[Jifty-commit] r4898 - in jifty/branches/jquery: . bin examples/Chat examples/Chat/lib/Chat examples/Chat/share examples/Chat/var examples/Clock/var examples/Doxory examples/HelloKitty examples/HelloKitty/var examples/MyWeblog/log examples/MyWeblog/var examples/ShrinkURL/var examples/Yada/inc inc/Module inc/Module/Install lib/Jifty lib/Jifty/Action/Record lib/Jifty/Filter lib/Jifty/Manual lib/Jifty/Model lib/Jifty/Plugin lib/Jifty/Plugin/Authentication/Password lib/Jifty/Plugin/Authentication/Password/Action lib/Jifty/Plugin/Authentication/Password/Mixin/Model lib/Jifty/Plugin/CompressedCSSandJS lib/Jifty/Plugin/OAuth lib/Jifty/Plugin/Quota lib/Jifty/Plugin/Quota/Model lib/Jifty/Plugin/REST lib/Jifty/Script lib/Jifty/Test/WWW lib/Jifty/View/Declare lib/Jifty/Web lib/Jifty/Web/Form lib/Jifty/Web/Session share/plugins/Jifty/Plugin/Chart/web/static/js share/plugins/Jifty/Plugin/JQuery share/web/static/css share/web/static/css/yui/calendar share/web/static/css/yui/menu share/web/static/css/yui/tabview share/web/static/images/yui/calendar share/web/static/images/yui/menu share/web/static/images/yui/tabview share/web/static/js share/web/static/js/yui t/TestApp-Plugin-JQuery t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth t/TestApp-Plugin-OAuth/t t/TestApp-Plugin-REST/t t/TestApp/lib/TestApp/Model t/TestApp/t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Jan 21 11:08:06 EST 2008


Author: gugod
Date: Mon Jan 21 11:08:06 2008
New Revision: 4898

Added:
   jifty/branches/jquery/bin/show_continuation   (contents, props changed)
   jifty/branches/jquery/examples/Chat/lib/Chat/View.pm
   jifty/branches/jquery/examples/MyWeblog/log/
   jifty/branches/jquery/lib/Jifty/Plugin/Quota/
   jifty/branches/jquery/lib/Jifty/Plugin/Quota.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Quota/Model/
   jifty/branches/jquery/lib/Jifty/Plugin/Quota/Model/Quota.pm
   jifty/branches/jquery/lib/Jifty/Script/Script.pm
   jifty/branches/jquery/lib/Jifty/Web/Session/ApacheSession.pm
   jifty/branches/jquery/share/web/static/css/yui/calendar/calendar-core.css
   jifty/branches/jquery/share/web/static/css/yui/menu/menu-core.css
   jifty/branches/jquery/share/web/static/css/yui/tabview/tabview-core.css
   jifty/branches/jquery/share/web/static/images/yui/calendar/
   jifty/branches/jquery/share/web/static/images/yui/calendar/calgrad.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/calendar/callt.gif   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/calendar/calrt.gif   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/calendar/calx.gif   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/
   jifty/branches/jquery/share/web/static/images/yui/menu/menu_down_arrow.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menu_down_arrow_disabled.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menu_down_arrow_selected.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menu_up_arrow.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menu_up_arrow_disabled.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menubaritem_submenuindicator.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menubaritem_submenuindicator_disabled.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menubaritem_submenuindicator_selected.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_checked.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_checked_disabled.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_checked_selected.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_submenuindicator.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_submenuindicator_disabled.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_submenuindicator_selected.png   (contents, props changed)
   jifty/branches/jquery/share/web/static/images/yui/tabview/
   jifty/branches/jquery/share/web/static/images/yui/tabview/loading.gif   (contents, props changed)
   jifty/branches/jquery/t/TestApp/lib/TestApp/Model/CanonTest.pm
Removed:
   jifty/branches/jquery/examples/Chat/share/
   jifty/branches/jquery/examples/Chat/var/
   jifty/branches/jquery/examples/Clock/var/
   jifty/branches/jquery/examples/Doxory/doxory
   jifty/branches/jquery/examples/Doxory/var/
   jifty/branches/jquery/examples/HelloKitty/hellokitty
   jifty/branches/jquery/examples/HelloKitty/var/
   jifty/branches/jquery/examples/MyWeblog/var/
   jifty/branches/jquery/examples/ShrinkURL/var/
   jifty/branches/jquery/examples/Yada/inc/
   jifty/branches/jquery/lib/Jifty/Plugin/JQuery.pm
   jifty/branches/jquery/share/plugins/Jifty/Plugin/JQuery/
   jifty/branches/jquery/share/web/static/css/yui/menu/map.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuarodwn8_dim_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuarodwn8_hov_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuarodwn8_nrm_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuarorght8_dim_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuarorght8_hov_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuarorght8_nrm_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuaroup8_dim_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuaroup8_nrm_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuchk8_dim_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuchk8_hov_1.gif
   jifty/branches/jquery/share/web/static/css/yui/menu/menuchk8_nrm_1.gif
   jifty/branches/jquery/share/web/static/css/yui/tabview/tabs.css
   jifty/branches/jquery/t/TestApp-Plugin-JQuery/
Modified:
   jifty/branches/jquery/   (props changed)
   jifty/branches/jquery/AUTHORS
   jifty/branches/jquery/MANIFEST
   jifty/branches/jquery/META.yml
   jifty/branches/jquery/Makefile.PL
   jifty/branches/jquery/examples/Chat/Makefile.PL
   jifty/branches/jquery/inc/Module/Install.pm
   jifty/branches/jquery/inc/Module/Install/AutoInstall.pm
   jifty/branches/jquery/inc/Module/Install/Base.pm
   jifty/branches/jquery/inc/Module/Install/Can.pm
   jifty/branches/jquery/inc/Module/Install/Fetch.pm
   jifty/branches/jquery/inc/Module/Install/Include.pm
   jifty/branches/jquery/inc/Module/Install/Makefile.pm
   jifty/branches/jquery/inc/Module/Install/Metadata.pm
   jifty/branches/jquery/inc/Module/Install/Scripts.pm
   jifty/branches/jquery/inc/Module/Install/Share.pm
   jifty/branches/jquery/inc/Module/Install/Win32.pm
   jifty/branches/jquery/inc/Module/Install/WriteAll.pm
   jifty/branches/jquery/lib/Jifty/Action.pm
   jifty/branches/jquery/lib/Jifty/Action/Record/Update.pm
   jifty/branches/jquery/lib/Jifty/ClassLoader.pm
   jifty/branches/jquery/lib/Jifty/Continuation.pm
   jifty/branches/jquery/lib/Jifty/DateTime.pm
   jifty/branches/jquery/lib/Jifty/Dispatcher.pm
   jifty/branches/jquery/lib/Jifty/Filter/DateTime.pm
   jifty/branches/jquery/lib/Jifty/Manual/Deploying.pod
   jifty/branches/jquery/lib/Jifty/Model/Metadata.pm
   jifty/branches/jquery/lib/Jifty/Model/Session.pm
   jifty/branches/jquery/lib/Jifty/Model/SessionCollection.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Action/GeneratePasswordToken.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Action/Login.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Mixin/Model/User.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/View.pm
   jifty/branches/jquery/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm
   jifty/branches/jquery/lib/Jifty/Plugin/Monitoring.pm
   jifty/branches/jquery/lib/Jifty/Plugin/OAuth/Dispatcher.pm
   jifty/branches/jquery/lib/Jifty/Plugin/REST.pm
   jifty/branches/jquery/lib/Jifty/Plugin/REST/Dispatcher.pm
   jifty/branches/jquery/lib/Jifty/Plugin/SinglePage.pm
   jifty/branches/jquery/lib/Jifty/Record.pm
   jifty/branches/jquery/lib/Jifty/Script.pm
   jifty/branches/jquery/lib/Jifty/Script/Schema.pm
   jifty/branches/jquery/lib/Jifty/Test.pm
   jifty/branches/jquery/lib/Jifty/Test/WWW/Declare.pm
   jifty/branches/jquery/lib/Jifty/Util.pm
   jifty/branches/jquery/lib/Jifty/View/Declare/CRUD.pm
   jifty/branches/jquery/lib/Jifty/Web.pm
   jifty/branches/jquery/lib/Jifty/Web/Form.pm
   jifty/branches/jquery/lib/Jifty/Web/Form/Clickable.pm
   jifty/branches/jquery/lib/Jifty/Web/Form/Field.pm
   jifty/branches/jquery/lib/Jifty/Web/Menu.pm
   jifty/branches/jquery/lib/Jifty/Web/PageRegion.pm
   jifty/branches/jquery/lib/Jifty/Web/Session.pm
   jifty/branches/jquery/lib/Jifty/Web/Session/ClientSide.pm
   jifty/branches/jquery/share/plugins/Jifty/Plugin/Chart/web/static/js/chart_img_behaviour.js
   jifty/branches/jquery/share/plugins/Jifty/Plugin/Chart/web/static/js/simple_bars.js
   jifty/branches/jquery/share/web/static/css/base.css
   jifty/branches/jquery/share/web/static/css/main.css
   jifty/branches/jquery/share/web/static/css/yui/calendar/calendar.css
   jifty/branches/jquery/share/web/static/css/yui/menu/menu.css
   jifty/branches/jquery/share/web/static/css/yui/tabview/border_tabs.css
   jifty/branches/jquery/share/web/static/css/yui/tabview/tabview.css
   jifty/branches/jquery/share/web/static/js/calendar.js
   jifty/branches/jquery/share/web/static/js/context_menu.js
   jifty/branches/jquery/share/web/static/js/jifty.js
   jifty/branches/jquery/share/web/static/js/prototype.js
   jifty/branches/jquery/share/web/static/js/yui/calendar.js
   jifty/branches/jquery/share/web/static/js/yui/container.js
   jifty/branches/jquery/share/web/static/js/yui/dom.js
   jifty/branches/jquery/share/web/static/js/yui/element-beta.js
   jifty/branches/jquery/share/web/static/js/yui/event.js
   jifty/branches/jquery/share/web/static/js/yui/menu.js
   jifty/branches/jquery/share/web/static/js/yui/oom_select.patch
   jifty/branches/jquery/share/web/static/js/yui/tabview.js
   jifty/branches/jquery/share/web/static/js/yui/yahoo.js
   jifty/branches/jquery/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/Test.pm
   jifty/branches/jquery/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/View.pm
   jifty/branches/jquery/t/TestApp-Plugin-OAuth/t/00-test-setup.t
   jifty/branches/jquery/t/TestApp-Plugin-OAuth/t/05-protected-resource.t
   jifty/branches/jquery/t/TestApp-Plugin-REST/t/02-basic-use.t
   jifty/branches/jquery/t/TestApp/t/06-validation.t
   jifty/branches/jquery/t/TestApp/t/14-template-paths.t   (contents, props changed)

Log:
- Merge /prj/mirror/jifty/trunk to /prj/mirror/jifty/branches/jquery

Modified: jifty/branches/jquery/AUTHORS
==============================================================================
--- jifty/branches/jquery/AUTHORS	(original)
+++ jifty/branches/jquery/AUTHORS	Mon Jan 21 11:08:06 2008
@@ -35,3 +35,4 @@
 Cornelius Lin <c9s at aiink.com>
 Todd Chapman <todd at chaka.net>
 Jason May <jason.a.may at gmail.com>
+Stanislav Sinyagin <ssinyagin at k-open.com>

Modified: jifty/branches/jquery/MANIFEST
==============================================================================
--- jifty/branches/jquery/MANIFEST	(original)
+++ jifty/branches/jquery/MANIFEST	Mon Jan 21 11:08:06 2008
@@ -369,6 +369,7 @@
 lib/Jifty/Web/Menu.pm
 lib/Jifty/Web/PageRegion.pm
 lib/Jifty/Web/Session.pm
+lib/Jifty/Web/Session/ApacheSession.pm
 lib/Jifty/Web/Session/ClientSide.pm
 lib/Jifty/Web/Session/None.pm
 lib/Jifty/YAML.pm

Modified: jifty/branches/jquery/META.yml
==============================================================================
--- jifty/branches/jquery/META.yml	(original)
+++ jifty/branches/jquery/META.yml	Mon Jan 21 11:08:06 2008
@@ -1,8 +1,9 @@
 --- 
+author: ~
 build_requires: 
   ExtUtils::MakeMaker: 6.11
 distribution_type: module
-generated_by: Module::Install version 0.67
+generated_by: Module::Install version 0.680
 license: Perl
 meta-spec: 
   url: http://module-build.sourceforge.net/META-spec-v1.3.html
@@ -29,9 +30,8 @@
   DBD::SQLite: 0
   Devel::Cover: 0
   Devel::EvalContext: 0
-  Devel::Events: 0.02
-  Devel::Events::Generator::Objects: 0
-  Devel::Events::Handler::ObjectTracker: 0
+  Devel::Events::Objects: 0.02
+  Devel::Gladiator: 0
   Devel::Size: 0
   Digest::HMAC_SHA1: 0
   GD: 0
@@ -42,10 +42,7 @@
   Module::Install::Admin: 0.50
   Module::Refresh: 0.09
   Net::LDAP: 0
-  Net::OAuth::AccessTokenRequest: 0
-  Net::OAuth::ProtectedResourceRequest: 0
   Net::OAuth::Request: 0.04
-  Net::OAuth::RequestTokenRequest: 0
   Net::OpenID::Consumer: 0
   Net::Server::Fork: 0
   Net::Server::PreFork: 0
@@ -82,14 +79,14 @@
   DateTime::Locale: 0
   Email::Folder: 0
   Email::LocalDelivery: 0.217
-  Email::MIME: 0
-  Email::MIME::ContentType: 0
+  Email::MIME: 1.861
+  Email::MIME::ContentType: 1.012
   Email::MIME::CreateHTML: 0
-  Email::MIME::Creator: 0
-  Email::MIME::Modifier: 0
-  Email::Send: 1.99_01
-  Email::Simple: 0
-  Email::Simple::Creator: 0
+  Email::MIME::Creator: 1.45
+  Email::MIME::Modifier: 1.442
+  Email::Send: 2.0
+  Email::Simple: 2.003
+  Email::Simple::Creator: 1.4
   Exporter::Lite: 0
   File::Find::Rule: 0
   File::MMagic: 0
@@ -125,7 +122,7 @@
   Params::Validate: 0
   Pod::Simple: 0
   SQL::ReservedWords: 0
-  Scalar::Defer: 0.10
+  Scalar::Defer: 0.12
   Shell::Command: 0
   String::Koremutake: 0
   Template::Declare: 0.26

Modified: jifty/branches/jquery/Makefile.PL
==============================================================================
--- jifty/branches/jquery/Makefile.PL	(original)
+++ jifty/branches/jquery/Makefile.PL	Mon Jan 21 11:08:06 2008
@@ -24,14 +24,14 @@
 requires('Date::Manip');
 requires('Email::Folder');
 requires('Email::LocalDelivery' => 0.217 );
-requires('Email::MIME');
-requires('Email::MIME::Creator');
-requires('Email::MIME::ContentType');
+requires('Email::MIME' => 1.861);
+requires('Email::MIME::Creator' => 1.450 );
+requires('Email::MIME::ContentType' => 1.012 );
 requires('Email::MIME::CreateHTML');
-requires('Email::MIME::Modifier');
-requires('Email::Send' => '1.99_01'); # Email::Send::Jifty::Test
-requires('Email::Simple');
-requires('Email::Simple::Creator');
+requires('Email::MIME::Modifier' => 1.442 );
+requires('Email::Send' => '2.0'); # Email::Send::Jifty::Test
+requires('Email::Simple' => 2.003);
+requires('Email::Simple::Creator' => 1.400 );
 requires('Exporter::Lite');
 requires('File::Find::Rule');
 requires('File::MMagic');
@@ -169,7 +169,7 @@
     ],
     'OAuth Plugin' => [
         -default => 0,
-        recommends('Net::OAuth::Request' => '0.04'), # Net::OAuth::RequestTokenRequest Net::OAuth::AccessTokenRequest Net::OAuth::ProtectedResourceRequest
+        recommends('Net::OAuth::Request' => '0.05'), # Net::OAuth::RequestTokenRequest Net::OAuth::AccessTokenRequest Net::OAuth::ProtectedResourceRequest
         recommends('Crypt::OpenSSL::RSA'),
         recommends('Digest::HMAC_SHA1'),
     ],

Added: jifty/branches/jquery/bin/show_continuation
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/bin/show_continuation	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,15 @@
+#!/usr/bin/env perl
+
+use Jifty::Everything;
+Jifty->new();
+
+my $id = shift @ARGV || die("Usage: $0 CONTINUATION_ID\n");
+
+my $session = Jifty::Model::SessionCollection->new(current_user => Jifty::CurrentUser->superuser);
+$session->limit(column => 'data_key', value => $id);
+
+while (my $item = $session->next) {
+    print scalar Jifty::YAML::Dump($item->value);
+}
+
+1;

Modified: jifty/branches/jquery/examples/Chat/Makefile.PL
==============================================================================
--- jifty/branches/jquery/examples/Chat/Makefile.PL	(original)
+++ jifty/branches/jquery/examples/Chat/Makefile.PL	Mon Jan 21 11:08:06 2008
@@ -1,5 +1,5 @@
 use inc::Module::Install;
-name('Clock');
+name('Chat');
 version('0.01');
 requires('Jifty' => '0.60912');
 

Added: jifty/branches/jquery/examples/Chat/lib/Chat/View.pm
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/examples/Chat/lib/Chat/View.pm	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,31 @@
+use warnings;
+use strict;
+
+package Chat::View;
+use Jifty::View::Declare -base;
+
+template 'index.html' => page { title => "Jifty chat server" } content {
+    Jifty->subs->add(
+        class       => 'Message',
+        mode        => 'Bottom',
+        region      => "message",
+        render_with => '/fragments/message'
+    );
+    render_region( name => "message", path => '/__jifty/empty' );
+    render_region( name => "sender",  path => '/fragments/sender' );
+};
+
+template 'fragments/message' => sub {
+    div { get('event')->data->{'message'} }
+};
+
+
+template 'fragments/sender' => sub {
+    my $action = Jifty->web->new_action( class => 'Send' );
+    form {
+        render_param ($action => 'message', focus => 1);
+        form_submit(onclick => [ { submit => $action }, { refresh_self => 1 } ]);
+    }
+};
+
+1;

Modified: jifty/branches/jquery/inc/Module/Install.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install.pm	Mon Jan 21 11:08:06 2008
@@ -28,7 +28,7 @@
     # This is not enforced yet, but will be some time in the next few
     # releases once we can make sure it won't clash with custom
     # Module::Install extensions.
-    $VERSION = '0.67';
+    $VERSION = '0.68';
 }
 
 # Whether or not inc::Module::Install is actually loaded, the

Modified: jifty/branches/jquery/inc/Module/Install/AutoInstall.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/AutoInstall.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/AutoInstall.pm	Mon Jan 21 11:08:06 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/inc/Module/Install/Base.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/Base.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/Base.pm	Mon Jan 21 11:08:06 2008
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.67';
+$VERSION = '0.68';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: jifty/branches/jquery/inc/Module/Install/Can.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/Can.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/Can.pm	Mon Jan 21 11:08:06 2008
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/inc/Module/Install/Fetch.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/Fetch.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/Fetch.pm	Mon Jan 21 11:08:06 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/inc/Module/Install/Include.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/Include.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/Include.pm	Mon Jan 21 11:08:06 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/inc/Module/Install/Makefile.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/Makefile.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/Makefile.pm	Mon Jan 21 11:08:06 2008
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/inc/Module/Install/Metadata.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/Metadata.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/Metadata.pm	Mon Jan 21 11:08:06 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/inc/Module/Install/Scripts.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/Scripts.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/Scripts.pm	Mon Jan 21 11:08:06 2008
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/inc/Module/Install/Share.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/Share.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/Share.pm	Mon Jan 21 11:08:06 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/inc/Module/Install/Win32.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/Win32.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/Win32.pm	Mon Jan 21 11:08:06 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/inc/Module/Install/WriteAll.pm
==============================================================================
--- jifty/branches/jquery/inc/Module/Install/WriteAll.pm	(original)
+++ jifty/branches/jquery/inc/Module/Install/WriteAll.pm	Mon Jan 21 11:08:06 2008
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.67';
+	$VERSION = '0.68';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: jifty/branches/jquery/lib/Jifty/Action.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Action.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Action.pm	Mon Jan 21 11:08:06 2008
@@ -647,17 +647,6 @@
         Jifty->web->form->print_action_registration($self->moniker);
     } 
     
-    # Not registered yet, so we need to place registration in the button itself
-    elsif ( not Jifty->web->form->printed_actions->{ $self->moniker } ) {
-
-        # Otherwise, if we're not registered yet, do it in the button
-        my $arguments = $self->arguments;
-        $args{parameters}{ $self->register_name } = ref $self;
-        $args{parameters}{ $self->fallback_form_field_name($_) }
-            = $self->argument_value($_) || $arguments->{$_}->{'default_value'}
-            for grep { $arguments->{$_}{constructor} } keys %{ $arguments };
-    }
-
     # Add whatever additional arguments they've requested to the button
     $args{parameters}{$self->form_field_name($_)} = $args{arguments}{$_}
       for keys %{$args{arguments}};

Modified: jifty/branches/jquery/lib/Jifty/Action/Record/Update.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Action/Record/Update.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Action/Record/Update.pm	Mon Jan 21 11:08:06 2008
@@ -124,16 +124,33 @@
             $value = scalar <$value>;
         }
 
-        # Skip fields that have not changed
-        my $old = $self->record->$field;
-        # XXX TODO: This ignore "by" on columns
-        $old = $old->id if blessed($old) and $old->isa( 'Jifty::Record' );
-
-        # ID is sometimes passed in, we want to ignore it if it doesn't change
-        next if $field eq 'id'
-           and defined $old
-           and defined $value
-           and "$old" eq "$value";
+        # Skip fields that have not changed, but only if we can read the field.
+        # This prevents us from getting an $old value that is wrongly undef
+        # when really we are just denied read access.  At the same time, it means
+        # we can keep the change checks before checking if we can update.
+        
+        if ( $self->record->current_user_can('read', column => $field) ) {
+            my $old = $self->record->$field;
+
+            # Handle columns which reference other tables
+            my $col = $self->record->column( $field );
+            my $by  = defined $col->by ? $col->by : 'id';
+            $old = $old->$by if blessed($old) and $old->isa( 'Jifty::Record' );
+
+            # ID is sometimes passed in, we want to ignore it if it doesn't change
+            next if $field eq 'id'
+               and defined $old
+               and defined $value
+               and "$old" eq "$value";
+
+            # if both the new and old values are defined and equal, we don't want to change em
+            # XXX TODO "$old" is a cheap hack to scalarize datetime objects
+            next if ( defined $old and defined $value and "$old" eq "$value" );
+
+            # If _both_ the values are ''
+            next if (  (not defined $old or not length $old)
+                        and ( not defined $value or not length $value ));
+        }
 
         # Error on columns we can't update
         # <Sartak> ah ha. I think I know why passing due => undef reports
@@ -155,14 +172,6 @@
             next;
         }
 
-        # if both the new and old values are defined and equal, we don't want to change em
-        # XXX TODO "$old" is a cheap hack to scalarize datetime objects
-        next if ( defined $old and defined $value and "$old" eq "$value" );
-
-        # If _both_ the values are ''
-        next if (  (not defined $old or not length $old)
-                    and ( not defined $value or not length $value ));
-
         # Calculate the name of the setter and set; asplode on failure
         my $setter = "set_$field";
         my ( $val, $msg ) = $self->record->$setter( $value );

Modified: jifty/branches/jquery/lib/Jifty/ClassLoader.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/ClassLoader.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/ClassLoader.pm	Mon Jan 21 11:08:06 2008
@@ -402,7 +402,7 @@
 
     require Jifty::Model::ModelClassCollection;
     require Jifty::Model::ModelClass;
-    my $models = Jifty::Model::ModelClassCollection->new(current_user => Jifty::CurrentUser->superuser);
+    my $models = Jifty::Model::ModelClassCollection->new(current_user => Jifty->app_class('CurrentUser')->superuser);
     $models->unlimit();
     while (my $model = $models->next) {
         $model->instantiate();

Modified: jifty/branches/jquery/lib/Jifty/Continuation.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Continuation.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Continuation.pm	Mon Jan 21 11:08:06 2008
@@ -253,7 +253,8 @@
     my $self = shift;
 
     # Remove all continuations that point to me
-    $_->delete for grep {$_->parent eq $self->id} values %{Jifty->web->session->continuations};
+    my %continuations = Jifty->web->session->continuations;
+    $_->delete for grep {$_->parent eq $self->id} values %continuations;
 
     # Finally, remove me from the list of continuations
     Jifty->web->session->remove_continuation($self->id);

Modified: jifty/branches/jquery/lib/Jifty/DateTime.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/DateTime.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/DateTime.pm	Mon Jan 21 11:08:06 2008
@@ -22,11 +22,15 @@
 
 =head1 DESCRIPTION
 
-Jifty natively stores timestamps in the database in GMT.  Dates are stored
-without timezone. This class loads and parses dates and sets them
-into the proper timezone.
-
-To use this DateTime class to it's fullest ability, you'll need to add a C<time_zone> method to your application's user object class. This is the class returned by L<Jifty::CurrentUser/user_object>. It must return a value valid for using as an argument to L<DateTime>'s C<set_time_zone()> method.
+Jifty natively stores timestamps in the database in GMT.  Dates are
+stored without timezone. This class loads and parses dates and sets
+them into the proper timezone.
+
+To use this DateTime class to it's fullest ability, you'll need to add
+a C<time_zone> method to your application's user object class. This is
+the class returned by L<Jifty::CurrentUser/user_object>. It must
+return a value valid for using as an argument to L<DateTime>'s
+C<set_time_zone()> method.
 
 =cut
 
@@ -53,6 +57,9 @@
 sub new {
     my $class = shift;
     my %args  = (@_);
+
+    my $replace_tz = delete $args{_replace_time_zone};
+
     my $self  = $class->SUPER::new(%args);
 
     # XXX What if they really mean midnight offset by time zone?
@@ -65,15 +72,16 @@
     # 00:00:00 implies that no time is used
     if ($self->hour || $self->minute || $self->second) {
 
-        # Unless the user has explicitly said they want a floating time,
+        # Unless the user has explicitly said they want a time zone,
         # we want to convert to the end-user's timezone. If we ignore
         # $args{time_zone}, then DateTime::from_epoch will get very confused
-        if (!$args{time_zone} and my $tz = $self->current_user_has_timezone) {
-
-            # XXX: we do this because of the floating timezone
-            $self->set_time_zone("UTC");
+        if (!$args{time_zone} || $replace_tz) {
+            if (my $tz = $self->current_user_has_timezone) {
+                # XXX: we do this because of the floating timezone
+                $self->set_time_zone("UTC");
 
-            $self->set_time_zone( $tz );
+                $self->set_time_zone( $tz );
+            }
         }
     }
 
@@ -126,24 +134,47 @@
     return $self;
 }
 
+=head2 current_user [CURRENTUSER]
+
+When setting the current user, update the timezone appropriately.
+
+=cut
+
+sub current_user {
+    my $self = shift;
+    return $self->SUPER::current_user unless @_;
+    my $ret = $self->SUPER::current_user(@_);
+    $self->set_current_user_timezone();
+    return $ret;
+}
+
 =head2 current_user_has_timezone
 
-Return timezone if the current user has one. This is determined by checking to see if the current user has a user object. If it has a user object, then it checks to see if that user object has a C<time_zone> method and uses that to determine the value.
+Return timezone if the current user has one. This is determined by
+checking to see if the current user has a user object. If it has a
+user object, then it checks to see if that user object has a
+C<time_zone> method and uses that to determine the value.
 
 =cut
 
 sub current_user_has_timezone {
     my $self = shift;
-    $self->_get_current_user();
+
+    # make this work as Jifty::DateTime->current_user_has_timezone
+    my $dt = ref($self) ? $self : $self->now;
+
+    $dt->_get_current_user();
 
     # Can't continue if we have no notion of a user_object
-    $self->current_user->can('user_object') or return;
+    $dt->current_user->can('user_object') or return;
 
     # Can't continue unless the user object is defined
-    my $user_obj = $self->current_user->user_object or return;
+    my $user_obj = $dt->current_user->user_object or return;
 
     # Check for a time_zone method and then use it if it exists
-    my $f = $user_obj->can('time_zone') or return;
+    my $f = $user_obj->can('time_zone') || $user_obj->can('timezone')
+        or return;
+
     return $f->($user_obj);
 }
 
@@ -171,14 +202,16 @@
 it in the floating timezone, otherwise, set it to the current user's
 timezone.
 
-As of this writing, this uses L<Date::Manip> along with some internal hacks to alter the way L<Date::Manip> normally interprets week day names. This may change in the future.
+As of this writing, this uses L<Date::Manip> along with some internal
+hacks to alter the way L<Date::Manip> normally interprets week day
+names. This may change in the future.
 
 =cut
 
 sub new_from_string {
     my $class  = shift;
     my $string = shift;
-    my $now;
+    my $epoch;
 
     # Hack to use Date::Manip to flexibly scan dates from strings
     {
@@ -189,23 +222,33 @@
         if($string =~ /^\s* (?:monday|tuesday|wednesday|thursday|friday|saturday|sunday)$/xi) {
             $string = "next $string";
         }
-        
-        # Why are we parsing this as GMT? This feels really wrong.  It will get the wrong answer
-        # if the current user is in another tz.
+
+        my $offset = $class->get_tz_offset;
+        my $dt_now = $class->now;
+        my $now = $dt_now->ymd . ' ' . $dt_now->hms;
+
         require Date::Manip;
-        Date::Manip::Date_Init("TZ=GMT");
-        $now = Date::Manip::UnixDate( $string, "%o" );
+
+        # TZ sets the timezone for parsing
+        # ConvTZ sets the output timezone
+        # ForceDate forces the current date to be now in the user's timezone,
+        #    if we don't set it then DM uses the machine's timezone
+        Date::Manip::Date_Init("TZ=$offset", "ConvTZ=+0000", "ForceDate=$now");
+        $epoch = Date::Manip::UnixDate( $string, "%o" );
     }
 
     # Stop here if Date::Manip couldn't figure it out
-    return undef unless $now;
+    return undef unless $epoch;
 
     # Build a DateTime object from the Date::Manip value and setup the TZ
-    my $self = $class->from_epoch( epoch => $now, time_zone => 'gmt' );
+    my $self = $class->from_epoch( epoch => $epoch, time_zone => 'GMT' );
     if (my $tz = $self->current_user_has_timezone) {
-        $self->set_time_zone("floating")
-            unless ( $self->hour or $self->minute or $self->second );
-        $self->set_time_zone( $tz );
+        if ($self->hour || $self->minute || $self->second) {
+            $self->set_time_zone( $tz );
+        }
+        else {
+            $self->set_time_zone("floating")
+        }
     }
 
     return $self;
@@ -268,6 +311,25 @@
     return 1;
 }
 
+=head2 get_tz_offset [DateTime] -> String
+
+Returns the offset for the current user's timezone. If there is no current
+user, or the current user's time zone is unset, then UTC will be used.
+
+The optional DateTime argument lets you calculate an offset for some time other
+than "right now".
+
+=cut
+
+sub get_tz_offset {
+    my $self = shift;
+    my $dt   = shift || DateTime->now();
+
+    $dt->set_time_zone( $self->current_user_has_timezone || 'UTC' );
+
+    return $dt->strftime("%z");
+}
+
 =head2 jifty_serialize_format
 
 This returns a DateTime (or string) consistent with Jifty's date format.
@@ -288,9 +350,14 @@
 
 =head1 WHY?
 
-There are other ways to do some of these things and some of the decisions here may seem arbitrary, particularly if you read the code. They are.
-
-These things are valuable to applications built by Best Practical Solutions, so it's here. If you disagree with the policy or need to do it differently, then you probably need to implement something yourself using a DateTime::Format::* class or your own code. 
+There are other ways to do some of these things and some of the
+decisions here may seem arbitrary, particularly if you read the
+code. They are.
+
+These things are valuable to applications built by Best Practical
+Solutions, so it's here. If you disagree with the policy or need to do
+it differently, then you probably need to implement something yourself
+using a DateTime::Format::* class or your own code.
 
 Parts may be cleaned up and the API cleared up a bit more in the future.
 

Modified: jifty/branches/jquery/lib/Jifty/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Dispatcher.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Dispatcher.pm	Mon Jan 21 11:08:06 2008
@@ -1040,7 +1040,7 @@
 
 Turns a metaexpression containing C<*>, C<?> and C<#> into a capturing regex pattern.
 
-Also supports the non-capturing C<[]>,and C<{}> notation.
+Also supports the non-capturing C<[]> and C<{}> notations.
 
 The rules are:
 

Modified: jifty/branches/jquery/lib/Jifty/Filter/DateTime.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Filter/DateTime.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Filter/DateTime.pm	Mon Jan 21 11:08:06 2008
@@ -53,13 +53,14 @@
 
     # XXX There has to be a better way to do this
     my %args;
-    for (qw(year month day hour minute second nanosecond formatter)) {
+    for (qw(year month day hour minute second nanosecond time_zone formatter)) {
         $args{$_} = $$value_ref->$_ if(defined($$value_ref->$_));
     }
 
-    # the floating timezone indicates a date, so we don't want to set any
-    # other timezone on it
-    $args{time_zone} = 'floating' if $$value_ref->time_zone =~ /floating/i;
+    # we want this DateTime's TZ to be in the current user's TZ, unless
+    # it represents a date
+    $args{_replace_time_zone} = 1
+        unless $args{time_zone} =~ /floating/i;
 
     my $dt = Jifty::DateTime->new(%args);
 

Modified: jifty/branches/jquery/lib/Jifty/Manual/Deploying.pod
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Manual/Deploying.pod	(original)
+++ jifty/branches/jquery/lib/Jifty/Manual/Deploying.pod	Mon Jan 21 11:08:06 2008
@@ -117,6 +117,8 @@
 
 After you've copied your application onto the server, change into that directory and make any changes to your configuration required for production.
 
+Put all your site-specific changes in F<etc/site_config.yml> and never edit F<etc/config.yml>, as it will be overwritten with the next application update.
+
 Here are some things you'll want to consider changing:
 
 =over
@@ -195,7 +197,7 @@
 
 If you've been developing your server using the default SQLite configuration, you will likely want to change this for your production server. SQLite might work for production environment, but chances are it will not.
 
-For your production system, you will probably want to modify the C<Driver> to suit your production environment. For example, if you were going to change to use a MySQL server, you might change your C<Database> configuration in F<etc/config.yml> to something like this:
+For your production system, you will probably want to modify the C<Driver> to suit your production environment. For example, if you were going to change to use a MySQL server, you might change your C<Database> configuration in F<etc/site_config.yml> to something like this:
 
   Database:
     Database: myapp
@@ -217,7 +219,7 @@
 
 =head3 Configure the Web Server
 
-There are two primary ways to configure your web server. You can use FastCGI or you can use a proxy to the Jifty simple server. You will most likely want to do the former, but the configuration for the latter is presented for completeness.
+There are several ways to configure your web server. You can use FastCGI or mod_perl or you can use a proxy to the Jifty simple server. The first two options are what you will most likely want to do, but the proxy configuration is presented for completeness.
 
 =head4 Configuring FastCGI
 
@@ -225,6 +227,10 @@
 
 It may take a few tries to get the configuration exactly right. Be sure to check the server logs for your web server when looking for problems.
 
+=head4 Configuring mod_perl
+
+Support for mod_perl version 2.0 is provided by L<Jifty::Script::ModPerl2>. Remember that you need to completely stop and start the Apache server after the Perl modules in your application are changed.
+
 =head4 Configuring a Proxy
 
 You can use a proxy with the built-in server. This can be done with the following configuration in Apache:
@@ -240,6 +246,17 @@
 
 Apache will proxy your server on port 80 for you. This may not work exactly as expected because the built-in server is intended for testing, not for a production environment. As such, it is not well-tested as a production server.
 
+=head3 Configure File Permissions
+
+The <var/> subdirectory in your application should be writable by the server process. If it runs as non-root UID (for example, FastCGI and Apache processes are usually running under the user named I<apache> or I<www> or something alike), you need to change the group or user permissions for this directory.
+
+For example, assume your application will run under user I<apache> and group I<apache>. Then the following commands should do the job:
+
+  chgrp -R apache var
+  chmod -R g+w var
+
+A more flexible way would be to create a new group I<myapp> and add I<apache> user in it. This allows you to maintain the application from non-root login and use C<sudo> for restarting Apache.
+
 =head3 All Systems Go
 
 Once you have done all of the above, your application should be ready to use at the production address you have configured.

Modified: jifty/branches/jquery/lib/Jifty/Model/Metadata.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Model/Metadata.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Model/Metadata.pm	Mon Jan 21 11:08:06 2008
@@ -57,7 +57,7 @@
 
 sub load {
     my $self = shift;
-    $self = $self->new( current_user => Jifty::CurrentUser->superuser )
+    $self = $self->new( current_user => Jifty->app_class('CurrentUser')->superuser )
         unless ref $self;
     return undef unless $self->_handle and $self->_handle->dbh->ping;
 
@@ -83,7 +83,7 @@
 
 sub store {
     my $self = shift;
-    $self = $self->new( current_user => Jifty::CurrentUser->superuser )
+    $self = $self->new( current_user => Jifty->app_class('CurrentUser')->superuser )
         unless ref $self;
 
     my ( $key, $value ) = @_;

Modified: jifty/branches/jquery/lib/Jifty/Model/Session.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Model/Session.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Model/Session.pm	Mon Jan 21 11:08:06 2008
@@ -58,7 +58,7 @@
 
 =cut
 
-sub current_user { return Jifty::CurrentUser->superuser }
+sub current_user { return Jifty->app_class('CurrentUser')->superuser }
 
 =head2 new_session_id
 

Modified: jifty/branches/jquery/lib/Jifty/Model/SessionCollection.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Model/SessionCollection.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Model/SessionCollection.pm	Mon Jan 21 11:08:06 2008
@@ -29,6 +29,6 @@
 
 =cut
 
-sub current_user { return Jifty::CurrentUser->superuser }
+sub current_user { return Jifty->app_class('CurrentUser')->superuser }
 
 1;

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Action/GeneratePasswordToken.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Action/GeneratePasswordToken.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Action/GeneratePasswordToken.pm	Mon Jan 21 11:08:06 2008
@@ -36,7 +36,7 @@
 
     my $email = $self->argument_value('email');
     my $class = Jifty->app_class('Model','User');
-    my $user = $class->new(current_user => Jifty::CurrentUser->superuser);
+    my $user = $class->new(current_user => Jifty->app_class('CurrentUser')->superuser);
     $user->load_by_cols(email => $email);
     unless($user->id) {
         $self->result->error('No such user');

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Action/Login.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Action/Login.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Action/Login.pm	Mon Jan 21 11:08:06 2008
@@ -58,8 +58,7 @@
     my $self  = shift;
     my $email = shift;
 
-    my $u = Jifty->app_class('Model', 'User')->new(current_user => Jifty->app_class('CurrentUser')->superuser);
-    $u->load_by_cols( email => $email );
+    my $u = $self->load_user($email);
     return $self->validation_error(email => _("It doesn't look like there's an account by that name.")) unless ($u->id);
 
     return $self->validation_ok('email');
@@ -131,25 +130,23 @@
 
 sub take_action {
     my $self = shift;
-    my $user = Jifty->app_class('Model', 'User')->new(current_user => Jifty->app_class('CurrentUser')->superuser);
-    $user->load_by_cols( email => $self->argument_value('email') );
-
-
+    my $user = $self->load_user( $self->argument_value('email') );
     my $password = $self->argument_value('password');
     my $token    = $self->argument_value('token') || '';
     my $hashedpw = $self->argument_value('hashed_password');
 
+           my $BAD_PW =  _('You may have mistyped your email or password. Give it another shot.');
 
     if ( $token ne '' ) {   # browser supports javascript, do password hashing
         unless ( $user->id && $user->hashed_password_is( $hashedpw, $token ) )
         {
-            $self->result->error( _('You may have mistyped your email or password. Give it another shot.'));
+            $self->result->error($BAD_PW);
             return;
         }
         Jifty->web->session->set( login_token => '' );
     } else {                # no password hashing over the wire
         unless ( $user->id && $user->password_is($password) ) {
-            $self->result->error( _('You may have mistyped your email or password. Give it another shot.'));
+            $self->result->error($BAD_PW);
             return;
         }
     }
@@ -169,6 +166,21 @@
     return 1;
 }
 
+=head2 load_user
+
+Load up and return a YourApp::User object for the user trying to log in
+
+=cut
+
+sub load_user {
+    my $self = shift;
+    my $username = shift;
+    my $user = Jifty->app_class('Model', 'User')->new(current_user => Jifty->app_class('CurrentUser')->superuser);
+    $user->load_by_cols( email => $username);
+    return $user
+
+}
+
 =head2 login_message $user_object
 
 Returns the "hi, you're logged in message"

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Dispatcher.pm	Mon Jan 21 11:08:06 2008
@@ -46,7 +46,7 @@
 
 };
 
-=head2 on qr/^(?:passwordreminder|signup|lost_password)$/ 
+=head2 on qr/^(?:signup|lost_password)$/ 
 
 Redirect to home if logged.
 
@@ -54,7 +54,7 @@
 
 =cut
 
-before qr'^/(?:passwordreminder|signup|lost_password)$' => run {
+before qr'^/(?:signup|lost_password)$' => run {
     redirect('/') if ( Jifty->web->current_user->id );
     set 'next' => Jifty->web->request->continuation || Jifty::Continuation->new( request => Jifty::Request->new( path => "/login" ) );
 };

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Mixin/Model/User.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Mixin/Model/User.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/Mixin/Model/User.pm	Mon Jan 21 11:08:06 2008
@@ -49,6 +49,7 @@
 column auth_token =>
   render_as 'unrendered',
   type is 'varchar(255)',
+  max_length is 255,
   default is '',
   label is _('Authentication token');
     
@@ -57,7 +58,9 @@
 column password =>
   is unreadable,
   label is _('Password'),
-  type is 'varchar(255)',
+  type is 'varchar(64)',
+  max_length is 64,
+  lenght is 16,
   hints is _('Your password should be at least six characters'),
   render_as 'password',
   filters are 'Jifty::DBI::Filter::SaltHash';
@@ -132,7 +135,7 @@
     return 1 if $self->has_alternative_auth();
 
     return ( 0, _('Passwords need to be at least six characters long') )
-        if length($new_value) < 6;
+        if  length($new_value) && length($new_value) < 6;
 
     return 1;
 }

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/View.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/View.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Authentication/Password/View.pm	Mon Jan 21 11:08:06 2008
@@ -105,10 +105,11 @@
 
 =cut
 
-template 'let/reset_lost_password' => page { title => 'Reset lost password' } content {
+template 'let/reset_lost_password' => page { title => _('Reset lost password') } content {
     my ( $next ) = get(qw(next));
     my $action = Jifty->web->new_action( class => 'ResetLostPassword' );
 
+    h1 { {class is 'title'};  _('Reset lost password')};
     Jifty->web->form->start( call => $next );
         render_param( $action => $_ ) for ( $action->argument_names );
         form_return( label => _("New password"), submit => $action );
@@ -143,6 +144,7 @@
         class   => 'SendPasswordReminder',
     );
 
+    h1 { {class is 'title'};  _('Send a link to reset your password')};
     outs( _(  "You lost your password. A link to reset it will be sent to the following email address:"));
     my $focused = 0;
     Jifty->web->form->start( call => $next );
@@ -152,35 +154,6 @@
 
 };
 
-=head2 passwordreminder
-
-Starts the process of sending a link to reset a lost password by email.
-
-See L<Jifty::Plugin::Authentication::Password::SendPasswordReminder>.
-
-=begin comment
-
-What's the difference between lost_password and passwordreminder? -- Sterling
-
-=end comment
-
-=cut
-
-template 'passwordreminder' => page { title => 'Send a password reminder' } content {
-    my $next = get('next');
-    my $action = Jifty->web->new_action(
-        moniker => 'password_reminder',
-        class   => 'SendPasswordReminder',
-    );
-    h2 { _('Send a password reminder') };
-    p  { _(  "You lost your password. A reminder will be send to the following mail:") };
-
-    Jifty->web->form->start( call => $next );
-        render_param( $action => $_ ) for ( $action->argument_names );
-        form_return( label => _("Send"), submit => $action);
-    Jifty->web->form->end();
-};
-
 =head2 resend_confirmation
 
 Request a new email confirmation message be sent to your email account.

Modified: jifty/branches/jquery/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/CompressedCSSandJS/Dispatcher.pm	Mon Jan 21 11:08:06 2008
@@ -41,8 +41,11 @@
         return;
     }
 
+
     Jifty->handler->apache->content_type("application/x-javascript");
-    Jifty->handler->apache->header_out( 'Expires' => HTTP::Date::time2str( time + 31536000 ) );
+    Jifty->handler->apache->header_out( 'Cache-Control' => 'max-age=259200, public' );
+    Jifty->handler->apache->header_out( Expires => HTTP::Date::time2str( time() + 31536000 ) ) ;    # Expire in a year
+    Jifty->handler->apache->header_out( 'Last-Modified' => HTTP::Date::time2str($^T) );
 
     # XXX TODO: If we start caching the squished JS in a file somewhere, we
     # can have the static handler serve it, which would take care of gzipping
@@ -83,7 +86,9 @@
     }
 
     Jifty->handler->apache->content_type("text/css");
-    Jifty->handler->apache->header_out( 'Expires' => HTTP::Date::time2str( time + 31536000 ) );
+    Jifty->handler->apache->header_out( 'Cache-Control' => 'max-age=259200, public' );
+    Jifty->handler->apache->header_out( Expires => HTTP::Date::time2str( time() + 31536000 ) ) ;    # Expire in a year
+    Jifty->handler->apache->header_out( 'Last-Modified' => HTTP::Date::time2str($^T) );
 
     # XXX TODO: If we start caching the squished CSS in a file somewhere, we
     # can have the static handler serve it, which would take care of gzipping

Modified: jifty/branches/jquery/lib/Jifty/Plugin/Monitoring.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/Monitoring.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Monitoring.pm	Mon Jan 21 11:08:06 2008
@@ -194,7 +194,7 @@
     my @path = $args{path} ? @{$args{path}} : (Jifty->app_class("Monitor"));
     $self->base_classes(\@path);
     $self->monitors({});
-    $self->lockfile($args{lockfile} || "var/monitoring.pid");
+    $self->lockfile($args{lockfile} || Jifty::Util->absolute_path("var/monitoring.pid"));
     local $Jifty::Plugin::Monitoring::self = $self;
     Jifty::Module::Pluggable->import(
         require => 1,
@@ -303,7 +303,10 @@
 sub lock {
     my $self = shift;
     return if -e $self->lockfile;
-    open PID, ">", $self->lockfile;
+    unless (open PID, ">", $self->lockfile) {
+        warn "Can't open lockfile @{[$self->lockfile]}: $!";
+        return 0;
+    }
     print PID $$;
     close PID;
     $self->has_lock(1);

Modified: jifty/branches/jquery/lib/Jifty/Plugin/OAuth/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/OAuth/Dispatcher.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/OAuth/Dispatcher.pm	Mon Jan 21 11:08:06 2008
@@ -250,7 +250,7 @@
     abortmsg(undef, "Invalid signature (type: $oauth_params{signature_method})."), return unless $request->verify;
 
     $consumer->made_request(@oauth_params{qw/timestamp nonce/});
-    Jifty->web->current_user(Jifty->app_class('CurrentUser')->new(id => $access_token->auth_as));
+    Jifty->web->temporary_current_user(Jifty->app_class('CurrentUser')->new(id => $access_token->auth_as));
 }
 
 =head2 get_consumer CONSUMER KEY

Added: jifty/branches/jquery/lib/Jifty/Plugin/Quota.pm
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Quota.pm	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,65 @@
+use strict;
+use warnings;
+
+package Jifty::Plugin::Quota;
+
+use base qw/Jifty::Plugin/;
+
+=head1 NAME
+
+Jifty::Plugin::Quota - Provides a framework for generic quota management
+of Jifty model objects
+
+=head1 SYNOPSIS
+
+In your F<config.yml>:
+
+  Plugins:
+    - Quota:
+        disk:
+          User: 5242880   # bytes (5MB)
+          Group: 10485760
+
+By inserting hooks and checks into an app (actions and models, most
+likely), quotas can be updated and enforced.  It is up to the developer to
+do this though; this plugin just provides a ready-made framework.
+
+The configuration provides defaults for quota creation.  It is structured
+by I<type> and then I<object_class>.  In the example above, the default disk
+space quotas for User and Group model objects are set.  When a new quota is
+created and a I<cap> is not specified, the plugin will look up the default
+in the config.
+
+=head1 METHODS
+
+=head2 config
+
+=cut
+
+__PACKAGE__->mk_accessors(qw(config));
+
+=head2 init
+
+=cut
+
+sub init {
+    my $self = shift;
+    my %opt  = @_;
+    $self->config( \%opt );
+}
+
+=head2 default_cap TYPE CLASS
+
+Returns the default cap (if there is one) as specified by the config for
+the given TYPE and CLASS.  Returns undef otherwise.
+
+=cut
+
+sub default_cap {
+    my $self  = shift;
+    my $type  = shift;
+    my $class = shift;
+    return $self->config->{$type}{$class};
+}
+
+1;

Added: jifty/branches/jquery/lib/Jifty/Plugin/Quota/Model/Quota.pm
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/lib/Jifty/Plugin/Quota/Model/Quota.pm	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,193 @@
+use strict;
+use warnings;
+
+=head1 NAME
+
+BTDT::Model::Quota
+
+=head1 DESCRIPTION
+
+Generic quotas for Jifty model objects.
+
+=cut
+
+package Jifty::Plugin::Quota::Model::Quota;
+use Jifty::DBI::Schema;
+
+use Jifty::Record schema {
+    column object_id =>
+        type is 'integer',
+        is mandatory;
+    
+    column object_class =>
+        type is 'text',
+        is mandatory;
+
+    column type =>
+        type is 'text',
+        is mandatory,
+        label is 'Type';
+
+    column cap =>
+        type is 'integer',
+        is mandatory,
+        label is 'Cap (limit)';
+
+    column usage =>
+        type is 'integer',
+        is mandatory,
+        default is 0,
+        label is 'Usage';
+};
+
+=head2 create PARAMHASH
+
+=cut
+
+sub create {
+    my $self = shift;
+    my %args = @_;
+
+    if ( not defined $args{cap} ) {
+        my $plugin = Jifty->find_plugin('Jifty::Plugin::Quota');
+        $args{cap} = $plugin->default_cap( $args{type}, $args{object_class} );
+    }
+
+    $args{usage} = 0
+        if not defined $args{usage};
+
+    # XXX TODO: This should be in the schema, but we can't do that at the moment
+    my $check = Jifty::Plugin::Quota::Model::Quota->new( current_user => Jifty->app_class('CurrentUser')->superuser );
+    $check->load_by_cols(
+        object_id    => $args{object_id},
+        object_class => $args{object_class},
+        type         => $args{type}
+    );
+    return ( undef, "Already a quota for that object." ) if $check->id;
+
+    return $self->SUPER::create( %args );
+}
+
+=head2 create_from_object OBJECT [PARAMHASH]
+
+Conveniently creates a quota record using a model OBJECT and an optional
+extra paramhash.
+
+=cut
+
+sub create_from_object {
+    my $self    = shift;
+    my $object  = shift;
+    return $self->create( ($self->_object_attrs($object)), @_ );
+}
+
+=head2 load_by_object OBJECT [PARAMHASH]
+
+Conveniently loads a quota record using a model OBJECT and an optional
+extra paramhash.
+
+=cut
+
+sub load_by_object {
+    my $self    = shift;
+    my $object  = shift;
+    return $self->load_by_cols( ($self->_object_attrs($object)), @_ );
+}
+
+sub _object_attrs {
+    my $self   = shift;
+    my $object = shift;
+    my $class  = ref $object;
+    $class =~ s/^.+::(\w+)$/$1/;
+    return ( object_id => $object->id, object_class => $class );
+}
+
+=head2 object
+
+Returns the object regulated by this quota.
+
+=cut
+
+sub object {
+    my $self   = shift;
+    my $class  = Jifty->app_class( 'Model', $self->__value('object_class') );
+    my $object = $class->new( current_user => $self->current_user );
+    $object->load( $self->__value('object_id') );
+    return $object;
+}
+
+=head2 usage_ok INTEGER
+
+Checks if adding INTEGER to the current I<usage> will exceed I<cap>.
+
+Returns true or false.
+
+=cut
+
+sub usage_ok {
+    my $self = shift;
+    my $more = shift;
+    return (($self->__value('usage') + $more) <= $self->__value('cap')) ? 1 : 0;
+}
+
+=head2 add_usage INTEGER
+
+Adds INTEGER to I<usage> if there is enough quota left.
+
+Returns true on success, false on failure.
+
+=cut
+
+sub add_usage {
+    my $self  = shift;
+    my $usage = shift;
+    
+    $usage =~ s/\D//g;
+
+    if ( $self->usage_ok( $usage ) ) {
+        $self->__set(
+            column => 'usage',
+            value  => 'usage + '.$usage,
+            is_sql_function => 1
+        );
+        return 1;
+    }
+    return 0;
+}
+
+=head2 subtract_usage INTEGER
+
+Subtracts INTEGER from I<usage>.
+
+=cut
+
+sub subtract_usage {
+    my $self  = shift;
+    my $usage = shift;
+    
+    $usage =~ s/\D//g;
+
+    $self->__set(
+        column => 'usage',
+        value  => 'usage - '.$usage,
+        is_sql_function => 1
+    );
+}
+
+=head2 current_user_can
+
+If current user can read the referenced object, then they can read the quotas.
+No one can created, update, or delete quotas unless they are a superuser.
+
+=cut
+
+sub current_user_can {
+    my $self   = shift;
+    my $right  = shift;
+    return 1 if $right eq 'read' and $self->object->current_user_can( $right );
+    return 1 if $self->current_user->is_superuser;
+    return $self->SUPER::current_user_can( $right, @_ );
+}
+
+1;
+

Modified: jifty/branches/jquery/lib/Jifty/Plugin/REST.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/REST.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/REST.pm	Mon Jan 21 11:08:06 2008
@@ -4,7 +4,7 @@
 package Jifty::Plugin::REST;
 use base qw/Jifty::Plugin/;
 
-our $VERSION = 0.01;
+our $VERSION = '1.00';
 
 =head1 NAME
 

Modified: jifty/branches/jquery/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/REST/Dispatcher.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/REST/Dispatcher.pm	Mon Jan 21 11:08:06 2008
@@ -42,6 +42,9 @@
 on POST   '/=/action/*'         => \&run_action;
 
 on GET    '/=/help'             => \&show_help;
+on GET    '/=/help/*'           => \&show_help_specific;
+
+on GET    '/=/version'          => \&show_version;
 
 =head2 show_help
 
@@ -75,6 +78,10 @@
 on GET    /=/action/<action>                         list action params
 on POST   /=/action/<action>                         run action
 
+on GET    /=/help                                    this help page
+on GET    /=/help/search                             help for /=/search
+
+on GET    /=/version                                 version information
 
 Resources are available in a variety of formats:
 
@@ -91,6 +98,79 @@
     last_rule;
 }
 
+=head2 show_help_specific
+
+Displays a help page about a specific topic. Will look for a method named
+C<show_help_specific_$1>.
+
+=cut
+
+sub show_help_specific {
+    my $topic = $1;
+    my $method = "show_help_specific_$topic";
+    __PACKAGE__->can($method) or abort(404);
+
+    my $apache = Jifty->handler->apache;
+
+    $apache->header_out('Content-Type' => 'text/plain; charset=UTF-8');
+    $apache->send_http_header;
+
+    print __PACKAGE__->$method;
+    last_rule;
+}
+
+=head2 show_help_specific_search
+
+Explains /=/search/ a bit more in-depth.
+
+=cut
+
+sub show_help_specific_search {
+    return << 'SEARCH';
+This interface supports searching arbitrary columns and values. For example, if
+you're looking at a Task with due date 1999-12-25 and complete, you can use:
+
+    /=/search/Task/due/1999-12-25/complete/1
+
+If you're looking for just the summaries of these tasks, you can use:
+
+    /=/search/Task/due/1999-12-25/complete/1/summary
+
+Any column in the model is eligible for searching. If you specify multiple
+values for the same column, they'll be ORed together. For example, if you're
+looking for Tasks with due dates 1999-12-25 OR 2000-12-25, you can use:
+
+    /=/search/Task/due/1999-12-25/due/2000-12-25/
+
+There are also some pseudo-columns that affect the results, but are not columns
+that are searched:
+
+    .../__order_by/<column>
+    .../__order_by_asc/<column>
+    .../__order_by_desc/<column>
+
+These let you change the output order of the results. Multiple '__order_by's
+will be respected.
+
+    .../__page/<number>
+    .../__per_page/<number>
+
+These let you control how many results you'll get.
+SEARCH
+}
+
+=head2 show_version
+
+Displays versions of the various bits of your application.
+
+=cut
+
+sub show_version {
+    outs(['version'], {
+        Jifty => $Jifty::VERSION,
+        REST  => $Jifty::Plugin::REST::VERSION,
+    });
+}
 
 =head2 list PREFIX items
 
@@ -135,16 +215,11 @@
     elsif ($accept =~ /json/i) {
         $apache->header_out('Content-Type' => 'application/json; charset=UTF-8');
         $apache->send_http_header;
-        print Jifty::JSON::objToJson( @_, { singlequote => 1 } );
+        print Jifty::JSON::objToJson( @_ );
     }
     elsif ($accept =~ /j(?:ava)?s|ecmascript/i) {
         $apache->header_out('Content-Type' => 'application/javascript; charset=UTF-8');
         $apache->send_http_header;
-	# XXX: temporary hack to fix _() that aren't respected by json dumper
-	for (values %{$_[0]}) {
-	    $_->{label} = "$_->{label}" if exists $_->{label} && defined ref $_->{label};
-	    $_->{hints} = "$_->{hints}" if exists $_->{hints} && defined ref $_->{hints};
-	}
         print 'var $_ = ', Jifty::JSON::objToJson( @_, { singlequote => 1 } );
     }
     elsif ($accept =~ qr{^(?:application/x-)?(?:perl|pl)$}i) {
@@ -436,9 +511,7 @@
     my $rec = $model->new;
     $rec->load_by_cols( $column => $key );
     $rec->id or abort(404);
-    outs( ['model', $model, $column, $key], 
-        { map { $_ => Jifty::Util->stringify($rec->$_()) }
-              map {$_->name} $rec->columns});
+    outs( ['model', $model, $column, $key], $rec->jifty_serialize_format );
 }
 
 =head2 search_items $model, [c1, v1, c2, v2, ...] [, $field]
@@ -449,12 +522,34 @@
 
 Will throw a 404 if there were no matches, or C<$field> was invalid.
 
+Pseudo-columns:
+
+=over 4
+
+=item __per_page => N
+
+Return the collection as N records per page.
+
+=item __page => N
+
+Return page N of the collection
+
+=item __order_by => C<column>
+
+Order by the given column, ascending.
+
+=item __order_by_desc => C<column>
+
+Order by the given column, descending.
+
+=back
+
 =cut
 
 sub search_items {
     my ($model, $fragment) = (model($1), $2);
     my @pieces = grep {length} split '/', $fragment;
-    my @orig = @pieces;
+    my $ret = ['search', $model, @pieces];
 
     # if they provided an odd number of pieces, the last is the output column
     my $field;
@@ -465,24 +560,98 @@
     # limit to the key => value pairs they gave us
     my $collection = eval { $model->collection_class->new }
         or abort(404);
+    $collection->unlimit;
 
-    # no pieces? they must be asking for everything
-    if (!@pieces) {
-        $collection->unlimit;
-    }
+    my $record = $model->new
+        or abort(404);
+
+    my $added_order = 0;
+    my $per_page;
+    my $current_page = 1;
+
+    my %special = (
+        __per_page => sub {
+            my $N = shift;
+
+            # must be a number
+            $N =~ /^\d+$/
+                or abort(404);
+
+            $per_page = $N;
+        },
+        __page => sub {
+            my $N = shift;
+
+            # must be a number
+            $N =~ /^\d+$/
+                or abort(404);
+
+            $current_page = $N;
+        },
+        __order_by => sub {
+            my $col = shift;
+            my $order = shift || 'ASC';
+
+            # this will wipe out the default ordering on your model the first
+            # time around
+            if ($added_order) {
+                $collection->add_order_by(
+                    column => $col,
+                    order  => $order,
+                );
+            }
+            else {
+                $added_order = 1;
+                $collection->order_by(
+                    column => $col,
+                    order  => $order,
+                );
+            }
+        },
+    );
+
+    # this was called __limit before it was generalized
+    $special{__limit} = $special{__per_page};
+
+    # /__order_by/name/desc is impossible to distinguish between ordering by
+    # 'name', descending, and ordering by 'name', with output column 'desc'.
+    # so we use __order_by_desc instead (and __order_by_asc is provided for
+    # consistency)
+    $special{__order_by_asc}  = $special{__order_by};
+    $special{__order_by_desc} = sub { $special{__order_by}->($_[0], 'DESC') };
 
     while (@pieces) {
         my $column = shift @pieces;
         my $value  = shift @pieces;
 
-        $collection->limit(column => $column, value => $value);
+        if (exists $special{$column}) {
+            $special{$column}->($value);
+        }
+        else {
+            my $canonicalizer = "canonicalize_$column";
+            $value = $record->$canonicalizer($value)
+                if $record->can($canonicalizer);
+
+            $collection->limit(column => $column, value => $value);
+        }
     }
 
-    $collection->count or abort(404);
+    if (defined($per_page) || defined($current_page)) {
+        $per_page = 15 unless defined $per_page;
+        $current_page = 1 unless defined $current_page;
+        $collection->set_page_info(
+            current_page => $current_page,
+            per_page     => $per_page,
+        );
+    }
+
+    $collection->count                       or return outs($ret, []);
+    $collection->pager->entries_on_this_page or return outs($ret, []);
 
     # output
     if (defined $field) {
-        my $item = $collection->first;
+        my $item = $collection->first
+            or return outs($ret, []);
 
         # make sure $field exists and is a real column
         $item->can($field)    or abort(404);
@@ -495,16 +664,10 @@
             push @values, $item->$field;
         } while $item = $collection->next;
 
-        outs(
-            ['search', $model, @orig],
-            \@values,
-        );
+        outs($ret, \@values);
     }
     else {
-        outs(
-            ['search', $model, @orig],
-            $collection->jifty_serialize_format,
-        );
+        outs($ret, $collection->jifty_serialize_format);
     }
 }
 

Modified: jifty/branches/jquery/lib/Jifty/Plugin/SinglePage.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Plugin/SinglePage.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Plugin/SinglePage.pm	Mon Jan 21 11:08:06 2008
@@ -54,6 +54,7 @@
 sub _sp_link {
     my $self = shift;
     return sub {
+        return if Jifty->web->temporary_current_user;
         my ( $clickable, $args ) = @_;
         my $url = $args->{'url'};
         if ( $url && $url !~ m/^#/ && $url !~ m{^https?://} && $url !~ m{^javascript:} ) {

Modified: jifty/branches/jquery/lib/Jifty/Record.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Record.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Record.pm	Mon Jan 21 11:08:06 2008
@@ -435,11 +435,13 @@
         # Otherwise, no instruction from the handlers, move along...
     }
 
-    # Abort! Return false for safety
+    # Abort! Return false for safety if the hook exploded
     else {
         return 0;
     }
 
+
+    Carp::confess unless ( $self->current_user );
     if (   $self->current_user->is_bootstrap_user
         or $self->current_user->is_superuser )
     {

Modified: jifty/branches/jquery/lib/Jifty/Script.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Script.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Script.pm	Mon Jan 21 11:08:06 2008
@@ -26,7 +26,7 @@
 
 sub prepare {
     my $self = shift;
-    if ($ARGV[0] =~ /--?h(elp?)/i) {
+    if ($ARGV[0] =~ /--?h(elp)?/i) {
         $ARGV[0] = 'help';
     }
     elsif (!@ARGV) {

Modified: jifty/branches/jquery/lib/Jifty/Script/Schema.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Script/Schema.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Script/Schema.pm	Mon Jan 21 11:08:06 2008
@@ -63,9 +63,8 @@
 sub run_upgrades {
     my $self = shift;
     $self->upgrade_jifty_tables();
-    $self->upgrade_application_tables();
     $self->upgrade_plugin_tables();
-
+    $self->upgrade_application_tables();
 }
 
 =head2 setup_environment

Added: jifty/branches/jquery/lib/Jifty/Script/Script.pm
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/lib/Jifty/Script/Script.pm	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,104 @@
+use warnings;
+use strict;
+
+package Jifty::Script::Script;
+use base qw/ App::CLI::Command /;
+
+=head1 NAME
+
+Jifty::Script::Script - Add a new Jifty script to your Jifty application
+
+=head1 DESCRIPTION
+
+This creates a skeleton of a new script file for your Jifty application. Often it such a script is needed for cron jobs, annual maintenance work, and any other server-side activity that would benefit from a command-line script.
+
+=head1 API
+
+=head2 options
+
+=over
+
+=item --name NAME (required)
+
+Name of the script to create.
+
+=item --force
+
+By default, this will stop and warn you if any of the files it is going to write already exist. Passing the --force flag will make it overwrite the files.
+
+=back
+
+=cut
+
+sub options {
+    (
+        'n|name=s' => 'name',
+        'force'    => 'force',
+    )
+}
+
+=head2 run
+
+Creates a skeleton file under C<bin/I<script>>.
+
+TODO Should this create skeleton test files too?
+
+=cut
+
+sub run {
+    my $self = shift;
+
+    my $script = $self->{name};
+    die "You need to give your new script a --name\n"
+        unless defined $script;
+
+    Jifty->new( no_handle => 1 );
+    my $root = Jifty::Util->app_root;
+
+    my $script_file = <<"END_OF_SCRIPT";
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use Jifty;
+BEGIN { Jifty->new }
+
+# Your script-specific code goes here.
+
+END_OF_SCRIPT
+
+    $self->_write("$root/bin/$script" => $script_file);
+}
+
+# TODO This should be moved to Jifty::Util or somewhere else so all these
+# scripts don't duplicate it!
+sub _write {
+    my $self = shift;
+    my %files = (@_);
+    my $halt;
+    for my $path (keys %files) {
+        my ($volume, $dir, $file) = File::Spec->splitpath($path);
+
+        # Make sure the directories we need are there
+        Jifty::Util->make_path($dir);
+
+        # If it already exists, bail
+        if (-e $path and not $self->{force}) {
+            print "File $path exists already; Use --force to overwrite\n";
+            $halt = 11;
+        }
+    }
+    exit if $halt;
+
+    # Now that we've san-checked everything, we can write the files
+    for my $path (keys %files) {
+        print "Writing file $path\n";
+        # Actually write the file out
+        open(FILE, ">$path")
+          or die "Can't write to $path: $!";
+        print FILE $files{$path};
+        close FILE;
+    }
+}
+
+1;

Modified: jifty/branches/jquery/lib/Jifty/Test.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Test.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Test.pm	Mon Jan 21 11:08:06 2008
@@ -4,9 +4,7 @@
 package Jifty::Test;
 use base qw/Test::More/;
 
-use Jifty::YAML;
-use Jifty::Server;
-use Jifty::Script::Schema;
+use Jifty::Util;
 use Email::LocalDelivery;
 use Email::Folder;
 use File::Path;
@@ -119,8 +117,16 @@
 sub import_extra {
     my $class = shift;
     my $args  = shift;
+
     $class->setup($args);
     Test::More->export_to_level(2);
+
+    # Now, clobber Test::Builder::plan (if we got given a plan) so we
+    # don't try to spit one out *again* later
+    if ($class->builder->has_plan) {
+        no warnings 'redefine';
+        *Test::Builder::plan = sub {};
+    }
 }
 
 =head2 setup ARGS
@@ -161,6 +167,17 @@
 
 sub setup {
     my $class = shift;
+    my $args = shift;
+
+    # Spit out a plan (if we got one) *before* we load modules, in
+    # case of compilation errors
+    $class->builder->plan(@{$args})
+      unless $class->builder->has_plan;
+
+    # Require the things we need
+    require Jifty::YAML;
+    require Jifty::Server;
+    require Jifty::Script::Schema;
 
     my $test_config = File::Temp->new( UNLINK => 0 );
     Jifty::YAML::DumpFile("$test_config", $class->test_config(Jifty::Config->new));
@@ -180,8 +197,8 @@
           use vars qw/$cache_key_prefix/;
 
           $cache_key_prefix = "jifty-test-" . $$;
-        
-          sub cache_key_prefix {
+          
+          *Jifty::Record::cache_key_prefix = sub {
               $Jifty::Record::cache_key_prefix;
           }
       }

Modified: jifty/branches/jquery/lib/Jifty/Test/WWW/Declare.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Test/WWW/Declare.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Test/WWW/Declare.pm	Mon Jan 21 11:08:06 2008
@@ -18,7 +18,7 @@
     Test::More->import(@_);
 
     # set up database and other things
-    Jifty::Test->setup($class);
+    Jifty::Test->setup(\@_);
 
     # export the DSL-ey functions
     Test::WWW::Declare->export_to_level(2);

Modified: jifty/branches/jquery/lib/Jifty/Util.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Util.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Util.pm	Mon Jan 21 11:08:06 2008
@@ -364,6 +364,9 @@
         if (UNIVERSAL::isa($_, 'Jifty::Record')) {
             push @r, Jifty::Util->reference_to_data($_);
         }
+        if (UNIVERSAL::isa($_, 'Jifty::DateTime') && $_->is_date) {
+            push @r, $_->ymd;
+        }
         elsif (defined $_) {
             push @r, '' . $_; # force stringification
         }

Modified: jifty/branches/jquery/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/View/Declare/CRUD.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/View/Declare/CRUD.pm	Mon Jan 21 11:08:06 2008
@@ -418,8 +418,6 @@
     my $delete = $record->as_delete_action(
         moniker => 'delete-' . Jifty->web->serial,
     );
-    Jifty->web->form->register_action($delete);
-
         div {
             { class is 'crud editlink' };
             hyperlink(
@@ -438,13 +436,13 @@
                     args         => { object_type => $object_type, id => $id }
                 },
                 as_button => 1,
-                class => 'cancel'
+                class     => 'cancel'
             );
             if ( $record->current_user_can('delete') ) {
                 $delete->button(
                     label   => _('Delete'),
                     onclick => {
-                        submit => $delete,
+                        submit  => $delete,
                         confirm => _('Really delete?'),
                         refresh => Jifty->web->current_region->parent,
                     },

Modified: jifty/branches/jquery/lib/Jifty/Web.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web.pm	Mon Jan 21 11:08:06 2008
@@ -244,21 +244,22 @@
         $self->_current_user( $currentuser_obj || undef );
     }
 
+    my $object;
+
     if ( defined $self->temporary_current_user ) {
         return $self->temporary_current_user;
     } elsif ( defined $self->_current_user ) {
         return $self->_current_user;
-
     } elsif ( my $id = $self->session->get('user_id') ) {
-        my $object = Jifty->app_class("CurrentUser")->new( id => $id );
-        $self->_current_user($object);
-        return $object;
+         $object = Jifty->app_class("CurrentUser")->new( id => $id );
+    } elsif ( Jifty->config->framework('AdminMode')) {
+         $object = Jifty->app_class("CurrentUser")->superuser;
     } else {
-        my $object = Jifty->app_class("CurrentUser")->new;
-        $object->is_superuser(1) if Jifty->config->framework('AdminMode');
-        $self->_current_user($object);
-        return ($object);
+         $object = Jifty->app_class("CurrentUser")->new;
     }
+    
+    $self->_current_user($object);
+    return $object;
 }
 
 =head3 temporary_current_user [USER]
@@ -382,57 +383,57 @@
 }
 
 sub _process_valid_actions {
-    my  $self = shift;
+    my $self          = shift;
     my $valid_actions = shift;
-        for my $request_action (@$valid_actions) {
+    for my $request_action (@$valid_actions) {
 
-            # Pull the action out of the request (again, since
-            # mappings may have affected parameters).  This
-            # returns the cached version unless the request has
-            # been changed by argument mapping from previous
-            # actions (Jifty::Request::Mapper)
-            my $action = $self->new_action_from_request($request_action);
-            next unless $action;
-            if ( $request_action->modified ) {
-
-                # If the request's action was changed, re-validate
-                $action->result( Jifty::Result->new );
-                $action->result->action_class( ref $action );
-                $self->response->result(
-                    $action->moniker => $action->result );
-                $self->log->debug( "Re-validating action "
-                        . ref($action) . " "
-                        . $action->moniker );
-                next unless $action->validate;
-            }
+        # Pull the action out of the request (again, since
+        # mappings may have affected parameters).  This
+        # returns the cached version unless the request has
+        # been changed by argument mapping from previous
+        # actions (Jifty::Request::Mapper)
+        my $action = $self->new_action_from_request($request_action);
+        next unless $action;
+        if ( $request_action->modified ) {
 
-            $self->log->debug(
-                "Running action " . ref($action) . " " . $action->moniker );
-            eval { $action->run; };
-            $request_action->has_run(1);
-
-            if ( my $err = $@ ) {
-
-                # Poor man's exception propagation; we need to get
-                # "LAST RULE" and "ABORT" exceptions back up to the
-                # dispatcher.  This is specifically for redirects from
-                # actions
-                die $err if ( $err =~ /^(LAST RULE|ABORT)/ );
-                $self->log->fatal($err);
-                $action->result->error(
-                    Jifty->config->framework("DevelMode")
-                    ? $err
-                    : _("There was an error completing the request.  Please try again later."
-                    )
-                );
-            }
+            # If the request's action was changed, re-validate
+            $action->result( Jifty::Result->new );
+            $action->result->action_class( ref $action );
+            $self->response->result( $action->moniker => $action->result );
+            $self->log->debug( "Re-validating action "
+                    . ref($action) . " "
+                    . $action->moniker );
+            next unless $action->validate;
+        }
 
-            # Fill in the request with any results that that action
-            # may have yielded.
-            $self->request->do_mapping;
+        $self->log->debug(
+            "Running action " . ref($action) . " " . $action->moniker );
+        eval { $action->run; };
+        $request_action->has_run(1);
+
+        if ( my $err = $@ ) {
+
+            # Poor man's exception propagation; we need to get
+            # "LAST RULE" and "ABORT" exceptions back up to the
+            # dispatcher.  This is specifically for redirects from
+            # actions
+            die $err if ( $err =~ /^(LAST RULE|ABORT)/ );
+            $self->log->fatal($err);
+            $action->result->error(
+                Jifty->config->framework("DevelMode")
+                ? $err
+                : _("There was an error completing the request.  Please try again later."
+                )
+            );
         }
 
+        # Fill in the request with any results that that action
+        # may have yielded.
+        $self->request->do_mapping;
     }
+
+}
+
 =head3 request [VALUE]
 
 Gets or sets the current L<Jifty::Request> object.
@@ -756,7 +757,7 @@
         local $self->{navigation} = undef;
         local $self->{page_navigation} = undef;
         $self->replace_current_region($page);
-        Jifty::Dispatcher::_abort;
+        Jifty::Dispatcher::_abort();
         return;
     }
 
@@ -788,7 +789,7 @@
 
     # Mason abort, or dispatcher abort out of here
     $self->mason->abort if $self->mason;
-    Jifty::Dispatcher::_abort;
+    Jifty::Dispatcher::_abort();
 }
 
 =head3 caller

Modified: jifty/branches/jquery/lib/Jifty/Web/Form.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web/Form.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web/Form.pm	Mon Jan 21 11:08:06 2008
@@ -373,4 +373,17 @@
     return '';
 }
 
+=head2 DESTROY
+
+Checks to ensure that forms that were opened were actually closed,
+which is when actions are registered.
+
+=cut
+
+sub DESTROY {
+    my $self = shift;
+    warn "Action $_ was never registered (form was never closed)"
+      for grep {not $self->printed_actions->{$_}} keys %{$self->actions};
+}
+
 1;

Modified: jifty/branches/jquery/lib/Jifty/Web/Form/Clickable.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web/Form/Clickable.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web/Form/Clickable.pm	Mon Jan 21 11:08:06 2008
@@ -156,28 +156,30 @@
     my ($root) = $ENV{'REQUEST_URI'} =~ /([^\?]*)/;
 
     my %args = (
-        parameters     => {},
-        as_button      => 0,
-        as_link        => 0,
+        parameters => {},
+        as_button  => 0,
+        as_link    => 0,
         @_,
     );
 
-    $class->call_trigger('before_new', \%args);
+    $class->call_trigger( 'before_new', \%args );
 
     $args{render_as_button} = delete $args{as_button};
     $args{render_as_link}   = delete $args{as_link};
 
-    my $self = $class->SUPER::new({
-        class          => '',
-        label          => 'Click me!',
-        url            => $root,
-        escape_label   => 1,
-        tooltip        => '',
-        continuation   => Jifty->web->request->continuation,
-        submit         => [],
-        preserve_state => 0,
-        parameters     => {},
-    }, \%args);
+    my $self = $class->SUPER::new(
+        {   class          => '',
+            label          => 'Click me!',
+            url            => $root,
+            escape_label   => 1,
+            tooltip        => '',
+            continuation   => Jifty->web->request->continuation,
+            submit         => [],
+            preserve_state => 0,
+            parameters     => {},
+        },
+        \%args
+    );
 
     for (qw/continuation call/) {
         $self->{$_} = $self->{$_}->id if $self->{$_} and ref $self->{$_};
@@ -194,7 +196,10 @@
             if ( !ref($submit) ) { push @submit_temp, $submit }
 
             # We've been handed a Jifty::Action to submit
-            elsif ( blessed($submit) ) { push @submit_temp, $submit->moniker }
+            elsif ( blessed($submit) ) {
+                push @submit_temp, $submit->moniker;
+                $self->register_action($submit);
+            }
 
           # We've been handed a hashref which contains an action and arguments
             else {
@@ -206,18 +211,18 @@
 
                 # Add the action's moniker to the submit
                 push @submit_temp, $submit->{'action'}->moniker;
+                $self->register_action($submit->{'action'});
             }
         }
 
         @{ $self->{submit} } = @submit_temp;
     }
 
-
     # Anything doing fragment replacement needs to preserve the
     # current state as well
     if ( grep { $self->$_ } $self->handlers or $self->preserve_state ) {
         my %state_vars = Jifty->web->state_variables;
-        while ( my ($key,  $val) = each %state_vars ) {
+        while ( my ( $key, $val ) = each %state_vars ) {
             if ( $key =~ /^region-(.*?)\.(.*)$/ ) {
                 $self->region_argument( $1, $2 => $val );
             } elsif ( $key =~ /^region-(.*)$/ ) {
@@ -302,8 +307,8 @@
 
 sub state_variable {
     my $self = shift;
-    defined $self->call_trigger('before_state_variable', @_)
-        or return; # if aborted by trigger
+    defined $self->call_trigger( 'before_state_variable', @_ )
+        or return;    # if aborted by trigger
 
     my ( $key, $value, $fallback ) = @_;
     if ( defined $value and length $value ) {
@@ -345,9 +350,9 @@
     my $self = shift;
     my ( $region, $argument, $value ) = @_;
 
-    my $name = ref $region ? $region->qualified_name : $region;
+    my $name     = ref $region ? $region->qualified_name : $region;
     my $defaults = Jifty->web->get_region($name);
-    my $default = $defaults ? $defaults->default_argument($argument) : undef;
+    my $default  = $defaults ? $defaults->default_argument($argument) : undef;
 
     if (   ( not defined $default and not defined $value )
         or ( defined $default and defined $value and $default eq $value ) )
@@ -364,8 +369,9 @@
     my %old_args = @_;
     my %new_args;
 
-    while (my ($key, $val) = each %old_args) {
-        my ($new_key, $new_val) = Jifty::Request::Mapper->query_parameters($key => $val);
+    while ( my ( $key, $val ) = each %old_args ) {
+        my ( $new_key, $new_val )
+            = Jifty::Request::Mapper->query_parameters( $key => $val );
         $new_args{$new_key} = $new_val;
     }
 
@@ -386,17 +392,19 @@
     my %parameters;
 
     if ( $self->returns ) {
-        %parameters = Jifty::Request::Mapper->query_parameters( %{ $self->returns } );
+        %parameters
+            = Jifty::Request::Mapper->query_parameters( %{ $self->returns } );
         $parameters{"J:CREATE"} = 1;
-        $parameters{"J:PATH"} = Jifty::Web::Form::Clickable->new( url => $self->url,
-                                                                  parameters => $self->{parameters},
-                                                                  continuation => undef,
-                                                                )->complete_url;
+        $parameters{"J:PATH"}   = Jifty::Web::Form::Clickable->new(
+            url          => $self->url,
+            parameters   => $self->{parameters},
+            continuation => undef,
+        )->complete_url;
     } else {
-        %parameters = %{ $self->{parameters} };        
+        %parameters = %{ $self->{parameters} };
     }
 
-    %parameters = _map( %{$self->{state_variable} || {}}, %parameters );
+    %parameters = _map( %{ $self->{state_variable} || {} }, %parameters );
 
     $parameters{"J:CALL"} = $self->call
         if $self->call;
@@ -417,13 +425,15 @@
 sub post_parameters {
     my $self = shift;
 
-    my %parameters = ( _map( %{ $self->{fallback} || {} } ), $self->parameters );
+    my %parameters
+        = ( _map( %{ $self->{fallback} || {} } ), $self->parameters );
 
     my ($root) = $ENV{'REQUEST_URI'} =~ /([^\?]*)/;
 
     # Submit actions should only show up once
     my %uniq;
-    $self->submit([grep {not $uniq{$_}++} @{$self->submit}]) if $self->submit;
+    $self->submit( [ grep { not $uniq{$_}++ } @{ $self->submit } ] )
+        if $self->submit;
 
     # Add a redirect, if this isn't to the right page
     if ( $self->url ne $root and not $self->returns ) {
@@ -432,11 +442,12 @@
             arguments => { url => $self->url } );
         $parameters{ $redirect->register_name } = ref $redirect;
         $parameters{ $redirect->form_field_name('url') } = $self->url;
-        $parameters{"J:ACTIONS"} = join( '!', @{ $self->submit }, $redirect->moniker )
-          if $self->submit;
+        $parameters{"J:ACTIONS"}
+            = join( '!', @{ $self->submit }, $redirect->moniker )
+            if $self->submit;
     } else {
         $parameters{"J:ACTIONS"} = join( '!', @{ $self->submit } )
-          if $self->submit;
+            if $self->submit;
     }
 
     return %parameters;
@@ -479,8 +490,8 @@
 
 sub _defined_accessor_values {
     my $self = shift;
-    return { map { my $val = $self->$_; defined $val ? ($_ => $val) : () } 
-        $self->SUPER::accessors };
+    return { map { my $val = $self->$_; defined $val ? ( $_ => $val ) : () }
+            $self->SUPER::accessors };
 }
 
 =head2 as_link
@@ -496,24 +507,26 @@
 
     my $args = $self->_defined_accessor_values;
     my $link = Jifty::Web::Form::Link->new(
-        { %$args,
-          escape_label => $self->escape_label,
-          url          => $self->complete_url,
-          target       => $self->target,
-          continuation => $self->_continuation,
-          @_ }
+        {   %$args,
+            escape_label => $self->escape_label,
+            url          => $self->complete_url,
+            target       => $self->target,
+            continuation => $self->_continuation,
+            @_
+        }
     );
     return $link;
 }
 
 sub _continuation {
+
     # continuation info used by the update() call on client side
     my $self = shift;
-    if ($self->call) {
-	return { 'type' => 'call', id => $self->call };
+    if ( $self->call ) {
+        return { 'type' => 'call', id => $self->call };
     }
-    if ($self->returns) {
-	return { 'create' => $self->url };
+    if ( $self->returns ) {
+        return { 'create' => $self->url };
     }
 
     return {};
@@ -531,12 +544,13 @@
 sub as_button {
     my $self = shift;
 
-    my $args = $self->_defined_accessor_values;
+    my $args  = $self->_defined_accessor_values;
     my $field = Jifty::Web::Form::Field->new(
-        { %$args,
-          type => 'InlineButton',
-          continuation => $self->_continuation,
-          @_ }
+        {   %$args,
+            type         => 'InlineButton',
+            continuation => $self->_continuation,
+            @_
+        }
     );
     my %parameters = $self->post_parameters;
 
@@ -546,7 +560,7 @@
             grep { defined $parameters{$_} } keys %parameters
     );
     $field->name( join '|', keys %{ $args->{parameters} } );
-    $field->button_as_link($self->render_as_link);
+    $field->button_as_link( $self->render_as_link );
 
     return $field;
 }
@@ -571,39 +585,76 @@
         my @hooks = @{$value};
         for my $hook (@hooks) {
             next unless ref $hook eq "HASH";
-            $hook->{region} ||= $hook->{refresh} || Jifty->web->qualified_region;
+            $hook->{region} ||= $hook->{refresh}
+                || Jifty->web->qualified_region;
 
-            my $region = ref $hook->{region} ? $hook->{region} : Jifty->web->get_region( $hook->{region} );
+            my $region
+                = ref $hook->{region}
+                ? $hook->{region}
+                : Jifty->web->get_region( $hook->{region} );
 
-            if ($hook->{replace_with}) {
+            if ( $hook->{replace_with} ) {
                 my $currently_shown = '';
                 if ($region) {
 
-                my $state_var = Jifty->web->request->state_variable("region-".$region->qualified_name);
-                $currently_shown = $state_var->value if ($state_var);
-                } 
-                # Toggle region if the toggle flag is set, and clicking wouldn't change path
-                if ($hook->{toggle} and $hook->{replace_with} eq $currently_shown) {
-                    $self->region_fragment( $hook->{region}, "/__jifty/empty" );
+                    my $state_var = Jifty->web->request->state_variable(
+                        "region-" . $region->qualified_name );
+                    $currently_shown = $state_var->value if ($state_var);
+                }
+
+  # Toggle region if the toggle flag is set, and clicking wouldn't change path
+                if (    $hook->{toggle}
+                    and $hook->{replace_with} eq $currently_shown )
+                {
+                    $self->region_fragment( $hook->{region},
+                        "/__jifty/empty" );
+
 #                    Jifty->web->request->remove_state_variable('region-'.$region->qualified_name);
                 } else {
-                    $self->region_fragment( $hook->{region}, $hook->{replace_with} )
+                    $self->region_fragment( $hook->{region},
+                        $hook->{replace_with} );
                 }
-                
+
             }
             $self->region_argument( $hook->{region}, $_ => $hook->{args}{$_} )
                 for keys %{ $hook->{args} };
             if ( $hook->{submit} ) {
                 $self->{submit} ||= [];
-                $hook->{submit} = [ $hook->{submit} ] unless ref $hook->{submit} eq "ARRAY";
+                $hook->{submit} = [ $hook->{submit} ]
+                    unless ref $hook->{submit} eq "ARRAY";
                 push @{ $self->{submit} }, @{ $hook->{submit} };
             }
         }
     }
 
-    return ( ( not( $self->submit ) || @{ $self->submit } || $self->render_as_button )
+    return (
+        (          not( $self->submit )
+                || @{ $self->submit }
+                || $self->render_as_button
+        )
         ? $self->as_button(@_)
-        : $self->as_link(@_) );
+        : $self->as_link(@_)
+    );
+}
+
+=head2 register_action ACTION
+
+Reisters the action if it isn't registered already, but only on the
+link.  That is, the registration will not be seen by any other buttons
+in the form.
+
+=cut
+
+sub register_action {
+    my $self = shift;
+    my ($action) = @_;
+    return if Jifty->web->form->actions->{ $action->moniker };
+
+    my $arguments = $action->arguments;
+    $self->parameter( $action->register_name, ref $action );
+    $self->parameter( $action->fallback_form_field_name($_),
+        $action->argument_value($_) || $arguments->{$_}->{'default_value'} )
+        for grep { $arguments->{$_}{constructor} } keys %{$arguments};
 }
 
 1;

Modified: jifty/branches/jquery/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web/Form/Field.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web/Form/Field.pm	Mon Jan 21 11:08:06 2008
@@ -568,7 +568,7 @@
 sub render_value {
     my $self  = shift;
     my $field = '<span';
-    $field .= qq! class="@{[ $self->classes ]}"> !;
+    $field .= qq! class="@{[ $self->classes ]} value"> !;
     # XXX: force stringify the value because maketext is buggy with overloaded objects.
     $field .= $self->canonicalize_value(Jifty->web->escape("@{[$self->current_value]}")) if defined $self->current_value;
     $field .= qq!</span>\n!;

Modified: jifty/branches/jquery/lib/Jifty/Web/Menu.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web/Menu.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web/Menu.pm	Mon Jan 21 11:08:06 2008
@@ -4,7 +4,9 @@
 use URI;
 use Scalar::Util qw(weaken);
 
-__PACKAGE__->mk_accessors(qw(label _parent sort_order link target escape_label class));
+__PACKAGE__->mk_accessors(qw(
+    label _parent sort_order link target escape_label class render_children_inline
+));
 
 =head1 NAME
 
@@ -67,7 +69,6 @@
 Gets or sets the sort order of the item, as it will be displayed under
 the parent.  This defaults to adding onto the end.
 
-
 =head2 link
 
 Gets or set a Jifty::Web::Link object that represents this menu item. If
@@ -85,6 +86,16 @@
 Gets or sets the CSS class the link should have in addition to the default
 classes.  This is only used if C<link> isn't specified.
 
+=head2 render_children_inline [BOOLEAN]
+
+Gets or sets whether children are rendered inline as a menu "group" instead
+of a true submenu.  Only used when rendering with YUI for now.
+Defaults to false.
+
+Note that YUI doesn't support rendering nested menu groups, so having direct
+parent/children render_children_inline is likely not going to do what you
+want or expect.
+
 =head2 url
 
 Gets or sets the URL that the menu's link goes to.  If the link
@@ -98,7 +109,7 @@
     $self->{url} = shift if @_;
 
     $self->{url} = URI->new_abs($self->{url}, $self->parent->url . "/")->as_string
-      if $self->parent and $self->parent->url;
+      if defined $self->{url} and $self->parent and $self->parent->url;
 
     $self->{url} =~ s!///!/! if $self->{url};
 
@@ -147,16 +158,24 @@
                                                @_
                                              });
         Scalar::Util::weaken($self->{children}{$key}{parent});
+        
+        # Figure out the URL
+        my $child = $self->{children}{$key};
+        my $url   =   ( defined $child->link
+                    and ref $child->link
+                    and $child->link->can('url') )
+                        ? $child->link->url : $child->url;
+
         # Activate it
-        if (my $url = $self->{children}{$key}->url and Jifty->web->request) {
+        if ( defined $url and length $url and Jifty->web->request ) {
             # XXX TODO cleanup for mod_perl
             my $base_path = Jifty->web->request->path;
             chomp($base_path);
-        
-            $base_path =~ s/index\.html$//g;
-            $base_path =~ s/\/+$//g;
-            $url =~ s/\/+$//i;
-    
+            
+            $base_path =~ s/index\.html$//;
+            $base_path =~ s/\/+$//;
+            $url =~ s/\/+$//;
+            
             if ($url eq $base_path) {
                 $self->{children}{$key}->active(1); 
             }
@@ -207,7 +226,6 @@
     return wantarray ? @kids : \@kids;
 }
 
-
 =head2 render_as_menu
 
 Render this menu with HTML markup as multiple dropdowns, suitable for
@@ -221,7 +239,7 @@
     Jifty->web->out(qq{<ul class="menu">});
 
     for (@kids) {
-	$_->render_as_hierarchical_menu_item();
+        $_->render_as_hierarchical_menu_item();
     }
     Jifty->web->out(qq{</ul>});
     '';
@@ -234,11 +252,11 @@
 =cut
 
 sub render_as_context_menu {
-	my $self = shift;
-    	Jifty->web->out( qq{<ul class="context_menu">});
-	$self->render_as_hierarchical_menu_item();
-	Jifty->web->out(qq{</ul>});
-	'';
+    my $self = shift;
+    Jifty->web->out( qq{<ul class="context_menu">});
+    $self->render_as_hierarchical_menu_item();
+    Jifty->web->out(qq{</ul>});
+    '';
 }
 
 =head2 render_as_hierarchical_menu_item
@@ -293,13 +311,13 @@
 =cut
 
 sub  render_as_classical_menu {
-	my $self = shift;
+    my $self = shift;
     my @kids = $self->children;
 
     Jifty->web->out( qq{<ul class="menu">});
 
     for (@kids) {
-	    $_->_render_as_classical_menu_item();
+        $_->_render_as_classical_menu_item();
     }
 
     Jifty->web->out(qq{</ul>});
@@ -329,7 +347,7 @@
 
 }
 
-=head2 render_as_yui_menubar
+=head2 render_as_yui_menubar [PARAMHASH]
 
 Render menubar with YUI menu, suitable for an application's menu.
 It can support arbitary levels of submenu.
@@ -339,10 +357,10 @@
 sub render_as_yui_menubar {
     my $self = shift;
     my $id   = Jifty->web->serial;
-    $self->_render_as_yui_menu_item("yuimenubar", $id);
+    $self->_render_as_yui_menu_item( class => "yuimenubar", id => $id );
     Jifty->web->out(qq|<script type="text/javascript">\n|
         . qq|YAHOO.util.Event.onContentReady("|.$id.qq|", function() {\n|
-        . qq|var menu = new YAHOO.widget.MenuBar("|.$id.qq|", { autosubmenudisplay:true, hidedelay:750, lazyload:true });\n|
+        . qq|var menu = new YAHOO.widget.MenuBar("|.$id.qq|", { autosubmenudisplay:true, hidedelay:750, lazyload:true, showdelay:0 });\n|
         . qq|menu.render();\n|
         . qq|});</script>|
         );
@@ -350,23 +368,65 @@
 }
 
 sub _render_as_yui_menu_item {
-    my ($self, $class, $id) = @_;
-    my @kids = $self->children 
-        or return;
+    my $self = shift;
+    my %args = ( class => 'yuimenu', first => 0, id => undef, @_ );
+    my @kids = $self->children or return;
     
-    Jifty->web->out(
-        qq{<div}
-        . ($id ? qq{ id="$id"} : "")
-        . qq{ class="$class"><div class="bd"><ul>}
-    );
-    for (@kids) {
-        Jifty->web->out( qq{<li class="${class}item }
-        . ($_->active? 'active' : '') . qq{">});
-        Jifty->web->out( $_->as_link );
-        $_->_render_as_yui_menu_item("yuimenu");
-        Jifty->web->out( qq{</li>});
+    if ( $self->render_children_inline ) {
+        Jifty->web->out( $args{'first'} ? '<ul class="first-of-type">' : '<ul>' );
+        for my $kid ( @kids ) {
+            Jifty->web->out( qq{<li class="${class}item } . ($kid->active? 'active' : '') . qq{">});
+            Jifty->web->out( $kid->as_link );
+            $kid->_render_as_yui_menu_item( class => 'yuimenu' );
+            Jifty->web->out( qq{</li>});
+        }
+        Jifty->web->out('</ul>');
+    }
+    else {
+        Jifty->web->out(
+            qq{<div}
+            . ($args{'id'} ? qq( id="$args{'id'}") : "")
+            . qq{ class="$class"><div class="bd">}
+        );
+
+        my $count    = 1;
+        my $count_h6 = 1;
+        my $openlist = 0;
+
+        for my $kid ( @kids ) {
+            if ( $kid->render_children_inline and $kid->children ) {
+                Jifty->web->out('</ul>') if $openlist;
+                
+                my @classes = ();
+                push @classes, 'active' if $kid->active;
+                push @classes, 'first-of-type'
+                    if $count_h6 == 1 and $count == 1;
+
+                Jifty->web->out(qq(<h6 class="@{[ join ' ', @classes ]}">));
+                Jifty->web->out( $kid->as_link );
+                Jifty->web->out('</h6>');
+                $kid->_render_as_yui_menu_item(
+                    class => 'yuimenu',
+                    first => ($count == 1 ? 1 : 0)
+                );
+                $openlist = 0;
+                $count_h6++;
+            }
+            else {
+                if ( not $openlist ) {
+                    Jifty->web->out( $count == 1 ? '<ul class="first-of-type">' : '<ul>' );
+                    $openlist = 1;
+                }
+                Jifty->web->out( qq{<li class="${class}item } . ($kid->active? 'active' : '') . qq{">});
+                Jifty->web->out( $kid->as_link );
+                $kid->_render_as_yui_menu_item( class => 'yuimenu' );
+                Jifty->web->out( qq{</li>});
+            }
+            $count++;
+        }
+        Jifty->web->out('</ul>') if $openlist;
+        Jifty->web->out(qq{</div></div>});
     }
-    Jifty->web->out(qq{</ul></div></div>});
 }
 
 =head2 as_link

Modified: jifty/branches/jquery/lib/Jifty/Web/PageRegion.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web/PageRegion.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web/PageRegion.pm	Mon Jan 21 11:08:06 2008
@@ -15,7 +15,7 @@
 =cut
 
 use base qw/Jifty::Object Class::Accessor::Fast/;
-__PACKAGE__->mk_accessors(qw(name force_path force_arguments default_path default_arguments qualified_name parent region_wrapper));
+__PACKAGE__->mk_accessors(qw(name force_path force_arguments default_path default_arguments qualified_name parent region_wrapper lazy));
 use Jifty::JSON;
 use Encode ();
 
@@ -60,8 +60,9 @@
 HTML region preamble that makes Javascript aware of its presence.
 Defaults to true.
 
+=item lazy (optional)
 
-=item
+Delays the loading of the fragment until render-time
 
 =back
 
@@ -79,6 +80,7 @@
                 force_arguments => {},
                 force_path => undef,
                 region_wrapper => 1,
+                lazy => 0,
                 @_
                );
 
@@ -107,6 +109,7 @@
     $self->arguments({});
     $self->parent($args{parent} || Jifty->web->current_region);
     $self->region_wrapper($args{region_wrapper});
+    $self->lazy($args{lazy});
 
     # Keep track of the fully qualified name (which should be unique)
     $self->log->warn("Repeated region: " . $self->qualified_name)
@@ -284,8 +287,11 @@
             . qq|'| . $self->path . qq|',|
             . ( $self->parent ? qq|'| . $self->parent->qualified_name . qq|'| : q|null|)
             . qq|);\n|
-            . qq|</script>|
-            . qq|<div id="region-| . $self->qualified_name . qq|">|;
+            . qq|</script>|;
+        if ($self->lazy) {
+            return $result .  qq|<div id="region-| . $self->qualified_name . qq|" class="jifty-region-lazy"></div>|;
+        }
+        $result .= qq|<div id="region-| . $self->qualified_name . qq|" class="jifty-region">|;
     }
 
     $self->render_as_subrequest(\$result, \%arguments);

Modified: jifty/branches/jquery/lib/Jifty/Web/Session.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web/Session.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web/Session.pm	Mon Jan 21 11:08:06 2008
@@ -6,7 +6,7 @@
 use CGI::Cookie ();
 use DateTime ();
 use Storable ();
- 
+
 =head1 NAME
 
 Jifty::Web::Session - A Jifty session handler
@@ -317,6 +317,10 @@
 sub set_cookie {
     my $self = shift;
 
+    # never send a cookie with cached content. misbehaving proxies cause
+    # terrific problems
+    return if Jifty->handler->apache->header_out('Expires');
+
     my $cookie_name = $self->cookie_name;
     my %cookies     = CGI::Cookie->fetch();
     my $cookie = new CGI::Cookie(

Added: jifty/branches/jquery/lib/Jifty/Web/Session/ApacheSession.pm
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/lib/Jifty/Web/Session/ApacheSession.pm	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,172 @@
+package Jifty::Web::Session::ApacheSession;
+
+=head1 NAME
+
+Jifty::Web::Session::ApacheSession - Jifty Sessions based on Apache::Session
+
+=head1 SYNOPSIS
+
+In your F<etc/config.yml>, using the L<Apache::Session::File> backend:
+
+  framework:
+    Web:
+      SessionClass: Jifty::Web::Session::ApacheSession
+      SessionBackend: File
+      SessionOptions:
+        Directory: /tmp/sessions
+        LockDirectory: /var/lock/sessions
+
+Or with L<Apache::Session::Memorycached> backend:
+
+  framework:
+    Web:
+      SessionClass: Jifty::Web::Session::ApacheSession
+      SessionBackend: Memorycached
+      SessionOptions: { servers: [ '127.0.0.1:11211' ] }
+
+=cut
+
+use strict;
+use warnings;
+use Jifty::Model::Session ();
+use base 'Jifty::Web::Session';
+
+=head2 new
+
+Returns a new, empty session handler, subclassing L<Jifty::Web::Session>.
+
+=cut
+
+sub new {
+    my $class = shift;
+    my $cookie_name = Jifty->config->framework('Web')->{'SessionCookieName'};
+    my $backend_class = Jifty->config->framework('Web')->{'SessionBackend'}
+        or die "Please set SessionBackend in your framework/Web settings";
+    $backend_class = "Apache::Session::$backend_class" unless $backend_class =~ /::/;
+    Jifty::Util->require($backend_class);
+
+    return bless { _cookie_name => $cookie_name, _backend_class => $backend_class }, $class;
+}
+
+=head2 id
+
+Returns the session's id if it has been loaded, or C<undef> otherwise.
+
+=cut
+
+sub id {
+    my $self = shift;
+    return $self->loaded ? $self->_session->{_session_id} : undef;
+}
+
+=head2 load [ID]
+
+Load up the current session from the given C<ID>, or the appropriate
+cookie (see L<Jifty::Web::Session/cookie_name>) otherwise.
+
+If both of those fail, creates a session in memory.
+
+=cut
+
+sub load {
+    my $self       = shift;
+    my $session_id = shift;
+    my %cookies    = CGI::Cookie->fetch();
+
+    unless ($session_id) {
+        my $cookie_name = $self->cookie_name;
+        $session_id = $cookies{$cookie_name}
+            ? $cookies{$cookie_name}->value()
+            : Jifty::Model::Session->new_session_id,
+    }
+
+    my $options = Jifty->config->framework('Web')->{'SessionOptions'};
+
+    my %session;
+    local $@;
+    eval {
+        tie %session => $self->{_backend_class}, $session_id, $options;
+        1;
+    } or do {
+        tie %session => $self->{_backend_class}, undef, $options;
+    };
+
+    $self->{_session} = \%session;
+}
+
+=head2 get KEY [TYPE]
+
+See L<Jifty::Web::Session/get>.
+
+=cut
+
+sub get {
+    my $self     = shift;
+    my $key      = shift;
+    my $key_type = shift || "key";
+
+    return undef unless $self->loaded;
+    return $self->_session->{$key_type,$key};
+}
+
+=head2 set KEY => VALUE, [TYPE]
+
+See L<Jifty::Web::Session/set>.
+
+=cut
+
+sub set {
+    my $self     = shift;
+    my $key      = shift;
+    my $value    = shift;
+    my $key_type = shift || "key";
+
+    return undef unless $self->loaded;
+    $self->_session->{$key_type,$key} = $value;
+}
+
+=head2 remove KEY, [TYPE]
+
+See L<Jifty::Web::Session/remove>.
+
+=cut
+
+sub remove {
+    my $self     = shift;
+    my $key      = shift;
+    my $key_type = shift || "key";
+
+    return undef unless $self->loaded;
+    delete $self->_session->{$key_type,$key};
+}
+
+sub remove_all {
+    my $self     = shift;
+    my $key      = shift;
+    my $key_type = shift || "key";
+
+    return undef unless $self->loaded;
+    undef %{$self->_session};
+}
+
+=head2 continuations
+
+See L<Jifty::Web::Session/continuations>.
+
+=cut
+
+sub continuations {
+    my $self     = shift;
+    return () unless $self->loaded;
+
+    my $session = $self->_session;
+    my %continuations;
+    foreach my $key (keys %$session) {
+        if ($key =~ /^continuation$;(.*)/os) {
+            $continuations{$1} = $session->{$key};
+        }
+    }
+    return %continuations;
+}
+
+1;

Modified: jifty/branches/jquery/lib/Jifty/Web/Session/ClientSide.pm
==============================================================================
--- jifty/branches/jquery/lib/Jifty/Web/Session/ClientSide.pm	(original)
+++ jifty/branches/jquery/lib/Jifty/Web/Session/ClientSide.pm	Mon Jan 21 11:08:06 2008
@@ -19,11 +19,12 @@
 use warnings;
 use base 'Jifty::Web::Session';
 use Jifty::Model::Session();
-use Jifty::YAML ();
+use Storable ();
 use Compress::Zlib ();
 use Crypt::CBC ();
 use Crypt::Rijndael ();
 use CGI::Cookie::Splitter ();
+use MIME::Base64;
 
 my $session_key;
 my $splitter = CGI::Cookie::Splitter->new;
@@ -36,13 +37,14 @@
 
 sub new {
     my $class = shift;
+    my $cookie_name = Jifty->config->framework('Web')->{'SessionCookieName'};
     my $session_key = Jifty->config->framework('Web')->{'SessionSecret'}
         or die "Please set SessionSecret in your framework/Web settings";
     my $cipher = Crypt::CBC->new(
         -key    => $session_key,
         -cipher => 'Rijndael',
     );
-    bless { _cipher => $cipher, _session => undef }, $class;
+    bless { _cookie_name => $cookie_name, _cipher => $cipher, _session => undef }, $class;
 }
 
 =head2 _cipher
@@ -85,11 +87,11 @@
 
     unless ($session_id) {
         my $cookie_name = $self->cookie_name;
-        $session_id = $cookies{$cookie_name}
-            ? $cookies{$cookie_name}->value()
-            : Jifty::Model::Session->new_session_id,
+        $session_id = $cookies{$cookie_name}->value() if $cookies{$cookie_name};
+        $session_id ||= Jifty::Model::Session->new_session_id;
     }
 
+
     my $data;
 
     {
@@ -110,17 +112,19 @@
     if ($data) {
         local $@;
         eval {
-            $self->_session(
-                Jifty::YAML::Load(
-                    Compress::Zlib::uncompress(
-                        $self->_cipher->decrypt(
+            if (my $session = Storable::thaw(
+                Compress::Zlib::uncompress(
+                    $self->_cipher->decrypt(
+                        decode_base64(
                             $data->value
                         )
                     )
                 )
-            );
-            die "Session id mismatch"
-                unless $self->_session->{session_id} eq $session_id;
+            )) {
+                $self->_session($session);
+                die "Session id mismatch"
+                    unless $self->_session->{session_id} eq $session_id;
+            }
             1;
         } and return;
         warn $@ if $@;
@@ -220,10 +224,12 @@
     my $data_cookie = CGI::Cookie->new(
         -name    => "JIFTY_DAT_$session_id",
         -expires => $self->expires,
-        -value   => $self->_cipher->encrypt(
-            Compress::Zlib::compress(
-                Jifty::YAML::Dump(
-                    $self->_session
+        -value   => encode_base64(
+            $self->_cipher->encrypt(
+                Compress::Zlib::compress(
+                    Storable::nfreeze(
+                        $self->_session
+                    )
                 )
             )
         )

Modified: jifty/branches/jquery/share/plugins/Jifty/Plugin/Chart/web/static/js/chart_img_behaviour.js
==============================================================================
--- jifty/branches/jquery/share/plugins/Jifty/Plugin/Chart/web/static/js/chart_img_behaviour.js	(original)
+++ jifty/branches/jquery/share/plugins/Jifty/Plugin/Chart/web/static/js/chart_img_behaviour.js	Mon Jan 21 11:08:06 2008
@@ -10,7 +10,7 @@
         var url = e.src;
 
         var path  = url;
-        var query = $H();
+        var query = new Hash();
 
         if (url.indexOf('?') >= 0) {
             var path_and_query = url.split('?');
@@ -19,14 +19,14 @@
             var query_params = path_and_query[1].split('&');
             for (var query_param in query_params) {
                 var key_and_value = query_param.split('=');
-                query[ key_and_value[0] ] = key_and_value[1];
+                query.set(key_and_value[0], key_and_value[1]);
             }
         }
 
-        query['width']  = dim.width + 'px';
-        query['height'] = dim.height + 'px';
+        query.set('width', dim.width + 'px');
+        query.set('height', dim.height + 'px');
 
-        url = path + '?' + $H(query).toQueryString();
+        url = path + '?' + query.toQueryString();
 
         e.src = url;
     }

Modified: jifty/branches/jquery/share/plugins/Jifty/Plugin/Chart/web/static/js/simple_bars.js
==============================================================================
--- jifty/branches/jquery/share/plugins/Jifty/Plugin/Chart/web/static/js/simple_bars.js	(original)
+++ jifty/branches/jquery/share/plugins/Jifty/Plugin/Chart/web/static/js/simple_bars.js	Mon Jan 21 11:08:06 2008
@@ -13,57 +13,52 @@
  */
 
 function SimpleBars(table) {
-    var dataset = $H();
+    var dataSet = {};
 
-    for (var i = 0; i < table.tBodies[0].rows.length; i++) {
-        var table_row = table.tBodies[0].rows[i];
-        dataset[table_row.cells[0].innerHTML] = table_row.cells[1].innerHTML;
-    }
+    jQuery('tr', table).each(function() {
+        dataSet[ jQuery(this.cells[0]).text() ] = jQuery(this.cells[1]).text();
+    });
 
-    var max_value = 0;
-    dataset.values().each(function(v,i){max_value=Math.max(max_value, v);});
+    var maxValue = 0;
+    for (var name in dataSet) {
+        maxValue = Math.max(maxValue, dataSet[name]);
+    }
 
-    var simple_bars = document.createElement('div');
-    simple_bars.id = table.id;
-    simple_bars.className = table.className;
-
-    dataset.keys().each(function(k, i) {
-        var v = dataset[k];
-
-        var row = document.createElement('div');
-        row.className = 'row';
-
-        var row_label = document.createElement('span');
-        row_label.className = 'label';
-        row_label.innerHTML = k;
-        row.appendChild(row_label);
-
-        var row_bar_area = document.createElement('span');
-        row_bar_area.className = 'barArea';
-        row.appendChild(row_bar_area);
-
-        var row_bar = document.createElement('span');
-        row_bar.className = 'bar';
-        row_bar.style.width = Math.round( 100 * v / max_value ) + '%';
-        row_bar.innerHTML = '&nbsp;';
-        row_bar_area.appendChild(row_bar);
-
-        var row_value = document.createElement('span');
-        row_value.className = 'value';
-        row_value.innerHTML = v;
-        row.appendChild(row_value);
+    var simpleBars 
+        = jQuery("<div/>")
+            .attr('id', table.attr('id'))
+            .attr('class', table.attr('class'));
+
+    for (var k in dataSet) {
+        var v = dataSet[k];
+
+        var row = jQuery('<div class="row"/>');
+        jQuery('<span class="label"/>')
+            .text(k)
+            .appendTo(row);
+
+        var rowBarArea = jQuery('<span class="barArea"/>');
+        jQuery('<span class="bar"/>')
+            .css('width', Math.round( 100 * v / maxValue ) + '%')
+            .html('&nbsp;')
+            .appendTo(rowBarArea);
+        rowBarArea.appendTo(row);
+
+        jQuery('<span class="value"/>')
+            .text(v)
+            .appendTo(row);
 
-        simple_bars.appendChild(row);
-    });
+        simpleBars.append(row);
+    }
 
-    table.parentNode.insertBefore(simple_bars, table);
-    table.parentNode.removeChild(table);
+    table.before(simpleBars);
+    table.remove();
 
     return this;
 }
 
 Behaviour.register({
     'table.simple_bars': function(table) {
-        new SimpleBars(table);
+        new SimpleBars(jQuery(table));
     }
 });

Modified: jifty/branches/jquery/share/web/static/css/base.css
==============================================================================
--- jifty/branches/jquery/share/web/static/css/base.css	(original)
+++ jifty/branches/jquery/share/web/static/css/base.css	Mon Jan 21 11:08:06 2008
@@ -60,6 +60,10 @@
     float: right;
 }
 
+div#jifty-region, div#jifty-region-lazy {
+    display: inline;
+}
+
 
 
 div.warning {

Modified: jifty/branches/jquery/share/web/static/css/main.css
==============================================================================
--- jifty/branches/jquery/share/web/static/css/main.css	(original)
+++ jifty/branches/jquery/share/web/static/css/main.css	Mon Jan 21 11:08:06 2008
@@ -9,6 +9,8 @@
 @import "halos.css";
 @import "app.css";
 @import "autocomplete.css";
+ at import "yui/calendar/calendar-core.css";
 @import "yui/calendar/calendar.css";
+ at import "yui/menu/menu-core.css";
 @import "yui/menu/menu.css";
 @import "notices.css";

Added: jifty/branches/jquery/share/web/static/css/yui/calendar/calendar-core.css
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/share/web/static/css/yui/calendar/calendar-core.css	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,126 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.4.1
+*/
+/**
+ * CORE
+ *
+ * This is the set of CSS rules required by Calendar to drive core functionality and structure.
+ * Changes to these rules may result in the Calendar not functioning or rendering correctly.
+ *
+ * They should not be modified for skinning.
+ **/
+ 
+/* CALENDAR BOUNDING BOX */
+.yui-calcontainer {
+	position:relative;
+	float:left;
+	_overflow:hidden; /* IE6 only, to clip iframe shim */
+}
+
+/* IFRAME SHIM */
+.yui-calcontainer iframe {
+	position:absolute;
+	border:none;
+	margin:0;padding:0;
+	z-index:0;
+	width:100%;
+	height:100%;
+	left:0px;
+	top:0px;
+}
+
+/* IFRAME SHIM IE6 only */
+.yui-calcontainer iframe.fixedsize {
+	width:50em;
+	height:50em;
+	top:-1px;
+	left:-1px;
+}
+
+/* BOUNDING BOX FOR EACH CALENDAR GROUP PAGE */
+.yui-calcontainer.multi .groupcal {
+	z-index:1;
+	float:left;
+	position:relative;
+}
+
+/* TITLE BAR */
+.yui-calcontainer .title {
+	position:relative;
+	z-index:1;
+}
+
+/* CLOSE ICON CONTAINER */
+.yui-calcontainer .close-icon {
+	position:absolute;
+	z-index:1;
+}
+
+/* CALENDAR TABLE */
+.yui-calendar {
+	position:relative;
+}
+
+/* NAVBAR LEFT ARROW CONTAINER */
+.yui-calendar .calnavleft {
+	position:absolute;
+	z-index:1;
+}
+
+/* NAVBAR RIGHT ARROW CONTAINER */
+.yui-calendar .calnavright {
+	position:absolute;
+	z-index:1;
+}
+
+/* NAVBAR TEXT CONTAINER */
+.yui-calendar .calheader {
+	position:relative;
+	width:100%;
+	text-align:center;
+}
+
+/* CalendarNavigator */
+.yui-calcontainer .yui-cal-nav-mask {
+	position:absolute;
+	z-index:2;
+	margin:0;
+	padding:0;
+	width:100%;
+	height:100%;
+	_width:0;    /* IE6, IE7 quirks - width/height set programmatically to match container */
+	_height:0;
+	left:0;
+	top:0;
+	display:none;
+}
+
+/* NAVIGATOR BOUNDING BOX */
+.yui-calcontainer .yui-cal-nav {
+	position:absolute;
+	z-index:3;
+	top:0;
+	display:none;
+}
+
+/* NAVIGATOR BUTTONS (based on button-core.css) */
+.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn  {
+	display: -moz-inline-box; /* Gecko */
+	display: inline-block; /* IE, Opera and Safari */
+}
+
+.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button {
+	display: block;
+	*display: inline-block; /* IE */
+	*overflow: visible; /* Remove superfluous padding for IE */
+	border: none;
+	background-color: transparent;
+	cursor: pointer;
+}
+
+/* Specific changes for calendar running under fonts/reset */
+.yui-calendar .calbody a:hover {background:inherit;}
+p#clear {clear:left; padding-top:10px;}
\ No newline at end of file

Modified: jifty/branches/jquery/share/web/static/css/yui/calendar/calendar.css
==============================================================================
--- jifty/branches/jquery/share/web/static/css/yui/calendar/calendar.css	(original)
+++ jifty/branches/jquery/share/web/static/css/yui/calendar/calendar.css	Mon Jan 21 11:08:06 2008
@@ -2,7 +2,7 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
 .yui-calcontainer {
 	position:relative;
@@ -10,18 +10,26 @@
 	background-color:#F7F9FB;
 	border:1px solid #7B9EBD;
 	float:left;
-	overflow:hidden;
+	_overflow:hidden; /* IE6 only, to clip iframe shim */
 }
 
 .yui-calcontainer iframe {
 	position:absolute;
 	border:none;
 	margin:0;padding:0;
-	left:-1px;
-	top:-1px;
 	z-index:0;
+	width:100%;
+	height:100%;
+	left:0px;
+	top:0px;
+}
+
+/* IE6 only */
+.yui-calcontainer iframe.fixedsize {
 	width:50em;
 	height:50em;
+	top:-1px;
+	left:-1px;
 }
 
 .yui-calcontainer.multi {
@@ -57,7 +65,7 @@
 }
 
 .yui-calcontainer .calclose {
-	background: url("calx.gif") no-repeat;
+	background: url("/static/images/yui/calendar/calx.gif") no-repeat;
 	width:17px;
 	height:13px;
 	cursor:pointer;	
@@ -83,10 +91,10 @@
 	top:2px;
 	bottom:0;
 	width:9px;
-	height:12px;   
+	height:12px;
 	left:2px;
 	z-index:1;
-	background: url("callt.gif") no-repeat;
+	background: url("/static/images/yui/calendar/callt.gif") no-repeat;
 }
 
 .yui-calendar .calnavright {
@@ -98,7 +106,7 @@
 	height:12px;
 	right:2px;
 	z-index:1;
-	background: url("calrt.gif") no-repeat;
+	background: url("/static/images/yui/calendar/calrt.gif") no-repeat;
 }
 
 .yui-calendar td.calcell {
@@ -192,6 +200,115 @@
 	border-right-width:2px;
 }
 
+/* CalendarNavigator */
+.yui-calendar a.calnav {
+	_position:relative;
+	padding-left:2px;
+	padding-right:2px;
+	text-decoration:none;
+	color:#000;
+}
+
+.yui-calendar a.calnav:hover {
+	border:1px solid #003366;
+	background-color:#6699cc;
+	background: url(/static/images/yui/calendar/calgrad.png) repeat-x;
+	color:#fff;
+	cursor:pointer;
+}
+
+.yui-calcontainer .yui-cal-nav-mask {
+	position:absolute;
+	z-index:2;
+	display:none;
+
+	margin:0;
+	padding:0;
+
+	left:0;
+	top:0;
+	width:100%;
+	height:100%;
+	_width:0;    /* IE6, IE7 Quirks - width/height set programmatically to match container */
+	_height:0;
+
+	background-color:#000;
+	opacity:0.25;
+	*filter:alpha(opacity=25);
+}
+
+.yui-calcontainer .yui-cal-nav {
+	position:absolute;
+	z-index:3;
+	display:none;
+
+	padding:0;
+	top:1.5em;
+	left:50%;
+	width:12em;
+	margin-left:-6em;
+
+	border:1px solid #7B9EBD;
+	background-color:#F7F9FB;
+	font-size:93%;
+}
+
+.yui-calcontainer.withtitle .yui-cal-nav {
+	top:3.5em;
+}
+
+.yui-calcontainer .yui-cal-nav-y,
+.yui-calcontainer .yui-cal-nav-m,
+.yui-calcontainer .yui-cal-nav-b {
+	padding:2px 5px 2px 5px;
+}
+
+.yui-calcontainer .yui-cal-nav-b {
+	text-align:center;
+}
+
+.yui-calcontainer .yui-cal-nav-e {
+	margin-top:2px;
+	padding:2px;
+	background-color:#EDF5FF;
+	border-top:1px solid black;
+	display:none;
+}
+
+.yui-calcontainer .yui-cal-nav label {
+	display:block;
+	font-weight:bold;
+}
+
+.yui-calcontainer .yui-cal-nav-mc {
+	width:100%;
+	_width:auto; /* IE6 doesn't like width 100% */
+}
+
+.yui-calcontainer .yui-cal-nav-y input.yui-invalid {
+	background-color:#FFEE69;
+	border: 1px solid #000;
+}
+
+.yui-calcontainer .yui-cal-nav-yc {
+	width:3em;
+}
+
+.yui-calcontainer .yui-cal-nav-b button {
+	font-size:93%;
+	text-decoration:none;
+	cursor: pointer;
+	background-color: #79b2ea;
+	border: 1px solid #003366;
+	border-top-color:#FFF;
+	border-left-color:#FFF;
+	margin:1px;
+}
+
+.yui-calcontainer .yui-cal-nav-b .yui-default button {
+	/* not implemented */
+}
+
 /* Specific changes for calendar running under fonts/reset */
 .yui-calendar .calbody a:hover {background:inherit;}
 p#clear {clear:left; padding-top:10px;}

Added: jifty/branches/jquery/share/web/static/css/yui/menu/menu-core.css
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/share/web/static/css/yui/menu/menu-core.css	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,235 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.4.1
+*/
+/* Menu & MenuBar styles */
+
+.yuimenubar {
+
+    visibility: visible;
+    position: static;
+
+}
+
+.yuimenu .yuimenu,
+.yuimenubar .yuimenu {
+
+    visibility: hidden;
+    position: absolute;
+    top: -10000px;
+    left: -10000px;
+
+}
+
+.yuimenubar li, 
+.yuimenu li {
+
+    list-style-type: none;    
+
+}
+
+.yuimenubar ul, 
+.yuimenu ul,
+.yuimenubar li, 
+.yuimenu li,
+.yuimenu h6,
+.yuimenubar h6 { 
+
+    margin: 0;
+    padding: 0;
+
+}
+
+.yuimenuitemlabel,
+.yuimenubaritemlabel {
+
+    text-align: left;
+    white-space: nowrap;
+
+}
+
+
+/* 
+    The following style rule trigger the "hasLayout" property in 
+    IE (http://msdn2.microsoft.com/en-us/library/ms533776.aspx) for a
+    MenuBar instance's <ul> element, allowing both to clear their floated 
+    child <li> elements.
+*/
+
+.yuimenubar ul {
+
+    *zoom: 1;
+
+}
+
+
+/* 
+    Remove the "hasLayout" trigger for submenus of MenuBar instances as it 
+    is unnecessary. 
+*/
+
+.yuimenubar .yuimenu ul {
+
+    *zoom: normal;
+
+}
+
+/*
+    The following style rule allows a MenuBar instance's <ul> element to clear
+    its floated <li> elements in Firefox, Safari and and Opera.
+*/
+
+.yuimenubar>.bd>ul:after {
+
+    content: ".";
+    display: block;
+    clear: both;
+    visibility: hidden;
+    height: 0;
+    line-height: 0;
+
+}
+
+.yuimenubaritem {
+
+    float: left;
+
+}
+
+.yuimenubaritemlabel,
+.yuimenuitemlabel {
+
+    display: block;
+
+}
+
+.yuimenuitemlabel .helptext {
+
+    font-style: normal;
+    display: block;
+    
+    /*
+        The value for the left margin controls how much the help text is
+        offset from the text of the menu item.  This value will need to 
+        be customized depending on the longest text label of a menu item.
+    */
+    
+    margin: -1em 0 0 10em;
+    
+}
+
+/*
+    PLEASE NOTE: The <div> element used for a menu's shadow is appended 
+    to its root element via JavaScript once it has been rendered.  The 
+    code that creates the shadow lives in the menu's public "onRender" 
+    event handler that is a prototype method of YAHOO.widget.Menu.  
+    Implementers wishing to remove a menu's shadow or add any other markup
+    required for a given skin for menu should override the "onRender" method.
+*/
+
+.yui-menu-shadow {
+
+    position: absolute;
+    visibility: hidden;
+    z-index: -1;
+
+}
+
+.yui-skin-sam .yui-menu-shadow-visible {
+
+    top: 2px;
+    right: -3px;
+    left: -3px;
+    bottom: -3px;
+    visibility: visible;
+
+}
+
+
+/*
+
+There are two known issues with YAHOO.widget.Overlay (the superclass class of 
+Menu) that manifest in Gecko-based browsers on Mac OS X:
+
+    1) Elements with scrollbars will poke through Overlay instances floating 
+       above them.
+    
+    2) An Overlay's scrollbars and the scrollbars of its child nodes remain  
+       visible when the Overlay is hidden.
+
+To fix these bugs in Menu (a subclass of YAHOO.widget.Overlay):
+
+    1) The "overflow" property of a Menu instance's shadow element and child 
+       nodes is toggled between "hidden" and "auto" (through the application  
+       and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes)
+       as its "visibility" configuration property is toggled between 
+       "false" and "true."
+    
+    2) The "display" property of <select> elements that are child nodes of the 
+       Menu instance's root element is set to "none" when it is hidden.
+
+PLEASE NOTE:  
+  
+    1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
+       applied only for Gecko on Mac OS X and are added/removed to/from the 
+       Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
+       "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
+    
+    2) There may be instances where the CSS for a web page or application 
+       contains style rules whose specificity override the rules implemented by 
+       the Menu CSS files to fix this bug.  In such cases, is necessary to 
+       leverage the provided "hide-scrollbars" and "show-scrollbars" classes to 
+       write custom style rules to guard against this bug.
+
+** For more information on this issue, see:
+
+   + https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+   + SourceForge bug #1723530
+
+*/
+
+.hide-scrollbars * {
+
+	overflow: hidden;
+
+}
+
+.hide-scrollbars select {
+
+	display: none;
+
+}
+
+
+/*
+
+The following style rule (".yuimenu.show-scrollbars") overrides the 
+".show-scrollbars" rule defined in container-core.css which sets the 
+"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to 
+"auto" when it is visible.  Without this override, a Menu would have scrollbars
+when one of its submenus is visible.
+
+*/
+
+.yuimenu.show-scrollbars,
+.yuimenubar.show-scrollbars {
+
+	overflow: visible; 
+
+}
+
+.yuimenu.hide-scrollbars .yui-menu-shadow,
+.yuimenubar.hide-scrollbars .yui-menu-shadow {
+
+    overflow: hidden;
+
+}
+
+.yuimenu.show-scrollbars .yui-menu-shadow,
+.yuimenubar.show-scrollbars .yui-menu-shadow {
+
+    overflow: auto;
+
+}
\ No newline at end of file

Modified: jifty/branches/jquery/share/web/static/css/yui/menu/menu.css
==============================================================================
--- jifty/branches/jquery/share/web/static/css/yui/menu/menu.css	(original)
+++ jifty/branches/jquery/share/web/static/css/yui/menu/menu.css	Mon Jan 21 11:08:06 2008
@@ -2,400 +2,493 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
-/* Menu styles */
+/* Menu & MenuBar styles */
 
-div.yuimenu {
+.yuimenubar {
+
+    visibility: visible;
+    position: static;
 
-    background-color:#f6f7ee;
-    border:solid 1px #c4c4be;
-    padding:1px;
-    
 }
 
-/* Submenus are positioned absolute and hidden by default */
+.yuimenu .yuimenu,
+.yuimenubar .yuimenu {
+
+    visibility: hidden;
+    position: absolute;
+    top: -10000px;
+    left: -10000px;
 
-div.yuimenu div.yuimenu,
-div.yuimenubar div.yuimenu {
+}
+
+.yuimenubar li, 
+.yuimenu li {
 
-    position:absolute;
-    visibility:hidden;
+    list-style-type: none;    
 
 }
 
-/* MenuBar Styles */
+.yuimenubar ul, 
+.yuimenu ul,
+.yuimenubar li, 
+.yuimenu li,
+.yuimenu h6,
+.yuimenubar h6 { 
 
-div.yuimenubar {
+    margin: 0;
+    padding: 0;
 
-    background-color:#f6f7ee;
-    
 }
 
-/*
-    Applying a width triggers "haslayout" in IE so that the module's
-    body clears its floated elements
-*/
-div.yuimenubar div.bd {
+.yuimenuitemlabel,
+.yuimenubaritemlabel {
 
-    width:100%;
+    text-align: left;
+    white-space: nowrap;
 
 }
 
-/*
-    Clear the module body for other browsers
+
+/* 
+    The following style rule trigger the "hasLayout" property in 
+    IE (http://msdn2.microsoft.com/en-us/library/ms533776.aspx) for a
+    MenuBar instance's <ul> element, allowing both to clear their floated 
+    child <li> elements.
 */
-div.yuimenubar div.bd:after {
 
-    content:'.';
-    display:block;
-    clear:both;
-    visibility:hidden;
-    height:0;
+.yuimenubar ul {
+
+    *zoom: 1;
 
 }
 
-/* Matches the group title (H6) inside a Menu or MenuBar instance */
 
-div.yuimenu h6,
-div.yuimenubar h6 { 
+/* 
+    Remove the "hasLayout" trigger for submenus of MenuBar instances as it 
+    is unnecessary. 
+*/
+
+.yuimenubar .yuimenu ul {
 
-    font-size:100%;
-    font-weight:normal;    
-    margin:0;
-    border:solid 1px #c4c4be;
-    color:#b9b9b9;    
+    *zoom: normal;
 
 }
 
-div.yuimenubar h6 {
+/*
+    The following style rule allows a MenuBar instance's <ul> element to clear
+    its floated <li> elements in Firefox, Safari and and Opera.
+*/
+
+.yuimenubar>.bd>ul:after {
+
+    content: ".";
+    display: block;
+    clear: both;
+    visibility: hidden;
+    height: 0;
+    line-height: 0;
 
-    float:left;
-    display:inline; /* Prevent margin doubling in IE */
-    padding:4px 12px;
-    border-width:0 1px 0 0;
-    
 }
 
-div.yuimenu h6 {
+.yuimenubaritem {
 
-    float:none;
-    display:block;
-    border-width:1px 0 0 0;
-    padding:5px 10px 0 10px;
+    float: left;
 
 }
 
-/* Matches the UL inside a Menu or MenuBar instance */
+.yuimenubaritemlabel,
+.yuimenuitemlabel {
 
-div.yuimenubar ul {
+    display: block;
 
-    list-style-type:none;
-    margin:0;
-    padding:0;
+}
+
+.yuimenuitemlabel .helptext {
 
+    font-style: normal;
+    display: block;
+    
+    /*
+        The value for the left margin controls how much the help text is
+        offset from the text of the menu item.  This value will need to 
+        be customized depending on the longest text label of a menu item.
+    */
+    
+    margin: -1em 0 0 10em;
+    
 }
 
-div.yuimenu ul {
+/*
+    PLEASE NOTE: The <div> element used for a menu's shadow is appended 
+    to its root element via JavaScript once it has been rendered.  The 
+    code that creates the shadow lives in the menu's public "onRender" 
+    event handler that is a prototype method of YAHOO.widget.Menu.  
+    Implementers wishing to remove a menu's shadow or add any other markup
+    required for a given skin for menu should override the "onRender" method.
+*/
+
+.yui-menu-shadow {
 
-    list-style-type:none;
-    border:solid 1px #c4c4be;
-    border-width:1px 0 0 0;
-    margin:0;
-    padding:10px 0;
+    position: absolute;
+    visibility: hidden;
+    z-index: -1;
 
 }
 
-div.yuimenu ul.first-of-type, 
-div.yuimenu ul.hastitle,
-div.yuimenu h6.first-of-type {
+.yui-skin-sam .yui-menu-shadow-visible {
 
-    border-width:0;
+    top: 2px;
+    right: -3px;
+    left: -3px;
+    bottom: -3px;
+    visibility: visible;
 
 }
 
+
 /*
-    Styles for the menu's header and footer elements that are used as controls 
-    to scroll the menu's body element when the menu's height exceeds the 
-    value of the "maxheight" configuration property.
+
+There are two known issues with YAHOO.widget.Overlay (the superclass class of 
+Menu) that manifest in Gecko-based browsers on Mac OS X:
+
+    1) Elements with scrollbars will poke through Overlay instances floating 
+       above them.
+    
+    2) An Overlay's scrollbars and the scrollbars of its child nodes remain  
+       visible when the Overlay is hidden.
+
+To fix these bugs in Menu (a subclass of YAHOO.widget.Overlay):
+
+    1) The "overflow" property of a Menu instance's shadow element and child 
+       nodes is toggled between "hidden" and "auto" (through the application  
+       and removal of the "hide-scrollbars" and "show-scrollbars" CSS classes)
+       as its "visibility" configuration property is toggled between 
+       "false" and "true."
+    
+    2) The "display" property of <select> elements that are child nodes of the 
+       Menu instance's root element is set to "none" when it is hidden.
+
+PLEASE NOTE:  
+  
+    1) The "hide-scrollbars" and "show-scrollbars" CSS classes classes are 
+       applied only for Gecko on Mac OS X and are added/removed to/from the 
+       Overlay's root HTML element (DIV) via the "hideMacGeckoScrollbars" and 
+       "showMacGeckoScrollbars" methods of YAHOO.widget.Overlay.
+    
+    2) There may be instances where the CSS for a web page or application 
+       contains style rules whose specificity override the rules implemented by 
+       the Menu CSS files to fix this bug.  In such cases, is necessary to 
+       leverage the provided "hide-scrollbars" and "show-scrollbars" classes to 
+       write custom style rules to guard against this bug.
+
+** For more information on this issue, see:
+
+   + https://bugzilla.mozilla.org/show_bug.cgi?id=187435
+   + SourceForge bug #1723530
+
 */
 
-div.yuimenu div.topscrollbar,
-div.yuimenu div.bottomscrollbar {
+.hide-scrollbars * {
 
-    height:16px;
-    background-image:url(map.gif);
-    background-repeat:no-repeat;
+	overflow: hidden;
 
 }
 
+.hide-scrollbars select {
 
-div.yuimenu div.topscrollbar {
-
-    background-image:url(map.gif);
-    background-position:center -72px;
+	display: none;
 
 }
 
 
-div.yuimenu div.topscrollbar_disabled {
+/*
+
+The following style rule (".yuimenu.show-scrollbars") overrides the 
+".show-scrollbars" rule defined in container-core.css which sets the 
+"overflow" property of a YAHOO.widget.Overlay instance's root HTML element to 
+"auto" when it is visible.  Without this override, a Menu would have scrollbars
+when one of its submenus is visible.
+
+*/
+
+.yuimenu.show-scrollbars,
+.yuimenubar.show-scrollbars {
 
-    background-image:url(map.gif);
-    background-position:center -88px;
+	overflow: visible; 
 
 }
 
+.yuimenu.hide-scrollbars .yui-menu-shadow,
+.yuimenubar.hide-scrollbars .yui-menu-shadow {
+
+    overflow: hidden;
 
-div.yuimenu div.bottomscrollbar {
+}
 
-    background-image:url(map.gif);
-    background-position:center -104px;
+.yuimenu.show-scrollbars .yui-menu-shadow,
+.yuimenubar.show-scrollbars .yui-menu-shadow {
+
+    overflow: auto;
 
 }
 
 
-div.yuimenu div.bottomscrollbar_disabled {
+/* MenuBar style rules */
 
-    background-image:url(map.gif);
-    background-position:center -120px;
+.yuimenubar {
 
+    background-color: #f6f7ee;
+    
 }
 
 
-/* MenuItem and MenuBarItem styles */
 
-div.yuimenu li,
-div.yuimenubar li {
+/* Menu style rules */
 
-    font-size:85%;
-    cursor:pointer;
-    cursor:hand;
-    white-space:nowrap;
-    text-align:left;
+.yuimenu {
 
+    background-color: #f6f7ee;
+    border: solid 1px #c4c4be;
+    padding: 1px;
+    
 }
 
-div.yuimenu li.yuimenuitem {
+.yui-menu-shadow {
+
+    display: none;
 
-    padding:2px 24px;
-    
 }
 
-div.yuimenu li li,
-div.yuimenubar li li {
+.yuimenu ul {
 
-    font-size:100%;
+    border: solid 1px #c4c4be;
+    border-width: 1px 0 0 0;
+    padding: 10px 0;
 
 }
 
+.yuimenu .yui-menu-body-scrolled {
 
-/* Matches the help text for a menu item */
+    overflow: hidden;
 
-div.yuimenu li.hashelptext em.helptext {
+}
+
+
+/* Group titles */
 
-    font-style:normal;
-    margin:0 0 0 40px;
+.yuimenu h6,
+.yuimenubar h6 { 
+
+    font-size: 100%;
+    font-weight: normal;
+    border: solid 1px #c4c4be;
+    color: #b9b9b9;    
 
 }
 
-div.yuimenu li a,
-div.yuimenubar li a {
-    
-    /*
-        "zoom:1" triggers "haslayout" in IE to ensure that the mouseover and 
-        mouseout events bubble to the parent LI in IE.
-    */
-    zoom:1;
-    color:#000;
-    text-decoration:none;
-    
+.yuimenubar h6 {
+
+    float: left;
+    padding: 4px 12px;
+    border-width: 0 1px 0 0;
+
 }
 
-div.yuimenu li.hassubmenu,
-div.yuimenu li.hashelptext {
+.yuimenubar .yuimenu h6 {
 
-    text-align:right;
+    float: none;
 
 }
 
-div.yuimenu li.hassubmenu a.hassubmenu,
-div.yuimenu li.hashelptext a.hashelptext {
+.yuimenu h6 {
 
-    /*
-        Need to apply float immediately for IE or help text will jump to the 
-        next line 
-    */
+    border-width: 1px 0 0 0;
+    padding: 5px 10px 0 10px;
 
-    *float:left;
-    *display:inline; /* Prevent margin doubling in IE */
-    text-align:left;
+}
+
+.yuimenu ul.first-of-type, 
+.yuimenu ul.hastitle,
+.yuimenu h6.first-of-type {
+
+    border-width: 0;
 
 }
 
-div.yuimenu.visible li.hassubmenu a.hassubmenu, 
-div.yuimenu.visible li.hashelptext a.hashelptext {
 
-    /*
-        Apply the float only when the menu is visible to prevent the help
-        text from wrapping to the next line in Opera.
-    */
 
-    float:left;
+/* Top and bottom scroll controls */
+
+.yuimenu .topscrollbar,
+.yuimenu .bottomscrollbar {
+
+    height: 16px;
+    background-position: center center;
+    background-repeat: no-repeat;
 
 }
 
+.yuimenu .topscrollbar {
+
+    background-image: url(/static/images/yui/menu/menu_up_arrow.png);
 
-/* Matches selected menu items */
+}
 
-div.yuimenu li.selected,
-div.yuimenubar li.selected {
+.yuimenu .topscrollbar_disabled {
 
-    background-color:#8c8ad0;
+    background-image: url(/static/images/yui/menu/menu_up_arrow_disabled.png);
 
 }
 
-div.yuimenu li.selected a.selected,
-div.yuimenubar li.selected a.selected {
+.yuimenu .bottomscrollbar {
 
-    text-decoration:underline;
+    background-image: url(/static/images/yui/menu/menu_down_arrow.png);
 
 }
 
-div.yuimenu li.selected a.selected,
-div.yuimenu li.selected em.selected, 
-div.yuimenubar li.selected a.selected {
+.yuimenu .bottomscrollbar_disabled {
 
-    color:#fff;
+    background-image: url(/static/images/yui/menu/menu_down_arrow_disabled.png);
 
 }
 
 
-/* Matches disabled menu items */
+/* MenuItem and MenuBarItem styles */
+
+.yuimenuitem {
+
+    /*
+        For IE: Used to collapse superfluous white space between <li> elements
+        that is triggered by the "display" property of the <a> elements being
+        set to "block."
+    */
+
+    *border-bottom: solid 1px #f6f7ee;
 
-div.yuimenu li.disabled, 
-div.yuimenubar li.disabled {
+}
+
+.yuimenuitemlabel,
+.yuimenubaritemlabel {
 
-    cursor:default;
+    font-size: 85%;
+    color: #000;
+    text-decoration: none;
 
 }
 
-div.yuimenu li.disabled a.disabled,
-div.yuimenu li.disabled em.disabled,
-div.yuimenubar li.disabled a.disabled {
+.yuimenuitemlabel {
 
-    color:#b9b9b9;
-    cursor:default;
+    padding: 2px 24px;
     
 }
 
-div.yuimenubar li.yuimenubaritem {
+.yuimenubaritemlabel {
 
-    float:left;
-    display:inline; /* Prevent margin doubling in IE */
-    border-width:0 0 0 1px;
-    border-style:solid;
-    border-color:#c4c4be;
-    padding:4px 24px;
-    margin:0;
+    border-width: 0 0 0 1px;
+    border-style: solid;
+    border-color: #c4c4be;
+    padding: 4px 24px;
 
 }
 
-div.yuimenubar li.yuimenubaritem.first-of-type {
+.yuimenubar li.first-of-type .yuimenubaritemlabel {
 
-    border-width:0;
+    border-width: 0;
 
 }
 
+.yuimenubaritem-hassubmenu {
 
-/* Styles for the the submenu indicator for menu items */
+    background: url(/static/images/yui/menu/menubaritem_submenuindicator.png) right center no-repeat;
 
-div.yuimenu li.hassubmenu em.submenuindicator, 
-div.yuimenubar li.hassubmenu em.submenuindicator {
+}
 
-    display:-moz-inline-box; /* Mozilla */
-    display:inline-block; /* IE, Opera and Safari */
-    vertical-align:middle;
-    height:8px;
-    width:8px;
-    text-indent:9px;
-    font:0/0 arial;
-    overflow:hidden;
-    background-image:url(map.gif);
-    background-repeat:no-repeat;
+.yuimenuitem-hassubmenu {
+
+    background: url(/static/images/yui/menu/menuitem_submenuindicator.png) right center no-repeat;
 
 }
 
-div.yuimenubar li.hassubmenu em.submenuindicator {
+.yuimenuitem-checked {
+
+    background: url(/static/images/yui/menu/menuitem_checkbox.png) left center no-repeat;
+
+}
 
-    background-position:0 -24px;
-    margin:0 0 0 10px;
+.yuimenuitemlabel .helptext {
 
+    margin-top: -1.1em;
+    *margin-top: -1.2em;  /* For IE*/
+    
 }
 
-div.yuimenubar li.hassubmenu em.submenuindicator.selected {
 
-    background-position:0 -32px;
+
+/* MenuItem states */
+
+
+/* Selected MenuItem */
+
+.yuimenubaritem-selected,
+.yuimenuitem-selected {
+
+    background-color: #8c8ad0;
 
 }
 
-div.yuimenubar li.hassubmenu em.submenuindicator.disabled {
+.yuimenubaritemlabel-selected,
+.yuimenuitemlabel-selected {
 
-    background-position:0 -40px;
+    text-decoration: underline;
+    color: #fff;
 
 }
 
-div.yuimenu li.hassubmenu em.submenuindicator {
+.yuimenubaritem-hassubmenu-selected {
 
-    background-position:0 0;
-    margin:0 -16px 0 10px;
+    background-image: url(/static/images/yui/menu/menubaritem_submenuindicator_selected.png);
 
 }
 
-div.yuimenu li.hassubmenu em.submenuindicator.selected {
+.yuimenuitem-hassubmenu-selected {
 
-    background-position:0 -8px;
+    background-image: url(/static/images/yui/menu/menuitem_submenuindicator_selected.png);
 
 }
 
-div.yuimenu li.hassubmenu em.submenuindicator.disabled {
+.yuimenuitem-checked-selected {
 
-    background-position:0 -16px;
+    background-image: url(/static/images/yui/menu/menuitem_checkbox_selected.png);
 
 }
 
 
-/* Styles for a menu item's "checked" state */
+/* Disabled MenuItem */
 
-div.yuimenu li.checked {
+.yuimenubaritemlabel-disabled,
+.yuimenuitemlabel-disabled {
 
-    position:relative;
+    cursor: default;
+    color: #b9b9b9;
 
 }
 
-div.yuimenu li.checked em.checkedindicator {
+.yuimenubaritem-hassubmenu-disabled {
 
-    height:8px;
-    width:8px;
-    text-indent:9px;
-    overflow:hidden;
-    background-image:url(map.gif);
-    background-position:0 -48px;
-    background-repeat:no-repeat;
-    position:absolute;
-    left:6px;
-    _left:-16px; /* Underscore hack b/c this is for IE 6 only */
-    top:.5em;
+    background-image: url(/static/images/yui/menu/menubaritem_submenuindicator_disabled.png);
 
 }
 
-div.yuimenu li.checked em.checkedindicator.selected {
+.yuimenuitem-hassubmenu-disabled {
 
-    background-position:0 -56px;
+    background-image: url(/static/images/yui/menu/menuitem_submenuindicator_disabled.png);
 
 }
 
-div.yuimenu li.checked em.checkedindicator.disabled {
+.yuimenuitem-checked-disabled {
 
-    background-position:0 -64px;
+    background-image: url(/static/images/yui/menu/menuitem_checkbox_disabled.png);
 
-}
\ No newline at end of file
+}

Modified: jifty/branches/jquery/share/web/static/css/yui/tabview/border_tabs.css
==============================================================================
--- jifty/branches/jquery/share/web/static/css/yui/tabview/border_tabs.css	(original)
+++ jifty/branches/jquery/share/web/static/css/yui/tabview/border_tabs.css	Mon Jan 21 11:08:06 2008
@@ -2,7 +2,7 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
 .yui-navset .yui-nav li a, .yui-navset .yui-content {
     border:1px solid #000;  /* label and content borders */

Added: jifty/branches/jquery/share/web/static/css/yui/tabview/tabview-core.css
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/share/web/static/css/yui/tabview/tabview-core.css	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,110 @@
+/*
+Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.4.1
+*/
+/* default space between tabs */
+.yui-navset .yui-nav li,
+.yui-navset .yui-navset-top .yui-nav li,
+.yui-navset .yui-navset-bottom .yui-nav li {
+    margin:0 0.5em 0 0; /* horizontal tabs */
+}
+.yui-navset-left .yui-nav li,
+.yui-navset-right .yui-nav li {
+    margin:0 0 0.5em; /* vertical tabs */
+}
+
+/* default width for side tabs */
+.yui-navset .yui-navset-left .yui-nav,
+.yui-navset .yui-navset-right .yui-nav,
+.yui-navset-left .yui-nav,
+.yui-navset-right .yui-nav { width:6em; }
+
+.yui-navset-top .yui-nav,
+.yui-navset-bottom .yui-nav {
+    width:auto;
+}
+.yui-navset .yui-navset-left,
+.yui-navset-left { padding:0 0 0 6em; } /* map to nav width */
+.yui-navset-right { padding:0 6em 0 0; } /* ditto */
+
+.yui-navset-top,
+.yui-navset-bottom {
+    padding:auto;
+}
+/* core */
+
+.yui-nav,
+.yui-nav li {
+    margin:0;
+    padding:0;
+    list-style:none;
+}
+.yui-navset li em { font-style:normal; }
+
+.yui-navset {
+    position:relative; /* contain absolute positioned tabs (left/right) */
+    zoom:1;
+}
+
+.yui-navset .yui-content { zoom:1; }
+
+.yui-navset .yui-nav li,
+.yui-navset .yui-navset-top .yui-nav li, /* in case nested */
+.yui-navset .yui-navset-bottom .yui-nav li {
+    display:inline-block;
+    display:-moz-inline-stack;
+    *display:inline; /* IE */
+    vertical-align:bottom; /* safari: for overlap */
+    cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */
+    zoom:1; /* IE: kill space between horizontal tabs */
+}
+
+.yui-navset-left .yui-nav li,
+.yui-navset-right .yui-nav li {
+    display:block;
+}
+
+.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */
+
+.yui-navset .yui-nav li a,
+.yui-navset-top .yui-nav li a,
+.yui-navset-bottom .yui-nav li a {
+    display:block;
+    display:inline-block;
+    vertical-align:bottom; /* safari: for overlap */
+    zoom:1;
+}
+
+.yui-navset-left .yui-nav li a,
+.yui-navset-right .yui-nav li a {
+    display:block;
+}
+
+.yui-navset-bottom .yui-nav li a {
+    vertical-align:text-top; /* for inline overlap (reverse for Opera border bug) */
+}
+
+.yui-navset .yui-nav li a em,
+.yui-navset-top .yui-nav li a em,
+.yui-navset-bottom .yui-nav li a em { display:block; }
+
+/* position left and right oriented tabs */
+.yui-navset .yui-navset-left .yui-nav,
+.yui-navset .yui-navset-right .yui-nav,
+.yui-navset-left .yui-nav,
+.yui-navset-right .yui-nav {
+   position:absolute;
+   z-index:1; 
+}
+
+.yui-navset-top .yui-nav,
+.yui-navset-bottom .yui-nav {
+    position:static;
+}
+.yui-navset .yui-navset-left .yui-nav,
+.yui-navset-left .yui-nav { left:0; right:auto; }
+
+.yui-navset .yui-navset-right .yui-nav,
+.yui-navset-right .yui-nav { right:0; left:auto; }

Modified: jifty/branches/jquery/share/web/static/css/yui/tabview/tabview.css
==============================================================================
--- jifty/branches/jquery/share/web/static/css/yui/tabview/tabview.css	(original)
+++ jifty/branches/jquery/share/web/static/css/yui/tabview/tabview.css	Mon Jan 21 11:08:06 2008
@@ -2,7 +2,7 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
 /* default space between tabs */
 .yui-navset .yui-nav li {

Added: jifty/branches/jquery/share/web/static/images/yui/calendar/calgrad.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/calendar/callt.gif
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/calendar/calrt.gif
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/calendar/calx.gif
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menu_down_arrow.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menu_down_arrow_disabled.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menu_down_arrow_selected.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menu_up_arrow.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menu_up_arrow_disabled.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menubaritem_submenuindicator.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menubaritem_submenuindicator_disabled.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menubaritem_submenuindicator_selected.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_checked.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_checked_disabled.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_checked_selected.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_submenuindicator.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_submenuindicator_disabled.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/menu/menuitem_submenuindicator_selected.png
==============================================================================
Binary file. No diff available.

Added: jifty/branches/jquery/share/web/static/images/yui/tabview/loading.gif
==============================================================================
Binary file. No diff available.

Modified: jifty/branches/jquery/share/web/static/js/calendar.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/calendar.js	(original)
+++ jifty/branches/jquery/share/web/static/js/calendar.js	Mon Jan 21 11:08:06 2008
@@ -16,9 +16,7 @@
     dateRegex: /^(\d{4})\W(\d{2})\W(\d{2})/,
     
     Options: {
-        NAV_ARROW_LEFT: "/static/images/yui/us/tr/callt.gif",
-        NAV_ARROW_RIGHT: "/static/images/yui/us/tr/calrt.gif",
-        OOM_SELECT: true
+        OUT_OF_MONTH_SELECT: true
     },
 
     toggleCalendar: function(ev) {

Modified: jifty/branches/jquery/share/web/static/js/context_menu.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/context_menu.js	(original)
+++ jifty/branches/jquery/share/web/static/js/context_menu.js	Mon Jan 21 11:08:06 2008
@@ -58,8 +58,9 @@
     
         var li = Jifty.ContextMenu.getParentListItem(ul);
 
+        Element.addClassName( ul, "dropdown_menu" );
         ul.style.position = "absolute";
-        ul.style.width    = li.offsetWidth * 2 + "px";
+        ul.style.width    = "12em";
         
         /* Use position: relative based positioning for every browser
            but IE, which needs to use absolute positioning */

Modified: jifty/branches/jquery/share/web/static/js/jifty.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/jifty.js	(original)
+++ jifty/branches/jquery/share/web/static/js/jifty.js	Mon Jan 21 11:08:06 2008
@@ -668,6 +668,9 @@
         element = Jifty.$(element);
 
         var extras = [];
+        if (!element)
+            return extras;
+
         var args = Form.Element.buttonArguments(element);
 
         jQuery.each(args, function(k, v) {
@@ -763,6 +766,10 @@
     },
     '.form_field .error, .form_field .warning, .form_field .canonicalization_note': function(e) {
         if ( e.innerHTML == "" ) jQuery(e).hide();
+    },
+    '.-jifty-region-lazy': function(e) {
+        var region = e.getAttribute("id").replace(/^region-/,"");
+        Jifty.update( { 'fragments': [{'region': region, 'mode': 'Replace'}]}, e);
     }
 });
 
@@ -1078,6 +1085,8 @@
     request['actions'] = {};
 
     for (var moniker in named_args['actions']) {
+        if (moniker == 'extend')
+            continue;
         var disable = named_args['actions'][moniker];
         var a = new Action(moniker, button_args);
         current_actions[moniker] = a;

Modified: jifty/branches/jquery/share/web/static/js/prototype.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/prototype.js	(original)
+++ jifty/branches/jquery/share/web/static/js/prototype.js	Mon Jan 21 11:08:06 2008
@@ -2210,7 +2210,11 @@
         if (position == 'top' || position == 'after') fragments.reverse();
         fragments.each(pos.insert.curry(element));
       }
-      else element.insertAdjacentHTML(pos.adjacency, content.stripScripts());
+      // Sartak: pos.adjacency may be undefined. IE6 gets very unhappy if you
+      // try to pass undef to insertAdjacentHTML
+      else if (pos.adjacency) {
+          element.insertAdjacentHTML(pos.adjacency, content.stripScripts());
+      }
 
       content.evalScripts.bind(content).defer();
     }

Modified: jifty/branches/jquery/share/web/static/js/yui/calendar.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/yui/calendar.js	(original)
+++ jifty/branches/jquery/share/web/static/js/yui/calendar.js	Mon Jan 21 11:08:06 2008
@@ -6,477 +6,683 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
-/**
-* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.
-* @namespace YAHOO.util
-* @class Config
-* @constructor
-* @param {Object}	owner	The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config = function(owner) {
-	if (owner) {
-		this.init(owner);
-	}
-};
-
-/**
- * Constant representing the CustomEvent type for the config changed event.
- * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
- * @private
- * @static
- * @final
- */
-YAHOO.util.Config.CONFIG_CHANGED_EVENT = "configChanged";
-
-/**
- * Constant representing the boolean type string
- * @property YAHOO.util.Config.BOOLEAN_TYPE
- * @private
- * @static
- * @final
- */
-YAHOO.util.Config.BOOLEAN_TYPE = "boolean";
-
-YAHOO.util.Config.prototype = {
-	
-	/**
-	* Object reference to the owner of this Config Object
-	* @property owner
-	* @type Object
-	*/
-	owner : null,
-
-	/**
-	* Boolean flag that specifies whether a queue is currently being executed
-	* @property queueInProgress
-	* @type Boolean
-	*/
-	queueInProgress : false,
-
-	/**
-	* Maintains the local collection of configuration property objects and their specified values
-	* @property config
-	* @private
-	* @type Object
-	*/ 
-	config : null,
-
-	/**
-	* Maintains the local collection of configuration property objects as they were initially applied.
-	* This object is used when resetting a property.
-	* @property initialConfig
-	* @private
-	* @type Object
-	*/ 
-	initialConfig : null,
-
-	/**
-	* Maintains the local, normalized CustomEvent queue
-	* @property eventQueue
-	* @private
-	* @type Object
-	*/ 
-	eventQueue : null,
-
-	/**
-	* Custom Event, notifying subscribers when Config properties are set (setProperty is called without the silent flag
-	* @event configChangedEvent
-	*/
-	configChangedEvent : null,
-
-	/**
-	* Validates that the value passed in is a Boolean.
-	* @method checkBoolean
-	* @param	{Object}	val	The value to validate
-	* @return	{Boolean}	true, if the value is valid
-	*/	
-	checkBoolean: function(val) {
-		return (typeof val == YAHOO.util.Config.BOOLEAN_TYPE);
-	},
-
-	/**
-	* Validates that the value passed in is a number.
-	* @method checkNumber
-	* @param	{Object}	val	The value to validate
-	* @return	{Boolean}	true, if the value is valid
-	*/
-	checkNumber: function(val) {
-		return (!isNaN(val));
-	},
-
-	/**
-	* Fires a configuration property event using the specified value. 
-	* @method fireEvent
-	* @private
-	* @param {String}	key			The configuration property's name
-	* @param {value}	Object		The value of the correct type for the property
-	*/ 
-	fireEvent : function( key, value ) {
-		var property = this.config[key];
-
-		if (property && property.event) {
-			property.event.fire(value);
-		}	
-	},
-
-	/**
-	* Adds a property to the Config Object's private config hash.
-	* @method addProperty
-	* @param {String}	key	The configuration property's name
-	* @param {Object}	propertyObject	The Object containing all of this property's arguments
-	*/
-	addProperty : function( key, propertyObject ) {
-		key = key.toLowerCase();
-
-		this.config[key] = propertyObject;
-
-		propertyObject.event = new YAHOO.util.CustomEvent(key, this.owner);
-		propertyObject.key = key;
-
-		if (propertyObject.handler) {
-			propertyObject.event.subscribe(propertyObject.handler, this.owner);
-		}
-
-		this.setProperty(key, propertyObject.value, true);
-		
-		if (! propertyObject.suppressEvent) {
-			this.queueProperty(key, propertyObject.value);
-		}
-		
-	},
-
-	/**
-	* Returns a key-value configuration map of the values currently set in the Config Object.
-	* @method getConfig
-	* @return {Object} The current config, represented in a key-value map
-	*/
-	getConfig : function() {
-		var cfg = {};
-			
-		for (var prop in this.config) {
-			var property = this.config[prop];
-			if (property && property.event) {
-				cfg[prop] = property.value;
-			}
-		}
-		
-		return cfg;
-	},
-
-	/**
-	* Returns the value of specified property.
-	* @method getProperty
-	* @param {String} key	The name of the property
-	* @return {Object}		The value of the specified property
-	*/
-	getProperty : function(key) {
-		var property = this.config[key.toLowerCase()];
-		if (property && property.event) {
-			return property.value;
-		} else {
-			return undefined;
-		}
-	},
-
-	/**
-	* Resets the specified property's value to its initial value.
-	* @method resetProperty
-	* @param {String} key	The name of the property
-	* @return {Boolean} True is the property was reset, false if not
-	*/
-	resetProperty : function(key) {
-		key = key.toLowerCase();
-
-		var property = this.config[key];
-		if (property && property.event) {
-			if (this.initialConfig[key] && !YAHOO.lang.isUndefined(this.initialConfig[key]))	{
-				this.setProperty(key, this.initialConfig[key]);
-			}
-			return true;
-		} else {
-			return false;
-		}
-	},
-
-	/**
-	* Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
-	* @method setProperty
-	* @param {String} key		The name of the property
-	* @param {String} value		The value to set the property to
-	* @param {Boolean} silent	Whether the value should be set silently, without firing the property event.
-	* @return {Boolean}			True, if the set was successful, false if it failed.
-	*/
-	setProperty : function(key, value, silent) {
-		key = key.toLowerCase();
-
-		if (this.queueInProgress && ! silent) {
-			this.queueProperty(key,value); // Currently running through a queue... 
-			return true;
-		} else {
-			var property = this.config[key];
-			if (property && property.event) {
-				if (property.validator && ! property.validator(value)) { // validator
-					return false;
-				} else {
-					property.value = value;
-					if (! silent) {
-						this.fireEvent(key, value);
-						this.configChangedEvent.fire([key, value]);
-					}
-					return true;
-				}
-			} else {
-				return false;
-			}
-		}
-	},
-
-	/**
-	* Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
-	* moved from its current position to the end of the queue.
-	* @method queueProperty
-	* @param {String} key	The name of the property
-	* @param {String} value	The value to set the property to
-	* @return {Boolean}		true, if the set was successful, false if it failed.
-	*/	
-	queueProperty : function(key, value) {
-		key = key.toLowerCase();
-
-		var property = this.config[key];
-							
-		if (property && property.event) {
-			if (!YAHOO.lang.isUndefined(value) && property.validator && ! property.validator(value)) { // validator
-				return false;
-			} else {
-
-				if (!YAHOO.lang.isUndefined(value)) {
-					property.value = value;
-				} else {
-					value = property.value;
-				}
-
-				var foundDuplicate = false;
-				var iLen = this.eventQueue.length;
-				for (var i=0; i < iLen; i++) {
-					var queueItem = this.eventQueue[i];
-
-					if (queueItem) {
-						var queueItemKey = queueItem[0];
-						var queueItemValue = queueItem[1];
-						
-						if (queueItemKey == key) {
-							// found a dupe... push to end of queue, null current item, and break
-							this.eventQueue[i] = null;
-							this.eventQueue.push([key, (!YAHOO.lang.isUndefined(value) ? value : queueItemValue)]);
-							foundDuplicate = true;
-							break;
-						}
-					}
-				}
-				
-				if (! foundDuplicate && !YAHOO.lang.isUndefined(value)) { // this is a refire, or a new property in the queue
-					this.eventQueue.push([key, value]);
-				}
-			}
-
-			if (property.supercedes) {
-				var sLen = property.supercedes.length;
-				for (var s=0; s < sLen; s++) {
-					var supercedesCheck = property.supercedes[s];
-					var qLen = this.eventQueue.length;
-					for (var q=0; q < qLen; q++) {
-						var queueItemCheck = this.eventQueue[q];
-
-						if (queueItemCheck) {
-							var queueItemCheckKey = queueItemCheck[0];
-							var queueItemCheckValue = queueItemCheck[1];
-							
-							if ( queueItemCheckKey == supercedesCheck.toLowerCase() ) {
-								this.eventQueue.push([queueItemCheckKey, queueItemCheckValue]);
-								this.eventQueue[q] = null;
-								break;
-							}
-						}
-					}
-				}
-			}
-
-			return true;
-		} else {
-			return false;
-		}
-	},
+(function () {
 
-	/**
-	* Fires the event for a property using the property's current value.
-	* @method refireEvent
-	* @param {String} key	The name of the property
-	*/
-	refireEvent : function(key) {
-		key = key.toLowerCase();
-
-		var property = this.config[key];
-		if (property && property.event && !YAHOO.lang.isUndefined(property.value)) {
-			if (this.queueInProgress) {
-				this.queueProperty(key);
-			} else {
-				this.fireEvent(key, property.value);
-			}
-		}
-	},
+    /**
+    * Config is a utility used within an Object to allow the implementer to
+    * maintain a list of local configuration properties and listen for changes 
+    * to those properties dynamically using CustomEvent. The initial values are 
+    * also maintained so that the configuration can be reset at any given point 
+    * to its initial state.
+    * @namespace YAHOO.util
+    * @class Config
+    * @constructor
+    * @param {Object} owner The owner Object to which this Config Object belongs
+    */
+    YAHOO.util.Config = function (owner) {
 
-	/**
-	* Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.
-	* Although the values will be set, fireQueue() must be called for their associated events to execute.
-	* @method applyConfig
-	* @param {Object}	userConfig	The configuration Object literal
-	* @param {Boolean}	init		When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.
-	*/
-	applyConfig : function(userConfig, init) {
-		if (init) {
-			this.initialConfig = userConfig;
-		}
-		for (var prop in userConfig) {
-			this.queueProperty(prop, userConfig[prop]);
-		}
-	},
+        if (owner) {
+            this.init(owner);
+        }
 
-	/**
-	* Refires the events for all configuration properties using their current values.
-	* @method refresh
-	*/
-	refresh : function() {
-		for (var prop in this.config) {
-			this.refireEvent(prop);
-		}
-	},
 
-	/**
-	* Fires the normalized list of queued property change events
-	* @method fireQueue
-	*/
-	fireQueue : function() {
-		this.queueInProgress = true;
-		for (var i=0;i<this.eventQueue.length;i++) {
-			var queueItem = this.eventQueue[i];
-			if (queueItem) {
-				var key = queueItem[0];
-				var value = queueItem[1];
-				
-				var property = this.config[key];
-				property.value = value;
+    };
 
-				this.fireEvent(key,value);
-			}
-		}
-		
-		this.queueInProgress = false;
-		this.eventQueue = [];
-	},
 
-	/**
-	* Subscribes an external handler to the change event for any given property. 
-	* @method subscribeToConfigEvent
-	* @param {String}	key			The property name
-	* @param {Function}	handler		The handler function to use subscribe to the property's event
-	* @param {Object}	obj			The Object to use for scoping the event handler (see CustomEvent documentation)
-	* @param {Boolean}	override	Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.
-	* @return {Boolean}				True, if the subscription was successful, otherwise false.
-	*/	
-	subscribeToConfigEvent : function(key, handler, obj, override) {
-		var property = this.config[key.toLowerCase()];
-		if (property && property.event) {
-			if (! YAHOO.util.Config.alreadySubscribed(property.event, handler, obj)) {
-				property.event.subscribe(handler, obj, override);
-			}
-			return true;
-		} else {
-			return false;
-		}
-	},
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Config = YAHOO.util.Config;
 
-	/**
-	* Unsubscribes an external handler from the change event for any given property. 
-	* @method unsubscribeFromConfigEvent
-	* @param {String}	key			The property name
-	* @param {Function}	handler		The handler function to use subscribe to the property's event
-	* @param {Object}	obj			The Object to use for scoping the event handler (see CustomEvent documentation)
-	* @return {Boolean}				True, if the unsubscription was successful, otherwise false.
-	*/
-	unsubscribeFromConfigEvent : function(key, handler, obj) {
-		var property = this.config[key.toLowerCase()];
-		if (property && property.event) {
-			return property.event.unsubscribe(handler, obj);
-		} else {
-			return false;
-		}
-	},
 
-	/**
-	* Returns a string representation of the Config object
-	* @method toString
-	* @return {String}	The Config object in string format.
-	*/
-	toString : function() {
-		var output = "Config";
-		if (this.owner) {
-			output += " [" + this.owner.toString() + "]";
-		}
-		return output;
-	},
+    /**
+     * Constant representing the CustomEvent type for the config changed event.
+     * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
+     * @private
+     * @static
+     * @final
+     */
+    Config.CONFIG_CHANGED_EVENT = "configChanged";
+    
+    /**
+     * Constant representing the boolean type string
+     * @property YAHOO.util.Config.BOOLEAN_TYPE
+     * @private
+     * @static
+     * @final
+     */
+    Config.BOOLEAN_TYPE = "boolean";
+    
+    Config.prototype = {
+     
+        /**
+        * Object reference to the owner of this Config Object
+        * @property owner
+        * @type Object
+        */
+        owner: null,
+        
+        /**
+        * Boolean flag that specifies whether a queue is currently 
+        * being executed
+        * @property queueInProgress
+        * @type Boolean
+        */
+        queueInProgress: false,
+        
+        /**
+        * Maintains the local collection of configuration property objects and 
+        * their specified values
+        * @property config
+        * @private
+        * @type Object
+        */ 
+        config: null,
+        
+        /**
+        * Maintains the local collection of configuration property objects as 
+        * they were initially applied.
+        * This object is used when resetting a property.
+        * @property initialConfig
+        * @private
+        * @type Object
+        */ 
+        initialConfig: null,
+        
+        /**
+        * Maintains the local, normalized CustomEvent queue
+        * @property eventQueue
+        * @private
+        * @type Object
+        */ 
+        eventQueue: null,
+        
+        /**
+        * Custom Event, notifying subscribers when Config properties are set 
+        * (setProperty is called without the silent flag
+        * @event configChangedEvent
+        */
+        configChangedEvent: null,
+    
+        /**
+        * Initializes the configuration Object and all of its local members.
+        * @method init
+        * @param {Object} owner The owner Object to which this Config 
+        * Object belongs
+        */
+        init: function (owner) {
+    
+            this.owner = owner;
+    
+            this.configChangedEvent = 
+                this.createEvent(Config.CONFIG_CHANGED_EVENT);
+    
+            this.configChangedEvent.signature = CustomEvent.LIST;
+            this.queueInProgress = false;
+            this.config = {};
+            this.initialConfig = {};
+            this.eventQueue = [];
+        
+        },
+        
+        /**
+        * Validates that the value passed in is a Boolean.
+        * @method checkBoolean
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */ 
+        checkBoolean: function (val) {
+            return (typeof val == Config.BOOLEAN_TYPE);
+        },
+        
+        /**
+        * Validates that the value passed in is a number.
+        * @method checkNumber
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */
+        checkNumber: function (val) {
+            return (!isNaN(val));
+        },
+        
+        /**
+        * Fires a configuration property event using the specified value. 
+        * @method fireEvent
+        * @private
+        * @param {String} key The configuration property's name
+        * @param {value} Object The value of the correct type for the property
+        */ 
+        fireEvent: function ( key, value ) {
+            var property = this.config[key];
+        
+            if (property && property.event) {
+                property.event.fire(value);
+            } 
+        },
+        
+        /**
+        * Adds a property to the Config Object's private config hash.
+        * @method addProperty
+        * @param {String} key The configuration property's name
+        * @param {Object} propertyObject The Object containing all of this 
+        * property's arguments
+        */
+        addProperty: function ( key, propertyObject ) {
+            key = key.toLowerCase();
+        
+            this.config[key] = propertyObject;
+        
+            propertyObject.event = this.createEvent(key, { scope: this.owner });
+            propertyObject.event.signature = CustomEvent.LIST;
+            
+            
+            propertyObject.key = key;
+        
+            if (propertyObject.handler) {
+                propertyObject.event.subscribe(propertyObject.handler, 
+                    this.owner);
+            }
+        
+            this.setProperty(key, propertyObject.value, true);
+            
+            if (! propertyObject.suppressEvent) {
+                this.queueProperty(key, propertyObject.value);
+            }
+            
+        },
+        
+        /**
+        * Returns a key-value configuration map of the values currently set in  
+        * the Config Object.
+        * @method getConfig
+        * @return {Object} The current config, represented in a key-value map
+        */
+        getConfig: function () {
+        
+            var cfg = {},
+                prop,
+                property;
+                
+            for (prop in this.config) {
+                property = this.config[prop];
+                if (property && property.event) {
+                    cfg[prop] = property.value;
+                }
+            }
+            
+            return cfg;
+        },
+        
+        /**
+        * Returns the value of specified property.
+        * @method getProperty
+        * @param {String} key The name of the property
+        * @return {Object}  The value of the specified property
+        */
+        getProperty: function (key) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.value;
+            } else {
+                return undefined;
+            }
+        },
+        
+        /**
+        * Resets the specified property's value to its initial value.
+        * @method resetProperty
+        * @param {String} key The name of the property
+        * @return {Boolean} True is the property was reset, false if not
+        */
+        resetProperty: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event) {
+    
+                if (this.initialConfig[key] && 
+                    !Lang.isUndefined(this.initialConfig[key])) {
+    
+                    this.setProperty(key, this.initialConfig[key]);
+
+                    return true;
+    
+                }
+    
+            } else {
+    
+                return false;
+            }
+    
+        },
+        
+        /**
+        * Sets the value of a property. If the silent property is passed as 
+        * true, the property's event will not be fired.
+        * @method setProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @param {Boolean} silent Whether the value should be set silently, 
+        * without firing the property event.
+        * @return {Boolean} True, if the set was successful, false if it failed.
+        */
+        setProperty: function (key, value, silent) {
+        
+            var property;
+        
+            key = key.toLowerCase();
+        
+            if (this.queueInProgress && ! silent) {
+                // Currently running through a queue... 
+                this.queueProperty(key,value);
+                return true;
+    
+            } else {
+                property = this.config[key];
+                if (property && property.event) {
+                    if (property.validator && !property.validator(value)) {
+                        return false;
+                    } else {
+                        property.value = value;
+                        if (! silent) {
+                            this.fireEvent(key, value);
+                            this.configChangedEvent.fire([key, value]);
+                        }
+                        return true;
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        
+        /**
+        * Sets the value of a property and queues its event to execute. If the 
+        * event is already scheduled to execute, it is
+        * moved from its current position to the end of the queue.
+        * @method queueProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @return {Boolean}  true, if the set was successful, false if 
+        * it failed.
+        */ 
+        queueProperty: function (key, value) {
+        
+            key = key.toLowerCase();
+        
+            var property = this.config[key],
+                foundDuplicate = false,
+                iLen,
+                queueItem,
+                queueItemKey,
+                queueItemValue,
+                sLen,
+                supercedesCheck,
+                qLen,
+                queueItemCheck,
+                queueItemCheckKey,
+                queueItemCheckValue,
+                i,
+                s,
+                q;
+                                
+            if (property && property.event) {
+    
+                if (!Lang.isUndefined(value) && property.validator && 
+                    !property.validator(value)) { // validator
+                    return false;
+                } else {
+        
+                    if (!Lang.isUndefined(value)) {
+                        property.value = value;
+                    } else {
+                        value = property.value;
+                    }
+        
+                    foundDuplicate = false;
+                    iLen = this.eventQueue.length;
+        
+                    for (i = 0; i < iLen; i++) {
+                        queueItem = this.eventQueue[i];
+        
+                        if (queueItem) {
+                            queueItemKey = queueItem[0];
+                            queueItemValue = queueItem[1];
+
+                            if (queueItemKey == key) {
+    
+                                /*
+                                    found a dupe... push to end of queue, null 
+                                    current item, and break
+                                */
+    
+                                this.eventQueue[i] = null;
+    
+                                this.eventQueue.push(
+                                    [key, (!Lang.isUndefined(value) ? 
+                                    value : queueItemValue)]);
+    
+                                foundDuplicate = true;
+                                break;
+                            }
+                        }
+                    }
+                    
+                    // this is a refire, or a new property in the queue
+    
+                    if (! foundDuplicate && !Lang.isUndefined(value)) { 
+                        this.eventQueue.push([key, value]);
+                    }
+                }
+        
+                if (property.supercedes) {
+
+                    sLen = property.supercedes.length;
+
+                    for (s = 0; s < sLen; s++) {
+
+                        supercedesCheck = property.supercedes[s];
+                        qLen = this.eventQueue.length;
+
+                        for (q = 0; q < qLen; q++) {
+                            queueItemCheck = this.eventQueue[q];
+
+                            if (queueItemCheck) {
+                                queueItemCheckKey = queueItemCheck[0];
+                                queueItemCheckValue = queueItemCheck[1];
+
+                                if (queueItemCheckKey == 
+                                    supercedesCheck.toLowerCase() ) {
+
+                                    this.eventQueue.push([queueItemCheckKey, 
+                                        queueItemCheckValue]);
+
+                                    this.eventQueue[q] = null;
+                                    break;
+
+                                }
+                            }
+                        }
+                    }
+                }
+
+
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Fires the event for a property using the property's current value.
+        * @method refireEvent
+        * @param {String} key The name of the property
+        */
+        refireEvent: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event && 
+    
+                !Lang.isUndefined(property.value)) {
+    
+                if (this.queueInProgress) {
+    
+                    this.queueProperty(key);
+    
+                } else {
+    
+                    this.fireEvent(key, property.value);
+    
+                }
+    
+            }
+        },
+        
+        /**
+        * Applies a key-value Object literal to the configuration, replacing  
+        * any existing values, and queueing the property events.
+        * Although the values will be set, fireQueue() must be called for their 
+        * associated events to execute.
+        * @method applyConfig
+        * @param {Object} userConfig The configuration Object literal
+        * @param {Boolean} init  When set to true, the initialConfig will 
+        * be set to the userConfig passed in, so that calling a reset will 
+        * reset the properties to the passed values.
+        */
+        applyConfig: function (userConfig, init) {
+        
+            var sKey,
+                oConfig;
+
+            if (init) {
+                oConfig = {};
+                for (sKey in userConfig) {
+                    if (Lang.hasOwnProperty(userConfig, sKey)) {
+                        oConfig[sKey.toLowerCase()] = userConfig[sKey];
+                    }
+                }
+                this.initialConfig = oConfig;
+            }
+
+            for (sKey in userConfig) {
+                if (Lang.hasOwnProperty(userConfig, sKey)) {
+                    this.queueProperty(sKey, userConfig[sKey]);
+                }
+            }
+        },
+        
+        /**
+        * Refires the events for all configuration properties using their 
+        * current values.
+        * @method refresh
+        */
+        refresh: function () {
+        
+            var prop;
+        
+            for (prop in this.config) {
+                this.refireEvent(prop);
+            }
+        },
+        
+        /**
+        * Fires the normalized list of queued property change events
+        * @method fireQueue
+        */
+        fireQueue: function () {
+        
+            var i, 
+                queueItem,
+                key,
+                value,
+                property;
+        
+            this.queueInProgress = true;
+            for (i = 0;i < this.eventQueue.length; i++) {
+                queueItem = this.eventQueue[i];
+                if (queueItem) {
+        
+                    key = queueItem[0];
+                    value = queueItem[1];
+                    property = this.config[key];
+        
+                    property.value = value;
+        
+                    this.fireEvent(key,value);
+                }
+            }
+            
+            this.queueInProgress = false;
+            this.eventQueue = [];
+        },
+        
+        /**
+        * Subscribes an external handler to the change event for any 
+        * given property. 
+        * @method subscribeToConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event handler 
+        * (see CustomEvent documentation)
+        * @param {Boolean} override Optional. If true, will override "this"  
+        * within the handler to map to the scope Object passed into the method.
+        * @return {Boolean} True, if the subscription was successful, 
+        * otherwise false.
+        */ 
+        subscribeToConfigEvent: function (key, handler, obj, override) {
+    
+            var property = this.config[key.toLowerCase()];
+    
+            if (property && property.event) {
+                if (!Config.alreadySubscribed(property.event, handler, obj)) {
+                    property.event.subscribe(handler, obj, override);
+                }
+                return true;
+            } else {
+                return false;
+            }
+    
+        },
+        
+        /**
+        * Unsubscribes an external handler from the change event for any 
+        * given property. 
+        * @method unsubscribeFromConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event 
+        * handler (see CustomEvent documentation)
+        * @return {Boolean} True, if the unsubscription was successful, 
+        * otherwise false.
+        */
+        unsubscribeFromConfigEvent: function (key, handler, obj) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.event.unsubscribe(handler, obj);
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Returns a string representation of the Config object
+        * @method toString
+        * @return {String} The Config object in string format.
+        */
+        toString: function () {
+            var output = "Config";
+            if (this.owner) {
+                output += " [" + this.owner.toString() + "]";
+            }
+            return output;
+        },
+        
+        /**
+        * Returns a string representation of the Config object's current 
+        * CustomEvent queue
+        * @method outputEventQueue
+        * @return {String} The string list of CustomEvents currently queued 
+        * for execution
+        */
+        outputEventQueue: function () {
+
+            var output = "",
+                queueItem,
+                q,
+                nQueue = this.eventQueue.length;
+              
+            for (q = 0; q < nQueue; q++) {
+                queueItem = this.eventQueue[q];
+                if (queueItem) {
+                    output += queueItem[0] + "=" + queueItem[1] + ", ";
+                }
+            }
+            return output;
+        },
+
+        /**
+        * Sets all properties to null, unsubscribes all listeners from each 
+        * property's change event and all listeners from the configChangedEvent.
+        * @method destroy
+        */
+        destroy: function () {
+
+            var oConfig = this.config,
+                sProperty,
+                oProperty;
+
+
+            for (sProperty in oConfig) {
+            
+                if (Lang.hasOwnProperty(oConfig, sProperty)) {
+
+                    oProperty = oConfig[sProperty];
+
+                    oProperty.event.unsubscribeAll();
+                    oProperty.event = null;
+
+                }
+            
+            }
+            
+            this.configChangedEvent.unsubscribeAll();
+            
+            this.configChangedEvent = null;
+            this.owner = null;
+            this.config = null;
+            this.initialConfig = null;
+            this.eventQueue = null;
+        
+        }
+
+    };
+    
+    
+    
+    /**
+    * Checks to determine if a particular function/Object pair are already 
+    * subscribed to the specified CustomEvent
+    * @method YAHOO.util.Config.alreadySubscribed
+    * @static
+    * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check 
+    * the subscriptions
+    * @param {Function} fn The function to look for in the subscribers list
+    * @param {Object} obj The execution scope Object for the subscription
+    * @return {Boolean} true, if the function/Object pair is already subscribed 
+    * to the CustomEvent passed in
+    */
+    Config.alreadySubscribed = function (evt, fn, obj) {
+    
+        var nSubscribers = evt.subscribers.length,
+            subsc,
+            i;
+
+        if (nSubscribers > 0) {
+            i = nSubscribers - 1;
+            do {
+                subsc = evt.subscribers[i];
+                if (subsc && subsc.obj == obj && subsc.fn == fn) {
+                    return true;
+                }
+            }
+            while (i--);
+        }
 
-	/**
-	* Returns a string representation of the Config object's current CustomEvent queue
-	* @method outputEventQueue
-	* @return {String}	The string list of CustomEvents currently queued for execution
-	*/
-	outputEventQueue : function() {
-		var output = "";
-		for (var q=0;q<this.eventQueue.length;q++) {
-			var queueItem = this.eventQueue[q];
-			if (queueItem) {
-				output += queueItem[0] + "=" + queueItem[1] + ", ";
-			}
-		}
-		return output;
-	}
-};
+        return false;
 
+    };
 
-/**
-* Initializes the configuration Object and all of its local members.
-* @method init
-* @param {Object}	owner	The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config.prototype.init = function(owner) {
-	this.owner = owner;
-	this.configChangedEvent = new YAHOO.util.CustomEvent(YAHOO.util.CONFIG_CHANGED_EVENT, this);
-	this.queueInProgress = false;
-	this.config = {};
-	this.initialConfig = {};
-	this.eventQueue = [];
-};
+    YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
 
-/**
-* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent
-* @method YAHOO.util.Config.alreadySubscribed
-* @static
-* @param {YAHOO.util.CustomEvent} evt	The CustomEvent for which to check the subscriptions
-* @param {Function}	fn	The function to look for in the subscribers list
-* @param {Object}	obj	The execution scope Object for the subscription
-* @return {Boolean}	true, if the function/Object pair is already subscribed to the CustomEvent passed in
-*/
-YAHOO.util.Config.alreadySubscribed = function(evt, fn, obj) {
-	for (var e=0;e<evt.subscribers.length;e++) {
-		var subsc = evt.subscribers[e];
-		if (subsc && subsc.obj == obj && subsc.fn == fn) {
-			return true;
-		}
-	}
-	return false;
-};
+}());
 
 /**
 * YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility
@@ -641,7 +847,7 @@
 	* @return {Date}	January 1 of the calendar year specified.
 	*/
 	getJan1 : function(calendarYear) {
-		return new Date(calendarYear,0,1); 
+		return this.getDate(calendarYear,0,1);
 	},
 
 	/**
@@ -671,14 +877,13 @@
 	* @param {Date}	date	The JavaScript date for which to find the week number
 	* @param {Number} calendarYear	OPTIONAL - The calendar year to use for determining the week number. Default is
 	*											the calendar year of parameter "date".
-	* @param {Number} weekStartsOn	OPTIONAL - The integer (0-6) representing which day a week begins on. Default is 0 (for Sunday).
 	* @return {Number}	The week number of the given date.
 	*/
 	getWeekNumber : function(date, calendarYear) {
 		date = this.clearTime(date);
 		var nearestThurs = new Date(date.getTime() + (4 * this.ONE_DAY_MS) - ((date.getDay()) * this.ONE_DAY_MS));
 
-		var jan1 = new Date(nearestThurs.getFullYear(),0,1);
+		var jan1 = this.getDate(nearestThurs.getFullYear(),0,1);
 		var dayOfYear = ((nearestThurs.getTime() - jan1.getTime()) / this.ONE_DAY_MS) - 1;
 
 		var weekNum = Math.ceil((dayOfYear)/ 7);
@@ -722,7 +927,7 @@
 	* @return {Date}		The JavaScript Date representing the first day of the month
 	*/
 	findMonthStart : function(date) {
-		var start = new Date(date.getFullYear(), date.getMonth(), 1);
+		var start = this.getDate(date.getFullYear(), date.getMonth(), 1);
 		return start;
 	},
 
@@ -748,14 +953,46 @@
 	clearTime : function(date) {
 		date.setHours(12,0,0,0);
 		return date;
+	},
+
+	/**
+	 * Returns a new JavaScript Date object, representing the given year, month and date. Time fields (hr, min, sec, ms) on the new Date object
+	 * are set to 0. The method allows Date instances to be created with the a year less than 100. "new Date(year, month, date)" implementations 
+	 * set the year to 19xx if a year (xx) which is less than 100 is provided.
+	 * <p>
+	 * <em>NOTE:</em>Validation on argument values is not performed. It is the caller's responsibility to ensure
+	 * arguments are valid as per the ECMAScript-262 Date object specification for the new Date(year, month[, date]) constructor.
+	 * </p>
+	 * @method getDate
+	 * @param {Number} y Year.
+	 * @param {Number} m Month index from 0 (Jan) to 11 (Dec).
+	 * @param {Number} d (optional) Date from 1 to 31. If not provided, defaults to 1.
+	 * @return {Date} The JavaScript date object with year, month, date set as provided.
+	 */
+	getDate : function(y, m, d) {
+		var dt = null;
+		if (YAHOO.lang.isUndefined(d)) {
+			d = 1;
+		}
+		if (y >= 100) {
+			dt = new Date(y, m, d);
+		} else {
+			dt = new Date();
+			dt.setFullYear(y);
+			dt.setMonth(m);
+			dt.setDate(d);
+			dt.setHours(0,0,0,0);
+		}
+		return dt;
 	}
 };
 
 /**
-* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month ("one-up") or two-month ("two-up") interface. Calendars are generated entirely via script and can be navigated without any page refreshes.
+* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month or
+* multi-month interface. Calendars are generated entirely via script and can be navigated without any page refreshes.
 * @module    calendar
-* @title     Calendar
-* @namespace YAHOO.widget
+* @title    Calendar
+* @namespace  YAHOO.widget
 * @requires  yahoo,dom,event
 */
 
@@ -767,19 +1004,39 @@
 * <p>To construct the placeholder for the calendar widget, the code is as
 * follows:
 *	<xmp>
-*		<div id="cal1Container"></div>
+*		<div id="calContainer"></div>
+*	</xmp>
+* </p>
+* <p>
+* <strong>NOTE: As of 2.4.0, the constructor's ID argument is optional.</strong>
+* The Calendar can be constructed by simply providing a container ID string, 
+* or a reference to a container DIV HTMLElement (the element needs to exist 
+* in the document).
+* 
+* E.g.:
+*	<xmp>
+*		var c = new YAHOO.widget.Calendar("calContainer", configOptions);
 *	</xmp>
-* Note that the table can be replaced with any kind of element.
+* or:
+*   <xmp>
+*       var containerDiv = YAHOO.util.Dom.get("calContainer");
+*		var c = new YAHOO.widget.Calendar(containerDiv, configOptions);
+*	</xmp>
+* </p>
+* <p>
+* If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix.
+* For example if an ID is not provided, and the container's ID is "calContainer", the Calendar's ID will be set to "calContainer_t".
 * </p>
+* 
 * @namespace YAHOO.widget
 * @class Calendar
 * @constructor
-* @param {String}	id			The id of the table element that will represent the calendar widget
-* @param {String}	containerId	The id of the container div element that will wrap the calendar table
-* @param {Object}	config		The configuration object containing the Calendar's arguments
+* @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional.
+* @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document.
+* @param {Object} config optional The configuration object containing the initial configuration values for the Calendar.
 */
 YAHOO.widget.Calendar = function(id, containerId, config) {
-	this.init(id, containerId, config);
+	this.init.apply(this, arguments);
 };
 
 /**
@@ -899,23 +1156,24 @@
 * @type Object
 */
 YAHOO.widget.Calendar._DEFAULT_CONFIG = {
-	PAGEDATE : {key:"pagedate", value:new Date()},
-	SELECTED : {key:"selected", value:[]},
+	// Default values for pagedate and selected are not class level constants - they are set during instance creation 
+	PAGEDATE : {key:"pagedate", value:null},
+	SELECTED : {key:"selected", value:null},
 	TITLE : {key:"title", value:""},
 	CLOSE : {key:"close", value:false},
-	IFRAME : {key:"iframe", value:true},
+	IFRAME : {key:"iframe", value:(YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) ? true : false},
 	MINDATE : {key:"mindate", value:null},
 	MAXDATE : {key:"maxdate", value:null},
-	MULTI_SELECT : {key:"multi_select",	value:false},
-	OOM_SELECT : {key:"oom_select",	value:false},
+	MULTI_SELECT : {key:"multi_select", value:false},
 	START_WEEKDAY : {key:"start_weekday", value:0},
 	SHOW_WEEKDAYS : {key:"show_weekdays", value:true},
 	SHOW_WEEK_HEADER : {key:"show_week_header", value:false},
 	SHOW_WEEK_FOOTER : {key:"show_week_footer", value:false},
 	HIDE_BLANK_WEEKS : {key:"hide_blank_weeks", value:false},
+	OUT_OF_MONTH_SELECT : {key:"out_of_month_select", value:false},
 	NAV_ARROW_LEFT: {key:"nav_arrow_left", value:null} ,
 	NAV_ARROW_RIGHT : {key:"nav_arrow_right", value:null} ,
-	MONTHS_SHORT : {key:"months_short",	value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]},
+	MONTHS_SHORT : {key:"months_short", value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]},
 	MONTHS_LONG: {key:"months_long", value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]},
 	WEEKDAYS_1CHAR: {key:"weekdays_1char", value:["S", "M", "T", "W", "T", "F", "S"]},
 	WEEKDAYS_SHORT: {key:"weekdays_short", value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]},
@@ -932,7 +1190,12 @@
 	MD_DAY_POSITION:{key:"md_day_position", value:2},
 	MDY_MONTH_POSITION:{key:"mdy_month_position", value:1},
 	MDY_DAY_POSITION:{key:"mdy_day_position", value:2},
-	MDY_YEAR_POSITION:{key:"mdy_year_position", value:3}
+	MDY_YEAR_POSITION:{key:"mdy_year_position", value:3},
+	MY_LABEL_MONTH_POSITION:{key:"my_label_month_position", value:1},
+	MY_LABEL_YEAR_POSITION:{key:"my_label_year_position", value:2},
+	MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix", value:" "},
+	MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix", value:""},
+	NAV: {key:"navigator", value: null}
 };
 
 /**
@@ -952,11 +1215,21 @@
 	BEFORE_RENDER : "beforeRender",
 	RENDER : "render",
 	RESET : "reset",
-	CLEAR : "clear"
+	CLEAR : "clear",
+	BEFORE_HIDE : "beforeHide",
+	HIDE : "hide",
+	BEFORE_SHOW : "beforeShow",
+	SHOW : "show",
+	BEFORE_HIDE_NAV : "beforeHideNav",
+	HIDE_NAV : "hideNav",
+	BEFORE_SHOW_NAV : "beforeShowNav",
+	SHOW_NAV : "showNav",
+	BEFORE_RENDER_NAV : "beforeRenderNav",
+	RENDER_NAV : "renderNav"
 };
 
 /**
-* Collection of Default Style constants for the Calendar
+* The set of default style constants for the Calendar
 * @property YAHOO.widget.Calendar._STYLES
 * @final
 * @static
@@ -985,6 +1258,7 @@
 	CSS_CONTAINER : "yui-calcontainer",
 	CSS_NAV_LEFT : "calnavleft",
 	CSS_NAV_RIGHT : "calnavright",
+	CSS_NAV : "calnav",
 	CSS_CLOSE : "calclose",
 	CSS_CELL_TOP : "calcelltop",
 	CSS_CELL_LEFT : "calcellleft",
@@ -1028,7 +1302,7 @@
 	* @type HTMLTableCellElement[]
 	*/
 	cells : null,
-	
+
 	/**
 	* The collection of calendar cell dates that is parallel to the cells collection. The array contains dates field arrays in the format of [YYYY, M, D].
 	* @property cellDates
@@ -1037,13 +1311,20 @@
 	cellDates : null,
 
 	/**
-	* The id that uniquely identifies this calendar. This id should match the id of the placeholder element on the page.
+	* The id that uniquely identifies this Calendar.
 	* @property id
 	* @type String
 	*/
 	id : null,
 
 	/**
+	* The unique id associated with the Calendar's container
+	* @property containerId
+	* @type String
+	*/
+	containerId: null,
+
+	/**
 	* The DOM element reference that points to this calendar's container element. The calendar will be inserted into this element when the shell is rendered.
 	* @property oDomContainer
 	* @type HTMLElement
@@ -1073,6 +1354,14 @@
 	_renderStack : null,
 
 	/**
+	* A reference to the CalendarNavigator instance created for this Calendar.
+	* Will be null if the "navigator" configuration property has not been set
+	* @property oNavigator
+	* @type CalendarNavigator
+	*/
+	oNavigator : null,
+
+	/**
 	* The private list of initially selected dates.
 	* @property _selectedDates
 	* @private
@@ -1085,2348 +1374,2861 @@
 	* @property domEventMap
 	* @type Object
 	*/
-	domEventMap : null
-};
-
-
-
-/**
-* Initializes the Calendar widget.
-* @method init
-* @param {String}	id			The id of the table element that will represent the calendar widget
-* @param {String}	containerId	The id of the container div element that will wrap the calendar table
-* @param {Object}	config		The configuration object containing the Calendar's arguments
-*/
-YAHOO.widget.Calendar.prototype.init = function(id, containerId, config) {
-	this.initEvents();
-	this.today = new Date();
-	YAHOO.widget.DateMath.clearTime(this.today);
+	domEventMap : null,
 
-	this.id = id;
-	this.oDomContainer = document.getElementById(containerId);
-
-	/**
-	* The Config object used to hold the configuration variables for the Calendar
-	* @property cfg
-	* @type YAHOO.util.Config
-	*/
-	this.cfg = new YAHOO.util.Config(this);
-	
 	/**
-	* The local object which contains the Calendar's options
-	* @property Options
-	* @type Object
-	*/
-	this.Options = {};
+	 * Protected helper used to parse Calendar constructor/init arguments.
+	 *
+	 * As of 2.4.0, Calendar supports a simpler constructor 
+	 * signature. This method reconciles arguments
+	 * received in the pre 2.4.0 and 2.4.0 formats.
+	 * 
+	 * @protected
+	 * @method _parseArgs
+	 * @param {Array} Function "arguments" array
+	 * @return {Object} Object with id, container, config properties containing
+	 * the reconciled argument values.
+	 **/
+	_parseArgs : function(args) {
+		/*
+		   2.4.0 Constructors signatures
+
+		   new Calendar(String)
+		   new Calendar(HTMLElement)
+		   new Calendar(String, ConfigObject)
+		   new Calendar(HTMLElement, ConfigObject)
+
+		   Pre 2.4.0 Constructor signatures
+
+		   new Calendar(String, String)
+		   new Calendar(String, HTMLElement)
+		   new Calendar(String, String, ConfigObject)
+		   new Calendar(String, HTMLElement, ConfigObject)
+		 */
+		var nArgs = {id:null, container:null, config:null};
+
+		if (args && args.length && args.length > 0) {
+			switch (args.length) {
+				case 1:
+					nArgs.id = null;
+					nArgs.container = args[0];
+					nArgs.config = null;
+					break;
+				case 2:
+					if (YAHOO.lang.isObject(args[1]) && !args[1].tagName && !(args[1] instanceof String)) {
+						nArgs.id = null;
+						nArgs.container = args[0];
+						nArgs.config = args[1];
+					} else {
+						nArgs.id = args[0];
+						nArgs.container = args[1];
+						nArgs.config = null;
+					}
+					break;
+				default: // 3+
+					nArgs.id = args[0];
+					nArgs.container = args[1];
+					nArgs.config = args[2];
+					break;
+			}
+		} else {
+		}
+		return nArgs;
+	},
 
 	/**
-	* The local object which contains the Calendar's locale settings
-	* @property Locale
-	* @type Object
+	* Initializes the Calendar widget.
+	* @method init
+	*
+	* @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional.
+	* @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document.
+	* @param {Object} config optional The configuration object containing the initial configuration values for the Calendar.
 	*/
-	this.Locale = {};
+	init : function(id, container, config) {
+		// Normalize 2.4.0, pre 2.4.0 args
+		var nArgs = this._parseArgs(arguments);
 
-	this.initStyles();
+		id = nArgs.id;
+		container = nArgs.container;
+		config = nArgs.config;
 
-	YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER);	
-	YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE);
+		this.oDomContainer = YAHOO.util.Dom.get(container);
 
-	this.cellDates = [];
-	this.cells = [];
-	this.renderStack = [];
-	this._renderStack = [];
+		if (!this.oDomContainer.id) {
+			this.oDomContainer.id = YAHOO.util.Dom.generateId();
+		}
+		if (!id) {
+			id = this.oDomContainer.id + "_t";
+		}
 
-	this.setupConfig();
-	
-	if (config) {
-		this.cfg.applyConfig(config, true);
-	}
-	
-	this.cfg.fireQueue();
-};
+		this.id = id;
+		this.containerId = this.oDomContainer.id;
 
-/**
-* Renders the built-in IFRAME shim for the IE6 and below
-* @method configIframe
-*/
-YAHOO.widget.Calendar.prototype.configIframe = function(type, args, obj) {
-	var useIframe = args[0];
+		this.initEvents();
 
-	if (!this.parent) {
-		if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
-			if (useIframe) {
-				var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
-
-				if (this.browser == "ie" && (pos == "absolute" || pos == "relative")) {
-					if (! YAHOO.util.Dom.inDocument(this.iframe)) {
-						this.iframe = document.createElement("iframe");
-						this.iframe.src = "javascript:false;";
-						YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");
-						this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
-					}
-				}
-			} else {
-				if (this.iframe) {
-					if (this.iframe.parentNode) {
-						this.iframe.parentNode.removeChild(this.iframe);
-					}
-					this.iframe = null;
-				}
-			}
-		}
-	}
-};
+		this.today = new Date();
+		YAHOO.widget.DateMath.clearTime(this.today);
 
-/**
-* Default handler for the "title" property
-* @method configTitle
-*/
-YAHOO.widget.Calendar.prototype.configTitle = function(type, args, obj) {
-	var title = args[0];
-	var close = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);
-	
-	var titleDiv;
-
-	if (title && title !== "") {
-		titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");
-		titleDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;
-		titleDiv.innerHTML = title;
-		this.oDomContainer.insertBefore(titleDiv, this.oDomContainer.firstChild);
-		YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
-	} else {
-		titleDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null;
+		/**
+		* The Config object used to hold the configuration variables for the Calendar
+		* @property cfg
+		* @type YAHOO.util.Config
+		*/
+		this.cfg = new YAHOO.util.Config(this);
 
-		if (titleDiv) {
-			YAHOO.util.Event.purgeElement(titleDiv);
-			this.oDomContainer.removeChild(titleDiv);
-		}
-		if (! close) {
-			YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");
-		}
-	}
-};
+		/**
+		* The local object which contains the Calendar's options
+		* @property Options
+		* @type Object
+		*/
+		this.Options = {};
 
-/**
-* Default handler for the "close" property
-* @method configClose
-*/
-YAHOO.widget.Calendar.prototype.configClose = function(type, args, obj) {
-	var close = args[0];
-	var title = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);
-	
-	var DEPR_CLOSE_PATH = "us/my/bn/x_d.gif";
-
-	var linkClose;
-
-	if (close === true) {
-		linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || document.createElement("a");
-		linkClose.href = "#";
-		linkClose.className = "link-close";
-		YAHOO.util.Event.addListener(linkClose, "click", function(e, cal) {cal.hide(); YAHOO.util.Event.preventDefault(e); }, this);
-		
-		if (YAHOO.widget.Calendar.IMG_ROOT !== null) {
-			var imgClose = document.createElement("img");
-			imgClose.src = YAHOO.widget.Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
-			imgClose.className = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE;
-			linkClose.appendChild(imgClose);
-		} else {
-			linkClose.innerHTML = '<span class="' + YAHOO.widget.CalendarGroup.CSS_2UPCLOSE + ' ' + this.Style.CSS_CLOSE + '"></span>';
-		}
-		
-		this.oDomContainer.appendChild(linkClose);
-		YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
-	} else {
-		linkClose = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;
-		if (linkClose) {
-			YAHOO.util.Event.purgeElement(linkClose);
-			this.oDomContainer.removeChild(linkClose);
-		}
-		if (! title || title === "") {
-			YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");
-		}
-	}
-};
+		/**
+		* The local object which contains the Calendar's locale settings
+		* @property Locale
+		* @type Object
+		*/
+		this.Locale = {};
 
-/**
-* Initializes Calendar's built-in CustomEvents
-* @method initEvents
-*/
-YAHOO.widget.Calendar.prototype.initEvents = function() {
+		this.initStyles();
 
-	var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+		YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER);
+		YAHOO.util.Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE);
 
-	/**
-	* Fired before a selection is made
-	* @event beforeSelectEvent
-	*/
-	this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT); 
+		this.cellDates = [];
+		this.cells = [];
+		this.renderStack = [];
+		this._renderStack = [];
 
-	/**
-	* Fired when a selection is made
-	* @event selectEvent
-	* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].
-	*/
-	this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT);
+		this.setupConfig();
 
-	/**
-	* Fired before a selection is made
-	* @event beforeDeselectEvent
-	*/
-	this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);
+		if (config) {
+			this.cfg.applyConfig(config, true);
+		}
 
-	/**
-	* Fired when a selection is made
-	* @event deselectEvent
-	* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].
-	*/
-	this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT);
+		this.cfg.fireQueue();
+	},
 
 	/**
-	* Fired when the Calendar page is changed
-	* @event changePageEvent
-	*/
-	this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);
+	* Default Config listener for the iframe property. If the iframe config property is set to true, 
+	* renders the built-in IFRAME shim if the container is relatively or absolutely positioned.
+	* 
+	* @method configIframe
+	*/
+	configIframe : function(type, args, obj) {
+		var useIframe = args[0];
+	
+		if (!this.parent) {
+			if (YAHOO.util.Dom.inDocument(this.oDomContainer)) {
+				if (useIframe) {
+					var pos = YAHOO.util.Dom.getStyle(this.oDomContainer, "position");
+					
+					if (pos == "absolute" || pos == "relative") {
+						
+						if (!YAHOO.util.Dom.inDocument(this.iframe)) {
+							this.iframe = document.createElement("iframe");
+							this.iframe.src = "javascript:false;";
+	
+							YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");
+	
+							if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
+								YAHOO.util.Dom.addClass(this.iframe, "fixedsize");
+							}
+	
+							this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
+						}
+					}
+				} else {
+					if (this.iframe) {
+						if (this.iframe.parentNode) {
+							this.iframe.parentNode.removeChild(this.iframe);
+						}
+						this.iframe = null;
+					}
+				}
+			}
+		}
+	},
 
 	/**
-	* Fired before the Calendar is rendered
-	* @event beforeRenderEvent
+	* Default handler for the "title" property
+	* @method configTitle
 	*/
-	this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
+	configTitle : function(type, args, obj) {
+		var title = args[0];
 
+		// "" disables title bar
+		if (title) {
+			this.createTitleBar(title);
+		} else {
+			var close = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.CLOSE.key);
+			if (!close) {
+				this.removeTitleBar();
+			} else {
+				this.createTitleBar("&#160;");
+			}
+		}
+	},
+	
 	/**
-	* Fired when the Calendar is rendered
-	* @event renderEvent
+	* Default handler for the "close" property
+	* @method configClose
 	*/
-	this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
-
+	configClose : function(type, args, obj) {
+		var close = args[0],
+			title = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.TITLE.key);
+	
+		if (close) {
+			if (!title) {
+				this.createTitleBar("&#160;");
+			}
+			this.createCloseButton();
+		} else {
+			this.removeCloseButton();
+			if (!title) {
+				this.removeTitleBar();
+			}
+		}
+	},
+	
 	/**
-	* Fired when the Calendar is reset
-	* @event resetEvent
+	* Initializes Calendar's built-in CustomEvents
+	* @method initEvents
 	*/
-	this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET);
+	initEvents : function() {
+	
+		var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+	
+		/**
+		* Fired before a selection is made
+		* @event beforeSelectEvent
+		*/
+		this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT); 
+	
+		/**
+		* Fired when a selection is made
+		* @event selectEvent
+		* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].
+		*/
+		this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT);
+	
+		/**
+		* Fired before a selection is made
+		* @event beforeDeselectEvent
+		*/
+		this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT);
+	
+		/**
+		* Fired when a selection is made
+		* @event deselectEvent
+		* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].
+		*/
+		this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT);
+	
+		/**
+		* Fired when the Calendar page is changed
+		* @event changePageEvent
+		*/
+		this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE);
+	
+		/**
+		* Fired before the Calendar is rendered
+		* @event beforeRenderEvent
+		*/
+		this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
+	
+		/**
+		* Fired when the Calendar is rendered
+		* @event renderEvent
+		*/
+		this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
+	
+		/**
+		* Fired when the Calendar is reset
+		* @event resetEvent
+		*/
+		this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET);
+	
+		/**
+		* Fired when the Calendar is cleared
+		* @event clearEvent
+		*/
+		this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
+	
+		/**
+		* Fired just before the Calendar is to be shown
+		* @event beforeShowEvent
+		*/
+		this.beforeShowEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW);
+	
+		/**
+		* Fired after the Calendar is shown
+		* @event showEvent
+		*/
+		this.showEvent = new YAHOO.util.CustomEvent(defEvents.SHOW);
+	
+		/**
+		* Fired just before the Calendar is to be hidden
+		* @event beforeHideEvent
+		*/
+		this.beforeHideEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE);
+	
+		/**
+		* Fired after the Calendar is hidden
+		* @event hideEvent
+		*/
+		this.hideEvent = new YAHOO.util.CustomEvent(defEvents.HIDE);
 
-	/**
-	* Fired when the Calendar is cleared
-	* @event clearEvent
-	*/
-	this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
+		/**
+		* Fired just before the CalendarNavigator is to be shown
+		* @event beforeShowNavEvent
+		*/
+		this.beforeShowNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW_NAV);
+	
+		/**
+		* Fired after the CalendarNavigator is shown
+		* @event showNavEvent
+		*/
+		this.showNavEvent = new YAHOO.util.CustomEvent(defEvents.SHOW_NAV);
+	
+		/**
+		* Fired just before the CalendarNavigator is to be hidden
+		* @event beforeHideNavEvent
+		*/
+		this.beforeHideNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE_NAV);
+	
+		/**
+		* Fired after the CalendarNavigator is hidden
+		* @event hideNavEvent
+		*/
+		this.hideNavEvent = new YAHOO.util.CustomEvent(defEvents.HIDE_NAV);
 
-	this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);
-	this.selectEvent.subscribe(this.onSelect, this, true);
-	this.beforeDeselectEvent.subscribe(this.onBeforeDeselect, this, true);
-	this.deselectEvent.subscribe(this.onDeselect, this, true);
-	this.changePageEvent.subscribe(this.onChangePage, this, true);
-	this.renderEvent.subscribe(this.onRender, this, true);
-	this.resetEvent.subscribe(this.onReset, this, true);
-	this.clearEvent.subscribe(this.onClear, this, true);
-};
+		/**
+		* Fired just before the CalendarNavigator is to be rendered
+		* @event beforeRenderNavEvent
+		*/
+		this.beforeRenderNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER_NAV);
 
-/**
-* The default event function that is attached to a date link within a calendar cell
-* when the calendar is rendered.
-* @method doSelectCell
-* @param {DOMEvent} e	The event
-* @param {Calendar} cal	A reference to the calendar passed by the Event utility
-*/
-YAHOO.widget.Calendar.prototype.doSelectCell = function(e, cal) {
-	var cell,index,d,date;
+		/**
+		* Fired after the CalendarNavigator is rendered
+		* @event renderNavEvent
+		*/
+		this.renderNavEvent = new YAHOO.util.CustomEvent(defEvents.RENDER_NAV);
+
+		this.beforeSelectEvent.subscribe(this.onBeforeSelect, this, true);
+		this.selectEvent.subscribe(this.onSelect, this, true);
+		this.beforeDeselectEvent.subscribe(this.onBeforeDeselect, this, true);
+		this.deselectEvent.subscribe(this.onDeselect, this, true);
+		this.changePageEvent.subscribe(this.onChangePage, this, true);
+		this.renderEvent.subscribe(this.onRender, this, true);
+		this.resetEvent.subscribe(this.onReset, this, true);
+		this.clearEvent.subscribe(this.onClear, this, true);
+	},
+	
+	/**
+	* The default event function that is attached to a date link within a calendar cell
+	* when the calendar is rendered.
+	* @method doSelectCell
+	* @param {DOMEvent} e	The event
+	* @param {Calendar} cal	A reference to the calendar passed by the Event utility
+	*/
+	doSelectCell : function(e, cal) {
+		var cell,index,d,date;
+
+		var target = YAHOO.util.Event.getTarget(e);
+		var tagName = target.tagName.toLowerCase();
+		var defSelector = false;
 
-	var target = YAHOO.util.Event.getTarget(e);
-	var tagName = target.tagName.toLowerCase();
-	var defSelector = false;
+		while (tagName != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
 
-	while (tagName != "td" && ! YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+			if (!defSelector && tagName == "a" && YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) {
+				defSelector = true;	
+			}
 
-		if (!defSelector && tagName == "a" && YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) {
-			defSelector = true;	
+			target = target.parentNode;
+			tagName = target.tagName.toLowerCase();
+			// TODO: No need to go all the way up to html.
+			if (tagName == "html") {
+				return;
+			}
 		}
 
-		target = target.parentNode;
-		tagName = target.tagName.toLowerCase(); 
-		if (tagName == "html") {
-			return;
+		if (defSelector) {
+			// Stop link href navigation for default renderer
+			YAHOO.util.Event.preventDefault(e);
 		}
-	}
-
-	if (defSelector) {
-		// Stop link href navigation for default renderer
-		YAHOO.util.Event.preventDefault(e);
-	}
-
-	cell = target;
-
-	if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {
-		index = cell.id.split("cell")[1];
-		d = cal.cellDates[index];
-		date = new Date(d[0],d[1]-1,d[2]);
 	
-		var link;
+		cell = target;
 
-		if (cal.Options.MULTI_SELECT) {
-			link = cell.getElementsByTagName("a")[0];
-			if (link) {
-				link.blur();
-			}
+		if (YAHOO.util.Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {
+			index = cell.id.split("cell")[1];
+			d = cal.cellDates[index];
+			date = YAHOO.widget.DateMath.getDate(d[0],d[1]-1,d[2]);
+		
+			var link;
 
-			var cellDate = cal.cellDates[index];
-			var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);
+			if (cal.Options.MULTI_SELECT) {
+				link = cell.getElementsByTagName("a")[0];
+				if (link) {
+					link.blur();
+				}
+
+				var cellDate = cal.cellDates[index];
+				var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);
 
-			if (cellDateIndex > -1) {	
-				cal.deselectCell(index);
+				if (cellDateIndex > -1) {	
+					cal.deselectCell(index);
+				} else {
+					cal.selectCell(index);
+				}	
+	
 			} else {
+				link = cell.getElementsByTagName("a")[0];
+				if (link) {
+					link.blur();
+				}
 				cal.selectCell(index);
-			}	
-
-		} else {
-			link = cell.getElementsByTagName("a")[0];
-			if (link) {
-				link.blur();
 			}
-			cal.selectCell(index);
 		}
-	}
-};
-
-/**
-* The event that is executed when the user hovers over a cell
-* @method doCellMouseOver
-* @param {DOMEvent} e	The event
-* @param {Calendar} cal	A reference to the calendar passed by the Event utility
-*/
-YAHOO.widget.Calendar.prototype.doCellMouseOver = function(e, cal) {
-	var target;
-	if (e) {
-		target = YAHOO.util.Event.getTarget(e);
-	} else {
-		target = this;
-	}
+	},
 
-	while (target.tagName.toLowerCase() != "td") {
-		target = target.parentNode;
-		if (target.tagName.toLowerCase() == "html") {
-			return;
+	/**
+	* The event that is executed when the user hovers over a cell
+	* @method doCellMouseOver
+	* @param {DOMEvent} e	The event
+	* @param {Calendar} cal	A reference to the calendar passed by the Event utility
+	*/
+	doCellMouseOver : function(e, cal) {
+		var target;
+		if (e) {
+			target = YAHOO.util.Event.getTarget(e);
+		} else {
+			target = this;
 		}
-	}
-
-	if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
-		YAHOO.util.Dom.addClass(target, cal.Style.CSS_CELL_HOVER);
-	}
-};
 
-/**
-* The event that is executed when the user moves the mouse out of a cell
-* @method doCellMouseOut
-* @param {DOMEvent} e	The event
-* @param {Calendar} cal	A reference to the calendar passed by the Event utility
-*/
-YAHOO.widget.Calendar.prototype.doCellMouseOut = function(e, cal) {
-	var target;
-	if (e) {
-		target = YAHOO.util.Event.getTarget(e);
-	} else {
-		target = this;
-	}
-
-	while (target.tagName.toLowerCase() != "td") {
-		target = target.parentNode;
-		if (target.tagName.toLowerCase() == "html") {
-			return;
+		while (target.tagName && target.tagName.toLowerCase() != "td") {
+			target = target.parentNode;
+			if (!target.tagName || target.tagName.toLowerCase() == "html") {
+				return;
+			}
 		}
-	}
-
-	if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
-		YAHOO.util.Dom.removeClass(target, cal.Style.CSS_CELL_HOVER);
-	}
-};
-
-YAHOO.widget.Calendar.prototype.setupConfig = function() {
-
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-
-	/**
-	* The month/year representing the current visible Calendar date (mm/yyyy)
-	* @config pagedate
-	* @type String
-	* @default today's date
-	*/
-	this.cfg.addProperty(defCfg.PAGEDATE.key, { value:defCfg.PAGEDATE.value, handler:this.configPageDate } );
-
-	/**
-	* The date or range of dates representing the current Calendar selection
-	* @config selected
-	* @type String
-	* @default []
-	*/
-	this.cfg.addProperty(defCfg.SELECTED.key, { value:defCfg.SELECTED.value, handler:this.configSelected } );
-
-	/**
-	* The title to display above the Calendar's month header
-	* @config title
-	* @type String
-	* @default ""
-	*/
-	this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
-
-	/**
-	* Whether or not a close button should be displayed for this Calendar
-	* @config close
-	* @type Boolean
-	* @default false
-	*/
-	this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
-
-	/**
-	* Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
-	* @config iframe
-	* @type Boolean
-	* @default true
-	*/
-	this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
 
-	/**
-	* The minimum selectable date in the current Calendar (mm/dd/yyyy)
-	* @config mindate
-	* @type String
-	* @default null
-	*/
-	this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.configMinDate } );
+		if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+			YAHOO.util.Dom.addClass(target, cal.Style.CSS_CELL_HOVER);
+		}
+	},
 
 	/**
-	* The maximum selectable date in the current Calendar (mm/dd/yyyy)
-	* @config maxdate
-	* @type String
-	* @default null
-	*/
-	this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.configMaxDate } );
+	* The event that is executed when the user moves the mouse out of a cell
+	* @method doCellMouseOut
+	* @param {DOMEvent} e	The event
+	* @param {Calendar} cal	A reference to the calendar passed by the Event utility
+	*/
+	doCellMouseOut : function(e, cal) {
+		var target;
+		if (e) {
+			target = YAHOO.util.Event.getTarget(e);
+		} else {
+			target = this;
+		}
 
+		while (target.tagName && target.tagName.toLowerCase() != "td") {
+			target = target.parentNode;
+			if (!target.tagName || target.tagName.toLowerCase() == "html") {
+				return;
+			}
+		}
 
-	// Options properties
+		if (YAHOO.util.Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
+			YAHOO.util.Dom.removeClass(target, cal.Style.CSS_CELL_HOVER);
+		}
+	},
+	
+	setupConfig : function() {
+	
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
 
-	/**
-	* True if the Calendar should allow multiple selections. False by default.
-	* @config MULTI_SELECT
-	* @type Boolean
-	* @default false
-	*/
-	this.cfg.addProperty(defCfg.MULTI_SELECT.key,	{ value:defCfg.MULTI_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+		/**
+		* The month/year representing the current visible Calendar date (mm/yyyy)
+		* @config pagedate
+		* @type String
+		* @default today's date
+		*/
+		this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
-    /**
-    * True if the Calendar should allow selection of out-of-month dates. False by default.
-    * @config OOM_SELECT
-    * @type Boolean
-    * @default false
-    */
-    this.cfg.addProperty(defCfg.OOM_SELECT.key,      { value:defCfg.OOM_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+		/**
+		* The date or range of dates representing the current Calendar selection
+		* @config selected
+		* @type String
+		* @default []
+		*/
+		this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
-	/**
-	* The weekday the week begins on. Default is 0 (Sunday).
-	* @config START_WEEKDAY
-	* @type number
-	* @default 0
-	*/
-	this.cfg.addProperty(defCfg.START_WEEKDAY.key,	{ value:defCfg.START_WEEKDAY.value, handler:this.configOptions, validator:this.cfg.checkNumber  } );
+		/**
+		* The title to display above the Calendar's month header
+		* @config title
+		* @type String
+		* @default ""
+		*/
+		this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
-	/**
-	* True if the Calendar should show weekday labels. True by default.
-	* @config SHOW_WEEKDAYS
-	* @type Boolean
-	* @default true
-	*/
-	this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,	{ value:defCfg.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
+		/**
+		* Whether or not a close button should be displayed for this Calendar
+		* @config close
+		* @type Boolean
+		* @default false
+		*/
+		this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
-	/**
-	* True if the Calendar should show week row headers. False by default.
-	* @config SHOW_WEEK_HEADER
-	* @type Boolean
-	* @default false
-	*/
-	this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key, { value:defCfg.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+		/**
+		* Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+		* This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+		* enabled if required.
+		* 
+		* @config iframe
+		* @type Boolean
+		* @default true for IE6 and below, false for all other browsers
+		*/
+		this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
 
-	/**
-	* True if the Calendar should show week row footers. False by default.
-	* @config SHOW_WEEK_FOOTER
-	* @type Boolean
-	* @default false
-	*/	
-	this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+		/**
+		* The minimum selectable date in the current Calendar (mm/dd/yyyy)
+		* @config mindate
+		* @type String
+		* @default null
+		*/
+		this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.configMinDate } );
 
-	/**
-	* True if the Calendar should suppress weeks that are not a part of the current month. False by default.
-	* @config HIDE_BLANK_WEEKS
-	* @type Boolean
-	* @default false
-	*/	
-	this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key, { value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+		/**
+		* The maximum selectable date in the current Calendar (mm/dd/yyyy)
+		* @config maxdate
+		* @type String
+		* @default null
+		*/
+		this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.configMaxDate } );
 	
-	/**
-	* The image that should be used for the left navigation arrow.
-	* @config NAV_ARROW_LEFT
-	* @type String
-	* @deprecated	You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"  
-	* @default null
-	*/	
-	this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,	{ value:defCfg.NAV_ARROW_LEFT.value, handler:this.configOptions } );
-
-	/**
-	* The image that should be used for the right navigation arrow.
-	* @config NAV_ARROW_RIGHT
-	* @type String
-	* @deprecated	You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
-	* @default null
-	*/	
-	this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key, { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.configOptions } );
-
-	// Locale properties
-
-	/**
-	* The short month labels for the current locale.
-	* @config MONTHS_SHORT
-	* @type String[]
-	* @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
-	*/
-	this.cfg.addProperty(defCfg.MONTHS_SHORT.key,	{ value:defCfg.MONTHS_SHORT.value, handler:this.configLocale } );
 	
-	/**
-	* The long month labels for the current locale.
-	* @config MONTHS_LONG
-	* @type String[]
-	* @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
-	*/	
-	this.cfg.addProperty(defCfg.MONTHS_LONG.key,		{ value:defCfg.MONTHS_LONG.value, handler:this.configLocale } );
+		// Options properties
 	
-	/**
-	* The 1-character weekday labels for the current locale.
-	* @config WEEKDAYS_1CHAR
-	* @type String[]
-	* @default ["S", "M", "T", "W", "T", "F", "S"]
-	*/	
-	this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,	{ value:defCfg.WEEKDAYS_1CHAR.value, handler:this.configLocale } );
+		/**
+		* True if the Calendar should allow multiple selections. False by default.
+		* @config MULTI_SELECT
+		* @type Boolean
+		* @default false
+		*/
+		this.cfg.addProperty(defCfg.MULTI_SELECT.key,	{ value:defCfg.MULTI_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
 	
-	/**
-	* The short weekday labels for the current locale.
-	* @config WEEKDAYS_SHORT
-	* @type String[]
-	* @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
-	*/	
-	this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,	{ value:defCfg.WEEKDAYS_SHORT.value, handler:this.configLocale } );
-	
-	/**
-	* The medium weekday labels for the current locale.
-	* @config WEEKDAYS_MEDIUM
-	* @type String[]
-	* @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
-	*/	
-	this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,	{ value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.configLocale } );
-	
-	/**
-	* The long weekday labels for the current locale.
-	* @config WEEKDAYS_LONG
-	* @type String[]
-	* @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
-	*/	
-	this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,	{ value:defCfg.WEEKDAYS_LONG.value, handler:this.configLocale } );
-
-	/**
-	* Refreshes the locale values used to build the Calendar.
-	* @method refreshLocale
-	* @private
-	*/
-	var refreshLocale = function() {
-		this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
-		this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
-	};
-
-	this.cfg.subscribeToConfigEvent(defCfg.START_WEEKDAY.key, refreshLocale, this, true);
-	this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key, refreshLocale, this, true);
-	this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key, refreshLocale, this, true);
-	this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key, refreshLocale, this, true);
-	this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key, refreshLocale, this, true);
-	this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key, refreshLocale, this, true);
-	this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key, refreshLocale, this, true);
-	
-	/**
-	* The setting that determines which length of month labels should be used. Possible values are "short" and "long".
-	* @config LOCALE_MONTHS
-	* @type String
-	* @default "long"
-	*/	
-	this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,	{ value:defCfg.LOCALE_MONTHS.value, handler:this.configLocaleValues } );
-	
-	/**
-	* The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
-	* @config LOCALE_WEEKDAYS
-	* @type String
-	* @default "short"
-	*/	
-	this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,	{ value:defCfg.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } );
-
-	/**
-	* The value used to delimit individual dates in a date string passed to various Calendar functions.
-	* @config DATE_DELIMITER
-	* @type String
-	* @default ","
-	*/	
-	this.cfg.addProperty(defCfg.DATE_DELIMITER.key,		{ value:defCfg.DATE_DELIMITER.value, handler:this.configLocale } );
-
-	/**
-	* The value used to delimit date fields in a date string passed to various Calendar functions.
-	* @config DATE_FIELD_DELIMITER
-	* @type String
-	* @default "/"
-	*/	
-	this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key, { value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.configLocale } );
-
-	/**
-	* The value used to delimit date ranges in a date string passed to various Calendar functions.
-	* @config DATE_RANGE_DELIMITER
-	* @type String
-	* @default "-"
-	*/
-	this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key, { value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.configLocale } );
-
-	/**
-	* The position of the month in a month/year date string
-	* @config MY_MONTH_POSITION
-	* @type Number
-	* @default 1
-	*/
-	this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,	{ value:defCfg.MY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-	/**
-	* The position of the year in a month/year date string
-	* @config MY_YEAR_POSITION
-	* @type Number
-	* @default 2
-	*/
-	this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,	{ value:defCfg.MY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-	/**
-	* The position of the month in a month/day date string
-	* @config MD_MONTH_POSITION
-	* @type Number
-	* @default 1
-	*/
-	this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,	{ value:defCfg.MD_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-	/**
-	* The position of the day in a month/year date string
-	* @config MD_DAY_POSITION
-	* @type Number
-	* @default 2
-	*/
-	this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,		{ value:defCfg.MD_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-	/**
-	* The position of the month in a month/day/year date string
-	* @config MDY_MONTH_POSITION
-	* @type Number
-	* @default 1
-	*/
-	this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,	{ value:defCfg.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-	/**
-	* The position of the day in a month/day/year date string
-	* @config MDY_DAY_POSITION
-	* @type Number
-	* @default 2
-	*/
-	this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,	{ value:defCfg.MDY_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-
-	/**
-	* The position of the year in a month/day/year date string
-	* @config MDY_YEAR_POSITION
-	* @type Number
-	* @default 3
-	*/
-	this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,	{ value:defCfg.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
-};
-
-/**
-* The default handler for the "pagedate" property
-* @method configPageDate
-*/
-YAHOO.widget.Calendar.prototype.configPageDate = function(type, args, obj) {
-	this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key, this._parsePageDate(args[0]), true);
-};
-
-/**
-* The default handler for the "mindate" property
-* @method configMinDate
-*/
-YAHOO.widget.Calendar.prototype.configMinDate = function(type, args, obj) {
-	var val = args[0];
-	if (YAHOO.lang.isString(val)) {
-		val = this._parseDate(val);
-		this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key, new Date(val[0],(val[1]-1),val[2]));
-	}
-};
-
-/**
-* The default handler for the "maxdate" property
-* @method configMaxDate
-*/
-YAHOO.widget.Calendar.prototype.configMaxDate = function(type, args, obj) {
-	var val = args[0];
-	if (YAHOO.lang.isString(val)) {
-		val = this._parseDate(val);
-		this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key, new Date(val[0],(val[1]-1),val[2]));
-	}
-};
-
-/**
-* The default handler for the "selected" property
-* @method configSelected
-*/
-YAHOO.widget.Calendar.prototype.configSelected = function(type, args, obj) {
-	var selected = args[0];
-	var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-	
-	if (selected) {
-		if (YAHOO.lang.isString(selected)) {
-			this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
-		} 
-	}
-	if (! this._selectedDates) {
-		this._selectedDates = this.cfg.getProperty(cfgSelected);
-	}
-};
-
-/**
-* The default handler for all configuration options properties
-* @method configOptions
-*/
-YAHOO.widget.Calendar.prototype.configOptions = function(type, args, obj) {
-	this.Options[type.toUpperCase()] = args[0];
-};
-
-/**
-* The default handler for all configuration locale properties
-* @method configLocale
-*/
-YAHOO.widget.Calendar.prototype.configLocale = function(type, args, obj) {
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-	this.Locale[type.toUpperCase()] = args[0];
-
-	this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
-	this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
-};
-
-/**
-* The default handler for all configuration locale field length properties
-* @method configLocaleValues
-*/
-YAHOO.widget.Calendar.prototype.configLocaleValues = function(type, args, obj) {
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG; 
-
-	type = type.toLowerCase();
-	var val = args[0];
-
-	switch (type) {
-		case defCfg.LOCALE_MONTHS.key:
-			switch (val) {
-				case YAHOO.widget.Calendar.SHORT:
-					this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();
-					break;
-				case YAHOO.widget.Calendar.LONG:
-					this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();
-					break;
-			}
-			break;
-		case defCfg.LOCALE_WEEKDAYS.key:
-			switch (val) {
-				case YAHOO.widget.Calendar.ONE_CHAR:
-					this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();
-					break;
-				case YAHOO.widget.Calendar.SHORT:
-					this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();
-					break;
-				case YAHOO.widget.Calendar.MEDIUM:
-					this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();
-					break;
-				case YAHOO.widget.Calendar.LONG:
-					this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();
-					break;
-			}
-			
-			var START_WEEKDAY = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
-
-			if (START_WEEKDAY > 0) {
-				for (var w=0;w<START_WEEKDAY;++w) {
-					this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());
-				}
-			}
-			break;
-	}
-};
-
-/**
-* Defines the style constants for the Calendar
-* @method initStyles
-*/
-YAHOO.widget.Calendar.prototype.initStyles = function() {
-
-	var defStyle = YAHOO.widget.Calendar._STYLES;
-
-	this.Style = {
 		/**
-		* @property Style.CSS_ROW_HEADER
+		* The weekday the week begins on. Default is 0 (Sunday).
+		* @config START_WEEKDAY
+		* @type number
+		* @default 0
 		*/
-		CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
+		this.cfg.addProperty(defCfg.START_WEEKDAY.key,	{ value:defCfg.START_WEEKDAY.value, handler:this.configOptions, validator:this.cfg.checkNumber  } );
+	
 		/**
-		* @property Style.CSS_ROW_FOOTER
+		* True if the Calendar should show weekday labels. True by default.
+		* @config SHOW_WEEKDAYS
+		* @type Boolean
+		* @default true
 		*/
-		CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
+		this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,	{ value:defCfg.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:this.cfg.checkBoolean  } );
+	
 		/**
-		* @property Style.CSS_CELL
+		* True if the Calendar should show week row headers. False by default.
+		* @config SHOW_WEEK_HEADER
+		* @type Boolean
+		* @default false
 		*/
-		CSS_CELL : defStyle.CSS_CELL,
+		this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key, { value:defCfg.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+	
 		/**
-		* @property Style.CSS_CELL_SELECTOR
-		*/
-		CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
+		* True if the Calendar should show week row footers. False by default.
+		* @config SHOW_WEEK_FOOTER
+		* @type Boolean
+		* @default false
+		*/	
+		this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+	
 		/**
-		* @property Style.CSS_CELL_SELECTED
-		*/
-		CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
+		* True if the Calendar should suppress weeks that are not a part of the current month. False by default.
+		* @config HIDE_BLANK_WEEKS
+		* @type Boolean
+		* @default false
+		*/	
+		this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key, { value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+		
+        /**
+        * True if the Calendar should allow out of month selections. false by default.
+        * @config OUT_OF_MONTH_SELECT
+        * @type Boolean
+        * @default false
+        */
+        this.cfg.addProperty(defCfg.OUT_OF_MONTH_SELECT.key, { value:defCfg.OUT_OF_MONTH_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+
 		/**
-		* @property Style.CSS_CELL_SELECTABLE
-		*/
-		CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
+		* The image that should be used for the left navigation arrow.
+		* @config NAV_ARROW_LEFT
+		* @type String
+		* @deprecated	You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"  
+		* @default null
+		*/	
+		this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,	{ value:defCfg.NAV_ARROW_LEFT.value, handler:this.configOptions } );
+	
 		/**
-		* @property Style.CSS_CELL_RESTRICTED
-		*/
-		CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
+		* The image that should be used for the right navigation arrow.
+		* @config NAV_ARROW_RIGHT
+		* @type String
+		* @deprecated	You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+		* @default null
+		*/	
+		this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key, { value:defCfg.NAV_ARROW_RIGHT.value, handler:this.configOptions } );
+	
+		// Locale properties
+	
 		/**
-		* @property Style.CSS_CELL_TODAY
+		* The short month labels for the current locale.
+		* @config MONTHS_SHORT
+		* @type String[]
+		* @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
 		*/
-		CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
+		this.cfg.addProperty(defCfg.MONTHS_SHORT.key,	{ value:defCfg.MONTHS_SHORT.value, handler:this.configLocale } );
+		
 		/**
-		* @property Style.CSS_CELL_OOM
-		*/
-		CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
+		* The long month labels for the current locale.
+		* @config MONTHS_LONG
+		* @type String[]
+		* @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+		*/	
+		this.cfg.addProperty(defCfg.MONTHS_LONG.key,		{ value:defCfg.MONTHS_LONG.value, handler:this.configLocale } );
+
 		/**
-		* @property Style.CSS_CELL_OOB
-		*/
-		CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
+		* The 1-character weekday labels for the current locale.
+		* @config WEEKDAYS_1CHAR
+		* @type String[]
+		* @default ["S", "M", "T", "W", "T", "F", "S"]
+		*/	
+		this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,	{ value:defCfg.WEEKDAYS_1CHAR.value, handler:this.configLocale } );
+		
 		/**
-		* @property Style.CSS_HEADER
-		*/
-		CSS_HEADER : defStyle.CSS_HEADER,
+		* The short weekday labels for the current locale.
+		* @config WEEKDAYS_SHORT
+		* @type String[]
+		* @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
+		*/	
+		this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,	{ value:defCfg.WEEKDAYS_SHORT.value, handler:this.configLocale } );
+		
 		/**
-		* @property Style.CSS_HEADER_TEXT
-		*/
-		CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
+		* The medium weekday labels for the current locale.
+		* @config WEEKDAYS_MEDIUM
+		* @type String[]
+		* @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+		*/	
+		this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,	{ value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.configLocale } );
+		
 		/**
-		* @property Style.CSS_BODY
-		*/
-		CSS_BODY : defStyle.CSS_BODY,
+		* The long weekday labels for the current locale.
+		* @config WEEKDAYS_LONG
+		* @type String[]
+		* @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+		*/	
+		this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,	{ value:defCfg.WEEKDAYS_LONG.value, handler:this.configLocale } );
+	
 		/**
-		* @property Style.CSS_WEEKDAY_CELL
+		* Refreshes the locale values used to build the Calendar.
+		* @method refreshLocale
+		* @private
 		*/
-		CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
+		var refreshLocale = function() {
+			this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+			this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
+		};
+	
+		this.cfg.subscribeToConfigEvent(defCfg.START_WEEKDAY.key, refreshLocale, this, true);
+		this.cfg.subscribeToConfigEvent(defCfg.MONTHS_SHORT.key, refreshLocale, this, true);
+		this.cfg.subscribeToConfigEvent(defCfg.MONTHS_LONG.key, refreshLocale, this, true);
+		this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_1CHAR.key, refreshLocale, this, true);
+		this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_SHORT.key, refreshLocale, this, true);
+		this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_MEDIUM.key, refreshLocale, this, true);
+		this.cfg.subscribeToConfigEvent(defCfg.WEEKDAYS_LONG.key, refreshLocale, this, true);
+		
 		/**
-		* @property Style.CSS_WEEKDAY_ROW
-		*/
-		CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
+		* The setting that determines which length of month labels should be used. Possible values are "short" and "long".
+		* @config LOCALE_MONTHS
+		* @type String
+		* @default "long"
+		*/	
+		this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,	{ value:defCfg.LOCALE_MONTHS.value, handler:this.configLocaleValues } );
+		
 		/**
-		* @property Style.CSS_FOOTER
-		*/
-		CSS_FOOTER : defStyle.CSS_FOOTER,
+		* The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
+		* @config LOCALE_WEEKDAYS
+		* @type String
+		* @default "short"
+		*/	
+		this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,	{ value:defCfg.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } );
+	
 		/**
-		* @property Style.CSS_CALENDAR
-		*/
-		CSS_CALENDAR : defStyle.CSS_CALENDAR,
+		* The value used to delimit individual dates in a date string passed to various Calendar functions.
+		* @config DATE_DELIMITER
+		* @type String
+		* @default ","
+		*/	
+		this.cfg.addProperty(defCfg.DATE_DELIMITER.key,		{ value:defCfg.DATE_DELIMITER.value, handler:this.configLocale } );
+	
 		/**
-		* @property Style.CSS_SINGLE
-		*/
-		CSS_SINGLE : defStyle.CSS_SINGLE,
+		* The value used to delimit date fields in a date string passed to various Calendar functions.
+		* @config DATE_FIELD_DELIMITER
+		* @type String
+		* @default "/"
+		*/	
+		this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key, { value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.configLocale } );
+	
 		/**
-		* @property Style.CSS_CONTAINER
+		* The value used to delimit date ranges in a date string passed to various Calendar functions.
+		* @config DATE_RANGE_DELIMITER
+		* @type String
+		* @default "-"
 		*/
-		CSS_CONTAINER : defStyle.CSS_CONTAINER,
+		this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key, { value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.configLocale } );
+	
 		/**
-		* @property Style.CSS_NAV_LEFT
+		* The position of the month in a month/year date string
+		* @config MY_MONTH_POSITION
+		* @type Number
+		* @default 1
 		*/
-		CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
+		this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,	{ value:defCfg.MY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+	
 		/**
-		* @property Style.CSS_NAV_RIGHT
+		* The position of the year in a month/year date string
+		* @config MY_YEAR_POSITION
+		* @type Number
+		* @default 2
 		*/
-		CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
+		this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,	{ value:defCfg.MY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+	
 		/**
-		* @property Style.CSS_CLOSE
+		* The position of the month in a month/day date string
+		* @config MD_MONTH_POSITION
+		* @type Number
+		* @default 1
 		*/
-		CSS_CLOSE : defStyle.CSS_CLOSE,
+		this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,	{ value:defCfg.MD_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+	
 		/**
-		* @property Style.CSS_CELL_TOP
+		* The position of the day in a month/year date string
+		* @config MD_DAY_POSITION
+		* @type Number
+		* @default 2
 		*/
-		CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
+		this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,		{ value:defCfg.MD_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+	
 		/**
-		* @property Style.CSS_CELL_LEFT
+		* The position of the month in a month/day/year date string
+		* @config MDY_MONTH_POSITION
+		* @type Number
+		* @default 1
 		*/
-		CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
+		this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,	{ value:defCfg.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+	
 		/**
-		* @property Style.CSS_CELL_RIGHT
+		* The position of the day in a month/day/year date string
+		* @config MDY_DAY_POSITION
+		* @type Number
+		* @default 2
 		*/
-		CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
+		this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,	{ value:defCfg.MDY_DAY_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+	
 		/**
-		* @property Style.CSS_CELL_BOTTOM
+		* The position of the year in a month/day/year date string
+		* @config MDY_YEAR_POSITION
+		* @type Number
+		* @default 3
 		*/
-		CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
+		this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,	{ value:defCfg.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+		
 		/**
-		* @property Style.CSS_CELL_HOVER
+		* The position of the month in the month year label string used as the Calendar header
+		* @config MY_LABEL_MONTH_POSITION
+		* @type Number
+		* @default 1
 		*/
-		CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
+		this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,	{ value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+	
 		/**
-		* @property Style.CSS_CELL_HIGHLIGHT1
+		* The position of the year in the month year label string used as the Calendar header
+		* @config MY_LABEL_YEAR_POSITION
+		* @type Number
+		* @default 2
 		*/
-		CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
+		this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key,	{ value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.configLocale, validator:this.cfg.checkNumber } );
+		
 		/**
-		* @property Style.CSS_CELL_HIGHLIGHT2
+		* The suffix used after the month when rendering the Calendar header
+		* @config MY_LABEL_MONTH_SUFFIX
+		* @type String
+		* @default " "
 		*/
-		CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
+		this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,	{ value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.configLocale } );
+		
 		/**
-		* @property Style.CSS_CELL_HIGHLIGHT3
+		* The suffix used after the year when rendering the Calendar header
+		* @config MY_LABEL_YEAR_SUFFIX
+		* @type String
+		* @default ""
 		*/
-		CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
+		this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.configLocale } );
+
 		/**
-		* @property Style.CSS_CELL_HIGHLIGHT4
+		* Configuration for the Month/Year CalendarNavigator UI which allows the user to jump directly to a 
+		* specific Month/Year without having to scroll sequentially through months.
+		* <p>
+		* Setting this property to null (default value) or false, will disable the CalendarNavigator UI.
+		* </p>
+		* <p>
+		* Setting this property to true will enable the CalendarNavigatior UI with the default CalendarNavigator configuration values.
+		* </p>
+		* <p>
+		* This property can also be set to an object literal containing configuration properties for the CalendarNavigator UI.
+		* The configuration object expects the the following case-sensitive properties, with the "strings" property being a nested object.
+		* Any properties which are not provided will use the default values (defined in the CalendarNavigator class).
+		* </p>
+		* <dl>
+		* <dt>strings</dt>
+		* <dd><em>Object</em> :  An object with the properties shown below, defining the string labels to use in the Navigator's UI
+		*     <dl>
+		*         <dt>month</dt><dd><em>String</em> : The string to use for the month label. Defaults to "Month".</dd>
+		*         <dt>year</dt><dd><em>String</em> : The string to use for the year label. Defaults to "Year".</dd>
+		*         <dt>submit</dt><dd><em>String</em> : The string to use for the submit button label. Defaults to "Okay".</dd>
+		*         <dt>cancel</dt><dd><em>String</em> : The string to use for the cancel button label. Defaults to "Cancel".</dd>
+		*         <dt>invalidYear</dt><dd><em>String</em> : The string to use for invalid year values. Defaults to "Year needs to be a number".</dd>
+		*     </dl>
+		* </dd>
+		* <dt>monthFormat</dt><dd><em>String</em> : The month format to use. Either YAHOO.widget.Calendar.LONG, or YAHOO.widget.Calendar.SHORT. Defaults to YAHOO.widget.Calendar.LONG</dd>
+		* <dt>initialFocus</dt><dd><em>String</em> : Either "year" or "month" specifying which input control should get initial focus. Defaults to "year"</dd>
+		* </dl>
+		* <p>E.g.</p>
+		* <pre>
+		* var navConfig = {
+		*	  strings: {
+		*		  month:"Calendar Month",
+		*		  year:"Calendar Year",
+		*		  submit: "Submit",
+		*		  cancel: "Cancel",
+		*		  invalidYear: "Please enter a valid year"
+		*	  },
+		*	  monthFormat: YAHOO.widget.Calendar.SHORT,
+		*	  initialFocus: "month"
+		* }
+		* </pre>
+		* @config navigator
+		* @type {Object|Boolean}
+		* @default null
 		*/
-		CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4
-	};
-};
+		this.cfg.addProperty(defCfg.NAV.key, { value:defCfg.NAV.value, handler:this.configNavigator } );
+	},
 
-/**
-* Builds the date label that will be displayed in the calendar header or
-* footer, depending on configuration.
-* @method buildMonthLabel
-* @return	{String}	The formatted calendar month label
-*/
-YAHOO.widget.Calendar.prototype.buildMonthLabel = function() {
-	var pageDate = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);
-	return this.Locale.LOCALE_MONTHS[pageDate.getMonth()] + " " + pageDate.getFullYear();
-};
+	/**
+	* The default handler for the "pagedate" property
+	* @method configPageDate
+	*/
+	configPageDate : function(type, args, obj) {
+		this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key, this._parsePageDate(args[0]), true);
+	},
 
-/**
-* Builds the date digit that will be displayed in calendar cells
-* @method buildDayLabel
-* @param {Date}	workingDate	The current working date
-* @return	{String}	The formatted day label
-*/
-YAHOO.widget.Calendar.prototype.buildDayLabel = function(workingDate) {
-	return workingDate.getDate();
-};
+	/**
+	* The default handler for the "mindate" property
+	* @method configMinDate
+	*/
+	configMinDate : function(type, args, obj) {
+		var val = args[0];
+		if (YAHOO.lang.isString(val)) {
+			val = this._parseDate(val);
+			this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MINDATE.key, YAHOO.widget.DateMath.getDate(val[0],(val[1]-1),val[2]));
+		}
+	},
 
-/**
-* Renders the calendar header.
-* @method renderHeader
-* @param {Array}	html	The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderHeader = function(html) {
-	var colSpan = 7;
-	
-	var DEPR_NAV_LEFT = "us/tr/callt.gif";
-	var DEPR_NAV_RIGHT = "us/tr/calrt.gif";	
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+	/**
+	* The default handler for the "maxdate" property
+	* @method configMaxDate
+	*/
+	configMaxDate : function(type, args, obj) {
+		var val = args[0];
+		if (YAHOO.lang.isString(val)) {
+			val = this._parseDate(val);
+			this.cfg.setProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MAXDATE.key, YAHOO.widget.DateMath.getDate(val[0],(val[1]-1),val[2]));
+		}
+	},
 	
-	if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
-		colSpan += 1;
-	}
-
-	if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
-		colSpan += 1;
-	}
-
-	html[html.length] = "<thead>";
-	html[html.length] =		"<tr>";
-	html[html.length] =			'<th colspan="' + colSpan + '" class="' + this.Style.CSS_HEADER_TEXT + '">';
-	html[html.length] =				'<div class="' + this.Style.CSS_HEADER + '">';
-
-	var renderLeft, renderRight = false;
-
-	if (this.parent) {
-		if (this.index === 0) {
-			renderLeft = true;
+	/**
+	* The default handler for the "selected" property
+	* @method configSelected
+	*/
+	configSelected : function(type, args, obj) {
+		var selected = args[0];
+		var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+		
+		if (selected) {
+			if (YAHOO.lang.isString(selected)) {
+				this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
+			} 
 		}
-		if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
-			renderRight = true;
+		if (! this._selectedDates) {
+			this._selectedDates = this.cfg.getProperty(cfgSelected);
 		}
-	} else {
-		renderLeft = true;
-		renderRight = true;
-	}
-
-	var cal = this.parent || this;
+	},
 	
-	if (renderLeft) {
-		var leftArrow = this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);
-		// Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value
-		if (leftArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
-			leftArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_LEFT;
-		}
-		var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"';
-		html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '"' + leftStyle + ' >&#160;</a>';
-	}
+	/**
+	* The default handler for all configuration options properties
+	* @method configOptions
+	*/
+	configOptions : function(type, args, obj) {
+		this.Options[type.toUpperCase()] = args[0];
+	},
 	
-	html[html.length] = this.buildMonthLabel();
+	/**
+	* The default handler for all configuration locale properties
+	* @method configLocale
+	*/
+	configLocale : function(type, args, obj) {
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+		this.Locale[type.toUpperCase()] = args[0];
+	
+		this.cfg.refireEvent(defCfg.LOCALE_MONTHS.key);
+		this.cfg.refireEvent(defCfg.LOCALE_WEEKDAYS.key);
+	},
+	
+	/**
+	* The default handler for all configuration locale field length properties
+	* @method configLocaleValues
+	*/
+	configLocaleValues : function(type, args, obj) {
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG; 
+	
+		type = type.toLowerCase();
+		var val = args[0];
+	
+		switch (type) {
+			case defCfg.LOCALE_MONTHS.key:
+				switch (val) {
+					case YAHOO.widget.Calendar.SHORT:
+						this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_SHORT.key).concat();
+						break;
+					case YAHOO.widget.Calendar.LONG:
+						this.Locale.LOCALE_MONTHS = this.cfg.getProperty(defCfg.MONTHS_LONG.key).concat();
+						break;
+				}
+				break;
+			case defCfg.LOCALE_WEEKDAYS.key:
+				switch (val) {
+					case YAHOO.widget.Calendar.ONE_CHAR:
+						this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_1CHAR.key).concat();
+						break;
+					case YAHOO.widget.Calendar.SHORT:
+						this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_SHORT.key).concat();
+						break;
+					case YAHOO.widget.Calendar.MEDIUM:
+						this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_MEDIUM.key).concat();
+						break;
+					case YAHOO.widget.Calendar.LONG:
+						this.Locale.LOCALE_WEEKDAYS = this.cfg.getProperty(defCfg.WEEKDAYS_LONG.key).concat();
+						break;
+				}
+				
+				var START_WEEKDAY = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
 	
-	if (renderRight) {
-		var rightArrow = this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);
-		if (rightArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
-			rightArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_RIGHT;
+				if (START_WEEKDAY > 0) {
+					for (var w=0;w<START_WEEKDAY;++w) {
+						this.Locale.LOCALE_WEEKDAYS.push(this.Locale.LOCALE_WEEKDAYS.shift());
+					}
+				}
+				break;
 		}
-		var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"';
-		html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '"' + rightStyle + ' >&#160;</a>';
-	}
-
-	html[html.length] =	'</div>\n</th>\n</tr>';
+	},
 
-	if (this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)) {
-		html = this.buildWeekdays(html);
-	}
-	
-	html[html.length] = '</thead>';
+	/**
+	 * The default handler for the "navigator" property
+	 * @method configNavigator
+	 */
+	configNavigator : function(type, args, obj) {
+		var val = args[0];
+		if (YAHOO.widget.CalendarNavigator && (val === true || YAHOO.lang.isObject(val))) {
+			if (!this.oNavigator) {
+				this.oNavigator = new YAHOO.widget.CalendarNavigator(this);
+				// Cleanup DOM Refs/Events before innerHTML is removed.
+				function erase() {
+					if (!this.pages) {
+						this.oNavigator.erase();
+					}
+				}
+				this.beforeRenderEvent.subscribe(erase, this, true);
+			}
+		} else {
+			if (this.oNavigator) {
+				this.oNavigator.destroy();
+				this.oNavigator = null;
+			}
+		}
+	},
 
-	return html;
-};
+	/**
+	* Defines the style constants for the Calendar
+	* @method initStyles
+	*/
+	initStyles : function() {
 
-/**
-* Renders the Calendar's weekday headers.
-* @method buildWeekdays
-* @param {Array}	html	The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.buildWeekdays = function(html) {
+		var defStyle = YAHOO.widget.Calendar._STYLES;
 
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+		this.Style = {
+			/**
+			* @property Style.CSS_ROW_HEADER
+			*/
+			CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
+			/**
+			* @property Style.CSS_ROW_FOOTER
+			*/
+			CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
+			/**
+			* @property Style.CSS_CELL
+			*/
+			CSS_CELL : defStyle.CSS_CELL,
+			/**
+			* @property Style.CSS_CELL_SELECTOR
+			*/
+			CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
+			/**
+			* @property Style.CSS_CELL_SELECTED
+			*/
+			CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
+			/**
+			* @property Style.CSS_CELL_SELECTABLE
+			*/
+			CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
+			/**
+			* @property Style.CSS_CELL_RESTRICTED
+			*/
+			CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
+			/**
+			* @property Style.CSS_CELL_TODAY
+			*/
+			CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
+			/**
+			* @property Style.CSS_CELL_OOM
+			*/
+			CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
+			/**
+			* @property Style.CSS_CELL_OOB
+			*/
+			CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
+			/**
+			* @property Style.CSS_HEADER
+			*/
+			CSS_HEADER : defStyle.CSS_HEADER,
+			/**
+			* @property Style.CSS_HEADER_TEXT
+			*/
+			CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
+			/**
+			* @property Style.CSS_BODY
+			*/
+			CSS_BODY : defStyle.CSS_BODY,
+			/**
+			* @property Style.CSS_WEEKDAY_CELL
+			*/
+			CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
+			/**
+			* @property Style.CSS_WEEKDAY_ROW
+			*/
+			CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
+			/**
+			* @property Style.CSS_FOOTER
+			*/
+			CSS_FOOTER : defStyle.CSS_FOOTER,
+			/**
+			* @property Style.CSS_CALENDAR
+			*/
+			CSS_CALENDAR : defStyle.CSS_CALENDAR,
+			/**
+			* @property Style.CSS_SINGLE
+			*/
+			CSS_SINGLE : defStyle.CSS_SINGLE,
+			/**
+			* @property Style.CSS_CONTAINER
+			*/
+			CSS_CONTAINER : defStyle.CSS_CONTAINER,
+			/**
+			* @property Style.CSS_NAV_LEFT
+			*/
+			CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
+			/**
+			* @property Style.CSS_NAV_RIGHT
+			*/
+			CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
+			/**
+			* @property Style.CSS_NAV
+			*/
+			CSS_NAV : defStyle.CSS_NAV,
+			/**
+			* @property Style.CSS_CLOSE
+			*/
+			CSS_CLOSE : defStyle.CSS_CLOSE,
+			/**
+			* @property Style.CSS_CELL_TOP
+			*/
+			CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
+			/**
+			* @property Style.CSS_CELL_LEFT
+			*/
+			CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
+			/**
+			* @property Style.CSS_CELL_RIGHT
+			*/
+			CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
+			/**
+			* @property Style.CSS_CELL_BOTTOM
+			*/
+			CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
+			/**
+			* @property Style.CSS_CELL_HOVER
+			*/
+			CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
+			/**
+			* @property Style.CSS_CELL_HIGHLIGHT1
+			*/
+			CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
+			/**
+			* @property Style.CSS_CELL_HIGHLIGHT2
+			*/
+			CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
+			/**
+			* @property Style.CSS_CELL_HIGHLIGHT3
+			*/
+			CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
+			/**
+			* @property Style.CSS_CELL_HIGHLIGHT4
+			*/
+			CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4
+		};
+	},
+	
+	/**
+	* Builds the date label that will be displayed in the calendar header or
+	* footer, depending on configuration.
+	* @method buildMonthLabel
+	* @return	{String}	The formatted calendar month label
+	*/
+	buildMonthLabel : function() {
+		var pageDate = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key);
+	
+		var monthLabel  = this.Locale.LOCALE_MONTHS[pageDate.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX;
+		var yearLabel = pageDate.getFullYear() + this.Locale.MY_LABEL_YEAR_SUFFIX;
 
-	html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';
-
-	if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
-		html[html.length] = '<th>&#160;</th>';
-	}
-
-	for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i) {
-		html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
-	}
-
-	if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
-		html[html.length] = '<th>&#160;</th>';
-	}
-
-	html[html.length] = '</tr>';
-
-	return html;
-};
-
-/**
-* Renders the calendar body.
-* @method renderBody
-* @param {Date}	workingDate	The current working Date being used for the render process
-* @param {Array}	html	The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderBody = function(workingDate, html) {
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-
-	var startDay = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
-
-	this.preMonthDays = workingDate.getDay();
-	if (startDay > 0) {
-		this.preMonthDays -= startDay;
-	}
-	if (this.preMonthDays < 0) {
-		this.preMonthDays += 7;
-	}
+		if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
+			return yearLabel + monthLabel;
+		} else {
+			return monthLabel + yearLabel;
+		}
+	},
 	
-	this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();
-	this.postMonthDays = YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;
+	/**
+	* Builds the date digit that will be displayed in calendar cells
+	* @method buildDayLabel
+	* @param {Date}	workingDate	The current working date
+	* @return	{String}	The formatted day label
+	*/
+	buildDayLabel : function(workingDate) {
+		return workingDate.getDate();
+	},
 	
-	workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);
-
-	var weekNum,weekClass;
-	var weekPrefix = "w";
-	var cellPrefix = "_cell";
-	var workingDayPrefix = "wd";
-	var dayPrefix = "d";
-	
-	var cellRenderers;
-	var renderer;
-	
-	var todayYear = this.today.getFullYear();
-	var todayMonth = this.today.getMonth();
-	var todayDate = this.today.getDate();
-	
-	var useDate = this.cfg.getProperty(defCfg.PAGEDATE.key);
-	var hideBlankWeeks = this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);
-	var showWeekFooter = this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);
-	var showWeekHeader = this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);
-	var mindate = this.cfg.getProperty(defCfg.MINDATE.key);
-	var maxdate = this.cfg.getProperty(defCfg.MAXDATE.key);
-
-	if (mindate) {
-		mindate = YAHOO.widget.DateMath.clearTime(mindate);
-	}
-	if (maxdate) {
-		maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
-	}
+	/**
+	 * Creates the title bar element and adds it to Calendar container DIV
+	 * 
+	 * @method createTitleBar
+	 * @param {String} strTitle The title to display in the title bar
+	 * @return The title bar element
+	 */
+	createTitleBar : function(strTitle) {
+		var tDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");
+		tDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;
+		tDiv.innerHTML = strTitle;
+		this.oDomContainer.insertBefore(tDiv, this.oDomContainer.firstChild);
 	
-	html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';
+		YAHOO.util.Dom.addClass(this.oDomContainer, "withtitle");
 	
-	var i = 0;
-
-	var tempDiv = document.createElement("div");
-	var cell = document.createElement("td");
-	tempDiv.appendChild(cell);
-
-	var jan1 = new Date(useDate.getFullYear(),0,1);
-
-	var cal = this.parent || this;
+		return tDiv;
+	},
+	
+	/**
+	 * Removes the title bar element from the DOM
+	 * 
+	 * @method removeTitleBar
+	 */
+	removeTitleBar : function() {
+		var tDiv = YAHOO.util.Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null;
+		if (tDiv) {
+			YAHOO.util.Event.purgeElement(tDiv);
+			this.oDomContainer.removeChild(tDiv);
+		}
+		YAHOO.util.Dom.removeClass(this.oDomContainer, "withtitle");
+	},
+	
+	/**
+	 * Creates the close button HTML element and adds it to Calendar container DIV
+	 * 
+	 * @method createCloseButton
+	 * @return The close HTML element created
+	 */
+	createCloseButton : function() {
+		var Dom = YAHOO.util.Dom,
+			Event = YAHOO.util.Event,
+			cssClose = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE,
+			DEPR_CLOSE_PATH = "us/my/bn/x_d.gif";
+	
+		var lnk = Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0];
+	
+		if (!lnk) {
+			lnk = document.createElement("a");  
+			Event.addListener(lnk, "click", function(e, cal) {
+				cal.hide(); 
+				Event.preventDefault(e);
+			}, this);        
+		}
+	
+		lnk.href = "#";
+		lnk.className = "link-close";
+	
+		if (YAHOO.widget.Calendar.IMG_ROOT !== null) {
+			var img = Dom.getElementsByClassName(cssClose, "img", lnk)[0] || document.createElement("img");
+			img.src = YAHOO.widget.Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
+			img.className = cssClose;
+			lnk.appendChild(img);
+		} else {
+			lnk.innerHTML = '<span class="' + cssClose + ' ' + this.Style.CSS_CLOSE + '"></span>';
+		}
+		this.oDomContainer.appendChild(lnk);
+	
+		return lnk;
+	},
+	
+	/**
+	 * Removes the close button HTML element from the DOM
+	 * 
+	 * @method removeCloseButton
+	 */
+	removeCloseButton : function() {
+		var btn = YAHOO.util.Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null;
+		if (btn) {
+			YAHOO.util.Event.purgeElement(btn);
+			this.oDomContainer.removeChild(btn);
+		}
+	},
 
-	for (var r=0;r<6;r++) {
+	/**
+	* Renders the calendar header.
+	* @method renderHeader
+	* @param {Array}	html	The current working HTML array
+	* @return {Array} The current working HTML array
+	*/
+	renderHeader : function(html) {
+		var colSpan = 7;
+		
+		var DEPR_NAV_LEFT = "us/tr/callt.gif";
+		var DEPR_NAV_RIGHT = "us/tr/calrt.gif";	
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+		
+		if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
+			colSpan += 1;
+		}
+	
+		if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
+			colSpan += 1;
+		}
+	
+		html[html.length] = "<thead>";
+		html[html.length] =		"<tr>";
+		html[html.length] =			'<th colspan="' + colSpan + '" class="' + this.Style.CSS_HEADER_TEXT + '">';
+		html[html.length] =				'<div class="' + this.Style.CSS_HEADER + '">';
+	
+		var renderLeft, renderRight = false;
+	
+		if (this.parent) {
+			if (this.index === 0) {
+				renderLeft = true;
+			}
+			if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
+				renderRight = true;
+			}
+		} else {
+			renderLeft = true;
+			renderRight = true;
+		}
+	
+		if (renderLeft) {
+			var leftArrow = this.cfg.getProperty(defCfg.NAV_ARROW_LEFT.key);
+			// Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value
+			if (leftArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+				leftArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_LEFT;
+			}
+			var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"';
+			html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '"' + leftStyle + ' >&#160;</a>';
+		}
 
-		weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);
-		weekClass = weekPrefix + weekNum;
+		var lbl = this.buildMonthLabel();
+		var cal = this.parent || this;
+		if (cal.cfg.getProperty("navigator")) {
+			lbl = "<a class=\"" + this.Style.CSS_NAV + "\" href=\"#\">" + lbl + "</a>";
+		}
+		html[html.length] = lbl;
 
-		// Local OOM check for performance, since we already have pagedate
-		if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth() && !this.cfg.getProperty(defCfg.OOM_SELECT.key)) {
-			break;
-		} else {
+		if (renderRight) {
+			var rightArrow = this.cfg.getProperty(defCfg.NAV_ARROW_RIGHT.key);
+			if (rightArrow === null && YAHOO.widget.Calendar.IMG_ROOT !== null) {
+				rightArrow = YAHOO.widget.Calendar.IMG_ROOT + DEPR_NAV_RIGHT;
+			}
+			var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"';
+			html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '"' + rightStyle + ' >&#160;</a>';
+		}
 
-			html[html.length] = '<tr class="' + weekClass + '">';
-			
-			if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }
-			
-			for (var d=0;d<7;d++){ // Render actual days
+		html[html.length] =	'</div>\n</th>\n</tr>';
 
-				cellRenderers = [];
-				renderer = null;
+		if (this.cfg.getProperty(defCfg.SHOW_WEEKDAYS.key)) {
+			html = this.buildWeekdays(html);
+		}
+		
+		html[html.length] = '</thead>';
+	
+		return html;
+	},
+	
+	/**
+	* Renders the Calendar's weekday headers.
+	* @method buildWeekdays
+	* @param {Array}	html	The current working HTML array
+	* @return {Array} The current working HTML array
+	*/
+	buildWeekdays : function(html) {
+	
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+	
+		html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';
+	
+		if (this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key)) {
+			html[html.length] = '<th>&#160;</th>';
+		}
+	
+		for(var i=0;i<this.Locale.LOCALE_WEEKDAYS.length;++i) {
+			html[html.length] = '<th class="calweekdaycell">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
+		}
+	
+		if (this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key)) {
+			html[html.length] = '<th>&#160;</th>';
+		}
+	
+		html[html.length] = '</tr>';
+	
+		return html;
+	},
+	
+	/**
+	* Renders the calendar body.
+	* @method renderBody
+	* @param {Date}	workingDate	The current working Date being used for the render process
+	* @param {Array}	html	The current working HTML array
+	* @return {Array} The current working HTML array
+	*/
+	renderBody : function(workingDate, html) {
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+	
+		var startDay = this.cfg.getProperty(defCfg.START_WEEKDAY.key);
+	
+		this.preMonthDays = workingDate.getDay();
+		if (startDay > 0) {
+			this.preMonthDays -= startDay;
+		}
+		if (this.preMonthDays < 0) {
+			this.preMonthDays += 7;
+		}
+		
+		this.monthDays = YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();
+		this.postMonthDays = YAHOO.widget.Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;
+		
+		workingDate = YAHOO.widget.DateMath.subtract(workingDate, YAHOO.widget.DateMath.DAY, this.preMonthDays);
+	
+		var weekNum,weekClass;
+		var weekPrefix = "w";
+		var cellPrefix = "_cell";
+		var workingDayPrefix = "wd";
+		var dayPrefix = "d";
+		
+		var cellRenderers;
+		var renderer;
+		
+		var todayYear = this.today.getFullYear();
+		var todayMonth = this.today.getMonth();
+		var todayDate = this.today.getDate();
+		
+		var useDate = this.cfg.getProperty(defCfg.PAGEDATE.key);
+		var hideBlankWeeks = this.cfg.getProperty(defCfg.HIDE_BLANK_WEEKS.key);
+		var showWeekFooter = this.cfg.getProperty(defCfg.SHOW_WEEK_FOOTER.key);
+		var showWeekHeader = this.cfg.getProperty(defCfg.SHOW_WEEK_HEADER.key);
+		var mindate = this.cfg.getProperty(defCfg.MINDATE.key);
+		var maxdate = this.cfg.getProperty(defCfg.MAXDATE.key);
+	
+        var outOfMonthSelect = this.cfg.getProperty(defCfg.OUT_OF_MONTH_SELECT.key);
 
-				this.clearElement(cell);
-				cell.className = this.Style.CSS_CELL;
-				cell.id = this.id + cellPrefix + i;
-
-				if (workingDate.getDate()		== todayDate && 
-					workingDate.getMonth()		== todayMonth &&
-					workingDate.getFullYear()	== todayYear) {
-					cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
-				}
-				
-				var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
-				this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
+		if (mindate) {
+			mindate = YAHOO.widget.DateMath.clearTime(mindate);
+		}
+		if (maxdate) {
+			maxdate = YAHOO.widget.DateMath.clearTime(maxdate);
+		}
+		
+		html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';
+		
+		var i = 0;
+	
+		var tempDiv = document.createElement("div");
+		var cell = document.createElement("td");
+		tempDiv.appendChild(cell);
+	
+		var cal = this.parent || this;
+	
+		for (var r=0;r<6;r++) {
+	
+			weekNum = YAHOO.widget.DateMath.getWeekNumber(workingDate, useDate.getFullYear(), startDay);
+			weekClass = weekPrefix + weekNum;
+	
+			// Local OOM check for performance, since we already have pagedate
+			if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth() && !outOfMonthSelect) {
+				break;
+			} else {
+	
+				html[html.length] = '<tr class="' + weekClass + '">';
 				
-				// Local OOM check for performance, since we already have pagedate
-				if (workingDate.getMonth() != useDate.getMonth() && !this.cfg.getProperty(defCfg.OOM_SELECT.key)) {
-					cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
-				} else {
-					YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
-					YAHOO.util.Dom.addClass(cell, dayPrefix + workingDate.getDate());
+				if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }
 				
-					for (var s=0;s<this.renderStack.length;++s) {
-
-						var rArray = this.renderStack[s];
-						var type = rArray[0];
-						
-						var month;
-						var day;
-						var year;
-						
-						switch (type) {
-							case YAHOO.widget.Calendar.DATE:
-								month = rArray[1][1];
-								day = rArray[1][2];
-								year = rArray[1][0];
-
-								if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {
-									renderer = rArray[2];
-									this.renderStack.splice(s,1);
-								}
-								break;
-							case YAHOO.widget.Calendar.MONTH_DAY:
-								month = rArray[1][0];
-								day = rArray[1][1];
-								
-								if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {
-									renderer = rArray[2];
-									this.renderStack.splice(s,1);
-								}
-								break;
-							case YAHOO.widget.Calendar.RANGE:
-								var date1 = rArray[1][0];
-								var date2 = rArray[1][1];
-
-								var d1month = date1[1];
-								var d1day = date1[2];
-								var d1year = date1[0];
-								
-								var d1 = new Date(d1year, d1month-1, d1day);
-
-								var d2month = date2[1];
-								var d2day = date2[2];
-								var d2year = date2[0];
-
-								var d2 = new Date(d2year, d2month-1, d2day);
-
-								if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {
-									renderer = rArray[2];
-
-									if (workingDate.getTime()==d2.getTime()) { 
+				for (var d=0;d<7;d++){ // Render actual days
+	
+					cellRenderers = [];
+	
+					this.clearElement(cell);
+					cell.className = this.Style.CSS_CELL;
+					cell.id = this.id + cellPrefix + i;
+
+					if (workingDate.getDate()		== todayDate && 
+						workingDate.getMonth()		== todayMonth &&
+						workingDate.getFullYear()	== todayYear) {
+						cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
+					}
+					
+					var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
+					this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
+					
+					// Local OOM check for performance, since we already have pagedate
+					if (workingDate.getMonth() != useDate.getMonth()) {
+                        if (outOfMonthSelect) {
+                            cellRenderers[cellRenderers.length]=cal.renderCellStyleNotThisMonth;
+                        } else {
+                            cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
+                        }
+					} else {
+						YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
+						YAHOO.util.Dom.addClass(cell, dayPrefix + workingDate.getDate());
+					
+						for (var s=0;s<this.renderStack.length;++s) {
+	
+							renderer = null;
+	
+							var rArray = this.renderStack[s];
+							var type = rArray[0];
+							
+							var month;
+							var day;
+							var year;
+							
+							switch (type) {
+								case YAHOO.widget.Calendar.DATE:
+									month = rArray[1][1];
+									day = rArray[1][2];
+									year = rArray[1][0];
+	
+									if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {
+										renderer = rArray[2];
+										this.renderStack.splice(s,1);
+									}
+									break;
+								case YAHOO.widget.Calendar.MONTH_DAY:
+									month = rArray[1][0];
+									day = rArray[1][1];
+									
+									if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {
+										renderer = rArray[2];
 										this.renderStack.splice(s,1);
 									}
-								}
-								break;
-							case YAHOO.widget.Calendar.WEEKDAY:
-								
-								var weekday = rArray[1][0];
-								if (workingDate.getDay()+1 == weekday) {
-									renderer = rArray[2];
-								}
-								break;
-							case YAHOO.widget.Calendar.MONTH:
-								
-								month = rArray[1][0];
-								if (workingDate.getMonth()+1 == month) {
-									renderer = rArray[2];
-								}
-								break;
+									break;
+								case YAHOO.widget.Calendar.RANGE:
+									var date1 = rArray[1][0];
+									var date2 = rArray[1][1];
+	
+									var d1month = date1[1];
+									var d1day = date1[2];
+									var d1year = date1[0];
+									
+									var d1 = YAHOO.widget.DateMath.getDate(d1year, d1month-1, d1day);
+	
+									var d2month = date2[1];
+									var d2day = date2[2];
+									var d2year = date2[0];
+	
+									var d2 = YAHOO.widget.DateMath.getDate(d2year, d2month-1, d2day);
+	
+									if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {
+										renderer = rArray[2];
+	
+										if (workingDate.getTime()==d2.getTime()) { 
+											this.renderStack.splice(s,1);
+										}
+									}
+									break;
+								case YAHOO.widget.Calendar.WEEKDAY:
+									
+									var weekday = rArray[1][0];
+									if (workingDate.getDay()+1 == weekday) {
+										renderer = rArray[2];
+									}
+									break;
+								case YAHOO.widget.Calendar.MONTH:
+									
+									month = rArray[1][0];
+									if (workingDate.getMonth()+1 == month) {
+										renderer = rArray[2];
+									}
+									break;
+							}
+							
+							if (renderer) {
+								cellRenderers[cellRenderers.length]=renderer;
+							}
 						}
-						
-						if (renderer) {
-							cellRenderers[cellRenderers.length]=renderer;
+	
+					}
+	
+					if (this._indexOfSelectedFieldArray(workingArray) > -1) {
+						cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
+					}
+	
+					if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
+						(maxdate && (workingDate.getTime() > maxdate.getTime()))
+					) {
+						cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
+					} else {
+						cellRenderers[cellRenderers.length]=cal.styleCellDefault;
+						cellRenderers[cellRenderers.length]=cal.renderCellDefault;	
+					}
+					
+					for (var x=0; x < cellRenderers.length; ++x) {
+						if (cellRenderers[x].call(cal, workingDate, cell) == YAHOO.widget.Calendar.STOP_RENDER) {
+							break;
 						}
 					}
-
-				}
-
-				if (this._indexOfSelectedFieldArray(workingArray) > -1) {
-					cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
-				}
-
-				if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
-					(maxdate && (workingDate.getTime() > maxdate.getTime()))
-				) {
-					cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
-				} else {
-					cellRenderers[cellRenderers.length]=cal.styleCellDefault;
-					cellRenderers[cellRenderers.length]=cal.renderCellDefault;	
-				}
-				
-				for (var x=0; x < cellRenderers.length; ++x) {
-					if (cellRenderers[x].call(cal, workingDate, cell) == YAHOO.widget.Calendar.STOP_RENDER) {
-						break;
+	
+					workingDate.setTime(workingDate.getTime() + YAHOO.widget.DateMath.ONE_DAY_MS);
+	
+					if (i >= 0 && i <= 6) {
+						YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);
 					}
-				}
-
-				workingDate.setTime(workingDate.getTime() + YAHOO.widget.DateMath.ONE_DAY_MS);
-
-				if (i >= 0 && i <= 6) {
-					YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TOP);
-				}
-				if ((i % 7) === 0) {
-					YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);
-				}
-				if (((i+1) % 7) === 0) {
-					YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);
-				}
-				
-				var postDays = this.postMonthDays; 
-				if (hideBlankWeeks && postDays >= 7) {
-					var blankWeeks = Math.floor(postDays/7);
-					for (var p=0;p<blankWeeks;++p) {
-						postDays -= 7;
+					if ((i % 7) === 0) {
+						YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_LEFT);
 					}
+					if (((i+1) % 7) === 0) {
+						YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);
+					}
+					
+					var postDays = this.postMonthDays; 
+					if (hideBlankWeeks && postDays >= 7) {
+						var blankWeeks = Math.floor(postDays/7);
+						for (var p=0;p<blankWeeks;++p) {
+							postDays -= 7;
+						}
+					}
+					
+					if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {
+						YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);
+					}
+	
+					html[html.length] = tempDiv.innerHTML;
+					i++;
 				}
-				
-				if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {
-					YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);
-				}
-
-				html[html.length] = tempDiv.innerHTML;
-				i++;
+	
+				if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
+	
+				html[html.length] = '</tr>';
 			}
-
-			if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
-
-			html[html.length] = '</tr>';
 		}
-	}
-
-	html[html.length] = '</tbody>';
-
-	return html;
-};
-
-/**
-* Renders the calendar footer. In the default implementation, there is
-* no footer.
-* @method renderFooter
-* @param {Array}	html	The current working HTML array
-* @return {Array} The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderFooter = function(html) { return html; };
-
-/**
-* Renders the calendar after it has been configured. The render() method has a specific call chain that will execute
-* when the method is called: renderHeader, renderBody, renderFooter.
-* Refer to the documentation for those methods for information on 
-* individual render tasks.
-* @method render
-*/
-YAHOO.widget.Calendar.prototype.render = function() {
-	this.beforeRenderEvent.fire();
-
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-
-	// Find starting day of the current month
-	var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));
-
-	this.resetRenderers();
-	this.cellDates.length = 0;
-
-	YAHOO.util.Event.purgeElement(this.oDomContainer, true);
-
-	var html = [];
-
-	html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';
-	html = this.renderHeader(html);
-	html = this.renderBody(workingDate, html);
-	html = this.renderFooter(html);
-	html[html.length] = '</table>';
-
-	this.oDomContainer.innerHTML = html.join("\n");
+	
+		html[html.length] = '</tbody>';
+	
+		return html;
+	},
+	
+	/**
+	* Renders the calendar footer. In the default implementation, there is
+	* no footer.
+	* @method renderFooter
+	* @param {Array}	html	The current working HTML array
+	* @return {Array} The current working HTML array
+	*/
+	renderFooter : function(html) { return html; },
+	
+	/**
+	* Renders the calendar after it has been configured. The render() method has a specific call chain that will execute
+	* when the method is called: renderHeader, renderBody, renderFooter.
+	* Refer to the documentation for those methods for information on 
+	* individual render tasks.
+	* @method render
+	*/
+	render : function() {
+		this.beforeRenderEvent.fire();
+	
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+	
+		// Find starting day of the current month
+		var workingDate = YAHOO.widget.DateMath.findMonthStart(this.cfg.getProperty(defCfg.PAGEDATE.key));
+	
+		this.resetRenderers();
+		this.cellDates.length = 0;
 
-	this.applyListeners();
-	this.cells = this.oDomContainer.getElementsByTagName("td");
+		YAHOO.util.Event.purgeElement(this.oDomContainer, true);
 
-	this.cfg.refireEvent(defCfg.TITLE.key);
-	this.cfg.refireEvent(defCfg.CLOSE.key);
-	this.cfg.refireEvent(defCfg.IFRAME.key);
+		var html = [];
+	
+		html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + workingDate.getFullYear() + '" id="' + this.id + '">';
+		html = this.renderHeader(html);
+		html = this.renderBody(workingDate, html);
+		html = this.renderFooter(html);
+		html[html.length] = '</table>';
 
-	this.renderEvent.fire();
-};
+		this.oDomContainer.innerHTML = html.join("\n");
 
-/**
-* Applies the Calendar's DOM listeners to applicable elements.
-* @method applyListeners
-*/
-YAHOO.widget.Calendar.prototype.applyListeners = function() {
+		this.applyListeners();
+		this.cells = this.oDomContainer.getElementsByTagName("td");
 	
-	var root = this.oDomContainer;
-	var cal = this.parent || this;
+		this.cfg.refireEvent(defCfg.TITLE.key);
+		this.cfg.refireEvent(defCfg.CLOSE.key);
+		this.cfg.refireEvent(defCfg.IFRAME.key);
 	
-	var anchor = "a";
-	var mousedown = "mousedown";
-
-	var linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root);
-	var linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);
+		this.renderEvent.fire();
+	},
 
-	if (linkLeft && linkLeft.length > 0) {
-		this.linkLeft = linkLeft[0];
-		YAHOO.util.Event.addListener(this.linkLeft, mousedown, cal.previousMonth, cal, true);
-	}
+	/**
+	* Applies the Calendar's DOM listeners to applicable elements.
+	* @method applyListeners
+	*/
+	applyListeners : function() {
+		var root = this.oDomContainer;
+		var cal = this.parent || this;
+		var anchor = "a";
+		var mousedown = "mousedown";
 
-	if (linkRight && linkRight.length > 0) {
-		this.linkRight = linkRight[0];
-		YAHOO.util.Event.addListener(this.linkRight, mousedown, cal.nextMonth, cal, true);
-	}
+		var linkLeft = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root);
+		var linkRight = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);
+	
+		if (linkLeft && linkLeft.length > 0) {
+			this.linkLeft = linkLeft[0];
+			YAHOO.util.Event.addListener(this.linkLeft, mousedown, cal.previousMonth, cal, true);
+		}
 
-	if (this.domEventMap) {
-		var el,elements;
-		for (var cls in this.domEventMap) {	
-			if (YAHOO.lang.hasOwnProperty(this.domEventMap, cls)) {
-				var items = this.domEventMap[cls];
+		if (linkRight && linkRight.length > 0) {
+			this.linkRight = linkRight[0];
+			YAHOO.util.Event.addListener(this.linkRight, mousedown, cal.nextMonth, cal, true);
+		}
 
-				if (! (items instanceof Array)) {
-					items = [items];
-				}
+		if (cal.cfg.getProperty("navigator") !== null) {
+			this.applyNavListeners();
+		}
 
-				for (var i=0;i<items.length;i++)	{
-					var item = items[i];
-					elements = YAHOO.util.Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);
-
-					for (var c=0;c<elements.length;c++) {
-						el = elements[c];
-						 YAHOO.util.Event.addListener(el, item.event, item.handler, item.scope, item.correct );
+		if (this.domEventMap) {
+			var el,elements;
+			for (var cls in this.domEventMap) {	
+				if (YAHOO.lang.hasOwnProperty(this.domEventMap, cls)) {
+					var items = this.domEventMap[cls];
+	
+					if (! (items instanceof Array)) {
+						items = [items];
+					}
+	
+					for (var i=0;i<items.length;i++)	{
+						var item = items[i];
+						elements = YAHOO.util.Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);
+	
+						for (var c=0;c<elements.length;c++) {
+							el = elements[c];
+							 YAHOO.util.Event.addListener(el, item.event, item.handler, item.scope, item.correct );
+						}
 					}
 				}
 			}
 		}
-	}
-
-	YAHOO.util.Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);
-	YAHOO.util.Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);
-	YAHOO.util.Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);
-};
+	
+		YAHOO.util.Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);
+		YAHOO.util.Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);
+		YAHOO.util.Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);
+	},
 
-/**
-* Retrieves the Date object for the specified Calendar cell
-* @method getDateByCellId
-* @param {String}	id	The id of the cell
-* @return {Date} The Date object for the specified Calendar cell
-*/
-YAHOO.widget.Calendar.prototype.getDateByCellId = function(id) {
-	var date = this.getDateFieldsByCellId(id);
-	return new Date(date[0],date[1]-1,date[2]);
-};
+	applyNavListeners : function() {
 
-/**
-* Retrieves the Date object for the specified Calendar cell
-* @method getDateFieldsByCellId
-* @param {String}	id	The id of the cell
-* @return {Array}	The array of Date fields for the specified Calendar cell
-*/
-YAHOO.widget.Calendar.prototype.getDateFieldsByCellId = function(id) {
-	id = id.toLowerCase().split("_cell")[1];
-	id = parseInt(id, 10);
-	return this.cellDates[id];
-};
+		var E = YAHOO.util.Event;
 
-// BEGIN BUILT-IN TABLE CELL RENDERERS
+		var calParent = this.parent || this;
+		var cal = this;
 
-/**
-* Renders a cell that falls before the minimum date or after the maximum date.
-* widget class.
-* @method renderOutOfBoundsDate
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*			should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderOutOfBoundsDate = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);
-	cell.innerHTML = workingDate.getDate();
-	return YAHOO.widget.Calendar.STOP_RENDER;
-};
+		var navBtns = YAHOO.util.Dom.getElementsByClassName(this.Style.CSS_NAV, "a", this.oDomContainer);
 
-/**
-* Renders the row header for a week.
-* @method renderRowHeader
-* @param {Number}	weekNum	The week number of the current row
-* @param {Array}	cell	The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderRowHeader = function(weekNum, html) {
-	html[html.length] = '<th class="calrowhead">' + weekNum + '</th>';
-	return html;
-};
+		if (navBtns.length > 0) {
 
-/**
-* Renders the row footer for a week.
-* @method renderRowFooter
-* @param {Number}	weekNum	The week number of the current row
-* @param {Array}	cell	The current working HTML array
-*/
-YAHOO.widget.Calendar.prototype.renderRowFooter = function(weekNum, html) {
-	html[html.length] = '<th class="calrowfoot">' + weekNum + '</th>';
-	return html;
-};
+			function show(e, obj) {
+				var target = E.getTarget(e);
+				// this == navBtn
+				if (this === target || YAHOO.util.Dom.isAncestor(this, target)) {
+					E.preventDefault(e);
+				}
+				var navigator = calParent.oNavigator;
+				if (navigator) {
+					var pgdate = cal.cfg.getProperty("pagedate");
+					navigator.setYear(pgdate.getFullYear());
+					navigator.setMonth(pgdate.getMonth());
+					navigator.show();
+				}
+			}
+			E.addListener(navBtns, "click", show);
+		}
+	},
 
-/**
-* Renders a single standard calendar cell in the calendar widget table.
-* All logic for determining how a standard default cell will be rendered is 
-* encapsulated in this method, and must be accounted for when extending the
-* widget class.
-* @method renderCellDefault
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellDefault = function(workingDate, cell) {
-	cell.innerHTML = '<a href="#" class="' + this.Style.CSS_CELL_SELECTOR + '">' + this.buildDayLabel(workingDate) + "</a>";
-};
-
-/**
-* Styles a selectable cell.
-* @method styleCellDefault
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.styleCellDefault = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE);
-};
-
-
-/**
-* Renders a single standard calendar cell using the CSS hightlight1 style
-* @method renderCellStyleHighlight1
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight1 = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);
-};
-
-/**
-* Renders a single standard calendar cell using the CSS hightlight2 style
-* @method renderCellStyleHighlight2
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight2 = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);
-};
-
-/**
-* Renders a single standard calendar cell using the CSS hightlight3 style
-* @method renderCellStyleHighlight3
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight3 = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);
-};
-
-/**
-* Renders a single standard calendar cell using the CSS hightlight4 style
-* @method renderCellStyleHighlight4
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleHighlight4 = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);
-};
-
-/**
-* Applies the default style used for rendering today's date to the current calendar cell
-* @method renderCellStyleToday
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleToday = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);
-};
-
-/**
-* Applies the default style used for rendering selected dates to the current calendar cell
-* @method renderCellStyleSelected
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*			should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderCellStyleSelected = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);
-};
-
-/**
-* Applies the default style used for rendering dates that are not a part of the current
-* month (preceding or trailing the cells for the current month)
-* @method renderCellNotThisMonth
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*			should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderCellNotThisMonth = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);
-	cell.innerHTML=workingDate.getDate();
-	return YAHOO.widget.Calendar.STOP_RENDER;
-};
-
-/**
-* Renders the current calendar cell as a non-selectable "black-out" date using the default
-* restricted style.
-* @method renderBodyCellRestricted
-* @param {Date}					workingDate		The current working Date object being used to generate the calendar
-* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
-* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
-*			should not be terminated
-*/
-YAHOO.widget.Calendar.prototype.renderBodyCellRestricted = function(workingDate, cell) {
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);
-	YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED);
-	cell.innerHTML=workingDate.getDate();
-	return YAHOO.widget.Calendar.STOP_RENDER;
-};
-
-// END BUILT-IN TABLE CELL RENDERERS
-
-// BEGIN MONTH NAVIGATION METHODS
-
-/**
-* Adds the designated number of months to the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method addMonths
-* @param {Number}	count	The number of months to add to the current calendar
-*/
-YAHOO.widget.Calendar.prototype.addMonths = function(count) {
-	var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-	this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
-	this.resetRenderers();
-	this.changePageEvent.fire();
-};
-
-/**
-* Subtracts the designated number of months from the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method subtractMonths
-* @param {Number}	count	The number of months to subtract from the current calendar
-*/
-YAHOO.widget.Calendar.prototype.subtractMonths = function(count) {
-	var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-	this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
-	this.resetRenderers();
-	this.changePageEvent.fire();
-};
-
-/**
-* Adds the designated number of years to the current calendar, and sets the current
-* calendar page date to the new month.
-* @method addYears
-* @param {Number}	count	The number of years to add to the current calendar
-*/
-YAHOO.widget.Calendar.prototype.addYears = function(count) {
-	var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-	this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
-	this.resetRenderers();
-	this.changePageEvent.fire();
-};
-
-/**
-* Subtcats the designated number of years from the current calendar, and sets the current
-* calendar page date to the new month.
-* @method subtractYears
-* @param {Number}	count	The number of years to subtract from the current calendar
-*/
-YAHOO.widget.Calendar.prototype.subtractYears = function(count) {
-	var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-	this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
-	this.resetRenderers();
-	this.changePageEvent.fire();
-};
-
-/**
-* Navigates to the next month page in the calendar widget.
-* @method nextMonth
-*/
-YAHOO.widget.Calendar.prototype.nextMonth = function() {
-	this.addMonths(1);
-};
-
-/**
-* Navigates to the previous month page in the calendar widget.
-* @method previousMonth
-*/
-YAHOO.widget.Calendar.prototype.previousMonth = function() {
-	this.subtractMonths(1);
-};
-
-/**
-* Navigates to the next year in the currently selected month in the calendar widget.
-* @method nextYear
-*/
-YAHOO.widget.Calendar.prototype.nextYear = function() {
-	this.addYears(1);
-};
-
-/**
-* Navigates to the previous year in the currently selected month in the calendar widget.
-* @method previousYear
-*/
-YAHOO.widget.Calendar.prototype.previousYear = function() {
-	this.subtractYears(1);
-};
-
-// END MONTH NAVIGATION METHODS
-
-// BEGIN SELECTION METHODS
-
-/**
-* Resets the calendar widget to the originally selected month and year, and 
-* sets the calendar to the initial selection(s).
-* @method reset
-*/
-YAHOO.widget.Calendar.prototype.reset = function() {
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-	this.cfg.resetProperty(defCfg.SELECTED.key);
-	this.cfg.resetProperty(defCfg.PAGEDATE.key);
-	this.resetEvent.fire();
-};
-
-/**
-* Clears the selected dates in the current calendar widget and sets the calendar
-* to the current month and year.
-* @method clear
-*/
-YAHOO.widget.Calendar.prototype.clear = function() {
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
-	this.cfg.setProperty(defCfg.SELECTED.key, []);
-	this.cfg.setProperty(defCfg.PAGEDATE.key, new Date(this.today.getTime()));
-	this.clearEvent.fire();
-};
-
-/**
-* Selects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once selection has completed, render must be 
-* called for the changes to be reflected visually.
-* @method select
-* @param	{String/Date/Date[]}	date	The date string of dates to select in the current calendar. Valid formats are
-*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*								This method can also take a JavaScript Date object or an array of Date objects.
-* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.select = function(date) {
-	this.beforeSelectEvent.fire();
+	/**
+	* Retrieves the Date object for the specified Calendar cell
+	* @method getDateByCellId
+	* @param {String}	id	The id of the cell
+	* @return {Date} The Date object for the specified Calendar cell
+	*/
+	getDateByCellId : function(id) {
+		var date = this.getDateFieldsByCellId(id);
+		return YAHOO.widget.DateMath.getDate(date[0],date[1]-1,date[2]);
+	},
 	
-	var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-
-	var selected = this.cfg.getProperty(cfgSelected);
-	var aToBeSelected = this._toFieldArray(date);
-
-	for (var a=0;a<aToBeSelected.length;++a) {
-		var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select
-		if (this._indexOfSelectedFieldArray(toSelect) == -1) { // not already selected?
-			selected[selected.length]=toSelect;
+	/**
+	* Retrieves the Date object for the specified Calendar cell
+	* @method getDateFieldsByCellId
+	* @param {String}	id	The id of the cell
+	* @return {Array}	The array of Date fields for the specified Calendar cell
+	*/
+	getDateFieldsByCellId : function(id) {
+		id = id.toLowerCase().split("_cell")[1];
+		id = parseInt(id, 10);
+		return this.cellDates[id];
+	},
+	
+	/**
+	 * Find the Calendar's cell index for a given date.
+	 * If the date is not found, the method returns -1.
+	 * <p>
+	 * The returned index can be used to lookup the cell HTMLElement  
+	 * using the Calendar's cells array or passed to selectCell to select 
+	 * cells by index. 
+	 * </p>
+	 *
+	 * See <a href="#cells">cells</a>, <a href="#selectCell">selectCell</a>.
+	 *
+	 * @method getCellIndex
+	 * @param {Date} date JavaScript Date object, for which to find a cell index.
+	 * @return {Number} The index of the date in Calendars cellDates/cells arrays, or -1 if the date 
+	 * is not on the curently rendered Calendar page.
+	 */
+	getCellIndex : function(date) {
+		var idx = -1;
+		if (date) {
+			var m = date.getMonth(),
+				y = date.getFullYear(),
+				d = date.getDate(),
+				dates = this.cellDates;
+
+			for (var i = 0; i < dates.length; ++i) {
+				var cellDate = dates[i];
+				if (cellDate[0] === y && cellDate[1] === m+1 && cellDate[2] === d) {
+					idx = i;
+					break;
+				}
+			}
 		}
-	}
+		return idx;
+	},
 	
-	if (this.parent) {
-		this.parent.cfg.setProperty(cfgSelected, selected);
-	} else {
-		this.cfg.setProperty(cfgSelected, selected);
-	}
-
-	this.selectEvent.fire(aToBeSelected);
+	// BEGIN BUILT-IN TABLE CELL RENDERERS
 	
-	return this.getSelectedDates();
-};
-
-/**
-* Selects a date on the current calendar by referencing the index of the cell that should be selected.
-* This method is used to easily select a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is applied to the cell directly.
-* @method selectCell
-* @param	{Number}	cellIndex	The index of the cell to select in the current calendar. 
-* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.selectCell = function(cellIndex) {
-	this.beforeSelectEvent.fire();
+	/**
+	* Renders a cell that falls before the minimum date or after the maximum date.
+	* widget class.
+	* @method renderOutOfBoundsDate
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+	*			should not be terminated
+	*/
+	renderOutOfBoundsDate : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOB);
+		cell.innerHTML = workingDate.getDate();
+		return YAHOO.widget.Calendar.STOP_RENDER;
+	},
 	
-	var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-	var selected = this.cfg.getProperty(cfgSelected);
-
-	var cell = this.cells[cellIndex];
-	var cellDate = this.cellDates[cellIndex];
-
-	var dCellDate = this._toDate(cellDate);
-
-	var selectDate = cellDate.concat();
-
-	if (this._indexOfSelectedFieldArray(selectDate) == -1) {
-		selected[selected.length] = selectDate;
-	}
-
-	if (this.parent) {
-		this.parent.cfg.setProperty(cfgSelected, selected);
-	} else {
-		this.cfg.setProperty(cfgSelected, selected);
-	}
-
-	this.renderCellStyleSelected(dCellDate,cell);
-
-	this.selectEvent.fire([selectDate]);
-
-	this.doCellMouseOut.call(cell, null, this);
-
-	return this.getSelectedDates();
-};
-
-/**
-* Deselects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once deselection has completed, render must be 
-* called for the changes to be reflected visually.
-* @method deselect
-* @param	{String/Date/Date[]}	date	The date string of dates to deselect in the current calendar. Valid formats are
-*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*								This method can also take a JavaScript Date object or an array of Date objects.	
-* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.deselect = function(date) {
-	this.beforeDeselectEvent.fire();
-	var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-
-	var selected = this.cfg.getProperty(cfgSelected);
-
-	var aToBeSelected = this._toFieldArray(date);
+	/**
+	* Renders the row header for a week.
+	* @method renderRowHeader
+	* @param {Number}	weekNum	The week number of the current row
+	* @param {Array}	cell	The current working HTML array
+	*/
+	renderRowHeader : function(weekNum, html) {
+		html[html.length] = '<th class="calrowhead">' + weekNum + '</th>';
+		return html;
+	},
+	
+	/**
+	* Renders the row footer for a week.
+	* @method renderRowFooter
+	* @param {Number}	weekNum	The week number of the current row
+	* @param {Array}	cell	The current working HTML array
+	*/
+	renderRowFooter : function(weekNum, html) {
+		html[html.length] = '<th class="calrowfoot">' + weekNum + '</th>';
+		return html;
+	},
+	
+	/**
+	* Renders a single standard calendar cell in the calendar widget table.
+	* All logic for determining how a standard default cell will be rendered is 
+	* encapsulated in this method, and must be accounted for when extending the
+	* widget class.
+	* @method renderCellDefault
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	*/
+	renderCellDefault : function(workingDate, cell) {
+		cell.innerHTML = '<a href="#" class="' + this.Style.CSS_CELL_SELECTOR + '">' + this.buildDayLabel(workingDate) + "</a>";
+	},
+	
+	/**
+	* Styles a selectable cell.
+	* @method styleCellDefault
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	*/
+	styleCellDefault : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE);
+	},
+	
+	
+	/**
+	* Renders a single standard calendar cell using the CSS hightlight1 style
+	* @method renderCellStyleHighlight1
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	*/
+	renderCellStyleHighlight1 : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);
+	},
+	
+	/**
+	* Renders a single standard calendar cell using the CSS hightlight2 style
+	* @method renderCellStyleHighlight2
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	*/
+	renderCellStyleHighlight2 : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);
+	},
+	
+	/**
+	* Renders a single standard calendar cell using the CSS hightlight3 style
+	* @method renderCellStyleHighlight3
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	*/
+	renderCellStyleHighlight3 : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);
+	},
+	
+	/**
+	* Renders a single standard calendar cell using the CSS hightlight4 style
+	* @method renderCellStyleHighlight4
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	*/
+	renderCellStyleHighlight4 : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);
+	},
+	
+	/**
+	* Applies the default style used for rendering today's date to the current calendar cell
+	* @method renderCellStyleToday
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	*/
+	renderCellStyleToday : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);
+	},
+	
+    /**
+    * Styles an out of month cell.
+    * @method renderCellStyleNotThisMonth
+    * @param {Date}					workingDate		The current working Date object being used to generate the calendar
+    * @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+    */
+    renderCellStyleNotThisMonth : function(workingDate, cell) {
+        YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);
+    },
 
-	for (var a=0;a<aToBeSelected.length;++a) {
-		var toSelect = aToBeSelected[a]; // For each date item in the list of dates we're trying to select
-		var index = this._indexOfSelectedFieldArray(toSelect);
+	/**
+	* Applies the default style used for rendering selected dates to the current calendar cell
+	* @method renderCellStyleSelected
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+	*			should not be terminated
+	*/
+	renderCellStyleSelected : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);
+	},
+	
+	/**
+	* Applies the default style used for rendering dates that are not a part of the current
+	* month (preceding or trailing the cells for the current month)
+	* @method renderCellNotThisMonth
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+	*			should not be terminated
+	*/
+	renderCellNotThisMonth : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);
+		cell.innerHTML=workingDate.getDate();
+		return YAHOO.widget.Calendar.STOP_RENDER;
+	},
+	
+	/**
+	* Renders the current calendar cell as a non-selectable "black-out" date using the default
+	* restricted style.
+	* @method renderBodyCellRestricted
+	* @param {Date}					workingDate		The current working Date object being used to generate the calendar
+	* @param {HTMLTableCellElement}	cell			The current working cell in the calendar
+	* @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
+	*			should not be terminated
+	*/
+	renderBodyCellRestricted : function(workingDate, cell) {
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL);
+		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED);
+		cell.innerHTML=workingDate.getDate();
+		return YAHOO.widget.Calendar.STOP_RENDER;
+	},
+	
+	// END BUILT-IN TABLE CELL RENDERERS
+	
+	// BEGIN MONTH NAVIGATION METHODS
+	
+	/**
+	* Adds the designated number of months to the current calendar month, and sets the current
+	* calendar page date to the new month.
+	* @method addMonths
+	* @param {Number}	count	The number of months to add to the current calendar
+	*/
+	addMonths : function(count) {
+		var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+		this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
+		this.resetRenderers();
+		this.changePageEvent.fire();
+	},
+	
+	/**
+	* Subtracts the designated number of months from the current calendar month, and sets the current
+	* calendar page date to the new month.
+	* @method subtractMonths
+	* @param {Number}	count	The number of months to subtract from the current calendar
+	*/
+	subtractMonths : function(count) {
+		var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+		this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.MONTH, count));
+		this.resetRenderers();
+		this.changePageEvent.fire();
+	},
+	
+	/**
+	* Adds the designated number of years to the current calendar, and sets the current
+	* calendar page date to the new month.
+	* @method addYears
+	* @param {Number}	count	The number of years to add to the current calendar
+	*/
+	addYears : function(count) {
+		var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+		this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.add(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
+		this.resetRenderers();
+		this.changePageEvent.fire();
+	},
+	
+	/**
+	* Subtcats the designated number of years from the current calendar, and sets the current
+	* calendar page date to the new month.
+	* @method subtractYears
+	* @param {Number}	count	The number of years to subtract from the current calendar
+	*/
+	subtractYears : function(count) {
+		var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+		this.cfg.setProperty(cfgPageDate, YAHOO.widget.DateMath.subtract(this.cfg.getProperty(cfgPageDate), YAHOO.widget.DateMath.YEAR, count));
+		this.resetRenderers();
+		this.changePageEvent.fire();
+	},
+	
+	/**
+	* Navigates to the next month page in the calendar widget.
+	* @method nextMonth
+	*/
+	nextMonth : function() {
+		this.addMonths(1);
+	},
+	
+	/**
+	* Navigates to the previous month page in the calendar widget.
+	* @method previousMonth
+	*/
+	previousMonth : function() {
+		this.subtractMonths(1);
+	},
+	
+	/**
+	* Navigates to the next year in the currently selected month in the calendar widget.
+	* @method nextYear
+	*/
+	nextYear : function() {
+		this.addYears(1);
+	},
+	
+	/**
+	* Navigates to the previous year in the currently selected month in the calendar widget.
+	* @method previousYear
+	*/
+	previousYear : function() {
+		this.subtractYears(1);
+	},
+	
+	// END MONTH NAVIGATION METHODS
+	
+	// BEGIN SELECTION METHODS
 	
-		if (index != -1) {	
-			selected.splice(index,1);
+	/**
+	* Resets the calendar widget to the originally selected month and year, and 
+	* sets the calendar to the initial selection(s).
+	* @method reset
+	*/
+	reset : function() {
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+		this.cfg.resetProperty(defCfg.SELECTED.key);
+		this.cfg.resetProperty(defCfg.PAGEDATE.key);
+		this.resetEvent.fire();
+	},
+	
+	/**
+	* Clears the selected dates in the current calendar widget and sets the calendar
+	* to the current month and year.
+	* @method clear
+	*/
+	clear : function() {
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+		this.cfg.setProperty(defCfg.SELECTED.key, []);
+		this.cfg.setProperty(defCfg.PAGEDATE.key, new Date(this.today.getTime()));
+		this.clearEvent.fire();
+	},
+	
+	/**
+	* Selects a date or a collection of dates on the current calendar. This method, by default,
+	* does not call the render method explicitly. Once selection has completed, render must be 
+	* called for the changes to be reflected visually.
+	*
+	* Any dates which are OOB (out of bounds, not selectable) will not be selected and the array of 
+	* selected dates passed to the selectEvent will not contain OOB dates.
+	* 
+	* If all dates are OOB, the no state change will occur; beforeSelect and select events will not be fired.
+	*
+	* @method select
+	* @param	{String/Date/Date[]}	date	The date string of dates to select in the current calendar. Valid formats are
+	*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+	*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+	*								This method can also take a JavaScript Date object or an array of Date objects.
+	* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*/
+	select : function(date) {
+	
+		var aToBeSelected = this._toFieldArray(date);
+	
+		// Filtered array of valid dates
+		var validDates = [];
+		var selected = [];
+		var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+		
+		for (var a=0; a < aToBeSelected.length; ++a) {
+			var toSelect = aToBeSelected[a];
+	
+			if (!this.isDateOOB(this._toDate(toSelect))) {
+				
+				if (validDates.length === 0) {
+					this.beforeSelectEvent.fire();
+					selected = this.cfg.getProperty(cfgSelected);
+				}
+	
+				validDates.push(toSelect);
+				
+				if (this._indexOfSelectedFieldArray(toSelect) == -1) { 
+					selected[selected.length] = toSelect;
+				}
+			}
 		}
-	}
-
-	if (this.parent) {
-		this.parent.cfg.setProperty(cfgSelected, selected);
-	} else {
-		this.cfg.setProperty(cfgSelected, selected);
-	}
-
-	this.deselectEvent.fire(aToBeSelected);
+		
 	
-	return this.getSelectedDates();
-};
-
-/**
-* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
-* This method is used to easily deselect a single cell (usually with a mouse click) without having to do
-* a full render. The selected style is removed from the cell directly.
-* @method deselectCell
-* @param	{Number}	cellIndex	The index of the cell to deselect in the current calendar. 
-* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.Calendar.prototype.deselectCell = function(i) {
-	this.beforeDeselectEvent.fire();
+		if (validDates.length > 0) {
+			if (this.parent) {
+				this.parent.cfg.setProperty(cfgSelected, selected);
+			} else {
+				this.cfg.setProperty(cfgSelected, selected);
+			}
+			this.selectEvent.fire(validDates);
+		}
 	
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+		return this.getSelectedDates();
+	},
 	
-	var selected = this.cfg.getProperty(defCfg.SELECTED.key);
-
-	var cell = this.cells[i];
-	var cellDate = this.cellDates[i];
-	var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
-
-	var dCellDate = this._toDate(cellDate);
-
-	var selectDate = cellDate.concat();
-
-	if (cellDateIndex > -1) {
-		if (this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth() == dCellDate.getMonth() &&
-			this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) {
-			YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);
+	/**
+	* Selects a date on the current calendar by referencing the index of the cell that should be selected.
+	* This method is used to easily select a single cell (usually with a mouse click) without having to do
+	* a full render. The selected style is applied to the cell directly.
+	*
+	* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+	* or out of bounds cells), it will not be selected and in such a case beforeSelect and select events will not be fired.
+	* 
+	* @method selectCell
+	* @param	{Number}	cellIndex	The index of the cell to select in the current calendar. 
+	* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*/
+	selectCell : function(cellIndex) {
+	
+		var cell = this.cells[cellIndex];
+		var cellDate = this.cellDates[cellIndex];
+		var dCellDate = this._toDate(cellDate);
+		
+		var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
+	
+		if (selectable) {
+	
+			this.beforeSelectEvent.fire();
+	
+			var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+			var selected = this.cfg.getProperty(cfgSelected);
+	
+			var selectDate = cellDate.concat();
+	
+			if (this._indexOfSelectedFieldArray(selectDate) == -1) {
+				selected[selected.length] = selectDate;
+			}
+			if (this.parent) {
+				this.parent.cfg.setProperty(cfgSelected, selected);
+			} else {
+				this.cfg.setProperty(cfgSelected, selected);
+			}
+			this.renderCellStyleSelected(dCellDate,cell);
+			this.selectEvent.fire([selectDate]);
+	
+			this.doCellMouseOut.call(cell, null, this);		
 		}
-
-		selected.splice(cellDateIndex, 1);
-	}
-
-	if (this.parent) {
-		this.parent.cfg.setProperty(defCfg.SELECTED.key, selected);
-	} else {
-		this.cfg.setProperty(defCfg.SELECTED.key, selected);
-	}
 	
-	this.deselectEvent.fire(selectDate);
-	return this.getSelectedDates();
-};
-
-/**
-* Deselects all dates on the current calendar.
-* @method deselectAll
-* @return {Date[]}		Array of JavaScript Date objects representing all individual dates that are currently selected.
-*						Assuming that this function executes properly, the return value should be an empty array.
-*						However, the empty array is returned for the sake of being able to check the selection status
-*						of the calendar.
-*/
-YAHOO.widget.Calendar.prototype.deselectAll = function() {
-	this.beforeDeselectEvent.fire();
+		return this.getSelectedDates();
+	},
 	
-	var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
-
-	var selected = this.cfg.getProperty(cfgSelected);
-	var count = selected.length;
-	var sel = selected.concat();
-
-	if (this.parent) {
-		this.parent.cfg.setProperty(cfgSelected, []);
-	} else {
-		this.cfg.setProperty(cfgSelected, []);
-	}
+	/**
+	* Deselects a date or a collection of dates on the current calendar. This method, by default,
+	* does not call the render method explicitly. Once deselection has completed, render must be 
+	* called for the changes to be reflected visually.
+	* 
+	* The method will not attempt to deselect any dates which are OOB (out of bounds, and hence not selectable) 
+	* and the array of deselected dates passed to the deselectEvent will not contain any OOB dates.
+	* 
+	* If all dates are OOB, beforeDeselect and deselect events will not be fired.
+	* 
+	* @method deselect
+	* @param	{String/Date/Date[]}	date	The date string of dates to deselect in the current calendar. Valid formats are
+	*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+	*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+	*								This method can also take a JavaScript Date object or an array of Date objects.	
+	* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*/
+	deselect : function(date) {
+	
+		var aToBeDeselected = this._toFieldArray(date);
+	
+		var validDates = [];
+		var selected = [];
+		var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+	
+		for (var a=0; a < aToBeDeselected.length; ++a) {
+			var toDeselect = aToBeDeselected[a];
+	
+			if (!this.isDateOOB(this._toDate(toDeselect))) {
+	
+				if (validDates.length === 0) {
+					this.beforeDeselectEvent.fire();
+					selected = this.cfg.getProperty(cfgSelected);
+				}
 	
-	if (count > 0) {
-		this.deselectEvent.fire(sel);
-	}
-
-	return this.getSelectedDates();
-};
-
-// END SELECTION METHODS
-
-// BEGIN TYPE CONVERSION METHODS
-
-/**
-* Converts a date (either a JavaScript Date object, or a date string) to the internal data structure
-* used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].
-* @method _toFieldArray
-* @private
-* @param	{String/Date/Date[]}	date	The date string of dates to deselect in the current calendar. Valid formats are
-*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*								This method can also take a JavaScript Date object or an array of Date objects.	
-* @return {Array[](Number[])}	Array of date field arrays
-*/
-YAHOO.widget.Calendar.prototype._toFieldArray = function(date) {
-	var returnDate = [];
-
-	if (date instanceof Date) {
-		returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];
-	} else if (YAHOO.lang.isString(date)) {
-		returnDate = this._parseDates(date);
-	} else if (YAHOO.lang.isArray(date)) {
-		for (var i=0;i<date.length;++i) {
-			var d = date[i];
-			returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];
+				validDates.push(toDeselect);
+	
+				var index = this._indexOfSelectedFieldArray(toDeselect);
+				if (index != -1) {	
+					selected.splice(index,1);
+				}
+			}
 		}
-	}
 	
-	return returnDate;
-};
-
-/**
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
-* @method _toDate
-* @private
-* @param	{Number[]}		dateFieldArray	The date field array to convert to a JavaScript Date.
-* @return	{Date}	JavaScript Date object representing the date field array
-*/
-YAHOO.widget.Calendar.prototype._toDate = function(dateFieldArray) {
-	if (dateFieldArray instanceof Date) {
-		return dateFieldArray;
-	} else {
-		return new Date(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);
-	}
-};
-
-// END TYPE CONVERSION METHODS 
-
-// BEGIN UTILITY METHODS
-
-/**
-* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
-* @method _fieldArraysAreEqual
-* @private
-* @param	{Number[]}	array1	The first date field array to compare
-* @param	{Number[]}	array2	The first date field array to compare
-* @return	{Boolean}	The boolean that represents the equality of the two arrays
-*/
-YAHOO.widget.Calendar.prototype._fieldArraysAreEqual = function(array1, array2) {
-	var match = false;
-
-	if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {
-		match=true;	
-	}
-
-	return match;
-};
+	
+		if (validDates.length > 0) {
+			if (this.parent) {
+				this.parent.cfg.setProperty(cfgSelected, selected);
+			} else {
+				this.cfg.setProperty(cfgSelected, selected);
+			}
+			this.deselectEvent.fire(validDates);
+		}
+	
+		return this.getSelectedDates();
+	},
+	
+	/**
+	* Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
+	* This method is used to easily deselect a single cell (usually with a mouse click) without having to do
+	* a full render. The selected style is removed from the cell directly.
+	* 
+	* If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
+	* or out of bounds cells), the method will not attempt to deselect it and in such a case, beforeDeselect and 
+	* deselect events will not be fired.
+	* 
+	* @method deselectCell
+	* @param	{Number}	cellIndex	The index of the cell to deselect in the current calendar. 
+	* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*/
+	deselectCell : function(cellIndex) {
+		var cell = this.cells[cellIndex];
+		var cellDate = this.cellDates[cellIndex];
+		var cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
+		
+		var selectable = YAHOO.util.Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
+	
+		if (selectable) {
+	
+			this.beforeDeselectEvent.fire();
+	
+			var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+			var selected = this.cfg.getProperty(defCfg.SELECTED.key);
+	
+			var dCellDate = this._toDate(cellDate);
+			var selectDate = cellDate.concat();
+	
+			if (cellDateIndex > -1) {
+				if (this.cfg.getProperty(defCfg.PAGEDATE.key).getMonth() == dCellDate.getMonth() &&
+					this.cfg.getProperty(defCfg.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) {
+					YAHOO.util.Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);
+				}
+				selected.splice(cellDateIndex, 1);
+			}
+	
+			if (this.parent) {
+				this.parent.cfg.setProperty(defCfg.SELECTED.key, selected);
+			} else {
+				this.cfg.setProperty(defCfg.SELECTED.key, selected);
+			}
+	
+			this.deselectEvent.fire(selectDate);
+		}
+	
+		return this.getSelectedDates();
+	},
+	
+	/**
+	* Deselects all dates on the current calendar.
+	* @method deselectAll
+	* @return {Date[]}		Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*						Assuming that this function executes properly, the return value should be an empty array.
+	*						However, the empty array is returned for the sake of being able to check the selection status
+	*						of the calendar.
+	*/
+	deselectAll : function() {
+		this.beforeDeselectEvent.fire();
+		
+		var cfgSelected = YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key;
+	
+		var selected = this.cfg.getProperty(cfgSelected);
+		var count = selected.length;
+		var sel = selected.concat();
+	
+		if (this.parent) {
+			this.parent.cfg.setProperty(cfgSelected, []);
+		} else {
+			this.cfg.setProperty(cfgSelected, []);
+		}
+		
+		if (count > 0) {
+			this.deselectEvent.fire(sel);
+		}
+	
+		return this.getSelectedDates();
+	},
+	
+	// END SELECTION METHODS
+	
+	// BEGIN TYPE CONVERSION METHODS
+	
+	/**
+	* Converts a date (either a JavaScript Date object, or a date string) to the internal data structure
+	* used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].
+	* @method _toFieldArray
+	* @private
+	* @param	{String/Date/Date[]}	date	The date string of dates to deselect in the current calendar. Valid formats are
+	*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+	*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+	*								This method can also take a JavaScript Date object or an array of Date objects.	
+	* @return {Array[](Number[])}	Array of date field arrays
+	*/
+	_toFieldArray : function(date) {
+		var returnDate = [];
+	
+		if (date instanceof Date) {
+			returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];
+		} else if (YAHOO.lang.isString(date)) {
+			returnDate = this._parseDates(date);
+		} else if (YAHOO.lang.isArray(date)) {
+			for (var i=0;i<date.length;++i) {
+				var d = date[i];
+				returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];
+			}
+		}
+		
+		return returnDate;
+	},
+	
+	/**
+	* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object. The date field array
+	* is the format in which dates are as provided as arguments to selectEvent and deselectEvent listeners.
+	* 
+	* @method toDate
+	* @param	{Number[]}	dateFieldArray	The date field array to convert to a JavaScript Date.
+	* @return	{Date}	JavaScript Date object representing the date field array.
+	*/
+	toDate : function(dateFieldArray) {
+		return this._toDate(dateFieldArray);
+	},
+	
+	/**
+	* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
+	* @method _toDate
+	* @private
+	* @deprecated Made public, toDate 
+	* @param	{Number[]}		dateFieldArray	The date field array to convert to a JavaScript Date.
+	* @return	{Date}	JavaScript Date object representing the date field array
+	*/
+	_toDate : function(dateFieldArray) {
+		if (dateFieldArray instanceof Date) {
+			return dateFieldArray;
+		} else {
+			return YAHOO.widget.DateMath.getDate(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);
+		}
+	},
+	
+	// END TYPE CONVERSION METHODS 
+	
+	// BEGIN UTILITY METHODS
+	
+	/**
+	* Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
+	* @method _fieldArraysAreEqual
+	* @private
+	* @param	{Number[]}	array1	The first date field array to compare
+	* @param	{Number[]}	array2	The first date field array to compare
+	* @return	{Boolean}	The boolean that represents the equality of the two arrays
+	*/
+	_fieldArraysAreEqual : function(array1, array2) {
+		var match = false;
+	
+		if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {
+			match=true;	
+		}
+	
+		return match;
+	},
+	
+	/**
+	* Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.
+	* @method	_indexOfSelectedFieldArray
+	* @private
+	* @param	{Number[]}		find	The date field array to search for
+	* @return	{Number}			The index of the date field array within the collection of selected dates.
+	*								-1 will be returned if the date is not found.
+	*/
+	_indexOfSelectedFieldArray : function(find) {
+		var selected = -1;
+		var seldates = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
+	
+		for (var s=0;s<seldates.length;++s) {
+			var sArray = seldates[s];
+			if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {
+				selected = s;
+				break;
+			}
+		}
+	
+		return selected;
+	},
+	
+	/**
+	* Determines whether a given date is OOM (out of month).
+	* @method	isDateOOM
+	* @param	{Date}	date	The JavaScript Date object for which to check the OOM status
+	* @return	{Boolean}	true if the date is OOM
+	*/
+	isDateOOM : function(date) {
+		return (date.getMonth() != this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());
+	},
+	
+	/**
+	* Determines whether a given date is OOB (out of bounds - less than the mindate or more than the maxdate).
+	*
+	* @method	isDateOOB
+	* @param	{Date}	date	The JavaScript Date object for which to check the OOB status
+	* @return	{Boolean}	true if the date is OOB
+	*/
+	isDateOOB : function(date) {
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+		
+		var minDate = this.cfg.getProperty(defCfg.MINDATE.key);
+		var maxDate = this.cfg.getProperty(defCfg.MAXDATE.key);
+		var dm = YAHOO.widget.DateMath;
+		
+		if (minDate) {
+			minDate = dm.clearTime(minDate);
+		} 
+		if (maxDate) {
+			maxDate = dm.clearTime(maxDate);
+		}
+	
+		var clearedDate = new Date(date.getTime());
+		clearedDate = dm.clearTime(clearedDate);
+	
+		return ((minDate && clearedDate.getTime() < minDate.getTime()) || (maxDate && clearedDate.getTime() > maxDate.getTime()));
+	},
+	
+	/**
+	 * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object 
+	 * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object 
+	 * @method	_parsePageDate
+	 * @private
+	 * @param {Date|String}	date	Pagedate value which needs to be parsed
+	 * @return {Date}	The Date object representing the pagedate
+	 */
+	_parsePageDate : function(date) {
+		var parsedDate;
+		
+		var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+	
+		if (date) {
+			if (date instanceof Date) {
+				parsedDate = YAHOO.widget.DateMath.findMonthStart(date);
+			} else {
+				var month, year, aMonthYear;
+				aMonthYear = date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));
+				month = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1], 10)-1;
+				year = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1], 10);
 
-/**
-* Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.
-* @method	_indexOfSelectedFieldArray
-* @private
-* @param	{Number[]}		find	The date field array to search for
-* @return	{Number}			The index of the date field array within the collection of selected dates.
-*								-1 will be returned if the date is not found.
-*/
-YAHOO.widget.Calendar.prototype._indexOfSelectedFieldArray = function(find) {
-	var selected = -1;
-	var seldates = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
-
-	for (var s=0;s<seldates.length;++s) {
-		var sArray = seldates[s];
-		if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {
-			selected = s;
-			break;
+				parsedDate = YAHOO.widget.DateMath.getDate(year, month, 1);
+			}
+		} else {
+			parsedDate = YAHOO.widget.DateMath.getDate(this.today.getFullYear(), this.today.getMonth(), 1);
+		}
+		return parsedDate;
+	},
+	
+	// END UTILITY METHODS
+	
+	// BEGIN EVENT HANDLERS
+	
+	/**
+	* Event executed before a date is selected in the calendar widget.
+	* @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.
+	*/
+	onBeforeSelect : function() {
+		if (this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key) === false) {
+			if (this.parent) {
+				this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);
+				this.parent.deselectAll();
+			} else {
+				this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);
+				this.deselectAll();
+			}
+		}
+	},
+	
+	/**
+	* Event executed when a date is selected in the calendar widget.
+	* @param	{Array}	selected	An array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
+	* @deprecated Event handlers for this event should be susbcribed to selectEvent.
+	*/
+	onSelect : function(selected) { },
+	
+	/**
+	* Event executed before a date is deselected in the calendar widget.
+	* @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.
+	*/
+	onBeforeDeselect : function() { },
+	
+	/**
+	* Event executed when a date is deselected in the calendar widget.
+	* @param	{Array}	selected	An array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
+	* @deprecated Event handlers for this event should be susbcribed to deselectEvent.
+	*/
+	onDeselect : function(deselected) { },
+	
+	/**
+	* Event executed when the user navigates to a different calendar page.
+	* @deprecated Event handlers for this event should be susbcribed to changePageEvent.
+	*/
+	onChangePage : function() {
+		this.render();
+	},
+	
+	/**
+	* Event executed when the calendar widget is rendered.
+	* @deprecated Event handlers for this event should be susbcribed to renderEvent.
+	*/
+	onRender : function() { },
+	
+	/**
+	* Event executed when the calendar widget is reset to its original state.
+	* @deprecated Event handlers for this event should be susbcribed to resetEvemt.
+	*/
+	onReset : function() { this.render(); },
+	
+	/**
+	* Event executed when the calendar widget is completely cleared to the current month with no selections.
+	* @deprecated Event handlers for this event should be susbcribed to clearEvent.
+	*/
+	onClear : function() { this.render(); },
+	
+	/**
+	* Validates the calendar widget. This method has no default implementation
+	* and must be extended by subclassing the widget.
+	* @return	Should return true if the widget validates, and false if
+	* it doesn't.
+	* @type Boolean
+	*/
+	validate : function() { return true; },
+	
+	// END EVENT HANDLERS
+	
+	// BEGIN DATE PARSE METHODS
+	
+	/**
+	* Converts a date string to a date field array
+	* @private
+	* @param	{String}	sDate			Date string. Valid formats are mm/dd and mm/dd/yyyy.
+	* @return				A date field array representing the string passed to the method
+	* @type Array[](Number[])
+	*/
+	_parseDate : function(sDate) {
+		var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);
+		var rArray;
+	
+		if (aDate.length == 2) {
+			rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];
+			rArray.type = YAHOO.widget.Calendar.MONTH_DAY;
+		} else {
+			rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];
+			rArray.type = YAHOO.widget.Calendar.DATE;
+		}
+	
+		for (var i=0;i<rArray.length;i++) {
+			rArray[i] = parseInt(rArray[i], 10);
+		}
+	
+		return rArray;
+	},
+	
+	/**
+	* Converts a multi or single-date string to an array of date field arrays
+	* @private
+	* @param	{String}	sDates		Date string with one or more comma-delimited dates. Valid formats are mm/dd, mm/dd/yyyy, mm/dd/yyyy-mm/dd/yyyy
+	* @return							An array of date field arrays
+	* @type Array[](Number[])
+	*/
+	_parseDates : function(sDates) {
+		var aReturn = [];
+	
+		var aDates = sDates.split(this.Locale.DATE_DELIMITER);
+		
+		for (var d=0;d<aDates.length;++d) {
+			var sDate = aDates[d];
+	
+			if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {
+				// This is a range
+				var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);
+	
+				var dateStart = this._parseDate(aRange[0]);
+				var dateEnd = this._parseDate(aRange[1]);
+	
+				var fullRange = this._parseRange(dateStart, dateEnd);
+				aReturn = aReturn.concat(fullRange);
+			} else {
+				// This is not a range
+				var aDate = this._parseDate(sDate);
+				aReturn.push(aDate);
+			}
+		}
+		return aReturn;
+	},
+	
+	/**
+	* Converts a date range to the full list of included dates
+	* @private
+	* @param	{Number[]}	startDate	Date field array representing the first date in the range
+	* @param	{Number[]}	endDate		Date field array representing the last date in the range
+	* @return							An array of date field arrays
+	* @type Array[](Number[])
+	*/
+	_parseRange : function(startDate, endDate) {
+		var dCurrent = YAHOO.widget.DateMath.add(YAHOO.widget.DateMath.getDate(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);
+		var dEnd     = YAHOO.widget.DateMath.getDate(endDate[0],  endDate[1]-1,  endDate[2]);
+	
+		var results = [];
+		results.push(startDate);
+		while (dCurrent.getTime() <= dEnd.getTime()) {
+			results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);
+			dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);
 		}
-	}
-
-	return selected;
-};
-
-/**
-* Determines whether a given date is OOM (out of month).
-* @method	isDateOOM
-* @param	{Date}	date	The JavaScript Date object for which to check the OOM status
-* @return	{Boolean}	true if the date is OOM
-*/
-YAHOO.widget.Calendar.prototype.isDateOOM = function(date) {
-	return (date.getMonth() != this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key).getMonth());
-};
-
-/**
- * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object 
- * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object 
- * @method	_parsePageDate
- * @private
- * @param {Date|String}	date	Pagedate value which needs to be parsed
- * @return {Date}	The Date object representing the pagedate
- */
-YAHOO.widget.Calendar.prototype._parsePageDate = function(date) {
-	var parsedDate;
+		return results;
+	},
+	
+	// END DATE PARSE METHODS
+	
+	// BEGIN RENDERER METHODS
+	
+	/**
+	* Resets the render stack of the current calendar to its original pre-render value.
+	*/
+	resetRenderers : function() {
+		this.renderStack = this._renderStack.concat();
+	},
 	
-	var defCfg = YAHOO.widget.Calendar._DEFAULT_CONFIG;
+	/**
+	 * Removes all custom renderers added to the Calendar through the addRenderer, addMonthRenderer and 
+	 * addWeekdayRenderer methods. Calendar's render method needs to be called after removing renderers 
+	 * to re-render the Calendar without custom renderers applied.
+	 */
+	removeRenderers : function() {
+		this._renderStack = [];
+		this.renderStack = [];
+	},
 
-	if (date) {
-		if (date instanceof Date) {
-			parsedDate = YAHOO.widget.DateMath.findMonthStart(date);
-		} else {
-			var month, year, aMonthYear;
-			aMonthYear = date.split(this.cfg.getProperty(defCfg.DATE_FIELD_DELIMITER.key));
-			month = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_MONTH_POSITION.key)-1], 10)-1;
-			year = parseInt(aMonthYear[this.cfg.getProperty(defCfg.MY_YEAR_POSITION.key)-1], 10);
-			
-			parsedDate = new Date(year, month, 1);
+	/**
+	* Clears the inner HTML, CSS class and style information from the specified cell.
+	* @method clearElement
+	* @param	{HTMLTableCellElement} cell The cell to clear
+	*/ 
+	clearElement : function(cell) {
+		cell.innerHTML = "&#160;";
+		cell.className="";
+	},
+	
+	/**
+	* Adds a renderer to the render stack. The function reference passed to this method will be executed
+	* when a date cell matches the conditions specified in the date string for this renderer.
+	* @method addRenderer
+	* @param	{String}	sDates		A date string to associate with the specified renderer. Valid formats
+	*									include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
+	* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
+	*/
+	addRenderer : function(sDates, fnRender) {
+		var aDates = this._parseDates(sDates);
+		for (var i=0;i<aDates.length;++i) {
+			var aDate = aDates[i];
+		
+			if (aDate.length == 2) { // this is either a range or a month/day combo
+				if (aDate[0] instanceof Array) { // this is a range
+					this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);
+				} else { // this is a month/day combo
+					this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);
+				}
+			} else if (aDate.length == 3) {
+				this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);
+			}
 		}
-	} else {
-		parsedDate = new Date(this.today.getFullYear(), this.today.getMonth(), 1);
-	}
-	return parsedDate;
-};
-
-// END UTILITY METHODS
+	},
+	
+	/**
+	* The private method used for adding cell renderers to the local render stack.
+	* This method is called by other methods that set the renderer type prior to the method call.
+	* @method _addRenderer
+	* @private
+	* @param	{String}	type		The type string that indicates the type of date renderer being added.
+	*									Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,
+	*									YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH
+	* @param	{Array}		aDates		An array of dates used to construct the renderer. The format varies based
+	*									on the renderer type
+	* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
+	*/
+	_addRenderer : function(type, aDates, fnRender) {
+		var add = [type,aDates,fnRender];
+		this.renderStack.unshift(add);	
+		this._renderStack = this.renderStack.concat();
+	},
 
-// BEGIN EVENT HANDLERS
+	/**
+	* Adds a month to the render stack. The function reference passed to this method will be executed
+	* when a date cell matches the month passed to this method.
+	* @method addMonthRenderer
+	* @param	{Number}	month		The month (1-12) to associate with this renderer
+	* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
+	*/
+	addMonthRenderer : function(month, fnRender) {
+		this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);
+	},
 
-/**
-* Event executed before a date is selected in the calendar widget.
-* @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onBeforeSelect = function() {
-	if (this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.MULTI_SELECT.key) === false) {
-		if (this.parent) {
-			this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);
-			this.parent.deselectAll();
-		} else {
-			this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);
-			this.deselectAll();
+	/**
+	* Adds a weekday to the render stack. The function reference passed to this method will be executed
+	* when a date cell matches the weekday passed to this method.
+	* @method addWeekdayRenderer
+	* @param	{Number}	weekday		The weekday (0-6) to associate with this renderer
+	* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
+	*/
+	addWeekdayRenderer : function(weekday, fnRender) {
+		this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);
+	},
+	
+	// END RENDERER METHODS
+	
+	// BEGIN CSS METHODS
+	
+	/**
+	* Removes all styles from all body cells in the current calendar table.
+	* @method clearAllBodyCellStyles
+	* @param	{style}	style The CSS class name to remove from all calendar body cells
+	*/
+	clearAllBodyCellStyles : function(style) {
+		for (var c=0;c<this.cells.length;++c) {
+			YAHOO.util.Dom.removeClass(this.cells[c],style);
 		}
-	}
-};
-
-/**
-* Event executed when a date is selected in the calendar widget.
-* @param	{Array}	selected	An array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
-* @deprecated Event handlers for this event should be susbcribed to selectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onSelect = function(selected) { };
-
-/**
-* Event executed before a date is deselected in the calendar widget.
-* @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onBeforeDeselect = function() { };
-
-/**
-* Event executed when a date is deselected in the calendar widget.
-* @param	{Array}	selected	An array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
-* @deprecated Event handlers for this event should be susbcribed to deselectEvent.
-*/
-YAHOO.widget.Calendar.prototype.onDeselect = function(deselected) { };
-
-/**
-* Event executed when the user navigates to a different calendar page.
-* @deprecated Event handlers for this event should be susbcribed to changePageEvent.
-*/
-YAHOO.widget.Calendar.prototype.onChangePage = function() {
-	this.render();
-};
-
-/**
-* Event executed when the calendar widget is rendered.
-* @deprecated Event handlers for this event should be susbcribed to renderEvent.
-*/
-YAHOO.widget.Calendar.prototype.onRender = function() { };
-
-/**
-* Event executed when the calendar widget is reset to its original state.
-* @deprecated Event handlers for this event should be susbcribed to resetEvemt.
-*/
-YAHOO.widget.Calendar.prototype.onReset = function() { this.render(); };
-
-/**
-* Event executed when the calendar widget is completely cleared to the current month with no selections.
-* @deprecated Event handlers for this event should be susbcribed to clearEvent.
-*/
-YAHOO.widget.Calendar.prototype.onClear = function() { this.render(); };
-
-/**
-* Validates the calendar widget. This method has no default implementation
-* and must be extended by subclassing the widget.
-* @return	Should return true if the widget validates, and false if
-* it doesn't.
-* @type Boolean
-*/
-YAHOO.widget.Calendar.prototype.validate = function() { return true; };
-
-// END EVENT HANDLERS
+	},
+	
+	// END CSS METHODS
+	
+	// BEGIN GETTER/SETTER METHODS
+	/**
+	* Sets the calendar's month explicitly
+	* @method setMonth
+	* @param {Number}	month		The numeric month, from 0 (January) to 11 (December)
+	*/
+	setMonth : function(month) {
+		var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+		var current = this.cfg.getProperty(cfgPageDate);
+		current.setMonth(parseInt(month, 10));
+		this.cfg.setProperty(cfgPageDate, current);
+	},
 
-// BEGIN DATE PARSE METHODS
+	/**
+	* Sets the calendar's year explicitly.
+	* @method setYear
+	* @param {Number}	year		The numeric 4-digit year
+	*/
+	setYear : function(year) {
+		var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
+		var current = this.cfg.getProperty(cfgPageDate);
+		current.setFullYear(parseInt(year, 10));
+		this.cfg.setProperty(cfgPageDate, current);
+	},
 
-/**
-* Converts a date string to a date field array
-* @private
-* @param	{String}	sDate			Date string. Valid formats are mm/dd and mm/dd/yyyy.
-* @return				A date field array representing the string passed to the method
-* @type Array[](Number[])
-*/
-YAHOO.widget.Calendar.prototype._parseDate = function(sDate) {
-	var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER);
-	var rArray;
-
-	if (aDate.length == 2) {
-		rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];
-		rArray.type = YAHOO.widget.Calendar.MONTH_DAY;
-	} else {
-		rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];
-		rArray.type = YAHOO.widget.Calendar.DATE;
-	}
+	/**
+	* Gets the list of currently selected dates from the calendar.
+	* @method getSelectedDates
+	* @return {Date[]} An array of currently selected JavaScript Date objects.
+	*/
+	getSelectedDates : function() {
+		var returnDates = [];
+		var selected = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
 
-	for (var i=0;i<rArray.length;i++) {
-		rArray[i] = parseInt(rArray[i], 10);
-	}
+		for (var d=0;d<selected.length;++d) {
+			var dateArray = selected[d];
 
-	return rArray;
-};
+			var date = YAHOO.widget.DateMath.getDate(dateArray[0],dateArray[1]-1,dateArray[2]);
+			returnDates.push(date);
+		}
 
-/**
-* Converts a multi or single-date string to an array of date field arrays
-* @private
-* @param	{String}	sDates		Date string with one or more comma-delimited dates. Valid formats are mm/dd, mm/dd/yyyy, mm/dd/yyyy-mm/dd/yyyy
-* @return							An array of date field arrays
-* @type Array[](Number[])
-*/
-YAHOO.widget.Calendar.prototype._parseDates = function(sDates) {
-	var aReturn = [];
+		returnDates.sort( function(a,b) { return a-b; } );
+		return returnDates;
+	},
 
-	var aDates = sDates.split(this.Locale.DATE_DELIMITER);
+	/// END GETTER/SETTER METHODS ///
 	
-	for (var d=0;d<aDates.length;++d) {
-		var sDate = aDates[d];
-
-		if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {
-			// This is a range
-			var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER);
-
-			var dateStart = this._parseDate(aRange[0]);
-			var dateEnd = this._parseDate(aRange[1]);
-
-			var fullRange = this._parseRange(dateStart, dateEnd);
-			aReturn = aReturn.concat(fullRange);
-		} else {
-			// This is not a range
-			var aDate = this._parseDate(sDate);
-			aReturn.push(aDate);
+	/**
+	* Hides the Calendar's outer container from view.
+	* @method hide
+	*/
+	hide : function() {
+		if (this.beforeHideEvent.fire()) {
+			this.oDomContainer.style.display = "none";
+			this.hideEvent.fire();
 		}
-	}
-	return aReturn;
-};
-
-/**
-* Converts a date range to the full list of included dates
-* @private
-* @param	{Number[]}	startDate	Date field array representing the first date in the range
-* @param	{Number[]}	endDate		Date field array representing the last date in the range
-* @return							An array of date field arrays
-* @type Array[](Number[])
-*/
-YAHOO.widget.Calendar.prototype._parseRange = function(startDate, endDate) {
-	var dStart   = new Date(startDate[0],startDate[1]-1,startDate[2]);
-	var dCurrent = YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);
-	var dEnd     = new Date(endDate[0],  endDate[1]-1,  endDate[2]);
-
-	var results = [];
-	results.push(startDate);
-	while (dCurrent.getTime() <= dEnd.getTime()) {
-		results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);
-		dCurrent = YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);
-	}
-	return results;
-};
-
-// END DATE PARSE METHODS
-
-// BEGIN RENDERER METHODS
-
-/**
-* Resets the render stack of the current calendar to its original pre-render value.
-*/
-YAHOO.widget.Calendar.prototype.resetRenderers = function() {
-	this.renderStack = this._renderStack.concat();
-};
-
-/**
-* Clears the inner HTML, CSS class and style information from the specified cell.
-* @method clearElement
-* @param	{HTMLTableCellElement}	The cell to clear
-*/ 
-YAHOO.widget.Calendar.prototype.clearElement = function(cell) {
-	cell.innerHTML = "&#160;";
-	cell.className="";
-};
+	},
 
-/**
-* Adds a renderer to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the conditions specified in the date string for this renderer.
-* @method addRenderer
-* @param	{String}	sDates		A date string to associate with the specified renderer. Valid formats
-*									include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
-* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype.addRenderer = function(sDates, fnRender) {
-	var aDates = this._parseDates(sDates);
-	for (var i=0;i<aDates.length;++i) {
-		var aDate = aDates[i];
-	
-		if (aDate.length == 2) { // this is either a range or a month/day combo
-			if (aDate[0] instanceof Array) { // this is a range
-				this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);
-			} else { // this is a month/day combo
-				this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);
-			}
-		} else if (aDate.length == 3) {
-			this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);
+	/**
+	* Shows the Calendar's outer container.
+	* @method show
+	*/
+	show : function() {
+		if (this.beforeShowEvent.fire()) {
+			this.oDomContainer.style.display = "block";
+			this.showEvent.fire();
 		}
-	}
-};
-
-/**
-* The private method used for adding cell renderers to the local render stack.
-* This method is called by other methods that set the renderer type prior to the method call.
-* @method _addRenderer
-* @private
-* @param	{String}	type		The type string that indicates the type of date renderer being added.
-*									Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,
-*									YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH
-* @param	{Array}		aDates		An array of dates used to construct the renderer. The format varies based
-*									on the renderer type
-* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype._addRenderer = function(type, aDates, fnRender) {
-	var add = [type,aDates,fnRender];
-	this.renderStack.unshift(add);	
-	this._renderStack = this.renderStack.concat();
-};
-
-/**
-* Adds a month to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the month passed to this method.
-* @method addMonthRenderer
-* @param	{Number}	month		The month (1-12) to associate with this renderer
-* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype.addMonthRenderer = function(month, fnRender) {
-	this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);
-};
-
-/**
-* Adds a weekday to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the weekday passed to this method.
-* @method addWeekdayRenderer
-* @param	{Number}	weekday		The weekday (0-6) to associate with this renderer
-* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.Calendar.prototype.addWeekdayRenderer = function(weekday, fnRender) {
-	this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);
-};
-
-// END RENDERER METHODS
-
-// BEGIN CSS METHODS
-
-/**
-* Removes all styles from all body cells in the current calendar table.
-* @method clearAllBodyCellStyles
-* @param	{style}		The CSS class name to remove from all calendar body cells
-*/
-YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles = function(style) {
-	for (var c=0;c<this.cells.length;++c) {
-		YAHOO.util.Dom.removeClass(this.cells[c],style);
-	}
-};
-
-// END CSS METHODS
-
-// BEGIN GETTER/SETTER METHODS
-/**
-* Sets the calendar's month explicitly
-* @method setMonth
-* @param {Number}	month		The numeric month, from 0 (January) to 11 (December)
-*/
-YAHOO.widget.Calendar.prototype.setMonth = function(month) {
-	var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-	var current = this.cfg.getProperty(cfgPageDate);
-	current.setMonth(parseInt(month, 10));
-	this.cfg.setProperty(cfgPageDate, current);
-};
-
-/**
-* Sets the calendar's year explicitly.
-* @method setYear
-* @param {Number}	year		The numeric 4-digit year
-*/
-YAHOO.widget.Calendar.prototype.setYear = function(year) {
-	var cfgPageDate = YAHOO.widget.Calendar._DEFAULT_CONFIG.PAGEDATE.key;
-	var current = this.cfg.getProperty(cfgPageDate);
-	current.setFullYear(parseInt(year, 10));
-	this.cfg.setProperty(cfgPageDate, current);
-};
-
-/**
-* Gets the list of currently selected dates from the calendar.
-* @method getSelectedDates
-* @return {Date[]} An array of currently selected JavaScript Date objects.
-*/
-YAHOO.widget.Calendar.prototype.getSelectedDates = function() {
-	var returnDates = [];
-	var selected = this.cfg.getProperty(YAHOO.widget.Calendar._DEFAULT_CONFIG.SELECTED.key);
-
-	for (var d=0;d<selected.length;++d) {
-		var dateArray = selected[d];
+	},
 
-		var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);
-		returnDates.push(date);
+	/**
+	* Returns a string representing the current browser.
+	* @deprecated As of 2.3.0, environment information is available in YAHOO.env.ua
+	* @see YAHOO.env.ua
+	* @property browser
+	* @type String
+	*/
+	browser : (function() {
+				var ua = navigator.userAgent.toLowerCase();
+					  if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
+						 return 'opera';
+					  } else if (ua.indexOf('msie 7')!=-1) { // IE7
+						 return 'ie7';
+					  } else if (ua.indexOf('msie') !=-1) { // IE
+						 return 'ie';
+					  } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
+						 return 'safari';
+					  } else if (ua.indexOf('gecko') != -1) { // Gecko
+						 return 'gecko';
+					  } else {
+						 return false;
+					  }
+				})(),
+	/**
+	* Returns a string representation of the object.
+	* @method toString
+	* @return {String}	A string representation of the Calendar object.
+	*/
+	toString : function() {
+		return "Calendar " + this.id;
 	}
-
-	returnDates.sort( function(a,b) { return a-b; } );
-	return returnDates;
-};
-
-/// END GETTER/SETTER METHODS ///
-
-/**
-* Hides the Calendar's outer container from view.
-* @method hide
-*/
-YAHOO.widget.Calendar.prototype.hide = function() {
-	this.oDomContainer.style.display = "none";
-};
-
-/**
-* Shows the Calendar's outer container.
-* @method show
-*/
-YAHOO.widget.Calendar.prototype.show = function() {
-	this.oDomContainer.style.display = "block";
-};
-
-/**
-* Returns a string representing the current browser.
-* @property browser
-* @type String
-*/
-YAHOO.widget.Calendar.prototype.browser = function() {
-			var ua = navigator.userAgent.toLowerCase();
-				  if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
-					 return 'opera';
-				  } else if (ua.indexOf('msie 7')!=-1) { // IE7
-					 return 'ie7';
-				  } else if (ua.indexOf('msie') !=-1) { // IE
-					 return 'ie';
-				  } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
-					 return 'safari';
-				  } else if (ua.indexOf('gecko') != -1) { // Gecko
-					 return 'gecko';
-				  } else {
-					 return false;
-				  }
-			}();
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}	A string representation of the Calendar object.
-*/
-YAHOO.widget.Calendar.prototype.toString = function() {
-	return "Calendar " + this.id;
 };
 
 /**
@@ -3443,7 +4245,7 @@
 * YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar. This class facilitates
 * the ability to have multi-page calendar views that share a single dataset and are
 * dependent on each other.
-* 
+*
 * The calendar group instance will refer to each of its elements using a 0-based index.
 * For example, to construct the placeholder for a calendar group widget with id "cal1" and
 * containerId of "cal1Container", the markup would be as follows:
@@ -3452,1012 +4254,1211 @@
 *		<div id="cal1Container_1"></div>
 *	</xmp>
 * The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.
+* 
+* <p>
+* <strong>NOTE: As of 2.4.0, the constructor's ID argument is optional.</strong>
+* The CalendarGroup can be constructed by simply providing a container ID string, 
+* or a reference to a container DIV HTMLElement (the element needs to exist 
+* in the document).
+* 
+* E.g.:
+*	<xmp>
+*		var c = new YAHOO.widget.CalendarGroup("calContainer", configOptions);
+*	</xmp>
+* or:
+*   <xmp>
+*       var containerDiv = YAHOO.util.Dom.get("calContainer");
+*		var c = new YAHOO.widget.CalendarGroup(containerDiv, configOptions);
+*	</xmp>
+* </p>
+* <p>
+* If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix.
+* For example if an ID is not provided, and the container's ID is "calContainer", the CalendarGroup's ID will be set to "calContainer_t".
+* </p>
+* 
 * @namespace YAHOO.widget
 * @class CalendarGroup
 * @constructor
-* @param {String}	id			The id of the table element that will represent the calendar widget
-* @param {String}	containerId	The id of the container div element that will wrap the calendar table
-* @param {Object}	config		The configuration object containing the Calendar's arguments
+* @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional.
+* @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document.
+* @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup.
 */
 YAHOO.widget.CalendarGroup = function(id, containerId, config) {
 	if (arguments.length > 0) {
-		this.init(id, containerId, config);
+		this.init.apply(this, arguments);
 	}
 };
 
-/**
-* Initializes the calendar group. All subclasses must call this method in order for the
-* group to be initialized properly.
-* @method init
-* @param {String}	id			The id of the table element that will represent the calendar widget
-* @param {String}	containerId	The id of the container div element that will wrap the calendar table
-* @param {Object}	config		The configuration object containing the Calendar's arguments
-*/
-YAHOO.widget.CalendarGroup.prototype.init = function(id, containerId, config) {
-	this.initEvents();
-	this.initStyles();
+YAHOO.widget.CalendarGroup.prototype = {
 
 	/**
-	* The collection of Calendar pages contained within the CalendarGroup
-	* @property pages
-	* @type YAHOO.widget.Calendar[]
-	*/
-	this.pages = [];
-	
-	/**
-	* The unique id associated with the CalendarGroup
-	* @property id
-	* @type String
+	* Initializes the calendar group. All subclasses must call this method in order for the
+	* group to be initialized properly.
+	* @method init
+	* @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional.
+	* @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document.
+	* @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup.
 	*/
-	this.id = id;
+	init : function(id, container, config) {
 
-	/**
-	* The unique id associated with the CalendarGroup container
-	* @property containerId
-	* @type String
-	*/
-	this.containerId = containerId;
+		// Normalize 2.4.0, pre 2.4.0 args
+		var nArgs = this._parseArgs(arguments);
 
-	/**
-	* The outer containing element for the CalendarGroup
-	* @property oDomContainer
-	* @type HTMLElement
-	*/
-	this.oDomContainer = document.getElementById(containerId);
+		id = nArgs.id;
+		container = nArgs.container;
+		config = nArgs.config;
 
-	YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_CONTAINER);
-	YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_MULTI_UP);
+		this.oDomContainer = YAHOO.util.Dom.get(container);
 
-	/**
-	* The Config object used to hold the configuration variables for the CalendarGroup
-	* @property cfg
-	* @type YAHOO.util.Config
-	*/
-	this.cfg = new YAHOO.util.Config(this);
+		if (!this.oDomContainer.id) {
+			this.oDomContainer.id = YAHOO.util.Dom.generateId();
+		}
+		if (!id) {
+			id = this.oDomContainer.id + "_t";
+		}
 
-	/**
-	* The local object which contains the CalendarGroup's options
-	* @property Options
-	* @type Object
-	*/
-	this.Options = {};
+		/**
+		* The unique id associated with the CalendarGroup
+		* @property id
+		* @type String
+		*/
+		this.id = id;
 
-	/**
-	* The local object which contains the CalendarGroup's locale settings
-	* @property Locale
-	* @type Object
-	*/
-	this.Locale = {};
+		/**
+		* The unique id associated with the CalendarGroup container
+		* @property containerId
+		* @type String
+		*/
+		this.containerId = this.oDomContainer.id;
+
+		this.initEvents();
+		this.initStyles();
+
+		/**
+		* The collection of Calendar pages contained within the CalendarGroup
+		* @property pages
+		* @type YAHOO.widget.Calendar[]
+		*/
+		this.pages = [];
+
+		YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_CONTAINER);
+		YAHOO.util.Dom.addClass(this.oDomContainer, YAHOO.widget.CalendarGroup.CSS_MULTI_UP);
+
+		/**
+		* The Config object used to hold the configuration variables for the CalendarGroup
+		* @property cfg
+		* @type YAHOO.util.Config
+		*/
+		this.cfg = new YAHOO.util.Config(this);
+
+		/**
+		* The local object which contains the CalendarGroup's options
+		* @property Options
+		* @type Object
+		*/
+		this.Options = {};
+
+		/**
+		* The local object which contains the CalendarGroup's locale settings
+		* @property Locale
+		* @type Object
+		*/
+		this.Locale = {};
+
+		this.setupConfig();
+
+		if (config) {
+			this.cfg.applyConfig(config, true);
+		}
+
+		this.cfg.fireQueue();
 
-	this.setupConfig();
+		// OPERA HACK FOR MISWRAPPED FLOATS
+		if (YAHOO.env.ua.opera){
+			this.renderEvent.subscribe(this._fixWidth, this, true);
+			this.showEvent.subscribe(this._fixWidth, this, true);
+		}
+
+	},
+
+	setupConfig : function() {
+
+		var defCfg = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;
+
+		/**
+		* The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.
+		* @config pages
+		* @type Number
+		* @default 2
+		*/
+		this.cfg.addProperty(defCfg.PAGES.key, { value:defCfg.PAGES.value, validator:this.cfg.checkNumber, handler:this.configPages } );
 
-	if (config) {
-		this.cfg.applyConfig(config, true);
-	}
+		/**
+		* The month/year representing the current visible Calendar date (mm/yyyy)
+		* @config pagedate
+		* @type String
+		* @default today's date
+		*/
+		this.cfg.addProperty(defCfg.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } );
 
-	this.cfg.fireQueue();
+		/**
+		* The date or range of dates representing the current Calendar selection
+		* @config selected
+		* @type String
+		* @default []
+		*/
+		this.cfg.addProperty(defCfg.SELECTED.key, { value:[], handler:this.configSelected } );
 
-	// OPERA HACK FOR MISWRAPPED FLOATS
-	if (this.browser == "opera"){
-		var fixWidth = function() {
-			var startW = this.oDomContainer.offsetWidth;
-			var w = 0;
-			for (var p=0;p<this.pages.length;++p) {
-				var cal = this.pages[p];
-				w += cal.oDomContainer.offsetWidth;
-			}
-			if (w > 0) {
-				this.oDomContainer.style.width = w + "px";
-			}
-		};
-		this.renderEvent.subscribe(fixWidth,this,true);
-	}
-};
+		/**
+		* The title to display above the CalendarGroup's month header
+		* @config title
+		* @type String
+		* @default ""
+		*/
+		this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
 
+		/**
+		* Whether or not a close button should be displayed for this CalendarGroup
+		* @config close
+		* @type Boolean
+		* @default false
+		*/
+		this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
 
-YAHOO.widget.CalendarGroup.prototype.setupConfig = function() {
+		/**
+		* Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
+		* This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
+		* enabled if required.
+		* 
+		* @config iframe
+		* @type Boolean
+		* @default true for IE6 and below, false for all other browsers
+		*/
+		this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
 	
-	var defCfg = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG;
+		/**
+		* The minimum selectable date in the current Calendar (mm/dd/yyyy)
+		* @config mindate
+		* @type String
+		* @default null
+		*/
+		this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.delegateConfig } );
 	
-	/**
-	* The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.
-	* @config pages
-	* @type Number
-	* @default 2
-	*/
-	this.cfg.addProperty(defCfg.PAGES.key, { value:defCfg.PAGES.value, validator:this.cfg.checkNumber, handler:this.configPages } );
-
-	/**
-	* The month/year representing the current visible Calendar date (mm/yyyy)
-	* @config pagedate
-	* @type String
-	* @default today's date
-	*/
-	this.cfg.addProperty(defCfg.PAGEDATE.key, { value:defCfg.PAGEDATE.value, handler:this.configPageDate } );
+		/**
+		* The maximum selectable date in the current Calendar (mm/dd/yyyy)
+		* @config maxdate
+		* @type String
+		* @default null
+		*/	
+		this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.delegateConfig  } );
+	
+		// Options properties
+	
+		/**
+		* True if the Calendar should allow multiple selections. False by default.
+		* @config MULTI_SELECT
+		* @type Boolean
+		* @default false
+		*/
+		this.cfg.addProperty(defCfg.MULTI_SELECT.key,	{ value:defCfg.MULTI_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+	
+		/**
+		* The weekday the week begins on. Default is 0 (Sunday).
+		* @config START_WEEKDAY
+		* @type number
+		* @default 0
+		*/	
+		this.cfg.addProperty(defCfg.START_WEEKDAY.key,	{ value:defCfg.START_WEEKDAY.value, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
+		
+		/**
+		* True if the Calendar should show weekday labels. True by default.
+		* @config SHOW_WEEKDAYS
+		* @type Boolean
+		* @default true
+		*/	
+		this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,	{ value:defCfg.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+		
+		/**
+		* True if the Calendar should show week row headers. False by default.
+		* @config SHOW_WEEK_HEADER
+		* @type Boolean
+		* @default false
+		*/	
+		this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{ value:defCfg.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+		
+		/**
+		* True if the Calendar should show week row footers. False by default.
+		* @config SHOW_WEEK_FOOTER
+		* @type Boolean
+		* @default false
+		*/
+		this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+		
+		/**
+		* True if the Calendar should suppress weeks that are not a part of the current month. False by default.
+		* @config HIDE_BLANK_WEEKS
+		* @type Boolean
+		* @default false
+		*/		
+		this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{ value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+		
+        /**
+        * True if the Calendar should allow out of month selections. false by default.
+        * @config OUT_OF_MONTH_SELECT
+        * @type Boolean
+        * @default false
+        */
+        this.cfg.addProperty(defCfg.OUT_OF_MONTH_SELECT.key,{ value:defCfg.OUT_OF_MONTH_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
 
-	/**
-	* The date or range of dates representing the current Calendar selection
-	* @config selected
-	* @type String
-	* @default []
-	*/
-	this.cfg.addProperty(defCfg.SELECTED.key, { value:defCfg.SELECTED.value, handler:this.configSelected } );
+		/**
+		* The image that should be used for the left navigation arrow.
+		* @config NAV_ARROW_LEFT
+		* @type String
+		* @deprecated	You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"
+		* @default null
+		*/		
+		this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,	{ value:defCfg.NAV_ARROW_LEFT.value, handler:this.delegateConfig } );
+		
+		/**
+		* The image that should be used for the right navigation arrow.
+		* @config NAV_ARROW_RIGHT
+		* @type String
+		* @deprecated	You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
+		* @default null
+		*/		
+		this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,	{ value:defCfg.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } );
+	
+		// Locale properties
+		
+		/**
+		* The short month labels for the current locale.
+		* @config MONTHS_SHORT
+		* @type String[]
+		* @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+		*/
+		this.cfg.addProperty(defCfg.MONTHS_SHORT.key,	{ value:defCfg.MONTHS_SHORT.value, handler:this.delegateConfig } );
+		
+		/**
+		* The long month labels for the current locale.
+		* @config MONTHS_LONG
+		* @type String[]
+		* @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
+		*/		
+		this.cfg.addProperty(defCfg.MONTHS_LONG.key,		{ value:defCfg.MONTHS_LONG.value, handler:this.delegateConfig } );
+		
+		/**
+		* The 1-character weekday labels for the current locale.
+		* @config WEEKDAYS_1CHAR
+		* @type String[]
+		* @default ["S", "M", "T", "W", "T", "F", "S"]
+		*/		
+		this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,	{ value:defCfg.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } );
+		
+		/**
+		* The short weekday labels for the current locale.
+		* @config WEEKDAYS_SHORT
+		* @type String[]
+		* @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
+		*/		
+		this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,	{ value:defCfg.WEEKDAYS_SHORT.value, handler:this.delegateConfig } );
+		
+		/**
+		* The medium weekday labels for the current locale.
+		* @config WEEKDAYS_MEDIUM
+		* @type String[]
+		* @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+		*/		
+		this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,	{ value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } );
+		
+		/**
+		* The long weekday labels for the current locale.
+		* @config WEEKDAYS_LONG
+		* @type String[]
+		* @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+		*/		
+		this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,	{ value:defCfg.WEEKDAYS_LONG.value, handler:this.delegateConfig } );
+	
+		/**
+		* The setting that determines which length of month labels should be used. Possible values are "short" and "long".
+		* @config LOCALE_MONTHS
+		* @type String
+		* @default "long"
+		*/
+		this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,	{ value:defCfg.LOCALE_MONTHS.value, handler:this.delegateConfig } );
+	
+		/**
+		* The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
+		* @config LOCALE_WEEKDAYS
+		* @type String
+		* @default "short"
+		*/	
+		this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,	{ value:defCfg.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } );
+	
+		/**
+		* The value used to delimit individual dates in a date string passed to various Calendar functions.
+		* @config DATE_DELIMITER
+		* @type String
+		* @default ","
+		*/
+		this.cfg.addProperty(defCfg.DATE_DELIMITER.key,		{ value:defCfg.DATE_DELIMITER.value, handler:this.delegateConfig } );
+	
+		/**
+		* The value used to delimit date fields in a date string passed to various Calendar functions.
+		* @config DATE_FIELD_DELIMITER
+		* @type String
+		* @default "/"
+		*/	
+		this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{ value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } );
+	
+		/**
+		* The value used to delimit date ranges in a date string passed to various Calendar functions.
+		* @config DATE_RANGE_DELIMITER
+		* @type String
+		* @default "-"
+		*/
+		this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{ value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } );
+	
+		/**
+		* The position of the month in a month/year date string
+		* @config MY_MONTH_POSITION
+		* @type Number
+		* @default 1
+		*/
+		this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,	{ value:defCfg.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+		
+		/**
+		* The position of the year in a month/year date string
+		* @config MY_YEAR_POSITION
+		* @type Number
+		* @default 2
+		*/	
+		this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,	{ value:defCfg.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+		
+		/**
+		* The position of the month in a month/day date string
+		* @config MD_MONTH_POSITION
+		* @type Number
+		* @default 1
+		*/	
+		this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,	{ value:defCfg.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+		
+		/**
+		* The position of the day in a month/year date string
+		* @config MD_DAY_POSITION
+		* @type Number
+		* @default 2
+		*/	
+		this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,		{ value:defCfg.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+		
+		/**
+		* The position of the month in a month/day/year date string
+		* @config MDY_MONTH_POSITION
+		* @type Number
+		* @default 1
+		*/	
+		this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,	{ value:defCfg.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+		
+		/**
+		* The position of the day in a month/day/year date string
+		* @config MDY_DAY_POSITION
+		* @type Number
+		* @default 2
+		*/	
+		this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,	{ value:defCfg.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+		
+		/**
+		* The position of the year in a month/day/year date string
+		* @config MDY_YEAR_POSITION
+		* @type Number
+		* @default 3
+		*/	
+		this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,	{ value:defCfg.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+	
+		/**
+		* The position of the month in the month year label string used as the Calendar header
+		* @config MY_LABEL_MONTH_POSITION
+		* @type Number
+		* @default 1
+		*/
+		this.cfg.addProperty(defCfg.MY_LABEL_MONTH_POSITION.key,	{ value:defCfg.MY_LABEL_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+	
+		/**
+		* The position of the year in the month year label string used as the Calendar header
+		* @config MY_LABEL_YEAR_POSITION
+		* @type Number
+		* @default 2
+		*/
+		this.cfg.addProperty(defCfg.MY_LABEL_YEAR_POSITION.key,	{ value:defCfg.MY_LABEL_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+		
+		/**
+		* The suffix used after the month when rendering the Calendar header
+		* @config MY_LABEL_MONTH_SUFFIX
+		* @type String
+		* @default " "
+		*/
+		this.cfg.addProperty(defCfg.MY_LABEL_MONTH_SUFFIX.key,	{ value:defCfg.MY_LABEL_MONTH_SUFFIX.value, handler:this.delegateConfig } );
+		
+		/**
+		* The suffix used after the year when rendering the Calendar header
+		* @config MY_LABEL_YEAR_SUFFIX
+		* @type String
+		* @default ""
+		*/
+		this.cfg.addProperty(defCfg.MY_LABEL_YEAR_SUFFIX.key, { value:defCfg.MY_LABEL_YEAR_SUFFIX.value, handler:this.delegateConfig } );
 
-	/**
-	* The title to display above the CalendarGroup's month header
-	* @config title
-	* @type String
-	* @default ""
-	*/
-	this.cfg.addProperty(defCfg.TITLE.key, { value:defCfg.TITLE.value, handler:this.configTitle } );
+		/**
+		* Configuration for the Month Year Navigation UI. By default it is disabled
+		* @config NAV
+		* @type Object
+		* @default null
+		*/
+		this.cfg.addProperty(defCfg.NAV.key, { value:defCfg.NAV.value, handler:this.configNavigator } );
+	},
 
 	/**
-	* Whether or not a close button should be displayed for this CalendarGroup
-	* @config close
-	* @type Boolean
-	* @default false
+	* Initializes CalendarGroup's built-in CustomEvents
+	* @method initEvents
 	*/
-	this.cfg.addProperty(defCfg.CLOSE.key, { value:defCfg.CLOSE.value, handler:this.configClose } );
+	initEvents : function() {
+		var me = this;
+		var strEvent = "Event";
 
-	/**
-	* Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
-	* @config iframe
-	* @type Boolean
-	* @default true
-	*/
-	this.cfg.addProperty(defCfg.IFRAME.key, { value:defCfg.IFRAME.value, handler:this.configIframe, validator:this.cfg.checkBoolean } );
+		/**
+		* Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents
+		* @method sub
+		* @private
+		* @param {Function} fn	The function to subscribe to this CustomEvent
+		* @param {Object}	obj	The CustomEvent's scope object
+		* @param {Boolean}	bOverride	Whether or not to apply scope correction
+		*/
+		var sub = function(fn, obj, bOverride) {
+			for (var p=0;p<me.pages.length;++p) {
+				var cal = me.pages[p];
+				cal[this.type + strEvent].subscribe(fn, obj, bOverride);
+			}
+		};
 
-	/**
-	* The minimum selectable date in the current Calendar (mm/dd/yyyy)
-	* @config mindate
-	* @type String
-	* @default null
-	*/
-	this.cfg.addProperty(defCfg.MINDATE.key, { value:defCfg.MINDATE.value, handler:this.delegateConfig } );
+		/**
+		* Proxy unsubscriber to unsubscribe from the CalendarGroup's child Calendars' CustomEvents
+		* @method unsub
+		* @private
+		* @param {Function} fn	The function to subscribe to this CustomEvent
+		* @param {Object}	obj	The CustomEvent's scope object
+		*/
+		var unsub = function(fn, obj) {
+			for (var p=0;p<me.pages.length;++p) {
+				var cal = me.pages[p];
+				cal[this.type + strEvent].unsubscribe(fn, obj);
+			}
+		};
+		
+		var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+	
+		/**
+		* Fired before a selection is made
+		* @event beforeSelectEvent
+		*/
+		this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);
+		this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;
+	
+		/**
+		* Fired when a selection is made
+		* @event selectEvent
+		* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].
+		*/
+		this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT); 
+		this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;
+	
+		/**
+		* Fired before a selection is made
+		* @event beforeDeselectEvent
+		*/
+		this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT); 
+		this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;
+	
+		/**
+		* Fired when a selection is made
+		* @event deselectEvent
+		* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].
+		*/
+		this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT); 
+		this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;
+		
+		/**
+		* Fired when the Calendar page is changed
+		* @event changePageEvent
+		*/
+		this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE); 
+		this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;
+	
+		/**
+		* Fired before the Calendar is rendered
+		* @event beforeRenderEvent
+		*/
+		this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
+		this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;
+	
+		/**
+		* Fired when the Calendar is rendered
+		* @event renderEvent
+		*/
+		this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
+		this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;
+	
+		/**
+		* Fired when the Calendar is reset
+		* @event resetEvent
+		*/
+		this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET); 
+		this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;
+	
+		/**
+		* Fired when the Calendar is cleared
+		* @event clearEvent
+		*/
+		this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
+		this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;
+	
+		/**
+		* Fired just before the CalendarGroup is to be shown
+		* @event beforeShowEvent
+		*/
+		this.beforeShowEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW);
+	
+		/**
+		* Fired after the CalendarGroup is shown
+		* @event showEvent
+		*/
+		this.showEvent = new YAHOO.util.CustomEvent(defEvents.SHOW);
+	
+		/**
+		* Fired just before the CalendarGroup is to be hidden
+		* @event beforeHideEvent
+		*/
+		this.beforeHideEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE);
+	
+		/**
+		* Fired after the CalendarGroup is hidden
+		* @event hideEvent
+		*/
+		this.hideEvent = new YAHOO.util.CustomEvent(defEvents.HIDE);
 
-	/**
-	* The maximum selectable date in the current Calendar (mm/dd/yyyy)
-	* @config maxdate
-	* @type String
-	* @default null
-	*/	
-	this.cfg.addProperty(defCfg.MAXDATE.key, { value:defCfg.MAXDATE.value, handler:this.delegateConfig  } );
+		/**
+		* Fired just before the CalendarNavigator is to be shown
+		* @event beforeShowNavEvent
+		*/
+		this.beforeShowNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SHOW_NAV);
+	
+		/**
+		* Fired after the CalendarNavigator is shown
+		* @event showNavEvent
+		*/
+		this.showNavEvent = new YAHOO.util.CustomEvent(defEvents.SHOW_NAV);
+	
+		/**
+		* Fired just before the CalendarNavigator is to be hidden
+		* @event beforeHideNavEvent
+		*/
+		this.beforeHideNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_HIDE_NAV);
+	
+		/**
+		* Fired after the CalendarNavigator is hidden
+		* @event hideNavEvent
+		*/
+		this.hideNavEvent = new YAHOO.util.CustomEvent(defEvents.HIDE_NAV);
 
-	// Options properties
+		/**
+		* Fired just before the CalendarNavigator is to be rendered
+		* @event beforeRenderNavEvent
+		*/
+		this.beforeRenderNavEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER_NAV);
 
+		/**
+		* Fired after the CalendarNavigator is rendered
+		* @event renderNavEvent
+		*/
+		this.renderNavEvent = new YAHOO.util.CustomEvent(defEvents.RENDER_NAV);
+	},
+	
 	/**
-	* True if the Calendar should allow multiple selections. False by default.
-	* @config MULTI_SELECT
-	* @type Boolean
-	* @default false
-	*/
-	this.cfg.addProperty(defCfg.MULTI_SELECT.key,	{ value:defCfg.MULTI_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+	* The default Config handler for the "pages" property
+	* @method configPages
+	* @param {String} type	The CustomEvent type (usually the property name)
+	* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+	* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
+	*/
+	configPages : function(type, args, obj) {
+		var pageCount = args[0];
+	
+		var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+	
+		// Define literals outside loop	
+		var sep = "_";
+		var groupCalClass = "groupcal";
+	
+		var firstClass = "first-of-type";
+		var lastClass = "last-of-type";
+	
+		for (var p=0;p<pageCount;++p) {
+			var calId = this.id + sep + p;
+			var calContainerId = this.containerId + sep + p;
+	
+			var childConfig = this.cfg.getConfig();
+			childConfig.close = false;
+			childConfig.title = false;
+			childConfig.navigator = null;
+
+			var cal = this.constructChild(calId, calContainerId, childConfig);
+			var caldate = cal.cfg.getProperty(cfgPageDate);
+			this._setMonthOnDate(caldate, caldate.getMonth() + p);
+			cal.cfg.setProperty(cfgPageDate, caldate);
+	
+			YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);
+			YAHOO.util.Dom.addClass(cal.oDomContainer, groupCalClass);
 
-	/**
-	* The weekday the week begins on. Default is 0 (Sunday).
-	* @config START_WEEKDAY
-	* @type number
-	* @default 0
-	*/	
-	this.cfg.addProperty(defCfg.START_WEEKDAY.key,	{ value:defCfg.START_WEEKDAY.value, handler:this.delegateConfig, validator:this.cfg.checkNumber  } );
+			if (p===0) {
+				YAHOO.util.Dom.addClass(cal.oDomContainer, firstClass);
+			}
 	
-	/**
-	* True if the Calendar should show weekday labels. True by default.
-	* @config SHOW_WEEKDAYS
-	* @type Boolean
-	* @default true
-	*/	
-	this.cfg.addProperty(defCfg.SHOW_WEEKDAYS.key,	{ value:defCfg.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+			if (p==(pageCount-1)) {
+				YAHOO.util.Dom.addClass(cal.oDomContainer, lastClass);
+			}
 	
-	/**
-	* True if the Calendar should show week row headers. False by default.
-	* @config SHOW_WEEK_HEADER
-	* @type Boolean
-	* @default false
-	*/	
-	this.cfg.addProperty(defCfg.SHOW_WEEK_HEADER.key,{ value:defCfg.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+			cal.parent = this;
+			cal.index = p; 
 	
-	/**
-	* True if the Calendar should show week row footers. False by default.
-	* @config SHOW_WEEK_FOOTER
-	* @type Boolean
-	* @default false
-	*/
-	this.cfg.addProperty(defCfg.SHOW_WEEK_FOOTER.key,{ value:defCfg.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+			this.pages[this.pages.length] = cal;
+		}
+	},
 	
 	/**
-	* True if the Calendar should suppress weeks that are not a part of the current month. False by default.
-	* @config HIDE_BLANK_WEEKS
-	* @type Boolean
-	* @default false
-	*/		
-	this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{ value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+	* The default Config handler for the "pagedate" property
+	* @method configPageDate
+	* @param {String} type	The CustomEvent type (usually the property name)
+	* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+	* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
+	*/
+	configPageDate : function(type, args, obj) {
+		var val = args[0];
+		var firstPageDate;
+		
+		var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+		
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			if (p === 0) {
+				firstPageDate = cal._parsePageDate(val);
+				cal.cfg.setProperty(cfgPageDate, firstPageDate);
+			} else {
+				var pageDate = new Date(firstPageDate);
+				this._setMonthOnDate(pageDate, pageDate.getMonth() + p);
+				cal.cfg.setProperty(cfgPageDate, pageDate);
+			}
+		}
+	},
 	
 	/**
-	* The image that should be used for the left navigation arrow.
-	* @config NAV_ARROW_LEFT
-	* @type String
-	* @deprecated	You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"
-	* @default null
-	*/		
-	this.cfg.addProperty(defCfg.NAV_ARROW_LEFT.key,	{ value:defCfg.NAV_ARROW_LEFT.value, handler:this.delegateConfig } );
+	* The default Config handler for the CalendarGroup "selected" property
+	* @method configSelected
+	* @param {String} type	The CustomEvent type (usually the property name)
+	* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+	* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
+	*/
+	configSelected : function(type, args, obj) {
+		var cfgSelected = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;
+		this.delegateConfig(type, args, obj);
+		var selected = (this.pages.length > 0) ? this.pages[0].cfg.getProperty(cfgSelected) : []; 
+		this.cfg.setProperty(cfgSelected, selected, true);
+	},
+
 	
 	/**
-	* The image that should be used for the right navigation arrow.
-	* @config NAV_ARROW_RIGHT
-	* @type String
-	* @deprecated	You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
-	* @default null
-	*/		
-	this.cfg.addProperty(defCfg.NAV_ARROW_RIGHT.key,	{ value:defCfg.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } );
+	* Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children
+	* @method delegateConfig
+	* @param {String} type	The CustomEvent type (usually the property name)
+	* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
+	* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
+	*/
+	delegateConfig : function(type, args, obj) {
+		var val = args[0];
+		var cal;
+	
+		for (var p=0;p<this.pages.length;p++) {
+			cal = this.pages[p];
+			cal.cfg.setProperty(type, val);
+		}
+	},
 
-	// Locale properties
-	
 	/**
-	* The short month labels for the current locale.
-	* @config MONTHS_SHORT
-	* @type String[]
-	* @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+	* Adds a function to all child Calendars within this CalendarGroup.
+	* @method setChildFunction
+	* @param {String}		fnName		The name of the function
+	* @param {Function}		fn			The function to apply to each Calendar page object
 	*/
-	this.cfg.addProperty(defCfg.MONTHS_SHORT.key,	{ value:defCfg.MONTHS_SHORT.value, handler:this.delegateConfig } );
+	setChildFunction : function(fnName, fn) {
+		var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
 	
+		for (var p=0;p<pageCount;++p) {
+			this.pages[p][fnName] = fn;
+		}
+	},
+
 	/**
-	* The long month labels for the current locale.
-	* @config MONTHS_LONG
-	* @type String[]
-	* @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
-	*/		
-	this.cfg.addProperty(defCfg.MONTHS_LONG.key,		{ value:defCfg.MONTHS_LONG.value, handler:this.delegateConfig } );
-	
+	* Calls a function within all child Calendars within this CalendarGroup.
+	* @method callChildFunction
+	* @param {String}		fnName		The name of the function
+	* @param {Array}		args		The arguments to pass to the function
+	*/
+	callChildFunction : function(fnName, args) {
+		var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
+	
+		for (var p=0;p<pageCount;++p) {
+			var page = this.pages[p];
+			if (page[fnName]) {
+				var fn = page[fnName];
+				fn.call(page, args);
+			}
+		}	
+	},
+
 	/**
-	* The 1-character weekday labels for the current locale.
-	* @config WEEKDAYS_1CHAR
-	* @type String[]
-	* @default ["S", "M", "T", "W", "T", "F", "S"]
-	*/		
-	this.cfg.addProperty(defCfg.WEEKDAYS_1CHAR.key,	{ value:defCfg.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } );
+	* Constructs a child calendar. This method can be overridden if a subclassed version of the default
+	* calendar is to be used.
+	* @method constructChild
+	* @param {String}	id			The id of the table element that will represent the calendar widget
+	* @param {String}	containerId	The id of the container div element that will wrap the calendar table
+	* @param {Object}	config		The configuration object containing the Calendar's arguments
+	* @return {YAHOO.widget.Calendar}	The YAHOO.widget.Calendar instance that is constructed
+	*/
+	constructChild : function(id,containerId,config) {
+		var container = document.getElementById(containerId);
+		if (! container) {
+			container = document.createElement("div");
+			container.id = containerId;
+			this.oDomContainer.appendChild(container);
+		}
+		return new YAHOO.widget.Calendar(id,containerId,config);
+	},
 	
 	/**
-	* The short weekday labels for the current locale.
-	* @config WEEKDAYS_SHORT
-	* @type String[]
-	* @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
-	*/		
-	this.cfg.addProperty(defCfg.WEEKDAYS_SHORT.key,	{ value:defCfg.WEEKDAYS_SHORT.value, handler:this.delegateConfig } );
-	
+	* Sets the calendar group's month explicitly. This month will be set into the first
+	* page of the multi-page calendar, and all other months will be iterated appropriately.
+	* @method setMonth
+	* @param {Number}	month		The numeric month, from 0 (January) to 11 (December)
+	*/
+	setMonth : function(month) {
+		month = parseInt(month, 10);
+		var currYear;
+
+		var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+
+		for (var p=0; p<this.pages.length; ++p) {
+			var cal = this.pages[p];
+			var pageDate = cal.cfg.getProperty(cfgPageDate);
+			if (p === 0) {
+				currYear = pageDate.getFullYear();
+			} else {
+				pageDate.setFullYear(currYear);
+			}
+			this._setMonthOnDate(pageDate, month+p); 
+			cal.cfg.setProperty(cfgPageDate, pageDate);
+		}
+	},
+
 	/**
-	* The medium weekday labels for the current locale.
-	* @config WEEKDAYS_MEDIUM
-	* @type String[]
-	* @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
-	*/		
-	this.cfg.addProperty(defCfg.WEEKDAYS_MEDIUM.key,	{ value:defCfg.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } );
+	* Sets the calendar group's year explicitly. This year will be set into the first
+	* page of the multi-page calendar, and all other months will be iterated appropriately.
+	* @method setYear
+	* @param {Number}	year		The numeric 4-digit year
+	*/
+	setYear : function(year) {
+	
+		var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
+	
+		year = parseInt(year, 10);
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			var pageDate = cal.cfg.getProperty(cfgPageDate);
 	
-	/**
-	* The long weekday labels for the current locale.
-	* @config WEEKDAYS_LONG
-	* @type String[]
-	* @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
-	*/		
-	this.cfg.addProperty(defCfg.WEEKDAYS_LONG.key,	{ value:defCfg.WEEKDAYS_LONG.value, handler:this.delegateConfig } );
+			if ((pageDate.getMonth()+1) == 1 && p>0) {
+				year+=1;
+			}
+			cal.setYear(year);
+		}
+	},
 
 	/**
-	* The setting that determines which length of month labels should be used. Possible values are "short" and "long".
-	* @config LOCALE_MONTHS
-	* @type String
-	* @default "long"
+	* Calls the render function of all child calendars within the group.
+	* @method render
 	*/
-	this.cfg.addProperty(defCfg.LOCALE_MONTHS.key,	{ value:defCfg.LOCALE_MONTHS.value, handler:this.delegateConfig } );
-
-	/**
-	* The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
-	* @config LOCALE_WEEKDAYS
-	* @type String
-	* @default "short"
-	*/	
-	this.cfg.addProperty(defCfg.LOCALE_WEEKDAYS.key,	{ value:defCfg.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } );
+	render : function() {
+		this.renderHeader();
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.render();
+		}
+		this.renderFooter();
+	},
 
 	/**
-	* The value used to delimit individual dates in a date string passed to various Calendar functions.
-	* @config DATE_DELIMITER
-	* @type String
-	* @default ","
-	*/
-	this.cfg.addProperty(defCfg.DATE_DELIMITER.key,		{ value:defCfg.DATE_DELIMITER.value, handler:this.delegateConfig } );
+	* Selects a date or a collection of dates on the current calendar. This method, by default,
+	* does not call the render method explicitly. Once selection has completed, render must be 
+	* called for the changes to be reflected visually.
+	* @method select
+	* @param	{String/Date/Date[]}	date	The date string of dates to select in the current calendar. Valid formats are
+	*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+	*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+	*								This method can also take a JavaScript Date object or an array of Date objects.
+	* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*/
+	select : function(date) {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.select(date);
+		}
+		return this.getSelectedDates();
+	},
 
 	/**
-	* The value used to delimit date fields in a date string passed to various Calendar functions.
-	* @config DATE_FIELD_DELIMITER
-	* @type String
-	* @default "/"
-	*/	
-	this.cfg.addProperty(defCfg.DATE_FIELD_DELIMITER.key,{ value:defCfg.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } );
-
+	* Selects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+	* The value of the MULTI_SELECT Configuration attribute will determine the set of dates which get selected. 
+	* <ul>
+	*    <li>If MULTI_SELECT is false, selectCell will select the cell at the specified index for only the last displayed Calendar page.</li>
+	*    <li>If MULTI_SELECT is true, selectCell will select the cell at the specified index, on each displayed Calendar page.</li>
+	* </ul>
+	* @method selectCell
+	* @param	{Number}	cellIndex	The index of the cell to be selected. 
+	* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*/
+	selectCell : function(cellIndex) {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.selectCell(cellIndex);
+		}
+		return this.getSelectedDates();
+	},
+	
 	/**
-	* The value used to delimit date ranges in a date string passed to various Calendar functions.
-	* @config DATE_RANGE_DELIMITER
-	* @type String
-	* @default "-"
-	*/
-	this.cfg.addProperty(defCfg.DATE_RANGE_DELIMITER.key,{ value:defCfg.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } );
-
+	* Deselects a date or a collection of dates on the current calendar. This method, by default,
+	* does not call the render method explicitly. Once deselection has completed, render must be 
+	* called for the changes to be reflected visually.
+	* @method deselect
+	* @param	{String/Date/Date[]}	date	The date string of dates to deselect in the current calendar. Valid formats are
+	*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
+	*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
+	*								This method can also take a JavaScript Date object or an array of Date objects.	
+	* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*/
+	deselect : function(date) {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.deselect(date);
+		}
+		return this.getSelectedDates();
+	},
+	
 	/**
-	* The position of the month in a month/year date string
-	* @config MY_MONTH_POSITION
-	* @type Number
-	* @default 1
-	*/
-	this.cfg.addProperty(defCfg.MY_MONTH_POSITION.key,	{ value:defCfg.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+	* Deselects all dates on the current calendar.
+	* @method deselectAll
+	* @return {Date[]}		Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*						Assuming that this function executes properly, the return value should be an empty array.
+	*						However, the empty array is returned for the sake of being able to check the selection status
+	*						of the calendar.
+	*/
+	deselectAll : function() {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.deselectAll();
+		}
+		return this.getSelectedDates();
+	},
 	
 	/**
-	* The position of the year in a month/year date string
-	* @config MY_YEAR_POSITION
-	* @type Number
-	* @default 2
-	*/	
-	this.cfg.addProperty(defCfg.MY_YEAR_POSITION.key,	{ value:defCfg.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+	* Deselects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
+	* deselectCell will deselect the cell at the specified index on each displayed Calendar page.
+	*
+	* @method deselectCell
+	* @param	{Number}	cellIndex	The index of the cell to deselect. 
+	* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.
+	*/
+	deselectCell : function(cellIndex) {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.deselectCell(cellIndex);
+		}
+		return this.getSelectedDates();
+	},
 	
 	/**
-	* The position of the month in a month/day date string
-	* @config MD_MONTH_POSITION
-	* @type Number
-	* @default 1
-	*/	
-	this.cfg.addProperty(defCfg.MD_MONTH_POSITION.key,	{ value:defCfg.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+	* Resets the calendar widget to the originally selected month and year, and 
+	* sets the calendar to the initial selection(s).
+	* @method reset
+	*/
+	reset : function() {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.reset();
+		}
+	},
 	
 	/**
-	* The position of the day in a month/year date string
-	* @config MD_DAY_POSITION
-	* @type Number
-	* @default 2
-	*/	
-	this.cfg.addProperty(defCfg.MD_DAY_POSITION.key,		{ value:defCfg.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+	* Clears the selected dates in the current calendar widget and sets the calendar
+	* to the current month and year.
+	* @method clear
+	*/
+	clear : function() {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.clear();
+		}
+	},
 	
 	/**
-	* The position of the month in a month/day/year date string
-	* @config MDY_MONTH_POSITION
-	* @type Number
-	* @default 1
-	*/	
-	this.cfg.addProperty(defCfg.MDY_MONTH_POSITION.key,	{ value:defCfg.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+	* Navigates to the next month page in the calendar widget.
+	* @method nextMonth
+	*/
+	nextMonth : function() {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.nextMonth();
+		}
+	},
 	
 	/**
-	* The position of the day in a month/day/year date string
-	* @config MDY_DAY_POSITION
-	* @type Number
-	* @default 2
-	*/	
-	this.cfg.addProperty(defCfg.MDY_DAY_POSITION.key,	{ value:defCfg.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+	* Navigates to the previous month page in the calendar widget.
+	* @method previousMonth
+	*/
+	previousMonth : function() {
+		for (var p=this.pages.length-1;p>=0;--p) {
+			var cal = this.pages[p];
+			cal.previousMonth();
+		}
+	},
 	
 	/**
-	* The position of the year in a month/day/year date string
-	* @config MDY_YEAR_POSITION
-	* @type Number
-	* @default 3
-	*/	
-	this.cfg.addProperty(defCfg.MDY_YEAR_POSITION.key,	{ value:defCfg.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:this.cfg.checkNumber } );
+	* Navigates to the next year in the currently selected month in the calendar widget.
+	* @method nextYear
+	*/
+	nextYear : function() {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.nextYear();
+		}
+	},
 
-};
+	/**
+	* Navigates to the previous year in the currently selected month in the calendar widget.
+	* @method previousYear
+	*/
+	previousYear : function() {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.previousYear();
+		}
+	},
 
-/**
-* Initializes CalendarGroup's built-in CustomEvents
-* @method initEvents
-*/
-YAHOO.widget.CalendarGroup.prototype.initEvents = function() {
-	var me = this;
-	var strEvent = "Event";
+	/**
+	* Gets the list of currently selected dates from the calendar.
+	* @return			An array of currently selected JavaScript Date objects.
+	* @type Date[]
+	*/
+	getSelectedDates : function() { 
+		var returnDates = [];
+		var selected = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);
+		for (var d=0;d<selected.length;++d) {
+			var dateArray = selected[d];
+
+			var date = YAHOO.widget.DateMath.getDate(dateArray[0],dateArray[1]-1,dateArray[2]);
+			returnDates.push(date);
+		}
+
+		returnDates.sort( function(a,b) { return a-b; } );
+		return returnDates;
+	},
 
 	/**
-	* Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents
-	* @method sub
-	* @private
-	* @param {Function} fn	The function to subscribe to this CustomEvent
-	* @param {Object}	obj	The CustomEvent's scope object
-	* @param {Boolean}	bOverride	Whether or not to apply scope correction
-	*/
-	var sub = function(fn, obj, bOverride) {
-		for (var p=0;p<me.pages.length;++p) {
-			var cal = me.pages[p];
-			cal[this.type + strEvent].subscribe(fn, obj, bOverride);
+	* Adds a renderer to the render stack. The function reference passed to this method will be executed
+	* when a date cell matches the conditions specified in the date string for this renderer.
+	* @method addRenderer
+	* @param	{String}	sDates		A date string to associate with the specified renderer. Valid formats
+	*									include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
+	* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
+	*/
+	addRenderer : function(sDates, fnRender) {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.addRenderer(sDates, fnRender);
 		}
-	};
+	},
 
 	/**
-	* Proxy unsubscriber to unsubscribe from the CalendarGroup's child Calendars' CustomEvents
-	* @method unsub
-	* @private
-	* @param {Function} fn	The function to subscribe to this CustomEvent
-	* @param {Object}	obj	The CustomEvent's scope object
-	*/
-	var unsub = function(fn, obj) {
-		for (var p=0;p<me.pages.length;++p) {
-			var cal = me.pages[p];
-			cal[this.type + strEvent].unsubscribe(fn, obj);
+	* Adds a month to the render stack. The function reference passed to this method will be executed
+	* when a date cell matches the month passed to this method.
+	* @method addMonthRenderer
+	* @param	{Number}	month		The month (1-12) to associate with this renderer
+	* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
+	*/
+	addMonthRenderer : function(month, fnRender) {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.addMonthRenderer(month, fnRender);
 		}
-	};
-	
-	var defEvents = YAHOO.widget.Calendar._EVENT_TYPES;
+	},
 
 	/**
-	* Fired before a selection is made
-	* @event beforeSelectEvent
-	*/
-	this.beforeSelectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_SELECT);
-	this.beforeSelectEvent.subscribe = sub; this.beforeSelectEvent.unsubscribe = unsub;
+	* Adds a weekday to the render stack. The function reference passed to this method will be executed
+	* when a date cell matches the weekday passed to this method.
+	* @method addWeekdayRenderer
+	* @param	{Number}	weekday		The weekday (1-7) to associate with this renderer. 1=Sunday, 2=Monday etc.
+	* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
+	*/
+	addWeekdayRenderer : function(weekday, fnRender) {
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			cal.addWeekdayRenderer(weekday, fnRender);
+		}
+	},
+
+	/**
+	 * Removes all custom renderers added to the CalendarGroup through the addRenderer, addMonthRenderer and 
+	 * addWeekRenderer methods. CalendarGroup's render method needs to be called to after removing renderers 
+	 * to see the changes applied.
+	 * 
+	 * @method removeRenderers
+	 */
+	removeRenderers : function() {
+		this.callChildFunction("removeRenderers");
+	},
 
 	/**
-	* Fired when a selection is made
-	* @event selectEvent
-	* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].
+	* Renders the header for the CalendarGroup.
+	* @method renderHeader
 	*/
-	this.selectEvent = new YAHOO.util.CustomEvent(defEvents.SELECT); 
-	this.selectEvent.subscribe = sub; this.selectEvent.unsubscribe = unsub;
+	renderHeader : function() {
+		// EMPTY DEFAULT IMPL
+	},
 
 	/**
-	* Fired before a selection is made
-	* @event beforeDeselectEvent
+	* Renders a footer for the 2-up calendar container. By default, this method is
+	* unimplemented.
+	* @method renderFooter
 	*/
-	this.beforeDeselectEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_DESELECT); 
-	this.beforeDeselectEvent.subscribe = sub; this.beforeDeselectEvent.unsubscribe = unsub;
+	renderFooter : function() {
+		// EMPTY DEFAULT IMPL
+	},
 
 	/**
-	* Fired when a selection is made
-	* @event deselectEvent
-	* @param {Array}	Array of Date field arrays in the format [YYYY, MM, DD].
+	* Adds the designated number of months to the current calendar month, and sets the current
+	* calendar page date to the new month.
+	* @method addMonths
+	* @param {Number}	count	The number of months to add to the current calendar
 	*/
-	this.deselectEvent = new YAHOO.util.CustomEvent(defEvents.DESELECT); 
-	this.deselectEvent.subscribe = sub; this.deselectEvent.unsubscribe = unsub;
+	addMonths : function(count) {
+		this.callChildFunction("addMonths", count);
+	},
 	
 	/**
-	* Fired when the Calendar page is changed
-	* @event changePageEvent
+	* Subtracts the designated number of months from the current calendar month, and sets the current
+	* calendar page date to the new month.
+	* @method subtractMonths
+	* @param {Number}	count	The number of months to subtract from the current calendar
 	*/
-	this.changePageEvent = new YAHOO.util.CustomEvent(defEvents.CHANGE_PAGE); 
-	this.changePageEvent.subscribe = sub; this.changePageEvent.unsubscribe = unsub;
+	subtractMonths : function(count) {
+		this.callChildFunction("subtractMonths", count);
+	},
 
 	/**
-	* Fired before the Calendar is rendered
-	* @event beforeRenderEvent
+	* Adds the designated number of years to the current calendar, and sets the current
+	* calendar page date to the new month.
+	* @method addYears
+	* @param {Number}	count	The number of years to add to the current calendar
 	*/
-	this.beforeRenderEvent = new YAHOO.util.CustomEvent(defEvents.BEFORE_RENDER);
-	this.beforeRenderEvent.subscribe = sub; this.beforeRenderEvent.unsubscribe = unsub;
+	addYears : function(count) {
+		this.callChildFunction("addYears", count);
+	},
 
 	/**
-	* Fired when the Calendar is rendered
-	* @event renderEvent
+	* Subtcats the designated number of years from the current calendar, and sets the current
+	* calendar page date to the new month.
+	* @method subtractYears
+	* @param {Number}	count	The number of years to subtract from the current calendar
 	*/
-	this.renderEvent = new YAHOO.util.CustomEvent(defEvents.RENDER);
-	this.renderEvent.subscribe = sub; this.renderEvent.unsubscribe = unsub;
+	subtractYears : function(count) {
+		this.callChildFunction("subtractYears", count);
+	},
 
 	/**
-	* Fired when the Calendar is reset
-	* @event resetEvent
-	*/
-	this.resetEvent = new YAHOO.util.CustomEvent(defEvents.RESET); 
-	this.resetEvent.subscribe = sub; this.resetEvent.unsubscribe = unsub;
+	 * Returns the Calendar page instance which has a pagedate (month/year) matching the given date. 
+	 * Returns null if no match is found.
+	 * 
+	 * @method getCalendarPage
+	 * @param {Date} date The JavaScript Date object for which a Calendar page is to be found.
+	 * @return {Calendar} The Calendar page instance representing the month to which the date 
+	 * belongs.
+	 */
+	getCalendarPage : function(date) {
+		var cal = null;
+		if (date) {
+			var y = date.getFullYear(),
+				m = date.getMonth();
+
+			var pages = this.pages;
+			for (var i = 0; i < pages.length; ++i) {
+				var pageDate = pages[i].cfg.getProperty("pagedate");
+				if (pageDate.getFullYear() === y && pageDate.getMonth() === m) {
+					cal = pages[i];
+					break;
+				}
+			}
+		}
+		return cal;
+	},
 
 	/**
-	* Fired when the Calendar is cleared
-	* @event clearEvent
+	* Sets the month on a Date object, taking into account year rollover if the month is less than 0 or greater than 11.
+	* The Date object passed in is modified. It should be cloned before passing it into this method if the original value needs to be maintained
+	* @method	_setMonthOnDate
+	* @private
+	* @param	{Date}	date	The Date object on which to set the month index
+	* @param	{Number}	iMonth	The month index to set
 	*/
-	this.clearEvent = new YAHOO.util.CustomEvent(defEvents.CLEAR);
-	this.clearEvent.subscribe = sub; this.clearEvent.unsubscribe = unsub;
-
-};
-
-/**
-* The default Config handler for the "pages" property
-* @method configPages
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.configPages = function(type, args, obj) {
-	var pageCount = args[0];
-
-	var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
-
-	// Define literals outside loop	
-	var sep = "_";
-	var groupCalClass = "groupcal";
-	var firstClass = "first";
-	var lastClass = "last";
-
-	for (var p=0;p<pageCount;++p) {
-		var calId = this.id + sep + p;
-		var calContainerId = this.containerId + sep + p;
-
-		var childConfig = this.cfg.getConfig();
-		childConfig.close = false;
-		childConfig.title = false;
-
-		var cal = this.constructChild(calId, calContainerId, childConfig);
-		var caldate = cal.cfg.getProperty(cfgPageDate);
-		this._setMonthOnDate(caldate, caldate.getMonth() + p);
-		cal.cfg.setProperty(cfgPageDate, caldate);
-		
-		YAHOO.util.Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);
-		YAHOO.util.Dom.addClass(cal.oDomContainer, groupCalClass);
-		
-		if (p===0) {
-			YAHOO.util.Dom.addClass(cal.oDomContainer, firstClass);
-		}
-
-		if (p==(pageCount-1)) {
-			YAHOO.util.Dom.addClass(cal.oDomContainer, lastClass);
-		}
-		
-		cal.parent = this;
-		cal.index = p; 
-
-		this.pages[this.pages.length] = cal;
-	}
-};
-
-/**
-* The default Config handler for the "pagedate" property
-* @method configPageDate
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.configPageDate = function(type, args, obj) {
-	var val = args[0];
-	var firstPageDate;
-	
-	var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
-	
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		if (p === 0) {
-			firstPageDate = cal._parsePageDate(val);
-			cal.cfg.setProperty(cfgPageDate, firstPageDate);
-		} else {
-			var pageDate = new Date(firstPageDate);
-			this._setMonthOnDate(pageDate, pageDate.getMonth() + p);
-			cal.cfg.setProperty(cfgPageDate, pageDate);
-		}
-	}
-};
-
-/**
-* The default Config handler for the CalendarGroup "selected" property
-* @method configSelected
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.configSelected = function(type, args, obj) {
-	var cfgSelected = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key;
-	this.delegateConfig(type, args, obj);
-	var selected = (this.pages.length > 0) ? this.pages[0].cfg.getProperty(cfgSelected) : []; 
-	this.cfg.setProperty(cfgSelected, selected, true);
-};
-
-
-/**
-* Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children
-* @method delegateConfig
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.CalendarGroup.prototype.delegateConfig = function(type, args, obj) {
-	var val = args[0];
-	var cal;
-
-	for (var p=0;p<this.pages.length;p++) {
-		cal = this.pages[p];
-		cal.cfg.setProperty(type, val);
-	}
-};
-
-
-/**
-* Adds a function to all child Calendars within this CalendarGroup.
-* @method setChildFunction
-* @param {String}		fnName		The name of the function
-* @param {Function}		fn			The function to apply to each Calendar page object
-*/
-YAHOO.widget.CalendarGroup.prototype.setChildFunction = function(fnName, fn) {
-	var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
-
-	for (var p=0;p<pageCount;++p) {
-		this.pages[p][fnName] = fn;
-	}
-};
-
-/**
-* Calls a function within all child Calendars within this CalendarGroup.
-* @method callChildFunction
-* @param {String}		fnName		The name of the function
-* @param {Array}		args		The arguments to pass to the function
-*/
-YAHOO.widget.CalendarGroup.prototype.callChildFunction = function(fnName, args) {
-	var pageCount = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES.key);
-
-	for (var p=0;p<pageCount;++p) {
-		var page = this.pages[p];
-		if (page[fnName]) {
-			var fn = page[fnName];
-			fn.call(page, args);
-		}
-	}	
-};
-
-/**
-* Constructs a child calendar. This method can be overridden if a subclassed version of the default
-* calendar is to be used.
-* @method constructChild
-* @param {String}	id			The id of the table element that will represent the calendar widget
-* @param {String}	containerId	The id of the container div element that will wrap the calendar table
-* @param {Object}	config		The configuration object containing the Calendar's arguments
-* @return {YAHOO.widget.Calendar}	The YAHOO.widget.Calendar instance that is constructed
-*/
-YAHOO.widget.CalendarGroup.prototype.constructChild = function(id,containerId,config) {
-	var container = document.getElementById(containerId);
-	if (! container) {
-		container = document.createElement("div");
-		container.id = containerId;
-		this.oDomContainer.appendChild(container);
-	}
-	return new YAHOO.widget.Calendar(id,containerId,config);
-};
-
-
-/**
-* Sets the calendar group's month explicitly. This month will be set into the first
-* page of the multi-page calendar, and all other months will be iterated appropriately.
-* @method setMonth
-* @param {Number}	month		The numeric month, from 0 (January) to 11 (December)
-*/
-YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {
-	month = parseInt(month, 10);
-	var currYear;
-	
-	var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
-	
-	for (var p=0; p<this.pages.length; ++p) {
-		var cal = this.pages[p];
-		var pageDate = cal.cfg.getProperty(cfgPageDate);
-		if (p === 0) {
-			currYear = pageDate.getFullYear();
+	_setMonthOnDate : function(date, iMonth) {
+		// Bug in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
+		if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420 && (iMonth < 0 || iMonth > 11)) {
+			var DM = YAHOO.widget.DateMath;
+			var newDate = DM.add(date, DM.MONTH, iMonth-date.getMonth());
+			date.setTime(newDate.getTime());
 		} else {
-			pageDate.setYear(currYear);
-		}
-		this._setMonthOnDate(pageDate, month+p); 
-		cal.cfg.setProperty(cfgPageDate, pageDate);
-	}
-};
-
-/**
-* Sets the calendar group's year explicitly. This year will be set into the first
-* page of the multi-page calendar, and all other months will be iterated appropriately.
-* @method setYear
-* @param {Number}	year		The numeric 4-digit year
-*/
-YAHOO.widget.CalendarGroup.prototype.setYear = function(year) {
-
-	var cfgPageDate = YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGEDATE.key;
-
-	year = parseInt(year, 10);
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		var pageDate = cal.cfg.getProperty(cfgPageDate);
-
-		if ((pageDate.getMonth()+1) == 1 && p>0) {
-			year+=1;
+			date.setMonth(iMonth);
 		}
-		cal.setYear(year);
-	}
-};
-/**
-* Calls the render function of all child calendars within the group.
-* @method render
-*/
-YAHOO.widget.CalendarGroup.prototype.render = function() {
-	this.renderHeader();
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.render();
-	}
-	this.renderFooter();
-};
-
-/**
-* Selects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once selection has completed, render must be 
-* called for the changes to be reflected visually.
-* @method select
-* @param	{String/Date/Date[]}	date	The date string of dates to select in the current calendar. Valid formats are
-*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*								This method can also take a JavaScript Date object or an array of Date objects.
-* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.select = function(date) {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.select(date);
-	}
-	return this.getSelectedDates();
-};
-
-/**
-* Selects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
-* The value of the MULTI_SELECT Configuration attribute will determine the set of dates which get selected. 
-* <ul>
-*    <li>If MULTI_SELECT is false, selectCell will select the cell at the specified index for only the last displayed Calendar page.</li>
-*    <li>If MULTI_SELECT is true, selectCell will select the cell at the specified index, on each displayed Calendar page.</li>
-* </ul>
-* @method selectCell
-* @param	{Number}	cellIndex	The index of the cell to be selected. 
-* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.selectCell = function(cellIndex) {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.selectCell(cellIndex);
-	}
-	return this.getSelectedDates();
-};
-
-/**
-* Deselects a date or a collection of dates on the current calendar. This method, by default,
-* does not call the render method explicitly. Once deselection has completed, render must be 
-* called for the changes to be reflected visually.
-* @method deselect
-* @param	{String/Date/Date[]}	date	The date string of dates to deselect in the current calendar. Valid formats are
-*								individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
-*								Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
-*								This method can also take a JavaScript Date object or an array of Date objects.	
-* @return	{Date[]}			Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.deselect = function(date) {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.deselect(date);
-	}
-	return this.getSelectedDates();
-};
-
-/**
-* Deselects all dates on the current calendar.
-* @method deselectAll
-* @return {Date[]}		Array of JavaScript Date objects representing all individual dates that are currently selected.
-*						Assuming that this function executes properly, the return value should be an empty array.
-*						However, the empty array is returned for the sake of being able to check the selection status
-*						of the calendar.
-*/
-YAHOO.widget.CalendarGroup.prototype.deselectAll = function() {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.deselectAll();
-	}
-	return this.getSelectedDates();
-};
-
-/**
-* Deselects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
-* deselectCell will deselect the cell at the specified index on each displayed Calendar page.
-*
-* @method deselectCell
-* @param	{Number}	cellIndex	The index of the cell to deselect. 
-* @return	{Date[]}	Array of JavaScript Date objects representing all individual dates that are currently selected.
-*/
-YAHOO.widget.CalendarGroup.prototype.deselectCell = function(cellIndex) {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.deselectCell(cellIndex);
-	}
-	return this.getSelectedDates();
-};
-
-/**
-* Resets the calendar widget to the originally selected month and year, and 
-* sets the calendar to the initial selection(s).
-* @method reset
-*/
-YAHOO.widget.CalendarGroup.prototype.reset = function() {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.reset();
-	}
-};
-
-/**
-* Clears the selected dates in the current calendar widget and sets the calendar
-* to the current month and year.
-* @method clear
-*/
-YAHOO.widget.CalendarGroup.prototype.clear = function() {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.clear();
-	}
-};
-
-/**
-* Navigates to the next month page in the calendar widget.
-* @method nextMonth
-*/
-YAHOO.widget.CalendarGroup.prototype.nextMonth = function() {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.nextMonth();
-	}
-};
-
-/**
-* Navigates to the previous month page in the calendar widget.
-* @method previousMonth
-*/
-YAHOO.widget.CalendarGroup.prototype.previousMonth = function() {
-	for (var p=this.pages.length-1;p>=0;--p) {
-		var cal = this.pages[p];
-		cal.previousMonth();
-	}
-};
-
-/**
-* Navigates to the next year in the currently selected month in the calendar widget.
-* @method nextYear
-*/
-YAHOO.widget.CalendarGroup.prototype.nextYear = function() {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.nextYear();
-	}
-};
-
-/**
-* Navigates to the previous year in the currently selected month in the calendar widget.
-* @method previousYear
-*/
-YAHOO.widget.CalendarGroup.prototype.previousYear = function() {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.previousYear();
-	}
-};
-
-
-/**
-* Gets the list of currently selected dates from the calendar.
-* @return			An array of currently selected JavaScript Date objects.
-* @type Date[]
-*/
-YAHOO.widget.CalendarGroup.prototype.getSelectedDates = function() { 
-	var returnDates = [];
-	var selected = this.cfg.getProperty(YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.SELECTED.key);
-	for (var d=0;d<selected.length;++d) {
-		var dateArray = selected[d];
-
-		var date = new Date(dateArray[0],dateArray[1]-1,dateArray[2]);
-		returnDates.push(date);
-	}
-
-	returnDates.sort( function(a,b) { return a-b; } );
-	return returnDates;
-};
-
-/**
-* Adds a renderer to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the conditions specified in the date string for this renderer.
-* @method addRenderer
-* @param	{String}	sDates		A date string to associate with the specified renderer. Valid formats
-*									include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
-* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.CalendarGroup.prototype.addRenderer = function(sDates, fnRender) {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.addRenderer(sDates, fnRender);
-	}
-};
-
-/**
-* Adds a month to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the month passed to this method.
-* @method addMonthRenderer
-* @param	{Number}	month		The month (1-12) to associate with this renderer
-* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.CalendarGroup.prototype.addMonthRenderer = function(month, fnRender) {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.addMonthRenderer(month, fnRender);
-	}
-};
-
-/**
-* Adds a weekday to the render stack. The function reference passed to this method will be executed
-* when a date cell matches the weekday passed to this method.
-* @method addWeekdayRenderer
-* @param	{Number}	weekday		The weekday (0-6) to associate with this renderer
-* @param	{Function}	fnRender	The function executed to render cells that match the render rules for this renderer.
-*/
-YAHOO.widget.CalendarGroup.prototype.addWeekdayRenderer = function(weekday, fnRender) {
-	for (var p=0;p<this.pages.length;++p) {
-		var cal = this.pages[p];
-		cal.addWeekdayRenderer(weekday, fnRender);
-	}
-};
-
-/**
-* Renders the header for the CalendarGroup.
-* @method renderHeader
-*/
-YAHOO.widget.CalendarGroup.prototype.renderHeader = function() {};
-
-/**
-* Renders a footer for the 2-up calendar container. By default, this method is
-* unimplemented.
-* @method renderFooter
-*/
-YAHOO.widget.CalendarGroup.prototype.renderFooter = function() {};
-
-/**
-* Adds the designated number of months to the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method addMonths
-* @param {Number}	count	The number of months to add to the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.addMonths = function(count) {
-	this.callChildFunction("addMonths", count);
-};
-
-
-/**
-* Subtracts the designated number of months from the current calendar month, and sets the current
-* calendar page date to the new month.
-* @method subtractMonths
-* @param {Number}	count	The number of months to subtract from the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.subtractMonths = function(count) {
-	this.callChildFunction("subtractMonths", count);
-};
-
-/**
-* Adds the designated number of years to the current calendar, and sets the current
-* calendar page date to the new month.
-* @method addYears
-* @param {Number}	count	The number of years to add to the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.addYears = function(count) {
-	this.callChildFunction("addYears", count);
-};
-
-/**
-* Subtcats the designated number of years from the current calendar, and sets the current
-* calendar page date to the new month.
-* @method subtractYears
-* @param {Number}	count	The number of years to subtract from the current calendar
-*/
-YAHOO.widget.CalendarGroup.prototype.subtractYears = function(count) {
-	this.callChildFunction("subtractYears", count);
-};
-
-/**
-* Sets the month on a Date object, taking into account year rollover if the month is less than 0 or greater than 11.
-* The Date object passed in is modified. It should be cloned before passing it into this method if the original value needs to be maintained
-* @method	_setMonthOnDate
-* @private
-* @param	{Date}	date	The Date object on which to set the month index
-* @param	{Number}	iMonth	The month index to set
-*/
-YAHOO.widget.CalendarGroup.prototype._setMonthOnDate = function(date, iMonth) {
-	// BUG in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
-	if (this.browser == "safari" && (iMonth < 0 || iMonth > 11)) {
-		var DM = YAHOO.widget.DateMath;
-		var newDate = DM.add(date, DM.MONTH, iMonth-date.getMonth());
-		date.setTime(newDate.getTime());
-	} else {
-		date.setMonth(iMonth);
+	},
+	
+	/**
+	 * Fixes the width of the CalendarGroup container element, to account for miswrapped floats
+	 * @method _fixWidth
+	 * @private
+	 */
+	_fixWidth : function() {
+		var w = 0;
+		for (var p=0;p<this.pages.length;++p) {
+			var cal = this.pages[p];
+			w += cal.oDomContainer.offsetWidth;
+		}
+		if (w > 0) {
+			this.oDomContainer.style.width = w + "px";
+		}
+	},
+	
+	/**
+	* Returns a string representation of the object.
+	* @method toString
+	* @return {String}	A string representation of the CalendarGroup object.
+	*/
+	toString : function() {
+		return "CalendarGroup " + this.id;
 	}
 };
 
-
 /**
 * CSS class representing the container for the calendar
 * @property YAHOO.widget.CalendarGroup.CSS_CONTAINER
@@ -4496,7 +5497,7 @@
 */
 YAHOO.widget.CalendarGroup.CSS_2UPCLOSE = "close-icon";
 
-YAHOO.augment(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
+YAHOO.lang.augmentProto(YAHOO.widget.CalendarGroup, YAHOO.widget.Calendar, "buildDayLabel",
 																 "buildMonthLabel",
 																 "renderOutOfBoundsDate",
 																 "renderRowHeader",
@@ -4510,13 +5511,21 @@
 																 "renderCellStyleToday",
 																 "renderCellStyleSelected",
 																 "renderCellNotThisMonth",
+																 "renderCellStyleNotThisMonth",
 																 "renderBodyCellRestricted",
 																 "initStyles",
 																 "configTitle",
 																 "configClose",
 																 "configIframe",
+																 "configNavigator",
+																 "createTitleBar",
+																 "createCloseButton",
+																 "removeTitleBar",
+																 "removeCloseButton",
 																 "hide",
 																 "show",
+																 "toDate",
+																 "_parseArgs",
 																 "browser");
 
 /**
@@ -4530,15 +5539,6 @@
 YAHOO.widget.CalendarGroup._DEFAULT_CONFIG = YAHOO.widget.Calendar._DEFAULT_CONFIG;
 YAHOO.widget.CalendarGroup._DEFAULT_CONFIG.PAGES = {key:"pages", value:2};
 
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}	A string representation of the CalendarGroup object.
-*/
-YAHOO.widget.CalendarGroup.prototype.toString = function() {
-	return "CalendarGroup " + this.id;
-};
-
 YAHOO.widget.CalGrp = YAHOO.widget.CalendarGroup;
 
 /**
@@ -4557,4 +5557,1241 @@
 */
 YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
 
-YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.2.1", build: "193"});
+/**
+ * The CalendarNavigator is used along with a Calendar/CalendarGroup to 
+ * provide a Month/Year popup navigation control, allowing the user to navigate 
+ * to a specific month/year in the Calendar/CalendarGroup without having to 
+ * scroll through months sequentially
+ *
+ * @namespace YAHOO.widget
+ * @class CalendarNavigator
+ * @constructor
+ * @param {Calendar|CalendarGroup} cal The instance of the Calendar or CalendarGroup to which this CalendarNavigator should be attached.
+ */
+YAHOO.widget.CalendarNavigator = function(cal) {
+	this.init(cal);
+};
+
+(function() {
+	// Setup static properties (inside anon fn, so that we can use shortcuts)
+	var CN = YAHOO.widget.CalendarNavigator;
+
+	/**
+	 * YAHOO.widget.CalendarNavigator.CLASSES contains constants
+	 * for the class values applied to the CalendarNaviatgator's 
+	 * DOM elements
+	 * @property YAHOO.widget.CalendarNavigator.CLASSES
+	 * @type Object
+	 * @static
+	 */
+	CN.CLASSES = {
+		/**
+		 * Class applied to the Calendar Navigator's bounding box
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.NAV
+		 * @type String
+		 * @static
+		 */
+		NAV :"yui-cal-nav",
+		/**
+		 * Class applied to the Calendar/CalendarGroup's bounding box to indicate
+		 * the Navigator is currently visible
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.NAV_VISIBLE
+		 * @type String
+		 * @static
+		 */
+		NAV_VISIBLE: "yui-cal-nav-visible",
+		/**
+		 * Class applied to the Navigator mask's bounding box
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.MASK
+		 * @type String
+		 * @static
+		 */
+		MASK : "yui-cal-nav-mask",
+		/**
+		 * Class applied to the year label/control bounding box
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.YEAR
+		 * @type String
+		 * @static
+		 */
+		YEAR : "yui-cal-nav-y",
+		/**
+		 * Class applied to the month label/control bounding box
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.MONTH
+		 * @type String
+		 * @static
+		 */
+		MONTH : "yui-cal-nav-m",
+		/**
+		 * Class applied to the submit/cancel button's bounding box
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.BUTTONS
+		 * @type String
+		 * @static
+		 */
+		BUTTONS : "yui-cal-nav-b",
+		/**
+		 * Class applied to buttons wrapping element
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.BUTTON
+		 * @type String
+		 * @static
+		 */
+		BUTTON : "yui-cal-nav-btn",
+		/**
+		 * Class applied to the validation error area's bounding box
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.ERROR
+		 * @type String
+		 * @static
+		 */
+		ERROR : "yui-cal-nav-e",
+		/**
+		 * Class applied to the year input control
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.YEAR_CTRL
+		 * @type String
+		 * @static
+		 */
+		YEAR_CTRL : "yui-cal-nav-yc",
+		/**
+		 * Class applied to the month input control
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.MONTH_CTRL
+		 * @type String
+		 * @static
+		 */
+		MONTH_CTRL : "yui-cal-nav-mc",
+		/**
+		 * Class applied to controls with invalid data (e.g. a year input field with invalid an year)
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.INVALID
+		 * @type String
+		 * @static
+		 */
+		INVALID : "yui-invalid",
+		/**
+		 * Class applied to default controls
+		 * @property YAHOO.widget.CalendarNavigator.CLASSES.DEFAULT
+		 * @type String
+		 * @static
+		 */
+		DEFAULT : "yui-default"
+	};
+
+	/**
+	 * Object literal containing the default configuration values for the CalendarNavigator
+	 * The configuration object is expected to follow the format below, with the properties being
+	 * case sensitive.
+	 * <dl>
+	 * <dt>strings</dt>
+	 * <dd><em>Object</em> :  An object with the properties shown below, defining the string labels to use in the Navigator's UI
+	 *     <dl>
+	 *         <dt>month</dt><dd><em>String</em> : The string to use for the month label. Defaults to "Month".</dd>
+	 *         <dt>year</dt><dd><em>String</em> : The string to use for the year label. Defaults to "Year".</dd>
+	 *         <dt>submit</dt><dd><em>String</em> : The string to use for the submit button label. Defaults to "Okay".</dd>
+	 *         <dt>cancel</dt><dd><em>String</em> : The string to use for the cancel button label. Defaults to "Cancel".</dd>
+	 *         <dt>invalidYear</dt><dd><em>String</em> : The string to use for invalid year values. Defaults to "Year needs to be a number".</dd>
+	 *     </dl>
+	 * </dd>
+	 * <dt>monthFormat</dt><dd><em>String</em> : The month format to use. Either YAHOO.widget.Calendar.LONG, or YAHOO.widget.Calendar.SHORT. Defaults to YAHOO.widget.Calendar.LONG</dd>
+	 * <dt>initialFocus</dt><dd><em>String</em> : Either "year" or "month" specifying which input control should get initial focus. Defaults to "year"</dd>
+	 * </dl>
+	 * @property _DEFAULT_CFG
+	 * @protected
+	 * @type Object
+	 * @static
+	 */
+	CN._DEFAULT_CFG = {
+		strings : {
+			month: "Month",
+			year: "Year",
+			submit: "Okay",
+			cancel: "Cancel",
+			invalidYear : "Year needs to be a number"
+		},
+		monthFormat: YAHOO.widget.Calendar.LONG,
+		initialFocus: "year"
+	};
+
+	/**
+	 * The suffix added to the Calendar/CalendarGroup's ID, to generate
+	 * a unique ID for the Navigator and it's bounding box.
+	 * @property YAHOO.widget.CalendarNavigator.ID_SUFFIX
+	 * @static
+	 * @type String
+	 * @final
+	 */
+	CN.ID_SUFFIX = "_nav";
+	/**
+	 * The suffix added to the Navigator's ID, to generate
+	 * a unique ID for the month control.
+	 * @property YAHOO.widget.CalendarNavigator.MONTH_SUFFIX
+	 * @static
+	 * @type String 
+	 * @final
+	 */
+	CN.MONTH_SUFFIX = "_month";
+	/**
+	 * The suffix added to the Navigator's ID, to generate
+	 * a unique ID for the year control.
+	 * @property YAHOO.widget.CalendarNavigator.YEAR_SUFFIX
+	 * @static
+	 * @type String
+	 * @final
+	 */
+	CN.YEAR_SUFFIX = "_year";
+	/**
+	 * The suffix added to the Navigator's ID, to generate
+	 * a unique ID for the error bounding box.
+	 * @property YAHOO.widget.CalendarNavigator.ERROR_SUFFIX
+	 * @static
+	 * @type String
+	 * @final
+	 */
+	CN.ERROR_SUFFIX = "_error";
+	/**
+	 * The suffix added to the Navigator's ID, to generate
+	 * a unique ID for the "Cancel" button.
+	 * @property YAHOO.widget.CalendarNavigator.CANCEL_SUFFIX
+	 * @static
+	 * @type String
+	 * @final
+	 */
+	CN.CANCEL_SUFFIX = "_cancel";
+	/**
+	 * The suffix added to the Navigator's ID, to generate
+	 * a unique ID for the "Submit" button.
+	 * @property YAHOO.widget.CalendarNavigator.SUBMIT_SUFFIX
+	 * @static
+	 * @type String
+	 * @final
+	 */
+	CN.SUBMIT_SUFFIX = "_submit";
+
+	/**
+	 * The number of digits to which the year input control is to be limited.
+	 * @property YAHOO.widget.CalendarNavigator.YR_MAX_DIGITS
+	 * @static
+	 * @type Number
+	 */
+	CN.YR_MAX_DIGITS = 4;
+
+	/**
+	 * The amount by which to increment the current year value,
+	 * when the arrow up/down key is pressed on the year control
+	 * @property YAHOO.widget.CalendarNavigator.YR_MINOR_INC
+	 * @static
+	 * @type Number
+	 */
+	CN.YR_MINOR_INC = 1;
+
+	/**
+	 * The amount by which to increment the current year value,
+	 * when the page up/down key is pressed on the year control
+	 * @property YAHOO.widget.CalendarNavigator.YR_MAJOR_INC
+	 * @static
+	 * @type Number
+	 */
+	CN.YR_MAJOR_INC = 10;
+
+	/**
+	 * Artificial delay (in ms) between the time the Navigator is hidden
+	 * and the Calendar/CalendarGroup state is updated. Allows the user
+	 * the see the Calendar/CalendarGroup page changing. If set to 0
+	 * the Calendar/CalendarGroup page will be updated instantly
+	 * @property YAHOO.widget.CalendarNavigator.UPDATE_DELAY
+	 * @static
+	 * @type Number
+	 */
+	CN.UPDATE_DELAY = 50;
+
+	/**
+	 * Regular expression used to validate the year input
+	 * @property YAHOO.widget.CalendarNavigator.YR_PATTERN
+	 * @static
+	 * @type RegExp
+	 */
+	CN.YR_PATTERN = /^\d+$/;
+	/**
+	 * Regular expression used to trim strings
+	 * @property YAHOO.widget.CalendarNavigator.TRIM
+	 * @static
+	 * @type RegExp
+	 */
+	CN.TRIM = /^\s*(.*?)\s*$/;
+})();
+
+YAHOO.widget.CalendarNavigator.prototype = {
+
+	/**
+	 * The unique ID for this CalendarNavigator instance
+	 * @property id
+	 * @type String
+	 */
+	id : null,
+
+	/**
+	 * The Calendar/CalendarGroup instance to which the navigator belongs
+	 * @property cal
+	 * @type {Calendar|CalendarGroup}
+	 */
+	cal : null,
+
+	/**
+	 * Reference to the HTMLElement used to render the navigator's bounding box
+	 * @property navEl
+	 * @type HTMLElement
+	 */
+	navEl : null,
+
+	/**
+	 * Reference to the HTMLElement used to render the navigator's mask
+	 * @property maskEl
+	 * @type HTMLElement
+	 */
+	maskEl : null,
+
+	/**
+	 * Reference to the HTMLElement used to input the year
+	 * @property yearEl
+	 * @type HTMLElement
+	 */
+	yearEl : null,
+
+	/**
+	 * Reference to the HTMLElement used to input the month
+	 * @property monthEl
+	 * @type HTMLElement
+	 */
+	monthEl : null,
+
+	/**
+	 * Reference to the HTMLElement used to display validation errors
+	 * @property errorEl
+	 * @type HTMLElement
+	 */
+	errorEl : null,
+
+	/**
+	 * Reference to the HTMLElement used to update the Calendar/Calendar group
+	 * with the month/year values
+	 * @property submitEl
+	 * @type HTMLElement
+	 */
+	submitEl : null,
+	
+	/**
+	 * Reference to the HTMLElement used to hide the navigator without updating the 
+	 * Calendar/Calendar group
+	 * @property cancelEl
+	 * @type HTMLElement
+	 */
+	cancelEl : null,
+
+	/** 
+	 * Reference to the first focusable control in the navigator (by default monthEl)
+	 * @property firstCtrl
+	 * @type HTMLElement
+	 */
+	firstCtrl : null,
+	
+	/** 
+	 * Reference to the last focusable control in the navigator (by default cancelEl)
+	 * @property lastCtrl
+	 * @type HTMLElement
+	 */
+	lastCtrl : null,
+
+	/**
+	 * The document containing the Calendar/Calendar group instance
+	 * @protected
+	 * @property _doc
+	 * @type HTMLDocument
+	 */
+	_doc : null,
+
+	/**
+	 * Internal state property for the current year displayed in the navigator
+	 * @protected
+	 * @property _year
+	 * @type Number
+	 */
+	_year: null,
+	
+	/**
+	 * Internal state property for the current month index displayed in the navigator
+	 * @protected
+	 * @property _month
+	 * @type Number
+	 */
+	_month: 0,
+
+	/**
+	 * Private internal state property which indicates whether or not the 
+	 * Navigator has been rendered.
+	 * @private
+	 * @property __rendered
+	 * @type Boolean
+	 */
+	__rendered: false,
+
+	/**
+	 * Init lifecycle method called as part of construction
+	 * 
+	 * @method init
+	 * @param {Calendar} cal The instance of the Calendar or CalendarGroup to which this CalendarNavigator should be attached
+	 */
+	init : function(cal) {
+		var calBox = cal.oDomContainer;
+
+		this.cal = cal;
+		this.id = calBox.id + YAHOO.widget.CalendarNavigator.ID_SUFFIX;
+		this._doc = calBox.ownerDocument;
+
+		/**
+		 * Private flag, to identify IE6/IE7 Quirks
+		 * @private
+		 * @property __isIEQuirks
+		 */
+		var ie = YAHOO.env.ua.ie;
+		this.__isIEQuirks = (ie && ((ie <= 6) || (ie === 7 && this._doc.compatMode == "BackCompat")));
+	},
+
+	/**
+	 * Displays the navigator and mask, updating the input controls to reflect the 
+	 * currently set month and year. The show method will invoke the render method
+	 * if the navigator has not been renderered already, allowing for lazy rendering
+	 * of the control.
+	 * 
+	 * The show method will fire the Calendar/CalendarGroup's beforeShowNav and showNav events
+	 * 
+	 * @method show
+	 */
+	show : function() {
+		var CLASSES = YAHOO.widget.CalendarNavigator.CLASSES;
+
+		if (this.cal.beforeShowNavEvent.fire()) {
+			if (!this.__rendered) {
+				this.render();
+			}
+			this.clearErrors();
+
+			this._updateMonthUI();
+			this._updateYearUI();
+			this._show(this.navEl, true);
+
+			this.setInitialFocus();
+			this.showMask();
+
+			YAHOO.util.Dom.addClass(this.cal.oDomContainer, CLASSES.NAV_VISIBLE);
+			this.cal.showNavEvent.fire();
+		}
+	},
+
+	/**
+	 * Hides the navigator and mask
+	 * 
+	 * The show method will fire the Calendar/CalendarGroup's beforeHideNav event and hideNav events
+	 * @method hide
+	 */
+	hide : function() {
+		var CLASSES = YAHOO.widget.CalendarNavigator.CLASSES;
+
+		if (this.cal.beforeHideNavEvent.fire()) {
+			this._show(this.navEl, false);
+			this.hideMask();
+			YAHOO.util.Dom.removeClass(this.cal.oDomContainer, CLASSES.NAV_VISIBLE);
+			this.cal.hideNavEvent.fire();
+		}
+	},
+	
+
+	/**
+	 * Displays the navigator's mask element
+	 * 
+	 * @method showMask
+	 */
+	showMask : function() {
+		this._show(this.maskEl, true);
+		if (this.__isIEQuirks) {
+			this._syncMask();
+		}
+	},
+
+	/**
+	 * Hides the navigator's mask element
+	 * 
+	 * @method hideMask
+	 */
+	hideMask : function() {
+		this._show(this.maskEl, false);
+	},
+
+	/**
+	 * Returns the current month set on the navigator
+	 * 
+	 * Note: This may not be the month set in the UI, if 
+	 * the UI contains an invalid value.
+	 * 
+	 * @method getMonth
+	 * @return {Number} The Navigator's current month index
+	 */
+	getMonth: function() {
+		return this._month;
+	},
+
+	/**
+	 * Returns the current year set on the navigator
+	 * 
+	 * Note: This may not be the year set in the UI, if 
+	 * the UI contains an invalid value.
+	 * 
+	 * @method getYear
+	 * @return {Number} The Navigator's current year value
+	 */
+	getYear: function() {
+		return this._year;
+	},
+
+	/**
+	 * Sets the current month on the Navigator, and updates the UI
+	 * 
+	 * @method setMonth
+	 * @param {Number} nMonth The month index, from 0 (Jan) through 11 (Dec).
+	 */
+	setMonth : function(nMonth) {
+		if (nMonth >= 0 && nMonth < 12) {
+			this._month = nMonth;
+		}
+		this._updateMonthUI();
+	},
+
+	/**
+	 * Sets the current year on the Navigator, and updates the UI. If the 
+	 * provided year is invalid, it will not be set.
+	 * 
+	 * @method setYear
+	 * @param {Number} nYear The full year value to set the Navigator to.
+	 */
+	setYear : function(nYear) {
+		var yrPattern = YAHOO.widget.CalendarNavigator.YR_PATTERN;
+		if (YAHOO.lang.isNumber(nYear) && yrPattern.test(nYear+"")) {
+			this._year = nYear;
+		}
+		this._updateYearUI();
+	},
+
+	/**
+	 * Renders the HTML for the navigator, adding it to the 
+	 * document and attaches event listeners if it has not 
+	 * already been rendered.
+	 * 
+	 * @method render
+	 */
+	render: function() {
+		this.cal.beforeRenderNavEvent.fire();
+		if (!this.__rendered) {
+			this.createNav();
+			this.createMask();
+			this.applyListeners();
+			this.__rendered = true;
+		}
+		this.cal.renderNavEvent.fire();
+	},
+
+	/**
+	 * Creates the navigator's containing HTMLElement, it's contents, and appends 
+	 * the containg element to the Calendar/CalendarGroup's container.
+	 * 
+	 * @method createNav
+	 */
+	createNav : function() {
+		var NAV = YAHOO.widget.CalendarNavigator;
+		var doc = this._doc;
+
+		var d = doc.createElement("div");
+		d.className = NAV.CLASSES.NAV;
+
+		var htmlBuf = this.renderNavContents([]);
+
+		d.innerHTML = htmlBuf.join('');
+		this.cal.oDomContainer.appendChild(d);
+
+		this.navEl = d;
+
+		this.yearEl = doc.getElementById(this.id + NAV.YEAR_SUFFIX);
+		this.monthEl = doc.getElementById(this.id + NAV.MONTH_SUFFIX);
+		this.errorEl = doc.getElementById(this.id + NAV.ERROR_SUFFIX);
+		this.submitEl = doc.getElementById(this.id + NAV.SUBMIT_SUFFIX);
+		this.cancelEl = doc.getElementById(this.id + NAV.CANCEL_SUFFIX);
+
+		if (YAHOO.env.ua.gecko && this.yearEl && this.yearEl.type == "text") {
+			// Avoid XUL error on focus, select [ https://bugzilla.mozilla.org/show_bug.cgi?id=236791, 
+			// supposedly fixed in 1.8.1, but there are reports of it still being around for methods other than blur ]
+			this.yearEl.setAttribute("autocomplete", "off");
+		}
+
+		this._setFirstLastElements();
+	},
+
+	/**
+	 * Creates the Mask HTMLElement and appends it to the Calendar/CalendarGroups
+	 * container.
+	 * 
+	 * @method createMask
+	 */
+	createMask : function() {
+		var C = YAHOO.widget.CalendarNavigator.CLASSES;
+
+		var d = this._doc.createElement("div");
+		d.className = C.MASK;
+
+		this.cal.oDomContainer.appendChild(d);
+		this.maskEl = d;
+	},
+
+	/**
+	 * Used to set the width/height of the mask in pixels to match the Calendar Container.
+	 * Currently only used for IE6 and IE7 quirks mode. The other A-Grade browser are handled using CSS (width/height 100%).
+	 * <p>
+	 * The method is also registered as an HTMLElement resize listener on the Calendars container element.
+	 * </p>
+	 * @protected
+	 * @method _syncMask
+	 */
+	_syncMask : function() {
+		var c = this.cal.oDomContainer;
+		if (c && this.maskEl) {
+			var r = YAHOO.util.Dom.getRegion(c);
+			YAHOO.util.Dom.setStyle(this.maskEl, "width", r.right - r.left + "px");
+			YAHOO.util.Dom.setStyle(this.maskEl, "height", r.bottom - r.top + "px");
+		}
+	},
+
+	/**
+	 * Renders the contents of the navigator
+	 * 
+	 * @method renderNavContents
+	 * 
+	 * @param {Array} html The HTML buffer to append the HTML to.
+	 * @return {Array} A reference to the buffer passed in.
+	 */
+	renderNavContents : function(html) {
+		var NAV = YAHOO.widget.CalendarNavigator,
+			C = NAV.CLASSES,
+			h = html; // just to use a shorter name
+
+		h[h.length] = '<div class="' + C.MONTH + '">';
+		this.renderMonth(h);
+		h[h.length] = '</div>';
+		h[h.length] = '<div class="' + C.YEAR + '">';
+		this.renderYear(h);
+		h[h.length] = '</div>';
+		h[h.length] = '<div class="' + C.BUTTONS + '">';
+		this.renderButtons(h);
+		h[h.length] = '</div>';
+		h[h.length] = '<div class="' + C.ERROR + '" id="' + this.id + NAV.ERROR_SUFFIX + '"></div>';
+
+		return h;
+	},
+
+	/**
+	 * Renders the month label and control for the navigator
+	 * 
+	 * @method renderNavContents
+	 * @param {Array} html The HTML buffer to append the HTML to.
+	 * @return {Array} A reference to the buffer passed in.
+	 */
+	renderMonth : function(html) {
+		var NAV = YAHOO.widget.CalendarNavigator,
+			C = NAV.CLASSES;
+
+		var id = this.id + NAV.MONTH_SUFFIX,
+			mf = this.__getCfg("monthFormat"),
+			months = this.cal.cfg.getProperty((mf == YAHOO.widget.Calendar.SHORT) ? "MONTHS_SHORT" : "MONTHS_LONG"),
+			h = html;
+
+		if (months && months.length > 0) {
+			h[h.length] = '<label for="' + id + '">';
+			h[h.length] = this.__getCfg("month", true);
+			h[h.length] = '</label>';
+			h[h.length] = '<select name="' + id + '" id="' + id + '" class="' + C.MONTH_CTRL + '">';
+			for (var i = 0; i < months.length; i++) {
+				h[h.length] = '<option value="' + i + '">';
+				h[h.length] = months[i];
+				h[h.length] = '</option>';
+			}
+			h[h.length] = '</select>';
+		}
+		return h;
+	},
+
+	/**
+	 * Renders the year label and control for the navigator
+	 * 
+	 * @method renderYear
+	 * @param {Array} html The HTML buffer to append the HTML to.
+	 * @return {Array} A reference to the buffer passed in.
+	 */
+	renderYear : function(html) {
+		var NAV = YAHOO.widget.CalendarNavigator,
+			C = NAV.CLASSES;
+
+		var id = this.id + NAV.YEAR_SUFFIX,
+			size = NAV.YR_MAX_DIGITS,
+			h = html;
+
+		h[h.length] = '<label for="' + id + '">';
+		h[h.length] = this.__getCfg("year", true);
+		h[h.length] = '</label>';
+		h[h.length] = '<input type="text" name="' + id + '" id="' + id + '" class="' + C.YEAR_CTRL + '" maxlength="' + size + '"/>';
+		return h;
+	},
+
+	/**
+	 * Renders the submit/cancel buttons for the navigator
+	 * 
+	 * @method renderButton
+	 * @return {String} The HTML created for the Button UI
+	 */
+	renderButtons : function(html) {
+		var C = YAHOO.widget.CalendarNavigator.CLASSES;
+		var h = html;
+
+		h[h.length] = '<span class="' + C.BUTTON + ' ' + C.DEFAULT + '">';
+		h[h.length] = '<button type="button" id="' + this.id + '_submit' + '">';
+		h[h.length] = this.__getCfg("submit", true);
+		h[h.length] = '</button>';
+		h[h.length] = '</span>';
+		h[h.length] = '<span class="' + C.BUTTON +'">';
+		h[h.length] = '<button type="button" id="' + this.id + '_cancel' + '">';
+		h[h.length] = this.__getCfg("cancel", true);
+		h[h.length] = '</button>';
+		h[h.length] = '</span>';
+
+		return h;
+	},
+
+	/**
+	 * Attaches DOM event listeners to the rendered elements
+	 * <p>
+	 * The method will call applyKeyListeners, to setup keyboard specific 
+	 * listeners
+	 * </p>
+	 * @method applyListeners
+	 */
+	applyListeners : function() {
+		var E = YAHOO.util.Event;
+
+		function yearUpdateHandler() {
+			if (this.validate()) {
+				this.setYear(this._getYearFromUI());
+			}
+		}
+
+		function monthUpdateHandler() {
+			this.setMonth(this._getMonthFromUI());
+		}
+
+		E.on(this.submitEl, "click", this.submit, this, true);
+		E.on(this.cancelEl, "click", this.cancel, this, true);
+		E.on(this.yearEl, "blur", yearUpdateHandler, this, true);
+		E.on(this.monthEl, "change", monthUpdateHandler, this, true);
+
+		if (this.__isIEQuirks) {
+			YAHOO.util.Event.on(this.cal.oDomContainer, "resize", this._syncMask, this, true);
+		}
+
+		this.applyKeyListeners();
+	},
+
+	/**
+	 * Removes/purges DOM event listeners from the rendered elements
+	 * 
+	 * @method purgeListeners
+	 */
+	purgeListeners : function() {
+		var E = YAHOO.util.Event;
+		E.removeListener(this.submitEl, "click", this.submit);
+		E.removeListener(this.cancelEl, "click", this.cancel);
+		E.removeListener(this.yearEl, "blur");
+		E.removeListener(this.monthEl, "change");
+		if (this.__isIEQuirks) {
+			E.removeListener(this.cal.oDomContainer, "resize", this._syncMask);
+		}
+
+		this.purgeKeyListeners();
+	},
+
+	/**
+	 * Attaches DOM listeners for keyboard support. 
+	 * Tab/Shift-Tab looping, Enter Key Submit on Year element,
+	 * Up/Down/PgUp/PgDown year increment on Year element
+	 * <p>
+	 * NOTE: MacOSX Safari 2.x doesn't let you tab to buttons and 
+	 * MacOSX Gecko does not let you tab to buttons or select controls,
+	 * so for these browsers, Tab/Shift-Tab looping is limited to the 
+	 * elements which can be reached using the tab key.
+	 * </p>
+	 * @method applyKeyListeners
+	 */
+	applyKeyListeners : function() {
+		var E = YAHOO.util.Event;
+
+		// IE doesn't fire keypress for arrow/pg keys (non-char keys)
+		var ua = YAHOO.env.ua;
+		var arrowEvt = (ua.ie) ? "keydown" : "keypress";
+
+		// - IE doesn't fire keypress for non-char keys
+		// - Opera doesn't allow us to cancel keydown or keypress for tab, but 
+		//   changes focus successfully on keydown (keypress is too late to change focus - opera's already moved on).
+		var tabEvt = (ua.ie || ua.opera) ? "keydown" : "keypress";
+
+		// Everyone likes keypress for Enter (char keys) - whoo hoo!
+		E.on(this.yearEl, "keypress", this._handleEnterKey, this, true);
+
+		E.on(this.yearEl, arrowEvt, this._handleDirectionKeys, this, true);
+		E.on(this.lastCtrl, tabEvt, this._handleTabKey, this, true);
+		E.on(this.firstCtrl, tabEvt, this._handleShiftTabKey, this, true);
+	},
+
+	/**
+	 * Removes/purges DOM listeners for keyboard support
+	 *
+	 * @method purgeKeyListeners
+	 */
+	purgeKeyListeners : function() {
+		var E = YAHOO.util.Event;
+
+		var arrowEvt = (YAHOO.env.ua.ie) ? "keydown" : "keypress";
+		var tabEvt = (YAHOO.env.ua.ie || YAHOO.env.ua.opera) ? "keydown" : "keypress";
+
+		E.removeListener(this.yearEl, "keypress", this._handleEnterKey);
+		E.removeListener(this.yearEl, arrowEvt, this._handleDirectionKeys);
+		E.removeListener(this.lastCtrl, tabEvt, this._handleTabKey);
+		E.removeListener(this.firstCtrl, tabEvt, this._handleShiftTabKey);
+	},
+
+	/**
+	 * Updates the Calendar/CalendarGroup's pagedate with the currently set month and year if valid.
+	 * <p>
+	 * If the currently set month/year is invalid, a validation error will be displayed and the 
+	 * Calendar/CalendarGroup's pagedate will not be updated.
+	 * </p>
+	 * @method submit
+	 */
+	submit : function() {
+		if (this.validate()) {
+			this.hide();
+
+			this.setMonth(this._getMonthFromUI());
+			this.setYear(this._getYearFromUI());
+
+			var cal = this.cal;
+			var nav = this;
+			
+			function update() {
+				cal.setYear(nav.getYear());
+				cal.setMonth(nav.getMonth());
+				cal.render();
+			}
+			// Artificial delay, just to help the user see something changed
+			var delay = YAHOO.widget.CalendarNavigator.UPDATE_DELAY;
+			if (delay > 0) {
+				window.setTimeout(update, delay);
+			} else {
+				update();
+			}
+		}
+	},
+
+	/**
+	 * Hides the navigator and mask, without updating the Calendar/CalendarGroup's state
+	 * 
+	 * @method cancel
+	 */
+	cancel : function() {
+		this.hide();
+	},
+
+	/**
+	 * Validates the current state of the UI controls
+	 * 
+	 * @method validate
+	 * @return {Boolean} true, if the current UI state contains valid values, false if not
+	 */
+	validate : function() {
+		if (this._getYearFromUI() !== null) {
+			this.clearErrors();
+			return true;
+		} else {
+			this.setYearError();
+			this.setError(this.__getCfg("invalidYear", true));
+			return false;
+		}
+	},
+
+	/**
+	 * Displays an error message in the Navigator's error panel
+	 * @method setError
+	 * @param {String} msg The error message to display
+	 */
+	setError : function(msg) {
+		if (this.errorEl) {
+			this.errorEl.innerHTML = msg;
+			this._show(this.errorEl, true);
+		}
+	},
+
+	/**
+	 * Clears the navigator's error message and hides the error panel
+	 * @method clearError 
+	 */
+	clearError : function() {
+		if (this.errorEl) {
+			this.errorEl.innerHTML = "";
+			this._show(this.errorEl, false);
+		}
+	},
+
+	/**
+	 * Displays the validation error UI for the year control
+	 * @method setYearError
+	 */
+	setYearError : function() {
+		YAHOO.util.Dom.addClass(this.yearEl, YAHOO.widget.CalendarNavigator.CLASSES.INVALID);
+	},
+
+	/**
+	 * Removes the validation error UI for the year control
+	 * @method clearYearError
+	 */
+	clearYearError : function() {
+		YAHOO.util.Dom.removeClass(this.yearEl, YAHOO.widget.CalendarNavigator.CLASSES.INVALID);
+	},
+
+	/**
+	 * Clears all validation and error messages in the UI
+	 * @method clearErrors
+	 */
+	clearErrors : function() {
+		this.clearError();
+		this.clearYearError();
+	},
+
+	/**
+	 * Sets the initial focus, based on the configured value
+	 * @method setInitialFocus
+	 */
+	setInitialFocus : function() {
+		var el = this.submitEl;
+		var f = this.__getCfg("initialFocus");
+
+		if (f && f.toLowerCase) {
+			f = f.toLowerCase();
+			if (f == "year") {
+				el = this.yearEl;
+				try {
+					this.yearEl.select();
+				} catch (e) {
+					// Ignore;
+				}
+			} else if (f == "month") {
+				el = this.monthEl;
+			}
+		}
+
+		if (el && YAHOO.lang.isFunction(el.focus)) {
+			try {
+				el.focus();
+			} catch (e) {
+				// TODO: Fall back if focus fails?
+			}
+		}
+	},
+
+	/**
+	 * Removes all renderered HTML elements for the Navigator from
+	 * the DOM, purges event listeners and clears (nulls) any property
+	 * references to HTML references
+	 * @method erase
+	 */
+	erase : function() {
+		if (this.__rendered) {
+			this.purgeListeners();
+
+			// Clear out innerHTML references
+			this.yearEl = null;
+			this.monthEl = null;
+			this.errorEl = null;
+			this.submitEl = null;
+			this.cancelEl = null;
+			this.firstCtrl = null;
+			this.lastCtrl = null;
+			if (this.navEl) {
+				this.navEl.innerHTML = "";
+			}
+
+			var p = this.navEl.parentNode;
+			if (p) {
+				p.removeChild(this.navEl);
+			}
+			this.navEl = null;
+
+			var pm = this.maskEl.parentNode;
+			if (pm) {
+				pm.removeChild(this.maskEl);
+			}
+			this.maskEl = null;
+			this.__rendered = false;
+		}
+	},
+
+	/**
+	 * Destroys the Navigator object and any HTML references
+	 * @method destroy
+	 */
+	destroy : function() {
+		this.erase();
+		this._doc = null;
+		this.cal = null;
+		this.id = null;
+	},
+
+	/**
+	 * Protected implementation to handle how UI elements are 
+	 * hidden/shown.
+	 *
+	 * @method _show
+	 * @protected
+	 */
+	_show : function(el, bShow) {
+		if (el) {
+			YAHOO.util.Dom.setStyle(el, "display", (bShow) ? "block" : "none");
+		}
+	},
+
+	/**
+	 * Returns the month value (index), from the month UI element
+	 * @protected
+	 * @method _getMonthFromUI
+	 * @return {Number} The month index, or 0 if a UI element for the month
+	 * is not found
+	 */
+	_getMonthFromUI : function() {
+		if (this.monthEl) {
+			return this.monthEl.selectedIndex;
+		} else {
+			return 0; // Default to Jan
+		}
+	},
+
+	/**
+	 * Returns the year value, from the Navitator's year UI element
+	 * @protected
+	 * @method _getYearFromUI
+	 * @return {Number} The year value set in the UI, if valid. null is returned if 
+	 * the UI does not contain a valid year value.
+	 */
+	_getYearFromUI : function() {
+		var NAV = YAHOO.widget.CalendarNavigator;
+
+		var yr = null;
+		if (this.yearEl) {
+			var value = this.yearEl.value;
+			value = value.replace(NAV.TRIM, "$1");
+
+			if (NAV.YR_PATTERN.test(value)) {
+				yr = parseInt(value, 10);
+			}
+		}
+		return yr;
+	},
+
+	/**
+	 * Updates the Navigator's year UI, based on the year value set on the Navigator object
+	 * @protected
+	 * @method _updateYearUI
+	 */
+	_updateYearUI : function() {
+		if (this.yearEl && this._year !== null) {
+			this.yearEl.value = this._year;
+		}
+	},
+
+	/**
+	 * Updates the Navigator's month UI, based on the month value set on the Navigator object
+	 * @protected
+	 * @method _updateMonthUI
+	 */
+	_updateMonthUI : function() {
+		if (this.monthEl) {
+			this.monthEl.selectedIndex = this._month;
+		}
+	},
+
+	/**
+	 * Sets up references to the first and last focusable element in the Navigator's UI
+	 * in terms of tab order (Naviagator's firstEl and lastEl properties). The references
+	 * are used to control modality by looping around from the first to the last control
+	 * and visa versa for tab/shift-tab navigation.
+	 * <p>
+	 * See <a href="#applyKeyListeners">applyKeyListeners</a>
+	 * </p>
+	 * @protected
+	 * @method _setFirstLastElements
+	 */
+	_setFirstLastElements : function() {
+		this.firstCtrl = this.monthEl;
+		this.lastCtrl = this.cancelEl;
+
+		// Special handling for MacOSX.
+		// - Safari 2.x can't focus on buttons
+		// - Gecko can't focus on select boxes or buttons
+		if (this.__isMac) {
+			if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420){
+				this.firstCtrl = this.monthEl;
+				this.lastCtrl = this.yearEl;
+			}
+			if (YAHOO.env.ua.gecko) {
+				this.firstCtrl = this.yearEl;
+				this.lastCtrl = this.yearEl;
+			}
+		}
+	},
+
+	/**
+	 * Default Keyboard event handler to capture Enter 
+	 * on the Navigator's year control (yearEl)
+	 * 
+	 * @method _handleEnterKey
+	 * @protected
+	 * @param {Event} e The DOM event being handled
+	 */
+	_handleEnterKey : function(e) {
+		var KEYS = YAHOO.util.KeyListener.KEY;
+
+		if (YAHOO.util.Event.getCharCode(e) == KEYS.ENTER) {
+			this.submit();
+		}
+	},
+
+	/**
+	 * Default Keyboard event handler to capture up/down/pgup/pgdown
+	 * on the Navigator's year control (yearEl).
+	 * 
+	 * @method _handleDirectionKeys
+	 * @protected
+	 * @param {Event} e The DOM event being handled
+	 */
+	_handleDirectionKeys : function(e) {
+		var E = YAHOO.util.Event;
+		var KEYS = YAHOO.util.KeyListener.KEY;
+		var NAV = YAHOO.widget.CalendarNavigator;
+
+		var value = (this.yearEl.value) ? parseInt(this.yearEl.value, 10) : null;
+		if (isFinite(value)) {
+			var dir = false;
+			switch(E.getCharCode(e)) {
+				case KEYS.UP:
+					this.yearEl.value = value + NAV.YR_MINOR_INC;
+					dir = true;
+					break;
+				case KEYS.DOWN:
+					this.yearEl.value = Math.max(value - NAV.YR_MINOR_INC, 0);
+					dir = true;
+					break;
+				case KEYS.PAGE_UP:
+					this.yearEl.value = value + NAV.YR_MAJOR_INC;
+					dir = true;
+					break;
+				case KEYS.PAGE_DOWN:
+					this.yearEl.value = Math.max(value - NAV.YR_MAJOR_INC, 0);
+					dir = true;
+					break;
+				default:
+					break;
+			}
+			if (dir) {
+				E.preventDefault(e);
+				try {
+					this.yearEl.select();
+				} catch(e) {
+					// Ignore
+				}
+			}
+		}
+	},
+
+	/**
+	 * Default Keyboard event handler to capture Tab 
+	 * on the last control (lastCtrl) in the Navigator.
+	 * 
+	 * @method _handleTabKey
+	 * @protected
+	 * @param {Event} e The DOM event being handled
+	 */
+	_handleTabKey : function(e) {
+		var E = YAHOO.util.Event;
+		var KEYS = YAHOO.util.KeyListener.KEY;
+
+		if (E.getCharCode(e) == KEYS.TAB && !e.shiftKey) {
+			try {
+				E.preventDefault(e);
+				this.firstCtrl.focus();
+			} catch (e) {
+				// Ignore - mainly for focus edge cases
+			}
+		}
+	},
+
+	/**
+	 * Default Keyboard event handler to capture Shift-Tab 
+	 * on the first control (firstCtrl) in the Navigator.
+	 * 
+	 * @method _handleShiftTabKey
+	 * @protected
+	 * @param {Event} e The DOM event being handled
+	 */
+	_handleShiftTabKey : function(e) {
+		var E = YAHOO.util.Event;
+		var KEYS = YAHOO.util.KeyListener.KEY;
+
+		if (e.shiftKey && E.getCharCode(e) == KEYS.TAB) {
+			try {
+				E.preventDefault(e);
+				this.lastCtrl.focus();
+			} catch (e) {
+				// Ignore - mainly for focus edge cases
+			}
+		}
+	},
+
+	/**
+	 * Retrieve Navigator configuration values from 
+	 * the parent Calendar/CalendarGroup's config value.
+	 * <p>
+	 * If it has not been set in the user provided configuration, the method will 
+	 * return the default value of the configuration property, as set in _DEFAULT_CFG
+	 * </p>
+	 * @private
+	 * @method __getCfg
+	 * @param {String} Case sensitive property name.
+	 * @param {Boolean} true, if the property is a string property, false if not.
+	 * @return The value of the configuration property
+	 */
+	__getCfg : function(prop, bIsStr) {
+		var DEF_CFG = YAHOO.widget.CalendarNavigator._DEFAULT_CFG;
+		var cfg = this.cal.cfg.getProperty("navigator");
+
+		if (bIsStr) {
+			return (cfg !== true && cfg.strings && cfg.strings[prop]) ? cfg.strings[prop] : DEF_CFG.strings[prop];
+		} else {
+			return (cfg !== true && cfg[prop]) ? cfg[prop] : DEF_CFG[prop];
+		}
+	},
+
+	/**
+	 * Private flag, to identify MacOS
+	 * @private
+	 * @property __isMac
+	 */
+	__isMac : (navigator.userAgent.toLowerCase().indexOf("macintosh") != -1)
+
+};
+
+YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.4.1", build: "742"});

Modified: jifty/branches/jquery/share/web/static/js/yui/container.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/yui/container.js	(original)
+++ jifty/branches/jquery/share/web/static/js/yui/container.js	Mon Jan 21 11:08:06 2008
@@ -2,5397 +2,7808 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
-*/
-/**
-* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.
-* @namespace YAHOO.util
-* @class Config
-* @constructor
-* @param {Object}	owner	The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config = function(owner) {
-	if (owner) {
-		this.init(owner);
-	}
-};
-
-/**
- * Constant representing the CustomEvent type for the config changed event.
- * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
- * @private
- * @static
- * @final
- */
-YAHOO.util.Config.CONFIG_CHANGED_EVENT = "configChanged";
-
-/**
- * Constant representing the boolean type string
- * @property YAHOO.util.Config.BOOLEAN_TYPE
- * @private
- * @static
- * @final
- */
-YAHOO.util.Config.BOOLEAN_TYPE = "boolean";
-
-YAHOO.util.Config.prototype = {
-	
-	/**
-	* Object reference to the owner of this Config Object
-	* @property owner
-	* @type Object
-	*/
-	owner : null,
-
-	/**
-	* Boolean flag that specifies whether a queue is currently being executed
-	* @property queueInProgress
-	* @type Boolean
-	*/
-	queueInProgress : false,
-
-	/**
-	* Maintains the local collection of configuration property objects and their specified values
-	* @property config
-	* @private
-	* @type Object
-	*/ 
-	config : null,
-
-	/**
-	* Maintains the local collection of configuration property objects as they were initially applied.
-	* This object is used when resetting a property.
-	* @property initialConfig
-	* @private
-	* @type Object
-	*/ 
-	initialConfig : null,
-
-	/**
-	* Maintains the local, normalized CustomEvent queue
-	* @property eventQueue
-	* @private
-	* @type Object
-	*/ 
-	eventQueue : null,
-
-	/**
-	* Custom Event, notifying subscribers when Config properties are set (setProperty is called without the silent flag
-	* @event configChangedEvent
-	*/
-	configChangedEvent : null,
-
-	/**
-	* Validates that the value passed in is a Boolean.
-	* @method checkBoolean
-	* @param	{Object}	val	The value to validate
-	* @return	{Boolean}	true, if the value is valid
-	*/	
-	checkBoolean: function(val) {
-		return (typeof val == YAHOO.util.Config.BOOLEAN_TYPE);
-	},
-
-	/**
-	* Validates that the value passed in is a number.
-	* @method checkNumber
-	* @param	{Object}	val	The value to validate
-	* @return	{Boolean}	true, if the value is valid
-	*/
-	checkNumber: function(val) {
-		return (!isNaN(val));
-	},
-
-	/**
-	* Fires a configuration property event using the specified value. 
-	* @method fireEvent
-	* @private
-	* @param {String}	key			The configuration property's name
-	* @param {value}	Object		The value of the correct type for the property
-	*/ 
-	fireEvent : function( key, value ) {
-		var property = this.config[key];
-
-		if (property && property.event) {
-			property.event.fire(value);
-		}	
-	},
-
-	/**
-	* Adds a property to the Config Object's private config hash.
-	* @method addProperty
-	* @param {String}	key	The configuration property's name
-	* @param {Object}	propertyObject	The Object containing all of this property's arguments
-	*/
-	addProperty : function( key, propertyObject ) {
-		key = key.toLowerCase();
-
-		this.config[key] = propertyObject;
-
-		propertyObject.event = new YAHOO.util.CustomEvent(key, this.owner);
-		propertyObject.key = key;
-
-		if (propertyObject.handler) {
-			propertyObject.event.subscribe(propertyObject.handler, this.owner);
-		}
-
-		this.setProperty(key, propertyObject.value, true);
-		
-		if (! propertyObject.suppressEvent) {
-			this.queueProperty(key, propertyObject.value);
-		}
-		
-	},
-
-	/**
-	* Returns a key-value configuration map of the values currently set in the Config Object.
-	* @method getConfig
-	* @return {Object} The current config, represented in a key-value map
-	*/
-	getConfig : function() {
-		var cfg = {};
-			
-		for (var prop in this.config) {
-			var property = this.config[prop];
-			if (property && property.event) {
-				cfg[prop] = property.value;
-			}
-		}
-		
-		return cfg;
-	},
-
-	/**
-	* Returns the value of specified property.
-	* @method getProperty
-	* @param {String} key	The name of the property
-	* @return {Object}		The value of the specified property
-	*/
-	getProperty : function(key) {
-		var property = this.config[key.toLowerCase()];
-		if (property && property.event) {
-			return property.value;
-		} else {
-			return undefined;
-		}
-	},
-
-	/**
-	* Resets the specified property's value to its initial value.
-	* @method resetProperty
-	* @param {String} key	The name of the property
-	* @return {Boolean} True is the property was reset, false if not
-	*/
-	resetProperty : function(key) {
-		key = key.toLowerCase();
-
-		var property = this.config[key];
-		if (property && property.event) {
-			if (this.initialConfig[key] && !YAHOO.lang.isUndefined(this.initialConfig[key]))	{
-				this.setProperty(key, this.initialConfig[key]);
-			}
-			return true;
-		} else {
-			return false;
-		}
-	},
-
-	/**
-	* Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
-	* @method setProperty
-	* @param {String} key		The name of the property
-	* @param {String} value		The value to set the property to
-	* @param {Boolean} silent	Whether the value should be set silently, without firing the property event.
-	* @return {Boolean}			True, if the set was successful, false if it failed.
-	*/
-	setProperty : function(key, value, silent) {
-		key = key.toLowerCase();
-
-		if (this.queueInProgress && ! silent) {
-			this.queueProperty(key,value); // Currently running through a queue... 
-			return true;
-		} else {
-			var property = this.config[key];
-			if (property && property.event) {
-				if (property.validator && ! property.validator(value)) { // validator
-					return false;
-				} else {
-					property.value = value;
-					if (! silent) {
-						this.fireEvent(key, value);
-						this.configChangedEvent.fire([key, value]);
-					}
-					return true;
-				}
-			} else {
-				return false;
-			}
-		}
-	},
-
-	/**
-	* Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
-	* moved from its current position to the end of the queue.
-	* @method queueProperty
-	* @param {String} key	The name of the property
-	* @param {String} value	The value to set the property to
-	* @return {Boolean}		true, if the set was successful, false if it failed.
-	*/	
-	queueProperty : function(key, value) {
-		key = key.toLowerCase();
-
-		var property = this.config[key];
-							
-		if (property && property.event) {
-			if (!YAHOO.lang.isUndefined(value) && property.validator && ! property.validator(value)) { // validator
-				return false;
-			} else {
-
-				if (!YAHOO.lang.isUndefined(value)) {
-					property.value = value;
-				} else {
-					value = property.value;
-				}
-
-				var foundDuplicate = false;
-				var iLen = this.eventQueue.length;
-				for (var i=0; i < iLen; i++) {
-					var queueItem = this.eventQueue[i];
-
-					if (queueItem) {
-						var queueItemKey = queueItem[0];
-						var queueItemValue = queueItem[1];
-						
-						if (queueItemKey == key) {
-							// found a dupe... push to end of queue, null current item, and break
-							this.eventQueue[i] = null;
-							this.eventQueue.push([key, (!YAHOO.lang.isUndefined(value) ? value : queueItemValue)]);
-							foundDuplicate = true;
-							break;
-						}
-					}
-				}
-				
-				if (! foundDuplicate && !YAHOO.lang.isUndefined(value)) { // this is a refire, or a new property in the queue
-					this.eventQueue.push([key, value]);
-				}
-			}
-
-			if (property.supercedes) {
-				var sLen = property.supercedes.length;
-				for (var s=0; s < sLen; s++) {
-					var supercedesCheck = property.supercedes[s];
-					var qLen = this.eventQueue.length;
-					for (var q=0; q < qLen; q++) {
-						var queueItemCheck = this.eventQueue[q];
-
-						if (queueItemCheck) {
-							var queueItemCheckKey = queueItemCheck[0];
-							var queueItemCheckValue = queueItemCheck[1];
-							
-							if ( queueItemCheckKey == supercedesCheck.toLowerCase() ) {
-								this.eventQueue.push([queueItemCheckKey, queueItemCheckValue]);
-								this.eventQueue[q] = null;
-								break;
-							}
-						}
-					}
-				}
-			}
-
-			return true;
-		} else {
-			return false;
-		}
-	},
-
-	/**
-	* Fires the event for a property using the property's current value.
-	* @method refireEvent
-	* @param {String} key	The name of the property
-	*/
-	refireEvent : function(key) {
-		key = key.toLowerCase();
-
-		var property = this.config[key];
-		if (property && property.event && !YAHOO.lang.isUndefined(property.value)) {
-			if (this.queueInProgress) {
-				this.queueProperty(key);
-			} else {
-				this.fireEvent(key, property.value);
-			}
-		}
-	},
-
-	/**
-	* Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.
-	* Although the values will be set, fireQueue() must be called for their associated events to execute.
-	* @method applyConfig
-	* @param {Object}	userConfig	The configuration Object literal
-	* @param {Boolean}	init		When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.
-	*/
-	applyConfig : function(userConfig, init) {
-		if (init) {
-			this.initialConfig = userConfig;
-		}
-		for (var prop in userConfig) {
-			this.queueProperty(prop, userConfig[prop]);
-		}
-	},
-
-	/**
-	* Refires the events for all configuration properties using their current values.
-	* @method refresh
-	*/
-	refresh : function() {
-		for (var prop in this.config) {
-			this.refireEvent(prop);
-		}
-	},
-
-	/**
-	* Fires the normalized list of queued property change events
-	* @method fireQueue
-	*/
-	fireQueue : function() {
-		this.queueInProgress = true;
-		for (var i=0;i<this.eventQueue.length;i++) {
-			var queueItem = this.eventQueue[i];
-			if (queueItem) {
-				var key = queueItem[0];
-				var value = queueItem[1];
-				
-				var property = this.config[key];
-				property.value = value;
-
-				this.fireEvent(key,value);
-			}
-		}
-		
-		this.queueInProgress = false;
-		this.eventQueue = [];
-	},
-
-	/**
-	* Subscribes an external handler to the change event for any given property. 
-	* @method subscribeToConfigEvent
-	* @param {String}	key			The property name
-	* @param {Function}	handler		The handler function to use subscribe to the property's event
-	* @param {Object}	obj			The Object to use for scoping the event handler (see CustomEvent documentation)
-	* @param {Boolean}	override	Optional. If true, will override "this" within the handler to map to the scope Object passed into the method.
-	* @return {Boolean}				True, if the subscription was successful, otherwise false.
-	*/	
-	subscribeToConfigEvent : function(key, handler, obj, override) {
-		var property = this.config[key.toLowerCase()];
-		if (property && property.event) {
-			if (! YAHOO.util.Config.alreadySubscribed(property.event, handler, obj)) {
-				property.event.subscribe(handler, obj, override);
-			}
-			return true;
-		} else {
-			return false;
-		}
-	},
-
-	/**
-	* Unsubscribes an external handler from the change event for any given property. 
-	* @method unsubscribeFromConfigEvent
-	* @param {String}	key			The property name
-	* @param {Function}	handler		The handler function to use subscribe to the property's event
-	* @param {Object}	obj			The Object to use for scoping the event handler (see CustomEvent documentation)
-	* @return {Boolean}				True, if the unsubscription was successful, otherwise false.
-	*/
-	unsubscribeFromConfigEvent : function(key, handler, obj) {
-		var property = this.config[key.toLowerCase()];
-		if (property && property.event) {
-			return property.event.unsubscribe(handler, obj);
-		} else {
-			return false;
-		}
-	},
-
-	/**
-	* Returns a string representation of the Config object
-	* @method toString
-	* @return {String}	The Config object in string format.
-	*/
-	toString : function() {
-		var output = "Config";
-		if (this.owner) {
-			output += " [" + this.owner.toString() + "]";
-		}
-		return output;
-	},
-
-	/**
-	* Returns a string representation of the Config object's current CustomEvent queue
-	* @method outputEventQueue
-	* @return {String}	The string list of CustomEvents currently queued for execution
-	*/
-	outputEventQueue : function() {
-		var output = "";
-		for (var q=0;q<this.eventQueue.length;q++) {
-			var queueItem = this.eventQueue[q];
-			if (queueItem) {
-				output += queueItem[0] + "=" + queueItem[1] + ", ";
-			}
-		}
-		return output;
-	}
-};
-
-
-/**
-* Initializes the configuration Object and all of its local members.
-* @method init
-* @param {Object}	owner	The owner Object to which this Config Object belongs
-*/
-YAHOO.util.Config.prototype.init = function(owner) {
-	this.owner = owner;
-	this.configChangedEvent = new YAHOO.util.CustomEvent(YAHOO.util.CONFIG_CHANGED_EVENT, this);
-	this.queueInProgress = false;
-	this.config = {};
-	this.initialConfig = {};
-	this.eventQueue = [];
-};
-
-/**
-* Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent
-* @method YAHOO.util.Config.alreadySubscribed
-* @static
-* @param {YAHOO.util.CustomEvent} evt	The CustomEvent for which to check the subscriptions
-* @param {Function}	fn	The function to look for in the subscribers list
-* @param {Object}	obj	The execution scope Object for the subscription
-* @return {Boolean}	true, if the function/Object pair is already subscribed to the CustomEvent passed in
-*/
-YAHOO.util.Config.alreadySubscribed = function(evt, fn, obj) {
-	for (var e=0;e<evt.subscribers.length;e++) {
-		var subsc = evt.subscribers[e];
-		if (subsc && subsc.obj == obj && subsc.fn == fn) {
-			return true;
-		}
-	}
-	return false;
-};
-/**
-*  The Container family of components is designed to enable developers to create different kinds of content-containing modules on the web. Module and Overlay are the most basic containers, and they can be used directly or extended to build custom containers. Also part of the Container family are four UI controls that extend Module and Overlay: Tooltip, Panel, Dialog, and SimpleDialog.
-* @module container
-* @title Container
-* @requires yahoo,dom,event,dragdrop,animation
+version: 2.4.1
 */
+(function () {
+
+    /**
+    * Config is a utility used within an Object to allow the implementer to
+    * maintain a list of local configuration properties and listen for changes 
+    * to those properties dynamically using CustomEvent. The initial values are 
+    * also maintained so that the configuration can be reset at any given point 
+    * to its initial state.
+    * @namespace YAHOO.util
+    * @class Config
+    * @constructor
+    * @param {Object} owner The owner Object to which this Config Object belongs
+    */
+    YAHOO.util.Config = function (owner) {
+
+        if (owner) {
+            this.init(owner);
+        }
+
+
+    };
+
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Config = YAHOO.util.Config;
+
+
+    /**
+     * Constant representing the CustomEvent type for the config changed event.
+     * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
+     * @private
+     * @static
+     * @final
+     */
+    Config.CONFIG_CHANGED_EVENT = "configChanged";
+    
+    /**
+     * Constant representing the boolean type string
+     * @property YAHOO.util.Config.BOOLEAN_TYPE
+     * @private
+     * @static
+     * @final
+     */
+    Config.BOOLEAN_TYPE = "boolean";
+    
+    Config.prototype = {
+     
+        /**
+        * Object reference to the owner of this Config Object
+        * @property owner
+        * @type Object
+        */
+        owner: null,
+        
+        /**
+        * Boolean flag that specifies whether a queue is currently 
+        * being executed
+        * @property queueInProgress
+        * @type Boolean
+        */
+        queueInProgress: false,
+        
+        /**
+        * Maintains the local collection of configuration property objects and 
+        * their specified values
+        * @property config
+        * @private
+        * @type Object
+        */ 
+        config: null,
+        
+        /**
+        * Maintains the local collection of configuration property objects as 
+        * they were initially applied.
+        * This object is used when resetting a property.
+        * @property initialConfig
+        * @private
+        * @type Object
+        */ 
+        initialConfig: null,
+        
+        /**
+        * Maintains the local, normalized CustomEvent queue
+        * @property eventQueue
+        * @private
+        * @type Object
+        */ 
+        eventQueue: null,
+        
+        /**
+        * Custom Event, notifying subscribers when Config properties are set 
+        * (setProperty is called without the silent flag
+        * @event configChangedEvent
+        */
+        configChangedEvent: null,
+    
+        /**
+        * Initializes the configuration Object and all of its local members.
+        * @method init
+        * @param {Object} owner The owner Object to which this Config 
+        * Object belongs
+        */
+        init: function (owner) {
+    
+            this.owner = owner;
+    
+            this.configChangedEvent = 
+                this.createEvent(Config.CONFIG_CHANGED_EVENT);
+    
+            this.configChangedEvent.signature = CustomEvent.LIST;
+            this.queueInProgress = false;
+            this.config = {};
+            this.initialConfig = {};
+            this.eventQueue = [];
+        
+        },
+        
+        /**
+        * Validates that the value passed in is a Boolean.
+        * @method checkBoolean
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */ 
+        checkBoolean: function (val) {
+            return (typeof val == Config.BOOLEAN_TYPE);
+        },
+        
+        /**
+        * Validates that the value passed in is a number.
+        * @method checkNumber
+        * @param {Object} val The value to validate
+        * @return {Boolean} true, if the value is valid
+        */
+        checkNumber: function (val) {
+            return (!isNaN(val));
+        },
+        
+        /**
+        * Fires a configuration property event using the specified value. 
+        * @method fireEvent
+        * @private
+        * @param {String} key The configuration property's name
+        * @param {value} Object The value of the correct type for the property
+        */ 
+        fireEvent: function ( key, value ) {
+            var property = this.config[key];
+        
+            if (property && property.event) {
+                property.event.fire(value);
+            } 
+        },
+        
+        /**
+        * Adds a property to the Config Object's private config hash.
+        * @method addProperty
+        * @param {String} key The configuration property's name
+        * @param {Object} propertyObject The Object containing all of this 
+        * property's arguments
+        */
+        addProperty: function ( key, propertyObject ) {
+            key = key.toLowerCase();
+        
+            this.config[key] = propertyObject;
+        
+            propertyObject.event = this.createEvent(key, { scope: this.owner });
+            propertyObject.event.signature = CustomEvent.LIST;
+            
+            
+            propertyObject.key = key;
+        
+            if (propertyObject.handler) {
+                propertyObject.event.subscribe(propertyObject.handler, 
+                    this.owner);
+            }
+        
+            this.setProperty(key, propertyObject.value, true);
+            
+            if (! propertyObject.suppressEvent) {
+                this.queueProperty(key, propertyObject.value);
+            }
+            
+        },
+        
+        /**
+        * Returns a key-value configuration map of the values currently set in  
+        * the Config Object.
+        * @method getConfig
+        * @return {Object} The current config, represented in a key-value map
+        */
+        getConfig: function () {
+        
+            var cfg = {},
+                prop,
+                property;
+                
+            for (prop in this.config) {
+                property = this.config[prop];
+                if (property && property.event) {
+                    cfg[prop] = property.value;
+                }
+            }
+            
+            return cfg;
+        },
+        
+        /**
+        * Returns the value of specified property.
+        * @method getProperty
+        * @param {String} key The name of the property
+        * @return {Object}  The value of the specified property
+        */
+        getProperty: function (key) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.value;
+            } else {
+                return undefined;
+            }
+        },
+        
+        /**
+        * Resets the specified property's value to its initial value.
+        * @method resetProperty
+        * @param {String} key The name of the property
+        * @return {Boolean} True is the property was reset, false if not
+        */
+        resetProperty: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event) {
+    
+                if (this.initialConfig[key] && 
+                    !Lang.isUndefined(this.initialConfig[key])) {
+    
+                    this.setProperty(key, this.initialConfig[key]);
+
+                    return true;
+    
+                }
+    
+            } else {
+    
+                return false;
+            }
+    
+        },
+        
+        /**
+        * Sets the value of a property. If the silent property is passed as 
+        * true, the property's event will not be fired.
+        * @method setProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @param {Boolean} silent Whether the value should be set silently, 
+        * without firing the property event.
+        * @return {Boolean} True, if the set was successful, false if it failed.
+        */
+        setProperty: function (key, value, silent) {
+        
+            var property;
+        
+            key = key.toLowerCase();
+        
+            if (this.queueInProgress && ! silent) {
+                // Currently running through a queue... 
+                this.queueProperty(key,value);
+                return true;
+    
+            } else {
+                property = this.config[key];
+                if (property && property.event) {
+                    if (property.validator && !property.validator(value)) {
+                        return false;
+                    } else {
+                        property.value = value;
+                        if (! silent) {
+                            this.fireEvent(key, value);
+                            this.configChangedEvent.fire([key, value]);
+                        }
+                        return true;
+                    }
+                } else {
+                    return false;
+                }
+            }
+        },
+        
+        /**
+        * Sets the value of a property and queues its event to execute. If the 
+        * event is already scheduled to execute, it is
+        * moved from its current position to the end of the queue.
+        * @method queueProperty
+        * @param {String} key The name of the property
+        * @param {String} value The value to set the property to
+        * @return {Boolean}  true, if the set was successful, false if 
+        * it failed.
+        */ 
+        queueProperty: function (key, value) {
+        
+            key = key.toLowerCase();
+        
+            var property = this.config[key],
+                foundDuplicate = false,
+                iLen,
+                queueItem,
+                queueItemKey,
+                queueItemValue,
+                sLen,
+                supercedesCheck,
+                qLen,
+                queueItemCheck,
+                queueItemCheckKey,
+                queueItemCheckValue,
+                i,
+                s,
+                q;
+                                
+            if (property && property.event) {
+    
+                if (!Lang.isUndefined(value) && property.validator && 
+                    !property.validator(value)) { // validator
+                    return false;
+                } else {
+        
+                    if (!Lang.isUndefined(value)) {
+                        property.value = value;
+                    } else {
+                        value = property.value;
+                    }
+        
+                    foundDuplicate = false;
+                    iLen = this.eventQueue.length;
+        
+                    for (i = 0; i < iLen; i++) {
+                        queueItem = this.eventQueue[i];
+        
+                        if (queueItem) {
+                            queueItemKey = queueItem[0];
+                            queueItemValue = queueItem[1];
+
+                            if (queueItemKey == key) {
+    
+                                /*
+                                    found a dupe... push to end of queue, null 
+                                    current item, and break
+                                */
+    
+                                this.eventQueue[i] = null;
+    
+                                this.eventQueue.push(
+                                    [key, (!Lang.isUndefined(value) ? 
+                                    value : queueItemValue)]);
+    
+                                foundDuplicate = true;
+                                break;
+                            }
+                        }
+                    }
+                    
+                    // this is a refire, or a new property in the queue
+    
+                    if (! foundDuplicate && !Lang.isUndefined(value)) { 
+                        this.eventQueue.push([key, value]);
+                    }
+                }
+        
+                if (property.supercedes) {
+
+                    sLen = property.supercedes.length;
+
+                    for (s = 0; s < sLen; s++) {
+
+                        supercedesCheck = property.supercedes[s];
+                        qLen = this.eventQueue.length;
+
+                        for (q = 0; q < qLen; q++) {
+                            queueItemCheck = this.eventQueue[q];
+
+                            if (queueItemCheck) {
+                                queueItemCheckKey = queueItemCheck[0];
+                                queueItemCheckValue = queueItemCheck[1];
+
+                                if (queueItemCheckKey == 
+                                    supercedesCheck.toLowerCase() ) {
+
+                                    this.eventQueue.push([queueItemCheckKey, 
+                                        queueItemCheckValue]);
+
+                                    this.eventQueue[q] = null;
+                                    break;
+
+                                }
+                            }
+                        }
+                    }
+                }
+
+
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Fires the event for a property using the property's current value.
+        * @method refireEvent
+        * @param {String} key The name of the property
+        */
+        refireEvent: function (key) {
+    
+            key = key.toLowerCase();
+        
+            var property = this.config[key];
+    
+            if (property && property.event && 
+    
+                !Lang.isUndefined(property.value)) {
+    
+                if (this.queueInProgress) {
+    
+                    this.queueProperty(key);
+    
+                } else {
+    
+                    this.fireEvent(key, property.value);
+    
+                }
+    
+            }
+        },
+        
+        /**
+        * Applies a key-value Object literal to the configuration, replacing  
+        * any existing values, and queueing the property events.
+        * Although the values will be set, fireQueue() must be called for their 
+        * associated events to execute.
+        * @method applyConfig
+        * @param {Object} userConfig The configuration Object literal
+        * @param {Boolean} init  When set to true, the initialConfig will 
+        * be set to the userConfig passed in, so that calling a reset will 
+        * reset the properties to the passed values.
+        */
+        applyConfig: function (userConfig, init) {
+        
+            var sKey,
+                oConfig;
+
+            if (init) {
+                oConfig = {};
+                for (sKey in userConfig) {
+                    if (Lang.hasOwnProperty(userConfig, sKey)) {
+                        oConfig[sKey.toLowerCase()] = userConfig[sKey];
+                    }
+                }
+                this.initialConfig = oConfig;
+            }
+
+            for (sKey in userConfig) {
+                if (Lang.hasOwnProperty(userConfig, sKey)) {
+                    this.queueProperty(sKey, userConfig[sKey]);
+                }
+            }
+        },
+        
+        /**
+        * Refires the events for all configuration properties using their 
+        * current values.
+        * @method refresh
+        */
+        refresh: function () {
+        
+            var prop;
+        
+            for (prop in this.config) {
+                this.refireEvent(prop);
+            }
+        },
+        
+        /**
+        * Fires the normalized list of queued property change events
+        * @method fireQueue
+        */
+        fireQueue: function () {
+        
+            var i, 
+                queueItem,
+                key,
+                value,
+                property;
+        
+            this.queueInProgress = true;
+            for (i = 0;i < this.eventQueue.length; i++) {
+                queueItem = this.eventQueue[i];
+                if (queueItem) {
+        
+                    key = queueItem[0];
+                    value = queueItem[1];
+                    property = this.config[key];
+        
+                    property.value = value;
+        
+                    this.fireEvent(key,value);
+                }
+            }
+            
+            this.queueInProgress = false;
+            this.eventQueue = [];
+        },
+        
+        /**
+        * Subscribes an external handler to the change event for any 
+        * given property. 
+        * @method subscribeToConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event handler 
+        * (see CustomEvent documentation)
+        * @param {Boolean} override Optional. If true, will override "this"  
+        * within the handler to map to the scope Object passed into the method.
+        * @return {Boolean} True, if the subscription was successful, 
+        * otherwise false.
+        */ 
+        subscribeToConfigEvent: function (key, handler, obj, override) {
+    
+            var property = this.config[key.toLowerCase()];
+    
+            if (property && property.event) {
+                if (!Config.alreadySubscribed(property.event, handler, obj)) {
+                    property.event.subscribe(handler, obj, override);
+                }
+                return true;
+            } else {
+                return false;
+            }
+    
+        },
+        
+        /**
+        * Unsubscribes an external handler from the change event for any 
+        * given property. 
+        * @method unsubscribeFromConfigEvent
+        * @param {String} key The property name
+        * @param {Function} handler The handler function to use subscribe to 
+        * the property's event
+        * @param {Object} obj The Object to use for scoping the event 
+        * handler (see CustomEvent documentation)
+        * @return {Boolean} True, if the unsubscription was successful, 
+        * otherwise false.
+        */
+        unsubscribeFromConfigEvent: function (key, handler, obj) {
+            var property = this.config[key.toLowerCase()];
+            if (property && property.event) {
+                return property.event.unsubscribe(handler, obj);
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Returns a string representation of the Config object
+        * @method toString
+        * @return {String} The Config object in string format.
+        */
+        toString: function () {
+            var output = "Config";
+            if (this.owner) {
+                output += " [" + this.owner.toString() + "]";
+            }
+            return output;
+        },
+        
+        /**
+        * Returns a string representation of the Config object's current 
+        * CustomEvent queue
+        * @method outputEventQueue
+        * @return {String} The string list of CustomEvents currently queued 
+        * for execution
+        */
+        outputEventQueue: function () {
+
+            var output = "",
+                queueItem,
+                q,
+                nQueue = this.eventQueue.length;
+              
+            for (q = 0; q < nQueue; q++) {
+                queueItem = this.eventQueue[q];
+                if (queueItem) {
+                    output += queueItem[0] + "=" + queueItem[1] + ", ";
+                }
+            }
+            return output;
+        },
+
+        /**
+        * Sets all properties to null, unsubscribes all listeners from each 
+        * property's change event and all listeners from the configChangedEvent.
+        * @method destroy
+        */
+        destroy: function () {
+
+            var oConfig = this.config,
+                sProperty,
+                oProperty;
+
+
+            for (sProperty in oConfig) {
+            
+                if (Lang.hasOwnProperty(oConfig, sProperty)) {
+
+                    oProperty = oConfig[sProperty];
+
+                    oProperty.event.unsubscribeAll();
+                    oProperty.event = null;
+
+                }
+            
+            }
+            
+            this.configChangedEvent.unsubscribeAll();
+            
+            this.configChangedEvent = null;
+            this.owner = null;
+            this.config = null;
+            this.initialConfig = null;
+            this.eventQueue = null;
+        
+        }
+
+    };
+    
+    
+    
+    /**
+    * Checks to determine if a particular function/Object pair are already 
+    * subscribed to the specified CustomEvent
+    * @method YAHOO.util.Config.alreadySubscribed
+    * @static
+    * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check 
+    * the subscriptions
+    * @param {Function} fn The function to look for in the subscribers list
+    * @param {Object} obj The execution scope Object for the subscription
+    * @return {Boolean} true, if the function/Object pair is already subscribed 
+    * to the CustomEvent passed in
+    */
+    Config.alreadySubscribed = function (evt, fn, obj) {
+    
+        var nSubscribers = evt.subscribers.length,
+            subsc,
+            i;
+
+        if (nSubscribers > 0) {
+            i = nSubscribers - 1;
+            do {
+                subsc = evt.subscribers[i];
+                if (subsc && subsc.obj == obj && subsc.fn == fn) {
+                    return true;
+                }
+            }
+            while (i--);
+        }
+
+        return false;
+
+    };
+
+    YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
+
+}());
+
+(function () {
+
+    /**
+    * The Container family of components is designed to enable developers to 
+    * create different kinds of content-containing modules on the web. Module 
+    * and Overlay are the most basic containers, and they can be used directly 
+    * or extended to build custom containers. Also part of the Container family 
+    * are four UI controls that extend Module and Overlay: Tooltip, Panel, 
+    * Dialog, and SimpleDialog.
+    * @module container
+    * @title Container
+    * @requires yahoo, dom, event 
+    * @optional dragdrop, animation, button
+    */
+    
+    /**
+    * Module is a JavaScript representation of the Standard Module Format. 
+    * Standard Module Format is a simple standard for markup containers where 
+    * child nodes representing the header, body, and footer of the content are 
+    * denoted using the CSS classes "hd", "bd", and "ft" respectively. 
+    * Module is the base class for all other classes in the YUI 
+    * Container package.
+    * @namespace YAHOO.widget
+    * @class Module
+    * @constructor
+    * @param {String} el The element ID representing the Module <em>OR</em>
+    * @param {HTMLElement} el The element representing the Module
+    * @param {Object} userConfig The configuration Object literal containing 
+    * the configuration that should be set for this module. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Module = function (el, userConfig) {
+        if (el) {
+            this.init(el, userConfig);
+        } else {
+        }
+    };
+
+    var Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+
+        m_oModuleTemplate,
+        m_oHeaderTemplate,
+        m_oBodyTemplate,
+        m_oFooterTemplate,
+
+        /**
+        * Constant representing the name of the Module's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_INIT": "beforeInit",
+            "INIT": "init",
+            "APPEND": "append",
+            "BEFORE_RENDER": "beforeRender",
+            "RENDER": "render",
+            "CHANGE_HEADER": "changeHeader",
+            "CHANGE_BODY": "changeBody",
+            "CHANGE_FOOTER": "changeFooter",
+            "CHANGE_CONTENT": "changeContent",
+            "DESTORY": "destroy",
+            "BEFORE_SHOW": "beforeShow",
+            "SHOW": "show",
+            "BEFORE_HIDE": "beforeHide",
+            "HIDE": "hide"
+        
+        },
+            
+        /**
+        * Constant representing the Module's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "VISIBLE": { 
+                key: "visible", 
+                value: true, 
+                validator: YAHOO.lang.isBoolean 
+            },
+        
+            "EFFECT": { 
+                key: "effect", 
+                suppressEvent: true, 
+                supercedes: ["visible"] 
+            },
+
+            "MONITOR_RESIZE": { 
+                key: "monitorresize", 
+                value: true  
+            },
+
+            "APPEND_TO_DOCUMENT_BODY": { 
+                key: "appendtodocumentbody", 
+                value: false
+            }
+        };
+    
+    /**
+    * Constant representing the prefix path to use for non-secure images
+    * @property YAHOO.widget.Module.IMG_ROOT
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT = null;
+    
+    /**
+    * Constant representing the prefix path to use for securely served images
+    * @property YAHOO.widget.Module.IMG_ROOT_SSL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.IMG_ROOT_SSL = null;
+    
+    /**
+    * Constant for the default CSS class name that represents a Module
+    * @property YAHOO.widget.Module.CSS_MODULE
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_MODULE = "yui-module";
+    
+    /**
+    * Constant representing the module header
+    * @property YAHOO.widget.Module.CSS_HEADER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_HEADER = "hd";
+    
+    /**
+    * Constant representing the module body
+    * @property YAHOO.widget.Module.CSS_BODY
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_BODY = "bd";
+    
+    /**
+    * Constant representing the module footer
+    * @property YAHOO.widget.Module.CSS_FOOTER
+    * @static
+    * @final
+    * @type String
+    */
+    Module.CSS_FOOTER = "ft";
+    
+    /**
+    * Constant representing the url for the "src" attribute of the iframe 
+    * used to monitor changes to the browser's base font size
+    * @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
+    * @static
+    * @final
+    * @type String
+    */
+    Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
+    
+    /**
+    * Singleton CustomEvent fired when the font size is changed in the browser.
+    * Opera's "zoom" functionality currently does not support text 
+    * size detection.
+    * @event YAHOO.widget.Module.textResizeEvent
+    */
+    Module.textResizeEvent = new CustomEvent("textResize");
+
+    function createModuleTemplate() {
+
+        if (!m_oModuleTemplate) {
+            m_oModuleTemplate = document.createElement("div");
+            
+            m_oModuleTemplate.innerHTML = ("<div class=\"" + 
+                Module.CSS_HEADER + "\"></div>" + "<div class=\"" + 
+                Module.CSS_BODY + "\"></div><div class=\"" + 
+                Module.CSS_FOOTER + "\"></div>");
+
+            m_oHeaderTemplate = m_oModuleTemplate.firstChild;
+            m_oBodyTemplate = m_oHeaderTemplate.nextSibling;
+            m_oFooterTemplate = m_oBodyTemplate.nextSibling;
+        }
+
+        return m_oModuleTemplate;
+    }
+
+    function createHeader() {
+        if (!m_oHeaderTemplate) {
+            createModuleTemplate();
+        }
+        return (m_oHeaderTemplate.cloneNode(false));
+    }
+
+    function createBody() {
+        if (!m_oBodyTemplate) {
+            createModuleTemplate();
+        }
+        return (m_oBodyTemplate.cloneNode(false));
+    }
+
+    function createFooter() {
+        if (!m_oFooterTemplate) {
+            createModuleTemplate();
+        }
+        return (m_oFooterTemplate.cloneNode(false));
+    }
+
+    Module.prototype = {
+
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: Module,
+        
+        /**
+        * The main module element that contains the header, body, and footer
+        * @property element
+        * @type HTMLElement
+        */
+        element: null,
+
+        /**
+        * The header element, denoted with CSS class "hd"
+        * @property header
+        * @type HTMLElement
+        */
+        header: null,
+
+        /**
+        * The body element, denoted with CSS class "bd"
+        * @property body
+        * @type HTMLElement
+        */
+        body: null,
+
+        /**
+        * The footer element, denoted with CSS class "ft"
+        * @property footer
+        * @type HTMLElement
+        */
+        footer: null,
+
+        /**
+        * The id of the element
+        * @property id
+        * @type String
+        */
+        id: null,
+
+        /**
+        * A string representing the root path for all images created by
+        * a Module instance.
+        * @deprecated It is recommend that any images for a Module be applied
+        * via CSS using the "background-image" property.
+        * @property imageRoot
+        * @type String
+        */
+        imageRoot: Module.IMG_ROOT,
+
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        * @method initEvents
+        */
+        initEvents: function () {
+
+            var SIGNATURE = CustomEvent.LIST;
+
+            /**
+            * CustomEvent fired prior to class initalization.
+            * @event beforeInitEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */
+            this.beforeInitEvent = this.createEvent(EVENT_TYPES.BEFORE_INIT);
+            this.beforeInitEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired after class initalization.
+            * @event initEvent
+            * @param {class} classRef class reference of the initializing 
+            * class, such as this.beforeInitEvent.fire(Module)
+            */  
+            this.initEvent = this.createEvent(EVENT_TYPES.INIT);
+            this.initEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired when the Module is appended to the DOM
+            * @event appendEvent
+            */
+            this.appendEvent = this.createEvent(EVENT_TYPES.APPEND);
+            this.appendEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired before the Module is rendered
+            * @event beforeRenderEvent
+            */
+            this.beforeRenderEvent = this.createEvent(EVENT_TYPES.BEFORE_RENDER);
+            this.beforeRenderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the Module is rendered
+            * @event renderEvent
+            */
+            this.renderEvent = this.createEvent(EVENT_TYPES.RENDER);
+            this.renderEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the header content of the Module 
+            * is modified
+            * @event changeHeaderEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new header content
+            */
+            this.changeHeaderEvent = this.createEvent(EVENT_TYPES.CHANGE_HEADER);
+            this.changeHeaderEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the body content of the Module is modified
+            * @event changeBodyEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new body content
+            */  
+            this.changeBodyEvent = this.createEvent(EVENT_TYPES.CHANGE_BODY);
+            this.changeBodyEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired when the footer content of the Module 
+            * is modified
+            * @event changeFooterEvent
+            * @param {String/HTMLElement} content String/element representing 
+            * the new footer content
+            */
+            this.changeFooterEvent = this.createEvent(EVENT_TYPES.CHANGE_FOOTER);
+            this.changeFooterEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired when the content of the Module is modified
+            * @event changeContentEvent
+            */
+            this.changeContentEvent = this.createEvent(EVENT_TYPES.CHANGE_CONTENT);
+            this.changeContentEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired when the Module is destroyed
+            * @event destroyEvent
+            */
+            this.destroyEvent = this.createEvent(EVENT_TYPES.DESTORY);
+            this.destroyEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired before the Module is shown
+            * @event beforeShowEvent
+            */
+            this.beforeShowEvent = this.createEvent(EVENT_TYPES.BEFORE_SHOW);
+            this.beforeShowEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired after the Module is shown
+            * @event showEvent
+            */
+            this.showEvent = this.createEvent(EVENT_TYPES.SHOW);
+            this.showEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired before the Module is hidden
+            * @event beforeHideEvent
+            */
+            this.beforeHideEvent = this.createEvent(EVENT_TYPES.BEFORE_HIDE);
+            this.beforeHideEvent.signature = SIGNATURE;
+
+            /**
+            * CustomEvent fired after the Module is hidden
+            * @event hideEvent
+            */
+            this.hideEvent = this.createEvent(EVENT_TYPES.HIDE);
+            this.hideEvent.signature = SIGNATURE;
+        }, 
+
+        /**
+        * String representing the current user-agent platform
+        * @property platform
+        * @type String
+        */
+        platform: function () {
+            var ua = navigator.userAgent.toLowerCase();
+
+            if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
+                return "windows";
+            } else if (ua.indexOf("macintosh") != -1) {
+                return "mac";
+            } else {
+                return false;
+            }
+        }(),
+        
+        /**
+        * String representing the user-agent of the browser
+        * @deprecated Use YAHOO.env.ua
+        * @property browser
+        * @type String
+        */
+        browser: function () {
+            var ua = navigator.userAgent.toLowerCase();
+            /*
+                 Check Opera first in case of spoof and check Safari before
+                 Gecko since Safari's user agent string includes "like Gecko"
+            */
+            if (ua.indexOf('opera') != -1) { 
+                return 'opera';
+            } else if (ua.indexOf('msie 7') != -1) {
+                return 'ie7';
+            } else if (ua.indexOf('msie') != -1) {
+                return 'ie';
+            } else if (ua.indexOf('safari') != -1) { 
+                return 'safari';
+            } else if (ua.indexOf('gecko') != -1) {
+                return 'gecko';
+            } else {
+                return false;
+            }
+        }(),
+        
+        /**
+        * Boolean representing whether or not the current browsing context is 
+        * secure (https)
+        * @property isSecure
+        * @type Boolean
+        */
+        isSecure: function () {
+            if (window.location.href.toLowerCase().indexOf("https") === 0) {
+                return true;
+            } else {
+                return false;
+            }
+        }(),
+        
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        */
+        initDefaultConfig: function () {
+            // Add properties //
+            /**
+            * Specifies whether the Module is visible on the page.
+            * @config visible
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.VISIBLE.key, {
+                handler: this.configVisible, 
+                value: DEFAULT_CONFIG.VISIBLE.value, 
+                validator: DEFAULT_CONFIG.VISIBLE.validator
+            });
+
+            /**
+            * Object or array of objects representing the ContainerEffect 
+            * classes that are active for animating the container.
+            * @config effect
+            * @type Object
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key, {
+                suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.EFFECT.supercedes
+            });
+
+            /**
+            * Specifies whether to create a special proxy iframe to monitor 
+            * for user font resizing in the document
+            * @config monitorresize
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key, {
+                handler: this.configMonitorResize,
+                value: DEFAULT_CONFIG.MONITOR_RESIZE.value
+            });
+
+            /**
+            * Specifies if the module should be rendered as the first child 
+            * of document.body or appended as the last child when render is called
+            * with document.body as the "appendToNode".
+            * <p>
+            * Appending to the body while the DOM is still being constructed can 
+            * lead to Operation Aborted errors in IE hence this flag is set to 
+            * false by default.
+            * </p>
+            * 
+            * @config appendtodocumentbody
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.key, {
+                value: DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.value
+            });
+        },
+
+        /**
+        * The Module class's initialization method, which is executed for
+        * Module and all of its subclasses. This method is automatically 
+        * called by the constructor, and  sets up all DOM references for 
+        * pre-existing markup, and creates required markup if it is not 
+        * already present.
+        * @method init
+        * @param {String} el The element ID representing the Module <em>OR</em>
+        * @param {HTMLElement} el The element representing the Module
+        * @param {Object} userConfig The configuration Object literal 
+        * containing the configuration that should be set for this module. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+
+            var elId, child;
+
+            this.initEvents();
+            this.beforeInitEvent.fire(Module);
+
+            /**
+            * The Module's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type YAHOO.util.Config
+            */
+            this.cfg = new Config(this);
+
+            if (this.isSecure) {
+                this.imageRoot = Module.IMG_ROOT_SSL;
+            }
+
+            if (typeof el == "string") {
+                elId = el;
+                el = document.getElementById(el);
+                if (! el) {
+                    el = (createModuleTemplate()).cloneNode(false);
+                    el.id = elId;
+                }
+            }
+
+            this.element = el;
+
+            if (el.id) {
+                this.id = el.id;
+            }
+
+            child = this.element.firstChild;
+
+            if (child) {
+                var fndHd = false, fndBd = false, fndFt = false;
+                do {
+                    // We're looking for elements
+                    if (1 == child.nodeType) {
+                        if (!fndHd && Dom.hasClass(child, Module.CSS_HEADER)) {
+                            this.header = child;
+                            fndHd = true;
+                        } else if (!fndBd && Dom.hasClass(child, Module.CSS_BODY)) {
+                            this.body = child;
+                            fndBd = true;
+                        } else if (!fndFt && Dom.hasClass(child, Module.CSS_FOOTER)){
+                            this.footer = child;
+                            fndFt = true;
+                        }
+                    }
+                } while ((child = child.nextSibling));
+            }
+
+            this.initDefaultConfig();
+
+            Dom.addClass(this.element, Module.CSS_MODULE);
+
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+
+            /*
+                Subscribe to the fireQueue() method of Config so that any 
+                queued configuration changes are excecuted upon render of 
+                the Module
+            */ 
+
+            if (!Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
+                this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
+            }
+
+            this.initEvent.fire(Module);
+        },
+
+        /**
+        * Initialized an empty IFRAME that is placed out of the visible area 
+        * that can be used to detect text resize.
+        * @method initResizeMonitor
+        */
+        initResizeMonitor: function () {
+
+            var oDoc, 
+                oIFrame, 
+                sHTML;
+
+            function fireTextResize() {
+                Module.textResizeEvent.fire();
+            }
+
+            if (!YAHOO.env.ua.opera) {
+                oIFrame = Dom.get("_yuiResizeMonitor");
+
+                if (!oIFrame) {
+                    oIFrame = document.createElement("iframe");
+
+                    if (this.isSecure && Module.RESIZE_MONITOR_SECURE_URL && YAHOO.env.ua.ie) {
+                        oIFrame.src = Module.RESIZE_MONITOR_SECURE_URL;
+                    }
+
+                    /*
+                        Need to set the iframe document for Gecko
+                        to fire resize events on the iframe contentWindow.
+                     */
+                    if (YAHOO.env.ua.gecko) {
+                         sHTML = ["<html><head><script ",
+                                  "type=\"text/javascript\">",
+                                  "window.onresize=function(){window.parent.",
+                                  "YAHOO.widget.Module.textResizeEvent.",
+                                  "fire();}", 
+                                  "<\/script></head>",
+                                  "<body></body></html>"].join('');
+
+                        oIFrame.src = "data:text/html;charset=utf-8," +
+                            encodeURIComponent(sHTML);
+                    }
+
+                    oIFrame.id = "_yuiResizeMonitor";
+                    /*
+                        Need to set "position" property before inserting the 
+                        iframe into the document or Safari's status bar will 
+                        forever indicate the iframe is loading 
+                        (See SourceForge bug #1723064)
+                    */
+                    oIFrame.style.position = "absolute";
+                    oIFrame.style.visibility = "hidden";
+
+                    var fc = document.body.firstChild;
+                    if (fc) {
+                        document.body.insertBefore(oIFrame, fc);
+                    } else {
+                        document.body.appendChild(oIFrame);
+                    }
+
+                    oIFrame.style.width = "10em";
+                    oIFrame.style.height = "10em";
+                    oIFrame.style.top = (-1 * oIFrame.offsetHeight) + "px";
+                    oIFrame.style.left = (-1 * oIFrame.offsetWidth) + "px";
+                    oIFrame.style.borderWidth = "0";
+                    oIFrame.style.visibility = "visible";
+
+                    /*
+                       Don't open/close the document for Gecko like we used to, since it
+                       leads to duplicate cookies. (See SourceForge bug #1721755)
+                    */
+                    if (YAHOO.env.ua.webkit) {
+                        oDoc = oIFrame.contentWindow.document;
+                        oDoc.open();
+                        oDoc.close();
+                    }
+                }
+
+                if (oIFrame && oIFrame.contentWindow) {
+                    Module.textResizeEvent.subscribe(this.onDomResize, this, true);
+
+                    if (!Module.textResizeInitialized) {
+                         // We already handle gecko using the iframe's document content
+                        if (!YAHOO.env.ua.gecko) {
+                            if (!Event.on(oIFrame.contentWindow, "resize", fireTextResize)) {
+                                /*
+                                     This will fail in IE if document.domain has 
+                                     changed, so we must change the listener to 
+                                     use the oIFrame element instead
+                                */
+                                Event.on(oIFrame, "resize", fireTextResize);
+                            }
+                        }
+                        Module.textResizeInitialized = true;
+                    }
+                    this.resizeMonitor = oIFrame;
+                }
+            }
+        },
+
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The DOM resize event
+        * @param {Object} obj The scope object passed to the handler
+        */
+        onDomResize: function (e, obj) {
+        
+            var nLeft = -1 * this.resizeMonitor.offsetWidth,
+                nTop = -1 * this.resizeMonitor.offsetHeight;
+        
+            this.resizeMonitor.style.top = nTop + "px";
+            this.resizeMonitor.style.left =  nLeft + "px";
+
+        },
+        
+        /**
+        * Sets the Module's header content to the HTML specified, or appends 
+        * the passed element to the header. If no header is present, one will 
+        * be automatically created.
+        * @method setHeader
+        * @param {String} headerContent The HTML used to set the header 
+        * <em>OR</em>
+        * @param {HTMLElement} headerContent The HTMLElement to append to 
+        * the header
+        */
+        setHeader: function (headerContent) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            if (typeof headerContent == "string") {
+
+                oHeader.innerHTML = headerContent;
+
+            } else {
+
+                oHeader.innerHTML = "";
+                oHeader.appendChild(headerContent);
+
+            }
+        
+            this.changeHeaderEvent.fire(headerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the header. If no header is present, 
+        * one will be automatically created.
+        * @method appendToHeader
+        * @param {HTMLElement} element The element to append to the header
+        */
+        appendToHeader: function (element) {
+
+            var oHeader = this.header || (this.header = createHeader());
+        
+            oHeader.appendChild(element);
+
+            this.changeHeaderEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Sets the Module's body content to the HTML specified, or appends the
+        * passed element to the body. If no body is present, one will be 
+        * automatically created.
+        * @method setBody
+        * @param {String} bodyContent The HTML used to set the body <em>OR</em>
+        * @param {HTMLElement} bodyContent The HTMLElement to append to the body
+        */
+        setBody: function (bodyContent) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            if (typeof bodyContent == "string") {
+
+                oBody.innerHTML = bodyContent;
+
+            } else {
+
+                oBody.innerHTML = "";
+                oBody.appendChild(bodyContent);
+
+            }
+        
+            this.changeBodyEvent.fire(bodyContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the body. If no body is present, one 
+        * will be automatically created.
+        * @method appendToBody
+        * @param {HTMLElement} element The element to append to the body
+        */
+        appendToBody: function (element) {
+
+            var oBody = this.body || (this.body = createBody());
+        
+            oBody.appendChild(element);
+
+            this.changeBodyEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Sets the Module's footer content to the HTML specified, or appends 
+        * the passed element to the footer. If no footer is present, one will 
+        * be automatically created.
+        * @method setFooter
+        * @param {String} footerContent The HTML used to set the footer 
+        * <em>OR</em>
+        * @param {HTMLElement} footerContent The HTMLElement to append to 
+        * the footer
+        */
+        setFooter: function (footerContent) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            if (typeof footerContent == "string") {
+
+                oFooter.innerHTML = footerContent;
+
+            } else {
+
+                oFooter.innerHTML = "";
+                oFooter.appendChild(footerContent);
+
+            }
+        
+            this.changeFooterEvent.fire(footerContent);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Appends the passed element to the footer. If no footer is present, 
+        * one will be automatically created.
+        * @method appendToFooter
+        * @param {HTMLElement} element The element to append to the footer
+        */
+        appendToFooter: function (element) {
+
+            var oFooter = this.footer || (this.footer = createFooter());
+        
+            oFooter.appendChild(element);
+
+            this.changeFooterEvent.fire(element);
+            this.changeContentEvent.fire();
+
+        },
+        
+        /**
+        * Renders the Module by inserting the elements that are not already 
+        * in the main Module into their correct places. Optionally appends 
+        * the Module to the specified node prior to the render's execution. 
+        * <p>
+        * For Modules without existing markup, the appendToNode argument 
+        * is REQUIRED. If this argument is ommitted and the current element is 
+        * not present in the document, the function will return false, 
+        * indicating that the render was a failure.
+        * </p>
+        * <p>
+        * NOTE: As of 2.3.1, if the appendToNode is the document's body element
+        * then the module is rendered as the first child of the body element, 
+        * and not appended to it, to avoid Operation Aborted errors in IE when 
+        * rendering the module before window's load event is fired. You can 
+        * use the appendtodocumentbody configuration property to change this 
+        * to append to document.body if required.
+        * </p>
+        * @method render
+        * @param {String} appendToNode The element id to which the Module 
+        * should be appended to prior to rendering <em>OR</em>
+        * @param {HTMLElement} appendToNode The element to which the Module 
+        * should be appended to prior to rendering
+        * @param {HTMLElement} moduleElement OPTIONAL. The element that 
+        * represents the actual Standard Module container.
+        * @return {Boolean} Success or failure of the render
+        */
+        render: function (appendToNode, moduleElement) {
+
+            var me = this,
+                firstChild;
+
+            function appendTo(parentNode) {
+                if (typeof parentNode == "string") {
+                    parentNode = document.getElementById(parentNode);
+                }
+
+                if (parentNode) {
+                    me._addToParent(parentNode, me.element);
+                    me.appendEvent.fire();
+                }
+            }
+
+            this.beforeRenderEvent.fire();
+
+            if (! moduleElement) {
+                moduleElement = this.element;
+            }
+
+            if (appendToNode) {
+                appendTo(appendToNode);
+            } else { 
+                // No node was passed in. If the element is not already in the Dom, this fails
+                if (! Dom.inDocument(this.element)) {
+                    return false;
+                }
+            }
+
+            // Need to get everything into the DOM if it isn't already
+            if (this.header && ! Dom.inDocument(this.header)) {
+                // There is a header, but it's not in the DOM yet. Need to add it.
+                firstChild = moduleElement.firstChild;
+                if (firstChild) {
+                    moduleElement.insertBefore(this.header, firstChild);
+                } else {
+                    moduleElement.appendChild(this.header);
+                }
+            }
+
+            if (this.body && ! Dom.inDocument(this.body)) {
+                // There is a body, but it's not in the DOM yet. Need to add it.		
+                if (this.footer && Dom.isAncestor(this.moduleElement, this.footer)) {
+                    moduleElement.insertBefore(this.body, this.footer);
+                } else {
+                    moduleElement.appendChild(this.body);
+                }
+            }
+
+            if (this.footer && ! Dom.inDocument(this.footer)) {
+                // There is a footer, but it's not in the DOM yet. Need to add it.
+                moduleElement.appendChild(this.footer);
+            }
+
+            this.renderEvent.fire();
+            return true;
+        },
+
+        /**
+        * Removes the Module element from the DOM and sets all child elements 
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+
+            var parent,
+                e;
+
+            if (this.element) {
+                Event.purgeElement(this.element, true);
+                parent = this.element.parentNode;
+            }
+
+            if (parent) {
+                parent.removeChild(this.element);
+            }
+        
+            this.element = null;
+            this.header = null;
+            this.body = null;
+            this.footer = null;
+
+            Module.textResizeEvent.unsubscribe(this.onDomResize, this);
+
+            this.cfg.destroy();
+            this.cfg = null;
+
+            this.destroyEvent.fire();
+        
+            for (e in this) {
+                if (e instanceof CustomEvent) {
+                    e.unsubscribeAll();
+                }
+            }
+
+        },
+        
+        /**
+        * Shows the Module element by setting the visible configuration 
+        * property to true. Also fires two events: beforeShowEvent prior to 
+        * the visibility change, and showEvent after.
+        * @method show
+        */
+        show: function () {
+            this.cfg.setProperty("visible", true);
+        },
+        
+        /**
+        * Hides the Module element by setting the visible configuration 
+        * property to false. Also fires two events: beforeHideEvent prior to 
+        * the visibility change, and hideEvent after.
+        * @method hide
+        */
+        hide: function () {
+            this.cfg.setProperty("visible", false);
+        },
+        
+        // BUILT-IN EVENT HANDLERS FOR MODULE //
+        /**
+        * Default event handler for changing the visibility property of a 
+        * Module. By default, this is achieved by switching the "display" style 
+        * between "block" and "none".
+        * This method is responsible for firing showEvent and hideEvent.
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configVisible
+        */
+        configVisible: function (type, args, obj) {
+            var visible = args[0];
+            if (visible) {
+                this.beforeShowEvent.fire();
+                Dom.setStyle(this.element, "display", "block");
+                this.showEvent.fire();
+            } else {
+                this.beforeHideEvent.fire();
+                Dom.setStyle(this.element, "display", "none");
+                this.hideEvent.fire();
+            }
+        },
+        
+        /**
+        * Default event handler for the "monitorresize" configuration property
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        * @method configMonitorResize
+        */
+        configMonitorResize: function (type, args, obj) {
+            var monitor = args[0];
+            if (monitor) {
+                this.initResizeMonitor();
+            } else {
+                Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
+                this.resizeMonitor = null;
+            }
+        },
+
+        /**
+         * This method is a protected helper, used when constructing the DOM structure for the module 
+         * to account for situations which may cause Operation Aborted errors in IE. It should not 
+         * be used for general DOM construction.
+         * <p>
+         * If the parentNode is not document.body, the element is appended as the last element.
+         * </p>
+         * <p>
+         * If the parentNode is document.body the element is added as the first child to help
+         * prevent Operation Aborted errors in IE.
+         * </p>
+         *
+         * @param {parentNode} The HTML element to which the element will be added
+         * @param {element} The HTML element to be added to parentNode's children
+         * @method _addToParent
+         * @protected
+         */
+        _addToParent: function(parentNode, element) {
+            if (!this.cfg.getProperty("appendtodocumentbody") && parentNode === document.body && parentNode.firstChild) {
+                parentNode.insertBefore(element, parentNode.firstChild);
+            } else {
+                parentNode.appendChild(element);
+            }
+        },
+
+        /**
+        * Returns a String representation of the Object.
+        * @method toString
+        * @return {String} The string representation of the Module
+        */
+        toString: function () {
+            return "Module " + this.id;
+        }
+    };
+
+    YAHOO.lang.augmentProto(Module, YAHOO.util.EventProvider);
+
+}());
+
+(function () {
+
+    /**
+    * Overlay is a Module that is absolutely positioned above the page flow. It 
+    * has convenience methods for positioning and sizing, as well as options for 
+    * controlling zIndex and constraining the Overlay's position to the current 
+    * visible viewport. Overlay also contains a dynamicly generated IFRAME which 
+    * is placed beneath it for Internet Explorer 6 and 5.x so that it will be 
+    * properly rendered above SELECT elements.
+    * @namespace YAHOO.widget
+    * @class Overlay
+    * @extends YAHOO.widget.Module
+    * @param {String} el The element ID representing the Overlay <em>OR</em>
+    * @param {HTMLElement} el The element representing the Overlay
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Overlay. See configuration 
+    * documentation for more details.
+    * @constructor
+    */
+    YAHOO.widget.Overlay = function (el, userConfig) {
+        YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
+    };
+
+    var Lang = YAHOO.lang,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Module = YAHOO.widget.Module,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        Overlay = YAHOO.widget.Overlay,
+
+        m_oIFrameTemplate,
+
+        /**
+        * Constant representing the name of the Overlay's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+            "BEFORE_MOVE": "beforeMove",
+            "MOVE": "move"
+        },
+
+        /**
+        * Constant representing the Overlay's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+
+            "X": { 
+                key: "x", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"]
+            },
+
+            "Y": { 
+                key: "y", 
+                validator: Lang.isNumber, 
+                suppressEvent: true, 
+                supercedes: ["iframe"]
+            },
+
+            "XY": { 
+                key: "xy", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+
+            "CONTEXT": { 
+                key: "context", 
+                suppressEvent: true, 
+                supercedes: ["iframe"] 
+            },
+
+            "FIXED_CENTER": { 
+                key: "fixedcenter", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "visible"] 
+            },
+
+            "WIDTH": { 
+                key: "width", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+
+            "HEIGHT": { 
+                key: "height", 
+                suppressEvent: true, 
+                supercedes: ["context", "fixedcenter", "iframe"] 
+            }, 
+
+            "ZINDEX": { 
+                key: "zindex", 
+                value: null 
+            }, 
+
+            "CONSTRAIN_TO_VIEWPORT": { 
+                key: "constraintoviewport", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["iframe", "x", "y", "xy"]
+            }, 
+
+            "IFRAME": { 
+                key: "iframe", 
+                value: (YAHOO.env.ua.ie == 6 ? true : false), 
+                validator: Lang.isBoolean, 
+                supercedes: ["zindex"] 
+            }
+        };
+
+    /**
+    * The URL that will be placed in the iframe
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.IFRAME_SRC = "javascript:false;";
+
+    /**
+    * Number representing how much the iframe shim should be offset from each 
+    * side of an Overlay instance, in pixels.
+    * @property YAHOO.widget.Overlay.IFRAME_SRC
+    * @default 3
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.IFRAME_OFFSET = 3;
+
+    /**
+    * Number representing the minimum distance an Overlay instance should be 
+    * positioned relative to the boundaries of the browser's viewport, in pixels.
+    * @property YAHOO.widget.Overlay.VIEWPORT_OFFSET
+    * @default 10
+    * @static
+    * @final
+    * @type Number
+    */
+    Overlay.VIEWPORT_OFFSET = 10;
+
+    /**
+    * Constant representing the top left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_LEFT = "tl";
+
+    /**
+    * Constant representing the top right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.TOP_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.TOP_RIGHT = "tr";
+
+    /**
+    * Constant representing the top bottom left corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_LEFT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_LEFT = "bl";
+
+    /**
+    * Constant representing the bottom right corner of an element, used for 
+    * configuring the context element alignment
+    * @property YAHOO.widget.Overlay.BOTTOM_RIGHT
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.BOTTOM_RIGHT = "br";
+
+    /**
+    * Constant representing the default CSS class used for an Overlay
+    * @property YAHOO.widget.Overlay.CSS_OVERLAY
+    * @static
+    * @final
+    * @type String
+    */
+    Overlay.CSS_OVERLAY = "yui-overlay";
+
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for 
+    * window scroll
+    * @event YAHOO.widget.Overlay.windowScrollEvent
+    */
+    Overlay.windowScrollEvent = new CustomEvent("windowScroll");
+
+    /**
+    * A singleton CustomEvent used for reacting to the DOM event for
+    * window resize
+    * @event YAHOO.widget.Overlay.windowResizeEvent
+    */
+    Overlay.windowResizeEvent = new CustomEvent("windowResize");
+
+    /**
+    * The DOM event handler used to fire the CustomEvent for window scroll
+    * @method YAHOO.widget.Overlay.windowScrollHandler
+    * @static
+    * @param {DOMEvent} e The DOM scroll event
+    */
+    Overlay.windowScrollHandler = function (e) {
+
+        if (YAHOO.env.ua.ie) {
+
+            if (! window.scrollEnd) {
+                window.scrollEnd = -1;
+            }
+
+            clearTimeout(window.scrollEnd);
+    
+            window.scrollEnd = setTimeout(function () { 
+                Overlay.windowScrollEvent.fire(); 
+            }, 1);
+    
+        } else {
+            Overlay.windowScrollEvent.fire();
+        }
+    };
+
+    /**
+    * The DOM event handler used to fire the CustomEvent for window resize
+    * @method YAHOO.widget.Overlay.windowResizeHandler
+    * @static
+    * @param {DOMEvent} e The DOM resize event
+    */
+    Overlay.windowResizeHandler = function (e) {
+
+        if (YAHOO.env.ua.ie) {
+            if (! window.resizeEnd) {
+                window.resizeEnd = -1;
+            }
+
+            clearTimeout(window.resizeEnd);
+
+            window.resizeEnd = setTimeout(function () {
+                Overlay.windowResizeEvent.fire(); 
+            }, 100);
+        } else {
+            Overlay.windowResizeEvent.fire();
+        }
+    };
+
+    /**
+    * A boolean that indicated whether the window resize and scroll events have 
+    * already been subscribed to.
+    * @property YAHOO.widget.Overlay._initialized
+    * @private
+    * @type Boolean
+    */
+    Overlay._initialized = null;
+
+    if (Overlay._initialized === null) {
+        Event.on(window, "scroll", Overlay.windowScrollHandler);
+        Event.on(window, "resize", Overlay.windowResizeHandler);
+    
+        Overlay._initialized = true;
+    }
+
+    YAHOO.extend(Overlay, Module, {
+
+        /**
+        * The Overlay initialization method, which is executed for Overlay and  
+        * all of its subclasses. This method is automatically called by the 
+        * constructor, and  sets up all DOM references for pre-existing markup, 
+        * and creates required markup if it is not already present.
+        * @method init
+        * @param {String} el The element ID representing the Overlay <em>OR</em>
+        * @param {HTMLElement} el The element representing the Overlay
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Overlay. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+    
+            /*
+                 Note that we don't pass the user config in here yet because we
+                 only want it executed once, at the lowest subclass level
+            */
+    
+            Overlay.superclass.init.call(this, el/*, userConfig*/);  
+
+            this.beforeInitEvent.fire(Overlay);
+            
+            Dom.addClass(this.element, Overlay.CSS_OVERLAY);
+            
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+
+            if (this.platform == "mac" && YAHOO.env.ua.gecko) {
+
+                if (! Config.alreadySubscribed(this.showEvent,
+                    this.showMacGeckoScrollbars, this)) {
+
+                    this.showEvent.subscribe(this.showMacGeckoScrollbars, 
+                        this, true);
+
+                }
+
+                if (! Config.alreadySubscribed(this.hideEvent, 
+                    this.hideMacGeckoScrollbars, this)) {
+
+                    this.hideEvent.subscribe(this.hideMacGeckoScrollbars, 
+                        this, true);
+
+                }
+            }
+
+            this.initEvent.fire(Overlay);
+        },
+        
+        /**
+        * Initializes the custom events for Overlay which are fired  
+        * automatically at appropriate times by the Overlay class.
+        * @method initEvents
+        */
+        initEvents: function () {
+    
+            Overlay.superclass.initEvents.call(this);
+            
+            var SIGNATURE = CustomEvent.LIST;
+            
+            /**
+            * CustomEvent fired before the Overlay is moved.
+            * @event beforeMoveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.beforeMoveEvent = this.createEvent(EVENT_TYPES.BEFORE_MOVE);
+            this.beforeMoveEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired after the Overlay is moved.
+            * @event moveEvent
+            * @param {Number} x x coordinate
+            * @param {Number} y y coordinate
+            */
+            this.moveEvent = this.createEvent(EVENT_TYPES.MOVE);
+            this.moveEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Overlay's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+    
+            Overlay.superclass.initDefaultConfig.call(this);
+            
+            
+            // Add overlay config properties //
+            
+            /**
+            * The absolute x-coordinate position of the Overlay
+            * @config x
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.X.key, { 
+    
+                handler: this.configX, 
+                validator: DEFAULT_CONFIG.X.validator, 
+                suppressEvent: DEFAULT_CONFIG.X.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.X.supercedes
+    
+            });
+    
+            /**
+            * The absolute y-coordinate position of the Overlay
+            * @config y
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.Y.key, {
+    
+                handler: this.configY, 
+                validator: DEFAULT_CONFIG.Y.validator, 
+                suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.Y.supercedes
+    
+            });
+    
+            /**
+            * An array with the absolute x and y positions of the Overlay
+            * @config xy
+            * @type Number[]
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.XY.key, {
+            
+                handler: this.configXY, 
+                suppressEvent: DEFAULT_CONFIG.XY.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.XY.supercedes
+            
+            });
+    
+            /**
+            * The array of context arguments for context-sensitive positioning.  
+            * The format is: [id or element, element corner, context corner]. 
+            * For example, setting this property to ["img1", "tl", "bl"] would 
+            * align the Overlay's top left corner to the context element's 
+            * bottom left corner.
+            * @config context
+            * @type Array
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key, {
+            
+                handler: this.configContext, 
+                suppressEvent: DEFAULT_CONFIG.CONTEXT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
+            
+            });
+
+            /**
+            * True if the Overlay should be anchored to the center of 
+            * the viewport.
+            * @config fixedcenter
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key, {
+            
+                handler: this.configFixedCenter,
+                value: DEFAULT_CONFIG.FIXED_CENTER.value, 
+                validator: DEFAULT_CONFIG.FIXED_CENTER.validator, 
+                supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
+            
+            });
+    
+            /**
+            * CSS width of the Overlay.
+            * @config width
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.WIDTH.key, {
+
+                handler: this.configWidth, 
+                suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.WIDTH.supercedes
+
+            });
+
+            /**
+            * CSS height of the Overlay.
+            * @config height
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key, {
+
+                handler: this.configHeight, 
+                suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
+            
+            });
+
+            /**
+            * CSS z-index of the Overlay.
+            * @config zIndex
+            * @type Number
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key, {
+
+                handler: this.configzIndex,
+                value: DEFAULT_CONFIG.ZINDEX.value
+
+            });
+            
+            /**
+            * True if the Overlay should be prevented from being positioned 
+            * out of the viewport.
+            * @config constraintoviewport
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, {
+
+                handler: this.configConstrainToViewport, 
+                value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
+                validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
+                supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
+
+            });
+            
+            /**
+            * @config iframe
+            * @description Boolean indicating whether or not the Overlay should 
+            * have an IFRAME shim; used to prevent SELECT elements from 
+            * poking through an Overlay instance in IE6.  When set to "true", 
+            * the iframe shim is created when the Overlay instance is intially
+            * made visible.
+            * @type Boolean
+            * @default true for IE6 and below, false for all other browsers.
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.IFRAME.key, {
+
+                handler: this.configIframe, 
+                value: DEFAULT_CONFIG.IFRAME.value, 
+                validator: DEFAULT_CONFIG.IFRAME.validator, 
+                supercedes: DEFAULT_CONFIG.IFRAME.supercedes
+
+            });
+        },
+
+        /**
+        * Moves the Overlay to the specified position. This function is  
+        * identical to calling this.cfg.setProperty("xy", [x,y]);
+        * @method moveTo
+        * @param {Number} x The Overlay's new x position
+        * @param {Number} y The Overlay's new y position
+        */
+        moveTo: function (x, y) {
+            this.cfg.setProperty("xy", [x, y]);
+        },
+
+        /**
+        * Adds a CSS class ("hide-scrollbars") and removes a CSS class 
+        * ("show-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method hideMacGeckoScrollbars
+        */
+        hideMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "show-scrollbars");
+            Dom.addClass(this.element, "hide-scrollbars");
+    
+        },
+
+        /**
+        * Adds a CSS class ("show-scrollbars") and removes a CSS class 
+        * ("hide-scrollbars") to the Overlay to fix a bug in Gecko on Mac OS X 
+        * (https://bugzilla.mozilla.org/show_bug.cgi?id=187435)
+        * @method showMacGeckoScrollbars
+        */
+        showMacGeckoScrollbars: function () {
+    
+            Dom.removeClass(this.element, "hide-scrollbars");
+            Dom.addClass(this.element, "show-scrollbars");
+    
+        },
+
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        /**
+        * The default event handler fired when the "visible" property is 
+        * changed.  This method is responsible for firing showEvent
+        * and hideEvent.
+        * @method configVisible
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configVisible: function (type, args, obj) {
+
+            var visible = args[0],
+                currentVis = Dom.getStyle(this.element, "visibility"),
+                effect = this.cfg.getProperty("effect"),
+                effectInstances = [],
+                isMacGecko = (this.platform == "mac" && YAHOO.env.ua.gecko),
+                alreadySubscribed = Config.alreadySubscribed,
+                eff, ei, e, i, j, k, h,
+                nEffects,
+                nEffectInstances;
+
+            if (currentVis == "inherit") {
+                e = this.element.parentNode;
+
+                while (e.nodeType != 9 && e.nodeType != 11) {
+                    currentVis = Dom.getStyle(e, "visibility");
+
+                    if (currentVis != "inherit") { 
+                        break; 
+                    }
+
+                    e = e.parentNode;
+                }
+
+                if (currentVis == "inherit") {
+                    currentVis = "visible";
+                }
+            }
+
+            if (effect) {
+                if (effect instanceof Array) {
+                    nEffects = effect.length;
+
+                    for (i = 0; i < nEffects; i++) {
+                        eff = effect[i];
+                        effectInstances[effectInstances.length] = 
+                            eff.effect(this, eff.duration);
+
+                    }
+                } else {
+                    effectInstances[effectInstances.length] = 
+                        effect.effect(this, effect.duration);
+                }
+            }
+
+
+            if (visible) { // Show
+                if (isMacGecko) {
+                    this.showMacGeckoScrollbars();
+                }
+
+                if (effect) { // Animate in
+                    if (visible) { // Animate in if not showing
+                        if (currentVis != "visible" || currentVis === "") {
+                            this.beforeShowEvent.fire();
+                            nEffectInstances = effectInstances.length;
+
+                            for (j = 0; j < nEffectInstances; j++) {
+                                ei = effectInstances[j];
+                                if (j === 0 && !alreadySubscribed(
+                                        ei.animateInCompleteEvent, 
+                                        this.showEvent.fire, this.showEvent)) {
+
+                                    /*
+                                         Delegate showEvent until end 
+                                         of animateInComplete
+                                    */
+
+                                    ei.animateInCompleteEvent.subscribe(
+                                     this.showEvent.fire, this.showEvent, true);
+                                }
+                                ei.animateIn();
+                            }
+                        }
+                    }
+                } else { // Show
+                    if (currentVis != "visible" || currentVis === "") {
+                        this.beforeShowEvent.fire();
+
+                        Dom.setStyle(this.element, "visibility", "visible");
+
+                        this.cfg.refireEvent("iframe");
+                        this.showEvent.fire();
+                    }
+                }
+            } else { // Hide
+
+                if (isMacGecko) {
+                    this.hideMacGeckoScrollbars();
+                }
+                    
+                if (effect) { // Animate out if showing
+                    if (currentVis == "visible") {
+                        this.beforeHideEvent.fire();
+
+                        nEffectInstances = effectInstances.length;
+                        for (k = 0; k < nEffectInstances; k++) {
+                            h = effectInstances[k];
+    
+                            if (k === 0 && !alreadySubscribed(
+                                h.animateOutCompleteEvent, this.hideEvent.fire, 
+                                this.hideEvent)) {
+    
+                                /*
+                                     Delegate hideEvent until end 
+                                     of animateOutComplete
+                                */
+    
+                                h.animateOutCompleteEvent.subscribe(
+                                    this.hideEvent.fire, this.hideEvent, true);
+    
+                            }
+                            h.animateOut();
+                        }
+
+                    } else if (currentVis === "") {
+                        Dom.setStyle(this.element, "visibility", "hidden");
+                    }
+
+                } else { // Simple hide
+
+                    if (currentVis == "visible" || currentVis === "") {
+                        this.beforeHideEvent.fire();
+                        Dom.setStyle(this.element, "visibility", "hidden");
+                        this.hideEvent.fire();
+                    }
+                }
+            }
+        },
+
+        /**
+        * Center event handler used for centering on scroll/resize, but only if 
+        * the Overlay is visible
+        * @method doCenterOnDOMEvent
+        */
+        doCenterOnDOMEvent: function () {
+            if (this.cfg.getProperty("visible")) {
+                this.center();
+            }
+        },
+
+        /**
+        * The default event handler fired when the "fixedcenter" property 
+        * is changed.
+        * @method configFixedCenter
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configFixedCenter: function (type, args, obj) {
+
+            var val = args[0],
+                alreadySubscribed = Config.alreadySubscribed,
+                windowResizeEvent = Overlay.windowResizeEvent,
+                windowScrollEvent = Overlay.windowScrollEvent;
+
+            if (val) {
+                this.center();
+
+                if (!alreadySubscribed(this.beforeShowEvent, this.center, this)) {
+                    this.beforeShowEvent.subscribe(this.center);
+                }
+
+                if (!alreadySubscribed(windowResizeEvent, this.doCenterOnDOMEvent, this)) {
+                    windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
+                }
+
+                if (!alreadySubscribed(windowScrollEvent, this.doCenterOnDOMEvent, this)) {
+                    windowScrollEvent.subscribe(this.doCenterOnDOMEvent, this, true);
+                }
+
+            } else {
+                this.beforeShowEvent.unsubscribe(this.center);
+
+                windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+                windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
+            }
+        },
+        
+        /**
+        * The default event handler fired when the "height" property is changed.
+        * @method configHeight
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configHeight: function (type, args, obj) {
+    
+            var height = args[0],
+                el = this.element;
+
+            Dom.setStyle(el, "height", height);
+            this.cfg.refireEvent("iframe");
+        },
+
+        /**
+        * The default event handler fired when the "width" property is changed.
+        * @method configWidth
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configWidth: function (type, args, obj) {
+
+            var width = args[0],
+                el = this.element;
+    
+            Dom.setStyle(el, "width", width);
+            this.cfg.refireEvent("iframe");
+        },
+        
+        /**
+        * The default event handler fired when the "zIndex" property is changed.
+        * @method configzIndex
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configzIndex: function (type, args, obj) {
+
+            var zIndex = args[0],
+                el = this.element;
+
+            if (! zIndex) {
+                zIndex = Dom.getStyle(el, "zIndex");
+                if (! zIndex || isNaN(zIndex)) {
+                    zIndex = 0;
+                }
+            }
+
+            if (this.iframe || this.cfg.getProperty("iframe") === true) {
+                if (zIndex <= 0) {
+                    zIndex = 1;
+                }
+            }
+
+            Dom.setStyle(el, "zIndex", zIndex);
+            this.cfg.setProperty("zIndex", zIndex, true);
+
+            if (this.iframe) {
+                this.stackIframe();
+            }
+        },
+
+        /**
+        * The default event handler fired when the "xy" property is changed.
+        * @method configXY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configXY: function (type, args, obj) {
+
+            var pos = args[0],
+                x = pos[0],
+                y = pos[1];
+
+            this.cfg.setProperty("x", x);
+            this.cfg.setProperty("y", y);
+
+            this.beforeMoveEvent.fire([x, y]);
+
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+
+
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+        },
+
+        /**
+        * The default event handler fired when the "x" property is changed.
+        * @method configX
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configX: function (type, args, obj) {
+
+            var x = args[0],
+                y = this.cfg.getProperty("y");
+
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+
+            this.beforeMoveEvent.fire([x, y]);
+
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+            
+            Dom.setX(this.element, x, true);
+            
+            this.cfg.setProperty("xy", [x, y], true);
+           
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+        },
+
+        /**
+        * The default event handler fired when the "y" property is changed.
+        * @method configY
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configY: function (type, args, obj) {
+
+            var x = this.cfg.getProperty("x"),
+                y = args[0];
+
+            this.cfg.setProperty("x", x, true);
+            this.cfg.setProperty("y", y, true);
+
+            this.beforeMoveEvent.fire([x, y]);
+
+            x = this.cfg.getProperty("x");
+            y = this.cfg.getProperty("y");
+
+            Dom.setY(this.element, y, true);
+
+            this.cfg.setProperty("xy", [x, y], true);
+
+            this.cfg.refireEvent("iframe");
+            this.moveEvent.fire([x, y]);
+        },
+        
+        /**
+        * Shows the iframe shim, if it has been enabled.
+        * @method showIframe
+        */
+        showIframe: function () {
+
+            var oIFrame = this.iframe,
+                oParentNode;
+
+            if (oIFrame) {
+                oParentNode = this.element.parentNode;
+
+                if (oParentNode != oIFrame.parentNode) {
+                    this._addToParent(oParentNode, oIFrame);
+                }
+                oIFrame.style.display = "block";
+            }
+        },
+
+        /**
+        * Hides the iframe shim, if it has been enabled.
+        * @method hideIframe
+        */
+        hideIframe: function () {
+            if (this.iframe) {
+                this.iframe.style.display = "none";
+            }
+        },
+
+        /**
+        * Syncronizes the size and position of iframe shim to that of its 
+        * corresponding Overlay instance.
+        * @method syncIframe
+        */
+        syncIframe: function () {
+
+            var oIFrame = this.iframe,
+                oElement = this.element,
+                nOffset = Overlay.IFRAME_OFFSET,
+                nDimensionOffset = (nOffset * 2),
+                aXY;
+
+            if (oIFrame) {
+                // Size <iframe>
+                oIFrame.style.width = (oElement.offsetWidth + nDimensionOffset + "px");
+                oIFrame.style.height = (oElement.offsetHeight + nDimensionOffset + "px");
+
+                // Position <iframe>
+                aXY = this.cfg.getProperty("xy");
+
+                if (!Lang.isArray(aXY) || (isNaN(aXY[0]) || isNaN(aXY[1]))) {
+                    this.syncPosition();
+                    aXY = this.cfg.getProperty("xy");
+                }
+                Dom.setXY(oIFrame, [(aXY[0] - nOffset), (aXY[1] - nOffset)]);
+            }
+        },
+
+        /**
+         * Sets the zindex of the iframe shim, if it exists, based on the zindex of
+         * the Overlay element. The zindex of the iframe is set to be one less 
+         * than the Overlay element's zindex.
+         * 
+         * <p>NOTE: This method will not bump up the zindex of the Overlay element
+         * to ensure that the iframe shim has a non-negative zindex.
+         * If you require the iframe zindex to be 0 or higher, the zindex of 
+         * the Overlay element should be set to a value greater than 0, before 
+         * this method is called.
+         * </p>
+         * @method stackIframe
+         */
+        stackIframe: function () {
+            if (this.iframe) {
+                var overlayZ = Dom.getStyle(this.element, "zIndex");
+                if (!YAHOO.lang.isUndefined(overlayZ) && !isNaN(overlayZ)) {
+                    Dom.setStyle(this.iframe, "zIndex", (overlayZ - 1));
+                }
+            }
+        },
+
+        /**
+        * The default event handler fired when the "iframe" property is changed.
+        * @method configIframe
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configIframe: function (type, args, obj) {
+
+            var bIFrame = args[0];
+
+            function createIFrame() {
+
+                var oIFrame = this.iframe,
+                    oElement = this.element,
+                    oParent;
+
+                if (!oIFrame) {
+                    if (!m_oIFrameTemplate) {
+                        m_oIFrameTemplate = document.createElement("iframe");
+
+                        if (this.isSecure) {
+                            m_oIFrameTemplate.src = Overlay.IFRAME_SRC;
+                        }
+
+                        /*
+                            Set the opacity of the <iframe> to 0 so that it 
+                            doesn't modify the opacity of any transparent 
+                            elements that may be on top of it (like a shadow).
+                        */
+
+                        if (YAHOO.env.ua.ie) {
+                            m_oIFrameTemplate.style.filter = "alpha(opacity=0)";
+                            /*
+                                 Need to set the "frameBorder" property to 0 
+                                 supress the default <iframe> border in IE.  
+                                 Setting the CSS "border" property alone 
+                                 doesn't supress it.
+                            */
+                            m_oIFrameTemplate.frameBorder = 0;
+                        }
+                        else {
+                            m_oIFrameTemplate.style.opacity = "0";
+                        }
+
+                        m_oIFrameTemplate.style.position = "absolute";
+                        m_oIFrameTemplate.style.border = "none";
+                        m_oIFrameTemplate.style.margin = "0";
+                        m_oIFrameTemplate.style.padding = "0";
+                        m_oIFrameTemplate.style.display = "none";
+                    }
+
+                    oIFrame = m_oIFrameTemplate.cloneNode(false);
+                    oParent = oElement.parentNode;
+
+                    var parentNode = oParent || document.body;
+
+                    this._addToParent(parentNode, oIFrame);
+                    this.iframe = oIFrame;
+                }
+
+                /*
+                     Show the <iframe> before positioning it since the "setXY" 
+                     method of DOM requires the element be in the document 
+                     and visible.
+                */
+                this.showIframe();
+
+                /*
+                     Syncronize the size and position of the <iframe> to that 
+                     of the Overlay.
+                */
+                this.syncIframe();
+                this.stackIframe();
+
+                // Add event listeners to update the <iframe> when necessary
+                if (!this._hasIframeEventListeners) {
+                    this.showEvent.subscribe(this.showIframe);
+                    this.hideEvent.subscribe(this.hideIframe);
+                    this.changeContentEvent.subscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = true;
+                }
+            }
+
+            function onBeforeShow() {
+                createIFrame.call(this);
+                this.beforeShowEvent.unsubscribe(onBeforeShow);
+                this._iframeDeferred = false;
+            }
+
+            if (bIFrame) { // <iframe> shim is enabled
+
+                if (this.cfg.getProperty("visible")) {
+                    createIFrame.call(this);
+                } else {
+                    if (!this._iframeDeferred) {
+                        this.beforeShowEvent.subscribe(onBeforeShow);
+                        this._iframeDeferred = true;
+                    }
+                }
+
+            } else {    // <iframe> shim is disabled
+                this.hideIframe();
+
+                if (this._hasIframeEventListeners) {
+                    this.showEvent.unsubscribe(this.showIframe);
+                    this.hideEvent.unsubscribe(this.hideIframe);
+                    this.changeContentEvent.unsubscribe(this.syncIframe);
+
+                    this._hasIframeEventListeners = false;
+                }
+            }
+        },
+
+        /**
+        * The default event handler fired when the "constraintoviewport" 
+        * property is changed.
+        * @method configConstrainToViewport
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for 
+        * the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configConstrainToViewport: function (type, args, obj) {
+
+            function constrainBeforeShow() {
+                if (YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))) {
+                    // Set CFG XY based on DOM XY
+                    this.syncPosition();
+                }
+                var x = this.cfg.getProperty("x");
+                var y = this.cfg.getProperty("y");
+
+                // Account for XY being set silently (no moveTo fired/called)
+                var cXY = this.getConstrainedXY(x, y);
+                if (cXY[0] !== x || cXY[1] !== y) {
+                    this.moveTo(cXY[0], cXY[1]);
+                }
+            }
+
+            var val = args[0];
+
+            if (val) {
+                if (! Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) {
+                    this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true);
+                }
+
+                if (! Config.alreadySubscribed(this.beforeShowEvent, constrainBeforeShow)) {
+                    this.beforeShowEvent.subscribe(constrainBeforeShow);
+                }
+            } else {
+                this.beforeShowEvent.unsubscribe(constrainBeforeShow);
+                this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
+            }
+        },
+
+        /**
+        * The default event handler fired when the "context" property 
+        * is changed.
+        * @method configContext
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configContext: function (type, args, obj) {
+    
+            var contextArgs = args[0],
+                contextEl,
+                elementMagnetCorner,
+                contextMagnetCorner;
+            
+            if (contextArgs) {
+            
+                contextEl = contextArgs[0];
+                elementMagnetCorner = contextArgs[1];
+                contextMagnetCorner = contextArgs[2];
+                
+                if (contextEl) {
+    
+                    if (typeof contextEl == "string") {
+
+                        this.cfg.setProperty("context", 
+                            [document.getElementById(contextEl), 
+                                elementMagnetCorner, contextMagnetCorner], 
+                                true);
+
+                    }
+                    
+                    if (elementMagnetCorner && contextMagnetCorner) {
+
+                        this.align(elementMagnetCorner, contextMagnetCorner);
+
+                    }
+
+                }
+
+            }
+
+        },
+
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+
+        /**
+        * Aligns the Overlay to its context element using the specified corner 
+        * points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, 
+        * and BOTTOM_RIGHT.
+        * @method align
+        * @param {String} elementAlign  The String representing the corner of 
+        * the Overlay that should be aligned to the context element
+        * @param {String} contextAlign  The corner of the context element 
+        * that the elementAlign corner should stick to.
+        */
+        align: function (elementAlign, contextAlign) {
+
+            var contextArgs = this.cfg.getProperty("context"),
+                me = this,
+                context,
+                element,
+                contextRegion;
+
+            function doAlign(v, h) {
+    
+                switch (elementAlign) {
+    
+                case Overlay.TOP_LEFT:
+                    me.moveTo(h, v);
+                    break;
+    
+                case Overlay.TOP_RIGHT:
+                    me.moveTo((h - element.offsetWidth), v);
+                    break;
+    
+                case Overlay.BOTTOM_LEFT:
+                    me.moveTo(h, (v - element.offsetHeight));
+                    break;
+    
+                case Overlay.BOTTOM_RIGHT:
+                    me.moveTo((h - element.offsetWidth), 
+                        (v - element.offsetHeight));
+                    break;
+                }
+            }
+    
+    
+            if (contextArgs) {
+            
+                context = contextArgs[0];
+                element = this.element;
+                me = this;
+                
+                if (! elementAlign) {
+                    elementAlign = contextArgs[1];
+                }
+                
+                if (! contextAlign) {
+                    contextAlign = contextArgs[2];
+                }
+                
+                if (element && context) {
+                    contextRegion = Dom.getRegion(context);
+
+                    switch (contextAlign) {
+    
+                    case Overlay.TOP_LEFT:
+                        doAlign(contextRegion.top, contextRegion.left);
+                        break;
+    
+                    case Overlay.TOP_RIGHT:
+                        doAlign(contextRegion.top, contextRegion.right);
+                        break;
+    
+                    case Overlay.BOTTOM_LEFT:
+                        doAlign(contextRegion.bottom, contextRegion.left);
+                        break;
+    
+                    case Overlay.BOTTOM_RIGHT:
+                        doAlign(contextRegion.bottom, contextRegion.right);
+                        break;
+                    }
+    
+                }
+    
+            }
+            
+        },
+
+        /**
+        * The default event handler executed when the moveEvent is fired, if the 
+        * "constraintoviewport" is set to true.
+        * @method enforceConstraints
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        enforceConstraints: function (type, args, obj) {
+            var pos = args[0];
+            var cXY = this.getConstrainedXY(pos[0], pos[1]);
+            this.cfg.setProperty("x", cXY[0], true);
+            this.cfg.setProperty("y", cXY[1], true);
+            this.cfg.setProperty("xy", cXY, true);
+        },
+
+        /**
+         * Given x, y coordinate values, returns the calculated coordinates required to 
+         * position the Overlay if it is to be constrained to the viewport, based on the 
+         * current element size, viewport dimensions and scroll values.
+         *
+         * @param {Number} x The X coordinate value to be constrained
+         * @param {Number} y The Y coordinate value to be constrained
+         * @return {Array} The constrained x and y coordinates at index 0 and 1 respectively;
+         */
+        getConstrainedXY: function(x, y) {
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                offsetHeight = this.element.offsetHeight,
+                offsetWidth = this.element.offsetWidth,
+                scrollX = Dom.getDocumentScrollLeft(),
+                scrollY = Dom.getDocumentScrollTop();
+
+            var xNew = x;
+            var yNew = y;
+
+            if (offsetWidth + nViewportOffset < viewPortWidth) {
+
+                var leftConstraint = scrollX + nViewportOffset;
+                var rightConstraint = scrollX + viewPortWidth - offsetWidth - nViewportOffset;
+
+                if (x < leftConstraint) {
+                    xNew = leftConstraint;
+                } else if (x > rightConstraint) {
+                    xNew = rightConstraint;
+                }
+            } else {
+                xNew = nViewportOffset + scrollX;
+            }
+
+            if (offsetHeight + nViewportOffset < viewPortHeight) {
+
+                var topConstraint = scrollY + nViewportOffset;
+                var bottomConstraint = scrollY + viewPortHeight - offsetHeight - nViewportOffset;
+
+                if (y < topConstraint) {
+                    yNew  = topConstraint;
+                } else if (y  > bottomConstraint) {
+                    yNew  = bottomConstraint;
+                }
+            } else {
+                yNew = nViewportOffset + scrollY;
+            }
+
+            return [xNew, yNew];
+        },
+
+        /**
+        * Centers the container in the viewport.
+        * @method center
+        */
+        center: function () {
+
+            var nViewportOffset = Overlay.VIEWPORT_OFFSET,
+                elementWidth = this.element.offsetWidth,
+                elementHeight = this.element.offsetHeight,
+                viewPortWidth = Dom.getViewportWidth(),
+                viewPortHeight = Dom.getViewportHeight(),
+                x,
+                y;
+
+            if (elementWidth < viewPortWidth) {
+                x = (viewPortWidth / 2) - (elementWidth / 2) + Dom.getDocumentScrollLeft();
+            } else {
+                x = nViewportOffset + Dom.getDocumentScrollLeft();
+            }
+
+            if (elementHeight < viewPortHeight) {
+                y = (viewPortHeight / 2) - (elementHeight / 2) + Dom.getDocumentScrollTop();
+            } else {
+                y = nViewportOffset + Dom.getDocumentScrollTop();
+            }
+
+            this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
+            this.cfg.refireEvent("iframe");
+        },
+
+        /**
+        * Synchronizes the Panel's "xy", "x", and "y" properties with the 
+        * Panel's position in the DOM. This is primarily used to update  
+        * position information during drag & drop.
+        * @method syncPosition
+        */
+        syncPosition: function () {
+
+            var pos = Dom.getXY(this.element);
+
+            this.cfg.setProperty("x", pos[0], true);
+            this.cfg.setProperty("y", pos[1], true);
+            this.cfg.setProperty("xy", pos, true);
+
+        },
+
+        /**
+        * Event handler fired when the resize monitor element is resized.
+        * @method onDomResize
+        * @param {DOMEvent} e The resize DOM event
+        * @param {Object} obj The scope object
+        */
+        onDomResize: function (e, obj) {
+
+            var me = this;
+
+            Overlay.superclass.onDomResize.call(this, e, obj);
+
+            setTimeout(function () {
+                me.syncPosition();
+                me.cfg.refireEvent("iframe");
+                me.cfg.refireEvent("context");
+            }, 0);
+    
+        },
+
+        /**
+        * Places the Overlay on top of all other instances of 
+        * YAHOO.widget.Overlay.
+        * @method bringToTop
+        */
+        bringToTop: function () {
+
+            var aOverlays = [],
+                oElement = this.element;
+
+            function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
+
+                var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
+                    sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
+
+                    nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10),
+                    nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10);
+
+                if (nZIndex1 > nZIndex2) {
+                    return -1;
+                } else if (nZIndex1 < nZIndex2) {
+                    return 1;
+                } else {
+                    return 0;
+                }
+            }
+
+            function isOverlayElement(p_oElement) {
+
+                var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
+                    Panel = YAHOO.widget.Panel;
+
+                if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
+                    if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
+                        aOverlays[aOverlays.length] = p_oElement.parentNode;
+                    } else {
+                        aOverlays[aOverlays.length] = p_oElement;
+                    }
+                }
+            }
+
+            Dom.getElementsBy(isOverlayElement, "DIV", document.body);
+
+            aOverlays.sort(compareZIndexDesc);
+
+            var oTopOverlay = aOverlays[0],
+                nTopZIndex;
+
+            if (oTopOverlay) {
+                nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
+
+                if (!isNaN(nTopZIndex)) {
+                    var bRequiresBump = false;
+
+                    if (oTopOverlay != oElement) {
+                        bRequiresBump = true;
+                    } else if (aOverlays.length > 1) {
+                        var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex");
+                        // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                        if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                            bRequiresBump = true;
+                        }
+                    }
+                    if (bRequiresBump) {
+                        this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                    }
+                }
+            }
+        },
+
+        /**
+        * Removes the Overlay element from the DOM and sets all child 
+        * elements to null.
+        * @method destroy
+        */
+        destroy: function () {
+
+            if (this.iframe) {
+                this.iframe.parentNode.removeChild(this.iframe);
+            }
+
+            this.iframe = null;
+        
+            Overlay.windowResizeEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+    
+            Overlay.windowScrollEvent.unsubscribe(
+                this.doCenterOnDOMEvent, this);
+        
+            Overlay.superclass.destroy.call(this);
+        },
+        
+        /**
+        * Returns a String representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Overlay.
+        */
+        toString: function () {
+            return "Overlay " + this.id;
+        }
+
+    });
+}());
+
+(function () {
+    
+    /**
+    * OverlayManager is used for maintaining the focus status of 
+    * multiple Overlays.
+    * @namespace YAHOO.widget
+    * @namespace YAHOO.widget
+    * @class OverlayManager
+    * @constructor
+    * @param {Array} overlays Optional. A collection of Overlays to register 
+    * with the manager.
+    * @param {Object} userConfig  The object literal representing the user 
+    * configuration of the OverlayManager
+    */
+    YAHOO.widget.OverlayManager = function (userConfig) {
+        this.init(userConfig);
+    };
+
+    var Overlay = YAHOO.widget.Overlay,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Config = YAHOO.util.Config,
+        CustomEvent = YAHOO.util.CustomEvent,
+        OverlayManager = YAHOO.widget.OverlayManager;
+    
+    /**
+    * The CSS class representing a focused Overlay
+    * @property OverlayManager.CSS_FOCUSED
+    * @static
+    * @final
+    * @type String
+    */
+    OverlayManager.CSS_FOCUSED = "focused";
+    
+    OverlayManager.prototype = {
+    
+        /**
+        * The class's constructor function
+        * @property contructor
+        * @type Function
+        */
+        constructor: OverlayManager,
+        
+        /**
+        * The array of Overlays that are currently registered
+        * @property overlays
+        * @type YAHOO.widget.Overlay[]
+        */
+        overlays: null,
+        
+        /**
+        * Initializes the default configuration of the OverlayManager
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+        
+            /**
+            * The collection of registered Overlays in use by 
+            * the OverlayManager
+            * @config overlays
+            * @type YAHOO.widget.Overlay[]
+            * @default null
+            */
+            this.cfg.addProperty("overlays", { suppressEvent: true } );
+        
+            /**
+            * The default DOM event that should be used to focus an Overlay
+            * @config focusevent
+            * @type String
+            * @default "mousedown"
+            */
+            this.cfg.addProperty("focusevent", { value: "mousedown" } );
+
+        },
+
+        /**
+        * Initializes the OverlayManager
+        * @method init
+        * @param {Overlay[]} overlays Optional. A collection of Overlays to 
+        * register with the manager.
+        * @param {Object} userConfig  The object literal representing the user 
+        * configuration of the OverlayManager
+        */
+        init: function (userConfig) {
+
+            /**
+            * The OverlayManager's Config object used for monitoring 
+            * configuration properties.
+            * @property cfg
+            * @type Config
+            */
+            this.cfg = new Config(this);
+
+            this.initDefaultConfig();
+
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+            this.cfg.fireQueue();
+
+            /**
+            * The currently activated Overlay
+            * @property activeOverlay
+            * @private
+            * @type YAHOO.widget.Overlay
+            */
+            var activeOverlay = null;
+
+            /**
+            * Returns the currently focused Overlay
+            * @method getActive
+            * @return {Overlay} The currently focused Overlay
+            */
+            this.getActive = function () {
+                return activeOverlay;
+            };
+
+            /**
+            * Focuses the specified Overlay
+            * @method focus
+            * @param {Overlay} overlay The Overlay to focus
+            * @param {String} overlay The id of the Overlay to focus
+            */
+            this.focus = function (overlay) {
+                var o = this.find(overlay);
+                if (o) {
+                    if (activeOverlay != o) {
+                        if (activeOverlay) {
+                            activeOverlay.blur();
+                        }
+                        this.bringToTop(o);
+
+                        activeOverlay = o;
+
+                        Dom.addClass(activeOverlay.element, 
+                            OverlayManager.CSS_FOCUSED);
+
+                        o.focusEvent.fire();
+                    }
+                }
+            };
+        
+            /**
+            * Removes the specified Overlay from the manager
+            * @method remove
+            * @param {Overlay} overlay The Overlay to remove
+            * @param {String} overlay The id of the Overlay to remove
+            */
+            this.remove = function (overlay) {
+                var o = this.find(overlay), 
+                        originalZ;
+                if (o) {
+                    if (activeOverlay == o) {
+                        activeOverlay = null;
+                    }
+
+                    var bDestroyed = (o.element === null && o.cfg === null) ? true : false;
+
+                    if (!bDestroyed) {
+                        // Set it's zindex so that it's sorted to the end.
+                        originalZ = Dom.getStyle(o.element, "zIndex");
+                        o.cfg.setProperty("zIndex", -1000, true);
+                    }
+
+                    this.overlays.sort(this.compareZIndexDesc);
+                    this.overlays = this.overlays.slice(0, (this.overlays.length - 1));
+
+                    o.hideEvent.unsubscribe(o.blur);
+                    o.destroyEvent.unsubscribe(this._onOverlayDestroy, o);
+
+                    if (!bDestroyed) {
+                        Event.removeListener(o.element, 
+                                    this.cfg.getProperty("focusevent"), 
+                                    this._onOverlayElementFocus);
+
+                        o.cfg.setProperty("zIndex", originalZ, true);
+                        o.cfg.setProperty("manager", null);
+                    }
+
+                    o.focusEvent.unsubscribeAll();
+                    o.blurEvent.unsubscribeAll();
+
+                    o.focusEvent = null;
+                    o.blurEvent = null;
+
+                    o.focus = null;
+                    o.blur = null;
+                }
+            };
+
+            /**
+            * Removes focus from all registered Overlays in the manager
+            * @method blurAll
+            */
+            this.blurAll = function () {
+    
+                var nOverlays = this.overlays.length,
+                    i;
+
+                if (nOverlays > 0) {
+                    i = nOverlays - 1;
+
+                    do {
+                        this.overlays[i].blur();
+                    }
+                    while(i--);
+                }
+            };
+        
+            this._onOverlayBlur = function (p_sType, p_aArgs) {
+                activeOverlay = null;
+            };
+        
+            var overlays = this.cfg.getProperty("overlays");
+        
+            if (! this.overlays) {
+                this.overlays = [];
+            }
+        
+            if (overlays) {
+                this.register(overlays);
+                this.overlays.sort(this.compareZIndexDesc);
+            }
+        },
+        
+        
+        /**
+        * @method _onOverlayElementFocus
+        * @description Event handler for the DOM event that is used to focus 
+        * the Overlay instance as specified by the "focusevent" 
+        * configuration property.
+        * @private
+        * @param {Event} p_oEvent Object representing the DOM event 
+        * object passed back by the event utility (Event).
+        */
+        _onOverlayElementFocus: function (p_oEvent) {
+        
+            var oTarget = Event.getTarget(p_oEvent),
+                oClose = this.close;
+            
+            if (oClose && (oTarget == oClose || Dom.isAncestor(oClose, oTarget))) {
+                this.blur();
+            } else {
+                this.focus();
+            }
+        },
+        
+        
+        /**
+        * @method _onOverlayDestroy
+        * @description "destroy" event handler for the Overlay.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {Overlay} p_oOverlay Object representing the menu that 
+        * fired the event.
+        */
+        _onOverlayDestroy: function (p_sType, p_aArgs, p_oOverlay) {
+            this.remove(p_oOverlay);
+        },
+        
+        /**
+        * Registers an Overlay or an array of Overlays with the manager. Upon 
+        * registration, the Overlay receives functions for focus and blur, 
+        * along with CustomEvents for each.
+        * @method register
+        * @param {Overlay} overlay  An Overlay to register with the manager.
+        * @param {Overlay[]} overlay  An array of Overlays to register with 
+        * the manager.
+        * @return {Boolean} True if any Overlays are registered.
+        */
+        register: function (overlay) {
+        
+            var mgr = this,
+                zIndex,
+                regcount,
+                i,
+                nOverlays;
+        
+            if (overlay instanceof Overlay) {
+
+                overlay.cfg.addProperty("manager", { value: this } );
+
+                overlay.focusEvent = overlay.createEvent("focus");
+                overlay.focusEvent.signature = CustomEvent.LIST;
+
+                overlay.blurEvent = overlay.createEvent("blur");
+                overlay.blurEvent.signature = CustomEvent.LIST;
+        
+                overlay.focus = function () {
+                    mgr.focus(this);
+                };
+        
+                overlay.blur = function () {
+                    if (mgr.getActive() == this) {
+                        Dom.removeClass(this.element, OverlayManager.CSS_FOCUSED);
+                        this.blurEvent.fire();
+                    }
+                };
+        
+                overlay.blurEvent.subscribe(mgr._onOverlayBlur);
+                overlay.hideEvent.subscribe(overlay.blur);
+                
+                overlay.destroyEvent.subscribe(this._onOverlayDestroy, overlay, this);
+        
+                Event.on(overlay.element, this.cfg.getProperty("focusevent"), 
+                            this._onOverlayElementFocus, null, overlay);
+        
+                zIndex = Dom.getStyle(overlay.element, "zIndex");
+
+                if (!isNaN(zIndex)) {
+                    overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
+                } else {
+                    overlay.cfg.setProperty("zIndex", 0);
+                }
+
+                this.overlays.push(overlay);
+                this.bringToTop(overlay);
+
+                return true;
+
+            } else if (overlay instanceof Array) {
+
+                regcount = 0;
+                nOverlays = overlay.length;
+
+                for (i = 0; i < nOverlays; i++) {
+                    if (this.register(overlay[i])) {
+                        regcount++;
+                    }
+                }
 
-/**
-* Module is a JavaScript representation of the Standard Module Format. Standard Module Format is a simple standard for markup containers where child nodes representing the header, body, and footer of the content are denoted using the CSS classes "hd", "bd", and "ft" respectively. Module is the base class for all other classes in the YUI Container package.
-* @namespace YAHOO.widget
-* @class Module
-* @constructor
-* @param {String} el			The element ID representing the Module <em>OR</em>
-* @param {HTMLElement} el		The element representing the Module
-* @param {Object} userConfig	The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-*/
-YAHOO.widget.Module = function(el, userConfig) {
-	if (el) {
-		this.init(el, userConfig);
-	} else {
-	}
-};
-
-/**
-* Constant representing the prefix path to use for non-secure images
-* @property YAHOO.widget.Module.IMG_ROOT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT = null;
+                if (regcount > 0) {
+                    return true;
+                }
+            } else {
+                return false;
+            }
+        },
+
+        /**
+        * Places the specified Overlay instance on top of all other 
+        * Overlay instances.
+        * @method bringToTop
+        * @param {YAHOO.widget.Overlay} p_oOverlay Object representing an 
+        * Overlay instance.
+        * @param {String} p_oOverlay String representing the id of an 
+        * Overlay instance.
+        */        
+        bringToTop: function (p_oOverlay) {
+
+            var oOverlay = this.find(p_oOverlay),
+                nTopZIndex,
+                oTopOverlay,
+                aOverlays;
+
+            if (oOverlay) {
+
+                aOverlays = this.overlays;
+                aOverlays.sort(this.compareZIndexDesc);
+
+                oTopOverlay = aOverlays[0];
+
+                if (oTopOverlay) {
+                    nTopZIndex = Dom.getStyle(oTopOverlay.element, "zIndex");
+
+                    if (!isNaN(nTopZIndex)) {
+
+                        var bRequiresBump = false;
+
+                        if (oTopOverlay !== oOverlay) {
+                            bRequiresBump = true;
+                        } else if (aOverlays.length > 1) {
+                            var nNextZIndex = Dom.getStyle(aOverlays[1].element, "zIndex");
+                            // Don't rely on DOM order to stack if 2 overlays are at the same zindex.
+                            if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
+                                bRequiresBump = true;
+                            }
+                        }
+
+                        if (bRequiresBump) {
+                            oOverlay.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
+                        }
+                    }
+                    aOverlays.sort(this.compareZIndexDesc);
+                }
+            }
+        },
+
+        /**
+        * Attempts to locate an Overlay by instance or ID.
+        * @method find
+        * @param {Overlay} overlay  An Overlay to locate within the manager
+        * @param {String} overlay  An Overlay id to locate within the manager
+        * @return {Overlay} The requested Overlay, if found, or null if it 
+        * cannot be located.
+        */
+        find: function (overlay) {
+
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+                i = nOverlays - 1;
+
+                if (overlay instanceof Overlay) {
+                    do {
+                        if (aOverlays[i] == overlay) {
+                            return aOverlays[i];
+                        }
+                    }
+                    while(i--);
+
+                } else if (typeof overlay == "string") {
+                    do {
+                        if (aOverlays[i].id == overlay) {
+                            return aOverlays[i];
+                        }
+                    }
+                    while(i--);
+                }
+                return null;
+            }
+        },
+        
+        /**
+        * Used for sorting the manager's Overlays by z-index.
+        * @method compareZIndexDesc
+        * @private
+        * @return {Number} 0, 1, or -1, depending on where the Overlay should 
+        * fall in the stacking order.
+        */
+        compareZIndexDesc: function (o1, o2) {
+
+            var zIndex1 = (o1.cfg) ? o1.cfg.getProperty("zIndex") : null, // Sort invalid (destroyed)
+                zIndex2 = (o2.cfg) ? o2.cfg.getProperty("zIndex") : null; // objects at bottom.
+
+            if (zIndex1 === null && zIndex2 === null) {
+                return 0;
+            } else if (zIndex1 === null){
+                return 1;
+            } else if (zIndex2 === null) {
+                return -1;
+            } else if (zIndex1 > zIndex2) {
+                return -1;
+            } else if (zIndex1 < zIndex2) {
+                return 1;
+            } else {
+                return 0;
+            }
+        },
+        
+        /**
+        * Shows all Overlays in the manager.
+        * @method showAll
+        */
+        showAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+                i = nOverlays - 1;
+                do {
+                    aOverlays[i].show();
+                }
+                while(i--);
+            }
+        },
+
+        /**
+        * Hides all Overlays in the manager.
+        * @method hideAll
+        */
+        hideAll: function () {
+        
+            var aOverlays = this.overlays,
+                nOverlays = aOverlays.length,
+                i;
+
+            if (nOverlays > 0) {
+                i = nOverlays - 1;
+                do {
+                    aOverlays[i].hide();
+                }
+                while(i--);
+            }
+        },
+
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the OverlayManager
+        */
+        toString: function () {
+            return "OverlayManager";
+        }
+    };
+
+}());
+
+(function () {
+
+    /**
+    * Tooltip is an implementation of Overlay that behaves like an OS tooltip, 
+    * displaying when the user mouses over a particular element, and 
+    * disappearing on mouse out.
+    * @namespace YAHOO.widget
+    * @class Tooltip
+    * @extends YAHOO.widget.Overlay
+    * @constructor
+    * @param {String} el The element ID representing the Tooltip <em>OR</em>
+    * @param {HTMLElement} el The element representing the Tooltip
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Overlay. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Tooltip = function (el, userConfig) {
+    
+        YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);
+    
+    };
+
+
+    var Lang = YAHOO.lang,
+        Event = YAHOO.util.Event,
+        Dom = YAHOO.util.Dom,
+        Tooltip = YAHOO.widget.Tooltip,
+    
+        m_oShadowTemplate,
+        
+        /**
+        * Constant representing the Tooltip's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "PREVENT_OVERLAP": { 
+                key: "preventoverlap", 
+                value: true, 
+                validator: Lang.isBoolean, 
+                supercedes: ["x", "y", "xy"] 
+            },
+        
+            "SHOW_DELAY": { 
+                key: "showdelay", 
+                value: 200, 
+                validator: Lang.isNumber 
+            }, 
+        
+            "AUTO_DISMISS_DELAY": { 
+                key: "autodismissdelay", 
+                value: 5000, 
+                validator: Lang.isNumber 
+            }, 
+        
+            "HIDE_DELAY": { 
+                key: "hidedelay", 
+                value: 250, 
+                validator: Lang.isNumber 
+            }, 
+        
+            "TEXT": { 
+                key: "text", 
+                suppressEvent: true 
+            }, 
+        
+            "CONTAINER": { 
+                key: "container"
+            }
+        
+        };
+
+    
+    /**
+    * Constant representing the Tooltip CSS class
+    * @property YAHOO.widget.Tooltip.CSS_TOOLTIP
+    * @static
+    * @final
+    * @type String
+    */
+    Tooltip.CSS_TOOLTIP = "yui-tt";
+
+
+    /* 
+        "hide" event handler that sets a Tooltip instance's "width"
+        configuration property back to its original value before 
+        "setWidthToOffsetWidth" was called.
+    */
+    
+    function restoreOriginalWidth(p_sType, p_aArgs, p_oObject) {
+
+        var sOriginalWidth = p_oObject[0],
+            sNewWidth = p_oObject[1],
+            oConfig = this.cfg,
+            sCurrentWidth = oConfig.getProperty("width");
+
+        if (sCurrentWidth == sNewWidth) {
+            
+            oConfig.setProperty("width", sOriginalWidth);
+        
+        }
+
+        this.unsubscribe("hide", this._onHide, p_oObject);
+    
+    }
+
+    /* 
+        "beforeShow" event handler that sets a Tooltip instance's "width"
+        configuration property to the value of its root HTML 
+        elements's offsetWidth
+    */
+
+    function setWidthToOffsetWidth(p_sType, p_aArgs) {
+
+        var oBody = document.body,
+            oConfig = this.cfg,
+            sOriginalWidth = oConfig.getProperty("width"),
+            sNewWidth,
+            oClone;
+
+        
+        if ((!sOriginalWidth || sOriginalWidth == "auto") && 
+            (oConfig.getProperty("container") != oBody || 
+            oConfig.getProperty("x") >= Dom.getViewportWidth() || 
+            oConfig.getProperty("y") >= Dom.getViewportHeight())) {
+
+            oClone = this.element.cloneNode(true);
+            oClone.style.visibility = "hidden";
+            oClone.style.top = "0px";
+            oClone.style.left = "0px";
+            
+            oBody.appendChild(oClone);
+
+            sNewWidth = (oClone.offsetWidth + "px");
+
+            oBody.removeChild(oClone);
+
+            oClone = null;
+
+            oConfig.setProperty("width", sNewWidth);
+
+            oConfig.refireEvent("xy");
+
+            this.subscribe("hide", restoreOriginalWidth, 
+                [(sOriginalWidth || ""), sNewWidth]);
+        
+        }
+
+    }
+
+    // "onDOMReady" that renders the ToolTip
+
+    function onDOMReady(p_sType, p_aArgs, p_oObject) {
+    
+        this.render(p_oObject);
+    
+    }
+
+
+    //  "init" event handler that automatically renders the Tooltip
+
+    function onInit() {
+
+        Event.onDOMReady(onDOMReady, this.cfg.getProperty("container"), this);
+
+    }
+
+    
+    YAHOO.extend(Tooltip, YAHOO.widget.Overlay, { 
+    
+        /**
+        * The Tooltip initialization method. This method is automatically 
+        * called by the constructor. A Tooltip is automatically rendered by 
+        * the init method, and it also is set to be invisible by default, 
+        * and constrained to viewport by default as well.
+        * @method init
+        * @param {String} el The element ID representing the Tooltip <em>OR</em>
+        * @param {HTMLElement} el The element representing the Tooltip
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Tooltip. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+
+
+            Tooltip.superclass.init.call(this, el);
+
+            this.beforeInitEvent.fire(Tooltip);
+
+            Dom.addClass(this.element, Tooltip.CSS_TOOLTIP);
+
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+
+            this.cfg.queueProperty("visible", false);
+            this.cfg.queueProperty("constraintoviewport", true);
+    
+            this.setBody("");
+
+            this.subscribe("beforeShow", setWidthToOffsetWidth);
+            this.subscribe("init", onInit);
+            this.subscribe("render", this.onRender);
+    
+            this.initEvent.fire(Tooltip);
+
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be 
+        * changed using the Overlay's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+
+            Tooltip.superclass.initDefaultConfig.call(this);
+        
+            /**
+            * Specifies whether the Tooltip should be kept from overlapping 
+            * its context element.
+            * @config preventoverlap
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.PREVENT_OVERLAP.key, {
+                value: DEFAULT_CONFIG.PREVENT_OVERLAP.value, 
+                validator: DEFAULT_CONFIG.PREVENT_OVERLAP.validator, 
+                supercedes: DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes
+            });
+        
+            /**
+            * The number of milliseconds to wait before showing a Tooltip 
+            * on mouseover.
+            * @config showdelay
+            * @type Number
+            * @default 200
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key, {
+                handler: this.configShowDelay,
+                value: 200, 
+                validator: DEFAULT_CONFIG.SHOW_DELAY.validator
+            });
+        
+            /**
+            * The number of milliseconds to wait before automatically 
+            * dismissing a Tooltip after the mouse has been resting on the 
+            * context element.
+            * @config autodismissdelay
+            * @type Number
+            * @default 5000
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.AUTO_DISMISS_DELAY.key, {
+                handler: this.configAutoDismissDelay,
+                value: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,
+                validator: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator
+            });
+        
+            /**
+            * The number of milliseconds to wait before hiding a Tooltip 
+            * on mouseover.
+            * @config hidedelay
+            * @type Number
+            * @default 250
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key, {
+                handler: this.configHideDelay,
+                value: DEFAULT_CONFIG.HIDE_DELAY.value, 
+                validator: DEFAULT_CONFIG.HIDE_DELAY.validator
+            });
+        
+            /**
+            * Specifies the Tooltip's text. 
+            * @config text
+            * @type String
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key, {
+                handler: this.configText,
+                suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent
+            });
+
+            /**
+            * Specifies the container element that the Tooltip's markup 
+            * should be rendered into.
+            * @config container
+            * @type HTMLElement/String
+            * @default document.body
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CONTAINER.key, {
+                handler: this.configContainer,
+                value: document.body
+            });
+        
+            /**
+            * Specifies the element or elements that the Tooltip should be 
+            * anchored to on mouseover.
+            * @config context
+            * @type HTMLElement[]/String[]
+            * @default null
+            */ 
+
+            /**
+            * String representing the width of the Tooltip.  <em>Please note:
+            * </em> As of version 2.3 if either no value or a value of "auto" 
+            * is specified, and the Toolip's "container" configuration property
+            * is set to something other than <code>document.body</code> or 
+            * its "context" element resides outside the immediately visible 
+            * portion of the document, the width of the Tooltip will be 
+            * calculated based on the offsetWidth of its root HTML and set just 
+            * before it is made visible.  The original value will be 
+            * restored when the Tooltip is hidden. This ensures the Tooltip is 
+            * rendered at a usable width.  For more information see 
+            * SourceForge bug #1685496 and SourceForge 
+            * bug #1735423.
+            * @config width
+            * @type String
+            * @default null
+            */
+        
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the "text" property is changed.
+        * @method configText
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configText: function (type, args, obj) {
+            var text = args[0];
+            if (text) {
+                this.setBody(text);
+            }
+        },
+        
+        /**
+        * The default event handler fired when the "container" property 
+        * is changed.
+        * @method configContainer
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For 
+        * configuration handlers, args[0] will equal the newly applied value 
+        * for the property.
+        * @param {Object} obj The scope object. For configuration handlers,
+        * this will usually equal the owner.
+        */
+        configContainer: function (type, args, obj) {
+
+            var container = args[0];
+
+            if (typeof container == 'string') {
+
+                this.cfg.setProperty("container", 
+                    document.getElementById(container), true);
+
+            }
+
+        },
+        
+        /**
+        * @method _removeEventListeners
+        * @description Removes all of the DOM event handlers from the HTML
+        *  element(s) that trigger the display of the tooltip.
+        * @protected
+        */
+        _removeEventListeners: function () {
+        
+            var aElements = this._context,
+                nElements,
+                oElement,
+                i;
+        
+            
+            if (aElements) {
+                nElements = aElements.length;
+                if (nElements > 0) {
+                    i = nElements - 1;
+                    do {
+                        oElement = aElements[i];
+        
+                        Event.removeListener(oElement, "mouseover", 
+                            this.onContextMouseOver);
+
+                        Event.removeListener(oElement, "mousemove", 
+                            this.onContextMouseMove);
+
+                        Event.removeListener(oElement, "mouseout", 
+                            this.onContextMouseOut);
+                    }
+                    while (i--);
+                }
+            }
+        },
+        
+        /**
+        * The default event handler fired when the "context" property 
+        * is changed.
+        * @method configContext
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers,
+        * this will usually equal the owner.
+        */
+        configContext: function (type, args, obj) {
+        
+            var context = args[0],
+                aElements,
+                nElements,
+                oElement,
+                i;
+            
+        
+            if (context) {
+        
+                // Normalize parameter into an array
+                if (! (context instanceof Array)) {
+
+                    if (typeof context == "string") {
+
+                        this.cfg.setProperty("context", 
+                            [document.getElementById(context)], true);
+
+                    } else { // Assuming this is an element
+
+                        this.cfg.setProperty("context", [context], true);
+
+                    }
+
+                    context = this.cfg.getProperty("context");
+
+                }
+        
+        
+                // Remove any existing mouseover/mouseout listeners
+                this._removeEventListeners();
+        
+                // Add mouseover/mouseout listeners to context elements
+                this._context = context;
+        
+                aElements = this._context;
+                
+                if (aElements) {
+            
+                    nElements = aElements.length;
+                    
+                    if (nElements > 0) {
+                    
+                        i = nElements - 1;
+                        
+                        do {
+            
+                            oElement = aElements[i];
+            
+                            Event.on(oElement, "mouseover", 
+                                this.onContextMouseOver, this);
+
+                            Event.on(oElement, "mousemove", 
+                                this.onContextMouseMove, this);
+
+                            Event.on(oElement, "mouseout", 
+                                this.onContextMouseOut, this);
+                        
+                        }
+                        while (i--);
+                    
+                    }
+            
+                }
+        
+            }
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        // BEGIN BUILT-IN DOM EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the user moves the mouse while 
+        * over the context element.
+        * @method onContextMouseMove
+        * @param {DOMEvent} e The current DOM event
+        * @param {Object} obj The object argument
+        */
+        onContextMouseMove: function (e, obj) {
+            obj.pageX = Event.getPageX(e);
+            obj.pageY = Event.getPageY(e);
+        
+        },
+        
+        /**
+        * The default event handler fired when the user mouses over the 
+        * context element.
+        * @method onContextMouseOver
+        * @param {DOMEvent} e The current DOM event
+        * @param {Object} obj The object argument
+        */
+        onContextMouseOver: function (e, obj) {
+        
+            var context = this;
+        
+            if (obj.hideProcId) {
+
+                clearTimeout(obj.hideProcId);
+
+
+                obj.hideProcId = null;
+
+            }
+
+            Event.on(context, "mousemove", obj.onContextMouseMove, obj);
+
+            if (context.title) {
+                obj._tempTitle = context.title;
+                context.title = "";
+            }
+
+            /**
+            * The unique process ID associated with the thread responsible 
+            * for showing the Tooltip.
+            * @type int
+            */
+            obj.showProcId = obj.doShow(e, context);
+
+        },
+        
+        /**
+        * The default event handler fired when the user mouses out of 
+        * the context element.
+        * @method onContextMouseOut
+        * @param {DOMEvent} e The current DOM event
+        * @param {Object} obj The object argument
+        */
+        onContextMouseOut: function (e, obj) {
+            var el = this;
+        
+            if (obj._tempTitle) {
+                el.title = obj._tempTitle;
+                obj._tempTitle = null;
+            }
+        
+            if (obj.showProcId) {
+                clearTimeout(obj.showProcId);
+                obj.showProcId = null;
+            }
+        
+            if (obj.hideProcId) {
+                clearTimeout(obj.hideProcId);
+                obj.hideProcId = null;
+            }
+        
+        
+            obj.hideProcId = setTimeout(function () {
+                obj.hide();
+    
+            }, obj.cfg.getProperty("hidedelay"));
+    
+        },
+        
+        // END BUILT-IN DOM EVENT HANDLERS //
+        
+        /**
+        * Processes the showing of the Tooltip by setting the timeout delay 
+        * and offset of the Tooltip.
+        * @method doShow
+        * @param {DOMEvent} e The current DOM event
+        * @return {Number} The process ID of the timeout function associated 
+        * with doShow
+        */
+        doShow: function (e, context) {
+
+            var yOffset = 25,
+                me = this;
+
+            if (YAHOO.env.ua.opera && context.tagName && 
+                context.tagName.toUpperCase() == "A") {
+
+                yOffset += 12;
+
+            }
+
+            return setTimeout(function () {
+
+                var txt = me.cfg.getProperty("text");
+                // title does not over-ride text
+                if (me._tempTitle && (txt === "" || YAHOO.lang.isUndefined(txt) || YAHOO.lang.isNull(txt))) {
+                    me.setBody(me._tempTitle);
+                } else {
+                    me.cfg.refireEvent("text");
+                }
+
+                me.moveTo(me.pageX, me.pageY + yOffset);
+
+                if (me.cfg.getProperty("preventoverlap")) {
+                    me.preventOverlap(me.pageX, me.pageY);
+                }
+
+                Event.removeListener(context, "mousemove", 
+                    me.onContextMouseMove);
+
+                me.show();
+                me.hideProcId = me.doHide();
+
+
+            }, this.cfg.getProperty("showdelay"));
+        
+        },
+        
+        /**
+        * Sets the timeout for the auto-dismiss delay, which by default is 5 
+        * seconds, meaning that a tooltip will automatically dismiss itself 
+        * after 5 seconds of being displayed.
+        * @method doHide
+        */
+        doHide: function () {
+        
+            var me = this;
+        
+        
+            return setTimeout(function () {
+        
+                me.hide();
+        
+            }, this.cfg.getProperty("autodismissdelay"));
+        
+        },
+        
+        /**
+        * Fired when the Tooltip is moved, this event handler is used to 
+        * prevent the Tooltip from overlapping with its context element.
+        * @method preventOverlay
+        * @param {Number} pageX The x coordinate position of the mouse pointer
+        * @param {Number} pageY The y coordinate position of the mouse pointer
+        */
+        preventOverlap: function (pageX, pageY) {
+        
+            var height = this.element.offsetHeight,
+                mousePoint = new YAHOO.util.Point(pageX, pageY),
+                elementRegion = Dom.getRegion(this.element);
+        
+            elementRegion.top -= 5;
+            elementRegion.left -= 5;
+            elementRegion.right += 5;
+            elementRegion.bottom += 5;
+        
+        
+            if (elementRegion.contains(mousePoint)) {
+                this.cfg.setProperty("y", (pageY - height - 5));
+            }
+        },
 
-/**
-* Constant representing the prefix path to use for securely served images
-* @property YAHOO.widget.Module.IMG_ROOT_SSL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.IMG_ROOT_SSL = null;
 
-/**
-* Constant for the default CSS class name that represents a Module
-* @property YAHOO.widget.Module.CSS_MODULE
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_MODULE = "yui-module";
+        /**
+        * @method onRender
+        * @description "render" event handler for the Tooltip.
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        onRender: function (p_sType, p_aArgs) {
+    
+            function sizeShadow() {
+    
+                var oElement = this.element,
+                    oShadow = this._shadow;
+            
+                if (oShadow) {
+            
+                    oShadow.style.width = (oElement.offsetWidth + 6) + "px";
+                    oShadow.style.height = (oElement.offsetHeight + 1) + "px"; 
+            
+                }
+            
+            }
 
-/**
-* Constant representing the module header
-* @property YAHOO.widget.Module.CSS_HEADER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_HEADER = "hd";
 
-/**
-* Constant representing the module body
-* @property YAHOO.widget.Module.CSS_BODY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_BODY = "bd";
+            function addShadowVisibleClass() {
+            
+                Dom.addClass(this._shadow, "yui-tt-shadow-visible");
+            
+            }
+            
 
-/**
-* Constant representing the module footer
-* @property YAHOO.widget.Module.CSS_FOOTER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.CSS_FOOTER = "ft";
+            function removeShadowVisibleClass() {
+        
+                Dom.removeClass(this._shadow, "yui-tt-shadow-visible");
+            
+            }
+    
+    
+            function createShadow() {
+    
+                var oShadow = this._shadow,
+                    oElement,
+                    Module,
+                    nIE,
+                    me;
+    
+                if (!oShadow) {
+    
+                    oElement = this.element;
+                    Module = YAHOO.widget.Module;
+                    nIE = YAHOO.env.ua.ie;
+                    me = this;
+    
+                    if (!m_oShadowTemplate) {
+        
+                        m_oShadowTemplate = document.createElement("div");
+                        m_oShadowTemplate.className = "yui-tt-shadow";
+                    
+                    }
+        
+                    oShadow = m_oShadowTemplate.cloneNode(false);
+        
+                    oElement.appendChild(oShadow);
+                    
+                    this._shadow = oShadow;
+    
+                    addShadowVisibleClass.call(this);
+        
+                    this.subscribe("beforeShow", addShadowVisibleClass);
+                    this.subscribe("beforeHide", removeShadowVisibleClass);
 
-/**
-* Constant representing the url for the "src" attribute of the iframe used to monitor changes to the browser's base font size
-* @property YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";
+                    if (nIE == 6 || 
+                        (nIE == 7 && document.compatMode == "BackCompat")) {
+                
+                        window.setTimeout(function () { 
+        
+                            sizeShadow.call(me); 
+        
+                        }, 0);
+    
+                        this.cfg.subscribeToConfigEvent("width", sizeShadow);
+                        this.cfg.subscribeToConfigEvent("height", sizeShadow);
+                        this.subscribe("changeContent", sizeShadow);
+    
+                        Module.textResizeEvent.subscribe(sizeShadow, 
+                                                            this, true);
+                        
+                        this.subscribe("destroy", function () {
+                        
+                            Module.textResizeEvent.unsubscribe(sizeShadow, 
+                                                                    this);
+                        
+                        });
+                
+                    }
+                
+                }
+    
+            }
+    
+    
+            function onBeforeShow() {
+            
+                createShadow.call(this);
+    
+                this.unsubscribe("beforeShow", onBeforeShow);
+            
+            }
+    
+    
+            if (this.cfg.getProperty("visible")) {
+    
+                createShadow.call(this);
+            
+            }
+            else {
+    
+                this.subscribe("beforeShow", onBeforeShow);
+            
+            }
+        
+        },
+        
+        /**
+        * Removes the Tooltip element from the DOM and sets all child 
+        * elements to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            // Remove any existing mouseover/mouseout listeners
+            this._removeEventListeners();
+        
+            Tooltip.superclass.destroy.call(this);  
+        
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Tooltip
+        */
+        toString: function () {
+            return "Tooltip " + this.id;
+        }
+    
+    });
 
-/**
-* Singleton CustomEvent fired when the font size is changed in the browser.
-* Opera's "zoom" functionality currently does not support text size detection.
-* @event YAHOO.widget.Module.textResizeEvent
-*/
-YAHOO.widget.Module.textResizeEvent = new YAHOO.util.CustomEvent("textResize");
+}());
 
-/**
-* Constant representing the name of the Module's events
-* @property YAHOO.widget.Module._EVENT_TYPES
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Module._EVENT_TYPES = {
+(function () {
 
-    "BEFORE_INIT": "beforeInit",
-    "INIT": "init",
-    "APPEND": "append",
-    "BEFORE_RENDER": "beforeRender",
-    "RENDER": "render",
-    "CHANGE_HEADER": "changeHeader",
-    "CHANGE_BODY": "changeBody",
-    "CHANGE_FOOTER": "changeFooter",
-    "CHANGE_CONTENT": "changeContent",
-    "DESTORY": "destroy",
-    "BEFORE_SHOW": "beforeShow",
-    "SHOW": "show",
-    "BEFORE_HIDE": "beforeHide",
-    "HIDE": "hide"
-
-};
-    
-/**
-* Constant representing the Module's configuration properties
-* @property YAHOO.widget.Module._DEFAULT_CONFIG
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Module._DEFAULT_CONFIG = {
+    /**
+    * Panel is an implementation of Overlay that behaves like an OS window, 
+    * with a draggable header and an optional close icon at the top right.
+    * @namespace YAHOO.widget
+    * @class Panel
+    * @extends YAHOO.widget.Overlay
+    * @constructor
+    * @param {String} el The element ID representing the Panel <em>OR</em>
+    * @param {HTMLElement} el The element representing the Panel
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Panel. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Panel = function (el, userConfig) {
+        YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);
+    };
+
+    var Lang = YAHOO.lang,
+        DD = YAHOO.util.DD,
+        Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event,
+        Overlay = YAHOO.widget.Overlay,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Config = YAHOO.util.Config,
+        Panel = YAHOO.widget.Panel,
+
+        m_oMaskTemplate,
+        m_oUnderlayTemplate,
+        m_oCloseIconTemplate,
+
+        /**
+        * Constant representing the name of the Panel's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "SHOW_MASK": "showMask",
+            "HIDE_MASK": "hideMask",
+            "DRAG": "drag"
+        
+        },
 
-    "VISIBLE": { 
-        key: "visible", 
-        value: true, 
-        validator: YAHOO.lang.isBoolean 
-    },
-
-    "EFFECT": { 
-        key: "effect", 
-        suppressEvent:true, 
-        supercedes:["visible"] 
-    },
-
-    "MONITOR_RESIZE": { 
-        key: "monitorresize", 
-        value:true  
-    }
+        /**
+        * Constant representing the Panel's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
 
-};
+            "CLOSE": { 
+                key: "close", 
+                value: true, 
+                validator: Lang.isBoolean, 
+                supercedes: ["visible"] 
+            },
+
+            "DRAGGABLE": { 
+                key: "draggable", 
+                value: (DD ? true : false), 
+                validator: Lang.isBoolean, 
+                supercedes: ["visible"]  
+            },
+
+            "DRAG_ONLY" : {
+                key: "dragonly",
+                value: false,
+                validator: Lang.isBoolean,
+                supercedes: ["draggable"]
+            },
+
+            "UNDERLAY": { 
+                key: "underlay", 
+                value: "shadow", 
+                supercedes: ["visible"] 
+            },
+
+            "MODAL": { 
+                key: "modal", 
+                value: false, 
+                validator: Lang.isBoolean, 
+                supercedes: ["visible", "zindex"]
+            },
+
+            "KEY_LISTENERS": {
+                key: "keylisteners",
+                suppressEvent: true,
+                supercedes: ["visible"]
+            }
+        };
 
+    /**
+    * Constant representing the default CSS class used for a Panel
+    * @property YAHOO.widget.Panel.CSS_PANEL
+    * @static
+    * @final
+    * @type String
+    */
+    Panel.CSS_PANEL = "yui-panel";
+    
+    /**
+    * Constant representing the default CSS class used for a Panel's 
+    * wrapping container
+    * @property YAHOO.widget.Panel.CSS_PANEL_CONTAINER
+    * @static
+    * @final
+    * @type String
+    */
+    Panel.CSS_PANEL_CONTAINER = "yui-panel-container";
+
+    // Private CustomEvent listeners
+
+    /* 
+        "beforeRender" event handler that creates an empty header for a Panel 
+        instance if its "draggable" configuration property is set to "true" 
+        and no header has been created.
+    */
+
+    function createHeader(p_sType, p_aArgs) {
+        if (!this.header && this.cfg.getProperty("draggable")) {
+            this.setHeader("&#160;");
+        }
+    }
 
-YAHOO.widget.Module.prototype = {
+    /* 
+        "hide" event handler that sets a Panel instance's "width"
+        configuration property back to its original value before 
+        "setWidthToOffsetWidth" was called.
+    */
+    
+    function restoreOriginalWidth(p_sType, p_aArgs, p_oObject) {
 
-	/**
-	* The class's constructor function
-	* @property contructor
-	* @type Function
-	*/
-	constructor : YAHOO.widget.Module,
-
-	/**
-	* The main module element that contains the header, body, and footer
-	* @property element
-	* @type HTMLElement
-	*/
-	element : null,
-
-	/**
-	* The header element, denoted with CSS class "hd"
-	* @property header
-	* @type HTMLElement
-	*/
-	header : null,
-
-	/**
-	* The body element, denoted with CSS class "bd"
-	* @property body
-	* @type HTMLElement
-	*/
-	body : null,
-
-	/**
-	* The footer element, denoted with CSS class "ft"
-	* @property footer
-	* @type HTMLElement
-	*/
-	footer : null,
-
-	/**
-	* The id of the element
-	* @property id
-	* @type String
-	*/
-	id : null,
-
-	/**
-	* The String representing the image root
-	* @property imageRoot
-	* @type String
-	*/
-	imageRoot : YAHOO.widget.Module.IMG_ROOT,
-
-	/**
-	* Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-	* @method initEvents
-	*/
-	initEvents : function() {
-
-        var EVENT_TYPES = YAHOO.widget.Module._EVENT_TYPES;
-
-		/**
-		* CustomEvent fired prior to class initalization.
-		* @event beforeInitEvent
-		* @param {class} classRef	class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-		*/
-		this.beforeInitEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.BEFORE_INIT, this);
-
-		/**
-		* CustomEvent fired after class initalization.
-		* @event initEvent
-		* @param {class} classRef	class reference of the initializing class, such as this.beforeInitEvent.fire(YAHOO.widget.Module)
-		*/		
-		this.initEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.INIT, this);
-
-		/**
-		* CustomEvent fired when the Module is appended to the DOM
-		* @event appendEvent
-		*/
-		this.appendEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.APPEND, this);
-
-		/**
-		* CustomEvent fired before the Module is rendered
-		* @event beforeRenderEvent
-		*/
-		this.beforeRenderEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.BEFORE_RENDER, this);
-
-		/**
-		* CustomEvent fired after the Module is rendered
-		* @event renderEvent
-		*/
-		this.renderEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.RENDER, this);
-	
-		/**
-		* CustomEvent fired when the header content of the Module is modified
-		* @event changeHeaderEvent
-		* @param {String/HTMLElement} content	String/element representing the new header content
-		*/
-		this.changeHeaderEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.CHANGE_HEADER, this);
-		
-		/**
-		* CustomEvent fired when the body content of the Module is modified
-		* @event changeBodyEvent
-		* @param {String/HTMLElement} content	String/element representing the new body content
-		*/		
-		this.changeBodyEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.CHANGE_BODY, this);
-		
-		/**
-		* CustomEvent fired when the footer content of the Module is modified
-		* @event changeFooterEvent
-		* @param {String/HTMLElement} content	String/element representing the new footer content
-		*/
-		this.changeFooterEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.CHANGE_FOOTER, this);
-
-		/**
-		* CustomEvent fired when the content of the Module is modified
-		* @event changeContentEvent
-		*/
-		this.changeContentEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.CHANGE_CONTENT, this);
-
-		/**
-		* CustomEvent fired when the Module is destroyed
-		* @event destroyEvent
-		*/
-		this.destroyEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.DESTORY, this);
-		
-		/**
-		* CustomEvent fired before the Module is shown
-		* @event beforeShowEvent
-		*/
-		this.beforeShowEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.BEFORE_SHOW, this);
-
-		/**
-		* CustomEvent fired after the Module is shown
-		* @event showEvent
-		*/
-		this.showEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.SHOW, this);
-
-		/**
-		* CustomEvent fired before the Module is hidden
-		* @event beforeHideEvent
-		*/
-		this.beforeHideEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.BEFORE_HIDE, this);
-
-		/**
-		* CustomEvent fired after the Module is hidden
-		* @event hideEvent
-		*/
-		this.hideEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.HIDE, this);
-	}, 
-
-	/**
-	* String representing the current user-agent platform
-	* @property platform
-	* @type String
-	*/
-	platform : function() {
-					var ua = navigator.userAgent.toLowerCase();
-					if (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1) {
-						return "windows";
-					} else if (ua.indexOf("macintosh") != -1) {
-						return "mac";
-					} else {
-						return false;
-					}
-				}(),
-
-	/**
-	* String representing the current user-agent browser
-	* @property browser
-	* @type String
-	*/
-	browser : function() {
-			var ua = navigator.userAgent.toLowerCase();
-				  if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
-					 return 'opera';
-				  } else if (ua.indexOf('msie 7')!=-1) { // IE7
-					 return 'ie7';
-				  } else if (ua.indexOf('msie') !=-1) { // IE
-					 return 'ie';
-				  } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
-					 return 'safari';
-				  } else if (ua.indexOf('gecko') != -1) { // Gecko
-					 return 'gecko';
-				  } else {
-					 return false;
-				  }
-			}(),
-
-	/**
-	* Boolean representing whether or not the current browsing context is secure (https)
-	* @property isSecure
-	* @type Boolean
-	*/
-	isSecure : function() {
-		if (window.location.href.toLowerCase().indexOf("https") === 0) {
-			return true;
-		} else {
-			return false;
-		}
-	}(),
-
-	/**
-	* Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-	*/
-	initDefaultConfig : function() {
-		// Add properties //
-
-    	var DEFAULT_CONFIG = YAHOO.widget.Module._DEFAULT_CONFIG;
-
-		/**
-		* Specifies whether the Module is visible on the page.
-		* @config visible
-		* @type Boolean
-		* @default true
-		*/
-		this.cfg.addProperty(
-		          DEFAULT_CONFIG.VISIBLE.key, 
-		          {
-		              handler: this.configVisible, 
-		              value: DEFAULT_CONFIG.VISIBLE.value, 
-		              validator: DEFAULT_CONFIG.VISIBLE.validator
-                  }
-              );
-
-		/**
-		* Object or array of objects representing the ContainerEffect classes that are active for animating the container.
-		* @config effect
-		* @type Object
-		* @default null
-		*/
-		this.cfg.addProperty(
-                    DEFAULT_CONFIG.EFFECT.key, 
-                    {
-                        suppressEvent: DEFAULT_CONFIG.EFFECT.suppressEvent, 
-                        supercedes: DEFAULT_CONFIG.EFFECT.supercedes
-                    }
-                );
-
-		/**
-		* Specifies whether to create a special proxy iframe to monitor for user font resizing in the document
-		* @config monitorresize
-		* @type Boolean
-		* @default true
-		*/
-		this.cfg.addProperty(
-		          DEFAULT_CONFIG.MONITOR_RESIZE.key,
-		          {
-		              handler: this.configMonitorResize,
-		              value: DEFAULT_CONFIG.MONITOR_RESIZE.value
-                  }
-              );
-		
-	},
-
-	/**
-	* The Module class's initialization method, which is executed for Module and all of its subclasses. This method is automatically called by the constructor, and  sets up all DOM references for pre-existing markup, and creates required markup if it is not already present.
-	* @method init
-	* @param {String}	el	The element ID representing the Module <em>OR</em>
-	* @param {HTMLElement}	el	The element representing the Module
-	* @param {Object}	userConfig	The configuration Object literal containing the configuration that should be set for this module. See configuration documentation for more details.
-	*/
-	init : function(el, userConfig) {
-
-		this.initEvents();
-
-		this.beforeInitEvent.fire(YAHOO.widget.Module);
-
-		/**
-		* The Module's Config object used for monitoring configuration properties.
-		* @property cfg
-		* @type YAHOO.util.Config
-		*/
-		this.cfg = new YAHOO.util.Config(this);
-
-		if (this.isSecure) {
-			this.imageRoot = YAHOO.widget.Module.IMG_ROOT_SSL;
-		}
-
-		if (typeof el == "string") {
-			var elId = el;
-
-			el = document.getElementById(el);
-			if (! el) {
-				el = document.createElement("div");
-				el.id = elId;
-			}
-		}
-
-		this.element = el;
-
-		if (el.id) {
-			this.id = el.id;
-		}
-
-		var childNodes = this.element.childNodes;
-
-		if (childNodes) {
-			for (var i=0;i<childNodes.length;i++) {
-				var child = childNodes[i];
-				switch (child.className) {
-					case YAHOO.widget.Module.CSS_HEADER:
-						this.header = child;
-						break;
-					case YAHOO.widget.Module.CSS_BODY:
-						this.body = child;
-						break;
-					case YAHOO.widget.Module.CSS_FOOTER:
-						this.footer = child;
-						break;
-				}
-			}
-		}
-
-		this.initDefaultConfig();
-
-		YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Module.CSS_MODULE);
-
-		if (userConfig) {
-			this.cfg.applyConfig(userConfig, true);
-		}
-
-		// Subscribe to the fireQueue() method of Config so that any queued configuration changes are
-		// excecuted upon render of the Module
-		if (! YAHOO.util.Config.alreadySubscribed(this.renderEvent, this.cfg.fireQueue, this.cfg)) {
-			this.renderEvent.subscribe(this.cfg.fireQueue, this.cfg, true);
-		}
-
-		this.initEvent.fire(YAHOO.widget.Module);
-	},
-
-	/**
-	* Initialized an empty IFRAME that is placed out of the visible area that can be used to detect text resize.
-	* @method initResizeMonitor
-	*/
-	initResizeMonitor : function() {
-
-        if(this.browser != "opera") {
-
-            var resizeMonitor = document.getElementById("_yuiResizeMonitor");
-
-            if (! resizeMonitor) {
-
-                resizeMonitor = document.createElement("iframe");
-
-                var bIE = (this.browser.indexOf("ie") === 0);
-
-                if(this.isSecure && YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL && bIE) {
-                   resizeMonitor.src = YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;
-                }
-
-                resizeMonitor.id = "_yuiResizeMonitor";
-                resizeMonitor.style.visibility = "hidden";
-
-                document.body.appendChild(resizeMonitor);
-
-                resizeMonitor.style.width = "10em";
-                resizeMonitor.style.height = "10em";
-                resizeMonitor.style.position = "absolute";
-
-                var nLeft = -1 * resizeMonitor.offsetWidth;
-                var nTop = -1 * resizeMonitor.offsetHeight;
-
-                resizeMonitor.style.top = nTop + "px";
-                resizeMonitor.style.left = nLeft + "px";
-                resizeMonitor.style.borderStyle = "none";
-                resizeMonitor.style.borderWidth = "0";
-                YAHOO.util.Dom.setStyle(resizeMonitor, "opacity", "0");
-
-                resizeMonitor.style.visibility = "visible";
-
-                if(!bIE) {
-
-                    var doc = resizeMonitor.contentWindow.document;
-
-                    doc.open();
-                    doc.close();
-
-                }
-            }
-
-			var fireTextResize = function() {
-				YAHOO.widget.Module.textResizeEvent.fire();
-			};
-
-            if(resizeMonitor && resizeMonitor.contentWindow) {
-                this.resizeMonitor = resizeMonitor;
-
-				YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize, this, true);
-
-				if (! YAHOO.widget.Module.textResizeInitialized) {
-					if (! YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", fireTextResize)) {
-						// This will fail in IE if document.domain has changed, so we must change the listener to
-						// use the resizeMonitor element instead
-						YAHOO.util.Event.addListener(this.resizeMonitor, "resize", fireTextResize);
-					}
-					YAHOO.widget.Module.textResizeInitialized = true;
-				}
-            }
+        var sOriginalWidth = p_oObject[0],
+            sNewWidth = p_oObject[1],
+            oConfig = this.cfg,
+            sCurrentWidth = oConfig.getProperty("width");
 
+        if (sCurrentWidth == sNewWidth) {
+            oConfig.setProperty("width", sOriginalWidth);
         }
 
-	},
+        this.unsubscribe("hide", restoreOriginalWidth, p_oObject);
+    }
 
-	/**
-	* Event handler fired when the resize monitor element is resized.
-	* @method onDomResize
-	* @param {DOMEvent} e	The DOM resize event
-	* @param {Object} obj	The scope object passed to the handler
-	*/
-	onDomResize : function(e, obj) {
-
-        var nLeft = -1 * this.resizeMonitor.offsetWidth,
-            nTop = -1 * this.resizeMonitor.offsetHeight;
-
-        this.resizeMonitor.style.top = nTop + "px";
-        this.resizeMonitor.style.left =  nLeft + "px";
-
-	},
-
-	/**
-	* Sets the Module's header content to the HTML specified, or appends the passed element to the header. If no header is present, one will be automatically created.
-	* @method setHeader
-	* @param {String}	headerContent	The HTML used to set the header <em>OR</em>
-	* @param {HTMLElement}	headerContent	The HTMLElement to append to the header
-	*/
-	setHeader : function(headerContent) {
-		if (! this.header) {
-			this.header = document.createElement("div");
-			this.header.className = YAHOO.widget.Module.CSS_HEADER;
-		}
-
-		if (typeof headerContent == "string") {
-			this.header.innerHTML = headerContent;
-		} else {
-			this.header.innerHTML = "";
-			this.header.appendChild(headerContent);
-		}
-
-		this.changeHeaderEvent.fire(headerContent);
-		this.changeContentEvent.fire();
-	},
-
-	/**
-	* Appends the passed element to the header. If no header is present, one will be automatically created.
-	* @method appendToHeader
-	* @param {HTMLElement}	element	The element to append to the header
-	*/
-	appendToHeader : function(element) {
-		if (! this.header) {
-			this.header = document.createElement("div");
-			this.header.className = YAHOO.widget.Module.CSS_HEADER;
-		}
-
-		this.header.appendChild(element);
-		this.changeHeaderEvent.fire(element);
-		this.changeContentEvent.fire();
-	},
-
-	/**
-	* Sets the Module's body content to the HTML specified, or appends the passed element to the body. If no body is present, one will be automatically created.
-	* @method setBody
-	* @param {String}	bodyContent	The HTML used to set the body <em>OR</em>
-	* @param {HTMLElement}	bodyContent	The HTMLElement to append to the body
-	*/
-	setBody : function(bodyContent) {
-		if (! this.body) {
-			this.body = document.createElement("div");
-			this.body.className = YAHOO.widget.Module.CSS_BODY;
-		}
-
-		if (typeof bodyContent == "string")
-		{
-			this.body.innerHTML = bodyContent;
-		} else {
-			this.body.innerHTML = "";
-			this.body.appendChild(bodyContent);
-		}
-
-		this.changeBodyEvent.fire(bodyContent);
-		this.changeContentEvent.fire();
-	},
-
-	/**
-	* Appends the passed element to the body. If no body is present, one will be automatically created.
-	* @method appendToBody
-	* @param {HTMLElement}	element	The element to append to the body
-	*/
-	appendToBody : function(element) {
-		if (! this.body) {
-			this.body = document.createElement("div");
-			this.body.className = YAHOO.widget.Module.CSS_BODY;
-		}
-
-		this.body.appendChild(element);
-		this.changeBodyEvent.fire(element);
-		this.changeContentEvent.fire();
-	},
-
-	/**
-	* Sets the Module's footer content to the HTML specified, or appends the passed element to the footer. If no footer is present, one will be automatically created.
-	* @method setFooter
-	* @param {String}	footerContent	The HTML used to set the footer <em>OR</em>
-	* @param {HTMLElement}	footerContent	The HTMLElement to append to the footer
-	*/
-	setFooter : function(footerContent) {
-		if (! this.footer) {
-			this.footer = document.createElement("div");
-			this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-		}
-
-		if (typeof footerContent == "string") {
-			this.footer.innerHTML = footerContent;
-		} else {
-			this.footer.innerHTML = "";
-			this.footer.appendChild(footerContent);
-		}
-
-		this.changeFooterEvent.fire(footerContent);
-		this.changeContentEvent.fire();
-	},
-
-	/**
-	* Appends the passed element to the footer. If no footer is present, one will be automatically created.
-	* @method appendToFooter
-	* @param {HTMLElement}	element	The element to append to the footer
-	*/
-	appendToFooter : function(element) {
-		if (! this.footer) {
-			this.footer = document.createElement("div");
-			this.footer.className = YAHOO.widget.Module.CSS_FOOTER;
-		}
-
-		this.footer.appendChild(element);
-		this.changeFooterEvent.fire(element);
-		this.changeContentEvent.fire();
-	},
-
-	/**
-	* Renders the Module by inserting the elements that are not already in the main Module into their correct places. Optionally appends the Module to the specified node prior to the render's execution. NOTE: For Modules without existing markup, the appendToNode argument is REQUIRED. If this argument is ommitted and the current element is not present in the document, the function will return false, indicating that the render was a failure.
-	* @method render
-	* @param {String}	appendToNode	The element id to which the Module should be appended to prior to rendering <em>OR</em>
-	* @param {HTMLElement}	appendToNode	The element to which the Module should be appended to prior to rendering
-	* @param {HTMLElement}	moduleElement	OPTIONAL. The element that represents the actual Standard Module container.
-	* @return {Boolean} Success or failure of the render
-	*/
-	render : function(appendToNode, moduleElement) {
-		this.beforeRenderEvent.fire();
-
-		if (! moduleElement) {
-			moduleElement = this.element;
-		}
-
-		var me = this;
-		var appendTo = function(element) {
-			if (typeof element == "string") {
-				element = document.getElementById(element);
-			}
-
-			if (element) {
-				element.appendChild(me.element);
-				me.appendEvent.fire();
-			}
-		};
-
-		if (appendToNode) {
-			appendTo(appendToNode);
-		} else { // No node was passed in. If the element is not pre-marked up, this fails
-			if (! YAHOO.util.Dom.inDocument(this.element)) {
-				return false;
-			}
-		}
-
-		// Need to get everything into the DOM if it isn't already
-
-		if (this.header && ! YAHOO.util.Dom.inDocument(this.header)) {
-			// There is a header, but it's not in the DOM yet... need to add it
-			var firstChild = moduleElement.firstChild;
-			if (firstChild) { // Insert before first child if exists
-				moduleElement.insertBefore(this.header, firstChild);
-			} else { // Append to empty body because there are no children
-				moduleElement.appendChild(this.header);
-			}
-		}
-
-		if (this.body && ! YAHOO.util.Dom.inDocument(this.body)) {
-			// There is a body, but it's not in the DOM yet... need to add it
-			if (this.footer && YAHOO.util.Dom.isAncestor(this.moduleElement, this.footer)) { // Insert before footer if exists in DOM
-				moduleElement.insertBefore(this.body, this.footer);
-			} else { // Append to element because there is no footer
-				moduleElement.appendChild(this.body);
-			}
-		}
-
-		if (this.footer && ! YAHOO.util.Dom.inDocument(this.footer)) {
-			// There is a footer, but it's not in the DOM yet... need to add it
-			moduleElement.appendChild(this.footer);
-		}
-
-		this.renderEvent.fire();
-		return true;
-	},
-
-	/**
-	* Removes the Module element from the DOM and sets all child elements to null.
-	* @method destroy
-	*/
-	destroy : function() {
-		var parent;
-
-		if (this.element) {
-			YAHOO.util.Event.purgeElement(this.element, true);
-			parent = this.element.parentNode;
-		}
-		if (parent) {
-			parent.removeChild(this.element);
-		}
-
-		this.element = null;
-		this.header = null;
-		this.body = null;
-		this.footer = null;
-
-		for (var e in this) {
-			if (e instanceof YAHOO.util.CustomEvent) {
-				e.unsubscribeAll();
-			}
-		}
-
-		YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this);
-
-		this.destroyEvent.fire();
-	},
-
-	/**
-	* Shows the Module element by setting the visible configuration property to true. Also fires two events: beforeShowEvent prior to the visibility change, and showEvent after.
-	* @method show
-	*/
-	show : function() {
-		this.cfg.setProperty("visible", true);
-	},
-
-	/**
-	* Hides the Module element by setting the visible configuration property to false. Also fires two events: beforeHideEvent prior to the visibility change, and hideEvent after.
-	* @method hide
-	*/
-	hide : function() {
-		this.cfg.setProperty("visible", false);
-	},
-
-	// BUILT-IN EVENT HANDLERS FOR MODULE //
-
-	/**
-	* Default event handler for changing the visibility property of a Module. By default, this is achieved by switching the "display" style between "block" and "none".
-	* This method is responsible for firing showEvent and hideEvent.
-	* @param {String} type	The CustomEvent type (usually the property name)
-	* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-	* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-	* @method configVisible
-	*/
-	configVisible : function(type, args, obj) {
-		var visible = args[0];
-		if (visible) {
-			this.beforeShowEvent.fire();
-			YAHOO.util.Dom.setStyle(this.element, "display", "block");
-			this.showEvent.fire();
-		} else {
-			this.beforeHideEvent.fire();
-			YAHOO.util.Dom.setStyle(this.element, "display", "none");
-			this.hideEvent.fire();
-		}
-	},
-
-	/**
-	* Default event handler for the "monitorresize" configuration property
-	* @param {String} type	The CustomEvent type (usually the property name)
-	* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-	* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-	* @method configMonitorResize
-	*/
-	configMonitorResize : function(type, args, obj) {
-		var monitor = args[0];
-		if (monitor) {
-			this.initResizeMonitor();
-		} else {
-			YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this, true);
-			this.resizeMonitor = null;
-		}
-	}
-};
-
-/**
-* Returns a String representation of the Object.
-* @method toString
-* @return {String}	The string representation of the Module
-*/
-YAHOO.widget.Module.prototype.toString = function() {
-	return "Module " + this.id;
-};
-/**
-* Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.
-* @namespace YAHOO.widget
-* @class Overlay
-* @extends YAHOO.widget.Module
-* @param {String}	el	The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement}	el	The element representing the Overlay
-* @param {Object}	userConfig	The configuration object literal containing 10/23/2006the configuration that should be set for this Overlay. See configuration documentation for more details.
-* @constructor
-*/
-YAHOO.widget.Overlay = function(el, userConfig) {
-	YAHOO.widget.Overlay.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Overlay, YAHOO.widget.Module);
-
-/**
-* Constant representing the name of the Overlay's events
-* @property YAHOO.widget.Overlay._EVENT_TYPES
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Overlay._EVENT_TYPES = {
+    /* 
+        "beforeShow" event handler that sets a Panel instance's "width"
+        configuration property to the value of its root HTML 
+        elements's offsetWidth
+    */
+
+    function setWidthToOffsetWidth(p_sType, p_aArgs) {
+
+        var nIE = YAHOO.env.ua.ie,
+            oConfig,
+            sOriginalWidth,
+            sNewWidth;
 
-    "BEFORE_MOVE": "beforeMove",
-    "MOVE": "move"
+        if (nIE == 6 || (nIE == 7 && document.compatMode == "BackCompat")) {
 
-};
+            oConfig = this.cfg;
+            sOriginalWidth = oConfig.getProperty("width");
+            
+            if (!sOriginalWidth || sOriginalWidth == "auto") {
+    
+                sNewWidth = (this.element.offsetWidth + "px");
+    
+                oConfig.setProperty("width", sNewWidth);
+                
+                this.subscribe("hide", restoreOriginalWidth, 
+                    [(sOriginalWidth || ""), sNewWidth]);
+            
+            }
+        }
+    }
 
-/**
-* Constant representing the Overlay's configuration properties
-* @property YAHOO.widget.Overlay._DEFAULT_CONFIG
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Overlay._DEFAULT_CONFIG = {
+    /* 
+        "focus" event handler for a focuable element.  Used to automatically 
+        blur the element when it receives focus to ensure that a Panel 
+        instance's modality is not compromised.
+    */
 
-    "X": { 
-        key: "x", 
-        validator:YAHOO.lang.isNumber, 
-        suppressEvent:true, supercedes:["iframe"] 
-    },
-
-    "Y": { 
-        key: "y", 
-        validator:YAHOO.lang.isNumber, 
-        suppressEvent:true, supercedes:["iframe"] 
-    },
-
-    "XY": { 
-        key: "xy", 
-        suppressEvent:true, 
-        supercedes:["iframe"] 
-    },
-
-    "CONTEXT": { 
-        key: "context", 
-        suppressEvent:true, 
-        supercedes:["iframe"] 
-    },
-
-    "FIXED_CENTER": { 
-        key: "fixedcenter", 
-        value:false, 
-        validator:YAHOO.lang.isBoolean, 
-        supercedes:["iframe","visible"] 
-    },
-
-    "WIDTH": { 
-        key: "width", 
-        suppressEvent:true, 
-        supercedes:["iframe"] 
-    }, 
-
-    "HEIGHT": { 
-        key: "height", 
-        suppressEvent:true, 
-        supercedes:["iframe"] 
-    }, 
-
-    "ZINDEX": { 
-        key: "zindex", 
-        value:null 
-    }, 
-
-    "CONSTRAIN_TO_VIEWPORT": { 
-        key: "constraintoviewport", 
-        value:false, 
-        validator:YAHOO.lang.isBoolean, 
-        supercedes:["iframe","x","y","xy"] 
-    }, 
-
-    "IFRAME": { 
-        key: "iframe", 
-        value:(YAHOO.widget.Module.prototype.browser == "ie" ? true : false), 
-        validator:YAHOO.lang.isBoolean, 
-        supercedes:["zIndex"] 
+    function onElementFocus() {
+        this.blur();
     }
 
-};
+    /* 
+        "showMask" event handler that adds a "focus" event handler to all
+        focusable elements in the document to enforce a Panel instance's 
+        modality from being compromised.
+    */
 
-/**
-* The URL that will be placed in the iframe
-* @property YAHOO.widget.Overlay.IFRAME_SRC
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;";
+    function addFocusEventHandlers(p_sType, p_aArgs) {
 
-/**
-* Constant representing the top left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_LEFT = "tl";
+        var me = this;
 
-/**
-* Constant representing the top right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.TOP_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.TOP_RIGHT = "tr";
+        function isFocusable(el) {
 
-/**
-* Constant representing the top bottom left corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_LEFT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_LEFT = "bl";
+            var sTagName = el.tagName.toUpperCase(),
+                bFocusable = false;
+            
+            switch (sTagName) {
+            
+            case "A":
+            case "BUTTON":
+            case "SELECT":
+            case "TEXTAREA":
+
+                if (!Dom.isAncestor(me.element, el)) {
+                    Event.on(el, "focus", onElementFocus, el, true);
+                    bFocusable = true;
+                }
 
-/**
-* Constant representing the bottom right corner of an element, used for configuring the context element alignment
-* @property YAHOO.widget.Overlay.BOTTOM_RIGHT
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.BOTTOM_RIGHT = "br";
+                break;
 
-/**
-* Constant representing the default CSS class used for an Overlay
-* @property YAHOO.widget.Overlay.CSS_OVERLAY
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Overlay.CSS_OVERLAY = "yui-overlay";
+            case "INPUT":
 
-/**
-* The Overlay initialization method, which is executed for Overlay and all of its subclasses. This method is automatically called by the constructor, and  sets up all DOM references for pre-existing markup, and creates required markup if it is not already present.
-* @method init
-* @param {String}	el	The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement}	el	The element representing the Overlay
-* @param {Object}	userConfig	The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Overlay.prototype.init = function(el, userConfig) {
-	YAHOO.widget.Overlay.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level
+                if (el.type != "hidden" && 
+                    !Dom.isAncestor(me.element, el)) {
+
+                    Event.on(el, "focus", onElementFocus, el, true);
+                    bFocusable = true;
 
-	this.beforeInitEvent.fire(YAHOO.widget.Overlay);
+                }
+
+                break;
+            
+            }
 
-	YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Overlay.CSS_OVERLAY);
+            return bFocusable;
 
-	if (userConfig) {
-		this.cfg.applyConfig(userConfig, true);
-	}
+        }
 
-	if (this.platform == "mac" && this.browser == "gecko") {
-		if (! YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)) {
-			this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);
-		}
-		if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)) {
-			this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);
-		}
-	}
+        this.focusableElements = Dom.getElementsBy(isFocusable);
+    
+    }
 
-	this.initEvent.fire(YAHOO.widget.Overlay);
+    /* 
+        "hideMask" event handler that removes all "focus" event handlers added 
+        by the "addFocusEventHandlers" method.
+    */
+    
+    function removeFocusEventHandlers(p_sType, p_aArgs) {
 
-};
+        var aElements = this.focusableElements,
+            nElements = aElements.length,
+            el2,
+            i;
+
+        for (i = 0; i < nElements; i++) {
+            el2 = aElements[i];
+            Event.removeListener(el2, "focus", onElementFocus);
+        }
 
-/**
-* Initializes the custom events for Overlay which are fired automatically at appropriate times by the Overlay class.
-* @method initEvents
-*/
-YAHOO.widget.Overlay.prototype.initEvents = function() {
-	YAHOO.widget.Overlay.superclass.initEvents.call(this);
+    }
 
-    var EVENT_TYPES = YAHOO.widget.Overlay._EVENT_TYPES;
+    YAHOO.extend(Panel, Overlay, {
 
-	/**
-	* CustomEvent fired before the Overlay is moved.
-	* @event beforeMoveEvent
-	* @param {Number} x	x coordinate
-	* @param {Number} y	y coordinate
-	*/
-	this.beforeMoveEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.BEFORE_MOVE, this);
-
-	/**
-	* CustomEvent fired after the Overlay is moved.
-	* @event moveEvent
-	* @param {Number} x	x coordinate
-	* @param {Number} y	y coordinate
-	*/
-	this.moveEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.MOVE, this);
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Overlay.prototype.initDefaultConfig = function() {
-	YAHOO.widget.Overlay.superclass.initDefaultConfig.call(this);
+        /**
+        * The Overlay initialization method, which is executed for Overlay and 
+        * all of its subclasses. This method is automatically called by the 
+        * constructor, and  sets up all DOM references for pre-existing markup, 
+        * and creates required markup if it is not already present.
+        * @method init
+        * @param {String} el The element ID representing the Overlay <em>OR</em>
+        * @param {HTMLElement} el The element representing the Overlay
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Overlay. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
+    
+            /*
+                 Note that we don't pass the user config in here yet because 
+                 we only want it executed once, at the lowest subclass level
+            */
 
+            Panel.superclass.init.call(this, el/*, userConfig*/);  
 
-	// Add overlay config properties //
+            this.beforeInitEvent.fire(Panel);
 
-    var DEFAULT_CONFIG = YAHOO.widget.Overlay._DEFAULT_CONFIG;
+            Dom.addClass(this.element, Panel.CSS_PANEL);
 
-	/**
-	* The absolute x-coordinate position of the Overlay
-	* @config x
-	* @type Number
-	* @default null
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.X.key, 
-	           { 
-	               handler: this.configX, 
-	               validator: DEFAULT_CONFIG.X.validator, 
-	               suppressEvent: DEFAULT_CONFIG.X.suppressEvent, 
-	               supercedes: DEFAULT_CONFIG.X.supercedes
-               }
-           );
-
-	/**
-	* The absolute y-coordinate position of the Overlay
-	* @config y
-	* @type Number
-	* @default null
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.Y.key,
-	           {
-	               handler: this.configY, 
-	               validator: DEFAULT_CONFIG.Y.validator, 
-	               suppressEvent: DEFAULT_CONFIG.Y.suppressEvent, 
-	               supercedes: DEFAULT_CONFIG.Y.supercedes
-               }
-           );
-
-	/**
-	* An array with the absolute x and y positions of the Overlay
-	* @config xy
-	* @type Number[]
-	* @default null
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.XY.key,
-	           {
-	               handler: this.configXY, 
-	               suppressEvent: DEFAULT_CONFIG.XY.suppressEvent, 
-	               supercedes: DEFAULT_CONFIG.XY.supercedes
-               }
-           );
-
-	/**
-	* The array of context arguments for context-sensitive positioning. The format is: [id or element, element corner, context corner]. For example, setting this property to ["img1", "tl", "bl"] would align the Overlay's top left corner to the context element's bottom left corner.
-	* @config context
-	* @type Array
-	* @default null
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.CONTEXT.key,
-	           {
-	               handler: this.configContext, 
-	               suppressEvent: DEFAULT_CONFIG.CONTEXT.suppressEvent, 
-	               supercedes: DEFAULT_CONFIG.CONTEXT.supercedes
-               }
-           );
-
-	/**
-	* True if the Overlay should be anchored to the center of the viewport.
-	* @config fixedcenter
-	* @type Boolean
-	* @default false
-	*/
-	this.cfg.addProperty(
-               DEFAULT_CONFIG.FIXED_CENTER.key, 
-               {
-                    handler: this.configFixedCenter,
-                    value: DEFAULT_CONFIG.FIXED_CENTER.value, 
-                    validator: DEFAULT_CONFIG.FIXED_CENTER.validator, 
-                    supercedes: DEFAULT_CONFIG.FIXED_CENTER.supercedes
-                }
-            );
-
-	/**
-	* CSS width of the Overlay.
-	* @config width
-	* @type String
-	* @default null
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.WIDTH.key,
-	           {
-	               handler: this.configWidth, 
-	               suppressEvent: DEFAULT_CONFIG.WIDTH.suppressEvent, 
-	               supercedes: DEFAULT_CONFIG.WIDTH.supercedes
-               }
-           );
-
-	/**
-	* CSS height of the Overlay.
-	* @config height
-	* @type String
-	* @default null
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.HEIGHT.key, 
-	           {
-	               handler: this.configHeight, 
-	               suppressEvent: DEFAULT_CONFIG.HEIGHT.suppressEvent, 
-	               supercedes: DEFAULT_CONFIG.HEIGHT.supercedes
-               }
-           );
-
-	/**
-	* CSS z-index of the Overlay.
-	* @config zIndex
-	* @type Number
-	* @default null
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.ZINDEX.key, 
-	           {
-	               handler: this.configzIndex,
-	               value: DEFAULT_CONFIG.ZINDEX.value
-               }
-           );
-
-	/**
-	* True if the Overlay should be prevented from being positioned out of the viewport.
-	* @config constraintoviewport
-	* @type Boolean
-	* @default false
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key, 
-	           {
-	               handler: this.configConstrainToViewport, 
-	               value: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value, 
-	               validator: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator, 
-	               supercedes: DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes
-               }
-           );
-
-	/**
-	* True if the Overlay should have an IFRAME shim (for correcting the select z-index bug in IE6 and below).
-	* @config iframe
-	* @type Boolean
-	* @default true for IE6 and below, false for all others
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.IFRAME.key, 
-	           {
-	               handler: this.configIframe, 
-	               value: DEFAULT_CONFIG.IFRAME.value, 
-	               validator: DEFAULT_CONFIG.IFRAME.validator, 
-	               supercedes: DEFAULT_CONFIG.IFRAME.supercedes
-	           }
-           );
-
-};
-
-/**
-* Moves the Overlay to the specified position. This function is identical to calling this.cfg.setProperty("xy", [x,y]);
-* @method moveTo
-* @param {Number}	x	The Overlay's new x position
-* @param {Number}	y	The Overlay's new y position
-*/
-YAHOO.widget.Overlay.prototype.moveTo = function(x, y) {
-	this.cfg.setProperty("xy",[x,y]);
-};
-
-/**
-* Adds a special CSS class to the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method hideMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.hideMacGeckoScrollbars = function() {
-	YAHOO.util.Dom.removeClass(this.element, "show-scrollbars");
-	YAHOO.util.Dom.addClass(this.element, "hide-scrollbars");
-};
-
-/**
-* Removes a special CSS class from the Overlay when Mac/Gecko is in use, to work around a Gecko bug where
-* scrollbars cannot be hidden. See https://bugzilla.mozilla.org/show_bug.cgi?id=187435
-* @method showMacGeckoScrollbars
-*/
-YAHOO.widget.Overlay.prototype.showMacGeckoScrollbars = function() {
-	YAHOO.util.Dom.removeClass(this.element, "hide-scrollbars");
-	YAHOO.util.Dom.addClass(this.element, "show-scrollbars");
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "visible" property is changed. This method is responsible for firing showEvent and hideEvent.
-* @method configVisible
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configVisible = function(type, args, obj) {
-	var visible = args[0];
-	var currentVis = YAHOO.util.Dom.getStyle(this.element, "visibility");
-
-	if (currentVis == "inherit") {
-		var e = this.element.parentNode;
-		while (e.nodeType != 9 && e.nodeType != 11) {
-			currentVis = YAHOO.util.Dom.getStyle(e, "visibility");
-			if (currentVis != "inherit") { break; }
-			e = e.parentNode;
-		}
-		if (currentVis == "inherit") {
-			currentVis = "visible";
-		}
-	}
-
-	var effect = this.cfg.getProperty("effect");
-
-	var effectInstances = [];
-	if (effect) {
-		if (effect instanceof Array) {
-			for (var i=0;i<effect.length;i++) {
-				var eff = effect[i];
-				effectInstances[effectInstances.length] = eff.effect(this, eff.duration);
-			}
-		} else {
-			effectInstances[effectInstances.length] = effect.effect(this, effect.duration);
-		}
-	}
-
-	var isMacGecko = (this.platform == "mac" && this.browser == "gecko");
-
-	if (visible) { // Show
-		if (isMacGecko) {
-			this.showMacGeckoScrollbars();
-		}
-
-		if (effect) { // Animate in
-			if (visible) { // Animate in if not showing
-				if (currentVis != "visible" || currentVis === "") {
-					this.beforeShowEvent.fire();
-					for (var j=0;j<effectInstances.length;j++) {
-						var ei = effectInstances[j];
-						if (j === 0 && ! YAHOO.util.Config.alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)) {
-							ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true); // Delegate showEvent until end of animateInComplete
-						}
-						ei.animateIn();
-					}
-				}
-			}
-		} else { // Show
-			if (currentVis != "visible" || currentVis === "") {
-				this.beforeShowEvent.fire();
-				YAHOO.util.Dom.setStyle(this.element, "visibility", "visible");
-				this.cfg.refireEvent("iframe");
-				this.showEvent.fire();
-			}
-		}
-
-	} else { // Hide
-		if (isMacGecko) {
-			this.hideMacGeckoScrollbars();
-		}
-
-		if (effect) { // Animate out if showing
-			if (currentVis == "visible") {
-				this.beforeHideEvent.fire();
-				for (var k=0;k<effectInstances.length;k++) {
-					var h = effectInstances[k];
-					if (k === 0 && ! YAHOO.util.Config.alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)) {
-						h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true); // Delegate hideEvent until end of animateOutComplete
-					}
-					h.animateOut();
-				}
-			} else if (currentVis === "") {
-				YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-			}
-		} else { // Simple hide
-			if (currentVis == "visible" || currentVis === "") {
-				this.beforeHideEvent.fire();
-				YAHOO.util.Dom.setStyle(this.element, "visibility", "hidden");
-				this.cfg.refireEvent("iframe");
-				this.hideEvent.fire();
-			}
-		}
-	}
-};
-
-/**
-* Center event handler used for centering on scroll/resize, but only if the Overlay is visible
-* @method doCenterOnDOMEvent
-*/
-YAHOO.widget.Overlay.prototype.doCenterOnDOMEvent = function() {
-	if (this.cfg.getProperty("visible")) {
-		this.center();
-	}
-};
-
-/**
-* The default event handler fired when the "fixedcenter" property is changed.
-* @method configFixedCenter
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configFixedCenter = function(type, args, obj) {
-	var val = args[0];
+            this.buildWrapper();
 
-	if (val) {
-		this.center();
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
 
-		if (! YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent, this.center, this)) {
-			this.beforeShowEvent.subscribe(this.center, this, true);
-		}
-
-		if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent, this.doCenterOnDOMEvent, this)) {
-			YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.doCenterOnDOMEvent, this, true);
-		}
-
-		if (! YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowScrollEvent, this.doCenterOnDOMEvent, this)) {
-			YAHOO.widget.Overlay.windowScrollEvent.subscribe( this.doCenterOnDOMEvent, this, true);
-		}
-	} else {
-		YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-		YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-	}
-};
-
-/**
-* The default event handler fired when the "height" property is changed.
-* @method configHeight
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configHeight = function(type, args, obj) {
-	var height = args[0];
-	var el = this.element;
-	YAHOO.util.Dom.setStyle(el, "height", height);
-	this.cfg.refireEvent("iframe");
-};
-
-/**
-* The default event handler fired when the "width" property is changed.
-* @method configWidth
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configWidth = function(type, args, obj) {
-	var width = args[0];
-	var el = this.element;
-	YAHOO.util.Dom.setStyle(el, "width", width);
-	this.cfg.refireEvent("iframe");
-};
-
-/**
-* The default event handler fired when the "zIndex" property is changed.
-* @method configzIndex
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configzIndex = function(type, args, obj) {
-	var zIndex = args[0];
+            this.subscribe("showMask", addFocusEventHandlers);
+            this.subscribe("hideMask", removeFocusEventHandlers);
+            this.subscribe("beforeRender", createHeader);
 
-	var el = this.element;
+            this.initEvent.fire(Panel);
+        },
+        
+        /**
+        * Initializes the custom events for Module which are fired 
+        * automatically at appropriate times by the Module class.
+        */
+        initEvents: function () {
+            Panel.superclass.initEvents.call(this);
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired after the modality mask is shown
+            * @event showMaskEvent
+            */
+            this.showMaskEvent = this.createEvent(EVENT_TYPES.SHOW_MASK);
+            this.showMaskEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after the modality mask is hidden
+            * @event hideMaskEvent
+            */
+            this.hideMaskEvent = this.createEvent(EVENT_TYPES.HIDE_MASK);
+            this.hideMaskEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent when the Panel is dragged
+            * @event dragEvent
+            */
+            this.dragEvent = this.createEvent(EVENT_TYPES.DRAG);
+            this.dragEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Panel's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+            Panel.superclass.initDefaultConfig.call(this);
+        
+            // Add panel config properties //
+        
+            /**
+            * True if the Panel should display a "close" button
+            * @config close
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.CLOSE.key, { 
+                handler: this.configClose, 
+                value: DEFAULT_CONFIG.CLOSE.value, 
+                validator: DEFAULT_CONFIG.CLOSE.validator, 
+                supercedes: DEFAULT_CONFIG.CLOSE.supercedes 
+            });
+        
+            /**
+            * Boolean specifying if the Panel should be draggable.  The default 
+            * value is "true" if the Drag and Drop utility is included, 
+            * otherwise it is "false." <strong>PLEASE NOTE:</strong> There is a 
+            * known issue in IE 6 (Strict Mode and Quirks Mode) and IE 7 
+            * (Quirks Mode) where Panels that either don't have a value set for 
+            * their "width" configuration property, or their "width" 
+            * configuration property is set to "auto" will only be draggable by
+            * placing the mouse on the text of the Panel's header element.
+            * To fix this bug, draggable Panels missing a value for their 
+            * "width" configuration property, or whose "width" configuration 
+            * property is set to "auto" will have it set to the value of 
+            * their root HTML element's offsetWidth before they are made 
+            * visible.  The calculated width is then removed when the Panel is   
+            * hidden. <em>This fix is only applied to draggable Panels in IE 6 
+            * (Strict Mode and Quirks Mode) and IE 7 (Quirks Mode)</em>. For 
+            * more information on this issue see:
+            * SourceForge bugs #1726972 and #1589210.
+            * @config draggable
+            * @type Boolean
+            * @default true
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.DRAGGABLE.key, { 
+                handler: this.configDraggable, 
+                value: DEFAULT_CONFIG.DRAGGABLE.value, 
+                validator: DEFAULT_CONFIG.DRAGGABLE.validator, 
+                supercedes: DEFAULT_CONFIG.DRAGGABLE.supercedes 
+            });
+
+            /**
+            * Boolean specifying if the draggable Panel should be drag only, not interacting with drop 
+            * targets on the page.
+            * <p>
+            * When set to true, draggable Panels will not check to see if they are over drop targets,
+            * or fire the DragDrop events required to support drop target interaction (onDragEnter, 
+            * onDragOver, onDragOut, onDragDrop etc.).
+            * If the Panel is not designed to be dropped on any target elements on the page, then this 
+            * flag can be set to true to improve performance.
+            * </p>
+            * <p>
+            * When set to false, all drop target related events will be fired.
+            * </p>
+            * <p>
+            * The property is set to false by default to maintain backwards compatibility but should be 
+            * set to true if drop target interaction is not required for the Panel, to improve performance.</p>
+            * 
+            * @config dragOnly
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.DRAG_ONLY.key, { 
+                value: DEFAULT_CONFIG.DRAG_ONLY.value, 
+                validator: DEFAULT_CONFIG.DRAG_ONLY.validator, 
+                supercedes: DEFAULT_CONFIG.DRAG_ONLY.supercedes 
+            });
+
+            /**
+            * Sets the type of underlay to display for the Panel. Valid values 
+            * are "shadow," "matte," and "none".  <strong>PLEASE NOTE:</strong> 
+            * The creation of the underlay element is deferred until the Panel 
+            * is initially made visible.  For Gecko-based browsers on Mac
+            * OS X the underlay elment is always created as it is used as a 
+            * shim to prevent Aqua scrollbars below a Panel instance from poking 
+            * through it (See SourceForge bug #836476).
+            * @config underlay
+            * @type String
+            * @default shadow
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.UNDERLAY.key, { 
+                handler: this.configUnderlay, 
+                value: DEFAULT_CONFIG.UNDERLAY.value, 
+                supercedes: DEFAULT_CONFIG.UNDERLAY.supercedes 
+            });
+        
+            /**
+            * True if the Panel should be displayed in a modal fashion, 
+            * automatically creating a transparent mask over the document that
+            * will not be removed until the Panel is dismissed.
+            * @config modal
+            * @type Boolean
+            * @default false
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.MODAL.key, { 
+                handler: this.configModal, 
+                value: DEFAULT_CONFIG.MODAL.value,
+                validator: DEFAULT_CONFIG.MODAL.validator, 
+                supercedes: DEFAULT_CONFIG.MODAL.supercedes 
+            });
+        
+            /**
+            * A KeyListener (or array of KeyListeners) that will be enabled 
+            * when the Panel is shown, and disabled when the Panel is hidden.
+            * @config keylisteners
+            * @type YAHOO.util.KeyListener[]
+            * @default null
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.KEY_LISTENERS.key, { 
+                handler: this.configKeyListeners, 
+                suppressEvent: DEFAULT_CONFIG.KEY_LISTENERS.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.KEY_LISTENERS.supercedes 
+            });
+        
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the "close" property is changed.
+        * The method controls the appending or hiding of the close icon at the 
+        * top right of the Panel.
+        * @method configClose
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configClose: function (type, args, obj) {
 
-	if (! zIndex) {
-		zIndex = YAHOO.util.Dom.getStyle(el, "zIndex");
-		if (! zIndex || isNaN(zIndex)) {
-			zIndex = 0;
-		}
-	}
-
-	if (this.iframe) {
-		if (zIndex <= 0) {
-			zIndex = 1;
-		}
-		YAHOO.util.Dom.setStyle(this.iframe, "zIndex", (zIndex-1));
-	}
-
-	YAHOO.util.Dom.setStyle(el, "zIndex", zIndex);
-	this.cfg.setProperty("zIndex", zIndex, true);
-};
-
-/**
-* The default event handler fired when the "xy" property is changed.
-* @method configXY
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configXY = function(type, args, obj) {
-	var pos = args[0];
-	var x = pos[0];
-	var y = pos[1];
-
-	this.cfg.setProperty("x", x);
-	this.cfg.setProperty("y", y);
-
-	this.beforeMoveEvent.fire([x,y]);
-
-	x = this.cfg.getProperty("x");
-	y = this.cfg.getProperty("y");
-
-
-	this.cfg.refireEvent("iframe");
-	this.moveEvent.fire([x,y]);
-};
-
-/**
-* The default event handler fired when the "x" property is changed.
-* @method configX
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configX = function(type, args, obj) {
-	var x = args[0];
-	var y = this.cfg.getProperty("y");
+            var val = args[0],
+                oClose = this.close;
+        
+            function doHide(e, obj) {
+                obj.hide();
+            }
+        
+            if (val) {
+                if (!oClose) {
+                    if (!m_oCloseIconTemplate) {
+                        m_oCloseIconTemplate = document.createElement("span");
+                        m_oCloseIconTemplate.innerHTML = "&#160;";
+                        m_oCloseIconTemplate.className = "container-close";
+                    }
 
-	this.cfg.setProperty("x", x, true);
-	this.cfg.setProperty("y", y, true);
+                    oClose = m_oCloseIconTemplate.cloneNode(true);
+                    this.innerElement.appendChild(oClose);
+                    Event.on(oClose, "click", doHide, this);
+                    
+                    this.close = oClose;
 
-	this.beforeMoveEvent.fire([x,y]);
+                } else {
+                    oClose.style.display = "block";
+                }
 
-	x = this.cfg.getProperty("x");
-	y = this.cfg.getProperty("y");
+            } else {
+                if (oClose) {
+                    oClose.style.display = "none";
+                }
+            }
 
-	YAHOO.util.Dom.setX(this.element, x, true);
+        },
 
-	this.cfg.setProperty("xy", [x, y], true);
+        /**
+        * The default event handler fired when the "draggable" property 
+        * is changed.
+        * @method configDraggable
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configDraggable: function (type, args, obj) {
+            var val = args[0];
 
-	this.cfg.refireEvent("iframe");
-	this.moveEvent.fire([x, y]);
-};
+            if (val) {
+                if (!DD) {
+                    this.cfg.setProperty("draggable", false);
+                    return;
+                }
 
-/**
-* The default event handler fired when the "y" property is changed.
-* @method configY
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configY = function(type, args, obj) {
-	var x = this.cfg.getProperty("x");
-	var y = args[0];
+                if (this.header) {
+                    Dom.setStyle(this.header, "cursor", "move");
+                    this.registerDragDrop();
+                }
 
-	this.cfg.setProperty("x", x, true);
-	this.cfg.setProperty("y", y, true);
+                this.subscribe("beforeShow", setWidthToOffsetWidth);
 
-	this.beforeMoveEvent.fire([x,y]);
+            } else {
 
-	x = this.cfg.getProperty("x");
-	y = this.cfg.getProperty("y");
+                if (this.dd) {
+                    this.dd.unreg();
+                }
 
-	YAHOO.util.Dom.setY(this.element, y, true);
+                if (this.header) {
+                    Dom.setStyle(this.header,"cursor","auto");
+                }
 
-	this.cfg.setProperty("xy", [x, y], true);
+                this.unsubscribe("beforeShow", setWidthToOffsetWidth);
+            }
+        },
+      
+        /**
+        * The default event handler fired when the "underlay" property 
+        * is changed.
+        * @method configUnderlay
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configUnderlay: function (type, args, obj) {
+    
+            var UA = YAHOO.env.ua,
+                bMacGecko = (this.platform == "mac" && UA.gecko),
+                sUnderlay = args[0].toLowerCase(),
+                oUnderlay = this.underlay,
+                oElement = this.element;
+                
+            function fixWebkitUnderlay() {
+                // Webkit 419.3 (Safari 2.x) does not update
+                // it's Render Tree for the Container when content changes. 
+                // We need to force it to update using this contentChange 
+                // listener
+
+                // Webkit 523.6 doesn't have this problem and doesn't 
+                // need the fix
+                var u = this.underlay;
+                Dom.addClass(u, "yui-force-redraw");
+                window.setTimeout(function(){Dom.removeClass(u, "yui-force-redraw");}, 0);
+            }
 
-	this.cfg.refireEvent("iframe");
-	this.moveEvent.fire([x, y]);
-};
+            function createUnderlay() {
 
-/**
-* Shows the iframe shim, if it has been enabled
-* @method showIframe
-*/
-YAHOO.widget.Overlay.prototype.showIframe = function() {
-	if (this.iframe) {
-		this.iframe.style.display = "block";
-	}
-};
-
-/**
-* Hides the iframe shim, if it has been enabled
-* @method hideIframe
-*/
-YAHOO.widget.Overlay.prototype.hideIframe = function() {
-	if (this.iframe) {
-		this.iframe.style.display = "none";
-	}
-};
-
-/**
-* The default event handler fired when the "iframe" property is changed.
-* @method configIframe
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configIframe = function(type, args, obj) {
+                var nIE;
 
-	var val = args[0];
+                if (!oUnderlay) { // create if not already in DOM
 
-	if (val) { // IFRAME shim is enabled
+                    if (!m_oUnderlayTemplate) {
+                        m_oUnderlayTemplate = document.createElement("div");
+                        m_oUnderlayTemplate.className = "underlay";
+                    }
 
-		if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, this.showIframe, this)) {
-			this.showEvent.subscribe(this.showIframe, this, true);
-		}
-		if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, this.hideIframe, this)) {
-			this.hideEvent.subscribe(this.hideIframe, this, true);
-		}
-
-		var x = this.cfg.getProperty("x");
-		var y = this.cfg.getProperty("y");
-
-		if (! x || ! y) {
-			this.syncPosition();
-			x = this.cfg.getProperty("x");
-			y = this.cfg.getProperty("y");
-		}
-
-
-		if (! isNaN(x) && ! isNaN(y)) {
-			if (! this.iframe) {
-				this.iframe = document.createElement("iframe");
-				if (this.isSecure) {
-					this.iframe.src = YAHOO.widget.Overlay.IFRAME_SRC;
-				}
-
-				var parent = this.element.parentNode;
-				if (parent) {
-					parent.appendChild(this.iframe);
-				} else {
-					document.body.appendChild(this.iframe);
-				}
-
-				YAHOO.util.Dom.setStyle(this.iframe, "position", "absolute");
-				YAHOO.util.Dom.setStyle(this.iframe, "border", "none");
-				YAHOO.util.Dom.setStyle(this.iframe, "margin", "0");
-				YAHOO.util.Dom.setStyle(this.iframe, "padding", "0");
-				YAHOO.util.Dom.setStyle(this.iframe, "opacity", "0");
-				if (this.cfg.getProperty("visible")) {
-					this.showIframe();
-				} else {
-					this.hideIframe();
-				}
-			}
-
-			var iframeDisplay = YAHOO.util.Dom.getStyle(this.iframe, "display");
-
-			if (iframeDisplay == "none") {
-				this.iframe.style.display = "block";
-			}
-
-			YAHOO.util.Dom.setXY(this.iframe, [x,y]);
-
-			var width = this.element.clientWidth;
-			var height = this.element.clientHeight;
-
-			YAHOO.util.Dom.setStyle(this.iframe, "width", (width+2) + "px");
-			YAHOO.util.Dom.setStyle(this.iframe, "height", (height+2) + "px");
-
-			if (iframeDisplay == "none") {
-				this.iframe.style.display = "none";
-			}
-		}
-	} else {
-		if (this.iframe) {
-			this.iframe.style.display = "none";
-		}
-		this.showEvent.unsubscribe(this.showIframe, this);
-		this.hideEvent.unsubscribe(this.hideIframe, this);
-	}
-};
-
-
-/**
-* The default event handler fired when the "constraintoviewport" property is changed.
-* @method configConstrainToViewport
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configConstrainToViewport = function(type, args, obj) {
-	var val = args[0];
-	if (val) {
-		if (! YAHOO.util.Config.alreadySubscribed(this.beforeMoveEvent, this.enforceConstraints, this)) {
-			this.beforeMoveEvent.subscribe(this.enforceConstraints, this, true);
-		}
-	} else {
-		this.beforeMoveEvent.unsubscribe(this.enforceConstraints, this);
-	}
-};
-
-/**
-* The default event handler fired when the "context" property is changed.
-* @method configContext
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.configContext = function(type, args, obj) {
-	var contextArgs = args[0];
+                    oUnderlay = m_oUnderlayTemplate.cloneNode(false);
+                    this.element.appendChild(oUnderlay);
 
-	if (contextArgs) {
-		var contextEl = contextArgs[0];
-		var elementMagnetCorner = contextArgs[1];
-		var contextMagnetCorner = contextArgs[2];
-
-		if (contextEl) {
-			if (typeof contextEl == "string") {
-				this.cfg.setProperty("context", [document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner], true);
-			}
-
-			if (elementMagnetCorner && contextMagnetCorner) {
-				this.align(elementMagnetCorner, contextMagnetCorner);
-			}
-		}
-	}
-};
-
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Aligns the Overlay to its context element using the specified corner points (represented by the constants TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, and BOTTOM_RIGHT.
-* @method align
-* @param {String} elementAlign		The String representing the corner of the Overlay that should be aligned to the context element
-* @param {String} contextAlign		The corner of the context element that the elementAlign corner should stick to.
-*/
-YAHOO.widget.Overlay.prototype.align = function(elementAlign, contextAlign) {
-	var contextArgs = this.cfg.getProperty("context");
-	if (contextArgs) {
-		var context = contextArgs[0];
-
-		var element = this.element;
-		var me = this;
-
-		if (! elementAlign) {
-			elementAlign = contextArgs[1];
-		}
-
-		if (! contextAlign) {
-			contextAlign = contextArgs[2];
-		}
-
-		if (element && context) {
-			var contextRegion = YAHOO.util.Dom.getRegion(context);
-
-			var doAlign = function(v,h) {
-				switch (elementAlign) {
-					case YAHOO.widget.Overlay.TOP_LEFT:
-						me.moveTo(h,v);
-						break;
-					case YAHOO.widget.Overlay.TOP_RIGHT:
-						me.moveTo(h-element.offsetWidth,v);
-						break;
-					case YAHOO.widget.Overlay.BOTTOM_LEFT:
-						me.moveTo(h,v-element.offsetHeight);
-						break;
-					case YAHOO.widget.Overlay.BOTTOM_RIGHT:
-						me.moveTo(h-element.offsetWidth,v-element.offsetHeight);
-						break;
-				}
-			};
-
-			switch (contextAlign) {
-				case YAHOO.widget.Overlay.TOP_LEFT:
-					doAlign(contextRegion.top, contextRegion.left);
-					break;
-				case YAHOO.widget.Overlay.TOP_RIGHT:
-					doAlign(contextRegion.top, contextRegion.right);
-					break;
-				case YAHOO.widget.Overlay.BOTTOM_LEFT:
-					doAlign(contextRegion.bottom, contextRegion.left);
-					break;
-				case YAHOO.widget.Overlay.BOTTOM_RIGHT:
-					doAlign(contextRegion.bottom, contextRegion.right);
-					break;
-			}
-		}
-	}
-};
-
-/**
-* The default event handler executed when the moveEvent is fired, if the "constraintoviewport" is set to true.
-* @method enforceConstraints
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Overlay.prototype.enforceConstraints = function(type, args, obj) {
-	var pos = args[0];
+                    this.underlay = oUnderlay;
 
-	var x = pos[0];
-	var y = pos[1];
+                    nIE = UA.ie;
 
-	var offsetHeight = this.element.offsetHeight;
-	var offsetWidth = this.element.offsetWidth;
+                    if (nIE == 6 || (nIE == 7 && document.compatMode == "BackCompat")) {
 
-	var viewPortWidth = YAHOO.util.Dom.getViewportWidth();
-	var viewPortHeight = YAHOO.util.Dom.getViewportHeight();
-
-	var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-	var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
-
-	var topConstraint = scrollY + 10;
-	var leftConstraint = scrollX + 10;
-	var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;
-	var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
-
-	if (x < leftConstraint) {
-		x = leftConstraint;
-	} else if (x > rightConstraint) {
-		x = rightConstraint;
-	}
-
-	if (y < topConstraint) {
-		y = topConstraint;
-	} else if (y > bottomConstraint) {
-		y = bottomConstraint;
-	}
-
-	this.cfg.setProperty("x", x, true);
-	this.cfg.setProperty("y", y, true);
-	this.cfg.setProperty("xy", [x,y], true);
-};
-
-/**
-* Centers the container in the viewport.
-* @method center
-*/
-YAHOO.widget.Overlay.prototype.center = function() {
-	var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
-	var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+                        this.sizeUnderlay();
 
-	var viewPortWidth = YAHOO.util.Dom.getClientWidth();
-	var viewPortHeight = YAHOO.util.Dom.getClientHeight();
+                        this.cfg.subscribeToConfigEvent("width", this.sizeUnderlay);
+                        this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);
+                        this.changeContentEvent.subscribe(this.sizeUnderlay);
 
-	var elementWidth = this.element.offsetWidth;
-	var elementHeight = this.element.offsetHeight;
+                        YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay, this, true);
+                    }
 
-	var x = (viewPortWidth / 2) - (elementWidth / 2) + scrollX;
-	var y = (viewPortHeight / 2) - (elementHeight / 2) + scrollY;
+                    if (UA.webkit && UA.webkit < 420) {
+                        this.changeContentEvent.subscribe(fixWebkitUnderlay);
+                    }
+                }
 
-	this.cfg.setProperty("xy", [parseInt(x, 10), parseInt(y, 10)]);
+            }
 
-	this.cfg.refireEvent("iframe");
-};
+            function onBeforeShow() {
+                createUnderlay.call(this);
+                this._underlayDeferred = false;
+                this.beforeShowEvent.unsubscribe(onBeforeShow);
+            }
 
-/**
-* Synchronizes the Panel's "xy", "x", and "y" properties with the Panel's position in the DOM. This is primarily used to update position information during drag & drop.
-* @method syncPosition
-*/
-YAHOO.widget.Overlay.prototype.syncPosition = function() {
-	var pos = YAHOO.util.Dom.getXY(this.element);
-	this.cfg.setProperty("x", pos[0], true);
-	this.cfg.setProperty("y", pos[1], true);
-	this.cfg.setProperty("xy", pos, true);
-};
-
-/**
-* Event handler fired when the resize monitor element is resized.
-* @method onDomResize
-* @param {DOMEvent} e	The resize DOM event
-* @param {Object} obj	The scope object
-*/
-YAHOO.widget.Overlay.prototype.onDomResize = function(e, obj) {
-	YAHOO.widget.Overlay.superclass.onDomResize.call(this, e, obj);
-	var me = this;
-	setTimeout(function() {
-		me.syncPosition();
-		me.cfg.refireEvent("iframe");
-		me.cfg.refireEvent("context");
-	}, 0);
-};
-
-/**
-* Removes the Overlay element from the DOM and sets all child elements to null.
-* @method destroy
-*/
-YAHOO.widget.Overlay.prototype.destroy = function() {
-	if (this.iframe) {
-		this.iframe.parentNode.removeChild(this.iframe);
-	}
-
-	this.iframe = null;
-
-	YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-	YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);
-
-	YAHOO.widget.Overlay.superclass.destroy.call(this);
-};
-
-/**
-* Returns a String representation of the object.
-* @method toString
-* @return {String} The string representation of the Overlay.
-*/
-YAHOO.widget.Overlay.prototype.toString = function() {
-	return "Overlay " + this.id;
-};
-
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window scroll
-* @event YAHOO.widget.Overlay.windowScrollEvent
-*/
-YAHOO.widget.Overlay.windowScrollEvent = new YAHOO.util.CustomEvent("windowScroll");
+            function destroyUnderlay() {
+                if (this._underlayDeferred) {
+                    this.beforeShowEvent.unsubscribe(onBeforeShow);
+                    this._underlayDeferred = false;
+                }
 
-/**
-* A singleton CustomEvent used for reacting to the DOM event for window resize
-* @event YAHOO.widget.Overlay.windowResizeEvent
-*/
-YAHOO.widget.Overlay.windowResizeEvent = new YAHOO.util.CustomEvent("windowResize");
+                if (oUnderlay) {
+                    this.cfg.unsubscribeFromConfigEvent("width", this.sizeUnderlay);
+                    this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);
+                    this.changeContentEvent.unsubscribe(this.sizeUnderlay);
+                    this.changeContentEvent.unsubscribe(fixWebkitUnderlay);
+                    YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay, this, true);
 
-/**
-* The DOM event handler used to fire the CustomEvent for window scroll
-* @method YAHOO.widget.Overlay.windowScrollHandler
-* @static
-* @param {DOMEvent} e The DOM scroll event
-*/
-YAHOO.widget.Overlay.windowScrollHandler = function(e) {
-	if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {
-		if (! window.scrollEnd) {
-			window.scrollEnd = -1;
-		}
-		clearTimeout(window.scrollEnd);
-		window.scrollEnd = setTimeout(function() { YAHOO.widget.Overlay.windowScrollEvent.fire(); }, 1);
-	} else {
-		YAHOO.widget.Overlay.windowScrollEvent.fire();
-	}
-};
-
-/**
-* The DOM event handler used to fire the CustomEvent for window resize
-* @method YAHOO.widget.Overlay.windowResizeHandler
-* @static
-* @param {DOMEvent} e The DOM resize event
-*/
-YAHOO.widget.Overlay.windowResizeHandler = function(e) {
-	if (YAHOO.widget.Module.prototype.browser == "ie" || YAHOO.widget.Module.prototype.browser == "ie7") {
-		if (! window.resizeEnd) {
-			window.resizeEnd = -1;
-		}
-		clearTimeout(window.resizeEnd);
-		window.resizeEnd = setTimeout(function() { YAHOO.widget.Overlay.windowResizeEvent.fire(); }, 100);
-	} else {
-		YAHOO.widget.Overlay.windowResizeEvent.fire();
-	}
-};
-
-/**
-* A boolean that indicated whether the window resize and scroll events have already been subscribed to.
-* @property YAHOO.widget.Overlay._initialized
-* @private
-* @type Boolean
-*/
-YAHOO.widget.Overlay._initialized = null;
+                    this.element.removeChild(oUnderlay);
 
-if (YAHOO.widget.Overlay._initialized === null) {
-	YAHOO.util.Event.addListener(window, "scroll", YAHOO.widget.Overlay.windowScrollHandler);
-	YAHOO.util.Event.addListener(window, "resize", YAHOO.widget.Overlay.windowResizeHandler);
-
-	YAHOO.widget.Overlay._initialized = true;
-}
-/**
-* OverlayManager is used for maintaining the focus status of multiple Overlays.* @namespace YAHOO.widget
-* @namespace YAHOO.widget
-* @class OverlayManager
-* @constructor
-* @param {Array}	overlays	Optional. A collection of Overlays to register with the manager.
-* @param {Object}	userConfig		The object literal representing the user configuration of the OverlayManager
-*/
-YAHOO.widget.OverlayManager = function(userConfig) {
-	this.init(userConfig);
-};
-
-/**
-* The CSS class representing a focused Overlay
-* @property YAHOO.widget.OverlayManager.CSS_FOCUSED
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.OverlayManager.CSS_FOCUSED = "focused";
+                    this.underlay = null;
+                }
+            }
+        
 
-YAHOO.widget.OverlayManager.prototype = {
-	/**
-	* The class's constructor function
-	* @property contructor
-	* @type Function
-	*/
-	constructor : YAHOO.widget.OverlayManager,
-
-	/**
-	* The array of Overlays that are currently registered
-	* @property overlays
-	* @type YAHOO.widget.Overlay[]
-	*/
-	overlays : null,
-
-	/**
-	* Initializes the default configuration of the OverlayManager
-	* @method initDefaultConfig
-	*/
-	initDefaultConfig : function() {
-		/**
-		* The collection of registered Overlays in use by the OverlayManager
-		* @config overlays
-		* @type YAHOO.widget.Overlay[]
-		* @default null
-		*/
-		this.cfg.addProperty("overlays", { suppressEvent:true } );
-
-		/**
-		* The default DOM event that should be used to focus an Overlay
-		* @config focusevent
-		* @type String
-		* @default "mousedown"
-		*/
-		this.cfg.addProperty("focusevent", { value:"mousedown" } );
-	},
-
-	/**
-	* Initializes the OverlayManager
-	* @method init
-	* @param {YAHOO.widget.Overlay[]}	overlays	Optional. A collection of Overlays to register with the manager.
-	* @param {Object}	userConfig		The object literal representing the user configuration of the OverlayManager
-	*/
-	init : function(userConfig) {
-		/**
-		* The OverlayManager's Config object used for monitoring configuration properties.
-		* @property cfg
-		* @type YAHOO.util.Config
-		*/
-		this.cfg = new YAHOO.util.Config(this);
-
-		this.initDefaultConfig();
-
-		if (userConfig) {
-			this.cfg.applyConfig(userConfig, true);
-		}
-		this.cfg.fireQueue();
-
-		/**
-		* The currently activated Overlay
-		* @property activeOverlay
-		* @private
-		* @type YAHOO.widget.Overlay
-		*/
-		var activeOverlay = null;
-
-		/**
-		* Returns the currently focused Overlay
-		* @method getActive
-		* @return {YAHOO.widget.Overlay}	The currently focused Overlay
-		*/
-		this.getActive = function() {
-			return activeOverlay;
-		};
-
-		/**
-		* Focuses the specified Overlay
-		* @method focus
-		* @param {YAHOO.widget.Overlay} overlay	The Overlay to focus
-		* @param {String} overlay	The id of the Overlay to focus
-		*/
-		this.focus = function(overlay) {
-
-			var o = this.find(overlay);
-
-			if (o) {
-
-                if (activeOverlay != o) {
-
-                    if(activeOverlay) {
+            switch (sUnderlay) {
     
-                        activeOverlay.blur();
+                case "shadow":
     
-                    }
-    
-                    activeOverlay = o;
+                    Dom.removeClass(oElement, "matte");
+                    Dom.addClass(oElement, "shadow");
     
-                    YAHOO.util.Dom.addClass(activeOverlay.element, YAHOO.widget.OverlayManager.CSS_FOCUSED);
+                    break;
     
-                    this.overlays.sort(this.compareZIndexDesc);
+                case "matte":
     
-                    var topZIndex = YAHOO.util.Dom.getStyle(this.overlays[0].element, "zIndex");
+                    if (!bMacGecko) {
+                        destroyUnderlay.call(this);
+                    }
     
-                    if (! isNaN(topZIndex) && this.overlays[0] != overlay) {
+                    Dom.removeClass(oElement, "shadow");
+                    Dom.addClass(oElement, "matte");
     
-                        activeOverlay.cfg.setProperty("zIndex", (parseInt(topZIndex, 10) + 2));
+                    break;
+                default:
     
+                    if (!bMacGecko) {
+                        destroyUnderlay.call(this);
                     }
+                    Dom.removeClass(oElement, "shadow");
+                    Dom.removeClass(oElement, "matte");
     
-                    this.overlays.sort(this.compareZIndexDesc);
-    
-                    o.focusEvent.fire();
+                    break;
+            }
+
+            if ((sUnderlay == "shadow") || (bMacGecko && !oUnderlay)) {
                 
+                if (this.cfg.getProperty("visible")) {
+                    createUnderlay.call(this);
                 }
+                else {
+                    if (!this._underlayDeferred) {
+                        this.beforeShowEvent.subscribe(onBeforeShow);
+                        this._underlayDeferred = true;
+                    }
+                }
+            }
+    
+        },
+        
+        /**
+        * The default event handler fired when the "modal" property is 
+        * changed. This handler subscribes or unsubscribes to the show and hide
+        * events to handle the display or hide of the modality mask.
+        * @method configModal
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configModal: function (type, args, obj) {
 
-			}
-
-		};
-
-		/**
-		* Removes the specified Overlay from the manager
-		* @method remove
-		* @param {YAHOO.widget.Overlay}	overlay	The Overlay to remove
-		* @param {String} overlay	The id of the Overlay to remove
-		*/
-		this.remove = function(overlay) {
-			var o = this.find(overlay);
-			if (o) {
-				var originalZ = YAHOO.util.Dom.getStyle(o.element, "zIndex");
-				o.cfg.setProperty("zIndex", -1000, true);
-				this.overlays.sort(this.compareZIndexDesc);
-				this.overlays = this.overlays.slice(0, this.overlays.length-1);
-				o.cfg.setProperty("zIndex", originalZ, true);
-
-				o.cfg.setProperty("manager", null);
-				o.focusEvent = null;
-				o.blurEvent = null;
-				o.focus = null;
-				o.blur = null;
-			}
-		};
-
-		/**
-		* Removes focus from all registered Overlays in the manager
-		* @method blurAll
-		*/
-		this.blurAll = function() {
-			for (var o=0;o<this.overlays.length;o++) {
-                this.overlays[o].blur();
-			}
-		};
-
-
-        this._onOverlayBlur = function(p_sType, p_aArgs) {
-            activeOverlay = null;
-        };
-
-
-		var overlays = this.cfg.getProperty("overlays");
-
-		if (! this.overlays) {
-			this.overlays = [];
-		}
-
-		if (overlays) {
-			this.register(overlays);
-			this.overlays.sort(this.compareZIndexDesc);
-		}
-	},
-
-	/**
-	* Registers an Overlay or an array of Overlays with the manager. Upon registration, the Overlay receives functions for focus and blur, along with CustomEvents for each.
-	* @method register
-	* @param {YAHOO.widget.Overlay}	overlay		An Overlay to register with the manager.
-	* @param {YAHOO.widget.Overlay[]}	overlay		An array of Overlays to register with the manager.
-	* @return	{Boolean}	True if any Overlays are registered.
-	*/
-	register : function(overlay) {
-		if (overlay instanceof YAHOO.widget.Overlay) {
-			overlay.cfg.addProperty("manager", { value:this } );
-
-			overlay.focusEvent = new YAHOO.util.CustomEvent("focus", overlay);
-			overlay.blurEvent = new YAHOO.util.CustomEvent("blur", overlay);
-
-			var mgr=this;
-
-			overlay.focus = function() {
-				mgr.focus(this);
-			};
-
-			overlay.blur = function() {
-                if(mgr.getActive() == this) {
-                    YAHOO.util.Dom.removeClass(this.element, YAHOO.widget.OverlayManager.CSS_FOCUSED);
-                    this.blurEvent.fire();
-				}
-			};
-
-            overlay.blurEvent.subscribe(mgr._onOverlayBlur);
-
-			var focusOnDomEvent = function(e,obj) {
-				overlay.focus();
-			};
-
-			var focusevent = this.cfg.getProperty("focusevent");
-			YAHOO.util.Event.addListener(overlay.element,focusevent,focusOnDomEvent,this,true);
-
-			var zIndex = YAHOO.util.Dom.getStyle(overlay.element, "zIndex");
-			if (! isNaN(zIndex)) {
-				overlay.cfg.setProperty("zIndex", parseInt(zIndex, 10));
-			} else {
-				overlay.cfg.setProperty("zIndex", 0);
-			}
-
-			this.overlays.push(overlay);
-			return true;
-		} else if (overlay instanceof Array) {
-			var regcount = 0;
-			for (var i=0;i<overlay.length;i++) {
-				if (this.register(overlay[i])) {
-					regcount++;
-				}
-			}
-			if (regcount > 0) {
-				return true;
-			}
-		} else {
-			return false;
-		}
-	},
-
-	/**
-	* Attempts to locate an Overlay by instance or ID.
-	* @method find
-	* @param {YAHOO.widget.Overlay}	overlay		An Overlay to locate within the manager
-	* @param {String}	overlay		An Overlay id to locate within the manager
-	* @return	{YAHOO.widget.Overlay}	The requested Overlay, if found, or null if it cannot be located.
-	*/
-	find : function(overlay) {
-		if (overlay instanceof YAHOO.widget.Overlay) {
-			for (var o=0;o<this.overlays.length;o++) {
-				if (this.overlays[o] == overlay) {
-					return this.overlays[o];
-				}
-			}
-		} else if (typeof overlay == "string") {
-			for (var p=0;p<this.overlays.length;p++) {
-				if (this.overlays[p].id == overlay) {
-					return this.overlays[p];
-				}
-			}
-		}
-		return null;
-	},
-
-	/**
-	* Used for sorting the manager's Overlays by z-index.
-	* @method compareZIndexDesc
-	* @private
-	* @return {Number}	0, 1, or -1, depending on where the Overlay should fall in the stacking order.
-	*/
-	compareZIndexDesc : function(o1, o2) {
-		var zIndex1 = o1.cfg.getProperty("zIndex");
-		var zIndex2 = o2.cfg.getProperty("zIndex");
-
-		if (zIndex1 > zIndex2) {
-			return -1;
-		} else if (zIndex1 < zIndex2) {
-			return 1;
-		} else {
-			return 0;
-		}
-	},
-
-	/**
-	* Shows all Overlays in the manager.
-	* @method showAll
-	*/
-	showAll : function() {
-		for (var o=0;o<this.overlays.length;o++) {
-			this.overlays[o].show();
-		}
-	},
-
-	/**
-	* Hides all Overlays in the manager.
-	* @method hideAll
-	*/
-	hideAll : function() {
-		for (var o=0;o<this.overlays.length;o++) {
-			this.overlays[o].hide();
-		}
-	},
-
-	/**
-	* Returns a string representation of the object.
-	* @method toString
-	* @return {String}	The string representation of the OverlayManager
-	*/
-	toString : function() {
-		return "OverlayManager";
-	}
-
-};
-/**
-* Tooltip is an implementation of Overlay that behaves like an OS tooltip, displaying when the user mouses over a particular element, and disappearing on mouse out.
-* @namespace YAHOO.widget
-* @class Tooltip
-* @extends YAHOO.widget.Overlay
-* @constructor
-* @param {String}	el	The element ID representing the Tooltip <em>OR</em>
-* @param {HTMLElement}	el	The element representing the Tooltip
-* @param {Object}	userConfig	The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Tooltip = function(el, userConfig) {
-	YAHOO.widget.Tooltip.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Tooltip, YAHOO.widget.Overlay);
-
-/**
-* Constant representing the Tooltip CSS class
-* @property YAHOO.widget.Tooltip.CSS_TOOLTIP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Tooltip.CSS_TOOLTIP = "yui-tt";
+            var modal = args[0];
+            if (modal) {
+                if (!this._hasModalityEventListeners) {
 
-/**
-* Constant representing the Tooltip's configuration properties
-* @property YAHOO.widget.Tooltip._DEFAULT_CONFIG
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Tooltip._DEFAULT_CONFIG = {
+                    this.subscribe("beforeShow", this.buildMask);
+                    this.subscribe("beforeShow", this.bringToTop);
+                    this.subscribe("beforeShow", this.showMask);
+                    this.subscribe("hide", this.hideMask);
 
-    "PREVENT_OVERLAP": { 
-        key: "preventoverlap", 
-        value:true, 
-        validator:YAHOO.lang.isBoolean, 
-        supercedes:["x","y","xy"] 
-    },
-
-    "SHOW_DELAY": { 
-        key: "showdelay", 
-        value:200, 
-        validator:YAHOO.lang.isNumber 
-    }, 
-
-    "AUTO_DISMISS_DELAY": { 
-        key: "autodismissdelay", 
-        value:5000, 
-        validator:YAHOO.lang.isNumber 
-    }, 
-
-    "HIDE_DELAY": { 
-        key: "hidedelay", 
-        value:250, 
-        validator:YAHOO.lang.isNumber 
-    }, 
-
-    "TEXT": { 
-        key: "text", 
-        suppressEvent:true 
-    }, 
+                    Overlay.windowResizeEvent.subscribe(this.sizeMask, 
+                        this, true);
 
-    "CONTAINER": { 
-        key: "container"
-    }
+                    this._hasModalityEventListeners = true;
+                }
+            } else {
+                if (this._hasModalityEventListeners) {
 
-};
+                    if (this.cfg.getProperty("visible")) {
+                        this.hideMask();
+                        this.removeMask();
+                    }
 
-/**
-* The Tooltip initialization method. This method is automatically called by the constructor. A Tooltip is automatically rendered by the init method, and it also is set to be invisible by default, and constrained to viewport by default as well.
-* @method init
-* @param {String}	el	The element ID representing the Tooltip <em>OR</em>
-* @param {HTMLElement}	el	The element representing the Tooltip
-* @param {Object}	userConfig	The configuration object literal containing the configuration that should be set for this Tooltip. See configuration documentation for more details.
-*/
-YAHOO.widget.Tooltip.prototype.init = function(el, userConfig) {
+                    this.unsubscribe("beforeShow", this.buildMask);
+                    this.unsubscribe("beforeShow", this.bringToTop);
+                    this.unsubscribe("beforeShow", this.showMask);
+                    this.unsubscribe("hide", this.hideMask);
+
+                    Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
+                    
+                    this._hasModalityEventListeners = false;
+                }
+            }
+        },
+        
+        /**
+        * Removes the modality mask.
+        * @method removeMask
+        */
+        removeMask: function () {
+        
+            var oMask = this.mask,
+                oParentNode;
+        
+            if (oMask) {
+                /*
+                    Hide the mask before destroying it to ensure that DOM
+                    event handlers on focusable elements get removed.
+                */
+                this.hideMask();
+                
+                oParentNode = oMask.parentNode;
+                if (oParentNode) {
+                    oParentNode.removeChild(oMask);
+                }
 
-	if (document.readyState && document.readyState != "complete") {
-		var deferredInit = function() {
-			this.init(el, userConfig);
-		};
-		YAHOO.util.Event.addListener(window, "load", deferredInit, this, true);
-	} else {
-		YAHOO.widget.Tooltip.superclass.init.call(this, el);
+                this.mask = null;
+            }
+        },
+        
+        /**
+        * The default event handler fired when the "keylisteners" property 
+        * is changed.
+        * @method configKeyListeners
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configKeyListeners: function (type, args, obj) {
 
-		this.beforeInitEvent.fire(YAHOO.widget.Tooltip);
+            var listeners = args[0],
+                listener,
+                nListeners,
+                i;
+        
+            if (listeners) {
 
-		YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Tooltip.CSS_TOOLTIP);
+                if (listeners instanceof Array) {
 
-		if (userConfig) {
-			this.cfg.applyConfig(userConfig, true);
-		}
+                    nListeners = listeners.length;
 
-		this.cfg.queueProperty("visible",false);
-		this.cfg.queueProperty("constraintoviewport",true);
+                    for (i = 0; i < nListeners; i++) {
 
-		this.setBody("");
-		this.render(this.cfg.getProperty("container"));
+                        listener = listeners[i];
+        
+                        if (!Config.alreadySubscribed(this.showEvent, 
+                            listener.enable, listener)) {
 
-		this.initEvent.fire(YAHOO.widget.Tooltip);
-	}
-};
+                            this.showEvent.subscribe(listener.enable, 
+                                listener, true);
 
-/**
-* Initializes the class's configurable properties which can be changed using the Overlay's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Tooltip.prototype.initDefaultConfig = function() {
-	YAHOO.widget.Tooltip.superclass.initDefaultConfig.call(this);
+                        }
 
-    var DEFAULT_CONFIG = YAHOO.widget.Tooltip._DEFAULT_CONFIG;
+                        if (!Config.alreadySubscribed(this.hideEvent, 
+                            listener.disable, listener)) {
 
-	/**
-	* Specifies whether the Tooltip should be kept from overlapping its context element.
-	* @config preventoverlap
-	* @type Boolean
-	* @default true
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.PREVENT_OVERLAP.key,
-	           {
-	               value: DEFAULT_CONFIG.PREVENT_OVERLAP.value, 
-	               validator: DEFAULT_CONFIG.PREVENT_OVERLAP.validator, 
-	               supercedes: DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes
-               }
-           );
-
-	/**
-	* The number of milliseconds to wait before showing a Tooltip on mouseover.
-	* @config showdelay
-	* @type Number
-	* @default 200
-	*/
-	this.cfg.addProperty(
-                DEFAULT_CONFIG.SHOW_DELAY.key,
-                {
-                    handler: this.configShowDelay,
-                    value: 200, 
-                    validator: DEFAULT_CONFIG.SHOW_DELAY.validator
-                }
-          );
-
-	/**
-	* The number of milliseconds to wait before automatically dismissing a Tooltip after the mouse has been resting on the context element.
-	* @config autodismissdelay
-	* @type Number
-	* @default 5000
-	*/
-	this.cfg.addProperty(
-                DEFAULT_CONFIG.AUTO_DISMISS_DELAY.key,	
-                {
-                    handler: this.configAutoDismissDelay,
-                    value: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,
-                    validator: DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator
-                }
-            );
-
-	/**
-	* The number of milliseconds to wait before hiding a Tooltip on mouseover.
-	* @config hidedelay
-	* @type Number
-	* @default 250
-	*/
-	this.cfg.addProperty(
-                DEFAULT_CONFIG.HIDE_DELAY.key,
-                {
-                    handler: this.configHideDelay,
-                    value: DEFAULT_CONFIG.HIDE_DELAY.value, 
-                    validator: DEFAULT_CONFIG.HIDE_DELAY.validator
-                }
-            );
-
-	/**
-	* Specifies the Tooltip's text.
-	* @config text
-	* @type String
-	* @default null
-	*/
-    this.cfg.addProperty(
-                DEFAULT_CONFIG.TEXT.key,
-                {
-                    handler: this.configText,
-                    suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent
-                }
-            );
-
-	/**
-	* Specifies the container element that the Tooltip's markup should be rendered into.
-	* @config container
-	* @type HTMLElement/String
-	* @default document.body
-	*/
-    this.cfg.addProperty(
-                DEFAULT_CONFIG.CONTAINER.key,
-                {
-                    handler: this.configContainer,
-                    value: document.body
-                }
-            );
-
-	/**
-	* Specifies the element or elements that the Tooltip should be anchored to on mouseover.
-	* @config context
-	* @type HTMLElement[]/String[]
-	* @default null
-	*/	
-
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "text" property is changed.
-* @method configText
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Tooltip.prototype.configText = function(type, args, obj) {
-	var text = args[0];
-	if (text) {
-		this.setBody(text);
-	}
-};
-
-/**
-* The default event handler fired when the "container" property is changed.
-* @method configContainer
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Tooltip.prototype.configContainer = function(type, args, obj) {
-	var container = args[0];
-	if (typeof container == 'string') {
-		this.cfg.setProperty("container", document.getElementById(container), true);
-	}
-};
-
-/**
-* @method _removeEventListeners
-* @description Removes all of the DOM event handlers from the HTML element(s) 
-* that trigger the display of the tooltip.
-* @protected
-*/
-YAHOO.widget.Tooltip.prototype._removeEventListeners = function() {
+                            this.hideEvent.subscribe(listener.disable, 
+                                listener, true);
 
-    var aElements = this._context;
-    
-    if (aElements) {
+                            this.destroyEvent.subscribe(listener.disable, 
+                                listener, true);
+                        }
 
-        var nElements = aElements.length;
-        
-        if (nElements > 0) {
-        
-            var i = nElements - 1,
-                oElement;
-            
-            do {
+                    }
 
-                oElement = aElements[i];
+                } else {
 
-                YAHOO.util.Event.removeListener(oElement, "mouseover", this.onContextMouseOver);
-                YAHOO.util.Event.removeListener(oElement, "mousemove", this.onContextMouseMove);
-                YAHOO.util.Event.removeListener(oElement, "mouseout", this.onContextMouseOut);
-            
-            }
-            while(i--);
-        
-        }
+                    if (!Config.alreadySubscribed(this.showEvent, 
+                        listeners.enable, listeners)) {
 
-    }
+                        this.showEvent.subscribe(listeners.enable, 
+                            listeners, true);
+                    }
 
-};
+                    if (!Config.alreadySubscribed(this.hideEvent, 
+                        listeners.disable, listeners)) {
 
-/**
-* The default event handler fired when the "context" property is changed.
-* @method configContext
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Tooltip.prototype.configContext = function(type, args, obj) {
-	var context = args[0];
-	if (context) {
+                        this.hideEvent.subscribe(listeners.disable, 
+                            listeners, true);
 
-		// Normalize parameter into an array
-		if (! (context instanceof Array)) {
-			if (typeof context == "string") {
-				this.cfg.setProperty("context", [document.getElementById(context)], true);
-			} else { // Assuming this is an element
-				this.cfg.setProperty("context", [context], true);
-			}
-			context = this.cfg.getProperty("context");
-		}
+                        this.destroyEvent.subscribe(listeners.disable, 
+                            listeners, true);
 
+                    }
 
-		// Remove any existing mouseover/mouseout listeners
-        this._removeEventListeners();
+                }
 
-		// Add mouseover/mouseout listeners to context elements
-		this._context = context;
+            }
 
-        var aElements = this._context;
+        },
         
-        if (aElements) {
+        /**
+        * The default event handler fired when the "height" property is changed.
+        * @method configHeight
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configHeight: function (type, args, obj) {
     
-            var nElements = aElements.length;
-            
-            if (nElements > 0) {
-            
-                var i = nElements - 1,
-                    oElement;
-                
-                do {
+            var height = args[0],
+                el = this.innerElement;
     
-                    oElement = aElements[i];
+            Dom.setStyle(el, "height", height);
+            this.cfg.refireEvent("iframe");
     
-                    YAHOO.util.Event.addListener(oElement, "mouseover", this.onContextMouseOver, this);
-                    YAHOO.util.Event.addListener(oElement, "mousemove", this.onContextMouseMove, this);
-                    YAHOO.util.Event.addListener(oElement, "mouseout", this.onContextMouseOut, this);
-                
-                }
-                while(i--);
-            
-            }
+        },
+        
+        /**
+        * The default event handler fired when the "width" property is changed.
+        * @method configWidth
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configWidth: function (type, args, obj) {
     
-        }
+            var width = args[0],
+                el = this.innerElement;
+    
+            Dom.setStyle(el, "width", width);
+            this.cfg.refireEvent("iframe");
+    
+        },
+        
+        /**
+        * The default event handler fired when the "zIndex" property is changed.
+        * @method configzIndex
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configzIndex: function (type, args, obj) {
+            Panel.superclass.configzIndex.call(this, type, args, obj);
 
-	}
-};
+            if (this.mask || this.cfg.getProperty("modal") === true) {
+                var panelZ = Dom.getStyle(this.element, "zIndex");
+                if (!panelZ || isNaN(panelZ)) {
+                    panelZ = 0;
+                }
 
-// END BUILT-IN PROPERTY EVENT HANDLERS //
+                if (panelZ === 0) {
+                    // Recursive call to configzindex (which should be stopped
+                    // from going further because panelZ should no longer === 0)
+                    this.cfg.setProperty("zIndex", 1);
+                } else {
+                    this.stackMask();
+                }
+            }
+        },
 
-// BEGIN BUILT-IN DOM EVENT HANDLERS //
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        /**
+        * Builds the wrapping container around the Panel that is used for 
+        * positioning the shadow and matte underlays. The container element is 
+        * assigned to a  local instance variable called container, and the 
+        * element is reinserted inside of it.
+        * @method buildWrapper
+        */
+        buildWrapper: function () {
 
-/**
-* The default event handler fired when the user moves the mouse while over the context element.
-* @method onContextMouseMove
-* @param {DOMEvent} e	The current DOM event
-* @param {Object}	obj	The object argument
-*/
-YAHOO.widget.Tooltip.prototype.onContextMouseMove = function(e, obj) {
-	obj.pageX = YAHOO.util.Event.getPageX(e);
-	obj.pageY = YAHOO.util.Event.getPageY(e);
-
-};
-
-/**
-* The default event handler fired when the user mouses over the context element.
-* @method onContextMouseOver
-* @param {DOMEvent} e	The current DOM event
-* @param {Object}	obj	The object argument
-*/
-YAHOO.widget.Tooltip.prototype.onContextMouseOver = function(e, obj) {
+            var elementParent = this.element.parentNode,
+                originalElement = this.element,
+                wrapper = document.createElement("div");
 
-	if (obj.hideProcId) {
-		clearTimeout(obj.hideProcId);
-		obj.hideProcId = null;
-	}
-
-	var context = this;
-	YAHOO.util.Event.addListener(context, "mousemove", obj.onContextMouseMove, obj);
-
-	if (context.title) {
-		obj._tempTitle = context.title;
-		context.title = "";
-	}
-
-	/**
-	* The unique process ID associated with the thread responsible for showing the Tooltip.
-	* @type int
-	*/
-	obj.showProcId = obj.doShow(e, context);
-};
-
-/**
-* The default event handler fired when the user mouses out of the context element.
-* @method onContextMouseOut
-* @param {DOMEvent} e	The current DOM event
-* @param {Object}	obj	The object argument
-*/
-YAHOO.widget.Tooltip.prototype.onContextMouseOut = function(e, obj) {
-	var el = this;
+            wrapper.className = Panel.CSS_PANEL_CONTAINER;
+            wrapper.id = originalElement.id + "_c";
 
-	if (obj._tempTitle) {
-		el.title = obj._tempTitle;
-		obj._tempTitle = null;
-	}
-
-	if (obj.showProcId) {
-		clearTimeout(obj.showProcId);
-		obj.showProcId = null;
-	}
-
-	if (obj.hideProcId) {
-		clearTimeout(obj.hideProcId);
-		obj.hideProcId = null;
-	}
-
-
-	obj.hideProcId = setTimeout(function() {
-				obj.hide();
-				}, obj.cfg.getProperty("hidedelay"));
-};
-
-// END BUILT-IN DOM EVENT HANDLERS //
-
-/**
-* Processes the showing of the Tooltip by setting the timeout delay and offset of the Tooltip.
-* @method doShow
-* @param {DOMEvent} e	The current DOM event
-* @return {Number}	The process ID of the timeout function associated with doShow
-*/
-YAHOO.widget.Tooltip.prototype.doShow = function(e, context) {
+            if (elementParent) {
+                elementParent.insertBefore(wrapper, originalElement);
+            }
 
-	var yOffset = 25;
-	if (this.browser == "opera" && context.tagName && context.tagName.toUpperCase() == "A") {
-		yOffset += 12;
-	}
-
-	var me = this;
-	return setTimeout(
-		function() {
-			if (me._tempTitle) {
-				me.setBody(me._tempTitle);
-			} else {
-				me.cfg.refireEvent("text");
-			}
-
-			me.moveTo(me.pageX, me.pageY + yOffset);
-			if (me.cfg.getProperty("preventoverlap")) {
-				me.preventOverlap(me.pageX, me.pageY);
-			}
-
-			YAHOO.util.Event.removeListener(context, "mousemove", me.onContextMouseMove);
-
-			me.show();
-			me.hideProcId = me.doHide();
-		},
-	this.cfg.getProperty("showdelay"));
-};
-
-/**
-* Sets the timeout for the auto-dismiss delay, which by default is 5 seconds, meaning that a tooltip will automatically dismiss itself after 5 seconds of being displayed.
-* @method doHide
-*/
-YAHOO.widget.Tooltip.prototype.doHide = function() {
-	var me = this;
-	return setTimeout(
-		function() {
-			me.hide();
-		},
-		this.cfg.getProperty("autodismissdelay"));
-};
-
-/**
-* Fired when the Tooltip is moved, this event handler is used to prevent the Tooltip from overlapping with its context element.
-* @method preventOverlay
-* @param {Number} pageX	The x coordinate position of the mouse pointer
-* @param {Number} pageY	The y coordinate position of the mouse pointer
-*/
-YAHOO.widget.Tooltip.prototype.preventOverlap = function(pageX, pageY) {
+            wrapper.appendChild(originalElement);
 
-	var height = this.element.offsetHeight;
+            this.element = wrapper;
+            this.innerElement = originalElement;
 
-	var elementRegion = YAHOO.util.Dom.getRegion(this.element);
+            Dom.setStyle(this.innerElement, "visibility", "inherit");
+        },
 
-	elementRegion.top -= 5;
-	elementRegion.left -= 5;
-	elementRegion.right += 5;
-	elementRegion.bottom += 5;
+        /**
+        * Adjusts the size of the shadow based on the size of the element.
+        * @method sizeUnderlay
+        */
+        sizeUnderlay: function () {
 
-	var mousePoint = new YAHOO.util.Point(pageX, pageY);
+            var oUnderlay = this.underlay,
+                oElement;
 
+            if (oUnderlay) {
 
-	if (elementRegion.contains(mousePoint)) {
-		this.cfg.setProperty("y", (pageY-height-5));
-	}
-};
+                oElement = this.element;
 
-/**
-* Removes the Tooltip element from the DOM and sets all child elements to null.
-* @method destroy
-*/
-YAHOO.widget.Tooltip.prototype.destroy = function() {
+                oUnderlay.style.width = oElement.offsetWidth + "px";
+                oUnderlay.style.height = oElement.offsetHeight + "px";
 
-    // Remove any existing mouseover/mouseout listeners
-    this._removeEventListeners();
+            }
 
-    YAHOO.widget.Tooltip.superclass.destroy.call(this);  
+        },
 
-};
+        
+        /**
+        * Registers the Panel's header for drag & drop capability.
+        * @method registerDragDrop
+        */
+        registerDragDrop: function () {
 
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}	The string representation of the Tooltip
-*/
-YAHOO.widget.Tooltip.prototype.toString = function() {
-	return "Tooltip " + this.id;
-};
-/**
-* Panel is an implementation of Overlay that behaves like an OS window, with a draggable header and an optional close icon at the top right.
-* @namespace YAHOO.widget
-* @class Panel
-* @extends YAHOO.widget.Overlay
-* @constructor
-* @param {String}	el	The element ID representing the Panel <em>OR</em>
-* @param {HTMLElement}	el	The element representing the Panel
-* @param {Object}	userConfig	The configuration object literal containing the configuration that should be set for this Panel. See configuration documentation for more details.
-*/
-YAHOO.widget.Panel = function(el, userConfig) {
-	YAHOO.widget.Panel.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Panel, YAHOO.widget.Overlay);
-
-/**
-* Constant representing the default CSS class used for a Panel
-* @property YAHOO.widget.Panel.CSS_PANEL
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Panel.CSS_PANEL = "yui-panel";
+            var me = this;
 
-/**
-* Constant representing the default CSS class used for a Panel's wrapping container
-* @property YAHOO.widget.Panel.CSS_PANEL_CONTAINER
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Panel.CSS_PANEL_CONTAINER = "yui-panel-container";
+            if (this.header) {
 
-/**
-* Constant representing the name of the Panel's events
-* @property YAHOO.widget.Panel._EVENT_TYPES
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Panel._EVENT_TYPES = {
+                if (!DD) {
+                    return;
+                }
 
-	"SHOW_MASK": "showMask",
-	"HIDE_MASK": "hideMask",
-	"DRAG": "drag"
-
-};
-
-/**
-* Constant representing the Panel's configuration properties
-* @property YAHOO.widget.Panel._DEFAULT_CONFIG
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Panel._DEFAULT_CONFIG = {
+                var bDragOnly = (this.cfg.getProperty("dragonly") === true);
+                this.dd = new DD(this.element.id, this.id, {dragOnly: bDragOnly});
 
-    "CLOSE": { 
-        key: "close", 
-        value:true, 
-        validator:YAHOO.lang.isBoolean, 
-        supercedes:["visible"] 
-    },
-
-    "DRAGGABLE": { 
-        key: "draggable", 
-        value:(YAHOO.util.DD ? true : false), 
-        validator:YAHOO.lang.isBoolean, 
-        supercedes:["visible"]  
-    },
-
-    "UNDERLAY": { 
-        key: "underlay", 
-        value:"shadow", 
-        supercedes:["visible"] 
-    },
-
-    "MODAL": { 
-        key: "modal", 
-        value:false, 
-        validator:YAHOO.lang.isBoolean, 
-        supercedes:["visible"] 
-    },
-
-    "KEY_LISTENERS": { 
-        key: "keylisteners", 
-        suppressEvent:true, 
-        supercedes:["visible"] 
-    }
+                if (!this.header.id) {
+                    this.header.id = this.id + "_h";
+                }
 
-};
+                this.dd.startDrag = function () {
 
-/**
-* The Overlay initialization method, which is executed for Overlay and all of its subclasses. This method is automatically called by the constructor, and  sets up all DOM references for pre-existing markup, and creates required markup if it is not already present.
-* @method init
-* @param {String}	el	The element ID representing the Overlay <em>OR</em>
-* @param {HTMLElement}	el	The element representing the Overlay
-* @param {Object}	userConfig	The configuration object literal containing the configuration that should be set for this Overlay. See configuration documentation for more details.
-*/
-YAHOO.widget.Panel.prototype.init = function(el, userConfig) {
-	YAHOO.widget.Panel.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level
+                    var offsetHeight,
+                        offsetWidth,
+                        viewPortWidth,
+                        viewPortHeight,
+                        scrollX,
+                        scrollY;
 
-	this.beforeInitEvent.fire(YAHOO.widget.Panel);
+                    if (YAHOO.env.ua.ie == 6) {
+                        Dom.addClass(me.element,"drag");
+                    }
 
-	YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Panel.CSS_PANEL);
+                    if (me.cfg.getProperty("constraintoviewport")) {
 
-	this.buildWrapper();
+                        var nViewportOffset = Overlay.VIEWPORT_OFFSET;
 
-	if (userConfig) {
-		this.cfg.applyConfig(userConfig, true);
-	}
+                        offsetHeight = me.element.offsetHeight;
+                        offsetWidth = me.element.offsetWidth;
 
-	this.beforeRenderEvent.subscribe(function() {
-		var draggable = this.cfg.getProperty("draggable");
-		if (draggable) {
-			if (! this.header) {
-				this.setHeader("&#160;");
-			}
-		}
-	}, this, true);
+                        viewPortWidth = Dom.getViewportWidth();
+                        viewPortHeight = Dom.getViewportHeight();
 
+                        scrollX = Dom.getDocumentScrollLeft();
+                        scrollY = Dom.getDocumentScrollTop();
 
-    this.renderEvent.subscribe(function() {
+                        if (offsetHeight + nViewportOffset < viewPortHeight) {
+                            this.minY = scrollY + nViewportOffset;
+                            this.maxY = scrollY + viewPortHeight - offsetHeight - nViewportOffset;
+                        } else {
+                            this.minY = scrollY + nViewportOffset;
+                            this.maxY = scrollY + nViewportOffset;
+                        }
 
-        /*
-            If no value for the "width" configuration property was specified, 
-            set it to the offsetWidth. If the "width" is not set, then in IE 
-            you can only drag the panel when you put the cursor on the
-            header's text.
-        */
+                        if (offsetWidth + nViewportOffset < viewPortWidth) {
+                            this.minX = scrollX + nViewportOffset;
+                            this.maxX = scrollX + viewPortWidth - offsetWidth - nViewportOffset;
+                        } else {
+                            this.minX = scrollX + nViewportOffset;
+                            this.maxX = scrollX + nViewportOffset;
+                        }
 
-        var sWidth = this.cfg.getProperty("width");
-        
-        if(!sWidth) {
+                        this.constrainX = true;
+                        this.constrainY = true;
+                    } else {
+                        this.constrainX = false;
+                        this.constrainY = false;
+                    }
 
-            this.cfg.setProperty("width", (this.element.offsetWidth + "px"));
-        
-        }
-    
-    });
+                    me.dragEvent.fire("startDrag", arguments);
+                };
 
+                this.dd.onDrag = function () {
+                    me.syncPosition();
+                    me.cfg.refireEvent("iframe");
+                    if (this.platform == "mac" && YAHOO.env.ua.gecko) {
+                        this.showMacGeckoScrollbars();
+                    }
 
-	var me = this;
+                    me.dragEvent.fire("onDrag", arguments);
+                };
 
-	var doBlur = function() {
-		this.blur();
-	};
+                this.dd.endDrag = function () {
 
-	this.showMaskEvent.subscribe(function() {
+                    if (YAHOO.env.ua.ie == 6) {
+                        Dom.removeClass(me.element,"drag");
+                    }
 
-		var checkFocusable = function(el) {
+                    me.dragEvent.fire("endDrag", arguments);
+                    me.moveEvent.fire(me.cfg.getProperty("xy"));
 
-            var sTagName = el.tagName.toUpperCase(),
-                bFocusable = false;
-            
-            switch(sTagName) {
-            
-                case "A":
-                case "BUTTON":
-                case "SELECT":
-                case "TEXTAREA":
-
-                    if (! YAHOO.util.Dom.isAncestor(me.element, el)) {
-                        YAHOO.util.Event.addListener(el, "focus", doBlur, el, true);
-                        bFocusable = true;
-                    }
+                };
 
-                break;
+                this.dd.setHandleElId(this.header.id);
+                this.dd.addInvalidHandleType("INPUT");
+                this.dd.addInvalidHandleType("SELECT");
+                this.dd.addInvalidHandleType("TEXTAREA");
+            }
+        },
+        
+        /**
+        * Builds the mask that is laid over the document when the Panel is 
+        * configured to be modal.
+        * @method buildMask
+        */
+        buildMask: function () {
+            var oMask = this.mask;
+            if (!oMask) {
+                if (!m_oMaskTemplate) {
+                    m_oMaskTemplate = document.createElement("div");
+                    m_oMaskTemplate.className = "mask";
+                    m_oMaskTemplate.innerHTML = "&#160;";
+                }
+                oMask = m_oMaskTemplate.cloneNode(true);
+                oMask.id = this.id + "_mask";
 
-                case "INPUT":
+                document.body.insertBefore(oMask, document.body.firstChild);
 
-                    if (el.type != "hidden" && ! YAHOO.util.Dom.isAncestor(me.element, el)) {
+                this.mask = oMask;
 
-                        YAHOO.util.Event.addListener(el, "focus", doBlur, el, true);
-                        bFocusable = true;
+                // Stack mask based on the element zindex
+                this.stackMask();
+            }
+        },
 
-                    }
+        /**
+        * Hides the modality mask.
+        * @method hideMask
+        */
+        hideMask: function () {
+            if (this.cfg.getProperty("modal") && this.mask) {
+                this.mask.style.display = "none";
+                this.hideMaskEvent.fire();
+                Dom.removeClass(document.body, "masked");
+            }
+        },
 
-                break;
-            
+        /**
+        * Shows the modality mask.
+        * @method showMask
+        */
+        showMask: function () {
+            if (this.cfg.getProperty("modal") && this.mask) {
+                Dom.addClass(document.body, "masked");
+                this.sizeMask();
+                this.mask.style.display = "block";
+                this.showMaskEvent.fire();
             }
+        },
 
-            return bFocusable;
+        /**
+        * Sets the size of the modality mask to cover the entire scrollable 
+        * area of the document
+        * @method sizeMask
+        */
+        sizeMask: function () {
+            if (this.mask) {
+                this.mask.style.height = Dom.getDocumentHeight() + "px";
+                this.mask.style.width = Dom.getDocumentWidth() + "px";
+            }
+        },
 
-		};
+        /**
+         * Sets the zindex of the mask, if it exists, based on the zindex of 
+         * the Panel element. The zindex of the mask is set to be one less 
+         * than the Panel element's zindex.
+         * 
+         * <p>NOTE: This method will not bump up the zindex of the Panel
+         * to ensure that the mask has a non-negative zindex. If you require the
+         * mask zindex to be 0 or higher, the zindex of the Panel 
+         * should be set to a value higher than 0, before this method is called.
+         * </p>
+         * @method stackMask
+         */
+        stackMask: function() {
+            if (this.mask) {
+                var panelZ = Dom.getStyle(this.element, "zIndex");
+                if (!YAHOO.lang.isUndefined(panelZ) && !isNaN(panelZ)) {
+                    Dom.setStyle(this.mask, "zIndex", panelZ - 1);
+                }
+            }
+        },
 
-		this.focusableElements = YAHOO.util.Dom.getElementsBy(checkFocusable);
-	}, this, true);
+        /**
+        * Renders the Panel by inserting the elements that are not already in 
+        * the main Panel into their correct places. Optionally appends the 
+        * Panel to the specified node prior to the render's execution. NOTE: 
+        * For Panels without existing markup, the appendToNode argument is 
+        * REQUIRED. If this argument is ommitted and the current element is 
+        * not present in the document, the function will return false, 
+        * indicating that the render was a failure.
+        * @method render
+        * @param {String} appendToNode The element id to which the Module 
+        * should be appended to prior to rendering <em>OR</em>
+        * @param {HTMLElement} appendToNode The element to which the Module 
+        * should be appended to prior to rendering
+        * @return {boolean} Success or failure of the render
+        */
+        render: function (appendToNode) {
 
-	this.hideMaskEvent.subscribe(function() {
-		for (var i=0;i<this.focusableElements.length;i++) {
-			var el2 = this.focusableElements[i];
-			YAHOO.util.Event.removeListener(el2, "focus", doBlur);
-		}
-	}, this, true);
-
-	this.beforeShowEvent.subscribe(function() {
-		this.cfg.refireEvent("underlay");
-	}, this, true);
-	this.initEvent.fire(YAHOO.widget.Panel);
-};
+            return Panel.superclass.render.call(this, 
+                appendToNode, this.innerElement);
 
-/**
-* Initializes the custom events for Module which are fired automatically at appropriate times by the Module class.
-*/
-YAHOO.widget.Panel.prototype.initEvents = function() {
-	YAHOO.widget.Panel.superclass.initEvents.call(this);
+        },
+        
+        /**
+        * Removes the Panel element from the DOM and sets all child elements
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
+            
+            this.removeMask();
+        
+            if (this.close) {
+            
+                Event.purgeElement(this.close);
+        
+            }
+        
+            Panel.superclass.destroy.call(this);  
+        
+        },
+        
+        /**
+        * Returns a String representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Panel.
+        */
+        toString: function () {
+            return "Panel " + this.id;
+        }
+    
+    });
 
-    var EVENT_TYPES = YAHOO.widget.Panel._EVENT_TYPES;
+}());
 
-	/**
-	* CustomEvent fired after the modality mask is shown
-	* @event showMaskEvent
-	*/
-	this.showMaskEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.SHOW_MASK, this);
-
-	/**
-	* CustomEvent fired after the modality mask is hidden
-	* @event hideMaskEvent
-	*/
-	this.hideMaskEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.HIDE_MASK, this);
-
-	/**
-	* CustomEvent when the Panel is dragged
-	* @event dragEvent
-	*/
-	this.dragEvent = new YAHOO.util.CustomEvent(EVENT_TYPES.DRAG, this);
-};
-
-/**
-* Initializes the class's configurable properties which can be changed using the Panel's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Panel.prototype.initDefaultConfig = function() {
-	YAHOO.widget.Panel.superclass.initDefaultConfig.call(this);
+(function () {
 
-    // Add panel config properties //
+    /**
+    * Dialog is an implementation of Panel that can be used to submit form 
+    * data. Built-in functionality for buttons with event handlers is included, 
+    * and button sets can be build dynamically, or the preincluded ones for 
+    * Submit/Cancel and OK/Cancel can be utilized. Forms can be processed in 3
+    * ways -- via an asynchronous Connection utility call, a simple form 
+    * POST or GET, or manually.
+    * @namespace YAHOO.widget
+    * @class Dialog
+    * @extends YAHOO.widget.Panel
+    * @constructor
+    * @param {String} el The element ID representing the Dialog <em>OR</em>
+    * @param {HTMLElement} el The element representing the Dialog
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this Dialog. See configuration 
+    * documentation for more details.
+    */
+    YAHOO.widget.Dialog = function (el, userConfig) {
+    
+        YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);
+    
+    };
 
-    var DEFAULT_CONFIG = YAHOO.widget.Panel._DEFAULT_CONFIG;
 
-	/**
-	* True if the Panel should display a "close" button
-	* @config close
-	* @type Boolean
-	* @default true
-	*/
-    this.cfg.addProperty(
-                DEFAULT_CONFIG.CLOSE.key,
-                { 
-                    handler: this.configClose, 
-                    value: DEFAULT_CONFIG.CLOSE.value, 
-                    validator: DEFAULT_CONFIG.CLOSE.validator, 
-                    supercedes: DEFAULT_CONFIG.CLOSE.supercedes
-                } 
-            );
-
-	/**
-	* True if the Panel should be draggable.  Default value is "true" if the Drag and Drop utility is included, otherwise it is "false."
-	* @config draggable
-	* @type Boolean
-	* @default true
-	*/
-    this.cfg.addProperty(
-                DEFAULT_CONFIG.DRAGGABLE.key, 
-                { 
-                    handler: this.configDraggable, 
-                    value: DEFAULT_CONFIG.DRAGGABLE.value, 
-                    validator: DEFAULT_CONFIG.DRAGGABLE.validator, 
-                    supercedes: DEFAULT_CONFIG.DRAGGABLE.supercedes 
-                } 
-            );
-
-	/**
-	* Sets the type of underlay to display for the Panel. Valid values are "shadow", "matte", and "none".
-	* @config underlay
-	* @type String
-	* @default shadow
-	*/
-    this.cfg.addProperty(
-                DEFAULT_CONFIG.UNDERLAY.key, 
-                { 
-                    handler: this.configUnderlay, 
-                    value: DEFAULT_CONFIG.UNDERLAY.value, 
-                    supercedes: DEFAULT_CONFIG.UNDERLAY.supercedes
-                } 
-            );
-
-	/**
-	* True if the Panel should be displayed in a modal fashion, automatically creating a transparent mask over the document that will not be removed until the Panel is dismissed.
-	* @config modal
-	* @type Boolean
-	* @default false
-	*/
-    this.cfg.addProperty(
-                DEFAULT_CONFIG.MODAL.key,
-                { 
-                    handler: this.configModal, 
-                    value: DEFAULT_CONFIG.MODAL.value,
-                    validator: DEFAULT_CONFIG.MODAL.validator, 
-                    supercedes: DEFAULT_CONFIG.MODAL.supercedes 
-                } 
-            );
-
-	/**
-	* A KeyListener (or array of KeyListeners) that will be enabled when the Panel is shown, and disabled when the Panel is hidden.
-	* @config keylisteners
-	* @type YAHOO.util.KeyListener[]
-	* @default null
-	*/
-    this.cfg.addProperty(
-                DEFAULT_CONFIG.KEY_LISTENERS.key, 
-                { 
-                    handler: this.configKeyListeners, 
-                    suppressEvent: DEFAULT_CONFIG.KEY_LISTENERS.suppressEvent, 
-                    supercedes: DEFAULT_CONFIG.KEY_LISTENERS.supercedes
-                } 
-            );
-
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "close" property is changed. The method controls the appending or hiding of the close icon at the top right of the Panel.
-* @method configClose
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Panel.prototype.configClose = function(type, args, obj) {
-	var val = args[0];
+    var Event = YAHOO.util.Event,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Dom = YAHOO.util.Dom,
+        KeyListener = YAHOO.util.KeyListener,
+        Connect = YAHOO.util.Connect,
+        Dialog = YAHOO.widget.Dialog,
+        Lang = YAHOO.lang,
+
+        /**
+        * Constant representing the name of the Dialog's events
+        * @property EVENT_TYPES
+        * @private
+        * @final
+        * @type Object
+        */
+        EVENT_TYPES = {
+        
+            "BEFORE_SUBMIT": "beforeSubmit",
+            "SUBMIT": "submit",
+            "MANUAL_SUBMIT": "manualSubmit",
+            "ASYNC_SUBMIT": "asyncSubmit",
+            "FORM_SUBMIT": "formSubmit",
+            "CANCEL": "cancel"
+        
+        },
+        
+        /**
+        * Constant representing the Dialog's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "POST_METHOD": { 
+                key: "postmethod", 
+                value: "async" 
+            },
+            
+            "BUTTONS": { 
+                key: "buttons", 
+                value: "none" 
+            }
+        };    
 
-	var doHide = function(e, obj) {
-		obj.hide();
-	};
-
-	if (val) {
-		if (! this.close) {
-			this.close = document.createElement("span");
-			YAHOO.util.Dom.addClass(this.close, "container-close");
-			this.close.innerHTML = "&#160;";
-			this.innerElement.appendChild(this.close);
-			YAHOO.util.Event.addListener(this.close, "click", doHide, this);
-		} else {
-			this.close.style.display = "block";
-		}
-	} else {
-		if (this.close) {
-			this.close.style.display = "none";
-		}
-	}
-};
-
-/**
-* The default event handler fired when the "draggable" property is changed.
-* @method configDraggable
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Panel.prototype.configDraggable = function(type, args, obj) {
+    /**
+    * Constant representing the default CSS class used for a Dialog
+    * @property YAHOO.widget.Dialog.CSS_DIALOG
+    * @static
+    * @final
+    * @type String
+    */
+    Dialog.CSS_DIALOG = "yui-dialog";
+
+    function removeButtonEventHandlers() {
+
+        var aButtons = this._aButtons,
+            nButtons,
+            oButton,
+            i;
+
+        if (Lang.isArray(aButtons)) {
+            nButtons = aButtons.length;
 
-	var val = args[0];
-	if (val) {
+            if (nButtons > 0) {
+                i = nButtons - 1;
+                do {
+                    oButton = aButtons[i];
 
-        if (!YAHOO.util.DD) {
+                    if (YAHOO.widget.Button && oButton instanceof YAHOO.widget.Button) {
+                        oButton.destroy();
+                    }
+                    else if (oButton.tagName.toUpperCase() == "BUTTON") {
+                        Event.purgeElement(oButton);
+                        Event.purgeElement(oButton, false);
+                    }
+                }
+                while (i--);
+            }
+        }
+    }
     
+    YAHOO.extend(Dialog, YAHOO.widget.Panel, { 
 
-            this.cfg.setProperty("draggable", false);
+        
+        /**
+        * @property form
+        * @description Object reference to the Dialog's 
+        * <code>&#60;form&#62;</code> element.
+        * @default null 
+        * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-40002357">HTMLFormElement</a>
+        */
+        form: null,
     
-            return;
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the Dialog's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+            Dialog.superclass.initDefaultConfig.call(this);
+        
+            /**
+            * The internally maintained callback object for use with the 
+            * Connection utility
+            * @property callback
+            * @type Object
+            */
+            this.callback = {
+    
+                /**
+                * The function to execute upon success of the 
+                * Connection submission
+                * @property callback.success
+                * @type Function
+                */
+                success: null,
+    
+                /**
+                * The function to execute upon failure of the 
+                * Connection submission
+                * @property callback.failure
+                * @type Function
+                */
+                failure: null,
+    
+                /**
+                * The arbitraty argument or arguments to pass to the Connection 
+                * callback functions
+                * @property callback.argument
+                * @type Object
+                */
+                argument: null
+    
+            };
         
-        }
 
-		if (this.header) {
-			YAHOO.util.Dom.setStyle(this.header,"cursor","move");
-			this.registerDragDrop();
-		}
-	} else {
-		if (this.dd) {
-			this.dd.unreg();
-		}
-		if (this.header) {
-			YAHOO.util.Dom.setStyle(this.header,"cursor","auto");
-		}
-	}
-};
-
-/**
-* The default event handler fired when the "underlay" property is changed.
-* @method configUnderlay
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Panel.prototype.configUnderlay = function(type, args, obj) {
-	var val = args[0];
+            // Add form dialog config properties //
+            
+            /**
+            * The method to use for posting the Dialog's form. Possible values 
+            * are "async", "form", and "manual".
+            * @config postmethod
+            * @type String
+            * @default async
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.POST_METHOD.key, {
+                handler: this.configPostMethod, 
+                value: DEFAULT_CONFIG.POST_METHOD.value, 
+                validator: function (val) {
+                    if (val != "form" && val != "async" && val != "none" && 
+                        val != "manual") {
+                        return false;
+                    } else {
+                        return true;
+                    }
+                }
+            });
+            
+            /**
+            * Array of object literals, each containing a set of properties 
+            * defining a button to be appended into the Dialog's footer.
+            * Each button object in the buttons array can have three properties:
+            * <dt>text:</dt>
+            * <dd>The text that will display on the face of the button.  <em>
+            * Please note:</em> As of version 2.3, the text can include 
+            * HTML.</dd>
+            * <dt>handler:</dt>
+            * <dd>Can be either:
+            *     <ol>
+            *         <li>A reference to a function that should fire when the 
+            * button is clicked.  (In this case scope of this function is 
+            * always its Dialog instance.)</li>
+            *         <li>An object literal representing the code to be 
+            * executed when the button is clicked.  Format:<br> <code> {<br>  
+            * <strong>fn:</strong> Function,   &#47;&#47; The handler to call 
+            * when  the event fires.<br> <strong>obj:</strong> Object, 
+            * &#47;&#47; An  object to pass back to the handler.<br> <strong>
+            * scope:</strong>  Object &#47;&#47; The object to use for the 
+            * scope of the handler. <br> } </code> <br><em>Please note: this 
+            * functionality was added in version 2.3.</em></li>
+            *     </ol>
+            * </dd>
+            * <dt>isDefault:</dt>
+            * <dd>An optional boolean value that specifies that a button 
+            * should be highlighted and focused by default.</dd>
+            * @config buttons
+            * @type {Array|String}
+            * @default "none"
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.BUTTONS.key, {
+                handler: this.configButtons,
+                value: DEFAULT_CONFIG.BUTTONS.value
+            }); 
+            
+        },
+        
+        /**
+        * Initializes the custom events for Dialog which are fired 
+        * automatically at appropriate times by the Dialog class.
+        * @method initEvents
+        */
+        initEvents: function () {
+            Dialog.superclass.initEvents.call(this);
+        
+            var SIGNATURE = CustomEvent.LIST;
+        
+            /**
+            * CustomEvent fired prior to submission
+            * @event beforeSubmitEvent
+            */ 
+            this.beforeSubmitEvent = 
+                this.createEvent(EVENT_TYPES.BEFORE_SUBMIT);
+            this.beforeSubmitEvent.signature = SIGNATURE;
+            
+            /**
+            * CustomEvent fired after submission
+            * @event submitEvent
+            */
+            this.submitEvent = this.createEvent(EVENT_TYPES.SUBMIT);
+            this.submitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired prior to manual submission
+            * @event manualSubmitEvent
+            */
+            this.manualSubmitEvent = 
+                this.createEvent(EVENT_TYPES.MANUAL_SUBMIT);
+            this.manualSubmitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired prior to asynchronous submission
+            * @event asyncSubmitEvent
+            */ 
+            this.asyncSubmitEvent = this.createEvent(EVENT_TYPES.ASYNC_SUBMIT);
+            this.asyncSubmitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired prior to form-based submission
+            * @event formSubmitEvent
+            */
+            this.formSubmitEvent = this.createEvent(EVENT_TYPES.FORM_SUBMIT);
+            this.formSubmitEvent.signature = SIGNATURE;
+        
+            /**
+            * CustomEvent fired after cancel
+            * @event cancelEvent
+            */
+            this.cancelEvent = this.createEvent(EVENT_TYPES.CANCEL);
+            this.cancelEvent.signature = SIGNATURE;
+        
+        },
+        
+        /**
+        * The Dialog initialization method, which is executed for Dialog and 
+        * all of its subclasses. This method is automatically called by the 
+        * constructor, and  sets up all DOM references for pre-existing markup, 
+        * and creates required markup if it is not already present.
+        * @method init
+        * @param {String} el The element ID representing the Dialog <em>OR</em>
+        * @param {HTMLElement} el The element representing the Dialog
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this Dialog. 
+        * See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
 
-	switch (val.toLowerCase()) {
-		case "shadow":
-			YAHOO.util.Dom.removeClass(this.element, "matte");
-			YAHOO.util.Dom.addClass(this.element, "shadow");
-
-			if (! this.underlay) { // create if not already in DOM
-				this.underlay = document.createElement("div");
-				this.underlay.className = "underlay";
-				this.underlay.innerHTML = "&#160;";
-				this.element.appendChild(this.underlay);
-			}
-
-			this.sizeUnderlay();
-			break;
-		case "matte":
-			YAHOO.util.Dom.removeClass(this.element, "shadow");
-			YAHOO.util.Dom.addClass(this.element, "matte");
-			break;
-		default:
-			YAHOO.util.Dom.removeClass(this.element, "shadow");
-			YAHOO.util.Dom.removeClass(this.element, "matte");
-			break;
-	}
-};
-
-/**
-* The default event handler fired when the "modal" property is changed. This handler subscribes or unsubscribes to the show and hide events to handle the display or hide of the modality mask.
-* @method configModal
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Panel.prototype.configModal = function(type, args, obj) {
-	var modal = args[0];
+            /*
+                 Note that we don't pass the user config in here yet because 
+                 we only want it executed once, at the lowest subclass level
+            */
 
-	if (modal) {
-		this.buildMask();
+            Dialog.superclass.init.call(this, el/*, userConfig*/); 
+        
+            this.beforeInitEvent.fire(Dialog);
+        
+            Dom.addClass(this.element, Dialog.CSS_DIALOG);
+        
+            this.cfg.setProperty("visible", false);
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            this.showEvent.subscribe(this.focusFirst, this, true);
+            this.beforeHideEvent.subscribe(this.blurButtons, this, true);
 
-		if (! YAHOO.util.Config.alreadySubscribed( this.beforeShowEvent, this.showMask, this ) ) {
-			this.beforeShowEvent.subscribe(this.showMask, this, true);
-		}
-		if (! YAHOO.util.Config.alreadySubscribed( this.hideEvent, this.hideMask, this) ) {
-			this.hideEvent.subscribe(this.hideMask, this, true);
-		}
-		if (! YAHOO.util.Config.alreadySubscribed( YAHOO.widget.Overlay.windowResizeEvent, this.sizeMask, this ) ) {
-			YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask, this, true);
-		}
-		if (! YAHOO.util.Config.alreadySubscribed( this.destroyEvent, this.removeMask, this) ) {
-			this.destroyEvent.subscribe(this.removeMask, this, true);
-		}
-
-		this.cfg.refireEvent("zIndex");
-	} else {
-		this.beforeShowEvent.unsubscribe(this.showMask, this);
-		this.hideEvent.unsubscribe(this.hideMask, this);
-		YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
-		this.destroyEvent.unsubscribe(this.removeMask, this);
-	}
-};
-
-/**
-* Removes the modality mask.
-* @method removeMask
-*/
-YAHOO.widget.Panel.prototype.removeMask = function() {
+            this.subscribe("changeBody", this.registerForm);
+        
+            this.initEvent.fire(Dialog);
+        },
+        
+        /**
+        * Submits the Dialog's form depending on the value of the 
+        * "postmethod" configuration property.  <strong>Please note:
+        * </strong> As of version 2.3 this method will automatically handle 
+        * asyncronous file uploads should the Dialog instance's form contain 
+        * <code>&#60;input type="file"&#62;</code> elements.  If a Dialog 
+        * instance will be handling asyncronous file uploads, its 
+        * <code>callback</code> property will need to be setup with a 
+        * <code>upload</code> handler rather than the standard 
+        * <code>success</code> and, or <code>failure</code> handlers.  For more 
+        * information, see the <a href="http://developer.yahoo.com/yui/
+        * connection/#file">Connection Manager documenation on file uploads</a>.
+        * @method doSubmit
+        */
+        doSubmit: function () {
+    
+            var oForm = this.form,
+                bUseFileUpload = false,
+                bUseSecureFileUpload = false,
+                aElements,
+                nElements,
+                i,
+                sMethod;
 
-    var oMask = this.mask;
 
-    if(oMask) {
+            switch (this.cfg.getProperty("postmethod")) {
     
-        /*
-            Hide the mask before destroying it to ensure that DOM
-            event handlers on focusable elements get removed.
-        */
+            case "async":
 
-        this.hideMask();
-    
-        var oParentNode = oMask.parentNode;
+                aElements = oForm.elements;
+                nElements = aElements.length;
 
-        if(oParentNode) {
+                if (nElements > 0) {
+                
+                    i = nElements - 1;
+                
+                    do {
+                    
+                        if (aElements[i].type == "file") {
+                        
+                            bUseFileUpload = true;
+                            break;
+                        
+                        }
+                    
+                    }
+                    while(i--);
+                
+                }
 
-            oParentNode.removeChild(oMask);
+                if (bUseFileUpload && YAHOO.env.ua.ie && this.isSecure) {
 
-        }
+                    bUseSecureFileUpload = true;
+                
+                }
 
-        this.mask = null;
-    }
-    
-};
+                sMethod = 
+                    (oForm.getAttribute("method") || "POST").toUpperCase();
 
-/**
-* The default event handler fired when the "keylisteners" property is changed.
-* @method configKeyListeners
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Panel.prototype.configKeyListeners = function(type, args, obj) {
-	var listeners = args[0];
+                Connect.setForm(oForm, bUseFileUpload, bUseSecureFileUpload);
 
-	if (listeners) {
-		if (listeners instanceof Array) {
-			for (var i=0;i<listeners.length;i++) {
-				var listener = listeners[i];
-
-				if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, listener.enable, listener)) {
-					this.showEvent.subscribe(listener.enable, listener, true);
-				}
-				if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, listener.disable, listener)) {
-					this.hideEvent.subscribe(listener.disable, listener, true);
-					this.destroyEvent.subscribe(listener.disable, listener, true);
-				}
-			}
-		} else {
-			if (! YAHOO.util.Config.alreadySubscribed(this.showEvent, listeners.enable, listeners)) {
-				this.showEvent.subscribe(listeners.enable, listeners, true);
-			}
-			if (! YAHOO.util.Config.alreadySubscribed(this.hideEvent, listeners.disable, listeners)) {
-				this.hideEvent.subscribe(listeners.disable, listeners, true);
-				this.destroyEvent.subscribe(listeners.disable, listeners, true);
-			}
-		}
-	}
-};
-
-/**
-* The default event handler fired when the "height" property is changed.
-* @method configHeight
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Panel.prototype.configHeight = function(type, args, obj) {
-	var height = args[0];
-	var el = this.innerElement;
-	YAHOO.util.Dom.setStyle(el, "height", height);
-	this.cfg.refireEvent("underlay");
-	this.cfg.refireEvent("iframe");
-};
-
-/**
-* The default event handler fired when the "width" property is changed.
-* @method configWidth
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Panel.prototype.configWidth = function(type, args, obj) {
-	var width = args[0];
-	var el = this.innerElement;
-	YAHOO.util.Dom.setStyle(el, "width", width);
-	this.cfg.refireEvent("underlay");
-	this.cfg.refireEvent("iframe");
-};
-
-/**
-* The default event handler fired when the "zIndex" property is changed.
-* @method configzIndex
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Panel.prototype.configzIndex = function(type, args, obj) {
-	YAHOO.widget.Panel.superclass.configzIndex.call(this, type, args, obj);
+                Connect.asyncRequest(sMethod, oForm.getAttribute("action"), 
+                    this.callback);
 
-	var maskZ = 0;
-	var currentZ = YAHOO.util.Dom.getStyle(this.element, "zIndex");
+                this.asyncSubmitEvent.fire();
 
-	if (this.mask) {
-		if (! currentZ || isNaN(currentZ)) {
-			currentZ = 0;
-		}
+                break;
 
-		if (currentZ === 0) {
-			this.cfg.setProperty("zIndex", 1);
-		} else {
-			maskZ = currentZ - 1;
-			YAHOO.util.Dom.setStyle(this.mask, "zIndex", maskZ);
-		}
+            case "form":
 
-	}
-};
+                oForm.submit();
+                this.formSubmitEvent.fire();
 
-// END BUILT-IN PROPERTY EVENT HANDLERS //
+                break;
 
+            case "none":
+            case "manual":
 
-/**
-* Builds the wrapping container around the Panel that is used for positioning the shadow and matte underlays. The container element is assigned to a  local instance variable called container, and the element is reinserted inside of it.
-* @method buildWrapper
-*/
-YAHOO.widget.Panel.prototype.buildWrapper = function() {
-	var elementParent = this.element.parentNode;
-	var originalElement = this.element;
+                this.manualSubmitEvent.fire();
 
-	var wrapper = document.createElement("div");
-	wrapper.className = YAHOO.widget.Panel.CSS_PANEL_CONTAINER;
-	wrapper.id = originalElement.id + "_c";
+                break;
+    
+            }
+    
+        },
+        
+        
+        /**
+        * Prepares the Dialog's internal FORM object, creating one if one is
+        * not currently present.
+        * @method registerForm
+        */
+        registerForm: function () {
+    
+            var form = this.element.getElementsByTagName("form")[0],
+                me = this,
+                firstElement,
+                lastElement;
 
-	if (elementParent) {
-		elementParent.insertBefore(wrapper, originalElement);
-	}
 
-	wrapper.appendChild(originalElement);
+            if (this.form) {
+                if (this.form == form && 
+                    Dom.isAncestor(this.element, this.form)) {
+    
+                    return;
+                } else {
+                    Event.purgeElement(this.form);
+                    this.form = null;                
+                }
+            }
 
-	this.element = wrapper;
-	this.innerElement = originalElement;
+            if (!form) {
+                form = document.createElement("form");
+                form.name = "frm_" + this.id;
 
-	YAHOO.util.Dom.setStyle(this.innerElement, "visibility", "inherit");
-};
+                this.body.appendChild(form);
+            }
 
-/**
-* Adjusts the size of the shadow based on the size of the element.
-* @method sizeUnderlay
-*/
-YAHOO.widget.Panel.prototype.sizeUnderlay = function() {
-	if (this.underlay && this.browser != "gecko" && this.browser != "safari") {
-		this.underlay.style.width = this.innerElement.offsetWidth + "px";
-		this.underlay.style.height = this.innerElement.offsetHeight + "px";
-	}
-};
-
-/**
-* Event handler fired when the resize monitor element is resized.
-* @method onDomResize
-* @param {DOMEvent} e	The resize DOM event
-* @param {Object} obj	The scope object
-*/
-YAHOO.widget.Panel.prototype.onDomResize = function(e, obj) {
-	YAHOO.widget.Panel.superclass.onDomResize.call(this, e, obj);
-	var me = this;
-	setTimeout(function() {
-		me.sizeUnderlay();
-	}, 0);
-};
-
-/**
-* Registers the Panel's header for drag & drop capability.
-* @method registerDragDrop
-*/
-YAHOO.widget.Panel.prototype.registerDragDrop = function() {
-	if (this.header) {
+            if (form) {
+                this.form = form;
 
-        if(!YAHOO.util.DD) {
+                Event.on(form, "submit", function (e) {
+                    Event.stopEvent(e);
+                    this.submit();
+                    this.form.blur();
+                }, this, true);
+
+                this.firstFormElement = function () {
+                    var f, el, nElements = form.elements.length;
+
+                    for (f = 0; f < nElements; f++) {
+                        el = form.elements[f];
+                        if (el.focus && !el.disabled && el.type != "hidden") {
+                            return el;
+                        }
+                    }
+                    return null;
+                }();
+            
+                this.lastFormElement = function () {
+                    var f, el, nElements = form.elements.length;
+                    
+                    for (f = nElements - 1; f >= 0; f--) {
+                        el = form.elements[f];
+                        if (el.focus && !el.disabled && el.type != "hidden") {
+                            return el;
+                        }
+                    }
+                    return null;
+                }();
+            
+                if (this.cfg.getProperty("modal")) {
+                    firstElement = this.firstFormElement || this.firstButton;
+                    if (firstElement) {
+                        this.preventBackTab = new KeyListener(firstElement, 
+                            { shift: true, keys: 9 }, 
+                            { fn: me.focusLast, scope: me, 
+                            correctScope: true });
+    
+                        this.showEvent.subscribe(this.preventBackTab.enable, 
+                            this.preventBackTab, true);
+    
+                        this.hideEvent.subscribe(this.preventBackTab.disable, 
+                            this.preventBackTab, true);
+                    }
+            
+                    lastElement = this.lastButton || this.lastFormElement;
+    
+                    if (lastElement) {
+                        this.preventTabOut = new KeyListener(lastElement, 
+                            { shift: false, keys: 9 }, 
+                            { fn: me.focusFirst, scope: me, 
+                            correctScope: true });
+    
+                        this.showEvent.subscribe(this.preventTabOut.enable, 
+                            this.preventTabOut, true);
+    
+                        this.hideEvent.subscribe(this.preventTabOut.disable, 
+                            this.preventTabOut, true);
+                    }
+                }
+            }
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * The default event handler fired when the "close" property is 
+        * changed. The method controls the appending or hiding of the close
+        * icon at the top right of the Dialog.
+        * @method configClose
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For 
+        * configuration handlers, args[0] will equal the newly applied value 
+        * for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configClose: function (type, args, obj) {
+            var val = args[0];
+        
+            function doCancel(e, obj) {
+                obj.cancel();
+            }
+        
+            if (val) {
+                if (! this.close) {
+                    this.close = document.createElement("div");
+                    Dom.addClass(this.close, "container-close");
+        
+                    this.close.innerHTML = "&#160;";
+                    this.innerElement.appendChild(this.close);
+                    Event.on(this.close, "click", doCancel, this);
+                } else {
+                    this.close.style.display = "block";
+                }
+            } else {
+                if (this.close) {
+                    this.close.style.display = "none";
+                }
+            }
+        },
+        
+        /**
+        * The default event handler for the "buttons" configuration property
+        * @method configButtons
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configButtons: function (type, args, obj) {
+    
+            var Button = YAHOO.widget.Button,
+                aButtons = args[0],
+                oInnerElement = this.innerElement,
+                oButton,
+                oButtonEl,
+                oYUIButton,
+                nButtons,
+                oSpan,
+                oFooter,
+                i;
 
+            removeButtonEventHandlers.call(this);
+            
+            this._aButtons = null;
 
-            return;
-        
-        }
+            if (Lang.isArray(aButtons)) {
 
-		this.dd = new YAHOO.util.DD(this.element.id, this.id);
+                oSpan = document.createElement("span");
+                oSpan.className = "button-group";
 
-		if (! this.header.id) {
-			this.header.id = this.id + "_h";
-		}
-
-		var me = this;
-
-		this.dd.startDrag = function() {
-
-			if (me.browser == "ie") {
-				YAHOO.util.Dom.addClass(me.element,"drag");
-			}
-
-			if (me.cfg.getProperty("constraintoviewport")) {
-				var offsetHeight = me.element.offsetHeight;
-				var offsetWidth = me.element.offsetWidth;
-
-				var viewPortWidth = YAHOO.util.Dom.getViewportWidth();
-				var viewPortHeight = YAHOO.util.Dom.getViewportHeight();
-
-				var scrollX = window.scrollX || document.documentElement.scrollLeft;
-				var scrollY = window.scrollY || document.documentElement.scrollTop;
-
-				var topConstraint = scrollY + 10;
-				var leftConstraint = scrollX + 10;
-				var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;
-				var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;
-
-				this.minX = leftConstraint;
-				this.maxX = rightConstraint;
-				this.constrainX = true;
-
-				this.minY = topConstraint;
-				this.maxY = bottomConstraint;
-				this.constrainY = true;
-			} else {
-				this.constrainX = false;
-				this.constrainY = false;
-			}
-
-			me.dragEvent.fire("startDrag", arguments);
-		};
-
-		this.dd.onDrag = function() {
-			me.syncPosition();
-			me.cfg.refireEvent("iframe");
-			if (this.platform == "mac" && this.browser == "gecko") {
-				this.showMacGeckoScrollbars();
-			}
-
-			me.dragEvent.fire("onDrag", arguments);
-		};
-
-		this.dd.endDrag = function() {
-			if (me.browser == "ie") {
-				YAHOO.util.Dom.removeClass(me.element,"drag");
-			}
-
-			me.dragEvent.fire("endDrag", arguments);
-		};
-
-		this.dd.setHandleElId(this.header.id);
-		this.dd.addInvalidHandleType("INPUT");
-		this.dd.addInvalidHandleType("SELECT");
-		this.dd.addInvalidHandleType("TEXTAREA");
-	}
-};
-
-/**
-* Builds the mask that is laid over the document when the Panel is configured to be modal.
-* @method buildMask
-*/
-YAHOO.widget.Panel.prototype.buildMask = function() {
-	if (! this.mask) {
-		this.mask = document.createElement("div");
-		this.mask.id = this.id + "_mask";
-		this.mask.className = "mask";
-		this.mask.innerHTML = "&#160;";
-
-		var maskClick = function(e, obj) {
-			YAHOO.util.Event.stopEvent(e);
-		};
-
-		var firstChild = document.body.firstChild;
-		if (firstChild)	{
-			document.body.insertBefore(this.mask, document.body.firstChild);
-		} else {
-			document.body.appendChild(this.mask);
-		}
-	}
-};
-
-/**
-* Hides the modality mask.
-* @method hideMask
-*/
-YAHOO.widget.Panel.prototype.hideMask = function() {
-	if (this.cfg.getProperty("modal") && this.mask) {
-		this.mask.style.display = "none";
-		this.hideMaskEvent.fire();
-		YAHOO.util.Dom.removeClass(document.body, "masked");
-	}
-};
-
-/**
-* Shows the modality mask.
-* @method showMask
-*/
-YAHOO.widget.Panel.prototype.showMask = function() {
-	if (this.cfg.getProperty("modal") && this.mask) {
-		YAHOO.util.Dom.addClass(document.body, "masked");
-		this.sizeMask();
-		this.mask.style.display = "block";
-		this.showMaskEvent.fire();
-	}
-};
-
-/**
-* Sets the size of the modality mask to cover the entire scrollable area of the document
-* @method sizeMask
-*/
-YAHOO.widget.Panel.prototype.sizeMask = function() {
-	if (this.mask) {
-		this.mask.style.height = YAHOO.util.Dom.getDocumentHeight()+"px";
-		this.mask.style.width = YAHOO.util.Dom.getDocumentWidth()+"px";
-	}
-};
-
-/**
-* Renders the Panel by inserting the elements that are not already in the main Panel into their correct places. Optionally appends the Panel to the specified node prior to the render's execution. NOTE: For Panels without existing markup, the appendToNode argument is REQUIRED. If this argument is ommitted and the current element is not present in the document, the function will return false, indicating that the render was a failure.
-* @method render
-* @param {String}	appendToNode	The element id to which the Module should be appended to prior to rendering <em>OR</em>
-* @param {HTMLElement}	appendToNode	The element to which the Module should be appended to prior to rendering
-* @return {boolean} Success or failure of the render
-*/
-YAHOO.widget.Panel.prototype.render = function(appendToNode) {
-	return YAHOO.widget.Panel.superclass.render.call(this, appendToNode, this.innerElement);
-};
-
-/**
-* Removes the Panel element from the DOM and sets all child elements to null.
-* @method destroy
-*/
-YAHOO.widget.Panel.prototype.destroy = function() {
+                nButtons = aButtons.length;
 
-    YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.sizeMask, this);
+                this._aButtons = [];
+        
+                for (i = 0; i < nButtons; i++) {
 
-    if(this.close) {
-    
-        YAHOO.util.Event.purgeElement(this.close);
+                    oButton = aButtons[i];
 
-    }
+                    if (Button) {
 
-    YAHOO.widget.Panel.superclass.destroy.call(this);  
+                        oYUIButton = new Button({ label: oButton.text, 
+                                            container: oSpan });
 
-};
+                        oButtonEl = oYUIButton.get("element");
 
-/**
-* Returns a String representation of the object.
-* @method toString
-* @return {String} The string representation of the Panel.
-*/
-YAHOO.widget.Panel.prototype.toString = function() {
-	return "Panel " + this.id;
-};
-/**
-* Dialog is an implementation of Panel that can be used to submit form data. Built-in functionality for buttons with event handlers is included, and button sets can be build dynamically, or the preincluded ones for Submit/Cancel and OK/Cancel can be utilized. Forms can be processed in 3 ways -- via an asynchronous Connection utility call, a simple form POST or GET, or manually.
-* @namespace YAHOO.widget
-* @class Dialog
-* @extends YAHOO.widget.Panel
-* @constructor
-* @param {String}	el	The element ID representing the Dialog <em>OR</em>
-* @param {HTMLElement}	el	The element representing the Dialog
-* @param {Object}	userConfig	The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.
-*/
-YAHOO.widget.Dialog = function(el, userConfig) {
-	YAHOO.widget.Dialog.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.Dialog, YAHOO.widget.Panel);
-
-/**
-* Constant representing the default CSS class used for a Dialog
-* @property YAHOO.widget.Dialog.CSS_DIALOG
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.Dialog.CSS_DIALOG = "yui-dialog";
+                        if (oButton.isDefault) {
 
-/**
-* Constant representing the name of the Dialog's events
-* @property YAHOO.widget.Dialog._EVENT_TYPES
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Dialog._EVENT_TYPES = {
+                            oYUIButton.addClass("default");
 
-	"BEFORE_SUBMIT": "beforeSubmit",
-	"SUBMIT": "submit",
-	"MANUAL_SUBMIT": "manualSubmit",
-	"ASYNC_SUBMIT": "asyncSubmit",
-	"FORM_SUBMIT": "formSubmit",
-	"CANCEL": "cancel"
-
-};
-
-/**
-* Constant representing the Dialog's configuration properties
-* @property YAHOO.widget.Dialog._DEFAULT_CONFIG
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Dialog._DEFAULT_CONFIG = {
+                            this.defaultHtmlButton = oButtonEl;
 
-	"POST_METHOD": { 
-	   key: "postmethod", 
-	   value: "async" 
-    },
-
-	"BUTTONS": { 
-	   key: "buttons", 
-	   value: "none" 
-    }
+                        }
+    
+                        if (Lang.isFunction(oButton.handler)) {
+    
+                            oYUIButton.set("onclick", { fn: oButton.handler, 
+                                obj: this, scope: this });
+            
+                        }
+                        else if (Lang.isObject(oButton.handler) && 
+                            Lang.isFunction(oButton.handler.fn)) {
 
-};
+                            oYUIButton.set("onclick", { fn: oButton.handler.fn, 
+                                obj: ((!Lang.isUndefined(oButton.handler.obj)) ? 
+                                oButton.handler.obj : this), 
+                                scope: (oButton.handler.scope || this) });
+    
+                        }
 
-/**
-* Initializes the class's configurable properties which can be changed using the Dialog's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.Dialog.prototype.initDefaultConfig = function() {
-	YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);
+                        this._aButtons[this._aButtons.length] = oYUIButton;
 
-	/**
-	* The internally maintained callback object for use with the Connection utility
-	* @property callback
-	* @type Object
-	*/
-	this.callback = {
-		/**
-		* The function to execute upon success of the Connection submission
-		* @property callback.success
-		* @type Function
-		*/
-		success : null,
-		/**
-		* The function to execute upon failure of the Connection submission
-		* @property callback.failure
-		* @type Function
-		*/
-		failure : null,
-		/**
-		* The arbitraty argument or arguments to pass to the Connection callback functions
-		* @property callback.argument
-		* @type Object
-		*/
-		argument: null
-	};
-
-	// Add form dialog config properties //
-	
-	var DEFAULT_CONFIG = YAHOO.widget.Dialog._DEFAULT_CONFIG;
-	
-	/**
-	* The method to use for posting the Dialog's form. Possible values are "async", "form", and "manual".
-	* @config postmethod
-	* @type String
-	* @default async
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.POST_METHOD.key, 
-                {
-                    handler: this.configPostMethod, 
-                    value: DEFAULT_CONFIG.POST_METHOD.value, 
-                    validator: function(val) {
-                        if (val != "form" && val != "async" && val != "none" && val != "manual") {
-                            return false;
-                        } else {
-                            return true;
+                    }
+                    else {
+        
+                        oButtonEl = document.createElement("button");
+                        oButtonEl.setAttribute("type", "button");
+            
+                        if (oButton.isDefault) {
+                            oButtonEl.className = "default";
+                            this.defaultHtmlButton = oButtonEl;
+                        }
+    
+                        oButtonEl.innerHTML = oButton.text;
+    
+                        if (Lang.isFunction(oButton.handler)) {
+    
+                            Event.on(oButtonEl, "click", oButton.handler, 
+                                this, true);
+            
                         }
+                        else if (Lang.isObject(oButton.handler) && 
+                            Lang.isFunction(oButton.handler.fn)) {
+    
+                            Event.on(oButtonEl, "click", oButton.handler.fn, 
+                                ((!Lang.isUndefined(oButton.handler.obj)) ? 
+                                oButton.handler.obj : this), 
+                                (oButton.handler.scope || this));
+    
+                        }
+            
+                        oSpan.appendChild(oButtonEl);
+                        
+                        this._aButtons[this._aButtons.length] = oButtonEl;
+                        
                     }
+
+                    oButton.htmlButton = oButtonEl;
+        
+                    if (i === 0) {
+                        this.firstButton = oButtonEl;
+                    }
+        
+                    if (i == (nButtons - 1)) {
+                        this.lastButton = oButtonEl;
+                    }
+        
                 }
-            );
+        
+                this.setFooter(oSpan);
 
-	/**
-	* Object literal(s) defining the buttons for the Dialog's footer.
-	* @config buttons
-	* @type Object[]
-	* @default "none"
-	*/
-	this.cfg.addProperty(
-	           DEFAULT_CONFIG.BUTTONS.key,
-	           {
-	               handler: this.configButtons,
-	               value: DEFAULT_CONFIG.BUTTONS.value
-               }
-           );	
-	
-};
-
-/**
-* Initializes the custom events for Dialog which are fired automatically at appropriate times by the Dialog class.
-* @method initEvents
-*/
-YAHOO.widget.Dialog.prototype.initEvents = function() {
-	YAHOO.widget.Dialog.superclass.initEvents.call(this);
+                oFooter = this.footer;
+                
+                if (Dom.inDocument(this.element) && 
+                    !Dom.isAncestor(oInnerElement, oFooter)) {
+    
+                    oInnerElement.appendChild(oFooter);
+                
+                }
 
-    var EVENT_TYPES = YAHOO.widget.Dialog._EVENT_TYPES;
+                this.buttonSpan = oSpan;
 
-	/**
-	* CustomEvent fired prior to submission
-	* @event beforeSumitEvent
-	*/	
-	this.beforeSubmitEvent	= new YAHOO.util.CustomEvent(EVENT_TYPES.BEFORE_SUBMIT, this);
-	
-	/**
-	* CustomEvent fired after submission
-	* @event submitEvent
-	*/
-	this.submitEvent		= new YAHOO.util.CustomEvent(EVENT_TYPES.SUBMIT, this);
-
-	/**
-	* CustomEvent fired prior to manual submission
-	* @event manualSubmitEvent
-	*/
-	this.manualSubmitEvent	= new YAHOO.util.CustomEvent(EVENT_TYPES.MANUAL_SUBMIT, this);
-
-	/**
-	* CustomEvent fired prior to asynchronous submission
-	* @event asyncSubmitEvent
-	*/	
-	this.asyncSubmitEvent	= new YAHOO.util.CustomEvent(EVENT_TYPES.ASYNC_SUBMIT, this);
-
-	/**
-	* CustomEvent fired prior to form-based submission
-	* @event formSubmitEvent
-	*/
-	this.formSubmitEvent	= new YAHOO.util.CustomEvent(EVENT_TYPES.FORM_SUBMIT, this);
-
-	/**
-	* CustomEvent fired after cancel
-	* @event cancelEvent
-	*/
-	this.cancelEvent		= new YAHOO.util.CustomEvent(EVENT_TYPES.CANCEL, this);
-};
-
-/**
-* The Dialog initialization method, which is executed for Dialog and all of its subclasses. This method is automatically called by the constructor, and  sets up all DOM references for pre-existing markup, and creates required markup if it is not already present.
-* @method init
-* @param {String}	el	The element ID representing the Dialog <em>OR</em>
-* @param {HTMLElement}	el	The element representing the Dialog
-* @param {Object}	userConfig	The configuration object literal containing the configuration that should be set for this Dialog. See configuration documentation for more details.
-*/
-YAHOO.widget.Dialog.prototype.init = function(el, userConfig) {
-	YAHOO.widget.Dialog.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level
+            } else { // Do cleanup
 
-	this.beforeInitEvent.fire(YAHOO.widget.Dialog);
+                oSpan = this.buttonSpan;
+                oFooter = this.footer;
 
-	YAHOO.util.Dom.addClass(this.element, YAHOO.widget.Dialog.CSS_DIALOG);
+                if (oSpan && oFooter) {
 
-	this.cfg.setProperty("visible", false);
+                    oFooter.removeChild(oSpan);
 
-	if (userConfig) {
-		this.cfg.applyConfig(userConfig, true);
-	}
+                    this.buttonSpan = null;
+                    this.firstButton = null;
+                    this.lastButton = null;
+                    this.defaultHtmlButton = null;
 
-	this.showEvent.subscribe(this.focusFirst, this, true);
-	this.beforeHideEvent.subscribe(this.blurButtons, this, true);
+                }
 
-	this.beforeRenderEvent.subscribe(function() {
-		var buttonCfg = this.cfg.getProperty("buttons");
-		if (buttonCfg && buttonCfg != "none") {
-			if (! this.footer) {
-				this.setFooter("");
-			}
-		}
-	}, this, true);
+            }
 
-	this.initEvent.fire(YAHOO.widget.Dialog);
-};
+            this.cfg.refireEvent("iframe");
+            this.cfg.refireEvent("underlay");
 
-/**
-* Performs the submission of the Dialog form depending on the value of "postmethod" property.
-* @method doSubmit
-*/
-YAHOO.widget.Dialog.prototype.doSubmit = function() {
-	var pm = this.cfg.getProperty("postmethod");
-	switch (pm) {
-		case "async":
-			var method = this.form.getAttribute("method") || 'POST';
-			method = method.toUpperCase();
-			YAHOO.util.Connect.setForm(this.form);
-			var cObj = YAHOO.util.Connect.asyncRequest(method, this.form.getAttribute("action"), this.callback);
-			this.asyncSubmitEvent.fire();
-			break;
-		case "form":
-			this.form.submit();
-			this.formSubmitEvent.fire();
-			break;
-		case "none":
-		case "manual":
-			this.manualSubmitEvent.fire();
-			break;
-	}
-};
-
-/**
-* @method _onFormKeyDown
-* @description "keydown" event handler for the dialog's form.
-* @protected
-* @param {Event} p_oEvent Object representing the DOM event object passed 
-* back by the event utility (YAHOO.util.Event).
-*/
-YAHOO.widget.Dialog.prototype._onFormKeyDown = function(p_oEvent) {
+        },
 
-    var oTarget = YAHOO.util.Event.getTarget(p_oEvent),
-        nCharCode = YAHOO.util.Event.getCharCode(p_oEvent);
 
-    if (
-        nCharCode == 13 && 
-        oTarget.tagName && 
-        oTarget.tagName.toUpperCase() == "INPUT"
-    ) {
-
-        var sType = oTarget.type;
-
-        if(
-            sType == "text" || sType == "password" || sType == "checkbox" || 
-            sType == "radio" || sType == "file"
-        ) {
+        /**
+        * @method getButtons
+        * @description Returns an array containing each of the Dialog's 
+        * buttons, by default an array of HTML <code>&#60;BUTTON&#60;</code> 
+        * elements.  If the Dialog's buttons were created using the 
+        * YAHOO.widget.Button class (via the inclusion of the optional Button 
+        * dependancy on the page), an array of YAHOO.widget.Button instances 
+        * is returned.
+        * @return {Array}
+        */
+        getButtons: function () {
+        
+            var aButtons = this._aButtons;
+            
+            if (aButtons) {
+            
+                return aButtons;
+            
+            }
+        
+        },
 
-            // Fire the "click" event on the dialog's default button
-            this.defaultHtmlButton.click();
         
-        }
+        /**
+        * Sets focus to the first element in the Dialog's form or the first 
+        * button defined via the "buttons" configuration property. Called 
+        * when the Dialog is made visible.
+        * @method focusFirst
+        */
+        focusFirst: function (type, args, obj) {
+    
+            var oElement = this.firstFormElement,
+                oEvent;
 
-    }
+            if (args) {
 
-};
+                oEvent = args[1];
 
-/**
-* Prepares the Dialog's internal FORM object, creating one if one is not currently present.
-* @method registerForm
-*/
-YAHOO.widget.Dialog.prototype.registerForm = function() {
-	var form = this.element.getElementsByTagName("form")[0];
+                if (oEvent) {
 
-	if (! form) {
-		var formHTML = "<form name=\"frm_" + this.id + "\" action=\"\"></form>";
-		this.body.innerHTML += formHTML;
-		form = this.element.getElementsByTagName("form")[0];
-	}
-
-	this.firstFormElement = function() {
-		for (var f=0;f<form.elements.length;f++ ) {
-			var el = form.elements[f];
-			if (el.focus && ! el.disabled) {
-				if (el.type && el.type != "hidden") {
-					return el;
-				}
-			}
-		}
-		return null;
-	}();
-
-	this.lastFormElement = function() {
-		for (var f=form.elements.length-1;f>=0;f-- ) {
-			var el = form.elements[f];
-			if (el.focus && ! el.disabled) {
-				if (el.type && el.type != "hidden") {
-					return el;
-				}
-			}
-		}
-		return null;
-	}();
+                    Event.stopEvent(oEvent);
 
-	this.form = form;
+                }
 
-    if(this.form && (this.browser == "ie" || this.browser == "ie7" || this.browser == "gecko")) {
+            }
+        
 
-        YAHOO.util.Event.addListener(this.form, "keydown", this._onFormKeyDown, null, this);
-    
-    }
+            if (oElement) {
 
+                /*
+                    Place the call to the "focus" method inside a try/catch
+                    block to prevent IE from throwing JavaScript errors if
+                    the element is disabled or hidden.
+                */
 
-	if (this.cfg.getProperty("modal") && this.form) {
+                try {
 
-		var me = this;
+                    oElement.focus();
 
-		var firstElement = this.firstFormElement || this.firstButton;
-		if (firstElement) {
-			this.preventBackTab = new YAHOO.util.KeyListener(firstElement, { shift:true, keys:9 }, {fn:me.focusLast, scope:me, correctScope:true} );
-			this.showEvent.subscribe(this.preventBackTab.enable, this.preventBackTab, true);
-			this.hideEvent.subscribe(this.preventBackTab.disable, this.preventBackTab, true);
-		}
-
-		var lastElement = this.lastButton || this.lastFormElement;
-		if (lastElement) {
-			this.preventTabOut = new YAHOO.util.KeyListener(lastElement, { shift:false, keys:9 }, {fn:me.focusFirst, scope:me, correctScope:true} );
-			this.showEvent.subscribe(this.preventTabOut.enable, this.preventTabOut, true);
-			this.hideEvent.subscribe(this.preventTabOut.disable, this.preventTabOut, true);
-		}
-	}
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* The default event handler fired when the "close" property is changed. The method controls the appending or hiding of the close icon at the top right of the Dialog.
-* @method configClose
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Dialog.prototype.configClose = function(type, args, obj) {
-	var val = args[0];
+                }
+                catch(oException) {
 
-	var doCancel = function(e, obj) {
-		obj.cancel();
-	};
-
-	if (val) {
-		if (! this.close) {
-			this.close = document.createElement("div");
-			YAHOO.util.Dom.addClass(this.close, "container-close");
-
-			this.close.innerHTML = "&#160;";
-			this.innerElement.appendChild(this.close);
-			YAHOO.util.Event.addListener(this.close, "click", doCancel, this);
-		} else {
-			this.close.style.display = "block";
-		}
-	} else {
-		if (this.close) {
-			this.close.style.display = "none";
-		}
-	}
-};
-
-/**
-* The default event handler for the "buttons" configuration property
-* @method configButtons
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Dialog.prototype.configButtons = function(type, args, obj) {
-	var buttons = args[0];
-	if (buttons != "none") {
-		this.buttonSpan = null;
-		this.buttonSpan = document.createElement("span");
-		this.buttonSpan.className = "button-group";
-
-		for (var b=0;b<buttons.length;b++) {
-			var button = buttons[b];
-
-			var htmlButton = document.createElement("button");
-			htmlButton.setAttribute("type", "button");
-
-			if (button.isDefault) {
-				htmlButton.className = "default";
-				this.defaultHtmlButton = htmlButton;
-			}
-
-			htmlButton.appendChild(document.createTextNode(button.text));
-			YAHOO.util.Event.addListener(htmlButton, "click", button.handler, this, true);
-
-			this.buttonSpan.appendChild(htmlButton);
-			button.htmlButton = htmlButton;
-
-			if (b === 0) {
-				this.firstButton = button.htmlButton;
-			}
-
-			if (b == (buttons.length-1)) {
-				this.lastButton = button.htmlButton;
-			}
-
-		}
-
-		this.setFooter(this.buttonSpan);
-
-		this.cfg.refireEvent("iframe");
-		this.cfg.refireEvent("underlay");
-	} else { // Do cleanup
-		if (this.buttonSpan) {
-			if (this.buttonSpan.parentNode) {
-				this.buttonSpan.parentNode.removeChild(this.buttonSpan);
-			}
-
-			this.buttonSpan = null;
-			this.firstButton = null;
-			this.lastButton = null;
-			this.defaultHtmlButton = null;
-		}
-	}
-};
-
-
-/**
-* The default event handler used to focus the first field of the form when the Dialog is shown.
-* @method focusFirst
-*/
-YAHOO.widget.Dialog.prototype.focusFirst = function(type,args,obj) {
-	if (args) {
-		var e = args[1];
-		if (e) {
-			YAHOO.util.Event.stopEvent(e);
-		}
-	}
-
-	if (this.firstFormElement) {
-		this.firstFormElement.focus();
-	} else {
-		this.focusDefaultButton();
-	}
-};
-
-/**
-* Sets the focus to the last button in the button or form element in the Dialog
-* @method focusLast
-*/
-YAHOO.widget.Dialog.prototype.focusLast = function(type,args,obj) {
-	if (args) {
-		var e = args[1];
-		if (e) {
-			YAHOO.util.Event.stopEvent(e);
-		}
-	}
-
-	var buttons = this.cfg.getProperty("buttons");
-	if (buttons && buttons instanceof Array) {
-		this.focusLastButton();
-	} else {
-		if (this.lastFormElement) {
-			this.lastFormElement.focus();
-		}
-	}
-};
-
-/**
-* Sets the focus to the button that is designated as the default. By default, his handler is executed when the show event is fired.
-* @method focusDefaultButton
-*/
-YAHOO.widget.Dialog.prototype.focusDefaultButton = function() {
-	if (this.defaultHtmlButton) {
-		this.defaultHtmlButton.focus();
-	}
-};
-
-/**
-* Blurs all the html buttons
-* @method blurButtons
-*/
-YAHOO.widget.Dialog.prototype.blurButtons = function() {
-	var buttons = this.cfg.getProperty("buttons");
-	if (buttons && buttons instanceof Array) {
-		var html = buttons[0].htmlButton;
-		if (html) {
-			html.blur();
-		}
-	}
-};
-
-/**
-* Sets the focus to the first button in the button list
-* @method focusFirstButton
-*/
-YAHOO.widget.Dialog.prototype.focusFirstButton = function() {
-	var buttons = this.cfg.getProperty("buttons");
-	if (buttons && buttons instanceof Array) {
-		var html = buttons[0].htmlButton;
-		if (html) {
-			html.focus();
-		}
-	}
-};
-
-/**
-* Sets the focus to the first button in the button list
-* @method focusLastButton
-*/
-YAHOO.widget.Dialog.prototype.focusLastButton = function() {
-	var buttons = this.cfg.getProperty("buttons");
-	if (buttons && buttons instanceof Array) {
-		var html = buttons[buttons.length-1].htmlButton;
-		if (html) {
-			html.focus();
-		}
-	}
-};
-
-/**
-* The default event handler for the "postmethod" configuration property
-* @method configPostMethod
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.Dialog.prototype.configPostMethod = function(type, args, obj) {
-	var postmethod = args[0];
+                }
 
-	this.registerForm();
-	YAHOO.util.Event.addListener(this.form, "submit", function(e) {
-														YAHOO.util.Event.stopEvent(e);
-														this.submit();
-														this.form.blur();
-													  }, this, true);
-};
-
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Built-in function hook for writing a validation function that will be checked for a "true" value prior to a submit. This function, as implemented by default, always returns true, so it should be overridden if validation is necessary.
-* @method validate
-*/
-YAHOO.widget.Dialog.prototype.validate = function() {
-	return true;
-};
-
-/**
-* Executes a submit of the Dialog followed by a hide, if validation is successful.
-* @method submit
-*/
-YAHOO.widget.Dialog.prototype.submit = function() {
-	if (this.validate()) {
-		this.beforeSubmitEvent.fire();
-		this.doSubmit();
-		this.submitEvent.fire();
-		this.hide();
-		return true;
-	} else {
-		return false;
-	}
-};
-
-/**
-* Executes the cancel of the Dialog followed by a hide.
-* @method cancel
-*/
-YAHOO.widget.Dialog.prototype.cancel = function() {
-	this.cancelEvent.fire();
-	this.hide();
-};
-
-/**
-* Returns a JSON-compatible data structure representing the data currently contained in the form.
-* @method getData
-* @return {Object} A JSON object reprsenting the data of the current form.
-*/
-YAHOO.widget.Dialog.prototype.getData = function() {
+            } else {
 
-    var oForm = this.form;
+                this.focusDefaultButton();
 
-    if(oForm) {
+            }
 
-        var aElements = oForm.elements,
-            nTotalElements = aElements.length,
-            oData = {},
-            sName,
-            oElement,
-            nElements;
+        },
+        
+        /**
+        * Sets focus to the last element in the Dialog's form or the last 
+        * button defined via the "buttons" configuration property.
+        * @method focusLast
+        */
+        focusLast: function (type, args, obj) {
+    
+            var aButtons = this.cfg.getProperty("buttons"),
+                oElement = this.lastFormElement,
+                oEvent;
+    
+            if (args) {
 
-        for(var i=0; i<nTotalElements; i++) {
+                oEvent = args[1];
 
-            sName = aElements[i].name;
+                if (oEvent) {
 
-            function isFormElement(p_oElement) {
-            
-                var sTagName = p_oElement.tagName.toUpperCase();
-                
-                return (
-                    (
-                        sTagName == "INPUT" || 
-                        sTagName == "TEXTAREA" || 
-                        sTagName == "SELECT"
-                    ) && 
-                    p_oElement.name == sName
-                );
+                    Event.stopEvent(oEvent);
 
-            }
+                }
 
-            /*
-                Using "YAHOO.util.Dom.getElementsBy" to safeguard
-                user from JS errors that result from giving a form field (or 
-                set of fields) the same name as a native method of a form 
-                (like "submit") or a DOM collection (such as the "item" method).
-                Originally tried accessing fields via the "namedItem" method of 
-                the "element" collection, but discovered that it won't return
-                a collection of fields in Gecko.
-            */
+            }
+            
+            if (aButtons && Lang.isArray(aButtons)) {
 
-            oElement = YAHOO.util.Dom.getElementsBy(isFormElement, "*", oForm);
-            nElements = oElement.length;
+                this.focusLastButton();
 
-            if(nElements > 0) {
+            } else {
 
-                if(nElements == 1) {
+                if (oElement) {
 
-                    oElement = oElement[0];
+                    /*
+                        Place the call to the "focus" method inside a try/catch
+                        block to prevent IE from throwing JavaScript errors if
+                        the element is disabled or hidden.
+                    */
+    
+                    try {
+    
+                        oElement.focus();
+    
+                    }
+                    catch(oException) {
+    
+                    }
 
-                    var sType = oElement.type,
-                        sTagName = oElement.tagName.toUpperCase();
+                }
 
-                    switch(sTagName) {
+            }
 
-                        case "INPUT":
+        },
+        
+        /**
+        * Sets the focus to the button that is designated as the default via 
+        * the "buttons" configuration property. By default, this method is 
+        * called when the Dialog is made visible.
+        * @method focusDefaultButton
+        */
+        focusDefaultButton: function () {
+        
+            var oElement = this.defaultHtmlButton;
+        
+            if (oElement) {
 
-                            if(sType == "checkbox") {
+                /*
+                    Place the call to the "focus" method inside a try/catch
+                    block to prevent IE from throwing JavaScript errors if
+                    the element is disabled or hidden.
+                */
 
-                                oData[sName] = oElement.checked;
+                try {
 
-                            }
-                            else if(sType != "radio") {
+                    oElement.focus();
+                
+                }
+                catch(oException) {
+                
+                }
 
-                                oData[sName] = oElement.value;
+            }
+        },
+        
+        /**
+        * Blurs all the buttons defined via the "buttons" 
+        * configuration property.
+        * @method blurButtons
+        */
+        blurButtons: function () {
+            
+            var aButtons = this.cfg.getProperty("buttons"),
+                nButtons,
+                oButton,
+                oElement,
+                i;
 
+            if (aButtons && Lang.isArray(aButtons)) {
+            
+                nButtons = aButtons.length;
+                
+                if (nButtons > 0) {
+                
+                    i = (nButtons - 1);
+                    
+                    do {
+                    
+                        oButton = aButtons[i];
+                        
+                        if (oButton) {
+
+                            oElement = oButton.htmlButton;
+
+                            if (oElement) {
+
+                                /*
+                                    Place the call to the "blur" method inside  
+                                    a try/catch block to prevent IE from  
+                                    throwing JavaScript errors if the element 
+                                    is disabled or hidden.
+                                */
+    
+                                try {
+            
+                                    oElement.blur();
+                                
+                                }
+                                catch(oException) {
+                                
+                                
+                                }
+                            
                             }
 
-                        break;
-
-                        case "TEXTAREA":
-
-                            oData[sName] = oElement.value;
+                        }
+                    
+                    }
+                    while(i--);
+                
+                }
+            
+            }
 
-                        break;
+        },
+        
+        /**
+        * Sets the focus to the first button created via the "buttons"
+        * configuration property.
+        * @method focusFirstButton
+        */
+        focusFirstButton: function () {
+    
+            var aButtons = this.cfg.getProperty("buttons"),
+                oButton,
+                oElement;
 
-                        case "SELECT":
+            if (aButtons && Lang.isArray(aButtons)) {
 
-                            var aOptions = oElement.options,
-                                nOptions = aOptions.length,
-                                aValues = [],
-                                oOption,
-                                sValue;
+                oButton = aButtons[0];
 
+                if (oButton) {
 
-                            for(var n=0; n<nOptions; n++) {
+                    oElement = oButton.htmlButton;
+                    
+                    if (oElement) {
+
+                        /*
+                            Place the call to the "focus" method inside a 
+                            try/catch block to prevent IE from throwing 
+                            JavaScript errors if the element is disabled 
+                            or hidden.
+                        */
+    
+                        try {
+    
+                            oElement.focus();
+                        
+                        }
+                        catch(oException) {
+                        
+                        
+                        }
+                    
+                    }
 
-                                oOption = aOptions[n];
+                }
 
-                                if(oOption.selected) {
+            }
+        },
+        
+        /**
+        * Sets the focus to the last button created via the "buttons" 
+        * configuration property.
+        * @method focusLastButton
+        */
+        focusLastButton: function () {
+    
+            var aButtons = this.cfg.getProperty("buttons"),
+                nButtons,
+                oButton,
+                oElement;
 
-                                    sValue = oOption.value;
+            if (aButtons && Lang.isArray(aButtons)) {
 
-                                    if(!sValue || sValue === "") {
+                nButtons = aButtons.length;
+                
+                if (nButtons > 0) {
 
-                                        sValue = oOption.text;
+                    oButton = aButtons[(nButtons - 1)];
+                    
+                    if (oButton) {
+                    
+                        oElement = oButton.htmlButton;
+
+                        if (oElement) {
+
+                            /*
+                                Place the call to the "focus" method inside a 
+                                try/catch block to prevent IE from throwing 
+                                JavaScript errors if the element is disabled
+                                or hidden.
+                            */
+        
+                            try {
+        
+                                oElement.focus();
+                            
+                            }
+                            catch(oException) {
+                            
+                            
+                            }
+                        
+                        }
+                    
+                    }
+                
+                }
+            
+            }
 
+        },
+        
+        /**
+        * The default event handler for the "postmethod" configuration property
+        * @method configPostMethod
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For 
+        * configuration handlers, args[0] will equal the newly applied value 
+        * for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configPostMethod: function (type, args, obj) {
+            this.registerForm();
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Built-in function hook for writing a validation function that will 
+        * be checked for a "true" value prior to a submit. This function, as 
+        * implemented by default, always returns true, so it should be 
+        * overridden if validation is necessary.
+        * @method validate
+        */
+        validate: function () {
+            return true;
+        },
+        
+        /**
+        * Executes a submit of the Dialog followed by a hide, if validation 
+        * is successful.
+        * @method submit
+        */
+        submit: function () {
+            if (this.validate()) {
+                this.beforeSubmitEvent.fire();
+                this.doSubmit();
+                this.submitEvent.fire();
+                this.hide();
+                return true;
+            } else {
+                return false;
+            }
+        },
+        
+        /**
+        * Executes the cancel of the Dialog followed by a hide.
+        * @method cancel
+        */
+        cancel: function () {
+            this.cancelEvent.fire();
+            this.hide();
+        },
+        
+        /**
+        * Returns a JSON-compatible data structure representing the data 
+        * currently contained in the form.
+        * @method getData
+        * @return {Object} A JSON object reprsenting the data of the 
+        * current form.
+        */
+        getData: function () {
+        
+            var oForm = this.form,
+                aElements,
+                nTotalElements,
+                oData,
+                sName,
+                oElement,
+                nElements,
+                sType,
+                sTagName,
+                aOptions,
+                nOptions,
+                aValues,
+                oOption,
+                sValue,
+                oRadio,
+                oCheckbox,
+                i,
+                n;    
+    
+            function isFormElement(p_oElement) {
+            
+                var sTag = p_oElement.tagName.toUpperCase();
+                
+                return ((sTag == "INPUT" || sTag == "TEXTAREA" || 
+                        sTag == "SELECT") && p_oElement.name == sName);
+    
+            }
+    
+    
+            if (oForm) {
+        
+                aElements = oForm.elements;
+                nTotalElements = aElements.length;
+                oData = {};
+    
+        
+                for (i = 0; i < nTotalElements; i++) {
+        
+                    sName = aElements[i].name;
+        
+                    /*
+                        Using "Dom.getElementsBy" to safeguard user from JS 
+                        errors that result from giving a form field (or set of 
+                        fields) the same name as a native method of a form 
+                        (like "submit") or a DOM collection (such as the "item"
+                        method). Originally tried accessing fields via the 
+                        "namedItem" method of the "element" collection, but 
+                        discovered that it won't return a collection of fields 
+                        in Gecko.
+                    */
+        
+                    oElement = Dom.getElementsBy(isFormElement, "*", oForm);
+                    nElements = oElement.length;
+        
+                    if (nElements > 0) {
+        
+                        if (nElements == 1) {
+        
+                            oElement = oElement[0];
+        
+                            sType = oElement.type;
+                            sTagName = oElement.tagName.toUpperCase();
+        
+                            switch (sTagName) {
+        
+                            case "INPUT":
+    
+                                if (sType == "checkbox") {
+    
+                                    oData[sName] = oElement.checked;
+    
+                                }
+                                else if (sType != "radio") {
+    
+                                    oData[sName] = oElement.value;
+    
+                                }
+    
+                                break;
+    
+                            case "TEXTAREA":
+    
+                                oData[sName] = oElement.value;
+    
+                                break;
+    
+                            case "SELECT":
+    
+                                aOptions = oElement.options;
+                                nOptions = aOptions.length;
+                                aValues = [];
+    
+                                for (n = 0; n < nOptions; n++) {
+    
+                                    oOption = aOptions[n];
+    
+                                    if (oOption.selected) {
+    
+                                        sValue = oOption.value;
+    
+                                        if (!sValue || sValue === "") {
+    
+                                            sValue = oOption.text;
+    
+                                        }
+    
+                                        aValues[aValues.length] = sValue;
+    
                                     }
-
-                                    aValues[aValues.length] = sValue;
-
+    
+                                }
+    
+                                oData[sName] = aValues;
+    
+                                break;
+        
+                            }
+        
+        
+                        }
+                        else {
+        
+                            sType = oElement[0].type;
+        
+                            switch (sType) {
+        
+                            case "radio":
+    
+                                for (n = 0; n < nElements; n++) {
+    
+                                    oRadio = oElement[n];
+    
+                                    if (oRadio.checked) {
+    
+                                        oData[sName] = oRadio.value;
+                                        break;
+    
+                                    }
+    
+                                }
+    
+                                break;
+    
+                            case "checkbox":
+    
+                                aValues = [];
+    
+                                for (n = 0; n < nElements; n++) {
+    
+                                    oCheckbox = oElement[n];
+    
+                                    if (oCheckbox.checked) {
+    
+                                        aValues[aValues.length] = 
+                                            oCheckbox.value;
+    
+                                    }
+    
                                 }
-
+    
+                                oData[sName] = aValues;
+    
+                                break;
+        
                             }
-
-                            oData[sName] = aValues;
-
-                        break;
-
+        
+                        }
+        
                     }
-
-
+        
                 }
-                else {
-
-                    var sType = oElement[0].type;
-
-                    switch(sType) {
-
-                        case "radio":
-
-                            var oRadio;
-
-                            for(var n=0; n<nElements; n++) {
-
-                                oRadio = oElement[n];
-
-                                if(oRadio.checked) {
-
-                                    oData[sName] = oRadio.value;
-                                    break;
-
-                                }
-
-                            }
-
-                        break;
-
-                        case "checkbox":
-
-                            var aValues = [],
-                                oCheckbox;
-
-                            for(var n=0; n<nElements; n++) {
-
-                                oCheckbox = oElement[n];
-
-                                if(oCheckbox.checked) {
-
-                                    aValues[aValues.length] = oCheckbox.value;
-
-                                }
-
-                            }
+        
+            }
+        
+        
+            return oData;
+        
+        },
+        
+        /**
+        * Removes the Panel element from the DOM and sets all child elements 
+        * to null.
+        * @method destroy
+        */
+        destroy: function () {
+        
+            removeButtonEventHandlers.call(this);
+            
+            this._aButtons = null;
 
-                            oData[sName] = aValues;
+            var aForms = this.element.getElementsByTagName("form"),
+                oForm;
+            
+            if (aForms.length > 0) {
 
-                        break;
+                oForm = aForms[0];
 
+                if (oForm) {
+                    Event.purgeElement(oForm);
+                    if (oForm.parentNode) {
+                        oForm.parentNode.removeChild(oForm);
                     }
-
+                    this.form = null;
                 }
-
             }
-
+        
+            Dialog.superclass.destroy.call(this);  
+        
+        },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the Dialog
+        */
+        toString: function () {
+            return "Dialog " + this.id;
         }
+    
+    });
 
-    }
-
-
-    return oData;
-
-};
-
-/**
-* Removes the Panel element from the DOM and sets all child elements to null.
-* @method destroy
-*/
-YAHOO.widget.Dialog.prototype.destroy = function() {
-
-    var Event = YAHOO.util.Event,
-        oForm = this.form,
-        oFooter = this.footer;
-
-    if(oFooter) {
+}());
 
-        var aButtons = oFooter.getElementsByTagName("button");
+(function () {
 
-        if(aButtons && aButtons.length > 0) {
+    /**
+    * SimpleDialog is a simple implementation of Dialog that can be used to 
+    * submit a single value. Forms can be processed in 3 ways -- via an 
+    * asynchronous Connection utility call, a simple form POST or GET, 
+    * or manually.
+    * @namespace YAHOO.widget
+    * @class SimpleDialog
+    * @extends YAHOO.widget.Dialog
+    * @constructor
+    * @param {String} el The element ID representing the SimpleDialog 
+    * <em>OR</em>
+    * @param {HTMLElement} el The element representing the SimpleDialog
+    * @param {Object} userConfig The configuration object literal containing 
+    * the configuration that should be set for this SimpleDialog. See 
+    * configuration documentation for more details.
+    */
+    YAHOO.widget.SimpleDialog = function (el, userConfig) {
+    
+        YAHOO.widget.SimpleDialog.superclass.constructor.call(this, 
+            el, userConfig);
+    
+    };
 
-            var i = aButtons.length - 1;
-            
-            do {
-            
-                Event.purgeElement(aButtons[i], false, "click");
-            
+    var Dom = YAHOO.util.Dom,
+        SimpleDialog = YAHOO.widget.SimpleDialog,
+    
+        /**
+        * Constant representing the SimpleDialog's configuration properties
+        * @property DEFAULT_CONFIG
+        * @private
+        * @final
+        * @type Object
+        */
+        DEFAULT_CONFIG = {
+        
+            "ICON": { 
+                key: "icon", 
+                value: "none", 
+                suppressEvent: true  
+            },
+        
+            "TEXT": { 
+                key: "text", 
+                value: "", 
+                suppressEvent: true, 
+                supercedes: ["icon"] 
             }
-            while(i--);
         
-        }
+        };
 
-    }
+    /**
+    * Constant for the standard network icon for a blocking action
+    * @property YAHOO.widget.SimpleDialog.ICON_BLOCK
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_BLOCK = "blckicon";
     
+    /**
+    * Constant for the standard network icon for alarm
+    * @property YAHOO.widget.SimpleDialog.ICON_ALARM
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_ALARM = "alrticon";
+    
+    /**
+    * Constant for the standard network icon for help
+    * @property YAHOO.widget.SimpleDialog.ICON_HELP
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_HELP  = "hlpicon";
+    
+    /**
+    * Constant for the standard network icon for info
+    * @property YAHOO.widget.SimpleDialog.ICON_INFO
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_INFO  = "infoicon";
+    
+    /**
+    * Constant for the standard network icon for warn
+    * @property YAHOO.widget.SimpleDialog.ICON_WARN
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_WARN  = "warnicon";
+    
+    /**
+    * Constant for the standard network icon for a tip
+    * @property YAHOO.widget.SimpleDialog.ICON_TIP
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_TIP   = "tipicon";
+
+    /**
+    * Constant representing the name of the CSS class applied to the element 
+    * created by the "icon" configuration property.
+    * @property YAHOO.widget.SimpleDialog.ICON_CSS_CLASSNAME
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.ICON_CSS_CLASSNAME = "yui-icon";
+    
+    /**
+    * Constant representing the default CSS class used for a SimpleDialog
+    * @property YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG
+    * @static
+    * @final
+    * @type String
+    */
+    SimpleDialog.CSS_SIMPLEDIALOG = "yui-simple-dialog";
 
-    if(oForm) {
-       
-        Event.purgeElement(oForm);
-
-        this.body.removeChild(oForm);
+    
+    YAHOO.extend(SimpleDialog, YAHOO.widget.Dialog, {
+    
+        /**
+        * Initializes the class's configurable properties which can be changed 
+        * using the SimpleDialog's Config object (cfg).
+        * @method initDefaultConfig
+        */
+        initDefaultConfig: function () {
+        
+            SimpleDialog.superclass.initDefaultConfig.call(this);
+        
+            // Add dialog config properties //
+        
+            /**
+            * Sets the informational icon for the SimpleDialog
+            * @config icon
+            * @type String
+            * @default "none"
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.ICON.key, {
+                handler: this.configIcon,
+                value: DEFAULT_CONFIG.ICON.value,
+                suppressEvent: DEFAULT_CONFIG.ICON.suppressEvent
+            });
+        
+            /**
+            * Sets the text for the SimpleDialog
+            * @config text
+            * @type String
+            * @default ""
+            */
+            this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key, { 
+                handler: this.configText, 
+                value: DEFAULT_CONFIG.TEXT.value, 
+                suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent, 
+                supercedes: DEFAULT_CONFIG.TEXT.supercedes 
+            });
+        
+        },
         
-        this.form = null;
+        
+        /**
+        * The SimpleDialog initialization method, which is executed for 
+        * SimpleDialog and all of its subclasses. This method is automatically 
+        * called by the constructor, and  sets up all DOM references for 
+        * pre-existing markup, and creates required markup if it is not 
+        * already present.
+        * @method init
+        * @param {String} el The element ID representing the SimpleDialog 
+        * <em>OR</em>
+        * @param {HTMLElement} el The element representing the SimpleDialog
+        * @param {Object} userConfig The configuration object literal 
+        * containing the configuration that should be set for this 
+        * SimpleDialog. See configuration documentation for more details.
+        */
+        init: function (el, userConfig) {
 
-    }
+            /*
+                Note that we don't pass the user config in here yet because we 
+                only want it executed once, at the lowest subclass level
+            */
 
-    YAHOO.widget.Dialog.superclass.destroy.call(this);  
+            SimpleDialog.superclass.init.call(this, el/*, userConfig*/);
+        
+            this.beforeInitEvent.fire(SimpleDialog);
+        
+            Dom.addClass(this.element, SimpleDialog.CSS_SIMPLEDIALOG);
+        
+            this.cfg.queueProperty("postmethod", "manual");
+        
+            if (userConfig) {
+                this.cfg.applyConfig(userConfig, true);
+            }
+        
+            this.beforeRenderEvent.subscribe(function () {
+                if (! this.body) {
+                    this.setBody("");
+                }
+            }, this, true);
+        
+            this.initEvent.fire(SimpleDialog);
+        
+        },
+        
+        /**
+        * Prepares the SimpleDialog's internal FORM object, creating one if one 
+        * is not currently present, and adding the value hidden field.
+        * @method registerForm
+        */
+        registerForm: function () {
 
-};
+            SimpleDialog.superclass.registerForm.call(this);
 
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}	The string representation of the Dialog
-*/
-YAHOO.widget.Dialog.prototype.toString = function() {
-	return "Dialog " + this.id;
-};
-/**
-* SimpleDialog is a simple implementation of Dialog that can be used to submit a single value. Forms can be processed in 3 ways -- via an asynchronous Connection utility call, a simple form POST or GET, or manually.
-* @namespace YAHOO.widget
-* @class SimpleDialog
-* @extends YAHOO.widget.Dialog
-* @constructor
-* @param {String}	el	The element ID representing the SimpleDialog <em>OR</em>
-* @param {HTMLElement}	el	The element representing the SimpleDialog
-* @param {Object}	userConfig	The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.
-*/
-YAHOO.widget.SimpleDialog = function(el, userConfig) {
-	YAHOO.widget.SimpleDialog.superclass.constructor.call(this, el, userConfig);
-};
-
-YAHOO.extend(YAHOO.widget.SimpleDialog, YAHOO.widget.Dialog);
-
-/**
-* Constant for the standard network icon for a blocking action
-* @property YAHOO.widget.SimpleDialog.ICON_BLOCK
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_BLOCK = "blckicon";
+            this.form.innerHTML += "<input type=\"hidden\" name=\"" + 
+                this.id + "\" value=\"\"/>";
 
-/**
-* Constant for the standard network icon for alarm
-* @property YAHOO.widget.SimpleDialog.ICON_ALARM
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_ALARM = "alrticon";
+        },
+        
+        // BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Fired when the "icon" property is set.
+        * @method configIcon
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configIcon: function (type,args,obj) {
+        
+            var sIcon = args[0],
+                oBody = this.body,
+                sCSSClass = SimpleDialog.ICON_CSS_CLASSNAME,
+                oIcon,
+                oIconParent;
+        
+            if (sIcon && sIcon != "none") {
 
-/**
-* Constant for the standard network icon for help
-* @property YAHOO.widget.SimpleDialog.ICON_HELP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_HELP  = "hlpicon";
+                oIcon = Dom.getElementsByClassName(sCSSClass, "*" , oBody);
 
-/**
-* Constant for the standard network icon for info
-* @property YAHOO.widget.SimpleDialog.ICON_INFO
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_INFO  = "infoicon";
+                if (oIcon) {
 
-/**
-* Constant for the standard network icon for warn
-* @property YAHOO.widget.SimpleDialog.ICON_WARN
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_WARN  = "warnicon";
+                    oIconParent = oIcon.parentNode;
+                    
+                    if (oIconParent) {
+                    
+                        oIconParent.removeChild(oIcon);
+                        
+                        oIcon = null;
+                    
+                    }
 
-/**
-* Constant for the standard network icon for a tip
-* @property YAHOO.widget.SimpleDialog.ICON_TIP
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.ICON_TIP   = "tipicon";
+                }
 
-/**
-* Constant representing the default CSS class used for a SimpleDialog
-* @property YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG
-* @static
-* @final
-* @type String
-*/
-YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG = "yui-simple-dialog";
 
-/**
-* Constant representing the SimpleDialog's configuration properties
-* @property YAHOO.widget.SimpleDialog._DEFAULT_CONFIG
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.SimpleDialog._DEFAULT_CONFIG = {
+                if (sIcon.indexOf(".") == -1) {
 
-    "ICON": { 
-        key: "icon", 
-        value:"none", 
-        suppressEvent:true  
-    },
-
-    "TEXT": { 
-        key: "text", 
-        value:"", 
-        suppressEvent:true, 
-        supercedes:["icon"] 
-    }
+                    oIcon = document.createElement("span");
+                    oIcon.className = (sCSSClass + " " + sIcon);
+                    oIcon.innerHTML = "&#160;";
 
-};
+                } else {
 
-/**
-* Initializes the class's configurable properties which can be changed using the SimpleDialog's Config object (cfg).
-* @method initDefaultConfig
-*/
-YAHOO.widget.SimpleDialog.prototype.initDefaultConfig = function() {
-	YAHOO.widget.SimpleDialog.superclass.initDefaultConfig.call(this);
+                    oIcon = document.createElement("img");
+                    oIcon.src = (this.imageRoot + sIcon);
+                    oIcon.className = sCSSClass;
 
-	// Add dialog config properties //
+                }
+                
 
-    var DEFAULT_CONFIG = YAHOO.widget.SimpleDialog._DEFAULT_CONFIG;
+                if (oIcon) {
+                
+                    oBody.insertBefore(oIcon, oBody.firstChild);
+                
+                }
 
-	/**
-	* Sets the informational icon for the SimpleDialog
-	* @config icon
-	* @type String
-	* @default "none"
-	*/
-	this.cfg.addProperty(
-                DEFAULT_CONFIG.ICON.key,
-                {
-                    handler: this.configIcon,
-                    value: DEFAULT_CONFIG.ICON.value,
-                    suppressEvent: DEFAULT_CONFIG.ICON.suppressEvent
-                }
-            );
-
-	/**
-	* Sets the text for the SimpleDialog
-	* @config text
-	* @type String
-	* @default ""
-	*/
-    this.cfg.addProperty(
-                DEFAULT_CONFIG.TEXT.key,	
-                { 
-                    handler: this.configText, 
-                    value: DEFAULT_CONFIG.TEXT.value, 
-                    suppressEvent: DEFAULT_CONFIG.TEXT.suppressEvent, 
-                    supercedes: DEFAULT_CONFIG.TEXT.supercedes 
-                } 
-            );
-
-};
-
-
-/**
-* The SimpleDialog initialization method, which is executed for SimpleDialog and all of its subclasses. This method is automatically called by the constructor, and  sets up all DOM references for pre-existing markup, and creates required markup if it is not already present.
-* @method init
-* @param {String}	el	The element ID representing the SimpleDialog <em>OR</em>
-* @param {HTMLElement}	el	The element representing the SimpleDialog
-* @param {Object}	userConfig	The configuration object literal containing the configuration that should be set for this SimpleDialog. See configuration documentation for more details.
-*/
-YAHOO.widget.SimpleDialog.prototype.init = function(el, userConfig) {
-	YAHOO.widget.SimpleDialog.superclass.init.call(this, el/*, userConfig*/);  // Note that we don't pass the user config in here yet because we only want it executed once, at the lowest subclass level
+            }
 
-	this.beforeInitEvent.fire(YAHOO.widget.SimpleDialog);
+        },
+        
+        /**
+        * Fired when the "text" property is set.
+        * @method configText
+        * @param {String} type The CustomEvent type (usually the property name)
+        * @param {Object[]} args The CustomEvent arguments. For configuration 
+        * handlers, args[0] will equal the newly applied value for the property.
+        * @param {Object} obj The scope object. For configuration handlers, 
+        * this will usually equal the owner.
+        */
+        configText: function (type,args,obj) {
+            var text = args[0];
+            if (text) {
+                this.setBody(text);
+                this.cfg.refireEvent("icon");
+            }
+        },
+        
+        // END BUILT-IN PROPERTY EVENT HANDLERS //
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the SimpleDialog
+        */
+        toString: function () {
+            return "SimpleDialog " + this.id;
+        }
+    
+    });
 
-	YAHOO.util.Dom.addClass(this.element, YAHOO.widget.SimpleDialog.CSS_SIMPLEDIALOG);
+}());
 
-	this.cfg.queueProperty("postmethod", "manual");
+(function () {
 
-	if (userConfig) {
-		this.cfg.applyConfig(userConfig, true);
-	}
+    /**
+    * ContainerEffect encapsulates animation transitions that are executed when 
+    * an Overlay is shown or hidden.
+    * @namespace YAHOO.widget
+    * @class ContainerEffect
+    * @constructor
+    * @param {YAHOO.widget.Overlay} overlay The Overlay that the animation 
+    * should be associated with
+    * @param {Object} attrIn The object literal representing the animation 
+    * arguments to be used for the animate-in transition. The arguments for 
+    * this literal are: attributes(object, see YAHOO.util.Anim for description), 
+    * duration(Number), and method(i.e. Easing.easeIn).
+    * @param {Object} attrOut The object literal representing the animation 
+    * arguments to be used for the animate-out transition. The arguments for  
+    * this literal are: attributes(object, see YAHOO.util.Anim for description), 
+    * duration(Number), and method(i.e. Easing.easeIn).
+    * @param {HTMLElement} targetElement Optional. The target element that  
+    * should be animated during the transition. Defaults to overlay.element.
+    * @param {class} Optional. The animation class to instantiate. Defaults to 
+    * YAHOO.util.Anim. Other options include YAHOO.util.Motion.
+    */
+    YAHOO.widget.ContainerEffect = 
+    
+        function (overlay, attrIn, attrOut, targetElement, animClass) {
+    
+        if (!animClass) {
+            animClass = YAHOO.util.Anim;
+        }
+        
+        /**
+        * The overlay to animate
+        * @property overlay
+        * @type YAHOO.widget.Overlay
+        */
+        this.overlay = overlay;
+    
+        /**
+        * The animation attributes to use when transitioning into view
+        * @property attrIn
+        * @type Object
+        */
+        this.attrIn = attrIn;
+    
+        /**
+        * The animation attributes to use when transitioning out of view
+        * @property attrOut
+        * @type Object
+        */
+        this.attrOut = attrOut;
+    
+        /**
+        * The target element to be animated
+        * @property targetElement
+        * @type HTMLElement
+        */
+        this.targetElement = targetElement || overlay.element;
+    
+        /**
+        * The animation class to use for animating the overlay
+        * @property animClass
+        * @type class
+        */
+        this.animClass = animClass;
+    
+    };
 
-	this.beforeRenderEvent.subscribe(function() {
-		if (! this.body) {
-			this.setBody("");
-		}
-	}, this, true);
 
-	this.initEvent.fire(YAHOO.widget.SimpleDialog);
+    var Dom = YAHOO.util.Dom,
+        CustomEvent = YAHOO.util.CustomEvent,
+        Easing = YAHOO.util.Easing,
+        ContainerEffect = YAHOO.widget.ContainerEffect;
+
+
+    /**
+    * A pre-configured ContainerEffect instance that can be used for fading 
+    * an overlay in and out.
+    * @method FADE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.FADE = function (overlay, dur) {
+
+        var fin = {
+            attributes: {opacity:{from:0, to:1}},
+            duration: dur,
+            method: Easing.easeIn
+        };
 
-};
-/**
-* Prepares the SimpleDialog's internal FORM object, creating one if one is not currently present, and adding the value hidden field.
-* @method registerForm
-*/
-YAHOO.widget.SimpleDialog.prototype.registerForm = function() {
-	YAHOO.widget.SimpleDialog.superclass.registerForm.call(this);
-	this.form.innerHTML += "<input type=\"hidden\" name=\"" + this.id + "\" value=\"\"/>";
-};
-
-// BEGIN BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Fired when the "icon" property is set.
-* @method configIcon
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.SimpleDialog.prototype.configIcon = function(type,args,obj) {
-	var icon = args[0];
-	if (icon && icon != "none") {
-		var iconHTML = "";
-		if (icon.indexOf(".") == -1) {
-			iconHTML = "<span class=\"yui-icon " + icon +"\" >&#160;</span>";
-		} else {
-			iconHTML = "<img src=\"" + this.imageRoot + icon + "\" class=\"yui-icon\" />";
-		}
-		this.body.innerHTML = iconHTML + this.body.innerHTML;
-	}
-};
-
-/**
-* Fired when the "text" property is set.
-* @method configText
-* @param {String} type	The CustomEvent type (usually the property name)
-* @param {Object[]}	args	The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
-* @param {Object} obj	The scope object. For configuration handlers, this will usually equal the owner.
-*/
-YAHOO.widget.SimpleDialog.prototype.configText = function(type,args,obj) {
-	var text = args[0];
-	if (text) {
-		this.setBody(text);
-		this.cfg.refireEvent("icon");
-	}
-};
-// END BUILT-IN PROPERTY EVENT HANDLERS //
-
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}	The string representation of the SimpleDialog
-*/
-YAHOO.widget.SimpleDialog.prototype.toString = function() {
-	return "SimpleDialog " + this.id;
-};
-/**
-* ContainerEffect encapsulates animation transitions that are executed when an Overlay is shown or hidden.
-* @namespace YAHOO.widget
-* @class ContainerEffect
-* @constructor
-* @param {YAHOO.widget.Overlay}	overlay		The Overlay that the animation should be associated with
-* @param {Object}	attrIn		The object literal representing the animation arguments to be used for the animate-in transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).
-* @param {Object}	attrOut		The object literal representing the animation arguments to be used for the animate-out transition. The arguments for this literal are: attributes(object, see YAHOO.util.Anim for description), duration(Number), and method(i.e. YAHOO.util.Easing.easeIn).
-* @param {HTMLElement}	targetElement	Optional. The target element that should be animated during the transition. Defaults to overlay.element.
-* @param {class}	Optional. The animation class to instantiate. Defaults to YAHOO.util.Anim. Other options include YAHOO.util.Motion.
-*/
-YAHOO.widget.ContainerEffect = function(overlay, attrIn, attrOut, targetElement, animClass) {
-	if (! animClass) {
-		animClass = YAHOO.util.Anim;
-	}
-
-	/**
-	* The overlay to animate
-	* @property overlay
-	* @type YAHOO.widget.Overlay
-	*/
-	this.overlay = overlay;
-	/**
-	* The animation attributes to use when transitioning into view
-	* @property attrIn
-	* @type Object
-	*/
-	this.attrIn = attrIn;
-	/**
-	* The animation attributes to use when transitioning out of view
-	* @property attrOut
-	* @type Object
-	*/
-	this.attrOut = attrOut;
-	/**
-	* The target element to be animated
-	* @property targetElement
-	* @type HTMLElement
-	*/
-	this.targetElement = targetElement || overlay.element;
-	/**
-	* The animation class to use for animating the overlay
-	* @property animClass
-	* @type class
-	*/
-	this.animClass = animClass;
-};
-
-/**
-* Initializes the animation classes and events.
-* @method init
-*/
-YAHOO.widget.ContainerEffect.prototype.init = function() {
-	this.beforeAnimateInEvent = new YAHOO.util.CustomEvent("beforeAnimateIn", this);
-	this.beforeAnimateOutEvent = new YAHOO.util.CustomEvent("beforeAnimateOut", this);
-
-	this.animateInCompleteEvent = new YAHOO.util.CustomEvent("animateInComplete", this);
-	this.animateOutCompleteEvent = new YAHOO.util.CustomEvent("animateOutComplete", this);
-
-	this.animIn = new this.animClass(this.targetElement, this.attrIn.attributes, this.attrIn.duration, this.attrIn.method);
-	this.animIn.onStart.subscribe(this.handleStartAnimateIn, this);
-	this.animIn.onTween.subscribe(this.handleTweenAnimateIn, this);
-	this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn, this);
-
-	this.animOut = new this.animClass(this.targetElement, this.attrOut.attributes, this.attrOut.duration, this.attrOut.method);
-	this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);
-	this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);
-	this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, this);
-};
-
-/**
-* Triggers the in-animation.
-* @method animateIn
-*/
-YAHOO.widget.ContainerEffect.prototype.animateIn = function() {
-	this.beforeAnimateInEvent.fire();
-	this.animIn.animate();
-};
-
-/**
-* Triggers the out-animation.
-* @method animateOut
-*/
-YAHOO.widget.ContainerEffect.prototype.animateOut = function() {
-	this.beforeAnimateOutEvent.fire();
-	this.animOut.animate();
-};
-
-/**
-* The default onStart handler for the in-animation.
-* @method handleStartAnimateIn
-* @param {String} type	The CustomEvent type
-* @param {Object[]}	args	The CustomEvent arguments
-* @param {Object} obj	The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateIn = function(type, args, obj) { };
-/**
-* The default onTween handler for the in-animation.
-* @method handleTweenAnimateIn
-* @param {String} type	The CustomEvent type
-* @param {Object[]}	args	The CustomEvent arguments
-* @param {Object} obj	The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateIn = function(type, args, obj) { };
-/**
-* The default onComplete handler for the in-animation.
-* @method handleCompleteAnimateIn
-* @param {String} type	The CustomEvent type
-* @param {Object[]}	args	The CustomEvent arguments
-* @param {Object} obj	The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateIn = function(type, args, obj) { };
+        var fout = {
+            attributes: {opacity:{to:0}},
+            duration: dur,
+            method: Easing.easeOut
+        };
 
-/**
-* The default onStart handler for the out-animation.
-* @method handleStartAnimateOut
-* @param {String} type	The CustomEvent type
-* @param {Object[]}	args	The CustomEvent arguments
-* @param {Object} obj	The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleStartAnimateOut = function(type, args, obj) { };
-/**
-* The default onTween handler for the out-animation.
-* @method handleTweenAnimateOut
-* @param {String} type	The CustomEvent type
-* @param {Object[]}	args	The CustomEvent arguments
-* @param {Object} obj	The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleTweenAnimateOut = function(type, args, obj) { };
-/**
-* The default onComplete handler for the out-animation.
-* @method handleCompleteAnimateOut
-* @param {String} type	The CustomEvent type
-* @param {Object[]}	args	The CustomEvent arguments
-* @param {Object} obj	The scope object
-*/
-YAHOO.widget.ContainerEffect.prototype.handleCompleteAnimateOut = function(type, args, obj) { };
+        var fade = new ContainerEffect(overlay, fin, fout, overlay.element);
 
-/**
-* Returns a string representation of the object.
-* @method toString
-* @return {String}	The string representation of the ContainerEffect
-*/
-YAHOO.widget.ContainerEffect.prototype.toString = function() {
-	var output = "ContainerEffect";
-	if (this.overlay) {
-		output += " [" + this.overlay.toString() + "]";
-	}
-	return output;
-};
-
-/**
-* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.
-* @method FADE
-* @static
-* @param {Overlay}	overlay	The Overlay object to animate
-* @param {Number}	dur	The duration of the animation
-* @return {ContainerEffect}	The configured ContainerEffect object
-*/
-YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {
-	var fade = new YAHOO.widget.ContainerEffect(overlay, { attributes:{opacity: {from:0, to:1}}, duration:dur, method:YAHOO.util.Easing.easeIn }, { attributes:{opacity: {to:0}}, duration:dur, method:YAHOO.util.Easing.easeOut}, overlay.element );
+        fade.handleUnderlayStart = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                var hasFilters = (underlay.filters && underlay.filters.length > 0);
+                if(hasFilters) {
+                    Dom.addClass(overlay.element, "yui-effect-fade");
+                }
+            }
+        };
 
-	fade.handleStartAnimateIn = function(type,args,obj) {
-		YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");
+        fade.handleUnderlayComplete = function() {
+            var underlay = this.overlay.underlay;
+            if (underlay && YAHOO.env.ua.ie) {
+                Dom.removeClass(overlay.element, "yui-effect-fade");
+            }
+        };
 
-		if (! obj.overlay.underlay) {
-			obj.overlay.cfg.refireEvent("underlay");
-		}
-
-		if (obj.overlay.underlay) {
-			obj.initialUnderlayOpacity = YAHOO.util.Dom.getStyle(obj.overlay.underlay, "opacity");
-			obj.overlay.underlay.style.filter = null;
-		}
-
-		YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible");
-		YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 0);
-	};
-
-	fade.handleCompleteAnimateIn = function(type,args,obj) {
-		YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");
-
-		if (obj.overlay.element.style.filter) {
-			obj.overlay.element.style.filter = null;
-		}
-
-		if (obj.overlay.underlay) {
-			YAHOO.util.Dom.setStyle(obj.overlay.underlay, "opacity", obj.initialUnderlayOpacity);
-		}
-
-		obj.overlay.cfg.refireEvent("iframe");
-		obj.animateInCompleteEvent.fire();
-	};
-
-	fade.handleStartAnimateOut = function(type, args, obj) {
-		YAHOO.util.Dom.addClass(obj.overlay.element, "hide-select");
-
-		if (obj.overlay.underlay) {
-			obj.overlay.underlay.style.filter = null;
-		}
-	};
-
-	fade.handleCompleteAnimateOut =  function(type, args, obj) {
-		YAHOO.util.Dom.removeClass(obj.overlay.element, "hide-select");
-		if (obj.overlay.element.style.filter) {
-			obj.overlay.element.style.filter = null;
-		}
-		YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");
-		YAHOO.util.Dom.setStyle(obj.overlay.element, "opacity", 1);
-
-		obj.overlay.cfg.refireEvent("iframe");
-
-		obj.animateOutCompleteEvent.fire();
-	};
-
-	fade.init();
-	return fade;
-};
-
-
-/**
-* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.
-* @method SLIDE
-* @static
-* @param {Overlay}	overlay	The Overlay object to animate
-* @param {Number}	dur	The duration of the animation
-* @return {ContainerEffect}	The configured ContainerEffect object
-*/
-YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {
-	var x = overlay.cfg.getProperty("x") || YAHOO.util.Dom.getX(overlay.element);
-	var y = overlay.cfg.getProperty("y") || YAHOO.util.Dom.getY(overlay.element);
+        fade.handleStartAnimateIn = function (type,args,obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
 
-	var clientWidth = YAHOO.util.Dom.getClientWidth();
-	var offsetWidth = overlay.element.offsetWidth;
+            if (!obj.overlay.underlay) {
+                obj.overlay.cfg.refireEvent("underlay");
+            }
 
-	var slide = new YAHOO.widget.ContainerEffect(overlay, {
-															attributes:{ points: { to:[x, y] } },
-															duration:dur,
-															method:YAHOO.util.Easing.easeIn
-														},
-														{
-															attributes:{ points: { to:[(clientWidth+25), y] } },
-															duration:dur,
-															method:YAHOO.util.Easing.easeOut
-														},
-														overlay.element,
-														YAHOO.util.Motion);
+            obj.handleUnderlayStart();
 
+            Dom.setStyle(obj.overlay.element, "visibility", "visible");
+            Dom.setStyle(obj.overlay.element, "opacity", 0);
+        };
 
-	slide.handleStartAnimateIn = function(type,args,obj) {
-		obj.overlay.element.style.left = (-25-offsetWidth) + "px";
-		obj.overlay.element.style.top  = y + "px";
-	};
+        fade.handleCompleteAnimateIn = function (type,args,obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
 
-	slide.handleTweenAnimateIn = function(type, args, obj) {
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
 
+            obj.handleUnderlayComplete();
 
-		var pos = YAHOO.util.Dom.getXY(obj.overlay.element);
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
 
-		var currentX = pos[0];
-		var currentY = pos[1];
+        fade.handleStartAnimateOut = function (type, args, obj) {
+            Dom.addClass(obj.overlay.element, "hide-select");
+            obj.handleUnderlayStart();
+        };
 
-		if (YAHOO.util.Dom.getStyle(obj.overlay.element, "visibility") == "hidden" && currentX < x) {
-			YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "visible");
-		}
+        fade.handleCompleteAnimateOut =  function (type, args, obj) {
+            Dom.removeClass(obj.overlay.element, "hide-select");
+            if (obj.overlay.element.style.filter) {
+                obj.overlay.element.style.filter = null;
+            }
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+            Dom.setStyle(obj.overlay.element, "opacity", 1);
 
-		obj.overlay.cfg.setProperty("xy", [currentX,currentY], true);
-		obj.overlay.cfg.refireEvent("iframe");
-	};
+            obj.handleUnderlayComplete();
 
-	slide.handleCompleteAnimateIn = function(type, args, obj) {
-		obj.overlay.cfg.setProperty("xy", [x,y], true);
-		obj.startX = x;
-		obj.startY = y;
-		obj.overlay.cfg.refireEvent("iframe");
-		obj.animateInCompleteEvent.fire();
-	};
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateOutCompleteEvent.fire();
+        };
 
-	slide.handleStartAnimateOut = function(type, args, obj) {
-		var vw = YAHOO.util.Dom.getViewportWidth();
+        fade.init();
+        return fade;
+    };
+    
+    
+    /**
+    * A pre-configured ContainerEffect instance that can be used for sliding an 
+    * overlay in and out.
+    * @method SLIDE
+    * @static
+    * @param {YAHOO.widget.Overlay} overlay The Overlay object to animate
+    * @param {Number} dur The duration of the animation
+    * @return {YAHOO.widget.ContainerEffect} The configured ContainerEffect object
+    */
+    ContainerEffect.SLIDE = function (overlay, dur) {
+    
+        var x = overlay.cfg.getProperty("x") || Dom.getX(overlay.element),
+    
+            y = overlay.cfg.getProperty("y") || Dom.getY(overlay.element),
+    
+            clientWidth = Dom.getClientWidth(),
+    
+            offsetWidth = overlay.element.offsetWidth,
+    
+            slide = new ContainerEffect(overlay, 
+            
+            { attributes: { points: { to: [x, y] } },
+                duration: dur,
+                method: Easing.easeIn },
+    
+            { attributes: { points: { to: [(clientWidth + 25), y] } },
+                duration: dur,
+                method: Easing.easeOut },
+    
+            overlay.element, YAHOO.util.Motion);
+        
+        
+        slide.handleStartAnimateIn = function (type,args,obj) {
+            obj.overlay.element.style.left = ((-25) - offsetWidth) + "px";
+            obj.overlay.element.style.top  = y + "px";
+        };
+        
+        slide.handleTweenAnimateIn = function (type, args, obj) {
+        
+            var pos = Dom.getXY(obj.overlay.element),
+                currentX = pos[0],
+                currentY = pos[1];
+        
+            if (Dom.getStyle(obj.overlay.element, "visibility") == 
+                "hidden" && currentX < x) {
 
-		var pos = YAHOO.util.Dom.getXY(obj.overlay.element);
+                Dom.setStyle(obj.overlay.element, "visibility", "visible");
 
-		var yso = pos[1];
+            }
+        
+            obj.overlay.cfg.setProperty("xy", [currentX, currentY], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateIn = function (type, args, obj) {
+            obj.overlay.cfg.setProperty("xy", [x, y], true);
+            obj.startX = x;
+            obj.startY = y;
+            obj.overlay.cfg.refireEvent("iframe");
+            obj.animateInCompleteEvent.fire();
+        };
+        
+        slide.handleStartAnimateOut = function (type, args, obj) {
+    
+            var vw = Dom.getViewportWidth(),
+                pos = Dom.getXY(obj.overlay.element),
+                yso = pos[1];
+    
+            obj.animOut.attributes.points.to = [(vw + 25), yso];
+        };
+        
+        slide.handleTweenAnimateOut = function (type, args, obj) {
+    
+            var pos = Dom.getXY(obj.overlay.element),
+                xto = pos[0],
+                yto = pos[1];
+        
+            obj.overlay.cfg.setProperty("xy", [xto, yto], true);
+            obj.overlay.cfg.refireEvent("iframe");
+        };
+        
+        slide.handleCompleteAnimateOut = function (type, args, obj) {
+            Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+        
+            obj.overlay.cfg.setProperty("xy", [x, y]);
+            obj.animateOutCompleteEvent.fire();
+        };
+        
+        slide.init();
+        return slide;
+    };
+    
+    ContainerEffect.prototype = {
+    
+        /**
+        * Initializes the animation classes and events.
+        * @method init
+        */
+        init: function () {
 
-		var currentTo = obj.animOut.attributes.points.to;
-		obj.animOut.attributes.points.to = [(vw+25), yso];
-	};
+            this.beforeAnimateInEvent = this.createEvent("beforeAnimateIn");
+            this.beforeAnimateInEvent.signature = CustomEvent.LIST;
+            
+            this.beforeAnimateOutEvent = this.createEvent("beforeAnimateOut");
+            this.beforeAnimateOutEvent.signature = CustomEvent.LIST;
+        
+            this.animateInCompleteEvent = this.createEvent("animateInComplete");
+            this.animateInCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animateOutCompleteEvent = 
+                this.createEvent("animateOutComplete");
+            this.animateOutCompleteEvent.signature = CustomEvent.LIST;
+        
+            this.animIn = new this.animClass(this.targetElement, 
+                this.attrIn.attributes, this.attrIn.duration, 
+                this.attrIn.method);
 
-	slide.handleTweenAnimateOut = function(type, args, obj) {
-		var pos = YAHOO.util.Dom.getXY(obj.overlay.element);
+            this.animIn.onStart.subscribe(this.handleStartAnimateIn, this);
+            this.animIn.onTween.subscribe(this.handleTweenAnimateIn, this);
 
-		var xto = pos[0];
-		var yto = pos[1];
+            this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn, 
+                this);
+        
+            this.animOut = new this.animClass(this.targetElement, 
+                this.attrOut.attributes, this.attrOut.duration, 
+                this.attrOut.method);
+
+            this.animOut.onStart.subscribe(this.handleStartAnimateOut, this);
+            this.animOut.onTween.subscribe(this.handleTweenAnimateOut, this);
+            this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut, 
+                this);
 
-		obj.overlay.cfg.setProperty("xy", [xto,yto], true);
-		obj.overlay.cfg.refireEvent("iframe");
-	};
+        },
+        
+        /**
+        * Triggers the in-animation.
+        * @method animateIn
+        */
+        animateIn: function () {
+            this.beforeAnimateInEvent.fire();
+            this.animIn.animate();
+        },
+        
+        /**
+        * Triggers the out-animation.
+        * @method animateOut
+        */
+        animateOut: function () {
+            this.beforeAnimateOutEvent.fire();
+            this.animOut.animate();
+        },
+        
+        /**
+        * The default onStart handler for the in-animation.
+        * @method handleStartAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the in-animation.
+        * @method handleTweenAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateIn: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the in-animation.
+        * @method handleCompleteAnimateIn
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateIn: function (type, args, obj) { },
+        
+        /**
+        * The default onStart handler for the out-animation.
+        * @method handleStartAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleStartAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onTween handler for the out-animation.
+        * @method handleTweenAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleTweenAnimateOut: function (type, args, obj) { },
+    
+        /**
+        * The default onComplete handler for the out-animation.
+        * @method handleCompleteAnimateOut
+        * @param {String} type The CustomEvent type
+        * @param {Object[]} args The CustomEvent arguments
+        * @param {Object} obj The scope object
+        */
+        handleCompleteAnimateOut: function (type, args, obj) { },
+        
+        /**
+        * Returns a string representation of the object.
+        * @method toString
+        * @return {String} The string representation of the ContainerEffect
+        */
+        toString: function () {
+            var output = "ContainerEffect";
+            if (this.overlay) {
+                output += " [" + this.overlay.toString() + "]";
+            }
+            return output;
+        }
+    
+    };
 
-	slide.handleCompleteAnimateOut = function(type, args, obj) {
-		YAHOO.util.Dom.setStyle(obj.overlay.element, "visibility", "hidden");
+    YAHOO.lang.augmentProto(ContainerEffect, YAHOO.util.EventProvider);
 
-		obj.overlay.cfg.setProperty("xy", [x,y]);
-		obj.animateOutCompleteEvent.fire();
-	};
+})();
 
-	slide.init();
-	return slide;
-};
-YAHOO.register("container", YAHOO.widget.Module, {version: "2.2.1", build: "193"});
+YAHOO.register("container", YAHOO.widget.Module, {version: "2.4.1", build: "742"});

Modified: jifty/branches/jquery/share/web/static/js/yui/dom.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/yui/dom.js	(original)
+++ jifty/branches/jquery/share/web/static/js/yui/dom.js	Mon Jan 21 11:08:06 2008
@@ -2,14 +2,8 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
-/*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-*/
-
 /**
  * The dom module provides helper methods for manipulating Dom elements.
  * @module dom
@@ -21,19 +15,20 @@
         getStyle,           // for load time browser branching
         setStyle,           // ditto
         id_counter = 0,     // for use with generateId
-        propertyCache = {}; // for faster hyphen converts
+        propertyCache = {}, // for faster hyphen converts
+        reClassNameCache = {},          // cache regexes for className
+        document = window.document;     // cache for faster lookups
     
     // brower detection
-    var ua = navigator.userAgent.toLowerCase(),
-        isOpera = (ua.indexOf('opera') > -1),
-        isSafari = (ua.indexOf('safari') > -1),
-        isGecko = (!isOpera && !isSafari && ua.indexOf('gecko') > -1),
-        isIE = (!isOpera && ua.indexOf('msie') > -1); 
+    var isOpera = YAHOO.env.ua.opera,
+        isSafari = YAHOO.env.ua.webkit, 
+        isGecko = YAHOO.env.ua.gecko,
+        isIE = YAHOO.env.ua.ie; 
     
     // regex cache
     var patterns = {
         HYPHEN: /(-[a-z])/i, // to normalize get/setStyle
-        ROOT_TAG: /body|html/i // body for quirks mode, html for standards
+        ROOT_TAG: /^body|html$/i // body for quirks mode, html for standards
     };
 
     var toCamel = function(property) {
@@ -57,6 +52,15 @@
         //return property.replace(/-([a-z])/gi, function(m0, m1) {return m1.toUpperCase()}) // cant use function as 2nd arg yet due to safari bug
     };
     
+    var getClassRegEx = function(className) {
+        var re = reClassNameCache[className];
+        if (!re) {
+            re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
+            reClassNameCache[className] = re;
+        }
+        return re;
+    };
+
     // branching at load instead of runtime
     if (document.defaultView && document.defaultView.getComputedStyle) { // W3C DOM method
         getStyle = function(el, property) {
@@ -88,7 +92,6 @@
                         }
                     }
                     return val / 100;
-                    break;
                 case 'float': // fix reserved word
                     property = 'styleFloat'; // fall through
                 default: 
@@ -127,7 +130,11 @@
             el.style[property] = val;
         };
     }
-    
+
+    var testElement = function(node, method) {
+        return node && node.nodeType == 1 && ( !method || method(node) );
+    };
+
     /**
      * Provides helper methods for DOM elements.
      * @namespace YAHOO.util
@@ -141,11 +148,15 @@
          * @return {HTMLElement | Array} A DOM reference to an HTML element or an array of HTMLElements.
          */
         get: function(el) {
-            if ( YAHOO.lang.isString(el) ) { // ID 
+            if (el && (el.tagName || el.item)) { // HTMLElement, or HTMLCollection
+                return el;
+            }
+
+            if (YAHOO.lang.isString(el) || !el) { // HTMLElement or null
                 return document.getElementById(el);
             }
             
-            if ( YAHOO.lang.isArray(el) ) { // Array of IDs and/or HTMLElements
+            if (el.length !== undefined) { // array-like 
                 var c = [];
                 for (var i = 0, len = el.length; i < len; ++i) {
                     c[c.length] = Y.Dom.get(el[i]);
@@ -154,11 +165,7 @@
                 return c;
             }
 
-            if (el) { // assuming HTMLElement or HTMLCollection, just pass back 
-                return el;
-            }
-
-            return null; // el is likely null or undefined 
+            return el; // some other object, just pass it back
         },
     
         /**
@@ -204,75 +211,13 @@
          */
         getXY: function(el) {
             var f = function(el) {
-    
-            // has to be part of document to have pageXY
+                // has to be part of document to have pageXY
                 if ( (el.parentNode === null || el.offsetParent === null ||
-                        this.getStyle(el, 'display') == 'none') && el != document.body) {
+                        this.getStyle(el, 'display') == 'none') && el != el.ownerDocument.body) {
                     return false;
                 }
                 
-                var parentNode = null;
-                var pos = [];
-                var box;
-                
-                if (el.getBoundingClientRect) { // IE
-                    box = el.getBoundingClientRect();
-                    var doc = document;
-                    if ( !this.inDocument(el) && parent.document != document) {// might be in a frame, need to get its scroll
-                        doc = parent.document;
-
-                        if ( !this.isAncestor(doc.documentElement, el) ) {
-                            return false;                      
-                        }
-
-                    }
-
-                    var scrollTop = Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
-                    var scrollLeft = Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
-                    
-                    return [box.left + scrollLeft, box.top + scrollTop];
-                }
-                else { // safari, opera, & gecko
-                    pos = [el.offsetLeft, el.offsetTop];
-                    parentNode = el.offsetParent;
-
-                    // safari: if el is abs or any parent is abs, subtract body offsets
-                    var hasAbs = this.getStyle(el, 'position') == 'absolute';
-
-                    if (parentNode != el) {
-                        while (parentNode) {
-                            pos[0] += parentNode.offsetLeft;
-                            pos[1] += parentNode.offsetTop;
-                            if (isSafari && !hasAbs && 
-                                    this.getStyle(parentNode,'position') == 'absolute' ) {
-                                hasAbs = true; // we need to offset if any parent is absolutely positioned
-                            }
-                            parentNode = parentNode.offsetParent;
-                        }
-                    }
-
-                    if (isSafari && hasAbs) { //safari doubles in this case
-                        pos[0] -= document.body.offsetLeft;
-                        pos[1] -= document.body.offsetTop;
-                    } 
-                }
-                
-                parentNode = el.parentNode;
-
-                // account for any scrolled ancestors
-                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
-                {
-                   // work around opera inline scrollLeft/Top bug
-                   if (isOpera && Y.Dom.getStyle(parentNode, 'display') != 'inline') { 
-                        pos[0] -= parentNode.scrollLeft;
-                        pos[1] -= parentNode.scrollTop;
-                    }
-                    
-                    parentNode = parentNode.parentNode; 
-                }
-        
-                
-                return pos;
+                return getXY(el);
             };
             
             return Y.Dom.batch(el, f, Y.Dom, true);
@@ -282,7 +227,7 @@
          * Gets the current X position of an element based on page coordinates.  The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
          * @method getX
          * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
-         * @return {String | Array} The X position of the element(s)
+         * @return {Number | Array} The X position of the element(s)
          */
         getX: function(el) {
             var f = function(el) {
@@ -296,7 +241,7 @@
          * Gets the current Y position of an element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
          * @method getY
          * @param {String | HTMLElement | Array} el Accepts a string to use as an ID, an actual DOM reference, or an Array of IDs and/or HTMLElements
-         * @return {String | Array} The Y position of the element(s)
+         * @return {Number | Array} The Y position of the element(s)
          */
         getY: function(el) {
             var f = function(el) {
@@ -388,7 +333,12 @@
          */
         getRegion: function(el) {
             var f = function(el) {
-                var region = new Y.Region.getRegion(el);
+                if ( (el.parentNode === null || el.offsetParent === null ||
+                        this.getStyle(el, 'display') == 'none') && el != document.body) {
+                    return false;
+                }
+
+                var region = Y.Region.getRegion(el);
                 return region;
             };
             
@@ -422,11 +372,30 @@
          * @param {String} className The class name to match against
          * @param {String} tag (optional) The tag name of the elements being collected
          * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @param {Function} apply (optional) A function to apply to each element when found 
          * @return {Array} An array of elements that have the given class name
          */
-        getElementsByClassName: function(className, tag, root) {
-            var method = function(el) { return Y.Dom.hasClass(el, className); };
-            return Y.Dom.getElementsBy(method, tag, root);
+        getElementsByClassName: function(className, tag, root, apply) {
+            tag = tag || '*';
+            root = (root) ? Y.Dom.get(root) : null || document; 
+            if (!root) {
+                return [];
+            }
+
+            var nodes = [],
+                elements = root.getElementsByTagName(tag),
+                re = getClassRegEx(className);
+
+            for (var i = 0, len = elements.length; i < len; ++i) {
+                if ( re.test(elements[i].className) ) {
+                    nodes[nodes.length] = elements[i];
+                    if (apply) {
+                        apply.call(elements[i], elements[i]);
+                    }
+                }
+            }
+            
+            return nodes;
         },
 
         /**
@@ -437,8 +406,8 @@
          * @return {Boolean | Array} A boolean value or array of boolean values
          */
         hasClass: function(el, className) {
-            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
-            
+            var re = getClassRegEx(className);
+
             var f = function(el) {
                 return re.test(el.className);
             };
@@ -451,16 +420,20 @@
          * @method addClass         
          * @param {String | HTMLElement | Array} el The element or collection to add the class to
          * @param {String} className the class name to add to the class attribute
+         * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         addClass: function(el, className) {
             var f = function(el) {
-                if (this.hasClass(el, className)) { return; } // already present
+                if (this.hasClass(el, className)) {
+                    return false; // already present
+                }
                 
                 
-                el.className = [el.className, className].join(' ');
+                el.className = YAHOO.lang.trim([el.className, className].join(' '));
+                return true;
             };
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, f, Y.Dom, true);
         },
     
         /**
@@ -468,13 +441,14 @@
          * @method removeClass         
          * @param {String | HTMLElement | Array} el The element or collection to remove the class from
          * @param {String} className the class name to remove from the class attribute
+         * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         removeClass: function(el, className) {
-            var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', 'g');
-
+            var re = getClassRegEx(className);
+            
             var f = function(el) {
                 if (!this.hasClass(el, className)) {
-                    return; // not present
+                    return false; // not present
                 }                 
 
                 
@@ -483,10 +457,12 @@
                 if ( this.hasClass(el, className) ) { // in case of multiple adjacent
                     this.removeClass(el, className);
                 }
-                
+
+                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
+                return true;
             };
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, f, Y.Dom, true);
         },
         
         /**
@@ -496,19 +472,20 @@
          * @param {String | HTMLElement | Array} el The element or collection to remove the class from
          * @param {String} oldClassName the class name to be replaced
          * @param {String} newClassName the class name that will be replacing the old class name
+         * @return {Boolean | Array} A pass/fail boolean or array of booleans
          */
         replaceClass: function(el, oldClassName, newClassName) {
-            if (oldClassName === newClassName) { // avoid infinite loop
+            if (!newClassName || oldClassName === newClassName) { // avoid infinite loop
                 return false;
             }
             
-            var re = new RegExp('(?:^|\\s+)' + oldClassName + '(?:\\s+|$)', 'g');
+            var re = getClassRegEx(oldClassName);
 
             var f = function(el) {
             
                 if ( !this.hasClass(el, oldClassName) ) {
                     this.addClass(el, newClassName); // just add it if nothing to replace
-                    return; // note return
+                    return true; // NOTE: return
                 }
             
                 el.className = el.className.replace(re, ' ' + newClassName + ' ');
@@ -516,13 +493,16 @@
                 if ( this.hasClass(el, oldClassName) ) { // in case of multiple adjacent
                     this.replaceClass(el, oldClassName, newClassName);
                 }
+
+                el.className = YAHOO.lang.trim(el.className); // remove any trailing spaces
+                return true;
             };
             
-            Y.Dom.batch(el, f, Y.Dom, true);
+            return Y.Dom.batch(el, f, Y.Dom, true);
         },
         
         /**
-         * Generates a unique ID
+         * Returns an ID and applies it to the element "el", if provided.
          * @method generateId  
          * @param {String | HTMLElement | Array} el (optional) An optional element array of elements to add an ID to (no ID is added if one is already present).
          * @param {String} prefix (optional) an optional prefix to use (defaults to "yui-gen").
@@ -530,24 +510,23 @@
          */
         generateId: function(el, prefix) {
             prefix = prefix || 'yui-gen';
-            el = el || {};
-            
+
             var f = function(el) {
+                if (el && el.id) { // do not override existing ID
+                    return el.id;
+                } 
+
+                var id = prefix + id_counter++;
+
                 if (el) {
-                    el = Y.Dom.get(el);
-                } else {
-                    el = {}; // just generating ID in this case
+                    el.id = id;
                 }
                 
-                if (!el.id) {
-                    el.id = prefix + id_counter++; 
-                } // dont override existing
-                
-                
-                return el.id;
+                return id;
             };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+
+            // batch fails when no element, so just generate and return single ID
+            return Y.Dom.batch(el, f, Y.Dom, true) || f.apply(Y.Dom, arguments);
         },
         
         /**
@@ -559,33 +538,24 @@
          */
         isAncestor: function(haystack, needle) {
             haystack = Y.Dom.get(haystack);
-            if (!haystack || !needle) { return false; }
-            
-            var f = function(needle) {
-                if (haystack.contains && !isSafari) { // safari "contains" is broken
-                    return haystack.contains(needle);
-                }
-                else if ( haystack.compareDocumentPosition ) {
-                    return !!(haystack.compareDocumentPosition(needle) & 16);
-                }
-                else { // loop up and test each parent
-                    var parent = needle.parentNode;
-                    
-                    while (parent) {
-                        if (parent == haystack) {
-                            return true;
-                        }
-                        else if (!parent.tagName || parent.tagName.toUpperCase() == 'HTML') {
-                            return false;
-                        }
-                        
-                        parent = parent.parentNode;
-                    }
-                    return false;
-                }     
-            };
+            needle = Y.Dom.get(needle);
             
-            return Y.Dom.batch(needle, f, Y.Dom, true);      
+            if (!haystack || !needle) {
+                return false;
+            }
+
+            if (haystack.contains && needle.nodeType && !isSafari) { // safari contains is broken
+                return haystack.contains(needle);
+            }
+            else if ( haystack.compareDocumentPosition && needle.nodeType ) {
+                return !!(haystack.compareDocumentPosition(needle) & 16);
+            } else if (needle.nodeType) {
+                // fallback to crawling up (safari)
+                return !!this.getAncestorBy(needle, function(el) {
+                    return el == haystack; 
+                }); 
+            }
+            return false;
         },
         
         /**
@@ -595,11 +565,7 @@
          * @return {Boolean} Whether or not the element is present in the current document
          */
         inDocument: function(el) {
-            var f = function(el) {
-                return this.isAncestor(document.documentElement, el);
-            };
-            
-            return Y.Dom.batch(el, f, Y.Dom, true);
+            return this.isAncestor(document.documentElement, el);
         },
         
         /**
@@ -607,33 +573,29 @@
          * For optimized performance, include a tag and/or root node when possible.
          * @method getElementsBy
          * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
-
          * @param {String} tag (optional) The tag name of the elements being collected
          * @param {String | HTMLElement} root (optional) The HTMLElement or an ID to use as the starting point 
+         * @param {Function} apply (optional) A function to apply to each element when found 
          * @return {Array} Array of HTMLElements
          */
-        getElementsBy: function(method, tag, root) {
+        getElementsBy: function(method, tag, root, apply) {
             tag = tag || '*';
-            
-            var nodes = [];
-            
-            if (root) {
-                root = Y.Dom.get(root);
-                if (!root) { // if no root node, then no children
-                    return nodes;
-                }
-            } else {
-                root = document;
-            }
-            
-            var elements = root.getElementsByTagName(tag);
-            
-            if ( !elements.length && (tag == '*' && root.all) ) {
-                elements = root.all; // IE < 6
+            root = (root) ? Y.Dom.get(root) : null || document; 
+
+            if (!root) {
+                return [];
             }
+
+            var nodes = [],
+                elements = root.getElementsByTagName(tag);
             
             for (var i = 0, len = elements.length; i < len; ++i) {
-                if ( method(elements[i]) ) { nodes[nodes.length] = elements[i]; }
+                if ( method(elements[i]) ) {
+                    nodes[nodes.length] = elements[i];
+                    if (apply) {
+                        apply(elements[i]);
+                    }
+                }
             }
 
             
@@ -641,34 +603,30 @@
         },
         
         /**
-         * Returns an array of elements that have had the supplied method applied.
+         * Runs the supplied method against each item in the Collection/Array.
          * The method is called with the element(s) as the first arg, and the optional param as the second ( method(el, o) ).
          * @method batch
          * @param {String | HTMLElement | Array} el (optional) An element or array of elements to apply the method to
          * @param {Function} method The method to apply to the element(s)
          * @param {Any} o (optional) An optional arg that is passed to the supplied method
          * @param {Boolean} override (optional) Whether or not to override the scope of "method" with "o"
-         * @return {HTMLElement | Array} The element(s) with the method applied
+         * @return {Any | Array} The return value(s) from the supplied method
          */
         batch: function(el, method, o, override) {
-            var id = el;
-            el = Y.Dom.get(el);
-            
+            el = (el && (el.tagName || el.item)) ? el : Y.Dom.get(el); // skip get() when possible
+
+            if (!el || !method) {
+                return false;
+            } 
             var scope = (override) ? o : window;
             
-            if (!el || el.tagName || !el.length) { // is null or not a collection (tagName for SELECT and others that can be both an element and a collection)
-                if (!el) {
-                    return false;
-                }
+            if (el.tagName || el.length === undefined) { // element or not array-like 
                 return method.call(scope, el, o);
             } 
-            
+
             var collection = [];
             
             for (var i = 0, len = el.length; i < len; ++i) {
-                if (!el[i]) {
-                    id = el[i];
-                }
                 collection[collection.length] = method.call(scope, el[i], o);
             }
             
@@ -732,8 +690,351 @@
                         document.body.clientWidth; // Quirks
             }
             return width;
+        },
+
+       /**
+         * Returns the nearest ancestor that passes the test applied by supplied boolean method.
+         * For performance reasons, IDs are not accepted and argument validation omitted.
+         * @method getAncestorBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method - A boolean method for testing elements which receives the element as its only argument.
+         * @return {Object} HTMLElement or null if not found
+         */
+        getAncestorBy: function(node, method) {
+            while (node = node.parentNode) { // NOTE: assignment
+                if ( testElement(node, method) ) {
+                    return node;
+                }
+            } 
+
+            return null;
+        },
+        
+        /**
+         * Returns the nearest ancestor with the given className.
+         * @method getAncestorByClassName
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @param {String} className
+         * @return {Object} HTMLElement
+         */
+        getAncestorByClassName: function(node, className) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+            var method = function(el) { return Y.Dom.hasClass(el, className); };
+            return Y.Dom.getAncestorBy(node, method);
+        },
+
+        /**
+         * Returns the nearest ancestor with the given tagName.
+         * @method getAncestorByTagName
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @param {String} tagName
+         * @return {Object} HTMLElement
+         */
+        getAncestorByTagName: function(node, tagName) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+            var method = function(el) {
+                 return el.tagName && el.tagName.toUpperCase() == tagName.toUpperCase();
+            };
+
+            return Y.Dom.getAncestorBy(node, method);
+        },
+
+        /**
+         * Returns the previous sibling that is an HTMLElement. 
+         * For performance reasons, IDs are not accepted and argument validation omitted.
+         * Returns the nearest HTMLElement sibling if no method provided.
+         * @method getPreviousSiblingBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test siblings
+         * that receives the sibling node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getPreviousSiblingBy: function(node, method) {
+            while (node) {
+                node = node.previousSibling;
+                if ( testElement(node, method) ) {
+                    return node;
+                }
+            }
+            return null;
+        }, 
+
+        /**
+         * Returns the previous sibling that is an HTMLElement 
+         * @method getPreviousSibling
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getPreviousSibling: function(node) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+
+            return Y.Dom.getPreviousSiblingBy(node);
+        }, 
+
+        /**
+         * Returns the next HTMLElement sibling that passes the boolean method. 
+         * For performance reasons, IDs are not accepted and argument validation omitted.
+         * Returns the nearest HTMLElement sibling if no method provided.
+         * @method getNextSiblingBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test siblings
+         * that receives the sibling node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getNextSiblingBy: function(node, method) {
+            while (node) {
+                node = node.nextSibling;
+                if ( testElement(node, method) ) {
+                    return node;
+                }
+            }
+            return null;
+        }, 
+
+        /**
+         * Returns the next sibling that is an HTMLElement 
+         * @method getNextSibling
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getNextSibling: function(node) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+
+            return Y.Dom.getNextSiblingBy(node);
+        }, 
+
+        /**
+         * Returns the first HTMLElement child that passes the test method. 
+         * @method getFirstChildBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test children
+         * that receives the node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getFirstChildBy: function(node, method) {
+            var child = ( testElement(node.firstChild, method) ) ? node.firstChild : null;
+            return child || Y.Dom.getNextSiblingBy(node.firstChild, method);
+        }, 
+
+        /**
+         * Returns the first HTMLElement child. 
+         * @method getFirstChild
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getFirstChild: function(node, method) {
+            node = Y.Dom.get(node);
+            if (!node) {
+                return null;
+            }
+            return Y.Dom.getFirstChildBy(node);
+        }, 
+
+        /**
+         * Returns the last HTMLElement child that passes the test method. 
+         * @method getLastChildBy
+         * @param {HTMLElement} node The HTMLElement to use as the starting point 
+         * @param {Function} method A boolean function used to test children
+         * that receives the node being tested as its only argument
+         * @return {Object} HTMLElement or null if not found
+         */
+        getLastChildBy: function(node, method) {
+            if (!node) {
+                return null;
+            }
+            var child = ( testElement(node.lastChild, method) ) ? node.lastChild : null;
+            return child || Y.Dom.getPreviousSiblingBy(node.lastChild, method);
+        }, 
+
+        /**
+         * Returns the last HTMLElement child. 
+         * @method getLastChild
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Object} HTMLElement or null if not found
+         */
+        getLastChild: function(node) {
+            node = Y.Dom.get(node);
+            return Y.Dom.getLastChildBy(node);
+        }, 
+
+        /**
+         * Returns an array of HTMLElement childNodes that pass the test method. 
+         * @method getChildrenBy
+         * @param {HTMLElement} node The HTMLElement to start from
+         * @param {Function} method A boolean function used to test children
+         * that receives the node being tested as its only argument
+         * @return {Array} A static array of HTMLElements
+         */
+        getChildrenBy: function(node, method) {
+            var child = Y.Dom.getFirstChildBy(node, method);
+            var children = child ? [child] : [];
+
+            Y.Dom.getNextSiblingBy(child, function(node) {
+                if ( !method || method(node) ) {
+                    children[children.length] = node;
+                }
+                return false; // fail test to collect all children
+            });
+
+            return children;
+        },
+ 
+        /**
+         * Returns an array of HTMLElement childNodes. 
+         * @method getChildren
+         * @param {String | HTMLElement} node The HTMLElement or an ID to use as the starting point 
+         * @return {Array} A static array of HTMLElements
+         */
+        getChildren: function(node) {
+            node = Y.Dom.get(node);
+            if (!node) {
+            }
+
+            return Y.Dom.getChildrenBy(node);
+        },
+ 
+        /**
+         * Returns the left scroll value of the document 
+         * @method getDocumentScrollLeft
+         * @param {HTMLDocument} document (optional) The document to get the scroll value of
+         * @return {Int}  The amount that the document is scrolled to the left
+         */
+        getDocumentScrollLeft: function(doc) {
+            doc = doc || document;
+            return Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
+        }, 
+
+        /**
+         * Returns the top scroll value of the document 
+         * @method getDocumentScrollTop
+         * @param {HTMLDocument} document (optional) The document to get the scroll value of
+         * @return {Int}  The amount that the document is scrolled to the top
+         */
+        getDocumentScrollTop: function(doc) {
+            doc = doc || document;
+            return Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
+        },
+
+        /**
+         * Inserts the new node as the previous sibling of the reference node 
+         * @method insertBefore
+         * @param {String | HTMLElement} newNode The node to be inserted
+         * @param {String | HTMLElement} referenceNode The node to insert the new node before 
+         * @return {HTMLElement} The node that was inserted (or null if insert fails) 
+         */
+        insertBefore: function(newNode, referenceNode) {
+            newNode = Y.Dom.get(newNode); 
+            referenceNode = Y.Dom.get(referenceNode); 
+            
+            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+                return null;
+            }       
+
+            return referenceNode.parentNode.insertBefore(newNode, referenceNode); 
+        },
+
+        /**
+         * Inserts the new node as the next sibling of the reference node 
+         * @method insertAfter
+         * @param {String | HTMLElement} newNode The node to be inserted
+         * @param {String | HTMLElement} referenceNode The node to insert the new node after 
+         * @return {HTMLElement} The node that was inserted (or null if insert fails) 
+         */
+        insertAfter: function(newNode, referenceNode) {
+            newNode = Y.Dom.get(newNode); 
+            referenceNode = Y.Dom.get(referenceNode); 
+            
+            if (!newNode || !referenceNode || !referenceNode.parentNode) {
+                return null;
+            }       
+
+            if (referenceNode.nextSibling) {
+                return referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); 
+            } else {
+                return referenceNode.parentNode.appendChild(newNode);
+            }
+        },
+
+        /**
+         * Creates a Region based on the viewport relative to the document. 
+         * @method getClientRegion
+         * @return {Region} A Region object representing the viewport which accounts for document scroll
+         */
+        getClientRegion: function() {
+            var t = Y.Dom.getDocumentScrollTop(),
+                l = Y.Dom.getDocumentScrollLeft(),
+                r = Y.Dom.getViewportWidth() + l,
+                b = Y.Dom.getViewportHeight() + t;
+
+            return new Y.Region(t, r, b, l);
         }
     };
+    
+    var getXY = function() {
+        if (document.documentElement.getBoundingClientRect) { // IE
+            return function(el) {
+                var box = el.getBoundingClientRect();
+
+                var rootNode = el.ownerDocument;
+                return [box.left + Y.Dom.getDocumentScrollLeft(rootNode), box.top +
+                        Y.Dom.getDocumentScrollTop(rootNode)];
+            };
+        } else {
+            return function(el) { // manually calculate by crawling up offsetParents
+                var pos = [el.offsetLeft, el.offsetTop];
+                var parentNode = el.offsetParent;
+
+                // safari: subtract body offsets if el is abs (or any offsetParent), unless body is offsetParent
+                var accountForBody = (isSafari &&
+                        Y.Dom.getStyle(el, 'position') == 'absolute' &&
+                        el.offsetParent == el.ownerDocument.body);
+
+                if (parentNode != el) {
+                    while (parentNode) {
+                        pos[0] += parentNode.offsetLeft;
+                        pos[1] += parentNode.offsetTop;
+                        if (!accountForBody && isSafari && 
+                                Y.Dom.getStyle(parentNode,'position') == 'absolute' ) { 
+                            accountForBody = true;
+                        }
+                        parentNode = parentNode.offsetParent;
+                    }
+                }
+
+                if (accountForBody) { //safari doubles in this case
+                    pos[0] -= el.ownerDocument.body.offsetLeft;
+                    pos[1] -= el.ownerDocument.body.offsetTop;
+                } 
+                parentNode = el.parentNode;
+
+                // account for any scrolled ancestors
+                while ( parentNode.tagName && !patterns.ROOT_TAG.test(parentNode.tagName) ) 
+                {
+                   // work around opera inline/table scrollLeft/Top bug
+                   if (Y.Dom.getStyle(parentNode, 'display').search(/^inline|table-row.*$/i)) { 
+                        pos[0] -= parentNode.scrollLeft;
+                        pos[1] -= parentNode.scrollTop;
+                    }
+                    
+                    parentNode = parentNode.parentNode; 
+                }
+
+                return pos;
+            };
+        }
+    }() // NOTE: Executing for loadtime branching
 })();
 /**
  * A region is a representation of an object on a grid.  It is defined
@@ -897,8 +1198,8 @@
  * @extends YAHOO.util.Region
  */
 YAHOO.util.Point = function(x, y) {
-   if (x instanceof Array) { // accept output from Dom.getXY
-      y = x[1];
+   if (YAHOO.lang.isArray(x)) { // accept input from Dom.getXY, Event.getXY, etc.
+      y = x[1]; // dont blow away x yet
       x = x[0];
    }
    
@@ -920,4 +1221,4 @@
 
 YAHOO.util.Point.prototype = new YAHOO.util.Region();
 
-YAHOO.register("dom", YAHOO.util.Dom, {version: "2.2.1", build: "193"});
+YAHOO.register("dom", YAHOO.util.Dom, {version: "2.4.1", build: "742"});

Modified: jifty/branches/jquery/share/web/static/js/yui/element-beta.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/yui/element-beta.js	(original)
+++ jifty/branches/jquery/share/web/static/js/yui/element-beta.js	Mon Jan 21 11:08:06 2008
@@ -2,7 +2,7 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
 /**
  * Provides Attribute configurations.
@@ -211,7 +211,7 @@
      * @uses YAHOO.util.EventProvider
      */
     YAHOO.util.AttributeProvider = function() {};
-    
+
     YAHOO.util.AttributeProvider.prototype = {
         
         /**
@@ -228,8 +228,8 @@
          * @param {String} key The attribute whose value will be returned.
          */
         get: function(key){
-            var configs = this._configs || {};
-            var config = configs[key];
+            this._configs = this._configs || {};
+            var config = this._configs[key];
             
             if (!config) {
                 return undefined;
@@ -247,8 +247,8 @@
          * @return {Boolean} Whether or not the value was set.
          */
         set: function(key, value, silent){
-            var configs = this._configs || {};
-            var config = configs[key];
+            this._configs = this._configs || {};
+            var config = this._configs[key];
             
             if (!config) {
                 return false;
@@ -263,12 +263,12 @@
          * @return {Array} An array of attribute names.
          */
         getAttributeKeys: function(){
-            var configs = this._configs;
+            this._configs = this._configs;
             var keys = [];
             var config;
-            for (var key in configs) {
-                config = configs[key];
-                if ( Lang.hasOwnProperty(configs, key) && 
+            for (var key in this._configs) {
+                config = this._configs[key];
+                if ( Lang.hasOwnProperty(this._configs, key) && 
                         !Lang.isUndefined(config) ) {
                     keys[keys.length] = key;
                 }
@@ -299,9 +299,9 @@
          * @return {Boolean} Whether or not the value was set
          */
         resetValue: function(key, silent){
-            var configs = this._configs || {};
-            if (configs[key]) {
-                this.set(key, configs[key]._initialConfig.value, silent);
+            this._configs = this._configs || {};
+            if (this._configs[key]) {
+                this.set(key, this._configs[key]._initialConfig.value, silent);
                 return true;
             }
             return false;
@@ -314,17 +314,17 @@
          * @param {Boolean} silent Whether or not to suppress change events
          */
         refresh: function(key, silent){
-            var configs = this._configs;
+            this._configs = this._configs;
             
             key = ( ( Lang.isString(key) ) ? [key] : key ) || 
                     this.getAttributeKeys();
             
             for (var i = 0, len = key.length; i < len; ++i) { 
                 if ( // only set if there is a value and not null
-                    configs[key[i]] && 
-                    ! Lang.isUndefined(configs[key[i]].value) &&
-                    ! Lang.isNull(configs[key[i]].value) ) {
-                    configs[key[i]].refresh(silent);
+                    this._configs[key[i]] && 
+                    ! Lang.isUndefined(this._configs[key[i]].value) &&
+                    ! Lang.isNull(this._configs[key[i]].value) ) {
+                    this._configs[key[i]].refresh(silent);
                 }
             }
         },
@@ -351,8 +351,8 @@
          * attribute's properties.
          */
         getAttributeConfig: function(key) {
-            var configs = this._configs || {};
-            var config = configs[key] || {};
+            this._configs = this._configs || {};
+            var config = this._configs[key] || {};
             var map = {}; // returning a copy to prevent overrides
             
             for (key in config) {
@@ -372,13 +372,13 @@
          * @param {Boolean} init Whether or not this should become the intial config.
          */
         setAttributeConfig: function(key, map, init) {
-            var configs = this._configs || {};
+            this._configs = this._configs || {};
             map = map || {};
-            if (!configs[key]) {
+            if (!this._configs[key]) {
                 map.name = key;
-                configs[key] = new YAHOO.util.Attribute(map, this);
+                this._configs[key] = this.createAttribute(map);
             } else {
-                configs[key].configure(map, init);
+                this._configs[key].configure(map, init);
             }
         },
         
@@ -401,10 +401,30 @@
          * @private
          */
         resetAttributeConfig: function(key){
-            var configs = this._configs || {};
-            configs[key].resetConfig();
+            this._configs = this._configs || {};
+            this._configs[key].resetConfig();
         },
         
+        // wrapper for EventProvider.subscribe
+        // to create events on the fly
+        subscribe: function(type, callback) {
+            this._events = this._events || {};
+
+            if ( !(type in this._events) ) {
+                this._events[type] = this.createEvent(type);
+            }
+
+            YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments);
+        },
+
+        on: function() {
+            this.subscribe.apply(this, arguments);
+        },
+
+        addListener: function() {
+            this.subscribe.apply(this, arguments);
+        },
+
         /**
          * Fires the attribute's beforeChange event. 
          * @method fireBeforeChangeEvent
@@ -427,6 +447,10 @@
         fireChangeEvent: function(e) {
             e.type += 'Change';
             return this.fireEvent(e.type, e);
+        },
+
+        createAttribute: function(map) {
+            return new YAHOO.util.Attribute(map, this);
         }
     };
     
@@ -474,7 +498,7 @@
     /**
      * Wrapper for HTMLElement method.
      * @method appendChild
-     * @param {Boolean} deep Whether or not to do a deep clone
+     * @param {YAHOO.util.Element || HTMLElement} child The element to append. 
      */
     appendChild: function(child) {
         child = child.get ? child.get('element') : child;
@@ -572,10 +596,9 @@
             }
             
             this.createEvent(type, this);
-            this._events[type] = true;
         }
         
-        this.subscribe.apply(this, arguments); // notify via customEvent
+        YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); // notify via customEvent
     },
     
     
@@ -589,6 +612,15 @@
      */
     on: function() { this.addListener.apply(this, arguments); },
     
+    /**
+     * Alias for addListener
+     * @method subscribe
+     * @param {String} type The name of the event to listen for
+     * @param {Function} fn The function call when the event fires
+     * @param {Any} obj A variable to pass to the handler
+     * @param {Object} scope The object to use for the scope of the handler 
+     */
+    subscribe: function() { this.addListener.apply(this, arguments); },
     
     /**
      * Remove an event listener
@@ -740,6 +772,23 @@
         return AttributeProvider.prototype.get.call(this, key);
     },
 
+    setAttributes: function(map, silent){
+        var el = this.get('element');
+        for (var key in map) {
+            // need to configure if setting unconfigured HTMLElement attribute 
+            if ( !this._configs[key] && !YAHOO.lang.isUndefined(el[key]) ) {
+                this.setAttributeConfig(key);
+            }
+        }
+
+        // set based on configOrder
+        for (var i = 0, len = this._configOrder.length; i < len; ++i) {
+            if (map[this._configOrder[i]]) {
+                this.set(this._configOrder[i], map[this._configOrder[i]], silent);
+            }
+        }
+    },
+
     set: function(key, value, silent) {
         var el = this.get('element');
         if (!el) {
@@ -767,6 +816,7 @@
         } else {
             AttributeProvider.prototype.setAttributeConfig.apply(this, arguments);
         }
+        this._configOrder.push(key);
     },
     
     getAttributeKeys: function() {
@@ -782,6 +832,11 @@
         
         return keys;
     },
+
+    createEvent: function(type, scope) {
+        this._events[type] = true;
+        AttributeProvider.prototype.createEvent.apply(this, arguments);
+    },
     
     init: function(el, attr) {
         _initElement.apply(this, arguments); 
@@ -792,6 +847,7 @@
     this._queue = this._queue || [];
     this._events = this._events || {};
     this._configs = this._configs || {};
+    this._configOrder = []; 
     attr = attr || {};
     attr.element = attr.element || el || null;
 
@@ -811,53 +867,51 @@
         'submit': true
     };
 
+    var isReady = false;  // to determine when to init HTMLElement and content
+
     if (YAHOO.lang.isString(el) ) { // defer until available/ready
         _registerHTMLAttr.call(this, 'id', { value: attr.element });
     }
 
     if (Dom.get(el)) {
-        _availableHandler.call(this, attr);  
-        _readyHandler.call(this, attr);
-        return; // note return
+        isReady = true;
+        _initHTMLElement.call(this, attr);
+        _initContent.call(this, attr);
     } 
 
     YAHOO.util.Event.onAvailable(attr.element, function() {
-        _availableHandler.call(this, attr);  
+        if (!isReady) { // otherwise already done
+            _initHTMLElement.call(this, attr);
+        }
+
+        this.fireEvent('available', { type: 'available', target: attr.element });  
     }, this, true);
     
     YAHOO.util.Event.onContentReady(attr.element, function() {
-        _readyHandler.call(this, attr);
+        if (!isReady) { // otherwise already done
+            _initContent.call(this, attr);
+        }
+        this.fireEvent('contentReady', { type: 'contentReady', target: attr.element });  
     }, this, true);
 };
 
-var _availableHandler = function(attr) {
-    attr.element = Dom.get(attr.element);
-
+var _initHTMLElement = function(attr) {
     /**
      * The HTMLElement the Element instance refers to.
-     * @config element
+     * @attribute element
      * @type HTMLElement
      */
     this.setAttributeConfig('element', {
-        value: attr.element,
+        value: Dom.get(attr.element),
         readOnly: true
      });
-
-    this.fireEvent('available', {
-        type: 'available',
-        target: attr.element
-    }); 
 };
 
-var _readyHandler = function(attr) {
+var _initContent = function(attr) {
     this.initAttributes(attr);
     this.setAttributes(attr, true);
     this.fireQueue();
 
-    this.fireEvent('contentReady', {
-        type: 'contentReady',
-        target: attr.element
-    });
 };
 
 /**
@@ -910,4 +964,4 @@
 YAHOO.augment(YAHOO.util.Element, AttributeProvider);
 })();
 
-YAHOO.register("element", YAHOO.util.Element, {version: "2.2.1", build: "193"});
+YAHOO.register("element", YAHOO.util.Element, {version: "2.4.1", build: "742"});

Modified: jifty/branches/jquery/share/web/static/js/yui/event.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/yui/event.js	(original)
+++ jifty/branches/jquery/share/web/static/js/yui/event.js	Mon Jan 21 11:08:06 2008
@@ -2,7 +2,7 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
 
 /**
@@ -109,6 +109,16 @@
                 new YAHOO.util.CustomEvent(onsubscribeType, this, true);
 
     } 
+
+
+    /**
+     * In order to make it possible to execute the rest of the subscriber
+     * stack when one thows an exception, the subscribers exceptions are
+     * caught.  The most recent exception is stored in this property
+     * @property lastError
+     * @type Error
+     */
+    this.lastError = null;
 };
 
 /**
@@ -209,20 +219,20 @@
             return true;
         }
 
-        var args=[], ret=true, i;
+        var args=[], ret=true, i, rebuild=false;
 
         for (i=0; i<arguments.length; ++i) {
             args.push(arguments[i]);
         }
 
-        var argslength = args.length;
-
         if (!this.silent) {
         }
 
         for (i=0; i<len; ++i) {
             var s = this.subscribers[i];
-            if (s) {
+            if (!s) {
+                rebuild=true;
+            } else {
                 if (!this.silent) {
                 }
 
@@ -233,9 +243,18 @@
                     if (args.length > 0) {
                         param = args[0];
                     }
-                    ret = s.fn.call(scope, param, s.obj);
+
+                    try {
+                        ret = s.fn.call(scope, param, s.obj);
+                    } catch(e) {
+                        this.lastError = e;
+                    }
                 } else {
-                    ret = s.fn.call(scope, this.type, args, s.obj);
+                    try {
+                        ret = s.fn.call(scope, this.type, args, s.obj);
+                    } catch(ex) {
+                        this.lastError = ex;
+                    }
                 }
                 if (false === ret) {
                     if (!this.silent) {
@@ -247,6 +266,15 @@
             }
         }
 
+        if (rebuild) {
+            var newlist=[],subs=this.subscribers;
+            for (i=0,len=subs.length; i<len; i=i+1) {
+                newlist.push(subs[i]);
+            }
+
+            this.subscribers=newlist;
+        }
+
         return true;
     },
 
@@ -260,6 +288,8 @@
             this._delete(len - 1 - i);
         }
 
+        this.subscribers=[];
+
         return i;
     },
 
@@ -274,8 +304,7 @@
             delete s.obj;
         }
 
-        // delete this.subscribers[index];
-        this.subscribers.splice(index, 1);
+        this.subscribers[index]=null;
     },
 
     /**
@@ -314,7 +343,7 @@
      * @property obj
      * @type object
      */
-    this.obj = obj || null;
+    this.obj = YAHOO.lang.isUndefined(obj) ? null : obj;
 
     /**
      * The default execution scope for the event listener is defined when the
@@ -370,7 +399,7 @@
  * @method toString
  */
 YAHOO.util.Subscriber.prototype.toString = function() {
-    return "Subscriber { obj: " + (this.obj || "")  + 
+    return "Subscriber { obj: " + this.obj  + 
            ", override: " +  (this.override || "no") + " }";
 };
 
@@ -410,15 +439,6 @@
         var loadComplete =  false;
 
         /**
-         * True when the document is initially usable
-         * @property DOMReady
-         * @type boolean
-         * @static
-         * @private
-         */
-        var DOMReady = false;
-
-        /**
          * Cache of wrapped listeners
          * @property listeners
          * @type array
@@ -489,28 +509,38 @@
         var counter = 0;
         
         /**
-         * addListener/removeListener can throw errors in unexpected scenarios.
-         * These errors are suppressed, the method returns false, and this property
-         * is set
-         * @property lastError
-         * @type Error
+         * Normalized keycodes for webkit/safari
+         * @property webkitKeymap
+         * @type {int: int}
+         * @private
+         * @static
+         * @final
          */
-        var lastError = null;
+        var webkitKeymap = {
+            63232: 38, // up
+            63233: 40, // down
+            63234: 37, // left
+            63235: 39, // right
+            63276: 33, // page up
+            63277: 34, // page down
+            25: 9      // SHIFT-TAB (Safari provides a different key code in
+                       // this case, even though the shiftKey modifier is set)
+        };
 
         return {
 
             /**
              * The number of times we should look for elements that are not
              * in the DOM at the time the event is requested after the document
-             * has been loaded.  The default is 200 at amp;50 ms, so it will poll
-             * for 10 seconds or until all outstanding handlers are bound
+             * has been loaded.  The default is 4000 at amp;10 ms, so it will poll
+             * for 40 seconds or until all outstanding handlers are bound
              * (whichever comes first).
              * @property POLL_RETRYS
              * @type int
              * @static
              * @final
              */
-            POLL_RETRYS: 200,
+            POLL_RETRYS: 4000,
 
             /**
              * The poll interval in milliseconds
@@ -559,13 +589,14 @@
 
             /**
              * Object passed in by the user that will be returned as a 
-             * parameter to the callback, int constant
+             * parameter to the callback, int constant.  Specific to
+             * unload listeners
              * @property OBJ
              * @type int
              * @static
              * @final
              */
-            OBJ: 3,
+            UNLOAD_OBJ: 3,
 
             /**
              * Adjusted scope, either the element we are registering the event
@@ -578,64 +609,86 @@
             ADJ_SCOPE: 4,
 
             /**
-             * Safari detection is necessary to work around the preventDefault
-             * bug that makes it so you can't cancel a href click from the 
-             * handler.  Since this function has been used outside of this
-             * utility, it was changed to detect all KHTML browser to be more
-             * friendly towards the non-Safari browsers that share the engine.
-             * Internally, the preventDefault bug detection now uses the
-             * webkit property.
+             * The original obj passed into addListener
+             * @property OBJ
+             * @type int
+             * @static
+             * @final
+             */
+            OBJ: 5,
+
+            /**
+             * The original scope parameter passed into addListener
+             * @property OVERRIDE
+             * @type int
+             * @static
+             * @final
+             */
+            OVERRIDE: 6,
+
+            /**
+             * addListener/removeListener can throw errors in unexpected scenarios.
+             * These errors are suppressed, the method returns false, and this property
+             * is set
+             * @property lastError
+             * @static
+             * @type Error
+             */
+            lastError: null,
+
+            /**
+             * Safari detection
              * @property isSafari
              * @private
              * @static
-             * @deprecated
+             * @deprecated use YAHOO.env.ua.webkit
              */
-            isSafari: (/KHTML/gi).test(navigator.userAgent),
+            isSafari: YAHOO.env.ua.webkit,
             
             /**
-             * If WebKit is detected, we keep track of the version number of
-             * the engine.  The webkit property will contain a string with
-             * the webkit version number if webkit is detected, null
-             * otherwise.
-             * Safari 1.3.2 (312.6): 312.8.1 <-- currently the latest
-             *                       available on Mac OSX 10.3.
-             * Safari 2.0.2: 416 <-- hasOwnProperty introduced
-             * Safari 2.0.4: 418 <-- preventDefault fixed (I believe)
-             * Safari 2.0.4 (419.3): 418.9.1 <-- current release
-             *
-             * http://developer.apple.com/internet/safari/uamatrix.html
+             * webkit version
              * @property webkit
              * @type string
+             * @private
              * @static
+             * @deprecated use YAHOO.env.ua.webkit
              */
-            webkit: function() {
-                var v=navigator.userAgent.match(/AppleWebKit\/([^ ]*)/);
-                if (v&&v[1]) {
-                    return v[1];
-                }
-                return null;
-            }(),
+            webkit: YAHOO.env.ua.webkit,
             
             /**
-             * IE detection needed to properly calculate pageX and pageY.  
-             * capabilities checking didn't seem to work because another 
-             * browser that does not provide the properties have the values 
-             * calculated in a different manner than IE.
+             * IE detection 
              * @property isIE
              * @private
              * @static
+             * @deprecated use YAHOO.env.ua.ie
              */
-            isIE: (!this.webkit && !navigator.userAgent.match(/opera/gi) && 
-                    navigator.userAgent.match(/msie/gi)),
+            isIE: YAHOO.env.ua.ie,
 
             /**
              * poll handle
              * @property _interval
+             * @static
              * @private
              */
             _interval: null,
 
             /**
+             * document readystate poll handle
+             * @property _dri
+             * @static
+             * @private
+             */
+             _dri: null,
+
+            /**
+             * True when the document is initially usable
+             * @property DOMReady
+             * @type boolean
+             * @static
+             */
+            DOMReady: false,
+
+            /**
              * @method startInterval
              * @static
              * @private
@@ -656,70 +709,109 @@
              * The number of times it will poll and the frequency are
              * configurable.  By default it will poll for 10 seconds.
              *
+             * <p>The callback is executed with a single parameter:
+             * the custom object parameter, if provided.</p>
+             *
              * @method onAvailable
              *
-             * @param {string}   p_id the id of the element to look for.
+             * @param {string||string[]}   p_id the id of the element, or an array
+             * of ids to look for.
              * @param {function} p_fn what to execute when the element is found.
              * @param {object}   p_obj an optional object to be passed back as
              *                   a parameter to p_fn.
-             * @param {boolean}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj
-             *
+             * @param {boolean|object}  p_override If set to true, p_fn will execute
+             *                   in the scope of p_obj, if set to an object it
+             *                   will execute in the scope of that object
+             * @param checkContent {boolean} check child node readiness (onContentReady)
              * @static
              */
-            onAvailable: function(p_id, p_fn, p_obj, p_override) {
-                onAvailStack.push( { id:         p_id, 
-                                     fn:         p_fn, 
-                                     obj:        p_obj, 
-                                     override:   p_override, 
-                                     checkReady: false    } );
+            onAvailable: function(p_id, p_fn, p_obj, p_override, checkContent) {
+
+                var a = (YAHOO.lang.isString(p_id)) ? [p_id] : p_id;
+
+                for (var i=0; i<a.length; i=i+1) {
+                    onAvailStack.push({id:         a[i], 
+                                       fn:         p_fn, 
+                                       obj:        p_obj, 
+                                       override:   p_override, 
+                                       checkReady: checkContent });
+                }
                 retryCount = this.POLL_RETRYS;
                 this.startInterval();
             },
 
             /**
-             * Executes the supplied callback when the DOM is first usable.
+             * Works the same way as onAvailable, but additionally checks the
+             * state of sibling elements to determine if the content of the
+             * available element is safe to modify.
              *
-             * @method onDOMReady
+             * <p>The callback is executed with a single parameter:
+             * the custom object parameter, if provided.</p>
              *
-             * @param {function} p_fn what to execute when the element is found.
+             * @method onContentReady
+             *
+             * @param {string}   p_id the id of the element to look for.
+             * @param {function} p_fn what to execute when the element is ready.
              * @param {object}   p_obj an optional object to be passed back as
              *                   a parameter to p_fn.
-             * @param {boolean}  p_scope If set to true, p_fn will execute
-             *                   in the scope of p_obj, if set to an object it
-             *                   will execute in the scope of that object
+             * @param {boolean|object}  p_override If set to true, p_fn will execute
+             *                   in the scope of p_obj.  If an object, p_fn will
+             *                   exectute in the scope of that object
              *
              * @static
              */
-            onDOMReady: function(p_fn, p_obj, p_override) {
-                this.DOMReadyEvent.subscribe(p_fn, p_obj, p_override);
+            onContentReady: function(p_id, p_fn, p_obj, p_override) {
+                this.onAvailable(p_id, p_fn, p_obj, p_override, true);
             },
 
             /**
-             * Works the same way as onAvailable, but additionally checks the
-             * state of sibling elements to determine if the content of the
-             * available element is safe to modify.
+             * Executes the supplied callback when the DOM is first usable.  This
+             * will execute immediately if called after the DOMReady event has
+             * fired.   @todo the DOMContentReady event does not fire when the
+             * script is dynamically injected into the page.  This means the
+             * DOMReady custom event will never fire in FireFox or Opera when the
+             * library is injected.  It _will_ fire in Safari, and the IE 
+             * implementation would allow for us to fire it if the defered script
+             * is not available.  We want this to behave the same in all browsers.
+             * Is there a way to identify when the script has been injected 
+             * instead of included inline?  Is there a way to know whether the 
+             * window onload event has fired without having had a listener attached 
+             * to it when it did so?
              *
-             * @method onContentReady
+             * <p>The callback is a CustomEvent, so the signature is:</p>
+             * <p>type &lt;string&gt;, args &lt;array&gt;, customobject &lt;object&gt;</p>
+             * <p>For DOMReady events, there are no fire argments, so the
+             * signature is:</p>
+             * <p>"DOMReady", [], obj</p>
              *
-             * @param {string}   p_id the id of the element to look for.
-             * @param {function} p_fn what to execute when the element is ready.
+             *
+             * @method onDOMReady
+             *
+             * @param {function} p_fn what to execute when the element is found.
              * @param {object}   p_obj an optional object to be passed back as
              *                   a parameter to p_fn.
-             * @param {boolean}  p_override If set to true, p_fn will execute
-             *                   in the scope of p_obj
+             * @param {boolean|object}  p_scope If set to true, p_fn will execute
+             *                   in the scope of p_obj, if set to an object it
+             *                   will execute in the scope of that object
              *
              * @static
              */
-            onContentReady: function(p_id, p_fn, p_obj, p_override) {
-                onAvailStack.push( { id:         p_id, 
-                                     fn:         p_fn, 
-                                     obj:        p_obj, 
-                                     override:   p_override,
-                                     checkReady: true      } );
-
-                retryCount = this.POLL_RETRYS;
-                this.startInterval();
+            onDOMReady: function(p_fn, p_obj, p_override) {
+                if (this.DOMReady) {
+                    setTimeout(function() {
+                        var s = window;
+                        if (p_override) {
+                            if (p_override === true) {
+                                s = p_obj;
+                            } else {
+                                s = p_override;
+                            }
+                        }
+                        p_fn.call(s, "DOMReady", [], p_obj);
+                    }, 0);
+                } else {
+                    this.DOMReadyEvent.subscribe(p_fn, p_obj, p_override);
+                }
             },
 
             /**
@@ -727,15 +819,18 @@
              *
              * @method addListener
              *
-             * @param {Object}   el        The html element to assign the 
-             *                             event to
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to assign the 
+             *  listener to.
              * @param {String}   sType     The type of event to append
              * @param {Function} fn        The method the event invokes
              * @param {Object}   obj    An arbitrary object that will be 
              *                             passed as a parameter to the handler
-             * @param {boolean}  override  If true, the obj passed in becomes
-             *                             the execution scope of the listener
-             * @return {boolean} True if the action was successful or defered,
+             * @param {Boolean|object}  override  If true, the obj passed in becomes
+             *                             the execution scope of the listener. If an
+             *                             object, this object becomes the execution
+             *                             scope.
+             * @return {Boolean} True if the action was successful or defered,
              *                        false if one or more of the elements 
              *                        could not have the listener attached,
              *                        or if the operation throws an exception.
@@ -743,8 +838,8 @@
              */
             addListener: function(el, sType, fn, obj, override) {
 
-
                 if (!fn || !fn.call) {
+// throw new TypeError(sType + " addListener call failed, callback undefined");
                     return false;
                 }
 
@@ -760,7 +855,7 @@
                     }
                     return ok;
 
-                } else if (typeof el == "string") {
+                } else if (YAHOO.lang.isString(el)) {
                     var oEl = this.getEl(el);
                     // If the el argument is a string, we assume it is 
                     // actually the id of the element.  If the page is loaded
@@ -813,11 +908,11 @@
                 // wrap the function so we can return the obj object when
                 // the event fires;
                 var wrappedFn = function(e) {
-                        return fn.call(scope, YAHOO.util.Event.getEvent(e), 
+                        return fn.call(scope, YAHOO.util.Event.getEvent(e, el), 
                                 obj);
                     };
 
-                var li = [el, sType, fn, wrappedFn, scope];
+                var li = [el, sType, fn, wrappedFn, scope, obj, override];
                 var index = listeners.length;
                 // cache the listener so we can try to automatically unload
                 listeners[index] = li;
@@ -934,22 +1029,23 @@
             },
                     
             /**
-             * Removes an event handler
+             * Removes an event listener
              *
              * @method removeListener
              *
-             * @param {Object} el the html element or the id of the element to 
-             * assign the event to.
+             * @param {String|HTMLElement|Array|NodeList} el An id, an element 
+             *  reference, or a collection of ids and/or elements to remove
+             *  the listener from.
              * @param {String} sType the type of event to remove.
              * @param {Function} fn the method the event invokes.  If fn is
-             * undefined, then all event handlers for the type of event are 
-             * removed.
+             *  undefined, then all event handlers for the type of event are 
+             *  removed.
              * @return {boolean} true if the unbind was successful, false 
-             * otherwise.
+             *  otherwise.
              * @static
              */
             removeListener: function(el, sType, fn) {
-                var i, len;
+                var i, len, li;
 
                 // The el argument can be a string
                 if (typeof el == "string") {
@@ -968,16 +1064,16 @@
                     return this.purgeElement(el, false, sType);
                 }
 
-
                 if ("unload" == sType) {
 
                     for (i=0, len=unloadListeners.length; i<len; i++) {
-                        var li = unloadListeners[i];
+                        li = unloadListeners[i];
                         if (li && 
                             li[0] == el && 
                             li[1] == sType && 
                             li[2] == fn) {
-                                unloadListeners.splice(i, 1);
+                                //unloadListeners.splice(i, 1);
+                                unloadListeners[i]=null;
                                 return true;
                         }
                     }
@@ -992,7 +1088,7 @@
                 // try and take advantage of it, which is not possible.
                 var index = arguments[3];
   
-                if ("undefined" == typeof index) {
+                if ("undefined" === typeof index) {
                     index = this._getCacheIndex(el, sType, fn);
                 }
 
@@ -1015,7 +1111,8 @@
                                 li[this.EL] == el && 
                                 li[this.TYPE] == sType && 
                                 li[this.FN] == fn) {
-                                    llist.splice(i, 1);
+                                    //llist.splice(i, 1);
+                                    llist[i]=null;
                                     break;
                             }
                         }
@@ -1033,14 +1130,17 @@
                 // removed the wrapped handler
                 delete listeners[index][this.WFN];
                 delete listeners[index][this.FN];
-                listeners.splice(index, 1);
+                //listeners.splice(index, 1);
+                listeners[index]=null;
 
                 return true;
 
             },
 
             /**
-             * Returns the event's target element
+             * Returns the event's target element.  Safari sometimes provides
+             * a text node, and this is automatically resolved to the text
+             * node's parent so that it behaves like other browsers.
              * @method getTarget
              * @param {Event} ev the event
              * @param {boolean} resolveTextNode when set to true the target's
@@ -1065,8 +1165,6 @@
              * @static
              */
             resolveTextNode: function(node) {
-                // if (node && node.nodeName && 
-                        // "#TEXT" == node.nodeName.toUpperCase()) {
                 if (node && 3 == node.nodeType) {
                     return node.parentNode;
                 } else {
@@ -1215,10 +1313,11 @@
              * this function at all.
              * @method getEvent
              * @param {Event} e the event parameter from the handler
+             * @param {HTMLElement} boundEl the element the listener is attached to
              * @return {Event} the event 
              * @static
              */
-            getEvent: function(e) {
+            getEvent: function(e, boundEl) {
                 var ev = e || window.event;
 
                 if (!ev) {
@@ -1232,6 +1331,30 @@
                     }
                 }
 
+                // IE events that target non-browser objects (e.g., VML
+                // canvas) will sometimes throw errors when you try to
+                // inspect the properties of the event target.  We try to
+                // detect this condition, and provide a dummy target (the bound
+                // element) to eliminate spurious errors.  
+
+                // the implementation caused unexpected results in some 
+                // implementations, so this has been rolled back for now
+                /* 
+                if (ev && this.isIE) {
+
+                    try {
+
+                        var el = ev.srcElement;
+
+                    } catch(ex) {
+
+                         
+                        ev.target = boundEl;
+                    }
+
+                }
+                */
+
                 return ev;
             },
 
@@ -1243,7 +1366,13 @@
              * @static
              */
             getCharCode: function(ev) {
-                return ev.charCode || ev.keyCode || 0;
+                var code = ev.keyCode || ev.charCode || 0;
+
+                // webkit normalization
+                if (YAHOO.env.ua.webkit && (code in webkitKeymap)) {
+                    code = webkitKeymap[code];
+                }
+                return code;
             },
 
             /**
@@ -1301,12 +1430,16 @@
              * @private
              */
             _isValidCollection: function(o) {
-                return ( o                    && // o is something
-                         o.length             && // o is indexed
-                         typeof o != "string" && // o is not a string
-                         !o.tagName           && // o is not an HTML element
-                         !o.alert             && // o is not a window
-                         typeof o[0] != "undefined" );
+                try {
+                    return ( o                     && // o is something
+                             typeof o !== "string" && // o is not a string
+                             o.length              && // o is indexed
+                             !o.tagName            && // o is not an HTML element
+                             !o.alert              && // o is not a window
+                             typeof o[0] !== "undefined" );
+                } catch(ex) {
+                    return false;
+                }
 
             },
 
@@ -1315,7 +1448,8 @@
              * @property elCache
              * DOM element cache
              * @static
-             * @deprecated Elements are not cached any longer
+             * @deprecated Elements are not cached due to issues that arise when
+             * elements are removed and re-added
              */
             elCache: {},
 
@@ -1328,7 +1462,7 @@
              * @deprecated Elements are not cached any longer
              */
             getEl: function(id) {
-                return document.getElementById(id);
+                return (typeof id === "string") ? document.getElementById(id) : id;
             },
 
             /**
@@ -1353,18 +1487,25 @@
              * @private
              */
             _load: function(e) {
+
                 if (!loadComplete) {
                     loadComplete = true;
                     var EU = YAHOO.util.Event;
 
-                    // just in case DOMReady did not go off for some reason
+                    // Just in case DOMReady did not go off for some reason
                     EU._ready();
 
+                    // Available elements may not have been detected before the
+                    // window load event fires. Try to find them now so that the
+                    // the user is more likely to get the onAvailable notifications
+                    // before the window load notification
+                    EU._tryPreloadAttach();
+
                     // Remove the listener to assist with the IE memory issue, but not
                     // for other browsers because FF 1.0x does not like it.
-                    if (this.isIE) {
-                        EU._simpleRemove(window, "load", EU._load);
-                    }
+                    //if (this.isIE) {
+                        //EU._simpleRemove(window, "load", EU._load);
+                    //}
                 }
             },
 
@@ -1376,9 +1517,9 @@
              * @private
              */
             _ready: function(e) {
-                if (!DOMReady) {
-                    DOMReady=true;
-                    var EU = YAHOO.util.Event;
+                var EU = YAHOO.util.Event;
+                if (!EU.DOMReady) {
+                    EU.DOMReady=true;
 
                     // Fire the content ready custom event
                     EU.DOMReadyEvent.fire();
@@ -1402,9 +1543,15 @@
                     return false;
                 }
 
-
-                if (this.isIE && !DOMReady) {
-                    return false;
+                if (this.isIE) {
+                    // Hold off if DOMReady has not fired and check current
+                    // readyState to protect against the IE operation aborted
+                    // issue.
+                    //if (!this.DOMReady || "complete" !== document.readyState) {
+                    if (!this.DOMReady) {
+                        this.startInterval();
+                        return false;
+                    }
                 }
 
                 this.locked = true;
@@ -1498,19 +1645,20 @@
              * @static
              */
             purgeElement: function(el, recurse, sType) {
-                var elListeners = this.getListeners(el, sType);
+                var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
+                var elListeners = this.getListeners(oEl, sType), i, len;
                 if (elListeners) {
-                    for (var i=0,len=elListeners.length; i<len ; ++i) {
+                    for (i=0,len=elListeners.length; i<len ; ++i) {
                         var l = elListeners[i];
                         // can't use the index on the changing collection
-                        //this.removeListener(el, l.type, l.fn, l.index);
-                        this.removeListener(el, l.type, l.fn);
+                        this.removeListener(oEl, l.type, l.fn, l.index);
+                        //this.removeListener(oEl, l.type, l.fn);
                     }
                 }
 
-                if (recurse && el && el.childNodes) {
-                    for (i=0,len=el.childNodes.length; i<len ; ++i) {
-                        this.purgeElement(el.childNodes[i], recurse, sType);
+                if (recurse && oEl && oEl.childNodes) {
+                    for (i=0,len=oEl.childNodes.length; i<len ; ++i) {
+                        this.purgeElement(oEl.childNodes[i], recurse, sType);
                     }
                 }
             },
@@ -1519,14 +1667,15 @@
              * Returns all listeners attached to the given element via addListener.
              * Optionally, you can specify a specific type of event to return.
              * @method getListeners
-             * @param el {HTMLElement} the element to inspect 
+             * @param el {HTMLElement|string} the element or element id to inspect 
              * @param sType {string} optional type of listener to return. If
              * left out, all listeners will be returned
              * @return {Object} the listener. Contains the following fields:
              * &nbsp;&nbsp;type:   (string)   the type of event
              * &nbsp;&nbsp;fn:     (function) the callback supplied to addListener
              * &nbsp;&nbsp;obj:    (object)   the custom object supplied to addListener
-             * &nbsp;&nbsp;adjust: (boolean)  whether or not to adjust the default scope
+             * &nbsp;&nbsp;adjust: (boolean|object)  whether or not to adjust the default scope
+             * &nbsp;&nbsp;scope: (boolean)  the derived scope based on the adjust parameter
              * &nbsp;&nbsp;index:  (int)      its position in the Event util listener cache
              * @static
              */           
@@ -1534,24 +1683,27 @@
                 var results=[], searchLists;
                 if (!sType) {
                     searchLists = [listeners, unloadListeners];
-                } else if (sType == "unload") {
+                } else if (sType === "unload") {
                     searchLists = [unloadListeners];
                 } else {
                     searchLists = [listeners];
                 }
 
-                for (var j=0;j<searchLists.length; ++j) {
+                var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el;
+
+                for (var j=0;j<searchLists.length; j=j+1) {
                     var searchList = searchLists[j];
                     if (searchList && searchList.length > 0) {
                         for (var i=0,len=searchList.length; i<len ; ++i) {
                             var l = searchList[i];
-                            if ( l  && l[this.EL] === el && 
+                            if ( l  && l[this.EL] === oEl && 
                                     (!sType || sType === l[this.TYPE]) ) {
                                 results.push({
                                     type:   l[this.TYPE],
                                     fn:     l[this.FN],
                                     obj:    l[this.OBJ],
-                                    adjust: l[this.ADJ_SCOPE],
+                                    adjust: l[this.OVERRIDE],
+                                    scope:  l[this.ADJ_SCOPE],
                                     index:  i
                                 });
                             }
@@ -1573,18 +1725,19 @@
 
                 var EU = YAHOO.util.Event, i, j, l, len, index;
 
+                // execute and clear stored unload listeners
                 for (i=0,len=unloadListeners.length; i<len; ++i) {
                     l = unloadListeners[i];
                     if (l) {
                         var scope = window;
                         if (l[EU.ADJ_SCOPE]) {
                             if (l[EU.ADJ_SCOPE] === true) {
-                                scope = l[EU.OBJ];
+                                scope = l[EU.UNLOAD_OBJ];
                             } else {
                                 scope = l[EU.ADJ_SCOPE];
                             }
                         }
-                        l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ] );
+                        l[EU.FN].call(scope, EU.getEvent(e, l[EU.EL]), l[EU.UNLOAD_OBJ] );
                         unloadListeners[i] = null;
                         l=null;
                         scope=null;
@@ -1593,22 +1746,42 @@
 
                 unloadListeners = null;
 
+                // call clearAttributes or remove listeners to handle IE memory leaks
+                if (YAHOO.env.ua.ie && listeners && listeners.length > 0) {
+                    j = listeners.length;
+                    while (j) {
+                        index = j-1;
+                        l = listeners[index];
+                        if (l) {
+                            //try {
+                                //l[EU.EL].clearAttributes(); // errors on window objects
+                            //} catch(ex) {
+                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
+                            //}
+                        } 
+                        j--;
+                    }
+                    l=null;
+                }
+
+                /*
+                // remove all listeners
                 if (listeners && listeners.length > 0) {
                     j = listeners.length;
                     while (j) {
                         index = j-1;
                         l = listeners[index];
                         if (l) {
-                            EU.removeListener(l[EU.EL], l[EU.TYPE], 
-                                    l[EU.FN], index);
+                            EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], index);
                         } 
                         j = j - 1;
                     }
                     l=null;
-
-                    EU.clearCache();
                 }
+                */
 
+                /*
+                // kill legacy events
                 for (i=0,len=legacyEvents.length; i<len; ++i) {
                     // dereference the element
                     //delete legacyEvents[i][0];
@@ -1619,6 +1792,8 @@
                     legacyEvents[i] = null;
                 }
 
+                */
+
                 legacyEvents = null;
 
                 EU._simpleRemove(window, "unload", EU._unload);
@@ -1668,11 +1843,29 @@
              * compatibility
              * @method regCE
              * @private
+             * @static
+             * @deprecated still here for backwards compatibility
              */
             regCE: function() {
                 // does nothing
             },
 
+/*
+            testIEReady: function (){
+                var n = document.createElement('p'), ready = false;
+                try {
+                    // throws an error until the doc is ready
+                    n.doScroll('left'); 
+                    ready = true;
+                } catch(ex){ 
+                    // document is not ready
+                }
+
+                n = null;
+                return ready;
+            },
+*/
+
             /**
              * Adds a DOM event directly without the caching, cleanup, scope adj, etc
              *
@@ -1746,35 +1939,91 @@
         // the DOM prior to when the document's readyState suggests
         // it is safe to do so.
         if (EU.isIE) {
-	
-            document.write(
-'<scr' + 'ipt id="_yui_eu_dr" defer="true" src="//:"></script>');
-        
-            var el = document.getElementById("_yui_eu_dr");
-            el.onreadystatechange = function() {
-                if ("complete" == this.readyState) {
-                    this.parentNode.removeChild(this);
-                    YAHOO.util.Event._ready();
-                }
-            };
-
-            el=null;
 
             // Process onAvailable/onContentReady items when when the 
             // DOM is ready.
             YAHOO.util.Event.onDOMReady(
                     YAHOO.util.Event._tryPreloadAttach,
                     YAHOO.util.Event, true);
+
+            /*
+
+
+            var el, d=document, b=d.body;
+
+            // If the library is being injected after window.onload, it
+            // is not safe to document.write the script tag.  Detecting
+            // this state doesn't appear possible, so we expect a flag
+            // in YAHOO_config to be set if the library is being injected.
+            if (("undefined" !== typeof YAHOO_config) && YAHOO_config.injecting) {
+
+                el = document.createElement("script");
+                var p=d.getElementsByTagName("head")[0] || b;
+                p.insertBefore(el, p.firstChild);
+
+            } else {
+    d.write('<scr'+'ipt id="_yui_eu_dr" defer="true" src="//:"><'+'/script>');
+                el=document.getElementById("_yui_eu_dr");
+            }
+            
+
+            if (el) {
+                el.onreadystatechange = function() {
+                    if ("complete" === this.readyState) {
+                        this.parentNode.removeChild(this);
+                        YAHOO.util.Event._ready();
+                    }
+                };
+            } else {
+                // The library was likely injected into the page
+                // rendering onDOMReady unreliable
+                // YAHOO.util.Event._ready();
+            }
+
+            el=null;
+
+            */
+
+/*
+            (function (){
+                var n = document.createElement('p');  
+                try {
+                    // throws an error if doc is not ready
+                    n.doScroll('left');
+                    n = null;
+                    YAHOO.util.Event._ready();
+                } catch (ex){
+                    n = null;
+setTimeout(arguments.callee, YAHOO.util.Event.POLL_INTERVAL);
+                }
+            })();
+*/
+
+            EU._dri = setInterval(function() {
+                var n = document.createElement('p');  
+                try {
+                    // throws an error if doc is not ready
+                    n.doScroll('left');
+                    clearInterval(EU._dri);
+                    EU._dri = null;
+                    EU._ready();
+                    n = null;
+                } catch (ex) { 
+                    n = null;
+                }
+            }, EU.POLL_INTERVAL); 
+
         
         // Safari: The document's readyState in Safari currently will
         // change to loaded/complete before images are loaded.
+        //} else if (EU.webkit) {
         } else if (EU.webkit) {
 
-            EU._drwatch = setInterval(function(){
+            EU._dri = setInterval(function() {
                 var rs=document.readyState;
                 if ("loaded" == rs || "complete" == rs) {
-                    clearInterval(EU._drwatch);
-                    EU._drwatch = null;
+                    clearInterval(EU._dri);
+                    EU._dri = null;
                     EU._ready();
                 }
             }, EU.POLL_INTERVAL); 
@@ -1783,15 +2032,19 @@
         // moment.
         } else {
 
+            // @todo will this fire when the library is injected?
+
             EU._simpleAdd(document, "DOMContentLoaded", EU._ready);
 
         }
         /////////////////////////////////////////////////////////////
 
+
         EU._simpleAdd(window, "load", EU._load);
         EU._simpleAdd(window, "unload", EU._unload);
         EU._tryPreloadAttach();
     })();
+
 }
 /**
  * EventProvider is designed to be used with YAHOO.augment to wrap 
@@ -1828,7 +2081,6 @@
      * @method subscribe
      * @param p_type     {string}   the type, or name of the event
      * @param p_fn       {function} the function to exectute when the event fires
-     * @param p_obj
      * @param p_obj      {Object}   An object to be passed along when the event 
      *                              fires
      * @param p_override {boolean}  If true, the obj passed in becomes the 
@@ -1855,7 +2107,9 @@
     /**
      * Unsubscribes one or more listeners the from the specified event
      * @method unsubscribe
-     * @param p_type {string}   The type, or name of the event
+     * @param p_type {string}   The type, or name of the event.  If the type
+     *                          is not specified, it will attempt to remove
+     *                          the listener from all hosted events.
      * @param p_fn   {Function} The subscribed function to unsubscribe, if not
      *                          supplied, all subscribers will be removed.
      * @param p_obj  {Object}   The custom object passed to subscribe.  This is
@@ -1867,16 +2121,29 @@
      */
     unsubscribe: function(p_type, p_fn, p_obj) {
         this.__yui_events = this.__yui_events || {};
-        var ce = this.__yui_events[p_type];
-        if (ce) {
-            return ce.unsubscribe(p_fn, p_obj);
+        var evts = this.__yui_events;
+        if (p_type) {
+            var ce = evts[p_type];
+            if (ce) {
+                return ce.unsubscribe(p_fn, p_obj);
+            }
         } else {
-            return false;
+            var ret = true;
+            for (var i in evts) {
+                if (YAHOO.lang.hasOwnProperty(evts, i)) {
+                    ret = ret && evts[i].unsubscribe(p_fn, p_obj);
+                }
+            }
+            return ret;
         }
+
+        return false;
     },
     
     /**
-     * Removes all listeners from the specified event
+     * Removes all listeners from the specified event.  If the event type
+     * is not specified, all listeners from all hosted custom events will
+     * be removed.
      * @method unsubscribeAll
      * @param p_type {string}   The type, or name of the event
      */
@@ -1924,7 +2191,7 @@
         } else {
 
             var scope  = opts.scope  || this;
-            var silent = opts.silent || null;
+            var silent = (opts.silent);
 
             var ce = new YAHOO.util.CustomEvent(p_type, scope, silent,
                     YAHOO.util.CustomEvent.FLAT);
@@ -1957,27 +2224,29 @@
      *   <li>The custom object (if any) that was passed into the subscribe() 
      *       method</li>
      *   </ul>
+     * If the custom event has not been explicitly created, it will be
+     * created now with the default config, scoped to the host object
      * @method fireEvent
      * @param p_type    {string}  the type, or name of the event
      * @param arguments {Object*} an arbitrary set of parameters to pass to 
      *                            the handler.
-     * @return {boolean} the return value from CustomEvent.fire, or null if 
-     *                   the custom event does not exist.
+     * @return {boolean} the return value from CustomEvent.fire
+     *                   
      */
     fireEvent: function(p_type, arg1, arg2, etc) {
 
         this.__yui_events = this.__yui_events || {};
         var ce = this.__yui_events[p_type];
 
-        if (ce) {
-            var args = [];
-            for (var i=1; i<arguments.length; ++i) {
-                args.push(arguments[i]);
-            }
-            return ce.fire.apply(ce, args);
-        } else {
+        if (!ce) {
             return null;
         }
+
+        var args = [];
+        for (var i=1; i<arguments.length; ++i) {
+            args.push(arguments[i]);
+        }
+        return ce.fire.apply(ce, args);
     },
 
     /**
@@ -2017,6 +2286,15 @@
 * @param {Object}      handler  An object literal representing the handler. 
 * @param {String}      event    Optional. The event (keydown or keyup) to 
 *                               listen for. Defaults automatically to keydown.
+*
+* @knownissue the "keypress" event is completely broken in Safari 2.x and below.
+*             the workaround is use "keydown" for key listening.  However, if
+*             it is desired to prevent the default behavior of the keystroke,
+*             that can only be done on the keypress event.  This makes key
+*             handling quite ugly.
+* @knownissue keydown is also broken in Safari 2.x and below for the ESC key.
+*             There currently is no workaround other than choosing another
+*             key to listen for.
 */
 YAHOO.util.KeyListener = function(attachTo, keyData, handler, event) {
     if (!attachTo) {
@@ -2095,7 +2373,6 @@
             e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
             
             var dataItem;
-            var keyPressed;
 
             if (keyData.keys instanceof Array) {
                 for (var i=0;i<keyData.keys.length;i++) {
@@ -2180,4 +2457,36 @@
 * @type String
 */
 YAHOO.util.KeyListener.KEYUP = "keyup";
-YAHOO.register("event", YAHOO.util.Event, {version: "2.2.1", build: "193"});
+
+/**
+ * keycode constants for a subset of the special keys
+ * @property KEY
+ * @static
+ * @final
+ */
+YAHOO.util.KeyListener.KEY = {
+    ALT          : 18,
+    BACK_SPACE   : 8,
+    CAPS_LOCK    : 20,
+    CONTROL      : 17,
+    DELETE       : 46,
+    DOWN         : 40,
+    END          : 35,
+    ENTER        : 13,
+    ESCAPE       : 27,
+    HOME         : 36,
+    LEFT         : 37,
+    META         : 224,
+    NUM_LOCK     : 144,
+    PAGE_DOWN    : 34,
+    PAGE_UP      : 33, 
+    PAUSE        : 19,
+    PRINTSCREEN  : 44,
+    RIGHT        : 39,
+    SCROLL_LOCK  : 145,
+    SHIFT        : 16,
+    SPACE        : 32,
+    TAB          : 9,
+    UP           : 38
+};
+YAHOO.register("event", YAHOO.util.Event, {version: "2.4.1", build: "742"});

Modified: jifty/branches/jquery/share/web/static/js/yui/menu.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/yui/menu.js	(original)
+++ jifty/branches/jquery/share/web/static/js/yui/menu.js	Mon Jan 21 11:08:06 2008
@@ -2,7 +2,7 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
 
 
@@ -14,7 +14,6 @@
 * context menus, or application-style menu bars with just a small amount of 
 * scripting.</p><p>The Menu family of controls features:</p>
 * <ul>
-*    <li>Screen-reader accessibility.</li>
 *    <li>Keyboard and mouse navigation.</li>
 *    <li>A rich event model that provides access to all of a menu's 
 *    interesting moments.</li>
@@ -27,49 +26,49 @@
 * @namespace YAHOO.widget
 * @requires Event, Dom, Container
 */
-(function() {
-
-var Dom = YAHOO.util.Dom,
-    Event = YAHOO.util.Event;
-
-
-/**
-* Singleton that manages a collection of all menus and menu items.  Listens for 
-* DOM events at the document level and dispatches the events to the 
-* corresponding menu or menu item.
-*
-* @namespace YAHOO.widget
-* @class MenuManager
-* @static
-*/
-YAHOO.widget.MenuManager = function() {
-
-    // Private member variables
+(function () {
 
+    var Dom = YAHOO.util.Dom,
+        Event = YAHOO.util.Event;
 
-    // Flag indicating if the DOM event handlers have been attached
 
-    var m_bInitializedEventHandlers = false,
-
-
-        // Collection of menus
-
-        m_oMenus = {},
+    /**
+    * Singleton that manages a collection of all menus and menu items.  Listens 
+    * for DOM events at the document level and dispatches the events to the 
+    * corresponding menu or menu item.
+    *
+    * @namespace YAHOO.widget
+    * @class MenuManager
+    * @static
+    */
+    YAHOO.widget.MenuManager = function () {
     
+        // Private member variables
     
-        //  Collection of menu items 
+    
+        // Flag indicating if the DOM event handlers have been attached
+    
+        var m_bInitializedEventHandlers = false,
+    
+    
+        // Collection of menus
 
-        m_oItems = {},
+        m_oMenus = {},
 
 
         // Collection of visible menus
     
         m_oVisibleMenus = {},
+    
+    
+        //  Collection of menu items 
+
+        m_oItems = {},
 
 
         // Map of DOM event types to their equivalent CustomEvent types
-    
-        m_oEventTypes =  {
+        
+        m_oEventTypes = {
             "click": "clickEvent",
             "mousedown": "mouseDownEvent",
             "mouseup": "mouseUpEvent",
@@ -79,94 +78,50 @@
             "keyup": "keyUpEvent",
             "keypress": "keyPressEvent"
         },
-
-
+    
+    
         m_oFocusedMenuItem = null;
-
-
-
-
-    // Private methods
-
-
-    /**
-    * @method addItem
-    * @description Adds an item to the collection of known menu items.
-    * @private
-    * @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem 
-    * instance to be added.
-    */
-    function addItem(p_oItem) {
-
-        var sId = p_oItem.id;
-
-        if(p_oItem && m_oItems[sId] != p_oItem) {
     
-            m_oItems[sId] = p_oItem;
-
-            p_oItem.destroyEvent.subscribe(onItemDestroy);
-
-
-        }
     
-    }
-
-
-    /**
-    * @method removeItem
-    * @description Removes an item from the collection of known menu items.
-    * @private
-    * @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem 
-    * instance to be removed.
-    */
-    function removeItem(p_oItem) {
     
-        var sId = p_oItem.id;
-
-        if(sId && m_oItems[sId]) {
-
-            delete m_oItems[sId];
-
-
-        }
     
-    }
-
-
-    /**
-    * @method getMenuRootElement
-    * @description Finds the root DIV node of a menu or the root LI node of a 
-    * menu item.
-    * @private
-    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-    * one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object specifying 
-    * an HTML element.
-    */
-    function getMenuRootElement(p_oElement) {
     
-        var oParentNode;
-
-        if(p_oElement && p_oElement.tagName) {
+        // Private methods
+    
+    
+        /**
+        * @method getMenuRootElement
+        * @description Finds the root DIV node of a menu or the root LI node of 
+        * a menu item.
+        * @private
+        * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
+        * level-one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object 
+        * specifying an HTML element.
+        */
+        function getMenuRootElement(p_oElement) {
         
-            switch(p_oElement.tagName.toUpperCase()) {
-                    
+            var oParentNode;
+    
+            if (p_oElement && p_oElement.tagName) {
+            
+                switch (p_oElement.tagName.toUpperCase()) {
+                        
                 case "DIV":
     
                     oParentNode = p_oElement.parentNode;
     
                     // Check if the DIV is the inner "body" node of a menu
 
-                    if(
+                    if (
                         (
                             Dom.hasClass(p_oElement, "hd") ||
                             Dom.hasClass(p_oElement, "bd") ||
                             Dom.hasClass(p_oElement, "ft")
-                        )
-                        && 
+                        ) && 
                         oParentNode && 
                         oParentNode.tagName && 
-                        oParentNode.tagName.toUpperCase() == "DIV"
-                    ) {
+                        oParentNode.tagName.toUpperCase() == "DIV") 
+                    {
                     
                         return oParentNode;
                     
@@ -177,7 +132,7 @@
                     
                     }
                 
-                break;
+                    break;
 
                 case "LI":
     
@@ -187,481 +142,675 @@
     
                     oParentNode = p_oElement.parentNode;
     
-                    if(oParentNode) {
+                    if (oParentNode) {
                     
                         return getMenuRootElement(oParentNode);
                     
                     }
                 
-                break;
-            
+                    break;
+                
+                }
+    
             }
-
+            
         }
+    
+    
+    
+        // Private event handlers
+    
+    
+        /**
+        * @method onDOMEvent
+        * @description Generic, global event handler for all of a menu's 
+        * DOM-based events.  This listens for events against the document 
+        * object.  If the target of a given event is a member of a menu or 
+        * menu item's DOM, the instance's corresponding Custom Event is fired.
+        * @private
+        * @param {Event} p_oEvent Object representing the DOM event object  
+        * passed back by the event utility (YAHOO.util.Event).
+        */
+        function onDOMEvent(p_oEvent) {
+    
+            // Get the target node of the DOM event
         
-    }
-
-
-
-    // Private event handlers
-
-
-    /**
-    * @method onDOMEvent
-    * @description Generic, global event handler for all of a menu's DOM-based 
-    * events.  This listens for events against the document object.  If the 
-    * target of a given event is a member of a menu or menu item's DOM, the 
-    * instance's corresponding Custom Event is fired.
-    * @private
-    * @param {Event} p_oEvent Object representing the DOM event object passed 
-    * back by the event utility (YAHOO.util.Event).
-    */
-    function onDOMEvent(p_oEvent) {
-
-        // Get the target node of the DOM event
+            var oTarget = Event.getTarget(p_oEvent),
+                
+            // See if the target of the event was a menu, or a menu item
     
-        var oTarget = Event.getTarget(p_oEvent),
-
-
-        // See if the target of the event was a menu, or a menu item
-
             oElement = getMenuRootElement(oTarget),
+            sCustomEventType,
+            sTagName,
+            sId,
             oMenuItem,
             oMenu; 
-
-
-        if(oElement) {
-
-            var sTagName = oElement.tagName.toUpperCase();
     
-            if(sTagName == "LI") {
-        
-                var sId = oElement.id;
-        
-                if(sId && m_oItems[sId]) {
-        
-                    oMenuItem = m_oItems[sId];
-                    oMenu = oMenuItem.parent;
+    
+            if (oElement) {
+    
+                sTagName = oElement.tagName.toUpperCase();
         
-                }
+                if (sTagName == "LI") {
             
-            }
-            else if(sTagName == "DIV") {
+                    sId = oElement.id;
             
-                if(oElement.id) {
-                
-                    oMenu = m_oMenus[oElement.id];
+                    if (sId && m_oItems[sId]) {
+            
+                        oMenuItem = m_oItems[sId];
+                        oMenu = oMenuItem.parent;
+            
+                    }
                 
                 }
-            
-            }
-
-        }
-
-
-        if(oMenu) {
-
-            var sCustomEventType = m_oEventTypes[p_oEvent.type];
-
-
-            // Fire the Custom Event that corresponds the current DOM event    
-    
-            if(oMenuItem && !oMenuItem.cfg.getProperty("disabled")) {
-
-                oMenuItem[sCustomEventType].fire(p_oEvent);                   
-
-
-                if (p_oEvent.type == "keyup" || p_oEvent.type == "mousedown") {
-
-                    if (m_oFocusedMenuItem != oMenuItem) {
+                else if (sTagName == "DIV") {
+                
+                    if (oElement.id) {
                     
-                        if(m_oFocusedMenuItem) {
-
-                            m_oFocusedMenuItem.blurEvent.fire();
-                        
-                        }
-
-                        oMenuItem.focusEvent.fire();
+                        oMenu = m_oMenus[oElement.id];
                     
                     }
                 
                 }
-
+    
             }
     
-            oMenu[sCustomEventType].fire(p_oEvent, oMenuItem);
+    
+            if (oMenu) {
+    
+                sCustomEventType = m_oEventTypes[p_oEvent.type];
+    
+    
+                // Fire the Custom Event that corresponds the current DOM event    
         
-        }
-        else if(p_oEvent.type == "mousedown") {
-
-            if(m_oFocusedMenuItem) {
-
-                m_oFocusedMenuItem.blurEvent.fire();
-
-                m_oFocusedMenuItem = null;
-
-            }
-
-
-            /*
-                If the target of the event wasn't a menu, hide all 
-                dynamically positioned menus
-            */
-            
-            for(var i in m_oMenus) {
+                if (oMenuItem && !oMenuItem.cfg.getProperty("disabled")) {
     
-                if(YAHOO.lang.hasOwnProperty(m_oMenus,i)) {
+                    oMenuItem[sCustomEventType].fire(p_oEvent);                   
     
-                    oMenu = m_oMenus[i];
     
-                    if(
-                        oMenu.cfg.getProperty("clicktohide") && 
-                        oMenu.cfg.getProperty("position") == "dynamic"
-                    ) {
+                    if (
+                            p_oEvent.type == "keyup" || 
+                            p_oEvent.type == "mousedown") 
+                    {
     
-                        oMenu.hide();
+                        if (m_oFocusedMenuItem != oMenuItem) {
+                        
+                            if (m_oFocusedMenuItem) {
     
-                    }
-                    else {
-
-                        oMenu.clearActiveItem(true);
+                                m_oFocusedMenuItem.blurEvent.fire();
+                            
+                            }
     
+                            oMenuItem.focusEvent.fire();
+                        
+                        }
+                    
                     }
     
                 }
-    
-            } 
-
-        }
-        else if(p_oEvent.type == "keyup") { 
-
-            if(m_oFocusedMenuItem) {
-
-                m_oFocusedMenuItem.blurEvent.fire();
-
-                m_oFocusedMenuItem = null;
-
+        
+                oMenu[sCustomEventType].fire(p_oEvent, oMenuItem);
+            
             }
-
-        }
-
-    }
-
-
-    /**
-    * @method onMenuDestroy
-    * @description "destroy" event handler for a menu.
-    * @private
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    */
-    function onMenuDestroy(p_sType, p_aArgs) {
-
-        if(m_oMenus[this.id]) {
-
-            delete m_oMenus[this.id];
-
-
-        }
-
-    }
-
-
-    /**
-    * @method onMenuFocus
-    * @description "focus" event handler for a MenuItem instance.
-    * @private
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    */
-    function onMenuFocus(p_sType, p_aArgs) {
-
-        var oItem = p_aArgs[0];
+            else if (p_oEvent.type == "mousedown") {
+    
+                if (m_oFocusedMenuItem) {
+    
+                    m_oFocusedMenuItem.blurEvent.fire();
+    
+                    m_oFocusedMenuItem = null;
+    
+                }
+    
+    
+                /*
+                    If the target of the event wasn't a menu, hide all 
+                    dynamically positioned menus
+                */
+                
+                for (var i in m_oVisibleMenus) {
         
-        if (oItem) {
-
-            m_oFocusedMenuItem = oItem;
+                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus, i)) {
         
-        }
-
-    }
-
-
-    /**
-    * @method onMenuBlur
-    * @description "blur" event handler for a MenuItem instance.
-    * @private
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    */
-    function onMenuBlur(p_sType, p_aArgs) {
-
-        m_oFocusedMenuItem = null;
-
-    }
-
-
-    /**
-    * @method onItemDestroy
-    * @description "destroy" event handler for a MenuItem instance.
-    * @private
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    */
-    function onItemDestroy(p_sType, p_aArgs) {
-
-        var sId = this.id;
-
-        if(sId && m_oItems[sId]) {
-
-            delete m_oItems[sId];
-
-        }
-
-    }
-
-
-    /**
-    * @method onMenuVisibleConfigChange
-    * @description Event handler for when the "visible" configuration property 
-    * of a Menu instance changes.
-    * @private
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    */
-    function onMenuVisibleConfigChange(p_sType, p_aArgs) {
-
-        var bVisible = p_aArgs[0];
+                        oMenu = m_oVisibleMenus[i];
         
-        if(bVisible) {
-
-            m_oVisibleMenus[this.id] = this;
-            
+                        if (oMenu.cfg.getProperty("clicktohide") && 
+                            !(oMenu instanceof YAHOO.widget.MenuBar) && 
+                            oMenu.cfg.getProperty("position") == "dynamic") {
         
-        }
-        else if(m_oVisibleMenus[this.id]) {
+                            oMenu.hide();
         
-            delete m_oVisibleMenus[this.id];
-            
+                        }
+                        else {
+    
+                            oMenu.clearActiveItem(true);
         
+                        }
+        
+                    }
+        
+                } 
+    
+            }
+            else if (p_oEvent.type == "keyup") { 
+    
+                if (m_oFocusedMenuItem) {
+    
+                    m_oFocusedMenuItem.blurEvent.fire();
+    
+                    m_oFocusedMenuItem = null;
+    
+                }
+    
+            }
+    
         }
     
-    }
-
-
-    /**
-    * @method onItemAdded
-    * @description "itemadded" event handler for a Menu instance.
-    * @private
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    */
-    function onItemAdded(p_sType, p_aArgs) {
     
-        addItem(p_aArgs[0]);
+        /**
+        * @method onMenuDestroy
+        * @description "destroy" event handler for a menu.
+        * @private
+        * @param {String} p_sType String representing the name of the event 
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        * @param {YAHOO.widget.Menu} p_oMenu The menu that fired the event.
+        */
+        function onMenuDestroy(p_sType, p_aArgs, p_oMenu) {
+    
+            if (m_oMenus[p_oMenu.id]) {
+    
+                this.removeMenu(p_oMenu);
+    
+            }
+    
+        }
+    
+    
+        /**
+        * @method onMenuFocus
+        * @description "focus" event handler for a MenuItem instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event 
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onMenuFocus(p_sType, p_aArgs) {
+    
+            var oItem = p_aArgs[0];
+    
+            if (oItem) {
+    
+                m_oFocusedMenuItem = oItem;
+            
+            }
+    
+        }
+    
+    
+        /**
+        * @method onMenuBlur
+        * @description "blur" event handler for a MenuItem instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onMenuBlur(p_sType, p_aArgs) {
+    
+            m_oFocusedMenuItem = null;
+    
+        }
     
-    }
     
-
-    /**
-    * @method onItemRemoved
-    * @description "itemremoved" event handler for a Menu instance.
-    * @private
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    */
-    function onItemRemoved(p_sType, p_aArgs) {
-
-        removeItem(p_aArgs[0]);
     
-    }
-
-
-
-    return {
-
-        // Privileged methods
-
-
         /**
-        * @method addMenu
-        * @description Adds a menu to the collection of known menus.
-        * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu  
-        * instance to be added.
+        * @method onMenuVisibleConfigChange
+        * @description Event handler for when the "visible" configuration  
+        * property of a Menu instance changes.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
         */
-        addMenu: function(p_oMenu) {
+        function onMenuVisibleConfigChange(p_sType, p_aArgs) {
     
-            if(p_oMenu && p_oMenu.id && !m_oMenus[p_oMenu.id]) {
+            var bVisible = p_aArgs[0],
+                sId = this.id;
+            
+            if (bVisible) {
     
-                m_oMenus[p_oMenu.id] = p_oMenu;
+                m_oVisibleMenus[sId] = this;
+                
             
-        
-                if(!m_bInitializedEventHandlers) {
-        
-                    var oDoc = document;
+            }
+            else if (m_oVisibleMenus[sId]) {
+            
+                delete m_oVisibleMenus[sId];
+                
             
-                    Event.on(oDoc, "mouseover", onDOMEvent, this, true);
-                    Event.on(oDoc, "mouseout", onDOMEvent, this, true);
-                    Event.on(oDoc, "mousedown", onDOMEvent, this, true);
-                    Event.on(oDoc, "mouseup", onDOMEvent, this, true);
-                    Event.on(oDoc, "click", onDOMEvent, this, true);
-                    Event.on(oDoc, "keydown", onDOMEvent, this, true);
-                    Event.on(oDoc, "keyup", onDOMEvent, this, true);
-                    Event.on(oDoc, "keypress", onDOMEvent, this, true);
+            }
+        
+        }
+    
+    
+        /**
+        * @method onItemDestroy
+        * @description "destroy" event handler for a MenuItem instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
+        */
+        function onItemDestroy(p_sType, p_aArgs) {
+    
+            removeItem(this);
+    
+        }
 
+    
+        function removeItem(p_oMenuItem) {
 
-                    m_bInitializedEventHandlers = true;
-                    
-        
+            var sId = p_oMenuItem.id;
+    
+            if (sId && m_oItems[sId]) {
+    
+                if (m_oFocusedMenuItem == p_oMenuItem) {
+    
+                    m_oFocusedMenuItem = null;
+    
                 }
-        
-                p_oMenu.destroyEvent.subscribe(onMenuDestroy);
+    
+                delete m_oItems[sId];
                 
-                p_oMenu.cfg.subscribeToConfigEvent(
-                    "visible", 
-                    onMenuVisibleConfigChange
-                );
-        
-                p_oMenu.itemAddedEvent.subscribe(onItemAdded);
-                p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);
-                p_oMenu.focusEvent.subscribe(onMenuFocus);
-                p_oMenu.blurEvent.subscribe(onMenuBlur);
+                p_oMenuItem.destroyEvent.unsubscribe(onItemDestroy);
     
     
             }
-    
-        },
 
+        }
+    
     
         /**
-        * @method removeMenu
-        * @description Removes a menu from the collection of known menus.
-        * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu  
-        * instance to be removed.
+        * @method onItemAdded
+        * @description "itemadded" event handler for a Menu instance.
+        * @private
+        * @param {String} p_sType String representing the name of the event  
+        * that was fired.
+        * @param {Array} p_aArgs Array of arguments sent when the event 
+        * was fired.
         */
-        removeMenu: function(p_oMenu) {
+        function onItemAdded(p_sType, p_aArgs) {
     
-            if(p_oMenu && m_oMenus[p_oMenu.id]) {
+            var oItem = p_aArgs[0],
+                sId;
     
-                delete m_oMenus[p_oMenu.id];
+            if (oItem instanceof YAHOO.widget.MenuItem) { 
     
+                sId = oItem.id;
+        
+                if (!m_oItems[sId]) {
+            
+                    m_oItems[sId] = oItem;
+        
+                    oItem.destroyEvent.subscribe(onItemDestroy);
+        
+        
+                }
     
             }
-    
-        },
+        
+        }
     
     
-        /**
-        * @method hideVisible
-        * @description Hides all visible, dynamically positioned menus.
-        */
-        hideVisible: function() {
+        return {
     
-            var oMenu;
+            // Privileged methods
     
-            for(var i in m_oVisibleMenus) {
     
-                if(YAHOO.lang.hasOwnProperty(m_oVisibleMenus,i)) {
+            /**
+            * @method addMenu
+            * @description Adds a menu to the collection of known menus.
+            * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu  
+            * instance to be added.
+            */
+            addMenu: function (p_oMenu) {
     
-                    oMenu = m_oVisibleMenus[i];
+                var oDoc;
     
-                    if(oMenu.cfg.getProperty("position") == "dynamic") {
+                if (p_oMenu instanceof YAHOO.widget.Menu && p_oMenu.id && 
+                    !m_oMenus[p_oMenu.id]) {
+        
+                    m_oMenus[p_oMenu.id] = p_oMenu;
+                
+            
+                    if (!m_bInitializedEventHandlers) {
+            
+                        oDoc = document;
+                
+                        Event.on(oDoc, "mouseover", onDOMEvent, this, true);
+                        Event.on(oDoc, "mouseout", onDOMEvent, this, true);
+                        Event.on(oDoc, "mousedown", onDOMEvent, this, true);
+                        Event.on(oDoc, "mouseup", onDOMEvent, this, true);
+                        Event.on(oDoc, "click", onDOMEvent, this, true);
+                        Event.on(oDoc, "keydown", onDOMEvent, this, true);
+                        Event.on(oDoc, "keyup", onDOMEvent, this, true);
+                        Event.on(oDoc, "keypress", onDOMEvent, this, true);
     
-                        oMenu.hide();
     
+                        m_bInitializedEventHandlers = true;
+                        
+            
                     }
-    
+            
+                    p_oMenu.cfg.subscribeToConfigEvent("visible", 
+                        onMenuVisibleConfigChange);
+
+                    p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, 
+                                            this);
+            
+                    p_oMenu.itemAddedEvent.subscribe(onItemAdded);
+                    p_oMenu.focusEvent.subscribe(onMenuFocus);
+                    p_oMenu.blurEvent.subscribe(onMenuBlur);
+        
+        
                 }
+        
+            },
     
-            }        
         
-        },
+            /**
+            * @method removeMenu
+            * @description Removes a menu from the collection of known menus.
+            * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu  
+            * instance to be removed.
+            */
+            removeMenu: function (p_oMenu) {
+    
+                var sId,
+                    aItems,
+                    i;
+        
+                if (p_oMenu) {
+    
+                    sId = p_oMenu.id;
+        
+                    if (m_oMenus[sId] == p_oMenu) {
 
+                        // Unregister each menu item
 
-        /**
-        * @method getMenus
-        * @description Returns an array of all menus registered with the 
-        * menu manger.
-        * @return {Array}
-        */
-        getMenus: function() {
+                        aItems = p_oMenu.getItems();
+
+                        if (aItems && aItems.length > 0) {
+
+                            i = aItems.length - 1;
+
+                            do {
+
+                                removeItem(aItems[i]);
+
+                            }
+                            while (i--);
+
+                        }
+
+
+                        // Unregister the menu
+
+                        delete m_oMenus[sId];
+            
+        
+
+                        /*
+                             Unregister the menu from the collection of 
+                             visible menus
+                        */
+
+                        if (m_oVisibleMenus[sId] == p_oMenu) {
+            
+                            delete m_oVisibleMenus[sId];
+                            
+       
+                        }
+
+
+                        // Unsubscribe event listeners
+
+                        if (p_oMenu.cfg) {
+
+                            p_oMenu.cfg.unsubscribeFromConfigEvent("visible", 
+                                onMenuVisibleConfigChange);
+                            
+                        }
+
+                        p_oMenu.destroyEvent.unsubscribe(onMenuDestroy, 
+                            p_oMenu);
+                
+                        p_oMenu.itemAddedEvent.unsubscribe(onItemAdded);
+                        p_oMenu.focusEvent.unsubscribe(onMenuFocus);
+                        p_oMenu.blurEvent.unsubscribe(onMenuBlur);
+
+                    }
+                
+                }
+    
+            },
         
-            return m_oMenus;
         
-        },
+            /**
+            * @method hideVisible
+            * @description Hides all visible, dynamically positioned menus 
+            * (excluding instances of YAHOO.widget.MenuBar).
+            */
+            hideVisible: function () {
+        
+                var oMenu;
+        
+                for (var i in m_oVisibleMenus) {
+        
+                    if (YAHOO.lang.hasOwnProperty(m_oVisibleMenus, i)) {
+        
+                        oMenu = m_oVisibleMenus[i];
+        
+                        if (!(oMenu instanceof YAHOO.widget.MenuBar) && 
+                            oMenu.cfg.getProperty("position") == "dynamic") {
+        
+                            oMenu.hide();
+        
+                        }
+        
+                    }
+        
+                }        
+    
+            },
 
 
-        /**
-        * @method getMenu
-        * @description Returns a menu with the specified id.
-        * @param {String} p_sId String specifying the id of the menu to
-        * be retrieved.
-        * @return {YAHOO.widget.Menu}
-        */
-        getMenu: function(p_sId) {
+            /**
+            * @method getVisible
+            * @description Returns a collection of all visible menus registered
+            * with the menu manger.
+            * @return {Array}
+            */
+            getVisible: function () {
+            
+                return m_oVisibleMenus;
+            
+            },
+
+    
+            /**
+            * @method getMenus
+            * @description Returns a collection of all menus registered with the 
+            * menu manger.
+            * @return {Array}
+            */
+            getMenus: function () {
     
-            if(m_oMenus[p_sId]) {
+                return m_oMenus;
             
-                return m_oMenus[p_sId];
+            },
+    
+    
+            /**
+            * @method getMenu
+            * @description Returns a menu with the specified id.
+            * @param {String} p_sId String specifying the id of the 
+            * <code>&#60;div&#62;</code> element representing the menu to
+            * be retrieved.
+            * @return {YAHOO.widget.Menu}
+            */
+            getMenu: function (p_sId) {
+    
+                var oMenu = m_oMenus[p_sId];
+        
+                if (oMenu) {
+                
+                    return oMenu;
+                
+                }
             
-            }
+            },
+    
+    
+            /**
+            * @method getMenuItem
+            * @description Returns a menu item with the specified id.
+            * @param {String} p_sId String specifying the id of the 
+            * <code>&#60;li&#62;</code> element representing the menu item to
+            * be retrieved.
+            * @return {YAHOO.widget.MenuItem}
+            */
+            getMenuItem: function (p_sId) {
+    
+                var oItem = m_oItems[p_sId];
         
-        },
+                if (oItem) {
+                
+                    return oItem;
+                
+                }
+            
+            },
 
 
-        /**
-        * @method getFocusedMenuItem
-        * @description Returns a reference to the menu item that currently 
-        * has focus.
-        * @return {YAHOO.widget.MenuItem}
-        */
-        getFocusedMenuItem: function() {
+            /**
+            * @method getMenuItemGroup
+            * @description Returns an array of menu item instances whose 
+            * corresponding <code>&#60;li&#62;</code> elements are child 
+            * nodes of the <code>&#60;ul&#62;</code> element with the 
+            * specified id.
+            * @param {String} p_sId String specifying the id of the 
+            * <code>&#60;ul&#62;</code> element representing the group of 
+            * menu items to be retrieved.
+            * @return {Array}
+            */
+            getMenuItemGroup: function (p_sId) {
 
-            return m_oFocusedMenuItem;
+                var oUL = Dom.get(p_sId),
+                    aItems,
+                    oNode,
+                    oItem,
+                    sId;
+    
 
-        },
+                if (oUL && oUL.tagName && 
+                    oUL.tagName.toUpperCase() == "UL") {
 
+                    oNode = oUL.firstChild;
 
-        /**
-        * @method getFocusedMenu
-        * @description Returns a reference to the menu that currently has focus.
-        * @return {YAHOO.widget.Menu}
-        */
-        getFocusedMenu: function() {
+                    if (oNode) {
 
-            if(m_oFocusedMenuItem) {
+                        aItems = [];
+                        
+                        do {
 
-                return (m_oFocusedMenuItem.parent.getRoot());
-            
-            }
+                            sId = oNode.id;
 
-        },
+                            if (sId) {
+                            
+                                oItem = this.getMenuItem(sId);
+                                
+                                if (oItem) {
+                                
+                                    aItems[aItems.length] = oItem;
+                                
+                                }
+                            
+                            }
+                        
+                        }
+                        while ((oNode = oNode.nextSibling));
+
+
+                        if (aItems.length > 0) {
+
+                            return aItems;
+                        
+                        }
+
+                    }
+                
+                }
+            
+            },
 
     
-        /**
-        * @method toString
-        * @description Returns a string representing the menu manager.
-        * @return {String}
-        */
-        toString: function() {
-        
-            return ("MenuManager");
+            /**
+            * @method getFocusedMenuItem
+            * @description Returns a reference to the menu item that currently 
+            * has focus.
+            * @return {YAHOO.widget.MenuItem}
+            */
+            getFocusedMenuItem: function () {
+    
+                return m_oFocusedMenuItem;
+    
+            },
+    
+    
+            /**
+            * @method getFocusedMenu
+            * @description Returns a reference to the menu that currently 
+            * has focus.
+            * @return {YAHOO.widget.Menu}
+            */
+            getFocusedMenu: function () {
+    
+                if (m_oFocusedMenuItem) {
+    
+                    return (m_oFocusedMenuItem.parent.getRoot());
+                
+                }
+    
+            },
+    
         
-        }
+            /**
+            * @method toString
+            * @description Returns a string representing the menu manager.
+            * @return {String}
+            */
+            toString: function () {
+            
+                return "MenuManager";
+            
+            }
+    
+        };
+    
+    }();
 
-    };
+})();
 
-}();
 
-})();
 
+(function () {
 
 
 /**
@@ -688,17 +837,9 @@
 * @constructor
 * @extends YAHOO.widget.Overlay
 */
-(function() {
-
-var Dom = YAHOO.util.Dom,
-    Event = YAHOO.util.Event,
-    CustomEvent = YAHOO.util.CustomEvent,
-    Lang = YAHOO.lang;
-
+YAHOO.widget.Menu = function (p_oElement, p_oConfig) {
 
-YAHOO.widget.Menu = function(p_oElement, p_oConfig) {
-
-    if(p_oConfig) {
+    if (p_oConfig) {
 
         this.parent = p_oConfig.parent;
         this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;
@@ -707,148 +848,186 @@
     }
 
 
-    YAHOO.widget.Menu.superclass.constructor.call(
-        this, 
-        p_oElement, 
-        p_oConfig
-    );
-
-};
-
-
-/**
-* Constant representing the name of the Menu's events
-* @property YAHOO.widget.Menu._EVENT_TYPES
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Menu._EVENT_TYPES = {
-
-    "MOUSE_OVER": "mouseover",
-    "MOUSE_OUT": "mouseout",
-    "MOUSE_DOWN": "mousedown",
-    "MOUSE_UP": "mouseup",
-    "CLICK": "click",
-    "KEY_PRESS": "keypress",
-    "KEY_DOWN": "keydown",
-    "KEY_UP": "keyup",
-    "FOCUS": "focus",
-    "BLUR": "blur",
-    "ITEM_ADDED": "itemAdded",
-    "ITEM_REMOVED": "itemRemoved"
+    YAHOO.widget.Menu.superclass.constructor.call(this, p_oElement, p_oConfig);
 
 };
 
 
 
 /**
-* @method _checkPosition
+* @method checkPosition
 * @description Checks to make sure that the value of the "position" property 
 * is one of the supported strings. Returns true if the position is supported.
 * @private
 * @param {Object} p_sPosition String specifying the position of the menu.
 * @return {Boolean}
 */
-YAHOO.widget.Menu._checkPosition = function(p_sPosition) {
+function checkPosition(p_sPosition) {
 
-    if(typeof p_sPosition == "string") {
+    if (typeof p_sPosition == "string") {
 
-        var sPosition = p_sPosition.toLowerCase();
-
-        return ("dynamic,static".indexOf(sPosition) != -1);
+        return ("dynamic,static".indexOf((p_sPosition.toLowerCase())) != -1);
 
     }
 
-};
-
+}
 
 
-/**
-* Constant representing the Menu's configuration properties
-* @property YAHOO.widget.Menu._DEFAULT_CONFIG
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.Menu._DEFAULT_CONFIG = {
+var Dom = YAHOO.util.Dom,
+    Event = YAHOO.util.Event,
+    Module = YAHOO.widget.Module,
+    Overlay = YAHOO.widget.Overlay,
+    Menu = YAHOO.widget.Menu,
+    MenuManager = YAHOO.widget.MenuManager,
+    CustomEvent = YAHOO.util.CustomEvent,
+    Lang = YAHOO.lang,
+    UA = YAHOO.env.ua,
+    
+    m_oShadowTemplate,
 
-    "VISIBLE": { 
-        key: "visible", 
-        value: false, 
-        validator: Lang.isBoolean
-    }, 
-
-    "CONSTRAIN_TO_VIEWPORT": {
-        key: "constraintoviewport", 
-        value: true, 
-        validator: Lang.isBoolean, 
-        supercedes: ["iframe","x","y","xy"]
-    }, 
-
-    "POSITION": { 
-        key: "position", 
-        value: "dynamic", 
-        validator: YAHOO.widget.Menu._checkPosition, 
-        supercedes: ["visible"] 
-    }, 
-
-    "SUBMENU_ALIGNMENT": { 
-        key: "submenualignment", 
-        value: ["tl","tr"]
+    /**
+    * Constant representing the name of the Menu's events
+    * @property EVENT_TYPES
+    * @private
+    * @final
+    * @type Object
+    */
+    EVENT_TYPES = {
+    
+        "MOUSE_OVER": "mouseover",
+        "MOUSE_OUT": "mouseout",
+        "MOUSE_DOWN": "mousedown",
+        "MOUSE_UP": "mouseup",
+        "CLICK": "click",
+        "KEY_PRESS": "keypress",
+        "KEY_DOWN": "keydown",
+        "KEY_UP": "keyup",
+        "FOCUS": "focus",
+        "BLUR": "blur",
+        "ITEM_ADDED": "itemAdded",
+        "ITEM_REMOVED": "itemRemoved"
+    
     },
 
-    "AUTO_SUBMENU_DISPLAY": { 
-        key: "autosubmenudisplay", 
-        value: true, 
-        validator: Lang.isBoolean 
-    }, 
-
-    "SHOW_DELAY": { 
-        key: "showdelay", 
-        value: 250, 
-        validator: Lang.isNumber 
-    }, 
-
-    "HIDE_DELAY": { 
-        key: "hidedelay", 
-        value: 0, 
-        validator: Lang.isNumber, 
-        suppressEvent: true
-    }, 
-
-    "SUBMENU_HIDE_DELAY": { 
-        key: "submenuhidedelay", 
-        value: 250, 
-        validator: Lang.isNumber
-    }, 
-
-    "CLICK_TO_HIDE": { 
-        key: "clicktohide", 
-        value: true, 
-        validator: Lang.isBoolean
-    },
 
-    "CONTAINER": { 
-        key: "container"
-    }, 
-
-    "MAX_HEIGHT": { 
-        key: "maxheight", 
-        value: 0, 
-        validator: Lang.isNumber
-    }, 
-
-    "CLASS_NAME": { 
-        key: "classname", 
-        value: null, 
-        validator: Lang.isString
-    }
+    /**
+    * Constant representing the Menu's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
 
-};
+        "VISIBLE": { 
+            key: "visible", 
+            value: false, 
+            validator: Lang.isBoolean
+        }, 
+    
+        "CONSTRAIN_TO_VIEWPORT": {
+            key: "constraintoviewport", 
+            value: true, 
+            validator: Lang.isBoolean, 
+            supercedes: ["iframe","x","y","xy"]
+        }, 
+    
+        "POSITION": { 
+            key: "position", 
+            value: "dynamic", 
+            validator: checkPosition, 
+            supercedes: ["visible", "iframe"]
+        }, 
+    
+        "SUBMENU_ALIGNMENT": { 
+            key: "submenualignment", 
+            value: ["tl","tr"],
+            suppressEvent: true
+        },
+    
+        "AUTO_SUBMENU_DISPLAY": { 
+            key: "autosubmenudisplay", 
+            value: true, 
+            validator: Lang.isBoolean,
+            suppressEvent: true
+        }, 
+    
+        "SHOW_DELAY": { 
+            key: "showdelay", 
+            value: 250, 
+            validator: Lang.isNumber, 
+            suppressEvent: true
+        }, 
+    
+        "HIDE_DELAY": { 
+            key: "hidedelay", 
+            value: 0, 
+            validator: Lang.isNumber, 
+            suppressEvent: true
+        }, 
+    
+        "SUBMENU_HIDE_DELAY": { 
+            key: "submenuhidedelay", 
+            value: 250, 
+            validator: Lang.isNumber,
+            suppressEvent: true
+        }, 
+    
+        "CLICK_TO_HIDE": { 
+            key: "clicktohide", 
+            value: true, 
+            validator: Lang.isBoolean,
+            suppressEvent: true
+        },
+    
+        "CONTAINER": { 
+            key: "container",
+            suppressEvent: true
+        }, 
+
+        "SCROLL_INCREMENT": { 
+            key: "scrollincrement", 
+            value: 1, 
+            validator: Lang.isNumber,
+            supercedes: ["maxheight"],
+            suppressEvent: true
+        },
+
+        "MIN_SCROLL_HEIGHT": { 
+            key: "minscrollheight", 
+            value: 90, 
+            validator: Lang.isNumber,
+            supercedes: ["maxheight"],
+            suppressEvent: true
+        },    
+    
+        "MAX_HEIGHT": { 
+            key: "maxheight", 
+            value: 0, 
+            validator: Lang.isNumber,
+            supercedes: ["iframe"],
+            suppressEvent: true
+        }, 
+    
+        "CLASS_NAME": { 
+            key: "classname", 
+            value: null, 
+            validator: Lang.isString,
+            suppressEvent: true
+        }, 
+    
+        "DISABLED": { 
+            key: "disabled", 
+            value: false, 
+            validator: Lang.isBoolean,
+            suppressEvent: true
+        }
+    
+    };
 
 
-YAHOO.lang.extend(YAHOO.widget.Menu, YAHOO.widget.Overlay, {
+
+YAHOO.lang.extend(Menu, Overlay, {
 
 
 // Constants
@@ -889,6 +1068,17 @@
 GROUP_TITLE_TAG_NAME: "h6",
 
 
+/**
+* @property OFF_SCREEN_POSITION
+* @description Array representing the default x and y position that a menu 
+* should have when it is positioned outside the viewport by the 
+* "poistionOffScreen" method.
+* @default [-10000, -10000]
+* @final
+* @type Array
+*/
+OFF_SCREEN_POSITION: [-10000, -10000],
+
 
 // Private properties
 
@@ -1015,17 +1205,6 @@
 
 
 /**
-* @property _nMaxHeight
-* @description The original value of the "maxheight" configuration property 
-* as set by the user.
-* @default -1
-* @private
-* @type Number
-*/
-_nMaxHeight: -1,
-
-
-/**
 * @property _bStopMouseEventHandlers
 * @description Stops "mouseover," "mouseout," and "mousemove" event handlers 
 * from executing.
@@ -1223,13 +1402,13 @@
 * configuration for the menu. See configuration class documentation for 
 * more details.
 */
-init: function(p_oElement, p_oConfig) {
+init: function (p_oElement, p_oConfig) {
 
     this._aItemGroups = [];
     this._aListElements = [];
     this._aGroupTitleElements = [];
 
-    if(!this.ITEM_TYPE) {
+    if (!this.ITEM_TYPE) {
 
         this.ITEM_TYPE = YAHOO.widget.MenuItem;
 
@@ -1238,19 +1417,19 @@
 
     var oElement;
 
-    if(typeof p_oElement == "string") {
+    if (typeof p_oElement == "string") {
 
         oElement = document.getElementById(p_oElement);
 
     }
-    else if(p_oElement.tagName) {
+    else if (p_oElement.tagName) {
 
         oElement = p_oElement;
 
     }
 
 
-    if(oElement && oElement.tagName) {
+    if (oElement && oElement.tagName) {
 
         switch(oElement.tagName.toUpperCase()) {
     
@@ -1258,7 +1437,7 @@
 
                 this.srcElement = oElement;
 
-                if(!oElement.id) {
+                if (!oElement.id) {
 
                     oElement.setAttribute("id", Dom.generateId());
 
@@ -1271,9 +1450,9 @@
                     subclass level.
                 */ 
             
-                YAHOO.widget.Menu.superclass.init.call(this, oElement);
+                Menu.superclass.init.call(this, oElement);
 
-                this.beforeInitEvent.fire(YAHOO.widget.Menu);
+                this.beforeInitEvent.fire(Menu);
 
 
     
@@ -1293,9 +1472,9 @@
                     subclass level.
                 */ 
 
-                YAHOO.widget.Menu.superclass.init.call(this, Dom.generateId());
+                Menu.superclass.init.call(this, Dom.generateId());
 
-                this.beforeInitEvent.fire(YAHOO.widget.Menu);
+                this.beforeInitEvent.fire(Menu);
 
 
 
@@ -1312,45 +1491,45 @@
             subclass level.
         */ 
     
-        YAHOO.widget.Menu.superclass.init.call(this, p_oElement);
+        Menu.superclass.init.call(this, p_oElement);
 
-        this.beforeInitEvent.fire(YAHOO.widget.Menu);
+        this.beforeInitEvent.fire(Menu);
 
 
 
     }
 
 
-    if(this.element) {
+    if (this.element) {
 
-        var oEl = this.element;
-
-        Dom.addClass(oEl, this.CSS_CLASS_NAME);
+        Dom.addClass(this.element, this.CSS_CLASS_NAME);
 
 
         // Subscribe to Custom Events
 
-        this.initEvent.subscribe(this._onInit, this, true);
-        this.beforeRenderEvent.subscribe(this._onBeforeRender, this, true);
+        this.initEvent.subscribe(this._onInit);
+        this.beforeRenderEvent.subscribe(this._onBeforeRender);
         this.renderEvent.subscribe(this._onRender);
-        this.beforeShowEvent.subscribe(this._onBeforeShow, this, true);
-        this.showEvent.subscribe(this._onShow, this, true);
-        this.beforeHideEvent.subscribe(this._onBeforeHide, this, true);
-        this.hideEvent.subscribe(this._onHide, this, true);
-        this.mouseOverEvent.subscribe(this._onMouseOver, this, true);
-        this.mouseOutEvent.subscribe(this._onMouseOut, this, true);
-        this.clickEvent.subscribe(this._onClick, this, true);
-        this.keyDownEvent.subscribe(this._onKeyDown, this, true);
-        this.keyPressEvent.subscribe(this._onKeyPress, this, true);
-
-        YAHOO.widget.Module.textResizeEvent.subscribe(
-            this._onTextResize, 
-            this, 
-            true
-        );
+        this.renderEvent.subscribe(this.onRender);
+        this.beforeShowEvent.subscribe(this._onBeforeShow);
+        this.hideEvent.subscribe(this.positionOffScreen);
+        this.showEvent.subscribe(this._onShow);
+        this.beforeHideEvent.subscribe(this._onBeforeHide);
+        this.mouseOverEvent.subscribe(this._onMouseOver);
+        this.mouseOutEvent.subscribe(this._onMouseOut);
+        this.clickEvent.subscribe(this._onClick);
+        this.keyDownEvent.subscribe(this._onKeyDown);
+        this.keyPressEvent.subscribe(this._onKeyPress);
+        
+
+        if (UA.gecko || UA.webkit) {
 
+            this.cfg.subscribeToConfigEvent("y", this._onYChange);
 
-        if(p_oConfig) {
+        }
+
+
+        if (p_oConfig) {
     
             this.cfg.applyConfig(p_oConfig, true);
     
@@ -1359,10 +1538,10 @@
 
         // Register the Menu instance with the MenuManager
 
-        YAHOO.widget.MenuManager.addMenu(this);
+        MenuManager.addMenu(this);
         
 
-        this.initEvent.fire(YAHOO.widget.Menu);
+        this.initEvent.fire(Menu);
 
     }
 
@@ -1379,150 +1558,166 @@
 * used to instantiate menu and menu items.
 * @private
 */
-_initSubTree: function() {
-
-    var oNode;
+_initSubTree: function () {
 
-    if(this.srcElement.tagName.toUpperCase() == "DIV") {
+    var oSrcElement = this.srcElement,
+        sSrcElementTagName,
+        nGroup,
+        sGroupTitleTagName,
+        oNode,
+        aListElements,
+        nListElements,
+        i;
 
-        /*
-            Populate the collection of item groups and item
-            group titles
-        */
 
-        oNode = this.body.firstChild;
-
-        var nGroup = 0,
-            sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();
+    if (oSrcElement) {
+    
+        sSrcElementTagName = 
+            (oSrcElement.tagName && oSrcElement.tagName.toUpperCase());
 
-        do {
 
-            if(oNode && oNode.tagName) {
+        if (sSrcElementTagName == "DIV") {
+    
+            //  Populate the collection of item groups and item group titles
+    
+            oNode = this.body.firstChild;
+    
 
-                switch(oNode.tagName.toUpperCase()) {
+            if (oNode) {
+    
+                nGroup = 0;
+                sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();
+        
+                do {
+        
 
-                    case sGroupTitleTagName:
+                    if (oNode && oNode.tagName) {
+        
+                        switch (oNode.tagName.toUpperCase()) {
+        
+                            case sGroupTitleTagName:
+                            
+                                this._aGroupTitleElements[nGroup] = oNode;
+        
+                            break;
+        
+                            case "UL":
+        
+                                this._aListElements[nGroup] = oNode;
+                                this._aItemGroups[nGroup] = [];
+                                nGroup++;
+        
+                            break;
+        
+                        }
                     
-                        this._aGroupTitleElements[nGroup] = oNode;
-
-                    break;
-
-                    case "UL":
-
-                        this._aListElements[nGroup] = oNode;
-                        this._aItemGroups[nGroup] = [];
-                        nGroup++;
-
-                    break;
-
+                    }
+        
+                }
+                while ((oNode = oNode.nextSibling));
+        
+        
+                /*
+                    Apply the "first-of-type" class to the first UL to mimic 
+                    the "first-of-type" CSS3 psuedo class.
+                */
+        
+                if (this._aListElements[0]) {
+        
+                    Dom.addClass(this._aListElements[0], "first-of-type");
+        
                 }
             
             }
-
-        }
-        while((oNode = oNode.nextSibling));
-
-
-        /*
-            Apply the "first-of-type" class to the first UL to mimic 
-            the "first-of-type" CSS3 psuedo class.
-        */
-
-        if(this._aListElements[0]) {
-
-            Dom.addClass(this._aListElements[0], "first-of-type");
-
-        }
-
-    }
-
-
-    oNode = null;
-
-
-    if(this.srcElement.tagName) {
-
-        var sSrcElementTagName = this.srcElement.tagName.toUpperCase();
-
-
-        switch(sSrcElementTagName) {
     
-            case "DIV":
+        }
     
-                if(this._aListElements.length > 0) {
     
+        oNode = null;
     
-                    var i = this._aListElements.length - 1;
     
-                    do {
+
+        if (sSrcElementTagName) {
     
-                        oNode = this._aListElements[i].firstChild;
+            switch (sSrcElementTagName) {
         
-    
-                        do {
+                case "DIV":
+
+                    aListElements = this._aListElements;
+                    nListElements = aListElements.length;
+        
+                    if (nListElements > 0) {
         
-                            if(
-                                oNode && 
-                                oNode.tagName && 
-                                oNode.tagName.toUpperCase() == "LI"
-                            ) {
         
+                        i = nListElements - 1;
+        
+                        do {
+        
+                            oNode = aListElements[i].firstChild;
+            
+                            if (oNode) {
 
-                                this.addItem(
-                                        new this.ITEM_TYPE(
-                                            oNode, 
-                                            { parent: this }
-                                        ), 
-                                        i
-                                    );
-    
-                            }
+            
+                                do {
                 
-                        }
-                        while((oNode = oNode.nextSibling));
+                                    if (oNode && oNode.tagName && 
+                                        oNode.tagName.toUpperCase() == "LI") {
                 
-                    }
-                    while(i--);
-    
-                }
-    
-            break;
-    
-            case "SELECT":
-    
-    
-                oNode = this.srcElement.firstChild;
-    
-                do {
-    
-                    if(oNode && oNode.tagName) {
+        
+                                        this.addItem(new this.ITEM_TYPE(oNode, 
+                                                    { parent: this }), i);
+            
+                                    }
+                        
+                                }
+                                while ((oNode = oNode.nextSibling));
+                            
+                            }
                     
-                        switch(oNode.tagName.toUpperCase()) {
+                        }
+                        while (i--);
         
-                            case "OPTGROUP":
-                            case "OPTION":
+                    }
+        
+                break;
         
+                case "SELECT":
         
-                                this.addItem(
-                                        new this.ITEM_TYPE(
-                                                oNode, 
-                                                { parent: this }
-                                            )
-                                        );
         
-                            break;
+                    oNode = oSrcElement.firstChild;
         
+                    do {
+        
+                        if (oNode && oNode.tagName) {
+                        
+                            switch (oNode.tagName.toUpperCase()) {
+            
+                                case "OPTGROUP":
+                                case "OPTION":
+            
+            
+                                    this.addItem(
+                                            new this.ITEM_TYPE(
+                                                    oNode, 
+                                                    { parent: this }
+                                                )
+                                            );
+            
+                                break;
+            
+                            }
+    
                         }
-
+        
                     }
+                    while ((oNode = oNode.nextSibling));
+        
+                break;
+        
+            }
     
-                }
-                while((oNode = oNode.nextSibling));
-    
-            break;
+        }    
     
-        }
-
     }
 
 },
@@ -1534,7 +1729,7 @@
 * @return {YAHOO.widget.MenuItem}
 * @private
 */
-_getFirstEnabledItem: function() {
+_getFirstEnabledItem: function () {
 
     var aItems = this.getItems(),
         nItems = aItems.length,
@@ -1544,11 +1739,8 @@
 
         oItem = aItems[i];
 
-        if(
-            oItem && 
-            !oItem.cfg.getProperty("disabled") && 
-            oItem.element.style.display != "none"
-        ) {
+        if (oItem && !oItem.cfg.getProperty("disabled") && 
+            oItem.element.style.display != "none") {
 
             return oItem;
 
@@ -1575,22 +1767,35 @@
 * which the menu item should be added.
 * @return {YAHOO.widget.MenuItem}
 */
-_addItemToGroup: function(p_nGroupIndex, p_oItem, p_nItemIndex) {
+_addItemToGroup: function (p_nGroupIndex, p_oItem, p_nItemIndex) {
 
-    var oItem;
+    var oItem,
+        nGroupIndex,
+        aGroup,
+        oGroupItem,
+        bAppend,
+        oNextItemSibling,
+        nItemIndex;
+
+    function getNextItemSibling(p_aArray, p_nStartIndex) {
+
+        return (p_aArray[p_nStartIndex] || getNextItemSibling(p_aArray, 
+                (p_nStartIndex+1)));
+
+    }
 
-    if(p_oItem instanceof this.ITEM_TYPE) {
+    if (p_oItem instanceof this.ITEM_TYPE) {
 
         oItem = p_oItem;
         oItem.parent = this;
 
     }
-    else if(typeof p_oItem == "string") {
+    else if (typeof p_oItem == "string") {
 
         oItem = new this.ITEM_TYPE(p_oItem, { parent: this });
     
     }
-    else if(typeof p_oItem == "object") {
+    else if (typeof p_oItem == "object") {
 
         p_oItem.parent = this;
 
@@ -1599,7 +1804,7 @@
     }
 
 
-    if(oItem) {
+    if (oItem) {
 
         if (oItem.cfg.getProperty("selected")) {
 
@@ -1608,24 +1813,24 @@
         }
 
 
-        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,
-            aGroup = this._getItemGroup(nGroupIndex),
-            oGroupItem;
+        nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;
+        aGroup = this._getItemGroup(nGroupIndex);
+
 
 
-        if(!aGroup) {
+        if (!aGroup) {
 
             aGroup = this._createItemGroup(nGroupIndex);
 
         }
 
 
-        if(typeof p_nItemIndex == "number") {
+        if (typeof p_nItemIndex == "number") {
 
-            var bAppend = (p_nItemIndex >= aGroup.length);            
+            bAppend = (p_nItemIndex >= aGroup.length);            
 
 
-            if(aGroup[p_nItemIndex]) {
+            if (aGroup[p_nItemIndex]) {
     
                 aGroup.splice(p_nItemIndex, 0, oItem);
     
@@ -1639,51 +1844,26 @@
 
             oGroupItem = aGroup[p_nItemIndex];
 
-            if(oGroupItem) {
+            if (oGroupItem) {
 
-                if(
-                    bAppend && 
-                    (
-                        !oGroupItem.element.parentNode || 
-                        oGroupItem.element.parentNode.nodeType == 11
-                    )
-                ) {
+                if (bAppend && (!oGroupItem.element.parentNode || 
+                        oGroupItem.element.parentNode.nodeType == 11)) {
         
                     this._aListElements[nGroupIndex].appendChild(
-                        oGroupItem.element
-                    );
+                        oGroupItem.element);
     
                 }
                 else {
-  
-                    function getNextItemSibling(p_aArray, p_nStartIndex) {
-                
-                            return (
-                                    p_aArray[p_nStartIndex] || 
-                                    getNextItemSibling(
-                                        p_aArray, 
-                                        (p_nStartIndex+1)
-                                    )
-                                );
-
-                    }
     
+                    oNextItemSibling = getNextItemSibling(aGroup, 
+                        (p_nItemIndex+1));
     
-                    var oNextItemSibling = 
-                            getNextItemSibling(aGroup, (p_nItemIndex+1));
-    
-                    if(
-                        oNextItemSibling && 
-                        (
-                            !oGroupItem.element.parentNode || 
-                            oGroupItem.element.parentNode.nodeType == 11
-                        )
-                    ) {
+                    if (oNextItemSibling && (!oGroupItem.element.parentNode || 
+                            oGroupItem.element.parentNode.nodeType == 11)) {
             
                         this._aListElements[nGroupIndex].insertBefore(
                                 oGroupItem.element, 
-                                oNextItemSibling.element
-                            );
+                                oNextItemSibling.element);
         
                     }
     
@@ -1700,6 +1880,7 @@
         
 
                 this.itemAddedEvent.fire(oGroupItem);
+                this.changeContentEvent.fire();
 
                 return oGroupItem;
     
@@ -1708,25 +1889,20 @@
         }
         else {
     
-            var nItemIndex = aGroup.length;
+            nItemIndex = aGroup.length;
     
             aGroup[nItemIndex] = oItem;
 
             oGroupItem = aGroup[nItemIndex];
     
 
-            if(oGroupItem) {
+            if (oGroupItem) {
     
-                if(
-                    !Dom.isAncestor(
-                        this._aListElements[nGroupIndex], 
-                        oGroupItem.element
-                    )
-                ) {
+                if (!Dom.isAncestor(this._aListElements[nGroupIndex], 
+                        oGroupItem.element)) {
     
                     this._aListElements[nGroupIndex].appendChild(
-                        oGroupItem.element
-                    );
+                        oGroupItem.element);
     
                 }
     
@@ -1742,7 +1918,7 @@
     
                 this._configureSubmenu(oGroupItem);
     
-                if(nItemIndex === 0) {
+                if (nItemIndex === 0) {
         
                     Dom.addClass(oGroupItem.element, "first-of-type");
         
@@ -1751,6 +1927,7 @@
         
 
                 this.itemAddedEvent.fire(oGroupItem);
+                this.changeContentEvent.fire();
 
                 return oGroupItem;
     
@@ -1774,29 +1951,32 @@
 * to be removed.
 * @return {YAHOO.widget.MenuItem}
 */
-_removeItemFromGroupByIndex: function(p_nGroupIndex, p_nItemIndex) {
+_removeItemFromGroupByIndex: function (p_nGroupIndex, p_nItemIndex) {
 
     var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,
-        aGroup = this._getItemGroup(nGroupIndex);
+        aGroup = this._getItemGroup(nGroupIndex),
+        aArray,
+        oItem,
+        oUL;
 
-    if(aGroup) {
+    if (aGroup) {
 
-        var aArray = aGroup.splice(p_nItemIndex, 1),
-            oItem = aArray[0];
+        aArray = aGroup.splice(p_nItemIndex, 1);
+        oItem = aArray[0];
     
-        if(oItem) {
+        if (oItem) {
     
             // Update the index and className properties of each member        
             
             this._updateItemProperties(nGroupIndex);
     
-            if(aGroup.length === 0) {
+            if (aGroup.length === 0) {
     
                 // Remove the UL
     
-                var oUL = this._aListElements[nGroupIndex];
+                oUL = this._aListElements[nGroupIndex];
     
-                if(this.body && oUL) {
+                if (this.body && oUL) {
     
                     this.body.removeChild(oUL);
     
@@ -1819,7 +1999,7 @@
     
                 oUL = this._aListElements[0];
     
-                if(oUL) {
+                if (oUL) {
     
                     Dom.addClass(oUL, "first-of-type");
     
@@ -1828,7 +2008,8 @@
             }
     
 
-            this.itemRemovedEvent.fire(oItem);    
+            this.itemRemovedEvent.fire(oItem);
+            this.changeContentEvent.fire();
 
 
             // Return a reference to the item that was removed
@@ -1853,22 +2034,25 @@
 * instance to be removed.
 * @return {YAHOO.widget.MenuItem}
 */    
-_removeItemFromGroupByValue: function(p_nGroupIndex, p_oItem) {
+_removeItemFromGroupByValue: function (p_nGroupIndex, p_oItem) {
 
-    var aGroup = this._getItemGroup(p_nGroupIndex);
+    var aGroup = this._getItemGroup(p_nGroupIndex),
+        nItems,
+        nItemIndex,
+        i;
 
-    if(aGroup) {
+    if (aGroup) {
 
-        var nItems = aGroup.length,
-            nItemIndex = -1;
+        nItems = aGroup.length;
+        nItemIndex = -1;
     
-        if(nItems > 0) {
+        if (nItems > 0) {
     
-            var i = nItems-1;
+            i = nItems-1;
         
             do {
         
-                if(aGroup[i] == p_oItem) {
+                if (aGroup[i] == p_oItem) {
         
                     nItemIndex = i;
                     break;    
@@ -1878,12 +2062,10 @@
             }
             while(i--);
         
-            if(nItemIndex > -1) {
+            if (nItemIndex > -1) {
         
-                return this._removeItemFromGroupByIndex(
-                            p_nGroupIndex, 
-                            nItemIndex
-                        );
+                return (this._removeItemFromGroupByIndex(p_nGroupIndex, 
+                            nItemIndex));
         
             }
     
@@ -1901,16 +2083,18 @@
 * @private
 * @param {Number} p_nGroupIndex Number indicating the group of items to update.
 */
-_updateItemProperties: function(p_nGroupIndex) {
+_updateItemProperties: function (p_nGroupIndex) {
 
     var aGroup = this._getItemGroup(p_nGroupIndex),
-        nItems = aGroup.length;
+        nItems = aGroup.length,
+        oItem,
+        oLI,
+        i;
 
-    if(nItems > 0) {
 
-        var i = nItems - 1,
-            oItem,
-            oLI;
+    if (nItems > 0) {
+
+        i = nItems - 1;
 
         // Update the index and className properties of each member
     
@@ -1918,7 +2102,7 @@
 
             oItem = aGroup[i];
 
-            if(oItem) {
+            if (oItem) {
     
                 oLI = oItem.element;
 
@@ -1936,7 +2120,7 @@
         while(i--);
 
 
-        if(oLI) {
+        if (oLI) {
 
             Dom.addClass(oLI, "first-of-type");
 
@@ -1955,13 +2139,15 @@
 * @param {Number} p_nIndex Number indicating the group to create.
 * @return {Array}
 */
-_createItemGroup: function(p_nIndex) {
+_createItemGroup: function (p_nIndex) {
+
+    var oUL;
 
-    if(!this._aItemGroups[p_nIndex]) {
+    if (!this._aItemGroups[p_nIndex]) {
 
         this._aItemGroups[p_nIndex] = [];
 
-        var oUL = document.createElement("ul");
+        oUL = document.createElement("ul");
 
         this._aListElements[p_nIndex] = oUL;
 
@@ -1980,7 +2166,7 @@
 * to be retrieved.
 * @return {Array}
 */
-_getItemGroup: function(p_nIndex) {
+_getItemGroup: function (p_nIndex) {
 
     var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);
 
@@ -1996,43 +2182,31 @@
 * @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
 * instance with the submenu to be configured.
 */
-_configureSubmenu: function(p_oItem) {
+_configureSubmenu: function (p_oItem) {
 
     var oSubmenu = p_oItem.cfg.getProperty("submenu");
 
-    if(oSubmenu) {
+    if (oSubmenu) {
             
         /*
             Listen for configuration changes to the parent menu 
             so they they can be applied to the submenu.
         */
 
-        this.cfg.configChangedEvent.subscribe(
-                this._onParentMenuConfigChange, 
-                oSubmenu, 
-                true
-            );
-
-        this.renderEvent.subscribe(
-                this._onParentMenuRender,
-                oSubmenu, 
-                true
-            );
-
-        oSubmenu.beforeShowEvent.subscribe(
-                this._onSubmenuBeforeShow, 
-                oSubmenu, 
-                true
-            );
+        this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange, 
+                oSubmenu, true);
 
-        oSubmenu.showEvent.subscribe(this._onSubmenuShow, null, p_oItem);
-        oSubmenu.hideEvent.subscribe(this._onSubmenuHide, null, p_oItem);
+        this.renderEvent.subscribe(this._onParentMenuRender, oSubmenu, true);
+
+        oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow);
 
     }
 
 },
 
 
+
+
 /**
 * @method _subscribeToItemEvents
 * @description Subscribes a menu to a menu item's event.
@@ -2040,110 +2214,16 @@
 * @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem 
 * instance whose events should be subscribed to.
 */
-_subscribeToItemEvents: function(p_oItem) {
+_subscribeToItemEvents: function (p_oItem) {
 
     p_oItem.focusEvent.subscribe(this._onMenuItemFocus);
 
     p_oItem.blurEvent.subscribe(this._onMenuItemBlur);
 
-    p_oItem.cfg.configChangedEvent.subscribe(
-        this._onMenuItemConfigChange,
-        p_oItem,
-        this
-    );
-
-},
-
-
-/**
-* @method _getOffsetWidth
-* @description Returns the offset width of the menu's 
-* <code>&#60;div&#62;</code> element.
-* @private
-*/
-_getOffsetWidth: function() {
-
-    var oClone = this.element.cloneNode(true);
-
-    Dom.setStyle(oClone, "width", "");
-
-    document.body.appendChild(oClone);
-
-    var sWidth = oClone.offsetWidth;
-
-    document.body.removeChild(oClone);
-
-    return sWidth;
-
-},
-
-
-/**
-* @method _setWidth
-* @description Sets the width of the menu's root <code>&#60;div&#62;</code> 
-* element to its offsetWidth.
-* @private
-*/
-_setWidth: function() {
-
-    var sWidth;
-
-    if (this.element.parentNode.tagName.toUpperCase() == "BODY") {
-
-        if (this.browser == "opera") {
-
-            sWidth = this._getOffsetWidth();
-        
-        }
-        else {
-
-            Dom.setStyle(this.element, "width", "auto");
-            
-            sWidth = this.element.offsetWidth;
-        
-        }
-
-    }
-    else {
-    
-        sWidth = this._getOffsetWidth();
-    
-    }
-
-    this.cfg.setProperty("width", (sWidth + "px"));
-
-},
-
-
-/**
-* @method _onWidthChange
-* @description Change event handler for the the menu's "width" configuration
-* property.
-* @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-*/
-_onWidthChange: function(p_sType, p_aArgs) {
-
-    var sWidth = p_aArgs[0];
-    
-    if (sWidth && !this._hasSetWidthHandlers) {
-
-        this.itemAddedEvent.subscribe(this._setWidth);
-        this.itemRemovedEvent.subscribe(this._setWidth);
-
-        this._hasSetWidthHandlers = true;
-
-    }
-    else if (this._hasSetWidthHandlers) {
-
-        this.itemAddedEvent.unsubscribe(this._setWidth);
-        this.itemRemovedEvent.unsubscribe(this._setWidth);
+    p_oItem.destroyEvent.subscribe(this._onMenuItemDestroy, p_oItem, this);
 
-        this._hasSetWidthHandlers = false;
-
-    }
+    p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,
+        p_oItem, this);
 
 },
 
@@ -2157,7 +2237,7 @@
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
-_onVisibleChange: function(p_sType, p_aArgs) {
+_onVisibleChange: function (p_sType, p_aArgs) {
 
     var bVisible = p_aArgs[0];
     
@@ -2180,11 +2260,11 @@
 * @description Cancels the call to "hideMenu."
 * @private
 */
-_cancelHideDelay: function() {
+_cancelHideDelay: function () {
 
     var oRoot = this.getRoot();
 
-    if(oRoot._nHideDelayId) {
+    if (oRoot._nHideDelayId) {
 
         window.clearTimeout(oRoot._nHideDelayId);
 
@@ -2199,7 +2279,7 @@
 * the "hidedelay" configuration property.
 * @private
 */
-_execHideDelay: function() {
+_execHideDelay: function () {
 
     this._cancelHideDelay();
 
@@ -2208,15 +2288,16 @@
 
     function hideMenu() {
     
-        if(oRoot.activeItem) {
+        if (oRoot.activeItem) {
 
             oRoot.clearActiveItem();
 
         }
 
-        if(oRoot == me && me.cfg.getProperty("position") == "dynamic") {
+        if (oRoot == me && !(me instanceof YAHOO.widget.MenuBar) && 
+            me.cfg.getProperty("position") == "dynamic") {
 
-            me.hide();            
+            me.hide();
         
         }
     
@@ -2234,11 +2315,11 @@
 * @description Cancels the call to the "showMenu."
 * @private
 */
-_cancelShowDelay: function() {
+_cancelShowDelay: function () {
 
     var oRoot = this.getRoot();
 
-    if(oRoot._nShowDelayId) {
+    if (oRoot._nShowDelayId) {
 
         window.clearTimeout(oRoot._nShowDelayId);
 
@@ -2255,13 +2336,13 @@
 * @param {YAHOO.widget.Menu} p_oMenu Object specifying the menu that should 
 * be made visible.
 */
-_execShowDelay: function(p_oMenu) {
+_execShowDelay: function (p_oMenu) {
 
     var oRoot = this.getRoot();
 
     function showMenu() {
 
-        if(p_oMenu.parent.cfg.getProperty("selected")) {
+        if (p_oMenu.parent.cfg.getProperty("selected")) {
 
             p_oMenu.show();
 
@@ -2288,13 +2369,13 @@
 * @param {Number} p_nHideDelay The number of milliseconds that should ellapse
 * before the submenu is hidden.
 */
-_execSubmenuHideDelay: function(p_oSubmenu, p_nMouseX, p_nHideDelay) {
+_execSubmenuHideDelay: function (p_oSubmenu, p_nMouseX, p_nHideDelay) {
 
     var me = this;
 
     p_oSubmenu._nSubmenuHideDelayId = window.setTimeout(function () {
 
-        if(me._nCurrentMouseX > (p_nMouseX + 10)) {
+        if (me._nCurrentMouseX > (p_nMouseX + 10)) {
 
             p_oSubmenu._nSubmenuHideDelayId = window.setTimeout(function () {
         
@@ -2323,9 +2404,9 @@
 * @description Disables the header used for scrolling the body of the menu.
 * @protected
 */
-_disableScrollHeader: function() {
+_disableScrollHeader: function () {
 
-    if(!this._bHeaderDisabled) {
+    if (!this._bHeaderDisabled) {
 
         Dom.addClass(this.header, "topscrollbar_disabled");
         this._bHeaderDisabled = true;
@@ -2340,9 +2421,9 @@
 * @description Disables the footer used for scrolling the body of the menu.
 * @protected
 */
-_disableScrollFooter: function() {
+_disableScrollFooter: function () {
 
-    if(!this._bFooterDisabled) {
+    if (!this._bFooterDisabled) {
 
         Dom.addClass(this.footer, "bottomscrollbar_disabled");
         this._bFooterDisabled = true;
@@ -2357,9 +2438,9 @@
 * @description Enables the header used for scrolling the body of the menu.
 * @protected
 */
-_enableScrollHeader: function() {
+_enableScrollHeader: function () {
 
-    if(this._bHeaderDisabled) {
+    if (this._bHeaderDisabled) {
 
         Dom.removeClass(this.header, "topscrollbar_disabled");
         this._bHeaderDisabled = false;
@@ -2374,9 +2455,9 @@
 * @description Enables the footer used for scrolling the body of the menu.
 * @protected
 */
-_enableScrollFooter: function() {
+_enableScrollFooter: function () {
 
-    if(this._bFooterDisabled) {
+    if (this._bFooterDisabled) {
 
         Dom.removeClass(this.footer, "bottomscrollbar_disabled");
         this._bFooterDisabled = false;
@@ -2393,12 +2474,10 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onMouseOver: function(p_sType, p_aArgs, p_oMenu) {
+_onMouseOver: function (p_sType, p_aArgs) {
 
-    if(this._bStopMouseEventHandlers) {
+    if (this._bStopMouseEventHandlers) {
     
         return false;
     
@@ -2407,37 +2486,35 @@
 
     var oEvent = p_aArgs[0],
         oItem = p_aArgs[1],
-        oTarget = Event.getTarget(oEvent);
+        oTarget = Event.getTarget(oEvent),
+        oParentMenu,
+        nShowDelay,
+        bShowDelay,
+        oActiveItem,
+        oItemCfg,
+        oSubmenu;
 
 
-    if(
-        !this._bHandledMouseOverEvent && 
-        (oTarget == this.element || Dom.isAncestor(this.element, oTarget))
-    ) {
+    if (!this._bHandledMouseOverEvent && (oTarget == this.element || 
+        Dom.isAncestor(this.element, oTarget))) {
 
         // Menu mouseover logic
 
         this._nCurrentMouseX = 0;
 
-        Event.on(
-                this.element, 
-                "mousemove", 
-                this._onMouseMove, 
-                this, 
-                true
-            );
+        Event.on(this.element, "mousemove", this._onMouseMove, this, true);
 
 
         this.clearActiveItem();
 
 
-        if(this.parent && this._nSubmenuHideDelayId) {
+        if (this.parent && this._nSubmenuHideDelayId) {
 
             window.clearTimeout(this._nSubmenuHideDelayId);
 
             this.parent.cfg.setProperty("selected", true);
 
-            var oParentMenu = this.parent.parent;
+            oParentMenu = this.parent.parent;
 
             oParentMenu._bHandledMouseOutEvent = true;
             oParentMenu._bHandledMouseOverEvent = false;
@@ -2451,35 +2528,33 @@
     }
 
 
-    if(
-        oItem && !oItem.handledMouseOverEvent && 
+    if (oItem && !oItem.handledMouseOverEvent && 
         !oItem.cfg.getProperty("disabled") && 
-        (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))
-    ) {
+        (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))) {
 
         // Menu Item mouseover logic
 
-        var nShowDelay = this.cfg.getProperty("showdelay"),
-            bShowDelay = (nShowDelay > 0);
+        nShowDelay = this.cfg.getProperty("showdelay");
+        bShowDelay = (nShowDelay > 0);
 
 
-        if(bShowDelay) {
+        if (bShowDelay) {
         
             this._cancelShowDelay();
         
         }
 
 
-        var oActiveItem = this.activeItem;
+        oActiveItem = this.activeItem;
     
-        if(oActiveItem) {
+        if (oActiveItem) {
     
             oActiveItem.cfg.setProperty("selected", false);
     
         }
 
 
-        var oItemCfg = oItem.cfg;
+        oItemCfg = oItem.cfg;
     
         // Select and focus the current menu item
     
@@ -2493,15 +2568,15 @@
         }
 
 
-        if(this.cfg.getProperty("autosubmenudisplay")) {
+        if (this.cfg.getProperty("autosubmenudisplay")) {
 
             // Show the submenu this menu item
 
-            var oSubmenu = oItemCfg.getProperty("submenu");
+            oSubmenu = oItemCfg.getProperty("submenu");
         
-            if(oSubmenu) {
+            if (oSubmenu) {
         
-                if(bShowDelay) {
+                if (bShowDelay) {
 
                     this._execShowDelay(oSubmenu);
         
@@ -2531,12 +2606,10 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onMouseOut: function(p_sType, p_aArgs, p_oMenu) {
+_onMouseOut: function (p_sType, p_aArgs) {
 
-    if(this._bStopMouseEventHandlers) {
+    if (this._bStopMouseEventHandlers) {
     
         return false;
     
@@ -2546,63 +2619,52 @@
     var oEvent = p_aArgs[0],
         oItem = p_aArgs[1],
         oRelatedTarget = Event.getRelatedTarget(oEvent),
-        bMovingToSubmenu = false;
+        bMovingToSubmenu = false,
+        oItemCfg,
+        oSubmenu,
+        nSubmenuHideDelay,
+        nShowDelay;
 
 
-    if(oItem && !oItem.cfg.getProperty("disabled")) {
+    if (oItem && !oItem.cfg.getProperty("disabled")) {
 
-        var oItemCfg = oItem.cfg,
-            oSubmenu = oItemCfg.getProperty("submenu");
+        oItemCfg = oItem.cfg;
+        oSubmenu = oItemCfg.getProperty("submenu");
 
 
-        if(
-            oSubmenu && 
-            (
-                oRelatedTarget == oSubmenu.element ||
-                Dom.isAncestor(oSubmenu.element, oRelatedTarget)
-            )
-        ) {
+        if (oSubmenu && (oRelatedTarget == oSubmenu.element ||
+                Dom.isAncestor(oSubmenu.element, oRelatedTarget))) {
 
             bMovingToSubmenu = true;
 
         }
 
 
-        if( 
-            !oItem.handledMouseOutEvent && 
-            (
-                (
-                    oRelatedTarget != oItem.element &&  
-                    !Dom.isAncestor(oItem.element, oRelatedTarget)
-                ) || bMovingToSubmenu
-            )
-        ) {
+        if (!oItem.handledMouseOutEvent && ((oRelatedTarget != oItem.element &&  
+            !Dom.isAncestor(oItem.element, oRelatedTarget)) || 
+            bMovingToSubmenu)) {
 
             // Menu Item mouseout logic
 
-            if(!bMovingToSubmenu) {
+            if (!bMovingToSubmenu) {
 
                 oItem.cfg.setProperty("selected", false);
 
 
-                if(oSubmenu) {
+                if (oSubmenu) {
 
-                    var nSubmenuHideDelay = 
-                            this.cfg.getProperty("submenuhidedelay"),
+                    nSubmenuHideDelay = 
+                        this.cfg.getProperty("submenuhidedelay");
 
-                        nShowDelay = this.cfg.getProperty("showdelay");
+                    nShowDelay = this.cfg.getProperty("showdelay");
 
-                    if(
-                        !(this instanceof YAHOO.widget.MenuBar) && 
+                    if (!(this instanceof YAHOO.widget.MenuBar) && 
                         nSubmenuHideDelay > 0 && 
-                        nShowDelay >= nSubmenuHideDelay
-                    ) {
+                        nShowDelay >= nSubmenuHideDelay) {
 
-                        this._execSubmenuHideDelay(
-                                oSubmenu, 
+                        this._execSubmenuHideDelay(oSubmenu, 
                                 Event.getPageX(oEvent),
-                                nSubmenuHideDelay
-                            );
+                                nSubmenuHideDelay);
 
                     }
                     else {
@@ -2624,16 +2686,8 @@
     }
 
 
-    if(
-        !this._bHandledMouseOutEvent && 
-        (
-            (
-                oRelatedTarget != this.element &&  
-                !Dom.isAncestor(this.element, oRelatedTarget)
-            ) 
-            || bMovingToSubmenu
-        )
-    ) {
+    if (!this._bHandledMouseOutEvent && ((oRelatedTarget != this.element &&  
+        !Dom.isAncestor(this.element, oRelatedTarget)) || bMovingToSubmenu)) {
 
         // Menu mouseout logic
 
@@ -2658,9 +2712,9 @@
 * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
 * fired the event.
 */
-_onMouseMove: function(p_oEvent, p_oMenu) {
+_onMouseMove: function (p_oEvent, p_oMenu) {
 
-    if(this._bStopMouseEventHandlers) {
+    if (this._bStopMouseEventHandlers) {
     
         return false;
     
@@ -2678,111 +2732,91 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onClick: function(p_sType, p_aArgs, p_oMenu) {
+_onClick: function (p_sType, p_aArgs) {
 
     var oEvent = p_aArgs[0],
         oItem = p_aArgs[1],
-        oTarget = Event.getTarget(oEvent);
+        oSubmenu,
+        bInMenuAnchor = false,
+        oRoot,
+        sId,
+        sURL,
+        nHashPos,
+        nLen;
 
-    if(oItem && !oItem.cfg.getProperty("disabled")) {
 
-        var oItemCfg = oItem.cfg,
-            oSubmenu = oItemCfg.getProperty("submenu");
+    if (oItem && !oItem.cfg.getProperty("disabled")) {
 
+        oSubmenu = oItem.cfg.getProperty("submenu");
 
+        
         /*
-            ACCESSIBILITY FEATURE FOR SCREEN READERS: 
-            Expand/collapse the submenu when the user clicks 
-            on the submenu indicator image.
-        */        
+             Check if the URL of the anchor is pointing to an element that is 
+             a child of the menu.
+        */
+        
+        sURL = oItem.cfg.getProperty("url");
+
+        
+        if (sURL) {
 
-        if(oTarget == oItem.submenuIndicator && oSubmenu) {
+            nHashPos = sURL.indexOf("#");
 
-            if(oSubmenu.cfg.getProperty("visible")) {
+            nLen = sURL.length;
 
-                oSubmenu.hide();
-                
-                oSubmenu.parent.focus();
+
+            if (nHashPos != -1) {
+
+                sURL = sURL.substr(nHashPos, nLen);
     
-            }
-            else {
+                nLen = sURL.length;
 
-                this.clearActiveItem();
 
-                oItem.cfg.setProperty("selected", true);
+                if (nLen > 1) {
+
+                    sId = sURL.substr(1, nLen);
+
+                    bInMenuAnchor = Dom.isAncestor(this.element, sId);
+                    
+                }
+                else if (nLen === 1) {
 
-                oSubmenu.show();
+                    bInMenuAnchor = true;
                 
-                oSubmenu.setInitialFocus();
-    
+                }
+
             }
-    
+        
         }
-        else {
 
-            var sURL = oItemCfg.getProperty("url"),
-                bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#"),
-                sTarget = oItemCfg.getProperty("target"),
-                bHasTarget = (sTarget && sTarget.length > 0);
-
-            /*
-                Prevent the browser from following links 
-                equal to "#"
-            */
-            
-            if(
-                oTarget.tagName.toUpperCase() == "A" && 
-                bCurrentPageURL && !bHasTarget
-            ) {
 
-                Event.preventDefault(oEvent);
+        if (bInMenuAnchor && !oItem.cfg.getProperty("target")) {
 
-                oItem.focus();
-            
-            }
+            Event.preventDefault(oEvent);
 
-            if(
-                oTarget.tagName.toUpperCase() != "A" && 
-                !bCurrentPageURL && !bHasTarget
-            ) {
-                
-                /*
-                    Follow the URL of the item regardless of 
-                    whether or not the user clicked specifically
-                    on the anchor element.
-                */
-    
-                document.location = sURL;
+            oItem.focus();
         
-            }
+        }
 
 
-            /*
-                If the item doesn't navigate to a URL and it doesn't have
-                a submenu, then collapse the menu tree.
-            */
+        if (!oSubmenu) {
 
-            if(bCurrentPageURL && !oSubmenu) {
-    
-                var oRoot = this.getRoot();
-                
-                if(oRoot.cfg.getProperty("position") == "static") {
-    
-                    oRoot.clearActiveItem();
-    
-                }
-                else if(oRoot.cfg.getProperty("clicktohide")) {
+            oRoot = this.getRoot();
+            
+            if (oRoot instanceof YAHOO.widget.MenuBar || 
+                oRoot.cfg.getProperty("position") == "static") {
+
+                oRoot.clearActiveItem();
 
-                    oRoot.hide();
-                
-                }
-    
+            }
+            else {
+
+                oRoot.hide();
+            
             }
 
-        }                    
+        }
     
     }
 
@@ -2796,15 +2830,25 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onKeyDown: function(p_sType, p_aArgs, p_oMenu) {
+_onKeyDown: function (p_sType, p_aArgs) {
 
     var oEvent = p_aArgs[0],
         oItem = p_aArgs[1],
         me = this,
-        oSubmenu;
+        oSubmenu,
+        oItemCfg,
+        oParentItem,
+        oRoot,
+        oNextItem,
+        oBody,
+        nBodyScrollTop,
+        nBodyOffsetHeight,
+        aItems,
+        nItems,
+        nNextItemOffsetTop,
+        nScrollTarget,
+        oParentMenu;
 
 
     /*
@@ -2819,7 +2863,7 @@
 
         me._bStopMouseEventHandlers = true;
         
-        window.setTimeout(function() {
+        window.setTimeout(function () {
         
             me._bStopMouseEventHandlers = false;
         
@@ -2828,13 +2872,10 @@
     }
 
 
-    if(oItem && !oItem.cfg.getProperty("disabled")) {
-
-        var oItemCfg = oItem.cfg,
-            oParentItem = this.parent,
-            oRoot,
-            oNextItem;
+    if (oItem && !oItem.cfg.getProperty("disabled")) {
 
+        oItemCfg = oItem.cfg;
+        oParentItem = this.parent;
 
         switch(oEvent.keyCode) {
     
@@ -2845,7 +2886,7 @@
                     oItem.getPreviousEnabledSibling() : 
                     oItem.getNextEnabledSibling();
         
-                if(oNextItem) {
+                if (oNextItem) {
 
                     this.clearActiveItem();
 
@@ -2853,29 +2894,70 @@
                     oNextItem.focus();
 
 
-                    if(this.cfg.getProperty("maxheight") > 0) {
+                    if (this.cfg.getProperty("maxheight") > 0) {
+
+                        oBody = this.body;
+                        nBodyScrollTop = oBody.scrollTop;
+                        nBodyOffsetHeight = oBody.offsetHeight;
+                        aItems = this.getItems();
+                        nItems = aItems.length - 1;
+                        nNextItemOffsetTop = oNextItem.element.offsetTop;
+
+
+                        if (oEvent.keyCode == 40 ) {    // Down
+                       
+                            if (nNextItemOffsetTop >= (nBodyOffsetHeight + nBodyScrollTop)) {
+
+                                oBody.scrollTop = nNextItemOffsetTop - nBodyOffsetHeight;
+
+                            }
+                            else if (nNextItemOffsetTop <= nBodyScrollTop) {
+                            
+                                oBody.scrollTop = 0;
+                            
+                            }
+
+
+                            if (oNextItem == aItems[nItems]) {
+
+                                oBody.scrollTop = oNextItem.element.offsetTop;
+
+                            }
+
+                        }
+                        else {  // Up
+
+                            if (nNextItemOffsetTop <= nBodyScrollTop) {
+
+                                oBody.scrollTop = nNextItemOffsetTop - oNextItem.element.offsetHeight;
+                            
+                            }
+                            else if (nNextItemOffsetTop >= (nBodyScrollTop + nBodyOffsetHeight)) {
+                            
+                                oBody.scrollTop = nNextItemOffsetTop;
+                            
+                            }
 
-                        var oBody = this.body;
 
-                        oBody.scrollTop = 
+                            if (oNextItem == aItems[0]) {
+                            
+                                oBody.scrollTop = 0;
+                            
+                            }
 
-                            (
-                                oNextItem.element.offsetTop + 
-                                oNextItem.element.offsetHeight
-                            ) - oBody.offsetHeight;
+                        }
 
 
-                        var nScrollTop = oBody.scrollTop,
-                            nScrollTarget = 
-                                oBody.scrollHeight - oBody.offsetHeight;
+                        nBodyScrollTop = oBody.scrollTop;
+                        nScrollTarget = oBody.scrollHeight - oBody.offsetHeight;
 
-                        if(nScrollTop === 0) {
+                        if (nBodyScrollTop === 0) {
 
                             this._disableScrollHeader();
                             this._enableScrollFooter();
 
                         }
-                        else if(nScrollTop == nScrollTarget) {
+                        else if (nBodyScrollTop == nScrollTarget) {
 
                              this._enableScrollHeader();
                              this._disableScrollFooter();
@@ -2904,9 +2986,9 @@
     
                 oSubmenu = oItemCfg.getProperty("submenu");
     
-                if(oSubmenu) {
+                if (oSubmenu) {
     
-                    if(!oItemCfg.getProperty("selected")) {
+                    if (!oItemCfg.getProperty("selected")) {
         
                         oItemCfg.setProperty("selected", true);
         
@@ -2921,11 +3003,11 @@
     
                     oRoot = this.getRoot();
                     
-                    if(oRoot instanceof YAHOO.widget.MenuBar) {
+                    if (oRoot instanceof YAHOO.widget.MenuBar) {
     
                         oNextItem = oRoot.activeItem.getNextEnabledSibling();
     
-                        if(oNextItem) {
+                        if (oNextItem) {
                         
                             oRoot.clearActiveItem();
     
@@ -2933,7 +3015,7 @@
     
                             oSubmenu = oNextItem.cfg.getProperty("submenu");
     
-                            if(oSubmenu) {
+                            if (oSubmenu) {
     
                                 oSubmenu.show();
                             
@@ -2957,16 +3039,16 @@
     
             case 37:    // Left arrow
     
-                if(oParentItem) {
+                if (oParentItem) {
     
-                    var oParentMenu = oParentItem.parent;
+                    oParentMenu = oParentItem.parent;
     
-                    if(oParentMenu instanceof YAHOO.widget.MenuBar) {
+                    if (oParentMenu instanceof YAHOO.widget.MenuBar) {
     
                         oNextItem = 
                             oParentMenu.activeItem.getPreviousEnabledSibling();
     
-                        if(oNextItem) {
+                        if (oNextItem) {
                         
                             oParentMenu.clearActiveItem();
     
@@ -2974,7 +3056,7 @@
     
                             oSubmenu = oNextItem.cfg.getProperty("submenu");
     
-                            if(oSubmenu) {
+                            if (oSubmenu) {
                             
                                 oSubmenu.show();
                             
@@ -3007,24 +3089,24 @@
     }
 
 
-    if(oEvent.keyCode == 27) { // Esc key
+    if (oEvent.keyCode == 27) { // Esc key
 
-        if(this.cfg.getProperty("position") == "dynamic") {
+        if (this.cfg.getProperty("position") == "dynamic") {
         
             this.hide();
 
-            if(this.parent) {
+            if (this.parent) {
 
                 this.parent.focus();
             
             }
 
         }
-        else if(this.activeItem) {
+        else if (this.activeItem) {
 
             oSubmenu = this.activeItem.cfg.getProperty("submenu");
 
-            if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {
+            if (oSubmenu && oSubmenu.cfg.getProperty("visible")) {
             
                 oSubmenu.hide();
                 this.activeItem.focus();
@@ -3054,16 +3136,15 @@
 * @param {String} p_sType The name of the event that was fired.
 * @param {Array} p_aArgs Collection of arguments sent when the event 
 * was fired.
-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance that fired the event.
 */
-_onKeyPress: function(p_sType, p_aArgs, p_oMenu) {
+_onKeyPress: function (p_sType, p_aArgs) {
     
     var oEvent = p_aArgs[0];
 
 
-    if(oEvent.keyCode == 40 || oEvent.keyCode == 38) {
+    if (oEvent.keyCode == 40 || oEvent.keyCode == 38) {
 
-        YAHOO.util.Event.preventDefault(oEvent);
+        Event.preventDefault(oEvent);
 
     }
 
@@ -3071,31 +3152,45 @@
 
 
 /**
-* @method _onTextResize
-* @description "textresize" event handler for the menu.
+* @method _onYChange
+* @description "y" event handler for a Menu instance.
 * @protected
-* @param {String} p_sType String representing the name of the event that 
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
 * was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onTextResize: function(p_sType, p_aArgs, p_oMenu) {
+_onYChange: function (p_sType, p_aArgs) {
 
-    if(this.browser == "gecko" && !this._handleResize) {
+    var oParent = this.parent,
+        nScrollTop,
+        oIFrame,
+        nY;
 
-        this._handleResize = true;
-        return;
-    
-    }
 
+    if (oParent) {
+
+        nScrollTop = oParent.parent.body.scrollTop;
 
-    var oConfig = this.cfg;
 
-    if(oConfig.getProperty("position") == "dynamic") {
+        if (nScrollTop > 0) {
+    
+            nY = (this.cfg.getProperty("y") - nScrollTop);
+            
+            Dom.setY(this.element, nY);
 
-        oConfig.setProperty("width", (this._getOffsetWidth() + "px"));
+            oIFrame = this.iframe;            
+    
 
+            if (oIFrame) {
+    
+                Dom.setY(oIFrame, nY);
+    
+            }
+            
+            this.cfg.setProperty("y", nY, true);
+        
+        }
+    
     }
 
 },
@@ -3112,13 +3207,14 @@
 * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
 * fired the event.
 */
-_onScrollTargetMouseOver: function(p_oEvent, p_oMenu) {
+_onScrollTargetMouseOver: function (p_oEvent, p_oMenu) {
 
     this._cancelHideDelay();
 
     var oTarget = Event.getTarget(p_oEvent),
         oBody = this.body,
         me = this,
+        nScrollIncrement = this.cfg.getProperty("scrollincrement"),
         nScrollTarget,
         fnScrollFunction;
 
@@ -3128,9 +3224,9 @@
         var nScrollTop = oBody.scrollTop;
 
 
-        if(nScrollTop < nScrollTarget) {
+        if (nScrollTop < nScrollTarget) {
 
-            oBody.scrollTop = (nScrollTop + 1);
+            oBody.scrollTop = (nScrollTop + nScrollIncrement);
 
             me._enableScrollHeader();
 
@@ -3153,9 +3249,9 @@
         var nScrollTop = oBody.scrollTop;
 
 
-        if(nScrollTop > 0) {
+        if (nScrollTop > 0) {
 
-            oBody.scrollTop = (nScrollTop - 1);
+            oBody.scrollTop = (nScrollTop - nScrollIncrement);
 
             me._enableScrollFooter();
 
@@ -3173,7 +3269,7 @@
     }
 
     
-    if(Dom.hasClass(oTarget, "hd")) {
+    if (Dom.hasClass(oTarget, "hd")) {
 
         fnScrollFunction = scrollBodyUp;
     
@@ -3203,7 +3299,7 @@
 * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
 * fired the event.
 */
-_onScrollTargetMouseOut: function(p_oEvent, p_oMenu) {
+_onScrollTargetMouseOut: function (p_oEvent, p_oMenu) {
 
     window.clearInterval(this._nBodyScrollId);
 
@@ -3223,42 +3319,48 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onInit: function(p_sType, p_aArgs, p_oMenu) {
+_onInit: function (p_sType, p_aArgs) {
 
-    this.cfg.subscribeToConfigEvent("width", this._onWidthChange);
     this.cfg.subscribeToConfigEvent("visible", this._onVisibleChange);
 
-    if(
-        (
-            (this.parent && !this.lazyLoad) || 
-            (!this.parent && this.cfg.getProperty("position") == "static") ||
-            (
-                !this.parent && 
-                !this.lazyLoad && 
-                this.cfg.getProperty("position") == "dynamic"
-            ) 
-        ) && 
-        this.getItemGroups().length === 0
-    ) {
- 
-        if(this.srcElement) {
+    var bRootMenu = !this.parent,
+        bLazyLoad = this.lazyLoad;
+
+
+    /*
+        Automatically initialize a menu's subtree if:
+
+        1) This is the root menu and lazyload is off
+        
+        2) This is the root menu, lazyload is on, but the menu is 
+           already visible
+
+        3) This menu is a submenu and lazyload is off
+    */
+
+
+
+    if (((bRootMenu && !bLazyLoad) || 
+        (bRootMenu && (this.cfg.getProperty("visible") || 
+        this.cfg.getProperty("position") == "static")) || 
+        (!bRootMenu && !bLazyLoad)) && this.getItemGroups().length === 0) {
+
+        if (this.srcElement) {
 
             this._initSubTree();
         
         }
 
 
-        if(this.itemData) {
+        if (this.itemData) {
 
             this.addItems(this.itemData);
 
         }
     
     }
-    else if(this.lazyLoad) {
+    else if (bLazyLoad) {
 
         this.cfg.fireQueue();
     
@@ -3276,31 +3378,25 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onBeforeRender: function(p_sType, p_aArgs, p_oMenu) {
+_onBeforeRender: function (p_sType, p_aArgs) {
 
-    var oConfig = this.cfg,
-        oEl = this.element,
-        nListElements = this._aListElements.length;
-
-
-    if(nListElements > 0) {
-
-        var i = 0,
-            bFirstList = true,
-            oUL,
-            oGroupTitle;
+    var oEl = this.element,
+        nListElements = this._aListElements.length,
+        bFirstList = true,
+        i = 0,
+        oUL,
+        oGroupTitle;
 
+    if (nListElements > 0) {
 
         do {
 
             oUL = this._aListElements[i];
 
-            if(oUL) {
+            if (oUL) {
 
-                if(bFirstList) {
+                if (bFirstList) {
         
                     Dom.addClass(oUL, "first-of-type");
                     bFirstList = false;
@@ -3308,7 +3404,7 @@
                 }
 
 
-                if(!Dom.isAncestor(oEl, oUL)) {
+                if (!Dom.isAncestor(oEl, oUL)) {
 
                     this.appendToBody(oUL);
 
@@ -3317,9 +3413,9 @@
 
                 oGroupTitle = this._aGroupTitleElements[i];
 
-                if(oGroupTitle) {
+                if (oGroupTitle) {
 
-                    if(!Dom.isAncestor(oEl, oGroupTitle)) {
+                    if (!Dom.isAncestor(oEl, oGroupTitle)) {
 
                         oUL.parentNode.insertBefore(oGroupTitle, oUL);
 
@@ -3350,20 +3446,24 @@
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
-_onRender: function(p_sType, p_aArgs) {
+_onRender: function (p_sType, p_aArgs) {
+
+    if (this.cfg.getProperty("position") == "dynamic") { 
 
-    if (
-        this.cfg.getProperty("position") == "dynamic" && 
-        !this.cfg.getProperty("width")
-    ) {
+        if (!this.cfg.getProperty("visible")) {
 
-        this._setWidth();
+            this.positionOffScreen();
+
+        }
     
     }
 
 },
 
 
+
+
+
 /**
 * @method _onBeforeShow
 * @description "beforeshow" event handler for the menu.
@@ -3371,33 +3471,37 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
-* fired the event.
 */
-_onBeforeShow: function(p_sType, p_aArgs, p_oMenu) {
+_onBeforeShow: function (p_sType, p_aArgs) {
+
+    var nOptions,
+        n,
+        nViewportHeight,
+        oRegion,
+        oSrcElement;
 
-    if(this.lazyLoad && this.getItemGroups().length === 0) {
 
-        if(this.srcElement) {
+    if (this.lazyLoad && this.getItemGroups().length === 0) {
+
+        if (this.srcElement) {
         
             this._initSubTree();
 
         }
 
 
-        if(this.itemData) {
+        if (this.itemData) {
 
-            if(
-                this.parent && this.parent.parent && 
+            if (this.parent && this.parent.parent && 
                 this.parent.parent.srcElement && 
-                this.parent.parent.srcElement.tagName.toUpperCase() == "SELECT"
-            ) {
+                this.parent.parent.srcElement.tagName.toUpperCase() == 
+                "SELECT") {
 
-                var nOptions = this.itemData.length;
+                nOptions = this.itemData.length;
     
-                for(var n=0; n<nOptions; n++) {
+                for(n=0; n<nOptions; n++) {
 
-                    if(this.itemData[n].tagName) {
+                    if (this.itemData[n].tagName) {
 
                         this.addItem((new this.ITEM_TYPE(this.itemData[n])));
     
@@ -3415,13 +3519,13 @@
         }
 
 
-        var oSrcElement = this.srcElement;
+        oSrcElement = this.srcElement;
 
-        if(oSrcElement) {
+        if (oSrcElement) {
 
-            if(oSrcElement.tagName.toUpperCase() == "SELECT") {
+            if (oSrcElement.tagName.toUpperCase() == "SELECT") {
 
-                if(Dom.inDocument(oSrcElement)) {
+                if (Dom.inDocument(oSrcElement)) {
 
                     this.render(oSrcElement.parentNode);
                 
@@ -3442,7 +3546,7 @@
         }
         else {
 
-            if(this.parent) {
+            if (this.parent) {
 
                 this.render(this.parent.element);            
 
@@ -3450,7 +3554,6 @@
             else {
 
                 this.render(this.cfg.getProperty("container"));
-                this.cfg.refireEvent("xy");
 
             }                
 
@@ -3459,54 +3562,65 @@
     }
 
 
-    if(this.cfg.getProperty("position") == "dynamic") {
-
-        var nViewportHeight = Dom.getViewportHeight();
+    var nMaxHeight = this.cfg.getProperty("maxheight"),
+        nMinScrollHeight = this.cfg.getProperty("minscrollheight"),
+        bDynamicPos = this.cfg.getProperty("position") == "dynamic";
 
 
-        if(this.parent && this.parent.parent instanceof YAHOO.widget.MenuBar) {
-           
-            var oRegion = YAHOO.util.Region.getRegion(this.parent.element);
-            
-            nViewportHeight = (nViewportHeight - oRegion.bottom);
+    if (!this.parent && bDynamicPos) {
 
-        }
+        this.cfg.refireEvent("xy");
+   
+    }
 
 
-        if(this.element.offsetHeight >= nViewportHeight) {
+    function clearMaxHeight() {
     
-            var nMaxHeight = this.cfg.getProperty("maxheight");
-
-            /*
-                Cache the original value for the "maxheight" configuration  
-                property so that we can set it back when the menu is hidden.
-            */
+        this.cfg.setProperty("maxheight", 0);
+    
+        this.hideEvent.unsubscribe(clearMaxHeight);
     
-            this._nMaxHeight = nMaxHeight;
+    }
 
-            this.cfg.setProperty("maxheight", (nViewportHeight - 20));
-        
-        }
+
+    if (!(this instanceof YAHOO.widget.MenuBar) && bDynamicPos) {
+
+
+        if (nMaxHeight === 0) {
+
+            nViewportHeight = Dom.getViewportHeight();
     
     
-        if(this.cfg.getProperty("maxheight") > 0) {
+            if (this.parent && 
+                this.parent.parent instanceof YAHOO.widget.MenuBar) {
+               
+                oRegion = YAHOO.util.Region.getRegion(this.parent.element);
+                
+                nViewportHeight = (nViewportHeight - oRegion.bottom);
     
-            var oBody = this.body;
+            }
     
-            if(oBody.scrollTop > 0) {
     
-                oBody.scrollTop = 0;
+            if (this.element.offsetHeight >= nViewportHeight) {
     
-            }
+                nMaxHeight = (nViewportHeight - (Overlay.VIEWPORT_OFFSET * 2));
 
-            this._disableScrollHeader();
-            this._enableScrollFooter();
-    
+                if (nMaxHeight < nMinScrollHeight) {
+
+                    nMaxHeight = nMinScrollHeight;
+                
+                }
+
+                this.cfg.setProperty("maxheight", nMaxHeight);
+
+                this.hideEvent.subscribe(clearMaxHeight);
+
+            }
+        
         }
 
     }
 
-
 },
 
 
@@ -3517,82 +3631,68 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired 
-* the event.
 */
-_onShow: function(p_sType, p_aArgs, p_oMenu) {
+_onShow: function (p_sType, p_aArgs) {
 
-    var oParent = this.parent;
-    
-    if(oParent) {
+    var oParent = this.parent,
+        oParentMenu,
+        aParentAlignment,
+        aAlignment;
+
+
+    function disableAutoSubmenuDisplay(p_oEvent) {
 
-        var oParentMenu = oParent.parent,
-            aParentAlignment = oParentMenu.cfg.getProperty("submenualignment"),
-            aAlignment = this.cfg.getProperty("submenualignment");
+        var oTarget;
 
+        if (p_oEvent.type == "mousedown" || (p_oEvent.type == "keydown" && 
+            p_oEvent.keyCode == 27)) {
 
-        if(
-            (aParentAlignment[0] != aAlignment[0]) &&
-            (aParentAlignment[1] != aAlignment[1])
-        ) {
+            /*  
+                Set the "autosubmenudisplay" to "false" if the user
+                clicks outside the menu bar.
+            */
+
+            oTarget = Event.getTarget(p_oEvent);
+
+            if (oTarget != oParentMenu.element || 
+                !Dom.isAncestor(oParentMenu.element, oTarget)) {
+
+                oParentMenu.cfg.setProperty("autosubmenudisplay", false);
 
-            this.cfg.setProperty(
-                "submenualignment", 
-                [ aParentAlignment[0], aParentAlignment[1] ]
-            );
+                Event.removeListener(document, "mousedown", 
+                        disableAutoSubmenuDisplay);
+
+                Event.removeListener(document, "keydown", 
+                        disableAutoSubmenuDisplay);
+
+            }
         
         }
 
+    }
+
 
-        if(
-            !oParentMenu.cfg.getProperty("autosubmenudisplay") && 
-            oParentMenu.cfg.getProperty("position") == "static"
-        ) {
+    if (oParent) {
 
-            oParentMenu.cfg.setProperty("autosubmenudisplay", true);
+        oParentMenu = oParent.parent;
+        aParentAlignment = oParentMenu.cfg.getProperty("submenualignment");
+        aAlignment = this.cfg.getProperty("submenualignment");
 
 
-            function disableAutoSubmenuDisplay(p_oEvent) {
+        if ((aParentAlignment[0] != aAlignment[0]) &&
+            (aParentAlignment[1] != aAlignment[1])) {
 
-                if(
-                    p_oEvent.type == "mousedown" || 
-                    (p_oEvent.type == "keydown" && p_oEvent.keyCode == 27)
-                ) {
-
-                    /*  
-                        Set the "autosubmenudisplay" to "false" if the user
-                        clicks outside the menu bar.
-                    */
-
-                    var oTarget = Event.getTarget(p_oEvent);
-
-                    if(
-                        oTarget != oParentMenu.element || 
-                        !YAHOO.util.Dom.isAncestor(oParentMenu.element, oTarget)
-                    ) {
-
-                        oParentMenu.cfg.setProperty(
-                            "autosubmenudisplay", 
-                            false
-                        );
-
-                        Event.removeListener(
-                                document, 
-                                "mousedown", 
-                                disableAutoSubmenuDisplay
-                            );
-
-                        Event.removeListener(
-                                document, 
-                                "keydown", 
-                                disableAutoSubmenuDisplay
-                            );
+            this.cfg.setProperty("submenualignment", 
+                [aParentAlignment[0], aParentAlignment[1]]);
+        
+        }
 
-                    }
-                
-                }
 
-            }
+        if (!oParentMenu.cfg.getProperty("autosubmenudisplay") && 
+            (oParentMenu instanceof YAHOO.widget.MenuBar || 
+            oParentMenu.cfg.getProperty("position") == "static")) {
+
+            oParentMenu.cfg.setProperty("autosubmenudisplay", true);
 
             Event.on(document, "mousedown", disableAutoSubmenuDisplay);                             
             Event.on(document, "keydown", disableAutoSubmenuDisplay);
@@ -3611,22 +3711,22 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired 
-* the event.
 */
-_onBeforeHide: function(p_sType, p_aArgs, p_oMenu) {
+_onBeforeHide: function (p_sType, p_aArgs) {
 
-    var oActiveItem = this.activeItem;
+    var oActiveItem = this.activeItem,
+        oConfig,
+        oSubmenu;
 
-    if(oActiveItem) {
+    if (oActiveItem) {
 
-        var oConfig = oActiveItem.cfg;
+        oConfig = oActiveItem.cfg;
 
         oConfig.setProperty("selected", false);
 
-        var oSubmenu = oConfig.getProperty("submenu");
+        oSubmenu = oConfig.getProperty("submenu");
 
-        if(oSubmenu) {
+        if (oSubmenu) {
 
             oSubmenu.hide();
 
@@ -3634,7 +3734,7 @@
 
     }
 
-    if (this == this.getRoot()) {
+    if (this.getRoot() == this) {
 
         this.blur();
     
@@ -3644,29 +3744,6 @@
 
 
 /**
-* @method _onHide
-* @description "hide" event handler for the menu.
-* @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired 
-* the event.
-*/
-_onHide: function(p_sType, p_aArgs, p_oMenu) {
-
-    if(this._nMaxHeight != -1) {
-
-        this.cfg.setProperty("maxheight", this._nMaxHeight);
-
-        this._nMaxHeight = -1;
-
-    }
-
-},
-
-
-/**
 * @method _onParentMenuConfigChange
 * @description "configchange" event handler for a submenu.
 * @private
@@ -3676,7 +3753,7 @@
 * @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that 
 * subscribed to the event.
 */
-_onParentMenuConfigChange: function(p_sType, p_aArgs, p_oSubmenu) {
+_onParentMenuConfigChange: function (p_sType, p_aArgs, p_oSubmenu) {
     
     var sPropertyName = p_aArgs[0][0],
         oPropertyValue = p_aArgs[0][1];
@@ -3691,6 +3768,8 @@
         case "clicktohide":
         case "effect":
         case "classname":
+        case "scrollincrement":
+        case "minscrollheight":
 
             p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);
                 
@@ -3712,55 +3791,47 @@
 * @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that 
 * subscribed to the event.
 */
-_onParentMenuRender: function(p_sType, p_aArgs, p_oSubmenu) {
+_onParentMenuRender: function (p_sType, p_aArgs, p_oSubmenu) {
 
-    var oParentMenu = p_oSubmenu.parent.parent,
+    var oParentCfg = p_oSubmenu.parent.parent.cfg,
 
         oConfig = {
 
-            constraintoviewport: 
-                oParentMenu.cfg.getProperty("constraintoviewport"),
+            constraintoviewport: oParentCfg.getProperty("constraintoviewport"),
 
             xy: [0,0],
+
+            clicktohide: oParentCfg.getProperty("clicktohide"),
                 
-            clicktohide: oParentMenu.cfg.getProperty("clicktohide"),
-                
-            effect: oParentMenu.cfg.getProperty("effect"),
+            effect: oParentCfg.getProperty("effect"),
 
-            showdelay: oParentMenu.cfg.getProperty("showdelay"),
+            showdelay: oParentCfg.getProperty("showdelay"),
             
-            hidedelay: oParentMenu.cfg.getProperty("hidedelay"),
-
-            submenuhidedelay: oParentMenu.cfg.getProperty("submenuhidedelay"),
+            hidedelay: oParentCfg.getProperty("hidedelay"),
 
-            classname: oParentMenu.cfg.getProperty("classname")
+            submenuhidedelay: oParentCfg.getProperty("submenuhidedelay"),
 
-        };
-
-
-    /*
-        Only sync the "iframe" configuration property if the parent
-        menu's "position" configuration is the same.
-    */
+            classname: oParentCfg.getProperty("classname"),
+            
+            scrollincrement: oParentCfg.getProperty("scrollincrement"),
+            
+            minscrollheight: oParentCfg.getProperty("minscrollheight"),
+            
+            iframe: oParentCfg.getProperty("iframe")
 
-    if(
-        this.cfg.getProperty("position") == 
-        oParentMenu.cfg.getProperty("position")
-    ) {
+        },
+        
+        oLI;
 
-        oConfig.iframe = oParentMenu.cfg.getProperty("iframe");
-    
-    }
-               
 
     p_oSubmenu.cfg.applyConfig(oConfig);
 
 
-    if(!this.lazyLoad) {
+    if (!this.lazyLoad) {
 
-        var oLI = this.parent.element;
+        oLI = this.parent.element;
 
-        if(this.element.parentNode == oLI) {
+        if (this.element.parentNode == oLI) {
     
             this.render();
     
@@ -3783,92 +3854,71 @@
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that 
-* subscribed to the event.
 */
-_onSubmenuBeforeShow: function(p_sType, p_aArgs, p_oSubmenu) {
-    
+_onSubmenuBeforeShow: function (p_sType, p_aArgs) {
+
     var oParent = this.parent,
         aAlignment = oParent.parent.cfg.getProperty("submenualignment");
 
-    this.cfg.setProperty(
-        "context", 
-        [oParent.element, aAlignment[0], aAlignment[1]]
-    );
-
-
-    var nScrollTop = oParent.parent.body.scrollTop;
 
-    if(
-        (this.browser == "gecko" || this.browser == "safari") 
-        && nScrollTop > 0
-    ) {
-
-         this.cfg.setProperty("y", (this.cfg.getProperty("y") - nScrollTop));
+    if (!this.cfg.getProperty("context")) {
     
-    }
-
-},
+        this.cfg.setProperty("context", 
+            [oParent.element, aAlignment[0], aAlignment[1]]);
 
+    }
+    else {
 
-/**
-* @method _onSubmenuShow
-* @description "show" event handler for a submenu.
-* @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.
-*/
-_onSubmenuShow: function(p_sType, p_aArgs) {
+        this.align();
     
-    this.submenuIndicator.firstChild.nodeValue = 
-        this.EXPANDED_SUBMENU_INDICATOR_TEXT;
+    }
 
 },
 
 
 /**
-* @method _onSubmenuHide
-* @description "hide" Custom Event handler for a submenu.
+* @method _onMenuItemFocus
+* @description "focus" event handler for the menu's items.
 * @private
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
-_onSubmenuHide: function(p_sType, p_aArgs) {
-    
-    this.submenuIndicator.firstChild.nodeValue =
-        this.COLLAPSED_SUBMENU_INDICATOR_TEXT;
+_onMenuItemFocus: function (p_sType, p_aArgs) {
+
+    this.parent.focusEvent.fire(this);
 
 },
 
 
 /**
-* @method _onMenuItemFocus
-* @description "focus" event handler for the menu's items.
+* @method _onMenuItemBlur
+* @description "blur" event handler for the menu's items.
 * @private
-* @param {String} p_sType String representing the name of the event that 
-* was fired.
+* @param {String} p_sType String representing the name of the event 
+* that was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 */
-_onMenuItemFocus: function(p_sType, p_aArgs) {
+_onMenuItemBlur: function (p_sType, p_aArgs) {
 
-    this.parent.focusEvent.fire(this);
+    this.parent.blurEvent.fire(this);
 
 },
 
 
 /**
-* @method _onMenuItemBlur
-* @description "blur" event handler for the menu's items.
+* @method _onMenuItemDestroy
+* @description "destroy" event handler for the menu's items.
 * @private
 * @param {String} p_sType String representing the name of the event 
 * that was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item 
+* that fired the event.
 */
-_onMenuItemBlur: function(p_sType, p_aArgs) {
+_onMenuItemDestroy: function (p_sType, p_aArgs, p_oItem) {
 
-    this.parent.blurEvent.fire(this);
+    this._removeItemFromGroupByValue(p_oItem.groupIndex, p_oItem);
 
 },
 
@@ -3883,10 +3933,12 @@
 * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item 
 * that fired the event.
 */
-_onMenuItemConfigChange: function(p_sType, p_aArgs, p_oItem) {
+_onMenuItemConfigChange: function (p_sType, p_aArgs, p_oItem) {
 
     var sPropertyName = p_aArgs[0][0],
-        oPropertyValue = p_aArgs[0][1];
+        oPropertyValue = p_aArgs[0][1],
+        oSubmenu;
+
 
     switch(sPropertyName) {
 
@@ -3902,9 +3954,9 @@
 
         case "submenu":
 
-            var oSubmenu = p_aArgs[0][1];
+            oSubmenu = p_aArgs[0][1];
 
-            if(oSubmenu) {
+            if (oSubmenu) {
 
                 this._configureSubmenu(p_oItem);
 
@@ -3912,25 +3964,6 @@
 
         break;
 
-        case "text":
-        case "helptext":
-
-            /*
-                A change to an item's "text" or "helptext"
-                configuration properties requires the width of the parent
-                menu to be recalculated.
-            */
-
-            if(this.element.style.width) {
-    
-                var sWidth = this._getOffsetWidth() + "px";
-
-                Dom.setStyle(this.element, "width", sWidth);
-
-            }
-
-        break;
-
     }
 
 },
@@ -3950,59 +3983,59 @@
 * @param {Array} obj Array containing the current Menu instance 
 * and the item that fired the event.
 */
-enforceConstraints: function(type, args, obj) {
+enforceConstraints: function (type, args, obj) {
+
+    var oParentMenuItem = this.parent,
+        nViewportOffset = Overlay.VIEWPORT_OFFSET,
+        oElement = this.element,
+        oConfig = this.cfg,
+        pos = args[0],
+        offsetHeight = oElement.offsetHeight,
+        offsetWidth = oElement.offsetWidth,
+        viewPortWidth = Dom.getViewportWidth(),
+        viewPortHeight = Dom.getViewportHeight(),
+        nPadding = (oParentMenuItem && 
+            oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) ? 
+            0 : nViewportOffset,
+        aContext = oConfig.getProperty("context"),
+        oContextElement = aContext ? aContext[0] : null,
+        topConstraint,
+        leftConstraint,
+        bottomConstraint,
+        rightConstraint,
+        scrollX,
+        scrollY,
+        x,
+        y;
+    
+
+    if (offsetWidth < viewPortWidth) {
+
+        x = pos[0];
+        scrollX = Dom.getDocumentScrollLeft();
+        leftConstraint = scrollX + nPadding;
+        rightConstraint = scrollX + viewPortWidth - offsetWidth - nPadding;
 
-    if(this.parent && !(this.parent.parent instanceof YAHOO.widget.MenuBar)) {
+        if (x < nViewportOffset) {
     
-        var oConfig = this.cfg,
-            pos = args[0],
-            
-            x = pos[0],
-            y = pos[1],
-            
-            offsetHeight = this.element.offsetHeight,
-            offsetWidth = this.element.offsetWidth,
-            
-            viewPortWidth = YAHOO.util.Dom.getViewportWidth(),
-            viewPortHeight = YAHOO.util.Dom.getViewportHeight(),
-            
-            scrollX = Math.max(
-                    document.documentElement.scrollLeft, 
-                    document.body.scrollLeft
-                ),
-            
-            scrollY = Math.max(
-                    document.documentElement.scrollTop, 
-                    document.body.scrollTop
-                ),
-            
-            nPadding = (
-                            this.parent && 
-                            this.parent.parent instanceof YAHOO.widget.MenuBar
-                        ) ? 0 : 10,
-            
-            topConstraint = scrollY + nPadding,
-            leftConstraint = scrollX + nPadding,
-            bottomConstraint = 
-                scrollY + viewPortHeight - offsetHeight - nPadding,
-            rightConstraint = scrollX + viewPortWidth - offsetWidth - nPadding,
-            
-            aContext = oConfig.getProperty("context"),
-            oContextElement = aContext ? aContext[0] : null;
+            x = leftConstraint;
+    
+        } else if ((x + offsetWidth) > viewPortWidth) {
     
+            if(oContextElement &&
+                ((x - oContextElement.offsetWidth) > offsetWidth)) {
     
-        if (x < 10) {
+                if (oParentMenuItem && 
+                    oParentMenuItem.parent instanceof YAHOO.widget.MenuBar) {
     
-            x = leftConstraint;
+                    x = (x - (offsetWidth - oContextElement.offsetWidth));
     
-        } else if ((x + offsetWidth) > viewPortWidth) {
+                }
+                else {
     
-            if(
-                oContextElement &&
-                ((x - oContextElement.offsetWidth) > offsetWidth)
-            ) {
+                    x = (x - (oContextElement.offsetWidth + offsetWidth));
     
-                x = (x - (oContextElement.offsetWidth + offsetWidth));
+                }
     
             }
             else {
@@ -4013,13 +4046,25 @@
     
         }
     
-        if (y < 10) {
+    }
+
+
+    if (offsetHeight < viewPortHeight) {
+
+        y = pos[1];
+        scrollY = Dom.getDocumentScrollTop();
+        topConstraint = scrollY + nPadding;
+        bottomConstraint = scrollY + viewPortHeight - offsetHeight - nPadding;
+
+
+
+        if (y < nViewportOffset) {
     
             y = topConstraint;
     
         } else if (y > bottomConstraint) {
     
-            if(oContextElement && (y > offsetHeight)) {
+            if (oContextElement && (y > offsetHeight)) {
     
                 y = ((y + oContextElement.offsetHeight) - offsetHeight);
     
@@ -4027,17 +4072,20 @@
             else {
     
                 y = bottomConstraint;
+                
+
     
             }
     
         }
-    
-        oConfig.setProperty("x", x, true);
-        oConfig.setProperty("y", y, true);
-        oConfig.setProperty("xy", [x,y], true);
-    
+
     }
 
+
+    oConfig.setProperty("x", x, true);
+    oConfig.setProperty("y", y, true);
+    oConfig.setProperty("xy", [x,y], true);
+
 },
 
 
@@ -4051,26 +4099,26 @@
 * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
 * fired the event.
 */
-configVisible: function(p_sType, p_aArgs, p_oMenu) {
+configVisible: function (p_sType, p_aArgs, p_oMenu) {
 
-    if(this.cfg.getProperty("position") == "dynamic") {
+    var bVisible,
+        sDisplay;
 
-        YAHOO.widget.Menu.superclass.configVisible.call(
-            this, 
-            p_sType, 
-            p_aArgs, 
-            p_oMenu
-        );
+    if (this.cfg.getProperty("position") == "dynamic") {
+
+        Menu.superclass.configVisible.call(this, p_sType, p_aArgs, p_oMenu);
 
     }
     else {
 
-        var bVisible = p_aArgs[0],
-    	    sDisplay = Dom.getStyle(this.element, "display");
+        bVisible = p_aArgs[0];
+        sDisplay = Dom.getStyle(this.element, "display");
 
-        if(bVisible) {
+        Dom.setStyle(this.element, "visibility", "visible");
 
-            if(sDisplay != "block") {
+        if (bVisible) {
+
+            if (sDisplay != "block") {
                 this.beforeShowEvent.fire();
                 Dom.setStyle(this.element, "display", "block");
                 this.showEvent.fire();
@@ -4079,7 +4127,7 @@
         }
         else {
 
-			if(sDisplay == "block") {
+			if (sDisplay == "block") {
 				this.beforeHideEvent.fire();
 				Dom.setStyle(this.element, "display", "none");
 				this.hideEvent.fire();
@@ -4102,27 +4150,22 @@
 * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
 * fired the event.
 */
-configPosition: function(p_sType, p_aArgs, p_oMenu) {
-
-    var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",
-        oCfg = this.cfg;
+configPosition: function (p_sType, p_aArgs, p_oMenu) {
 
-    Dom.setStyle(this.element, "position", sCSSPosition);
+    var oElement = this.element,
+        sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",
+        oCfg = this.cfg,
+        nZIndex;
 
 
-    if(sCSSPosition == "static") {
+    Dom.setStyle(oElement, "position", sCSSPosition);
 
-        /*
-            Remove the iframe for statically positioned menus since it will 
-            intercept mouse events.
-        */
-
-        oCfg.setProperty("iframe", false);
 
+    if (sCSSPosition == "static") {
 
         // Statically positioned menus are visible by default
         
-        Dom.setStyle(this.element, "display", "block");
+        Dom.setStyle(oElement, "display", "block");
 
         oCfg.setProperty("visible", true);
 
@@ -4137,16 +4180,16 @@
             or not to show an Overlay instance.
         */
 
-        Dom.setStyle(this.element, "visibility", "hidden");
+        Dom.setStyle(oElement, "visibility", "hidden");
     
     }
 
 
-    if(sCSSPosition == "absolute") {
+    if (sCSSPosition == "absolute") {
 
-        var nZIndex = oCfg.getProperty("zindex");
+        nZIndex = oCfg.getProperty("zindex");
 
-        if(!nZIndex || nZIndex === 0) {
+        if (!nZIndex || nZIndex === 0) {
 
             nZIndex = this.parent ? 
                 (this.parent.parent.cfg.getProperty("zindex") + 1) : 1;
@@ -4170,16 +4213,11 @@
 * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
 * fired the event.
 */
-configIframe: function(p_sType, p_aArgs, p_oMenu) {    
+configIframe: function (p_sType, p_aArgs, p_oMenu) {    
 
-    if(this.cfg.getProperty("position") == "dynamic") {
+    if (this.cfg.getProperty("position") == "dynamic") {
 
-        YAHOO.widget.Menu.superclass.configIframe.call(
-            this, 
-            p_sType, 
-            p_aArgs, 
-            p_oMenu
-        );
+        Menu.superclass.configIframe.call(this, p_sType, p_aArgs, p_oMenu);
 
     }
 
@@ -4196,25 +4234,25 @@
 * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
 * fired the event.
 */
-configHideDelay: function(p_sType, p_aArgs, p_oMenu) {
+configHideDelay: function (p_sType, p_aArgs, p_oMenu) {
 
     var nHideDelay = p_aArgs[0],
         oMouseOutEvent = this.mouseOutEvent,
         oMouseOverEvent = this.mouseOverEvent,
         oKeyDownEvent = this.keyDownEvent;
 
-    if(nHideDelay > 0) {
+    if (nHideDelay > 0) {
 
         /*
             Only assign event handlers once. This way the user change 
             the value for the hidedelay as many times as they want.
         */
 
-        if(!this._bHideDelayEventHandlersAssigned) {
+        if (!this._bHideDelayEventHandlersAssigned) {
 
-            oMouseOutEvent.subscribe(this._execHideDelay, this);
-            oMouseOverEvent.subscribe(this._cancelHideDelay, this, true);
-            oKeyDownEvent.subscribe(this._cancelHideDelay, this, true);
+            oMouseOutEvent.subscribe(this._execHideDelay);
+            oMouseOverEvent.subscribe(this._cancelHideDelay);
+            oKeyDownEvent.subscribe(this._cancelHideDelay);
 
             this._bHideDelayEventHandlersAssigned = true;
         
@@ -4223,9 +4261,9 @@
     }
     else {
 
-        oMouseOutEvent.unsubscribe(this._execHideDelay, this);
-        oMouseOverEvent.unsubscribe(this._cancelHideDelay, this);
-        oKeyDownEvent.unsubscribe(this._cancelHideDelay, this);
+        oMouseOutEvent.unsubscribe(this._execHideDelay);
+        oMouseOverEvent.unsubscribe(this._cancelHideDelay);
+        oKeyDownEvent.unsubscribe(this._cancelHideDelay);
 
         this._bHideDelayEventHandlersAssigned = false;
 
@@ -4237,24 +4275,21 @@
 /**
 * @method configContainer
 * @description Event handler for when the "container" configuration property 
-of the menu changes.
+* of the menu changes.
 * @param {String} p_sType String representing the name of the event that 
 * was fired.
 * @param {Array} p_aArgs Array of arguments sent when the event was fired.
 * @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that 
 * fired the event.
 */
-configContainer: function(p_sType, p_aArgs, p_oMenu) {
+configContainer: function (p_sType, p_aArgs, p_oMenu) {
 
 	var oElement = p_aArgs[0];
 
-	if(typeof oElement == 'string') {
+	if (typeof oElement == 'string') {
 
-        this.cfg.setProperty(
-                "container", 
-                document.getElementById(oElement), 
-                true
-            );
+        this.cfg.setProperty("container", document.getElementById(oElement), 
+                true);
 
 	}
 
@@ -4273,7 +4308,7 @@
 * "maxheight" configuration property.
 * @private
 */
-_setMaxHeight: function(p_sType, p_aArgs, p_nMaxHeight) {
+_setMaxHeight: function (p_sType, p_aArgs, p_nMaxHeight) {
 
     this.cfg.setProperty("maxheight", p_nMaxHeight);
     this.renderEvent.unsubscribe(this._setMaxHeight);
@@ -4291,17 +4326,32 @@
 * @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired
 * the event.
 */
-configMaxHeight: function(p_sType, p_aArgs, p_oMenu) {
+configMaxHeight: function (p_sType, p_aArgs, p_oMenu) {
 
     var nMaxHeight = p_aArgs[0],
-        oBody = this.body;
+        oElement = this.element,
+        oBody = this.body,
+        oHeader = this.header,
+        oFooter = this.footer,
+        fnMouseOver = this._onScrollTargetMouseOver,
+        fnMouseOut = this._onScrollTargetMouseOut,
+        nMinScrollHeight = this.cfg.getProperty("minscrollheight"),
+        nHeight,
+        nOffsetWidth;
+
+
+    if (nMaxHeight !== 0 && nMaxHeight < nMinScrollHeight) {
+    
+        nMaxHeight = nMinScrollHeight;
+    
+    }
 
 
-    if(this.lazyLoad && !oBody) {
+    if (this.lazyLoad && !oBody) {
 
         this.renderEvent.unsubscribe(this._setMaxHeight);
     
-        if(nMaxHeight > 0) {
+        if (nMaxHeight > 0) {
 
             this.renderEvent.subscribe(this._setMaxHeight, nMaxHeight, this);
 
@@ -4311,129 +4361,408 @@
     
     }
 
-    Dom.setStyle(oBody, "height", "auto");
-    Dom.setStyle(oBody, "overflow", "visible");    
 
-    var oHeader = this.header,
-        oFooter = this.footer,
-        fnMouseOver = this._onScrollTargetMouseOver,
-        fnMouseOut = this._onScrollTargetMouseOut;
+    Dom.setStyle(oBody, "height", "");
+    Dom.removeClass(oBody, "yui-menu-body-scrolled");
 
 
-    if((nMaxHeight > 0) && (oBody.offsetHeight > nMaxHeight)) {
+    /*
+        There is a bug in gecko-based browsers where an element whose 
+        "position" property is set to "absolute" and "overflow" property is set 
+        to "hidden" will not render at the correct width when its 
+        offsetParent's "position" property is also set to "absolute."  It is 
+        possible to work around this bug by specifying a value for the width 
+        property in addition to overflow.
+    */
 
-        if(!this.cfg.getProperty("width")) {
+    if (UA.gecko && this.parent && this.parent.parent && 
+        this.parent.parent.cfg.getProperty("position") == "dynamic" && 
+        !this.cfg.getProperty("width")) {
 
-            this._setWidth();
+        nOffsetWidth = oElement.offsetWidth;
 
-        }
+        /*
+            Measuring the difference of the offsetWidth before and after
+            setting the "width" style attribute allows us to compute the 
+            about of padding and borders applied to the element, which in 
+            turn allows us to set the "width" property correctly.
+        */
+        
+        oElement.style.width = nOffsetWidth + "px";
+        oElement.style.width = 
+                (nOffsetWidth - (oElement.offsetWidth - nOffsetWidth)) + "px";
+
+    }
 
-        if(!oHeader && !oFooter) {
 
-            this.setHeader("&#32;");
-            this.setFooter("&#32;");
+    if (!oHeader && !oFooter) {
 
-            oHeader = this.header;
-            oFooter = this.footer;
+        this.setHeader("&#32;");
+        this.setFooter("&#32;");
 
-            Dom.addClass(oHeader, "topscrollbar");
-            Dom.addClass(oFooter, "bottomscrollbar");
-            
-            this.element.insertBefore(oHeader, oBody);
-            this.element.appendChild(oFooter);
+        oHeader = this.header;
+        oFooter = this.footer;
 
-            Event.on(oHeader, "mouseover", fnMouseOver, this, true);
-            Event.on(oHeader, "mouseout", fnMouseOut, this, true);
-            Event.on(oFooter, "mouseover", fnMouseOver, this, true);
-            Event.on(oFooter, "mouseout", fnMouseOut, this, true);
+        Dom.addClass(oHeader, "topscrollbar");
+        Dom.addClass(oFooter, "bottomscrollbar");
         
-        }
+        oElement.insertBefore(oHeader, oBody);
+        oElement.appendChild(oFooter);
+    
+    }
+
+
+    nHeight = (nMaxHeight - (oHeader.offsetHeight + oHeader.offsetHeight));
 
-        var nHeight = 
 
-                (
-                    nMaxHeight - 
-                    (this.footer.offsetHeight + this.header.offsetHeight)
-                );
 
+    if (nHeight > 0 && (oBody.offsetHeight > nMaxHeight)) {
+
+        Dom.addClass(oBody, "yui-menu-body-scrolled");
         Dom.setStyle(oBody, "height", (nHeight + "px"));
-        Dom.setStyle(oBody, "overflow", "hidden");
+
+        Event.on(oHeader, "mouseover", fnMouseOver, this, true);
+        Event.on(oHeader, "mouseout", fnMouseOut, this, true);
+        Event.on(oFooter, "mouseover", fnMouseOver, this, true);
+        Event.on(oFooter, "mouseout", fnMouseOut, this, true);
+
+        this._disableScrollHeader();
+        this._enableScrollFooter();
 
     }
-    else if(oHeader && oFooter) {
+    else if (oHeader && oFooter) {
 
-        Dom.setStyle(oBody, "height", "auto");
-        Dom.setStyle(oBody, "overflow", "visible");
+        this._enableScrollHeader();
+        this._enableScrollFooter();
 
         Event.removeListener(oHeader, "mouseover", fnMouseOver);
         Event.removeListener(oHeader, "mouseout", fnMouseOut);
         Event.removeListener(oFooter, "mouseover", fnMouseOver);
         Event.removeListener(oFooter, "mouseout", fnMouseOut);
 
-        this.element.removeChild(oHeader);
-        this.element.removeChild(oFooter);
+        oElement.removeChild(oHeader);
+        oElement.removeChild(oFooter);
+
+        this.header = null;
+        this.footer = null;
+    
+    }
+
+    this.cfg.refireEvent("iframe");
+
+},
+
+
+/**
+* @method configClassName
+* @description Event handler for when the "classname" configuration property of 
+* a menu changes.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.
+*/
+configClassName: function (p_sType, p_aArgs, p_oMenu) {
+
+    var sClassName = p_aArgs[0];
+
+    if (this._sClassName) {
+
+        Dom.removeClass(this.element, this._sClassName);
+
+    }
+
+    Dom.addClass(this.element, sClassName);
+    this._sClassName = sClassName;
+
+},
+
+
+/**
+* @method _onItemAdded
+* @description "itemadded" event handler for a Menu instance.
+* @private
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event 
+* was fired.
+*/
+_onItemAdded: function (p_sType, p_aArgs) {
+
+    var oItem = p_aArgs[0];
+    
+    if (oItem) {
+
+        oItem.cfg.setProperty("disabled", true);
+    
+    }
+
+},
+
+
+/**
+* @method configDisabled
+* @description Event handler for when the "disabled" configuration property of 
+* a menu changes.
+* @param {String} p_sType The name of the event that was fired.
+* @param {Array} p_aArgs Collection of arguments sent when the event was fired.
+* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.
+*/
+configDisabled: function (p_sType, p_aArgs, p_oMenu) {
+
+    var bDisabled = p_aArgs[0],
+        aItems = this.getItems(),
+        nItems,
+        i;
+
+    if (Lang.isArray(aItems)) {
+
+        nItems = aItems.length;
+    
+        if (nItems > 0) {
+        
+            i = nItems - 1;
+    
+            do {
+    
+                aItems[i].cfg.setProperty("disabled", bDisabled);
+            
+            }
+            while (i--);
+        
+        }
+
+
+        if (bDisabled) {
+
+            this.clearActiveItem(true);
+
+            Dom.addClass(this.element, "disabled");
+
+            this.itemAddedEvent.subscribe(this._onItemAdded);
+
+        }
+        else {
+
+            Dom.removeClass(this.element, "disabled");
+
+            this.itemAddedEvent.unsubscribe(this._onItemAdded);
+
+        }
+        
+    }
+
+},
+
+
+/**
+* @method onRender
+* @description "render" event handler for the menu.
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+*/
+onRender: function (p_sType, p_aArgs) {
+
+    function sizeShadow() {
+
+        var oElement = this.element,
+            oShadow = this._shadow;
+    
+        if (oShadow && oElement) {
+
+            oShadow.style.width = (oElement.offsetWidth + 6) + "px";
+            oShadow.style.height = (oElement.offsetHeight + 1) + "px";
+            
+        }
+    
+    }
+
+
+    function replaceShadow() {
+
+        this.element.appendChild(this._shadow);
+
+    }
+
+
+    function addShadowVisibleClass() {
+    
+        Dom.addClass(this._shadow, "yui-menu-shadow-visible");
+    
+    }
+    
+
+    function removeShadowVisibleClass() {
+
+        Dom.removeClass(this._shadow, "yui-menu-shadow-visible");
+    
+    }
+
+
+    function createShadow() {
+
+        var oShadow = this._shadow,
+            oElement,
+            me;
+
+        if (!oShadow) {
+
+            oElement = this.element;
+            me = this;
+
+            if (!m_oShadowTemplate) {
+
+                m_oShadowTemplate = document.createElement("div");
+                m_oShadowTemplate.className = 
+                    "yui-menu-shadow yui-menu-shadow-visible";
+            
+            }
+
+            oShadow = m_oShadowTemplate.cloneNode(false);
+
+            oElement.appendChild(oShadow);
+            
+            this._shadow = oShadow;
+
+            this.beforeShowEvent.subscribe(addShadowVisibleClass);
+            this.beforeHideEvent.subscribe(removeShadowVisibleClass);
+
+            if (UA.ie) {
+        
+                /*
+                     Need to call sizeShadow & syncIframe via setTimeout for 
+                     IE 7 Quirks Mode and IE 6 Standards Mode and Quirks Mode 
+                     or the shadow and iframe shim will not be sized and 
+                     positioned properly.
+                */
+        
+                window.setTimeout(function () { 
+        
+                    sizeShadow.call(me); 
+                    me.syncIframe();
+        
+                }, 0);
+
+                this.cfg.subscribeToConfigEvent("width", sizeShadow);
+                this.cfg.subscribeToConfigEvent("height", sizeShadow);
+                this.cfg.subscribeToConfigEvent("maxheight", sizeShadow);
+                this.changeContentEvent.subscribe(sizeShadow);
+
+                Module.textResizeEvent.subscribe(sizeShadow, me, true);
+                
+                this.destroyEvent.subscribe(function () {
+                
+                    Module.textResizeEvent.unsubscribe(sizeShadow, me);
+                
+                });
+        
+            }
+
+            this.cfg.subscribeToConfigEvent("maxheight", replaceShadow);
+
+        }
+
+    }
+
+
+    function onBeforeShow() {
     
-        this.header = null;
-        this.footer = null;
+        createShadow.call(this);
+
+        this.beforeShowEvent.unsubscribe(onBeforeShow);
     
     }
 
-},
-
-
-/**
-* @method configClassName
-* @description Event handler for when the "classname" configuration property of 
-* a menu changes.
-* @param {String} p_sType The name of the event that was fired.
-* @param {Array} p_aArgs Collection of arguments sent when the event was fired.
-* @param {YAHOO.widget.Menu} p_oMenu The Menu instance fired the event.
-*/
-configClassName: function(p_sType, p_aArgs, p_oMenu) {
 
-    var sClassName = p_aArgs[0];
+    if (this.cfg.getProperty("position") == "dynamic") {
 
-    if(this._sClassName) {
+        if (this.cfg.getProperty("visible")) {
 
-        Dom.removeClass(this.element, this._sClassName);
+            createShadow.call(this);
+        
+        }
+        else {
 
+            this.beforeShowEvent.subscribe(onBeforeShow);
+        
+        }
+    
     }
 
-    Dom.addClass(this.element, sClassName);
-    this._sClassName = sClassName;
-
 },
 
 
-
 // Public methods
 
 
-
 /**
 * @method initEvents
 * @description Initializes the custom events for the menu.
 */
-initEvents: function() {
+initEvents: function () {
 
-	YAHOO.widget.Menu.superclass.initEvents.call(this);
+	Menu.superclass.initEvents.call(this);
 
     // Create custom events
 
-    var EVENT_TYPES = YAHOO.widget.Menu._EVENT_TYPES;
+    var SIGNATURE = CustomEvent.LIST;
+
+    this.mouseOverEvent = this.createEvent(EVENT_TYPES.MOUSE_OVER);
+    this.mouseOverEvent.signature = SIGNATURE;
+
+    this.mouseOutEvent = this.createEvent(EVENT_TYPES.MOUSE_OUT);
+    this.mouseOutEvent.signature = SIGNATURE;
+    
+    this.mouseDownEvent = this.createEvent(EVENT_TYPES.MOUSE_DOWN);
+    this.mouseDownEvent.signature = SIGNATURE;
+
+    this.mouseUpEvent = this.createEvent(EVENT_TYPES.MOUSE_UP);
+    this.mouseUpEvent.signature = SIGNATURE;
+    
+    this.clickEvent = this.createEvent(EVENT_TYPES.CLICK);
+    this.clickEvent.signature = SIGNATURE;
+    
+    this.keyPressEvent = this.createEvent(EVENT_TYPES.KEY_PRESS);
+    this.keyPressEvent.signature = SIGNATURE;
+    
+    this.keyDownEvent = this.createEvent(EVENT_TYPES.KEY_DOWN);
+    this.keyDownEvent.signature = SIGNATURE;
+    
+    this.keyUpEvent = this.createEvent(EVENT_TYPES.KEY_UP);
+    this.keyUpEvent.signature = SIGNATURE;
+    
+    this.focusEvent = this.createEvent(EVENT_TYPES.FOCUS);
+    this.focusEvent.signature = SIGNATURE;
+    
+    this.blurEvent = this.createEvent(EVENT_TYPES.BLUR);
+    this.blurEvent.signature = SIGNATURE;
+    
+    this.itemAddedEvent = this.createEvent(EVENT_TYPES.ITEM_ADDED);
+    this.itemAddedEvent.signature = SIGNATURE;
+    
+    this.itemRemovedEvent = this.createEvent(EVENT_TYPES.ITEM_REMOVED);
+    this.itemRemovedEvent.signature = SIGNATURE;
+
+},
+
+
+/**
+* @method positionOffScreen
+* @description Positions the menu outside of the boundaries of the browser's 
+* viewport.  Called automatically when a menu is hidden to ensure that 
+* it doesn't force the browser to render uncessary scrollbars.
+*/
+positionOffScreen: function () {
+
+    var oIFrame = this.iframe,
+        aPos = this.OFF_SCREEN_POSITION;
 
-    this.mouseOverEvent = new CustomEvent(EVENT_TYPES.MOUSE_OVER, this);
-    this.mouseOutEvent = new CustomEvent(EVENT_TYPES.MOUSE_OUT, this);
-    this.mouseDownEvent = new CustomEvent(EVENT_TYPES.MOUSE_DOWN, this);
-    this.mouseUpEvent = new CustomEvent(EVENT_TYPES.MOUSE_UP, this);
-    this.clickEvent = new CustomEvent(EVENT_TYPES.CLICK, this);
-    this.keyPressEvent = new CustomEvent(EVENT_TYPES.KEY_PRESS, this);
-    this.keyDownEvent = new CustomEvent(EVENT_TYPES.KEY_DOWN, this);
-    this.keyUpEvent = new CustomEvent(EVENT_TYPES.KEY_UP, this);
-    this.focusEvent = new CustomEvent(EVENT_TYPES.FOCUS, this);
-    this.blurEvent = new CustomEvent(EVENT_TYPES.BLUR, this);
-    this.itemAddedEvent = new CustomEvent(EVENT_TYPES.ITEM_ADDED, this);
-    this.itemRemovedEvent = new CustomEvent(EVENT_TYPES.ITEM_REMOVED, this);
+    Dom.setXY(this.element, aPos);
+    
+    if (oIFrame) {
+
+        Dom.setXY(oIFrame, aPos);
+    
+    }
 
 },
 
@@ -4442,13 +4771,14 @@
 * @method getRoot
 * @description Finds the menu's root menu.
 */
-getRoot: function() {
+getRoot: function () {
 
-    var oItem = this.parent;
+    var oItem = this.parent,
+        oParentMenu;
 
-    if(oItem) {
+    if (oItem) {
 
-        var oParentMenu = oItem.parent;
+        oParentMenu = oItem.parent;
 
         return oParentMenu ? oParentMenu.getRoot() : this;
 
@@ -4467,9 +4797,18 @@
 * @description Returns a string representing the menu.
 * @return {String}
 */
-toString: function() {
+toString: function () {
+
+    var sReturnVal = "Menu",
+        sId = this.id;
+
+    if (sId) {
 
-    return ("Menu " + this.id);
+        sReturnVal += (" " + sId);
+    
+    }
+
+    return sReturnVal;
 
 },
 
@@ -4481,15 +4820,20 @@
 * @param {Number} p_nGroupIndex Optional. Number specifying the group to which
 * the title belongs.
 */
-setItemGroupTitle: function(p_sGroupTitle, p_nGroupIndex) {
+setItemGroupTitle: function (p_sGroupTitle, p_nGroupIndex) {
+
+    var nGroupIndex,
+        oTitle,
+        i,
+        nFirstIndex;
         
-    if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {
+    if (typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {
 
-        var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,
-            oTitle = this._aGroupTitleElements[nGroupIndex];
+        nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;
+        oTitle = this._aGroupTitleElements[nGroupIndex];
 
 
-        if(oTitle) {
+        if (oTitle) {
 
             oTitle.innerHTML = p_sGroupTitle;
             
@@ -4505,12 +4849,11 @@
         }
 
 
-        var i = this._aGroupTitleElements.length - 1,
-            nFirstIndex;
+        i = this._aGroupTitleElements.length - 1;
 
         do {
 
-            if(this._aGroupTitleElements[i]) {
+            if (this._aGroupTitleElements[i]) {
 
                 Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");
 
@@ -4522,15 +4865,15 @@
         while(i--);
 
 
-        if(nFirstIndex !== null) {
+        if (nFirstIndex !== null) {
 
-            Dom.addClass(
-                this._aGroupTitleElements[nFirstIndex], 
-                "first-of-type"
-            );
+            Dom.addClass(this._aGroupTitleElements[nFirstIndex], 
+                "first-of-type");
 
         }
 
+        this.changeContentEvent.fire();
+
     }
 
 },
@@ -4550,9 +4893,9 @@
 * which the item belongs.
 * @return {YAHOO.widget.MenuItem}
 */
-addItem: function(p_oItem, p_nGroupIndex) {
+addItem: function (p_oItem, p_nGroupIndex) {
 
-    if(p_oItem) {
+    if (p_oItem) {
 
         return this._addItemToGroup(p_nGroupIndex, p_oItem);
         
@@ -4572,22 +4915,25 @@
 * which the items belongs.
 * @return {Array}
 */
-addItems: function(p_aItems, p_nGroupIndex) {
+addItems: function (p_aItems, p_nGroupIndex) {
 
-    if(Lang.isArray(p_aItems)) {
+    var nItems,
+        aItems,
+        oItem,
+        i;
 
-        var nItems = p_aItems.length,
-            aItems = [],
-            oItem;
+    if (Lang.isArray(p_aItems)) {
 
+        nItems = p_aItems.length;
+        aItems = [];
 
-        for(var i=0; i<nItems; i++) {
+        for(i=0; i<nItems; i++) {
 
             oItem = p_aItems[i];
 
-            if(oItem) {
+            if (oItem) {
 
-                if(Lang.isArray(oItem)) {
+                if (Lang.isArray(oItem)) {
     
                     aItems[aItems.length] = this.addItems(oItem, i);
     
@@ -4604,7 +4950,7 @@
         }
 
 
-        if(aItems.length) {
+        if (aItems.length) {
         
             return aItems;
         
@@ -4630,9 +4976,9 @@
 * the item belongs.
 * @return {YAHOO.widget.MenuItem}
 */
-insertItem: function(p_oItem, p_nItemIndex, p_nGroupIndex) {
+insertItem: function (p_oItem, p_nItemIndex, p_nGroupIndex) {
     
-    if(p_oItem) {
+    if (p_oItem) {
 
         return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);
 
@@ -4652,24 +4998,24 @@
 * which the item belongs.
 * @return {YAHOO.widget.MenuItem}
 */
-removeItem: function(p_oObject, p_nGroupIndex) {
-    
-    if(typeof p_oObject != "undefined") {
+removeItem: function (p_oObject, p_nGroupIndex) {
 
-        var oItem;
+    var oItem;
+    
+    if (typeof p_oObject != "undefined") {
 
-        if(p_oObject instanceof YAHOO.widget.MenuItem) {
+        if (p_oObject instanceof YAHOO.widget.MenuItem) {
 
             oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);           
 
         }
-        else if(typeof p_oObject == "number") {
+        else if (typeof p_oObject == "number") {
 
             oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);
 
         }
 
-        if(oItem) {
+        if (oItem) {
 
             oItem.destroy();
 
@@ -4688,15 +5034,20 @@
 * @description Returns an array of all of the items in the menu.
 * @return {Array}
 */
-getItems: function() {
+getItems: function () {
 
     var aGroups = this._aItemGroups,
+        nGroups,
+        aItems = [];
+
+    if (Lang.isArray(aGroups)) {
+
         nGroups = aGroups.length;
 
-    return (
-                (nGroups == 1) ? aGroups[0] : 
-                    (Array.prototype.concat.apply([], aGroups))
-            );
+        return ((nGroups == 1) ? aGroups[0] : 
+                    (Array.prototype.concat.apply(aItems, aGroups)));
+
+    }
 
 },
 
@@ -4707,7 +5058,7 @@
 * are grouped in the menu.
 * @return {Array}
 */        
-getItemGroups: function() {
+getItemGroups: function () {
 
     return this._aItemGroups;
 
@@ -4723,13 +5074,15 @@
 * the item belongs.
 * @return {YAHOO.widget.MenuItem}
 */
-getItem: function(p_nItemIndex, p_nGroupIndex) {
+getItem: function (p_nItemIndex, p_nGroupIndex) {
+    
+    var aGroup;
     
-    if(typeof p_nItemIndex == "number") {
+    if (typeof p_nItemIndex == "number") {
 
-        var aGroup = this._getItemGroup(p_nGroupIndex);
+        aGroup = this._getItemGroup(p_nGroupIndex);
 
-        if(aGroup) {
+        if (aGroup) {
 
             return aGroup[p_nItemIndex];
         
@@ -4741,49 +5094,91 @@
 
 
 /**
+* @method getSubmenus
+* @description Returns an array of all of the submenus that are immediate 
+* children of the menu.
+* @return {Array}
+*/
+getSubmenus: function () {
+
+    var aItems = this.getItems(),
+        nItems = aItems.length,
+        aSubmenus,
+        oSubmenu,
+        oItem,
+        i;
+
+
+    if (nItems > 0) {
+        
+        aSubmenus = [];
+
+        for(i=0; i<nItems; i++) {
+
+            oItem = aItems[i];
+            
+            if (oItem) {
+
+                oSubmenu = oItem.cfg.getProperty("submenu");
+                
+                if (oSubmenu) {
+
+                    aSubmenus[aSubmenus.length] = oSubmenu;
+
+                }
+            
+            }
+        
+        }
+    
+    }
+
+    return aSubmenus;
+
+},
+
+
+/**
 * @method clearContent
 * @description Removes all of the content from the menu, including the menu 
 * items, group titles, header and footer.
 */
-clearContent: function() {
+clearContent: function () {
 
     var aItems = this.getItems(),
         nItems = aItems.length,
         oElement = this.element,
         oBody = this.body,
         oHeader = this.header,
-        oFooter = this.footer;
+        oFooter = this.footer,
+        oItem,
+        oSubmenu,
+        i;
 
 
-    if(nItems > 0) {
+    if (nItems > 0) {
 
-        var i = nItems - 1,
-            oItem,
-            oSubmenu;
+        i = nItems - 1;
 
         do {
 
             oItem = aItems[i];
 
-            if(oItem) {
+            if (oItem) {
 
                 oSubmenu = oItem.cfg.getProperty("submenu");
 
-                if(oSubmenu) {
+                if (oSubmenu) {
 
                     this.cfg.configChangedEvent.unsubscribe(
-                                this._onParentMenuConfigChange, 
-                                oSubmenu
-                            );
+                        this._onParentMenuConfigChange, oSubmenu);
 
-                    this.renderEvent.unsubscribe(
-                                        this._onParentMenuRender, 
-                                        oSubmenu
-                                    );
+                    this.renderEvent.unsubscribe(this._onParentMenuRender, 
+                        oSubmenu);
 
                 }
-
-                oItem.destroy();
+                
+                this.removeItem(oItem);
 
             }
         
@@ -4793,7 +5188,7 @@
     }
 
 
-    if(oHeader) {
+    if (oHeader) {
 
         Event.purgeElement(oHeader);
         oElement.removeChild(oHeader);
@@ -4801,14 +5196,14 @@
     }
     
 
-    if(oFooter) {
+    if (oFooter) {
 
         Event.purgeElement(oFooter);
         oElement.removeChild(oFooter);
     }
 
 
-    if(oBody) {
+    if (oBody) {
 
         Event.purgeElement(oBody);
 
@@ -4816,11 +5211,12 @@
 
     }
 
+    this.activeItem = null;
 
     this._aItemGroups = [];
     this._aListElements = [];
     this._aGroupTitleElements = [];
-    
+
     this.cfg.setProperty("width", null);
 
 },
@@ -4831,47 +5227,12 @@
 * @description Removes the menu's <code>&#60;div&#62;</code> element 
 * (and accompanying child nodes) from the document.
 */
-destroy: function() {
-
-    // Remove all DOM event listeners
-
-    Event.purgeElement(this.element);
-
-
-    // Remove Custom Event listeners
-
-    this.mouseOverEvent.unsubscribeAll();
-    this.mouseOutEvent.unsubscribeAll();
-    this.mouseDownEvent.unsubscribeAll();
-    this.mouseUpEvent.unsubscribeAll();
-    this.clickEvent.unsubscribeAll();
-    this.keyPressEvent.unsubscribeAll();
-    this.keyDownEvent.unsubscribeAll();
-    this.keyUpEvent.unsubscribeAll();
-    this.focusEvent.unsubscribeAll();
-    this.blurEvent.unsubscribeAll();
-    this.itemAddedEvent.unsubscribeAll();
-    this.itemRemovedEvent.unsubscribeAll();
-    this.cfg.unsubscribeFromConfigEvent("width", this._onWidthChange);
-    this.cfg.unsubscribeFromConfigEvent("visible", this._onVisibleChange);
-
-    if (this._hasSetWidthHandlers) {
-
-        this.itemAddedEvent.unsubscribe(this._setWidth);
-        this.itemRemovedEvent.unsubscribe(this._setWidth);
-
-        this._hasSetWidthHandlers = false;
-
-    }
-
-    YAHOO.widget.Module.textResizeEvent.unsubscribe(this._onTextResize, this);
-
+destroy: function () {
 
     // Remove all items
 
     this.clearContent();
 
-
     this._aItemGroups = null;
     this._aListElements = null;
     this._aGroupTitleElements = null;
@@ -4879,7 +5240,7 @@
 
     // Continue with the superclass implementation of this method
 
-    YAHOO.widget.Menu.superclass.destroy.call(this);
+    Menu.superclass.destroy.call(this);
     
 
 },
@@ -4889,7 +5250,7 @@
 * @method setInitialFocus
 * @description Sets focus to the menu's first enabled item.
 */
-setInitialFocus: function() {
+setInitialFocus: function () {
 
     var oItem = this._getFirstEnabledItem();
     
@@ -4907,11 +5268,11 @@
 * @description Sets the "selected" configuration property of the menu's first 
 * enabled item to "true."
 */
-setInitialSelection: function() {
+setInitialSelection: function () {
 
     var oItem = this._getFirstEnabledItem();
     
-    if(oItem) {
+    if (oItem) {
     
         oItem.cfg.setProperty("selected", true);
     }        
@@ -4926,22 +5287,24 @@
 * @param {Boolean} p_bBlur Boolean indicating if the menu's active item 
 * should be blurred.  
 */
-clearActiveItem: function(p_bBlur) {
+clearActiveItem: function (p_bBlur) {
 
-    if(this.cfg.getProperty("showdelay") > 0) {
+    if (this.cfg.getProperty("showdelay") > 0) {
     
         this._cancelShowDelay();
     
     }
 
 
-    var oActiveItem = this.activeItem;
+    var oActiveItem = this.activeItem,
+        oConfig,
+        oSubmenu;
 
-    if(oActiveItem) {
+    if (oActiveItem) {
 
-        var oConfig = oActiveItem.cfg;
+        oConfig = oActiveItem.cfg;
 
-        if(p_bBlur) {
+        if (p_bBlur) {
 
             oActiveItem.blur();
         
@@ -4949,9 +5312,9 @@
 
         oConfig.setProperty("selected", false);
 
-        var oSubmenu = oConfig.getProperty("submenu");
+        oSubmenu = oConfig.getProperty("submenu");
 
-        if(oSubmenu) {
+        if (oSubmenu) {
 
             oSubmenu.hide();
 
@@ -4968,7 +5331,7 @@
 * @method focus
 * @description Causes the menu to receive focus and fires the "focus" event.
 */
-focus: function() {
+focus: function () {
 
     if (!this.hasFocus()) {
 
@@ -4983,11 +5346,13 @@
 * @method blur
 * @description Causes the menu to lose focus and fires the "blur" event.
 */    
-blur: function() {
+blur: function () {
+
+    var oItem;
 
     if (this.hasFocus()) {
     
-        var oItem = YAHOO.widget.MenuManager.getFocusedMenuItem();
+        oItem = MenuManager.getFocusedMenuItem();
         
         if (oItem) {
 
@@ -5005,9 +5370,95 @@
 * @description Returns a boolean indicating whether or not the menu has focus.
 * @return {Boolean}
 */
-hasFocus: function() {
+hasFocus: function () {
+
+    return (MenuManager.getFocusedMenu() == this.getRoot());
+
+},
+
+
+/**
+* Adds the specified CustomEvent subscriber to the menu and each of 
+* its submenus.
+* @method subscribe
+* @param p_type     {string}   the type, or name of the event
+* @param p_fn       {function} the function to exectute when the event fires
+* @param p_obj      {Object}   An object to be passed along when the event 
+*                              fires
+* @param p_override {boolean}  If true, the obj passed in becomes the 
+*                              execution scope of the listener
+*/
+subscribe: function () {
+
+    function onItemAdded(p_sType, p_aArgs, p_oObject) {
+
+        var oItem = p_aArgs[0],
+            oSubmenu = oItem.cfg.getProperty("submenu");
+
+        if (oSubmenu) {
+
+            oSubmenu.subscribe.apply(oSubmenu, p_oObject);
+
+        }
+    
+    }
+
+
+    function onSubmenuAdded(p_sType, p_aArgs, p_oObject) { 
+    
+        var oSubmenu = this.cfg.getProperty("submenu");
+        
+        if (oSubmenu) {
+
+            oSubmenu.subscribe.apply(oSubmenu, p_oObject);
+        
+        }
+    
+    }
+
+
+    Menu.superclass.subscribe.apply(this, arguments);
+    Menu.superclass.subscribe.call(this, "itemAdded", onItemAdded, arguments);
+
+
+    var aItems = this.getItems(),
+        nItems,
+        oItem,
+        oSubmenu,
+        i;
+        
+
+    if (aItems) {
+
+        nItems = aItems.length;
+        
+        if (nItems > 0) {
+        
+            i = nItems - 1;
+            
+            do {
+
+                oItem = aItems[i];
+                
+                oSubmenu = oItem.cfg.getProperty("submenu");
+                
+                if (oSubmenu) {
+                
+                    oSubmenu.subscribe.apply(oSubmenu, arguments);
+                
+                }
+                else {
+                
+                    oItem.cfg.subscribeToConfigEvent("submenu", onSubmenuAdded, arguments);
+                
+                }
+
+            }
+            while (i--);
+        
+        }
 
-    return (YAHOO.widget.MenuManager.getFocusedMenu() == this.getRoot());
+    }
 
 },
 
@@ -5017,12 +5468,103 @@
 * changed using the menu's Config object ("cfg").
 * @method initDefaultConfig
 */
-initDefaultConfig: function() {
+initDefaultConfig: function () {
+
+    Menu.superclass.initDefaultConfig.call(this);
+
+    var oConfig = this.cfg;
+
+
+    // Module documentation overrides
+
+    /**
+    * @config effect
+    * @description Object or array of objects representing the ContainerEffect 
+    * classes that are active for animating the container.  When set this 
+    * property is automatically applied to all submenus.
+    * @type Object
+    * @default null
+    */
+
+    // Overlay documentation overrides
+
+
+    /**
+    * @config x
+    * @description Number representing the absolute x-coordinate position of 
+    * the Menu.  This property is only applied when the "position" 
+    * configuration property is set to dynamic.
+    * @type Number
+    * @default null
+    */
+    
+
+    /**
+    * @config y
+    * @description Number representing the absolute y-coordinate position of 
+    * the Menu.  This property is only applied when the "position" 
+    * configuration property is set to dynamic.
+    * @type Number
+    * @default null
+    */
+
+
+    /**
+    * @description Array of the absolute x and y positions of the Menu.  This 
+    * property is only applied when the "position" configuration property is 
+    * set to dynamic.
+    * @config xy
+    * @type Number[]
+    * @default null
+    */
+    
 
-    YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);
+    /**
+    * @config context
+    * @description Array of context arguments for context-sensitive positioning.  
+    * The format is: [id or element, element corner, context corner]. 
+    * For example, setting this property to ["img1", "tl", "bl"] would 
+    * align the Mnu's top left corner to the context element's 
+    * bottom left corner.  This property is only applied when the "position" 
+    * configuration property is set to dynamic.
+    * @type Array
+    * @default null
+    */
+    
+    
+    /**
+    * @config fixedcenter
+    * @description Boolean indicating if the Menu should be anchored to the 
+    * center of the viewport.  This property is only applied when the 
+    * "position" configuration property is set to dynamic.
+    * @type Boolean
+    * @default false
+    */
+
+    
+    /**
+    * @config zindex
+    * @description Number representing the CSS z-index of the Menu.  This 
+    * property is only applied when the "position" configuration property is 
+    * set to dynamic.
+    * @type Number
+    * @default null
+    */
+    
+    
+    /**
+    * @config iframe
+    * @description Boolean indicating whether or not the Menu should 
+    * have an IFRAME shim; used to prevent SELECT elements from 
+    * poking through an Overlay instance in IE6.  When set to "true", 
+    * the iframe shim is created when the Menu instance is intially
+    * made visible.  This property is only applied when the "position" 
+    * configuration property is set to dynamic and is automatically applied 
+    * to all submenus.
+    * @type Boolean
+    * @default true for IE6 and below, false for all other browsers.
+    */
 
-    var oConfig = this.cfg,
-        DEFAULT_CONFIG = YAHOO.widget.Menu._DEFAULT_CONFIG;
 
 	// Add configuration attributes
 
@@ -5062,7 +5604,9 @@
     /**
     * @config constraintoviewport
     * @description Boolean indicating if the menu will try to remain inside 
-    * the boundaries of the size of viewport.
+    * the boundaries of the size of viewport.  This property is only applied 
+    * when the "position" configuration property is set to dynamic and is 
+    * automatically applied to all submenus.
     * @default true
     * @type Boolean
     */
@@ -5111,7 +5655,8 @@
     oConfig.addProperty(
         DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
         { 
-            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value 
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value,
+            suppressEvent: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.suppressEvent
         }
     );
 
@@ -5127,7 +5672,8 @@
 	   DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
 	   { 
 	       value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
-	       validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+	       validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator,
+	       suppressEvent: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.suppressEvent
        } 
     );
 
@@ -5136,7 +5682,9 @@
     * @config showdelay
     * @description Number indicating the time (in milliseconds) that should 
     * expire before a submenu is made visible when the user mouses over 
-    * the menu's items.
+    * the menu's items.  This property is only applied when the "position" 
+    * configuration property is set to dynamic and is automatically applied 
+    * to all submenus.
     * @default 250
     * @type Number
     */
@@ -5144,7 +5692,8 @@
 	   DEFAULT_CONFIG.SHOW_DELAY.key, 
 	   { 
 	       value: DEFAULT_CONFIG.SHOW_DELAY.value, 
-	       validator: DEFAULT_CONFIG.SHOW_DELAY.validator
+	       validator: DEFAULT_CONFIG.SHOW_DELAY.validator,
+	       suppressEvent: DEFAULT_CONFIG.SHOW_DELAY.suppressEvent
        } 
     );
 
@@ -5152,7 +5701,9 @@
     /**
     * @config hidedelay
     * @description Number indicating the time (in milliseconds) that should 
-    * expire before the menu is hidden.
+    * expire before the menu is hidden.  This property is only applied when 
+    * the "position" configuration property is set to dynamic and is 
+    * automatically applied to all submenus.
     * @default 0
     * @type Number
     */
@@ -5173,6 +5724,8 @@
     * expire before a submenu is hidden when the user mouses out of a menu item 
     * heading in the direction of a submenu.  The value must be greater than or 
     * equal to the value specified for the "showdelay" configuration property.
+    * This property is only applied when the "position" configuration property 
+    * is set to dynamic and is automatically applied to all submenus.
     * @default 250
     * @type Number
     */
@@ -5180,7 +5733,8 @@
 	   DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.key, 
 	   { 
 	       value: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.value, 
-	       validator: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator
+	       validator: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.validator,
+	       suppressEvent: DEFAULT_CONFIG.SUBMENU_HIDE_DELAY.suppressEvent
        } 
     );
 
@@ -5188,7 +5742,9 @@
     /**
     * @config clicktohide
     * @description Boolean indicating if the menu will automatically be 
-    * hidden if the user clicks outside of it.
+    * hidden if the user clicks outside of it.  This property is only 
+    * applied when the "position" configuration property is set to dynamic 
+    * and is automatically applied to all submenus.
     * @default true
     * @type Boolean
     */
@@ -5196,7 +5752,8 @@
         DEFAULT_CONFIG.CLICK_TO_HIDE.key,
         {
             value: DEFAULT_CONFIG.CLICK_TO_HIDE.value,
-            validator: DEFAULT_CONFIG.CLICK_TO_HIDE.validator
+            validator: DEFAULT_CONFIG.CLICK_TO_HIDE.validator,
+            suppressEvent: DEFAULT_CONFIG.CLICK_TO_HIDE.suppressEvent
         }
     );
 
@@ -5214,15 +5771,58 @@
 	   DEFAULT_CONFIG.CONTAINER.key, 
 	   { 
 	       handler: this.configContainer,
-	       value: document.body
+	       value: document.body,
+           suppressEvent: DEFAULT_CONFIG.CONTAINER.suppressEvent
        } 
    );
 
 
     /**
+    * @config scrollincrement
+    * @description Number used to control the scroll speed of a menu.  Used to 
+    * increment the "scrollTop" property of the menu's body by when a menu's 
+    * content is scrolling.  When set this property is automatically applied 
+    * to all submenus.
+    * @default 1
+    * @type Number
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.SCROLL_INCREMENT.key, 
+        { 
+            value: DEFAULT_CONFIG.SCROLL_INCREMENT.value, 
+            validator: DEFAULT_CONFIG.SCROLL_INCREMENT.validator,
+            supercedes: DEFAULT_CONFIG.SCROLL_INCREMENT.supercedes,
+            suppressEvent: DEFAULT_CONFIG.SCROLL_INCREMENT.suppressEvent
+        }
+    );
+
+
+    /**
+    * @config minscrollheight
+    * @description Number defining the minimum threshold for the "maxheight" 
+    * configuration property.  When set this property is automatically applied 
+    * to all submenus.
+    * @default 90
+    * @type Number
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.key, 
+        { 
+            value: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.value, 
+            validator: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.validator,
+            supercedes: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.supercedes,
+            suppressEvent: DEFAULT_CONFIG.MIN_SCROLL_HEIGHT.suppressEvent
+        }
+    );
+
+
+    /**
     * @config maxheight
-    * @description Defines the maximum height (in pixels) for a menu before the
-    * contents of the body are scrolled.
+    * @description Number defining the maximum height (in pixels) for a menu's 
+    * body element (<code>&#60;div class="bd"&#60;</code>).  Once a menu's body 
+    * exceeds this height, the contents of the body are scrolled to maintain 
+    * this value.  This value cannot be set lower than the value of the 
+    * "minscrollheight" configuration property.
     * @default 0
     * @type Number
     */
@@ -5231,26 +5831,51 @@
        {
             handler: this.configMaxHeight,
             value: DEFAULT_CONFIG.MAX_HEIGHT.value,
-            validator: DEFAULT_CONFIG.MAX_HEIGHT.validator
+            validator: DEFAULT_CONFIG.MAX_HEIGHT.validator,
+            suppressEvent: DEFAULT_CONFIG.MAX_HEIGHT.suppressEvent,
+            supercedes: DEFAULT_CONFIG.MAX_HEIGHT.supercedes            
        } 
     );
 
 
     /**
     * @config classname
-    * @description CSS class to be applied to the menu's root 
-    * <code>&#60;div&#62;</code> element.  The specified class(es) are 
-    * appended in addition to the default class as specified by the menu's
-    * CSS_CLASS_NAME constant.
+    * @description String representing the CSS class to be applied to the 
+    * menu's root <code>&#60;div&#62;</code> element.  The specified class(es)  
+    * are appended in addition to the default class as specified by the menu's
+    * CSS_CLASS_NAME constant. When set this property is automatically 
+    * applied to all submenus.
     * @default null
     * @type String
     */
     oConfig.addProperty(
-        DEFAULT_CONFIG.CLASS_NAME.key, 
+        DEFAULT_CONFIG.CLASS_NAME.key, 
+        { 
+            handler: this.configClassName,
+            value: DEFAULT_CONFIG.CLASS_NAME.value, 
+            validator: DEFAULT_CONFIG.CLASS_NAME.validator,
+            supercedes: DEFAULT_CONFIG.CLASS_NAME.supercedes      
+        }
+    );
+
+
+    /**
+    * @config disabled
+    * @description Boolean indicating if the menu should be disabled.  
+    * Disabling a menu disables each of its items.  (Disabled menu items are 
+    * dimmed and will not respond to user input or fire events.)  Disabled
+    * menus have a corresponding "disabled" CSS class applied to their root
+    * <code>&#60;div&#62;</code> element.
+    * @default false
+    * @type Boolean
+    */
+    oConfig.addProperty(
+        DEFAULT_CONFIG.DISABLED.key, 
         { 
-            handler: this.configClassName,
-            value: DEFAULT_CONFIG.CLASS_NAME.value, 
-            validator: DEFAULT_CONFIG.CLASS_NAME.validator
+            handler: this.configDisabled,
+            value: DEFAULT_CONFIG.DISABLED.value, 
+            validator: DEFAULT_CONFIG.DISABLED.validator,
+            suppressEvent: DEFAULT_CONFIG.DISABLED.suppressEvent
         }
     );
 
@@ -5262,13 +5887,8 @@
 
 
 
-(function() {
+(function () {
 
-var Dom = YAHOO.util.Dom,
-    Module = YAHOO.widget.Module,
-    Menu = YAHOO.widget.Menu,
-    CustomEvent = YAHOO.util.CustomEvent,
-    Lang = YAHOO.lang;
 
 /**
 * Creates an item for a menu.
@@ -5289,11 +5909,11 @@
 * @class MenuItem
 * @constructor
 */
-YAHOO.widget.MenuItem = function(p_oObject, p_oConfig) {
+YAHOO.widget.MenuItem = function (p_oObject, p_oConfig) {
 
-    if(p_oObject) {
+    if (p_oObject) {
 
-        if(p_oConfig) {
+        if (p_oConfig) {
     
             this.parent = p_oConfig.parent;
             this.value = p_oConfig.value;
@@ -5308,188 +5928,155 @@
 };
 
 
-/**
-* Constant representing the name of the MenuItem's events
-* @property YAHOO.widget.MenuItem._EVENT_TYPES
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.MenuItem._EVENT_TYPES = {
-
-    "MOUSE_OVER": "mouseover",
-    "MOUSE_OUT": "mouseout",
-    "MOUSE_DOWN": "mousedown",
-    "MOUSE_UP": "mouseup",
-    "CLICK": "click",
-    "KEY_PRESS": "keypress",
-    "KEY_DOWN": "keydown",
-    "KEY_UP": "keyup",
-    "ITEM_ADDED": "itemAdded",
-    "ITEM_REMOVED": "itemRemoved",
-    "FOCUS": "focus",
-    "BLUR": "blur",
-    "DESTROY": "destroy"
-
-};
-
-
-/**
-* Constant representing the MenuItem's configuration properties
-* @property YAHOO.widget.MenuItem._DEFAULT_CONFIG
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.MenuItem._DEFAULT_CONFIG = {
-
-    "TEXT": { 
-        key: "text", 
-        value: "", 
-        validator: Lang.isString, 
-        suppressEvent: true 
-    }, 
-
-    "HELP_TEXT": { 
-        key: "helptext" 
-    },
-
-    "URL": { 
-        key: "url", 
-        value: "#", 
-        suppressEvent: true 
-    }, 
-
-    "TARGET": { 
-        key: "target", 
-        suppressEvent: true 
-    }, 
-
-    "EMPHASIS": { 
-        key: "emphasis", 
-        value: false, 
-        validator: Lang.isBoolean, 
-        suppressEvent: true 
-    }, 
-
-    "STRONG_EMPHASIS": { 
-        key: "strongemphasis", 
-        value: false, 
-        validator: Lang.isBoolean, 
-        suppressEvent: true 
-    },
-
-    "CHECKED": { 
-        key: "checked", 
-        value: false, 
-        validator: Lang.isBoolean, 
-        suppressEvent: true, 
-        supercedes:["disabled"]
-    }, 
-
-    "DISABLED": { 
-        key: "disabled", 
-        value: false, 
-        validator: Lang.isBoolean, 
-        suppressEvent: true
-    },
-
-    "SELECTED": { 
-        key: "selected", 
-        value: false, 
-        validator: Lang.isBoolean, 
-        suppressEvent: true
-    },
-
-    "SUBMENU": { 
-        key: "submenu"
-    },
-
-    "ONCLICK": { 
-        key: "onclick"
-    },
-
-    "CLASS_NAME": { 
-        key: "classname", 
-        value: null, 
-        validator: Lang.isString
-    }
-
-};
-
-
-YAHOO.widget.MenuItem.prototype = {
-
-    // Constants
+var Dom = YAHOO.util.Dom,
+    Module = YAHOO.widget.Module,
+    Menu = YAHOO.widget.Menu,
+    MenuItem = YAHOO.widget.MenuItem,
+    CustomEvent = YAHOO.util.CustomEvent,
+    Lang = YAHOO.lang,
 
+    m_oMenuItemTemplate,
 
     /**
-    * @property COLLAPSED_SUBMENU_INDICATOR_TEXT
-    * @description String representing the text for the <code>&#60;em&#62;</code>
-    * element used for the submenu arrow indicator.
-    * @default "Submenu collapsed.  Click to expand submenu."
+    * Constant representing the name of the MenuItem's events
+    * @property EVENT_TYPES
+    * @private
     * @final
-    * @type String
+    * @type Object
     */
-    COLLAPSED_SUBMENU_INDICATOR_TEXT: 
-        "Submenu collapsed.  Click to expand submenu.",
-
+    EVENT_TYPES = {
+    
+        "MOUSE_OVER": "mouseover",
+        "MOUSE_OUT": "mouseout",
+        "MOUSE_DOWN": "mousedown",
+        "MOUSE_UP": "mouseup",
+        "CLICK": "click",
+        "KEY_PRESS": "keypress",
+        "KEY_DOWN": "keydown",
+        "KEY_UP": "keyup",
+        "ITEM_ADDED": "itemAdded",
+        "ITEM_REMOVED": "itemRemoved",
+        "FOCUS": "focus",
+        "BLUR": "blur",
+        "DESTROY": "destroy"
+    
+    },
 
     /**
-    * @property EXPANDED_SUBMENU_INDICATOR_TEXT
-    * @description String representing the text for the submenu arrow indicator 
-    * element (<code>&#60;em&#62;</code>) when the submenu is visible.
-    * @default "Submenu expanded.  Click to collapse submenu."
+    * Constant representing the MenuItem's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
     * @final
-    * @type String
+    * @type Object
     */
-    EXPANDED_SUBMENU_INDICATOR_TEXT: 
-        "Submenu expanded.  Click to collapse submenu.",
-
+    DEFAULT_CONFIG = {
+    
+        "TEXT": { 
+            key: "text", 
+            value: "", 
+            validator: Lang.isString, 
+            suppressEvent: true 
+        }, 
+    
+        "HELP_TEXT": { 
+            key: "helptext",
+            supercedes: ["text"], 
+            suppressEvent: true 
+        },
+    
+        "URL": { 
+            key: "url", 
+            value: "#", 
+            suppressEvent: true 
+        }, 
+    
+        "TARGET": { 
+            key: "target", 
+            suppressEvent: true 
+        }, 
+    
+        "EMPHASIS": { 
+            key: "emphasis", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true, 
+            supercedes: ["text"]
+        }, 
+    
+        "STRONG_EMPHASIS": { 
+            key: "strongemphasis", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true,
+            supercedes: ["text"]
+        },
+    
+        "CHECKED": { 
+            key: "checked", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true, 
+            supercedes: ["disabled", "selected"]
+        }, 
+
+        "SUBMENU": { 
+            key: "submenu",
+            suppressEvent: true,
+            supercedes: ["disabled", "selected"]
+        },
+    
+        "DISABLED": { 
+            key: "disabled", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true,
+            supercedes: ["text", "selected"]
+        },
+    
+        "SELECTED": { 
+            key: "selected", 
+            value: false, 
+            validator: Lang.isBoolean, 
+            suppressEvent: true
+        },
+    
+        "ONCLICK": { 
+            key: "onclick",
+            suppressEvent: true
+        },
+    
+        "CLASS_NAME": { 
+            key: "classname", 
+            value: null, 
+            validator: Lang.isString,
+            suppressEvent: true
+        }
+    
+    };
 
-    /**
-    * @property DISABLED_SUBMENU_INDICATOR_TEXT
-    * @description String representing the text for the submenu arrow indicator 
-    * element (<code>&#60;em&#62;</code>) when the menu item is disabled.
-    * @default "Submenu collapsed.  (Item disabled.)."
-    * @final
-    * @type String
-    */
-    DISABLED_SUBMENU_INDICATOR_TEXT: "Submenu collapsed.  (Item disabled.)",
 
+MenuItem.prototype = {
 
     /**
-    * @property CHECKED_TEXT
-    * @description String representing the text to be used for the checked 
-    * indicator element (<code>&#60;em&#62;</code>).
-    * @default "Checked."
-    * @final
-    * @type String
-    */
-    CHECKED_TEXT: "Menu item checked.",
-    
-    
-    /**
-    * @property DISABLED_CHECKED_TEXT
-    * @description String representing the text to be used for the checked 
-    * indicator element (<code>&#60;em&#62;</code>) when the menu item 
-    * is disabled.
-    * @default "Checked. (Item disabled.)"
+    * @property CSS_CLASS_NAME
+    * @description String representing the CSS class(es) to be applied to the 
+    * <code>&#60;li&#62;</code> element of the menu item.
+    * @default "yuimenuitem"
     * @final
     * @type String
     */
-    DISABLED_CHECKED_TEXT: "Checked. (Item disabled.)",
+    CSS_CLASS_NAME: "yuimenuitem",
 
 
     /**
-    * @property CSS_CLASS_NAME
+    * @property CSS_LABEL_CLASS_NAME
     * @description String representing the CSS class(es) to be applied to the 
-    * <code>&#60;li&#62;</code> element of the menu item.
-    * @default "yuimenuitem"
+    * menu item's <code>&#60;a&#62;</code> element.
+    * @default "yuimenuitemlabel"
     * @final
     * @type String
     */
-    CSS_CLASS_NAME: "yuimenuitem",
+    CSS_LABEL_CLASS_NAME: "yuimenuitemlabel",
 
 
     /**
@@ -5517,16 +6104,6 @@
     */
     _oAnchor: null,
     
-
-    /**
-    * @property _oText
-    * @description Object reference to the menu item's text node.
-    * @default null
-    * @private
-    * @type TextNode
-    */
-    _oText: null,
-    
     
     /**
     * @property _oHelpTextEM
@@ -5548,18 +6125,6 @@
     * @type YAHOO.widget.Menu
     */
     _oSubmenu: null,
-    
-
-    /**
-    * @property _oCheckedIndicator
-    * @description Object reference to the menu item's checkmark image.
-    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    * @private
-    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    */
-    _oCheckedIndicator: null,
 
 
     /** 
@@ -5593,7 +6158,7 @@
     * @default YAHOO.widget.MenuItem
 	* @type YAHOO.widget.MenuItem
 	*/
-	constructor: YAHOO.widget.MenuItem,
+	constructor: MenuItem,
 
 
     /**
@@ -5665,20 +6230,9 @@
     value: null,
 
 
-    /**
-    * @property submenuIndicator
-    * @description Object reference to the <code>&#60;em&#62;</code> element 
-    * used to create the submenu indicator for the menu item.
-    * @default <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>
-    */
-    submenuIndicator: null,
-
-
 	/**
     * @property browser
+    * @deprecated Use YAHOO.env.ua
 	* @description String representing the browser.
 	* @type String
 	*/
@@ -5818,10 +6372,10 @@
     * configuration for the menu item. See configuration class documentation 
     * for more details.
     */
-    init: function(p_oObject, p_oConfig) {
+    init: function (p_oObject, p_oConfig) {
 
 
-        if(!this.SUBMENU_TYPE) {
+        if (!this.SUBMENU_TYPE) {
     
             this.SUBMENU_TYPE = Menu;
     
@@ -5834,17 +6388,23 @@
 
         this.initDefaultConfig();
 
-        var oConfig = this.cfg;
+        var SIGNATURE = CustomEvent.LIST,
+            oConfig = this.cfg,
+            sURL = "#",
+            oAnchor,
+            sTarget,
+            sText,
+            sId;
 
 
-        if(Lang.isString(p_oObject)) {
+        if (Lang.isString(p_oObject)) {
 
             this._createRootNodeStructure();
 
-            oConfig.setProperty("text", p_oObject);
+            oConfig.queueProperty("text", p_oObject);
 
         }
-        else if(this._checkDOMNode(p_oObject)) {
+        else if (p_oObject && p_oObject.tagName) {
 
             switch(p_oObject.tagName.toUpperCase()) {
 
@@ -5852,7 +6412,10 @@
 
                     this._createRootNodeStructure();
 
-                    oConfig.setProperty("text", p_oObject.text);
+                    oConfig.queueProperty("text", p_oObject.text);
+                    oConfig.queueProperty("disabled", p_oObject.disabled);
+
+                    this.value = p_oObject.value;
 
                     this.srcElement = p_oObject;
 
@@ -5862,7 +6425,8 @@
 
                     this._createRootNodeStructure();
 
-                    oConfig.setProperty("text", p_oObject.label);
+                    oConfig.queueProperty("text", p_oObject.label);
+                    oConfig.queueProperty("disabled", p_oObject.disabled);
 
                     this.srcElement = p_oObject;
 
@@ -5873,95 +6437,24 @@
                 case "LI":
 
                     // Get the anchor node (if it exists)
-
-                    var oAnchor = this._getFirstElement(p_oObject, "A"),
-                        sURL = "#",
-                        sTarget,
-                        sText;
+                    
+                    oAnchor = Dom.getFirstChild(p_oObject);
 
 
                     // Capture the "text" and/or the "URL"
 
-                    if(oAnchor) {
+                    if (oAnchor) {
 
                         sURL = oAnchor.getAttribute("href");
                         sTarget = oAnchor.getAttribute("target");
 
-                        if(oAnchor.innerText) {
-                
-                            sText = oAnchor.innerText;
-                
-                        }
-                        else {
-                
-                            var oRange = oAnchor.ownerDocument.createRange();
-                
-                            oRange.selectNodeContents(oAnchor);
-                
-                            sText = oRange.toString();             
-                
-                        }
-
-                    }
-                    else {
-
-                        var oText = p_oObject.firstChild;
-
-                        sText = oText.nodeValue;
-
-                        oAnchor = document.createElement("a");
-                        
-                        oAnchor.setAttribute("href", sURL);
-
-                        p_oObject.replaceChild(oAnchor, oText);
-                        
-                        oAnchor.appendChild(oText);
+                        sText = oAnchor.innerHTML;
 
                     }
 
-
                     this.srcElement = p_oObject;
                     this.element = p_oObject;
                     this._oAnchor = oAnchor;
-    
-
-                    // Check if emphasis has been applied to the MenuItem
-
-                    var oEmphasisNode = this._getFirstElement(oAnchor),
-                        bEmphasis = false,
-                        bStrongEmphasis = false;
-
-                    if(oEmphasisNode) {
-
-                        // Set a reference to the text node 
-
-                        this._oText = oEmphasisNode.firstChild;
-
-                        switch(oEmphasisNode.tagName.toUpperCase()) {
-
-                            case "EM":
-
-                                bEmphasis = true;
-
-                            break;
-
-                            case "STRONG":
-
-                                bStrongEmphasis = true;
-
-                            break;
-
-                        }
-
-                    }
-                    else {
-
-                        // Set a reference to the text node 
-
-                        this._oText = oAnchor.firstChild;
-
-                    }
-
 
                     /*
                         Set these properties silently to sync up the 
@@ -5972,12 +6465,6 @@
                     oConfig.setProperty("text", sText, true);
                     oConfig.setProperty("url", sURL, true);
                     oConfig.setProperty("target", sTarget, true);
-                    oConfig.setProperty("emphasis", bEmphasis, true);
-                    oConfig.setProperty(
-                        "strongemphasis", 
-                        bStrongEmphasis, 
-                        true
-                    );
 
                     this._initSubTree();
 
@@ -5988,11 +6475,11 @@
         }
 
 
-        if(this.element) {
+        if (this.element) {
 
-            var sId = this.element.id;
+            sId = (this.srcElement || this.element).id;
 
-            if(!sId) {
+            if (!sId) {
 
                 sId = this.id || Dom.generateId();
 
@@ -6004,104 +6491,59 @@
 
 
             Dom.addClass(this.element, this.CSS_CLASS_NAME);
+            Dom.addClass(this._oAnchor, this.CSS_LABEL_CLASS_NAME);
 
 
             // Create custom events
 
-            var EVENT_TYPES = YAHOO.widget.MenuItem._EVENT_TYPES;
+            this.mouseOverEvent = this.createEvent(EVENT_TYPES.MOUSE_OVER);
+            this.mouseOverEvent.signature = SIGNATURE;
 
-            this.mouseOverEvent = new CustomEvent(EVENT_TYPES.MOUSE_OVER, this);
-            this.mouseOutEvent = new CustomEvent(EVENT_TYPES.MOUSE_OUT, this);
-            this.mouseDownEvent = new CustomEvent(EVENT_TYPES.MOUSE_DOWN, this);
-            this.mouseUpEvent = new CustomEvent(EVENT_TYPES.MOUSE_UP, this);
-            this.clickEvent = new CustomEvent(EVENT_TYPES.CLICK, this);
-            this.keyPressEvent = new CustomEvent(EVENT_TYPES.KEY_PRESS, this);
-            this.keyDownEvent = new CustomEvent(EVENT_TYPES.KEY_DOWN, this);
-            this.keyUpEvent = new CustomEvent(EVENT_TYPES.KEY_UP, this);
-            this.focusEvent = new CustomEvent(EVENT_TYPES.FOCUS, this);
-            this.blurEvent = new CustomEvent(EVENT_TYPES.BLUR, this);
-            this.destroyEvent = new CustomEvent(EVENT_TYPES.DESTROY, this);
+            this.mouseOutEvent = this.createEvent(EVENT_TYPES.MOUSE_OUT);
+            this.mouseOutEvent.signature = SIGNATURE;
 
-            if(p_oConfig) {
-    
-                oConfig.applyConfig(p_oConfig);
-    
-            }        
+            this.mouseDownEvent = this.createEvent(EVENT_TYPES.MOUSE_DOWN);
+            this.mouseDownEvent.signature = SIGNATURE;
 
-            oConfig.fireQueue();
+            this.mouseUpEvent = this.createEvent(EVENT_TYPES.MOUSE_UP);
+            this.mouseUpEvent.signature = SIGNATURE;
 
-        }
+            this.clickEvent = this.createEvent(EVENT_TYPES.CLICK);
+            this.clickEvent.signature = SIGNATURE;
 
-    },
+            this.keyPressEvent = this.createEvent(EVENT_TYPES.KEY_PRESS);
+            this.keyPressEvent.signature = SIGNATURE;
 
+            this.keyDownEvent = this.createEvent(EVENT_TYPES.KEY_DOWN);
+            this.keyDownEvent.signature = SIGNATURE;
 
+            this.keyUpEvent = this.createEvent(EVENT_TYPES.KEY_UP);
+            this.keyUpEvent.signature = SIGNATURE;
 
-    // Private methods
+            this.focusEvent = this.createEvent(EVENT_TYPES.FOCUS);
+            this.focusEvent.signature = SIGNATURE;
 
+            this.blurEvent = this.createEvent(EVENT_TYPES.BLUR);
+            this.blurEvent.signature = SIGNATURE;
 
-    /**
-    * @method _getFirstElement
-    * @description Returns an HTML element's first HTML element node.
-    * @private
-    * @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object 
-    * reference specifying the element to be evaluated.
-    * @param {String} p_sTagName Optional. String specifying the tagname of 
-    * the element to be retrieved.
-    * @return {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
-    * level-one-html.html#ID-58190037">HTMLElement</a>}
-    */
-    _getFirstElement: function(p_oElement, p_sTagName) {
-    
-        var oFirstChild = p_oElement.firstChild,
-            oElement;
-    
-        if(oFirstChild) {
-    
-            if(oFirstChild.nodeType == 1) {
-    
-                oElement = oFirstChild;
-    
-            }
-            else {
-    
-                var oNextSibling = oFirstChild.nextSibling;
-    
-                if(oNextSibling && oNextSibling.nodeType == 1) {
-                
-                    oElement = oNextSibling;
-                
-                }
+            this.destroyEvent = this.createEvent(EVENT_TYPES.DESTROY);
+            this.destroyEvent.signature = SIGNATURE;
+
+            if (p_oConfig) {
     
-            }
+                oConfig.applyConfig(p_oConfig);
     
-        }
-
-
-        if(p_sTagName) {
+            }        
 
-            return (oElement && oElement.tagName.toUpperCase() == p_sTagName) ? 
-                oElement : false;
+            oConfig.fireQueue();
 
         }
-        
-        return oElement;
-
-    },    
 
+    },
 
-    /**
-    * @method _checkDOMNode
-    * @description Determines if an object is an HTML element.
-    * @private
-    * @param {Object} p_oObject Object to be evaluated.
-    * @return {Boolean}
-    */
-    _checkDOMNode: function(p_oObject) {
 
-        return (p_oObject && p_oObject.tagName);
 
-    },
+    // Private methods
 
 
     /**
@@ -6111,22 +6553,24 @@
     */
     _createRootNodeStructure: function () {
 
-        var oTemplate = YAHOO.widget.MenuItem._MenuItemTemplate;
-
-        if(!oTemplate) {
+        var oElement,
+            oAnchor;
 
-            oTemplate = document.createElement("li");
-            oTemplate.innerHTML = "<a href=\"#\">s</a>";
+        if (!m_oMenuItemTemplate) {
 
-            YAHOO.widget.MenuItem._MenuItemTemplate = oTemplate;
+            m_oMenuItemTemplate = document.createElement("li");
+            m_oMenuItemTemplate.innerHTML = "<a href=\"#\"></a>";
 
         }
 
-        this.element = oTemplate.cloneNode(true);
-        this._oAnchor = this.element.firstChild;
-        this._oText = this._oAnchor.firstChild;
+        oElement = m_oMenuItemTemplate.cloneNode(true);
+        oElement.className = this.CSS_CLASS_NAME;
 
-        this.element.appendChild(this._oAnchor);
+        oAnchor = oElement.firstChild;
+        oAnchor.className = this.CSS_LABEL_CLASS_NAME;
+        
+        this.element = oElement;
+        this._oAnchor = oAnchor;
 
     },
 
@@ -6137,19 +6581,21 @@
     * the child nodes to instantiate other menus.
     * @private
     */
-    _initSubTree: function() {
+    _initSubTree: function () {
 
         var oSrcEl = this.srcElement,
-            oConfig = this.cfg;
+            oConfig = this.cfg,
+            oNode,
+            aOptions,
+            nOptions,
+            oMenu,
+            n;
 
 
-        if(oSrcEl.childNodes.length > 0) {
+        if (oSrcEl.childNodes.length > 0) {
 
-            if(
-                this.parent.lazyLoad && 
-                this.parent.srcElement && 
-                this.parent.srcElement.tagName.toUpperCase() == "SELECT"
-            ) {
+            if (this.parent.lazyLoad && this.parent.srcElement && 
+                this.parent.srcElement.tagName.toUpperCase() == "SELECT") {
 
                 oConfig.setProperty(
                         "submenu", 
@@ -6159,12 +6605,12 @@
             }
             else {
 
-                var oNode = oSrcEl.firstChild,
-                    aOptions = [];
+                oNode = oSrcEl.firstChild;
+                aOptions = [];
     
                 do {
     
-                    if(oNode && oNode.tagName) {
+                    if (oNode && oNode.tagName) {
     
                         switch(oNode.tagName.toUpperCase()) {
                 
@@ -6188,159 +6634,101 @@
                 while((oNode = oNode.nextSibling));
     
     
-                var nOptions = aOptions.length;
+                nOptions = aOptions.length;
     
-                if(nOptions > 0) {
+                if (nOptions > 0) {
     
-                    var oMenu = new this.SUBMENU_TYPE(Dom.generateId());
+                    oMenu = new this.SUBMENU_TYPE(Dom.generateId());
                     
                     oConfig.setProperty("submenu", oMenu);
     
-                    for(var n=0; n<nOptions; n++) {
+                    for(n=0; n<nOptions; n++) {
         
                         oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));
         
                     }
         
-                }
-            
-            }
-
-        }
-
-    },
-
-
-
-    // Event handlers for configuration properties
-
-
-    /**
-    * @method configText
-    * @description Event handler for when the "text" configuration property of 
-    * the menu item changes.
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
-    * that fired the event.
-    */
-    configText: function(p_sType, p_aArgs, p_oItem) {
-
-        var sText = p_aArgs[0];
-
-
-        if(this._oText) {
-
-            this._oText.nodeValue = sText;
-
-        }
-
-    },
-
-
-    /**
-    * @method configHelpText
-    * @description Event handler for when the "helptext" configuration property 
-    * of the menu item changes.
-    * @param {String} p_sType String representing the name of the event that 
-    * was fired.
-    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
-    * that fired the event.
-    */    
-    configHelpText: function(p_sType, p_aArgs, p_oItem) {
-
-        var me = this,
-            oHelpText = p_aArgs[0],
-            oEl = this.element,
-            oConfig = this.cfg,
-            aNodes = [oEl, this._oAnchor],
-            oSubmenuIndicator = this.submenuIndicator;
-
-
-        function initHelpText() {
-
-            Dom.addClass(aNodes, "hashelptext");
-
-            if(oConfig.getProperty("disabled")) {
-
-                oConfig.refireEvent("disabled");
-
+                }
+            
             }
 
-            if(oConfig.getProperty("selected")) {
-
-                oConfig.refireEvent("selected");
-
-            }                
-
         }
 
+    },
 
-        function removeHelpText() {
-
-            Dom.removeClass(aNodes, "hashelptext");
-
-            oEl.removeChild(me._oHelpTextEM);
-            me._oHelpTextEM = null;
 
-        }
 
+    // Event handlers for configuration properties
 
-        if(this._checkDOMNode(oHelpText)) {
 
-            oHelpText.className = "helptext";
+    /**
+    * @method configText
+    * @description Event handler for when the "text" configuration property of 
+    * the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */
+    configText: function (p_sType, p_aArgs, p_oItem) {
 
-            if(this._oHelpTextEM) {
-            
-                this._oHelpTextEM.parentNode.replaceChild(
-                    oHelpText, 
-                    this._oHelpTextEM
-                );
+        var sText = p_aArgs[0],
+            oConfig = this.cfg,
+            oAnchor = this._oAnchor,
+            sHelpText = oConfig.getProperty("helptext"),
+            sHelpTextHTML = "",
+            sEmphasisStartTag = "",
+            sEmphasisEndTag = "";
 
-            }
-            else {
 
-                this._oHelpTextEM = oHelpText;
+        if (sText) {
 
-                oEl.insertBefore(this._oHelpTextEM, oSubmenuIndicator);
 
+            if (sHelpText) {
+                    
+                sHelpTextHTML = "<em class=\"helptext\">" + sHelpText + "</em>";
+            
             }
 
-            initHelpText();
 
-        }
-        else if(Lang.isString(oHelpText)) {
-
-            if(oHelpText.length === 0) {
+            if (oConfig.getProperty("emphasis")) {
 
-                removeHelpText();
+                sEmphasisStartTag = "<em>";
+                sEmphasisEndTag = "</em>";
 
             }
-            else {
 
-                if(!this._oHelpTextEM) {
 
-                    this._oHelpTextEM = document.createElement("em");
-                    this._oHelpTextEM.className = "helptext";
+            if (oConfig.getProperty("strongemphasis")) {
 
-                    oEl.insertBefore(this._oHelpTextEM, oSubmenuIndicator);
+                sEmphasisStartTag = "<strong>";
+                sEmphasisEndTag = "</strong>";
+            
+            }
 
-                }
 
-                this._oHelpTextEM.innerHTML = oHelpText;
+            oAnchor.innerHTML = (sEmphasisStartTag + sText + 
+                sEmphasisEndTag + sHelpTextHTML);
 
-                initHelpText();
+        }
 
-            }
+    },
 
-        }
-        else if(!oHelpText && this._oHelpTextEM) {
 
-            removeHelpText();
+    /**
+    * @method configHelpText
+    * @description Event handler for when the "helptext" configuration property 
+    * of the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configHelpText: function (p_sType, p_aArgs, p_oItem) {
 
-        }
+        this.cfg.refireEvent("text");
 
     },
 
@@ -6355,17 +6743,25 @@
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configURL: function(p_sType, p_aArgs, p_oItem) {
+    configURL: function (p_sType, p_aArgs, p_oItem) {
 
         var sURL = p_aArgs[0];
 
-        if(!sURL) {
+        if (!sURL) {
 
             sURL = "#";
 
         }
 
-        this._oAnchor.setAttribute("href", sURL);
+        var oAnchor = this._oAnchor;
+
+        if (YAHOO.env.ua.opera) {
+
+            oAnchor.removeAttribute("href");
+        
+        }
+
+        oAnchor.setAttribute("href", sURL);
 
     },
 
@@ -6380,12 +6776,12 @@
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configTarget: function(p_sType, p_aArgs, p_oItem) {
+    configTarget: function (p_sType, p_aArgs, p_oItem) {
 
         var sTarget = p_aArgs[0],
             oAnchor = this._oAnchor;
 
-        if(sTarget && sTarget.length > 0) {
+        if (sTarget && sTarget.length > 0) {
 
             oAnchor.setAttribute("target", sTarget);
 
@@ -6402,112 +6798,116 @@
     /**
     * @method configEmphasis
     * @description Event handler for when the "emphasis" configuration property
-    * of the menu item changes.  
+    * of the menu item changes.
     * @param {String} p_sType String representing the name of the event that 
     * was fired.
     * @param {Array} p_aArgs Array of arguments sent when the event was fired.
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configEmphasis: function(p_sType, p_aArgs, p_oItem) {
+    configEmphasis: function (p_sType, p_aArgs, p_oItem) {
 
         var bEmphasis = p_aArgs[0],
-            oAnchor = this._oAnchor,
-            oText = this._oText,
-            oConfig = this.cfg,
-            oEM;
+            oConfig = this.cfg;
 
 
-        if(bEmphasis && oConfig.getProperty("strongemphasis")) {
+        if (bEmphasis && oConfig.getProperty("strongemphasis")) {
 
             oConfig.setProperty("strongemphasis", false);
 
         }
 
 
-        if(oAnchor) {
+        oConfig.refireEvent("text");
 
-            if(bEmphasis) {
-
-                oEM = document.createElement("em");
-                oEM.appendChild(oText);
-
-                oAnchor.appendChild(oEM);
+    },
 
-            }
-            else {
 
-                oEM = this._getFirstElement(oAnchor, "EM");
+    /**
+    * @method configStrongEmphasis
+    * @description Event handler for when the "strongemphasis" configuration 
+    * property of the menu item changes.
+    * @param {String} p_sType String representing the name of the event that 
+    * was fired.
+    * @param {Array} p_aArgs Array of arguments sent when the event was fired.
+    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
+    * that fired the event.
+    */    
+    configStrongEmphasis: function (p_sType, p_aArgs, p_oItem) {
 
-                if(oEM) {
+        var bStrongEmphasis = p_aArgs[0],
+            oConfig = this.cfg;
 
-                    oAnchor.removeChild(oEM);
-                    oAnchor.appendChild(oText);
 
-                }
+        if (bStrongEmphasis && oConfig.getProperty("emphasis")) {
 
-            }
+            oConfig.setProperty("emphasis", false);
 
         }
 
+        oConfig.refireEvent("text");
+
     },
 
 
     /**
-    * @method configStrongEmphasis
-    * @description Event handler for when the "strongemphasis" configuration 
-    * property of the menu item changes. 
+    * @method configChecked
+    * @description Event handler for when the "checked" configuration property 
+    * of the menu item changes. 
     * @param {String} p_sType String representing the name of the event that 
     * was fired.
     * @param {Array} p_aArgs Array of arguments sent when the event was fired.
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {
+    configChecked: function (p_sType, p_aArgs, p_oItem) {
 
-        var bStrongEmphasis = p_aArgs[0],
+        var bChecked = p_aArgs[0],
+            oElement = this.element,
             oAnchor = this._oAnchor,
-            oText = this._oText,
             oConfig = this.cfg,
-            oStrong;
+            sState = "-checked",
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState;
 
-        if(bStrongEmphasis && oConfig.getProperty("emphasis")) {
 
-            oConfig.setProperty("emphasis", false);
+        if (bChecked) {
+
+            Dom.addClass(oElement, sClassName);
+            Dom.addClass(oAnchor, sLabelClassName);
 
         }
+        else {
 
-        if(oAnchor) {
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
+        
+        }
 
-            if(bStrongEmphasis) {
 
-                oStrong = document.createElement("strong");
-                oStrong.appendChild(oText);
+        oConfig.refireEvent("text");
 
-                oAnchor.appendChild(oStrong);
 
-            }
-            else {
+        if (oConfig.getProperty("disabled")) {
 
-                oStrong = this._getFirstElement(oAnchor, "STRONG");
+            oConfig.refireEvent("disabled");
 
-                if(oStrong) {
+        }
 
-                    oAnchor.removeChild(oStrong);
-                    oAnchor.appendChild(oText);
 
-                }
+        if (oConfig.getProperty("selected")) {
 
-            }
+            oConfig.refireEvent("selected");
 
         }
 
     },
 
 
+
     /**
-    * @method configChecked
-    * @description Event handler for when the "checked" configuration property 
+    * @method configDisabled
+    * @description Event handler for when the "disabled" configuration property 
     * of the menu item changes. 
     * @param {String} p_sType String representing the name of the event that 
     * was fired.
@@ -6515,84 +6915,82 @@
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configChecked: function(p_sType, p_aArgs, p_oItem) {
-    
-        var bChecked = p_aArgs[0],
-            oEl = this.element,
-            oConfig = this.cfg,
-            oEM;
-
+    configDisabled: function (p_sType, p_aArgs, p_oItem) {
 
-        if(bChecked) {
+        var bDisabled = p_aArgs[0],
+            oConfig = this.cfg,
+            oSubmenu = oConfig.getProperty("submenu"),
+            bChecked = oConfig.getProperty("checked"),
+            oElement = this.element,
+            oAnchor = this._oAnchor,
+            sState = "-disabled",
+            sCheckedState = "-checked" + sState,
+            sSubmenuState = "-hassubmenu" + sState,
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState,
+            sCheckedClassName = this.CSS_CLASS_NAME + sCheckedState,
+            sLabelCheckedClassName = this.CSS_LABEL_CLASS_NAME + sCheckedState,
+            sSubmenuClassName = this.CSS_CLASS_NAME + sSubmenuState,
+            sLabelSubmenuClassName = this.CSS_LABEL_CLASS_NAME + sSubmenuState;
 
-            var oTemplate = YAHOO.widget.MenuItem._CheckedIndicatorTemplate;
 
-            if(!oTemplate) {
+        if (bDisabled) {
 
-                oTemplate = document.createElement("em");
-                oTemplate.innerHTML = this.CHECKED_TEXT;
-                oTemplate.className = "checkedindicator";
+            if (oConfig.getProperty("selected")) {
 
-                YAHOO.widget.MenuItem._CheckedIndicatorTemplate = oTemplate;
+                oConfig.setProperty("selected", false);
 
             }
 
-            oEM = oTemplate.cloneNode(true);
-
-            var oSubmenu = this.cfg.getProperty("submenu");
-
-            if(oSubmenu && oSubmenu.element) {
+            Dom.addClass(oElement, sClassName);
+            Dom.addClass(oAnchor, sLabelClassName);
 
-                oEl.insertBefore(oEM, oSubmenu.element);
 
-            }
-            else {
-
-                oEl.appendChild(oEM);
+            if (oSubmenu) {
 
+                Dom.addClass(oElement, sSubmenuClassName);
+                Dom.addClass(oAnchor, sLabelSubmenuClassName);
+            
             }
+            
 
+            if (bChecked) {
 
-            Dom.addClass(oEl, "checked");
-
-            this._oCheckedIndicator = oEM;
-
-            if(oConfig.getProperty("disabled")) {
-
-                oConfig.refireEvent("disabled");
+                Dom.addClass(oElement, sCheckedClassName);
+                Dom.addClass(oAnchor, sLabelCheckedClassName);
 
             }
 
-            if(oConfig.getProperty("selected")) {
-
-                oConfig.refireEvent("selected");
-
-            }
-        
         }
         else {
 
-            oEM = this._oCheckedIndicator;
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
 
-            Dom.removeClass(oEl, "checked");
 
-            if(oEM) {
+            if (oSubmenu) {
+
+                Dom.removeClass(oElement, sSubmenuClassName);
+                Dom.removeClass(oAnchor, sLabelSubmenuClassName);
+            
+            }
+            
+
+            if (bChecked) {
 
-                oEl.removeChild(oEM);
+                Dom.removeClass(oElement, sCheckedClassName);
+                Dom.removeClass(oAnchor, sLabelCheckedClassName);
 
             }
 
-            this._oCheckedIndicator = null;
-        
         }
 
     },
 
 
-
     /**
-    * @method configDisabled
-    * @description Event handler for when the "disabled" configuration property 
+    * @method configSelected
+    * @description Event handler for when the "selected" configuration property 
     * of the menu item changes. 
     * @param {String} p_sType String representing the name of the event that 
     * was fired.
@@ -6600,133 +6998,116 @@
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */    
-    configDisabled: function(p_sType, p_aArgs, p_oItem) {
+    configSelected: function (p_sType, p_aArgs, p_oItem) {
 
-        var bDisabled = p_aArgs[0],
-            oConfig = this.cfg,
+        var oConfig = this.cfg,
+            bSelected = p_aArgs[0],
+            oElement = this.element,
             oAnchor = this._oAnchor,
-            aNodes = [this.element, oAnchor],
-            oHelpText = this._oHelpTextEM,
-            oCheckedIndicator = this._oCheckedIndicator,
-            oSubmenuIndicator = this.submenuIndicator,
-            i = 1;
+            bChecked = oConfig.getProperty("checked"),
+            oSubmenu = oConfig.getProperty("submenu"),
+            sState = "-selected",
+            sCheckedState = "-checked" + sState,
+            sSubmenuState = "-hassubmenu" + sState,
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState,
+            sCheckedClassName = this.CSS_CLASS_NAME + sCheckedState,
+            sLabelCheckedClassName = this.CSS_LABEL_CLASS_NAME + sCheckedState,
+            sSubmenuClassName = this.CSS_CLASS_NAME + sSubmenuState,
+            sLabelSubmenuClassName = this.CSS_LABEL_CLASS_NAME + sSubmenuState;
 
 
-        if(oHelpText) {
-
-            i++;
-            aNodes[i] = oHelpText;
+        if (YAHOO.env.ua.opera) {
 
+            oAnchor.blur();
+        
         }
 
 
-        if(oCheckedIndicator) {
-            
-            oCheckedIndicator.firstChild.nodeValue = bDisabled ? 
-                this.DISABLED_CHECKED_TEXT : 
-                this.CHECKED_TEXT;
+        if (bSelected && !oConfig.getProperty("disabled")) {
 
-            i++;
-            aNodes[i] = oCheckedIndicator;
+            Dom.addClass(oElement, sClassName);
+            Dom.addClass(oAnchor, sLabelClassName);
+
+
+            if (oSubmenu) {
+
+                Dom.addClass(oElement, sSubmenuClassName);
+                Dom.addClass(oAnchor, sLabelSubmenuClassName);
             
-        }    
+            }
 
 
-        if(oSubmenuIndicator) {
+            if (bChecked) {
 
-            oSubmenuIndicator.firstChild.nodeValue = bDisabled ? 
-                this.DISABLED_SUBMENU_INDICATOR_TEXT : 
-                this.COLLAPSED_SUBMENU_INDICATOR_TEXT;
+                Dom.addClass(oElement, sCheckedClassName);
+                Dom.addClass(oAnchor, sLabelCheckedClassName);
 
-            i++;
-            aNodes[i] = oSubmenuIndicator;
-        
-        }
+            }
 
+        }
+        else {
 
-        if(bDisabled) {
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
 
-            if(oConfig.getProperty("selected")) {
 
-                oConfig.setProperty("selected", false);
+            if (oSubmenu) {
 
+                Dom.removeClass(oElement, sSubmenuClassName);
+                Dom.removeClass(oAnchor, sLabelSubmenuClassName);
+            
             }
 
-            oAnchor.removeAttribute("href");
+        
+            if (bChecked) {
 
-            Dom.addClass(aNodes, "disabled");
+                Dom.removeClass(oElement, sCheckedClassName);
+                Dom.removeClass(oAnchor, sLabelCheckedClassName);
 
-        }
-        else {
+            }
 
-            oAnchor.setAttribute("href", oConfig.getProperty("url"));
+        }
 
-            Dom.removeClass(aNodes, "disabled");
 
+        if (this.hasFocus() && YAHOO.env.ua.opera) {
+        
+            oAnchor.focus();
+        
         }
 
     },
 
 
     /**
-    * @method configSelected
-    * @description Event handler for when the "selected" configuration property 
-    * of the menu item changes. 
+    * @method _onSubmenuBeforeHide
+    * @description "beforehide" Custom Event handler for a submenu.
+    * @private
     * @param {String} p_sType String representing the name of the event that 
     * was fired.
     * @param {Array} p_aArgs Array of arguments sent when the event was fired.
-    * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
-    * that fired the event.
-    */    
-    configSelected: function(p_sType, p_aArgs, p_oItem) {
-
-        if(!this.cfg.getProperty("disabled")) {
-
-            var bSelected = p_aArgs[0],
-                oHelpText = this._oHelpTextEM,
-                oSubmenuIndicator = this.submenuIndicator,
-                oCheckedIndicator = this._oCheckedIndicator,
-                aNodes = [this.element, this._oAnchor],
-                i = 1;
-
-
-            if(oHelpText) {
-    
-                i++;
-                aNodes[i] = oHelpText;
-    
-            }
-            
-
-            if(oSubmenuIndicator) {
-
-                i++;
-                aNodes[i] = oSubmenuIndicator;
+    */
+    _onSubmenuBeforeHide: function (p_sType, p_aArgs) {
 
-            }
+        var oItem = this.parent,
+            oMenu;
 
+        function onHide() {
 
-            if(oCheckedIndicator) {
+            oItem._oAnchor.blur();
+            oMenu.beforeHideEvent.unsubscribe(onHide);
+        
+        }
 
-                i++;
-                aNodes[i] = oCheckedIndicator;
-            
-            }
 
+        if (oItem.hasFocus()) {
 
-            if(bSelected) {
-    
-                Dom.addClass(aNodes, "selected");
-    
-            }
-            else {
-    
-                Dom.removeClass(aNodes, "selected");
-    
-            }
+            oMenu = oItem.parent;
 
+            oMenu.beforeHideEvent.subscribe(onHide);
+        
         }
-
+    
     },
 
 
@@ -6740,34 +7121,35 @@
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configSubmenu: function(p_sType, p_aArgs, p_oItem) {
+    configSubmenu: function (p_sType, p_aArgs, p_oItem) {
 
-        var oEl = this.element,
-            oSubmenu = p_aArgs[0],
-            oSubmenuIndicator = this.submenuIndicator,
+        var oSubmenu = p_aArgs[0],
             oConfig = this.cfg,
-            aNodes = [this.element, this._oAnchor],
+            oElement = this.element,
+            oAnchor = this._oAnchor,
             bLazyLoad = this.parent && this.parent.lazyLoad,
-            oMenu;
+            sState = "-hassubmenu",
+            sClassName = this.CSS_CLASS_NAME + sState,
+            sLabelClassName = this.CSS_LABEL_CLASS_NAME + sState,
+            oMenu,
+            sSubmenuId,
+            oSubmenuConfig;
 
 
-        if(oSubmenu) {
+        if (oSubmenu) {
 
-            if(oSubmenu instanceof Menu) {
+            if (oSubmenu instanceof Menu) {
 
                 oMenu = oSubmenu;
                 oMenu.parent = this;
                 oMenu.lazyLoad = bLazyLoad;
 
             }
-            else if(
-                typeof oSubmenu == "object" && 
-                oSubmenu.id && 
-                !oSubmenu.nodeType
-            ) {
+            else if (typeof oSubmenu == "object" && oSubmenu.id && 
+                !oSubmenu.nodeType) {
 
-                var sSubmenuId = oSubmenu.id,
-                    oSubmenuConfig = oSubmenu;
+                sSubmenuId = oSubmenu.id;
+                oSubmenuConfig = oSubmenu;
 
                 oSubmenuConfig.lazyload = bLazyLoad;
                 oSubmenuConfig.parent = this;
@@ -6776,118 +7158,63 @@
 
 
                 // Set the value of the property to the Menu instance
-                
-                this.cfg.setProperty("submenu", oMenu, true);
+
+                oConfig.setProperty("submenu", oMenu, true);
 
             }
             else {
 
-                oMenu = new this.SUBMENU_TYPE(
-                                oSubmenu,
-                                { lazyload: bLazyLoad, parent: this }                
-                            );
+                oMenu = new this.SUBMENU_TYPE(oSubmenu,
+                                { lazyload: bLazyLoad, parent: this });
 
 
                 // Set the value of the property to the Menu instance
                 
-                this.cfg.setProperty("submenu", oMenu, true);
+                oConfig.setProperty("submenu", oMenu, true);
 
             }
 
 
-            if(oMenu) {
-
-                this._oSubmenu = oMenu;
-
-
-                if(!oSubmenuIndicator) { 
+            if (oMenu) {
 
-                    var oTemplate = 
-                            YAHOO.widget.MenuItem._oSubmenuIndicatorTemplate;
+                Dom.addClass(oElement, sClassName);
+                Dom.addClass(oAnchor, sLabelClassName);
 
-                    if(!oTemplate) {
-                   
-                        oTemplate = document.createElement("em");
-                        oTemplate.innerHTML =  
-                            this.COLLAPSED_SUBMENU_INDICATOR_TEXT;
-                        oTemplate.className = "submenuindicator";
-                        
-                        YAHOO.widget.MenuItem._oSubmenuIndicatorTemplate = 
-                            oTemplate;
-
-                    }
-
-
-                    oSubmenuIndicator = oTemplate.cloneNode(true);
-
-
-                    if(oMenu.element.parentNode == oEl) {
-
-                        if(this.browser == "opera") {
-
-                            oEl.appendChild(oSubmenuIndicator);
-                            
-                            oMenu.renderEvent.subscribe(function() {
+                this._oSubmenu = oMenu;
 
-                                oSubmenuIndicator.parentNode.insertBefore(
-                                                            oSubmenuIndicator, 
-                                                            oMenu.element
-                                                        );
-                            
-                            });
+                if (YAHOO.env.ua.opera) {
                 
-                        }
-                        else {
-
-                            oEl.insertBefore(oSubmenuIndicator, oMenu.element);
-                        
-                        }
+                    oMenu.beforeHideEvent.subscribe(this._onSubmenuBeforeHide);               
                 
-                    }
-                    else {
-
-                        oEl.appendChild(oSubmenuIndicator);
-                    
-                    }
-
-                    this.submenuIndicator = oSubmenuIndicator;
-
                 }
+            
+            }
 
+        }
+        else {
 
-                Dom.addClass(aNodes, "hassubmenu");
-
-
-                if(oConfig.getProperty("disabled")) {
-
-                    oConfig.refireEvent("disabled");
-
-                }
+            Dom.removeClass(oElement, sClassName);
+            Dom.removeClass(oAnchor, sLabelClassName);
 
-                if(oConfig.getProperty("selected")) {
+            if (this._oSubmenu) {
 
-                    oConfig.refireEvent("selected");
+                this._oSubmenu.destroy();
 
-                }                
-            
             }
 
         }
-        else {
 
-            Dom.removeClass(aNodes, "hassubmenu");
 
-            if(oSubmenuIndicator) {
+        if (oConfig.getProperty("disabled")) {
 
-                oEl.removeChild(oSubmenuIndicator);
+            oConfig.refireEvent("disabled");
 
-            }
+        }
 
-            if(this._oSubmenu) {
 
-                this._oSubmenu.destroy();
+        if (oConfig.getProperty("selected")) {
 
-            }
+            oConfig.refireEvent("selected");
 
         }
 
@@ -6904,7 +7231,7 @@
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configOnClick: function(p_sType, p_aArgs, p_oItem) {
+    configOnClick: function (p_sType, p_aArgs, p_oItem) {
 
         var oObject = p_aArgs[0];
 
@@ -6913,32 +7240,23 @@
             already been specified.
         */
 
-        if(
-            this._oOnclickAttributeValue && 
-            (this._oOnclickAttributeValue != oObject)
-        ) {
-
-            this.clickEvent.unsubscribe(
-                                this._oOnclickAttributeValue.fn, 
-                                this._oOnclickAttributeValue.obj
-                            );
+        if (this._oOnclickAttributeValue && 
+            (this._oOnclickAttributeValue != oObject)) {
+
+            this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn, 
+                                this._oOnclickAttributeValue.obj);
 
             this._oOnclickAttributeValue = null;
 
         }
 
 
-        if(
-            !this._oOnclickAttributeValue && 
-            typeof oObject == "object" && 
-            typeof oObject.fn == "function"
-        ) {
-
-            this.clickEvent.subscribe(
-                    oObject.fn, 
-                    (oObject.obj || this), 
-                    oObject.scope
-                );
+        if (!this._oOnclickAttributeValue && typeof oObject == "object" && 
+            typeof oObject.fn == "function") {
+            
+            this.clickEvent.subscribe(oObject.fn, 
+                ((!YAHOO.lang.isUndefined(oObject.obj)) ? oObject.obj : this), 
+                oObject.scope);
 
             this._oOnclickAttributeValue = oObject;
 
@@ -6957,11 +7275,11 @@
     * @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item
     * that fired the event.
     */
-    configClassName: function(p_sType, p_aArgs, p_oItem) {
+    configClassName: function (p_sType, p_aArgs, p_oItem) {
     
         var sClassName = p_aArgs[0];
     
-        if(this._sClassName) {
+        if (this._sClassName) {
     
             Dom.removeClass(this.element, this._sClassName);
     
@@ -6981,10 +7299,9 @@
     * @method initDefaultConfig
 	* @description Initializes an item's configurable properties.
 	*/
-	initDefaultConfig : function() {
+	initDefaultConfig : function () {
 
-        var oConfig = this.cfg,
-            DEFAULT_CONFIG = YAHOO.widget.MenuItem._DEFAULT_CONFIG;
+        var oConfig = this.cfg;
 
 
         // Define the configuration attributes
@@ -7011,7 +7328,10 @@
         /**
         * @config helptext
         * @description String specifying additional instructional text to 
-        * accompany the text for the nenu item.
+        * accompany the text for the menu item.
+        * @deprecated Use "text" configuration property to add help text markup.  
+        * For example: <code>oMenuItem.cfg.setProperty("text", "Copy &#60;em 
+        * class=\"helptext\"&#62;Ctrl + C&#60;/em&#60;");</code>
         * @default null
         * @type String|<a href="http://www.w3.org/TR/
         * 2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-58190037">
@@ -7019,7 +7339,11 @@
         */
         oConfig.addProperty(
             DEFAULT_CONFIG.HELP_TEXT.key,
-            { handler: this.configHelpText }
+            {
+                handler: this.configHelpText, 
+                supercedes: DEFAULT_CONFIG.HELP_TEXT.supercedes,
+                suppressEvent: DEFAULT_CONFIG.HELP_TEXT.suppressEvent 
+            }
         );
 
 
@@ -7064,8 +7388,10 @@
         /**
         * @config emphasis
         * @description Boolean indicating if the text of the menu item will be 
-        * rendered with emphasis.  When building a menu from existing HTML the 
-        * value of this property will be interpreted from the menu's markup.
+        * rendered with emphasis.
+        * @deprecated Use "text" configuration property to add emphasis.  
+        * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;em&#62;Some 
+        * Text&#60;/em&#60;");</code>
         * @default false
         * @type Boolean
         */
@@ -7075,7 +7401,8 @@
                 handler: this.configEmphasis, 
                 value: DEFAULT_CONFIG.EMPHASIS.value, 
                 validator: DEFAULT_CONFIG.EMPHASIS.validator, 
-                suppressEvent: DEFAULT_CONFIG.EMPHASIS.suppressEvent 
+                suppressEvent: DEFAULT_CONFIG.EMPHASIS.suppressEvent,
+                supercedes: DEFAULT_CONFIG.EMPHASIS.supercedes
             }
         );
 
@@ -7083,9 +7410,10 @@
         /**
         * @config strongemphasis
         * @description Boolean indicating if the text of the menu item will be 
-        * rendered with strong emphasis.  When building a menu from existing 
-        * HTML the value of this property will be interpreted from the
-        * menu's markup.
+        * rendered with strong emphasis.
+        * @deprecated Use "text" configuration property to add strong emphasis.  
+        * For example: <code>oMenuItem.cfg.setProperty("text", "&#60;strong&#62; 
+        * Some Text&#60;/strong&#60;");</code>
         * @default false
         * @type Boolean
         */
@@ -7095,7 +7423,8 @@
                 handler: this.configStrongEmphasis,
                 value: DEFAULT_CONFIG.STRONG_EMPHASIS.value,
                 validator: DEFAULT_CONFIG.STRONG_EMPHASIS.validator,
-                suppressEvent: DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent
+                suppressEvent: DEFAULT_CONFIG.STRONG_EMPHASIS.suppressEvent,
+                supercedes: DEFAULT_CONFIG.STRONG_EMPHASIS.supercedes
             }
         );
 
@@ -7174,14 +7503,18 @@
         */
         oConfig.addProperty(
             DEFAULT_CONFIG.SUBMENU.key, 
-            { handler: this.configSubmenu }
+            {
+                handler: this.configSubmenu, 
+                supercedes: DEFAULT_CONFIG.SUBMENU.supercedes,
+                suppressEvent: DEFAULT_CONFIG.SUBMENU.suppressEvent
+            }
         );
 
 
         /**
         * @config onclick
         * @description Object literal representing the code to be executed when 
-        * the button is clicked.  Format:<br> <code> {<br> 
+        * the item is clicked.  Format:<br> <code> {<br> 
         * <strong>fn:</strong> Function,   &#47;&#47; The handler to call when 
         * the event fires.<br> <strong>obj:</strong> Object, &#47;&#47; An 
         * object to  pass back to the handler.<br> <strong>scope:</strong> 
@@ -7192,7 +7525,10 @@
         */
         oConfig.addProperty(
             DEFAULT_CONFIG.ONCLICK.key, 
-            { handler: this.configOnClick }
+            {
+                handler: this.configOnClick, 
+                suppressEvent: DEFAULT_CONFIG.ONCLICK.suppressEvent 
+            }
         );
 
 
@@ -7210,7 +7546,8 @@
             { 
                 handler: this.configClassName,
                 value: DEFAULT_CONFIG.CLASS_NAME.value, 
-                validator: DEFAULT_CONFIG.CLASS_NAME.validator
+                validator: DEFAULT_CONFIG.CLASS_NAME.validator,
+                suppressEvent: DEFAULT_CONFIG.CLASS_NAME.suppressEvent 
             }
         );
 
@@ -7222,37 +7559,36 @@
     * @description Finds the menu item's next enabled sibling.
     * @return YAHOO.widget.MenuItem
     */
-    getNextEnabledSibling: function() {
+    getNextEnabledSibling: function () {
 
-        if(this.parent instanceof Menu) {
+        var nGroupIndex,
+            aItemGroups,
+            oNextItem,
+            nNextGroupIndex,
+            aNextGroup;
 
-            var nGroupIndex = this.groupIndex;
+        function getNextArrayItem(p_aArray, p_nStartIndex) {
 
-            function getNextArrayItem(p_aArray, p_nStartIndex) {
-    
-                return p_aArray[p_nStartIndex] || 
-                    getNextArrayItem(p_aArray, (p_nStartIndex+1));
-    
-            }
-    
-    
-            var aItemGroups = this.parent.getItemGroups(),
-                oNextItem;
+            return p_aArray[p_nStartIndex] || 
+                getNextArrayItem(p_aArray, (p_nStartIndex+1));
+
+        }
+
+        if (this.parent instanceof Menu) {
+
+            nGroupIndex = this.groupIndex;
     
+            aItemGroups = this.parent.getItemGroups();
     
-            if(this.index < (aItemGroups[nGroupIndex].length - 1)) {
+            if (this.index < (aItemGroups[nGroupIndex].length - 1)) {
     
-                oNextItem = getNextArrayItem(
-                        aItemGroups[nGroupIndex], 
-                        (this.index+1)
-                    );
+                oNextItem = getNextArrayItem(aItemGroups[nGroupIndex], 
+                        (this.index+1));
     
             }
             else {
     
-                var nNextGroupIndex;
-    
-                if(nGroupIndex < (aItemGroups.length - 1)) {
+                if (nGroupIndex < (aItemGroups.length - 1)) {
     
                     nNextGroupIndex = nGroupIndex + 1;
     
@@ -7263,7 +7599,7 @@
     
                 }
     
-                var aNextGroup = getNextArrayItem(aItemGroups, nNextGroupIndex);
+                aNextGroup = getNextArrayItem(aItemGroups, nNextGroupIndex);
     
                 // Retrieve the first menu item in the next group
     
@@ -7271,11 +7607,9 @@
     
             }
     
-            return (
-                oNextItem.cfg.getProperty("disabled") || 
-                oNextItem.element.style.display == "none"
-            ) ? 
-            oNextItem.getNextEnabledSibling() : oNextItem;
+            return (oNextItem.cfg.getProperty("disabled") || 
+                oNextItem.element.style.display == "none") ? 
+                oNextItem.getNextEnabledSibling() : oNextItem;
 
         }
 
@@ -7287,46 +7621,43 @@
     * @description Finds the menu item's previous enabled sibling.
     * @return {YAHOO.widget.MenuItem}
     */
-    getPreviousEnabledSibling: function() {
+    getPreviousEnabledSibling: function () {
 
-       if(this.parent instanceof Menu) {
+        var nGroupIndex,
+            aItemGroups,
+            oPreviousItem,
+            nPreviousGroupIndex,
+            aPreviousGroup;
 
-            var nGroupIndex = this.groupIndex;
+        function getPreviousArrayItem(p_aArray, p_nStartIndex) {
 
-            function getPreviousArrayItem(p_aArray, p_nStartIndex) {
-    
-                return p_aArray[p_nStartIndex] || 
-                    getPreviousArrayItem(p_aArray, (p_nStartIndex-1));
-    
-            }
+            return p_aArray[p_nStartIndex] ||  
+                getPreviousArrayItem(p_aArray, (p_nStartIndex-1));
+
+        }
+
+        function getFirstItemIndex(p_aArray, p_nStartIndex) {
+
+            return p_aArray[p_nStartIndex] ? p_nStartIndex : 
+                getFirstItemIndex(p_aArray, (p_nStartIndex+1));
+
+        }
+
+       if (this.parent instanceof Menu) {
+
+            nGroupIndex = this.groupIndex;
+            aItemGroups = this.parent.getItemGroups();
 
-            function getFirstItemIndex(p_aArray, p_nStartIndex) {
-    
-                return p_aArray[p_nStartIndex] ? 
-                    p_nStartIndex : 
-                    getFirstItemIndex(p_aArray, (p_nStartIndex+1));
-    
-            }
-    
-            var aItemGroups = this.parent.getItemGroups(),
-                oPreviousItem;
     
-            if(
-                this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)
-            ) {
+            if (this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)) {
     
-                oPreviousItem = 
-                    getPreviousArrayItem(
-                        aItemGroups[nGroupIndex], 
-                        (this.index-1)
-                    );
+                oPreviousItem = getPreviousArrayItem(aItemGroups[nGroupIndex], 
+                        (this.index-1));
     
             }
             else {
     
-                var nPreviousGroupIndex;
-    
-                if(nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {
+                if (nGroupIndex > getFirstItemIndex(aItemGroups, 0)) {
     
                     nPreviousGroupIndex = nGroupIndex - 1;
     
@@ -7337,22 +7668,17 @@
     
                 }
     
-                var aPreviousGroup = 
-                        getPreviousArrayItem(aItemGroups, nPreviousGroupIndex);
+                aPreviousGroup = getPreviousArrayItem(aItemGroups, 
+                    nPreviousGroupIndex);
     
-                oPreviousItem = 
-                    getPreviousArrayItem(
-                        aPreviousGroup, 
-                        (aPreviousGroup.length - 1)
-                    );
+                oPreviousItem = getPreviousArrayItem(aPreviousGroup, 
+                        (aPreviousGroup.length - 1));
     
             }
 
-            return (
-                oPreviousItem.cfg.getProperty("disabled") || 
-                oPreviousItem.element.style.display == "none"
-            ) ? 
-            oPreviousItem.getPreviousEnabledSibling() : oPreviousItem;
+            return (oPreviousItem.cfg.getProperty("disabled") || 
+                oPreviousItem.element.style.display == "none") ? 
+                oPreviousItem.getPreviousEnabledSibling() : oPreviousItem;
 
         }
 
@@ -7364,7 +7690,7 @@
     * @description Causes the menu item to receive the focus and fires the 
     * focus event.
     */
-    focus: function() {
+    focus: function () {
 
         var oParent = this.parent,
             oAnchor = this._oAnchor,
@@ -7376,16 +7702,21 @@
 
             try {
 
-                if (
-                    (me.browser == "ie" || me.browser == "ie7") && 
-                    !document.hasFocus()
-                ) {
+                if (YAHOO.env.ua.ie && !document.hasFocus()) {
                 
                     return;
                 
                 }
 
+                if (oActiveItem) {
+    
+                    oActiveItem.blurEvent.fire();
+    
+                }
+
                 oAnchor.focus();
+                
+                me.focusEvent.fire();
 
             }
             catch(e) {
@@ -7395,18 +7726,9 @@
         }
 
 
-        if(
-            !this.cfg.getProperty("disabled") && 
-            oParent && 
+        if (!this.cfg.getProperty("disabled") && oParent && 
             oParent.cfg.getProperty("visible") && 
-            this.element.style.display != "none"
-        ) {
-
-            if(oActiveItem) {
-
-                oActiveItem.blur();
-
-            }
+            this.element.style.display != "none") {
 
 
             /*
@@ -7416,8 +7738,6 @@
             */
 
             window.setTimeout(setFocus, 0);
-            
-            this.focusEvent.fire();
 
         }
 
@@ -7429,19 +7749,29 @@
     * @description Causes the menu item to lose focus and fires the 
     * blur event.
     */    
-    blur: function() {
+    blur: function () {
 
         var oParent = this.parent;
 
-        if(
-            !this.cfg.getProperty("disabled") && 
-            oParent && 
-            Dom.getStyle(oParent.element, "visibility") == "visible"
-        ) {
+        if (!this.cfg.getProperty("disabled") && oParent && 
+            oParent.cfg.getProperty("visible")) {
+
+
+            var me = this;
+            
+            window.setTimeout(function () {
 
-            this._oAnchor.blur();
+                try {
+    
+                    me._oAnchor.blur();
+                    me.blurEvent.fire();    
 
-            this.blurEvent.fire();
+                } 
+                catch (e) {
+                
+                }
+                
+            }, 0);
 
         }
 
@@ -7454,7 +7784,7 @@
     * has focus.
     * @return {Boolean}
     */
-    hasFocus: function() {
+    hasFocus: function () {
     
         return (YAHOO.widget.MenuManager.getFocusedMenuItem() == this);
     
@@ -7466,18 +7796,20 @@
 	* @description Removes the menu item's <code>&#60;li&#62;</code> element 
 	* from its parent <code>&#60;ul&#62;</code> element.
 	*/
-    destroy: function() {
+    destroy: function () {
 
-        var oEl = this.element;
+        var oEl = this.element,
+            oSubmenu,
+            oParentNode;
 
-        if(oEl) {
+        if (oEl) {
 
 
             // If the item has a submenu, destroy it first
 
-            var oSubmenu = this.cfg.getProperty("submenu");
+            oSubmenu = this.cfg.getProperty("submenu");
 
-            if(oSubmenu) {
+            if (oSubmenu) {
             
                 oSubmenu.destroy();
             
@@ -7501,9 +7833,9 @@
 
             // Remove the element from the parent node
 
-            var oParentNode = oEl.parentNode;
+            oParentNode = oEl.parentNode;
 
-            if(oParentNode) {
+            if (oParentNode) {
 
                 oParentNode.removeChild(oEl);
 
@@ -7523,16 +7855,27 @@
     * @description Returns a string representing the menu item.
     * @return {String}
     */
-    toString: function() {
+    toString: function () {
+
+        var sReturnVal = "MenuItem",
+            sId = this.id;
+
+        if (sId) {
     
-        return ("MenuItem: " + this.cfg.getProperty("text"));
+            sReturnVal += (" " + sId);
+        
+        }
+
+        return sReturnVal;
     
     }
 
 };
 
-})();
+Lang.augmentProto(MenuItem, YAHOO.util.EventProvider);
 
+})();
+(function () {
 
 
 /**
@@ -7561,52 +7904,69 @@
 */
 YAHOO.widget.ContextMenu = function(p_oElement, p_oConfig) {
 
-    YAHOO.widget.ContextMenu.superclass.constructor.call(
-            this, 
-            p_oElement,
-            p_oConfig
-        );
+    YAHOO.widget.ContextMenu.superclass.constructor.call(this, 
+            p_oElement, p_oConfig);
 
 };
 
 
-/**
-* Constant representing the name of the ContextMenu's events
-* @property YAHOO.widget.ContextMenu._EVENT_TYPES
-* @private
-* @final
-* @type Object
-*/
-YAHOO.widget.ContextMenu._EVENT_TYPES = {
+var Event = YAHOO.util.Event,
+    ContextMenu = YAHOO.widget.ContextMenu,
 
-    "TRIGGER_CONTEXT_MENU": "triggerContextMenu",
 
-    "CONTEXT_MENU": (
-                        (YAHOO.widget.Module.prototype.browser == "opera" ? 
-                            "mousedown" : "contextmenu")
-                    ),
-    "CLICK": "click"
 
-};
+    /**
+    * Constant representing the name of the ContextMenu's events
+    * @property EVENT_TYPES
+    * @private
+    * @final
+    * @type Object
+    */
+    EVENT_TYPES = {
+
+        "TRIGGER_CONTEXT_MENU": "triggerContextMenu",
+        "CONTEXT_MENU": (YAHOO.env.ua.opera ? "mousedown" : "contextmenu"),
+        "CLICK": "click"
+
+    },
+    
+    
+    /**
+    * Constant representing the ContextMenu's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+    
+        "TRIGGER": { 
+            key: "trigger",
+            suppressEvent: true
+        }
+    
+    };
 
 
 /**
-* Constant representing the ContextMenu's configuration properties
-* @property YAHOO.widget.ContextMenu._DEFAULT_CONFIG
+* @method position
+* @description "beforeShow" event handler used to position the contextmenu.
 * @private
-* @final
-* @type Object
+* @param {String} p_sType String representing the name of the event that 
+* was fired.
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.
+* @param {Array} p_aPos Array representing the xy position for the context menu.
 */
-YAHOO.widget.ContextMenu._DEFAULT_CONFIG = {
+function position(p_sType, p_aArgs, p_aPos) {
 
-    "TRIGGER": { 
-        key: "trigger" 
-    }
+    this.cfg.setProperty("xy", p_aPos);
+    
+    this.beforeShowEvent.unsubscribe(position, p_aPos);
 
-};
+}
 
 
-YAHOO.lang.extend(YAHOO.widget.ContextMenu, YAHOO.widget.Menu, {
+YAHOO.lang.extend(ContextMenu, YAHOO.widget.Menu, {
 
 
 
@@ -7689,19 +8049,13 @@
 */
 init: function(p_oElement, p_oConfig) {
 
-    if(!this.ITEM_TYPE) {
-
-        this.ITEM_TYPE = YAHOO.widget.ContextMenuItem;
-
-    }
-
 
     // Call the init of the superclass (YAHOO.widget.Menu)
 
-    YAHOO.widget.ContextMenu.superclass.init.call(this, p_oElement);
+    ContextMenu.superclass.init.call(this, p_oElement);
 
 
-    this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);
+    this.beforeInitEvent.fire(ContextMenu);
 
 
     if(p_oConfig) {
@@ -7711,7 +8065,7 @@
     }
     
     
-    this.initEvent.fire(YAHOO.widget.ContextMenu);
+    this.initEvent.fire(ContextMenu);
     
 },
 
@@ -7722,16 +8076,14 @@
 */
 initEvents: function() {
 
-	YAHOO.widget.ContextMenu.superclass.initEvents.call(this);
+	ContextMenu.superclass.initEvents.call(this);
 
     // Create custom events
 
     this.triggerContextMenuEvent = 
+        this.createEvent(EVENT_TYPES.TRIGGER_CONTEXT_MENU);
 
-            new YAHOO.util.CustomEvent(
-                    YAHOO.widget.ContextMenu._EVENT_TYPES.TRIGGER_CONTEXT_MENU, 
-                    this
-                );
+    this.triggerContextMenuEvent.signature = YAHOO.util.CustomEvent.LIST;
 
 },
 
@@ -7760,27 +8112,20 @@
 */
 _removeEventHandlers: function() {
 
-    var Event = YAHOO.util.Event,
-        oTrigger = this._oTrigger;
+    var oTrigger = this._oTrigger;
 
 
     // Remove the event handlers from the trigger(s)
 
     if (oTrigger) {
 
-        Event.removeListener(
-            oTrigger, 
-            YAHOO.widget.ContextMenu._EVENT_TYPES.CONTEXT_MENU, 
-            this._onTriggerContextMenu
-        );    
-        
-        if(this.browser == "opera") {
-        
-            Event.removeListener(
-                oTrigger, 
-                YAHOO.widget.ContextMenu._EVENT_TYPES.CLICK, 
-                this._onTriggerClick
-            );
+        Event.removeListener(oTrigger, EVENT_TYPES.CONTEXT_MENU, 
+            this._onTriggerContextMenu);    
+        
+        if(YAHOO.env.ua.opera) {
+        
+            Event.removeListener(oTrigger, EVENT_TYPES.CLICK, 
+                this._onTriggerClick);
     
         }
 
@@ -7793,6 +8138,7 @@
 // Private event handlers
 
 
+
 /**
 * @method _onTriggerClick
 * @description "click" event handler for the HTML element(s) identified as the 
@@ -7807,7 +8153,7 @@
 
     if(p_oEvent.ctrlKey) {
     
-        YAHOO.util.Event.stopEvent(p_oEvent);
+        Event.stopEvent(p_oEvent);
 
     }
     
@@ -7826,15 +8172,16 @@
 */
 _onTriggerContextMenu: function(p_oEvent, p_oMenu) {
 
-    var Event = YAHOO.util.Event;
-
-    if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {
+    if (p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {
 
         return;
 
     }
 
 
+    var aXY;
+
+
     /*
         Prevent the browser's default context menu from appearing and 
         stop the propagation of the "contextmenu" event so that 
@@ -7844,21 +8191,35 @@
     Event.stopEvent(p_oEvent);
 
 
-    // Hide any other ContextMenu instances that might be visible
+    this.contextEventTarget = Event.getTarget(p_oEvent);
 
-    YAHOO.widget.MenuManager.hideVisible();
+    this.triggerContextMenuEvent.fire(p_oEvent);
 
 
-    this.contextEventTarget = Event.getTarget(p_oEvent);
+    // Hide any other Menu instances that might be visible
 
-    this.triggerContextMenuEvent.fire(p_oEvent);
+    YAHOO.widget.MenuManager.hideVisible();
+    
 
 
     if(!this._bCancelled) {
 
         // Position and display the context menu
-    
-        this.cfg.setProperty("xy", Event.getXY(p_oEvent));
+
+        aXY = Event.getXY(p_oEvent);
+
+
+        if (!YAHOO.util.Dom.inDocument(this.element)) {
+
+            this.beforeShowEvent.subscribe(position, aXY);
+
+        }
+        else {
+
+            this.cfg.setProperty("xy", aXY);
+        
+        }
+
 
         this.show();
 
@@ -7880,7 +8241,16 @@
 */
 toString: function() {
 
-    return ("ContextMenu " + this.id);
+    var sReturnVal = "ContextMenu",
+        sId = this.id;
+
+    if(sId) {
+
+        sReturnVal += (" " + sId);
+    
+    }
+
+    return sReturnVal;
 
 },
 
@@ -7892,7 +8262,7 @@
 */
 initDefaultConfig: function() {
 
-    YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);
+    ContextMenu.superclass.initDefaultConfig.call(this);
 
     /**
     * @config trigger
@@ -7904,9 +8274,11 @@
     * @type String|<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/
     * level-one-html.html#ID-58190037">HTMLElement</a>|Array
     */
-    this.cfg.addProperty(
-        YAHOO.widget.ContextMenu._DEFAULT_CONFIG.TRIGGER.key, 
-        { handler: this.configTrigger }
+    this.cfg.addProperty(DEFAULT_CONFIG.TRIGGER.key, 
+        {
+            handler: this.configTrigger, 
+            suppressEvent: DEFAULT_CONFIG.TRIGGER.suppressEvent 
+        }
     );
 
 },
@@ -7922,11 +8294,11 @@
     // Remove the DOM event handlers from the current trigger(s)
 
     this._removeEventHandlers();
-    
+
 
     // Continue with the superclass implementation of this method
 
-    YAHOO.widget.ContextMenu.superclass.destroy.call(this);
+    ContextMenu.superclass.destroy.call(this);
 
 },
 
@@ -7947,8 +8319,7 @@
 */
 configTrigger: function(p_sType, p_aArgs, p_oMenu) {
     
-    var Event = YAHOO.util.Event,
-        oTrigger = p_aArgs[0];
+    var oTrigger = p_aArgs[0];
 
     if(oTrigger) {
 
@@ -7971,13 +8342,8 @@
             support the "contextmenu" event
         */ 
   
-        Event.on(
-            oTrigger, 
-            YAHOO.widget.ContextMenu._EVENT_TYPES.CONTEXT_MENU, 
-            this._onTriggerContextMenu,
-            this,
-            true
-        );
+        Event.on(oTrigger, EVENT_TYPES.CONTEXT_MENU, 
+            this._onTriggerContextMenu, this, true);
 
 
         /*
@@ -7985,15 +8351,10 @@
             Opera to prevent default browser behaviors.
         */
 
-        if(this.browser == "opera") {
+        if(YAHOO.env.ua.opera) {
         
-            Event.on(
-                oTrigger, 
-                YAHOO.widget.ContextMenu._EVENT_TYPES.CLICK, 
-                this._onTriggerClick,
-                this,
-                true
-            );
+            Event.on(oTrigger, EVENT_TYPES.CLICK, this._onTriggerClick, 
+                this, true);
 
         }
 
@@ -8008,6 +8369,8 @@
 
 }); // END YAHOO.lang.extend
 
+}());
+
 
 
 /**
@@ -8030,89 +8393,11 @@
 * @class ContextMenuItem
 * @constructor
 * @extends YAHOO.widget.MenuItem
+* @deprecated As of version 2.4.0 items for YAHOO.widget.ContextMenu instances
+* are of type YAHOO.widget.MenuItem.
 */
-YAHOO.widget.ContextMenuItem = function(p_oObject, p_oConfig) {
-
-    YAHOO.widget.ContextMenuItem.superclass.constructor.call(
-        this, 
-        p_oObject, 
-        p_oConfig
-    );
-
-};
-
-YAHOO.lang.extend(YAHOO.widget.ContextMenuItem, YAHOO.widget.MenuItem, {
-
-
-/**
-* @method init
-* @description The ContextMenuItem class's initialization method. This method 
-* is automatically called by the constructor, and sets up all DOM references 
-* for pre-existing markup, and creates required markup if it is not 
-* already present.
-* @param {String} p_oObject String specifying the text of the context menu item.
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-* one-html.html#ID-74680021">HTMLLIElement</a>} p_oObject Object specifying the 
-* <code>&#60;li&#62;</code> element of the context menu item.
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-* one-html.html#ID-38450247">HTMLOptGroupElement</a>} p_oObject Object 
-* specifying the <code>&#60;optgroup&#62;</code> element of the context 
-* menu item.
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-
-* one-html.html#ID-70901257">HTMLOptionElement</a>} p_oObject Object specifying 
-* the <code>&#60;option&#62;</code> element of the context menu item.
-* @param {Object} p_oConfig Optional. Object literal specifying the 
-* configuration for the context menu item. See configuration class 
-* documentation for more details.
-*/
-init: function(p_oObject, p_oConfig) {
-    
-    if(!this.SUBMENU_TYPE) {
-
-        this.SUBMENU_TYPE = YAHOO.widget.ContextMenu;
-
-    }
-
-
-    /* 
-        Call the init of the superclass (YAHOO.widget.MenuItem)
-        Note: We don't pass the user config in here yet 
-        because we only want it executed once, at the lowest 
-        subclass level.
-    */ 
-
-    YAHOO.widget.ContextMenuItem.superclass.init.call(this, p_oObject);
-
-    var oConfig = this.cfg;
-
-    if(p_oConfig) {
-
-        oConfig.applyConfig(p_oConfig, true);
-
-    }
-
-    oConfig.fireQueue();
-
-},
-
-
-
-// Public methods
-
-
-/**
-* @method toString
-* @description Returns a string representing the context menu item.
-* @return {String}
-*/
-toString: function() {
-
-    return ("ContextMenuItem: " + this.cfg.getProperty("text"));
-
-}
-    
-}); // END YAHOO.lang.extend
-
+YAHOO.widget.ContextMenuItem = YAHOO.widget.MenuItem;
+(function () {
 
 
 /**
@@ -8133,54 +8418,75 @@
 * @param {Object} p_oConfig Optional. Object literal specifying the 
 * configuration for the menu bar. See configuration class documentation for
 * more details.
-* @class Menubar
+* @class MenuBar
 * @constructor
 * @extends YAHOO.widget.Menu
 * @namespace YAHOO.widget
 */
 YAHOO.widget.MenuBar = function(p_oElement, p_oConfig) {
 
-    YAHOO.widget.MenuBar.superclass.constructor.call(
-            this, 
-            p_oElement,
-            p_oConfig
-        );
+    YAHOO.widget.MenuBar.superclass.constructor.call(this, 
+        p_oElement, p_oConfig);
 
 };
 
 
 /**
-* Constant representing the MenuBar's configuration properties
-* @property YAHOO.widget.MenuBar._DEFAULT_CONFIG
+* @method checkPosition
+* @description Checks to make sure that the value of the "position" property 
+* is one of the supported strings. Returns true if the position is supported.
 * @private
-* @final
-* @type Object
+* @param {Object} p_sPosition String specifying the position of the menu.
+* @return {Boolean}
 */
-YAHOO.widget.MenuBar._DEFAULT_CONFIG = {
+function checkPosition(p_sPosition) {
 
-    "POSITION": { 
-        key: "position", 
-        value: "static", 
-        validator: YAHOO.widget.Menu._checkPosition, 
-        supercedes: ["visible"] 
-    }, 
-
-    "SUBMENU_ALIGNMENT": { 
-        key: "submenualignment", 
-        value: ["tl","bl"] 
-    },
+    if (typeof p_sPosition == "string") {
+
+        return ("dynamic,static".indexOf((p_sPosition.toLowerCase())) != -1);
 
-    "AUTO_SUBMENU_DISPLAY": { 
-        key: "autosubmenudisplay", 
-        value: false, 
-        validator: YAHOO.lang.isBoolean 
     }
 
-};
+}
+
+
+var Event = YAHOO.util.Event,
+    MenuBar = YAHOO.widget.MenuBar,
+
+    /**
+    * Constant representing the MenuBar's configuration properties
+    * @property DEFAULT_CONFIG
+    * @private
+    * @final
+    * @type Object
+    */
+    DEFAULT_CONFIG = {
+    
+        "POSITION": { 
+            key: "position", 
+            value: "static", 
+            validator: checkPosition, 
+            supercedes: ["visible"] 
+        }, 
+    
+        "SUBMENU_ALIGNMENT": { 
+            key: "submenualignment", 
+            value: ["tl","bl"],
+            suppressEvent: true 
+        },
+    
+        "AUTO_SUBMENU_DISPLAY": { 
+            key: "autosubmenudisplay", 
+            value: false, 
+            validator: YAHOO.lang.isBoolean,
+            suppressEvent: true
+        }
+    
+    };
 
 
 
-YAHOO.lang.extend(YAHOO.widget.MenuBar, YAHOO.widget.Menu, {
+YAHOO.lang.extend(MenuBar, YAHOO.widget.Menu, {
 
 /**
 * @method init
@@ -8214,10 +8520,10 @@
 
     // Call the init of the superclass (YAHOO.widget.Menu)
 
-    YAHOO.widget.MenuBar.superclass.init.call(this, p_oElement);
+    MenuBar.superclass.init.call(this, p_oElement);
 
 
-    this.beforeInitEvent.fire(YAHOO.widget.MenuBar);
+    this.beforeInitEvent.fire(MenuBar);
 
 
     if(p_oConfig) {
@@ -8226,7 +8532,7 @@
 
     }
 
-    this.initEvent.fire(YAHOO.widget.MenuBar);
+    this.initEvent.fire(MenuBar);
 
 },
 
@@ -8262,34 +8568,33 @@
 */
 _onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) {
 
-    var Event = YAHOO.util.Event,
-        oEvent = p_aArgs[0],
+    var oEvent = p_aArgs[0],
         oItem = p_aArgs[1],
-        oSubmenu;
+        oSubmenu,
+        oItemCfg,
+        oNextItem;
 
 
     if(oItem && !oItem.cfg.getProperty("disabled")) {
 
-        var oItemCfg = oItem.cfg;
+        oItemCfg = oItem.cfg;
 
         switch(oEvent.keyCode) {
     
             case 37:    // Left arrow
             case 39:    // Right arrow
     
-                if(
-                    oItem == this.activeItem && 
-                    !oItemCfg.getProperty("selected")
-                ) {
+                if(oItem == this.activeItem && 
+                    !oItemCfg.getProperty("selected")) {
     
                     oItemCfg.setProperty("selected", true);
     
                 }
                 else {
     
-                    var oNextItem = (oEvent.keyCode == 37) ? 
-                            oItem.getPreviousEnabledSibling() : 
-                            oItem.getNextEnabledSibling();
+                    oNextItem = (oEvent.keyCode == 37) ? 
+                        oItem.getPreviousEnabledSibling() : 
+                        oItem.getNextEnabledSibling();
             
                     if(oNextItem) {
     
@@ -8394,26 +8699,22 @@
 */
 _onClick: function(p_sType, p_aArgs, p_oMenuBar) {
 
-    YAHOO.widget.MenuBar.superclass._onClick.call(
-        this, 
-        p_sType, 
-        p_aArgs, 
-        p_oMenuBar
-    );
-
+    MenuBar.superclass._onClick.call(this, p_sType, p_aArgs, p_oMenuBar);
 
-    var oItem = p_aArgs[1];
+    var oItem = p_aArgs[1],
+        oEvent,
+        oTarget,
+        oActiveItem,
+        oConfig,
+        oSubmenu;
     
+
     if(oItem && !oItem.cfg.getProperty("disabled")) {
 
-         var Event = YAHOO.util.Event,
-             Dom = YAHOO.util.Dom,
-    
-             oEvent = p_aArgs[0],
-             oTarget = Event.getTarget(oEvent),
-    
-             oActiveItem = this.activeItem,
-             oConfig = this.cfg;
+        oEvent = p_aArgs[0];
+        oTarget = Event.getTarget(oEvent);
+        oActiveItem = this.activeItem;
+        oConfig = this.cfg;
 
 
         // Hide any other submenus that might be visible
@@ -8430,10 +8731,10 @@
 
         // Show the submenu for the item
     
-        var oSubmenu = oItem.cfg.getProperty("submenu");
+        oSubmenu = oItem.cfg.getProperty("submenu");
 
 
-        if(oSubmenu && oTarget != oItem.submenuIndicator) {
+        if(oSubmenu) {
         
             if(oSubmenu.cfg.getProperty("visible")) {
             
@@ -8464,7 +8765,16 @@
 */
 toString: function() {
 
-    return ("MenuBar " + this.id);
+    var sReturnVal = "MenuBar",
+        sId = this.id;
+
+    if(sId) {
+
+        sReturnVal += (" " + sId);
+    
+    }
+
+    return sReturnVal;
 
 },
 
@@ -8476,10 +8786,9 @@
 */
 initDefaultConfig: function() {
 
-    YAHOO.widget.MenuBar.superclass.initDefaultConfig.call(this);
+    MenuBar.superclass.initDefaultConfig.call(this);
 
-    var oConfig = this.cfg,
-        DEFAULT_CONFIG = YAHOO.widget.MenuBar._DEFAULT_CONFIG;
+    var oConfig = this.cfg;
 
 	// Add configuration properties
 
@@ -8527,7 +8836,8 @@
     oConfig.addProperty(
         DEFAULT_CONFIG.SUBMENU_ALIGNMENT.key, 
         {
-            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value
+            value: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.value,
+            suppressEvent: DEFAULT_CONFIG.SUBMENU_ALIGNMENT.suppressEvent
         }
     );
 
@@ -8548,7 +8858,8 @@
 	   DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.key, 
 	   {
 	       value: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.value, 
-	       validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator
+	       validator: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.validator,
+	       suppressEvent: DEFAULT_CONFIG.AUTO_SUBMENU_DISPLAY.suppressEvent
        } 
     );
 
@@ -8556,6 +8867,8 @@
  
 }); // END YAHOO.lang.extend
 
+}());
+
 
 
 /**
@@ -8580,17 +8893,15 @@
 */
 YAHOO.widget.MenuBarItem = function(p_oObject, p_oConfig) {
 
-    YAHOO.widget.MenuBarItem.superclass.constructor.call(
-        this, 
-        p_oObject, 
-        p_oConfig
-    );
+    YAHOO.widget.MenuBarItem.superclass.constructor.call(this, 
+        p_oObject, p_oConfig);
 
 };
 
 YAHOO.lang.extend(YAHOO.widget.MenuBarItem, YAHOO.widget.MenuItem, {
 
 
+
 /**
 * @method init
 * @description The MenuBarItem class's initialization method. This method is 
@@ -8645,6 +8956,7 @@
 
 // Constants
 
+
 /**
 * @property CSS_CLASS_NAME
 * @description String representing the CSS class(es) to be applied to the 
@@ -8656,6 +8968,17 @@
 CSS_CLASS_NAME: "yuimenubaritem",
 
 
+/**
+* @property CSS_LABEL_CLASS_NAME
+* @description String representing the CSS class(es) to be applied to the 
+* menu bar item's <code>&#60;a&#62;</code> element.
+* @default "yuimenubaritemlabel"
+* @final
+* @type String
+*/
+CSS_LABEL_CLASS_NAME: "yuimenubaritemlabel",
+
+
 
 // Public methods
 
@@ -8667,9 +8990,17 @@
 */
 toString: function() {
 
-    return ("MenuBarItem: " + this.cfg.getProperty("text"));
+    var sReturnVal = "MenuBarItem";
+
+    if(this.cfg && this.cfg.getProperty("text")) {
+
+        sReturnVal += (": " + this.cfg.getProperty("text"));
+
+    }
+
+    return sReturnVal;
 
 }
     
 }); // END YAHOO.lang.extend
-YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.2.1", build: "193"});
+YAHOO.register("menu", YAHOO.widget.Menu, {version: "2.4.1", build: "742"});

Modified: jifty/branches/jquery/share/web/static/js/yui/oom_select.patch
==============================================================================
--- jifty/branches/jquery/share/web/static/js/yui/oom_select.patch	(original)
+++ jifty/branches/jquery/share/web/static/js/yui/oom_select.patch	Mon Jan 21 11:08:06 2008
@@ -1,7 +1,5 @@
-=== share/web/static/js/yui/calendar.js
-==================================================================
---- share/web/static/js/yui/calendar.js	(revision 24788)
-+++ share/web/static/js/yui/calendar.js	(local)
+--- calendar.js.orig	2007-12-18 15:42:56.000000000 -0500
++++ calendar.js	2008-01-19 17:38:05.000000000 -0500
 @@ -1,4 +1,8 @@
  /*
 +    This file has been PATCHED by trs to allow selecting of out of month dates.
@@ -11,44 +9,97 @@
  Copyright (c) 2007, Yahoo! Inc. All rights reserved.
  Code licensed under the BSD License:
  http://developer.yahoo.net/yui/license.txt
-@@ -903,6 +907,7 @@
- 	MINDATE : {key:"mindate", value:null},
- 	MAXDATE : {key:"maxdate", value:null},
- 	MULTI_SELECT : {key:"multi_select",	value:false},
-+	OOM_SELECT : {key:"oom_select",	value:false},
- 	START_WEEKDAY : {key:"start_weekday", value:0},
- 	SHOW_WEEKDAYS : {key:"show_weekdays", value:true},
+@@ -1166,6 +1170,7 @@
  	SHOW_WEEK_HEADER : {key:"show_week_header", value:false},
-@@ -1505,6 +1510,14 @@
- 	*/
- 	this.cfg.addProperty(defCfg.MULTI_SELECT.key,	{ value:defCfg.MULTI_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
- 
+ 	SHOW_WEEK_FOOTER : {key:"show_week_footer", value:false},
+ 	HIDE_BLANK_WEEKS : {key:"hide_blank_weeks", value:false},
++	OUT_OF_MONTH_SELECT : {key:"out_of_month_select", value:false},
+ 	NAV_ARROW_LEFT: {key:"nav_arrow_left", value:null} ,
+ 	NAV_ARROW_RIGHT : {key:"nav_arrow_right", value:null} ,
+ 	MONTHS_SHORT : {key:"months_short", value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]},
+@@ -1953,6 +1958,14 @@
+ 		*/	
+ 		this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key, { value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
+ 		
++        /**
++        * True if the Calendar should allow out of month selections. false by default.
++        * @config OUT_OF_MONTH_SELECT
++        * @type Boolean
++        * @default false
++        */
++        this.cfg.addProperty(defCfg.OUT_OF_MONTH_SELECT.key, { value:defCfg.OUT_OF_MONTH_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
++
+ 		/**
+ 		* The image that should be used for the left navigation arrow.
+ 		* @config NAV_ARROW_LEFT
+@@ -2762,6 +2775,8 @@
+ 		var mindate = this.cfg.getProperty(defCfg.MINDATE.key);
+ 		var maxdate = this.cfg.getProperty(defCfg.MAXDATE.key);
+ 	
++        var outOfMonthSelect = this.cfg.getProperty(defCfg.OUT_OF_MONTH_SELECT.key);
++
+ 		if (mindate) {
+ 			mindate = YAHOO.widget.DateMath.clearTime(mindate);
+ 		}
+@@ -2785,7 +2800,7 @@
+ 			weekClass = weekPrefix + weekNum;
+ 	
+ 			// Local OOM check for performance, since we already have pagedate
+-			if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
++			if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth() && !outOfMonthSelect) {
+ 				break;
+ 			} else {
+ 	
+@@ -2812,7 +2827,11 @@
+ 					
+ 					// Local OOM check for performance, since we already have pagedate
+ 					if (workingDate.getMonth() != useDate.getMonth()) {
+-						cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
++                        if (outOfMonthSelect) {
++                            cellRenderers[cellRenderers.length]=cal.renderCellStyleNotThisMonth;
++                        } else {
++                            cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
++                        }
+ 					} else {
+ 						YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
+ 						YAHOO.util.Dom.addClass(cell, dayPrefix + workingDate.getDate());
+@@ -3257,6 +3276,16 @@
+ 		YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_TODAY);
+ 	},
+ 	
 +    /**
-+    * True if the Calendar should allow selection of out-of-month dates. False by default.
-+    * @config OOM_SELECT
-+    * @type Boolean
-+    * @default false
++    * Styles an out of month cell.
++    * @method renderCellStyleNotThisMonth
++    * @param {Date}					workingDate		The current working Date object being used to generate the calendar
++    * @param {HTMLTableCellElement}	cell			The current working cell in the calendar
 +    */
-+    this.cfg.addProperty(defCfg.OOM_SELECT.key,      { value:defCfg.OOM_SELECT.value, handler:this.configOptions, validator:this.cfg.checkBoolean } );
++    renderCellStyleNotThisMonth : function(workingDate, cell) {
++        YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_OOM);
++    },
 +
  	/**
- 	* The weekday the week begins on. Default is 0 (Sunday).
- 	* @config START_WEEKDAY
-@@ -2176,7 +2189,7 @@
- 		weekClass = weekPrefix + weekNum;
- 
- 		// Local OOM check for performance, since we already have pagedate
--		if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
-+		if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth() && !this.cfg.getProperty(defCfg.OOM_SELECT.key)) {
- 			break;
- 		} else {
- 
-@@ -2203,7 +2216,7 @@
- 				this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
- 				
- 				// Local OOM check for performance, since we already have pagedate
--				if (workingDate.getMonth() != useDate.getMonth()) {
-+				if (workingDate.getMonth() != useDate.getMonth() && !this.cfg.getProperty(defCfg.OOM_SELECT.key)) {
- 					cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
- 				} else {
- 					YAHOO.util.Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
+ 	* Applies the default style used for rendering selected dates to the current calendar cell
+ 	* @method renderCellStyleSelected
+@@ -4473,6 +4502,14 @@
+ 		*/		
+ 		this.cfg.addProperty(defCfg.HIDE_BLANK_WEEKS.key,{ value:defCfg.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
+ 		
++        /**
++        * True if the Calendar should allow out of month selections. false by default.
++        * @config OUT_OF_MONTH_SELECT
++        * @type Boolean
++        * @default false
++        */
++        this.cfg.addProperty(defCfg.OUT_OF_MONTH_SELECT.key,{ value:defCfg.OUT_OF_MONTH_SELECT.value, handler:this.delegateConfig, validator:this.cfg.checkBoolean } );
++
+ 		/**
+ 		* The image that should be used for the left navigation arrow.
+ 		* @config NAV_ARROW_LEFT
+@@ -5474,6 +5511,7 @@
+ 																 "renderCellStyleToday",
+ 																 "renderCellStyleSelected",
+ 																 "renderCellNotThisMonth",
++																 "renderCellStyleNotThisMonth",
+ 																 "renderBodyCellRestricted",
+ 																 "initStyles",
+ 																 "configTitle",

Modified: jifty/branches/jquery/share/web/static/js/yui/tabview.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/yui/tabview.js	(original)
+++ jifty/branches/jquery/share/web/static/js/yui/tabview.js	Mon Jan 21 11:08:06 2008
@@ -2,7 +2,7 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
 (function() {
 
@@ -123,7 +123,12 @@
 
         var activate = function(e) {
             YAHOO.util.Event.preventDefault(e);
-            self.set('activeTab', this);
+            var silent = false;
+
+            if (this == self.get('activeTab')) {
+                silent = true; // dont fire activeTabChange if already active
+            }
+            self.set('activeTab', this, silent);
         };
         
         tab.addListener( tab.get('activationEvent'), activate);
@@ -259,10 +264,14 @@
         }
         
         var el = this.get('element');
+
+        if (!YAHOO.util.Dom.hasClass(el, this.CLASSNAME)) {
+            YAHOO.util.Dom.addClass(el, this.CLASSNAME);        
+        }
         
         /**
          * The Tabs belonging to the TabView instance.
-         * @config tabs
+         * @attribute tabs
          * @type Array
          */
         this.setAttributeConfig('tabs', {
@@ -292,7 +301,7 @@
         
         /**
          * How the Tabs should be oriented relative to the TabView.
-         * @config orientation
+         * @attribute orientation
          * @type String
          * @default "top"
          */
@@ -316,7 +325,7 @@
         
         /**
          * The index of the tab currently active.
-         * @config activeIndex
+         * @attribute activeIndex
          * @type Int
          */
         this.setAttributeConfig('activeIndex', {
@@ -331,7 +340,7 @@
         
         /**
          * The tab currently active.
-         * @config activeTab
+         * @attribute activeTab
          * @type YAHOO.widget.Tab
          */
         this.setAttributeConfig('activeTab', {
@@ -363,6 +372,12 @@
             _initTabs.call(this);
         }
         
+        // Due to delegation we add all DOM_EVENTS to the TabView container
+        // but IE will leak when unsupported events are added, so remove these
+        this.DOM_EVENTS.submit = false;
+        this.DOM_EVENTS.focus = false;
+        this.DOM_EVENTS.blur = false;
+
         for (var type in this.DOM_EVENTS) {
             if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) {
                 this.addListener.call(this, type, this.DOMEventHandler);
@@ -372,9 +387,8 @@
     
     /**
      * Creates Tab instances from a collection of HTMLElements.
-     * @method createTabs
+     * @method initTabs
      * @private
-     * @param {Array|HTMLCollection} elements The elements to use for Tabs.
      * @return void
      */
     var _initTabs = function() {
@@ -398,6 +412,7 @@
             
             if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) {
                 this._configs.activeTab.value = tab; // dont invoke method
+                this._configs.activeIndex.value = this.getTabIndex(tab);
             }
         }
     };
@@ -448,70 +463,6 @@
         
         return nodes;
     };
-
-/**
- * Fires before the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeActiveTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the currently active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the tab to be made active</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeActiveTabChange', handler);</code></p>
- * @event beforeActiveTabChange
- */
-    
-/**
- * Fires after the activeTab is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> activeTabChange<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * prevValue</code> the formerly active tab<br>
- * <code>&lt;<a href="YAHOO.widget.Tab.html">YAHOO.widget.Tab</a>&gt;
- * newValue</code> the new active tab</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('activeTabChange', handler);</code></p>
- * @event activeTabChange
- */
- 
-/**
- * Fires before the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p>If handler returns false, the change will be cancelled, and the value will not
- * be set.</p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> beforeOrientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the current orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation to be applied</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('beforeOrientationChange', handler);</code></p>
- * @event beforeOrientationChange
- */
-    
-/**
- * Fires after the orientation is changed.
- * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
- * <p><strong>Event fields:</strong><br>
- * <code>&lt;String&gt; type</code> orientationChange<br>
- * <code>&lt;String&gt;
- * prevValue</code> the former orientation<br>
- * <code>&lt;String&gt;
- * newValue</code> the new orientation</p>
- * <p><strong>Usage:</strong><br>
- * <code>var handler = function(e) {var previous = e.prevValue};<br>
- * myTabs.addListener('orientationChange', handler);</code></p>
- * @event orientationChange
- */
 })();
 
 (function() {
@@ -567,7 +518,7 @@
      * The class name applied to active tabs.
      * @property ACTIVE_CLASSNAME
      * @type String
-     * @default "on"
+     * @default "selected"
      */
     proto.ACTIVE_CLASSNAME = 'selected';
     
@@ -601,6 +552,8 @@
      * @type object
      */
     proto.loadHandler = null;
+
+    proto._loading = false;
     
     /**
      * Provides a readable name for the tab.
@@ -626,7 +579,7 @@
         
         /**
          * The event that triggers the tab's activation.
-         * @config activationEvent
+         * @attribute activationEvent
          * @type String
          */
         this.setAttributeConfig('activationEvent', {
@@ -635,7 +588,7 @@
 
         /**
          * The element that contains the tab's label.
-         * @config labelEl
+         * @attribute labelEl
          * @type HTMLElement
          */
         this.setAttributeConfig('labelEl', {
@@ -659,7 +612,7 @@
 
         /**
          * The tab's label text (or innerHTML).
-         * @config label
+         * @attribute label
          * @type String
          */
         this.setAttributeConfig('label', {
@@ -676,7 +629,7 @@
         
         /**
          * The HTMLElement that contains the tab's content.
-         * @config contentEl
+         * @attribute contentEl
          * @type HTMLElement
          */
         this.setAttributeConfig('contentEl', {
@@ -695,7 +648,7 @@
         
         /**
          * The tab's content.
-         * @config content
+         * @attribute content
          * @type String
          */
         this.setAttributeConfig('content', {
@@ -709,7 +662,7 @@
         
         /**
          * The tab's data source, used for loading content dynamically.
-         * @config dataSrc
+         * @attribute dataSrc
          * @type String
          */
         this.setAttributeConfig('dataSrc', {
@@ -718,7 +671,7 @@
         
         /**
          * Whether or not content should be reloaded for every view.
-         * @config cacheData
+         * @attribute cacheData
          * @type Boolean
          * @default false
          */
@@ -729,7 +682,7 @@
         
         /**
          * The method to use for the data request.
-         * @config loadMethod
+         * @attribute loadMethod
          * @type String
          * @default "GET"
          */
@@ -740,7 +693,7 @@
 
         /**
          * Whether or not any data has been loaded from the server.
-         * @config dataLoaded
+         * @attribute dataLoaded
          * @type Boolean
          */        
         this.setAttributeConfig('dataLoaded', {
@@ -751,7 +704,7 @@
         
         /**
          * Number if milliseconds before aborting and calling failure handler.
-         * @config dataTimeout
+         * @attribute dataTimeout
          * @type Number
          * @default null
          */
@@ -764,7 +717,7 @@
          * Whether or not the tab is currently active.
          * If a dataSrc is set for the tab, the content will be loaded from
          * the given source.
-         * @config active
+         * @attribute active
          * @type Boolean
          */
         this.setAttributeConfig('active', {
@@ -785,7 +738,7 @@
         
         /**
          * Whether or not the tab is disabled.
-         * @config disabled
+         * @attribute disabled
          * @type Boolean
          */
         this.setAttributeConfig('disabled', {
@@ -802,12 +755,13 @@
         
         /**
          * The href of the tab's anchor element.
-         * @config href
+         * @attribute href
          * @type String
          * @default '#'
          */
         this.setAttributeConfig('href', {
-            value: attr.href || '#',
+            value: attr.href ||
+                    this.getElementsByTagName('a')[0].getAttribute('href', 2) || '#',
             method: function(value) {
                 this.getElementsByTagName('a')[0].href = value;
             },
@@ -816,7 +770,7 @@
         
         /**
          * The Whether or not the tab's content is visible.
-         * @config contentVisible
+         * @attribute contentVisible
          * @type Boolean
          * @default false
          */
@@ -827,8 +781,8 @@
                     this.get('contentEl').style.display = 'block';
                     
                     if ( this.get('dataSrc') ) {
-                     // load dynamic content unless already loaded and caching
-                        if ( !this.get('dataLoaded') || !this.get('cacheData') ) {
+                     // load dynamic content unless already loading or loaded and caching
+                        if ( !this._loading && !(this.get('dataLoaded') && this.get('cacheData')) ) {
                             _dataConnect.call(this);
                         }
                     }
@@ -895,7 +849,7 @@
         }
 
         Dom.addClass(this.get('contentEl').parentNode, this.LOADING_CLASSNAME);
-        
+        this._loading = true; 
         this.dataConnection = YAHOO.util.Connect.asyncRequest(
             this.get('loadMethod'),
             this.get('dataSrc'), 
@@ -906,12 +860,14 @@
                     this.dataConnection = null;
                     Dom.removeClass(this.get('contentEl').parentNode,
                             this.LOADING_CLASSNAME);
+                    this._loading = false;
                 },
                 failure: function(o) {
                     this.loadHandler.failure.call(this, o);
                     this.dataConnection = null;
                     Dom.removeClass(this.get('contentEl').parentNode,
                             this.LOADING_CLASSNAME);
+                    this._loading = false;
                 },
                 scope: this,
                 timeout: this.get('dataTimeout')
@@ -920,102 +876,6 @@
     };
     
     YAHOO.widget.Tab = Tab;
-    
-    /**
-     * Fires before the active state is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p>If handler returns false, the change will be cancelled, and the value will not
-     * be set.</p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> beforeActiveChange<br>
-     * <code>&lt;Boolean&gt;
-     * prevValue</code> the current value<br>
-     * <code>&lt;Boolean&gt;
-     * newValue</code> the new value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('beforeActiveChange', handler);</code></p>
-     * @event beforeActiveChange
-     */
-        
-    /**
-     * Fires after the active state is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> activeChange<br>
-     * <code>&lt;Boolean&gt;
-     * prevValue</code> the previous value<br>
-     * <code>&lt;Boolean&gt;
-     * newValue</code> the updated value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('activeChange', handler);</code></p>
-     * @event activeChange
-     */
-     
-    /**
-     * Fires before the tab label is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p>If handler returns false, the change will be cancelled, and the value will not
-     * be set.</p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> beforeLabelChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the current value<br>
-     * <code>&lt;String&gt;
-     * newValue</code> the new value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('beforeLabelChange', handler);</code></p>
-     * @event beforeLabelChange
-     */
-        
-    /**
-     * Fires after the tab label is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> labelChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the previous value<br>
-     * <code>&lt;String&gt;
-     * newValue</code> the updated value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('labelChange', handler);</code></p>
-     * @event labelChange
-     */
-     
-    /**
-     * Fires before the tab content is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p>If handler returns false, the change will be cancelled, and the value will not
-     * be set.</p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> beforeContentChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the current value<br>
-     * <code>&lt;String&gt;
-     * newValue</code> the new value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('beforeContentChange', handler);</code></p>
-     * @event beforeContentChange
-     */
-        
-    /**
-     * Fires after the tab content is changed.
-     * <p>See: <a href="YAHOO.util.Element.html#addListener">Element.addListener</a></p>
-     * <p><strong>Event fields:</strong><br>
-     * <code>&lt;String&gt; type</code> contentChange<br>
-     * <code>&lt;String&gt;
-     * prevValue</code> the previous value<br>
-     * <code>&lt;Boolean&gt;
-     * newValue</code> the updated value</p>
-     * <p><strong>Usage:</strong><br>
-     * <code>var handler = function(e) {var previous = e.prevValue};<br>
-     * myTabs.addListener('contentChange', handler);</code></p>
-     * @event contentChange
-     */
 })();
 
-YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.2.1", build: "193"});
+YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.4.1", build: "742"});

Modified: jifty/branches/jquery/share/web/static/js/yui/yahoo.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/yui/yahoo.js	(original)
+++ jifty/branches/jquery/share/web/static/js/yui/yahoo.js	Mon Jan 21 11:08:06 2008
@@ -2,7 +2,7 @@
 Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 Code licensed under the BSD License:
 http://developer.yahoo.net/yui/license.txt
-version: 2.2.1
+version: 2.4.1
 */
 /**
  * The YAHOO object is the single global object used by YUI Library.  It
@@ -14,10 +14,11 @@
  */
 
 /**
- * YAHOO_config is not included part of the library.  Instead it is an object
- * that can be defined by the implementer immediately before including the
- * YUI library.  The properties included in this object will be used to
- * configure global properties needed as soon as the library begins to load.
+ * YAHOO_config is not included as part of the library.  Instead it is an 
+ * object that can be defined by the implementer immediately before 
+ * including the YUI library.  The properties included in this object
+ * will be used to configure global properties needed as soon as the 
+ * library begins to load.
  * @class YAHOO_config
  * @static
  */
@@ -28,9 +29,39 @@
  * information for the module. See <a href="YAHOO.env.html#getVersion">
  * YAHOO.env.getVersion</a> for the description of the version data structure.
  * @property listener
+ * @type Function
  * @static
+ * @default undefined
  */
-if (typeof YAHOO == "undefined") {
+
+/**
+ * Set to true if the library will be dynamically loaded after window.onload.
+ * Defaults to false 
+ * @property injecting
+ * @type boolean
+ * @static
+ * @default undefined
+ */
+
+/**
+ * Instructs the yuiloader component to dynamically load yui components and
+ * their dependencies.  See the yuiloader documentation for more information
+ * about dynamic loading
+ * @property load
+ * @static
+ * @default undefined
+ * @see yuiloader
+ */
+
+/**
+ * Forces the use of the supplied locale where applicable in the library
+ * @property locale
+ * @type string
+ * @static
+ * @default undefined
+ */
+
+if (typeof YAHOO == "undefined" || !YAHOO) {
     /**
      * The YAHOO global namespace object.  If YAHOO is already defined, the
      * existing YAHOO object will not be overwritten so that defined
@@ -100,34 +131,6 @@
     }
 };
 
-
-/**
- * Initializes the global by creating the default namespaces and applying
- * any new configuration information that is detected.
- * @method init
- * @static
- */
-YAHOO.init = function() {
-    this.namespace("util", "widget", "example");
-    if (typeof YAHOO_config != "undefined") {
-        var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
-        if (l) {
-            // if YAHOO is loaded multiple times we need to check to see if
-            // this is a new config object.  If it is, add the new component
-            // load listener to the stack
-            for (i=0;i<ls.length;i=i+1) {
-                if (ls[i]==l) {
-                    unique=false;
-                    break;
-                }
-            }
-            if (unique) {
-                ls.push(l);
-            }
-        }
-    }
-};
-
 /**
  * Registers a module with the YAHOO object
  * @method register
@@ -171,10 +174,10 @@
  * YAHOO.env is used to keep track of what is known about the YUI library and
  * the browsing environment
  * @class YAHOO.env
- * @type Object
  * @static
  */
 YAHOO.env = YAHOO.env || {
+
     /**
      * Keeps the version info for all YUI modules that have reported themselves
      * @property modules
@@ -188,122 +191,283 @@
      * @property listeners
      * @type Function[]
      */
-    listeners: [],
-    
-    /**
-     * Returns the version data for the specified module:
-     *      <dl>
-     *      <dt>name:</dt>      <dd>The name of the module</dd>
-     *      <dt>version:</dt>   <dd>The version in use</dd>
-     *      <dt>build:</dt>     <dd>The build number in use</dd>
-     *      <dt>versions:</dt>  <dd>All versions that were registered</dd>
-     *      <dt>builds:</dt>    <dd>All builds that were registered.</dd>
-     *      <dt>mainClass:</dt> <dd>An object that was was stamped with the
-     *                 current version and build. If 
-     *                 mainClass.VERSION != version or mainClass.BUILD != build,
-     *                 multiple versions of pieces of the library have been
-     *                 loaded, potentially causing issues.</dd>
-     *       </dl>
-     *
-     * @method getVersion
-     * @static
-     * @param {String}  name the name of the module (event, slider, etc)
-     * @return {Object} The version info
-     */
-    getVersion: function(name) {
-        return YAHOO.env.modules[name] || null;
-    }
+    listeners: []
+};
+
+/**
+ * Returns the version data for the specified module:
+ *      <dl>
+ *      <dt>name:</dt>      <dd>The name of the module</dd>
+ *      <dt>version:</dt>   <dd>The version in use</dd>
+ *      <dt>build:</dt>     <dd>The build number in use</dd>
+ *      <dt>versions:</dt>  <dd>All versions that were registered</dd>
+ *      <dt>builds:</dt>    <dd>All builds that were registered.</dd>
+ *      <dt>mainClass:</dt> <dd>An object that was was stamped with the
+ *                 current version and build. If 
+ *                 mainClass.VERSION != version or mainClass.BUILD != build,
+ *                 multiple versions of pieces of the library have been
+ *                 loaded, potentially causing issues.</dd>
+ *       </dl>
+ *
+ * @method getVersion
+ * @static
+ * @param {String}  name the name of the module (event, slider, etc)
+ * @return {Object} The version info
+ */
+YAHOO.env.getVersion = function(name) {
+    return YAHOO.env.modules[name] || null;
 };
 
 /**
+ * Do not fork for a browser if it can be avoided.  Use feature detection when
+ * you can.  Use the user agent as a last resort.  YAHOO.env.ua stores a version
+ * number for the browser engine, 0 otherwise.  This value may or may not map
+ * to the version number of the browser using the engine.  The value is 
+ * presented as a float so that it can easily be used for boolean evaluation 
+ * as well as for looking for a particular range of versions.  Because of this, 
+ * some of the granularity of the version info may be lost (e.g., Gecko 1.8.0.9 
+ * reports 1.8).
+ * @class YAHOO.env.ua
+ * @static
+ */
+YAHOO.env.ua = function() {
+    var o={
+
+        /**
+         * Internet Explorer version number or 0.  Example: 6
+         * @property ie
+         * @type float
+         */
+        ie:0,
+
+        /**
+         * Opera version number or 0.  Example: 9.2
+         * @property opera
+         * @type float
+         */
+        opera:0,
+
+        /**
+         * Gecko engine revision number.  Will evaluate to 1 if Gecko 
+         * is detected but the revision could not be found. Other browsers
+         * will be 0.  Example: 1.8
+         * <pre>
+         * Firefox 1.0.0.4: 1.7.8   <-- Reports 1.7
+         * Firefox 1.5.0.9: 1.8.0.9 <-- Reports 1.8
+         * Firefox 2.0.0.3: 1.8.1.3 <-- Reports 1.8
+         * Firefox 3 alpha: 1.9a4   <-- Reports 1.9
+         * </pre>
+         * @property gecko
+         * @type float
+         */
+        gecko:0,
+
+        /**
+         * AppleWebKit version.  KHTML browsers that are not WebKit browsers 
+         * will evaluate to 1, other browsers 0.  Example: 418.9.1
+         * <pre>
+         * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the 
+         *                                   latest available for Mac OSX 10.3.
+         * Safari 2.0.2:         416     <-- hasOwnProperty introduced
+         * Safari 2.0.4:         418     <-- preventDefault fixed
+         * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run
+         *                                   different versions of webkit
+         * Safari 2.0.4 (419.3): 419     <-- Current Safari release
+         * Webkit 212 nightly:   522+    <-- Safari 3.0 (with native SVG) should
+         *                                   be higher than this
+         *                                   
+         * </pre>
+         * http://developer.apple.com/internet/safari/uamatrix.html
+         * @property webkit
+         * @type float
+         */
+        webkit:0,
+
+        /**
+         * The mobile property will be set to a string containing any relevant
+         * user agent information when a modern mobile browser is detected.
+         * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series
+         * devices with the WebKit-based browser, and Opera Mini.  
+         * @property mobile 
+         * @type string
+         */
+        mobile: null 
+    };
+
+    var ua=navigator.userAgent, m;
+
+    // Modern KHTML browsers should qualify as Safari X-Grade
+    if ((/KHTML/).test(ua)) {
+        o.webkit=1;
+    }
+    // Modern WebKit browsers are at least X-Grade
+    m=ua.match(/AppleWebKit\/([^\s]*)/);
+    if (m&&m[1]) {
+        o.webkit=parseFloat(m[1]);
+
+        // Mobile browser check
+        if (/ Mobile\//.test(ua)) {
+            o.mobile = "Apple"; // iPhone or iPod Touch
+        } else {
+            m=ua.match(/NokiaN[^\/]*/);
+            if (m) {
+                o.mobile = m[0]; // Nokia N-series, ex: NokiaN95
+            }
+        }
+
+    }
+
+    if (!o.webkit) { // not webkit
+        // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)
+        m=ua.match(/Opera[\s\/]([^\s]*)/);
+        if (m&&m[1]) {
+            o.opera=parseFloat(m[1]);
+            m=ua.match(/Opera Mini[^;]*/);
+            if (m) {
+                o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316
+            }
+        } else { // not opera or webkit
+            m=ua.match(/MSIE\s([^;]*)/);
+            if (m&&m[1]) {
+                o.ie=parseFloat(m[1]);
+            } else { // not opera, webkit, or ie
+                m=ua.match(/Gecko\/([^\s]*)/);
+                if (m) {
+                    o.gecko=1; // Gecko detected, look for revision
+                    m=ua.match(/rv:([^\s\)]*)/);
+                    if (m&&m[1]) {
+                        o.gecko=parseFloat(m[1]);
+                    }
+                }
+            }
+        }
+    }
+    
+    return o;
+}();
+
+/*
+ * Initializes the global by creating the default namespaces and applying
+ * any new configuration information that is detected.  This is the setup
+ * for env.
+ * @method init
+ * @static
+ * @private
+ */
+(function() {
+    YAHOO.namespace("util", "widget", "example");
+    if ("undefined" !== typeof YAHOO_config) {
+        var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;
+        if (l) {
+            // if YAHOO is loaded multiple times we need to check to see if
+            // this is a new config object.  If it is, add the new component
+            // load listener to the stack
+            for (i=0;i<ls.length;i=i+1) {
+                if (ls[i]==l) {
+                    unique=false;
+                    break;
+                }
+            }
+            if (unique) {
+                ls.push(l);
+            }
+        }
+    }
+})();
+/**
  * Provides the language utilites and extensions used by the library
  * @class YAHOO.lang
  */
-YAHOO.lang = {
+YAHOO.lang = YAHOO.lang || {
     /**
-     * Determines whether or not the provided object is an array
+     * Determines whether or not the provided object is an array.
+     * Testing typeof/instanceof/constructor of arrays across frame 
+     * boundaries isn't possible in Safari unless you have a reference
+     * to the other frame to test against its Array prototype.  To
+     * handle this case, we test well-known array properties instead.
+     * properties.
      * @method isArray
-     * @param {any} obj The object being testing
+     * @param {any} o The object being testing
      * @return Boolean
      */
-    isArray: function(obj) { // frames lose type, so test constructor string
-        if (obj && obj.constructor && 
-                   obj.constructor.toString().indexOf('Array') > -1) {
-            return true;
-        } else {
-            return YAHOO.lang.isObject(obj) && obj.constructor == Array;
+    isArray: function(o) { 
+
+        if (o) {
+           var l = YAHOO.lang;
+           return l.isNumber(o.length) && l.isFunction(o.splice);
         }
+        return false;
     },
 
     /**
      * Determines whether or not the provided object is a boolean
      * @method isBoolean
-     * @param {any} obj The object being testing
+     * @param {any} o The object being testing
      * @return Boolean
      */
-    isBoolean: function(obj) {
-        return typeof obj == 'boolean';
+    isBoolean: function(o) {
+        return typeof o === 'boolean';
     },
     
     /**
      * Determines whether or not the provided object is a function
      * @method isFunction
-     * @param {any} obj The object being testing
+     * @param {any} o The object being testing
      * @return Boolean
      */
-    isFunction: function(obj) {
-        return typeof obj == 'function';
+    isFunction: function(o) {
+        return typeof o === 'function';
     },
         
     /**
      * Determines whether or not the provided object is null
      * @method isNull
-     * @param {any} obj The object being testing
+     * @param {any} o The object being testing
      * @return Boolean
      */
-    isNull: function(obj) {
-        return obj === null;
+    isNull: function(o) {
+        return o === null;
     },
         
     /**
      * Determines whether or not the provided object is a legal number
      * @method isNumber
-     * @param {any} obj The object being testing
+     * @param {any} o The object being testing
      * @return Boolean
      */
-    isNumber: function(obj) {
-        return typeof obj == 'number' && isFinite(obj);
+    isNumber: function(o) {
+        return typeof o === 'number' && isFinite(o);
     },
       
     /**
      * Determines whether or not the provided object is of type object
      * or function
      * @method isObject
-     * @param {any} obj The object being testing
+     * @param {any} o The object being testing
      * @return Boolean
      */  
-    isObject: function(obj) {
-        return obj && (typeof obj == 'object' || YAHOO.lang.isFunction(obj));
+    isObject: function(o) {
+return (o && (typeof o === 'object' || YAHOO.lang.isFunction(o))) || false;
     },
         
     /**
      * Determines whether or not the provided object is a string
      * @method isString
-     * @param {any} obj The object being testing
+     * @param {any} o The object being testing
      * @return Boolean
      */
-    isString: function(obj) {
-        return typeof obj == 'string';
+    isString: function(o) {
+        return typeof o === 'string';
     },
         
     /**
      * Determines whether or not the provided object is undefined
      * @method isUndefined
-     * @param {any} obj The object being testing
+     * @param {any} o The object being testing
      * @return Boolean
      */
-    isUndefined: function(obj) {
-        return typeof obj == 'undefined';
+    isUndefined: function(o) {
+        return typeof o === 'undefined';
     },
     
     /**
@@ -323,21 +487,44 @@
      * alert(YAHOO.lang.hasOwnProperty(a, 'foo')); // false when using fallback
      * </pre>
      * @method hasOwnProperty
-     * @param {any} obj The object being testing
+     * @param {any} o The object being testing
      * @return Boolean
      */
-    hasOwnProperty: function(obj, prop) {
+    hasOwnProperty: function(o, prop) {
         if (Object.prototype.hasOwnProperty) {
-            return obj.hasOwnProperty(prop);
+            return o.hasOwnProperty(prop);
         }
         
-        return !YAHOO.lang.isUndefined(obj[prop]) && 
-                obj.constructor.prototype[prop] !== obj[prop];
+        return !YAHOO.lang.isUndefined(o[prop]) && 
+                o.constructor.prototype[prop] !== o[prop];
     },
-        
+ 
+    /**
+     * IE will not enumerate native functions in a derived object even if the
+     * function was overridden.  This is a workaround for specific functions 
+     * we care about on the Object prototype. 
+     * @property _IEEnumFix
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @static
+     * @private
+     */
+    _IEEnumFix: function(r, s) {
+        if (YAHOO.env.ua.ie) {
+            var add=["toString", "valueOf"], i;
+            for (i=0;i<add.length;i=i+1) {
+                var fname=add[i],f=s[fname];
+                if (YAHOO.lang.isFunction(f) && f!=Object.prototype[fname]) {
+                    r[fname]=f;
+                }
+            }
+        }
+    },
+       
     /**
      * Utility to set up the prototype, constructor and superclass properties to
      * support an inheritance strategy that can chain constructors and methods.
+     * Static members will not be inherited.
      *
      * @method extend
      * @static
@@ -366,51 +553,375 @@
             for (var i in overrides) {
                 subc.prototype[i]=overrides[i];
             }
+
+            YAHOO.lang._IEEnumFix(subc.prototype, overrides);
         }
     },
-    
+   
     /**
-     * Applies all prototype properties in the supplier to the receiver if the
-     * receiver does not have these properties yet.  Optionally, one or more
-     * methods/properties can be specified (as additional parameters).  This
-     * option will overwrite the property if receiver has it already.
+     * Applies all properties in the supplier to the receiver if the
+     * receiver does not have these properties yet.  Optionally, one or 
+     * more methods/properties can be specified (as additional 
+     * parameters).  This option will overwrite the property if receiver 
+     * has it already.  If true is passed as the third parameter, all 
+     * properties will be applied and _will_ overwrite properties in 
+     * the receiver.
      *
-     * @method augment
+     * @method augmentObject
      * @static
+     * @since 2.3.0
      * @param {Function} r  the object to receive the augmentation
      * @param {Function} s  the object that supplies the properties to augment
-     * @param {String*}  arguments zero or more properties methods to augment the
-     *                             receiver with.  If none specified, everything
-     *                             in the supplier will be used unless it would
-     *                             overwrite an existing property in the receiver
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything
+     *        in the supplier will be used unless it would
+     *        overwrite an existing property in the receiver. If true
+     *        is specified as the third parameter, all properties will
+     *        be applied and will overwrite an existing property in
+     *        the receiver
      */
-    augment: function(r, s) {
+    augmentObject: function(r, s) {
         if (!s||!r) {
-            throw new Error("YAHOO.lang.augment failed, please check that " +
-                            "all dependencies are included.");
+            throw new Error("Absorb failed, verify dependencies.");
         }
-        var rp=r.prototype, sp=s.prototype, a=arguments, i, p;
-        if (a[2]) {
+        var a=arguments, i, p, override=a[2];
+        if (override && override!==true) { // only absorb the specified properties
             for (i=2; i<a.length; i=i+1) {
-                rp[a[i]] = sp[a[i]];
+                r[a[i]] = s[a[i]];
+            }
+        } else { // take everything, overwriting only if the third parameter is true
+            for (p in s) { 
+                if (override || !r[p]) {
+                    r[p] = s[p];
+                }
+            }
+            
+            YAHOO.lang._IEEnumFix(r, s);
+        }
+    },
+ 
+    /**
+     * Same as YAHOO.lang.augmentObject, except it only applies prototype properties
+     * @see YAHOO.lang.augmentObject
+     * @method augmentProto
+     * @static
+     * @param {Function} r  the object to receive the augmentation
+     * @param {Function} s  the object that supplies the properties to augment
+     * @param {String*|boolean}  arguments zero or more properties methods 
+     *        to augment the receiver with.  If none specified, everything 
+     *        in the supplier will be used unless it would overwrite an existing 
+     *        property in the receiver.  if true is specified as the third 
+     *        parameter, all properties will be applied and will overwrite an 
+     *        existing property in the receiver
+     */
+    augmentProto: function(r, s) {
+        if (!s||!r) {
+            throw new Error("Augment failed, verify dependencies.");
+        }
+        //var a=[].concat(arguments);
+        var a=[r.prototype,s.prototype];
+        for (var i=2;i<arguments.length;i=i+1) {
+            a.push(arguments[i]);
+        }
+        YAHOO.lang.augmentObject.apply(this, a);
+    },
+
+      
+    /**
+     * Returns a simple string representation of the object or array.
+     * Other types of objects will be returned unprocessed.  Arrays
+     * are expected to be indexed.  Use object notation for
+     * associative arrays.
+     * @method dump
+     * @since 2.3.0
+     * @param o {Object} The object to dump
+     * @param d {int} How deep to recurse child objects, default 3
+     * @return {String} the dump result
+     */
+    dump: function(o, d) {
+        var l=YAHOO.lang,i,len,s=[],OBJ="{...}",FUN="f(){...}",
+            COMMA=', ', ARROW=' => ';
+
+        // Cast non-objects to string
+        // Skip dates because the std toString is what we want
+        // Skip HTMLElement-like objects because trying to dump 
+        // an element will cause an unhandled exception in FF 2.x
+        if (!l.isObject(o)) {
+            return o + "";
+        } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
+            return o;
+        } else if  (l.isFunction(o)) {
+            return FUN;
+        }
+
+        // dig into child objects the depth specifed. Default 3
+        d = (l.isNumber(d)) ? d : 3;
+
+        // arrays [1, 2, 3]
+        if (l.isArray(o)) {
+            s.push("[");
+            for (i=0,len=o.length;i<len;i=i+1) {
+                if (l.isObject(o[i])) {
+                    s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                } else {
+                    s.push(o[i]);
+                }
+                s.push(COMMA);
+            }
+            if (s.length > 1) {
+                s.pop();
             }
+            s.push("]");
+        // objects {k1 => v1, k2 => v2}
         } else {
-            for (p in sp) { 
-                if (!rp[p]) {
-                    rp[p] = sp[p];
+            s.push("{");
+            for (i in o) {
+                if (l.hasOwnProperty(o, i)) {
+                    s.push(i + ARROW);
+                    if (l.isObject(o[i])) {
+                        s.push((d > 0) ? l.dump(o[i], d-1) : OBJ);
+                    } else {
+                        s.push(o[i]);
+                    }
+                    s.push(COMMA);
+                }
+            }
+            if (s.length > 1) {
+                s.pop();
+            }
+            s.push("}");
+        }
+
+        return s.join("");
+    },
+
+    /**
+     * Does variable substitution on a string. It scans through the string 
+     * looking for expressions enclosed in { } braces. If an expression 
+     * is found, it is used a key on the object.  If there is a space in
+     * the key, the first word is used for the key and the rest is provided
+     * to an optional function to be used to programatically determine the
+     * value (the extra information might be used for this decision). If 
+     * the value for the key in the object, or what is returned from the
+     * function has a string value, number value, or object value, it is 
+     * substituted for the bracket expression and it repeats.  If this
+     * value is an object, it uses the Object's toString() if this has
+     * been overridden, otherwise it does a shallow dump of the key/value
+     * pairs.
+     * @method substitute
+     * @since 2.3.0
+     * @param s {String} The string that will be modified.
+     * @param o {Object} An object containing the replacement values
+     * @param f {Function} An optional function that can be used to
+     *                     process each match.  It receives the key,
+     *                     value, and any extra metadata included with
+     *                     the key inside of the braces.
+     * @return {String} the substituted string
+     */
+    substitute: function (s, o, f) {
+        var i, j, k, key, v, meta, l=YAHOO.lang, saved=[], token, 
+            DUMP='dump', SPACE=' ', LBRACE='{', RBRACE='}';
+
+
+        for (;;) {
+            i = s.lastIndexOf(LBRACE);
+            if (i < 0) {
+                break;
+            }
+            j = s.indexOf(RBRACE, i);
+            if (i + 1 >= j) {
+                break;
+            }
+
+            //Extract key and meta info 
+            token = s.substring(i + 1, j);
+            key = token;
+            meta = null;
+            k = key.indexOf(SPACE);
+            if (k > -1) {
+                meta = key.substring(k + 1);
+                key = key.substring(0, k);
+            }
+
+            // lookup the value
+            v = o[key];
+
+            // if a substitution function was provided, execute it
+            if (f) {
+                v = f(key, v, meta);
+            }
+
+            if (l.isObject(v)) {
+                if (l.isArray(v)) {
+                    v = l.dump(v, parseInt(meta, 10));
+                } else {
+                    meta = meta || "";
+
+                    // look for the keyword 'dump', if found force obj dump
+                    var dump = meta.indexOf(DUMP);
+                    if (dump > -1) {
+                        meta = meta.substring(4);
+                    }
+
+                    // use the toString if it is not the Object toString 
+                    // and the 'dump' meta info was not found
+                    if (v.toString===Object.prototype.toString||dump>-1) {
+                        v = l.dump(v, parseInt(meta, 10));
+                    } else {
+                        v = v.toString();
+                    }
                 }
+            } else if (!l.isString(v) && !l.isNumber(v)) {
+                // This {block} has no replace string. Save it for later.
+                v = "~-" + saved.length + "-~";
+                saved[saved.length] = token;
+
+                // break;
             }
+
+            s = s.substring(0, i) + v + s.substring(j + 1);
+
+
+        }
+
+        // restore saved {block}s
+        for (i=saved.length-1; i>=0; i=i-1) {
+            s = s.replace(new RegExp("~-" + i + "-~"), "{"  + saved[i] + "}", "g");
+        }
+
+        return s;
+    },
+
+
+    /**
+     * Returns a string without any leading or trailing whitespace.  If 
+     * the input is not a string, the input will be returned untouched.
+     * @method trim
+     * @since 2.3.0
+     * @param s {string} the string to trim
+     * @return {string} the trimmed string
+     */
+    trim: function(s){
+        try {
+            return s.replace(/^\s+|\s+$/g, "");
+        } catch(e) {
+            return s;
+        }
+    },
+
+    /**
+     * Returns a new object containing all of the properties of
+     * all the supplied objects.  The properties from later objects
+     * will overwrite those in earlier objects.
+     * @method merge
+     * @since 2.3.0
+     * @param arguments {Object*} the objects to merge
+     * @return the new merged object
+     */
+    merge: function() {
+        var o={}, a=arguments;
+        for (var i=0, l=a.length; i<l; i=i+1) {
+            YAHOO.lang.augmentObject(o, a[i], true);
         }
+        return o;
+    },
+
+    /**
+     * Executes the supplied function in the scope of the supplied 
+     * object 'when' milliseconds later.  Executes the function a 
+     * single time unless periodic is set to true.
+     * @method later
+     * @since 2.4.0
+     * @param when {int} the number of milliseconds to wait until the fn 
+     * is executed
+     * @param o the scope object
+     * @param fn {Function|String} the function to execute or the name of 
+     * the method in the 'o' object to execute
+     * @param data [Array] data that is provided to the function.  This accepts
+     * either a single item or an array.  If an array is provided, the
+     * function is executed with one parameter for each array item.  If
+     * you need to pass a single array parameter, it needs to be wrapped in
+     * an array [myarray]
+     * @param periodic {boolean} if true, executes continuously at supplied 
+     * interval until canceled
+     * @return a timer object. Call the cancel() method on this object to 
+     * stop the timer.
+     */
+    later: function(when, o, fn, data, periodic) {
+        when = when || 0; 
+        o = o || {};
+        var m=fn, d=data, f, r;
+
+        if (YAHOO.lang.isString(fn)) {
+            m = o[fn];
+        }
+
+        if (!m) {
+            throw new TypeError("method undefined");
+        }
+
+        if (!YAHOO.lang.isArray(d)) {
+            d = [data];
+        }
+
+        f = function() {
+            m.apply(o, d);
+        };
+
+        r = (periodic) ? setInterval(f, when) : setTimeout(f, when);
+
+        return {
+            interval: periodic,
+            cancel: function() {
+                if (this.interval) {
+                    clearInterval(r);
+                } else {
+                    clearTimeout(r);
+                }
+            }
+        };
+    },
+
+    /**
+     * A convenience method for detecting a legitimate non-null value.
+     * Returns false for null/undefined/NaN, true for other values, 
+     * including 0/false/''
+     * @method isValue
+     * @since 2.3.0
+     * @param o {any} the item to test
+     * @return {boolean} true if it is not null/undefined/NaN || false
+     */
+    isValue: function(o) {
+        // return (o || o === false || o === 0 || o === ''); // Infinity fails
+        var l = YAHOO.lang;
+return (l.isObject(o) || l.isString(o) || l.isNumber(o) || l.isBoolean(o));
     }
-};
 
-YAHOO.init();
+};
 
 /*
  * An alias for <a href="YAHOO.lang.html">YAHOO.lang</a>
  * @class YAHOO.util.Lang
  */
 YAHOO.util.Lang = YAHOO.lang;
+ 
+/**
+ * Same as YAHOO.lang.augmentObject, except it only applies prototype 
+ * properties.  This is an alias for augmentProto.
+ * @see YAHOO.lang.augmentObject
+ * @method augment
+ * @static
+ * @param {Function} r  the object to receive the augmentation
+ * @param {Function} s  the object that supplies the properties to augment
+ * @param {String*|boolean}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver.  if true
+ *        is specified as the third parameter, all properties will
+ *        be applied and will overwrite an existing property in
+ *        the receiver
+ */
+YAHOO.lang.augment = YAHOO.lang.augmentProto;
 
 /**
  * An alias for <a href="YAHOO.lang.html#augment">YAHOO.lang.augment</a>
@@ -419,12 +930,12 @@
  * @static
  * @param {Function} r  the object to receive the augmentation
  * @param {Function} s  the object that supplies the properties to augment
- * @param {String*}  arguments zero or more properties methods to augment the
- *                             receiver with.  If none specified, everything
- *                             in the supplier will be used unless it would
- *                             overwrite an existing property in the receiver
+ * @param {String*}  arguments zero or more properties methods to 
+ *        augment the receiver with.  If none specified, everything
+ *        in the supplier will be used unless it would
+ *        overwrite an existing property in the receiver
  */
-YAHOO.augment = YAHOO.lang.augment;
+YAHOO.augment = YAHOO.lang.augmentProto;
        
 /**
  * An alias for <a href="YAHOO.lang.html#extend">YAHOO.lang.extend</a>
@@ -433,10 +944,9 @@
  * @param {Function} subc   the object to modify
  * @param {Function} superc the object to inherit
  * @param {Object} overrides  additional properties/methods to add to the
- *                              subclass prototype.  These will override the
- *                              matching items obtained from the superclass 
- *                              if present.
+ *        subclass prototype.  These will override the
+ *        matching items obtained from the superclass if present.
  */
 YAHOO.extend = YAHOO.lang.extend;
 
-YAHOO.register("yahoo", YAHOO, {version: "2.2.1", build: "193"});
+YAHOO.register("yahoo", YAHOO, {version: "2.4.1", build: "742"});

Modified: jifty/branches/jquery/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/Test.pm
==============================================================================
--- jifty/branches/jquery/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/Test.pm	(original)
+++ jifty/branches/jquery/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/Test.pm	Mon Jan 21 11:08:06 2008
@@ -66,7 +66,7 @@
     my $consumer_secret = delete $params{consumer_secret}
         or die "consumer_secret not passed to response_is!";
 
-    if ($url !~ /request_token/) {
+    if ($url =~ /access_token/) {
         $token_secret ||= $token_obj->secret;
         $params{oauth_token} ||= $token_obj->token;
     }
@@ -130,9 +130,7 @@
           map { Jifty->web->escape_uri($_||'') }
               uc($method),
               $url,
-              $normalized_request_parameters,
-              $consumer_secret,
-              $token_secret;
+              $normalized_request_parameters;
 
     my $signature;
 
@@ -147,7 +145,7 @@
               $token_secret;
         my $hmac = Digest::HMAC_SHA1->new($key);
         $hmac->add($signature_base_string);
-        $signature = $hmac->b64digest;
+        $signature = encode_base64($hmac->digest, '');
     }
 
     return ($signature, $signature_base_string, $normalized_request_parameters)

Modified: jifty/branches/jquery/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/View.pm
==============================================================================
--- jifty/branches/jquery/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/View.pm	(original)
+++ jifty/branches/jquery/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/View.pm	Mon Jan 21 11:08:06 2008
@@ -6,6 +6,7 @@
 
 template '/nuke/the/whales' => page {
     h1 { "Press the shiny red button." }
+    h2 { "You are human #" . Jifty->web->current_user->id . "." }
 };
 
 1;

Modified: jifty/branches/jquery/t/TestApp-Plugin-OAuth/t/00-test-setup.t
==============================================================================
--- jifty/branches/jquery/t/TestApp-Plugin-OAuth/t/00-test-setup.t	(original)
+++ jifty/branches/jquery/t/TestApp-Plugin-OAuth/t/00-test-setup.t	Mon Jan 21 11:08:06 2008
@@ -43,8 +43,8 @@
     oauth_version => '1.0');
 
 is($nrp, 'file=vacation.jpg&oauth_consumer_key=dpf43f3p2l4k3l03&oauth_nonce=kllo9940pd9333jh&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1191242096&oauth_token=nnch734d00sl2jdk&oauth_version=1.0&size=original', 'HMAC-SHA1 normalized request paramaters correct');
-is($sbs, 'GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal&kd94hf93k423kf44&pfkkdhi9sl3r4s00', 'HMAC-SHA1 signature-base-string correct');
-is($sig, 'Gcg/323lvAsQ707p+y41y14qWfY', 'HMAC-SHA1 signature correct');
+is($sbs, 'GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal', 'HMAC-SHA1 signature-base-string correct');
+is($sig, 'tR3+Ty81lMeYAr/Fid0kMTYa/WM=', 'HMAC-SHA1 signature correct');
 # }}}
 # sign RSA-SHA1 {{{
 ($sig, $sbs, $nrp) = sign(
@@ -63,7 +63,7 @@
     oauth_version => '1.0');
 
 is($nrp, 'file=vacation.jpg&oauth_consumer_key=dpf43f3p2l4k3l03&oauth_nonce=kllo9940pd9333jh&oauth_signature_method=RSA-SHA1&oauth_timestamp=1191242096&oauth_token=nnch734d00sl2jdk&oauth_version=1.0&size=original', 'RSA-SHA1 normalized request paramaters correct');
-is($sbs, 'GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DRSA-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal&kd94hf93k423kf44&pfkkdhi9sl3r4s00', 'RSA-SHA1 signature-base-string correct');
-is($sig, 'oSjbUzMjD4E+LeHMaYzYx1KyULDwuR6V9oeNgTLoO9m90iJh4d01J/8SzvHKT8N0y2vs1o8s72z19Eicj6l+mEmH5Rp0cwWOE9UdvC+JdFSIA1bmlwVPCFL7jDQqRSBJsXEiT44T5j9P+Dh5Z5WUjEgCExQyNP38Z3nMnYYOCRM=', 'RSA-SHA1 signature correct');
+is($sbs, 'GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DRSA-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal', 'RSA-SHA1 signature-base-string correct');
+is($sig, 'NA2rGBEAnHta9amI/lwEHmuJzkDF2CtfzPNc+jbQIvsFKi0AyRQFi1etC+yxmHLn6bHKSHmn/pR4GOhN+2AP5fi0Aw9mr9n/k7LybUCUwRK/OjJH7b8ESXhkluss+UXCZoLOeaO9Pxskdi1DzWMOhY8si9hfYsCGrHrVbdcqwcw=', 'RSA-SHA1 signature correct');
 # }}}
 

Modified: jifty/branches/jquery/t/TestApp-Plugin-OAuth/t/05-protected-resource.t
==============================================================================
--- jifty/branches/jquery/t/TestApp-Plugin-OAuth/t/05-protected-resource.t	(original)
+++ jifty/branches/jquery/t/TestApp-Plugin-OAuth/t/05-protected-resource.t	Mon Jan 21 11:08:06 2008
@@ -5,7 +5,7 @@
 use Test::More;
 BEGIN {
     if (eval { require Net::OAuth::Request; require Crypt::OpenSSL::RSA; 1 }) {
-        plan tests => 16;
+        plan tests => 31;
     }
     else {
         plan skip_all => "Net::OAuth isn't installed";
@@ -51,8 +51,44 @@
 $umech->content_contains('Logout');
 # }}}
 # }}}
+# make sure we're not logged in {{{
+response_is(
+    url                    => '/nuke/the/whales',
+    code                   => 200,
+    testname               => "200 - protected resource request",
+    consumer_secret        => 'bar',
+    oauth_consumer_key     => 'foo',
+    oauth_signature_method => 'PLAINTEXT',
+    oauth_token            => 'please',
+    token_secret           => 'letmein',
+);
+$cmech->content_contains("Login with a password", "redirected to login");
+$cmech->content_lacks("Press the shiny red button", "did NOT get to a protected page");
+# }}}}
 # basic protected request {{{
 get_access_token();
+
+response_is(
+    url                    => '/nuke/the/whales',
+    code                   => 200,
+    testname               => "200 - protected resource request",
+    consumer_secret        => 'bar',
+    oauth_consumer_key     => 'foo',
+    oauth_signature_method => 'PLAINTEXT',
+    oauth_token            => $token_obj->token,
+    token_secret           => $token_obj->secret,
+);
+$cmech->content_contains("Press the shiny red button", "got to a protected page");
+$cmech->content_contains("human #1.", "correct current_user");
+# }}}
+# without OAuth parameters, no access {{{
+$cmech->get_ok('/nuke/the/whales');
+
+$cmech->content_contains("Login with a password", "current_user unset");
+$cmech->content_lacks("Press the shiny red button", "did NOT get to a protected page");
+$cmech->content_lacks("human #1.", "did NOT get to a protected page");
+# }}}
+# access tokens last for more than one hit {{{
 response_is(
     url                    => '/nuke/the/whales',
     code                   => 200,
@@ -60,7 +96,26 @@
     consumer_secret        => 'bar',
     oauth_consumer_key     => 'foo',
     oauth_signature_method => 'PLAINTEXT',
+    oauth_token            => $token_obj->token,
+    token_secret           => $token_obj->secret,
 );
 $cmech->content_contains("Press the shiny red button", "got to a protected page");
+$cmech->content_contains("human #1.", "correct current_user");
 # }}}
+# expired access token {{{
+$token_obj->set_valid_until(DateTime->now->subtract(days => 1));
 
+response_is(
+    url                    => '/nuke/the/whales',
+    code                   => 200,
+    testname               => "200 - protected resource request",
+    consumer_secret        => 'bar',
+    oauth_consumer_key     => 'foo',
+    oauth_signature_method => 'PLAINTEXT',
+    oauth_token            => $token_obj->token,
+    token_secret           => $token_obj->secret,
+);
+$cmech->content_contains("Login with a password", "redirected to login");
+$cmech->content_lacks("Press the shiny red button", "did NOT get to a protected page");
+$cmech->content_lacks("human #1.", "did NOT get to a protected page");
+# }}}

Modified: jifty/branches/jquery/t/TestApp-Plugin-REST/t/02-basic-use.t
==============================================================================
--- jifty/branches/jquery/t/TestApp-Plugin-REST/t/02-basic-use.t	(original)
+++ jifty/branches/jquery/t/TestApp-Plugin-REST/t/02-basic-use.t	Mon Jan 21 11:08:06 2008
@@ -13,7 +13,7 @@
 use lib 't/lib';
 use Jifty::SubTest;
 
-use Jifty::Test tests => 78;
+use Jifty::Test tests => 79;
 use Jifty::Test::WWW::Mechanize;
 
 my $server  = Jifty::Test->make_server;
@@ -98,7 +98,9 @@
 is($mech->status,'404');
 
 $mech->get('/=/search/user/id/1/name/foo.yml');
-is($mech->status,'404');
+is($mech->status,'200');
+$content = get_content();
+is_deeply($content, []);
 
 # on GET    '/=/action'      => \&list_actions;
 

Added: jifty/branches/jquery/t/TestApp/lib/TestApp/Model/CanonTest.pm
==============================================================================
--- (empty file)
+++ jifty/branches/jquery/t/TestApp/lib/TestApp/Model/CanonTest.pm	Mon Jan 21 11:08:06 2008
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+
+package TestApp::Model::CanonTest;
+use Jifty::DBI::Schema;
+
+use TestApp::Record schema {
+   column column_1 => type is 'text';
+};
+
+# we want to drop all non-word chars                                           
+
+sub canonicalize_column_1 {
+    my $self = shift;
+    my $value = shift;
+
+    $value =~ s/\W//g;
+    return $value;
+}
+
+1;
+

Modified: jifty/branches/jquery/t/TestApp/t/06-validation.t
==============================================================================
--- jifty/branches/jquery/t/TestApp/t/06-validation.t	(original)
+++ jifty/branches/jquery/t/TestApp/t/06-validation.t	Mon Jan 21 11:08:06 2008
@@ -5,7 +5,7 @@
 use lib 't/lib';
 use Jifty::SubTest;
 
-use Jifty::Test tests => 22;
+use Jifty::Test tests => 27;
 use Jifty::Test::WWW::Mechanize;
 
 my $server  = Jifty::Test->make_server;
@@ -56,6 +56,15 @@
     "Getting validator.xml output for a form entry");
 $mech->content_lacks('<error id="errors-J:A:F-bar-dosomething">', " ... validator didn't return error for bar");
 
+$mech->get_ok("$URL/__jifty/validator.xml?J:A-canontest=TestApp::Action::CreateCanonTest&J:A:F-column_1-canontest=f-f&J:VALIDATE=1",
+    "Getting validator.xml output for a form entry to check canonicalize_");
+$mech->content_contains('<update name="J:A:F-column_1-canontest">ff</update>');
+
+$mech->get_ok("$URL/__jifty/validator.xml?J:A-canontest=TestApp::Action::CreateCanonTest&J:A:F-column_1-canontest=%3Bf&J:VALIDATE=1",
+    "Getting validator.xml output for a form entry to check canonicalize_");
+$mech->content_lacks('<ignored name="J:A:F-column_1-canontest"');
+$mech->content_contains('<update name="J:A:F-column_1-canontest">f</update>');
+
 TODO: {
 local $TODO = "Not implemented in Jifty yet";
 $mech->content_contains('<error id="errors-J:A:F-foo-dosomething">You need to fill in this field</error>', " ... validator returned error for foo");

Modified: jifty/branches/jquery/t/TestApp/t/14-template-paths.t
==============================================================================
--- jifty/branches/jquery/t/TestApp/t/14-template-paths.t	(original)
+++ jifty/branches/jquery/t/TestApp/t/14-template-paths.t	Mon Jan 21 11:08:06 2008
@@ -51,6 +51,6 @@
 
 my $mech = Jifty::Test::WWW::Mechanize->new;
 foreach my $test (@tests) {
-    $mech->get_ok( $URL . $test->{url}, "get '$URL$test->{url}'" );
+    $mech->get_ok( $URL . $test->{url}, "get '$URL: $test->{url}'" );
     $mech->content_contains( $test->{text}, "found content '$test->{text}'" );
 }


More information about the Jifty-commit mailing list