Commit 792e738bbb5de65f7c7e6337ad312230e7828458

Authored by Bryn Divey
1 parent b6b32707

Added new dashboard. Massive changes - very unstable.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6039 c91229c3-7414-0410-bfa2-8a42b809f60b
config/siteMap.inc
... ... @@ -34,6 +34,9 @@ $default->siteMap = new SiteMap(false);
34 34 $default->siteMap->addPage("login", "/login.php", "General", None, "");
35 35  
36 36 // dashboard
  37 +$default->siteMap->addPage("ajaxdashboard", "/dashboard2.php", "General", Guest, "dashboard2");
  38 +
  39 +// old dashboard
37 40 $default->siteMap->addPage("dashboard", "/dashboard.php", "General", Guest, "dashboard");
38 41 // dashboard news
39 42  
... ...
dashboard.php
... ... @@ -85,7 +85,7 @@ class DashboardDispatcher extends KTStandardDispatcher {
85 85  
86 86  
87 87 $oTemplating =& KTTemplating::getSingleton();
88   - $oTemplate = $oTemplating->loadTemplate("kt3/dashboard");
  88 + $oTemplate = $oTemplating->loadTemplate("kt3/olddashboard");
89 89 $aTemplateData = array(
90 90 "context" => $this,
91 91 "dashlets_left" => $aDashletsLeft,
... ...
dashboard2.php 0 → 100644
  1 +<?php
  2 +
  3 +/**
  4 + * $Id: dashboard.php 5758 2006-07-27 10:17:43Z bshuttle $
  5 + *
  6 + * Main dashboard page -- This page is presented to the user after login.
  7 + * It contains a high level overview of the users subscriptions, checked out
  8 + * document, pending approval routing documents, etc.
  9 + *
  10 + * The contents of this file are subject to the KnowledgeTree Public
  11 + * License Version 1.1 ("License"); You may not use this file except in
  12 + * compliance with the License. You may obtain a copy of the License at
  13 + * http://www.ktdms.com/KPL
  14 + *
  15 + * Software distributed under the License is distributed on an "AS IS"
  16 + * basis,
  17 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  18 + * for the specific language governing rights and limitations under the
  19 + * License.
  20 + *
  21 + * The Original Code is: KnowledgeTree Open Source
  22 + *
  23 + * The Initial Developer of the Original Code is The Jam Warehouse Software
  24 + * (Pty) Ltd, trading as KnowledgeTree.
  25 + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
  26 + * (C) 2006 The Jam Warehouse Software (Pty) Ltd;
  27 + * All Rights Reserved.
  28 + *
  29 + *
  30 + * @version $Revision: 5758 $
  31 + * @author Michael Joseph <michael@jamwarehouse.com>, Jam Warehouse (Pty) Ltd, South Africa
  32 + */
  33 +
  34 +// main library routines and defaults
  35 +require_once("config/dmsDefaults.php");
  36 +require_once(KT_LIB_DIR . "/unitmanagement/Unit.inc");
  37 +
  38 +require_once(KT_LIB_DIR . "/dashboard/dashletregistry.inc.php");
  39 +require_once(KT_LIB_DIR . "/dashboard/dashlet.inc.php");
  40 +require_once(KT_LIB_DIR . "/templating/templating.inc.php");
  41 +require_once(KT_LIB_DIR . "/templating/kt3template.inc.php");
  42 +require_once(KT_LIB_DIR . "/dispatcher.inc.php");
  43 +
  44 +require_once(KT_LIB_DIR . "/dashboard/DashletDisables.inc.php");
  45 +
  46 +$sectionName = "dashboard";
  47 +
  48 +class DashboardDispatcher extends KTStandardDispatcher {
  49 +
  50 + var $notifications = array();
  51 + var $sHelpPage = 'ktcore/dashboard.html';
  52 +
  53 + function DashboardDispatcher() {
  54 + $this->aBreadcrumbs = array(
  55 + array('action' => 'dashboard', 'name' => _kt('Dashboard')),
  56 + );
  57 + return parent::KTStandardDispatcher();
  58 + }
  59 + function do_main() {
  60 + $this->oPage->setShowPortlets(false);
  61 + // retrieve action items for the user.
  62 + // FIXME what is the userid?
  63 +
  64 +
  65 + $oDashletRegistry =& KTDashletRegistry::getSingleton();
  66 + $aDashlets = $oDashletRegistry->getDashlets($this->oUser);
  67 +
  68 + $this->sSection = "dashboard";
  69 + $this->oPage->setBreadcrumbDetails(_kt("Home"));
  70 + $this->oPage->title = _kt("Dashboard");
  71 +
  72 + // simplistic improvement over the standard rendering: float half left
  73 + // and half right. +Involves no JS -can leave lots of white-space at the bottom.
  74 +
  75 + $aDashletsLeft = array();
  76 + $aDashletsRight = array();
  77 +
  78 + $i = 0;
  79 + foreach ($aDashlets as $oDashlet) {
  80 + if ($i == 0) { $aDashletsLeft[] = $oDashlet; }
  81 + else {$aDashletsRight[] = $oDashlet; }
  82 + $i += 1;
  83 + $i %= 2;
  84 + }
  85 +
  86 + $this->oPage->requireJSResource('resources/js/dashboard.js');
  87 +
  88 + $oTemplating =& KTTemplating::getSingleton();
  89 + $oTemplate = $oTemplating->loadTemplate("kt3/dashboard");
  90 + $aTemplateData = array(
  91 + "context" => $this,
  92 + "dashlets_left" => $aDashletsLeft,
  93 + "dashlets_right" => $aDashletsRight,
  94 + );
  95 + return $oTemplate->render($aTemplateData);
  96 + }
  97 +
  98 + // return some kind of ID for each dashlet
  99 + // currently uses the class name
  100 + function _getDashletId($oDashlet) {
  101 + return get_class($oDashlet);
  102 + }
  103 +
  104 + // disable a dashlet.
  105 + // FIXME this very slightly violates the separation of concerns, but its not that flagrant.
  106 + function do_disableDashlet() {
  107 + $sNamespace = KTUtil::arrayGet($_REQUEST, 'fNamespace');
  108 + $iUserId = $this->oUser->getId();
  109 +
  110 + if (empty($sNamespace)) {
  111 + $this->errorRedirectToMain('No dashlet specified.');
  112 + exit(0);
  113 + }
  114 +
  115 + // do the "delete"
  116 +
  117 + $this->startTransaction();
  118 + $aParams = array('sNamespace' => $sNamespace, 'iUserId' => $iUserId);
  119 + $oDD = KTDashletDisable::createFromArray($aParams);
  120 + if (PEAR::isError($oDD)) {
  121 + $this->errorRedirectToMain('Failed to disable the dashlet.');
  122 + }
  123 +
  124 + $this->commitTransaction();
  125 + $this->successRedirectToMain('Dashlet disabled.');
  126 + }
  127 +}
  128 +
  129 +$oDispatcher = new DashboardDispatcher();
  130 +$oDispatcher->dispatch();
  131 +
  132 +?>
  133 +
... ...
lib/templating/kt3template.inc.php
... ... @@ -94,15 +94,22 @@ class KTPage {
94 94 $this->requireCSSResource("resources/css/kt-ie-icons.css", true);
95 95 /* default js files initialisation */
96 96 $aJS = Array();
97   - $aJS[] = 'thirdpartyjs/MochiKit/Base.js';
98   - $aJS[] = 'thirdpartyjs/MochiKit/Iter.js';
99   - $aJS[] = 'thirdpartyjs/MochiKit/DOM.js';
100   - $aJS[] = 'thirdpartyjs/MochiKit/Logging.js';
101   - $aJS[] = 'thirdpartyjs/MochiKit/Async.js';
102   - $aJS[] = 'thirdpartyjs/MochiKit/Signal.js';
103   - $aJS[] = 'resources/js/kt-utility.js';
104   - //$aJS[] = 'resources/js/translate.js';
105   - $aJS[] = 'presentation/i18nJavascript.php';
  97 + $aJS[] = 'thirdpartyjs/MochiKit/MochiKit.js';
  98 + $aJS[] = 'thirdpartyjs/MochiKit/New.js';
  99 + $aJS[] = 'thirdpartyjs/MochiKit/DragAndDrop.js';
  100 + $aJS[] = 'thirdpartyjs/MochiKit/Sortable.js';
  101 + $aJS[] = 'resources/js/kt-utility.js';
  102 + $aJS[] = 'presentation/i18nJavascript.php';
  103 +
  104 +
  105 + //$aJS[] = 'thirdpartyjs/MochiKit/Iter.js';
  106 + //$aJS[] = 'thirdpartyjs/MochiKit/DOM.js';
  107 + //$aJS[] = 'thirdpartyjs/MochiKit/Logging.js';
  108 + //$aJS[] = 'thirdpartyjs/MochiKit/Async.js';
  109 + //$aJS[] = 'thirdpartyjs/MochiKit/Signal.js';
  110 + //$aJS[] = 'thirdpartyjs/MochiKit/.js';
  111 + //$aJS[] = 'resources/js/translate.js';
  112 +
106 113 $this->requireJSResources($aJS);
107 114  
108 115 // this is horrid, but necessary.
... ... @@ -121,7 +128,8 @@ class KTPage {
121 128 function initMenu() {
122 129 // FIXME: we lost the getDefaultAction stuff - do we care?
123 130 // note that key == action. this is _important_, since we crossmatch the breadcrumbs against this for "active"
124   - $this->menu = array("dashboard" => $this->_actionHelper(array("name" => _kt("Dashboard"), "action" => "dashboard", "active" => 0)),
  131 + $this->menu = array("dashboard" => $this->_actionHelper(array("name" => _kt("Dashboard"), "action" => "ajaxdashboard", "active" => 0)),
  132 + "olddashboard" => $this->_actionHelper(array("name" => _kt("Old Dashboard"), "action" => "dashboard", "active" => 0)),
125 133 "browse" => $this->_actionHelper(array("name" => _kt("Browse Documents"), "action" => "browse", "active" => 0)),
126 134 "administration" => $this->_actionHelper(array("name" => _kt("DMS Administration"), "action" => "administration", "active" => 0)),);
127 135 }
... ...
login.php
... ... @@ -73,8 +73,8 @@ class LoginPageDispatcher extends KTDispatcher {
73 73  
74 74 function performLogin(&$oUser) {
75 75 if (!is_a($oUser, 'User')) {
76   - var_dump($oUser);
77   - var_dump(PEAR::raiseError());
  76 + #var_dump($oUser);
  77 + #var_dump(PEAR::raiseError());
78 78 }
79 79 $session = new Session();
80 80 $sessionID = $session->create($oUser);
... ...
plugins/ktstandard/KTAdminVersionPlugin.php
... ... @@ -27,7 +27,7 @@ require_once(KT_LIB_DIR . &#39;/plugins/plugin.inc.php&#39;);
27 27 require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php');
28 28 require_once(KT_LIB_DIR . '/dashboard/dashlet.inc.php');
29 29  
30   -define('KT_VERSION_URL', 'http://www.ktdms.com/kt_versions');
  30 +define('KT_VERSION_URL', 'http://www.knowledgetree.com/kt_versions');
31 31  
32 32 class AdminVersionDashlet extends KTBaseDashlet {
33 33 var $oUser;
... ...
resources/css/kt-framing.css
... ... @@ -398,9 +398,9 @@ a.main_nav_item {
398 398  
399 399 #content .form_actions input
400 400 {
401   - border: 1px solid #888;
402   - background: #eee;
403   - color: black;
  401 + border: 1px solid #ccc;
  402 + background: #fdfdfd;
  403 + color: #333;
404 404 font-weight: normal;
405 405 }
406 406  
... ... @@ -676,6 +676,7 @@ a.main_nav_item {
676 676 width: 100%;
677 677 white-space: nowrap !important;
678 678 border: 1px solid #ccc;
  679 + -moz-border-radius: 1em;
679 680 }
680 681  
681 682 .kt_collection.narrow {
... ... @@ -802,6 +803,23 @@ a.main_nav_item {
802 803 }
803 804  
804 805  
  806 +.ktBlock
  807 +{
  808 + padding: 0 1em;
  809 + border: 1px solid #c5c5c5;
  810 + background-color: #fcfcfc;
  811 + margin: 0.5em 0;
  812 +}
  813 +
  814 +.ktInfo, .ktError, .ktBlock
  815 +{
  816 + -moz-border-radius: 15px;
  817 + background-image: url(../../resources/graphics/dashlet-gradient.png);
  818 + background-repeat: no-repeat;
  819 +}
  820 +
  821 +
  822 +
805 823 /** portlet stuff. */
806 824 #portlet-search-text {
807 825 border: 1px solid black;
... ... @@ -1153,3 +1171,107 @@ hr {
1153 1171 .browse_body {
1154 1172 padding: 0;
1155 1173 }
  1174 +
  1175 +
  1176 +
  1177 +/* -------------------------- dashboard ------------------------ */
  1178 +
  1179 +.dashboard_block_icons
  1180 +{
  1181 + text-align: right;
  1182 + margin-bottom: -3em;
  1183 + margin-right: 1em;
  1184 +}
  1185 +
  1186 +.dashboard_block_handle
  1187 +{
  1188 +}
  1189 +
  1190 +.dashboard_block.rolled-up .dashboard_block_body
  1191 +{
  1192 + display: none;
  1193 +}
  1194 +
  1195 +/* actions */
  1196 +
  1197 +#content .dashboard_block .action
  1198 +{
  1199 + padding: 1em 0.5em;
  1200 + border-bottom-width: 0px;
  1201 + background-repeat: no-repeat;
  1202 + background-position: center center;
  1203 +}
  1204 +
  1205 +#content .dashboard_block .action:hover
  1206 +{
  1207 + border-bottom-width: 0px;
  1208 +}
  1209 +
  1210 +#content .dashboard_block .action_rollup
  1211 +{
  1212 + background-image: url(../graphics/bullet_toggle_minus.png);
  1213 +}
  1214 +
  1215 +#content .dashboard_block.rolled-up .action_rollup
  1216 +{
  1217 + background-image: url(../graphics/bullet_toggle_plus.png);
  1218 +}
  1219 +
  1220 +#content .dashboard_block .action_close
  1221 +{
  1222 + background-image: url(../graphics/delete.gif);
  1223 +}
  1224 +
  1225 +/* action effects */
  1226 +#content .dashboard_block.rolled-up h2
  1227 +{
  1228 + border-bottom-width: 0px;
  1229 + padding-bottom: 0px;
  1230 +}
  1231 +
  1232 +
  1233 +#content .dashboard_block.closed
  1234 +{
  1235 + display: none;
  1236 +}
  1237 +
  1238 +.addDialogScreen
  1239 +{
  1240 + position: absolute;
  1241 + display: block;
  1242 + top: 0px;
  1243 + left: 0px;
  1244 + width: 100%;
  1245 + height: 100%;
  1246 +/* background-color: white;
  1247 + opacity: 0.5; */
  1248 + text-align: center;
  1249 +}
  1250 +
  1251 +.addDialog
  1252 +{
  1253 + display: block;
  1254 + border: 1px solid #ccc;
  1255 + background-color: white;
  1256 + padding: 2em;
  1257 + margin: 10% 30%;
  1258 + opacity: 1;
  1259 + overflow: hidden;
  1260 + text-align: left;
  1261 +}
  1262 +
  1263 +
  1264 +.addDialog .dashletLink
  1265 +{
  1266 + color: #666;
  1267 + text-decoration: none;
  1268 + display: block;
  1269 +}
  1270 +
  1271 +body #content #add_dashlet
  1272 +{
  1273 + display: none;
  1274 + text-decoration: none;
  1275 + border-width: 0px;
  1276 +
  1277 +}
... ...
resources/css/kt-login.css
... ... @@ -20,6 +20,7 @@
20 20 margin-right: auto;
21 21 text-align: left;
22 22 background: white url(../graphics/ktbg.png) bottom right no-repeat;
  23 + -moz-border-radius: 1em;
23 24 }
24 25  
25 26 #loginbox.hasDisclaimer {
... ...
resources/graphics/bullet_toggle_minus.png 0 → 100644

216 Bytes

resources/graphics/bullet_toggle_plus.png 0 → 100644

221 Bytes

resources/graphics/dashlet-gradient.png 0 → 100644

4.27 KB

resources/graphics/leaves.png 0 → 100644

321 KB

resources/js/#jsonlookup.js# 0 → 100644
  1 +var _aLookupWidgets = {};
  2 +
  3 +function getJSONLookupWidget(name) {
  4 + if(!isUndefinedOrNull(_aLookupWidgets[name])) {
  5 + return _aLookupWidgets[name];
  6 + } else {
  7 + return false;
  8 + }
  9 +}
  10 +
  11 +function JSONLookupWidget() {
  12 +}
  13 +
  14 +JSONLookupWidget.prototype = {
  15 +
  16 + /* bind_add and bind_remove are functions to be called with the key:value's of selected items */
  17 +
  18 + 'initialize' : function(name, action) {
  19 + bindMethods(this);
  20 +
  21 + this.sName = name;
  22 + this.sAction = action;
  23 +
  24 +
  25 + this.oSelectAvail = $('select_' + name + '_avail');
  26 + this.oSelectAssigned = $('select_' + name + '_assigned');
  27 + this.oFilterAvail = $('filter_' + name + '_avail');
  28 + this.oFilterAssigned = $('filter_' + name + '_assigned');
  29 +
  30 + this.savedFilter = this.oFilterAvail.value;
  31 + this.savedSelector = this.oFilterAssigned.value;
  32 + this.filterTimer = null;
  33 +
  34 + this.aItemsAdded = [];
  35 + this.aItemsRemoved = [];
  36 +
  37 + connect(this.oFilterAvail, 'onkeyup', this, 'onchangeFilter');
  38 + connect(this.oFilterAssigned, 'onkeyup', this, 'onchangeSelector');
  39 + connect(name + '_add', 'onclick', this, 'onclickAdd');
  40 + connect(name + '_remove', 'onclick', this, 'onclickRemove');
  41 + connect(name + '_show_all', 'onclick', this, 'onclickShowAll');
  42 +
  43 + this.triggers = {};
  44 + this.triggers['add'] = null;
  45 + this.triggers['remove'] = null;
  46 +
  47 + this.initialValuesLoaded = false;
  48 + var d = this.getValues();
  49 + d.addCallback(this.postInitialize);
  50 + },
  51 +
  52 + 'addTrigger' : function(event, func) {
  53 + this.triggers[event] = func;
  54 + },
  55 +
  56 +
  57 + // values handling
  58 +
  59 + 'getValues' : function(all) {
  60 + var act = this.sAction;
  61 + if(!isUndefinedOrNull(all)) {
  62 + act += '&' + queryString({'filter' : '%'});
  63 + } else if(this.savedFilter) {
  64 + act += '&' + queryString({'filter' : this.savedFilter});
  65 + } else if(!this.initialValuesLoaded) {
  66 + act += '&' + queryString({'selected' : '1'});
  67 + }
  68 +
  69 + var d = loadJSONDoc(act);
  70 + d.addErrback(this.errGetValues);
  71 + d.addCallback(checkKTError);
  72 + d.addCallback(this.saveValues);
  73 + d.addCallback(this.renderValues);
  74 + return d;
  75 + },
  76 +
  77 + 'errGetValues' : function(res) {
  78 + alert('There was an error retrieving data. Please check connectivity and try again.');
  79 + this.oValues = {'off':'-- Error fetching values --'};
  80 + this.renderValues();
  81 + },
  82 +
  83 + 'saveValues' : function(res) {
  84 + this.oValues = res;
  85 + return res;
  86 + },
  87 +
  88 + 'renderValues' : function() {
  89 + var aOptions = [];
  90 + var bSelFound = false;
  91 + for(var k in this.oValues) {
  92 + var found = false;
  93 + for(var i=0; i<this.oSelectAssigned.options.length; i++) {
  94 + if(this.oSelectAssigned.options[i].value == k) {
  95 + found = true; break;
  96 + }
  97 + }
  98 +
  99 + if(found) {
  100 + continue;
  101 + }
  102 +
  103 +
  104 + var aParam = {'value':k};
  105 + if(k == 'off') {
  106 + aParam['disabled'] = 'disabled';
  107 + }
  108 +
  109 + var val = this.oValues[k];
  110 + var sDisp = val;
  111 +
  112 + if(!isUndefinedOrNull(val['display'])) {
  113 + var sDisp = val['display'];
  114 + if(!isUndefinedOrNull(val['selected']) && val['selected'] === true) {
  115 + val['selected'] = undefined;
  116 + aParam['selected'] = true;
  117 + bSelFound = true;
  118 + aParam['value'] = k;
  119 + }
  120 + }
  121 + var oO = OPTION(aParam, sDisp);
  122 + aOptions.push(oO);
  123 + }
  124 +
  125 + replaceChildNodes(this.oSelectAvail, aOptions);
  126 + if(bSelFound) {
  127 + this.onclickAdd();
  128 + }
  129 + },
  130 +
  131 + 'postInitialize' : function(res) {
  132 + if(!isUndefinedOrNull(this.triggers['postInitialize'])) {
  133 + this.triggers['postInitialize']();
  134 + }
  135 + },
  136 +
  137 +
  138 + 'modItems' : function(type, value) {
  139 + var aTarget = (type == 'add') ? 'aItemsAdded' : 'aItemsRemoved';
  140 + var aOtherTarget = (type == 'remove') ? 'aItemsAdded' : 'aItemsRemoved';
  141 +
  142 + // check against other - if other has value, remove it from other, skip next bit
  143 + var aNewOther = [];
  144 + var exists = false;
  145 + var i = 0;
  146 + for(i=0; i<this[aOtherTarget].length; i++) {
  147 + if(this[aOtherTarget][i]!=value) {
  148 + aNewOther.push(this[aOtherTarget][i]);
  149 + } else {
  150 + exists = true;
  151 + }
  152 + }
  153 + if(exists) {
  154 + this[aOtherTarget] = aNewOther;
  155 + var sHidden = this.sName + '_items_' + ((type == 'remove') ? 'added' : 'removed');
  156 + $(sHidden).value = this[aOtherTarget].join(",");
  157 + return;
  158 + }
  159 +
  160 + exists = false;
  161 + for(i=0; i<this[aTarget].length; i++) {
  162 + if(this[aTarget][i] == value) {
  163 + exists = true;
  164 + break;
  165 + }
  166 + }
  167 +
  168 + if(!exists) {
  169 + this[aTarget].push(value);
  170 + var sHidden = this.sName + '_items_' + ((type == 'add') ? 'added' : 'removed');
  171 + $(sHidden).value = this[aTarget].join(",");
  172 + }
  173 +
  174 + },
  175 +
  176 +
  177 + // signals handling
  178 +
  179 + 'onchangeFilter' : function(e) {
  180 + if(this.savedFilter != this.oFilterAvail.value) {
  181 + this.savedFilter = this.oFilterAvail.value;
  182 + if(!isUndefinedOrNull(this.filterTimer)) {
  183 + this.filterTimer.canceller();
  184 + }
  185 + this.filterTimer = callLater(0.2, this.getValues);
  186 + }
  187 + return true;
  188 + },
  189 +
  190 + 'onchangeSelector' : function(e) {
  191 + if(this.savedSelector != this.oFilterAssigned.value) {
  192 + this.savedSelector = this.oFilterAssigned.value;
  193 + forEach(this.oSelectAssigned.options, bind(function(o) {
  194 + if(!this.savedSelector.length) {
  195 + o.selected = false;
  196 + } else {
  197 + if(o.innerHTML.toLowerCase().search(this.savedSelector) != -1) {
  198 + o.selected = true;
  199 + } else {
  200 + o.selected = false;
  201 + }
  202 + }
  203 + }, this));
  204 + }
  205 + },
  206 +
  207 + '_moveOptions' : function(dir) {
  208 + },
  209 +
  210 + 'onclickAdd' : function(e) {
  211 + var aCurOptions = extend([], this.oSelectAssigned.options);
  212 + forEach(this.oSelectAvail.options, bind(
  213 + function(o) {
  214 + try {
  215 + if(o.value == 'off') return;
  216 + var a = o.selected;
  217 + if(a == 'selected' || a === true) {
  218 + this.modItems('add', o.value);
  219 + try {
  220 + o.selected = false;
  221 + } catch(e) {
  222 + o.setAttribute('selected', false);
  223 + }
  224 + aCurOptions.push(o);
  225 +
  226 + if(!isUndefinedOrNull(this.triggers['add'])) {
  227 + this.triggers['add'](this.oValues[o.value]);
  228 + }
  229 + }
  230 + } catch(e) {
  231 + log('exception');
  232 + // forEach(keys(e), function(k) { log(k,':', e[k]); });
  233 + }
  234 + }, this));
  235 +
  236 + aCurOptions.sort(keyComparator('innerHTML'));
  237 + replaceChildNodes(this.oSelectAssigned, aCurOptions);
  238 +
  239 + },
  240 +
  241 + 'onclickRemove' : function(e) {
  242 + var aOptions = [];
  243 + forEach(this.oSelectAssigned.options, bind(function(o) {
  244 + if(o.selected == 'selected' || o.selected === true) {
  245 + this.modItems('remove', o.value);
  246 + if(!isUndefinedOrNull(this.triggers['remove'])) {
  247 + var obj = { 'type' : (o.value.substring(0,1) == 'g') ? 'group' : 'role',
  248 + 'id' : o.value.substring(1) };
  249 + this.triggers['remove'](obj);
  250 + }
  251 + } else {
  252 + aOptions.push(o);
  253 + }
  254 + }, this));
  255 + replaceChildNodes(this.oSelectAssigned, aOptions);
  256 + this.renderValues();
  257 + },
  258 +
  259 + 'onclickShowAll' : function(e) {
  260 + this.oFilterAvail.value = '';
  261 + this.savedFilter = '';
  262 + this.getValues(true);
  263 + e.stop();
  264 + }
  265 +}
  266 +
  267 +function initJSONLookup(name, action) {
  268 + return function() {
  269 + _aLookupWidgets[name] = new JSONLookupWidget();
  270 + _aLookupWidgets[name].initialize(name, action);
  271 + }
  272 +}
  273 +
  274 +
  275 +
0 276 \ No newline at end of file
... ...
resources/js/adminversiondashlet.js
... ... @@ -25,6 +25,10 @@ AdminVersionDashlet.prototype = {
25 25 }
26 26  
27 27 if(updates == 0) {
  28 + // next line is cause I thought this dashlet was causing orphaned
  29 + // dashlet buttons. it doesn't seem to be, but this may be needed.
  30 + // more investigation necessary.
  31 + // this.dashlet.style.display = 'none';
28 32 } else if(updates == 1) {
29 33 $('up_single').style.display = 'block';
30 34 this.dashlet.style.display = 'block';
... ...
resources/js/dashboard.js 0 → 100644
  1 +function KTDashlet() {
  2 +}
  3 +
  4 +KTDashlet.prototype = {
  5 + 'initialize' : function(e, dashboard) {
  6 + bindMethods(this);
  7 + this.dashboard = dashboard;
  8 + this.id = e.id;
  9 + this.elm = e;
  10 + this.body = getElementsByTagAndClassName('*', 'dashboard_block_body', e)[0];
  11 + connect(getElementsByTagAndClassName('*', 'action_rollup', e)[0], 'onclick', this, 'toggleRollup');
  12 + connect(getElementsByTagAndClassName('*', 'action_close', e)[0], 'onclick', this, 'toggleClose');
  13 + },
  14 +
  15 + 'toggleRollup' : function(event) {
  16 + toggleElementClass('rolled-up', this.elm);
  17 + if(this.getStatus() == KTDashboard.OPEN) {
  18 + this.setStatus(KTDashboard.ROLLEDUP);
  19 + } else {
  20 + this.setStatus(KTDashboard.OPEN);
  21 + }
  22 +
  23 + event.stop();
  24 + },
  25 +
  26 + 'toggleClose' : function(event) {
  27 + toggleElementClass('closed', this.elm);
  28 + if(this.getStatus() == KTDashboard.OPEN) {
  29 + this.setStatus(KTDashboard.CLOSED);
  30 + } else {
  31 + this.setStatus(KTDashboard.OPEN);
  32 + }
  33 + },
  34 +
  35 + 'setStatus' : function(status) {
  36 + this.dashboard.setStatus(this.id, status);
  37 + },
  38 +
  39 + 'getStatus' : function() {
  40 + return this.dashboard.getStatus(this.id);
  41 + }
  42 +
  43 +}
  44 +
  45 +
  46 +function KTDashboard() {
  47 + this.dashlets = {};
  48 +}
  49 +
  50 +KTDashboard.OPEN = 0;
  51 +KTDashboard.ROLLEDUP = 1;
  52 +KTDashboard.CLOSED = 2;
  53 +
  54 +
  55 +KTDashboard.prototype = {
  56 + 'initialize' : function(dashboard) {
  57 + var dashOpts = {
  58 + 'tag':'div',
  59 + 'dropOnEmpty':true,
  60 + 'constraint': false,
  61 + 'tree':true,
  62 + 'only' : ['dashboard_block', ],
  63 + 'handle' : 'dashboard_block_handle',
  64 + }
  65 +
  66 + MochiKit.Sortable.Sortable.create(dashboard, dashOpts);
  67 +
  68 + var self = this;
  69 + map(function(e) {
  70 + if(hasElementClass(e, 'empty')) return;
  71 + var d = new KTDashlet();
  72 + d.initialize(e, self);
  73 + self.dashlets[e.id] = { 'object' : d, 'state' : KTDashboard.OPEN };
  74 + }, getElementsByTagAndClassName('*', 'dashboard_block', dashboard));
  75 +
  76 + this.addButton = $('add_dashlet');
  77 + connect(this.addButton, 'onclick', this, 'onclickAdd');
  78 + hideElement(this.addButton);
  79 +
  80 + // alert(keys(this.dashlets));
  81 + // alert(values(this.dashlets));
  82 + },
  83 +
  84 + 'statusChange' : function(status) {
  85 + if(status == KTDashboard.CLOSED) {
  86 + showElement(this.addButton);
  87 + } else if(status == KTDashboard.OPEN) {
  88 + var closed = this.getDashletsInState(KTDashboard.CLOSED);
  89 + if(closed.length == 0) {
  90 + hideElement(this.addButton);
  91 + }
  92 + }
  93 + },
  94 +
  95 +
  96 + 'setStatus' : function(id, status) {
  97 + this.dashlets[id]['state'] = status;
  98 + this.statusChange(status);
  99 + },
  100 +
  101 + 'getStatus' : function(id) {
  102 + return this.dashlets[id]['state'];
  103 + },
  104 +
  105 + 'getDashletsInState' : function(state) {
  106 + var ret = [];
  107 + for(var i in this.dashlets) {
  108 + if(this.dashlets[i]['state'] == state) {
  109 + ret.push(i);
  110 + }
  111 + }
  112 + return ret;
  113 + },
  114 +
  115 + 'getDashletTitle' : function(elm) {
  116 + var h2 = getElementsByTagAndClassName('H2', null, elm);
  117 + if(h2.length) {
  118 + return h2[0].innerHTML;
  119 + } else {
  120 + return null;
  121 + }
  122 + },
  123 +
  124 + 'onclickAdd': function(event) {
  125 + var closed = this.getDashletsInState(KTDashboard.CLOSED);
  126 + var self = this;
  127 + var addDialogScreen = DIV({'class':'addDialogScreen'});
  128 + var addDialog = DIV({'class':'addDialog'});
  129 + var dashletList = UL(null);
  130 +
  131 + forEach(closed, function(id) {
  132 + var dashletelm = $(id);
  133 + var dashlet = self.dashlets[id]['object'];
  134 +
  135 + var link = A({'class':'dashletLink', 'href':'#'}, self.getDashletTitle(dashletelm));
  136 + var linkli = LI(null, link);
  137 +
  138 + connect(link, 'onclick', function(event) {
  139 + removeElement(linkli);
  140 + dashlet.toggleClose(event);
  141 + });
  142 + appendChildNodes(dashletList, linkli);
  143 + });
  144 + appendChildNodes(addDialog, H2(null, 'Add Dashlets'));
  145 + appendChildNodes(addDialog, dashletList);
  146 +
  147 + var closeLink = A({'class':'closeLink','href':'#'}, 'close');
  148 + connect(closeLink, 'onclick', function(event) { removeElement(addDialogScreen); });
  149 +
  150 + appendChildNodes(addDialog, closeLink);
  151 + appendChildNodes(addDialogScreen, addDialog);
  152 + appendChildNodes(document.body, addDialogScreen);
  153 + }
  154 +}
  155 +
  156 +
  157 +
  158 +addLoadEvent(
  159 + function() {
  160 + var dashboard = new KTDashboard();
  161 + dashboard.initialize($('content'));
  162 + });
  163 +
  164 +
0 165 \ No newline at end of file
... ...
templates/kt3/dashboard.smarty
  1 +<a href="#" id="add_dashlet">Add Dashlet</a>
  2 +
1 3 <div id="dashboard-container-left">
2 4 {foreach item=oDashlet from=$dashlets_left}
3   -<div class="dashboard_block">
  5 +<div class="dashboard_block" id="{$context->_getDashletId($oDashlet)}">
  6 +
  7 +<div class="dashboard_block_icons">
  8 +<a href="#" class="action action_rollup">&nbsp;</a>
  9 +<a href="#" class="action action_close">&nbsp;</a>
  10 +</div>
  11 +
4 12 {$oDashlet->render()}
5 13 </div>
6 14 {/foreach}
  15 +<div class="dashboard_block empty">&nbsp;</div>
7 16 </div>
8 17  
9 18 <div id="dashboard-container-right">
10 19 {foreach item=oDashlet from=$dashlets_right}
11   -<div class="dashboard_block">
  20 +<div class="dashboard_block" id="{$context->_getDashletId($oDashlet)}">
  21 +
  22 +<div class="dashboard_block_icons">
  23 +<a href="#" class="action action_rollup">&nbsp;</a>
  24 +<a href="#" class="action action_close">&nbsp;</a>
  25 +</div>
  26 +
12 27 {$oDashlet->render()}
13 28 </div>
14 29 {/foreach}
  30 +
  31 +<div class="dashboard_block empty">&nbsp;</div>
15 32 </div>
16 33  
17 34  
... ...
templates/kt3/olddashboard.smarty 0 → 100644
  1 +<div id="dashboard-container-left">
  2 +{foreach item=oDashlet from=$dashlets_left}
  3 +<div class="dashboard_block">
  4 +{$oDashlet->render()}
  5 +</div>
  6 +{/foreach}
  7 +</div>
  8 +
  9 +<div id="dashboard-container-right">
  10 +{foreach item=oDashlet from=$dashlets_right}
  11 +<div class="dashboard_block">
  12 +{$oDashlet->render()}
  13 +</div>
  14 +{/foreach}
  15 +</div>
  16 +
  17 +
  18 +
  19 +
... ...
templates/ktcore/dashlets/checkedout.smarty
1   -<h2>{i18n}Your Checked-out Documents{/i18n}</h2>
  1 +<div class="ktBlock">
  2 +<h2 class="dashboard_block_handle">{i18n}Your Checked-out Documents{/i18n}</h2>
  3 +
  4 +<div class="dashboard_block_body">
2 5 <p class="descriptiveText">{i18n}A checked-out document may not be modified by others. Please ensure that you check-in your documents to the repository as soon as you have finished working with them.{/i18n}</p>
3 6 {if (!empty($documents))}
4 7 <dl>
... ... @@ -9,3 +12,5 @@
9 12 {else}
10 13 <div class="ktInfo"><p>{i18n}You have no documents which are currently checked out.{/i18n}</p></div>
11 14 {/if}
  15 +</div>
  16 +</div>
12 17 \ No newline at end of file
... ...
templates/ktcore/dashlets/indexer_status.smarty
1   -<h2>{i18n}Indexer Status{/i18n}</h2>
  1 +<div class="ktBlock">
  2 +<h2 class="dashboard_block_handle">{i18n}Indexer Status{/i18n}</h2>
2 3  
  4 +<div class="dashboard_block_body">
3 5 {if $no_transforms}
4 6 <div class="ktError"><p><strong>{i18n}Warning:{/i18n}</strong> {i18n}There are currently
5 7 no active indexers registered. No content indexing will occur.{/i18n}</p></div>
... ... @@ -32,3 +34,5 @@ no active indexers registered. No content indexing will occur.{/i18n}&lt;/p&gt;&lt;/div&gt;
32 34 </table>
33 35 {/if}
34 36 {/if}
  37 +</div>
  38 +</div>
35 39 \ No newline at end of file
... ...
templates/ktcore/dashlets/kt3release.smarty
1   -<h2>{$title}</h2>
2   -
  1 +<div class="ktBlock">
  2 +<h2 class="dashboard_block_handle">{$title}</h2>
  3 +<div class="dashboard_block_body">
3 4 {$body}
4 5  
5 6 {if $can_edit}
... ... @@ -8,4 +9,6 @@
8 9 <a href="{ktLink base="admin.php" subpath="/misc/helpmanagement" query="action=customise&name=`$target_name`"}">{i18n}Edit this introduction.{/i18n}</a>
9 10 {if $help_id}| <a class="ktActionLink ktDelete" href="{ktLink base="admin.php" subpath="/misc/helpmanagement" query="action=deleteReplacement&id=`$help_id`"}">{i18n}Use the standard introduction.{/i18n}</a></p>
10 11 {/if}
11   -{/if}
12 12 \ No newline at end of file
  13 +{/if}
  14 +</div>
  15 +</div>
13 16 \ No newline at end of file
... ...
templates/ktcore/dashlets/mailserver.smarty
1   -<h2>{i18n}Mail server status{/i18n}</h2>
2   -
3 1 <div class="ktError">
4 2  
  3 +<h2 class="dashboard_block_handle">{i18n}Mail server status{/i18n}</h2>
  4 +
  5 +<div class="dashboard_block_body">
5 6 <p>{i18n}Email has not been configured on this server. Emailing of
6 7 documents and sending of notifications are disabled.{/i18n}</p>
7 8  
... ... @@ -10,3 +11,4 @@ documents and sending of notifications are disabled.{/i18n}&lt;/p&gt;
10 11 server and the sending address of the KnowledgeTree server.{/i18n}</p>
11 12 {/if}
12 13 </div>
  14 +</div>
13 15 \ No newline at end of file
... ...
templates/ktcore/dashlets/notifications.smarty
1   -<h2>{i18n}Items that require your attention{/i18n}</h2>
  1 +<div class="ktBlock">
  2 +<h2 class="dashboard_block_handle">{i18n}Items that require your attention{/i18n}</h2>
  3 +
  4 +<div class="dashboard_block_body">
2 5 {if (!empty($notifications))}
3 6 <dl>
4 7 {foreach item=oNotification from=$notifications}
... ... @@ -19,3 +22,5 @@
19 22 {else}
20 23 <div class="ktInfo"><p>{i18n}No items require your attention.{/i18n}</p></div>
21 24 {/if}
  25 +</div>
  26 +</div>
22 27 \ No newline at end of file
... ...
templates/ktstandard/adminversion/dashlet.smarty
... ... @@ -17,7 +17,9 @@
17 17  
18 18 <div class="ktError" id="admin_version_dashlet" >
19 19  
20   -<h2>{i18n}New Version Available{/i18n}</h2>
  20 +<h2 class="dashboard_block_handle">{i18n}New Version Available{/i18n}</h2>
  21 +
  22 +<div class="dashboard_block_body">
21 23 <p>
22 24 <span id="up_single">{i18n}The following upgrade is available:{/i18n}</span>
23 25 <span id="up_multi">{i18n}The following upgrades are available:{/i18n}</span>
... ... @@ -26,3 +28,4 @@
26 28 </p>
27 29  
28 30 </div>
  31 +</div>
29 32 \ No newline at end of file
... ...
templates/ktstandard/searchdashlet/dashlet.smarty
1   -<h2>{i18n}Search{/i18n}</h2>
  1 +<div class="ktBlock">
  2 +<h2 class="dashboard_block_handle">{i18n}Search{/i18n}</h2>
2 3  
  4 +
  5 +<div class="dashboard_block_body">
3 6 <form action="{ktLink base="search/simpleSearch.php"}" method="GET">
4 7 <input type="text" name="fSearchableText" id="dashlet-search-text"
5 8 size="15" /><input type="submit" value="{i18n}search{/i18n}"
... ... @@ -20,4 +23,5 @@ href=&quot;{&quot;booleanSearch&quot;|generateControllerUrl}&amp;qs[action]=performSearch&amp;qs[fSaved
20 23  
21 24  
22 25 {/if}
23   -
  26 +</div>
  27 +</div>
24 28 \ No newline at end of file
... ...
thirdpartyjs/MochiKit/DragAndDrop.js 0 → 100644
  1 +/***
  2 +MochiKit.DragAndDrop 1.4
  3 +
  4 +See <http://mochikit.com/> for documentation, downloads, license, etc.
  5 +
  6 +Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
  7 + Mochi-ized By Thomas Herve (_firstname_@nimail.org)
  8 +
  9 +***/
  10 +
  11 +if (typeof(dojo) != 'undefined') {
  12 + dojo.provide('MochiKit.DragAndDrop');
  13 + dojo.require('MochiKit.Base');
  14 + dojo.require('MochiKit.DOM');
  15 + dojo.require('MochiKit.Iter');
  16 + dojo.require('MochiKit.Visual');
  17 + dojo.require('MochiKit.Signal');
  18 +}
  19 +
  20 +if (typeof(JSAN) != 'undefined') {
  21 + JSAN.use("MochiKit.Base", []);
  22 + JSAN.use("MochiKit.DOM", []);
  23 + JSAN.use("MochiKit.Visual", []);
  24 + JSAN.use("MochiKit.Iter", []);
  25 + JSAN.use("MochiKit.Signal", []);
  26 +}
  27 +
  28 +try {
  29 + if (typeof(MochiKit.Base) == 'undefined' ||
  30 + typeof(MochiKit.DOM) == 'undefined' ||
  31 + typeof(MochiKit.Visual) == 'undefined' ||
  32 + typeof(MochiKit.Signal) == 'undefined' ||
  33 + typeof(MochiKit.Iter) == 'undefined') {
  34 + throw "";
  35 + }
  36 +} catch (e) {
  37 + throw "MochiKit.DragAndDrop depends on MochiKit.Base, MochiKit.DOM, MochiKit.Visual, MochiKit.Signal and MochiKit.Iter!";
  38 +}
  39 +
  40 +if (typeof(MochiKit.DragAndDrop) == 'undefined') {
  41 + MochiKit.DragAndDrop = {};
  42 +}
  43 +
  44 +MochiKit.DragAndDrop.NAME = 'MochiKit.DragAndDrop';
  45 +MochiKit.DragAndDrop.VERSION = '1.4';
  46 +
  47 +MochiKit.DragAndDrop.__repr__ = function () {
  48 + return '[' + this.NAME + ' ' + this.VERSION + ']';
  49 +};
  50 +
  51 +MochiKit.DragAndDrop.toString = function () {
  52 + return this.__repr__();
  53 +};
  54 +
  55 +MochiKit.DragAndDrop.EXPORT = [
  56 + "Droppable",
  57 + "Draggable"
  58 +];
  59 +
  60 +MochiKit.DragAndDrop.EXPORT_OK = [
  61 + "Droppables",
  62 + "Draggables"
  63 +];
  64 +
  65 +MochiKit.DragAndDrop.Droppables = {
  66 + /***
  67 +
  68 + Manage all droppables. Shouldn't be used, use the Droppable object instead.
  69 +
  70 + ***/
  71 + drops: [],
  72 +
  73 + remove: function (element) {
  74 + this.drops = MochiKit.Base.filter(function (d) {
  75 + return d.element != MochiKit.DOM.getElement(element)
  76 + }, this.drops);
  77 + },
  78 +
  79 + register: function (drop) {
  80 + this.drops.push(drop);
  81 + },
  82 +
  83 + unregister: function (drop) {
  84 + this.drops = MochiKit.Base.filter(function (d) {
  85 + return d != drop;
  86 + }, this.drops);
  87 + },
  88 +
  89 + prepare: function (element) {
  90 + MochiKit.Base.map(function (drop) {
  91 + if (drop.isAccepted(element)) {
  92 + if (drop.options.activeclass) {
  93 + MochiKit.DOM.addElementClass(drop.element,
  94 + drop.options.activeclass);
  95 + }
  96 + drop.options.onactive(drop.element, element);
  97 + }
  98 + }, this.drops);
  99 + },
  100 +
  101 + findDeepestChild: function (drops) {
  102 + deepest = drops[0];
  103 +
  104 + for (i = 1; i < drops.length; ++i) {
  105 + if (MochiKit.DOM.isParent(drops[i].element, deepest.element)) {
  106 + deepest = drops[i];
  107 + }
  108 + }
  109 + return deepest;
  110 + },
  111 +
  112 + show: function (point, element) {
  113 + if (!this.drops.length) {
  114 + return;
  115 + }
  116 + var affected = [];
  117 +
  118 + if (this.last_active) {
  119 + this.last_active.deactivate();
  120 + }
  121 + MochiKit.Iter.forEach(this.drops, function (drop) {
  122 + if (drop.isAffected(point, element)) {
  123 + affected.push(drop);
  124 + }
  125 + });
  126 + if (affected.length > 0) {
  127 + drop = this.findDeepestChild(affected);
  128 + MochiKit.Position.within(drop.element, point.page.x, point.page.y);
  129 + drop.options.onhover(element, drop.element,
  130 + MochiKit.Position.overlap(drop.options.overlap, drop.element));
  131 + drop.activate();
  132 + }
  133 + },
  134 +
  135 + fire: function (event, element) {
  136 + if (!this.last_active) {
  137 + return;
  138 + }
  139 + MochiKit.Position.prepare();
  140 +
  141 + if (this.last_active.isAffected(event.mouse(), element)) {
  142 + this.last_active.options.ondrop(element,
  143 + this.last_active.element, event);
  144 + }
  145 + },
  146 +
  147 + reset: function (element) {
  148 + MochiKit.Base.map(function (drop) {
  149 + if (drop.options.activeclass) {
  150 + MochiKit.DOM.removeElementClass(drop.element,
  151 + drop.options.activeclass);
  152 + }
  153 + drop.options.ondesactive(drop.element, element);
  154 + }, this.drops);
  155 + if (this.last_active) {
  156 + this.last_active.deactivate();
  157 + }
  158 + }
  159 +};
  160 +
  161 +/** @id MochiKit.DragAndDrop.Droppable */
  162 +MochiKit.DragAndDrop.Droppable = function (element, options) {
  163 + this.__init__(element, options);
  164 +};
  165 +
  166 +MochiKit.DragAndDrop.Droppable.prototype = {
  167 + /***
  168 +
  169 + A droppable object. Simple use is to create giving an element:
  170 +
  171 + new MochiKit.DragAndDrop.Droppable('myelement');
  172 +
  173 + Generally you'll want to define the 'ondrop' function and maybe the
  174 + 'accept' option to filter draggables.
  175 +
  176 + ***/
  177 + __class__: MochiKit.DragAndDrop.Droppable,
  178 +
  179 + __init__: function (element, /* optional */options) {
  180 + var d = MochiKit.DOM;
  181 + var b = MochiKit.Base;
  182 + this.element = d.getElement(element);
  183 +
  184 + d.addElementClass(element, 'droppable');
  185 +
  186 + this.options = b.update({
  187 +
  188 + /** @id MochiKit.DragAndDrop.greedy */
  189 + greedy: true,
  190 +
  191 + /** @id MochiKit.DragAndDrop.hoverclass */
  192 + hoverclass: null,
  193 +
  194 + /** @id MochiKit.DragAndDrop.activeclass */
  195 + activeclass: null,
  196 +
  197 + /** @id MochiKit.DragAndDrop.hoverfunc */
  198 + hoverfunc: b.noop,
  199 +
  200 + /** @id MochiKit.DragAndDrop.accept */
  201 + accept: null,
  202 +
  203 + /** @id MochiKit.DragAndDrop.onactive */
  204 + onactive: b.noop,
  205 +
  206 + /** @id MochiKit.DragAndDrop.ondesactive */
  207 + ondesactive: b.noop,
  208 +
  209 + /** @id MochiKit.DragAndDrop.onhover */
  210 + onhover: b.noop,
  211 +
  212 + /** @id MochiKit.DragAndDrop.ondrop */
  213 + ondrop: b.noop,
  214 +
  215 + /** @id MochiKit.DragAndDrop.containment */
  216 + containment: [],
  217 + tree: false
  218 + }, options || {});
  219 +
  220 + // cache containers
  221 + this.options._containers = [];
  222 + b.map(MochiKit.Base.bind(function (c) {
  223 + this.options._containers.push(d.getElement(c));
  224 + }, this), this.options.containment);
  225 +
  226 + d.makePositioned(this.element); // fix IE
  227 +
  228 + MochiKit.DragAndDrop.Droppables.register(this);
  229 + },
  230 +
  231 + /** @id MochiKit.DragAndDrop.isContained */
  232 + isContained: function (element) {
  233 + if (this.options._containers.length) {
  234 + var containmentNode;
  235 + if (this.options.tree) {
  236 + containmentNode = element.treeNode;
  237 + } else {
  238 + containmentNode = element.parentNode;
  239 + }
  240 + return MochiKit.Iter.some(this.options._containers, function (c) {
  241 + return containmentNode == c;
  242 + });
  243 + } else {
  244 + return true;
  245 + }
  246 + },
  247 +
  248 + /** @id MochiKit.DragAndDrop.isAccepted */
  249 + isAccepted: function (element) {
  250 + return ((!this.options.accept) || MochiKit.Iter.some(
  251 + this.options.accept, function (c) {
  252 + return MochiKit.DOM.hasElementClass(element, c);
  253 + }));
  254 + },
  255 +
  256 + /** @id MochiKit.DragAndDrop.isAffected */
  257 + isAffected: function (point, element) {
  258 + return ((this.element != element) &&
  259 + this.isContained(element) &&
  260 + this.isAccepted(element) &&
  261 + MochiKit.Position.within(this.element, point.page.x,
  262 + point.page.y));
  263 + },
  264 +
  265 + /** @id MochiKit.DragAndDrop.deactivate */
  266 + deactivate: function () {
  267 + /***
  268 +
  269 + A droppable is deactivate when a draggable has been over it and left.
  270 +
  271 + ***/
  272 + if (this.options.hoverclass) {
  273 + MochiKit.DOM.removeElementClass(this.element,
  274 + this.options.hoverclass);
  275 + }
  276 + this.options.hoverfunc(this.element, false);
  277 + MochiKit.DragAndDrop.Droppables.last_active = null;
  278 + },
  279 +
  280 + /** @id MochiKit.DragAndDrop.activate */
  281 + activate: function () {
  282 + /***
  283 +
  284 + A droppable is active when a draggable is over it.
  285 +
  286 + ***/
  287 + if (this.options.hoverclass) {
  288 + MochiKit.DOM.addElementClass(this.element, this.options.hoverclass);
  289 + }
  290 + this.options.hoverfunc(this.element, true);
  291 + MochiKit.DragAndDrop.Droppables.last_active = this;
  292 + },
  293 +
  294 + /** @id MochiKit.DragAndDrop.destroy */
  295 + destroy: function () {
  296 + /***
  297 +
  298 + Delete this droppable.
  299 +
  300 + ***/
  301 + MochiKit.DragAndDrop.Droppables.unregister(this);
  302 + },
  303 +
  304 + /** @id MochiKit.DragAndDrop.repr */
  305 + repr: function () {
  306 + return '[' + this.__class__.NAME + ", options:" + MochiKit.Base.repr(this.options) + "]";
  307 + }
  308 +};
  309 +
  310 +MochiKit.DragAndDrop.Draggables = {
  311 + /***
  312 +
  313 + Manage draggables elements. Not intended to direct use.
  314 +
  315 + ***/
  316 + drags: [],
  317 +
  318 + register: function (draggable) {
  319 + if (this.drags.length === 0) {
  320 + var conn = MochiKit.Signal.connect;
  321 + this.eventMouseUp = conn(document, 'onmouseup', this, this.endDrag);
  322 + this.eventMouseMove = conn(document, 'onmousemove', this,
  323 + this.updateDrag);
  324 + this.eventKeypress = conn(document, 'onkeypress', this,
  325 + this.keyPress);
  326 + }
  327 + this.drags.push(draggable);
  328 + },
  329 +
  330 + unregister: function (draggable) {
  331 + this.drags = MochiKit.Base.filter(function (d) {
  332 + return d != draggable;
  333 + }, this.drags);
  334 + if (this.drags.length === 0) {
  335 + var disc = MochiKit.Signal.disconnect
  336 + disc(this.eventMouseUp);
  337 + disc(this.eventMouseMove);
  338 + disc(this.eventKeypress);
  339 + }
  340 + },
  341 +
  342 + activate: function (draggable) {
  343 + // allows keypress events if window is not currently focused
  344 + // fails for Safari
  345 + window.focus();
  346 + this.activeDraggable = draggable;
  347 + },
  348 +
  349 + deactivate: function () {
  350 + this.activeDraggable = null;
  351 + },
  352 +
  353 + updateDrag: function (event) {
  354 + if (!this.activeDraggable) {
  355 + return;
  356 + }
  357 + var pointer = event.mouse();
  358 + // Mozilla-based browsers fire successive mousemove events with
  359 + // the same coordinates, prevent needless redrawing (moz bug?)
  360 + if (this._lastPointer && (MochiKit.Base.repr(this._lastPointer.page) ==
  361 + MochiKit.Base.repr(pointer.page))) {
  362 + return;
  363 + }
  364 + this._lastPointer = pointer;
  365 + this.activeDraggable.updateDrag(event, pointer);
  366 + },
  367 +
  368 + endDrag: function (event) {
  369 + if (!this.activeDraggable) {
  370 + return;
  371 + }
  372 + this._lastPointer = null;
  373 + this.activeDraggable.endDrag(event);
  374 + this.activeDraggable = null;
  375 + },
  376 +
  377 + keyPress: function (event) {
  378 + if (this.activeDraggable) {
  379 + this.activeDraggable.keyPress(event);
  380 + }
  381 + },
  382 +
  383 + notify: function (eventName, draggable, event) {
  384 + MochiKit.Signal.signal(this, eventName, draggable, event);
  385 + }
  386 +};
  387 +
  388 +/** @id MochiKit.DragAndDrop.Draggable */
  389 +MochiKit.DragAndDrop.Draggable = function (element, options) {
  390 + this.__init__(element, options);
  391 +};
  392 +
  393 +MochiKit.DragAndDrop.Draggable.prototype = {
  394 + /***
  395 +
  396 + A draggable object. Simple instantiate :
  397 +
  398 + new MochiKit.DragAndDrop.Draggable('myelement');
  399 +
  400 + ***/
  401 + __class__ : MochiKit.DragAndDrop.Draggable,
  402 +
  403 + __init__: function (element, /* optional */options) {
  404 + var v = MochiKit.Visual;
  405 + var b = MochiKit.Base;
  406 + options = b.update({
  407 +
  408 + /** @id MochiKit.DragAndDrop.handle */
  409 + handle: false,
  410 +
  411 + /** @id MochiKit.DragAndDrop.starteffect */
  412 + starteffect: function (innerelement) {
  413 + this._savedOpacity = MochiKit.Style.getOpacity(innerelement) || 1.0;
  414 + new v.Opacity(innerelement, {duration:0.2, from:this._savedOpacity, to:0.7});
  415 + },
  416 + /** @id MochiKit.DragAndDrop.reverteffect */
  417 + reverteffect: function (innerelement, top_offset, left_offset) {
  418 + var dur = Math.sqrt(Math.abs(top_offset^2) +
  419 + Math.abs(left_offset^2))*0.02;
  420 + return new v.Move(innerelement,
  421 + {x: -left_offset, y: -top_offset, duration: dur});
  422 + },
  423 +
  424 + /** @id MochiKit.DragAndDrop.endeffect */
  425 + endeffect: function (innerelement) {
  426 + new v.Opacity(innerelement, {duration:0.2, from:0.7, to:this._savedOpacity});
  427 + },
  428 +
  429 + /** @id MochiKit.DragAndDrop.onchange */
  430 + onchange: b.noop,
  431 +
  432 + /** @id MochiKit.DragAndDrop.zindex */
  433 + zindex: 1000,
  434 +
  435 + /** @id MochiKit.DragAndDrop.revert */
  436 + revert: false,
  437 +
  438 + /** @id MochiKit.DragAndDrop.scroll */
  439 + scroll: false,
  440 +
  441 + /** @id MochiKit.DragAndDrop.scrollSensitivity */
  442 + scrollSensitivity: 20,
  443 +
  444 + /** @id MochiKit.DragAndDrop.scrollSpeed */
  445 + scrollSpeed: 15,
  446 + // false, or xy or [x, y] or function (x, y){return [x, y];}
  447 +
  448 + /** @id MochiKit.DragAndDrop.snap */
  449 + snap: false
  450 + }, options || {});
  451 +
  452 + var d = MochiKit.DOM;
  453 + this.element = d.getElement(element);
  454 +
  455 + if (options.handle && (typeof(options.handle) == 'string')) {
  456 + this.handle = d.getFirstElementByTagAndClassName(null,
  457 + options.handle, this.element);
  458 + }
  459 + if (!this.handle) {
  460 + this.handle = d.getElement(options.handle);
  461 + }
  462 + if (!this.handle) {
  463 + this.handle = this.element;
  464 + }
  465 +
  466 + if (options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
  467 + options.scroll = d.getElement(options.scroll);
  468 + this._isScrollChild = MochiKit.DOM.isChildNode(this.element, options.scroll);
  469 + }
  470 +
  471 + d.makePositioned(this.element); // fix IE
  472 +
  473 + this.delta = this.currentDelta();
  474 + this.options = options;
  475 + this.dragging = false;
  476 +
  477 + this.eventMouseDown = MochiKit.Signal.connect(this.handle,
  478 + 'onmousedown', this, this.initDrag);
  479 + MochiKit.DragAndDrop.Draggables.register(this);
  480 + },
  481 +
  482 + /** @id MochiKit.DragAndDrop.destroy */
  483 + destroy: function () {
  484 + MochiKit.Signal.disconnect(this.eventMouseDown);
  485 + MochiKit.DragAndDrop.Draggables.unregister(this);
  486 + },
  487 +
  488 + /** @id MochiKit.DragAndDrop.currentDelta */
  489 + currentDelta: function () {
  490 + var s = MochiKit.Style.getStyle;
  491 + return [
  492 + parseInt(s(this.element, 'left') || '0'),
  493 + parseInt(s(this.element, 'top') || '0')];
  494 + },
  495 +
  496 + /** @id MochiKit.DragAndDrop.initDrag */
  497 + initDrag: function (event) {
  498 + if (!event.mouse().button.left) {
  499 + return;
  500 + }
  501 + // abort on form elements, fixes a Firefox issue
  502 + var src = event.target();
  503 + var tagName = (src.tagName || '').toUpperCase();
  504 + if (tagName === 'INPUT' || tagName === 'SELECT' ||
  505 + tagName === 'OPTION' || tagName === 'BUTTON' ||
  506 + tagName === 'TEXTAREA') {
  507 + return;
  508 + }
  509 +
  510 + if (this._revert) {
  511 + this._revert.cancel();
  512 + this._revert = null;
  513 + }
  514 +
  515 + var pointer = event.mouse();
  516 + var pos = MochiKit.Position.cumulativeOffset(this.element);
  517 + this.offset = [pointer.page.x - pos.x, pointer.page.y - pos.y]
  518 +
  519 + MochiKit.DragAndDrop.Draggables.activate(this);
  520 + event.stop();
  521 + },
  522 +
  523 + /** @id MochiKit.DragAndDrop.startDrag */
  524 + startDrag: function (event) {
  525 + this.dragging = true;
  526 + if (this.options.selectclass) {
  527 + MochiKit.DOM.addElementClass(this.element,
  528 + this.options.selectclass);
  529 + }
  530 + if (this.options.zindex) {
  531 + this.originalZ = parseInt(MochiKit.Style.getStyle(this.element,
  532 + 'z-index') || '0');
  533 + this.element.style.zIndex = this.options.zindex;
  534 + }
  535 +
  536 + if (this.options.ghosting) {
  537 + this._clone = this.element.cloneNode(true);
  538 + this.ghostPosition = MochiKit.Position.absolutize(this.element);
  539 + this.element.parentNode.insertBefore(this._clone, this.element);
  540 + }
  541 +
  542 + if (this.options.scroll) {
  543 + if (this.options.scroll == window) {
  544 + var where = this._getWindowScroll(this.options.scroll);
  545 + this.originalScrollLeft = where.left;
  546 + this.originalScrollTop = where.top;
  547 + } else {
  548 + this.originalScrollLeft = this.options.scroll.scrollLeft;
  549 + this.originalScrollTop = this.options.scroll.scrollTop;
  550 + }
  551 + }
  552 +
  553 + MochiKit.DragAndDrop.Droppables.prepare(this.element);
  554 + MochiKit.DragAndDrop.Draggables.notify('start', this, event);
  555 + if (this.options.starteffect) {
  556 + this.options.starteffect(this.element);
  557 + }
  558 + },
  559 +
  560 + /** @id MochiKit.DragAndDrop.updateDrag */
  561 + updateDrag: function (event, pointer) {
  562 + if (!this.dragging) {
  563 + this.startDrag(event);
  564 + }
  565 + MochiKit.Position.prepare();
  566 + MochiKit.DragAndDrop.Droppables.show(pointer, this.element);
  567 + MochiKit.DragAndDrop.Draggables.notify('drag', this, event);
  568 + this.draw(pointer);
  569 + this.options.onchange(this);
  570 +
  571 + if (this.options.scroll) {
  572 + this.stopScrolling();
  573 + var p, q;
  574 + if (this.options.scroll == window) {
  575 + var s = this._getWindowScroll(this.options.scroll);
  576 + p = new MochiKit.Style.Coordinates(s.left, s.top);
  577 + q = new MochiKit.Style.Coordinates(s.left + s.width,
  578 + s.top + s.height);
  579 + } else {
  580 + p = MochiKit.Position.page(this.options.scroll);
  581 + p.x += this.options.scroll.scrollLeft;
  582 + p.y += this.options.scroll.scrollTop;
  583 + p.x += (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0);
  584 + p.y += (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0);
  585 + q = new MochiKit.Style.Coordinates(p.x + this.options.scroll.offsetWidth,
  586 + p.y + this.options.scroll.offsetHeight);
  587 + }
  588 + var speed = [0, 0];
  589 + if (pointer.page.x > (q.x - this.options.scrollSensitivity)) {
  590 + speed[0] = pointer.page.x - (q.x - this.options.scrollSensitivity);
  591 + } else if (pointer.page.x < (p.x + this.options.scrollSensitivity)) {
  592 + speed[0] = pointer.page.x - (p.x + this.options.scrollSensitivity);
  593 + }
  594 + if (pointer.page.y > (q.y - this.options.scrollSensitivity)) {
  595 + speed[1] = pointer.page.y - (q.y - this.options.scrollSensitivity);
  596 + } else if (pointer.page.y < (p.y + this.options.scrollSensitivity)) {
  597 + speed[1] = pointer.page.y - (p.y + this.options.scrollSensitivity);
  598 + }
  599 + this.startScrolling(speed);
  600 + }
  601 +
  602 + // fix AppleWebKit rendering
  603 + if (/AppleWebKit'/.test(navigator.appVersion)) {
  604 + window.scrollBy(0, 0);
  605 + }
  606 + event.stop();
  607 + },
  608 +
  609 + /** @id MochiKit.DragAndDrop.finishDrag */
  610 + finishDrag: function (event, success) {
  611 + var dr = MochiKit.DragAndDrop;
  612 + this.dragging = false;
  613 + if (this.options.selectclass) {
  614 + MochiKit.DOM.removeElementClass(this.element,
  615 + this.options.selectclass);
  616 + }
  617 +
  618 + if (this.options.ghosting) {
  619 + // XXX: from a user point of view, it would be better to remove
  620 + // the node only *after* the MochiKit.Visual.Move end when used
  621 + // with revert.
  622 + MochiKit.Position.relativize(this.element, this.ghostPosition);
  623 + MochiKit.DOM.removeElement(this._clone);
  624 + this._clone = null;
  625 + }
  626 +
  627 + if (success) {
  628 + dr.Droppables.fire(event, this.element);
  629 + }
  630 + dr.Draggables.notify('end', this, event);
  631 +
  632 + var revert = this.options.revert;
  633 + if (revert && typeof(revert) == 'function') {
  634 + revert = revert(this.element);
  635 + }
  636 +
  637 + var d = this.currentDelta();
  638 + if (revert && this.options.reverteffect) {
  639 + this._revert = this.options.reverteffect(this.element,
  640 + d[1] - this.delta[1], d[0] - this.delta[0]);
  641 + } else {
  642 + this.delta = d;
  643 + }
  644 +
  645 + if (this.options.zindex) {
  646 + this.element.style.zIndex = this.originalZ;
  647 + }
  648 +
  649 + if (this.options.endeffect) {
  650 + this.options.endeffect(this.element);
  651 + }
  652 +
  653 + dr.Draggables.deactivate();
  654 + dr.Droppables.reset(this.element);
  655 + },
  656 +
  657 + /** @id MochiKit.DragAndDrop.keyPress */
  658 + keyPress: function (event) {
  659 + if (event.key().string != "KEY_ESCAPE") {
  660 + return;
  661 + }
  662 + this.finishDrag(event, false);
  663 + event.stop();
  664 + },
  665 +
  666 + /** @id MochiKit.DragAndDrop.endDrag */
  667 + endDrag: function (event) {
  668 + if (!this.dragging) {
  669 + return;
  670 + }
  671 + this.stopScrolling();
  672 + this.finishDrag(event, true);
  673 + event.stop();
  674 + },
  675 +
  676 + /** @id MochiKit.DragAndDrop.draw */
  677 + draw: function (point) {
  678 + var pos = MochiKit.Position.cumulativeOffset(this.element);
  679 + if (this.options.ghosting) {
  680 + var r = MochiKit.Position.realOffset(this.element);
  681 + pos.x += r.x - MochiKit.Position.windowOffset.x;
  682 + pos.y += r.y - MochiKit.Position.windowOffset.y;
  683 + }
  684 + var d = this.currentDelta();
  685 + pos.x -= d[0];
  686 + pos.y -= d[1];
  687 +
  688 + if (this.options.scroll && (this.options.scroll != window && this._isScrollChild)) {
  689 + pos.x -= this.options.scroll.scrollLeft - this.originalScrollLeft;
  690 + pos.y -= this.options.scroll.scrollTop - this.originalScrollTop;
  691 + }
  692 +
  693 + var p = [point.page.x - pos.x - this.offset[0],
  694 + point.page.y - pos.y - this.offset[1]]
  695 +
  696 + if (this.options.snap) {
  697 + if (typeof(this.options.snap) == 'function') {
  698 + p = this.options.snap(p[0], p[1]);
  699 + } else {
  700 + if (this.options.snap instanceof Array) {
  701 + var i = -1;
  702 + p = MochiKit.Base.map(MochiKit.Base.bind(function (v) {
  703 + i += 1;
  704 + return Math.round(v/this.options.snap[i]) *
  705 + this.options.snap[i]
  706 + }, this), p)
  707 + } else {
  708 + p = MochiKit.Base.map(MochiKit.Base.bind(function (v) {
  709 + return Math.round(v/this.options.snap) *
  710 + this.options.snap
  711 + }, this), p)
  712 + }
  713 + }
  714 + }
  715 + var style = this.element.style;
  716 + if ((!this.options.constraint) ||
  717 + (this.options.constraint == 'horizontal')) {
  718 + style.left = p[0] + 'px';
  719 + }
  720 + if ((!this.options.constraint) ||
  721 + (this.options.constraint == 'vertical')) {
  722 + style.top = p[1] + 'px';
  723 + }
  724 + if (style.visibility == 'hidden') {
  725 + style.visibility = ''; // fix gecko rendering
  726 + }
  727 + },
  728 +
  729 + /** @id MochiKit.DragAndDrop.stopScrolling */
  730 + stopScrolling: function () {
  731 + if (this.scrollInterval) {
  732 + clearInterval(this.scrollInterval);
  733 + this.scrollInterval = null;
  734 + MochiKit.DragAndDrop.Draggables._lastScrollPointer = null;
  735 + }
  736 + },
  737 +
  738 + /** @id MochiKit.DragAndDrop.startScrolling */
  739 + startScrolling: function (speed) {
  740 + if (!speed[0] && !speed[1]) {
  741 + return;
  742 + }
  743 + this.scrollSpeed = [speed[0] * this.options.scrollSpeed,
  744 + speed[1] * this.options.scrollSpeed];
  745 + this.lastScrolled = new Date();
  746 + this.scrollInterval = setInterval(MochiKit.Base.bind(this.scroll, this), 10);
  747 + },
  748 +
  749 + /** @id MochiKit.DragAndDrop.scroll */
  750 + scroll: function () {
  751 + var current = new Date();
  752 + var delta = current - this.lastScrolled;
  753 + this.lastScrolled = current;
  754 +
  755 + if (this.options.scroll == window) {
  756 + var s = this._getWindowScroll(this.options.scroll);
  757 + if (this.scrollSpeed[0] || this.scrollSpeed[1]) {
  758 + var d = delta / 1000;
  759 + this.options.scroll.scrollTo(s.left + d * this.scrollSpeed[0],
  760 + s.top + d * this.scrollSpeed[1]);
  761 + }
  762 + } else {
  763 + this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
  764 + this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000;
  765 + }
  766 +
  767 + var d = MochiKit.DragAndDrop;
  768 +
  769 + MochiKit.Position.prepare();
  770 + d.Droppables.show(d.Draggables._lastPointer, this.element);
  771 + d.Draggables.notify('drag', this);
  772 + if (this._isScrollChild) {
  773 + d.Draggables._lastScrollPointer = d.Draggables._lastScrollPointer || d.Draggables._lastPointer;
  774 + d.Draggables._lastScrollPointer.x += this.scrollSpeed[0] * delta / 1000;
  775 + d.Draggables._lastScrollPointer.y += this.scrollSpeed[1] * delta / 1000;
  776 + if (d.Draggables._lastScrollPointer.x < 0) {
  777 + d.Draggables._lastScrollPointer.x = 0;
  778 + }
  779 + if (d.Draggables._lastScrollPointer.y < 0) {
  780 + d.Draggables._lastScrollPointer.y = 0;
  781 + }
  782 + this.draw(d.Draggables._lastScrollPointer);
  783 + }
  784 +
  785 + this.options.onchange(this);
  786 + },
  787 +
  788 + _getWindowScroll: function (w) {
  789 + var vp, w, h;
  790 + MochiKit.DOM.withWindow(w, function () {
  791 + vp = MochiKit.Style.getViewportPosition(w.document);
  792 + });
  793 + if (w.innerWidth) {
  794 + w = w.innerWidth;
  795 + h = w.innerHeight;
  796 + } else if (w.document.documentElement && w.document.documentElement.clientWidth) {
  797 + w = w.document.documentElement.clientWidth;
  798 + h = w.document.documentElement.clientHeight;
  799 + } else {
  800 + w = w.document.body.offsetWidth;
  801 + h = w.document.body.offsetHeight
  802 + }
  803 + return {top: vp.x, left: vp.y, width: w, height: h};
  804 + },
  805 +
  806 + /** @id MochiKit.DragAndDrop.repr */
  807 + repr: function () {
  808 + return '[' + this.__class__.NAME + ", options:" + MochiKit.Base.repr(this.options) + "]";
  809 + }
  810 +};
  811 +
  812 +MochiKit.DragAndDrop.__new__ = function () {
  813 + MochiKit.Base.nameFunctions(this);
  814 +
  815 + this.EXPORT_TAGS = {
  816 + ":common": this.EXPORT,
  817 + ":all": MochiKit.Base.concat(this.EXPORT, this.EXPORT_OK)
  818 + };
  819 +};
  820 +
  821 +MochiKit.DragAndDrop.__new__();
  822 +
  823 +MochiKit.Base._exportSymbols(this, MochiKit.DragAndDrop);
  824 +
... ...
thirdpartyjs/MochiKit/MochiKit.js
Changes suppressed. Click to show
1 1 /***
2 2  
3   -MochiKit.MochiKit 1.3.1
  3 + MochiKit.MochiKit 1.4 : PACKED VERSION
4 4  
5   -See <http://mochikit.com/> for documentation, downloads, license, etc.
  5 + THIS FILE IS AUTOMATICALLY GENERATED. If creating patches, please
  6 + diff against the source tree, not this file.
6 7  
7   -(c) 2005 Bob Ippolito. All rights Reserved.
  8 + See <http://mochikit.com/> for documentation, downloads, license, etc.
  9 +
  10 + (c) 2005 Bob Ippolito. All rights Reserved.
8 11  
9 12 ***/
10 13  
11   -if (typeof(MochiKit) == 'undefined') {
12   - MochiKit = {};
  14 +if(typeof (dojo)!="undefined"){
  15 +dojo.provide("MochiKit.Base");
13 16 }
14   -
15   -if (typeof(MochiKit.MochiKit) == 'undefined') {
16   - MochiKit.MochiKit = {};
  17 +if(typeof (MochiKit)=="undefined"){
  18 +MochiKit={};
17 19 }
18   -
19   -MochiKit.MochiKit.NAME = "MochiKit.MochiKit";
20   -MochiKit.MochiKit.VERSION = "1.3.1";
21   -MochiKit.MochiKit.__repr__ = function () {
22   - return "[" + this.NAME + " " + this.VERSION + "]";
  20 +if(typeof (MochiKit.Base)=="undefined"){
  21 +MochiKit.Base={};
  22 +}
  23 +if(typeof (MochiKit.__export__)=="undefined"){
  24 +MochiKit.__export__=(MochiKit.__compat__||(typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined"));
  25 +}
  26 +MochiKit.Base.VERSION="1.4";
  27 +MochiKit.Base.NAME="MochiKit.Base";
  28 +MochiKit.Base.update=function(_1,_2){
  29 +if(_1===null){
  30 +_1={};
  31 +}
  32 +for(var i=1;i<arguments.length;i++){
  33 +var o=arguments[i];
  34 +if(typeof (o)!="undefined"&&o!==null){
  35 +for(var k in o){
  36 +_1[k]=o[k];
  37 +}
  38 +}
  39 +}
  40 +return _1;
23 41 };
24   -
25   -MochiKit.MochiKit.toString = function () {
26   - return this.__repr__();
  42 +MochiKit.Base.update(MochiKit.Base,{__repr__:function(){
  43 +return "["+this.NAME+" "+this.VERSION+"]";
  44 +},toString:function(){
  45 +return this.__repr__();
  46 +},camelize:function(_6){
  47 +var _7=_6.split("-");
  48 +var cc=_7[0];
  49 +for(var i=1;i<_7.length;i++){
  50 +cc+=_7[i].charAt(0).toUpperCase()+_7[i].substring(1);
  51 +}
  52 +return cc;
  53 +},counter:function(n){
  54 +if(arguments.length===0){
  55 +n=1;
  56 +}
  57 +return function(){
  58 +return n++;
27 59 };
28   -
29   -MochiKit.MochiKit.SUBMODULES = [
30   - "Base",
31   - "Iter",
32   - "Logging",
33   - "DateTime",
34   - "Format",
35   - "Async",
36   - "DOM",
37   - "LoggingPane",
38   - "Color",
39   - "Signal",
40   - "Visual"
41   -];
42   -
43   -if (typeof(JSAN) != 'undefined' || typeof(dojo) != 'undefined') {
44   - if (typeof(dojo) != 'undefined') {
45   - dojo.provide('MochiKit.MochiKit');
46   - dojo.require("MochiKit.*");
47   - }
48   - if (typeof(JSAN) != 'undefined') {
49   - // hopefully this makes it easier for static analysis?
50   - JSAN.use("MochiKit.Base", []);
51   - JSAN.use("MochiKit.Iter", []);
52   - JSAN.use("MochiKit.Logging", []);
53   - JSAN.use("MochiKit.DateTime", []);
54   - JSAN.use("MochiKit.Format", []);
55   - JSAN.use("MochiKit.Async", []);
56   - JSAN.use("MochiKit.DOM", []);
57   - JSAN.use("MochiKit.LoggingPane", []);
58   - JSAN.use("MochiKit.Color", []);
59   - JSAN.use("MochiKit.Signal", []);
60   - JSAN.use("MochiKit.Visual", []);
61   - }
62   - (function () {
63   - var extend = MochiKit.Base.extend;
64   - var self = MochiKit.MochiKit;
65   - var modules = self.SUBMODULES;
66   - var EXPORT = [];
67   - var EXPORT_OK = [];
68   - var EXPORT_TAGS = {};
69   - var i, k, m, all;
70   - for (i = 0; i < modules.length; i++) {
71   - m = MochiKit[modules[i]];
72   - extend(EXPORT, m.EXPORT);
73   - extend(EXPORT_OK, m.EXPORT_OK);
74   - for (k in m.EXPORT_TAGS) {
75   - EXPORT_TAGS[k] = extend(EXPORT_TAGS[k], m.EXPORT_TAGS[k]);
76   - }
77   - all = m.EXPORT_TAGS[":all"];
78   - if (!all) {
79   - all = extend(null, m.EXPORT, m.EXPORT_OK);
80   - }
81   - var j;
82   - for (j = 0; j < all.length; j++) {
83   - k = all[j];
84   - self[k] = m[k];
85   - }
86   - }
87   - self.EXPORT = EXPORT;
88   - self.EXPORT_OK = EXPORT_OK;
89   - self.EXPORT_TAGS = EXPORT_TAGS;
90   - }());
91   -
92   -} else {
93   - if (typeof(MochiKit.__compat__) == 'undefined') {
94   - MochiKit.__compat__ = true;
95   - }
96   - (function () {
97   - var scripts = document.getElementsByTagName("script");
98   - var kXULNSURI = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
99   - var base = null;
100   - var baseElem = null;
101   - var allScripts = {};
102   - var i;
103   - for (i = 0; i < scripts.length; i++) {
104   - var src = scripts[i].getAttribute("src");
105   - if (!src) {
106   - continue;
107   - }
108   - allScripts[src] = true;
109   - if (src.match(/MochiKit.js$/)) {
110   - base = src.substring(0, src.lastIndexOf('MochiKit.js'));
111   - baseElem = scripts[i];
112   - }
113   - }
114   - if (base === null) {
115   - return;
116   - }
117   - var modules = MochiKit.MochiKit.SUBMODULES;
118   - for (var i = 0; i < modules.length; i++) {
119   - if (MochiKit[modules[i]]) {
120   - continue;
121   - }
122   - var uri = base + modules[i] + '.js';
123   - if (uri in allScripts) {
124   - continue;
125   - }
126   - if (document.documentElement &&
127   - document.documentElement.namespaceURI == kXULNSURI) {
128   - // XUL
129   - var s = document.createElementNS(kXULNSURI, 'script');
130   - s.setAttribute("id", "MochiKit_" + base + modules[i]);
131   - s.setAttribute("src", uri);
132   - s.setAttribute("type", "application/x-javascript");
133   - baseElem.parentNode.appendChild(s);
134   - } else {
135   - // HTML
136   - /*
137   - DOM can not be used here because Safari does
138   - deferred loading of scripts unless they are
139   - in the document or inserted with document.write
140   -
141   - This is not XHTML compliant. If you want XHTML
142   - compliance then you must use the packed version of MochiKit
143   - or include each script individually (basically unroll
144   - these document.write calls into your XHTML source)
145   -
146   - */
147   - document.write('<script src="' + uri +
148   - '" type="text/javascript"></script>');
149   - }
150   - };
151   - })();
  60 +},clone:function(obj){
  61 +var me=arguments.callee;
  62 +if(arguments.length==1){
  63 +me.prototype=obj;
  64 +return new me();
  65 +}
  66 +},_flattenArray:function(res,lst){
  67 +for(var i=0;i<lst.length;i++){
  68 +var o=lst[i];
  69 +if(o instanceof Array){
  70 +arguments.callee(res,o);
  71 +}else{
  72 +res.push(o);
  73 +}
  74 +}
  75 +return res;
  76 +},flattenArray:function(lst){
  77 +return MochiKit.Base._flattenArray([],lst);
  78 +},flattenArguments:function(lst){
  79 +var res=[];
  80 +var m=MochiKit.Base;
  81 +var _15=m.extend(null,arguments);
  82 +while(_15.length){
  83 +var o=_15.shift();
  84 +if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
  85 +for(var i=o.length-1;i>=0;i--){
  86 +_15.unshift(o[i]);
  87 +}
  88 +}else{
  89 +res.push(o);
  90 +}
  91 +}
  92 +return res;
  93 +},extend:function(_16,obj,_17){
  94 +if(!_17){
  95 +_17=0;
  96 +}
  97 +if(obj){
  98 +var l=obj.length;
  99 +if(typeof (l)!="number"){
  100 +if(typeof (MochiKit.Iter)!="undefined"){
  101 +obj=MochiKit.Iter.list(obj);
  102 +l=obj.length;
  103 +}else{
  104 +throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
  105 +}
  106 +}
  107 +if(!_16){
  108 +_16=[];
  109 +}
  110 +for(var i=_17;i<l;i++){
  111 +_16.push(obj[i]);
  112 +}
  113 +}
  114 +return _16;
  115 +},updatetree:function(_19,obj){
  116 +if(_19===null){
  117 +_19={};
  118 +}
  119 +for(var i=1;i<arguments.length;i++){
  120 +var o=arguments[i];
  121 +if(typeof (o)!="undefined"&&o!==null){
  122 +for(var k in o){
  123 +var v=o[k];
  124 +if(typeof (_19[k])=="object"&&typeof (v)=="object"){
  125 +arguments.callee(_19[k],v);
  126 +}else{
  127 +_19[k]=v;
  128 +}
  129 +}
  130 +}
  131 +}
  132 +return _19;
  133 +},setdefault:function(_21,obj){
  134 +if(_21===null){
  135 +_21={};
  136 +}
  137 +for(var i=1;i<arguments.length;i++){
  138 +var o=arguments[i];
  139 +for(var k in o){
  140 +if(!(k in _21)){
  141 +_21[k]=o[k];
  142 +}
  143 +}
  144 +}
  145 +return _21;
  146 +},keys:function(obj){
  147 +var _22=[];
  148 +for(var _23 in obj){
  149 +_22.push(_23);
  150 +}
  151 +return _22;
  152 +},values:function(obj){
  153 +var _24=[];
  154 +for(var _25 in obj){
  155 +_24.push(obj[_25]);
  156 +}
  157 +return _24;
  158 +},items:function(obj){
  159 +var _26=[];
  160 +var e;
  161 +for(var _28 in obj){
  162 +var v;
  163 +try{
  164 +v=obj[_28];
  165 +}
  166 +catch(e){
  167 +continue;
  168 +}
  169 +_26.push([_28,v]);
  170 +}
  171 +return _26;
  172 +},_newNamedError:function(_29,_30,_31){
  173 +_31.prototype=new MochiKit.Base.NamedError(_29.NAME+"."+_30);
  174 +_29[_30]=_31;
  175 +},operator:{truth:function(a){
  176 +return !!a;
  177 +},lognot:function(a){
  178 +return !a;
  179 +},identity:function(a){
  180 +return a;
  181 +},not:function(a){
  182 +return ~a;
  183 +},neg:function(a){
  184 +return -a;
  185 +},add:function(a,b){
  186 +return a+b;
  187 +},sub:function(a,b){
  188 +return a-b;
  189 +},div:function(a,b){
  190 +return a/b;
  191 +},mod:function(a,b){
  192 +return a%b;
  193 +},mul:function(a,b){
  194 +return a*b;
  195 +},and:function(a,b){
  196 +return a&b;
  197 +},or:function(a,b){
  198 +return a|b;
  199 +},xor:function(a,b){
  200 +return a^b;
  201 +},lshift:function(a,b){
  202 +return a<<b;
  203 +},rshift:function(a,b){
  204 +return a>>b;
  205 +},zrshift:function(a,b){
  206 +return a>>>b;
  207 +},eq:function(a,b){
  208 +return a==b;
  209 +},ne:function(a,b){
  210 +return a!=b;
  211 +},gt:function(a,b){
  212 +return a>b;
  213 +},ge:function(a,b){
  214 +return a>=b;
  215 +},lt:function(a,b){
  216 +return a<b;
  217 +},le:function(a,b){
  218 +return a<=b;
  219 +},seq:function(a,b){
  220 +return a===b;
  221 +},sne:function(a,b){
  222 +return a!==b;
  223 +},ceq:function(a,b){
  224 +return MochiKit.Base.compare(a,b)===0;
  225 +},cne:function(a,b){
  226 +return MochiKit.Base.compare(a,b)!==0;
  227 +},cgt:function(a,b){
  228 +return MochiKit.Base.compare(a,b)==1;
  229 +},cge:function(a,b){
  230 +return MochiKit.Base.compare(a,b)!=-1;
  231 +},clt:function(a,b){
  232 +return MochiKit.Base.compare(a,b)==-1;
  233 +},cle:function(a,b){
  234 +return MochiKit.Base.compare(a,b)!=1;
  235 +},logand:function(a,b){
  236 +return a&&b;
  237 +},logor:function(a,b){
  238 +return a||b;
  239 +},contains:function(a,b){
  240 +return b in a;
  241 +}},forwardCall:function(_34){
  242 +return function(){
  243 +return this[_34].apply(this,arguments);
  244 +};
  245 +},itemgetter:function(_35){
  246 +return function(arg){
  247 +return arg[_35];
  248 +};
  249 +},typeMatcher:function(){
  250 +var _37={};
  251 +for(var i=0;i<arguments.length;i++){
  252 +var typ=arguments[i];
  253 +_37[typ]=typ;
  254 +}
  255 +return function(){
  256 +for(var i=0;i<arguments.length;i++){
  257 +if(!(typeof (arguments[i]) in _37)){
  258 +return false;
  259 +}
  260 +}
  261 +return true;
  262 +};
  263 +},isNull:function(){
  264 +for(var i=0;i<arguments.length;i++){
  265 +if(arguments[i]!==null){
  266 +return false;
  267 +}
  268 +}
  269 +return true;
  270 +},isUndefinedOrNull:function(){
  271 +for(var i=0;i<arguments.length;i++){
  272 +var o=arguments[i];
  273 +if(!(typeof (o)=="undefined"||o===null)){
  274 +return false;
  275 +}
  276 +}
  277 +return true;
  278 +},isEmpty:function(obj){
  279 +return !MochiKit.Base.isNotEmpty.apply(this,arguments);
  280 +},isNotEmpty:function(obj){
  281 +for(var i=0;i<arguments.length;i++){
  282 +var o=arguments[i];
  283 +if(!(o&&o.length)){
  284 +return false;
  285 +}
  286 +}
  287 +return true;
  288 +},isArrayLike:function(){
  289 +for(var i=0;i<arguments.length;i++){
  290 +var o=arguments[i];
  291 +var typ=typeof (o);
  292 +if((typ!="object"&&!(typ=="function"&&typeof (o.item)=="function"))||o===null||typeof (o.length)!="number"||o.nodeType===3){
  293 +return false;
  294 +}
  295 +}
  296 +return true;
  297 +},isDateLike:function(){
  298 +for(var i=0;i<arguments.length;i++){
  299 +var o=arguments[i];
  300 +if(typeof (o)!="object"||o===null||typeof (o.getTime)!="function"){
  301 +return false;
  302 +}
  303 +}
  304 +return true;
  305 +},xmap:function(fn){
  306 +if(fn===null){
  307 +return MochiKit.Base.extend(null,arguments,1);
  308 +}
  309 +var _40=[];
  310 +for(var i=1;i<arguments.length;i++){
  311 +_40.push(fn(arguments[i]));
  312 +}
  313 +return _40;
  314 +},map:function(fn,lst){
  315 +var m=MochiKit.Base;
  316 +var itr=MochiKit.Iter;
  317 +var _42=m.isArrayLike;
  318 +if(arguments.length<=2){
  319 +if(!_42(lst)){
  320 +if(itr){
  321 +lst=itr.list(lst);
  322 +if(fn===null){
  323 +return lst;
  324 +}
  325 +}else{
  326 +throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
  327 +}
  328 +}
  329 +if(fn===null){
  330 +return m.extend(null,lst);
  331 +}
  332 +var _43=[];
  333 +for(var i=0;i<lst.length;i++){
  334 +_43.push(fn(lst[i]));
  335 +}
  336 +return _43;
  337 +}else{
  338 +if(fn===null){
  339 +fn=Array;
  340 +}
  341 +var _44=null;
  342 +for(i=1;i<arguments.length;i++){
  343 +if(!_42(arguments[i])){
  344 +if(itr){
  345 +return itr.list(itr.imap.apply(null,arguments));
  346 +}else{
  347 +throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
  348 +}
  349 +}
  350 +var l=arguments[i].length;
  351 +if(_44===null||_44>l){
  352 +_44=l;
  353 +}
  354 +}
  355 +_43=[];
  356 +for(i=0;i<_44;i++){
  357 +var _45=[];
  358 +for(var j=1;j<arguments.length;j++){
  359 +_45.push(arguments[j][i]);
  360 +}
  361 +_43.push(fn.apply(this,_45));
  362 +}
  363 +return _43;
  364 +}
  365 +},xfilter:function(fn){
  366 +var _47=[];
  367 +if(fn===null){
  368 +fn=MochiKit.Base.operator.truth;
  369 +}
  370 +for(var i=1;i<arguments.length;i++){
  371 +var o=arguments[i];
  372 +if(fn(o)){
  373 +_47.push(o);
  374 +}
  375 +}
  376 +return _47;
  377 +},filter:function(fn,lst,_48){
  378 +var _49=[];
  379 +var m=MochiKit.Base;
  380 +if(!m.isArrayLike(lst)){
  381 +if(MochiKit.Iter){
  382 +lst=MochiKit.Iter.list(lst);
  383 +}else{
  384 +throw new TypeError("Argument not an array-like and MochiKit.Iter not present");
  385 +}
  386 +}
  387 +if(fn===null){
  388 +fn=m.operator.truth;
  389 +}
  390 +if(typeof (Array.prototype.filter)=="function"){
  391 +return Array.prototype.filter.call(lst,fn,_48);
  392 +}else{
  393 +if(typeof (_48)=="undefined"||_48===null){
  394 +for(var i=0;i<lst.length;i++){
  395 +var o=lst[i];
  396 +if(fn(o)){
  397 +_49.push(o);
  398 +}
  399 +}
  400 +}else{
  401 +for(i=0;i<lst.length;i++){
  402 +o=lst[i];
  403 +if(fn.call(_48,o)){
  404 +_49.push(o);
  405 +}
  406 +}
  407 +}
  408 +}
  409 +return _49;
  410 +},_wrapDumbFunction:function(_50){
  411 +return function(){
  412 +switch(arguments.length){
  413 +case 0:
  414 +return _50();
  415 +case 1:
  416 +return _50(arguments[0]);
  417 +case 2:
  418 +return _50(arguments[0],arguments[1]);
  419 +case 3:
  420 +return _50(arguments[0],arguments[1],arguments[2]);
  421 +}
  422 +var _51=[];
  423 +for(var i=0;i<arguments.length;i++){
  424 +_51.push("arguments["+i+"]");
  425 +}
  426 +return eval("(func("+_51.join(",")+"))");
  427 +};
  428 +},methodcaller:function(_52){
  429 +var _53=MochiKit.Base.extend(null,arguments,1);
  430 +if(typeof (_52)=="function"){
  431 +return function(obj){
  432 +return _52.apply(obj,_53);
  433 +};
  434 +}else{
  435 +return function(obj){
  436 +return obj[_52].apply(obj,_53);
  437 +};
  438 +}
  439 +},method:function(_54,_55){
  440 +var m=MochiKit.Base;
  441 +return m.bind.apply(this,m.extend([_55,_54],arguments,2));
  442 +},compose:function(f1,f2){
  443 +var _58=[];
  444 +var m=MochiKit.Base;
  445 +if(arguments.length===0){
  446 +throw new TypeError("compose() requires at least one argument");
  447 +}
  448 +for(var i=0;i<arguments.length;i++){
  449 +var fn=arguments[i];
  450 +if(typeof (fn)!="function"){
  451 +throw new TypeError(m.repr(fn)+" is not a function");
  452 +}
  453 +_58.push(fn);
  454 +}
  455 +return function(){
  456 +var _59=arguments;
  457 +for(var i=_58.length-1;i>=0;i--){
  458 +_59=[_58[i].apply(this,_59)];
  459 +}
  460 +return _59[0];
  461 +};
  462 +},bind:function(_60,_61){
  463 +if(typeof (_60)=="string"){
  464 +_60=_61[_60];
  465 +}
  466 +var _62=_60.im_func;
  467 +var _63=_60.im_preargs;
  468 +var _64=_60.im_self;
  469 +var m=MochiKit.Base;
  470 +if(typeof (_60)=="function"&&typeof (_60.apply)=="undefined"){
  471 +_60=m._wrapDumbFunction(_60);
  472 +}
  473 +if(typeof (_62)!="function"){
  474 +_62=_60;
  475 +}
  476 +if(typeof (_61)!="undefined"){
  477 +_64=_61;
  478 +}
  479 +if(typeof (_63)=="undefined"){
  480 +_63=[];
  481 +}else{
  482 +_63=_63.slice();
  483 +}
  484 +m.extend(_63,arguments,2);
  485 +var _65=function(){
  486 +var _66=arguments;
  487 +var me=arguments.callee;
  488 +if(me.im_preargs.length>0){
  489 +_66=m.concat(me.im_preargs,_66);
  490 +}
  491 +var _61=me.im_self;
  492 +if(!_61){
  493 +_61=this;
  494 +}
  495 +return me.im_func.apply(_61,_66);
  496 +};
  497 +_65.im_self=_64;
  498 +_65.im_func=_62;
  499 +_65.im_preargs=_63;
  500 +return _65;
  501 +},bindMethods:function(_67){
  502 +var _68=MochiKit.Base.bind;
  503 +for(var k in _67){
  504 +var _69=_67[k];
  505 +if(typeof (_69)=="function"){
  506 +_67[k]=_68(_69,_67);
  507 +}
  508 +}
  509 +},registerComparator:function(_70,_71,_72,_73){
  510 +MochiKit.Base.comparatorRegistry.register(_70,_71,_72,_73);
  511 +},_primitives:{"boolean":true,"string":true,"number":true},compare:function(a,b){
  512 +if(a==b){
  513 +return 0;
  514 +}
  515 +var _74=(typeof (a)=="undefined"||a===null);
  516 +var _75=(typeof (b)=="undefined"||b===null);
  517 +if(_74&&_75){
  518 +return 0;
  519 +}else{
  520 +if(_74){
  521 +return -1;
  522 +}else{
  523 +if(_75){
  524 +return 1;
  525 +}
  526 +}
  527 +}
  528 +var m=MochiKit.Base;
  529 +var _76=m._primitives;
  530 +if(!(typeof (a) in _76&&typeof (b) in _76)){
  531 +try{
  532 +return m.comparatorRegistry.match(a,b);
  533 +}
  534 +catch(e){
  535 +if(e!=m.NotFound){
  536 +throw e;
  537 +}
  538 +}
  539 +}
  540 +if(a<b){
  541 +return -1;
  542 +}else{
  543 +if(a>b){
  544 +return 1;
  545 +}
  546 +}
  547 +var _77=m.repr;
  548 +throw new TypeError(_77(a)+" and "+_77(b)+" can not be compared");
  549 +},compareDateLike:function(a,b){
  550 +return MochiKit.Base.compare(a.getTime(),b.getTime());
  551 +},compareArrayLike:function(a,b){
  552 +var _78=MochiKit.Base.compare;
  553 +var _79=a.length;
  554 +var _80=0;
  555 +if(_79>b.length){
  556 +_80=1;
  557 +_79=b.length;
  558 +}else{
  559 +if(_79<b.length){
  560 +_80=-1;
  561 +}
  562 +}
  563 +for(var i=0;i<_79;i++){
  564 +var cmp=_78(a[i],b[i]);
  565 +if(cmp){
  566 +return cmp;
  567 +}
  568 +}
  569 +return _80;
  570 +},registerRepr:function(_82,_83,_84,_85){
  571 +MochiKit.Base.reprRegistry.register(_82,_83,_84,_85);
  572 +},repr:function(o){
  573 +if(typeof (o)=="undefined"){
  574 +return "undefined";
  575 +}else{
  576 +if(o===null){
  577 +return "null";
  578 +}
  579 +}
  580 +try{
  581 +if(typeof (o.__repr__)=="function"){
  582 +return o.__repr__();
  583 +}else{
  584 +if(typeof (o.repr)=="function"&&o.repr!=arguments.callee){
  585 +return o.repr();
  586 +}
  587 +}
  588 +return MochiKit.Base.reprRegistry.match(o);
  589 +}
  590 +catch(e){
  591 +if(typeof (o.NAME)=="string"&&(o.toString==Function.prototype.toString||o.toString==Object.prototype.toString)){
  592 +return o.NAME;
  593 +}
  594 +}
  595 +try{
  596 +var _86=(o+"");
  597 +}
  598 +catch(e){
  599 +return "["+typeof (o)+"]";
  600 +}
  601 +if(typeof (o)=="function"){
  602 +o=_86.replace(/^\s+/,"");
  603 +var idx=o.indexOf("{");
  604 +if(idx!=-1){
  605 +o=o.substr(0,idx)+"{...}";
  606 +}
  607 +}
  608 +return _86;
  609 +},reprArrayLike:function(o){
  610 +var m=MochiKit.Base;
  611 +return "["+m.map(m.repr,o).join(", ")+"]";
  612 +},reprString:function(o){
  613 +return ("\""+o.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");
  614 +},reprNumber:function(o){
  615 +return o+"";
  616 +},registerJSON:function(_88,_89,_90,_91){
  617 +MochiKit.Base.jsonRegistry.register(_88,_89,_90,_91);
  618 +},evalJSON:function(){
  619 +return eval("("+arguments[0]+")");
  620 +},serializeJSON:function(o){
  621 +var _92=typeof (o);
  622 +if(_92=="number"||_92=="boolean"){
  623 +return o+"";
  624 +}else{
  625 +if(o===null){
  626 +return "null";
  627 +}
  628 +}
  629 +var m=MochiKit.Base;
  630 +var _93=m.reprString;
  631 +if(_92=="string"){
  632 +return _93(o);
  633 +}
  634 +var me=arguments.callee;
  635 +var _94;
  636 +if(typeof (o.__json__)=="function"){
  637 +_94=o.__json__();
  638 +if(o!==_94){
  639 +return me(_94);
  640 +}
  641 +}
  642 +if(typeof (o.json)=="function"){
  643 +_94=o.json();
  644 +if(o!==_94){
  645 +return me(_94);
  646 +}
  647 +}
  648 +if(_92!="function"&&typeof (o.length)=="number"){
  649 +var res=[];
  650 +for(var i=0;i<o.length;i++){
  651 +var val=me(o[i]);
  652 +if(typeof (val)!="string"){
  653 +val="undefined";
  654 +}
  655 +res.push(val);
  656 +}
  657 +return "["+res.join(", ")+"]";
  658 +}
  659 +try{
  660 +_94=m.jsonRegistry.match(o);
  661 +if(o!==_94){
  662 +return me(_94);
  663 +}
  664 +}
  665 +catch(e){
  666 +if(e!=m.NotFound){
  667 +throw e;
  668 +}
  669 +}
  670 +if(_92=="undefined"){
  671 +throw new TypeError("undefined can not be serialized as JSON");
  672 +}
  673 +if(_92=="function"){
  674 +return null;
  675 +}
  676 +res=[];
  677 +for(var k in o){
  678 +var _96;
  679 +if(typeof (k)=="number"){
  680 +_96="\""+k+"\"";
  681 +}else{
  682 +if(typeof (k)=="string"){
  683 +_96=_93(k);
  684 +}else{
  685 +continue;
  686 +}
  687 +}
  688 +val=me(o[k]);
  689 +if(typeof (val)!="string"){
  690 +continue;
  691 +}
  692 +res.push(_96+":"+val);
  693 +}
  694 +return "{"+res.join(", ")+"}";
  695 +},objEqual:function(a,b){
  696 +return (MochiKit.Base.compare(a,b)===0);
  697 +},arrayEqual:function(_97,arr){
  698 +if(_97.length!=arr.length){
  699 +return false;
  700 +}
  701 +return (MochiKit.Base.compare(_97,arr)===0);
  702 +},concat:function(){
  703 +var _99=[];
  704 +var _100=MochiKit.Base.extend;
  705 +for(var i=0;i<arguments.length;i++){
  706 +_100(_99,arguments[i]);
  707 +}
  708 +return _99;
  709 +},keyComparator:function(key){
  710 +var m=MochiKit.Base;
  711 +var _102=m.compare;
  712 +if(arguments.length==1){
  713 +return function(a,b){
  714 +return _102(a[key],b[key]);
  715 +};
  716 +}
  717 +var _103=m.extend(null,arguments);
  718 +return function(a,b){
  719 +var rval=0;
  720 +for(var i=0;(rval===0)&&(i<_103.length);i++){
  721 +var key=_103[i];
  722 +rval=_102(a[key],b[key]);
  723 +}
  724 +return rval;
  725 +};
  726 +},reverseKeyComparator:function(key){
  727 +var _105=MochiKit.Base.keyComparator.apply(this,arguments);
  728 +return function(a,b){
  729 +return _105(b,a);
  730 +};
  731 +},partial:function(func){
  732 +var m=MochiKit.Base;
  733 +return m.bind.apply(this,m.extend([func,undefined],arguments,1));
  734 +},listMinMax:function(_107,lst){
  735 +if(lst.length===0){
  736 +return null;
  737 +}
  738 +var cur=lst[0];
  739 +var _109=MochiKit.Base.compare;
  740 +for(var i=1;i<lst.length;i++){
  741 +var o=lst[i];
  742 +if(_109(o,cur)==_107){
  743 +cur=o;
  744 +}
  745 +}
  746 +return cur;
  747 +},objMax:function(){
  748 +return MochiKit.Base.listMinMax(1,arguments);
  749 +},objMin:function(){
  750 +return MochiKit.Base.listMinMax(-1,arguments);
  751 +},findIdentical:function(lst,_110,_111,end){
  752 +if(typeof (end)=="undefined"||end===null){
  753 +end=lst.length;
  754 +}
  755 +if(typeof (_111)=="undefined"||_111===null){
  756 +_111=0;
  757 +}
  758 +for(var i=_111;i<end;i++){
  759 +if(lst[i]===_110){
  760 +return i;
  761 +}
  762 +}
  763 +return -1;
  764 +},mean:function(){
  765 +var sum=0;
  766 +var m=MochiKit.Base;
  767 +var args=m.extend(null,arguments);
  768 +var _115=args.length;
  769 +while(args.length){
  770 +var o=args.shift();
  771 +if(o&&typeof (o)=="object"&&typeof (o.length)=="number"){
  772 +_115+=o.length-1;
  773 +for(var i=o.length-1;i>=0;i--){
  774 +sum+=o[i];
  775 +}
  776 +}else{
  777 +sum+=o;
  778 +}
  779 +}
  780 +if(_115<=0){
  781 +throw new TypeError("mean() requires at least one argument");
  782 +}
  783 +return sum/_115;
  784 +},median:function(){
  785 +var data=MochiKit.Base.flattenArguments(arguments);
  786 +if(data.length===0){
  787 +throw new TypeError("median() requires at least one argument");
  788 +}
  789 +data.sort(compare);
  790 +if(data.length%2==0){
  791 +var _117=data.length/2;
  792 +return (data[_117]+data[_117-1])/2;
  793 +}else{
  794 +return data[(data.length-1)/2];
  795 +}
  796 +},findValue:function(lst,_118,_119,end){
  797 +if(typeof (end)=="undefined"||end===null){
  798 +end=lst.length;
  799 +}
  800 +if(typeof (_119)=="undefined"||_119===null){
  801 +_119=0;
  802 +}
  803 +var cmp=MochiKit.Base.compare;
  804 +for(var i=_119;i<end;i++){
  805 +if(cmp(lst[i],_118)===0){
  806 +return i;
  807 +}
  808 +}
  809 +return -1;
  810 +},nodeWalk:function(node,_121){
  811 +var _122=[node];
  812 +var _123=MochiKit.Base.extend;
  813 +while(_122.length){
  814 +var res=_121(_122.shift());
  815 +if(res){
  816 +_123(_122,res);
  817 +}
  818 +}
  819 +},nameFunctions:function(_124){
  820 +var base=_124.NAME;
  821 +if(typeof (base)=="undefined"){
  822 +base="";
  823 +}else{
  824 +base=base+".";
  825 +}
  826 +for(var name in _124){
  827 +var o=_124[name];
  828 +if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
  829 +try{
  830 +o.NAME=base+name;
  831 +}
  832 +catch(e){
  833 +}
  834 +}
  835 +}
  836 +},queryString:function(_127,_128){
  837 +if(typeof (MochiKit.DOM)!="undefined"&&arguments.length==1&&(typeof (_127)=="string"||(typeof (_127.nodeType)!="undefined"&&_127.nodeType>0))){
  838 +var kv=MochiKit.DOM.formContents(_127);
  839 +_127=kv[0];
  840 +_128=kv[1];
  841 +}else{
  842 +if(arguments.length==1){
  843 +var o=_127;
  844 +_127=[];
  845 +_128=[];
  846 +for(var k in o){
  847 +var v=o[k];
  848 +if(typeof (v)=="function"){
  849 +continue;
  850 +}else{
  851 +if(typeof (v)!="string"&&typeof (v.length)=="number"){
  852 +for(var i=0;i<v.length;i++){
  853 +_127.push(k);
  854 +_128.push(v[i]);
  855 +}
  856 +}else{
  857 +_127.push(k);
  858 +_128.push(v);
  859 +}
  860 +}
  861 +}
  862 +}
  863 +}
  864 +var rval=[];
  865 +var len=Math.min(_127.length,_128.length);
  866 +var _131=MochiKit.Base.urlEncode;
  867 +for(var i=0;i<len;i++){
  868 +v=_128[i];
  869 +if(typeof (v)!="undefined"&&v!==null){
  870 +rval.push(_131(_127[i])+"="+_131(v));
  871 +}
  872 +}
  873 +return rval.join("&");
  874 +},parseQueryString:function(_132,_133){
  875 +var qstr=(_132[0]=="?")?_132.substring(1):_132;
  876 +var _135=qstr.replace(/\+/g,"%20").split(/(\&amp\;|\&\#38\;|\&#x26;|\&)/);
  877 +var o={};
  878 +var _136;
  879 +if(typeof (decodeURIComponent)!="undefined"){
  880 +_136=decodeURIComponent;
  881 +}else{
  882 +_136=unescape;
  883 +}
  884 +if(_133){
  885 +for(var i=0;i<_135.length;i++){
  886 +var pair=_135[i].split("=");
  887 +if(pair.length!==2){
  888 +continue;
  889 +}
  890 +var name=_136(pair[0]);
  891 +var arr=o[name];
  892 +if(!(arr instanceof Array)){
  893 +arr=[];
  894 +o[name]=arr;
  895 +}
  896 +arr.push(_136(pair[1]));
  897 +}
  898 +}else{
  899 +for(i=0;i<_135.length;i++){
  900 +pair=_135[i].split("=");
  901 +if(pair.length!==2){
  902 +continue;
  903 +}
  904 +o[_136(pair[0])]=_136(pair[1]);
  905 +}
  906 +}
  907 +return o;
  908 +}});
  909 +MochiKit.Base.AdapterRegistry=function(){
  910 +this.pairs=[];
  911 +};
  912 +MochiKit.Base.AdapterRegistry.prototype={register:function(name,_138,wrap,_140){
  913 +if(_140){
  914 +this.pairs.unshift([name,_138,wrap]);
  915 +}else{
  916 +this.pairs.push([name,_138,wrap]);
  917 +}
  918 +},match:function(){
  919 +for(var i=0;i<this.pairs.length;i++){
  920 +var pair=this.pairs[i];
  921 +if(pair[1].apply(this,arguments)){
  922 +return pair[2].apply(this,arguments);
  923 +}
  924 +}
  925 +throw MochiKit.Base.NotFound;
  926 +},unregister:function(name){
  927 +for(var i=0;i<this.pairs.length;i++){
  928 +var pair=this.pairs[i];
  929 +if(pair[0]==name){
  930 +this.pairs.splice(i,1);
  931 +return true;
  932 +}
  933 +}
  934 +return false;
  935 +}};
  936 +MochiKit.Base.EXPORT=["flattenArray","noop","camelize","counter","clone","extend","update","updatetree","setdefault","keys","values","items","NamedError","operator","forwardCall","itemgetter","typeMatcher","isCallable","isUndefined","isUndefinedOrNull","isNull","isEmpty","isNotEmpty","isArrayLike","isDateLike","xmap","map","xfilter","filter","methodcaller","compose","bind","bindMethods","NotFound","AdapterRegistry","registerComparator","compare","registerRepr","repr","objEqual","arrayEqual","concat","keyComparator","reverseKeyComparator","partial","merge","listMinMax","listMax","listMin","objMax","objMin","nodeWalk","zip","urlEncode","queryString","serializeJSON","registerJSON","evalJSON","parseQueryString","findValue","findIdentical","flattenArguments","method","average","mean","median"];
  937 +MochiKit.Base.EXPORT_OK=["nameFunctions","comparatorRegistry","reprRegistry","jsonRegistry","compareDateLike","compareArrayLike","reprArrayLike","reprString","reprNumber"];
  938 +MochiKit.Base._exportSymbols=function(_141,_142){
  939 +if(!MochiKit.__export__){
  940 +return;
  941 +}
  942 +var all=_142.EXPORT_TAGS[":all"];
  943 +for(var i=0;i<all.length;i++){
  944 +_141[all[i]]=_142[all[i]];
  945 +}
  946 +};
  947 +MochiKit.Base.__new__=function(){
  948 +var m=this;
  949 +m.noop=m.operator.identity;
  950 +m.forward=m.forwardCall;
  951 +m.find=m.findValue;
  952 +if(typeof (encodeURIComponent)!="undefined"){
  953 +m.urlEncode=function(_144){
  954 +return encodeURIComponent(_144).replace(/\'/g,"%27");
  955 +};
  956 +}else{
  957 +m.urlEncode=function(_145){
  958 +return escape(_145).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27");
  959 +};
  960 +}
  961 +m.NamedError=function(name){
  962 +this.message=name;
  963 +this.name=name;
  964 +};
  965 +m.NamedError.prototype=new Error();
  966 +m.update(m.NamedError.prototype,{repr:function(){
  967 +if(this.message&&this.message!=this.name){
  968 +return this.name+"("+m.repr(this.message)+")";
  969 +}else{
  970 +return this.name+"()";
  971 +}
  972 +},toString:m.forwardCall("repr")});
  973 +m.NotFound=new m.NamedError("MochiKit.Base.NotFound");
  974 +m.listMax=m.partial(m.listMinMax,1);
  975 +m.listMin=m.partial(m.listMinMax,-1);
  976 +m.isCallable=m.typeMatcher("function");
  977 +m.isUndefined=m.typeMatcher("undefined");
  978 +m.merge=m.partial(m.update,null);
  979 +m.zip=m.partial(m.map,null);
  980 +m.average=m.mean;
  981 +m.comparatorRegistry=new m.AdapterRegistry();
  982 +m.registerComparator("dateLike",m.isDateLike,m.compareDateLike);
  983 +m.registerComparator("arrayLike",m.isArrayLike,m.compareArrayLike);
  984 +m.reprRegistry=new m.AdapterRegistry();
  985 +m.registerRepr("arrayLike",m.isArrayLike,m.reprArrayLike);
  986 +m.registerRepr("string",m.typeMatcher("string"),m.reprString);
  987 +m.registerRepr("numbers",m.typeMatcher("number","boolean"),m.reprNumber);
  988 +m.jsonRegistry=new m.AdapterRegistry();
  989 +var all=m.concat(m.EXPORT,m.EXPORT_OK);
  990 +m.EXPORT_TAGS={":common":m.concat(m.EXPORT_OK),":all":all};
  991 +m.nameFunctions(this);
  992 +};
  993 +MochiKit.Base.__new__();
  994 +if(MochiKit.__export__){
  995 +compare=MochiKit.Base.compare;
  996 +compose=MochiKit.Base.compose;
  997 +serializeJSON=MochiKit.Base.serializeJSON;
  998 +}
  999 +MochiKit.Base._exportSymbols(this,MochiKit.Base);
  1000 +if(typeof (dojo)!="undefined"){
  1001 +dojo.provide("MochiKit.Iter");
  1002 +dojo.require("MochiKit.Base");
  1003 +}
  1004 +if(typeof (JSAN)!="undefined"){
  1005 +JSAN.use("MochiKit.Base",[]);
  1006 +}
  1007 +try{
  1008 +if(typeof (MochiKit.Base)=="undefined"){
  1009 +throw "";
  1010 +}
  1011 +}
  1012 +catch(e){
  1013 +throw "MochiKit.Iter depends on MochiKit.Base!";
  1014 +}
  1015 +if(typeof (MochiKit.Iter)=="undefined"){
  1016 +MochiKit.Iter={};
  1017 +}
  1018 +MochiKit.Iter.NAME="MochiKit.Iter";
  1019 +MochiKit.Iter.VERSION="1.4";
  1020 +MochiKit.Base.update(MochiKit.Iter,{__repr__:function(){
  1021 +return "["+this.NAME+" "+this.VERSION+"]";
  1022 +},toString:function(){
  1023 +return this.__repr__();
  1024 +},registerIteratorFactory:function(name,_146,_147,_148){
  1025 +MochiKit.Iter.iteratorRegistry.register(name,_146,_147,_148);
  1026 +},iter:function(_149,_150){
  1027 +var self=MochiKit.Iter;
  1028 +if(arguments.length==2){
  1029 +return self.takewhile(function(a){
  1030 +return a!=_150;
  1031 +},_149);
  1032 +}
  1033 +if(typeof (_149.next)=="function"){
  1034 +return _149;
  1035 +}else{
  1036 +if(typeof (_149.iter)=="function"){
  1037 +return _149.iter();
  1038 +}
  1039 +}
  1040 +try{
  1041 +return self.iteratorRegistry.match(_149);
  1042 +}
  1043 +catch(e){
  1044 +var m=MochiKit.Base;
  1045 +if(e==m.NotFound){
  1046 +e=new TypeError(typeof (_149)+": "+m.repr(_149)+" is not iterable");
  1047 +}
  1048 +throw e;
  1049 +}
  1050 +},count:function(n){
  1051 +if(!n){
  1052 +n=0;
  1053 +}
  1054 +var m=MochiKit.Base;
  1055 +return {repr:function(){
  1056 +return "count("+n+")";
  1057 +},toString:m.forwardCall("repr"),next:m.counter(n)};
  1058 +},cycle:function(p){
  1059 +var self=MochiKit.Iter;
  1060 +var m=MochiKit.Base;
  1061 +var lst=[];
  1062 +var _153=self.iter(p);
  1063 +return {repr:function(){
  1064 +return "cycle(...)";
  1065 +},toString:m.forwardCall("repr"),next:function(){
  1066 +try{
  1067 +var rval=_153.next();
  1068 +lst.push(rval);
  1069 +return rval;
  1070 +}
  1071 +catch(e){
  1072 +if(e!=self.StopIteration){
  1073 +throw e;
  1074 +}
  1075 +if(lst.length===0){
  1076 +this.next=function(){
  1077 +throw self.StopIteration;
  1078 +};
  1079 +}else{
  1080 +var i=-1;
  1081 +this.next=function(){
  1082 +i=(i+1)%lst.length;
  1083 +return lst[i];
  1084 +};
  1085 +}
  1086 +return this.next();
  1087 +}
  1088 +}};
  1089 +},repeat:function(elem,n){
  1090 +var m=MochiKit.Base;
  1091 +if(typeof (n)=="undefined"){
  1092 +return {repr:function(){
  1093 +return "repeat("+m.repr(elem)+")";
  1094 +},toString:m.forwardCall("repr"),next:function(){
  1095 +return elem;
  1096 +}};
  1097 +}
  1098 +return {repr:function(){
  1099 +return "repeat("+m.repr(elem)+", "+n+")";
  1100 +},toString:m.forwardCall("repr"),next:function(){
  1101 +if(n<=0){
  1102 +throw MochiKit.Iter.StopIteration;
  1103 +}
  1104 +n-=1;
  1105 +return elem;
  1106 +}};
  1107 +},next:function(_155){
  1108 +return _155.next();
  1109 +},izip:function(p,q){
  1110 +var m=MochiKit.Base;
  1111 +var self=MochiKit.Iter;
  1112 +var next=self.next;
  1113 +var _158=m.map(self.iter,arguments);
  1114 +return {repr:function(){
  1115 +return "izip(...)";
  1116 +},toString:m.forwardCall("repr"),next:function(){
  1117 +return m.map(next,_158);
  1118 +}};
  1119 +},ifilter:function(pred,seq){
  1120 +var m=MochiKit.Base;
  1121 +seq=MochiKit.Iter.iter(seq);
  1122 +if(pred===null){
  1123 +pred=m.operator.truth;
  1124 +}
  1125 +return {repr:function(){
  1126 +return "ifilter(...)";
  1127 +},toString:m.forwardCall("repr"),next:function(){
  1128 +while(true){
  1129 +var rval=seq.next();
  1130 +if(pred(rval)){
  1131 +return rval;
  1132 +}
  1133 +}
  1134 +return undefined;
  1135 +}};
  1136 +},ifilterfalse:function(pred,seq){
  1137 +var m=MochiKit.Base;
  1138 +seq=MochiKit.Iter.iter(seq);
  1139 +if(pred===null){
  1140 +pred=m.operator.truth;
  1141 +}
  1142 +return {repr:function(){
  1143 +return "ifilterfalse(...)";
  1144 +},toString:m.forwardCall("repr"),next:function(){
  1145 +while(true){
  1146 +var rval=seq.next();
  1147 +if(!pred(rval)){
  1148 +return rval;
  1149 +}
  1150 +}
  1151 +return undefined;
  1152 +}};
  1153 +},islice:function(seq){
  1154 +var self=MochiKit.Iter;
  1155 +var m=MochiKit.Base;
  1156 +seq=self.iter(seq);
  1157 +var _161=0;
  1158 +var stop=0;
  1159 +var step=1;
  1160 +var i=-1;
  1161 +if(arguments.length==2){
  1162 +stop=arguments[1];
  1163 +}else{
  1164 +if(arguments.length==3){
  1165 +_161=arguments[1];
  1166 +stop=arguments[2];
  1167 +}else{
  1168 +_161=arguments[1];
  1169 +stop=arguments[2];
  1170 +step=arguments[3];
  1171 +}
  1172 +}
  1173 +return {repr:function(){
  1174 +return "islice("+["...",_161,stop,step].join(", ")+")";
  1175 +},toString:m.forwardCall("repr"),next:function(){
  1176 +var rval;
  1177 +while(i<_161){
  1178 +rval=seq.next();
  1179 +i++;
  1180 +}
  1181 +if(_161>=stop){
  1182 +throw self.StopIteration;
  1183 +}
  1184 +_161+=step;
  1185 +return rval;
  1186 +}};
  1187 +},imap:function(fun,p,q){
  1188 +var m=MochiKit.Base;
  1189 +var self=MochiKit.Iter;
  1190 +var _165=m.map(self.iter,m.extend(null,arguments,1));
  1191 +var map=m.map;
  1192 +var next=self.next;
  1193 +return {repr:function(){
  1194 +return "imap(...)";
  1195 +},toString:m.forwardCall("repr"),next:function(){
  1196 +return fun.apply(this,map(next,_165));
  1197 +}};
  1198 +},applymap:function(fun,seq,self){
  1199 +seq=MochiKit.Iter.iter(seq);
  1200 +var m=MochiKit.Base;
  1201 +return {repr:function(){
  1202 +return "applymap(...)";
  1203 +},toString:m.forwardCall("repr"),next:function(){
  1204 +return fun.apply(self,seq.next());
  1205 +}};
  1206 +},chain:function(p,q){
  1207 +var self=MochiKit.Iter;
  1208 +var m=MochiKit.Base;
  1209 +if(arguments.length==1){
  1210 +return self.iter(arguments[0]);
  1211 +}
  1212 +var _167=m.map(self.iter,arguments);
  1213 +return {repr:function(){
  1214 +return "chain(...)";
  1215 +},toString:m.forwardCall("repr"),next:function(){
  1216 +while(_167.length>1){
  1217 +try{
  1218 +return _167[0].next();
  1219 +}
  1220 +catch(e){
  1221 +if(e!=self.StopIteration){
  1222 +throw e;
  1223 +}
  1224 +_167.shift();
  1225 +}
  1226 +}
  1227 +if(_167.length==1){
  1228 +var arg=_167.shift();
  1229 +this.next=m.bind("next",arg);
  1230 +return this.next();
  1231 +}
  1232 +throw self.StopIteration;
  1233 +}};
  1234 +},takewhile:function(pred,seq){
  1235 +var self=MochiKit.Iter;
  1236 +seq=self.iter(seq);
  1237 +return {repr:function(){
  1238 +return "takewhile(...)";
  1239 +},toString:MochiKit.Base.forwardCall("repr"),next:function(){
  1240 +var rval=seq.next();
  1241 +if(!pred(rval)){
  1242 +this.next=function(){
  1243 +throw self.StopIteration;
  1244 +};
  1245 +this.next();
  1246 +}
  1247 +return rval;
  1248 +}};
  1249 +},dropwhile:function(pred,seq){
  1250 +seq=MochiKit.Iter.iter(seq);
  1251 +var m=MochiKit.Base;
  1252 +var bind=m.bind;
  1253 +return {"repr":function(){
  1254 +return "dropwhile(...)";
  1255 +},"toString":m.forwardCall("repr"),"next":function(){
  1256 +while(true){
  1257 +var rval=seq.next();
  1258 +if(!pred(rval)){
  1259 +break;
  1260 +}
  1261 +}
  1262 +this.next=bind("next",seq);
  1263 +return rval;
  1264 +}};
  1265 +},_tee:function(_169,sync,_171){
  1266 +sync.pos[_169]=-1;
  1267 +var m=MochiKit.Base;
  1268 +var _172=m.listMin;
  1269 +return {repr:function(){
  1270 +return "tee("+_169+", ...)";
  1271 +},toString:m.forwardCall("repr"),next:function(){
  1272 +var rval;
  1273 +var i=sync.pos[_169];
  1274 +if(i==sync.max){
  1275 +rval=_171.next();
  1276 +sync.deque.push(rval);
  1277 +sync.max+=1;
  1278 +sync.pos[_169]+=1;
  1279 +}else{
  1280 +rval=sync.deque[i-sync.min];
  1281 +sync.pos[_169]+=1;
  1282 +if(i==sync.min&&_172(sync.pos)!=sync.min){
  1283 +sync.min+=1;
  1284 +sync.deque.shift();
  1285 +}
  1286 +}
  1287 +return rval;
  1288 +}};
  1289 +},tee:function(_173,n){
  1290 +var rval=[];
  1291 +var sync={"pos":[],"deque":[],"max":-1,"min":-1};
  1292 +if(arguments.length==1||typeof (n)=="undefined"||n===null){
  1293 +n=2;
152 1294 }
  1295 +var self=MochiKit.Iter;
  1296 +_173=self.iter(_173);
  1297 +var _tee=self._tee;
  1298 +for(var i=0;i<n;i++){
  1299 +rval.push(_tee(i,sync,_173));
  1300 +}
  1301 +return rval;
  1302 +},list:function(_175){
  1303 +var m=MochiKit.Base;
  1304 +if(typeof (_175.slice)=="function"){
  1305 +return _175.slice();
  1306 +}else{
  1307 +if(m.isArrayLike(_175)){
  1308 +return m.concat(_175);
  1309 +}
  1310 +}
  1311 +var self=MochiKit.Iter;
  1312 +_175=self.iter(_175);
  1313 +var rval=[];
  1314 +try{
  1315 +while(true){
  1316 +rval.push(_175.next());
  1317 +}
  1318 +}
  1319 +catch(e){
  1320 +if(e!=self.StopIteration){
  1321 +throw e;
  1322 +}
  1323 +return rval;
  1324 +}
  1325 +return undefined;
  1326 +},reduce:function(fn,_176,_177){
  1327 +var i=0;
  1328 +var x=_177;
  1329 +var self=MochiKit.Iter;
  1330 +_176=self.iter(_176);
  1331 +if(arguments.length<3){
  1332 +try{
  1333 +x=_176.next();
  1334 +}
  1335 +catch(e){
  1336 +if(e==self.StopIteration){
  1337 +e=new TypeError("reduce() of empty sequence with no initial value");
  1338 +}
  1339 +throw e;
  1340 +}
  1341 +i++;
  1342 +}
  1343 +try{
  1344 +while(true){
  1345 +x=fn(x,_176.next());
  1346 +}
  1347 +}
  1348 +catch(e){
  1349 +if(e!=self.StopIteration){
  1350 +throw e;
  1351 +}
  1352 +}
  1353 +return x;
  1354 +},range:function(){
  1355 +var _179=0;
  1356 +var stop=0;
  1357 +var step=1;
  1358 +if(arguments.length==1){
  1359 +stop=arguments[0];
  1360 +}else{
  1361 +if(arguments.length==2){
  1362 +_179=arguments[0];
  1363 +stop=arguments[1];
  1364 +}else{
  1365 +if(arguments.length==3){
  1366 +_179=arguments[0];
  1367 +stop=arguments[1];
  1368 +step=arguments[2];
  1369 +}else{
  1370 +throw new TypeError("range() takes 1, 2, or 3 arguments!");
  1371 +}
  1372 +}
  1373 +}
  1374 +if(step===0){
  1375 +throw new TypeError("range() step must not be 0");
  1376 +}
  1377 +return {next:function(){
  1378 +if((step>0&&_179>=stop)||(step<0&&_179<=stop)){
  1379 +throw MochiKit.Iter.StopIteration;
  1380 +}
  1381 +var rval=_179;
  1382 +_179+=step;
  1383 +return rval;
  1384 +},repr:function(){
  1385 +return "range("+[_179,stop,step].join(", ")+")";
  1386 +},toString:MochiKit.Base.forwardCall("repr")};
  1387 +},sum:function(_180,_181){
  1388 +if(typeof (_181)=="undefined"||_181===null){
  1389 +_181=0;
  1390 +}
  1391 +var x=_181;
  1392 +var self=MochiKit.Iter;
  1393 +_180=self.iter(_180);
  1394 +try{
  1395 +while(true){
  1396 +x+=_180.next();
  1397 +}
  1398 +}
  1399 +catch(e){
  1400 +if(e!=self.StopIteration){
  1401 +throw e;
  1402 +}
  1403 +}
  1404 +return x;
  1405 +},exhaust:function(_182){
  1406 +var self=MochiKit.Iter;
  1407 +_182=self.iter(_182);
  1408 +try{
  1409 +while(true){
  1410 +_182.next();
  1411 +}
  1412 +}
  1413 +catch(e){
  1414 +if(e!=self.StopIteration){
  1415 +throw e;
  1416 +}
  1417 +}
  1418 +},forEach:function(_183,func,self){
  1419 +var m=MochiKit.Base;
  1420 +if(arguments.length>2){
  1421 +func=m.bind(func,self);
  1422 +}
  1423 +if(m.isArrayLike(_183)){
  1424 +try{
  1425 +for(var i=0;i<_183.length;i++){
  1426 +func(_183[i]);
  1427 +}
  1428 +}
  1429 +catch(e){
  1430 +if(e!=MochiKit.Iter.StopIteration){
  1431 +throw e;
  1432 +}
  1433 +}
  1434 +}else{
  1435 +self=MochiKit.Iter;
  1436 +self.exhaust(self.imap(func,_183));
  1437 +}
  1438 +},every:function(_184,func){
  1439 +var self=MochiKit.Iter;
  1440 +try{
  1441 +self.ifilterfalse(func,_184).next();
  1442 +return false;
  1443 +}
  1444 +catch(e){
  1445 +if(e!=self.StopIteration){
  1446 +throw e;
  1447 +}
  1448 +return true;
  1449 +}
  1450 +},sorted:function(_185,cmp){
  1451 +var rval=MochiKit.Iter.list(_185);
  1452 +if(arguments.length==1){
  1453 +cmp=MochiKit.Base.compare;
  1454 +}
  1455 +rval.sort(cmp);
  1456 +return rval;
  1457 +},reversed:function(_186){
  1458 +var rval=MochiKit.Iter.list(_186);
  1459 +rval.reverse();
  1460 +return rval;
  1461 +},some:function(_187,func){
  1462 +var self=MochiKit.Iter;
  1463 +try{
  1464 +self.ifilter(func,_187).next();
  1465 +return true;
  1466 +}
  1467 +catch(e){
  1468 +if(e!=self.StopIteration){
  1469 +throw e;
  1470 +}
  1471 +return false;
  1472 +}
  1473 +},iextend:function(lst,_188){
  1474 +if(MochiKit.Base.isArrayLike(_188)){
  1475 +for(var i=0;i<_188.length;i++){
  1476 +lst.push(_188[i]);
  1477 +}
  1478 +}else{
  1479 +var self=MochiKit.Iter;
  1480 +_188=self.iter(_188);
  1481 +try{
  1482 +while(true){
  1483 +lst.push(_188.next());
  1484 +}
  1485 +}
  1486 +catch(e){
  1487 +if(e!=self.StopIteration){
  1488 +throw e;
  1489 +}
  1490 +}
  1491 +}
  1492 +return lst;
  1493 +},groupby:function(_189,_190){
  1494 +var m=MochiKit.Base;
  1495 +var self=MochiKit.Iter;
  1496 +if(arguments.length<2){
  1497 +_190=m.operator.identity;
  1498 +}
  1499 +_189=self.iter(_189);
  1500 +var pk=undefined;
  1501 +var k=undefined;
  1502 +var v;
  1503 +function fetch(){
  1504 +v=_189.next();
  1505 +k=_190(v);
  1506 +}
  1507 +function eat(){
  1508 +var ret=v;
  1509 +v=undefined;
  1510 +return ret;
  1511 +}
  1512 +var _193=true;
  1513 +var _194=m.compare;
  1514 +return {repr:function(){
  1515 +return "groupby(...)";
  1516 +},next:function(){
  1517 +while(_194(k,pk)===0){
  1518 +fetch();
  1519 +if(_193){
  1520 +_193=false;
  1521 +break;
  1522 +}
  1523 +}
  1524 +pk=k;
  1525 +return [k,{next:function(){
  1526 +if(v==undefined){
  1527 +fetch();
  1528 +}
  1529 +if(_194(k,pk)!==0){
  1530 +throw self.StopIteration;
  1531 +}
  1532 +return eat();
  1533 +}}];
  1534 +}};
  1535 +},groupby_as_array:function(_195,_196){
  1536 +var m=MochiKit.Base;
  1537 +var self=MochiKit.Iter;
  1538 +if(arguments.length<2){
  1539 +_196=m.operator.identity;
  1540 +}
  1541 +_195=self.iter(_195);
  1542 +var _197=[];
  1543 +var _198=true;
  1544 +var _199;
  1545 +var _200=m.compare;
  1546 +while(true){
  1547 +try{
  1548 +var _201=_195.next();
  1549 +var key=_196(_201);
  1550 +}
  1551 +catch(e){
  1552 +if(e==self.StopIteration){
  1553 +break;
  1554 +}
  1555 +throw e;
  1556 +}
  1557 +if(_198||_200(key,_199)!==0){
  1558 +var _202=[];
  1559 +_197.push([key,_202]);
  1560 +}
  1561 +_202.push(_201);
  1562 +_198=false;
  1563 +_199=key;
  1564 +}
  1565 +return _197;
  1566 +},arrayLikeIter:function(_203){
  1567 +var i=0;
  1568 +return {repr:function(){
  1569 +return "arrayLikeIter(...)";
  1570 +},toString:MochiKit.Base.forwardCall("repr"),next:function(){
  1571 +if(i>=_203.length){
  1572 +throw MochiKit.Iter.StopIteration;
  1573 +}
  1574 +return _203[i++];
  1575 +}};
  1576 +},hasIterateNext:function(_204){
  1577 +return (_204&&typeof (_204.iterateNext)=="function");
  1578 +},iterateNextIter:function(_205){
  1579 +return {repr:function(){
  1580 +return "iterateNextIter(...)";
  1581 +},toString:MochiKit.Base.forwardCall("repr"),next:function(){
  1582 +var rval=_205.iterateNext();
  1583 +if(rval===null||rval===undefined){
  1584 +throw MochiKit.Iter.StopIteration;
  1585 +}
  1586 +return rval;
  1587 +}};
  1588 +}});
  1589 +MochiKit.Iter.EXPORT_OK=["iteratorRegistry","arrayLikeIter","hasIterateNext","iterateNextIter",];
  1590 +MochiKit.Iter.EXPORT=["StopIteration","registerIteratorFactory","iter","count","cycle","repeat","next","izip","ifilter","ifilterfalse","islice","imap","applymap","chain","takewhile","dropwhile","tee","list","reduce","range","sum","exhaust","forEach","every","sorted","reversed","some","iextend","groupby","groupby_as_array"];
  1591 +MochiKit.Iter.__new__=function(){
  1592 +var m=MochiKit.Base;
  1593 +if(typeof (StopIteration)!="undefined"){
  1594 +this.StopIteration=StopIteration;
  1595 +}else{
  1596 +this.StopIteration=new m.NamedError("StopIteration");
  1597 +}
  1598 +this.iteratorRegistry=new m.AdapterRegistry();
  1599 +this.registerIteratorFactory("arrayLike",m.isArrayLike,this.arrayLikeIter);
  1600 +this.registerIteratorFactory("iterateNext",this.hasIterateNext,this.iterateNextIter);
  1601 +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
  1602 +m.nameFunctions(this);
  1603 +};
  1604 +MochiKit.Iter.__new__();
  1605 +if(MochiKit.__export__){
  1606 +reduce=MochiKit.Iter.reduce;
  1607 +}
  1608 +MochiKit.Base._exportSymbols(this,MochiKit.Iter);
  1609 +if(typeof (dojo)!="undefined"){
  1610 +dojo.provide("MochiKit.Logging");
  1611 +dojo.require("MochiKit.Base");
  1612 +}
  1613 +if(typeof (JSAN)!="undefined"){
  1614 +JSAN.use("MochiKit.Base",[]);
  1615 +}
  1616 +try{
  1617 +if(typeof (MochiKit.Base)=="undefined"){
  1618 +throw "";
  1619 +}
  1620 +}
  1621 +catch(e){
  1622 +throw "MochiKit.Logging depends on MochiKit.Base!";
  1623 +}
  1624 +if(typeof (MochiKit.Logging)=="undefined"){
  1625 +MochiKit.Logging={};
  1626 +}
  1627 +MochiKit.Logging.NAME="MochiKit.Logging";
  1628 +MochiKit.Logging.VERSION="1.4";
  1629 +MochiKit.Logging.__repr__=function(){
  1630 +return "["+this.NAME+" "+this.VERSION+"]";
  1631 +};
  1632 +MochiKit.Logging.toString=function(){
  1633 +return this.__repr__();
  1634 +};
  1635 +MochiKit.Logging.EXPORT=["LogLevel","LogMessage","Logger","alertListener","logger","log","logError","logDebug","logFatal","logWarning"];
  1636 +MochiKit.Logging.EXPORT_OK=["logLevelAtLeast","isLogMessage","compareLogMessage"];
  1637 +MochiKit.Logging.LogMessage=function(num,_207,info){
  1638 +this.num=num;
  1639 +this.level=_207;
  1640 +this.info=info;
  1641 +this.timestamp=new Date();
  1642 +};
  1643 +MochiKit.Logging.LogMessage.prototype={repr:function(){
  1644 +var m=MochiKit.Base;
  1645 +return "LogMessage("+m.map(m.repr,[this.num,this.level,this.info]).join(", ")+")";
  1646 +},toString:MochiKit.Base.forwardCall("repr")};
  1647 +MochiKit.Base.update(MochiKit.Logging,{logLevelAtLeast:function(_209){
  1648 +var self=MochiKit.Logging;
  1649 +if(typeof (_209)=="string"){
  1650 +_209=self.LogLevel[_209];
  1651 +}
  1652 +return function(msg){
  1653 +var _211=msg.level;
  1654 +if(typeof (_211)=="string"){
  1655 +_211=self.LogLevel[_211];
  1656 +}
  1657 +return _211>=_209;
  1658 +};
  1659 +},isLogMessage:function(){
  1660 +var _212=MochiKit.Logging.LogMessage;
  1661 +for(var i=0;i<arguments.length;i++){
  1662 +if(!(arguments[i] instanceof _212)){
  1663 +return false;
  1664 +}
  1665 +}
  1666 +return true;
  1667 +},compareLogMessage:function(a,b){
  1668 +return MochiKit.Base.compare([a.level,a.info],[b.level,b.info]);
  1669 +},alertListener:function(msg){
  1670 +alert("num: "+msg.num+"\nlevel: "+msg.level+"\ninfo: "+msg.info.join(" "));
  1671 +}});
  1672 +MochiKit.Logging.Logger=function(_213){
  1673 +this.counter=0;
  1674 +if(typeof (_213)=="undefined"||_213===null){
  1675 +_213=-1;
  1676 +}
  1677 +this.maxSize=_213;
  1678 +this._messages=[];
  1679 +this.listeners={};
  1680 +this.useNativeConsole=false;
  1681 +};
  1682 +MochiKit.Logging.Logger.prototype={clear:function(){
  1683 +this._messages.splice(0,this._messages.length);
  1684 +},logToConsole:function(msg){
  1685 +if(typeof (window)!="undefined"&&window.console&&window.console.log){
  1686 +window.console.log(msg.replace(/%/g,"\uff05"));
  1687 +}else{
  1688 +if(typeof (opera)!="undefined"&&opera.postError){
  1689 +opera.postError(msg);
  1690 +}else{
  1691 +if(typeof (printfire)=="function"){
  1692 +printfire(msg);
  1693 +}else{
  1694 +if(typeof (Debug)!="undefined"&&Debug.writeln){
  1695 +Debug.writeln(msg);
  1696 +}else{
  1697 +if(typeof (debug)!="undefined"&&debug.trace){
  1698 +debug.trace(msg);
  1699 +}
  1700 +}
  1701 +}
  1702 +}
  1703 +}
  1704 +},dispatchListeners:function(msg){
  1705 +for(var k in this.listeners){
  1706 +var pair=this.listeners[k];
  1707 +if(pair.ident!=k||(pair[0]&&!pair[0](msg))){
  1708 +continue;
  1709 +}
  1710 +pair[1](msg);
  1711 +}
  1712 +},addListener:function(_214,_215,_216){
  1713 +if(typeof (_215)=="string"){
  1714 +_215=MochiKit.Logging.logLevelAtLeast(_215);
  1715 +}
  1716 +var _217=[_215,_216];
  1717 +_217.ident=_214;
  1718 +this.listeners[_214]=_217;
  1719 +},removeListener:function(_218){
  1720 +delete this.listeners[_218];
  1721 +},baseLog:function(_219,_220){
  1722 +var msg=new MochiKit.Logging.LogMessage(this.counter,_219,MochiKit.Base.extend(null,arguments,1));
  1723 +this._messages.push(msg);
  1724 +this.dispatchListeners(msg);
  1725 +if(this.useNativeConsole){
  1726 +this.logToConsole(msg.level+": "+msg.info.join(" "));
  1727 +}
  1728 +this.counter+=1;
  1729 +while(this.maxSize>=0&&this._messages.length>this.maxSize){
  1730 +this._messages.shift();
  1731 +}
  1732 +},getMessages:function(_221){
  1733 +var _222=0;
  1734 +if(!(typeof (_221)=="undefined"||_221===null)){
  1735 +_222=Math.max(0,this._messages.length-_221);
  1736 +}
  1737 +return this._messages.slice(_222);
  1738 +},getMessageText:function(_223){
  1739 +if(typeof (_223)=="undefined"||_223===null){
  1740 +_223=30;
  1741 +}
  1742 +var _224=this.getMessages(_223);
  1743 +if(_224.length){
  1744 +var lst=map(function(m){
  1745 +return "\n ["+m.num+"] "+m.level+": "+m.info.join(" ");
  1746 +},_224);
  1747 +lst.unshift("LAST "+_224.length+" MESSAGES:");
  1748 +return lst.join("");
  1749 +}
  1750 +return "";
  1751 +},debuggingBookmarklet:function(_225){
  1752 +if(typeof (MochiKit.LoggingPane)=="undefined"){
  1753 +alert(this.getMessageText());
  1754 +}else{
  1755 +MochiKit.LoggingPane.createLoggingPane(_225||false);
  1756 +}
  1757 +}};
  1758 +MochiKit.Logging.__new__=function(){
  1759 +this.LogLevel={ERROR:40,FATAL:50,WARNING:30,INFO:20,DEBUG:10};
  1760 +var m=MochiKit.Base;
  1761 +m.registerComparator("LogMessage",this.isLogMessage,this.compareLogMessage);
  1762 +var _226=m.partial;
  1763 +var _227=this.Logger;
  1764 +var _228=_227.prototype.baseLog;
  1765 +m.update(this.Logger.prototype,{debug:_226(_228,"DEBUG"),log:_226(_228,"INFO"),error:_226(_228,"ERROR"),fatal:_226(_228,"FATAL"),warning:_226(_228,"WARNING")});
  1766 +var self=this;
  1767 +var _229=function(name){
  1768 +return function(){
  1769 +self.logger[name].apply(self.logger,arguments);
  1770 +};
  1771 +};
  1772 +this.log=_229("log");
  1773 +this.logError=_229("error");
  1774 +this.logDebug=_229("debug");
  1775 +this.logFatal=_229("fatal");
  1776 +this.logWarning=_229("warning");
  1777 +this.logger=new _227();
  1778 +this.logger.useNativeConsole=true;
  1779 +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
  1780 +m.nameFunctions(this);
  1781 +};
  1782 +if(typeof (printfire)=="undefined"&&typeof (document)!="undefined"&&document.createEvent&&typeof (dispatchEvent)!="undefined"){
  1783 +printfire=function(){
  1784 +printfire.args=arguments;
  1785 +var ev=document.createEvent("Events");
  1786 +ev.initEvent("printfire",false,true);
  1787 +dispatchEvent(ev);
  1788 +};
  1789 +}
  1790 +MochiKit.Logging.__new__();
  1791 +MochiKit.Base._exportSymbols(this,MochiKit.Logging);
  1792 +if(typeof (dojo)!="undefined"){
  1793 +dojo.provide("MochiKit.DateTime");
  1794 +}
  1795 +if(typeof (MochiKit)=="undefined"){
  1796 +MochiKit={};
  1797 +}
  1798 +if(typeof (MochiKit.DateTime)=="undefined"){
  1799 +MochiKit.DateTime={};
  1800 +}
  1801 +MochiKit.DateTime.NAME="MochiKit.DateTime";
  1802 +MochiKit.DateTime.VERSION="1.4";
  1803 +MochiKit.DateTime.__repr__=function(){
  1804 +return "["+this.NAME+" "+this.VERSION+"]";
  1805 +};
  1806 +MochiKit.DateTime.toString=function(){
  1807 +return this.__repr__();
  1808 +};
  1809 +MochiKit.DateTime.isoDate=function(str){
  1810 +str=str+"";
  1811 +if(typeof (str)!="string"||str.length===0){
  1812 +return null;
  1813 +}
  1814 +var iso=str.split("-");
  1815 +if(iso.length===0){
  1816 +return null;
  1817 +}
  1818 +return new Date(iso[0],iso[1]-1,iso[2]);
  1819 +};
  1820 +MochiKit.DateTime._isoRegexp=/(\d{4,})(?:-(\d{1,2})(?:-(\d{1,2})(?:[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d+))?)?(?:(Z)|([+-])(\d{1,2})(?::(\d{1,2}))?)?)?)?)?/;
  1821 +MochiKit.DateTime.isoTimestamp=function(str){
  1822 +str=str+"";
  1823 +if(typeof (str)!="string"||str.length===0){
  1824 +return null;
  1825 +}
  1826 +var res=str.match(MochiKit.DateTime._isoRegexp);
  1827 +if(typeof (res)=="undefined"||res===null){
  1828 +return null;
  1829 +}
  1830 +var year,month,day,hour,min,sec,msec;
  1831 +year=parseInt(res[1],10);
  1832 +if(typeof (res[2])=="undefined"||res[2]===""){
  1833 +return new Date(year);
  1834 +}
  1835 +month=parseInt(res[2],10)-1;
  1836 +day=parseInt(res[3],10);
  1837 +if(typeof (res[4])=="undefined"||res[4]===""){
  1838 +return new Date(year,month,day);
  1839 +}
  1840 +hour=parseInt(res[4],10);
  1841 +min=parseInt(res[5],10);
  1842 +sec=(typeof (res[6])!="undefined"&&res[6]!=="")?parseInt(res[6],10):0;
  1843 +if(typeof (res[7])!="undefined"&&res[7]!==""){
  1844 +msec=Math.round(1000*parseFloat("0."+res[7]));
  1845 +}else{
  1846 +msec=0;
  1847 +}
  1848 +if((typeof (res[8])=="undefined"||res[8]==="")&&(typeof (res[9])=="undefined"||res[9]==="")){
  1849 +return new Date(year,month,day,hour,min,sec,msec);
  1850 +}
  1851 +var ofs;
  1852 +if(typeof (res[9])!="undefined"&&res[9]!==""){
  1853 +ofs=parseInt(res[10],10)*3600000;
  1854 +if(typeof (res[11])!="undefined"&&res[11]!==""){
  1855 +ofs+=parseInt(res[11],10)*60000;
  1856 +}
  1857 +if(res[9]=="-"){
  1858 +ofs=-ofs;
  1859 +}
  1860 +}else{
  1861 +ofs=0;
  1862 +}
  1863 +return new Date(Date.UTC(year,month,day,hour,min,sec,msec)-ofs);
  1864 +};
  1865 +MochiKit.DateTime.toISOTime=function(date,_236){
  1866 +if(typeof (date)=="undefined"||date===null){
  1867 +return null;
  1868 +}
  1869 +var hh=date.getHours();
  1870 +var mm=date.getMinutes();
  1871 +var ss=date.getSeconds();
  1872 +var lst=[((_236&&(hh<10))?"0"+hh:hh),((mm<10)?"0"+mm:mm),((ss<10)?"0"+ss:ss)];
  1873 +return lst.join(":");
  1874 +};
  1875 +MochiKit.DateTime.toISOTimestamp=function(date,_240){
  1876 +if(typeof (date)=="undefined"||date===null){
  1877 +return null;
  1878 +}
  1879 +var sep=_240?"T":" ";
  1880 +var foot=_240?"Z":"";
  1881 +if(_240){
  1882 +date=new Date(date.getTime()+(date.getTimezoneOffset()*60000));
  1883 +}
  1884 +return MochiKit.DateTime.toISODate(date)+sep+MochiKit.DateTime.toISOTime(date,_240)+foot;
  1885 +};
  1886 +MochiKit.DateTime.toISODate=function(date){
  1887 +if(typeof (date)=="undefined"||date===null){
  1888 +return null;
  1889 +}
  1890 +var _243=MochiKit.DateTime._padTwo;
  1891 +return [date.getFullYear(),_243(date.getMonth()+1),_243(date.getDate())].join("-");
  1892 +};
  1893 +MochiKit.DateTime.americanDate=function(d){
  1894 +d=d+"";
  1895 +if(typeof (d)!="string"||d.length===0){
  1896 +return null;
  1897 +}
  1898 +var a=d.split("/");
  1899 +return new Date(a[2],a[0]-1,a[1]);
  1900 +};
  1901 +MochiKit.DateTime._padTwo=function(n){
  1902 +return (n>9)?n:"0"+n;
  1903 +};
  1904 +MochiKit.DateTime.toPaddedAmericanDate=function(d){
  1905 +if(typeof (d)=="undefined"||d===null){
  1906 +return null;
  1907 +}
  1908 +var _245=MochiKit.DateTime._padTwo;
  1909 +return [_245(d.getMonth()+1),_245(d.getDate()),d.getFullYear()].join("/");
  1910 +};
  1911 +MochiKit.DateTime.toAmericanDate=function(d){
  1912 +if(typeof (d)=="undefined"||d===null){
  1913 +return null;
  1914 +}
  1915 +return [d.getMonth()+1,d.getDate(),d.getFullYear()].join("/");
  1916 +};
  1917 +MochiKit.DateTime.EXPORT=["isoDate","isoTimestamp","toISOTime","toISOTimestamp","toISODate","americanDate","toPaddedAmericanDate","toAmericanDate"];
  1918 +MochiKit.DateTime.EXPORT_OK=[];
  1919 +MochiKit.DateTime.EXPORT_TAGS={":common":MochiKit.DateTime.EXPORT,":all":MochiKit.DateTime.EXPORT};
  1920 +MochiKit.DateTime.__new__=function(){
  1921 +var base=this.NAME+".";
  1922 +for(var k in this){
  1923 +var o=this[k];
  1924 +if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
  1925 +try{
  1926 +o.NAME=base+k;
  1927 +}
  1928 +catch(e){
  1929 +}
  1930 +}
  1931 +}
  1932 +};
  1933 +MochiKit.DateTime.__new__();
  1934 +if(typeof (MochiKit.Base)!="undefined"){
  1935 +MochiKit.Base._exportSymbols(this,MochiKit.DateTime);
  1936 +}else{
  1937 +(function(_246,_247){
  1938 +if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
  1939 +var all=_247.EXPORT_TAGS[":all"];
  1940 +for(var i=0;i<all.length;i++){
  1941 +_246[all[i]]=_247[all[i]];
  1942 +}
  1943 +}
  1944 +})(this,MochiKit.DateTime);
  1945 +}
  1946 +if(typeof (dojo)!="undefined"){
  1947 +dojo.provide("MochiKit.Format");
  1948 +}
  1949 +if(typeof (MochiKit)=="undefined"){
  1950 +MochiKit={};
  1951 +}
  1952 +if(typeof (MochiKit.Format)=="undefined"){
  1953 +MochiKit.Format={};
  1954 +}
  1955 +MochiKit.Format.NAME="MochiKit.Format";
  1956 +MochiKit.Format.VERSION="1.4";
  1957 +MochiKit.Format.__repr__=function(){
  1958 +return "["+this.NAME+" "+this.VERSION+"]";
  1959 +};
  1960 +MochiKit.Format.toString=function(){
  1961 +return this.__repr__();
  1962 +};
  1963 +MochiKit.Format._numberFormatter=function(_248,_249,_250,_251,_252,_253,_254,_255,_256){
  1964 +return function(num){
  1965 +num=parseFloat(num);
  1966 +if(typeof (num)=="undefined"||num===null||isNaN(num)){
  1967 +return _248;
  1968 +}
  1969 +var _257=_249;
  1970 +var _258=_250;
  1971 +if(num<0){
  1972 +num=-num;
  1973 +}else{
  1974 +_257=_257.replace(/-/,"");
  1975 +}
  1976 +var me=arguments.callee;
  1977 +var fmt=MochiKit.Format.formatLocale(_251);
  1978 +if(_252){
  1979 +num=num*100;
  1980 +_258=fmt.percent+_258;
  1981 +}
  1982 +num=MochiKit.Format.roundToFixed(num,_253);
  1983 +var _260=num.split(/\./);
  1984 +var _261=_260[0];
  1985 +var frac=(_260.length==1)?"":_260[1];
  1986 +var res="";
  1987 +while(_261.length<_254){
  1988 +_261="0"+_261;
  1989 +}
  1990 +if(_255){
  1991 +while(_261.length>_255){
  1992 +var i=_261.length-_255;
  1993 +res=fmt.separator+_261.substring(i,_261.length)+res;
  1994 +_261=_261.substring(0,i);
  1995 +}
  1996 +}
  1997 +res=_261+res;
  1998 +if(_253>0){
  1999 +while(frac.length<_256){
  2000 +frac=frac+"0";
  2001 +}
  2002 +res=res+fmt.decimal+frac;
  2003 +}
  2004 +return _257+res+_258;
  2005 +};
  2006 +};
  2007 +MochiKit.Format.numberFormatter=function(_263,_264,_265){
  2008 +if(typeof (_264)=="undefined"){
  2009 +_264="";
  2010 +}
  2011 +var _266=_263.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);
  2012 +if(!_266){
  2013 +throw TypeError("Invalid pattern");
  2014 +}
  2015 +var _267=_263.substr(0,_266.index);
  2016 +var _268=_263.substr(_266.index+_266[0].length);
  2017 +if(_267.search(/-/)==-1){
  2018 +_267=_267+"-";
  2019 +}
  2020 +var _269=_266[1];
  2021 +var frac=(typeof (_266[2])=="string"&&_266[2]!="")?_266[2]:"";
  2022 +var _270=(typeof (_266[3])=="string"&&_266[3]!="");
  2023 +var tmp=_269.split(/,/);
  2024 +var _272;
  2025 +if(typeof (_265)=="undefined"){
  2026 +_265="default";
  2027 +}
  2028 +if(tmp.length==1){
  2029 +_272=null;
  2030 +}else{
  2031 +_272=tmp[1].length;
  2032 +}
  2033 +var _273=_269.length-_269.replace(/0/g,"").length;
  2034 +var _274=frac.length-frac.replace(/0/g,"").length;
  2035 +var _275=frac.length;
  2036 +var rval=MochiKit.Format._numberFormatter(_264,_267,_268,_265,_270,_275,_273,_272,_274);
  2037 +var m=MochiKit.Base;
  2038 +if(m){
  2039 +var fn=arguments.callee;
  2040 +var args=m.concat(arguments);
  2041 +rval.repr=function(){
  2042 +return [self.NAME,"(",map(m.repr,args).join(", "),")"].join("");
  2043 +};
  2044 +}
  2045 +return rval;
  2046 +};
  2047 +MochiKit.Format.formatLocale=function(_276){
  2048 +if(typeof (_276)=="undefined"||_276===null){
  2049 +_276="default";
  2050 +}
  2051 +if(typeof (_276)=="string"){
  2052 +var rval=MochiKit.Format.LOCALE[_276];
  2053 +if(typeof (rval)=="string"){
  2054 +rval=arguments.callee(rval);
  2055 +MochiKit.Format.LOCALE[_276]=rval;
  2056 +}
  2057 +return rval;
  2058 +}else{
  2059 +return _276;
  2060 +}
  2061 +};
  2062 +MochiKit.Format.twoDigitAverage=function(_277,_278){
  2063 +if(_278){
  2064 +var res=_277/_278;
  2065 +if(!isNaN(res)){
  2066 +return MochiKit.Format.twoDigitFloat(_277/_278);
  2067 +}
  2068 +}
  2069 +return "0";
  2070 +};
  2071 +MochiKit.Format.twoDigitFloat=function(_279){
  2072 +var sign=(_279<0?"-":"");
  2073 +var s=Math.floor(Math.abs(_279)*100).toString();
  2074 +if(s=="0"){
  2075 +return s;
  2076 +}
  2077 +if(s.length<3){
  2078 +while(s.charAt(s.length-1)=="0"){
  2079 +s=s.substring(0,s.length-1);
  2080 +}
  2081 +return sign+"0."+s;
  2082 +}
  2083 +var head=sign+s.substring(0,s.length-2);
  2084 +var tail=s.substring(s.length-2,s.length);
  2085 +if(tail=="00"){
  2086 +return head;
  2087 +}else{
  2088 +if(tail.charAt(1)=="0"){
  2089 +return head+"."+tail.charAt(0);
  2090 +}else{
  2091 +return head+"."+tail;
  2092 +}
  2093 +}
  2094 +};
  2095 +MochiKit.Format.lstrip=function(str,_284){
  2096 +str=str+"";
  2097 +if(typeof (str)!="string"){
  2098 +return null;
  2099 +}
  2100 +if(!_284){
  2101 +return str.replace(/^\s+/,"");
  2102 +}else{
  2103 +return str.replace(new RegExp("^["+_284+"]+"),"");
  2104 +}
  2105 +};
  2106 +MochiKit.Format.rstrip=function(str,_285){
  2107 +str=str+"";
  2108 +if(typeof (str)!="string"){
  2109 +return null;
  2110 +}
  2111 +if(!_285){
  2112 +return str.replace(/\s+$/,"");
  2113 +}else{
  2114 +return str.replace(new RegExp("["+_285+"]+$"),"");
  2115 +}
  2116 +};
  2117 +MochiKit.Format.strip=function(str,_286){
  2118 +var self=MochiKit.Format;
  2119 +return self.rstrip(self.lstrip(str,_286),_286);
  2120 +};
  2121 +MochiKit.Format.truncToFixed=function(_287,_288){
  2122 +_287=Math.floor(_287*Math.pow(10,_288));
  2123 +var res=(_287*Math.pow(10,-_288)).toFixed(_288);
  2124 +if(res.charAt(0)=="."){
  2125 +res="0"+res;
  2126 +}
  2127 +return res;
  2128 +};
  2129 +MochiKit.Format.roundToFixed=function(_289,_290){
  2130 +return MochiKit.Format.truncToFixed(_289+0.5*Math.pow(10,-_290),_290);
  2131 +};
  2132 +MochiKit.Format.percentFormat=function(_291){
  2133 +return MochiKit.Format.twoDigitFloat(100*_291)+"%";
  2134 +};
  2135 +MochiKit.Format.EXPORT=["truncToFixed","roundToFixed","numberFormatter","formatLocale","twoDigitAverage","twoDigitFloat","percentFormat","lstrip","rstrip","strip"];
  2136 +MochiKit.Format.LOCALE={en_US:{separator:",",decimal:".",percent:"%"},de_DE:{separator:".",decimal:",",percent:"%"},fr_FR:{separator:" ",decimal:",",percent:"%"},"default":"en_US"};
  2137 +MochiKit.Format.EXPORT_OK=[];
  2138 +MochiKit.Format.EXPORT_TAGS={":all":MochiKit.Format.EXPORT,":common":MochiKit.Format.EXPORT};
  2139 +MochiKit.Format.__new__=function(){
  2140 +var base=this.NAME+".";
  2141 +var k,v,o;
  2142 +for(k in this.LOCALE){
  2143 +o=this.LOCALE[k];
  2144 +if(typeof (o)=="object"){
  2145 +o.repr=function(){
  2146 +return this.NAME;
  2147 +};
  2148 +o.NAME=base+"LOCALE."+k;
  2149 +}
  2150 +}
  2151 +for(k in this){
  2152 +o=this[k];
  2153 +if(typeof (o)=="function"&&typeof (o.NAME)=="undefined"){
  2154 +try{
  2155 +o.NAME=base+k;
  2156 +}
  2157 +catch(e){
  2158 +}
  2159 +}
  2160 +}
  2161 +};
  2162 +MochiKit.Format.__new__();
  2163 +if(typeof (MochiKit.Base)!="undefined"){
  2164 +MochiKit.Base._exportSymbols(this,MochiKit.Format);
  2165 +}else{
  2166 +(function(_292,_293){
  2167 +if((typeof (JSAN)=="undefined"&&typeof (dojo)=="undefined")||(MochiKit.__export__===false)){
  2168 +var all=_293.EXPORT_TAGS[":all"];
  2169 +for(var i=0;i<all.length;i++){
  2170 +_292[all[i]]=_293[all[i]];
  2171 +}
  2172 +}
  2173 +})(this,MochiKit.Format);
  2174 +}
  2175 +if(typeof (dojo)!="undefined"){
  2176 +dojo.provide("MochiKit.Async");
  2177 +dojo.require("MochiKit.Base");
  2178 +}
  2179 +if(typeof (JSAN)!="undefined"){
  2180 +JSAN.use("MochiKit.Base",[]);
  2181 +}
  2182 +try{
  2183 +if(typeof (MochiKit.Base)=="undefined"){
  2184 +throw "";
  2185 +}
  2186 +}
  2187 +catch(e){
  2188 +throw "MochiKit.Async depends on MochiKit.Base!";
  2189 +}
  2190 +if(typeof (MochiKit.Async)=="undefined"){
  2191 +MochiKit.Async={};
  2192 +}
  2193 +MochiKit.Async.NAME="MochiKit.Async";
  2194 +MochiKit.Async.VERSION="1.4";
  2195 +MochiKit.Async.__repr__=function(){
  2196 +return "["+this.NAME+" "+this.VERSION+"]";
  2197 +};
  2198 +MochiKit.Async.toString=function(){
  2199 +return this.__repr__();
  2200 +};
  2201 +MochiKit.Async.Deferred=function(_294){
  2202 +this.chain=[];
  2203 +this.id=this._nextId();
  2204 +this.fired=-1;
  2205 +this.paused=0;
  2206 +this.results=[null,null];
  2207 +this.canceller=_294;
  2208 +this.silentlyCancelled=false;
  2209 +this.chained=false;
  2210 +};
  2211 +MochiKit.Async.Deferred.prototype={repr:function(){
  2212 +var _295;
  2213 +if(this.fired==-1){
  2214 +_295="unfired";
  2215 +}else{
  2216 +if(this.fired===0){
  2217 +_295="success";
  2218 +}else{
  2219 +_295="error";
  2220 +}
  2221 +}
  2222 +return "Deferred("+this.id+", "+_295+")";
  2223 +},toString:MochiKit.Base.forwardCall("repr"),_nextId:MochiKit.Base.counter(),cancel:function(){
  2224 +var self=MochiKit.Async;
  2225 +if(this.fired==-1){
  2226 +if(this.canceller){
  2227 +this.canceller(this);
  2228 +}else{
  2229 +this.silentlyCancelled=true;
  2230 +}
  2231 +if(this.fired==-1){
  2232 +this.errback(new self.CancelledError(this));
  2233 +}
  2234 +}else{
  2235 +if((this.fired===0)&&(this.results[0] instanceof self.Deferred)){
  2236 +this.results[0].cancel();
  2237 +}
  2238 +}
  2239 +},_resback:function(res){
  2240 +this.fired=((res instanceof Error)?1:0);
  2241 +this.results[this.fired]=res;
  2242 +this._fire();
  2243 +},_check:function(){
  2244 +if(this.fired!=-1){
  2245 +if(!this.silentlyCancelled){
  2246 +throw new MochiKit.Async.AlreadyCalledError(this);
  2247 +}
  2248 +this.silentlyCancelled=false;
  2249 +return;
  2250 +}
  2251 +},callback:function(res){
  2252 +this._check();
  2253 +if(res instanceof MochiKit.Async.Deferred){
  2254 +throw new Error("Deferred instances can only be chained if they are the result of a callback");
  2255 +}
  2256 +this._resback(res);
  2257 +},errback:function(res){
  2258 +this._check();
  2259 +var self=MochiKit.Async;
  2260 +if(res instanceof self.Deferred){
  2261 +throw new Error("Deferred instances can only be chained if they are the result of a callback");
  2262 +}
  2263 +if(!(res instanceof Error)){
  2264 +res=new self.GenericError(res);
  2265 +}
  2266 +this._resback(res);
  2267 +},addBoth:function(fn){
  2268 +if(arguments.length>1){
  2269 +fn=MochiKit.Base.partial.apply(null,arguments);
  2270 +}
  2271 +return this.addCallbacks(fn,fn);
  2272 +},addCallback:function(fn){
  2273 +if(arguments.length>1){
  2274 +fn=MochiKit.Base.partial.apply(null,arguments);
  2275 +}
  2276 +return this.addCallbacks(fn,null);
  2277 +},addErrback:function(fn){
  2278 +if(arguments.length>1){
  2279 +fn=MochiKit.Base.partial.apply(null,arguments);
  2280 +}
  2281 +return this.addCallbacks(null,fn);
  2282 +},addCallbacks:function(cb,eb){
  2283 +if(this.chained){
  2284 +throw new Error("Chained Deferreds can not be re-used");
  2285 +}
  2286 +this.chain.push([cb,eb]);
  2287 +if(this.fired>=0){
  2288 +this._fire();
  2289 +}
  2290 +return this;
  2291 +},_fire:function(){
  2292 +var _298=this.chain;
  2293 +var _299=this.fired;
  2294 +var res=this.results[_299];
  2295 +var self=this;
  2296 +var cb=null;
  2297 +while(_298.length>0&&this.paused===0){
  2298 +var pair=_298.shift();
  2299 +var f=pair[_299];
  2300 +if(f===null){
  2301 +continue;
  2302 +}
  2303 +try{
  2304 +res=f(res);
  2305 +_299=((res instanceof Error)?1:0);
  2306 +if(res instanceof MochiKit.Async.Deferred){
  2307 +cb=function(res){
  2308 +self._resback(res);
  2309 +self.paused--;
  2310 +if((self.paused===0)&&(self.fired>=0)){
  2311 +self._fire();
  2312 +}
  2313 +};
  2314 +this.paused++;
  2315 +}
  2316 +}
  2317 +catch(err){
  2318 +_299=1;
  2319 +if(!(err instanceof Error)){
  2320 +err=new MochiKit.Async.GenericError(err);
  2321 +}
  2322 +res=err;
  2323 +}
  2324 +}
  2325 +this.fired=_299;
  2326 +this.results[_299]=res;
  2327 +if(cb&&this.paused){
  2328 +res.addBoth(cb);
  2329 +res.chained=true;
  2330 +}
  2331 +}};
  2332 +MochiKit.Base.update(MochiKit.Async,{evalJSONRequest:function(){
  2333 +return eval("("+arguments[0].responseText+")");
  2334 +},succeed:function(_301){
  2335 +var d=new MochiKit.Async.Deferred();
  2336 +d.callback.apply(d,arguments);
  2337 +return d;
  2338 +},fail:function(_302){
  2339 +var d=new MochiKit.Async.Deferred();
  2340 +d.errback.apply(d,arguments);
  2341 +return d;
  2342 +},getXMLHttpRequest:function(){
  2343 +var self=arguments.callee;
  2344 +if(!self.XMLHttpRequest){
  2345 +var _303=[function(){
  2346 +return new XMLHttpRequest();
  2347 +},function(){
  2348 +return new ActiveXObject("Msxml2.XMLHTTP");
  2349 +},function(){
  2350 +return new ActiveXObject("Microsoft.XMLHTTP");
  2351 +},function(){
  2352 +return new ActiveXObject("Msxml2.XMLHTTP.4.0");
  2353 +},function(){
  2354 +throw new MochiKit.Async.BrowserComplianceError("Browser does not support XMLHttpRequest");
  2355 +}];
  2356 +for(var i=0;i<_303.length;i++){
  2357 +var func=_303[i];
  2358 +try{
  2359 +self.XMLHttpRequest=func;
  2360 +return func();
  2361 +}
  2362 +catch(e){
  2363 +}
  2364 +}
  2365 +}
  2366 +return self.XMLHttpRequest();
  2367 +},_xhr_onreadystatechange:function(d){
  2368 +var m=MochiKit.Base;
  2369 +if(this.readyState==4){
  2370 +try{
  2371 +this.onreadystatechange=null;
  2372 +}
  2373 +catch(e){
  2374 +try{
  2375 +this.onreadystatechange=m.noop;
  2376 +}
  2377 +catch(e){
  2378 +}
  2379 +}
  2380 +var _304=null;
  2381 +try{
  2382 +_304=this.status;
  2383 +if(!_304&&m.isNotEmpty(this.responseText)){
  2384 +_304=304;
  2385 +}
  2386 +}
  2387 +catch(e){
  2388 +}
  2389 +if(_304==200||_304==304){
  2390 +d.callback(this);
  2391 +}else{
  2392 +var err=new MochiKit.Async.XMLHttpRequestError(this,"Request failed");
  2393 +if(err.number){
  2394 +d.errback(err);
  2395 +}else{
  2396 +d.errback(err);
  2397 +}
  2398 +}
  2399 +}
  2400 +},_xhr_canceller:function(req){
  2401 +try{
  2402 +req.onreadystatechange=null;
  2403 +}
  2404 +catch(e){
  2405 +try{
  2406 +req.onreadystatechange=MochiKit.Base.noop;
  2407 +}
  2408 +catch(e){
  2409 +}
  2410 +}
  2411 +req.abort();
  2412 +},sendXMLHttpRequest:function(req,_307){
  2413 +if(typeof (_307)=="undefined"||_307===null){
  2414 +_307="";
  2415 +}
  2416 +var m=MochiKit.Base;
  2417 +var self=MochiKit.Async;
  2418 +var d=new self.Deferred(m.partial(self._xhr_canceller,req));
  2419 +try{
  2420 +req.onreadystatechange=m.bind(self._xhr_onreadystatechange,req,d);
  2421 +req.send(_307);
  2422 +}
  2423 +catch(e){
  2424 +try{
  2425 +req.onreadystatechange=null;
  2426 +}
  2427 +catch(ignore){
  2428 +}
  2429 +d.errback(e);
  2430 +}
  2431 +return d;
  2432 +},doSimpleXMLHttpRequest:function(url){
  2433 +var self=MochiKit.Async;
  2434 +var req=self.getXMLHttpRequest();
  2435 +if(arguments.length>1){
  2436 +var m=MochiKit.Base;
  2437 +var qs=m.queryString.apply(null,m.extend(null,arguments,1));
  2438 +if(qs){
  2439 +url+="?"+qs;
  2440 +}
  2441 +}
  2442 +req.open("GET",url,true);
  2443 +return self.sendXMLHttpRequest(req);
  2444 +},loadJSONDoc:function(url){
  2445 +var self=MochiKit.Async;
  2446 +var d=self.doSimpleXMLHttpRequest.apply(self,arguments);
  2447 +d=d.addCallback(self.evalJSONRequest);
  2448 +return d;
  2449 +},wait:function(_310,_311){
  2450 +var d=new MochiKit.Async.Deferred();
  2451 +var m=MochiKit.Base;
  2452 +if(typeof (_311)!="undefined"){
  2453 +d.addCallback(function(){
  2454 +return _311;
  2455 +});
  2456 +}
  2457 +var _312=setTimeout(m.bind("callback",d),Math.floor(_310*1000));
  2458 +d.canceller=function(){
  2459 +try{
  2460 +clearTimeout(_312);
  2461 +}
  2462 +catch(e){
  2463 +}
  2464 +};
  2465 +return d;
  2466 +},callLater:function(_313,func){
  2467 +var m=MochiKit.Base;
  2468 +var _314=m.partial.apply(m,m.extend(null,arguments,1));
  2469 +return MochiKit.Async.wait(_313).addCallback(function(res){
  2470 +return _314();
  2471 +});
  2472 +}});
  2473 +MochiKit.Async.DeferredLock=function(){
  2474 +this.waiting=[];
  2475 +this.locked=false;
  2476 +this.id=this._nextId();
  2477 +};
  2478 +MochiKit.Async.DeferredLock.prototype={__class__:MochiKit.Async.DeferredLock,acquire:function(){
  2479 +var d=new MochiKit.Async.Deferred();
  2480 +if(this.locked){
  2481 +this.waiting.push(d);
  2482 +}else{
  2483 +this.locked=true;
  2484 +d.callback(this);
  2485 +}
  2486 +return d;
  2487 +},release:function(){
  2488 +if(!this.locked){
  2489 +throw TypeError("Tried to release an unlocked DeferredLock");
  2490 +}
  2491 +this.locked=false;
  2492 +if(this.waiting.length>0){
  2493 +this.locked=true;
  2494 +this.waiting.shift().callback(this);
  2495 +}
  2496 +},_nextId:MochiKit.Base.counter(),repr:function(){
  2497 +var _315;
  2498 +if(this.locked){
  2499 +_315="locked, "+this.waiting.length+" waiting";
  2500 +}else{
  2501 +_315="unlocked";
  2502 +}
  2503 +return "DeferredLock("+this.id+", "+_315+")";
  2504 +},toString:MochiKit.Base.forwardCall("repr")};
  2505 +MochiKit.Async.DeferredList=function(list,_317,_318,_319,_320){
  2506 +MochiKit.Async.Deferred.apply(this,[_320]);
  2507 +this.list=list;
  2508 +var _321=[];
  2509 +this.resultList=_321;
  2510 +this.finishedCount=0;
  2511 +this.fireOnOneCallback=_317;
  2512 +this.fireOnOneErrback=_318;
  2513 +this.consumeErrors=_319;
  2514 +var cb=MochiKit.Base.bind(this._cbDeferred,this);
  2515 +for(var i=0;i<list.length;i++){
  2516 +var d=list[i];
  2517 +_321.push(undefined);
  2518 +d.addCallback(cb,i,true);
  2519 +d.addErrback(cb,i,false);
  2520 +}
  2521 +if(list.length===0&&!_317){
  2522 +this.callback(this.resultList);
  2523 +}
  2524 +};
  2525 +MochiKit.Async.DeferredList.prototype=new MochiKit.Async.Deferred();
  2526 +MochiKit.Async.DeferredList.prototype._cbDeferred=function(_322,_323,_324){
  2527 +this.resultList[_322]=[_323,_324];
  2528 +this.finishedCount+=1;
  2529 +if(this.fired==-1){
  2530 +if(_323&&this.fireOnOneCallback){
  2531 +this.callback([_322,_324]);
  2532 +}else{
  2533 +if(!_323&&this.fireOnOneErrback){
  2534 +this.errback(_324);
  2535 +}else{
  2536 +if(this.finishedCount==this.list.length){
  2537 +this.callback(this.resultList);
  2538 +}
  2539 +}
  2540 +}
  2541 +}
  2542 +if(!_323&&this.consumeErrors){
  2543 +_324=null;
  2544 +}
  2545 +return _324;
  2546 +};
  2547 +MochiKit.Async.gatherResults=function(_325){
  2548 +var d=new MochiKit.Async.DeferredList(_325,false,true,false);
  2549 +d.addCallback(function(_326){
  2550 +var ret=[];
  2551 +for(var i=0;i<_326.length;i++){
  2552 +ret.push(_326[i][1]);
  2553 +}
  2554 +return ret;
  2555 +});
  2556 +return d;
  2557 +};
  2558 +MochiKit.Async.maybeDeferred=function(func){
  2559 +var self=MochiKit.Async;
  2560 +var _327;
  2561 +try{
  2562 +var r=func.apply(null,MochiKit.Base.extend([],arguments,1));
  2563 +if(r instanceof self.Deferred){
  2564 +_327=r;
  2565 +}else{
  2566 +if(r instanceof Error){
  2567 +_327=self.fail(r);
  2568 +}else{
  2569 +_327=self.succeed(r);
  2570 +}
  2571 +}
  2572 +}
  2573 +catch(e){
  2574 +_327=self.fail(e);
  2575 +}
  2576 +return _327;
  2577 +};
  2578 +MochiKit.Async.EXPORT=["AlreadyCalledError","CancelledError","BrowserComplianceError","GenericError","XMLHttpRequestError","Deferred","succeed","fail","getXMLHttpRequest","doSimpleXMLHttpRequest","loadJSONDoc","wait","callLater","sendXMLHttpRequest","DeferredLock","DeferredList","gatherResults","maybeDeferred"];
  2579 +MochiKit.Async.EXPORT_OK=["evalJSONRequest"];
  2580 +MochiKit.Async.__new__=function(){
  2581 +var m=MochiKit.Base;
  2582 +var ne=m.partial(m._newNamedError,this);
  2583 +ne("AlreadyCalledError",function(_330){
  2584 +this.deferred=_330;
  2585 +});
  2586 +ne("CancelledError",function(_331){
  2587 +this.deferred=_331;
  2588 +});
  2589 +ne("BrowserComplianceError",function(msg){
  2590 +this.message=msg;
  2591 +});
  2592 +ne("GenericError",function(msg){
  2593 +this.message=msg;
  2594 +});
  2595 +ne("XMLHttpRequestError",function(req,msg){
  2596 +this.req=req;
  2597 +this.message=msg;
  2598 +try{
  2599 +this.number=req.status;
  2600 +}
  2601 +catch(e){
  2602 +}
  2603 +});
  2604 +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
  2605 +m.nameFunctions(this);
  2606 +};
  2607 +MochiKit.Async.__new__();
  2608 +MochiKit.Base._exportSymbols(this,MochiKit.Async);
  2609 +if(typeof (dojo)!="undefined"){
  2610 +dojo.provide("MochiKit.DOM");
  2611 +dojo.require("MochiKit.Base");
  2612 +}
  2613 +if(typeof (JSAN)!="undefined"){
  2614 +JSAN.use("MochiKit.Base",[]);
  2615 +}
  2616 +try{
  2617 +if(typeof (MochiKit.Base)=="undefined"){
  2618 +throw "";
  2619 +}
  2620 +}
  2621 +catch(e){
  2622 +throw "MochiKit.DOM depends on MochiKit.Base!";
  2623 +}
  2624 +if(typeof (MochiKit.DOM)=="undefined"){
  2625 +MochiKit.DOM={};
  2626 +}
  2627 +MochiKit.DOM.NAME="MochiKit.DOM";
  2628 +MochiKit.DOM.VERSION="1.4";
  2629 +MochiKit.DOM.__repr__=function(){
  2630 +return "["+this.NAME+" "+this.VERSION+"]";
  2631 +};
  2632 +MochiKit.DOM.toString=function(){
  2633 +return this.__repr__();
  2634 +};
  2635 +MochiKit.DOM.EXPORT=["removeEmptyTextNodes","formContents","currentWindow","currentDocument","withWindow","withDocument","registerDOMConverter","coerceToDOM","createDOM","createDOMFunc","isChildNode","getNodeAttribute","setNodeAttribute","updateNodeAttributes","appendChildNodes","replaceChildNodes","removeElement","swapDOM","BUTTON","TT","PRE","H1","H2","H3","BR","CANVAS","HR","LABEL","TEXTAREA","FORM","STRONG","SELECT","OPTION","OPTGROUP","LEGEND","FIELDSET","P","UL","OL","LI","TD","TR","THEAD","TBODY","TFOOT","TABLE","TH","INPUT","SPAN","A","DIV","IMG","getElement","$","getElementsByTagAndClassName","addToCallStack","addLoadEvent","focusOnLoad","setElementClass","toggleElementClass","addElementClass","removeElementClass","swapElementClass","hasElementClass","escapeHTML","toHTML","emitHTML","scrapeText"];
  2636 +MochiKit.DOM.EXPORT_OK=["domConverters"];
  2637 +MochiKit.DOM.DEPRECATED=[["computedStyle","MochiKit.Style.computedStyle","1.4"],["elementDimensions","MochiKit.Style.getElementDimensions","1.4"],["elementPosition","MochiKit.Style.getElementPosition","1.4"],["hideElement","MochiKit.Style.hideElement","1.4"],["setElementDimensions","MochiKit.Style.setElementDimensions","1.4"],["setElementPosition","MochiKit.Style.setElementPosition","1.4"],["setDisplayForElement","MochiKit.Style.setDisplayForElement","1.4"],["setOpacity","MochiKit.Style.setOpacity","1.4"],["showElement","MochiKit.Style.showElement","1.4"],["Coordinates","MochiKit.Style.Coordinates","1.4"],["Dimensions","MochiKit.Style.Dimensions","1.4"]];
  2638 +MochiKit.DOM.getViewportDimensions=new Function(""+"if (!MochiKit[\"Style\"]) {"+" throw new Error(\"This function has been deprecated and depends on MochiKit.Style.\");"+"}"+"return MochiKit.Style.getViewportDimensions.apply(this, arguments);");
  2639 +MochiKit.Base.update(MochiKit.DOM,{currentWindow:function(){
  2640 +return MochiKit.DOM._window;
  2641 +},currentDocument:function(){
  2642 +return MochiKit.DOM._document;
  2643 +},withWindow:function(win,func){
  2644 +var self=MochiKit.DOM;
  2645 +var _333=self._document;
  2646 +var _334=self._win;
  2647 +var rval;
  2648 +try{
  2649 +self._window=win;
  2650 +self._document=win.document;
  2651 +rval=func();
  2652 +}
  2653 +catch(e){
  2654 +self._window=_334;
  2655 +self._document=_333;
  2656 +throw e;
  2657 +}
  2658 +self._window=_334;
  2659 +self._document=_333;
  2660 +return rval;
  2661 +},formContents:function(elem){
  2662 +var _335=[];
  2663 +var _336=[];
  2664 +var m=MochiKit.Base;
  2665 +var self=MochiKit.DOM;
  2666 +if(typeof (elem)=="undefined"||elem===null){
  2667 +elem=self._document;
  2668 +}else{
  2669 +elem=self.getElement(elem);
  2670 +}
  2671 +m.nodeWalk(elem,function(elem){
  2672 +var name=elem.name;
  2673 +if(m.isNotEmpty(name)){
  2674 +var _337=elem.tagName.toUpperCase();
  2675 +if(_337==="INPUT"&&(elem.type=="radio"||elem.type=="checkbox")&&!elem.checked){
  2676 +return null;
  2677 +}
  2678 +if(_337==="SELECT"){
  2679 +if(elem.type=="select-one"){
  2680 +if(elem.selectedIndex>=0){
  2681 +var opt=elem.options[elem.selectedIndex];
  2682 +_335.push(name);
  2683 +_336.push(opt.value);
  2684 +return null;
  2685 +}
  2686 +_335.push(name);
  2687 +_336.push("");
  2688 +return null;
  2689 +}else{
  2690 +var opts=elem.options;
  2691 +if(!opts.length){
  2692 +_335.push(name);
  2693 +_336.push("");
  2694 +return null;
  2695 +}
  2696 +for(var i=0;i<opts.length;i++){
  2697 +var opt=opts[i];
  2698 +if(!opt.selected){
  2699 +continue;
  2700 +}
  2701 +_335.push(name);
  2702 +_336.push(opt.value);
  2703 +}
  2704 +return null;
  2705 +}
  2706 +}
  2707 +if(_337==="FORM"||_337==="P"||_337==="SPAN"||_337==="DIV"){
  2708 +return elem.childNodes;
  2709 +}
  2710 +_335.push(name);
  2711 +_336.push(elem.value||"");
  2712 +return null;
  2713 +}
  2714 +return elem.childNodes;
  2715 +});
  2716 +return [_335,_336];
  2717 +},withDocument:function(doc,func){
  2718 +var self=MochiKit.DOM;
  2719 +var _341=self._document;
  2720 +var rval;
  2721 +try{
  2722 +self._document=doc;
  2723 +rval=func();
  2724 +}
  2725 +catch(e){
  2726 +self._document=_341;
  2727 +throw e;
  2728 +}
  2729 +self._document=_341;
  2730 +return rval;
  2731 +},registerDOMConverter:function(name,_342,wrap,_343){
  2732 +MochiKit.DOM.domConverters.register(name,_342,wrap,_343);
  2733 +},coerceToDOM:function(node,ctx){
  2734 +var m=MochiKit.Base;
  2735 +var im=MochiKit.Iter;
  2736 +var self=MochiKit.DOM;
  2737 +if(im){
  2738 +var iter=im.iter;
  2739 +var _347=im.repeat;
  2740 +var map=m.map;
  2741 +}
  2742 +var _348=self.domConverters;
  2743 +var _349=arguments.callee;
  2744 +var _350=m.NotFound;
  2745 +while(true){
  2746 +if(typeof (node)=="undefined"||node===null){
  2747 +return null;
  2748 +}
  2749 +if(typeof (node.nodeType)!="undefined"&&node.nodeType>0){
  2750 +return node;
  2751 +}
  2752 +if(typeof (node)=="number"||typeof (node)=="boolean"){
  2753 +node=node.toString();
  2754 +}
  2755 +if(typeof (node)=="string"){
  2756 +return self._document.createTextNode(node);
  2757 +}
  2758 +if(typeof (node.__dom__)=="function"){
  2759 +node=node.__dom__(ctx);
  2760 +continue;
  2761 +}
  2762 +if(typeof (node.dom)=="function"){
  2763 +node=node.dom(ctx);
  2764 +continue;
  2765 +}
  2766 +if(typeof (node)=="function"){
  2767 +node=node.apply(ctx,[ctx]);
  2768 +continue;
  2769 +}
  2770 +if(im){
  2771 +var _351=null;
  2772 +try{
  2773 +_351=iter(node);
  2774 +}
  2775 +catch(e){
  2776 +}
  2777 +if(_351){
  2778 +return map(_349,_351,_347(ctx));
  2779 +}
  2780 +}
  2781 +try{
  2782 +node=_348.match(node,ctx);
  2783 +continue;
  2784 +}
  2785 +catch(e){
  2786 +if(e!=_350){
  2787 +throw e;
  2788 +}
  2789 +}
  2790 +return self._document.createTextNode(node.toString());
  2791 +}
  2792 +return undefined;
  2793 +},isChildNode:function(node,_352){
  2794 +var self=MochiKit.DOM;
  2795 +if(typeof (node)=="string"){
  2796 +node=self.getElement(node);
  2797 +}
  2798 +if(typeof (_352)=="string"){
  2799 +_352=self.getElement(_352);
  2800 +}
  2801 +if(node===_352){
  2802 +return true;
  2803 +}
  2804 +while(node&&node.tagName.toUpperCase()!="BODY"){
  2805 +node=node.parentNode;
  2806 +if(node===_352){
  2807 +return true;
  2808 +}
  2809 +}
  2810 +return false;
  2811 +},setNodeAttribute:function(node,attr,_354){
  2812 +var o={};
  2813 +o[attr]=_354;
  2814 +try{
  2815 +return MochiKit.DOM.updateNodeAttributes(node,o);
  2816 +}
  2817 +catch(e){
  2818 +}
  2819 +return null;
  2820 +},getNodeAttribute:function(node,attr){
  2821 +var self=MochiKit.DOM;
  2822 +var _355=self.attributeArray.renames[attr];
  2823 +node=self.getElement(node);
  2824 +try{
  2825 +if(_355){
  2826 +return node[_355];
  2827 +}
  2828 +return node.getAttribute(attr);
  2829 +}
  2830 +catch(e){
  2831 +}
  2832 +return null;
  2833 +},updateNodeAttributes:function(node,_356){
  2834 +var elem=node;
  2835 +var self=MochiKit.DOM;
  2836 +if(typeof (node)=="string"){
  2837 +elem=self.getElement(node);
  2838 +}
  2839 +if(_356){
  2840 +var _357=MochiKit.Base.updatetree;
  2841 +if(self.attributeArray.compliant){
  2842 +for(var k in _356){
  2843 +var v=_356[k];
  2844 +if(typeof (v)=="object"&&typeof (elem[k])=="object"){
  2845 +_357(elem[k],v);
  2846 +}else{
  2847 +if(k.substring(0,2)=="on"){
  2848 +if(typeof (v)=="string"){
  2849 +v=new Function(v);
  2850 +}
  2851 +elem[k]=v;
  2852 +}else{
  2853 +elem.setAttribute(k,v);
  2854 +}
  2855 +}
  2856 +}
  2857 +}else{
  2858 +var _358=self.attributeArray.renames;
  2859 +for(k in _356){
  2860 +v=_356[k];
  2861 +var _359=_358[k];
  2862 +if(k=="style"&&typeof (v)=="string"){
  2863 +elem.style.cssText=v;
  2864 +}else{
  2865 +if(typeof (_359)=="string"){
  2866 +elem[_359]=v;
  2867 +}else{
  2868 +if(typeof (elem[k])=="object"&&typeof (v)=="object"){
  2869 +_357(elem[k],v);
  2870 +}else{
  2871 +if(k.substring(0,2)=="on"){
  2872 +if(typeof (v)=="string"){
  2873 +v=new Function(v);
  2874 +}
  2875 +elem[k]=v;
  2876 +}else{
  2877 +elem.setAttribute(k,v);
  2878 +}
  2879 +}
  2880 +}
  2881 +}
  2882 +}
  2883 +}
  2884 +}
  2885 +return elem;
  2886 +},appendChildNodes:function(node){
  2887 +var elem=node;
  2888 +var self=MochiKit.DOM;
  2889 +if(typeof (node)=="string"){
  2890 +elem=self.getElement(node);
  2891 +}
  2892 +var _360=[self.coerceToDOM(MochiKit.Base.extend(null,arguments,1),elem)];
  2893 +var _361=MochiKit.Base.concat;
  2894 +while(_360.length){
  2895 +var n=_360.shift();
  2896 +if(typeof (n)=="undefined"||n===null){
  2897 +}else{
  2898 +if(typeof (n.nodeType)=="number"){
  2899 +elem.appendChild(n);
  2900 +}else{
  2901 +_360=_361(n,_360);
  2902 +}
  2903 +}
  2904 +}
  2905 +return elem;
  2906 +},replaceChildNodes:function(node){
  2907 +var elem=node;
  2908 +var self=MochiKit.DOM;
  2909 +if(typeof (node)=="string"){
  2910 +elem=self.getElement(node);
  2911 +arguments[0]=elem;
  2912 +}
  2913 +var _362;
  2914 +while((_362=elem.firstChild)){
  2915 +elem.removeChild(_362);
  2916 +}
  2917 +if(arguments.length<2){
  2918 +return elem;
  2919 +}else{
  2920 +return self.appendChildNodes.apply(this,arguments);
  2921 +}
  2922 +},createDOM:function(name,_363){
  2923 +var elem;
  2924 +var self=MochiKit.DOM;
  2925 +var m=MochiKit.Base;
  2926 +if(typeof (_363)=="string"||typeof (_363)=="number"){
  2927 +var args=m.extend([name,null],arguments,1);
  2928 +return arguments.callee.apply(this,args);
  2929 +}
  2930 +if(typeof (name)=="string"){
  2931 +if(_363&&!self.attributeArray.compliant){
  2932 +var _364="";
  2933 +if("name" in _363){
  2934 +_364+=" name=\""+self.escapeHTML(_363.name)+"\"";
  2935 +}
  2936 +if(name=="input"&&"type" in _363){
  2937 +_364+=" type=\""+self.escapeHTML(_363.type)+"\"";
  2938 +}
  2939 +if(_364){
  2940 +name="<"+name+_364+">";
  2941 +}
  2942 +}
  2943 +elem=self._document.createElement(name);
  2944 +}else{
  2945 +elem=name;
  2946 +}
  2947 +if(_363){
  2948 +self.updateNodeAttributes(elem,_363);
  2949 +}
  2950 +if(arguments.length<=2){
  2951 +return elem;
  2952 +}else{
  2953 +var args=m.extend([elem],arguments,2);
  2954 +return self.appendChildNodes.apply(this,args);
  2955 +}
  2956 +},createDOMFunc:function(){
  2957 +var m=MochiKit.Base;
  2958 +return m.partial.apply(this,m.extend([MochiKit.DOM.createDOM],arguments));
  2959 +},removeElement:function(elem){
  2960 +var e=MochiKit.DOM.getElement(elem);
  2961 +e.parentNode.removeChild(e);
  2962 +return e;
  2963 +},swapDOM:function(dest,src){
  2964 +var self=MochiKit.DOM;
  2965 +dest=self.getElement(dest);
  2966 +var _367=dest.parentNode;
  2967 +if(src){
  2968 +src=self.getElement(src);
  2969 +_367.replaceChild(src,dest);
  2970 +}else{
  2971 +_367.removeChild(dest);
  2972 +}
  2973 +return src;
  2974 +},getElement:function(id){
  2975 +var self=MochiKit.DOM;
  2976 +if(arguments.length==1){
  2977 +return ((typeof (id)=="string")?self._document.getElementById(id):id);
  2978 +}else{
  2979 +return MochiKit.Base.map(self.getElement,arguments);
  2980 +}
  2981 +},getElementsByTagAndClassName:function(_369,_370,_371){
  2982 +var self=MochiKit.DOM;
  2983 +if(typeof (_369)=="undefined"||_369===null){
  2984 +_369="*";
  2985 +}
  2986 +if(typeof (_371)=="undefined"||_371===null){
  2987 +_371=self._document;
  2988 +}
  2989 +_371=self.getElement(_371);
  2990 +var _372=(_371.getElementsByTagName(_369)||self._document.all);
  2991 +if(typeof (_370)=="undefined"||_370===null){
  2992 +return MochiKit.Base.extend(null,_372);
  2993 +}
  2994 +var _373=[];
  2995 +for(var i=0;i<_372.length;i++){
  2996 +var _374=_372[i];
  2997 +var cls=_374.className;
  2998 +if(!cls){
  2999 +continue;
  3000 +}
  3001 +var _376=cls.split(" ");
  3002 +for(var j=0;j<_376.length;j++){
  3003 +if(_376[j]==_370){
  3004 +_373.push(_374);
  3005 +break;
  3006 +}
  3007 +}
  3008 +}
  3009 +return _373;
  3010 +},_newCallStack:function(path,once){
  3011 +var rval=function(){
  3012 +var _379=arguments.callee.callStack;
  3013 +for(var i=0;i<_379.length;i++){
  3014 +if(_379[i].apply(this,arguments)===false){
  3015 +break;
  3016 +}
  3017 +}
  3018 +if(once){
  3019 +try{
  3020 +this[path]=null;
  3021 +}
  3022 +catch(e){
  3023 +}
  3024 +}
  3025 +};
  3026 +rval.callStack=[];
  3027 +return rval;
  3028 +},addToCallStack:function(_380,path,func,once){
  3029 +var self=MochiKit.DOM;
  3030 +var _381=_380[path];
  3031 +var _382=_381;
  3032 +if(!(typeof (_381)=="function"&&typeof (_381.callStack)=="object"&&_381.callStack!==null)){
  3033 +_382=self._newCallStack(path,once);
  3034 +if(typeof (_381)=="function"){
  3035 +_382.callStack.push(_381);
  3036 +}
  3037 +_380[path]=_382;
  3038 +}
  3039 +_382.callStack.push(func);
  3040 +},addLoadEvent:function(func){
  3041 +var self=MochiKit.DOM;
  3042 +self.addToCallStack(self._window,"onload",func,true);
  3043 +},focusOnLoad:function(_383){
  3044 +var self=MochiKit.DOM;
  3045 +self.addLoadEvent(function(){
  3046 +_383=self.getElement(_383);
  3047 +if(_383){
  3048 +_383.focus();
  3049 +}
  3050 +});
  3051 +},setElementClass:function(_384,_385){
  3052 +var self=MochiKit.DOM;
  3053 +var obj=self.getElement(_384);
  3054 +if(self.attributeArray.compliant){
  3055 +obj.setAttribute("class",_385);
  3056 +}else{
  3057 +obj.setAttribute("className",_385);
  3058 +}
  3059 +},toggleElementClass:function(_386){
  3060 +var self=MochiKit.DOM;
  3061 +for(var i=1;i<arguments.length;i++){
  3062 +var obj=self.getElement(arguments[i]);
  3063 +if(!self.addElementClass(obj,_386)){
  3064 +self.removeElementClass(obj,_386);
  3065 +}
  3066 +}
  3067 +},addElementClass:function(_387,_388){
  3068 +var self=MochiKit.DOM;
  3069 +var obj=self.getElement(_387);
  3070 +var cls=obj.className;
  3071 +if(cls==undefined||cls.length===0){
  3072 +self.setElementClass(obj,_388);
  3073 +return true;
  3074 +}
  3075 +if(cls==_388){
  3076 +return false;
  3077 +}
  3078 +var _389=cls.split(" ");
  3079 +for(var i=0;i<_389.length;i++){
  3080 +if(_389[i]==_388){
  3081 +return false;
  3082 +}
  3083 +}
  3084 +self.setElementClass(obj,cls+" "+_388);
  3085 +return true;
  3086 +},removeElementClass:function(_390,_391){
  3087 +var self=MochiKit.DOM;
  3088 +var obj=self.getElement(_390);
  3089 +var cls=obj.className;
  3090 +if(cls==undefined||cls.length===0){
  3091 +return false;
  3092 +}
  3093 +if(cls==_391){
  3094 +self.setElementClass(obj,"");
  3095 +return true;
  3096 +}
  3097 +var _392=cls.split(" ");
  3098 +for(var i=0;i<_392.length;i++){
  3099 +if(_392[i]==_391){
  3100 +_392.splice(i,1);
  3101 +self.setElementClass(obj,_392.join(" "));
  3102 +return true;
  3103 +}
  3104 +}
  3105 +return false;
  3106 +},swapElementClass:function(_393,_394,_395){
  3107 +var obj=MochiKit.DOM.getElement(_393);
  3108 +var res=MochiKit.DOM.removeElementClass(obj,_394);
  3109 +if(res){
  3110 +MochiKit.DOM.addElementClass(obj,_395);
  3111 +}
  3112 +return res;
  3113 +},hasElementClass:function(_396,_397){
  3114 +var obj=MochiKit.DOM.getElement(_396);
  3115 +var cls=obj.className;
  3116 +if(!cls){
  3117 +return false;
  3118 +}
  3119 +var _398=cls.split(" ");
  3120 +for(var i=1;i<arguments.length;i++){
  3121 +var good=false;
  3122 +for(var j=0;j<_398.length;j++){
  3123 +if(_398[j]==arguments[i]){
  3124 +good=true;
  3125 +break;
  3126 +}
  3127 +}
  3128 +if(!good){
  3129 +return false;
  3130 +}
  3131 +}
  3132 +return true;
  3133 +},escapeHTML:function(s){
  3134 +return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
  3135 +},toHTML:function(dom){
  3136 +return MochiKit.DOM.emitHTML(dom).join("");
  3137 +},emitHTML:function(dom,lst){
  3138 +if(typeof (lst)=="undefined"||lst===null){
  3139 +lst=[];
  3140 +}
  3141 +var _401=[dom];
  3142 +var self=MochiKit.DOM;
  3143 +var _402=self.escapeHTML;
  3144 +var _403=self.attributeArray;
  3145 +while(_401.length){
  3146 +dom=_401.pop();
  3147 +if(typeof (dom)=="string"){
  3148 +lst.push(dom);
  3149 +}else{
  3150 +if(dom.nodeType==1){
  3151 +lst.push("<"+dom.tagName.toLowerCase());
  3152 +var _404=[];
  3153 +var _405=_403(dom);
  3154 +for(var i=0;i<_405.length;i++){
  3155 +var a=_405[i];
  3156 +_404.push([" ",a.name,"=\"",_402(a.value),"\""]);
  3157 +}
  3158 +_404.sort();
  3159 +for(i=0;i<_404.length;i++){
  3160 +var _406=_404[i];
  3161 +for(var j=0;j<_406.length;j++){
  3162 +lst.push(_406[j]);
  3163 +}
  3164 +}
  3165 +if(dom.hasChildNodes()){
  3166 +lst.push(">");
  3167 +_401.push("</"+dom.tagName.toLowerCase()+">");
  3168 +var _407=dom.childNodes;
  3169 +for(i=_407.length-1;i>=0;i--){
  3170 +_401.push(_407[i]);
  3171 +}
  3172 +}else{
  3173 +lst.push("/>");
  3174 +}
  3175 +}else{
  3176 +if(dom.nodeType==3){
  3177 +lst.push(_402(dom.nodeValue));
  3178 +}
  3179 +}
  3180 +}
  3181 +}
  3182 +return lst;
  3183 +},scrapeText:function(node,_408){
  3184 +var rval=[];
  3185 +(function(node){
  3186 +var cn=node.childNodes;
  3187 +if(cn){
  3188 +for(var i=0;i<cn.length;i++){
  3189 +arguments.callee.call(this,cn[i]);
  3190 +}
  3191 +}
  3192 +var _410=node.nodeValue;
  3193 +if(typeof (_410)=="string"){
  3194 +rval.push(_410);
  3195 +}
  3196 +})(MochiKit.DOM.getElement(node));
  3197 +if(_408){
  3198 +return rval;
  3199 +}else{
  3200 +return rval.join("");
  3201 +}
  3202 +},removeEmptyTextNodes:function(_411){
  3203 +_411=MochiKit.DOM.getElement(_411);
  3204 +for(var i=0;i<_411.childNodes.length;i++){
  3205 +var node=_411.childNodes[i];
  3206 +if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
  3207 +node.parentNode.removeChild(node);
  3208 +}
  3209 +}
  3210 +},__new__:function(win){
  3211 +var m=MochiKit.Base;
  3212 +if(typeof (document)!="undefined"){
  3213 +this._document=document;
  3214 +}else{
  3215 +if(MochiKit.MockDOM){
  3216 +this._document=MochiKit.MockDOM.document;
  3217 +}
  3218 +}
  3219 +this._window=win;
  3220 +this.domConverters=new m.AdapterRegistry();
  3221 +var _412=this._document.createElement("span");
  3222 +var _413;
  3223 +if(_412&&_412.attributes&&_412.attributes.length>0){
  3224 +var _414=m.filter;
  3225 +_413=function(node){
  3226 +return _414(_413.ignoreAttrFilter,node.attributes);
  3227 +};
  3228 +_413.ignoreAttr={};
  3229 +var _415=_412.attributes;
  3230 +var _416=_413.ignoreAttr;
  3231 +for(var i=0;i<_415.length;i++){
  3232 +var a=_415[i];
  3233 +_416[a.name]=a.value;
  3234 +}
  3235 +_413.ignoreAttrFilter=function(a){
  3236 +return (_413.ignoreAttr[a.name]!=a.value);
  3237 +};
  3238 +_413.compliant=false;
  3239 +_413.renames={"class":"className","checked":"defaultChecked","usemap":"useMap","for":"htmlFor","readonly":"readOnly"};
  3240 +}else{
  3241 +_413=function(node){
  3242 +return node.attributes;
  3243 +};
  3244 +_413.compliant=true;
  3245 +_413.renames={};
  3246 +}
  3247 +this.attributeArray=_413;
  3248 +var _417=function(_418,arr){
  3249 +var _419=arr[1].split(".");
  3250 +var str="";
  3251 +var obj={};
  3252 +str+="if (!MochiKit."+_419[1]+") { throw new Error(\"";
  3253 +str+="This function has been deprecated and depends on MochiKit.";
  3254 +str+=_419[1]+".\");}";
  3255 +str+="return MochiKit."+_419[1]+"."+arr[0];
  3256 +str+=".apply(this, arguments);";
  3257 +obj[_419[2]]=new Function(str);
  3258 +MochiKit.Base.update(MochiKit[_418],obj);
  3259 +};
  3260 +for(var i;i<MochiKit.DOM.DEPRECATED.length;i++){
  3261 +_417("DOM",MochiKit.DOM.DEPRECATED[i]);
  3262 +}
  3263 +var _420=this.createDOMFunc;
  3264 +this.UL=_420("ul");
  3265 +this.OL=_420("ol");
  3266 +this.LI=_420("li");
  3267 +this.TD=_420("td");
  3268 +this.TR=_420("tr");
  3269 +this.TBODY=_420("tbody");
  3270 +this.THEAD=_420("thead");
  3271 +this.TFOOT=_420("tfoot");
  3272 +this.TABLE=_420("table");
  3273 +this.TH=_420("th");
  3274 +this.INPUT=_420("input");
  3275 +this.SPAN=_420("span");
  3276 +this.A=_420("a");
  3277 +this.DIV=_420("div");
  3278 +this.IMG=_420("img");
  3279 +this.BUTTON=_420("button");
  3280 +this.TT=_420("tt");
  3281 +this.PRE=_420("pre");
  3282 +this.H1=_420("h1");
  3283 +this.H2=_420("h2");
  3284 +this.H3=_420("h3");
  3285 +this.BR=_420("br");
  3286 +this.HR=_420("hr");
  3287 +this.LABEL=_420("label");
  3288 +this.TEXTAREA=_420("textarea");
  3289 +this.FORM=_420("form");
  3290 +this.P=_420("p");
  3291 +this.SELECT=_420("select");
  3292 +this.OPTION=_420("option");
  3293 +this.OPTGROUP=_420("optgroup");
  3294 +this.LEGEND=_420("legend");
  3295 +this.FIELDSET=_420("fieldset");
  3296 +this.STRONG=_420("strong");
  3297 +this.CANVAS=_420("canvas");
  3298 +this.$=this.getElement;
  3299 +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
  3300 +m.nameFunctions(this);
  3301 +}});
  3302 +MochiKit.DOM.__new__(((typeof (window)=="undefined")?this:window));
  3303 +if(MochiKit.__export__){
  3304 +withWindow=MochiKit.DOM.withWindow;
  3305 +withDocument=MochiKit.DOM.withDocument;
  3306 +}
  3307 +MochiKit.Base._exportSymbols(this,MochiKit.DOM);
  3308 +if(typeof (dojo)!="undefined"){
  3309 +dojo.provide("MochiKit.Style");
  3310 +dojo.require("MochiKit.Base");
  3311 +dojo.require("MochiKit.DOM");
  3312 +}
  3313 +if(typeof (JSAN)!="undefined"){
  3314 +JSAN.use("MochiKit.Base",[]);
  3315 +}
  3316 +try{
  3317 +if(typeof (MochiKit.Base)=="undefined"){
  3318 +throw "";
  3319 +}
  3320 +}
  3321 +catch(e){
  3322 +throw "MochiKit.Style depends on MochiKit.Base!";
  3323 +}
  3324 +try{
  3325 +if(typeof (MochiKit.DOM)=="undefined"){
  3326 +throw "";
  3327 +}
  3328 +}
  3329 +catch(e){
  3330 +throw "MochiKit.Style depends on MochiKit.DOM!";
  3331 +}
  3332 +if(typeof (MochiKit.Style)=="undefined"){
  3333 +MochiKit.Style={};
  3334 +}
  3335 +MochiKit.Style.NAME="MochiKit.Style";
  3336 +MochiKit.Style.VERSION="1.4";
  3337 +MochiKit.Style.__repr__=function(){
  3338 +return "["+this.NAME+" "+this.VERSION+"]";
  3339 +};
  3340 +MochiKit.Style.toString=function(){
  3341 +return this.__repr__();
  3342 +};
  3343 +MochiKit.Style.EXPORT_OK=[];
  3344 +MochiKit.Style.EXPORT=["setOpacity","getOpacity","setStyle","getStyle","computedStyle","getElementDimensions","elementDimensions","setElementDimensions","getElementPosition","elementPosition","setElementPosition","setDisplayForElement","hideElement","showElement","getViewportDimensions","getViewportPosition","Dimensions","Coordinates"];
  3345 +MochiKit.Style.Dimensions=function(w,h){
  3346 +this.w=w;
  3347 +this.h=h;
  3348 +};
  3349 +MochiKit.Style.Dimensions.prototype.__repr__=function(){
  3350 +var repr=MochiKit.Base.repr;
  3351 +return "{w: "+repr(this.w)+", h: "+repr(this.h)+"}";
  3352 +};
  3353 +MochiKit.Style.Dimensions.prototype.toString=function(){
  3354 +return this.__repr__();
  3355 +};
  3356 +MochiKit.Style.Coordinates=function(x,y){
  3357 +this.x=x;
  3358 +this.y=y;
  3359 +};
  3360 +MochiKit.Style.Coordinates.prototype.__repr__=function(){
  3361 +var repr=MochiKit.Base.repr;
  3362 +return "{x: "+repr(this.x)+", y: "+repr(this.y)+"}";
  3363 +};
  3364 +MochiKit.Style.Coordinates.prototype.toString=function(){
  3365 +return this.__repr__();
  3366 +};
  3367 +MochiKit.Base.update(MochiKit.Style,{computedStyle:function(elem,_425){
  3368 +var dom=MochiKit.DOM;
  3369 +var d=dom._document;
  3370 +elem=dom.getElement(elem);
  3371 +_425=MochiKit.Base.camelize(_425);
  3372 +if(!elem||elem==d){
  3373 +return undefined;
  3374 +}
  3375 +if(_425=="opacity"&&elem.filters){
  3376 +try{
  3377 +return elem.filters.item("DXImageTransform.Microsoft.Alpha").opacity/100;
  3378 +}
  3379 +catch(e){
  3380 +try{
  3381 +return elem.filters.item("alpha").opacity/100;
  3382 +}
  3383 +catch(e){
  3384 +}
  3385 +}
  3386 +}
  3387 +if(elem.currentStyle){
  3388 +return elem.currentStyle[_425];
  3389 +}
  3390 +if(typeof (d.defaultView)=="undefined"){
  3391 +return undefined;
  3392 +}
  3393 +if(d.defaultView===null){
  3394 +return undefined;
  3395 +}
  3396 +var _426=d.defaultView.getComputedStyle(elem,null);
  3397 +if(typeof (_426)=="undefined"||_426===null){
  3398 +return undefined;
  3399 +}
  3400 +var _427=_425.replace(/([A-Z])/g,"-$1").toLowerCase();
  3401 +return _426.getPropertyValue(_427);
  3402 +},getStyle:function(elem,_428){
  3403 +elem=MochiKit.DOM.getElement(elem);
  3404 +var _429=elem.style[MochiKit.Base.camelize(_428)];
  3405 +if(!_429){
  3406 +if(document.defaultView&&document.defaultView.getComputedStyle){
  3407 +var css=document.defaultView.getComputedStyle(elem,null);
  3408 +_429=css?css.getPropertyValue(_428):null;
  3409 +}else{
  3410 +if(elem.currentStyle){
  3411 +_429=elem.currentStyle[MochiKit.Base.camelize(_428)];
  3412 +}
  3413 +}
  3414 +}
  3415 +if(/Opera/.test(navigator.userAgent)&&(MochiKit.Base.find(["left","top","right","bottom"],_428)!=-1)){
  3416 +if(MochiKit.Style.getStyle(elem,"position")=="static"){
  3417 +_429="auto";
  3418 +}
  3419 +}
  3420 +return _429=="auto"?null:_429;
  3421 +},setStyle:function(elem,_431){
  3422 +elem=MochiKit.DOM.getElement(elem);
  3423 +for(name in _431){
  3424 +elem.style[MochiKit.Base.camelize(name)]=_431[name];
  3425 +}
  3426 +},getOpacity:function(elem){
  3427 +var _432;
  3428 +if(_432=MochiKit.Style.getStyle(elem,"opacity")){
  3429 +return parseFloat(_432);
  3430 +}
  3431 +if(_432=(MochiKit.Style.getStyle(elem,"filter")||"").match(/alpha\(opacity=(.*)\)/)){
  3432 +if(_432[1]){
  3433 +return parseFloat(_432[1])/100;
  3434 +}
  3435 +}
  3436 +return 1;
  3437 +},setOpacity:function(elem,o){
  3438 +elem=MochiKit.DOM.getElement(elem);
  3439 +var self=MochiKit.Style;
  3440 +if(o==1){
  3441 +var _433=/Gecko/.test(navigator.userAgent)&&!(/Konqueror|Safari|KHTML/.test(navigator.userAgent));
  3442 +self.setStyle(elem,{opacity:_433?0.999999:1});
  3443 +if(/MSIE/.test(navigator.userAgent)){
  3444 +self.setStyle(elem,{filter:self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")});
  3445 +}
  3446 +}else{
  3447 +if(o<0.00001){
  3448 +o=0;
  3449 +}
  3450 +self.setStyle(elem,{opacity:o});
  3451 +if(/MSIE/.test(navigator.userAgent)){
  3452 +self.setStyle(elem,{filter:self.getStyle(elem,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+o*100+")"});
  3453 +}
  3454 +}
  3455 +},getElementPosition:function(elem,_434){
  3456 +var self=MochiKit.Style;
  3457 +var dom=MochiKit.DOM;
  3458 +elem=dom.getElement(elem);
  3459 +if(!elem||(!(elem.x&&elem.y)&&(!elem.parentNode==null||self.computedStyle(elem,"display")=="none"))){
  3460 +return undefined;
  3461 +}
  3462 +var c=new self.Coordinates(0,0);
  3463 +var box=null;
  3464 +var _437=null;
  3465 +var d=MochiKit.DOM._document;
  3466 +var de=d.documentElement;
  3467 +var b=d.body;
  3468 +if(!elem.parentNode&&elem.x&&elem.y){
  3469 +c.x+=elem.x||0;
  3470 +c.y+=elem.y||0;
  3471 +}else{
  3472 +if(elem.getBoundingClientRect){
  3473 +box=elem.getBoundingClientRect();
  3474 +c.x+=box.left+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
  3475 +c.y+=box.top+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
  3476 +}else{
  3477 +if(elem.offsetParent){
  3478 +c.x+=elem.offsetLeft;
  3479 +c.y+=elem.offsetTop;
  3480 +_437=elem.offsetParent;
  3481 +if(_437!=elem){
  3482 +while(_437){
  3483 +c.x+=_437.offsetLeft;
  3484 +c.y+=_437.offsetTop;
  3485 +_437=_437.offsetParent;
  3486 +}
  3487 +}
  3488 +var ua=navigator.userAgent.toLowerCase();
  3489 +if((typeof (opera)!="undefined"&&parseFloat(opera.version())<9)||(ua.indexOf("safari")!=-1&&self.computedStyle(elem,"position")=="absolute")){
  3490 +c.x-=b.offsetLeft;
  3491 +c.y-=b.offsetTop;
  3492 +}
  3493 +}
  3494 +}
  3495 +}
  3496 +if(typeof (_434)!="undefined"){
  3497 +_434=arguments.callee(_434);
  3498 +if(_434){
  3499 +c.x-=(_434.x||0);
  3500 +c.y-=(_434.y||0);
  3501 +}
  3502 +}
  3503 +if(elem.parentNode){
  3504 +_437=elem.parentNode;
  3505 +}else{
  3506 +_437=null;
  3507 +}
  3508 +while(_437){
  3509 +var _440=_437.tagName.toUpperCase();
  3510 +if(_440==="BODY"||_440==="HTML"){
  3511 +break;
  3512 +}
  3513 +c.x-=_437.scrollLeft;
  3514 +c.y-=_437.scrollTop;
  3515 +if(_437.parentNode){
  3516 +_437=_437.parentNode;
  3517 +}else{
  3518 +_437=null;
  3519 +}
  3520 +}
  3521 +return c;
  3522 +},setElementPosition:function(elem,_441,_442){
  3523 +elem=MochiKit.DOM.getElement(elem);
  3524 +if(typeof (_442)=="undefined"){
  3525 +_442="px";
  3526 +}
  3527 +var _443={};
  3528 +var _444=MochiKit.Base.isUndefinedOrNull;
  3529 +if(!_444(_441.x)){
  3530 +_443["left"]=_441.x+_442;
  3531 +}
  3532 +if(!_444(_441.y)){
  3533 +_443["top"]=_441.y+_442;
  3534 +}
  3535 +MochiKit.DOM.updateNodeAttributes(elem,{"style":_443});
  3536 +},getElementDimensions:function(elem){
  3537 +var self=MochiKit.Style;
  3538 +var dom=MochiKit.DOM;
  3539 +if(typeof (elem.w)=="number"||typeof (elem.h)=="number"){
  3540 +return new self.Dimensions(elem.w||0,elem.h||0);
  3541 +}
  3542 +elem=dom.getElement(elem);
  3543 +if(!elem){
  3544 +return undefined;
  3545 +}
  3546 +var disp=self.computedStyle(elem,"display");
  3547 +if(disp!="none"&&disp!=""&&typeof (disp)!="undefined"){
  3548 +return new self.Dimensions(elem.offsetWidth||0,elem.offsetHeight||0);
  3549 +}
  3550 +var s=elem.style;
  3551 +var _446=s.visibility;
  3552 +var _447=s.position;
  3553 +s.visibility="hidden";
  3554 +s.position="absolute";
  3555 +s.display="";
  3556 +var _448=elem.offsetWidth;
  3557 +var _449=elem.offsetHeight;
  3558 +s.display="none";
  3559 +s.position=_447;
  3560 +s.visibility=_446;
  3561 +return new self.Dimensions(_448,_449);
  3562 +},setElementDimensions:function(elem,_450,_451){
  3563 +elem=MochiKit.DOM.getElement(elem);
  3564 +if(typeof (_451)=="undefined"){
  3565 +_451="px";
  3566 +}
  3567 +var _452={};
  3568 +var _453=MochiKit.Base.isUndefinedOrNull;
  3569 +if(!_453(_450.w)){
  3570 +_452["width"]=_450.w+_451;
  3571 +}
  3572 +if(!_453(_450.h)){
  3573 +_452["height"]=_450.h+_451;
  3574 +}
  3575 +MochiKit.DOM.updateNodeAttributes(elem,{"style":_452});
  3576 +},setDisplayForElement:function(_454,_455){
  3577 +var _456=MochiKit.Base.extend(null,arguments,1);
  3578 +var _457=MochiKit.DOM.getElement;
  3579 +for(var i=0;i<_456.length;i++){
  3580 +var _455=_457(_456[i]);
  3581 +if(_455){
  3582 +_455.style.display=_454;
  3583 +}
  3584 +}
  3585 +},getViewportDimensions:function(){
  3586 +var d=new MochiKit.Style.Dimensions();
  3587 +var w=MochiKit.DOM._window;
  3588 +var b=MochiKit.DOM._document.body;
  3589 +if(w.innerWidth){
  3590 +d.w=w.innerWidth;
  3591 +d.h=w.innerHeight;
  3592 +}else{
  3593 +if(b.parentElement.clientWidth){
  3594 +d.w=b.parentElement.clientWidth;
  3595 +d.h=b.parentElement.clientHeight;
  3596 +}else{
  3597 +if(b&&b.clientWidth){
  3598 +d.w=b.clientWidth;
  3599 +d.h=b.clientHeight;
  3600 +}
  3601 +}
  3602 +}
  3603 +return d;
  3604 +},getViewportPosition:function(){
  3605 +var c=new MochiKit.Style.Coordinates(0,0);
  3606 +var d=MochiKit.DOM._document;
  3607 +var de=d.documentElement;
  3608 +var db=d.body;
  3609 +if(de&&(de.scrollTop||de.scrollLeft)){
  3610 +c.x=de.scrollLeft;
  3611 +c.y=de.scrollTop;
  3612 +}else{
  3613 +if(db){
  3614 +c.x=db.scrollLeft;
  3615 +c.y=db.scrollTop;
  3616 +}
  3617 +}
  3618 +return c;
  3619 +},__new__:function(){
  3620 +var m=MochiKit.Base;
  3621 +this.elementPosition=this.getElementPosition;
  3622 +this.elementDimensions=this.getElementDimensions;
  3623 +this.hideElement=m.partial(this.setDisplayForElement,"none");
  3624 +this.showElement=m.partial(this.setDisplayForElement,"block");
  3625 +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
  3626 +m.nameFunctions(this);
  3627 +}});
  3628 +MochiKit.Style.__new__();
  3629 +MochiKit.Base._exportSymbols(this,MochiKit.Style);
  3630 +if(typeof (dojo)!="undefined"){
  3631 +dojo.provide("MochiKit.LoggingPane");
  3632 +dojo.require("MochiKit.Logging");
  3633 +dojo.require("MochiKit.Base");
  3634 +}
  3635 +if(typeof (JSAN)!="undefined"){
  3636 +JSAN.use("MochiKit.Logging",[]);
  3637 +JSAN.use("MochiKit.Base",[]);
  3638 +}
  3639 +try{
  3640 +if(typeof (MochiKit.Base)=="undefined"||typeof (MochiKit.Logging)=="undefined"){
  3641 +throw "";
  3642 +}
  3643 +}
  3644 +catch(e){
  3645 +throw "MochiKit.LoggingPane depends on MochiKit.Base and MochiKit.Logging!";
  3646 +}
  3647 +if(typeof (MochiKit.LoggingPane)=="undefined"){
  3648 +MochiKit.LoggingPane={};
  3649 +}
  3650 +MochiKit.LoggingPane.NAME="MochiKit.LoggingPane";
  3651 +MochiKit.LoggingPane.VERSION="1.4";
  3652 +MochiKit.LoggingPane.__repr__=function(){
  3653 +return "["+this.NAME+" "+this.VERSION+"]";
  3654 +};
  3655 +MochiKit.LoggingPane.toString=function(){
  3656 +return this.__repr__();
  3657 +};
  3658 +MochiKit.LoggingPane.createLoggingPane=function(_459){
  3659 +var m=MochiKit.LoggingPane;
  3660 +_459=!(!_459);
  3661 +if(m._loggingPane&&m._loggingPane.inline!=_459){
  3662 +m._loggingPane.closePane();
  3663 +m._loggingPane=null;
  3664 +}
  3665 +if(!m._loggingPane||m._loggingPane.closed){
  3666 +m._loggingPane=new m.LoggingPane(_459,MochiKit.Logging.logger);
  3667 +}
  3668 +return m._loggingPane;
  3669 +};
  3670 +MochiKit.LoggingPane.LoggingPane=function(_460,_461){
  3671 +if(typeof (_461)=="undefined"||_461===null){
  3672 +_461=MochiKit.Logging.logger;
  3673 +}
  3674 +this.logger=_461;
  3675 +var _462=MochiKit.Base.update;
  3676 +var _463=MochiKit.Base.updatetree;
  3677 +var bind=MochiKit.Base.bind;
  3678 +var _464=MochiKit.Base.clone;
  3679 +var win=window;
  3680 +var uid="_MochiKit_LoggingPane";
  3681 +if(typeof (MochiKit.DOM)!="undefined"){
  3682 +win=MochiKit.DOM.currentWindow();
  3683 +}
  3684 +if(!_460){
  3685 +var url=win.location.href.split("?")[0].replace(/[:\/.><&-]/g,"_");
  3686 +var name=uid+"_"+url;
  3687 +var nwin=win.open("",name,"dependent,resizable,height=200");
  3688 +if(!nwin){
  3689 +alert("Not able to open debugging window due to pop-up blocking.");
  3690 +return undefined;
  3691 +}
  3692 +nwin.document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" "+"\"http://www.w3.org/TR/html4/loose.dtd\">"+"<html><head><title>[MochiKit.LoggingPane]</title></head>"+"<body></body></html>");
  3693 +nwin.document.close();
  3694 +nwin.document.title+=" "+win.document.title;
  3695 +win=nwin;
  3696 +}
  3697 +var doc=win.document;
  3698 +this.doc=doc;
  3699 +var _467=doc.getElementById(uid);
  3700 +var _468=!!_467;
  3701 +if(_467&&typeof (_467.loggingPane)!="undefined"){
  3702 +_467.loggingPane.logger=this.logger;
  3703 +_467.loggingPane.buildAndApplyFilter();
  3704 +return _467.loggingPane;
  3705 +}
  3706 +if(_468){
  3707 +var _469;
  3708 +while((_469=_467.firstChild)){
  3709 +_467.removeChild(_469);
  3710 +}
  3711 +}else{
  3712 +_467=doc.createElement("div");
  3713 +_467.id=uid;
  3714 +}
  3715 +_467.loggingPane=this;
  3716 +var _470=doc.createElement("input");
  3717 +var _471=doc.createElement("input");
  3718 +var _472=doc.createElement("button");
  3719 +var _473=doc.createElement("button");
  3720 +var _474=doc.createElement("button");
  3721 +var _475=doc.createElement("button");
  3722 +var _476=doc.createElement("div");
  3723 +var _477=doc.createElement("div");
  3724 +var _478=uid+"_Listener";
  3725 +this.colorTable=_464(this.colorTable);
  3726 +var _479=[];
  3727 +var _480=null;
  3728 +var _481=function(msg){
  3729 +var _482=msg.level;
  3730 +if(typeof (_482)=="number"){
  3731 +_482=MochiKit.Logging.LogLevel[_482];
  3732 +}
  3733 +return _482;
  3734 +};
  3735 +var _483=function(msg){
  3736 +return msg.info.join(" ");
  3737 +};
  3738 +var _484=bind(function(msg){
  3739 +var _485=_481(msg);
  3740 +var text=_483(msg);
  3741 +var c=this.colorTable[_485];
  3742 +var p=doc.createElement("span");
  3743 +p.className="MochiKit-LogMessage MochiKit-LogLevel-"+_485;
  3744 +p.style.cssText="margin: 0px; white-space: -moz-pre-wrap; white-space: -o-pre-wrap; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word; wrap-option: emergency; color: "+c;
  3745 +p.appendChild(doc.createTextNode(_485+": "+text));
  3746 +_477.appendChild(p);
  3747 +_477.appendChild(doc.createElement("br"));
  3748 +if(_476.offsetHeight>_476.scrollHeight){
  3749 +_476.scrollTop=0;
  3750 +}else{
  3751 +_476.scrollTop=_476.scrollHeight;
  3752 +}
  3753 +},this);
  3754 +var _487=function(msg){
  3755 +_479[_479.length]=msg;
  3756 +_484(msg);
  3757 +};
  3758 +var _488=function(){
  3759 +var _489,infore;
  3760 +try{
  3761 +_489=new RegExp(_470.value);
  3762 +infore=new RegExp(_471.value);
  3763 +}
  3764 +catch(e){
  3765 +logDebug("Error in filter regex: "+e.message);
  3766 +return null;
  3767 +}
  3768 +return function(msg){
  3769 +return (_489.test(_481(msg))&&infore.test(_483(msg)));
  3770 +};
  3771 +};
  3772 +var _490=function(){
  3773 +while(_477.firstChild){
  3774 +_477.removeChild(_477.firstChild);
  3775 +}
  3776 +};
  3777 +var _491=function(){
  3778 +_479=[];
  3779 +_490();
  3780 +};
  3781 +var _492=bind(function(){
  3782 +if(this.closed){
  3783 +return;
  3784 +}
  3785 +this.closed=true;
  3786 +if(MochiKit.LoggingPane._loggingPane==this){
  3787 +MochiKit.LoggingPane._loggingPane=null;
  3788 +}
  3789 +this.logger.removeListener(_478);
  3790 +_467.loggingPane=null;
  3791 +if(_460){
  3792 +_467.parentNode.removeChild(_467);
  3793 +}else{
  3794 +this.win.close();
  3795 +}
  3796 +},this);
  3797 +var _493=function(){
  3798 +_490();
  3799 +for(var i=0;i<_479.length;i++){
  3800 +var msg=_479[i];
  3801 +if(_480===null||_480(msg)){
  3802 +_484(msg);
  3803 +}
  3804 +}
  3805 +};
  3806 +this.buildAndApplyFilter=function(){
  3807 +_480=_488();
  3808 +_493();
  3809 +this.logger.removeListener(_478);
  3810 +this.logger.addListener(_478,_480,_487);
  3811 +};
  3812 +var _494=bind(function(){
  3813 +_479=this.logger.getMessages();
  3814 +_493();
  3815 +},this);
  3816 +var _495=bind(function(_496){
  3817 +_496=_496||window.event;
  3818 +key=_496.which||_496.keyCode;
  3819 +if(key==13){
  3820 +this.buildAndApplyFilter();
  3821 +}
  3822 +},this);
  3823 +var _497="display: block; z-index: 1000; left: 0px; bottom: 0px; position: fixed; width: 100%; background-color: white; font: "+this.logFont;
  3824 +if(_460){
  3825 +_497+="; height: 10em; border-top: 2px solid black";
  3826 +}else{
  3827 +_497+="; height: 100%;";
  3828 +}
  3829 +_467.style.cssText=_497;
  3830 +if(!_468){
  3831 +doc.body.appendChild(_467);
  3832 +}
  3833 +_497={"cssText":"width: 33%; display: inline; font: "+this.logFont};
  3834 +_463(_470,{"value":"FATAL|ERROR|WARNING|INFO|DEBUG","onkeypress":_495,"style":_497});
  3835 +_467.appendChild(_470);
  3836 +_463(_471,{"value":".*","onkeypress":_495,"style":_497});
  3837 +_467.appendChild(_471);
  3838 +_497="width: 8%; display:inline; font: "+this.logFont;
  3839 +_472.appendChild(doc.createTextNode("Filter"));
  3840 +_472.onclick=bind("buildAndApplyFilter",this);
  3841 +_472.style.cssText=_497;
  3842 +_467.appendChild(_472);
  3843 +_473.appendChild(doc.createTextNode("Load"));
  3844 +_473.onclick=_494;
  3845 +_473.style.cssText=_497;
  3846 +_467.appendChild(_473);
  3847 +_474.appendChild(doc.createTextNode("Clear"));
  3848 +_474.onclick=_491;
  3849 +_474.style.cssText=_497;
  3850 +_467.appendChild(_474);
  3851 +_475.appendChild(doc.createTextNode("Close"));
  3852 +_475.onclick=_492;
  3853 +_475.style.cssText=_497;
  3854 +_467.appendChild(_475);
  3855 +_476.style.cssText="overflow: auto; width: 100%";
  3856 +_477.style.cssText="width: 100%; height: "+(_460?"8em":"100%");
  3857 +_476.appendChild(_477);
  3858 +_467.appendChild(_476);
  3859 +this.buildAndApplyFilter();
  3860 +_494();
  3861 +if(_460){
  3862 +this.win=undefined;
  3863 +}else{
  3864 +this.win=win;
  3865 +}
  3866 +this.inline=_460;
  3867 +this.closePane=_492;
  3868 +this.closed=false;
  3869 +return this;
  3870 +};
  3871 +MochiKit.LoggingPane.LoggingPane.prototype={"logFont":"8pt Verdana,sans-serif","colorTable":{"ERROR":"red","FATAL":"darkred","WARNING":"blue","INFO":"black","DEBUG":"green"}};
  3872 +MochiKit.LoggingPane.EXPORT_OK=["LoggingPane"];
  3873 +MochiKit.LoggingPane.EXPORT=["createLoggingPane"];
  3874 +MochiKit.LoggingPane.__new__=function(){
  3875 +this.EXPORT_TAGS={":common":this.EXPORT,":all":MochiKit.Base.concat(this.EXPORT,this.EXPORT_OK)};
  3876 +MochiKit.Base.nameFunctions(this);
  3877 +MochiKit.LoggingPane._loggingPane=null;
  3878 +};
  3879 +MochiKit.LoggingPane.__new__();
  3880 +MochiKit.Base._exportSymbols(this,MochiKit.LoggingPane);
  3881 +if(typeof (dojo)!="undefined"){
  3882 +dojo.provide("MochiKit.Color");
  3883 +dojo.require("MochiKit.Base");
  3884 +dojo.require("MochiKit.DOM");
  3885 +dojo.require("MochiKit.Style");
  3886 +}
  3887 +if(typeof (JSAN)!="undefined"){
  3888 +JSAN.use("MochiKit.Base",[]);
  3889 +JSAN.use("MochiKit.DOM",[]);
  3890 +JSAN.use("MochiKit.Style",[]);
  3891 +}
  3892 +try{
  3893 +if(typeof (MochiKit.Base)=="undefined"){
  3894 +throw "";
  3895 +}
  3896 +}
  3897 +catch(e){
  3898 +throw "MochiKit.Color depends on MochiKit.Base";
  3899 +}
  3900 +try{
  3901 +if(typeof (MochiKit.Base)=="undefined"){
  3902 +throw "";
  3903 +}
  3904 +}
  3905 +catch(e){
  3906 +throw "MochiKit.Color depends on MochiKit.DOM";
  3907 +}
  3908 +try{
  3909 +if(typeof (MochiKit.Base)=="undefined"){
  3910 +throw "";
  3911 +}
  3912 +}
  3913 +catch(e){
  3914 +throw "MochiKit.Color depends on MochiKit.Style";
  3915 +}
  3916 +if(typeof (MochiKit.Color)=="undefined"){
  3917 +MochiKit.Color={};
  3918 +}
  3919 +MochiKit.Color.NAME="MochiKit.Color";
  3920 +MochiKit.Color.VERSION="1.4";
  3921 +MochiKit.Color.__repr__=function(){
  3922 +return "["+this.NAME+" "+this.VERSION+"]";
  3923 +};
  3924 +MochiKit.Color.toString=function(){
  3925 +return this.__repr__();
  3926 +};
  3927 +MochiKit.Color.Color=function(red,_499,blue,_501){
  3928 +if(typeof (_501)=="undefined"||_501===null){
  3929 +_501=1;
  3930 +}
  3931 +this.rgb={r:red,g:_499,b:blue,a:_501};
  3932 +};
  3933 +MochiKit.Color.Color.prototype={__class__:MochiKit.Color.Color,colorWithAlpha:function(_502){
  3934 +var rgb=this.rgb;
  3935 +var m=MochiKit.Color;
  3936 +return m.Color.fromRGB(rgb.r,rgb.g,rgb.b,_502);
  3937 +},colorWithHue:function(hue){
  3938 +var hsl=this.asHSL();
  3939 +hsl.h=hue;
  3940 +var m=MochiKit.Color;
  3941 +return m.Color.fromHSL(hsl);
  3942 +},colorWithSaturation:function(_506){
  3943 +var hsl=this.asHSL();
  3944 +hsl.s=_506;
  3945 +var m=MochiKit.Color;
  3946 +return m.Color.fromHSL(hsl);
  3947 +},colorWithLightness:function(_507){
  3948 +var hsl=this.asHSL();
  3949 +hsl.l=_507;
  3950 +var m=MochiKit.Color;
  3951 +return m.Color.fromHSL(hsl);
  3952 +},darkerColorWithLevel:function(_508){
  3953 +var hsl=this.asHSL();
  3954 +hsl.l=Math.max(hsl.l-_508,0);
  3955 +var m=MochiKit.Color;
  3956 +return m.Color.fromHSL(hsl);
  3957 +},lighterColorWithLevel:function(_509){
  3958 +var hsl=this.asHSL();
  3959 +hsl.l=Math.min(hsl.l+_509,1);
  3960 +var m=MochiKit.Color;
  3961 +return m.Color.fromHSL(hsl);
  3962 +},blendedColor:function(_510,_511){
  3963 +if(typeof (_511)=="undefined"||_511===null){
  3964 +_511=0.5;
  3965 +}
  3966 +var sf=1-_511;
  3967 +var s=this.rgb;
  3968 +var d=_510.rgb;
  3969 +var df=_511;
  3970 +return MochiKit.Color.Color.fromRGB((s.r*sf)+(d.r*df),(s.g*sf)+(d.g*df),(s.b*sf)+(d.b*df),(s.a*sf)+(d.a*df));
  3971 +},compareRGB:function(_514){
  3972 +var a=this.asRGB();
  3973 +var b=_514.asRGB();
  3974 +return MochiKit.Base.compare([a.r,a.g,a.b,a.a],[b.r,b.g,b.b,b.a]);
  3975 +},isLight:function(){
  3976 +return this.asHSL().b>0.5;
  3977 +},isDark:function(){
  3978 +return (!this.isLight());
  3979 +},toHSLString:function(){
  3980 +var c=this.asHSL();
  3981 +var ccc=MochiKit.Color.clampColorComponent;
  3982 +var rval=this._hslString;
  3983 +if(!rval){
  3984 +var mid=(ccc(c.h,360).toFixed(0)+","+ccc(c.s,100).toPrecision(4)+"%"+","+ccc(c.l,100).toPrecision(4)+"%");
  3985 +var a=c.a;
  3986 +if(a>=1){
  3987 +a=1;
  3988 +rval="hsl("+mid+")";
  3989 +}else{
  3990 +if(a<=0){
  3991 +a=0;
  3992 +}
  3993 +rval="hsla("+mid+","+a+")";
  3994 +}
  3995 +this._hslString=rval;
  3996 +}
  3997 +return rval;
  3998 +},toRGBString:function(){
  3999 +var c=this.rgb;
  4000 +var ccc=MochiKit.Color.clampColorComponent;
  4001 +var rval=this._rgbString;
  4002 +if(!rval){
  4003 +var mid=(ccc(c.r,255).toFixed(0)+","+ccc(c.g,255).toFixed(0)+","+ccc(c.b,255).toFixed(0));
  4004 +if(c.a!=1){
  4005 +rval="rgba("+mid+","+c.a+")";
  4006 +}else{
  4007 +rval="rgb("+mid+")";
  4008 +}
  4009 +this._rgbString=rval;
  4010 +}
  4011 +return rval;
  4012 +},asRGB:function(){
  4013 +return MochiKit.Base.clone(this.rgb);
  4014 +},toHexString:function(){
  4015 +var m=MochiKit.Color;
  4016 +var c=this.rgb;
  4017 +var ccc=MochiKit.Color.clampColorComponent;
  4018 +var rval=this._hexString;
  4019 +if(!rval){
  4020 +rval=("#"+m.toColorPart(ccc(c.r,255))+m.toColorPart(ccc(c.g,255))+m.toColorPart(ccc(c.b,255)));
  4021 +this._hexString=rval;
  4022 +}
  4023 +return rval;
  4024 +},asHSV:function(){
  4025 +var hsv=this.hsv;
  4026 +var c=this.rgb;
  4027 +if(typeof (hsv)=="undefined"||hsv===null){
  4028 +hsv=MochiKit.Color.rgbToHSV(this.rgb);
  4029 +this.hsv=hsv;
  4030 +}
  4031 +return MochiKit.Base.clone(hsv);
  4032 +},asHSL:function(){
  4033 +var hsl=this.hsl;
  4034 +var c=this.rgb;
  4035 +if(typeof (hsl)=="undefined"||hsl===null){
  4036 +hsl=MochiKit.Color.rgbToHSL(this.rgb);
  4037 +this.hsl=hsl;
  4038 +}
  4039 +return MochiKit.Base.clone(hsl);
  4040 +},toString:function(){
  4041 +return this.toRGBString();
  4042 +},repr:function(){
  4043 +var c=this.rgb;
  4044 +var col=[c.r,c.g,c.b,c.a];
  4045 +return this.__class__.NAME+"("+col.join(", ")+")";
  4046 +}};
  4047 +MochiKit.Base.update(MochiKit.Color.Color,{fromRGB:function(red,_519,blue,_520){
  4048 +var _521=MochiKit.Color.Color;
  4049 +if(arguments.length==1){
  4050 +var rgb=red;
  4051 +red=rgb.r;
  4052 +_519=rgb.g;
  4053 +blue=rgb.b;
  4054 +if(typeof (rgb.a)=="undefined"){
  4055 +_520=undefined;
  4056 +}else{
  4057 +_520=rgb.a;
  4058 +}
  4059 +}
  4060 +return new _521(red,_519,blue,_520);
  4061 +},fromHSL:function(hue,_522,_523,_524){
  4062 +var m=MochiKit.Color;
  4063 +return m.Color.fromRGB(m.hslToRGB.apply(m,arguments));
  4064 +},fromHSV:function(hue,_525,_526,_527){
  4065 +var m=MochiKit.Color;
  4066 +return m.Color.fromRGB(m.hsvToRGB.apply(m,arguments));
  4067 +},fromName:function(name){
  4068 +var _528=MochiKit.Color.Color;
  4069 +if(name.charAt(0)=="\""){
  4070 +name=name.substr(1,name.length-2);
  4071 +}
  4072 +var _529=_528._namedColors[name.toLowerCase()];
  4073 +if(typeof (_529)=="string"){
  4074 +return _528.fromHexString(_529);
  4075 +}else{
  4076 +if(name=="transparent"){
  4077 +return _528.transparentColor();
  4078 +}
  4079 +}
  4080 +return null;
  4081 +},fromString:function(_530){
  4082 +var self=MochiKit.Color.Color;
  4083 +var _531=_530.substr(0,3);
  4084 +if(_531=="rgb"){
  4085 +return self.fromRGBString(_530);
  4086 +}else{
  4087 +if(_531=="hsl"){
  4088 +return self.fromHSLString(_530);
  4089 +}else{
  4090 +if(_530.charAt(0)=="#"){
  4091 +return self.fromHexString(_530);
  4092 +}
  4093 +}
  4094 +}
  4095 +return self.fromName(_530);
  4096 +},fromHexString:function(_532){
  4097 +if(_532.charAt(0)=="#"){
  4098 +_532=_532.substring(1);
  4099 +}
  4100 +var _533=[];
  4101 +var i,hex;
  4102 +if(_532.length==3){
  4103 +for(i=0;i<3;i++){
  4104 +hex=_532.substr(i,1);
  4105 +_533.push(parseInt(hex+hex,16)/255);
  4106 +}
  4107 +}else{
  4108 +for(i=0;i<6;i+=2){
  4109 +hex=_532.substr(i,2);
  4110 +_533.push(parseInt(hex,16)/255);
  4111 +}
  4112 +}
  4113 +var _534=MochiKit.Color.Color;
  4114 +return _534.fromRGB.apply(_534,_533);
  4115 +},_fromColorString:function(pre,_536,_537,_538){
  4116 +if(_538.indexOf(pre)===0){
  4117 +_538=_538.substring(_538.indexOf("(",3)+1,_538.length-1);
  4118 +}
  4119 +var _539=_538.split(/\s*,\s*/);
  4120 +var _540=[];
  4121 +for(var i=0;i<_539.length;i++){
  4122 +var c=_539[i];
  4123 +var val;
  4124 +var _541=c.substring(c.length-3);
  4125 +if(c.charAt(c.length-1)=="%"){
  4126 +val=0.01*parseFloat(c.substring(0,c.length-1));
  4127 +}else{
  4128 +if(_541=="deg"){
  4129 +val=parseFloat(c)/360;
  4130 +}else{
  4131 +if(_541=="rad"){
  4132 +val=parseFloat(c)/(Math.PI*2);
  4133 +}else{
  4134 +val=_537[i]*parseFloat(c);
  4135 +}
  4136 +}
  4137 +}
  4138 +_540.push(val);
  4139 +}
  4140 +return this[_536].apply(this,_540);
  4141 +},fromComputedStyle:function(elem,_542){
  4142 +var d=MochiKit.DOM;
  4143 +var cls=MochiKit.Color.Color;
  4144 +for(elem=d.getElement(elem);elem;elem=elem.parentNode){
  4145 +var _543=MochiKit.Style.computedStyle.apply(d,arguments);
  4146 +if(!_543){
  4147 +continue;
  4148 +}
  4149 +var _544=cls.fromString(_543);
  4150 +if(!_544){
  4151 +break;
  4152 +}
  4153 +if(_544.asRGB().a>0){
  4154 +return _544;
  4155 +}
  4156 +}
  4157 +return null;
  4158 +},fromBackground:function(elem){
  4159 +var cls=MochiKit.Color.Color;
  4160 +return cls.fromComputedStyle(elem,"backgroundColor","background-color")||cls.whiteColor();
  4161 +},fromText:function(elem){
  4162 +var cls=MochiKit.Color.Color;
  4163 +return cls.fromComputedStyle(elem,"color","color")||cls.blackColor();
  4164 +},namedColors:function(){
  4165 +return MochiKit.Base.clone(MochiKit.Color.Color._namedColors);
  4166 +}});
  4167 +MochiKit.Base.update(MochiKit.Color,{clampColorComponent:function(v,_545){
  4168 +v*=_545;
  4169 +if(v<0){
  4170 +return 0;
  4171 +}else{
  4172 +if(v>_545){
  4173 +return _545;
  4174 +}else{
  4175 +return v;
  4176 +}
  4177 +}
  4178 +},_hslValue:function(n1,n2,hue){
  4179 +if(hue>6){
  4180 +hue-=6;
  4181 +}else{
  4182 +if(hue<0){
  4183 +hue+=6;
  4184 +}
  4185 +}
  4186 +var val;
  4187 +if(hue<1){
  4188 +val=n1+(n2-n1)*hue;
  4189 +}else{
  4190 +if(hue<3){
  4191 +val=n2;
  4192 +}else{
  4193 +if(hue<4){
  4194 +val=n1+(n2-n1)*(4-hue);
  4195 +}else{
  4196 +val=n1;
  4197 +}
  4198 +}
  4199 +}
  4200 +return val;
  4201 +},hsvToRGB:function(hue,_548,_549,_550){
  4202 +if(arguments.length==1){
  4203 +var hsv=hue;
  4204 +hue=hsv.h;
  4205 +_548=hsv.s;
  4206 +_549=hsv.v;
  4207 +_550=hsv.a;
  4208 +}
  4209 +var red;
  4210 +var _551;
  4211 +var blue;
  4212 +if(_548===0){
  4213 +red=0;
  4214 +_551=0;
  4215 +blue=0;
  4216 +}else{
  4217 +var i=Math.floor(hue*6);
  4218 +var f=(hue*6)-i;
  4219 +var p=_549*(1-_548);
  4220 +var q=_549*(1-(_548*f));
  4221 +var t=_549*(1-(_548*(1-f)));
  4222 +switch(i){
  4223 +case 1:
  4224 +red=q;
  4225 +_551=_549;
  4226 +blue=p;
  4227 +break;
  4228 +case 2:
  4229 +red=p;
  4230 +_551=_549;
  4231 +blue=t;
  4232 +break;
  4233 +case 3:
  4234 +red=p;
  4235 +_551=q;
  4236 +blue=_549;
  4237 +break;
  4238 +case 4:
  4239 +red=t;
  4240 +_551=p;
  4241 +blue=_549;
  4242 +break;
  4243 +case 5:
  4244 +red=_549;
  4245 +_551=p;
  4246 +blue=q;
  4247 +break;
  4248 +case 6:
  4249 +case 0:
  4250 +red=_549;
  4251 +_551=t;
  4252 +blue=p;
  4253 +break;
  4254 +}
  4255 +}
  4256 +return {r:red,g:_551,b:blue,a:_550};
  4257 +},hslToRGB:function(hue,_553,_554,_555){
  4258 +if(arguments.length==1){
  4259 +var hsl=hue;
  4260 +hue=hsl.h;
  4261 +_553=hsl.s;
  4262 +_554=hsl.l;
  4263 +_555=hsl.a;
  4264 +}
  4265 +var red;
  4266 +var _556;
  4267 +var blue;
  4268 +if(_553===0){
  4269 +red=_554;
  4270 +_556=_554;
  4271 +blue=_554;
  4272 +}else{
  4273 +var m2;
  4274 +if(_554<=0.5){
  4275 +m2=_554*(1+_553);
  4276 +}else{
  4277 +m2=_554+_553-(_554*_553);
  4278 +}
  4279 +var m1=(2*_554)-m2;
  4280 +var f=MochiKit.Color._hslValue;
  4281 +var h6=hue*6;
  4282 +red=f(m1,m2,h6+2);
  4283 +_556=f(m1,m2,h6);
  4284 +blue=f(m1,m2,h6-2);
  4285 +}
  4286 +return {r:red,g:_556,b:blue,a:_555};
  4287 +},rgbToHSV:function(red,_560,blue,_561){
  4288 +if(arguments.length==1){
  4289 +var rgb=red;
  4290 +red=rgb.r;
  4291 +_560=rgb.g;
  4292 +blue=rgb.b;
  4293 +_561=rgb.a;
  4294 +}
  4295 +var max=Math.max(Math.max(red,_560),blue);
  4296 +var min=Math.min(Math.min(red,_560),blue);
  4297 +var hue;
  4298 +var _564;
  4299 +var _565=max;
  4300 +if(min==max){
  4301 +hue=0;
  4302 +_564=0;
  4303 +}else{
  4304 +var _566=(max-min);
  4305 +_564=_566/max;
  4306 +if(red==max){
  4307 +hue=(_560-blue)/_566;
  4308 +}else{
  4309 +if(_560==max){
  4310 +hue=2+((blue-red)/_566);
  4311 +}else{
  4312 +hue=4+((red-_560)/_566);
  4313 +}
  4314 +}
  4315 +hue/=6;
  4316 +if(hue<0){
  4317 +hue+=1;
  4318 +}
  4319 +if(hue>1){
  4320 +hue-=1;
  4321 +}
  4322 +}
  4323 +return {h:hue,s:_564,v:_565,a:_561};
  4324 +},rgbToHSL:function(red,_567,blue,_568){
  4325 +if(arguments.length==1){
  4326 +var rgb=red;
  4327 +red=rgb.r;
  4328 +_567=rgb.g;
  4329 +blue=rgb.b;
  4330 +_568=rgb.a;
  4331 +}
  4332 +var max=Math.max(red,Math.max(_567,blue));
  4333 +var min=Math.min(red,Math.min(_567,blue));
  4334 +var hue;
  4335 +var _569;
  4336 +var _570=(max+min)/2;
  4337 +var _571=max-min;
  4338 +if(_571===0){
  4339 +hue=0;
  4340 +_569=0;
  4341 +}else{
  4342 +if(_570<=0.5){
  4343 +_569=_571/(max+min);
  4344 +}else{
  4345 +_569=_571/(2-max-min);
  4346 +}
  4347 +if(red==max){
  4348 +hue=(_567-blue)/_571;
  4349 +}else{
  4350 +if(_567==max){
  4351 +hue=2+((blue-red)/_571);
  4352 +}else{
  4353 +hue=4+((red-_567)/_571);
  4354 +}
  4355 +}
  4356 +hue/=6;
  4357 +if(hue<0){
  4358 +hue+=1;
  4359 +}
  4360 +if(hue>1){
  4361 +hue-=1;
  4362 +}
  4363 +}
  4364 +return {h:hue,s:_569,l:_570,a:_568};
  4365 +},toColorPart:function(num){
  4366 +num=Math.round(num);
  4367 +var _572=num.toString(16);
  4368 +if(num<16){
  4369 +return "0"+_572;
  4370 +}
  4371 +return _572;
  4372 +},__new__:function(){
  4373 +var m=MochiKit.Base;
  4374 +this.Color.fromRGBString=m.bind(this.Color._fromColorString,this.Color,"rgb","fromRGB",[1/255,1/255,1/255,1]);
  4375 +this.Color.fromHSLString=m.bind(this.Color._fromColorString,this.Color,"hsl","fromHSL",[1/360,0.01,0.01,1]);
  4376 +var _573=1/3;
  4377 +var _574={black:[0,0,0],blue:[0,0,1],brown:[0.6,0.4,0.2],cyan:[0,1,1],darkGray:[_573,_573,_573],gray:[0.5,0.5,0.5],green:[0,1,0],lightGray:[2*_573,2*_573,2*_573],magenta:[1,0,1],orange:[1,0.5,0],purple:[0.5,0,0.5],red:[1,0,0],transparent:[0,0,0,0],white:[1,1,1],yellow:[1,1,0]};
  4378 +var _575=function(name,r,g,b,a){
  4379 +var rval=this.fromRGB(r,g,b,a);
  4380 +this[name]=function(){
  4381 +return rval;
  4382 +};
  4383 +return rval;
  4384 +};
  4385 +for(var k in _574){
  4386 +var name=k+"Color";
  4387 +var _577=m.concat([_575,this.Color,name],_574[k]);
  4388 +this.Color[name]=m.bind.apply(null,_577);
  4389 +}
  4390 +var _578=function(){
  4391 +for(var i=0;i<arguments.length;i++){
  4392 +if(!(arguments[i] instanceof Color)){
  4393 +return false;
  4394 +}
  4395 +}
  4396 +return true;
  4397 +};
  4398 +var _579=function(a,b){
  4399 +return a.compareRGB(b);
  4400 +};
  4401 +m.nameFunctions(this);
  4402 +m.registerComparator(this.Color.NAME,_578,_579);
  4403 +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
  4404 +}});
  4405 +MochiKit.Color.EXPORT=["Color"];
  4406 +MochiKit.Color.EXPORT_OK=["clampColorComponent","rgbToHSL","hslToRGB","rgbToHSV","hsvToRGB","toColorPart"];
  4407 +MochiKit.Color.__new__();
  4408 +MochiKit.Base._exportSymbols(this,MochiKit.Color);
  4409 +MochiKit.Color.Color._namedColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};
  4410 +if(typeof (dojo)!="undefined"){
  4411 +dojo.provide("MochiKit.Signal");
  4412 +dojo.require("MochiKit.Base");
  4413 +dojo.require("MochiKit.DOM");
  4414 +dojo.require("MochiKit.Style");
  4415 +}
  4416 +if(typeof (JSAN)!="undefined"){
  4417 +JSAN.use("MochiKit.Base",[]);
  4418 +JSAN.use("MochiKit.DOM",[]);
  4419 +JSAN.use("MochiKit.Style",[]);
  4420 +}
  4421 +try{
  4422 +if(typeof (MochiKit.Base)=="undefined"){
  4423 +throw "";
  4424 +}
  4425 +}
  4426 +catch(e){
  4427 +throw "MochiKit.Signal depends on MochiKit.Base!";
  4428 +}
  4429 +try{
  4430 +if(typeof (MochiKit.DOM)=="undefined"){
  4431 +throw "";
  4432 +}
  4433 +}
  4434 +catch(e){
  4435 +throw "MochiKit.Signal depends on MochiKit.DOM!";
  4436 +}
  4437 +try{
  4438 +if(typeof (MochiKit.Style)=="undefined"){
  4439 +throw "";
  4440 +}
  4441 +}
  4442 +catch(e){
  4443 +throw "MochiKit.Signal depends on MochiKit.Style!";
  4444 +}
  4445 +if(typeof (MochiKit.Signal)=="undefined"){
  4446 +MochiKit.Signal={};
  4447 +}
  4448 +MochiKit.Signal.NAME="MochiKit.Signal";
  4449 +MochiKit.Signal.VERSION="1.4";
  4450 +MochiKit.Signal._observers=[];
  4451 +MochiKit.Signal.Event=function(src,e){
  4452 +this._event=e||window.event;
  4453 +this._src=src;
  4454 +};
  4455 +MochiKit.Base.update(MochiKit.Signal.Event.prototype,{__repr__:function(){
  4456 +var repr=MochiKit.Base.repr;
  4457 +var str="{event(): "+repr(this.event())+", src(): "+repr(this.src())+", type(): "+repr(this.type())+", target(): "+repr(this.target())+", modifier(): "+"{alt: "+repr(this.modifier().alt)+", ctrl: "+repr(this.modifier().ctrl)+", meta: "+repr(this.modifier().meta)+", shift: "+repr(this.modifier().shift)+", any: "+repr(this.modifier().any)+"}";
  4458 +if(this.type()&&this.type().indexOf("key")===0){
  4459 +str+=", key(): {code: "+repr(this.key().code)+", string: "+repr(this.key().string)+"}";
  4460 +}
  4461 +if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
  4462 +str+=", mouse(): {page: "+repr(this.mouse().page)+", client: "+repr(this.mouse().client);
  4463 +if(this.type()!="mousemove"){
  4464 +str+=", button: {left: "+repr(this.mouse().button.left)+", middle: "+repr(this.mouse().button.middle)+", right: "+repr(this.mouse().button.right)+"}}";
  4465 +}else{
  4466 +str+="}";
  4467 +}
  4468 +}
  4469 +if(this.type()=="mouseover"||this.type()=="mouseout"){
  4470 +str+=", relatedTarget(): "+repr(this.relatedTarget());
  4471 +}
  4472 +str+="}";
  4473 +return str;
  4474 +},toString:function(){
  4475 +return this.__repr__();
  4476 +},src:function(){
  4477 +return this._src;
  4478 +},event:function(){
  4479 +return this._event;
  4480 +},type:function(){
  4481 +return this._event.type||undefined;
  4482 +},target:function(){
  4483 +return this._event.target||this._event.srcElement;
  4484 +},_relatedTarget:null,relatedTarget:function(){
  4485 +if(this._relatedTarget!==null){
  4486 +return this._relatedTarget;
  4487 +}
  4488 +var elem=null;
  4489 +if(this.type()=="mouseover"){
  4490 +elem=(this._event.relatedTarget||this._event.fromElement);
  4491 +}else{
  4492 +if(this.type()=="mouseout"){
  4493 +elem=(this._event.relatedTarget||this._event.toElement);
  4494 +}
  4495 +}
  4496 +if(elem!==null){
  4497 +this._relatedTarget=elem;
  4498 +return elem;
  4499 +}
  4500 +return undefined;
  4501 +},_modifier:null,modifier:function(){
  4502 +if(this._modifier!==null){
  4503 +return this._modifier;
  4504 +}
  4505 +var m={};
  4506 +m.alt=this._event.altKey;
  4507 +m.ctrl=this._event.ctrlKey;
  4508 +m.meta=this._event.metaKey||false;
  4509 +m.shift=this._event.shiftKey;
  4510 +m.any=m.alt||m.ctrl||m.shift||m.meta;
  4511 +this._modifier=m;
  4512 +return m;
  4513 +},_key:null,key:function(){
  4514 +if(this._key!==null){
  4515 +return this._key;
  4516 +}
  4517 +var k={};
  4518 +if(this.type()&&this.type().indexOf("key")===0){
  4519 +if(this.type()=="keydown"||this.type()=="keyup"){
  4520 +k.code=this._event.keyCode;
  4521 +k.string=(MochiKit.Signal._specialKeys[k.code]||"KEY_UNKNOWN");
  4522 +this._key=k;
  4523 +return k;
  4524 +}else{
  4525 +if(this.type()=="keypress"){
  4526 +k.code=0;
  4527 +k.string="";
  4528 +if(typeof (this._event.charCode)!="undefined"&&this._event.charCode!==0&&!MochiKit.Signal._specialMacKeys[this._event.charCode]){
  4529 +k.code=this._event.charCode;
  4530 +k.string=String.fromCharCode(k.code);
  4531 +}else{
  4532 +if(this._event.keyCode&&typeof (this._event.charCode)=="undefined"){
  4533 +k.code=this._event.keyCode;
  4534 +k.string=String.fromCharCode(k.code);
  4535 +}
  4536 +}
  4537 +this._key=k;
  4538 +return k;
  4539 +}
  4540 +}
  4541 +}
  4542 +return undefined;
  4543 +},_mouse:null,mouse:function(){
  4544 +if(this._mouse!==null){
  4545 +return this._mouse;
  4546 +}
  4547 +var m={};
  4548 +var e=this._event;
  4549 +if(this.type()&&(this.type().indexOf("mouse")===0||this.type().indexOf("click")!=-1||this.type()=="contextmenu")){
  4550 +m.client=new MochiKit.Style.Coordinates(0,0);
  4551 +if(e.clientX||e.clientY){
  4552 +m.client.x=(!e.clientX||e.clientX<0)?0:e.clientX;
  4553 +m.client.y=(!e.clientY||e.clientY<0)?0:e.clientY;
  4554 +}
  4555 +m.page=new MochiKit.Style.Coordinates(0,0);
  4556 +if(e.pageX||e.pageY){
  4557 +m.page.x=(!e.pageX||e.pageX<0)?0:e.pageX;
  4558 +m.page.y=(!e.pageY||e.pageY<0)?0:e.pageY;
  4559 +}else{
  4560 +var de=MochiKit.DOM._document.documentElement;
  4561 +var b=MochiKit.DOM._document.body;
  4562 +m.page.x=e.clientX+(de.scrollLeft||b.scrollLeft)-(de.clientLeft||0);
  4563 +m.page.y=e.clientY+(de.scrollTop||b.scrollTop)-(de.clientTop||0);
  4564 +}
  4565 +if(this.type()!="mousemove"){
  4566 +m.button={};
  4567 +m.button.left=false;
  4568 +m.button.right=false;
  4569 +m.button.middle=false;
  4570 +if(e.which){
  4571 +m.button.left=(e.which==1);
  4572 +m.button.middle=(e.which==2);
  4573 +m.button.right=(e.which==3);
  4574 +}else{
  4575 +m.button.left=!!(e.button&1);
  4576 +m.button.right=!!(e.button&2);
  4577 +m.button.middle=!!(e.button&4);
  4578 +}
  4579 +}
  4580 +this._mouse=m;
  4581 +return m;
  4582 +}
  4583 +return undefined;
  4584 +},stop:function(){
  4585 +this.stopPropagation();
  4586 +this.preventDefault();
  4587 +},stopPropagation:function(){
  4588 +if(this._event.stopPropagation){
  4589 +this._event.stopPropagation();
  4590 +}else{
  4591 +this._event.cancelBubble=true;
  4592 +}
  4593 +},preventDefault:function(){
  4594 +if(this._event.preventDefault){
  4595 +this._event.preventDefault();
  4596 +}else{
  4597 +if(this._confirmUnload===null){
  4598 +this._event.returnValue=false;
  4599 +}
  4600 +}
  4601 +},_confirmUnload:null,confirmUnload:function(msg){
  4602 +if(this.type()=="beforeunload"){
  4603 +this._confirmUnload=msg;
  4604 +this._event.returnValue=msg;
  4605 +}
  4606 +}});
  4607 +MochiKit.Signal._specialMacKeys={3:"KEY_ENTER",63289:"KEY_NUM_PAD_CLEAR",63276:"KEY_PAGE_UP",63277:"KEY_PAGE_DOWN",63275:"KEY_END",63273:"KEY_HOME",63234:"KEY_ARROW_LEFT",63232:"KEY_ARROW_UP",63235:"KEY_ARROW_RIGHT",63233:"KEY_ARROW_DOWN",63302:"KEY_INSERT",63272:"KEY_DELETE"};
  4608 +(function(){
  4609 +var _580=MochiKit.Signal._specialMacKeys;
  4610 +for(i=63236;i<=63242;i++){
  4611 +_580[i]="KEY_F"+(i-63236+1);
  4612 +}
  4613 +})();
  4614 +MochiKit.Signal._specialKeys={8:"KEY_BACKSPACE",9:"KEY_TAB",12:"KEY_NUM_PAD_CLEAR",13:"KEY_ENTER",16:"KEY_SHIFT",17:"KEY_CTRL",18:"KEY_ALT",19:"KEY_PAUSE",20:"KEY_CAPS_LOCK",27:"KEY_ESCAPE",32:"KEY_SPACEBAR",33:"KEY_PAGE_UP",34:"KEY_PAGE_DOWN",35:"KEY_END",36:"KEY_HOME",37:"KEY_ARROW_LEFT",38:"KEY_ARROW_UP",39:"KEY_ARROW_RIGHT",40:"KEY_ARROW_DOWN",44:"KEY_PRINT_SCREEN",45:"KEY_INSERT",46:"KEY_DELETE",59:"KEY_SEMICOLON",91:"KEY_WINDOWS_LEFT",92:"KEY_WINDOWS_RIGHT",93:"KEY_SELECT",106:"KEY_NUM_PAD_ASTERISK",107:"KEY_NUM_PAD_PLUS_SIGN",109:"KEY_NUM_PAD_HYPHEN-MINUS",110:"KEY_NUM_PAD_FULL_STOP",111:"KEY_NUM_PAD_SOLIDUS",144:"KEY_NUM_LOCK",145:"KEY_SCROLL_LOCK",186:"KEY_SEMICOLON",187:"KEY_EQUALS_SIGN",188:"KEY_COMMA",189:"KEY_HYPHEN-MINUS",190:"KEY_FULL_STOP",191:"KEY_SOLIDUS",192:"KEY_GRAVE_ACCENT",219:"KEY_LEFT_SQUARE_BRACKET",220:"KEY_REVERSE_SOLIDUS",221:"KEY_RIGHT_SQUARE_BRACKET",222:"KEY_APOSTROPHE"};
  4615 +(function(){
  4616 +var _581=MochiKit.Signal._specialKeys;
  4617 +for(var i=48;i<=57;i++){
  4618 +_581[i]="KEY_"+(i-48);
  4619 +}
  4620 +for(i=65;i<=90;i++){
  4621 +_581[i]="KEY_"+String.fromCharCode(i);
  4622 +}
  4623 +for(i=96;i<=105;i++){
  4624 +_581[i]="KEY_NUM_PAD_"+(i-96);
  4625 +}
  4626 +for(i=112;i<=123;i++){
  4627 +_581[i]="KEY_F"+(i-112+1);
  4628 +}
  4629 +})();
  4630 +MochiKit.Base.update(MochiKit.Signal,{__repr__:function(){
  4631 +return "["+this.NAME+" "+this.VERSION+"]";
  4632 +},toString:function(){
  4633 +return this.__repr__();
  4634 +},_unloadCache:function(){
  4635 +var self=MochiKit.Signal;
  4636 +var _582=self._observers;
  4637 +for(var i=0;i<_582.length;i++){
  4638 +self._disconnect(_582[i]);
  4639 +}
  4640 +delete self._observers;
  4641 +try{
  4642 +window.onload=undefined;
  4643 +}
  4644 +catch(e){
  4645 +}
  4646 +try{
  4647 +window.onunload=undefined;
  4648 +}
  4649 +catch(e){
  4650 +}
  4651 +},_listener:function(src,func,obj,_583){
  4652 +var self=MochiKit.Signal;
  4653 +var E=self.Event;
  4654 +if(!_583){
  4655 +return MochiKit.Base.bind(func,obj);
  4656 +}
  4657 +obj=obj||src;
  4658 +if(typeof (func)=="string"){
  4659 +return function(_585){
  4660 +obj[func].apply(obj,[new E(src,_585)]);
  4661 +};
  4662 +}else{
  4663 +return function(_586){
  4664 +func.apply(obj,[new E(src,_586)]);
  4665 +};
  4666 +}
  4667 +},_browserAlreadyHasMouseEnterAndLeave:function(){
  4668 +return /MSIE/.test(navigator.userAgent);
  4669 +},_mouseEnterListener:function(src,sig,func,obj){
  4670 +var E=MochiKit.Signal.Event;
  4671 +return function(_588){
  4672 +var e=new E(src,_588);
  4673 +try{
  4674 +e.relatedTarget().nodeName;
  4675 +}
  4676 +catch(err){
  4677 +return;
  4678 +}
  4679 +e.stop();
  4680 +if(MochiKit.DOM.isChildNode(e.relatedTarget(),src)){
  4681 +return;
  4682 +}
  4683 +e.type=function(){
  4684 +return sig;
  4685 +};
  4686 +if(typeof (func)=="string"){
  4687 +return obj[func].apply(obj,[e]);
  4688 +}else{
  4689 +return func.apply(obj,[e]);
  4690 +}
  4691 +};
  4692 +},connect:function(src,sig,_589,_590){
  4693 +src=MochiKit.DOM.getElement(src);
  4694 +var self=MochiKit.Signal;
  4695 +if(typeof (sig)!="string"){
  4696 +throw new Error("'sig' must be a string");
  4697 +}
  4698 +var obj=null;
  4699 +var func=null;
  4700 +if(typeof (_590)!="undefined"){
  4701 +obj=_589;
  4702 +func=_590;
  4703 +if(typeof (_590)=="string"){
  4704 +if(typeof (_589[_590])!="function"){
  4705 +throw new Error("'funcOrStr' must be a function on 'objOrFunc'");
  4706 +}
  4707 +}else{
  4708 +if(typeof (_590)!="function"){
  4709 +throw new Error("'funcOrStr' must be a function or string");
  4710 +}
  4711 +}
  4712 +}else{
  4713 +if(typeof (_589)!="function"){
  4714 +throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given");
  4715 +}else{
  4716 +func=_589;
  4717 +}
  4718 +}
  4719 +if(typeof (obj)=="undefined"||obj===null){
  4720 +obj=src;
  4721 +}
  4722 +var _591=!!(src.addEventListener||src.attachEvent);
  4723 +if(_591&&(sig==="onmouseenter"||sig==="onmouseleave")&&!self._browserAlreadyHasMouseEnterAndLeave()){
  4724 +var _592=self._mouseEnterListener(src,sig.substr(2),func,obj);
  4725 +if(sig==="onmouseenter"){
  4726 +sig="onmouseover";
  4727 +}else{
  4728 +sig="onmouseout";
  4729 +}
  4730 +}else{
  4731 +var _592=self._listener(src,func,obj,_591);
  4732 +}
  4733 +if(src.addEventListener){
  4734 +src.addEventListener(sig.substr(2),_592,false);
  4735 +}else{
  4736 +if(src.attachEvent){
  4737 +src.attachEvent(sig,_592);
  4738 +}
  4739 +}
  4740 +var _593=[src,sig,_592,_591,_589,_590,true];
  4741 +self._observers.push(_593);
  4742 +return _593;
  4743 +},_disconnect:function(_594){
  4744 +if(!_594[3]){
  4745 +return;
  4746 +}
  4747 +if(!_594[6]){
  4748 +return;
  4749 +}
  4750 +_594[6]=false;
  4751 +var src=_594[0];
  4752 +var sig=_594[1];
  4753 +var _595=_594[2];
  4754 +if(src.removeEventListener){
  4755 +src.removeEventListener(sig.substr(2),_595,false);
  4756 +}else{
  4757 +if(src.detachEvent){
  4758 +src.detachEvent(sig,_595);
  4759 +}else{
  4760 +throw new Error("'src' must be a DOM element");
  4761 +}
  4762 +}
  4763 +},disconnect:function(_596){
  4764 +var self=MochiKit.Signal;
  4765 +var _597=self._observers;
  4766 +var m=MochiKit.Base;
  4767 +if(arguments.length>1){
  4768 +var src=MochiKit.DOM.getElement(arguments[0]);
  4769 +var sig=arguments[1];
  4770 +var obj=arguments[2];
  4771 +var func=arguments[3];
  4772 +for(var i=_597.length-1;i>=0;i--){
  4773 +var o=_597[i];
  4774 +if(o[0]===src&&o[1]===sig&&o[4]===obj&&o[5]===func){
  4775 +self._disconnect(o);
  4776 +if(!self._lock){
  4777 +_597.splice(i,1);
  4778 +}else{
  4779 +self._dirty=true;
  4780 +}
  4781 +return true;
  4782 +}
  4783 +}
  4784 +}else{
  4785 +var idx=m.findIdentical(_597,_596);
  4786 +if(idx>=0){
  4787 +self._disconnect(_596);
  4788 +if(!self._lock){
  4789 +_597.splice(idx,1);
  4790 +}else{
  4791 +self._dirty=true;
  4792 +}
  4793 +return true;
  4794 +}
  4795 +}
  4796 +return false;
  4797 +},disconnectAll:function(src,sig){
  4798 +src=MochiKit.DOM.getElement(src);
  4799 +var m=MochiKit.Base;
  4800 +var _598=m.flattenArguments(m.extend(null,arguments,1));
  4801 +var self=MochiKit.Signal;
  4802 +var _599=self._disconnect;
  4803 +var _600=self._observers;
  4804 +var i,ident;
  4805 +var _601=self._lock;
  4806 +var _602=self._dirty;
  4807 +if(_598.length===0){
  4808 +for(i=_600.length-1;i>=0;i--){
  4809 +ident=_600[i];
  4810 +if(ident[0]===src){
  4811 +_599(ident);
  4812 +if(!_601){
  4813 +_600.splice(i,1);
  4814 +}else{
  4815 +_602=true;
  4816 +}
  4817 +}
  4818 +}
  4819 +}else{
  4820 +var sigs={};
  4821 +for(i=0;i<_598.length;i++){
  4822 +sigs[_598[i]]=true;
  4823 +}
  4824 +for(i=_600.length-1;i>=0;i--){
  4825 +ident=_600[i];
  4826 +if(ident[0]===src&&ident[1] in sigs){
  4827 +_599(ident);
  4828 +if(!_601){
  4829 +_600.splice(i,1);
  4830 +}else{
  4831 +_602=true;
  4832 +}
  4833 +}
  4834 +}
  4835 +}
  4836 +self._dirty=_602;
  4837 +},signal:function(src,sig){
  4838 +var self=MochiKit.Signal;
  4839 +var _604=self._observers;
  4840 +src=MochiKit.DOM.getElement(src);
  4841 +var args=MochiKit.Base.extend(null,arguments,2);
  4842 +var _605=[];
  4843 +self._lock=true;
  4844 +for(var i=0;i<_604.length;i++){
  4845 +var _606=_604[i];
  4846 +if(_606[0]===src&&_606[1]===sig){
  4847 +try{
  4848 +_606[2].apply(src,args);
  4849 +}
  4850 +catch(e){
  4851 +_605.push(e);
  4852 +}
  4853 +}
  4854 +}
  4855 +self._lock=false;
  4856 +if(self._dirty){
  4857 +self._dirty=false;
  4858 +for(var i=_604.length-1;i>=0;i--){
  4859 +if(!_604[i][6]){
  4860 +_604.splice(i,1);
  4861 +}
  4862 +}
  4863 +}
  4864 +if(_605.length==1){
  4865 +throw _605[0];
  4866 +}else{
  4867 +if(_605.length>1){
  4868 +var e=new Error("Multiple errors thrown in handling 'sig', see errors property");
  4869 +e.errors=_605;
  4870 +throw e;
  4871 +}
  4872 +}
  4873 +}});
  4874 +MochiKit.Signal.EXPORT_OK=[];
  4875 +MochiKit.Signal.EXPORT=["connect","disconnect","signal","disconnectAll"];
  4876 +MochiKit.Signal.__new__=function(win){
  4877 +var m=MochiKit.Base;
  4878 +this._document=document;
  4879 +this._window=win;
  4880 +this._lock=false;
  4881 +this._dirty=false;
  4882 +try{
  4883 +this.connect(window,"onunload",this._unloadCache);
  4884 +}
  4885 +catch(e){
  4886 +}
  4887 +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
  4888 +m.nameFunctions(this);
  4889 +};
  4890 +MochiKit.Signal.__new__(this);
  4891 +if(MochiKit.__export__){
  4892 +connect=MochiKit.Signal.connect;
  4893 +disconnect=MochiKit.Signal.disconnect;
  4894 +disconnectAll=MochiKit.Signal.disconnectAll;
  4895 +signal=MochiKit.Signal.signal;
  4896 +}
  4897 +MochiKit.Base._exportSymbols(this,MochiKit.Signal);
  4898 +if(typeof (dojo)!="undefined"){
  4899 +dojo.provide("MochiKit.Visual");
  4900 +dojo.require("MochiKit.Base");
  4901 +dojo.require("MochiKit.DOM");
  4902 +dojo.require("MochiKit.Style");
  4903 +dojo.require("MochiKit.Color");
  4904 +}
  4905 +if(typeof (JSAN)!="undefined"){
  4906 +JSAN.use("MochiKit.Base",[]);
  4907 +JSAN.use("MochiKit.DOM",[]);
  4908 +JSAN.use("MochiKit.Style",[]);
  4909 +JSAN.use("MochiKit.Color",[]);
  4910 +}
  4911 +try{
  4912 +if(typeof (MochiKit.Base)==="undefined"||typeof (MochiKit.DOM)==="undefined"||typeof (MochiKit.Style)==="undefined"||typeof (MochiKit.Color)==="undefined"){
  4913 +throw "";
  4914 +}
  4915 +}
  4916 +catch(e){
  4917 +throw "MochiKit.Visual depends on MochiKit.Base, MochiKit.DOM, MochiKit.Style and MochiKit.Color!";
  4918 +}
  4919 +if(typeof (MochiKit.Visual)=="undefined"){
  4920 +MochiKit.Visual={};
  4921 +}
  4922 +MochiKit.Visual.NAME="MochiKit.Visual";
  4923 +MochiKit.Visual.VERSION="1.4";
  4924 +MochiKit.Visual.__repr__=function(){
  4925 +return "["+this.NAME+" "+this.VERSION+"]";
  4926 +};
  4927 +MochiKit.Visual.toString=function(){
  4928 +return this.__repr__();
  4929 +};
  4930 +MochiKit.Visual._RoundCorners=function(e,_607){
  4931 +e=MochiKit.DOM.getElement(e);
  4932 +this._setOptions(_607);
  4933 +if(this.options.__unstable__wrapElement){
  4934 +e=this._doWrap(e);
  4935 +}
  4936 +var _608=this.options.color;
  4937 +var C=MochiKit.Color.Color;
  4938 +if(this.options.color==="fromElement"){
  4939 +_608=C.fromBackground(e);
  4940 +}else{
  4941 +if(!(_608 instanceof C)){
  4942 +_608=C.fromString(_608);
  4943 +}
  4944 +}
  4945 +this.isTransparent=(_608.asRGB().a<=0);
  4946 +var _610=this.options.bgColor;
  4947 +if(this.options.bgColor==="fromParent"){
  4948 +_610=C.fromBackground(e.offsetParent);
  4949 +}else{
  4950 +if(!(_610 instanceof C)){
  4951 +_610=C.fromString(_610);
  4952 +}
  4953 +}
  4954 +this._roundCornersImpl(e,_608,_610);
  4955 +};
  4956 +MochiKit.Visual._RoundCorners.prototype={_doWrap:function(e){
  4957 +var _611=e.parentNode;
  4958 +var doc=MochiKit.DOM.currentDocument();
  4959 +if(typeof (doc.defaultView)==="undefined"||doc.defaultView===null){
  4960 +return e;
  4961 +}
  4962 +var _612=doc.defaultView.getComputedStyle(e,null);
  4963 +if(typeof (_612)==="undefined"||_612===null){
  4964 +return e;
  4965 +}
  4966 +var _613=MochiKit.DOM.DIV({"style":{display:"block",marginTop:_612.getPropertyValue("padding-top"),marginRight:_612.getPropertyValue("padding-right"),marginBottom:_612.getPropertyValue("padding-bottom"),marginLeft:_612.getPropertyValue("padding-left"),padding:"0px"}});
  4967 +_613.innerHTML=e.innerHTML;
  4968 +e.innerHTML="";
  4969 +e.appendChild(_613);
  4970 +return e;
  4971 +},_roundCornersImpl:function(e,_614,_615){
  4972 +if(this.options.border){
  4973 +this._renderBorder(e,_615);
  4974 +}
  4975 +if(this._isTopRounded()){
  4976 +this._roundTopCorners(e,_614,_615);
  4977 +}
  4978 +if(this._isBottomRounded()){
  4979 +this._roundBottomCorners(e,_614,_615);
  4980 +}
  4981 +},_renderBorder:function(el,_617){
  4982 +var _618="1px solid "+this._borderColor(_617);
  4983 +var _619="border-left: "+_618;
  4984 +var _620="border-right: "+_618;
  4985 +var _621="style='"+_619+";"+_620+"'";
  4986 +el.innerHTML="<div "+_621+">"+el.innerHTML+"</div>";
  4987 +},_roundTopCorners:function(el,_622,_623){
  4988 +var _624=this._createCorner(_623);
  4989 +for(var i=0;i<this.options.numSlices;i++){
  4990 +_624.appendChild(this._createCornerSlice(_622,_623,i,"top"));
  4991 +}
  4992 +el.style.paddingTop=0;
  4993 +el.insertBefore(_624,el.firstChild);
  4994 +},_roundBottomCorners:function(el,_625,_626){
  4995 +var _627=this._createCorner(_626);
  4996 +for(var i=(this.options.numSlices-1);i>=0;i--){
  4997 +_627.appendChild(this._createCornerSlice(_625,_626,i,"bottom"));
  4998 +}
  4999 +el.style.paddingBottom=0;
  5000 +el.appendChild(_627);
  5001 +},_createCorner:function(_628){
  5002 +var dom=MochiKit.DOM;
  5003 +return dom.DIV({style:{backgroundColor:_628.toString()}});
  5004 +},_createCornerSlice:function(_629,_630,n,_631){
  5005 +var _632=MochiKit.DOM.SPAN();
  5006 +var _633=_632.style;
  5007 +_633.backgroundColor=_629.toString();
  5008 +_633.display="block";
  5009 +_633.height="1px";
  5010 +_633.overflow="hidden";
  5011 +_633.fontSize="1px";
  5012 +var _634=this._borderColor(_629,_630);
  5013 +if(this.options.border&&n===0){
  5014 +_633.borderTopStyle="solid";
  5015 +_633.borderTopWidth="1px";
  5016 +_633.borderLeftWidth="0px";
  5017 +_633.borderRightWidth="0px";
  5018 +_633.borderBottomWidth="0px";
  5019 +_633.height="0px";
  5020 +_633.borderColor=_634.toString();
  5021 +}else{
  5022 +if(_634){
  5023 +_633.borderColor=_634.toString();
  5024 +_633.borderStyle="solid";
  5025 +_633.borderWidth="0px 1px";
  5026 +}
  5027 +}
  5028 +if(!this.options.compact&&(n==(this.options.numSlices-1))){
  5029 +_633.height="2px";
  5030 +}
  5031 +this._setMargin(_632,n,_631);
  5032 +this._setBorder(_632,n,_631);
  5033 +return _632;
  5034 +},_setOptions:function(_635){
  5035 +this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false,__unstable__wrapElement:false};
  5036 +MochiKit.Base.update(this.options,_635);
  5037 +this.options.numSlices=(this.options.compact?2:4);
  5038 +},_whichSideTop:function(){
  5039 +var _636=this.options.corners;
  5040 +if(this._hasString(_636,"all","top")){
  5041 +return "";
  5042 +}
  5043 +var _637=(_636.indexOf("tl")!=-1);
  5044 +var _638=(_636.indexOf("tr")!=-1);
  5045 +if(_637&&_638){
  5046 +return "";
  5047 +}
  5048 +if(_637){
  5049 +return "left";
  5050 +}
  5051 +if(_638){
  5052 +return "right";
  5053 +}
  5054 +return "";
  5055 +},_whichSideBottom:function(){
  5056 +var _639=this.options.corners;
  5057 +if(this._hasString(_639,"all","bottom")){
  5058 +return "";
  5059 +}
  5060 +var _640=(_639.indexOf("bl")!=-1);
  5061 +var _641=(_639.indexOf("br")!=-1);
  5062 +if(_640&&_641){
  5063 +return "";
  5064 +}
  5065 +if(_640){
  5066 +return "left";
  5067 +}
  5068 +if(_641){
  5069 +return "right";
  5070 +}
  5071 +return "";
  5072 +},_borderColor:function(_642,_643){
  5073 +if(_642=="transparent"){
  5074 +return _643;
  5075 +}else{
  5076 +if(this.options.border){
  5077 +return this.options.border;
  5078 +}else{
  5079 +if(this.options.blend){
  5080 +return _643.blendedColor(_642);
  5081 +}
  5082 +}
  5083 +}
  5084 +return "";
  5085 +},_setMargin:function(el,n,_644){
  5086 +var _645=this._marginSize(n)+"px";
  5087 +var _646=(_644=="top"?this._whichSideTop():this._whichSideBottom());
  5088 +var _647=el.style;
  5089 +if(_646=="left"){
  5090 +_647.marginLeft=_645;
  5091 +_647.marginRight="0px";
  5092 +}else{
  5093 +if(_646=="right"){
  5094 +_647.marginRight=_645;
  5095 +_647.marginLeft="0px";
  5096 +}else{
  5097 +_647.marginLeft=_645;
  5098 +_647.marginRight=_645;
  5099 +}
  5100 +}
  5101 +},_setBorder:function(el,n,_648){
  5102 +var _649=this._borderSize(n)+"px";
  5103 +var _650=(_648=="top"?this._whichSideTop():this._whichSideBottom());
  5104 +var _651=el.style;
  5105 +if(_650=="left"){
  5106 +_651.borderLeftWidth=_649;
  5107 +_651.borderRightWidth="0px";
  5108 +}else{
  5109 +if(_650=="right"){
  5110 +_651.borderRightWidth=_649;
  5111 +_651.borderLeftWidth="0px";
  5112 +}else{
  5113 +_651.borderLeftWidth=_649;
  5114 +_651.borderRightWidth=_649;
  5115 +}
  5116 +}
  5117 +},_marginSize:function(n){
  5118 +if(this.isTransparent){
  5119 +return 0;
  5120 +}
  5121 +var o=this.options;
  5122 +if(o.compact&&o.blend){
  5123 +var _652=[1,0];
  5124 +return _652[n];
  5125 +}else{
  5126 +if(o.compact){
  5127 +var _653=[2,1];
  5128 +return _653[n];
  5129 +}else{
  5130 +if(o.blend){
  5131 +var _654=[3,2,1,0];
  5132 +return _654[n];
  5133 +}else{
  5134 +var _655=[5,3,2,1];
  5135 +return _655[n];
  5136 +}
  5137 +}
  5138 +}
  5139 +},_borderSize:function(n){
  5140 +var o=this.options;
  5141 +var _656;
  5142 +if(o.compact&&(o.blend||this.isTransparent)){
  5143 +return 1;
  5144 +}else{
  5145 +if(o.compact){
  5146 +_656=[1,0];
  5147 +}else{
  5148 +if(o.blend){
  5149 +_656=[2,1,1,1];
  5150 +}else{
  5151 +if(o.border){
  5152 +_656=[0,2,0,0];
  5153 +}else{
  5154 +if(this.isTransparent){
  5155 +_656=[5,3,2,1];
  5156 +}else{
  5157 +return 0;
  5158 +}
  5159 +}
  5160 +}
  5161 +}
  5162 +}
  5163 +return _656[n];
  5164 +},_hasString:function(str){
  5165 +for(var i=1;i<arguments.length;i++){
  5166 +if(str.indexOf(arguments[i])!=-1){
  5167 +return true;
  5168 +}
  5169 +}
  5170 +return false;
  5171 +},_isTopRounded:function(){
  5172 +return this._hasString(this.options.corners,"all","top","tl","tr");
  5173 +},_isBottomRounded:function(){
  5174 +return this._hasString(this.options.corners,"all","bottom","bl","br");
  5175 +},_hasSingleTextChild:function(el){
  5176 +return (el.childNodes.length==1&&el.childNodes[0].nodeType==3);
  5177 +}};
  5178 +MochiKit.Visual.roundElement=function(e,_657){
  5179 +new MochiKit.Visual._RoundCorners(e,_657);
  5180 +};
  5181 +MochiKit.Visual.roundClass=function(_658,_659,_660){
  5182 +var _661=MochiKit.DOM.getElementsByTagAndClassName(_658,_659);
  5183 +for(var i=0;i<_661.length;i++){
  5184 +MochiKit.Visual.roundElement(_661[i],_660);
  5185 +}
  5186 +};
  5187 +MochiKit.Visual.tagifyText=function(_662,_663){
  5188 +var _663=_663||"position:relative";
  5189 +if(/MSIE/.test(navigator.userAgent)){
  5190 +_663+=";zoom:1";
  5191 +}
  5192 +_662=MochiKit.DOM.getElement(_662);
  5193 +var ma=MochiKit.Base.map;
  5194 +ma(function(_665){
  5195 +if(_665.nodeType==3){
  5196 +ma(function(_666){
  5197 +_662.insertBefore(MochiKit.DOM.SPAN({style:_663},_666==" "?String.fromCharCode(160):_666),_665);
  5198 +},_665.nodeValue.split(""));
  5199 +MochiKit.DOM.removeElement(_665);
  5200 +}
  5201 +},_662.childNodes);
  5202 +};
  5203 +MochiKit.Visual.forceRerendering=function(_667){
  5204 +try{
  5205 +_667=MochiKit.DOM.getElement(_667);
  5206 +var n=document.createTextNode(" ");
  5207 +_667.appendChild(n);
  5208 +_667.removeChild(n);
  5209 +}
  5210 +catch(e){
  5211 +}
  5212 +};
  5213 +MochiKit.Visual.multiple=function(_668,_669,_670){
  5214 +_670=MochiKit.Base.update({speed:0.1,delay:0},_670||{});
  5215 +var _671=_670.delay;
  5216 +var _672=0;
  5217 +MochiKit.Base.map(function(_673){
  5218 +_670.delay=_672*_670.speed+_671;
  5219 +new _669(_673,_670);
  5220 +_672+=1;
  5221 +},_668);
  5222 +};
  5223 +MochiKit.Visual.PAIRS={"slide":["slideDown","slideUp"],"blind":["blindDown","blindUp"],"appear":["appear","fade"],"size":["grow","shrink"]};
  5224 +MochiKit.Visual.toggle=function(_674,_675,_676){
  5225 +_674=MochiKit.DOM.getElement(_674);
  5226 +_675=(_675||"appear").toLowerCase();
  5227 +_676=MochiKit.Base.update({queue:{position:"end",scope:(_674.id||"global"),limit:1}},_676||{});
  5228 +var v=MochiKit.Visual;
  5229 +v[_674.style.display!="none"?v.PAIRS[_675][1]:v.PAIRS[_675][0]](_674,_676);
  5230 +};
  5231 +MochiKit.Visual.Transitions={};
  5232 +MochiKit.Visual.Transitions.linear=function(pos){
  5233 +return pos;
  5234 +};
  5235 +MochiKit.Visual.Transitions.sinoidal=function(pos){
  5236 +return (-Math.cos(pos*Math.PI)/2)+0.5;
  5237 +};
  5238 +MochiKit.Visual.Transitions.reverse=function(pos){
  5239 +return 1-pos;
  5240 +};
  5241 +MochiKit.Visual.Transitions.flicker=function(pos){
  5242 +return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;
  5243 +};
  5244 +MochiKit.Visual.Transitions.wobble=function(pos){
  5245 +return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;
  5246 +};
  5247 +MochiKit.Visual.Transitions.pulse=function(pos){
  5248 +return (Math.floor(pos*10)%2==0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10)));
  5249 +};
  5250 +MochiKit.Visual.Transitions.none=function(pos){
  5251 +return 0;
  5252 +};
  5253 +MochiKit.Visual.Transitions.full=function(pos){
  5254 +return 1;
  5255 +};
  5256 +MochiKit.Visual.ScopedQueue=function(){
  5257 +this.__init__();
  5258 +};
  5259 +MochiKit.Base.update(MochiKit.Visual.ScopedQueue.prototype,{__init__:function(){
  5260 +this.effects=[];
  5261 +this.interval=null;
  5262 +},add:function(_678){
  5263 +var _679=new Date().getTime();
  5264 +var _680=(typeof (_678.options.queue)=="string")?_678.options.queue:_678.options.queue.position;
  5265 +var ma=MochiKit.Base.map;
  5266 +switch(_680){
  5267 +case "front":
  5268 +ma(function(e){
  5269 +if(e.state=="idle"){
  5270 +e.startOn+=_678.finishOn;
  5271 +e.finishOn+=_678.finishOn;
  5272 +}
  5273 +},this.effects);
  5274 +break;
  5275 +case "end":
  5276 +var _681;
  5277 +ma(function(e){
  5278 +var i=e.finishOn;
  5279 +if(i>=(_681||i)){
  5280 +_681=i;
  5281 +}
  5282 +},this.effects);
  5283 +_679=_681||_679;
  5284 +break;
  5285 +case "break":
  5286 +ma(function(e){
  5287 +e.finalize();
  5288 +},this.effects);
  5289 +break;
  5290 +}
  5291 +_678.startOn+=_679;
  5292 +_678.finishOn+=_679;
  5293 +if(!_678.options.queue.limit||this.effects.length<_678.options.queue.limit){
  5294 +this.effects.push(_678);
  5295 +}
  5296 +if(!this.interval){
  5297 +this.interval=this.startLoop(MochiKit.Base.bind(this.loop,this),40);
  5298 +}
  5299 +},startLoop:function(func,_682){
  5300 +return setInterval(func,_682);
  5301 +},remove:function(_683){
  5302 +this.effects=MochiKit.Base.filter(function(e){
  5303 +return e!=_683;
  5304 +},this.effects);
  5305 +if(this.effects.length==0){
  5306 +this.stopLoop(this.interval);
  5307 +this.interval=null;
  5308 +}
  5309 +},stopLoop:function(_684){
  5310 +clearInterval(_684);
  5311 +},loop:function(){
  5312 +var _685=new Date().getTime();
  5313 +MochiKit.Base.map(function(_686){
  5314 +_686.loop(_685);
  5315 +},this.effects);
  5316 +}});
  5317 +MochiKit.Visual.Queues={instances:{},get:function(_687){
  5318 +if(typeof (_687)!="string"){
  5319 +return _687;
  5320 +}
  5321 +if(!this.instances[_687]){
  5322 +this.instances[_687]=new MochiKit.Visual.ScopedQueue();
  5323 +}
  5324 +return this.instances[_687];
  5325 +}};
  5326 +MochiKit.Visual.Queue=MochiKit.Visual.Queues.get("global");
  5327 +MochiKit.Visual.DefaultOptions={transition:MochiKit.Visual.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};
  5328 +MochiKit.Visual.Base=function(){
  5329 +};
  5330 +MochiKit.Visual.Base.prototype={__class__:MochiKit.Visual.Base,start:function(_688){
  5331 +var v=MochiKit.Visual;
  5332 +this.options=MochiKit.Base.setdefault(_688||{},v.DefaultOptions);
  5333 +this.currentFrame=0;
  5334 +this.state="idle";
  5335 +this.startOn=this.options.delay*1000;
  5336 +this.finishOn=this.startOn+(this.options.duration*1000);
  5337 +this.event("beforeStart");
  5338 +if(!this.options.sync){
  5339 +v.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).add(this);
  5340 +}
  5341 +},loop:function(_689){
  5342 +if(_689>=this.startOn){
  5343 +if(_689>=this.finishOn){
  5344 +return this.finalize();
  5345 +}
  5346 +var pos=(_689-this.startOn)/(this.finishOn-this.startOn);
  5347 +var _690=Math.round(pos*this.options.fps*this.options.duration);
  5348 +if(_690>this.currentFrame){
  5349 +this.render(pos);
  5350 +this.currentFrame=_690;
  5351 +}
  5352 +}
  5353 +},render:function(pos){
  5354 +if(this.state=="idle"){
  5355 +this.state="running";
  5356 +this.event("beforeSetup");
  5357 +this.setup();
  5358 +this.event("afterSetup");
  5359 +}
  5360 +if(this.state=="running"){
  5361 +if(this.options.transition){
  5362 +pos=this.options.transition(pos);
  5363 +}
  5364 +pos*=(this.options.to-this.options.from);
  5365 +pos+=this.options.from;
  5366 +this.event("beforeUpdate");
  5367 +this.update(pos);
  5368 +this.event("afterUpdate");
  5369 +}
  5370 +},cancel:function(){
  5371 +if(!this.options.sync){
  5372 +MochiKit.Visual.Queues.get(typeof (this.options.queue)=="string"?"global":this.options.queue.scope).remove(this);
  5373 +}
  5374 +this.state="finished";
  5375 +},finalize:function(){
  5376 +this.render(1);
  5377 +this.cancel();
  5378 +this.event("beforeFinish");
  5379 +this.finish();
  5380 +this.event("afterFinish");
  5381 +},setup:function(){
  5382 +},finish:function(){
  5383 +},update:function(_691){
  5384 +},event:function(_692){
  5385 +if(this.options[_692+"Internal"]){
  5386 +this.options[_692+"Internal"](this);
  5387 +}
  5388 +if(this.options[_692]){
  5389 +this.options[_692](this);
  5390 +}
  5391 +},repr:function(){
  5392 +return "["+this.__class__.NAME+", options:"+MochiKit.Base.repr(this.options)+"]";
  5393 +}};
  5394 +MochiKit.Visual.Parallel=function(_693,_694){
  5395 +this.__init__(_693,_694);
  5396 +};
  5397 +MochiKit.Visual.Parallel.prototype=new MochiKit.Visual.Base();
  5398 +MochiKit.Base.update(MochiKit.Visual.Parallel.prototype,{__init__:function(_695,_696){
  5399 +this.effects=_695||[];
  5400 +this.start(_696);
  5401 +},update:function(_697){
  5402 +MochiKit.Base.map(function(_698){
  5403 +_698.render(_697);
  5404 +},this.effects);
  5405 +},finish:function(){
  5406 +MochiKit.Base.map(function(_699){
  5407 +_699.finalize();
  5408 +},this.effects);
  5409 +}});
  5410 +MochiKit.Visual.Opacity=function(_700,_701){
  5411 +this.__init__(_700,_701);
  5412 +};
  5413 +MochiKit.Visual.Opacity.prototype=new MochiKit.Visual.Base();
  5414 +MochiKit.Base.update(MochiKit.Visual.Opacity.prototype,{__init__:function(_702,_703){
  5415 +var b=MochiKit.Base;
  5416 +var s=MochiKit.Style;
  5417 +this.element=MochiKit.DOM.getElement(_702);
  5418 +if(this.element.currentStyle&&(!this.element.currentStyle.hasLayout)){
  5419 +s.setStyle(this.element,{zoom:1});
  5420 +}
  5421 +_703=b.update({from:s.getOpacity(this.element)||0,to:1},_703||{});
  5422 +this.start(_703);
  5423 +},update:function(_704){
  5424 +MochiKit.Style.setOpacity(this.element,_704);
  5425 +}});
  5426 +MochiKit.Visual.Move=function(_705,_706){
  5427 +this.__init__(_705,_706);
  5428 +};
  5429 +MochiKit.Visual.Move.prototype=new MochiKit.Visual.Base();
  5430 +MochiKit.Base.update(MochiKit.Visual.Move.prototype,{__init__:function(_707,_708){
  5431 +this.element=MochiKit.DOM.getElement(_707);
  5432 +_708=MochiKit.Base.update({x:0,y:0,mode:"relative"},_708||{});
  5433 +this.start(_708);
  5434 +},setup:function(){
  5435 +MochiKit.DOM.makePositioned(this.element);
  5436 +var s=this.element.style;
  5437 +var _709=s.visibility;
  5438 +var _710=s.display;
  5439 +if(_710=="none"){
  5440 +s.visibility="hidden";
  5441 +s.display="";
  5442 +}
  5443 +this.originalLeft=parseFloat(MochiKit.Style.getStyle(this.element,"left")||"0");
  5444 +this.originalTop=parseFloat(MochiKit.Style.getStyle(this.element,"top")||"0");
  5445 +if(this.options.mode=="absolute"){
  5446 +this.options.x-=this.originalLeft;
  5447 +this.options.y-=this.originalTop;
  5448 +}
  5449 +if(_710=="none"){
  5450 +s.visibility=_709;
  5451 +s.display=_710;
  5452 +}
  5453 +},update:function(_711){
  5454 +MochiKit.Style.setStyle(this.element,{left:Math.round(this.options.x*_711+this.originalLeft)+"px",top:Math.round(this.options.y*_711+this.originalTop)+"px"});
  5455 +}});
  5456 +MochiKit.Visual.Scale=function(_712,_713,_714){
  5457 +this.__init__(_712,_713,_714);
  5458 +};
  5459 +MochiKit.Visual.Scale.prototype=new MochiKit.Visual.Base();
  5460 +MochiKit.Base.update(MochiKit.Visual.Scale.prototype,{__init__:function(_715,_716,_717){
  5461 +this.element=MochiKit.DOM.getElement(_715);
  5462 +_717=MochiKit.Base.update({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_716},_717||{});
  5463 +this.start(_717);
  5464 +},setup:function(){
  5465 +this.restoreAfterFinish=this.options.restoreAfterFinish||false;
  5466 +this.elementPositioning=MochiKit.Style.getStyle(this.element,"position");
  5467 +var ma=MochiKit.Base.map;
  5468 +var b=MochiKit.Base.bind;
  5469 +this.originalStyle={};
  5470 +ma(b(function(k){
  5471 +this.originalStyle[k]=this.element.style[k];
  5472 +},this),["top","left","width","height","fontSize"]);
  5473 +this.originalTop=this.element.offsetTop;
  5474 +this.originalLeft=this.element.offsetLeft;
  5475 +var _718=MochiKit.Style.getStyle(this.element,"font-size")||"100%";
  5476 +ma(b(function(_719){
  5477 +if(_718.indexOf(_719)>0){
  5478 +this.fontSize=parseFloat(_718);
  5479 +this.fontSizeType=_719;
  5480 +}
  5481 +},this),["em","px","%"]);
  5482 +this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
  5483 +if(/^content/.test(this.options.scaleMode)){
  5484 +this.dims=[this.element.scrollHeight,this.element.scrollWidth];
  5485 +}else{
  5486 +if(this.options.scaleMode=="box"){
  5487 +this.dims=[this.element.offsetHeight,this.element.offsetWidth];
  5488 +}else{
  5489 +this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];
  5490 +}
  5491 +}
  5492 +},update:function(_720){
  5493 +var _721=(this.options.scaleFrom/100)+(this.factor*_720);
  5494 +if(this.options.scaleContent&&this.fontSize){
  5495 +MochiKit.Style.setStyle(this.element,{fontSize:this.fontSize*_721+this.fontSizeType});
  5496 +}
  5497 +this.setDimensions(this.dims[0]*_721,this.dims[1]*_721);
  5498 +},finish:function(){
  5499 +if(this.restoreAfterFinish){
  5500 +MochiKit.Style.setStyle(this.element,this.originalStyle);
  5501 +}
  5502 +},setDimensions:function(_722,_723){
  5503 +var d={};
  5504 +var r=Math.round;
  5505 +if(/MSIE/.test(navigator.userAgent)){
  5506 +r=Math.ceil;
  5507 +}
  5508 +if(this.options.scaleX){
  5509 +d.width=r(_723)+"px";
  5510 +}
  5511 +if(this.options.scaleY){
  5512 +d.height=r(_722)+"px";
  5513 +}
  5514 +if(this.options.scaleFromCenter){
  5515 +var topd=(_722-this.dims[0])/2;
  5516 +var _725=(_723-this.dims[1])/2;
  5517 +if(this.elementPositioning=="absolute"){
  5518 +if(this.options.scaleY){
  5519 +d.top=this.originalTop-topd+"px";
  5520 +}
  5521 +if(this.options.scaleX){
  5522 +d.left=this.originalLeft-_725+"px";
  5523 +}
  5524 +}else{
  5525 +if(this.options.scaleY){
  5526 +d.top=-topd+"px";
  5527 +}
  5528 +if(this.options.scaleX){
  5529 +d.left=-_725+"px";
  5530 +}
  5531 +}
  5532 +}
  5533 +MochiKit.Style.setStyle(this.element,d);
  5534 +}});
  5535 +MochiKit.Visual.Highlight=function(_726,_727){
  5536 +this.__init__(_726,_727);
  5537 +};
  5538 +MochiKit.Visual.Highlight.prototype=new MochiKit.Visual.Base();
  5539 +MochiKit.Base.update(MochiKit.Visual.Highlight.prototype,{__init__:function(_728,_729){
  5540 +this.element=MochiKit.DOM.getElement(_728);
  5541 +_729=MochiKit.Base.update({startcolor:"#ffff99"},_729||{});
  5542 +this.start(_729);
  5543 +},setup:function(){
  5544 +var b=MochiKit.Base;
  5545 +var s=MochiKit.Style;
  5546 +if(s.getStyle(this.element,"display")=="none"){
  5547 +this.cancel();
  5548 +return;
  5549 +}
  5550 +this.oldStyle={backgroundImage:s.getStyle(this.element,"background-image")};
  5551 +s.setStyle(this.element,{backgroundImage:"none"});
  5552 +if(!this.options.endcolor){
  5553 +this.options.endcolor=MochiKit.Color.Color.fromBackground(this.element).toHexString();
  5554 +}
  5555 +if(b.isUndefinedOrNull(this.options.restorecolor)){
  5556 +this.options.restorecolor=s.getStyle(this.element,"background-color");
  5557 +}
  5558 +this._base=b.map(b.bind(function(i){
  5559 +return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);
  5560 +},this),[0,1,2]);
  5561 +this._delta=b.map(b.bind(function(i){
  5562 +return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];
  5563 +},this),[0,1,2]);
  5564 +},update:function(_730){
  5565 +var m="#";
  5566 +MochiKit.Base.map(MochiKit.Base.bind(function(i){
  5567 +m+=MochiKit.Color.toColorPart(Math.round(this._base[i]+this._delta[i]*_730));
  5568 +},this),[0,1,2]);
  5569 +MochiKit.Style.setStyle(this.element,{backgroundColor:m});
  5570 +},finish:function(){
  5571 +MochiKit.Style.setStyle(this.element,MochiKit.Base.update(this.oldStyle,{backgroundColor:this.options.restorecolor}));
  5572 +}});
  5573 +MochiKit.Visual.ScrollTo=function(_731,_732){
  5574 +this.__init__(_731,_732);
  5575 +};
  5576 +MochiKit.Visual.ScrollTo.prototype=new MochiKit.Visual.Base();
  5577 +MochiKit.Base.update(MochiKit.Visual.ScrollTo.prototype,{__init__:function(_733,_734){
  5578 +this.element=MochiKit.DOM.getElement(_733);
  5579 +this.start(_734||{});
  5580 +},setup:function(){
  5581 +var p=MochiKit.Position;
  5582 +p.prepare();
  5583 +var _735=p.cumulativeOffset(this.element);
  5584 +if(this.options.offset){
  5585 +_735.y+=this.options.offset;
  5586 +}
  5587 +var max;
  5588 +if(window.innerHeight){
  5589 +max=window.innerHeight-window.height;
  5590 +}else{
  5591 +if(document.documentElement&&document.documentElement.clientHeight){
  5592 +max=document.documentElement.clientHeight-document.body.scrollHeight;
  5593 +}else{
  5594 +if(document.body){
  5595 +max=document.body.clientHeight-document.body.scrollHeight;
  5596 +}
  5597 +}
  5598 +}
  5599 +this.scrollStart=p.windowOffset.y;
  5600 +this.delta=(_735.y>max?max:_735.y)-this.scrollStart;
  5601 +},update:function(_736){
  5602 +var p=MochiKit.Position;
  5603 +p.prepare();
  5604 +window.scrollTo(p.windowOffset.x,this.scrollStart+(_736*this.delta));
  5605 +}});
  5606 +MochiKit.Visual.fade=function(_737,_738){
  5607 +var s=MochiKit.Style;
  5608 +var _739=MochiKit.DOM.getElement(_737).style.opacity||"";
  5609 +_738=MochiKit.Base.update({from:s.getOpacity(_737)||1,to:0,afterFinishInternal:function(_740){
  5610 +if(_740.options.to!==0){
  5611 +return;
  5612 +}
  5613 +s.hideElement(_740.element);
  5614 +s.setStyle(_740.element,{opacity:_739});
  5615 +}},_738||{});
  5616 +return new MochiKit.Visual.Opacity(_737,_738);
  5617 +};
  5618 +MochiKit.Visual.appear=function(_741,_742){
  5619 +var s=MochiKit.Style;
  5620 +var v=MochiKit.Visual;
  5621 +_742=MochiKit.Base.update({from:(s.getStyle(_741,"display")=="none"?0:s.getOpacity(_741)||0),to:1,afterFinishInternal:function(_743){
  5622 +v.forceRerendering(_743.element);
  5623 +},beforeSetupInternal:function(_744){
  5624 +s.setOpacity(_744.element,_744.options.from);
  5625 +s.showElement(_744.element);
  5626 +}},_742||{});
  5627 +return new v.Opacity(_741,_742);
  5628 +};
  5629 +MochiKit.Visual.puff=function(_745,_746){
  5630 +var s=MochiKit.Style;
  5631 +var v=MochiKit.Visual;
  5632 +_745=MochiKit.DOM.getElement(_745);
  5633 +var _747={opacity:_745.style.opacity||"",position:s.getStyle(_745,"position"),top:_745.style.top,left:_745.style.left,width:_745.style.width,height:_745.style.height};
  5634 +_746=MochiKit.Base.update({beforeSetupInternal:function(_748){
  5635 +MochiKit.Position.absolutize(_748.effects[0].element);
  5636 +},afterFinishInternal:function(_749){
  5637 +s.hideElement(_749.effects[0].element);
  5638 +s.setStyle(_749.effects[0].element,_747);
  5639 +}},_746||{});
  5640 +return new v.Parallel([new v.Scale(_745,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new v.Opacity(_745,{sync:true,to:0})],_746);
  5641 +};
  5642 +MochiKit.Visual.blindUp=function(_750,_751){
  5643 +var d=MochiKit.DOM;
  5644 +_750=d.getElement(_750);
  5645 +var _752=d.makeClipping(_750);
  5646 +_751=MochiKit.Base.update({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_753){
  5647 +MochiKit.Style.hideElement(_753.element);
  5648 +d.undoClipping(_753.element,_752);
  5649 +}},_751||{});
  5650 +return new MochiKit.Visual.Scale(_750,0,_751);
  5651 +};
  5652 +MochiKit.Visual.blindDown=function(_754,_755){
  5653 +var d=MochiKit.DOM;
  5654 +var s=MochiKit.Style;
  5655 +_754=d.getElement(_754);
  5656 +var _756=s.getElementDimensions(_754);
  5657 +var _757;
  5658 +_755=MochiKit.Base.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_756.h,originalWidth:_756.w},restoreAfterFinish:true,afterSetupInternal:function(_758){
  5659 +_757=d.makeClipping(_758.element);
  5660 +s.setStyle(_758.element,{height:"0px"});
  5661 +s.showElement(_758.element);
  5662 +},afterFinishInternal:function(_759){
  5663 +d.undoClipping(_759.element,_757);
  5664 +}},_755||{});
  5665 +return new MochiKit.Visual.Scale(_754,100,_755);
  5666 +};
  5667 +MochiKit.Visual.switchOff=function(_760,_761){
  5668 +var d=MochiKit.DOM;
  5669 +_760=d.getElement(_760);
  5670 +var _762=_760.style.opacity||"";
  5671 +var _763;
  5672 +var _761=MochiKit.Base.update({duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetupInternal:function(_764){
  5673 +d.makePositioned(_764.element);
  5674 +_763=d.makeClipping(_764.element);
  5675 +},afterFinishInternal:function(_765){
  5676 +MochiKit.Style.hideElement(_765.element);
  5677 +d.undoClipping(_765.element,_763);
  5678 +d.undoPositioned(_765.element);
  5679 +MochiKit.Style.setStyle(_765.element,{opacity:_762});
  5680 +}},_761||{});
  5681 +var v=MochiKit.Visual;
  5682 +return new v.appear(_760,{duration:0.4,from:0,transition:v.Transitions.flicker,afterFinishInternal:function(_766){
  5683 +new v.Scale(_766.element,1,_761);
  5684 +}});
  5685 +};
  5686 +MochiKit.Visual.dropOut=function(_767,_768){
  5687 +var d=MochiKit.DOM;
  5688 +var s=MochiKit.Style;
  5689 +_767=d.getElement(_767);
  5690 +var _769={top:s.getStyle(_767,"top"),left:s.getStyle(_767,"left"),opacity:_767.style.opacity||""};
  5691 +_768=MochiKit.Base.update({duration:0.5,beforeSetupInternal:function(_770){
  5692 +d.makePositioned(_770.effects[0].element);
  5693 +},afterFinishInternal:function(_771){
  5694 +s.hideElement(_771.effects[0].element);
  5695 +d.undoPositioned(_771.effects[0].element);
  5696 +s.setStyle(_771.effects[0].element,_769);
  5697 +}},_768||{});
  5698 +var v=MochiKit.Visual;
  5699 +return new v.Parallel([new v.Move(_767,{x:0,y:100,sync:true}),new v.Opacity(_767,{sync:true,to:0})],_768);
  5700 +};
  5701 +MochiKit.Visual.shake=function(_772,_773){
  5702 +var d=MochiKit.DOM;
  5703 +var v=MochiKit.Visual;
  5704 +var s=MochiKit.Style;
  5705 +_772=d.getElement(_772);
  5706 +_773=MochiKit.Base.update({x:-20,y:0,duration:0.05,afterFinishInternal:function(_774){
  5707 +d.undoPositioned(_774.element);
  5708 +s.setStyle(_774.element,oldStyle);
  5709 +}},_773||{});
  5710 +var _775={top:s.getStyle(_772,"top"),left:s.getStyle(_772,"left")};
  5711 +return new v.Move(_772,{x:20,y:0,duration:0.05,afterFinishInternal:function(_776){
  5712 +new v.Move(_776.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_776){
  5713 +new v.Move(_776.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_776){
  5714 +new v.Move(_776.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_776){
  5715 +new v.Move(_776.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_776){
  5716 +new v.Move(_776.element,_773);
  5717 +}});
  5718 +}});
  5719 +}});
  5720 +}});
  5721 +}});
  5722 +};
  5723 +MochiKit.Visual.slideDown=function(_777,_778){
  5724 +var d=MochiKit.DOM;
  5725 +var b=MochiKit.Base;
  5726 +var s=MochiKit.Style;
  5727 +_777=d.getElement(_777);
  5728 +if(!_777.firstChild){
  5729 +throw "MochiKit.Visual.slideDown must be used on a element with a child";
  5730 +}
  5731 +d.removeEmptyTextNodes(_777);
  5732 +var _779=s.getStyle(_777.firstChild,"bottom")||0;
  5733 +var _780=s.getElementDimensions(_777);
  5734 +var _781;
  5735 +_778=b.update({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_780.h,originalWidth:_780.w},restoreAfterFinish:true,afterSetupInternal:function(_782){
  5736 +d.makePositioned(_782.element);
  5737 +d.makePositioned(_782.element.firstChild);
  5738 +if(/Opera/.test(navigator.userAgent)){
  5739 +s.setStyle(_782.element,{top:""});
  5740 +}
  5741 +_781=d.makeClipping(_782.element);
  5742 +s.setStyle(_782.element,{height:"0px"});
  5743 +s.showElement(_782.element);
  5744 +},afterUpdateInternal:function(_783){
  5745 +s.setStyle(_783.element.firstChild,{bottom:(_783.dims[0]-_783.element.clientHeight)+"px"});
  5746 +},afterFinishInternal:function(_784){
  5747 +d.undoClipping(_784.element,_781);
  5748 +if(/MSIE/.test(navigator.userAgent)){
  5749 +d.undoPositioned(_784.element);
  5750 +d.undoPositioned(_784.element.firstChild);
  5751 +}else{
  5752 +d.undoPositioned(_784.element.firstChild);
  5753 +d.undoPositioned(_784.element);
  5754 +}
  5755 +s.setStyle(_784.element.firstChild,{bottom:_779});
  5756 +}},_778||{});
  5757 +return new MochiKit.Visual.Scale(_777,100,_778);
  5758 +};
  5759 +MochiKit.Visual.slideUp=function(_785,_786){
  5760 +var d=MochiKit.DOM;
  5761 +var b=MochiKit.Base;
  5762 +var s=MochiKit.Style;
  5763 +_785=d.getElement(_785);
  5764 +if(!_785.firstChild){
  5765 +throw "MochiKit.Visual.slideUp must be used on a element with a child";
  5766 +}
  5767 +d.removeEmptyTextNodes(_785);
  5768 +var _787=s.getStyle(_785.firstChild,"bottom");
  5769 +var _788;
  5770 +_786=b.update({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_789){
  5771 +d.makePositioned(_789.element);
  5772 +d.makePositioned(_789.element.firstChild);
  5773 +if(/Opera/.test(navigator.userAgent)){
  5774 +s.setStyle(_789.element,{top:""});
  5775 +}
  5776 +_788=d.makeClipping(_789.element);
  5777 +s.showElement(_789.element);
  5778 +},afterUpdateInternal:function(_790){
  5779 +s.setStyle(_790.element.firstChild,{bottom:(_790.dims[0]-_790.element.clientHeight)+"px"});
  5780 +},afterFinishInternal:function(_791){
  5781 +s.hideElement(_791.element);
  5782 +d.undoClipping(_791.element,_788);
  5783 +d.undoPositioned(_791.element.firstChild);
  5784 +d.undoPositioned(_791.element);
  5785 +s.setStyle(_791.element.firstChild,{bottom:_787});
  5786 +}},_786||{});
  5787 +return new MochiKit.Visual.Scale(_785,0,_786);
  5788 +};
  5789 +MochiKit.Visual.squish=function(_792,_793){
  5790 +var d=MochiKit.DOM;
  5791 +var b=MochiKit.Base;
  5792 +var _794;
  5793 +_793=b.update({restoreAfterFinish:true,beforeSetupInternal:function(_795){
  5794 +_794=d.makeClipping(_795.element);
  5795 +},afterFinishInternal:function(_796){
  5796 +MochiKit.Style.hideElement(_796.element);
  5797 +d.undoClipping(_796.element,_794);
  5798 +}},_793||{});
  5799 +return new MochiKit.Visual.Scale(_792,/Opera/.test(navigator.userAgent)?1:0,_793);
  5800 +};
  5801 +MochiKit.Visual.grow=function(_797,_798){
  5802 +var d=MochiKit.DOM;
  5803 +var v=MochiKit.Visual;
  5804 +var s=MochiKit.Style;
  5805 +_797=d.getElement(_797);
  5806 +_798=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.full},_798||{});
  5807 +var _799={top:_797.style.top,left:_797.style.left,height:_797.style.height,width:_797.style.width,opacity:_797.style.opacity||""};
  5808 +var dims=s.getElementDimensions(_797);
  5809 +var _801,initialMoveY;
  5810 +var _802,moveY;
  5811 +switch(_798.direction){
  5812 +case "top-left":
  5813 +_801=initialMoveY=_802=moveY=0;
  5814 +break;
  5815 +case "top-right":
  5816 +_801=dims.w;
  5817 +initialMoveY=moveY=0;
  5818 +_802=-dims.w;
  5819 +break;
  5820 +case "bottom-left":
  5821 +_801=_802=0;
  5822 +initialMoveY=dims.h;
  5823 +moveY=-dims.h;
  5824 +break;
  5825 +case "bottom-right":
  5826 +_801=dims.w;
  5827 +initialMoveY=dims.h;
  5828 +_802=-dims.w;
  5829 +moveY=-dims.h;
  5830 +break;
  5831 +case "center":
  5832 +_801=dims.w/2;
  5833 +initialMoveY=dims.h/2;
  5834 +_802=-dims.w/2;
  5835 +moveY=-dims.h/2;
  5836 +break;
  5837 +}
  5838 +var _803=MochiKit.Base.update({beforeSetupInternal:function(_804){
  5839 +s.setStyle(_804.effects[0].element,{height:"0px"});
  5840 +s.showElement(_804.effects[0].element);
  5841 +},afterFinishInternal:function(_805){
  5842 +d.undoClipping(_805.effects[0].element);
  5843 +d.undoPositioned(_805.effects[0].element);
  5844 +s.setStyle(_805.effects[0].element,_799);
  5845 +}},_798||{});
  5846 +return new v.Move(_797,{x:_801,y:initialMoveY,duration:0.01,beforeSetupInternal:function(_806){
  5847 +s.hideElement(_806.element);
  5848 +d.makeClipping(_806.element);
  5849 +d.makePositioned(_806.element);
  5850 +},afterFinishInternal:function(_807){
  5851 +new v.Parallel([new v.Opacity(_807.element,{sync:true,to:1,from:0,transition:_798.opacityTransition}),new v.Move(_807.element,{x:_802,y:moveY,sync:true,transition:_798.moveTransition}),new v.Scale(_807.element,100,{scaleMode:{originalHeight:dims.h,originalWidth:dims.w},sync:true,scaleFrom:/Opera/.test(navigator.userAgent)?1:0,transition:_798.scaleTransition,restoreAfterFinish:true})],_803);
  5852 +}});
  5853 +};
  5854 +MochiKit.Visual.shrink=function(_808,_809){
  5855 +var d=MochiKit.DOM;
  5856 +var v=MochiKit.Visual;
  5857 +var s=MochiKit.Style;
  5858 +_808=d.getElement(_808);
  5859 +_809=MochiKit.Base.update({direction:"center",moveTransition:v.Transitions.sinoidal,scaleTransition:v.Transitions.sinoidal,opacityTransition:v.Transitions.none},_809||{});
  5860 +var _810={top:_808.style.top,left:_808.style.left,height:_808.style.height,width:_808.style.width,opacity:_808.style.opacity||""};
  5861 +var dims=s.getElementDimensions(_808);
  5862 +var _811,moveY;
  5863 +switch(_809.direction){
  5864 +case "top-left":
  5865 +_811=moveY=0;
  5866 +break;
  5867 +case "top-right":
  5868 +_811=dims.w;
  5869 +moveY=0;
  5870 +break;
  5871 +case "bottom-left":
  5872 +_811=0;
  5873 +moveY=dims.h;
  5874 +break;
  5875 +case "bottom-right":
  5876 +_811=dims.w;
  5877 +moveY=dims.h;
  5878 +break;
  5879 +case "center":
  5880 +_811=dims.w/2;
  5881 +moveY=dims.h/2;
  5882 +break;
  5883 +}
  5884 +var _812;
  5885 +var _813=MochiKit.Base.update({beforeStartInternal:function(_814){
  5886 +_812=d.makePositioned(_814.effects[0].element);
  5887 +d.makeClipping(_814.effects[0].element);
  5888 +},afterFinishInternal:function(_815){
  5889 +s.hideElement(_815.effects[0].element);
  5890 +d.undoClipping(_815.effects[0].element,_812);
  5891 +d.undoPositioned(_815.effects[0].element);
  5892 +s.setStyle(_815.effects[0].element,_810);
  5893 +}},_809||{});
  5894 +return new v.Parallel([new v.Opacity(_808,{sync:true,to:0,from:1,transition:_809.opacityTransition}),new v.Scale(_808,/Opera/.test(navigator.userAgent)?1:0,{sync:true,transition:_809.scaleTransition,restoreAfterFinish:true}),new v.Move(_808,{x:_811,y:moveY,sync:true,transition:_809.moveTransition})],_813);
  5895 +};
  5896 +MochiKit.Visual.pulsate=function(_816,_817){
  5897 +var d=MochiKit.DOM;
  5898 +var v=MochiKit.Visual;
  5899 +var b=MochiKit.Base;
  5900 +var _818=d.getElement(_816).style.opacity||"";
  5901 +_817=b.update({duration:3,from:0,afterFinishInternal:function(_819){
  5902 +MochiKit.Style.setStyle(_819.element,{opacity:_818});
  5903 +}},_817||{});
  5904 +var _820=_817.transition||v.Transitions.sinoidal;
  5905 +var _821=b.bind(function(pos){
  5906 +return _820(1-v.Transitions.pulse(pos));
  5907 +},_820);
  5908 +b.bind(_821,_820);
  5909 +return new v.Opacity(_816,b.update({transition:_821},_817));
  5910 +};
  5911 +MochiKit.Visual.fold=function(_822,_823){
  5912 +var d=MochiKit.DOM;
  5913 +var v=MochiKit.Visual;
  5914 +var s=MochiKit.Style;
  5915 +_822=d.getElement(_822);
  5916 +var _824={top:_822.style.top,left:_822.style.left,width:_822.style.width,height:_822.style.height};
  5917 +var _825=d.makeClipping(_822);
  5918 +_823=MochiKit.Base.update({scaleContent:false,scaleX:false,afterFinishInternal:function(_826){
  5919 +new v.Scale(_822,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_826){
  5920 +s.hideElement(_826.element);
  5921 +d.undoClipping(_826.element,_825);
  5922 +s.setStyle(_826.element,_824);
  5923 +}});
  5924 +}},_823||{});
  5925 +return new v.Scale(_822,5,_823);
  5926 +};
  5927 +MochiKit.Visual.Color=MochiKit.Color.Color;
  5928 +MochiKit.Visual.getElementsComputedStyle=MochiKit.DOM.computedStyle;
  5929 +MochiKit.Visual.__new__=function(){
  5930 +var m=MochiKit.Base;
  5931 +m.nameFunctions(this);
  5932 +this.EXPORT_TAGS={":common":this.EXPORT,":all":m.concat(this.EXPORT,this.EXPORT_OK)};
  5933 +};
  5934 +MochiKit.Visual.EXPORT=["roundElement","roundClass","tagifyText","multiple","toggle","Base","Parallel","Opacity","Move","Scale","Highlight","ScrollTo","fade","appear","puff","blindUp","blindDown","switchOff","dropOut","shake","slideDown","slideUp","squish","grow","shrink","pulsate","fold"];
  5935 +MochiKit.Visual.EXPORT_OK=["PAIRS"];
  5936 +MochiKit.Visual.__new__();
  5937 +MochiKit.Base._exportSymbols(this,MochiKit.Visual);
  5938 +if(typeof (MochiKit)=="undefined"){
  5939 +MochiKit={};
  5940 +}
  5941 +if(typeof (MochiKit.MochiKit)=="undefined"){
  5942 +MochiKit.MochiKit={};
  5943 +}
  5944 +MochiKit.MochiKit.NAME="MochiKit.MochiKit";
  5945 +MochiKit.MochiKit.VERSION="1.4";
  5946 +MochiKit.MochiKit.__repr__=function(){
  5947 +return "["+this.NAME+" "+this.VERSION+"]";
  5948 +};
  5949 +MochiKit.MochiKit.toString=function(){
  5950 +return this.__repr__();
  5951 +};
  5952 +MochiKit.MochiKit.SUBMODULES=["Base","Iter","Logging","DateTime","Format","Async","DOM","Style","LoggingPane","Color","Signal","Visual"];
  5953 +if(typeof (JSAN)!="undefined"||typeof (dojo)!="undefined"){
  5954 +if(typeof (dojo)!="undefined"){
  5955 +dojo.provide("MochiKit.MochiKit");
  5956 +dojo.require("MochiKit.*");
  5957 +}
  5958 +if(typeof (JSAN)!="undefined"){
  5959 +(function(lst){
  5960 +for(var i=0;i<lst.length;i++){
  5961 +JSAN.use("MochiKit."+lst[i],[]);
  5962 +}
  5963 +})(MochiKit.MochiKit.SUBMODULES);
  5964 +}
  5965 +(function(){
  5966 +var _827=MochiKit.Base.extend;
  5967 +var self=MochiKit.MochiKit;
  5968 +var _828=self.SUBMODULES;
  5969 +var _829=[];
  5970 +var _830=[];
  5971 +var _831={};
  5972 +var i,k,m,all;
  5973 +for(i=0;i<_828.length;i++){
  5974 +m=MochiKit[_828[i]];
  5975 +_827(_829,m.EXPORT);
  5976 +_827(_830,m.EXPORT_OK);
  5977 +for(k in m.EXPORT_TAGS){
  5978 +_831[k]=_827(_831[k],m.EXPORT_TAGS[k]);
  5979 +}
  5980 +all=m.EXPORT_TAGS[":all"];
  5981 +if(!all){
  5982 +all=_827(null,m.EXPORT,m.EXPORT_OK);
  5983 +}
  5984 +var j;
  5985 +for(j=0;j<all.length;j++){
  5986 +k=all[j];
  5987 +self[k]=m[k];
  5988 +}
  5989 +}
  5990 +self.EXPORT=_829;
  5991 +self.EXPORT_OK=_830;
  5992 +self.EXPORT_TAGS=_831;
  5993 +}());
  5994 +}else{
  5995 +if(typeof (MochiKit.__compat__)=="undefined"){
  5996 +MochiKit.__compat__=true;
  5997 +}
  5998 +(function(){
  5999 +if(typeof (document)=="undefined"){
  6000 +return;
  6001 +}
  6002 +var _832=document.getElementsByTagName("script");
  6003 +var _833="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
  6004 +var base=null;
  6005 +var _834=null;
  6006 +var _835={};
  6007 +var i;
  6008 +for(i=0;i<_832.length;i++){
  6009 +var src=_832[i].getAttribute("src");
  6010 +if(!src){
  6011 +continue;
  6012 +}
  6013 +_835[src]=true;
  6014 +if(src.match(/MochiKit.js$/)){
  6015 +base=src.substring(0,src.lastIndexOf("MochiKit.js"));
  6016 +_834=_832[i];
  6017 +}
  6018 +}
  6019 +if(base===null){
  6020 +return;
  6021 +}
  6022 +var _836=MochiKit.MochiKit.SUBMODULES;
  6023 +for(var i=0;i<_836.length;i++){
  6024 +if(MochiKit[_836[i]]){
  6025 +continue;
  6026 +}
  6027 +var uri=base+_836[i]+".js";
  6028 +if(uri in _835){
  6029 +continue;
  6030 +}
  6031 +if(document.documentElement&&document.documentElement.namespaceURI==_833){
  6032 +var s=document.createElementNS(_833,"script");
  6033 +s.setAttribute("id","MochiKit_"+base+_836[i]);
  6034 +s.setAttribute("src",uri);
  6035 +s.setAttribute("type","application/x-javascript");
  6036 +_834.parentNode.appendChild(s);
  6037 +}else{
  6038 +document.write("<script src=\""+uri+"\" type=\"text/javascript\"></script>");
  6039 +}
  6040 +}
  6041 +})();
  6042 +}
  6043 +
  6044 +
... ...
thirdpartyjs/MochiKit/New.js 0 → 100644
  1 +
  2 +MochiKit.Base.update(MochiKit.DOM, {
  3 + /** @id MochiKit.DOM.makeClipping */
  4 + makeClipping: function (element) {
  5 + element = MochiKit.DOM.getElement(element);
  6 + var oldOverflow = element.style.overflow;
  7 + if ((MochiKit.Style.getStyle(element, 'overflow') || 'visible') != 'hidden') {
  8 + element.style.overflow = 'hidden';
  9 + }
  10 + return oldOverflow;
  11 + },
  12 +
  13 + /** @id MochiKit.DOM.undoClipping */
  14 + undoClipping: function (element, overflow) {
  15 + element = MochiKit.DOM.getElement(element);
  16 + if (!overflow) {
  17 + return;
  18 + }
  19 + element.style.overflow = overflow;
  20 + },
  21 +
  22 + /** @id MochiKit.DOM.makePositioned */
  23 + makePositioned: function (element) {
  24 + element = MochiKit.DOM.getElement(element);
  25 + var pos = MochiKit.Style.getStyle(element, 'position');
  26 + if (pos == 'static' || !pos) {
  27 + element.style.position = 'relative';
  28 + // Opera returns the offset relative to the positioning context,
  29 + // when an element is position relative but top and left have
  30 + // not been defined
  31 + if (/Opera/.test(navigator.userAgent)) {
  32 + element.style.top = 0;
  33 + element.style.left = 0;
  34 + }
  35 + }
  36 + },
  37 +
  38 + /** @id MochiKit.DOM.undoPositioned */
  39 + undoPositioned: function (element) {
  40 + element = MochiKit.DOM.getElement(element);
  41 + if (element.style.position == 'relative') {
  42 + element.style.position = element.style.top = element.style.left = element.style.bottom = element.style.right = '';
  43 + }
  44 + },
  45 +
  46 + /** @id MochiKit.DOM.getFirstElementByTagAndClassName */
  47 + getFirstElementByTagAndClassName: function (tagName, className,
  48 + /* optional */parent) {
  49 + var self = MochiKit.DOM;
  50 + if (typeof(tagName) == 'undefined' || tagName === null) {
  51 + tagName = '*';
  52 + }
  53 + if (typeof(parent) == 'undefined' || parent === null) {
  54 + parent = self._document;
  55 + }
  56 + parent = self.getElement(parent);
  57 + var children = (parent.getElementsByTagName(tagName)
  58 + || self._document.all);
  59 + if (typeof(className) == 'undefined' || className === null) {
  60 + return children[0];
  61 + }
  62 +
  63 + for (var i = 0; i < children.length; i++) {
  64 + var child = children[i];
  65 + var classNames = child.className.split(' ');
  66 + for (var j = 0; j < classNames.length; j++) {
  67 + if (classNames[j] == className) {
  68 + return child;
  69 + }
  70 + }
  71 + }
  72 + },
  73 +
  74 + /** @id MochiKit.DOM.isParent */
  75 + isParent: function (child, element) {
  76 + if (!child.parentNode || child == element) {
  77 + return false;
  78 + }
  79 +
  80 + if (child.parentNode == element) {
  81 + return true;
  82 + }
  83 +
  84 + return MochiKit.DOM.isParent(child.parentNode, element);
  85 + }
  86 +});
  87 +
  88 +MochiKit.Position = {
  89 + // set to true if needed, warning: firefox performance problems
  90 + // NOT neeeded for page scrolling, only if draggable contained in
  91 + // scrollable elements
  92 + includeScrollOffsets: false,
  93 +
  94 + /** @id MochiKit.Position.prepare */
  95 + prepare: function () {
  96 + var deltaX = window.pageXOffset
  97 + || document.documentElement.scrollLeft
  98 + || document.body.scrollLeft
  99 + || 0;
  100 + var deltaY = window.pageYOffset
  101 + || document.documentElement.scrollTop
  102 + || document.body.scrollTop
  103 + || 0;
  104 + this.windowOffset = new MochiKit.Style.Coordinates(deltaX, deltaY);
  105 + },
  106 +
  107 + /** @id MochiKit.Position.cumulativeOffset */
  108 + cumulativeOffset: function (element) {
  109 + var valueT = 0;
  110 + var valueL = 0;
  111 + do {
  112 + valueT += element.offsetTop || 0;
  113 + valueL += element.offsetLeft || 0;
  114 + element = element.offsetParent;
  115 + } while (element);
  116 + return new MochiKit.Style.Coordinates(valueL, valueT);
  117 + },
  118 +
  119 + /** @id MochiKit.Position.realOffset */
  120 + realOffset: function (element) {
  121 + var valueT = 0;
  122 + var valueL = 0;
  123 + do {
  124 + valueT += element.scrollTop || 0;
  125 + valueL += element.scrollLeft || 0;
  126 + element = element.parentNode;
  127 + } while (element);
  128 + return new MochiKit.Style.Coordinates(valueL, valueT);
  129 + },
  130 +
  131 + /** @id MochiKit.Position.within */
  132 + within: function (element, x, y) {
  133 + if (this.includeScrollOffsets) {
  134 + return this.withinIncludingScrolloffsets(element, x, y);
  135 + }
  136 + this.xcomp = x;
  137 + this.ycomp = y;
  138 + this.offset = this.cumulativeOffset(element);
  139 + if (element.style.position == "fixed") {
  140 + this.offset.x += this.windowOffset.x;
  141 + this.offset.y += this.windowOffset.y;
  142 + }
  143 +
  144 + return (y >= this.offset.y &&
  145 + y < this.offset.y + element.offsetHeight &&
  146 + x >= this.offset.x &&
  147 + x < this.offset.x + element.offsetWidth);
  148 + },
  149 +
  150 + /** @id MochiKit.Position.withinIncludingScrolloffsets */
  151 + withinIncludingScrolloffsets: function (element, x, y) {
  152 + var offsetcache = this.realOffset(element);
  153 +
  154 + this.xcomp = x + offsetcache.x - this.windowOffset.x;
  155 + this.ycomp = y + offsetcache.y - this.windowOffset.y;
  156 + this.offset = this.cumulativeOffset(element);
  157 +
  158 + return (this.ycomp >= this.offset.y &&
  159 + this.ycomp < this.offset.y + element.offsetHeight &&
  160 + this.xcomp >= this.offset.x &&
  161 + this.xcomp < this.offset.x + element.offsetWidth);
  162 + },
  163 +
  164 + // within must be called directly before
  165 + /** @id MochiKit.Position.overlap */
  166 + overlap: function (mode, element) {
  167 + if (!mode) {
  168 + return 0;
  169 + }
  170 + if (mode == 'vertical') {
  171 + return ((this.offset.y + element.offsetHeight) - this.ycomp) /
  172 + element.offsetHeight;
  173 + }
  174 + if (mode == 'horizontal') {
  175 + return ((this.offset.x + element.offsetWidth) - this.xcomp) /
  176 + element.offsetWidth;
  177 + }
  178 + },
  179 +
  180 + /** @id MochiKit.Position.absolutize */
  181 + absolutize: function (element) {
  182 + element = MochiKit.DOM.getElement(element);
  183 + if (element.style.position == 'absolute') {
  184 + return;
  185 + }
  186 + MochiKit.Position.prepare();
  187 +
  188 + var offsets = MochiKit.Position.positionedOffset(element);
  189 + var width = element.clientWidth;
  190 + var height = element.clientHeight;
  191 +
  192 + var oldStyle = {
  193 + 'position': element.style.position,
  194 + 'left': offsets.x - parseFloat(element.style.left || 0),
  195 + 'top': offsets.y - parseFloat(element.style.top || 0),
  196 + 'width': element.style.width,
  197 + 'height': element.style.height
  198 + };
  199 +
  200 + element.style.position = 'absolute';
  201 + element.style.top = offsets.y + 'px';
  202 + element.style.left = offsets.x + 'px';
  203 + element.style.width = width + 'px';
  204 + element.style.height = height + 'px';
  205 +
  206 + return oldStyle;
  207 + },
  208 +
  209 + /** @id MochiKit.Position.positionedOffset */
  210 + positionedOffset: function (element) {
  211 + var valueT = 0, valueL = 0;
  212 + do {
  213 + valueT += element.offsetTop || 0;
  214 + valueL += element.offsetLeft || 0;
  215 + element = element.offsetParent;
  216 + if (element) {
  217 + p = MochiKit.Style.getStyle(element, 'position');
  218 + if (p == 'relative' || p == 'absolute') {
  219 + break;
  220 + }
  221 + }
  222 + } while (element);
  223 + return new MochiKit.Style.Coordinates(valueL, valueT);
  224 + },
  225 +
  226 + /** @id MochiKit.Position.relativize */
  227 + relativize: function (element, oldPos) {
  228 + element = MochiKit.DOM.getElement(element);
  229 + if (element.style.position == 'relative') {
  230 + return;
  231 + }
  232 + MochiKit.Position.prepare();
  233 +
  234 + var top = parseFloat(element.style.top || 0) -
  235 + (oldPos['top'] || 0);
  236 + var left = parseFloat(element.style.left || 0) -
  237 + (oldPos['left'] || 0);
  238 +
  239 + element.style.position = oldPos['position'];
  240 + element.style.top = top + 'px';
  241 + element.style.left = left + 'px';
  242 + element.style.width = oldPos['width'];
  243 + element.style.height = oldPos['height'];
  244 + },
  245 +
  246 + /** @id MochiKit.Position.clone */
  247 + clone: function (source, target) {
  248 + source = MochiKit.DOM.getElement(source);
  249 + target = MochiKit.DOM.getElement(target);
  250 + target.style.position = 'absolute';
  251 + var offsets = this.cumulativeOffset(source);
  252 + target.style.top = offsets.y + 'px';
  253 + target.style.left = offsets.x + 'px';
  254 + target.style.width = source.offsetWidth + 'px';
  255 + target.style.height = source.offsetHeight + 'px';
  256 + },
  257 +
  258 + /** @id MochiKit.Position.page */
  259 + page: function (forElement) {
  260 + var valueT = 0;
  261 + var valueL = 0;
  262 +
  263 + var element = forElement;
  264 + do {
  265 + valueT += element.offsetTop || 0;
  266 + valueL += element.offsetLeft || 0;
  267 +
  268 + // Safari fix
  269 + if (element.offsetParent == document.body && MochiKit.Style.getStyle(element, 'position') == 'absolute') {
  270 + break;
  271 + }
  272 + } while (element = element.offsetParent);
  273 +
  274 + element = forElement;
  275 + do {
  276 + valueT -= element.scrollTop || 0;
  277 + valueL -= element.scrollLeft || 0;
  278 + } while (element = element.parentNode);
  279 +
  280 + return new MochiKit.Style.Coordinates(valueL, valueT);
  281 + }
  282 +};
  283 +
... ...
thirdpartyjs/MochiKit/Sortable.js 0 → 100644
  1 +/***
  2 +Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
  3 + Mochi-ized By Thomas Herve (_firstname_@nimail.org)
  4 +
  5 +See scriptaculous.js for full license.
  6 +
  7 +***/
  8 +
  9 +if (typeof(dojo) != 'undefined') {
  10 + dojo.provide('MochiKit.DragAndDrop');
  11 + dojo.require('MochiKit.Base');
  12 + dojo.require('MochiKit.DOM');
  13 + dojo.require('MochiKit.Iter');
  14 +}
  15 +
  16 +if (typeof(JSAN) != 'undefined') {
  17 + JSAN.use("MochiKit.Base", []);
  18 + JSAN.use("MochiKit.DOM", []);
  19 + JSAN.use("MochiKit.Iter", []);
  20 +}
  21 +
  22 +try {
  23 + if (typeof(MochiKit.Base) == 'undefined' ||
  24 + typeof(MochiKit.DOM) == 'undefined' ||
  25 + typeof(MochiKit.Iter) == 'undefined') {
  26 + throw "";
  27 + }
  28 +} catch (e) {
  29 + throw "MochiKit.DragAndDrop depends on MochiKit.Base, MochiKit.DOM and MochiKit.Iter!";
  30 +}
  31 +
  32 +if (typeof(MochiKit.Sortable) == 'undefined') {
  33 + MochiKit.Sortable = {};
  34 +}
  35 +
  36 +MochiKit.Sortable.NAME = 'MochiKit.Sortable';
  37 +MochiKit.Sortable.VERSION = '1.4';
  38 +
  39 +MochiKit.Sortable.__repr__ = function () {
  40 + return '[' + this.NAME + ' ' + this.VERSION + ']';
  41 +};
  42 +
  43 +MochiKit.Sortable.toString = function () {
  44 + return this.__repr__();
  45 +};
  46 +
  47 +MochiKit.Sortable.EXPORT = [
  48 +];
  49 +
  50 +MochiKit.DragAndDrop.EXPORT_OK = [
  51 + "Sortable"
  52 +];
  53 +
  54 +MochiKit.Sortable.Sortable = {
  55 + /***
  56 +
  57 + Manage sortables. Mainly use the create function to add a sortable.
  58 +
  59 + ***/
  60 + sortables: {},
  61 +
  62 + _findRootElement: function (element) {
  63 + while (element.tagName.toUpperCase() != "BODY") {
  64 + if (element.id && MochiKit.Sortable.Sortable.sortables[element.id]) {
  65 + return element;
  66 + }
  67 + element = element.parentNode;
  68 + }
  69 + },
  70 +
  71 + /** @id MochiKit.Sortable.Sortable.options */
  72 + options: function (element) {
  73 + element = MochiKit.Sortable.Sortable._findRootElement(MochiKit.DOM.getElement(element));
  74 + if (!element) {
  75 + return;
  76 + }
  77 + return MochiKit.Sortable.Sortable.sortables[element.id];
  78 + },
  79 +
  80 + /** @id MochiKit.Sortable.Sortable.destroy */
  81 + destroy: function (element){
  82 + var s = MochiKit.Sortable.Sortable.options(element);
  83 + var b = MochiKit.Base;
  84 + var d = MochiKit.DragAndDrop;
  85 +
  86 + if (s) {
  87 + MochiKit.Signal.disconnect(s.startHandle);
  88 + MochiKit.Signal.disconnect(s.endHandle);
  89 + b.map(function (dr) {
  90 + d.Droppables.remove(dr);
  91 + }, s.droppables);
  92 + b.map(function (dr) {
  93 + dr.destroy();
  94 + }, s.draggables);
  95 +
  96 + delete MochiKit.Sortable.Sortable.sortables[s.element.id];
  97 + }
  98 + },
  99 +
  100 + /** @id MochiKit.Sortable.Sortable.create */
  101 + create: function (element, options, droppables) {
  102 + element = MochiKit.DOM.getElement(element);
  103 + var self = MochiKit.Sortable.Sortable;
  104 +
  105 + /** @id MochiKit.Sortable.Sortable.options */
  106 + options = MochiKit.Base.update({
  107 +
  108 + /** @id MochiKit.Sortable.Sortable.element */
  109 + element: element,
  110 +
  111 + /** @id MochiKit.Sortable.Sortable.tag */
  112 + tag: 'li', // assumes li children, override with tag: 'tagname'
  113 +
  114 + /** @id MochiKit.Sortable.Sortable.dropOnEmpty */
  115 + dropOnEmpty: false,
  116 +
  117 + /** @id MochiKit.Sortable.Sortable.tree */
  118 + tree: false,
  119 +
  120 + /** @id MochiKit.Sortable.Sortable.treeTag */
  121 + treeTag: 'ul',
  122 +
  123 + /** @id MochiKit.Sortable.Sortable.overlap */
  124 + overlap: 'vertical', // one of 'vertical', 'horizontal'
  125 +
  126 + /** @id MochiKit.Sortable.Sortable.constraint */
  127 + constraint: 'vertical', // one of 'vertical', 'horizontal', false
  128 + // also takes array of elements (or ids); or false
  129 +
  130 + /** @id MochiKit.Sortable.Sortable.containment */
  131 + containment: [element],
  132 +
  133 + /** @id MochiKit.Sortable.Sortable.handle */
  134 + handle: false, // or a CSS class
  135 +
  136 + /** @id MochiKit.Sortable.Sortable.only */
  137 + only: false,
  138 +
  139 + /** @id MochiKit.Sortable.Sortable.hoverclass */
  140 + hoverclass: null,
  141 +
  142 + /** @id MochiKit.Sortable.Sortable.ghosting */
  143 + ghosting: false,
  144 +
  145 + /** @id MochiKit.Sortable.Sortable.scroll */
  146 + scroll: false,
  147 +
  148 + /** @id MochiKit.Sortable.Sortable.scrollSensitivity */
  149 + scrollSensitivity: 20,
  150 +
  151 + /** @id MochiKit.Sortable.Sortable.scrollSpeed */
  152 + scrollSpeed: 15,
  153 +
  154 + /** @id MochiKit.Sortable.Sortable.format */
  155 + format: /^[^_]*_(.*)$/,
  156 +
  157 + /** @id MochiKit.Sortable.Sortable.onChange */
  158 + onChange: MochiKit.Base.noop,
  159 +
  160 + /** @id MochiKit.Sortable.Sortable.onUpdate */
  161 + onUpdate: MochiKit.Base.noop,
  162 +
  163 + /** @id MochiKit.Sortable.Sortable.accept */
  164 + accept: null
  165 + }, options);
  166 +
  167 + // clear any old sortable with same element
  168 + self.destroy(element);
  169 +
  170 + // build options for the draggables
  171 + var options_for_draggable = {
  172 + revert: true,
  173 + ghosting: options.ghosting,
  174 + scroll: options.scroll,
  175 + scrollSensitivity: options.scrollSensitivity,
  176 + scrollSpeed: options.scrollSpeed,
  177 + constraint: options.constraint,
  178 + handle: options.handle
  179 + };
  180 +
  181 + if (options.starteffect) {
  182 + options_for_draggable.starteffect = options.starteffect;
  183 + }
  184 +
  185 + if (options.reverteffect) {
  186 + options_for_draggable.reverteffect = options.reverteffect;
  187 + } else if (options.ghosting) {
  188 + options_for_draggable.reverteffect = function (innerelement) {
  189 + innerelement.style.top = 0;
  190 + innerelement.style.left = 0;
  191 + };
  192 + }
  193 +
  194 + if (options.endeffect) {
  195 + options_for_draggable.endeffect = options.endeffect;
  196 + }
  197 +
  198 + if (options.zindex) {
  199 + options_for_draggable.zindex = options.zindex;
  200 + }
  201 +
  202 + // build options for the droppables
  203 + var options_for_droppable = {
  204 + overlap: options.overlap,
  205 + containment: options.containment,
  206 + hoverclass: options.hoverclass,
  207 + onhover: self.onHover,
  208 + tree: options.tree,
  209 + accept: options.accept,
  210 + }
  211 +
  212 + var options_for_tree = {
  213 + onhover: self.onEmptyHover,
  214 + overlap: options.overlap,
  215 + containment: options.containment,
  216 + hoverclass: options.hoverclass,
  217 + accept: options.accept
  218 + }
  219 +
  220 + // fix for gecko engine
  221 + MochiKit.DOM.removeEmptyTextNodes(element);
  222 +
  223 + options.draggables = [];
  224 + options.droppables = [];
  225 +
  226 + // drop on empty handling
  227 + if (options.dropOnEmpty || options.tree) {
  228 + new MochiKit.DragAndDrop.Droppable(element, options_for_tree);
  229 + options.droppables.push(element);
  230 + }
  231 +
  232 + MochiKit.Base.map(function (e) {
  233 + // handles are per-draggable
  234 + var handle = options.handle ?
  235 + MochiKit.DOM.getFirstElementByTagAndClassName(null,
  236 + options.handle, e) : e;
  237 + options.draggables.push(
  238 + new MochiKit.DragAndDrop.Draggable(e,
  239 + MochiKit.Base.update(options_for_draggable,
  240 + {handle: handle})));
  241 + new MochiKit.DragAndDrop.Droppable(e, options_for_droppable);
  242 + if (options.tree) {
  243 + e.treeNode = element;
  244 + }
  245 + options.droppables.push(e);
  246 + }, (self.findElements(element, options) || []));
  247 +
  248 + if (options.tree) {
  249 + MochiKit.Base.map(function (e) {
  250 + new MochiKit.DragAndDrop.Droppable(e, options_for_tree);
  251 + e.treeNode = element;
  252 + options.droppables.push(e);
  253 + }, (self.findTreeElements(element, options) || []));
  254 + }
  255 +
  256 + // keep reference
  257 + self.sortables[element.id] = options;
  258 +
  259 + options.lastValue = self.serialize(element);
  260 + options.startHandle = MochiKit.Signal.connect(MochiKit.DragAndDrop.Draggables, 'start',
  261 + MochiKit.Base.partial(self.onStart, element));
  262 + options.endHandle = MochiKit.Signal.connect(MochiKit.DragAndDrop.Draggables, 'end',
  263 + MochiKit.Base.partial(self.onEnd, element));
  264 + },
  265 +
  266 + /** @id MochiKit.Sortable.Sortable.onStart */
  267 + onStart: function (element, draggable) {
  268 + var self = MochiKit.Sortable.Sortable;
  269 + var options = self.options(element);
  270 + options.lastValue = self.serialize(options.element);
  271 + },
  272 +
  273 + /** @id MochiKit.Sortable.Sortable.onEnd */
  274 + onEnd: function (element, draggable) {
  275 + var self = MochiKit.Sortable.Sortable;
  276 + self.unmark();
  277 + var options = self.options(element);
  278 + if (options.lastValue != self.serialize(options.element)) {
  279 + options.onUpdate(options.element);
  280 + }
  281 + },
  282 +
  283 + // return all suitable-for-sortable elements in a guaranteed order
  284 +
  285 + /** @id MochiKit.Sortable.Sortable.findElements */
  286 + findElements: function (element, options) {
  287 + return MochiKit.Sortable.Sortable.findChildren(
  288 + element, options.only, options.tree ? true : false, options.tag);
  289 + },
  290 +
  291 + /** @id MochiKit.Sortable.Sortable.findTreeElements */
  292 + findTreeElements: function (element, options) {
  293 + return MochiKit.Sortable.Sortable.findChildren(
  294 + element, options.only, options.tree ? true : false, options.treeTag);
  295 + },
  296 +
  297 + /** @id MochiKit.Sortable.Sortable.findChildren */
  298 + findChildren: function (element, only, recursive, tagName) {
  299 + if (!element.hasChildNodes()) {
  300 + return null;
  301 + }
  302 + tagName = tagName.toUpperCase();
  303 + if (only) {
  304 + only = MochiKit.Base.flattenArray([only]);
  305 + }
  306 + var elements = [];
  307 + MochiKit.Base.map(function (e) {
  308 + if (e.tagName &&
  309 + e.tagName.toUpperCase() == tagName &&
  310 + (!only ||
  311 + MochiKit.Iter.some(only, function (c) {
  312 + return MochiKit.DOM.hasElementClass(e, c);
  313 + }))) {
  314 + elements.push(e);
  315 + }
  316 + if (recursive) {
  317 + var grandchildren = MochiKit.Sortable.Sortable.findChildren(e, only, recursive, tagName);
  318 + if (grandchildren && grandchildren.length > 0) {
  319 + elements = elements.concat(grandchildren);
  320 + }
  321 + }
  322 + }, element.childNodes);
  323 + return elements;
  324 + },
  325 +
  326 + /** @id MochiKit.Sortable.Sortable.onHover */
  327 + onHover: function (element, dropon, overlap) {
  328 + if (MochiKit.DOM.isParent(dropon, element)) {
  329 + return;
  330 + }
  331 + var self = MochiKit.Sortable.Sortable;
  332 +
  333 + if (overlap > .33 && overlap < .66 && self.options(dropon).tree) {
  334 + return;
  335 + } else if (overlap > 0.5) {
  336 + self.mark(dropon, 'before');
  337 + if (dropon.previousSibling != element) {
  338 + var oldParentNode = element.parentNode;
  339 + element.style.visibility = 'hidden'; // fix gecko rendering
  340 + dropon.parentNode.insertBefore(element, dropon);
  341 + if (dropon.parentNode != oldParentNode) {
  342 + self.options(oldParentNode).onChange(element);
  343 + }
  344 + self.options(dropon.parentNode).onChange(element);
  345 + }
  346 + } else {
  347 + self.mark(dropon, 'after');
  348 + var nextElement = dropon.nextSibling || null;
  349 + if (nextElement != element) {
  350 + var oldParentNode = element.parentNode;
  351 + element.style.visibility = 'hidden'; // fix gecko rendering
  352 + dropon.parentNode.insertBefore(element, nextElement);
  353 + if (dropon.parentNode != oldParentNode) {
  354 + self.options(oldParentNode).onChange(element);
  355 + }
  356 + self.options(dropon.parentNode).onChange(element);
  357 + }
  358 + }
  359 + },
  360 +
  361 + _offsetSize: function (element, type) {
  362 + if (type == 'vertical' || type == 'height') {
  363 + return element.offsetHeight;
  364 + } else {
  365 + return element.offsetWidth;
  366 + }
  367 + },
  368 +
  369 + /** @id MochiKit.Sortable.Sortable.onEmptyHover */
  370 + onEmptyHover: function (element, dropon, overlap) {
  371 + var oldParentNode = element.parentNode;
  372 + var self = MochiKit.Sortable.Sortable;
  373 + var droponOptions = self.options(dropon);
  374 +
  375 + if (!MochiKit.DOM.isParent(dropon, element)) {
  376 + var index;
  377 +
  378 + var children = self.findElements(dropon, {tag: droponOptions.tag,
  379 + only: droponOptions.only});
  380 + var child = null;
  381 +
  382 + if (children) {
  383 + var offset = self._offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
  384 +
  385 + for (index = 0; index < children.length; index += 1) {
  386 + if (offset - self._offsetSize(children[index], droponOptions.overlap) >= 0) {
  387 + offset -= self._offsetSize(children[index], droponOptions.overlap);
  388 + } else if (offset - (self._offsetSize (children[index], droponOptions.overlap) / 2) >= 0) {
  389 + child = index + 1 < children.length ? children[index + 1] : null;
  390 + break;
  391 + } else {
  392 + child = children[index];
  393 + break;
  394 + }
  395 + }
  396 + }
  397 +
  398 + dropon.insertBefore(element, child);
  399 +
  400 + self.options(oldParentNode).onChange(element);
  401 + droponOptions.onChange(element);
  402 + }
  403 + },
  404 +
  405 + /** @id MochiKit.Sortable.Sortable.unmark */
  406 + unmark: function () {
  407 + var m = MochiKit.Sortable.Sortable._marker;
  408 + if (m) {
  409 + MochiKit.Style.hideElement(m);
  410 + }
  411 + },
  412 +
  413 + /** @id MochiKit.Sortable.Sortable.mark */
  414 + mark: function (dropon, position) {
  415 + // mark on ghosting only
  416 + var d = MochiKit.DOM;
  417 + var self = MochiKit.Sortable.Sortable;
  418 + var sortable = self.options(dropon.parentNode);
  419 + if (sortable && !sortable.ghosting) {
  420 + return;
  421 + }
  422 +
  423 + if (!self._marker) {
  424 + self._marker = d.getElement('dropmarker') ||
  425 + document.createElement('DIV');
  426 + MochiKit.Style.hideElement(self._marker);
  427 + d.addElementClass(self._marker, 'dropmarker');
  428 + self._marker.style.position = 'absolute';
  429 + document.getElementsByTagName('body').item(0).appendChild(self._marker);
  430 + }
  431 + var offsets = MochiKit.Position.cumulativeOffset(dropon);
  432 + self._marker.style.left = offsets.x + 'px';
  433 + self._marker.style.top = offsets.y + 'px';
  434 +
  435 + if (position == 'after') {
  436 + if (sortable.overlap == 'horizontal') {
  437 + self._marker.style.left = (offsets.x + dropon.clientWidth) + 'px';
  438 + } else {
  439 + self._marker.style.top = (offsets.y + dropon.clientHeight) + 'px';
  440 + }
  441 + }
  442 + MochiKit.Style.showElement(self._marker);
  443 + },
  444 +
  445 + _tree: function (element, options, parent) {
  446 + var self = MochiKit.Sortable.Sortable;
  447 + var children = self.findElements(element, options) || [];
  448 +
  449 + for (var i = 0; i < children.length; ++i) {
  450 + var match = children[i].id.match(options.format);
  451 +
  452 + if (!match) {
  453 + continue;
  454 + }
  455 +
  456 + var child = {
  457 + id: encodeURIComponent(match ? match[1] : null),
  458 + element: element,
  459 + parent: parent,
  460 + children: [],
  461 + position: parent.children.length,
  462 + container: self._findChildrenElement(children[i], options.treeTag.toUpperCase())
  463 + }
  464 +
  465 + /* Get the element containing the children and recurse over it */
  466 + if (child.container) {
  467 + self._tree(child.container, options, child)
  468 + }
  469 +
  470 + parent.children.push (child);
  471 + }
  472 +
  473 + return parent;
  474 + },
  475 +
  476 + /* Finds the first element of the given tag type within a parent element.
  477 + Used for finding the first LI[ST] within a L[IST]I[TEM].*/
  478 + _findChildrenElement: function (element, containerTag) {
  479 + if (element && element.hasChildNodes) {
  480 + containerTag = containerTag.toUpperCase();
  481 + for (var i = 0; i < element.childNodes.length; ++i) {
  482 + if (element.childNodes[i].tagName.toUpperCase() == containerTag) {
  483 + return element.childNodes[i];
  484 + }
  485 + }
  486 + }
  487 + return null;
  488 + },
  489 +
  490 + /** @id MochiKit.Sortable.Sortable.tree */
  491 + tree: function (element, options) {
  492 + element = MochiKit.DOM.getElement(element);
  493 + var sortableOptions = MochiKit.Sortable.Sortable.options(element);
  494 + options = MochiKit.Base.update({
  495 + tag: sortableOptions.tag,
  496 + treeTag: sortableOptions.treeTag,
  497 + only: sortableOptions.only,
  498 + name: element.id,
  499 + format: sortableOptions.format
  500 + }, options || {});
  501 +
  502 + var root = {
  503 + id: null,
  504 + parent: null,
  505 + children: new Array,
  506 + container: element,
  507 + position: 0
  508 + }
  509 +
  510 + return MochiKit.Sortable.Sortable._tree(element, options, root);
  511 + },
  512 +
  513 + /**
  514 + * Specifies the sequence for the Sortable.
  515 + * @param {Node} element Element to use as the Sortable.
  516 + * @param {Object} newSequence New sequence to use.
  517 + * @param {Object} options Options to use fro the Sortable.
  518 + */
  519 + setSequence: function (element, newSequence, options) {
  520 + var self = MochiKit.Sortable.Sortable;
  521 + var b = MochiKit.Base;
  522 + element = MochiKit.DOM.getElement(element);
  523 + options = b.update(self.options(element), options || {});
  524 +
  525 + var nodeMap = {};
  526 + b.map(function (n) {
  527 + var m = n.id.match(options.format);
  528 + if (m) {
  529 + nodeMap[m[1]] = [n, n.parentNode];
  530 + }
  531 + n.parentNode.removeChild(n);
  532 + }, self.findElements(element, options));
  533 +
  534 + b.map(function (ident) {
  535 + var n = nodeMap[ident];
  536 + if (n) {
  537 + n[1].appendChild(n[0]);
  538 + delete nodeMap[ident];
  539 + }
  540 + }, newSequence);
  541 + },
  542 +
  543 + /* Construct a [i] index for a particular node */
  544 + _constructIndex: function (node) {
  545 + var index = '';
  546 + do {
  547 + if (node.id) {
  548 + index = '[' + node.position + ']' + index;
  549 + }
  550 + } while ((node = node.parent) != null);
  551 + return index;
  552 + },
  553 +
  554 + /** @id MochiKit.Sortable.Sortable.sequence */
  555 + sequence: function (element, options) {
  556 + element = MochiKit.DOM.getElement(element);
  557 + var self = MochiKit.Sortable.Sortable;
  558 + var options = MochiKit.Base.update(self.options(element), options || {});
  559 +
  560 + return MochiKit.Base.map(function (item) {
  561 + return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
  562 + }, MochiKit.DOM.getElement(self.findElements(element, options) || []));
  563 + },
  564 +
  565 + /**
  566 + * Serializes the content of a Sortable. Useful to send this content through a XMLHTTPRequest.
  567 + * These options override the Sortable options for the serialization only.
  568 + * @param {Node} element Element to serialize.
  569 + * @param {Object} options Serialization options.
  570 + */
  571 + serialize: function (element, options) {
  572 + element = MochiKit.DOM.getElement(element);
  573 + var self = MochiKit.Sortable.Sortable;
  574 + options = MochiKit.Base.update(self.options(element), options || {});
  575 + var name = encodeURIComponent(options.name || element.id);
  576 +
  577 + if (options.tree) {
  578 + return MochiKit.Base.flattenArray(MochiKit.Base.map(function (item) {
  579 + return [name + self._constructIndex(item) + "[id]=" +
  580 + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
  581 + }, self.tree(element, options).children)).join('&');
  582 + } else {
  583 + return MochiKit.Base.map(function (item) {
  584 + return name + "[]=" + encodeURIComponent(item);
  585 + }, self.sequence(element, options)).join('&');
  586 + }
  587 + }
  588 +};
  589 +
... ...
thirdpartyjs/MochiKit/__package__.js
1   -dojo.hostenv.conditionalLoadModule({
2   - "common": [
3   - "MochiKit.Base",
4   - "MochiKit.Iter",
5   - "MochiKit.Logging",
6   - "MochiKit.DateTime",
7   - "MochiKit.Format",
8   - "MochiKit.Async",
9   - "MochiKit.Color"
10   - ],
11   - "browser": [
12   - "MochiKit.DOM",
13   - "MochiKit.LoggingPane",
14   - "MochiKit.Visual"
15   - ]
16   -});
  1 +dojo.hostenv.conditionalLoadModule({"common": ["MochiKit.MochiKit"]});
17 2 dojo.hostenv.moduleLoaded("MochiKit.*");
... ...