<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13257] trunk: introduce custom menus, props jeffikus, See #11817</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13257">13257</a></dd>
<dt>Author</dt> <dd>wpmuguru</dd>
<dt>Date</dt> <dd>2010-02-20 21:57:43 +0000 (Sat, 20 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>introduce custom menus, props jeffikus, See <a href="http://trac.wordpress.org/ticket/11817">#11817</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminmenuphp">trunk/wp-admin/menu.php</a></li>
<li><a href="#trunkwpincludesdefaultwidgetsphp">trunk/wp-includes/default-widgets.php</a></li>
<li><a href="#trunkwpincludesgeneraltemplatephp">trunk/wp-includes/general-template.php</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
<li><a href="#trunkwpincludestaxonomyphp">trunk/wp-includes/taxonomy.php</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadmincsscustomnavigationcss">trunk/wp-admin/css/custom-navigation.css</a></li>
<li><a href="#trunkwpadmincsscustomnavigationdevcss">trunk/wp-admin/css/custom-navigation.dev.css</a></li>
<li><a href="#trunkwpadmincustomnavigationphp">trunk/wp-admin/custom-navigation.php</a></li>
<li><a href="#trunkwpadminjscustomnavigationcustomjquery132devjs">trunk/wp-admin/js/custom-navigation-custom-jquery-1.3.2.dev.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationcustomjquery132js">trunk/wp-admin/js/custom-navigation-custom-jquery-1.3.2.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationcustomjqueryautocompletedevjs">trunk/wp-admin/js/custom-navigation-custom-jquery-autocomplete.dev.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationcustomjqueryautocompletejs">trunk/wp-admin/js/custom-navigation-custom-jquery-autocomplete.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationcustomjqueryui172devjs">trunk/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.dev.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationcustomjqueryui172js">trunk/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationdefaultitemsdevjs">trunk/wp-admin/js/custom-navigation-default-items.dev.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationdefaultitemsjs">trunk/wp-admin/js/custom-navigation-default-items.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationdynamicfunctionsdevjs">trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationdynamicfunctionsjs">trunk/wp-admin/js/custom-navigation-dynamic-functions.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationphpfunctionsdevjs">trunk/wp-admin/js/custom-navigation-php-functions.dev.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationphpfunctionsjs">trunk/wp-admin/js/custom-navigation-php-functions.js</a></li>
<li><a href="#trunkwpincludescustomnavigationfunctionsphp">trunk/wp-includes/custom-navigation-functions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsscustomnavigationcss"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/css/custom-navigation.css (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/custom-navigation.css         (rev 0)
+++ trunk/wp-admin/css/custom-navigation.css        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+.fix{clear:both;height:1px;margin:-1px 0 0;overflow:hidden;}#no-js{display:block;}.maintitle{margin:0 0 20px 0!important;}.logo{vertical-align:middle;margin:0 10px 0 0;}#pages-left{min-width:650px;max-width:1100px;width:100%;float:left;clear:left;margin-right:-315px;}#pages-left .inside{margin-top:20px;margin-right:315px;}#nav-container{margin-top:-3px;}.sidebar-name{background-color:#AAA;background-image:url(../../../../../wp-admin/images/ed-bg.gif);border-color:#DFDFDF;text-shadow:0 1px 0 #FFF;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;background-position:0 0;background-repeat:repeat-x;border-style:solid;border-width:1px;cursor:pointer;font-size:13px;}.sidebar-name h3{font-size:13px;height:19px;margin:0;overflow:hidden;padding:5px 12px;white-space:nowrap;}.sidebar-name-arrow{background:transparent url(../../../../../wp-admin/images/menu-bits.gif) no-repeat scroll left -109px;float:right;height:29px;width:26px;}#menu-right{width:285px;margin-right:10px;margin-left:20px;float:left;clear:right;}h2.heading{margin:32px 0 10px 0;}.widgets-holder-wrap{margin:0 0 20px 0;}.widget-holder{padding:15px 10px;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;border-style:none solid solid;border-width:0 1px 1px;background-color:#F1F1F1;border-color:#DDD;}.checkboxes{float:right;margin:10px 12px 0 0;}.addtomenu{display:block;float:right;margin:10px 0 0 0;text-shadow:0 -1px 0 rgba(0,0,0,0.3);background:#21759B url(../../../../../wp-admin/images/button-grad.png) repeat-x scroll left top;border-color:#298CBA!important;color:#FFF!important;font-weight:bold;-moz-border-radius-bottomleft:11px;-moz-border-radius-bottomright:11px;-moz-border-radius-topleft:11px;-moz-border-radius-topright:11px;border-style:solid;border-width:1px;cursor:pointer;font-size:11px!important;line-height:16px;padding:2px 8px;text-decoration:none;}.list{zoom:1;}.list li{margin:0;}.list dt{display:none;float:left;width:260px;margin:0;padding:0 0 0 5px;line-height:30px;border-bottom:1px solid #e3e3e3;}.list dt span{float:left;}.list dt img{cursor:pointer;float:right;margin:7px 5px 0 0;}#nav-container{padding:0 10px 10px 10px;background-color:#fff;border:1px solid #DFDFDF;border-top:none;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;}#custom-nav ul{width:100%;}#custom-nav li{margin:0;}.ui-draggable-dragging{width:500px;}#custom-nav li dl dt{-webkit-border-bottom-left-radius:6px;-webkit-border-bottom-right-radius:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-bottomright:6px;-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;border:1px solid #E6E6E6;position:relative;padding-left:10px;background-color:#f1f1f1;height:35px;line-height:35px;}#custom-nav li dl dt:hover{cursor:move;}#custom-nav li dl dt .controls{position:absolute;right:15px;top:-1px;}#custom-nav li dl dt img{vertical-align:middle;}#custom-nav li .title{background:url(../images/ico-arrow.png) no-repeat 4px 5px;padding-left:15px;}#custom-nav li ul li{margin-left:20px;opacity:.7;}#custom-nav li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li ul li{opacity:.95;}#existing-pages li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-pages li ul li .title{margin-left:10px;}#existing-pages li ul li ul li .title{margin-left:20px;}#existing-pages li ul li ul li ul li .title{margin-left:30px;}#existing-pages li ul li ul li ul li ul li .title{margin-left:40px;}#existing-pages li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-pages li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}#existing-categories li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-categories li ul li .title{margin-left:10px;}#existing-categories li ul li ul li .title{margin-left:20px;}#existing-categories li ul li ul li ul li .title{margin-left:30px;}#existing-categories li ul li ul li ul li ul li .title{margin-left:40px;}#existing-categories li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-categories li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}img.remove,img.edit{cursor:pointer;margin:0 5px 0 0;}.dropzone{height:7px;margin:3px 0 3px 0;}.hide{display:none;}.type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}#menu_select{width:170px;}#dialog-confirm label{padding-left:10px;}.ui-dialog{background:#fff;border:1px solid #555;-moz-box-shadow:0 4px 30px #000;}.ui-dialog-titlebar{color:#CFCFCF;font-family:"Lucida Grande",Verdana,Arial,sans-serif;padding:6px 10px 6px;background-color:#222!important;border:none!important;-moz-border-radius:none!important;}#dialog-confirm{height:168px!important;padding:20px 10px 10px;}#dialog-confirm input{margin:0 0 15px 0;width:280px;}#dialog-confirm select{margin:0 0 15px 0;}.ui-dialog-buttonpane{padding:10px;}.ui-dialog-buttonpane button{margin:0 10px 0 0;background:#F2F2F2;text-shadow:0 1px 0 #FFF;border-color:#BBB;color:#464646;-moz-border-radius-bottomleft:11px;-moz-border-radius-bottomright:11px;-moz-border-radius-topleft:11px;-moz-border-radius-topright:11px;border-style:solid;border-width:1px;cursor:pointer;font-size:11px!important;line-height:14px;padding:2px 8px;text-decoration:none;}.ui-dialog-buttonpane button:hover{color:#000;border-color:#666;}.ui-icon{display:none;}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%;}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);-moz-border-radius:8px;-webkit-border-radius:8px;}#reset_wp_menu{background:#c77 none!important;color:white!important;text-shadow:0 1px 0 #555!important;}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadmincsscustomnavigationdevcss"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/css/custom-navigation.dev.css (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/custom-navigation.dev.css         (rev 0)
+++ trunk/wp-admin/css/custom-navigation.dev.css        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1,168 @@
</span><ins>+/**
+ * WordPress Administration Custom Navigation
+ * Interface CSS
+ *
+ * @author Jeffikus <pearce.jp@gmail.com>
+ * @version 1.1.0
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+.fix{clear: both;height: 1px;margin: -1px 0 0;overflow: hidden;}
+
+#no-js {display:block;}
+
+.maintitle { margin: 0 0 20px 0!important;}
+
+.logo { vertical-align: middle; margin: 0 10px 0 0; }
+
+#pages-left { min-width:650px;max-width:1100px;width: 100%; float:left; clear: left; margin-right: -315px; }
+#pages-left .inside {margin-top: 20px; margin-right: 315px; }
+#nav-container { margin-top: -3px; }
+
+.sidebar-name { background-color:#AAAAAA;
+background-image:url(../../../../../wp-admin/images/ed-bg.gif);
+border-color:#DFDFDF;
+text-shadow:0 1px 0 #FFFFFF;-moz-border-radius-topleft:8px;
+-moz-border-radius-topright:8px;
+background-position:0 0;
+background-repeat:repeat-x;
+border-style:solid;
+border-width:1px;
+cursor:pointer;
+font-size:13px; }
+
+
+.sidebar-name h3 {
+font-size:13px;
+height:19px;
+margin:0;
+overflow:hidden;
+padding:5px 12px;
+white-space:nowrap;
+}
+
+.sidebar-name-arrow {
+background:transparent url(../../../../../wp-admin/images/menu-bits.gif) no-repeat scroll left -109px;
+float:right;
+height:29px;
+width:26px;
+}
+
+#menu-right { width: 285px; margin-right: 10px; margin-left: 20px; float:left; clear: right;}
+h2.heading { margin: 32px 0 10px 0; }
+
+.widgets-holder-wrap { margin: 0 0 20px 0; }
+.widget-holder {
+padding:15px 10px;
+-moz-border-radius-bottomleft:8px;
+-moz-border-radius-bottomright:8px;
+border-style:none solid solid;
+border-width:0 1px 1px;
+background-color:#F1F1F1;
+border-color:#DDDDDD;
+}
+
+.checkboxes { float: right; margin: 10px 12px 0 0; }
+
+.addtomenu {
+display: block;
+float: right;
+margin: 10px 0 0 0;
+text-shadow:0 -1px 0 rgba(0, 0, 0, 0.3);
+background:#21759B url(../../../../../wp-admin/images/button-grad.png) repeat-x scroll left top;
+border-color:#298CBA !important;
+color:#FFFFFF !important;
+font-weight:bold;
+-moz-border-radius-bottomleft:11px;
+-moz-border-radius-bottomright:11px;
+-moz-border-radius-topleft:11px;
+-moz-border-radius-topright:11px;
+border-style:solid;
+border-width:1px;
+cursor:pointer;
+font-size:11px !important;
+line-height:16px;
+padding:2px 8px;
+text-decoration:none;
+}
+
+.list { zoom: 1; }
+.list li { margin: 0; }
+.list dt { display:none; float: left; width: 260px; margin: 0; padding: 0 0 0 5px; line-height: 30px; border-bottom: 1px solid #e3e3e3; }
+.list dt span { float: left; }
+.list dt img { cursor: pointer; float: right; margin: 7px 5px 0 0 }
+
+#nav-container { padding: 0 10px 10px 10px; background-color: #fff; border: 1px solid #DFDFDF; border-top: none; -moz-border-radius-bottomleft:8px; -moz-border-radius-bottomright:8px; }
+
+#custom-nav ul { width: 100%; }
+#custom-nav li { margin: 0; }
+.ui-draggable-dragging { width: 500px; }
+#custom-nav li dl dt { -webkit-border-bottom-left-radius:6px;-webkit-border-bottom-right-radius:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-bottomright:6px;-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;
+border:1px solid #E6E6E6;position: relative; padding-left:10px;background-color: #f1f1f1; height: 35px; line-height: 35px; }
+#custom-nav li dl dt:hover { cursor: move; }
+#custom-nav li dl dt .controls { position: absolute; right: 15px; top: -1px; }
+#custom-nav li dl dt img { vertical-align: middle; }
+#custom-nav li dl dt a {}
+#custom-nav li .title { background:url(../images/ico-arrow.png) no-repeat 4px 5px; padding-left:15px; }
+#custom-nav li ul li { margin-left:20px; opacity:.7;}
+#custom-nav li ul li ul li { opacity: .9;}
+#custom-nav li ul li ul li ul li { opacity: .9;}
+#custom-nav li ul li ul li ul li ul li { opacity: .95; }
+
+#existing-pages li .title { background:url(../images/ico-arrow.png) no-repeat 4px 13px; padding-left:15px; }
+#existing-pages li ul li .title { margin-left:10px; }
+#existing-pages li ul li ul li .title { margin-left:20px; }
+#existing-pages li ul li ul li ul li .title { margin-left:30px; }
+#existing-pages li ul li ul li ul li ul li .title { margin-left:40px; }
+#existing-pages li ul li ul li ul li ul li ul li .title { margin-left:50px; }
+#existing-pages li ul li ul li ul li ul li ul li ul li .title { margin-left:60px; }
+#existing-pages li ul li ul li ul li ul li ul li ul li ul li .title { margin-left:70px; }
+#existing-pages li ul li ul li ul li ul li ul li ul li ul li ul li .title { margin-left:80px; }
+
+#existing-categories li .title { background:url(../images/ico-arrow.png) no-repeat 4px 13px; padding-left:15px; }
+#existing-categories li ul li .title { margin-left:10px; }
+#existing-categories li ul li ul li .title { margin-left:20px; }
+#existing-categories li ul li ul li ul li .title { margin-left:30px; }
+#existing-categories li ul li ul li ul li ul li .title { margin-left:40px; }
+#existing-categories li ul li ul li ul li ul li ul li .title { margin-left:50px; }
+#existing-categories li ul li ul li ul li ul li ul li ul li .title { margin-left:60px; }
+#existing-categories li ul li ul li ul li ul li ul li ul li ul li .title { margin-left:70px; }
+#existing-categories li ul li ul li ul li ul li ul li ul li ul li ul li .title { margin-left:80px; }
+
+
+img.remove, img.edit { cursor: pointer; margin: 0 5px 0 0; }
+
+.dropzone {height:7px;margin: 3px 0 3px 0;}
+
+#custom-nav li dl {}
+
+.hide {display:none;}
+
+.type { text-transform: uppercase; font-size: 11px; color: #999999; padding-right:10px; }
+
+#menu_select { width: 170px; }
+
+#dialog-confirm label { padding-left: 10px; }
+
+/* EDIT LINK BOX */
+.ui-dialog { background: #fff; border: 1px solid #555555; -moz-box-shadow:0 4px 30px #000000; }
+.ui-dialog-titlebar { color: #CFCFCF;font-family:"Lucida Grande",Verdana,Arial,sans-serif; padding: 6px 10px 6px; background-color: #222222!important; border: none!important; -moz-border-radius: none!important; }
+#dialog-confirm { height: 168px !important; padding: 20px 10px 10px; }
+#dialog-confirm input { margin: 0 0 15px 0; width: 280px; }
+#dialog-confirm select { margin: 0 0 15px 0; }
+.ui-dialog-buttonpane { padding: 10px; }
+.ui-dialog-buttonpane button { margin: 0 10px 0 0; background:#F2F2F2; text-shadow:0 1px 0 #FFFFFF; border-color:#BBBBBB; color:#464646; -moz-border-radius-bottomleft:11px; -moz-border-radius-bottomright:11px; -moz-border-radius-topleft:11px; -moz-border-radius-topright:11px; border-style:solid; border-width:1px; cursor:pointer; font-size:11px !important; line-height:14px; padding:2px 8px; text-decoration:none; }
+
+.ui-dialog-buttonpane button:hover {color:#000;border-color:#666;}
+
+.ui-icon { display: none; }
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); }
+.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 8px; -webkit-border-radius: 8px; }
+
+
+#reset_wp_menu { background:#c77 none !important;color:white!important;text-shadow:0 1px 0 #555 !important;}
</ins></span></pre></div>
<a id="trunkwpadmincustomnavigationphp"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/custom-navigation.php (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/custom-navigation.php         (rev 0)
+++ trunk/wp-admin/custom-navigation.php        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1,590 @@
</span><ins>+<?php
+/**
+ * WordPress Administration Custom Navigation
+ * Interface functions
+ *
+ * @author Jeffikus <pearce.jp@gmail.com>
+ * @version 1.1.0
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+require_once('admin.php');
+
+wp_admin_css( 'custom-navigation' );
+wp_enqueue_script( 'custom-navigation-jquery' );
+wp_enqueue_script( 'custom-navigation-ui-custom' );
+wp_enqueue_script( 'custom-navigation-dynamic-functions' );
+wp_enqueue_script( 'custom-navigation-default-items' );
+wp_enqueue_script( 'custom-navigation-autocomplete' );
+wp_enqueue_script( 'custom-navigation-php-functions' );
+wp_enqueue_script( 'jquery-ui-dialog' );
+
+require_once('admin-header.php');
+require_once (ABSPATH . WPINC . '/custom-navigation-functions.php');
+
+wp_custom_navigation();
+
+function wp_custom_nav_reset() {
+        
+        global $wpdb;
+        
+        $table_name = $wpdb->prefix . "custom_nav_records";                 
+        //DROP existing menu records
+        $wpdb->query("DELETE FROM ".$table_name);
+        
+        $table_name_menus = $wpdb->prefix . "custom_nav_menus";                 
+        //DELETE existing menus
+        $wpdb->query("DELETE FROM ".$table_name_menus);
+        
+        wp_custom_navigation_setup(true);
+                
+        return true;
+        
+}
+
+
+/*-----------------------------------------------------------------------------------*/
+/* Custom Navigation Admin Interface
+/* wp_custom_navigation() is the main function for the Custom Navigation
+/* See functions in admin-functions.php
+/*-----------------------------------------------------------------------------------*/
+
+function wp_custom_navigation() {
+        global $wpdb, $user_ID;
+        ?>
+
+        <div class="wrap">
+        <div id="no-js"><h3>You do not have JavaScript enabled in your browser. Please enabled it to access the Custom Menu functionality.</h3></div>
+                        
+        <?php
+        $messagesdiv = '';
+        $menu_id_in_edit = 0;
+        
+        //Get the theme name
+        $themename = get_current_theme();
+        
+        //CHECK which menu is selected and if menu is in edit already
+        if ( isset( $_POST['switch_menu'] ) )
+                $menu_selected_id = $_POST['menu_select'];
+        elseif ( isset( $_POST['menu_id_in_edit'] ) )
+                $menu_selected_id = $_POST['menu_id_in_edit'];
+        
+        //Default Menu to show
+        $custom_menus = get_terms( 'menu', array( 'hide_empty' => false ) );
+         if ( !empty( $custom_menus ) )
+                $menu_selected_id = $custom_menus[0]->term_id;
+
+        $menu_title = '';
+        if ( $menu_selected_id > 0 ) {
+                foreach( $custom_menus as $menu ) {
+                        if ( $menu->term_id == $menu_selected_id ) {
+                                $menu_title = $menu->name;
+                                break;
+                        }
+                }
+        }
+        
+        if ( isset( $_POST['set_wp_menu'] ) ) {
+                 update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] );
+                $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
+        }
+        
+        if ( isset( $_POST['licount'] ) )
+                $postCounter = $_POST['licount'];
+        else
+                 $postCounter = 0;
+                
+        if ( isset( $_POST['add_menu'] ) ) {
+                 $insert_menu_name = $_POST['add_menu_name'];
+
+                 if ( $insert_menu_name != '' ) {
+                        $existing_term = get_term_by( 'name', $insert_menu_name, 'menu' );
+                         if ( $existing_term ) {
+                                 $messagesdiv = '<div id="message" class="error fade below-h2"><p>'.$insert_menu_name.' Menu has already created - please try another name</p></div>';
+                         } else {
+                                $term = wp_insert_term( $insert_menu_name, 'menu' );
+                                if ( $term ) {
+                                        $custom_menus[$term['term_id']] = $term;
+                                         $menu_selected_id = $term['term_id'];
+                                         $menu_id_in_edit = $menu_selected_id;
+                                         $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$insert_menu_name.' Menu has been created!</p></div>';        
+
+                                        $postCounter = 0;
+                                 }
+                         }
+                 } else {
+                         $messagesdiv = '<div id="message" class="error fade below-h2"><p>Please enter a valid Menu name</p></div>';
+                 }
+                         
+                        
+        }
+                
+        if (isset($_POST['reset_wp_menu'])) {        
+                 $success = wp_custom_nav_reset();
+                 if ($success) {
+                         //DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly
+                         $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been RESET!</p></div>';
+                         //GET reset menu id
+                        $custom_menus = array();
+                        $menu_selected_id = 0;
+                 } else {
+                         //DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly
+                        $messagesdiv = '<div id="message" class="error fade below-h2"><p>'.$themename.'s Custom Menu could not be RESET. Please try again.</p></div>';
+                 }
+        } elseif ( $postCounter > 0 && $menu_selected_id > 0 ) {
+                $menu_objects = get_objects_in_term( $menu_selected_id, 'menu' );
+                $menu_items = wp_custom_navigation_get_menu_items( $menu_objects );
+
+                $update_fields = array( 'menu_order', 'guid', 'post_content', 'post_title', 'post_excerpt', 'post_content_filtered' );
+                //Loop through all POST variables
+                 for ($k = 1;$k<= $postCounter; $k++) {
+                         
+                         if (isset($_POST['dbid'.$k])) { $db_id = $_POST['dbid'.$k]; } else { $db_id = 0; }
+                         if (isset($_POST['postmenu'.$k])) { $post_id = $_POST['postmenu'.$k]; } else { $post_id = 0; }
+//@todo implement heirarchy
+                        if (isset($_POST['parent'.$k])) { $parent_id = $_POST['parent'.$k]; } else { $parent_id = 0; }
+                         if (isset($_POST['title'.$k])) { $custom_title = stripslashes($_POST['title'.$k]); } else { $custom_title = ''; }
+                         if (isset($_POST['linkurl'.$k])) { $custom_linkurl = $_POST['linkurl'.$k]; } else { $custom_linkurl = ''; }
+                         if (isset($_POST['description'.$k])) { $custom_description = stripslashes($_POST['description'.$k]); } else { $custom_description = ''; }
+// doesn't seem to be used by UI
+                        if (isset($_POST['icon'.$k])) { $icon = $_POST['icon'.$k]; } else { $icon = 0; }
+                         if (isset($_POST['position'.$k])) { $position = $_POST['position'.$k]; } else { $position = 0; }
+                         if (isset($_POST['linktype'.$k])) { $linktype = $_POST['linktype'.$k]; } else { $linktype = 'custom'; }
+                         if (isset($_POST['anchortitle'.$k])) { $custom_anchor_title = stripslashes($_POST['anchortitle'.$k]); } else { $custom_anchor_title = $custom_title; }
+                         if (isset($_POST['newwindow'.$k])) { $new_window = $_POST['newwindow'.$k]; } else { $new_window = 0; }
+                         
+                        $post = array( 'post_status' => 'menu-' . $linktype, 'post_type' => 'menu_item', 'post_author' => $user_ID,
+                                'ping_status' => 0, 'post_parent' => $post_id, 'menu_order' => $position,
+                                'guid' => $custom_linkurl, 'post_excerpt' => $custom_anchor_title, 'tax_input' => array( 'menu' => $menu_title ),
+                                'post_content' => $custom_description, 'post_title' => $custom_title );
+                        if ( $new_window )
+                                $post['post_content_filtered'] = '_blank';
+                        else
+                                $post['post_content_filtered'] = '';
+
+                        //New menu item
+                         if ($db_id == 0) {
+                                $post_id = wp_insert_post( $post );
+                        } elseif ( isset( $menu_items[$db_id] ) ) {
+                                foreach( $update_fields as $field ) {
+                                        if ( $post[$field] != $menu_items[$db_id]->$field ) {
+                                                $post['ID'] = $db_id;
+                                                wp_insert_post( $post );
+                                                break;
+                                        }
+                                }
+                                unset( $menu_items[$db_id] );
+                        }
+                }
+                if ( !empty( $menu_items ) ) {
+                        foreach( array_keys( $menu_items ) as $menu_id ) {
+                                wp_delete_post( $menu_id );
+                        }
+                }
+                //DISPLAY SUCCESS MESSAGE IF POST CORRECT
+                $messagesdiv = '<div id="message" class="updated fade below-h2"><p>'.$themename.'s Custom Menu has been updated!</p></div>';
+        }
+                 
+                 //DISPLAY Custom Navigation
+                 ?>
+                <div id="pages-left">
+                        <div class="inside">
+                        <h2 class="maintitle">Custom Navigation</h2>
+                        <?php
+                                
+                                //CHECK if custom menu has been enabled
+                                $enabled_menu = get_option('wp_custom_nav_menu');
+                         $checked = strtolower($enabled_menu);
+        
+                                if ($checked == 'true') {
+                                } else {
+                                        echo '<div id="message-enabled" class="error fade below-h2"><p><strong>The Custom Menu has not been Enabled yet. Please enable it in order to use it --------></strong></p></div>';
+                                }
+                                
+                                
+                        ?>
+                        <?php echo $messagesdiv; ?>
+                        <form onsubmit="updatepostdata()" action="custom-navigation.php" method="post" enctype="multipart/form-data">
+                        
+                        <input type="hidden" name="licount" id="licount" value="0" />
+                        <input type="hidden" name="menu_id_in_edit" id="menu_id_in_edit" value="<?php echo $menu_selected_id; ?>" />
+                        
+                        <div class="sidebar-name">
+                        
+                                <div class="sidebar-name-arrow">
+                                        <br/>
+                                </div>
+                                <h3><?php echo $menu_title; ?></h3>
+                                
+                        </div>
+                        
+                        <div id="nav-container">
+                                <ul id="custom-nav">
+                                
+                        <?php
+                        //DISPLAY existing menu
+                        if ( $menu_selected_id > 0 ) {
+                                //SET output type
+                                $output_type = "backend";
+                                //MAIN OUTPUT FUNCTION
+                                wp_custom_navigation_output( 'type='.$output_type.'&name='.$menu_title.'&id='.$menu_selected_id );
+                        }                                
+                        ?>
+                                
+                                </ul>
+                        </div><!-- /#nav-container -->
+                        
+                        <p class="submit">
+                        
+                        <script type="text/javascript">
+                                updatepostdata();                 
+                        </script>
+                        
+                        <input id="save_bottom" name="save_bottom" type="submit" value="Save All Changes" /></p>
+                        </div><!-- /.inside -->
+                </div>
+                
+                <div id="menu-right">
+                
+                        <h2 class="heading">Options</h2>
+                        
+                        <div class="widgets-holder-wrap">
+                                <div class="sidebar-name">
+                                        <div class="sidebar-name-arrow"></div>
+                                        <h3>Setup Custom Menu</h3>
+                                </div>
+                                <div class="widget-holder">
+                                                
+                                        <?php
+                                 
+                                 //SETUP Custom Menu
+                                 
+                                        $enabled_menu = get_option('wp_custom_nav_menu');
+                                        
+                                 $checked = strtolower($enabled_menu);
+         
+                                 ?>
+                                 
+                                 <span >
+                                         <label>Enable</label><input type="radio" name="enable_wp_menu" value="true" <?php if ($checked=='true') { echo 'checked="checked"'; } ?> />
+                                         <label>Disable</label><input type="radio" name="enable_wp_menu" value="false" <?php if ($checked=='true') { } else { echo 'checked="checked"'; } ?> />
+                                        </span><!-- /.checkboxes -->                                
+                                                
+                                        <input id="set_wp_menu" type="submit" value="Set Menu" name="set_wp_menu" class="button" /><br />
+                                        
+                                        <span>
+                                                <label>Reset Menu to Default</label>
+                                                <input id="reset_wp_menu" type="submit" value="Reset" name="reset_wp_menu" class="button" onclick="return confirm('Are you sure you want to RESET the Custom Navigation Menu to its Default Settings?');" />
+                                        </span>
+                                        
+                                        <div class="fix"></div>
+                                </div>
+                        </div><!-- /.widgets-holder-wrap -->
+                        
+                        <div class="widgets-holder-wrap">
+                                <div class="sidebar-name">
+                                        <div class="sidebar-name-arrow"></div>
+                                        <h3>Menu Selector</h3>
+                                </div>
+                                <div class="widget-holder">
+                                        <select id="menu_select" name="menu_select">
+                                                <?php
+                                                
+                                                //DISPLAY SELECT OPTIONS
+                                                foreach( $custom_menus as $menu ) {
+                                                        $menu_term = get_term( $menu, 'menu' );
+                                                        if ( ( $menu_id_in_edit == $menu ) || ( $menu_selected_id == $menu ) )
+                                                                $selected_option = 'selected="selected"';
+                                                        else
+                                                                $selected_option = '';
+                                                        ?>
+                                                        <option value="<?php echo $menu_term->term_id; ?>" <?php echo $selected_option; ?>><?php echo $menu_term->name; ?></option>
+                                                        <?php
+                                                        
+                                                }
+                                                ?>
+                                        </select>
+                                        
+                                        <input id="switch_menu" type="submit" value="Switch" name="switch_menu" class="button" />
+                                        <input id="add_menu_name" name="add_menu_name" type="text" value="" />
+                                        <input id="add_menu" type="submit" value="Add Menu" name="add_menu" class="button" />
+                                                
+                                        <div class="fix"></div>
+                                </div>
+                        </div><!-- /.widgets-holder-wrap -->
+                        <?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?>
+                        <div class="widgets-holder-wrap" style="display:none;">
+                                <div class="sidebar-name">
+                                        <div class="sidebar-name-arrow"></div>
+                                        <h3>Top Level Menu Descriptions</h3>
+                                </div>
+                                <div class="widget-holder">        
+                                        <span>Display Descriptions in Top Level Menu?</span>
+                        
+                                        <?php
+                                 
+                                 //UPDATE and DISPLAY Menu Description Option
+                                 if (isset($_POST['menu-descriptions']))
+                                 {
+                                         
+                                                if (isset($_POST['switch_menu'])) {
+                                                        
+                                                }
+                                                else {
+                                                        $menu_options_to_edit = $_POST['menu_id_in_edit'];
+                                                 update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']);        
+                                                }
+                                         
+                                 }
+                                 
+                                 if ($menu_id_in_edit > 0)
+                                        {
+                                                $checkedraw = get_option('wp_settings_custom_nav_'.$menu_id_in_edit.'_descriptions');
+                                        }
+                                        else {
+                                                $checkedraw = get_option('wp_settings_custom_nav_'.$menu_selected_id.'_descriptions');
+                                        }
+                        
+                                 $checked = strtolower($checkedraw);
+                                 
+                                 if ($advanced_option_descriptions == 'no')
+                                 {
+                                         $checked = 'no';
+                                 }
+                                 
+                                 ?>
+                                 
+                                 <span class="checkboxes">
+                                         <label>Yes</label><input type="radio" name="menu-descriptions" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
+                                         <label>No</label><input type="radio" name="menu-descriptions" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
+                                        </span><!-- /.checkboxes -->
+                                 </form>
+                                        <div class="fix"></div>
+                                </div>
+                        </div><!-- /.widgets-holder-wrap -->
+                        
+                        <div class="widgets-holder-wrap">
+                                <div class="sidebar-name">
+                                        <div class="sidebar-name-arrow"></div>
+                                        <h3>Add an Existing Page</h3>
+                                </div>
+                                <div class="widget-holder">
+                                        
+                                        <?php
+                                        
+                                        $pages_args = array(
+                                 'child_of' => 0,
+                                        'sort_order' => 'ASC',
+                                        'sort_column' => 'post_title',
+                                        'hierarchical' => 1,
+                                        'exclude' => '',
+                                        'include' => '',
+                                        'meta_key' => '',
+                                        'meta_value' => '',
+                                        'authors' => '',
+                                        'parent' => -1,
+                                        'exclude_tree' => '',
+                                        'number' => '',
+                                        'offset' => 0 );
+        
+                                        //GET all pages                
+                                        $pages_array = get_pages($pages_args);
+                                        $page_name = '';
+                                        //CHECK if pages exist
+                                        if ($pages_array)
+                                        {
+                                                foreach ($pages_array as $post)
+                                                {
+                                                        //Add page name to
+                                                        $page_name .= htmlentities($post->post_title).'|';
+                                                }
+                                        }
+                                        else
+                                        {
+                                                $page_name = "No pages available";
+                                        }
+                                                
+                                        ?>
+                                        
+                                        <script>
+                                                 $(document).ready(function(){
+
+                                                        //GET PHP pages
+                                                 var dataposts = "<?php echo $page_name; ?>".split("|");
+                                                
+                                                        //Set autocomplete
+                                                        $("#page-search").autocomplete(dataposts);
+                                                
+                                                        //Handle autocomplete result
+                                                        $("#page-search").result(function(event, data, formatted) {
+                                                         $('#existing-pages').css('display','block');
+                                                         $("#existing-pages dt:contains('" + data + "')").css("display", "block");
+                                                 
+                                                         $('#show-pages').hide();
+                                                         $('#hide-pages').show();
+                                                 
+                                                        });
+                                                        $('#existing-pages').css('display','none');
+                                                 });
+                                         </script>
+
+
+                                        <input type="text" onfocus="jQuery('#page-search').attr('value','');" id="page-search" value="Search Pages" />
+                                        
+                                        <a id="show-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();">View All</a>
+                                        <a id="hide-pages" style="cursor:pointer;" onclick="jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide();">Hide All</a>
+                                        
+                                        <script type="text/javascript">
+                                        
+                                                jQuery('#hide-pages').hide();
+                                        
+                                        </script>
+                                        
+                                        <ul id="existing-pages" class="list">
+                                                <?php
+                                                        $intCounter = 0;
+                                                        //Get default Pages
+                                                        $intCounter = wp_custom_nav_get_pages($intCounter,'default');
+                                                ?>
+                                        </ul>
+                                        
+                                        <div class="fix"></div>
+                                        
+                                </div>
+                        </div><!-- /.widgets-holder-wrap -->
+                        
+                        <div class="widgets-holder-wrap">
+                                <div class="sidebar-name">
+                                        <div class="sidebar-name-arrow"></div>
+                                        <h3>Add an Existing Category</h3>
+                                </div>
+                                <div class="widget-holder">
+                                        
+                                        <?php
+                                        
+                                        //Custom GET categories query
+                                        $categories = $wpdb->get_results("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC");
+                                        $cat_name = '';
+                                        //CHECK for results
+                                        if ($categories)
+                                        {
+                                                foreach($categories as $category)
+                                                {
+                                                        $cat_id = $category->term_id;
+                                
+                                                        $cat_args=array(
+                                                                 'orderby' => 'name',
+                                                                 'include' => $cat_id,
+                                                                 'hierarchical' => 1,
+                                                                 'order' => 'ASC'
+                                                         );
+                                                         
+                                                         $category_names=get_categories($cat_args);
+                                                        
+                                                        if (isset($category_names[0]->name))
+                                                        {
+                                                                //Add category name to data string
+                                                                $cat_name .= htmlentities($category_names[0]->name).'|';
+                                                        }
+                                                 }
+                                         }
+                                         else
+                                        {
+                                                $cat_name = "No categories available";
+                                        }
+                                
+                                        ?>
+
+                                        <script>
+                                                 $(document).ready(function(){
+
+                                                        //GET PHP categories
+                                                 var datacats = "<?php echo $cat_name; ?>".split("|");
+                                                        
+                                                        //Set autocomplete
+                                                        $("#cat-search").autocomplete(datacats);
+                                                
+                                                        //Handle autocomplete result
+                                                        $("#cat-search").result(function(event, data, formatted) {
+                                                         $('#existing-categories').css('display','block');
+                                                         $("#existing-categories dt:contains('" + data + "')").css("display", "block");
+                                                                                                  
+                                                         $('#show-cats').hide();
+                                                         $('#hide-cats').show();
+                                                 
+                                                        });
+                                                        $('#existing-categories').css('display','none');
+                                        
+                                                 });
+                                         </script>
+
+
+                                        <input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="Search Categories" />
+                                        
+                                        <a id="show-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();">View All</a>
+                                        <a id="hide-cats" style="cursor:pointer;" onclick="jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide();">Hide All</a>
+                                        
+                                        <script type="text/javascript">
+                                        
+                                                jQuery('#hide-cats').hide();
+                                        
+                                        </script>
+                                        
+                                        <ul id="existing-categories" class="list">
+                         <?php
+                                                         //Get default Categories
+                                 $intCounter = wp_custom_nav_get_categories($intCounter,'default');                                 
+                                                ?>
+                                 </ul>
+                                 
+                                 <div class="fix"></div>
+                                        
+                                </div>
+                        </div><!-- /.widgets-holder-wrap -->
+                        
+                        <div class="widgets-holder-wrap">
+                                <div class="sidebar-name">
+                                        <div class="sidebar-name-arrow"></div>
+                                        <h3>Add a Custom Url</h3>
+                                </div>
+                                <div class="widget-holder">
+                                        <input id="custom_menu_item_url" type="text" value="http://" />
+                                        <label>URL</label><br />
+                         <?php $templatedir = get_bloginfo('url'); ?>
+                 <input type="hidden" id="templatedir" value="<?php echo $templatedir; ?>" />
+                 <input id="custom_menu_item_name" type="text" value="Menu Item" onfocus="jQuery('#custom_menu_item_name').attr('value','');" />
+                 <label>Menu Text</label><br />
+                         <input id="custom_menu_item_description" type="text" value="A description" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> onfocus="jQuery('#custom_menu_item_description').attr('value','');" />
+                         <label <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> >Description</label>
+                         <a class="addtomenu" onclick="appendToList('<?php echo $templatedir; ?>','Custom','','','','0','');jQuery('#custom_menu_item_name').attr('value','Menu Item');jQuery('#custom_menu_item_description').attr('value','A description');">Add to menu</a>
+                                        <div class="fix"></div>
+                                </div>
+                        </div><!-- /.widgets-holder-wrap -->
+                        
+ </div>
+ </div>
+
+ <script type="text/javascript">
+                document.getElementById('pages-left').style.display='block';
+                document.getElementById('menu-right').style.display='block';
+                document.getElementById('no-js').style.display='none';
+        </script>
+        
+        <div id="dialog-confirm" title="Edit Menu Item">
+                </label><input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle">Menu Title</label><br />
+                <input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink">URL</label><br />
+                <input id="editanchortitle" type="text" name="editanchortitle" value="" /><label class="editlabel" for="editanchortitle" >Link Title</label><br />
+                <select id="editnewwindow" name="editnewwindow">
+                        <option value="1" >Yes</option>
+                        <option value="0" >No</option>
+                </select><label class="editlabel" for="editnewwindow" >Open Link in a New Window</label>
+                <input id="editdescription" type="text" name="editdescription" value="" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> /><label class="editlabel" for="editdescription" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> >Description</label><br />
+        </div>
+
+<?php
+
+}
+
+include("admin-footer.php");
</ins></span></pre></div>
<a id="trunkwpadminjscustomnavigationcustomjquery132devjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-custom-jquery-1.3.2.dev.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-custom-jquery-1.3.2.dev.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-custom-jquery-1.3.2.dev.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
+/*
+ * Sizzle CSS Selector Engine - v0.9.3
+ * Copyright 2009, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ * More information: http://sizzlejs.com/
+ */
+(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationcustomjquery132js"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-custom-jquery-1.3.2.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-custom-jquery-1.3.2.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-custom-jquery-1.3.2.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+(function(){var W=this,ab,F=W.jQuery,S=W.$,T=W.jQuery=W.$=function(b,a){return new T.fn.init(b,a)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ac=/^.[^:#\[\.,]*$/;T.fn=T.prototype={init:function(e,b){e=e||document;if(e.nodeType){this[0]=e;this.length=1;this.context=e;return this}if(typeof e==="string"){var c=M.exec(e);if(c&&(c[1]||!b)){if(c[1]){e=T.clean([c[1]],b)}else{var a=document.getElementById(c[3]);if(a&&a.id!=c[3]){return T().find(e)}var d=T(a||[]);d.context=document;d.selector=e;return d}}else{return T(b).find(e)}}else{if(T.isFunction(e)){return T(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(T.isArray(e)?e:T.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===ab?Array.prototype.slice.call(this):this[a]},pushStack:function(c,a,d){var b=T(c);b.prevObject=this;b.context=this.context;if(a==="find"){b.selector=this.selector+(this.selector?" ":"")+d}else{if(a){b.selector=this.selector+"."+a+"("+d+")"}}return b},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return T.each(this,a,b)},index:function(a){return T.inArray(a&&a.jquery?a[0]:a,this)},attr:function(c,a,b){var d=c;if(typeof c==="string"){if(a===ab){return this[0]&&T[b||"attr"](this[0],c)}else{d={};d[c]=a}}return this.each(function(e){for(c in d){T.attr(b?this.style:this,c,T.prop(this,d[c],b,e,c))}})},css:function(b,a){if((b=="width"||b=="height")&&parseFloat(a)<0){a=ab}return this.attr(b,a,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a))}var b="";T.each(a||this,function(){T.each(this.childNodes,function(){if(this.nodeType!=8){b+=this.nodeType!=1?this.nodeValue:T.fn.text([this])}})});return b},wrapAll:function(b){if(this[0]){var a=T(b,this[0].ownerDocument).clone();if(this[0].parentNode){a.insertBefore(this[0])}a.map(function(){var c=this;while(c.firstChild){c=c.firstChild}return c}).append(this)}return this},wrapInner:function(a){return this.each(function(){T(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){T(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.appendChild(a)}})},prepend:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.insertBefore(a,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||T([])},push:[].push,sort:[].sort,splice:[].splice,find:function(b){if(this.length===1){var a=this.pushStack([],"find",b);a.length=0;T.find(b,this[0],a);return a}else{return this.pushStack(T.unique(T.map(this,function(c){return T.find(b,c)})),"find",b)}},clone:function(b){var d=this.map(function(){if(!T.support.noCloneEvent&&!T.isXMLDoc(this)){var f=this.outerHTML;if(!f){var e=this.ownerDocument.createElement("div");e.appendChild(this.cloneNode(true));f=e.innerHTML}return T.clean([f.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(b===true){var a=this.find("*").andSelf(),c=0;d.find("*").andSelf().each(function(){if(this.nodeName!==a[c].nodeName){return}var g=T.data(a[c],"events");for(var e in g){for(var f in g[e]){T.event.add(this,e,g[e][f],g[e][f].data)}}c++})}return d},filter:function(a){return this.pushStack(T.isFunction(a)&&T.grep(this,function(b,c){return a.call(b,c)})||T.multiFilter(a,T.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(c){var a=T.expr.match.POS.test(c)?T(c):null,b=0;return this.map(function(){var d=this;while(d&&d.ownerDocument){if(a?a.index(d)>-1:T(d).is(c)){T.data(d,"closest",b);return d}d=d.parentNode;b++}})},not:function(b){if(typeof b==="string"){if(ac.test(b)){return this.pushStack(T.multiFilter(b,this,true),"not",b)}else{b=T.multiFilter(b,this)}}var a=b.length&&b[b.length-1]!==ab&&!b.nodeType;return this.filter(function(){return a?T.inArray(this,b)<0:this!=b})},add:function(a){return this.pushStack(T.unique(T.merge(this.get(),typeof a==="string"?T(a):T.makeArray(a))))},is:function(a){return !!a&&T.multiFilter(a,this).length>0},hasClass:function(a){return !!a&&this.is("."+a)},val:function(c){if(c===ab){var i=this[0];if(i){if(T.nodeName(i,"option")){return(i.attributes.value||{}).specified?i.value:i.text}if(T.nodeName(i,"select")){var e=i.selectedIndex,b=[],a=i.options,f=i.type=="select-one";if(e<0){return null}for(var h=f?e:0,d=f?e+1:a.length;h<d;h++){var g=a[h];if(g.selected){c=T(g).val();if(f){return c}b.push(c)}}return b}return(i.value||"").replace(/\r/g,"")}return ab}if(typeof c==="number"){c+=""}return this.each(function(){if(this.nodeType!=1){return}if(T.isArray(c)&&/radio|checkbox/.test(this.type)){this.checked=(T.inArray(this.value,c)>=0||T.inArray(this.name,c)>=0)}else{if(T.nodeName(this,"select")){var j=T.makeArray(c);T("option",this).each(function(){this.selected=(T.inArray(this.value,j)>=0||T.inArray(this.text,j)>=0)});if(!j.length){this.selectedIndex=-1}}else{this.value=c}}})},html:function(a){return a===ab?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(T.map(this,function(b,c){return a.call(b,c,b)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(d,a,b){if(this[0]){var e=(this[0].ownerDocument||this[0]).createDocumentFragment(),h=T.clean(d,(this[0].ownerDocument||this[0]),e),f=e.firstChild;if(f){for(var g=0,i=this.length;g<i;g++){b.call(c(this[g],f),this.length>1||g>0?e.cloneNode(true):e)}}if(h){T.each(h,E)}}return this;function c(k,j){return a&&T.nodeName(k,"table")&&T.nodeName(j,"tr")?(k.getElementsByTagName("tbody")[0]||k.appendChild(k.ownerDocument.createElement("tbody"))):k}}};T.fn.init.prototype=T.fn;function E(b,a){if(a.src){T.ajax({url:a.src,async:false,dataType:"script"})}else{T.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function ad(){return +new Date}T.extend=T.fn.extend=function(){var c=arguments[0]||{},e=1,d=arguments.length,h=false,f;if(typeof c==="boolean"){h=c;c=arguments[1]||{};e=2}if(typeof c!=="object"&&!T.isFunction(c)){c={}}if(d==e){c=this;--e}for(;e<d;e++){if((f=arguments[e])!=null){for(var g in f){var b=c[g],a=f[g];if(c===a){continue}if(h&&a&&typeof a==="object"&&!a.nodeType){c[g]=T.extend(h,b||(a.length!=null?[]:{}),a)}else{if(a!==ab){c[g]=a}}}}}return c};var ag=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},L=Object.prototype.toString;T.extend({noConflict:function(a){W.$=S;if(a){W.jQuery=F}return T},isFunction:function(a){return L.call(a)==="[object Function]"},isArray:function(a){return L.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&T.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,c=document.createElement("script");c.type="text/javascript";if(T.support.scriptEval){c.appendChild(document.createTextNode(a))}else{c.text=a}b.insertBefore(c,b.firstChild);b.removeChild(c)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},each:function(e,a,f){var g,d=0,c=e.length;if(f){if(c===ab){for(g in e){if(a.apply(e[g],f)===false){break}}}else{for(;d<c;){if(a.apply(e[d++],f)===false){break}}}}else{if(c===ab){for(g in e){if(a.call(e[g],g,e[g])===false){break}}}else{for(var b=e[0];d<c&&a.call(b,d,b)!==false;b=e[++d]){}}}return e},prop:function(b,a,c,d,e){if(T.isFunction(a)){a=a.call(b,d)}return typeof a==="number"&&c=="curCSS"&&!ag.test(e)?a+"px":a},className:{add:function(b,a){T.each((a||"").split(/\s+/),function(d,c){if(b.nodeType==1&&!T.className.has(b.className,c)){b.className+=(b.className?" ":"")+c}})},remove:function(b,a){if(b.nodeType==1){b.className=a!==ab?T.grep(b.className.split(/\s+/),function(c){return !T.className.has(a,c)}).join(" "):""}},has:function(a,b){return a&&T.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(b,c,a){var e={};for(var d in c){e[d]=b.style[d];b.style[d]=c[d]}a.call(b);for(var d in c){b.style[d]=e[d]}},css:function(e,g,c,h){if(g=="width"||g=="height"){var a,f={position:"absolute",visibility:"hidden",display:"block"},b=g=="width"?["Left","Right"]:["Top","Bottom"];function d(){a=g=="width"?e.offsetWidth:e.offsetHeight;if(h==="border"){return}T.each(b,function(){if(!h){a-=parseFloat(T.curCSS(e,"padding"+this,true))||0}if(h==="margin"){a+=parseFloat(T.curCSS(e,"margin"+this,true))||0}else{a-=parseFloat(T.curCSS(e,"border"+this+"Width",true))||0}})}if(e.offsetWidth!==0){d()}else{T.swap(e,f,d)}return Math.max(0,Math.round(a))}return T.curCSS(e,g,c)},curCSS:function(e,h,g){var b,i=e.style;if(h=="opacity"&&!T.support.opacity){b=T.attr(i,"opacity");return b==""?"1":b}if(h.match(/float/i)){h=H}if(!g&&i&&i[h]){b=i[h]}else{if(Q.getComputedStyle){if(h.match(/float/i)){h="float"}h=h.replace(/([A-Z])/g,"-$1").toLowerCase();var a=Q.getComputedStyle(e,null);if(a){b=a.getPropertyValue(h)}if(h=="opacity"&&b==""){b="1"}}else{if(e.currentStyle){var d=h.replace(/\-(\w)/g,function(k,j){return j.toUpperCase()});b=e.currentStyle[h]||e.currentStyle[d];if(!/^\d+(px)?$/i.test(b)&&/^\d/.test(b)){var f=i.left,c=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left;i.left=b||0;b=i.pixelLeft+"px";i.left=f;e.runtimeStyle.left=c}}}}return b},clean:function(g,b,d){b=b||document;if(typeof b.createElement==="undefined"){b=b.ownerDocument||b[0]&&b[0].ownerDocument||document}if(!d&&g.length===1&&typeof g[0]==="string"){var e=/^<(\w+)\s*\/?>$/.exec(g[0]);if(e){return[b.createElement(e[1])]}}var f=[],h=[],a=b.createElement("div");T.each(g,function(l,i){if(typeof i==="number"){i+=""}if(!i){return}if(typeof i==="string"){i=i.replace(/(<(\w+)[^>]*?)\/>/g,function(q,p,r){return r.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?q:p+"></"+r+">"});var m=i.replace(/^\s+/,"").substring(0,10).toLowerCase();var k=!m.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!m.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||m.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!m.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!m.indexOf("<td")||!m.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!m.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!T.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];a.innerHTML=k[1]+i+k[2];while(k[0]--){a=a.lastChild}if(!T.support.tbody){var j=/<tbody/i.test(i),n=!m.indexOf("<table")&&!j?a.firstChild&&a.firstChild.childNodes:k[1]=="<table>"&&!j?a.childNodes:[];for(var o=n.length-1;o>=0;--o){if(T.nodeName(n[o],"tbody")&&!n[o].childNodes.length){n[o].parentNode.removeChild(n[o])}}}if(!T.support.leadingWhitespace&&/^\s/.test(i)){a.insertBefore(b.createTextNode(i.match(/^\s*/)[0]),a.firstChild)}i=T.makeArray(a.childNodes)}if(i.nodeType){f.push(i)}else{f=T.merge(f,i)}});if(d){for(var c=0;f[c];c++){if(T.nodeName(f[c],"script")&&(!f[c].type||f[c].type.toLowerCase()==="text/javascript")){h.push(f[c].parentNode?f[c].parentNode.removeChild(f[c]):f[c])}else{if(f[c].nodeType===1){f.splice.apply(f,[c+1,0].concat(T.makeArray(f[c].getElementsByTagName("script"))))}d.appendChild(f[c])}}return h}return f},attr:function(c,f,b){if(!c||c.nodeType==3||c.nodeType==8){return ab}var e=!T.isXMLDoc(c),a=b!==ab;f=e&&T.props[f]||f;if(c.tagName){var g=/href|src|style/.test(f);if(f=="selected"&&c.parentNode){c.parentNode.selectedIndex}if(f in c&&e&&!g){if(a){if(f=="type"&&T.nodeName(c,"input")&&c.parentNode){throw"type property can't be changed"}c[f]=b}if(T.nodeName(c,"form")&&c.getAttributeNode(f)){return c.getAttributeNode(f).nodeValue}if(f=="tabIndex"){var d=c.getAttributeNode("tabIndex");return d&&d.specified?d.value:c.nodeName.match(/(button|input|object|select|textarea)/i)?0:c.nodeName.match(/^(a|area)$/i)&&c.href?0:ab}return c[f]}if(!T.support.style&&e&&f=="style"){return T.attr(c.style,"cssText",b)}if(a){c.setAttribute(f,""+b)}var h=!T.support.hrefNormalized&&e&&g?c.getAttribute(f,2):c.getAttribute(f);return h===null?ab:h}if(!T.support.opacity&&f=="opacity"){if(a){c.zoom=1;c.filter=(c.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(b)+""=="NaN"?"":"alpha(opacity="+b*100+")")}return c.filter&&c.filter.indexOf("opacity=")>=0?(parseFloat(c.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}f=f.replace(/-([a-z])/ig,function(j,i){return i.toUpperCase()});if(a){c[f]=b}return c[f]},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var c=[];if(a!=null){var b=a.length;if(b==null||typeof a==="string"||T.isFunction(a)||a.setInterval){c[0]=a}else{while(b){c[--b]=a[b]}}}return c},inArray:function(b,a){for(var d=0,c=a.length;d<c;d++){if(a[d]===b){return d}}return -1},merge:function(b,e){var d=0,c,a=b.length;if(!T.support.getAll){while((c=e[d++])!=null){if(c.nodeType!=8){b[a++]=c}}}else{while((c=e[d++])!=null){b[a++]=c}}return b},unique:function(a){var f=[],g={};try{for(var e=0,d=a.length;e<d;e++){var b=T.data(a[e]);if(!g[b]){g[b]=true;f.push(a[e])}}}catch(c){f=a}return f},grep:function(e,a,f){var d=[];for(var c=0,b=e.length;c<b;c++){if(!f!=!a(e[c],c)){d.push(e[c])}}return d},map:function(f,a){var e=[];for(var d=0,c=f.length;d<c;d++){var b=a(f[d],d);if(b!=null){e[e.length]=b}}return e.concat.apply([],e)}});var O=navigator.userAgent.toLowerCase();T.browser={version:(O.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(O),opera:/opera/.test(O),msie:/msie/.test(O)&&!/opera/.test(O),mozilla:/mozilla/.test(O)&&!/(compatible|webkit)/.test(O)};T.each({parent:function(a){return a.parentNode},parents:function(a){return T.dir(a,"parentNode")},next:function(a){return T.nth(a,2,"nextSibling")},prev:function(a){return T.nth(a,2,"previousSibling")},nextAll:function(a){return T.dir(a,"nextSibling")},prevAll:function(a){return T.dir(a,"previousSibling")},siblings:function(a){return T.sibling(a.parentNode.firstChild,a)},children:function(a){return T.sibling(a.firstChild)},contents:function(a){return T.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:T.makeArray(a.childNodes)}},function(b,a){T.fn[b]=function(d){var c=T.map(this,a);if(d&&typeof d=="string"){c=T.multiFilter(d,c)}return this.pushStack(T.unique(c),b,d)}});T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,a){T.fn[b]=function(h){var e=[],c=T(h);for(var d=0,g=c.length;d<g;d++){var f=(d>0?this.clone(true):this).get();T.fn[a].apply(T(c[d]),f);e=e.concat(f)}return this.pushStack(e,b,h)}});T.each({removeAttr:function(a){T.attr(this,a,"");if(this.nodeType==1){this.removeAttribute(a)}},addClass:function(a){T.className.add(this,a)},removeClass:function(a){T.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean"){b=!T.className.has(this,a)}T.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||T.filter(a,[this]).length){T("*",this).add([this]).each(function(){T.event.remove(this);T.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){T(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(b,a){T.fn[b]=function(){return this.each(a,arguments)}});function Y(b,a){return b[0]&&parseInt(T.curCSS(b[0],a,true),10)||0}var aa="jQuery"+ad(),I=0,R={};T.extend({cache:{},data:function(c,d,b){c=c==W?R:c;var a=c[aa];if(!a){a=c[aa]=++I}if(d&&!T.cache[a]){T.cache[a]={}}if(b!==ab){T.cache[a][d]=b}return d?T.cache[a][d]:a},removeData:function(c,d){c=c==W?R:c;var a=c[aa];if(d){if(T.cache[a]){delete T.cache[a][d];d="";for(d in T.cache[a]){break}if(!d){T.removeData(c)}}}else{try{delete c[aa]}catch(b){if(c.removeAttribute){c.removeAttribute(aa)}}delete T.cache[a]}},queue:function(c,d,a){if(c){d=(d||"fx")+"queue";var b=T.data(c,d);if(!b||T.isArray(a)){b=T.data(c,d,T.makeArray(a))}else{if(a){b.push(a)}}}return b},dequeue:function(a,b){var d=T.queue(a,b),c=d.shift();if(!b||b==="fx"){c=d[0]}if(c!==ab){c.call(a)}}});T.fn.extend({data:function(d,b){var a=d.split(".");a[1]=a[1]?"."+a[1]:"";if(b===ab){var c=this.triggerHandler("getData"+a[1]+"!",[a[0]]);if(c===ab&&this.length){c=T.data(this[0],d)}return c===ab&&a[1]?this.data(a[0]):c}else{return this.trigger("setData"+a[1]+"!",[a[0],b]).each(function(){T.data(this,d,b)})}},removeData:function(a){return this.each(function(){T.removeData(this,a)})},queue:function(b,a){if(typeof b!=="string"){a=b;b="fx"}if(a===ab){return T.queue(this[0],b)}return this.each(function(){var c=T.queue(this,b,a);if(b=="fx"&&c.length==1){c[0].call(this)}})},dequeue:function(a){return this.each(function(){T.dequeue(this,a)})}});(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,h=0,l=Object.prototype.toString;var n=function(r,v,ai,D){ai=ai||[];v=v||document;if(v.nodeType!==1&&v.nodeType!==9){return[]}if(!r||typeof r!=="string"){return ai}var q=[],t,A,x,w,C,u,s=true;b.lastIndex=0;while((t=b.exec(r))!==null){q.push(t[1]);if(t[2]){u=RegExp.rightContext;break}}if(q.length>1&&g.exec(r)){if(q.length===2&&k.relative[q[0]]){A=j(q[0]+q[1],v)}else{A=k.relative[q[0]]?[v]:n(q.shift(),v);while(q.length){r=q.shift();if(k.relative[r]){r+=q.shift()}A=j(r,A)}}}else{var B=D?{expr:q.pop(),set:o(D)}:n.find(q.pop(),q.length===1&&v.parentNode?v.parentNode:v,c(v));A=n.filter(B.expr,B.set);if(q.length>0){x=o(A)}else{s=false}while(q.length){var y=q.pop(),z=y;if(!k.relative[y]){y=""}else{z=q.pop()}if(z==null){z=v}k.relative[y](x,z,c(v))}}if(!x){x=A}if(!x){throw"Syntax error, unrecognized expression: "+(y||r)}if(l.call(x)==="[object Array]"){if(!s){ai.push.apply(ai,x)}else{if(v.nodeType===1){for(var p=0;x[p]!=null;p++){if(x[p]&&(x[p]===true||x[p].nodeType===1&&i(v,x[p]))){ai.push(A[p])}}}else{for(var p=0;x[p]!=null;p++){if(x[p]&&x[p].nodeType===1){ai.push(A[p])}}}}}else{o(x,ai)}if(u){n(u,v,ai,D);if(m){hasDuplicate=false;ai.sort(m);if(hasDuplicate){for(var p=1;p<ai.length;p++){if(ai[p]===ai[p-1]){ai.splice(p--,1)}}}}}return ai};n.matches=function(q,p){return n(q,null,null,p)};n.find=function(p,w,x){var q,s;if(!p){return[]}for(var t=0,u=k.order.length;t<u;t++){var r=k.order[t],s;if((s=k.match[r].exec(p))){var v=RegExp.leftContext;if(v.substr(v.length-1)!=="\\"){s[1]=(s[1]||"").replace(/\\/g,"");q=k.find[r](s,w,x);if(q!=null){p=p.replace(k.match[r],"");break}}}}if(!q){q=w.getElementsByTagName("*")}return{set:q,expr:p}};n.filter=function(C,D,z,t){var u=C,x=[],p=D,r,w,q=D&&D[0]&&c(D[0]);while(C&&D.length){for(var ai in k.filter){if((r=k.match[ai].exec(C))!=null){var v=k.filter[ai],y,A;w=false;if(p==x){x=[]}if(k.preFilter[ai]){r=k.preFilter[ai](r,p,z,x,t,q);if(!r){w=y=true}else{if(r===true){continue}}}if(r){for(var s=0;(A=p[s])!=null;s++){if(A){y=v(A,r,s,p);var B=t^!!y;if(z&&y!=null){if(B){w=true}else{p[s]=false}}else{if(B){x.push(A);w=true}}}}}if(y!==ab){if(!z){p=x}C=C.replace(k.match[ai],"");if(!w){return[]}break}}}if(C==u){if(w==null){throw"Syntax error, unrecognized expression: "+C}else{break}}u=C}return p};var k=n.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(p){return p.getAttribute("href")}},relative:{"+":function(p,w,q){var s=typeof w==="string",x=s&&!/\W/.test(w),r=s&&!x;if(x&&!q){w=w.toUpperCase()}for(var t=0,u=p.length,v;t<u;t++){if((v=p[t])){while((v=v.previousSibling)&&v.nodeType!==1){}p[t]=r||v&&v.nodeName===w?v||false:v===w}}if(r){n.filter(w,p,true)}},">":function(u,r,t){var w=typeof r==="string";if(w&&!/\W/.test(r)){r=t?r:r.toUpperCase();for(var q=0,s=u.length;q<s;q++){var v=u[q];if(v){var p=v.parentNode;u[q]=p.nodeName===r?p:false}}}else{for(var q=0,s=u.length;q<s;q++){var v=u[q];if(v){u[q]=w?v.parentNode:v.parentNode===r}}if(w){n.filter(r,u,true)}}},"":function(p,r,t){var q=h++,s=a;if(!r.match(/\W/)){var u=r=t?r:r.toUpperCase();s=d}s("parentNode",r,q,p,u,t)},"~":function(p,r,t){var q=h++,s=a;if(typeof r==="string"&&!r.match(/\W/)){var u=r=t?r:r.toUpperCase();s=d}s("previousSibling",r,q,p,u,t)}},find:{ID:function(r,q,p){if(typeof q.getElementById!=="undefined"&&!p){var s=q.getElementById(r[1]);return s?[s]:[]}},NAME:function(q,u,t){if(typeof u.getElementsByName!=="undefined"){var r=[],v=u.getElementsByName(q[1]);for(var p=0,s=v.length;p<s;p++){if(v[p].getAttribute("name")===q[1]){r.push(v[p])}}return r.length===0?null:r}},TAG:function(q,p){return p.getElementsByTagName(q[1])}},preFilter:{CLASS:function(p,r,q,s,u,t){p=" "+p[1].replace(/\\/g,"")+" ";if(t){return p}for(var w=0,v;(v=r[w])!=null;w++){if(v){if(u^(v.className&&(" "+v.className+" ").indexOf(p)>=0)){if(!q){s.push(v)}}else{if(q){r[w]=false}}}}return false},ID:function(p){return p[1].replace(/\\/g,"")},TAG:function(q,r){for(var p=0;r[p]===false;p++){}return r[p]&&c(r[p])?q[1]:q[1].toUpperCase()},CHILD:function(q){if(q[1]=="nth"){var p=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(q[2]=="even"&&"2n"||q[2]=="odd"&&"2n+1"||!/\D/.test(q[2])&&"0n+"+q[2]||q[2]);q[2]=(p[1]+(p[2]||1))-0;q[3]=p[3]-0}q[0]=h++;return q},ATTR:function(v,r,q,s,u,t){var p=v[1].replace(/\\/g,"");if(!t&&k.attrMap[p]){v[1]=k.attrMap[p]}if(v[2]==="~="){v[4]=" "+v[4]+" "}return v},PSEUDO:function(u,r,q,s,t){if(u[1]==="not"){if(u[3].match(b).length>1||/^\w/.test(u[3])){u[3]=n(u[3],null,null,r)}else{var p=n.filter(u[3],r,q,true^t);if(!q){s.push.apply(s,p)}return false}}else{if(k.match.POS.test(u[0])||k.match.CHILD.test(u[0])){return true}}return u},POS:function(p){p.unshift(true);return p}},filters:{enabled:function(p){return p.disabled===false&&p.type!=="hidden"},disabled:function(p){return p.disabled===true},checked:function(p){return p.checked===true},selected:function(p){p.parentNode.selectedIndex;return p.selected===true},parent:function(p){return !!p.firstChild},empty:function(p){return !p.firstChild},has:function(p,q,r){return !!n(r[3],p).length},header:function(p){return/h\d/i.test(p.nodeName)},text:function(p){return"text"===p.type},radio:function(p){return"radio"===p.type},checkbox:function(p){return"checkbox"===p.type},file:function(p){return"file"===p.type},password:function(p){return"password"===p.type},submit:function(p){return"submit"===p.type},image:function(p){return"image"===p.type},reset:function(p){return"reset"===p.type},button:function(p){return"button"===p.type||p.nodeName.toUpperCase()==="BUTTON"},input:function(p){return/input|select|textarea|button/i.test(p.nodeName)}},setFilters:{first:function(p,q){return q===0},last:function(q,r,s,p){return r===p.length-1},even:function(p,q){return q%2===0},odd:function(p,q){return q%2===1},lt:function(p,q,r){return q<r[3]-0},gt:function(p,q,r){return q>r[3]-0},nth:function(p,q,r){return r[3]-0==q},eq:function(p,q,r){return r[3]-0==q}},filter:{PSEUDO:function(u,q,p,t){var r=q[1],w=k.filters[r];if(w){return w(u,p,q,t)}else{if(r==="contains"){return(u.textContent||u.innerText||"").indexOf(q[3])>=0}else{if(r==="not"){var v=q[3];for(var p=0,s=v.length;p<s;p++){if(v[p]===u){return false}}return true}}}},CHILD:function(w,t){var q=t[1],v=w;switch(q){case"only":case"first":while(v=v.previousSibling){if(v.nodeType===1){return false}}if(q=="first"){return true}v=w;case"last":while(v=v.nextSibling){if(v.nodeType===1){return false}}return true;case"nth":var u=t[2],x=t[3];if(u==1&&x==0){return true}var r=t[0],y=w.parentNode;if(y&&(y.sizcache!==r||!w.nodeIndex)){var s=0;for(v=y.firstChild;v;v=v.nextSibling){if(v.nodeType===1){v.nodeIndex=++s}}y.sizcache=r}var p=w.nodeIndex-x;if(u==0){return p==0}else{return(p%u==0&&p/u>=0)}}},ID:function(p,q){return p.nodeType===1&&p.getAttribute("id")===q},TAG:function(p,q){return(q==="*"&&p.nodeType===1)||p.nodeName===q},CLASS:function(p,q){return(" "+(p.className||p.getAttribute("class"))+" ").indexOf(q)>-1},ATTR:function(u,p){var q=p[1],s=k.attrHandle[q]?k.attrHandle[q](u):u[q]!=null?u[q]:u.getAttribute(q),t=s+"",v=p[2],r=p[4];return s==null?v==="!=":v==="="?t===r:v==="*="?t.indexOf(r)>=0:v==="~="?(" "+t+" ").indexOf(r)>=0:!r?t&&s!==false:v==="!="?t!=r:v==="^="?t.indexOf(r)===0:v==="$="?t.substr(t.length-r.length)===r:v==="|="?t===r||t.substr(0,r.length+1)===r+"-":false},POS:function(u,r,q,t){var s=r[2],p=k.setFilters[s];if(p){return p(u,q,r,t)}}}};var g=k.match.POS;for(var e in k.match){k.match[e]=RegExp(k.match[e].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var o=function(p,q){p=Array.prototype.slice.call(p);if(q){q.push.apply(q,p);return q}return p};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(f){o=function(t,p){var r=p||[];if(l.call(t)==="[object Array]"){Array.prototype.push.apply(r,t)}else{if(typeof t.length==="number"){for(var q=0,s=t.length;q<s;q++){r.push(t[q])}}else{for(var q=0;t[q];q++){r.push(t[q])}}}return r}}var m;if(document.documentElement.compareDocumentPosition){m=function(q,r){var p=q.compareDocumentPosition(r)&4?-1:q===r?0:1;if(p===0){hasDuplicate=true}return p}}else{if("sourceIndex" in document.documentElement){m=function(q,r){var p=q.sourceIndex-r.sourceIndex;if(p===0){hasDuplicate=true}return p}}else{if(document.createRange){m=function(p,r){var q=p.ownerDocument.createRange(),s=r.ownerDocument.createRange();q.selectNode(p);q.collapse(true);s.selectNode(r);s.collapse(true);var t=q.compareBoundaryPoints(Range.START_TO_END,s);if(t===0){hasDuplicate=true}return t}}}}(function(){var q=document.createElement("form"),p="script"+(new Date).getTime();q.innerHTML="<input name='"+p+"'/>";var r=document.documentElement;r.insertBefore(q,r.firstChild);if(!!document.getElementById(p)){k.find.ID=function(v,u,t){if(typeof u.getElementById!=="undefined"&&!t){var s=u.getElementById(v[1]);return s?s.id===v[1]||typeof s.getAttributeNode!=="undefined"&&s.getAttributeNode("id").nodeValue===v[1]?[s]:ab:[]}};k.filter.ID=function(t,s){var u=typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id");return t.nodeType===1&&u&&u.nodeValue===s}}r.removeChild(q)})();(function(){var p=document.createElement("div");p.appendChild(document.createComment(""));if(p.getElementsByTagName("*").length>0){k.find.TAG=function(s,t){var u=t.getElementsByTagName(s[1]);if(s[1]==="*"){var q=[];for(var r=0;u[r];r++){if(u[r].nodeType===1){q.push(u[r])}}u=q}return u}}p.innerHTML="<a href='#'></a>";if(p.firstChild&&typeof p.firstChild.getAttribute!=="undefined"&&p.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(q){return q.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var q=n,p=document.createElement("div");p.innerHTML="<p class='TEST'></p>";if(p.querySelectorAll&&p.querySelectorAll(".TEST").length===0){return}n=function(u,v,s,r){v=v||document;if(!r&&v.nodeType===9&&!c(v)){try{return o(v.querySelectorAll(u),s)}catch(t){}}return q(u,v,s,r)};n.find=q.find;n.filter=q.filter;n.selectors=q.selectors;n.matches=q.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var p=document.createElement("div");p.innerHTML="<div class='test e'></div><div class='test'></div>";if(p.getElementsByClassName("e").length===0){return}p.lastChild.className="e";if(p.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(s,r,q){if(typeof r.getElementsByClassName!=="undefined"&&!q){return r.getElementsByClassName(s[1])}}})()}function d(v,q,r,x,p,y){var z=v=="previousSibling"&&!y;for(var t=0,u=x.length;t<u;t++){var w=x[t];if(w){if(z&&w.nodeType===1){w.sizcache=r;w.sizset=t}w=w[v];var s=false;while(w){if(w.sizcache===r){s=x[w.sizset];break}if(w.nodeType===1&&!y){w.sizcache=r;w.sizset=t}if(w.nodeName===q){s=w;break}w=w[v]}x[t]=s}}}function a(v,q,r,x,p,y){var z=v=="previousSibling"&&!y;for(var t=0,u=x.length;t<u;t++){var w=x[t];if(w){if(z&&w.nodeType===1){w.sizcache=r;w.sizset=t}w=w[v];var s=false;while(w){if(w.sizcache===r){s=x[w.sizset];break}if(w.nodeType===1){if(!y){w.sizcache=r;w.sizset=t}if(typeof q!=="string"){if(w===q){s=true;break}}else{if(n.filter(q,[w]).length>0){s=w;break}}}w=w[v]}x[t]=s}}}var i=document.compareDocumentPosition?function(p,q){return p.compareDocumentPosition(q)&16}:function(p,q){return p!==q&&(p.contains?p.contains(q):true)};var c=function(p){return p.nodeType===9&&p.documentElement.nodeName!=="HTML"||!!p.ownerDocument&&c(p.ownerDocument)};var j=function(s,u){var p=[],w="",v,q=u.nodeType?[u]:u;while((v=k.match.PSEUDO.exec(s))){w+=v[0];s=s.replace(k.match.PSEUDO,"")}s=k.relative[s]?s+"*":s;for(var t=0,r=q.length;t<r;t++){n(s,q[t],p)}return n.filter(w,p)};T.find=n;T.filter=n.filter;T.expr=n.selectors;T.expr[":"]=T.expr.filters;n.selectors.filters.hidden=function(p){return p.offsetWidth===0||p.offsetHeight===0};n.selectors.filters.visible=function(p){return p.offsetWidth>0||p.offsetHeight>0};n.selectors.filters.animated=function(p){return T.grep(T.timers,function(q){return p===q.elem}).length};T.multiFilter=function(p,r,q){if(q){p=":not("+p+")"}return n.matches(p,r)};T.dir=function(q,r){var s=[],p=q[r];while(p&&p!=document){if(p.nodeType==1){s.push(p)}p=p[r]}return s};T.nth=function(t,s,q,p){s=s||1;var r=0;for(;t;t=t[q]){if(t.nodeType==1&&++r==s){break}}return t};T.sibling=function(p,q){var r=[];for(;p;p=p.nextSibling){if(p.nodeType==1&&p!=q){r.push(p)}}return r};return;W.Sizzle=n})();T.event={add:function(c,f,d,a){if(c.nodeType==3||c.nodeType==8){return}if(c.setInterval&&c!=W){c=W}if(!d.guid){d.guid=this.guid++}if(a!==ab){var e=d;d=this.proxy(e);d.data=a}var g=T.data(c,"events")||T.data(c,"events",{}),b=T.data(c,"handle")||T.data(c,"handle",function(){return typeof T!=="undefined"&&!T.event.triggered?T.event.handle.apply(arguments.callee.elem,arguments):ab});b.elem=c;T.each(f.split(/\s+/),function(k,j){var i=j.split(".");j=i.shift();d.type=i.slice().sort().join(".");var h=g[j];if(T.event.specialAll[j]){T.event.specialAll[j].setup.call(c,a,i)}if(!h){h=g[j]={};if(!T.event.special[j]||T.event.special[j].setup.call(c,a,i)===false){if(c.addEventListener){c.addEventListener(j,b,false)}else{if(c.attachEvent){c.attachEvent("on"+j,b)}}}}h[d.guid]=d;T.event.global[j]=true});c=null},guid:1,global:{},remove:function(b,e,c){if(b.nodeType==3||b.nodeType==8){return}var f=T.data(b,"events"),g,h;if(f){if(e===ab||(typeof e==="string"&&e.charAt(0)==".")){for(var d in f){this.remove(b,d+(e||""))}}else{if(e.type){c=e.handler;e=e.type}T.each(e.split(/\s+/),function(m,k){var i=k.split(".");k=i.shift();var l=RegExp("(^|\\.)"+i.slice().sort().join(".*\\.")+"(\\.|$)");if(f[k]){if(c){delete f[k][c.guid]}else{for(var j in f[k]){if(l.test(f[k][j].type)){delete f[k][j]}}}if(T.event.specialAll[k]){T.event.specialAll[k].teardown.call(b,i)}for(g in f[k]){break}if(!g){if(!T.event.special[k]||T.event.special[k].teardown.call(b,i)===false){if(b.removeEventListener){b.removeEventListener(k,T.data(b,"handle"),false)}else{if(b.detachEvent){b.detachEvent("on"+k,T.data(b,"handle"))}}}g=null;delete f[k]}}})}for(g in f){break}if(!g){var a=T.data(b,"handle");if(a){a.elem=null}T.removeData(b,"events");T.removeData(b,"handle")}}},trigger:function(d,b,e,h){var f=d.type||d;if(!h){d=typeof d==="object"?d[aa]?d:T.extend(T.Event(f),d):T.Event(f);if(f.indexOf("!")>=0){d.type=f=f.slice(0,-1);d.exclusive=true}if(!e){d.stopPropagation();if(this.global[f]){T.each(T.cache,function(){if(this.events&&this.events[f]){T.event.trigger(d,b,this.handle.elem)}})}}if(!e||e.nodeType==3||e.nodeType==8){return ab}d.result=ab;d.target=e;b=T.makeArray(b);b.unshift(d)}d.currentTarget=e;var c=T.data(e,"handle");if(c){c.apply(e,b)}if((!e[f]||(T.nodeName(e,"a")&&f=="click"))&&e["on"+f]&&e["on"+f].apply(e,b)===false){d.result=false}if(!h&&e[f]&&!d.isDefaultPrevented()&&!(T.nodeName(e,"a")&&f=="click")){this.triggered=true;try{e[f]()}catch(a){}}this.triggered=false;if(!d.isPropagationStopped()){var g=e.parentNode||e.ownerDocument;if(g){T.event.trigger(d,b,g,true)}}},handle:function(b){var c,h;b=arguments[0]=T.event.fix(b||W.event);b.currentTarget=this;var a=b.type.split(".");b.type=a.shift();c=!a.length&&!b.exclusive;var d=RegExp("(^|\\.)"+a.slice().sort().join(".*\\.")+"(\\.|$)");h=(T.data(this,"events")||{})[b.type];for(var f in h){var e=h[f];if(c||d.test(e.type)){b.handler=e;b.data=e.data;var g=e.apply(this,arguments);if(g!==ab){b.result=g;if(g===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(c){if(c[aa]){return c}var e=c;c=T.Event(e);for(var d=this.props.length,a;d;){a=this.props[--d];c[a]=e[a]}if(!c.target){c.target=c.srcElement||document}if(c.target.nodeType==3){c.target=c.target.parentNode}if(!c.relatedTarget&&c.fromElement){c.relatedTarget=c.fromElement==c.target?c.toElement:c.fromElement}if(c.pageX==null&&c.clientX!=null){var b=document.documentElement,f=document.body;c.pageX=c.clientX+(b&&b.scrollLeft||f&&f.scrollLeft||0)-(b.clientLeft||0);c.pageY=c.clientY+(b&&b.scrollTop||f&&f.scrollTop||0)-(b.clientTop||0)}if(!c.which&&((c.charCode||c.charCode===0)?c.charCode:c.keyCode)){c.which=c.charCode||c.keyCode}if(!c.metaKey&&c.ctrlKey){c.metaKey=c.ctrlKey}if(!c.which&&c.button){c.which=(c.button&1?1:(c.button&2?3:(c.button&4?2:0)))}return c},proxy:function(a,b){b=b||function(){return a.apply(this,arguments)};b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:P,teardown:function(){}}},specialAll:{live:{setup:function(b,a){T.event.add(this,a[0],af)},teardown:function(a){if(a.length){var c=0,b=RegExp("(^|\\.)"+a[0]+"(\\.|$)");T.each((T.data(this,"events").live||{}),function(){if(b.test(this.type)){c++}});if(c<1){T.event.remove(this,a[0],af)}}}}}};T.Event=function(a){if(!this.preventDefault){return new T.Event(a)}if(a&&a.type){this.originalEvent=a;this.type=a.type}else{this.type=a}this.timeStamp=ad();this[aa]=true};function X(){return false}function J(){return true}T.Event.prototype={preventDefault:function(){this.isDefaultPrevented=J;var a=this.originalEvent;if(!a){return}if(a.preventDefault){a.preventDefault()}a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=J;var a=this.originalEvent;if(!a){return}if(a.stopPropagation){a.stopPropagation()}a.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=J;this.stopPropagation()},isDefaultPrevented:X,isPropagationStopped:X,isImmediatePropagationStopped:X};var ah=function(b){var c=b.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(a){c=this}}if(c!=this){b.type=b.data;T.event.handle.apply(this,arguments)}};T.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){T.event.special[b]={setup:function(){T.event.add(this,a,ah,b)},teardown:function(){T.event.remove(this,a,ah)}}});T.fn.extend({bind:function(b,a,c){return b=="unload"?this.one(b,a,c):this.each(function(){T.event.add(this,b,c||a,c&&a)})},one:function(b,a,c){var d=T.event.proxy(c||a,function(e){T(this).unbind(e,d);return(c||a).apply(this,arguments)});return this.each(function(){T.event.add(this,b,d,c&&a)})},unbind:function(a,b){return this.each(function(){T.event.remove(this,a,b)})},trigger:function(b,a){return this.each(function(){T.event.trigger(b,a,this)})},triggerHandler:function(c,a){if(this[0]){var b=T.Event(c);b.preventDefault();b.stopPropagation();T.event.trigger(b,a,this[0]);return b.result}},toggle:function(a){var c=arguments,b=1;while(b<c.length){T.event.proxy(a,c[b++])}return this.click(T.event.proxy(a,function(d){this.lastToggle=(this.lastToggle||0)%b;d.preventDefault();return c[this.lastToggle++].apply(this,arguments)||false}))},hover:function(b,a){return this.mouseenter(b).mouseleave(a)},ready:function(a){P();if(T.isReady){a.call(document,T)}else{T.readyList.push(a)}return this},live:function(a,b){var c=T.event.proxy(b);c.guid+=this.selector+a;T(document).bind(Z(a,this.selector),this.selector,c);return this},die:function(a,b){T(document).unbind(Z(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});function af(a){var d=RegExp("(^|\\.)"+a.type+"(\\.|$)"),b=true,c=[];T.each(T.data(this,"events").live||[],function(g,f){if(d.test(f.type)){var e=T(a.target).closest(f.data)[0];if(e){c.push({elem:e,fn:f})}}});c.sort(function(e,f){return T.data(e.elem,"closest")-T.data(f.elem,"closest")});T.each(c,function(){if(this.fn.call(this.elem,a,this.fn.data)===false){return(b=false)}});return b}function Z(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}T.extend({isReady:false,readyList:[],ready:function(){if(!T.isReady){T.isReady=true;if(T.readyList){T.each(T.readyList,function(){this.call(document,T)});T.readyList=null}T(document).triggerHandler("ready")}}});var G=false;function P(){if(G){return}G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);T.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);T.ready()}});if(document.documentElement.doScroll&&W==W.top){(function(){if(T.isReady){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}T.ready()})()}}}T.event.add(W,"load",T.ready)}T.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(a,b){T.fn[b]=function(c){return c?this.bind(b,c):this.trigger(b)}});T(W).bind("unload",function(){for(var a in T.cache){if(a!=1&&T.cache[a].handle){T.event.remove(T.cache[a].handle.elem)}}});(function(){T.support={};var f=document.documentElement,e=document.createElement("script"),a=document.createElement("div"),b="script"+(new Date).getTime();a.style.display="none";a.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var d=a.getElementsByTagName("*"),g=a.getElementsByTagName("a")[0];if(!d||!d.length||!g){return}T.support={leadingWhitespace:a.firstChild.nodeType==3,tbody:!a.getElementsByTagName("tbody").length,objectAll:!!a.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/red/.test(g.getAttribute("style")),hrefNormalized:g.getAttribute("href")==="/a",opacity:g.style.opacity==="0.5",cssFloat:!!g.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};e.type="text/javascript";try{e.appendChild(document.createTextNode("window."+b+"=1;"))}catch(c){}f.insertBefore(e,f.firstChild);if(W[b]){T.support.scriptEval=true;delete W[b]}f.removeChild(e);if(a.attachEvent&&a.fireEvent){a.attachEvent("onclick",function(){T.support.noCloneEvent=false;a.detachEvent("onclick",arguments.callee)});a.cloneNode(true).fireEvent("onclick")}T(function(){var h=document.createElement("div");h.style.width=h.style.paddingLeft="1px";document.body.appendChild(h);T.boxModel=T.support.boxModel=h.offsetWidth===2;document.body.removeChild(h).style.display="none"})})();var H=T.support.cssFloat?"cssFloat":"styleFloat";T.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};T.fn.extend({_load:T.fn.load,load:function(e,b,a){if(typeof e!=="string"){return this._load(e)}var c=e.indexOf(" ");if(c>=0){var g=e.slice(c,e.length);e=e.slice(0,c)}var d="GET";if(b){if(T.isFunction(b)){a=b;b=null}else{if(typeof b==="object"){b=T.param(b);d="POST"}}}var f=this;T.ajax({url:e,type:d,dataType:"html",data:b,complete:function(i,h){if(h=="success"||h=="notmodified"){f.html(g?T("<div/>").append(i.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(g):i.responseText)}if(a){f.each(a,[i.responseText,h,i])}}});return this},serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?T.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(c,b){var a=T(this).val();return a==null?null:T.isArray(a)?T.map(a,function(d,e){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});T.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(b,a){T.fn[a]=function(c){return this.bind(a,c)}});var N=ad();T.extend({get:function(d,b,a,c){if(T.isFunction(b)){a=b;b=null}return T.ajax({type:"GET",url:d,data:b,success:a,dataType:c})},getScript:function(b,a){return T.get(b,null,a,"script")},getJSON:function(c,b,a){return T.get(c,b,a,"json")},post:function(d,b,a,c){if(T.isFunction(b)){a=b;b={}}return T.ajax({type:"POST",url:d,data:b,success:a,dataType:c})},ajaxSetup:function(a){T.extend(T.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return W.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(k){k=T.extend(true,k,T.extend(true,{},T.ajaxSettings,k));var a,r=/=\?(&|$)/g,f,b,q=k.type.toUpperCase();if(k.data&&k.processData&&typeof k.data!=="string"){k.data=T.param(k.data)}if(k.dataType=="jsonp"){if(q=="GET"){if(!k.url.match(r)){k.url+=(k.url.match(/\?/)?"&":"?")+(k.jsonp||"callback")+"=?"}}else{if(!k.data||!k.data.match(r)){k.data=(k.data?k.data+"&":"")+(k.jsonp||"callback")+"=?"}}k.dataType="json"}if(k.dataType=="json"&&(k.data&&k.data.match(r)||k.url.match(r))){a="jsonp"+N++;if(k.data){k.data=(k.data+"").replace(r,"="+a+"$1")}k.url=k.url.replace(r,"="+a+"$1");k.dataType="script";W[a]=function(u){b=u;o();l();W[a]=ab;try{delete W[a]}catch(t){}if(p){p.removeChild(d)}}}if(k.dataType=="script"&&k.cache==null){k.cache=false}if(k.cache===false&&q=="GET"){var s=ad();var c=k.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+s+"$2");k.url=c+((c==k.url)?(k.url.match(/\?/)?"&":"?")+"_="+s:"")}if(k.data&&q=="GET"){k.url+=(k.url.match(/\?/)?"&":"?")+k.data;k.data=null}if(k.global&&!T.active++){T.event.trigger("ajaxStart")}var g=/^(\w+:)?\/\/([^\/?#]+)/.exec(k.url);if(k.dataType=="script"&&q=="GET"&&g&&(g[1]&&g[1]!=location.protocol||g[2]!=location.host)){var p=document.getElementsByTagName("head")[0];var d=document.createElement("script");d.src=k.url;if(k.scriptCharset){d.charset=k.scriptCharset}if(!a){var i=false;d.onload=d.onreadystatechange=function(){if(!i&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){i=true;o();l();d.onload=d.onreadystatechange=null;p.removeChild(d)}}}p.appendChild(d);return ab}var m=false;var n=k.xhr();if(k.username){n.open(q,k.url,k.async,k.username,k.password)}else{n.open(q,k.url,k.async)}try{if(k.data){n.setRequestHeader("Content-Type",k.contentType)}if(k.ifModified){n.setRequestHeader("If-Modified-Since",T.lastModified[k.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}n.setRequestHeader("X-Requested-With","XMLHttpRequest");n.setRequestHeader("Accept",k.dataType&&k.accepts[k.dataType]?k.accepts[k.dataType]+", */*":k.accepts._default)}catch(e){}if(k.beforeSend&&k.beforeSend(n,k)===false){if(k.global&&!--T.active){T.event.trigger("ajaxStop")}n.abort();return false}if(k.global){T.event.trigger("ajaxSend",[n,k])}var j=function(v){if(n.readyState==0){if(h){clearInterval(h);h=null;if(k.global&&!--T.active){T.event.trigger("ajaxStop")}}}else{if(!m&&n&&(n.readyState==4||v=="timeout")){m=true;if(h){clearInterval(h);h=null}f=v=="timeout"?"timeout":!T.httpSuccess(n)?"error":k.ifModified&&T.httpNotModified(n,k.url)?"notmodified":"success";if(f=="success"){try{b=T.httpData(n,k.dataType,k)}catch(t){f="parsererror"}}if(f=="success"){var u;try{u=n.getResponseHeader("Last-Modified")}catch(t){}if(k.ifModified&&u){T.lastModified[k.url]=u}if(!a){o()}}else{T.handleError(k,n,f)}l();if(v){n.abort()}if(k.async){n=null}}}};if(k.async){var h=setInterval(j,13);if(k.timeout>0){setTimeout(function(){if(n&&!m){j("timeout")}},k.timeout)}}try{n.send(k.data)}catch(e){T.handleError(k,n,null,e)}if(!k.async){j()}function o(){if(k.success){k.success(b,f)}if(k.global){T.event.trigger("ajaxSuccess",[n,k])}}function l(){if(k.complete){k.complete(n,f)}if(k.global){T.event.trigger("ajaxComplete",[n,k])}if(k.global&&!--T.active){T.event.trigger("ajaxStop")}}return n},handleError:function(c,a,d,b){if(c.error){c.error(a,d,b)}if(c.global){T.event.trigger("ajaxError",[a,c,b])}},active:0,httpSuccess:function(a){try{return !a.status&&location.protocol=="file:"||(a.status>=200&&a.status<300)||a.status==304||a.status==1223}catch(b){}return false},httpNotModified:function(b,d){try{var a=b.getResponseHeader("Last-Modified");return b.status==304||a==T.lastModified[d]}catch(c){}return false},httpData:function(a,c,d){var e=a.getResponseHeader("content-type"),f=c=="xml"||!c&&e&&e.indexOf("xml")>=0,b=f?a.responseXML:a.responseText;if(f&&b.documentElement.tagName=="parsererror"){throw"parsererror"}if(d&&d.dataFilter){b=d.dataFilter(b,c)}if(typeof b==="string"){if(c=="script"){T.globalEval(b)}if(c=="json"){b=W["eval"]("("+b+")")}}return b},param:function(d){var b=[];function a(f,e){b[b.length]=encodeURIComponent(f)+"="+encodeURIComponent(e)}if(T.isArray(d)||d.jquery){T.each(d,function(){a(this.name,this.value)})}else{for(var c in d){if(T.isArray(d[c])){T.each(d[c],function(){a(c,this)})}else{a(c,T.isFunction(d[c])?d[c]():d[c])}}}return b.join("&").replace(/%20/g,"+")}});var V={},U,ae=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(b,c){var a={};T.each(ae.concat.apply([],ae.slice(0,c)),function(){a[this]=b});return a}T.fn.extend({show:function(c,a){if(c){return this.animate(K("show",3),c,a)}else{for(var e=0,g=this.length;e<g;e++){var h=T.data(this[e],"olddisplay");this[e].style.display=h||"";if(T.css(this[e],"display")==="none"){var f=this[e].tagName,b;if(V[f]){b=V[f]}else{var d=T("<"+f+" />").appendTo("body");b=d.css("display");if(b==="none"){b="block"}d.remove();V[f]=b}T.data(this[e],"olddisplay",b)}}for(var e=0,g=this.length;e<g;e++){this[e].style.display=T.data(this[e],"olddisplay")||""}return this}},hide:function(b,a){if(b){return this.animate(K("hide",3),b,a)}else{for(var c=0,d=this.length;c<d;c++){var e=T.data(this[c],"olddisplay");if(!e&&e!=="none"){T.data(this[c],"olddisplay",T.css(this[c],"display"))}}for(var c=0,d=this.length;c<d;c++){this[c].style.display="none"}return this}},_toggle:T.fn.toggle,toggle:function(a,b){var c=typeof a==="boolean";return T.isFunction(a)&&T.isFunction(b)?this._toggle.apply(this,arguments):a==null||c?this.each(function(){var d=c?a:T(this).is(":hidden");T(this)[d?"show":"hide"]()}):this.animate(K("toggle",3),a,b)},fadeTo:function(c,a,b){return this.animate({opacity:a},c,b)},animate:function(a,d,b,c){var e=T.speed(d,b,c);return this[e.queue===false?"each":"queue"](function(){var g=T.extend({},e),i,f=this.nodeType==1&&T(this).is(":hidden"),h=this;for(i in a){if(a[i]=="hide"&&f||a[i]=="show"&&!f){return g.complete.call(this)}if((i=="height"||i=="width")&&this.style){g.display=T.css(this,"display");g.overflow=this.style.overflow}}if(g.overflow!=null){this.style.overflow="hidden"}g.curAnim=T.extend({},a);T.each(a,function(o,k){var l=new T.fx(h,g,o);if(/toggle|show|hide/.test(k)){l[k=="toggle"?f?"show":"hide":k](a)}else{var m=k.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),j=l.cur(true)||0;if(m){var p=parseFloat(m[2]),n=m[3]||"px";if(n!="px"){h.style[o]=(p||1)+n;j=((p||1)/l.cur(true))*j;h.style[o]=j+n}if(m[1]){p=((m[1]=="-="?-1:1)*p)+j}l.custom(j,p,n)}else{l.custom(j,k,"")}}});return true})},stop:function(b,c){var a=T.timers;if(b){this.queue([])}this.each(function(){for(var d=a.length-1;d>=0;d--){if(a[d].elem==this){if(c){a[d](true)}a.splice(d,1)}}});if(!c){this.dequeue()}return this}});T.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,a){T.fn[b]=function(d,c){return this.animate(a,d,c)}});T.extend({speed:function(b,a,c){var d=typeof b==="object"?b:{complete:c||!c&&a||T.isFunction(b)&&b,duration:b,easing:c&&a||a&&!T.isFunction(a)&&a};d.duration=T.fx.off?0:typeof d.duration==="number"?d.duration:T.fx.speeds[d.duration]||T.fx.speeds._default;d.old=d.complete;d.complete=function(){if(d.queue!==false){T(this).dequeue()}if(T.isFunction(d.old)){d.old.call(this)}};return d},easing:{linear:function(b,a,d,c){return d+c*b},swing:function(b,a,d,c){return((-Math.cos(b*Math.PI)/2)+0.5)*c+d}},timers:[],fx:function(b,c,a){this.options=c;this.elem=b;this.prop=a;if(!c.orig){c.orig={}}}});T.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(T.fx.step[this.prop]||T.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var b=parseFloat(T.css(this.elem,this.prop,a));return b&&b>-10000?b:parseFloat(T.curCSS(this.elem,this.prop))||0},custom:function(a,b,c){this.startTime=ad();this.start=a;this.end=b;this.unit=c||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;function d(f){return e.step(f)}d.elem=this.elem;if(d()&&T.timers.push(d)&&!U){U=setInterval(function(){var f=T.timers;for(var g=0;g<f.length;g++){if(!f[g]()){f.splice(g--,1)}}if(!f.length){clearInterval(U);U=ab}},13)}},show:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());T(this.elem).show()},hide:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var d=ad();if(c||d>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var f=true;for(var e in this.options.curAnim){if(this.options.curAnim[e]!==true){f=false}}if(f){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(T.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){T(this.elem).hide()}if(this.options.hide||this.options.show){for(var b in this.options.curAnim){T.attr(this.elem.style,b,this.options.orig[b])}}this.options.complete.call(this.elem)}return false}else{var a=d-this.startTime;this.state=a/this.options.duration;this.pos=T.easing[this.options.easing||(T.easing.swing?"swing":"linear")](this.state,a,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};T.extend(T.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){T.attr(a.elem.style,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}}});if(document.documentElement.getBoundingClientRect){T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}var f=this[0].getBoundingClientRect(),c=this[0].ownerDocument,g=c.body,h=c.documentElement,a=h.clientTop||g.clientTop||0,b=h.clientLeft||g.clientLeft||0,d=f.top+(self.pageYOffset||T.boxModel&&h.scrollTop||g.scrollTop)-a,e=f.left+(self.pageXOffset||T.boxModel&&h.scrollLeft||g.scrollLeft)-b;return{top:d,left:e}}}else{T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}T.offset.initialized||T.offset.initialize();var f=this[0],i=f.offsetParent,j=f,a=f.ownerDocument,c,h=a.documentElement,e=a.body,d=a.defaultView,k=d.getComputedStyle(f,null),b=f.offsetTop,g=f.offsetLeft;while((f=f.parentNode)&&f!==e&&f!==h){c=d.getComputedStyle(f,null);b-=f.scrollTop,g-=f.scrollLeft;if(f===i){b+=f.offsetTop,g+=f.offsetLeft;if(T.offset.doesNotAddBorder&&!(T.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.tagName))){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}j=i,i=f.offsetParent}if(T.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}k=c}if(k.position==="relative"||k.position==="static"){b+=e.offsetTop,g+=e.offsetLeft}if(k.position==="fixed"){b+=Math.max(h.scrollTop,e.scrollTop),g+=Math.max(h.scrollLeft,e.scrollLeft)}return{top:b,left:g}}}T.offset={initialize:function(){if(this.initialized){return}var c=document.body,i=document.createElement("div"),g,h,a,f,b,j,e=c.style.marginTop,d='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';b={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(j in b){i.style[j]=b[j]}i.innerHTML=d;c.insertBefore(i,c.firstChild);g=i.firstChild,h=g.firstChild,f=g.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(h.offsetTop!==5);this.doesAddBorderForTableAndCells=(f.offsetTop===5);g.style.overflow="hidden",g.style.position="relative";this.subtractsBorderForOverflowNotVisible=(h.offsetTop===-5);c.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(c.offsetTop===0);c.style.marginTop=e;c.removeChild(i);this.initialized=true},bodyOffset:function(c){T.offset.initialized||T.offset.initialize();var a=c.offsetTop,b=c.offsetLeft;if(T.offset.doesNotIncludeMarginInBodyOffset){a+=parseInt(T.curCSS(c,"marginTop",true),10)||0,b+=parseInt(T.curCSS(c,"marginLeft",true),10)||0}return{top:a,left:b}}};T.fn.extend({position:function(){var b=0,c=0,e;if(this[0]){var d=this.offsetParent(),a=this.offset(),f=/^body|html$/i.test(d[0].tagName)?{top:0,left:0}:d.offset();a.top-=Y(this,"marginTop");a.left-=Y(this,"marginLeft");f.top+=Y(d,"borderTopWidth");f.left+=Y(d,"borderLeftWidth");e={top:a.top-f.top,left:a.left-f.left}}return e},offsetParent:function(){var a=this[0].offsetParent||document.body;while(a&&(!/^body|html$/i.test(a.tagName)&&T.css(a,"position")=="static")){a=a.offsetParent}return T(a)}});T.each(["Left","Top"],function(b,c){var a="scroll"+c;T.fn[a]=function(d){if(!this[0]){return null}return d!==ab?this.each(function(){this==W||this==document?W.scrollTo(!b?d:T(W).scrollLeft(),b?d:T(W).scrollTop()):this[a]=d}):this[0]==W||this[0]==document?self[b?"pageYOffset":"pageXOffset"]||T.boxModel&&document.documentElement[a]||document.body[a]:this[0][a]}});T.each(["Height","Width"],function(b,d){var f=b?"Left":"Top",c=b?"Right":"Bottom",e=d.toLowerCase();T.fn["inner"+d]=function(){return this[0]?T.css(this[0],e,false,"padding"):null};T.fn["outer"+d]=function(g){return this[0]?T.css(this[0],e,false,g?"margin":"border"):null};var a=d.toLowerCase();T.fn[a]=function(g){return this[0]==W?document.compatMode=="CSS1Compat"&&document.documentElement["client"+d]||document.body["client"+d]:this[0]==document?Math.max(document.documentElement["client"+d],document.body["scroll"+d],document.documentElement["scroll"+d],document.body["offset"+d],document.documentElement["offset"+d]):g===ab?(this.length?T.css(this[0],a):null):this.css(a,typeof g==="string"?g:g+"px")}})})();
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationcustomjqueryautocompletedevjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-custom-jquery-autocomplete.dev.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-custom-jquery-autocomplete.dev.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-custom-jquery-autocomplete.dev.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1,808 @@
</span><ins>+/*
+ * jQuery Autocomplete plugin 1.1
+ *
+ * Copyright (c) 2009 Jörn Zaefferer
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
+ */
+
+;(function($) {
+        
+$.fn.extend({
+        autocomplete: function(urlOrData, options) {
+                var isUrl = typeof urlOrData == "string";
+                options = $.extend({}, $.Autocompleter.defaults, {
+                        url: isUrl ? urlOrData : null,
+                        data: isUrl ? null : urlOrData,
+                        delay: isUrl ? $.Autocompleter.defaults.delay : 10,
+                        max: options && !options.scroll ? 10 : 150
+                }, options);
+                
+                // if highlight is set to false, replace it with a do-nothing function
+                options.highlight = options.highlight || function(value) { return value; };
+                
+                // if the formatMatch option is not specified, then use formatItem for backwards compatibility
+                options.formatMatch = options.formatMatch || options.formatItem;
+                
+                return this.each(function() {
+                        new $.Autocompleter(this, options);
+                });
+        },
+        result: function(handler) {
+                return this.bind("result", handler);
+        },
+        search: function(handler) {
+                return this.trigger("search", [handler]);
+        },
+        flushCache: function() {
+                return this.trigger("flushCache");
+        },
+        setOptions: function(options){
+                return this.trigger("setOptions", [options]);
+        },
+        unautocomplete: function() {
+                return this.trigger("unautocomplete");
+        }
+});
+
+$.Autocompleter = function(input, options) {
+
+        var KEY = {
+                UP: 38,
+                DOWN: 40,
+                DEL: 46,
+                TAB: 9,
+                RETURN: 13,
+                ESC: 27,
+                COMMA: 188,
+                PAGEUP: 33,
+                PAGEDOWN: 34,
+                BACKSPACE: 8
+        };
+
+        // Create $ object for input element
+        var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
+
+        var timeout;
+        var previousValue = "";
+        var cache = $.Autocompleter.Cache(options);
+        var hasFocus = 0;
+        var lastKeyPressCode;
+        var config = {
+                mouseDownOnSelect: false
+        };
+        var select = $.Autocompleter.Select(options, input, selectCurrent, config);
+        
+        var blockSubmit;
+        
+        // prevent form submit in opera when selecting with return key
+        $.browser.opera && $(input.form).bind("submit.autocomplete", function() {
+                if (blockSubmit) {
+                        blockSubmit = false;
+                        return false;
+                }
+        });
+        
+        // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
+        $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
+                // a keypress means the input has focus
+                // avoids issue where input had focus before the autocomplete was applied
+                hasFocus = 1;
+                // track last key pressed
+                lastKeyPressCode = event.keyCode;
+                switch(event.keyCode) {
+                
+                        case KEY.UP:
+                                event.preventDefault();
+                                if ( select.visible() ) {
+                                        select.prev();
+                                } else {
+                                        onChange(0, true);
+                                }
+                                break;
+                                
+                        case KEY.DOWN:
+                                event.preventDefault();
+                                if ( select.visible() ) {
+                                        select.next();
+                                } else {
+                                        onChange(0, true);
+                                }
+                                break;
+                                
+                        case KEY.PAGEUP:
+                                event.preventDefault();
+                                if ( select.visible() ) {
+                                        select.pageUp();
+                                } else {
+                                        onChange(0, true);
+                                }
+                                break;
+                                
+                        case KEY.PAGEDOWN:
+                                event.preventDefault();
+                                if ( select.visible() ) {
+                                        select.pageDown();
+                                } else {
+                                        onChange(0, true);
+                                }
+                                break;
+                        
+                        // matches also semicolon
+                        case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
+                        case KEY.TAB:
+                        case KEY.RETURN:
+                                if( selectCurrent() ) {
+                                        // stop default to prevent a form submit, Opera needs special handling
+                                        event.preventDefault();
+                                        blockSubmit = true;
+                                        return false;
+                                }
+                                break;
+                                
+                        case KEY.ESC:
+                                select.hide();
+                                break;
+                                
+                        default:
+                                clearTimeout(timeout);
+                                timeout = setTimeout(onChange, options.delay);
+                                break;
+                }
+        }).focus(function(){
+                // track whether the field has focus, we shouldn't process any
+                // results if the field no longer has focus
+                hasFocus++;
+        }).blur(function() {
+                hasFocus = 0;
+                if (!config.mouseDownOnSelect) {
+                        hideResults();
+                }
+        }).click(function() {
+                // show select when clicking in a focused field
+                if ( hasFocus++ > 1 && !select.visible() ) {
+                        onChange(0, true);
+                }
+        }).bind("search", function() {
+                // TODO why not just specifying both arguments?
+                var fn = (arguments.length > 1) ? arguments[1] : null;
+                function findValueCallback(q, data) {
+                        var result;
+                        if( data && data.length ) {
+                                for (var i=0; i < data.length; i++) {
+                                        if( data[i].result.toLowerCase() == q.toLowerCase() ) {
+                                                result = data[i];
+                                                break;
+                                        }
+                                }
+                        }
+                        if( typeof fn == "function" ) fn(result);
+                        else $input.trigger("result", result && [result.data, result.value]);
+                }
+                $.each(trimWords($input.val()), function(i, value) {
+                        request(value, findValueCallback, findValueCallback);
+                });
+        }).bind("flushCache", function() {
+                cache.flush();
+        }).bind("setOptions", function() {
+                $.extend(options, arguments[1]);
+                // if we've updated the data, repopulate
+                if ( "data" in arguments[1] )
+                        cache.populate();
+        }).bind("unautocomplete", function() {
+                select.unbind();
+                $input.unbind();
+                $(input.form).unbind(".autocomplete");
+        });
+        
+        
+        function selectCurrent() {
+                var selected = select.selected();
+                if( !selected )
+                        return false;
+                
+                var v = selected.result;
+                previousValue = v;
+                
+                if ( options.multiple ) {
+                        var words = trimWords($input.val());
+                        if ( words.length > 1 ) {
+                                var seperator = options.multipleSeparator.length;
+                                var cursorAt = $(input).selection().start;
+                                var wordAt, progress = 0;
+                                $.each(words, function(i, word) {
+                                        progress += word.length;
+                                        if (cursorAt <= progress) {
+                                                wordAt = i;
+                                                return false;
+                                        }
+                                        progress += seperator;
+                                });
+                                words[wordAt] = v;
+                                // TODO this should set the cursor to the right position, but it gets overriden somewhere
+                                //$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
+                                v = words.join( options.multipleSeparator );
+                        }
+                        v += options.multipleSeparator;
+                }
+                
+                $input.val(v);
+                hideResultsNow();
+                $input.trigger("result", [selected.data, selected.value]);
+                return true;
+        }
+        
+        function onChange(crap, skipPrevCheck) {
+                if( lastKeyPressCode == KEY.DEL ) {
+                        select.hide();
+                        return;
+                }
+                
+                var currentValue = $input.val();
+                
+                if ( !skipPrevCheck && currentValue == previousValue )
+                        return;
+                
+                previousValue = currentValue;
+                
+                currentValue = lastWord(currentValue);
+                if ( currentValue.length >= options.minChars) {
+                        $input.addClass(options.loadingClass);
+                        if (!options.matchCase)
+                                currentValue = currentValue.toLowerCase();
+                        request(currentValue, receiveData, hideResultsNow);
+                } else {
+                        stopLoading();
+                        select.hide();
+                }
+        };
+        
+        function trimWords(value) {
+                if (!value)
+                        return [""];
+                if (!options.multiple)
+                        return [$.trim(value)];
+                return $.map(value.split(options.multipleSeparator), function(word) {
+                        return $.trim(value).length ? $.trim(word) : null;
+                });
+        }
+        
+        function lastWord(value) {
+                if ( !options.multiple )
+                        return value;
+                var words = trimWords(value);
+                if (words.length == 1)
+                        return words[0];
+                var cursorAt = $(input).selection().start;
+                if (cursorAt == value.length) {
+                        words = trimWords(value)
+                } else {
+                        words = trimWords(value.replace(value.substring(cursorAt), ""));
+                }
+                return words[words.length - 1];
+        }
+        
+        // fills in the input box w/the first match (assumed to be the best match)
+        // q: the term entered
+        // sValue: the first matching result
+        function autoFill(q, sValue){
+                // autofill in the complete box w/the first match as long as the user hasn't entered in more data
+                // if the last user key pressed was backspace, don't autofill
+                if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
+                        // fill in the value (keep the case the user has typed)
+                        $input.val($input.val() + sValue.substring(lastWord(previousValue).length));
+                        // select the portion of the value not typed by the user (so the next character will erase)
+                        $(input).selection(previousValue.length, previousValue.length + sValue.length);
+                }
+        };
+
+        function hideResults() {
+                clearTimeout(timeout);
+                timeout = setTimeout(hideResultsNow, 200);
+        };
+
+        function hideResultsNow() {
+                var wasVisible = select.visible();
+                select.hide();
+                clearTimeout(timeout);
+                stopLoading();
+                if (options.mustMatch) {
+                        // call search and run callback
+                        $input.search(
+                                function (result){
+                                        // if no value found, clear the input box
+                                        if( !result ) {
+                                                if (options.multiple) {
+                                                        var words = trimWords($input.val()).slice(0, -1);
+                                                        $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
+                                                }
+                                                else {
+                                                        $input.val( "" );
+                                                        $input.trigger("result", null);
+                                                }
+                                        }
+                                }
+                        );
+                }
+        };
+
+        function receiveData(q, data) {
+                if ( data && data.length && hasFocus ) {
+                        stopLoading();
+                        select.display(data, q);
+                        autoFill(q, data[0].value);
+                        select.show();
+                } else {
+                        hideResultsNow();
+                }
+        };
+
+        function request(term, success, failure) {
+                if (!options.matchCase)
+                        term = term.toLowerCase();
+                var data = cache.load(term);
+                // recieve the cached data
+                if (data && data.length) {
+                        success(term, data);
+                // if an AJAX url has been supplied, try loading the data now
+                } else if( (typeof options.url == "string") && (options.url.length > 0) ){
+                        
+                        var extraParams = {
+                                timestamp: +new Date()
+                        };
+                        $.each(options.extraParams, function(key, param) {
+                                extraParams[key] = typeof param == "function" ? param() : param;
+                        });
+                        
+                        $.ajax({
+                                // try to leverage ajaxQueue plugin to abort previous requests
+                                mode: "abort",
+                                // limit abortion to this input
+                                port: "autocomplete" + input.name,
+                                dataType: options.dataType,
+                                url: options.url,
+                                data: $.extend({
+                                        q: lastWord(term),
+                                        limit: options.max
+                                }, extraParams),
+                                success: function(data) {
+                                        var parsed = options.parse && options.parse(data) || parse(data);
+                                        cache.add(term, parsed);
+                                        success(term, parsed);
+                                }
+                        });
+                } else {
+                        // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
+                        select.emptyList();
+                        failure(term);
+                }
+        };
+        
+        function parse(data) {
+                var parsed = [];
+                var rows = data.split("\n");
+                for (var i=0; i < rows.length; i++) {
+                        var row = $.trim(rows[i]);
+                        if (row) {
+                                row = row.split("|");
+                                parsed[parsed.length] = {
+                                        data: row,
+                                        value: row[0],
+                                        result: options.formatResult && options.formatResult(row, row[0]) || row[0]
+                                };
+                        }
+                }
+                return parsed;
+        };
+
+        function stopLoading() {
+                $input.removeClass(options.loadingClass);
+        };
+
+};
+
+$.Autocompleter.defaults = {
+        inputClass: "ac_input",
+        resultsClass: "ac_results",
+        loadingClass: "ac_loading",
+        minChars: 1,
+        delay: 400,
+        matchCase: false,
+        matchSubset: true,
+        matchContains: false,
+        cacheLength: 10,
+        max: 100,
+        mustMatch: false,
+        extraParams: {},
+        selectFirst: true,
+        formatItem: function(row) { return row[0]; },
+        formatMatch: null,
+        autoFill: false,
+        width: 0,
+        multiple: false,
+        multipleSeparator: ", ",
+        highlight: function(value, term) {
+                return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
+        },
+ scroll: true,
+ scrollHeight: 180
+};
+
+$.Autocompleter.Cache = function(options) {
+
+        var data = {};
+        var length = 0;
+        
+        function matchSubset(s, sub) {
+                if (!options.matchCase)
+                        s = s.toLowerCase();
+                var i = s.indexOf(sub);
+                if (options.matchContains == "word"){
+                        i = s.toLowerCase().search("\\b" + sub.toLowerCase());
+                }
+                if (i == -1) return false;
+                return i == 0 || options.matchContains;
+        };
+        
+        function add(q, value) {
+                if (length > options.cacheLength){
+                        flush();
+                }
+                if (!data[q]){
+                        length++;
+                }
+                data[q] = value;
+        }
+        
+        function populate(){
+                if( !options.data ) return false;
+                // track the matches
+                var stMatchSets = {},
+                        nullData = 0;
+
+                // no url was specified, we need to adjust the cache length to make sure it fits the local data store
+                if( !options.url ) options.cacheLength = 1;
+                
+                // track all options for minChars = 0
+                stMatchSets[""] = [];
+                
+                // loop through the array and create a lookup structure
+                for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
+                        var rawValue = options.data[i];
+                        // if rawValue is a string, make an array otherwise just reference the array
+                        rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
+                        
+                        var value = options.formatMatch(rawValue, i+1, options.data.length);
+                        if ( value === false )
+                                continue;
+                                
+                        var firstChar = value.charAt(0).toLowerCase();
+                        // if no lookup array for this character exists, look it up now
+                        if( !stMatchSets[firstChar] )
+                                stMatchSets[firstChar] = [];
+
+                        // if the match is a string
+                        var row = {
+                                value: value,
+                                data: rawValue,
+                                result: options.formatResult && options.formatResult(rawValue) || value
+                        };
+                        
+                        // push the current match into the set list
+                        stMatchSets[firstChar].push(row);
+
+                        // keep track of minChars zero items
+                        if ( nullData++ < options.max ) {
+                                stMatchSets[""].push(row);
+                        }
+                };
+
+                // add the data items to the cache
+                $.each(stMatchSets, function(i, value) {
+                        // increase the cache size
+                        options.cacheLength++;
+                        // add to the cache
+                        add(i, value);
+                });
+        }
+        
+        // populate any existing data
+        setTimeout(populate, 25);
+        
+        function flush(){
+                data = {};
+                length = 0;
+        }
+        
+        return {
+                flush: flush,
+                add: add,
+                populate: populate,
+                load: function(q) {
+                        if (!options.cacheLength || !length)
+                                return null;
+                        /*
+                         * if dealing w/local data and matchContains than we must make sure
+                         * to loop through all the data collections looking for matches
+                         */
+                        if( !options.url && options.matchContains ){
+                                // track all matches
+                                var csub = [];
+                                // loop through all the data grids for matches
+                                for( var k in data ){
+                                        // don't search through the stMatchSets[""] (minChars: 0) cache
+                                        // this prevents duplicates
+                                        if( k.length > 0 ){
+                                                var c = data[k];
+                                                $.each(c, function(i, x) {
+                                                        // if we've got a match, add it to the array
+                                                        if (matchSubset(x.value, q)) {
+                                                                csub.push(x);
+                                                        }
+                                                });
+                                        }
+                                }                                
+                                return csub;
+                        } else
+                        // if the exact item exists, use it
+                        if (data[q]){
+                                return data[q];
+                        } else
+                        if (options.matchSubset) {
+                                for (var i = q.length - 1; i >= options.minChars; i--) {
+                                        var c = data[q.substr(0, i)];
+                                        if (c) {
+                                                var csub = [];
+                                                $.each(c, function(i, x) {
+                                                        if (matchSubset(x.value, q)) {
+                                                                csub[csub.length] = x;
+                                                        }
+                                                });
+                                                return csub;
+                                        }
+                                }
+                        }
+                        return null;
+                }
+        };
+};
+
+$.Autocompleter.Select = function (options, input, select, config) {
+        var CLASSES = {
+                ACTIVE: "ac_over"
+        };
+        
+        var listItems,
+                active = -1,
+                data,
+                term = "",
+                needsInit = true,
+                element,
+                list;
+        
+        // Create results
+        function init() {
+                if (!needsInit)
+                        return;
+                element = $("<div/>")
+                .hide()
+                .addClass(options.resultsClass)
+                .css("position", "absolute")
+                .appendTo(document.body);
+        
+                list = $("<ul/>").appendTo(element).mouseover( function(event) {
+                        if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
+         active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
+                         $(target(event)).addClass(CLASSES.ACTIVE);
+         }
+                }).click(function(event) {
+                        $(target(event)).addClass(CLASSES.ACTIVE);
+                        select();
+                        // TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
+                        input.focus();
+                        return false;
+                }).mousedown(function() {
+                        config.mouseDownOnSelect = true;
+                }).mouseup(function() {
+                        config.mouseDownOnSelect = false;
+                });
+                
+                if( options.width > 0 )
+                        element.css("width", options.width);
+                        
+                needsInit = false;
+        }
+        
+        function target(event) {
+                var element = event.target;
+                while(element && element.tagName != "LI")
+                        element = element.parentNode;
+                // more fun with IE, sometimes event.target is empty, just ignore it then
+                if(!element)
+                        return [];
+                return element;
+        }
+
+        function moveSelect(step) {
+                listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
+                movePosition(step);
+ var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
+ if(options.scroll) {
+ var offset = 0;
+ listItems.slice(0, active).each(function() {
+                                offset += this.offsetHeight;
+                        });
+ if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
+ list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
+ } else if(offset < list.scrollTop()) {
+ list.scrollTop(offset);
+ }
+ }
+        };
+        
+        function movePosition(step) {
+                active += step;
+                if (active < 0) {
+                        active = listItems.size() - 1;
+                } else if (active >= listItems.size()) {
+                        active = 0;
+                }
+        }
+        
+        function limitNumberOfItems(available) {
+                return options.max && options.max < available
+                        ? options.max
+                        : available;
+        }
+        
+        function fillList() {
+                list.empty();
+                var max = limitNumberOfItems(data.length);
+                for (var i=0; i < max; i++) {
+                        if (!data[i])
+                                continue;
+                        var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
+                        if ( formatted === false )
+                                continue;
+                        var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
+                        $.data(li, "ac_data", data[i]);
+                }
+                listItems = list.find("li");
+                if ( options.selectFirst ) {
+                        listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
+                        active = 0;
+                }
+                // apply bgiframe if available
+                if ( $.fn.bgiframe )
+                        list.bgiframe();
+        }
+        
+        return {
+                display: function(d, q) {
+                        init();
+                        data = d;
+                        term = q;
+                        fillList();
+                },
+                next: function() {
+                        moveSelect(1);
+                },
+                prev: function() {
+                        moveSelect(-1);
+                },
+                pageUp: function() {
+                        if (active != 0 && active - 8 < 0) {
+                                moveSelect( -active );
+                        } else {
+                                moveSelect(-8);
+                        }
+                },
+                pageDown: function() {
+                        if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
+                                moveSelect( listItems.size() - 1 - active );
+                        } else {
+                                moveSelect(8);
+                        }
+                },
+                hide: function() {
+                        element && element.hide();
+                        listItems && listItems.removeClass(CLASSES.ACTIVE);
+                        active = -1;
+                },
+                visible : function() {
+                        return element && element.is(":visible");
+                },
+                current: function() {
+                        return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
+                },
+                show: function() {
+                        var offset = $(input).offset();
+                        element.css({
+                                width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
+                                top: offset.top + input.offsetHeight,
+                                left: offset.left
+                        }).show();
+ if(options.scroll) {
+ list.scrollTop(0);
+ list.css({
+                                        maxHeight: options.scrollHeight,
+                                        overflow: 'auto'
+                                });
+                                
+ if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
+                                        var listHeight = 0;
+                                        listItems.each(function() {
+                                                listHeight += this.offsetHeight;
+                                        });
+                                        var scrollbarsVisible = listHeight > options.scrollHeight;
+ list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
+                                        if (!scrollbarsVisible) {
+                                                // IE doesn't recalculate width when scrollbar disappears
+                                                listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
+                                        }
+ }
+
+ }
+                },
+                selected: function() {
+                        var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
+                        return selected && selected.length && $.data(selected[0], "ac_data");
+                },
+                emptyList: function (){
+                        list && list.empty();
+                },
+                unbind: function() {
+                        element && element.remove();
+                }
+        };
+};
+
+$.fn.selection = function(start, end) {
+        if (start !== undefined) {
+                return this.each(function() {
+                        if( this.createTextRange ){
+                                var selRange = this.createTextRange();
+                                if (end === undefined || start == end) {
+                                        selRange.move("character", start);
+                                        selRange.select();
+                                } else {
+                                        selRange.collapse(true);
+                                        selRange.moveStart("character", start);
+                                        selRange.moveEnd("character", end);
+                                        selRange.select();
+                                }
+                        } else if( this.setSelectionRange ){
+                                this.setSelectionRange(start, end);
+                        } else if( this.selectionStart ){
+                                this.selectionStart = start;
+                                this.selectionEnd = end;
+                        }
+                });
+        }
+        var field = this[0];
+        if ( field.createTextRange ) {
+                var range = document.selection.createRange(),
+                        orig = field.value,
+                        teststring = "<->",
+                        textLength = range.text.length;
+                range.text = teststring;
+                var caretAt = field.value.indexOf(teststring);
+                field.value = orig;
+                this.selection(caretAt, caretAt + textLength);
+                return {
+                        start: caretAt,
+                        end: caretAt + textLength
+                }
+        } else if( field.selectionStart !== undefined ){
+                return {
+                        start: field.selectionStart,
+                        end: field.selectionEnd
+                }
+        }
+};
+
+})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationcustomjqueryautocompletejs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-custom-jquery-autocomplete.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-custom-jquery-autocomplete.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-custom-jquery-autocomplete.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+(function(a){a.fn.extend({autocomplete:function(b,c){var d=typeof b=="string";c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c);c.highlight=c.highlight||function(e){return e};c.formatMatch=c.formatMatch||c.formatItem;return this.each(function(){new a.Autocompleter(this,c)})},result:function(b){return this.bind("result",b)},search:function(b){return this.trigger("search",[b])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(b){return this.trigger("setOptions",[b])},unautocomplete:function(){return this.trigger("unautocomplete")}});a.Autocompleter=function(l,g){var c={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var b=a(l).attr("autocomplete","off").addClass(g.inputClass);var j;var p="";var m=a.Autocompleter.Cache(g);var e=0;var u;var x={mouseDownOnSelect:false};var r=a.Autocompleter.Select(g,l,d,x);var w;a.browser.opera&&a(l.form).bind("submit.autocomplete",function(){if(w){w=false;return false}});b.bind((a.browser.opera?"keypress":"keydown")+".autocomplete",function(y){e=1;u=y.keyCode;switch(y.keyCode){case c.UP:y.preventDefault();if(r.visible()){r.prev()}else{t(0,true)}break;case c.DOWN:y.preventDefault();if(r.visible()){r.next()}else{t(0,true)}break;case c.PAGEUP:y.preventDefault();if(r.visible()){r.pageUp()}else{t(0,true)}break;case c.PAGEDOWN:y.preventDefault();if(r.visible()){r.pageDown()}else{t(0,true)}break;case g.multiple&&a.trim(g.multipleSeparator)==","&&c.COMMA:case c.TAB:case c.RETURN:if(d()){y.preventDefault();w=true;return false}break;case c.ESC:r.hide();break;default:clearTimeout(j);j=setTimeout(t,g.delay);break}}).focus(function(){e++}).blur(function(){e=0;if(!x.mouseDownOnSelect){s()}}).click(function(){if(e++>1&&!r.visible()){t(0,true)}}).bind("search",function(){var y=(arguments.length>1)?arguments[1]:null;function z(D,C){var A;if(C&&C.length){for(var B=0;B<C.length;B++){if(C[B].result.toLowerCase()==D.toLowerCase()){A=C[B];break}}}if(typeof y=="function"){y(A)}else{b.trigger("result",A&&[A.data,A.value])}}a.each(h(b.val()),function(A,B){f(B,z,z)})}).bind("flushCache",function(){m.flush()}).bind("setOptions",function(){a.extend(g,arguments[1]);if("data" in arguments[1]){m.populate()}}).bind("unautocomplete",function(){r.unbind();b.unbind();a(l.form).unbind(".autocomplete")});function d(){var B=r.selected();if(!B){return false}var y=B.result;p=y;if(g.multiple){var E=h(b.val());if(E.length>1){var A=g.multipleSeparator.length;var D=a(l).selection().start;var C,z=0;a.each(E,function(F,G){z+=G.length;if(D<=z){C=F;return false}z+=A});E[C]=y;y=E.join(g.multipleSeparator)}y+=g.multipleSeparator}b.val(y);v();b.trigger("result",[B.data,B.value]);return true}function t(A,z){if(u==c.DEL){r.hide();return}var y=b.val();if(!z&&y==p){return}p=y;y=i(y);if(y.length>=g.minChars){b.addClass(g.loadingClass);if(!g.matchCase){y=y.toLowerCase()}f(y,k,v)}else{n();r.hide()}}function h(y){if(!y){return[""]}if(!g.multiple){return[a.trim(y)]}return a.map(y.split(g.multipleSeparator),function(z){return a.trim(y).length?a.trim(z):null})}function i(y){if(!g.multiple){return y}var A=h(y);if(A.length==1){return A[0]}var z=a(l).selection().start;if(z==y.length){A=h(y)}else{A=h(y.replace(y.substring(z),""))}return A[A.length-1]}function q(y,z){if(g.autoFill&&(i(b.val()).toLowerCase()==y.toLowerCase())&&u!=c.BACKSPACE){b.val(b.val()+z.substring(i(p).length));a(l).selection(p.length,p.length+z.length)}}function s(){clearTimeout(j);j=setTimeout(v,200)}function v(){var y=r.visible();r.hide();clearTimeout(j);n();if(g.mustMatch){b.search(function(z){if(!z){if(g.multiple){var A=h(b.val()).slice(0,-1);b.val(A.join(g.multipleSeparator)+(A.length?g.multipleSeparator:""))}else{b.val("");b.trigger("result",null)}}})}}function k(z,y){if(y&&y.length&&e){n();r.display(y,z);q(z,y[0].value);r.show()}else{v()}}function f(z,B,y){if(!g.matchCase){z=z.toLowerCase()}var A=m.load(z);if(A&&A.length){B(z,A)}else{if((typeof g.url=="string")&&(g.url.length>0)){var C={timestamp:+new Date()};a.each(g.extraParams,function(D,E){C[D]=typeof E=="function"?E():E});a.ajax({mode:"abort",port:"autocomplete"+l.name,dataType:g.dataType,url:g.url,data:a.extend({q:i(z),limit:g.max},C),success:function(E){var D=g.parse&&g.parse(E)||o(E);m.add(z,D);B(z,D)}})}else{r.emptyList();y(z)}}}function o(B){var y=[];var A=B.split("\n");for(var z=0;z<A.length;z++){var C=a.trim(A[z]);if(C){C=C.split("|");y[y.length]={data:C,value:C[0],result:g.formatResult&&g.formatResult(C,C[0])||C[0]}}}return y}function n(){b.removeClass(g.loadingClass)}};a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(b){return b[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(c,b){return c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180};a.Autocompleter.Cache=function(c){var f={};var d=0;function h(l,k){if(!c.matchCase){l=l.toLowerCase()}var j=l.indexOf(k);if(c.matchContains=="word"){j=l.toLowerCase().search("\\b"+k.toLowerCase())}if(j==-1){return false}return j==0||c.matchContains}function g(j,i){if(d>c.cacheLength){b()}if(!f[j]){d++}f[j]=i}function e(){if(!c.data){return false}var k={},j=0;if(!c.url){c.cacheLength=1}k[""]=[];for(var m=0,l=c.data.length;m<l;m++){var p=c.data[m];p=(typeof p=="string")?[p]:p;var o=c.formatMatch(p,m+1,c.data.length);if(o===false){continue}var n=o.charAt(0).toLowerCase();if(!k[n]){k[n]=[]}var q={value:o,data:p,result:c.formatResult&&c.formatResult(p)||o};k[n].push(q);if(j++<c.max){k[""].push(q)}}a.each(k,function(r,s){c.cacheLength++;g(r,s)})}setTimeout(e,25);function b(){f={};d=0}return{flush:b,add:g,populate:e,load:function(n){if(!c.cacheLength||!d){return null}if(!c.url&&c.matchContains){var m=[];for(var j in f){if(j.length>0){var o=f[j];a.each(o,function(p,k){if(h(k.value,n)){m.push(k)}})}}return m}else{if(f[n]){return f[n]}else{if(c.matchSubset){for(var l=n.length-1;l>=c.minChars;l--){var o=f[n.substr(0,l)];if(o){var m=[];a.each(o,function(p,k){if(h(k.value,n)){m[m.length]=k}});return m}}}}}return null}}};a.Autocompleter.Select=function(e,j,l,p){var i={ACTIVE:"ac_over"};var k,f=-1,r,m="",s=true,c,o;function n(){if(!s){return}c=a("<div/>").hide().addClass(e.resultsClass).css("position","absolute").appendTo(document.body);o=a("<ul/>").appendTo(c).mouseover(function(t){if(q(t).nodeName&&q(t).nodeName.toUpperCase()=="LI"){f=a("li",o).removeClass(i.ACTIVE).index(q(t));a(q(t)).addClass(i.ACTIVE)}}).click(function(t){a(q(t)).addClass(i.ACTIVE);l();j.focus();return false}).mousedown(function(){p.mouseDownOnSelect=true}).mouseup(function(){p.mouseDownOnSelect=false});if(e.width>0){c.css("width",e.width)}s=false}function q(u){var t=u.target;while(t&&t.tagName!="LI"){t=t.parentNode}if(!t){return[]}return t}function h(t){k.slice(f,f+1).removeClass(i.ACTIVE);g(t);var v=k.slice(f,f+1).addClass(i.ACTIVE);if(e.scroll){var u=0;k.slice(0,f).each(function(){u+=this.offsetHeight});if((u+v[0].offsetHeight-o.scrollTop())>o[0].clientHeight){o.scrollTop(u+v[0].offsetHeight-o.innerHeight())}else{if(u<o.scrollTop()){o.scrollTop(u)}}}}function g(t){f+=t;if(f<0){f=k.size()-1}else{if(f>=k.size()){f=0}}}function b(t){return e.max&&e.max<t?e.max:t}function d(){o.empty();var u=b(r.length);for(var v=0;v<u;v++){if(!r[v]){continue}var w=e.formatItem(r[v].data,v+1,u,r[v].value,m);if(w===false){continue}var t=a("<li/>").html(e.highlight(w,m)).addClass(v%2==0?"ac_even":"ac_odd").appendTo(o)[0];a.data(t,"ac_data",r[v])}k=o.find("li");if(e.selectFirst){k.slice(0,1).addClass(i.ACTIVE);f=0}if(a.fn.bgiframe){o.bgiframe()}}return{display:function(u,t){n();r=u;m=t;d()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){if(f!=0&&f-8<0){h(-f)}else{h(-8)}},pageDown:function(){if(f!=k.size()-1&&f+8>k.size()){h(k.size()-1-f)}else{h(8)}},hide:function(){c&&c.hide();k&&k.removeClass(i.ACTIVE);f=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(k.filter("."+i.ACTIVE)[0]||e.selectFirst&&k[0])},show:function(){var v=a(j).offset();c.css({width:typeof e.width=="string"||e.width>0?e.width:a(j).width(),top:v.top+j.offsetHeight,left:v.left}).show();if(e.scroll){o.scrollTop(0);o.css({maxHeight:e.scrollHeight,overflow:"auto"});if(a.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var t=0;k.each(function(){t+=this.offsetHeight});var u=t>e.scrollHeight;o.css("height",u?e.scrollHeight:t);if(!u){k.width(o.width()-parseInt(k.css("padding-left"))-parseInt(k.css("padding-right")))}}}},selected:function(){var t=k&&k.filter("."+i.ACTIVE).removeClass(i.ACTIVE);return t&&t.length&&a.data(t[0],"ac_data")},emptyList:function(){o&&o.empty()},unbind:function(){c&&c.remove()}}};a.fn.selection=function(i,b){if(i!==undefined){return this.each(function(){if(this.createTextRange){var j=this.createTextRange();if(b===undefined||i==b){j.move("character",i);j.select()}else{j.collapse(true);j.moveStart("character",i);j.moveEnd("character",b);j.select()}}else{if(this.setSelectionRange){this.setSelectionRange(i,b)}else{if(this.selectionStart){this.selectionStart=i;this.selectionEnd=b}}}})}var g=this[0];if(g.createTextRange){var c=document.selection.createRange(),h=g.value,f="<->",d=c.text.length;c.text=f;var e=g.value.indexOf(f);g.value=h;this.selection(e,e+d);return{start:e,end:e+d}}else{if(g.selectionStart!==undefined){return{start:g.selectionStart,end:g.selectionEnd}}}}})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationcustomjqueryui172devjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.dev.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.dev.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.dev.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * jQuery UI 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI
+ */
+jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/*
+ * jQuery UI Draggable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Draggables
+ *
+ * Depends:
+ *        ui.core.js
+ */
+(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;/*
+ * jQuery UI Droppable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Droppables
+ *
+ * Depends:
+ *        ui.core.js
+ *        ui.draggable.js
+ */
+(function(a){a.widget("ui.droppable",{_init:function(){var c=this.options,b=c.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&a.isFunction(this.options.accept)?this.options.accept:function(e){return e.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[this.options.scope]=a.ui.ddmanager.droppables[this.options.scope]||[];a.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++){if(b[c]==this){b.splice(c,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(b,c){if(b=="accept"){this.options.accept=c&&a.isFunction(c)?c:function(e){return e.is(c)}}else{a.widget.prototype._setData.apply(this,arguments)}},_activate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(b&&this._trigger("activate",c,this.ui(b)))},_deactivate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(b&&this._trigger("deactivate",c,this.ui(b)))},_over:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",c,this.ui(b))}},_out:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",c,this.ui(b))}},_drop:function(c,d){var b=d||a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return false}var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=a.data(this,"droppable");if(f.options.greedy&&a.ui.intersect(b,a.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e){return false}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",c,this.ui(b));return this.element}return false},ui:function(b){return{draggable:(b.currentItem||b.element),helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(q,j,o){if(!j.offset){return false}var e=(q.positionAbs||q.position.absolute).left,d=e+q.helperProportions.width,n=(q.positionAbs||q.position.absolute).top,m=n+q.helperProportions.height;var g=j.offset.left,c=g+j.proportions.width,p=j.offset.top,k=p+j.proportions.height;switch(o){case"fit":return(g<e&&d<c&&p<n&&m<k);break;case"intersect":return(g<e+(q.helperProportions.width/2)&&d-(q.helperProportions.width/2)<c&&p<n+(q.helperProportions.height/2)&&m-(q.helperProportions.height/2)<k);break;case"pointer":var h=((q.positionAbs||q.position.absolute).left+(q.clickOffset||q.offset.click).left),i=((q.positionAbs||q.position.absolute).top+(q.clickOffset||q.offset.click).top),f=a.ui.isOver(i,h,p,g,j.proportions.height,j.proportions.width);return f;break;case"touch":return((n>=p&&n<=k)||(m>=p&&m<=k)||(n<p&&m>k))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d<b.length;d++){if(b[d].options.disabled||(e&&!b[d].options.accept.call(b[d].element[0],(e.currentItem||e.element)))){continue}for(var c=0;c<h.length;c++){if(h[c]==b[d].element[0]){b[d].proportions.height=0;continue droppablesLoop}}b[d].visible=b[d].element.css("display")!="none";if(!b[d].visible){continue}b[d].offset=b[d].element.offset();b[d].proportions={width:b[d].element[0].offsetWidth,height:b[d].element[0].offsetHeight};if(f=="mousedown"){b[d]._activate.call(b[d],g)}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)){d=this._drop.call(this,c)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(b.currentItem||b.element))){this.isout=1;this.isover=0;this._deactivate.call(this,c)}});return d},drag:function(b,c){if(b.options.refreshPositions){a.ui.ddmanager.prepareOffsets(b,c)}a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var e=a.ui.intersect(b,this,this.options.tolerance);var g=!e&&this.isover==1?"isout":(e&&this.isover==0?"isover":null);if(!g){return}var f;if(this.options.greedy){var d=this.element.parents(":data(droppable):eq(0)");if(d.length){f=a.data(d[0],"droppable");f.greedyChild=(g=="isover"?1:0)}}if(f&&g=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[g]=1;this[g=="isout"?"isover":"isout"]=0;this[g=="isover"?"_over":"_out"].call(this,c);if(f&&g=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}})}}})(jQuery);;/*
+ * jQuery UI Sortable 1.7.2
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Sortables
+ *
+ * Depends:
+ *        ui.core.js
+ */
+(function(a){a.widget("ui.sortable",a.extend({},a.ui.mouse,{_init:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop+g.scrollSpeed}else{if(f.pageY-this.overflowOffset.top<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop-g.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-f.pageX<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(f.pageX-this.overflowOffset.left<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft-g.scrollSpeed}}}else{if(f.pageY-a(document).scrollTop()<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(f.pageY-a(document).scrollTop())<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}if(f.pageX-a(document).scrollLeft()<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(f.pageX-a(document).scrollLeft())<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}if(b!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)<i&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>m[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&n<k+(this.helperProportions.height/2)&&j-(this.helperProportions.height/2)<i)}},_intersectsWithPointer:function(d){var e=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height),c=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width),g=e&&c,b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(!g){return false}return this.floating?(((f&&f=="right")||b=="down")?2:1):(b&&(b=="down"?2:1))},_intersectsWithSides:function(e){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+(e.height/2),e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+(e.width/2),e.width),b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(this.floating&&f){return((f=="right"&&d)||(f=="left"&&!d))}else{return b&&((b=="down"&&c)||(b=="up"&&!c))}},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c<this.items.length;c++){for(var b=0;b<d.length;b++){if(d[b]==this.items[c].item[0]){this.items.splice(c,1)}}}},_refreshItems:function(b){this.items=[];this.containers=[this];var h=this.items;var p=this;var f=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]];var l=this._connectWith();if(l){for(var e=l.length-1;e>=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d<n;d++){var o=a(c[d]);o.data("sortable-item",k);h.push({item:o,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)<h){h=Math.abs(f-e);g=this.items[b]}}if(!g&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[c];g?this._rearrange(d,g,null,true):this._rearrange(d,null,this.containers[c].element,true);this._trigger("change",d,this._uiHash());this.containers[c]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[c]._trigger("over",d,this._uiHash(this));this.containers[c].containerCache.over=1}}else{if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",d,this._uiHash(this));this.containers[c].containerCache.over=0}}}},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c,this.currentItem])):(d.helper=="clone"?this.currentItem.clone():this.currentItem);if(!b.parents("body").length){a(d.appendTo!="parent"?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0])}if(b[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(b[0].style.width==""||d.forceHelperSize){b.width(this.currentItem.width())}if(b[0].style.height==""||d.forceHelperSize){b.height(this.currentItem.height())}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)){var c=a(e.containment)[0];var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_rearrange:function(g,f,c,e){c?c[0].appendChild(this.placeholder[0]):f.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?f.item[0]:f.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var d=this,b=this.counter;window.setTimeout(function(){if(b==d.counter){d.refreshPositions(!e)}},0)},_clear:function(d,e){this.reverting=false;var f=[],b=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var c in this._storedCSS){if(this._storedCSS[c]=="auto"||this._storedCSS[c]=="static"){this._storedCSS[c]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){f.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!e){f.push(function(g){this._trigger("update",g,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!e){f.push(function(g){this._trigger("remove",g,this._uiHash())})}for(var c=this.containers.length-1;c>=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}return false}if(!e){this._trigger("beforeStop",d,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!e){for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(c){var b=c||this;return{helper:b.helper,placeholder:b.placeholder||a([]),position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs,item:b.currentItem,sender:c?c.element:null}}}));a.extend(a.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationcustomjqueryui172js"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+jQuery.ui||(function(p){var j=p.fn.remove,o=p.browser.mozilla&&(parseFloat(p.browser.version)<1.9);p.ui={version:"1.7.2",plugin:{add:function(c,b,e){var a=p.ui[c].prototype;for(var d in e){a.plugins[d]=a.plugins[d]||[];a.plugins[d].push([b,e[d]])}},call:function(d,b,c){var e=d.plugins[b];if(!e||!d.element[0].parentNode){return}for(var a=0;a<e.length;a++){if(d.options[e[a][0]]){e[a][1].apply(d.element,c)}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,c){if(p(a).css("overflow")=="hidden"){return false}var d=(c&&c=="left")?"scrollLeft":"scrollTop",b=false;if(a[d]>0){return true}a[d]=1;b=(a[d]>0);a[d]=0;return b},isOverAxis:function(b,c,a){return(b>c)&&(b<(c+a))},isOver:function(e,c,f,a,d,b){return p.ui.isOverAxis(e,f,d)&&p.ui.isOverAxis(c,a,b)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(o){var m=p.attr,n=p.fn.removeAttr,k="http://www.w3.org/2005/07/aaa",r=/^aria-/,q=/^wairole:/;p.attr=function(c,d,b){var a=b!==undefined;return(d=="role"?(a?m.call(this,c,d,"wairole:"+b):(m.apply(this,arguments)||"").replace(q,"")):(r.test(d)?(a?c.setAttributeNS(k,d.replace(r,"aaa:"),b):m.call(this,c,d.replace(r,"aaa:"))):m.apply(this,arguments)))};p.fn.removeAttr=function(a){return(r.test(a)?this.each(function(){this.removeAttributeNS(k,a.replace(r,""))}):n.call(this,a))}}p.fn.extend({remove:function(){p("*",this).add(this).each(function(){p(this).triggerHandler("remove")});return j.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var a;if((p.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){a=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(p.curCSS(this,"position",1))&&(/(auto|scroll)/).test(p.curCSS(this,"overflow",1)+p.curCSS(this,"overflow-y",1)+p.curCSS(this,"overflow-x",1))}).eq(0)}else{a=this.parents().filter(function(){return(/(auto|scroll)/).test(p.curCSS(this,"overflow",1)+p.curCSS(this,"overflow-y",1)+p.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!a.length?p(document):a}});p.extend(p.expr[":"],{data:function(a,b,c){return !!p.data(a,c[3])},focusable:function(b){var a=b.nodeName.toLowerCase(),c=p.attr(b,"tabindex");return(/input|select|textarea|button|object/.test(a)?!b.disabled:"a"==a||"area"==a?b.href||!isNaN(c):!isNaN(c))&&!p(b)["area"==a?"parents":"closest"](":hidden").length},tabbable:function(a){var b=p.attr(a,"tabindex");return(isNaN(b)||b>=0)&&p(a).is(":focusable")}});function l(a,f,e,b){function c(g){var h=p[a][f][g]||[];return(typeof h=="string"?h.split(/,?\s+/):h)}var d=c("getter");if(b.length==1&&typeof b[0]=="string"){d=d.concat(c("getterSetter"))}return(p.inArray(e,d)!=-1)}p.widget=function(b,c){var a=b.split(".")[0];b=b.split(".")[1];p.fn[b]=function(e){var g=(typeof e=="string"),f=Array.prototype.slice.call(arguments,1);if(g&&e.substring(0,1)=="_"){return this}if(g&&l(a,b,e,f)){var d=p.data(this[0],b);return(d?d[e].apply(d,f):undefined)}return this.each(function(){var h=p.data(this,b);(!h&&!g&&p.data(this,b,new p[a][b](this,e))._init());(h&&g&&p.isFunction(h[e])&&h[e].apply(h,f))})};p[a]=p[a]||{};p[a][b]=function(e,f){var d=this;this.namespace=a;this.widgetName=b;this.widgetEventPrefix=p[a][b].eventPrefix||b;this.widgetBaseClass=a+"-"+b;this.options=p.extend({},p.widget.defaults,p[a][b].defaults,p.metadata&&p.metadata.get(e)[b],f);this.element=p(e).bind("setData."+b,function(h,i,g){if(h.target==e){return d._setData(i,g)}}).bind("getData."+b,function(g,h){if(g.target==e){return d._getData(h)}}).bind("remove",function(){return d.destroy()})};p[a][b].prototype=p.extend({},p.widget.prototype,c);p[a][b].getterSetter="option"};p.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(b,a){var c=b,d=this;if(typeof b=="string"){if(a===undefined){return this._getData(b)}c={};c[b]=a}p.each(c,function(f,e){d._setData(f,e)})},_getData:function(a){return this.options[a]},_setData:function(b,a){this.options[b]=a;if(b=="disabled"){this.element[a?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",a)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(b,a,g){var e=this.options[b],d=(b==this.widgetEventPrefix?b:this.widgetEventPrefix+b);a=p.Event(a);a.type=d;if(a.originalEvent){for(var c=p.event.props.length,f;c;){f=p.event.props[--c];a[f]=a.originalEvent[f]}}this.element.trigger(a,g);return !(p.isFunction(e)&&e.call(this.element[0],a,g)===false||a.isDefaultPrevented())}};p.widget.defaults={disabled:false};p.ui.mouse={_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});if(p.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(p.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(b){b.originalEvent=b.originalEvent||{};if(b.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(b));this._mouseDownEvent=b;var c=this,a=(b.which==1),d=(typeof this.options.cancel=="string"?p(b.target).parents().add(b.target).filter(this.options.cancel).length:false);if(!a||d||!this._mouseCapture(b)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=(this._mouseStart(b)!==false);if(!this._mouseStarted){b.preventDefault();return true}}this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};p(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(p.browser.safari||b.preventDefault());b.originalEvent.mouseHandled=true;return true},_mouseMove:function(a){if(p.browser.msie&&!a.button){return this._mouseUp(a)}if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,a)!==false);(this._mouseStarted?this._mouseDrag(a):this._mouseUp(a))}return !this._mouseStarted},_mouseUp:function(a){p(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(a.target==this._mouseDownEvent.target);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return(Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance)},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return true}};p.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(b){b.widget("ui.draggable",b.extend({},b.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(a){var d=this.options;if(this.helper||d.disabled||b(a.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(a);if(!this.handle){return false}return true},_mouseStart:function(a){var d=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(b.ui.ddmanager){b.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};b.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;if(d.cursorAt){this._adjustOffsetFromHelper(d.cursorAt)}if(d.containment){this._setContainment()}this._trigger("start",a);this._cacheHelperProportions();if(b.ui.ddmanager&&!d.dropBehaviour){b.ui.ddmanager.prepareOffsets(this,a)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,e){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!e){var f=this._uiHash();this._trigger("drag",a,f);this.position=f.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(b.ui.ddmanager){b.ui.ddmanager.drag(this,a)}return false},_mouseStop:function(f){var e=false;if(b.ui.ddmanager&&!this.options.dropBehaviour){e=b.ui.ddmanager.drop(this,f)}if(this.dropped){e=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!e)||(this.options.revert=="valid"&&e)||this.options.revert===true||(b.isFunction(this.options.revert)&&this.options.revert.call(this.element,e))){var a=this;b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){a._trigger("stop",f);a._clear()})}else{this._trigger("stop",f);this._clear()}return false},_getHandle:function(a){var d=!this.options.handle||!b(this.options.handle,this.element).length?true:false;b(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target){d=true}});return d},_createHelper:function(f){var e=this.options;var a=b.isFunction(e.helper)?b(e.helper.apply(this.element[0],[f])):(e.helper=="clone"?this.element.clone():this.element);if(!a.parents("body").length){a.appendTo((e.appendTo=="parent"?this.element[0].parentNode:e.appendTo))}if(a[0]!=this.element[0]&&!(/(fixed|absolute)/).test(a.css("position"))){a.css("position","absolute")}return a},_adjustOffsetFromHelper:function(a){if(a.left!=undefined){this.offset.click.left=a.left+this.margins.left}if(a.right!=undefined){this.offset.click.left=this.helperProportions.width-a.right+this.margins.left}if(a.top!=undefined){this.offset.click.top=a.top+this.margins.top}if(a.bottom!=undefined){this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)){a={top:0,left:0}}return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var f=this.options;if(f.containment=="parent"){f.containment=this.helper[0].parentNode}if(f.containment=="document"||f.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(f.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b(f.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(f.containment)&&f.containment.constructor!=Array){var h=b(f.containment)[0];if(!h){return}var g=b(f.containment).offset();var a=(b(h).css("overflow")!="hidden");this.containment=[g.left+(parseInt(b(h).css("borderLeftWidth"),10)||0)+(parseInt(b(h).css("paddingLeft"),10)||0)-this.margins.left,g.top+(parseInt(b(h).css("borderTopWidth"),10)||0)+(parseInt(b(h).css("paddingTop"),10)||0)-this.margins.top,g.left+(a?Math.max(h.scrollWidth,h.offsetWidth):h.offsetWidth)-(parseInt(b(h).css("borderLeftWidth"),10)||0)-(parseInt(b(h).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,g.top+(a?Math.max(h.scrollHeight,h.offsetHeight):h.offsetHeight)-(parseInt(b(h).css("borderTopWidth"),10)||0)-(parseInt(b(h).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(f.containment.constructor==Array){this.containment=f.containment}}},_convertPositionTo:function(j,d){if(!d){d=this.position}var l=j=="absolute"?1:-1;var k=this.options,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(a[0].tagName);return{top:(d.top+this.offset.relative.top*l+this.offset.parent.top*l-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:a.scrollTop()))*l)),left:(d.left+this.offset.relative.left*l+this.offset.parent.left*l-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:a.scrollLeft())*l))}},_generatePosition:function(n){var k=this.options,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,j=(/(html|body)/i).test(a[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var o=n.pageX;var p=n.pageY;if(this.originalPosition){if(this.containment){if(n.pageX-this.offset.click.left<this.containment[0]){o=this.containment[0]+this.offset.click.left}if(n.pageY-this.offset.click.top<this.containment[1]){p=this.containment[1]+this.offset.click.top}if(n.pageX-this.offset.click.left>this.containment[2]){o=this.containment[2]+this.offset.click.left}if(n.pageY-this.offset.click.top>this.containment[3]){p=this.containment[3]+this.offset.click.top}}if(k.grid){var l=this.originalPageY+Math.round((p-this.originalPageY)/k.grid[1])*k.grid[1];p=this.containment?(!(l-this.offset.click.top<this.containment[1]||l-this.offset.click.top>this.containment[3])?l:(!(l-this.offset.click.top<this.containment[1])?l-k.grid[1]:l+k.grid[1])):l;var m=this.originalPageX+Math.round((o-this.originalPageX)/k.grid[0])*k.grid[0];o=this.containment?(!(m-this.offset.click.left<this.containment[0]||m-this.offset.click.left>this.containment[2])?m:(!(m-this.offset.click.left<this.containment[0])?m-k.grid[0]:m+k.grid[0])):m}}return{top:(p-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(j?0:a.scrollTop())))),left:(o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():j?0:a.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,f,e){e=e||this._uiHash();b.ui.plugin.call(this,a,[f,e]);if(a=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return b.widget.prototype._trigger.call(this,a,f,e)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));b.extend(b.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});b.ui.plugin.add("draggable","connectToSortable",{start:function(j,h){var i=b(this).data("draggable"),g=i.options,a=b.extend({},h,{item:i.element});i.sortables=[];b(g.connectToSortable).each(function(){var c=b.data(this,"sortable");if(c&&!c.options.disabled){i.sortables.push({instance:c,shouldRevert:c.options.revert});c._refreshItems();c._trigger("activate",j,a)}})},stop:function(h,f){var g=b(this).data("draggable"),a=b.extend({},f,{item:g.element});b.each(g.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;g.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(h);this.instance.options.helper=this.instance.options._helper;if(g.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",h,a)}})},drag:function(j,g){var h=b(this).data("draggable"),a=this;var i=function(r){var d=this.offset.click.top,e=this.offset.click.left;var t=this.positionAbs.top,o=this.positionAbs.left;var q=r.height,f=r.width;var c=r.top,s=r.left;return b.ui.isOver(t+d,o+e,c,s,q,f)};b.each(h.sortables,function(c){this.instance.positionAbs=h.positionAbs;this.instance.helperProportions=h.helperProportions;this.instance.offset.click=h.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=b(a).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return g.helper[0]};j.target=this.instance.currentItem[0];this.instance._mouseCapture(j,true);this.instance._mouseStart(j,true,true);this.instance.offset.click.top=h.offset.click.top;this.instance.offset.click.left=h.offset.click.left;this.instance.offset.parent.left-=h.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=h.offset.parent.top-this.instance.offset.parent.top;h._trigger("toSortable",j);h.dropped=this.instance.element;h.currentItem=h.element;this.instance.fromOutside=h}if(this.instance.currentItem){this.instance._mouseDrag(j)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",j,this.instance._uiHash(this.instance));this.instance._mouseStop(j,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}h._trigger("fromSortable",j);h.dropped=false}}})}});b.ui.plugin.add("draggable","cursor",{start:function(h,g){var a=b("body"),f=b(this).data("draggable").options;if(a.css("cursor")){f._cursor=a.css("cursor")}a.css("cursor",f.cursor)},stop:function(a,f){var e=b(this).data("draggable").options;if(e._cursor){b("body").css("cursor",e._cursor)}}});b.ui.plugin.add("draggable","iframeFix",{start:function(a,f){var e=b(this).data("draggable").options;b(e.iframeFix===true?"iframe":e.iframeFix).each(function(){b('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(b(this).offset()).appendTo("body")})},stop:function(a,d){b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});b.ui.plugin.add("draggable","opacity",{start:function(h,g){var a=b(g.helper),f=b(this).data("draggable").options;if(a.css("opacity")){f._opacity=a.css("opacity")}a.css("opacity",f.opacity)},stop:function(a,f){var e=b(this).data("draggable").options;if(e._opacity){b(f.helper).css("opacity",e._opacity)}}});b.ui.plugin.add("draggable","scroll",{start:function(f,e){var a=b(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML"){a.overflowOffset=a.scrollParent.offset()}},drag:function(i,h){var j=b(this).data("draggable"),g=j.options,a=false;if(j.scrollParent[0]!=document&&j.scrollParent[0].tagName!="HTML"){if(!g.axis||g.axis!="x"){if((j.overflowOffset.top+j.scrollParent[0].offsetHeight)-i.pageY<g.scrollSensitivity){j.scrollParent[0].scrollTop=a=j.scrollParent[0].scrollTop+g.scrollSpeed}else{if(i.pageY-j.overflowOffset.top<g.scrollSensitivity){j.scrollParent[0].scrollTop=a=j.scrollParent[0].scrollTop-g.scrollSpeed}}}if(!g.axis||g.axis!="y"){if((j.overflowOffset.left+j.scrollParent[0].offsetWidth)-i.pageX<g.scrollSensitivity){j.scrollParent[0].scrollLeft=a=j.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(i.pageX-j.overflowOffset.left<g.scrollSensitivity){j.scrollParent[0].scrollLeft=a=j.scrollParent[0].scrollLeft-g.scrollSpeed}}}}else{if(!g.axis||g.axis!="x"){if(i.pageY-b(document).scrollTop()<g.scrollSensitivity){a=b(document).scrollTop(b(document).scrollTop()-g.scrollSpeed)}else{if(b(window).height()-(i.pageY-b(document).scrollTop())<g.scrollSensitivity){a=b(document).scrollTop(b(document).scrollTop()+g.scrollSpeed)}}}if(!g.axis||g.axis!="y"){if(i.pageX-b(document).scrollLeft()<g.scrollSensitivity){a=b(document).scrollLeft(b(document).scrollLeft()-g.scrollSpeed)}else{if(b(window).width()-(i.pageX-b(document).scrollLeft())<g.scrollSensitivity){a=b(document).scrollLeft(b(document).scrollLeft()+g.scrollSpeed)}}}}if(a!==false&&b.ui.ddmanager&&!g.dropBehaviour){b.ui.ddmanager.prepareOffsets(j,i)}}});b.ui.plugin.add("draggable","snap",{start:function(h,g){var a=b(this).data("draggable"),f=a.options;a.snapElements=[];b(f.snap.constructor!=String?(f.snap.items||":data(draggable)"):f.snap).each(function(){var c=b(this);var d=c.offset();if(this!=a.element[0]){a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:d.top,left:d.left})}})},drag:function(r,D){var J=b(this).data("draggable"),B=J.options;var d=B.snapTolerance;var i=D.offset.left,l=i+J.helperProportions.width,K=D.offset.top,L=K+J.helperProportions.height;for(var o=J.snapElements.length-1;o>=0;o--){var t=J.snapElements[o].left,E=t+J.snapElements[o].width,F=J.snapElements[o].top,C=F+J.snapElements[o].height;if(!((t-d<i&&i<E+d&&F-d<K&&K<C+d)||(t-d<i&&i<E+d&&F-d<L&&L<C+d)||(t-d<l&&l<E+d&&F-d<K&&K<C+d)||(t-d<l&&l<E+d&&F-d<L&&L<C+d))){if(J.snapElements[o].snapping){(J.options.snap.release&&J.options.snap.release.call(J.element,r,b.extend(J._uiHash(),{snapItem:J.snapElements[o].item})))}J.snapElements[o].snapping=false;continue}if(B.snapMode!="inner"){var M=Math.abs(F-L)<=d;var a=Math.abs(C-K)<=d;var H=Math.abs(t-l)<=d;var G=Math.abs(E-i)<=d;if(M){D.position.top=J._convertPositionTo("relative",{top:F-J.helperProportions.height,left:0}).top-J.margins.top}if(a){D.position.top=J._convertPositionTo("relative",{top:C,left:0}).top-J.margins.top}if(H){D.position.left=J._convertPositionTo("relative",{top:0,left:t-J.helperProportions.width}).left-J.margins.left}if(G){D.position.left=J._convertPositionTo("relative",{top:0,left:E}).left-J.margins.left}}var I=(M||a||H||G);if(B.snapMode!="outer"){var M=Math.abs(F-K)<=d;var a=Math.abs(C-L)<=d;var H=Math.abs(t-i)<=d;var G=Math.abs(E-l)<=d;if(M){D.position.top=J._convertPositionTo("relative",{top:F,left:0}).top-J.margins.top}if(a){D.position.top=J._convertPositionTo("relative",{top:C-J.helperProportions.height,left:0}).top-J.margins.top}if(H){D.position.left=J._convertPositionTo("relative",{top:0,left:t}).left-J.margins.left}if(G){D.position.left=J._convertPositionTo("relative",{top:0,left:E-J.helperProportions.width}).left-J.margins.left}}if(!J.snapElements[o].snapping&&(M||a||H||G||I)){(J.options.snap.snap&&J.options.snap.snap.call(J.element,r,b.extend(J._uiHash(),{snapItem:J.snapElements[o].item})))}J.snapElements[o].snapping=(M||a||H||G||I)}}});b.ui.plugin.add("draggable","stack",{start:function(a,h){var f=b(this).data("draggable").options;var g=b.makeArray(b(f.stack.group)).sort(function(c,d){return(parseInt(b(c).css("zIndex"),10)||f.stack.min)-(parseInt(b(d).css("zIndex"),10)||f.stack.min)});b(g).each(function(c){this.style.zIndex=f.stack.min+c});this[0].style.zIndex=f.stack.min+g.length}});b.ui.plugin.add("draggable","zIndex",{start:function(h,g){var a=b(g.helper),f=b(this).data("draggable").options;if(a.css("zIndex")){f._zIndex=a.css("zIndex")}a.css("zIndex",f.zIndex)},stop:function(a,f){var e=b(this).data("draggable").options;if(e._zIndex){b(f.helper).css("zIndex",e._zIndex)}}})})(jQuery);(function(b){b.widget("ui.droppable",{_init:function(){var d=this.options,a=d.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&b.isFunction(this.options.accept)?this.options.accept:function(c){return c.is(a)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};b.ui.ddmanager.droppables[this.options.scope]=b.ui.ddmanager.droppables[this.options.scope]||[];b.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var a=b.ui.ddmanager.droppables[this.options.scope];for(var d=0;d<a.length;d++){if(a[d]==this){a.splice(d,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(a,d){if(a=="accept"){this.options.accept=d&&b.isFunction(d)?d:function(c){return c.is(d)}}else{b.widget.prototype._setData.apply(this,arguments)}},_activate:function(d){var a=b.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(a&&this._trigger("activate",d,this.ui(a)))},_deactivate:function(d){var a=b.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(a&&this._trigger("deactivate",d,this.ui(a)))},_over:function(d){var a=b.ui.ddmanager.current;if(!a||(a.currentItem||a.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(a.currentItem||a.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",d,this.ui(a))}},_out:function(d){var a=b.ui.ddmanager.current;if(!a||(a.currentItem||a.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(a.currentItem||a.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",d,this.ui(a))}},_drop:function(h,g){var a=g||b.ui.ddmanager.current;if(!a||(a.currentItem||a.element)[0]==this.element[0]){return false}var f=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var c=b.data(this,"droppable");if(c.options.greedy&&b.ui.intersect(a,b.extend(c,{offset:c.element.offset()}),c.options.tolerance)){f=true;return false}});if(f){return false}if(this.options.accept.call(this.element[0],(a.currentItem||a.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",h,this.ui(a));return this.element}return false},ui:function(a){return{draggable:(a.currentItem||a.element),helper:a.helper,position:a.position,absolutePosition:a.positionAbs,offset:a.positionAbs}}});b.extend(b.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});b.ui.intersect=function(a,v,r){if(!v.offset){return false}var A=(a.positionAbs||a.position.absolute).left,B=A+a.helperProportions.width,s=(a.positionAbs||a.position.absolute).top,t=s+a.helperProportions.height;var y=v.offset.left,C=y+v.proportions.width,l=v.offset.top,u=l+v.proportions.height;switch(r){case"fit":return(y<A&&B<C&&l<s&&t<u);break;case"intersect":return(y<A+(a.helperProportions.width/2)&&B-(a.helperProportions.width/2)<C&&l<s+(a.helperProportions.height/2)&&t-(a.helperProportions.height/2)<u);break;case"pointer":var x=((a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left),w=((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top),z=b.ui.isOver(w,x,l,y,v.proportions.height,v.proportions.width);return z;break;case"touch":return((s>=l&&s<=u)||(t>=l&&t<=u)||(s<l&&t>u))&&((A>=y&&A<=C)||(B>=y&&B<=C)||(A<y&&B>C));break;default:return false;break}};b.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(l,j){var a=b.ui.ddmanager.droppables[l.options.scope];var k=j?j.type:null;var i=(l.currentItem||l.element).find(":data(droppable)").andSelf();droppablesLoop:for(var m=0;m<a.length;m++){if(a[m].options.disabled||(l&&!a[m].options.accept.call(a[m].element[0],(l.currentItem||l.element)))){continue}for(var n=0;n<i.length;n++){if(i[n]==a[m].element[0]){a[m].proportions.height=0;continue droppablesLoop}}a[m].visible=a[m].element.css("display")!="none";if(!a[m].visible){continue}a[m].offset=a[m].element.offset();a[m].proportions={width:a[m].element[0].offsetWidth,height:a[m].element[0].offsetHeight};if(k=="mousedown"){a[m]._activate.call(a[m],j)}}},drop:function(a,f){var e=false;b.each(b.ui.ddmanager.droppables[a.options.scope],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&b.ui.intersect(a,this,this.options.tolerance)){e=this._drop.call(this,f)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(a.currentItem||a.element))){this.isout=1;this.isover=0;this._deactivate.call(this,f)}});return e},drag:function(a,d){if(a.options.refreshPositions){b.ui.ddmanager.prepareOffsets(a,d)}b.each(b.ui.ddmanager.droppables[a.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var i=b.ui.intersect(a,this,this.options.tolerance);var c=!i&&this.isover==1?"isout":(i&&this.isover==0?"isover":null);if(!c){return}var h;if(this.options.greedy){var j=this.element.parents(":data(droppable):eq(0)");if(j.length){h=b.data(j[0],"droppable");h.greedyChild=(c=="isover"?1:0)}}if(h&&c=="isover"){h.isover=0;h.isout=1;h._out.call(h,d)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,d);if(h&&c=="isout"){h.isout=0;h.isover=1;h._over.call(h,d)}})}}})(jQuery);(function(b){b.widget("ui.sortable",b.extend({},b.ui.mouse,{_init:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--){this.items[a].item.removeData("sortable-item")}},_mouseCapture:function(j,i){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(j);var k=null,l=this,a=b(j.target).parents().each(function(){if(b.data(this,"sortable-item")==l){k=b(this);return false}});if(b.data(j.target,"sortable-item")==l){k=b(j.target)}if(!k){return false}if(this.options.handle&&!i){var h=false;b(this.options.handle,k).find("*").andSelf().each(function(){if(this==j.target){h=true}});if(!h){return false}}this.currentItem=k;this._removeCurrentsFromItems();return true},_mouseStart:function(j,i,a){var h=this.options,l=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(j);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");b.extend(this.offset,{click:{left:j.pageX-this.offset.left,top:j.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(j);this.originalPageX=j.pageX;this.originalPageY=j.pageY;if(h.cursorAt){this._adjustOffsetFromHelper(h.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(h.containment){this._setContainment()}if(h.cursor){if(b("body").css("cursor")){this._storedCursor=b("body").css("cursor")}b("body").css("cursor",h.cursor)}if(h.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",h.opacity)}if(h.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",h.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",j,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!a){for(var k=this.containers.length-1;k>=0;k--){this.containers[k]._trigger("activate",j,l._uiHash(this))}}if(b.ui.ddmanager){b.ui.ddmanager.current=this}if(b.ui.ddmanager&&!h.dropBehaviour){b.ui.ddmanager.prepareOffsets(this,j)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(j);return true},_mouseDrag:function(k){this.position=this._generatePosition(k);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var j=this.options,a=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-k.pageY<j.scrollSensitivity){this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+j.scrollSpeed}else{if(k.pageY-this.overflowOffset.top<j.scrollSensitivity){this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-j.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-k.pageX<j.scrollSensitivity){this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+j.scrollSpeed}else{if(k.pageX-this.overflowOffset.left<j.scrollSensitivity){this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-j.scrollSpeed}}}else{if(k.pageY-b(document).scrollTop()<j.scrollSensitivity){a=b(document).scrollTop(b(document).scrollTop()-j.scrollSpeed)}else{if(b(window).height()-(k.pageY-b(document).scrollTop())<j.scrollSensitivity){a=b(document).scrollTop(b(document).scrollTop()+j.scrollSpeed)}}if(k.pageX-b(document).scrollLeft()<j.scrollSensitivity){a=b(document).scrollLeft(b(document).scrollLeft()-j.scrollSpeed)}else{if(b(window).width()-(k.pageX-b(document).scrollLeft())<j.scrollSensitivity){a=b(document).scrollLeft(b(document).scrollLeft()+j.scrollSpeed)}}}if(a!==false&&b.ui.ddmanager&&!j.dropBehaviour){b.ui.ddmanager.prepareOffsets(this,k)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var m=this.items.length-1;m>=0;m--){var l=this.items[m],n=l.item[0],i=this._intersectsWithPointer(l);if(!i){continue}if(n!=this.currentItem[0]&&this.placeholder[i==1?"next":"prev"]()[0]!=n&&!b.ui.contains(this.placeholder[0],n)&&(this.options.type=="semi-dynamic"?!b.ui.contains(this.element[0],n):true)){this.direction=i==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(l)){this._rearrange(k,l)}else{break}this._trigger("change",k,this._uiHash());break}}this._contactContainers(k);if(b.ui.ddmanager){b.ui.ddmanager.drag(this,k)}this._trigger("sort",k,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(h,g){if(!h){return}if(b.ui.ddmanager&&!this.options.dropBehaviour){b.ui.ddmanager.drop(this,h)}if(this.options.revert){var a=this;var f=a.placeholder.offset();a.reverting=true;b(this.helper).animate({left:f.left-this.offset.parent.left-a.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:f.top-this.offset.parent.top-a.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){a._clear(h)})}else{this._clear(h,g)}return false},cancel:function(){var a=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("deactivate",null,a._uiHash(this));if(this.containers[d].containerCache.over){this.containers[d]._trigger("out",null,a._uiHash(this));this.containers[d].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}b.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){b(this.domPosition.prev).after(this.currentItem)}else{b(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(e){var a=this._getItemsAsjQuery(e&&e.connected);var f=[];e=e||{};b(a).each(function(){var c=(b(e.item||this).attr(e.attribute||"id")||"").match(e.expression||(/(.+)[-=_](.+)/));if(c){f.push((e.key||c[1]+"[]")+"="+(e.key&&e.expression?c[1]:c[2]))}});return f.join("&")},toArray:function(e){var a=this._getItemsAsjQuery(e&&e.connected);var f=[];e=e||{};a.each(function(){f.push(b(e.item||this).attr(e.attribute||"id")||"")});return f},_intersectsWith:function(p){var w=this.positionAbs.left,x=w+this.helperProportions.width,q=this.positionAbs.top,r=q+this.helperProportions.height;var v=p.left,y=v+p.width,l=p.top,s=l+p.height;var a=this.offset.click.top,t=this.offset.click.left;var u=(q+a)>l&&(q+a)<s&&(w+t)>v&&(w+t)<y;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>p[this.floating?"width":"height"])){return u}else{return(v<w+(this.helperProportions.width/2)&&x-(this.helperProportions.width/2)<y&&l<q+(this.helperProportions.height/2)&&r-(this.helperProportions.height/2)<s)}},_intersectsWithPointer:function(k){var j=b.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,k.top,k.height),l=b.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,k.left,k.width),h=j&&l,a=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();if(!h){return false}return this.floating?(((i&&i=="right")||a=="down")?2:1):(a&&(a=="down"?2:1))},_intersectsWithSides:function(h){var j=b.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,h.top+(h.height/2),h.height),i=b.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,h.left+(h.width/2),h.width),a=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(this.floating&&g){return((g=="right"&&i)||(g=="left"&&!i))}else{return a&&((a=="down"&&j)||(a=="up"&&!j))}},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions()},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(r){var a=this;var m=[];var o=[];var j=this._connectWith();if(j&&r){for(var p=j.length-1;p>=0;p--){var i=b(j[p]);for(var q=i.length-1;q>=0;q--){var n=b.data(i[q],"sortable");if(n&&n!=this&&!n.options.disabled){o.push([b.isFunction(n.options.items)?n.options.items.call(n.element):b(n.options.items,n.element).not(".ui-sortable-helper"),n])}}}}o.push([b.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):b(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var p=o.length-1;p>=0;p--){o[p][0].each(function(){m.push(this)})}return b(m)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data(sortable-item)");for(var f=0;f<this.items.length;f++){for(var a=0;a<e.length;a++){if(e[a]==this.items[f].item[0]){this.items.splice(f,1)}}}},_refreshItems:function(z){this.items=[];this.containers=[this];var t=this.items;var a=this;var v=[[b.isFunction(this.options.items)?this.options.items.call(this.element[0],z,{item:this.currentItem}):b(this.options.items,this.element),this]];var r=this._connectWith();if(r){for(var w=r.length-1;w>=0;w--){var q=b(r[w]);for(var x=q.length-1;x>=0;x--){var u=b.data(q[x],"sortable");if(u&&u!=this&&!u.options.disabled){v.push([b.isFunction(u.options.items)?u.options.items.call(u.element[0],z,{item:this.currentItem}):b(u.options.items,u.element),u]);this.containers.push(u)}}}}for(var w=v.length-1;w>=0;w--){var s=v[w][1];var y=v[w][0];for(var x=0,j=y.length;x<j;x++){var i=b(y[x]);i.data("sortable-item",s);t.push({item:i,instance:s,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var i=this.items.length-1;i>=0;i--){var h=this.items[i];if(h.instance!=this.currentContainer&&this.currentContainer&&h.item[0]!=this.currentItem[0]){continue}var j=this.options.toleranceElement?b(this.options.toleranceElement,h.item):h.item;if(!a){h.width=j.outerWidth();h.height=j.outerHeight()}var g=j.offset();h.left=g.left;h.top=g.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var i=this.containers.length-1;i>=0;i--){var g=this.containers[i].element.offset();this.containers[i].containerCache.left=g.left;this.containers[i].containerCache.top=g.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight()}}},_createPlaceholder:function(g){var a=g||this,f=a.options;if(!f.placeholder||f.placeholder.constructor==String){var h=f.placeholder;f.placeholder={element:function(){var c=b(document.createElement(a.currentItem[0].nodeName)).addClass(h||a.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!h){c.style.visibility="hidden"}return c},update:function(d,c){if(h&&!f.forcePlaceholderSize){return}if(!c.height()){c.height(a.currentItem.innerHeight()-parseInt(a.currentItem.css("paddingTop")||0,10)-parseInt(a.currentItem.css("paddingBottom")||0,10))}if(!c.width()){c.width(a.currentItem.innerWidth()-parseInt(a.currentItem.css("paddingLeft")||0,10)-parseInt(a.currentItem.css("paddingRight")||0,10))}}}}a.placeholder=b(f.placeholder.element.call(a.element,a.currentItem));a.currentItem.after(a.placeholder);f.placeholder.update(a,a.placeholder)},_contactContainers:function(m){for(var n=this.containers.length-1;n>=0;n--){if(this._intersectsWith(this.containers[n].containerCache)){if(!this.containers[n].containerCache.over){if(this.currentContainer!=this.containers[n]){var i=10000;var j=null;var l=this.positionAbs[this.containers[n].floating?"left":"top"];for(var a=this.items.length-1;a>=0;a--){if(!b.ui.contains(this.containers[n].element[0],this.items[a].item[0])){continue}var k=this.items[a][this.containers[n].floating?"left":"top"];if(Math.abs(k-l)<i){i=Math.abs(k-l);j=this.items[a]}}if(!j&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[n];j?this._rearrange(m,j,null,true):this._rearrange(m,null,this.containers[n].element,true);this._trigger("change",m,this._uiHash());this.containers[n]._trigger("change",m,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[n]._trigger("over",m,this._uiHash(this));this.containers[n].containerCache.over=1}}else{if(this.containers[n].containerCache.over){this.containers[n]._trigger("out",m,this._uiHash(this));this.containers[n].containerCache.over=0}}}},_createHelper:function(f){var e=this.options;var a=b.isFunction(e.helper)?b(e.helper.apply(this.element[0],[f,this.currentItem])):(e.helper=="clone"?this.currentItem.clone():this.currentItem);if(!a.parents("body").length){b(e.appendTo!="parent"?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0])}if(a[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(a[0].style.width==""||e.forceHelperSize){a.width(this.currentItem.width())}if(a[0].style.height==""||e.forceHelperSize){a.height(this.currentItem.height())}return a},_adjustOffsetFromHelper:function(a){if(a.left!=undefined){this.offset.click.left=a.left+this.margins.left}if(a.right!=undefined){this.offset.click.left=this.helperProportions.width-a.right+this.margins.left}if(a.top!=undefined){this.offset.click.top=a.top+this.margins.top}if(a.bottom!=undefined){this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)){a={top:0,left:0}}return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var f=this.options;if(f.containment=="parent"){f.containment=this.helper[0].parentNode}if(f.containment=="document"||f.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,b(f.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b(f.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(f.containment)){var h=b(f.containment)[0];var g=b(f.containment).offset();var a=(b(h).css("overflow")!="hidden");this.containment=[g.left+(parseInt(b(h).css("borderLeftWidth"),10)||0)+(parseInt(b(h).css("paddingLeft"),10)||0)-this.margins.left,g.top+(parseInt(b(h).css("borderTopWidth"),10)||0)+(parseInt(b(h).css("paddingTop"),10)||0)-this.margins.top,g.left+(a?Math.max(h.scrollWidth,h.offsetWidth):h.offsetWidth)-(parseInt(b(h).css("borderLeftWidth"),10)||0)-(parseInt(b(h).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,g.top+(a?Math.max(h.scrollHeight,h.offsetHeight):h.offsetHeight)-(parseInt(b(h).css("borderTopWidth"),10)||0)-(parseInt(b(h).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(j,d){if(!d){d=this.position}var l=j=="absolute"?1:-1;var k=this.options,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(a[0].tagName);return{top:(d.top+this.offset.relative.top*l+this.offset.parent.top*l-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:a.scrollTop()))*l)),left:(d.left+this.offset.relative.left*l+this.offset.parent.left*l-(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:a.scrollLeft())*l))}},_generatePosition:function(n){var k=this.options,a=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,j=(/(html|body)/i).test(a[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var o=n.pageX;var p=n.pageY;if(this.originalPosition){if(this.containment){if(n.pageX-this.offset.click.left<this.containment[0]){o=this.containment[0]+this.offset.click.left}if(n.pageY-this.offset.click.top<this.containment[1]){p=this.containment[1]+this.offset.click.top}if(n.pageX-this.offset.click.left>this.containment[2]){o=this.containment[2]+this.offset.click.left}if(n.pageY-this.offset.click.top>this.containment[3]){p=this.containment[3]+this.offset.click.top}}if(k.grid){var l=this.originalPageY+Math.round((p-this.originalPageY)/k.grid[1])*k.grid[1];p=this.containment?(!(l-this.offset.click.top<this.containment[1]||l-this.offset.click.top>this.containment[3])?l:(!(l-this.offset.click.top<this.containment[1])?l-k.grid[1]:l+k.grid[1])):l;var m=this.originalPageX+Math.round((o-this.originalPageX)/k.grid[0])*k.grid[0];o=this.containment?(!(m-this.offset.click.left<this.containment[0]||m-this.offset.click.left>this.containment[2])?m:(!(m-this.offset.click.left<this.containment[0])?m-k.grid[0]:m+k.grid[0])):m}}return{top:(p-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(j?0:a.scrollTop())))),left:(o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(b.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():j?0:a.scrollLeft())))}},_rearrange:function(h,i,l,j){l?l[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var k=this,a=this.counter;window.setTimeout(function(){if(a==k.counter){k.refreshPositions(!j)}},0)},_clear:function(i,h){this.reverting=false;var g=[],a=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var j in this._storedCSS){if(this._storedCSS[j]=="auto"||this._storedCSS[j]=="static"){this._storedCSS[j]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!h){g.push(function(c){this._trigger("receive",c,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!h){g.push(function(c){this._trigger("update",c,this._uiHash())})}if(!b.ui.contains(this.element[0],this.currentItem[0])){if(!h){g.push(function(c){this._trigger("remove",c,this._uiHash())})}for(var j=this.containers.length-1;j>=0;j--){if(b.ui.contains(this.containers[j].element[0],this.currentItem[0])&&!h){g.push((function(c){return function(d){c._trigger("receive",d,this._uiHash(this))}}).call(this,this.containers[j]));g.push((function(c){return function(d){c._trigger("update",d,this._uiHash(this))}}).call(this,this.containers[j]))}}}for(var j=this.containers.length-1;j>=0;j--){if(!h){g.push((function(c){return function(d){c._trigger("deactivate",d,this._uiHash(this))}}).call(this,this.containers[j]))}if(this.containers[j].containerCache.over){g.push((function(c){return function(d){c._trigger("out",d,this._uiHash(this))}}).call(this,this.containers[j]));this.containers[j].containerCache.over=0}}if(this._storedCursor){b("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!h){this._trigger("beforeStop",i,this._uiHash());for(var j=0;j<g.length;j++){g[j].call(this,i)}this._trigger("stop",i,this._uiHash())}return false}if(!h){this._trigger("beforeStop",i,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!h){for(var j=0;j<g.length;j++){g[j].call(this,i)}this._trigger("stop",i,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(b.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(d){var a=d||this;return{helper:a.helper,placeholder:a.placeholder||b([]),position:a.position,absolutePosition:a.positionAbs,offset:a.positionAbs,item:a.currentItem,sender:d?d.element:null}}}));b.extend(b.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationdefaultitemsdevjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-default-items.dev.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-default-items.dev.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-default-items.dev.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1,147 @@
</span><ins>+/**
+ * WordPress Administration Custom Navigation
+ * Interface JQuery functions
+ *
+ * @author Jeffikus <pearce.jp@gmail.com>
+ * @version 1.1.0
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/*
+ * Init Functions
+*/
+$(function()
+        {
+                //Makes dialog box
+                $("#dialog-confirm").dialog({
+                        autoOpen: false,
+                        resizable: false,
+                        height: 210,
+                        width: 400,
+                        modal: true,
+                        buttons: {
+                                'Save': function() {
+                                        
+                                        titletosave = $('#edittitle').attr('value');
+                                        linktosave = $('#editlink').attr('value');
+                                        anchortitletosave = $('#editanchortitle').attr('value');
+                                        newwindowtosave = $('#editnewwindow').attr('value');
+                                        desctosave = $('#editdescription').attr('value');
+                                        
+                                        $('#title' + $(this).dialog('option', 'itemID')).attr('value',titletosave);
+                                        $('#linkurl' + $(this).dialog('option', 'itemID')).attr('value',linktosave);
+                                        $('#anchortitle' + $(this).dialog('option', 'itemID')).attr('value',anchortitletosave);
+                                        $('#newwindow' + $(this).dialog('option', 'itemID')).attr('value',newwindowtosave);
+                                        $('#description' + $(this).dialog('option', 'itemID')).attr('value',desctosave);
+                                        
+                                        $('#menu-' + $(this).dialog('option', 'itemID') + ' > dl > dt > span.title').text(titletosave);
+                                        
+                                        $('#view' + + $(this).dialog('option', 'itemID')).attr('href', linktosave);
+                                        
+                                        $(this).dialog('close');
+                                        
+                                },
+                                Cancel: function() {
+                                        $(this).dialog('close');
+                                }
+                        }
+                });
+                
+                $('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ $(this).remove();});
+                
+                //Add dropzone
+         $('#custom-nav li').prepend('<div class="dropzone"></div>');        
+                
+                //Make li items draggable
+                $('#custom-nav li').draggable({
+                         handle: ' > dl',
+                         opacity: .8,
+                         addClasses: false,
+                         helper: 'clone',
+                         zIndex: 100
+                });
+
+                //Make items droppable
+                $('#custom-nav dl, #custom-nav .dropzone').droppable(
+                {
+                 accept: '#custom-nav li',
+                 tolerance: 'pointer',
+                 drop: function(e, ui)
+                 {
+                 var li = $(this).parent();
+                 var child = !$(this).hasClass('dropzone');
+                 //Add UL to first child
+                 if (child && li.children('ul').length == 0)
+                 {
+                 li.append('<ul id="sub-menu" />');
+                 }
+                 //Make it draggable
+                 if (child)
+                 {
+                 li.children('ul').append(ui.draggable);
+                 }
+                 else
+                 {
+                 li.before(ui.draggable);
+                 }
+
+                 li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
+                 
+                 var draggablevalue = ui.draggable.attr('value');
+                 var droppablevalue = li.attr('value');
+                 li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
+                 $(this).parent().find("dt").removeAttr('style');
+                 $(this).parent().find("div:first").removeAttr('style');
+                 
+                 
+                 },
+                 over: function()
+                 {
+                         //Add child
+                         if ($(this).attr('class') == 'dropzone ui-droppable')
+                         {
+                                 $(this).parent().find("div:first").css('background', 'none').css('height', '50px');
+                         }
+                         //Add above
+                         else if ($(this).attr('class') == 'ui-droppable')
+                         {
+                                 $(this).parent().find("dt:first").css('background', '#d8d8d8');
+                         }
+                         //do nothing
+                         else {
+                         
+                         }
+                         var parentid = $(this).parent().attr('id');
+                
+                 },
+                 out: function()
+                 {
+                 $(this).parent().find("dt").removeAttr('style');
+                 $(this).parent().find("div:first").removeAttr('style');
+                 $(this).filter('.dropzone').css({ borderColor: '' });
+                 },
+                 deactivate: function()
+                 {        
+                         
+                                        
+                 }
+                 
+                         
+                });
+                                
+                //Handle Save Button Clicks        
+                $('#save_top').click(function()
+                {
+                        updatepostdata();
+                });
+                $('#save_bottom').click(function()
+                {
+                        updatepostdata();
+                });
+                
+
+        });
+
+
</ins></span></pre></div>
<a id="trunkwpadminjscustomnavigationdefaultitemsjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-default-items.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-default-items.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-default-items.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+$(function(){$("#dialog-confirm").dialog({autoOpen:false,resizable:false,height:210,width:400,modal:true,buttons:{Save:function(){titletosave=$("#edittitle").attr("value");linktosave=$("#editlink").attr("value");anchortitletosave=$("#editanchortitle").attr("value");newwindowtosave=$("#editnewwindow").attr("value");desctosave=$("#editdescription").attr("value");$("#title"+$(this).dialog("option","itemID")).attr("value",titletosave);$("#linkurl"+$(this).dialog("option","itemID")).attr("value",linktosave);$("#anchortitle"+$(this).dialog("option","itemID")).attr("value",anchortitletosave);$("#newwindow"+$(this).dialog("option","itemID")).attr("value",newwindowtosave);$("#description"+$(this).dialog("option","itemID")).attr("value",desctosave);$("#menu-"+$(this).dialog("option","itemID")+" > dl > dt > span.title").text(titletosave);$("#view"+ +$(this).dialog("option","itemID")).attr("href",linktosave);$(this).dialog("close")},Cancel:function(){$(this).dialog("close")}}});$("#message").animate({opacity:1},2000).fadeOut(300,function(){$(this).remove()});$("#custom-nav li").prepend('<div class="dropzone"></div>');$("#custom-nav li").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});$("#custom-nav dl, #custom-nav .dropzone").droppable({accept:"#custom-nav li",tolerance:"pointer",drop:function(f,d){var a=$(this).parent();var g=!$(this).hasClass("dropzone");if(g&&a.children("ul").length==0){a.append('<ul id="sub-menu" />')}if(g){a.children("ul").append(d.draggable)}else{a.before(d.draggable)}a.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var c=d.draggable.attr("value");var b=a.attr("value");a.find("#menu-"+c).find("#parent"+c).val(b);$(this).parent().find("dt").removeAttr("style");$(this).parent().find("div:first").removeAttr("style")},over:function(){if($(this).attr("class")=="dropzone ui-droppable"){$(this).parent().find("div:first").css("background","none").css("height","50px")}else{if($(this).attr("class")=="ui-droppable"){$(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}var a=$(this).parent().attr("id")},out:function(){$(this).parent().find("dt").removeAttr("style");$(this).parent().find("div:first").removeAttr("style");$(this).filter(".dropzone").css({borderColor:""})},deactivate:function(){}});$("#save_top").click(function(){updatepostdata()});$("#save_bottom").click(function(){updatepostdata()})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationdynamicfunctionsdevjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1,289 @@
</span><ins>+/**
+ * WordPress Administration Custom Navigation
+ * Interface JS functions
+ *
+ * @author Jeffikus <pearce.jp@gmail.com>
+ * @version 1.1.0
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/*
+ * Removes menu items from current menu
+ * @param int o - the id of the menu li to remove.
+*/
+function removeitem(o)
+{
+                         
+        var todelete = document.getElementById('menu-' + o);
+        
+        if (todelete)
+        {                
+                var parenttodelete = document.getElementById('menu-' + o).parentNode;
+ throwaway_node = parenttodelete.removeChild(todelete);
+        }        
+                        
+        updatepostdata();
+};
+
+/*
+ * Loads dialog window to edit menu items from current menu
+ * @param int o - the id of the menu li to edit.
+*/
+function edititem(o)
+{
+                         
+                itemTitle = $('#title' + o).attr('value');
+                itemURL = $('#linkurl' + o).attr('value');
+                itemAnchorTitle = $('#anchortitle' + o).attr('value');
+                itemNewWindow = $('#newwindow' + o).attr('value');
+                itemDesc = $('#description' + o).attr('value');
+                
+                $('#dialog-confirm').dialog( 'option' , 'itemID' , o )
+                                
+                $('#dialog-confirm').dialog('open');
+                
+                $('#edittitle').attr('value', itemTitle);
+                $('#editlink').attr('value', itemURL);
+                $('#editanchortitle').attr('value', itemAnchorTitle);
+                $("#editnewwindow option[value='" + itemNewWindow + "']").attr('selected', 'selected');
+                $('#editdescription').attr('value', itemDesc);
+        
+};
+
+/*
+ * Prepares menu items for POST
+*/
+function updatepostdata()
+{                 
+        
+        var i = 0;
+         $("#custom-nav").find("li").each(function(i) {
+                i = i + 1;
+         var j = $(this).attr('value');
+                
+         $(this).find('#position' + j).attr('value', i);
+         $(this).attr('id','menu-' + i);
+         $(this).attr('value', i);
+         
+         $(this).find('#dbid' + j).attr('name','dbid' + i);
+         $(this).find('#dbid' + j).attr('id','dbid' + i);
+         
+                $(this).find('#postmenu' + j).attr('name','postmenu' + i);
+         $(this).find('#postmenu' + j).attr('id','postmenu' + i);
+         
+         var p = $(this).find('#parent' + j).parent().parent().parent().attr('value');
+         
+         $(this).find('#parent' + j).attr('name','parent' + i);
+         $(this).find('#parent' + j).attr('id','parent' + i);
+         if (p) {
+                 //Do nothing
+         }
+         else {
+                 //reset p to be top level
+                 p = 0;
+         }
+                  
+         $(this).find('#parent' + j).attr('value', p);
+                  
+         $(this).find('#title' + j).attr('name','title' + i);
+         $(this).find('#title' + j).attr('id','title' + i);
+         
+         $(this).find('#linkurl' + j).attr('name','linkurl' + i);
+         $(this).find('#linkurl' + j).attr('id','linkurl' + i);
+                 
+         $(this).find('#description' + j).attr('name','description' + i);
+         $(this).find('#description' + j).attr('id','description' + i);
+         
+         $(this).find('#icon' + j).attr('name','icon' + i);
+         $(this).find('#icon' + j).attr('id','icon' + i);
+         
+         $(this).find('#position' + j).attr('name','position' + i);
+         $(this).find('#position' + j).attr('id','position' + i);
+         
+         $(this).find('#linktype' + j).attr('name','linktype' + i);
+         $(this).find('#linktype' + j).attr('id','linktype' + i);
+         
+         $(this).find('#anchortitle' + j).attr('name','anchortitle' + i);
+         $(this).find('#anchortitle' + j).attr('id','anchortitle' + i);
+         
+         $(this).find('#newwindow' + j).attr('name','newwindow' + i);
+         $(this).find('#newwindow' + j).attr('id','newwindow' + i);
+         
+         $(this).find('dl > dt > span > #remove' + j).attr('value', i);
+         $(this).find('dl > dt > span > #remove' + j).attr('onClick', 'removeitem(' + i + ')');
+         $(this).find('dl > dt > span > #remove' + j).attr('id','remove' + i);
+
+         $('#licount').attr('value',i);
+
+ });
+
+
+        
+};        
+
+/*
+ * Adds item from Page, Category, or Custom options menu
+ * @param string templatedir - directory of the add, edit, view images.
+ * @param string additemtype - Page, Category, or Custom.
+ * @param string itemtext - menu text.
+ * @param string itemurl - url of the menu.
+ * @param int itemid - menu id.
+ * @param int itemparentid - default 0.
+ * @param string itemdescription - the description of the menu item.
+*/
+function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription)
+{
+        var inputvaluevarname = '';
+        var inputvaluevarurl = '';
+        var inputitemid = '';
+        var inputparentid= '';
+        var inputdescription = '';
+        var inputicon = '';
+
+        if (additemtype == 'Custom')
+        {
+                inputvaluevarname = document.getElementById('custom_menu_item_name').value;
+                inputvaluevarurl = document.getElementById('custom_menu_item_url').value;
+                inputitemid = '';
+                inputparentid = '';
+                inputlinktype = 'custom';
+                inputdescription = document.getElementById('custom_menu_item_description').value;
+        }
+        else if (additemtype == 'Page')
+        {
+                inputvaluevarname = htmlentities(itemtext.toString());
+                inputvaluevarurl = itemurl.toString();
+                inputitemid = itemid.toString();
+                inputparentid = '0';
+                inputlinktype = 'page';
+                inputdescription = htmlentities(itemdescription.toString());
+                
+        }
+        else if (additemtype == 'Category')
+        {
+                inputvaluevarname = htmlentities(itemtext.toString());
+                inputvaluevarurl = itemurl.toString();
+                inputitemid = itemid.toString();
+                inputparentid = '0';
+                inputlinktype = 'category';
+                inputdescription = htmlentities(itemdescription.toString());
+        }
+        else
+        {
+                inputvaluevarname = '';
+                inputvaluevarname = '';
+                inputitemid = '';
+                inputparentid = '';
+                inputlinktype = 'custom';
+                inputdescription = '';
+        }
+        
+        var count=document.getElementById('custom-nav').getElementsByTagName('li').length;
+
+        var randomnumber = count;
+
+        var validatetest = 0;
+
+        try
+        {
+                var test=document.getElementById("menu-" + randomnumber.toString()).value;
+        }
+        catch (err)
+        {
+                validatetest = 1;
+        }
+
+        while (validatetest == 0)
+        {
+                randomnumber = randomnumber + 1;
+
+                try
+                {
+                        var test2=document.getElementById("menu-" + randomnumber.toString()).value;
+                }
+                catch (err)
+                {
+                        validatetest = 1;
+                }
+        }
+        
+        //Notification Message
+        $('.maintitle').after('<div id="message" class="updated fade below-h2"><p>Menu Item added!</p></div>');
+        $('#message').animate({ opacity: 1.0 },2000).fadeOut(300, function(){ $(this).remove();});
+        
+        //Appends HTML to the menu
+        $('#custom-nav').append('<li id="menu-' + randomnumber + '" value="' + randomnumber + '"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="title">' + inputvaluevarname + '</span><span class="controls"><span class="type">' + additemtype + '</span><a id="edit' + randomnumber + '" onclick="edititem(' + randomnumber + ')" value="' + randomnumber +'"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="' + templatedir + '/wp-admin/images/ico-edit.png" /></a> <a id="remove' + randomnumber + '" onclick="removeitem(' + randomnumber + ')" value="' + randomnumber +'"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="' + templatedir + '/wp-admin/images/ico-close.png" /></a> <a href="' + inputvaluevarurl + '" target="_blank"><img alt="View Custom Link" title="View Custom Link" src="' + templatedir + '/wp-admin/images/ico-viewpage.png" /></a></span></dt></dl><a class="hide" href="' + inputvaluevarurl + '">' + inputvaluevarname + '</a><input type="hidden" name="postmenu' + randomnumber + '" id="postmenu' + randomnumber + '" value="' + inputitemid + '" /><input type="hidden" name="parent' + randomnumber + '" id="parent' + randomnumber + '" value="' + inputparentid + '" /><input type="hidden" name="title' + randomnumber + '" id="title' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="linkurl' + randomnumber + '" id="linkurl' + randomnumber + '" value="' + inputvaluevarurl + '" /><input type="hidden" name="description' + randomnumber + '" id="description' + randomnumber + '" value="' + inputdescription + '" /><input type="hidden" name="icon' + randomnumber + '" id="icon' + randomnumber + '" value="' + inputicon + '" /><input type="hidden" name="position' + randomnumber + '" id="position' + randomnumber + '" value="' + randomnumber + '" /><input type="hidden" name="linktype' + randomnumber + '" id="linktype' + randomnumber + '" value="' + inputlinktype + '" /><input type="hidden" name="anchortitle' + randomnumber + '" id="anchortitle' + randomnumber + '" value="' + inputvaluevarname + '" /><input type="hidden" name="newwindow' + randomnumber + '" id="newwindow' + randomnumber + '" value="0" /></li>');
+
+        //make menu item draggable
+        $('#menu-' + randomnumber + '').draggable(
+        {
+                handle: ' > dl',
+                opacity: .8,
+                addClasses: false,
+                helper: 'clone',
+                zIndex: 100
+        });
+
+        //make menu item droppable
+        $('#menu-' + randomnumber + ' dl, #menu-' + randomnumber + ' .dropzone').droppable({
+                accept: '#' + randomnumber + ', #custom-nav li',
+                tolerance: 'pointer',
+                drop: function(e, ui)
+                {
+                        var li = $(this).parent();
+                        var child = !$(this).hasClass('dropzone');
+                        //Append UL to first child
+                        if (child && li.children('ul').length == 0)
+                        {
+                                li.append('<ul/>');
+                        }
+                        //Make it draggable
+                        if (child)
+                        {
+                                li.children('ul').append(ui.draggable);
+                        }
+                        else
+                        {
+                                li.before(ui.draggable);
+                        }
+                        
+                        li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });        
+                        
+                        var draggablevalue = ui.draggable.attr('value');
+                 var droppablevalue = li.attr('value');
+                 li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
+         $(this).parent().find("dt").removeAttr('style');
+         $(this).parent().find("div:first").removeAttr('style');
+        
+                },
+                over: function()
+                 {
+                         //Add child
+                         if ($(this).attr('class') == 'dropzone ui-droppable')
+                         {
+                                 $(this).parent().find("div:first").css('background', 'none').css('height', '50px');
+                         }
+                         //Add above
+                         else if ($(this).attr('class') == 'ui-droppable')
+                         {
+                                 $(this).parent().find("dt:first").css('background', '#d8d8d8');
+                         }
+                         //do nothing
+                         else {
+                         
+                         }
+                         var parentid = $(this).parent().attr('id');
+                
+                 },
+                 out: function()
+                 {
+                 $(this).parent().find("dt").removeAttr('style');
+                 $(this).parent().find("div:first").removeAttr('style');
+                 $(this).filter('.dropzone').css({ borderColor: '' });
+                 }
+        });
+
+        updatepostdata();
+};
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationdynamicfunctionsjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-dynamic-functions.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-dynamic-functions.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-dynamic-functions.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+function removeitem(c){var b=document.getElementById("menu-"+c);if(b){var a=document.getElementById("menu-"+c).parentNode;throwaway_node=a.removeChild(b)}updatepostdata()}function edititem(a){itemTitle=$("#title"+a).attr("value");itemURL=$("#linkurl"+a).attr("value");itemAnchorTitle=$("#anchortitle"+a).attr("value");itemNewWindow=$("#newwindow"+a).attr("value");itemDesc=$("#description"+a).attr("value");$("#dialog-confirm").dialog("option","itemID",a);$("#dialog-confirm").dialog("open");$("#edittitle").attr("value",itemTitle);$("#editlink").attr("value",itemURL);$("#editanchortitle").attr("value",itemAnchorTitle);$("#editnewwindow option[value='"+itemNewWindow+"']").attr("selected","selected");$("#editdescription").attr("value",itemDesc)}function updatepostdata(){var a=0;$("#custom-nav").find("li").each(function(c){c=c+1;var b=$(this).attr("value");$(this).find("#position"+b).attr("value",c);$(this).attr("id","menu-"+c);$(this).attr("value",c);$(this).find("#dbid"+b).attr("name","dbid"+c);$(this).find("#dbid"+b).attr("id","dbid"+c);$(this).find("#postmenu"+b).attr("name","postmenu"+c);$(this).find("#postmenu"+b).attr("id","postmenu"+c);var d=$(this).find("#parent"+b).parent().parent().parent().attr("value");$(this).find("#parent"+b).attr("name","parent"+c);$(this).find("#parent"+b).attr("id","parent"+c);if(d){}else{d=0}$(this).find("#parent"+b).attr("value",d);$(this).find("#title"+b).attr("name","title"+c);$(this).find("#title"+b).attr("id","title"+c);$(this).find("#linkurl"+b).attr("name","linkurl"+c);$(this).find("#linkurl"+b).attr("id","linkurl"+c);$(this).find("#description"+b).attr("name","description"+c);$(this).find("#description"+b).attr("id","description"+c);$(this).find("#icon"+b).attr("name","icon"+c);$(this).find("#icon"+b).attr("id","icon"+c);$(this).find("#position"+b).attr("name","position"+c);$(this).find("#position"+b).attr("id","position"+c);$(this).find("#linktype"+b).attr("name","linktype"+c);$(this).find("#linktype"+b).attr("id","linktype"+c);$(this).find("#anchortitle"+b).attr("name","anchortitle"+c);$(this).find("#anchortitle"+b).attr("id","anchortitle"+c);$(this).find("#newwindow"+b).attr("name","newwindow"+c);$(this).find("#newwindow"+b).attr("id","newwindow"+c);$(this).find("dl > dt > span > #remove"+b).attr("value",c);$(this).find("dl > dt > span > #remove"+b).attr("onClick","removeitem("+c+")");$(this).find("dl > dt > span > #remove"+b).attr("id","remove"+c);$("#licount").attr("value",c)})}function appendToList(b,s,d,n,h,l,e){var k="";var c="";var r="";var o="";var i="";var a="";if(s=="Custom"){k=document.getElementById("custom_menu_item_name").value;c=document.getElementById("custom_menu_item_url").value;r="";o="";inputlinktype="custom";i=document.getElementById("custom_menu_item_description").value}else{if(s=="Page"){k=htmlentities(d.toString());c=n.toString();r=h.toString();o="0";inputlinktype="page";i=htmlentities(e.toString())}else{if(s=="Category"){k=htmlentities(d.toString());c=n.toString();r=h.toString();o="0";inputlinktype="category";i=htmlentities(e.toString())}else{k="";k="";r="";o="";inputlinktype="custom";i=""}}}var g=document.getElementById("custom-nav").getElementsByTagName("li").length;var p=g;var m=0;try{var q=document.getElementById("menu-"+p.toString()).value}catch(f){m=1}while(m==0){p=p+1;try{var j=document.getElementById("menu-"+p.toString()).value}catch(f){m=1}}$(".maintitle").after('<div id="message" class="updated fade below-h2"><p>Menu Item added!</p></div>');$("#message").animate({opacity:1},2000).fadeOut(300,function(){$(this).remove()});$("#custom-nav").append('<li id="menu-'+p+'" value="'+p+'"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="title">'+k+'</span><span class="controls"><span class="type">'+s+'</span><a id="edit'+p+'" onclick="edititem('+p+')" value="'+p+'"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="'+b+'/wp-admin/images/ico-edit.png" /></a> <a id="remove'+p+'" onclick="removeitem('+p+')" value="'+p+'"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="'+b+'/wp-admin/images/ico-close.png" /></a> <a href="'+c+'" target="_blank"><img alt="View Custom Link" title="View Custom Link" src="'+b+'/wp-admin/images/ico-viewpage.png" /></a></span></dt></dl><a class="hide" href="'+c+'">'+k+'</a><input type="hidden" name="postmenu'+p+'" id="postmenu'+p+'" value="'+r+'" /><input type="hidden" name="parent'+p+'" id="parent'+p+'" value="'+o+'" /><input type="hidden" name="title'+p+'" id="title'+p+'" value="'+k+'" /><input type="hidden" name="linkurl'+p+'" id="linkurl'+p+'" value="'+c+'" /><input type="hidden" name="description'+p+'" id="description'+p+'" value="'+i+'" /><input type="hidden" name="icon'+p+'" id="icon'+p+'" value="'+a+'" /><input type="hidden" name="position'+p+'" id="position'+p+'" value="'+p+'" /><input type="hidden" name="linktype'+p+'" id="linktype'+p+'" value="'+inputlinktype+'" /><input type="hidden" name="anchortitle'+p+'" id="anchortitle'+p+'" value="'+k+'" /><input type="hidden" name="newwindow'+p+'" id="newwindow'+p+'" value="0" /></li>');$("#menu-"+p+"").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});$("#menu-"+p+" dl, #menu-"+p+" .dropzone").droppable({accept:"#"+p+", #custom-nav li",tolerance:"pointer",drop:function(x,w){var t=$(this).parent();var y=!$(this).hasClass("dropzone");if(y&&t.children("ul").length==0){t.append("<ul/>")}if(y){t.children("ul").append(w.draggable)}else{t.before(w.draggable)}t.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var v=w.draggable.attr("value");var u=t.attr("value");t.find("#menu-"+v).find("#parent"+v).val(u);$(this).parent().find("dt").removeAttr("style");$(this).parent().find("div:first").removeAttr("style")},over:function(){if($(this).attr("class")=="dropzone ui-droppable"){$(this).parent().find("div:first").css("background","none").css("height","50px")}else{if($(this).attr("class")=="ui-droppable"){$(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}var t=$(this).parent().attr("id")},out:function(){$(this).parent().find("dt").removeAttr("style");$(this).parent().find("div:first").removeAttr("style");$(this).filter(".dropzone").css({borderColor:""})}});updatepostdata()};
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationphpfunctionsdevjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-php-functions.dev.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-php-functions.dev.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-php-functions.dev.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1,300 @@
</span><ins>+/*
+ * More info at: http://phpjs.org
+ *
+ * This is version: 3.08
+ * php.js is copyright 2010 Kevin van Zonneveld.
+ *
+ * Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
+ * (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
+ * (http://getsprink.com), Waldo Malqui Silva, Paulo Ricardo F. Santos, Jack,
+ * Jonas Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Ates
+ * Goral (http://magnetiq.com), Legaev Andrey, Alex, Ratheous, Martijn
+ * Wieringa, Nate, lmeyrick (https://sourceforge.net/projects/bcmath-js/),
+ * Enrique Gonzalez, Philippe Baumann, Webtoolkit.info
+ * (http://www.webtoolkit.info/), travc, Carlos R. L. Rodrigues
+ * (http://www.jsfromhell.com), Jani Hartikainen, Ash Searle
+ * (http://hexmen.com/blog/), Ole Vrijenhoek, stag019, d3x, Erkekjetter,
+ * GeekFG (http://geekfg.blogspot.com), T.Wild, Johnny Mast
+ * (http://www.phpvrouwen.nl), Michael Grier,
+ * http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript,
+ * pilus, marrtins, Andrea Giammarchi (http://webreflection.blogspot.com),
+ * WebDevHobo (http://webdevhobo.blogspot.com/), Caio Ariede
+ * (http://caioariede.com), Thunder.m, Aman Gupta, Martin
+ * (http://www.erlenwiese.de/), Tyler Akins (http://rumkin.com), Lars Fischer,
+ * Paul Smith, Alfonso Jimenez (http://www.alfonsojimenez.com), Michael White,
+ * mdsjack (http://www.mdsjack.bo.it), Pellentesque Malesuada, gettimeofday,
+ * David, Joris, saulius, Robin, Steven Levithan
+ * (http://blog.stevenlevithan.com), Public Domain
+ * (http://www.json.org/json2.js), Kankrelune (http://www.webfaktory.info/),
+ * Tim de Koning (http://www.kingsquare.nl), Arpad Ray (mailto:arpad@php.net),
+ * AJ, KELAN, Sakimori, Mailfaker (http://www.weedem.fr/), Oleg Eremeev, Marc
+ * Palau, Josh Fraser
+ * (http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/),
+ * Karol Kowalski, Chris, Breaking Par Consulting Inc
+ * (http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7),
+ * Mirek Slugen, majak, Felix Geisendoerfer (http://www.debuggable.com/felix),
+ * gorthaur, Steve Hilder, LH, Stoyan Kyosev (http://www.svest.org/), Der
+ * Simon (http://innerdom.sourceforge.net/), HKM, echo is bad, nord_ua, Ozh,
+ * metjay, XoraX (http://www.xorax.info), Eugene Bulkin
+ * (http://doubleaw.com/), JB, strcasecmp, strcmp, Taras Bogach, Francesco,
+ * Marco, noname, class_exists, madipta, Alan C, mktime, Douglas Crockford
+ * (http://javascript.crockford.com), uestla, Frank Forte, David James, Steve
+ * Clay, J A R, jpfle, Marc Jansen, Paul, Hyam Singer
+ * (http://www.impact-computing.com/), T. Wild, Ole Vrijenhoek
+ * (http://www.nervous.nl/), Raphael (Ao RUDLER), kenneth, Brad Touesnard,
+ * ChaosNo1, Subhasis Deb, Norman "zEh" Fuchs, 0m3r, Sanjoy Roy, Rob, Gilbert,
+ * Bayron Guevara, paulo kuong, Orlando, duncan, sankai, hitwork, Philippe
+ * Jausions (http://pear.php.net/user/jausions), Aidan Lister
+ * (http://aidanlister.com/), ejsanders, Nick Callen, Brian Tafoya
+ * (http://www.premasolutions.com/), johnrembo, sowberry, Yves Sucaet, Denny
+ * Wardhana, Ulrich, kilops, dptr1988, john (http://www.jd-tech.net), MeEtc
+ * (http://yass.meetcweb.com), Peter-Paul Koch
+ * (http://www.quirksmode.org/js/beat.html), T0bsn, Tim Wiel, Bryan Elliott,
+ * Alexander Ermolaev (http://snippets.dzone.com/user/AlexanderErmolaev), JT,
+ * Thomas Beaucourt (http://www.webapp.fr), David Randall, DxGx, Soren Hansen,
+ * lmeyrick (https://sourceforge.net/projects/bcmath-js/this.), Le Torbi,
+ * djmix, Lincoln Ramsay, Linuxworld, Thiago Mata
+ * (http://thiagomata.blog.com), Pedro Tainha (http://www.pedrotainha.com),
+ * James, Pyerre, Jon Hohle, felix, ger, Russell Walker
+ * (http://www.nbill.co.uk/), Garagoth, Andrej Pavlovic, Dino, Jamie Beck
+ * (http://www.terabit.ca/), DtTvB
+ * (http://dt.in.th/2008-09-16.string-length-in-bytes.html), setcookie, YUI
+ * Library: http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html,
+ * Blues at http://hacks.bluesmoon.info/strftime/strftime.js, Andreas, rem,
+ * meo, Jay Klehr, Kheang Hok Chin (http://www.distantia.ca/), Luke Smith
+ * (http://lucassmith.name), Rival, Amir Habibi
+ * (http://www.residence-mixte.com/), Cagri Ekin, Greenseed, mk.keck, Leslie
+ * Hoare, booeyOH, Ben Bryan, Michael, Christian Doebler, Kirk Strobeck, Brant
+ * Messenger (http://www.brantmessenger.com/), Rick Waldron, Mick@el, Martin
+ * Pool, Pierre-Luc Paour, Daniel Esteban, Christoph, Saulo Vallory, Kristof
+ * Coomans (SCK-CEN Belgian Nucleair Research Centre), rezna, Tomasz
+ * Wesolowski, Gabriel Paderni, Marco van Oort, Philipp Lenssen,
+ * penutbutterjelly, Simon Willison (http://simonwillison.net), Anton Ongson,
+ * Eric Nagel, Bobby Drake, Pul, Blues (http://tech.bluesmoon.info/), Luke
+ * Godfrey, Diogo Resende, Howard Yeend, vlado houba, Jalal Berrami, Itsacon
+ * (http://www.itsacon.net/), date, Billy, stensi, Cord, fearphage
+ * (http://http/my.opera.com/fearphage/), Victor, Matteo, Artur Tchernychev,
+ * Francois, nobbler, Fox, marc andreu, Nick Kolosov (http://sammy.ru),
+ * Nathan, Arno, Scott Cariss, Slawomir Kaniecki, ReverseSyntax, Jason Wong
+ * (http://carrot.org/), Mateusz "loonquawl" Zalega, Manish, Wagner B. Soares,
+ * 3D-GRAF, jakes, Yannoo, gabriel paderni, daniel airton wermann
+ * (http://wermann.com.br), Atli ?\x97r, Allan Jensen
+ * (http://www.winternet.no), Benjamin Lupton, davook, Maximusya, FGFEmperor,
+ * baris ozdil, Luis Salazar (http://www.freaky-media.com/), Tim de Koning,
+ * taith, Matt Bradley, FremyCompany, T.J. Leahy, Greg Frazier, Valentina De
+ * Rosa, Tod Gentille, Riddler (http://www.frontierwebdev.com/), Alexander M
+ * Beedie
+ *
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES
+ * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+function get_html_translation_table (table, quote_style) {
+ // http://kevin.vanzonneveld.net
+ // + original by: Philip Peterson
+ // + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
+ // + bugfixed by: noname
+ // + bugfixed by: Alex
+ // + bugfixed by: Marco
+ // + bugfixed by: madipta
+ // + improved by: KELAN
+ // + improved by: Brett Zamir (http://brett-zamir.me)
+ // + bugfixed by: Brett Zamir (http://brett-zamir.me)
+ // + input by: Frank Forte
+ // + bugfixed by: T.Wild
+ // + input by: Ratheous
+ // % note: It has been decided that we're not going to add global
+ // % note: dependencies to php.js, meaning the constants are not
+ // % note: real constants, but strings instead. Integers are also supported if someone
+ // % note: chooses to create the constants themselves.
+ // * example 1: get_html_translation_table('HTML_SPECIALCHARS');
+ // * returns 1: {'"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;'}
+
+ var entities = {}, hash_map = {}, decimal = 0, symbol = '';
+ var constMappingTable = {}, constMappingQuoteStyle = {};
+ var useTable = {}, useQuoteStyle = {};
+
+ // Translate arguments
+ constMappingTable[0] = 'HTML_SPECIALCHARS';
+ constMappingTable[1] = 'HTML_ENTITIES';
+ constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
+ constMappingQuoteStyle[2] = 'ENT_COMPAT';
+ constMappingQuoteStyle[3] = 'ENT_QUOTES';
+
+ useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
+ useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT';
+
+ if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
+ throw new Error("Table: "+useTable+' not supported');
+ // return false;
+ }
+
+ entities['38'] = '&amp;';
+ if (useTable === 'HTML_ENTITIES') {
+ entities['160'] = '&nbsp;';
+ entities['161'] = '&iexcl;';
+ entities['162'] = '&cent;';
+ entities['163'] = '&pound;';
+ entities['164'] = '&curren;';
+ entities['165'] = '&yen;';
+ entities['166'] = '&brvbar;';
+ entities['167'] = '&sect;';
+ entities['168'] = '&uml;';
+ entities['169'] = '&copy;';
+ entities['170'] = '&ordf;';
+ entities['171'] = '&laquo;';
+ entities['172'] = '&not;';
+ entities['173'] = '&shy;';
+ entities['174'] = '&reg;';
+ entities['175'] = '&macr;';
+ entities['176'] = '&deg;';
+ entities['177'] = '&plusmn;';
+ entities['178'] = '&sup2;';
+ entities['179'] = '&sup3;';
+ entities['180'] = '&acute;';
+ entities['181'] = '&micro;';
+ entities['182'] = '&para;';
+ entities['183'] = '&middot;';
+ entities['184'] = '&cedil;';
+ entities['185'] = '&sup1;';
+ entities['186'] = '&ordm;';
+ entities['187'] = '&raquo;';
+ entities['188'] = '&frac14;';
+ entities['189'] = '&frac12;';
+ entities['190'] = '&frac34;';
+ entities['191'] = '&iquest;';
+ entities['192'] = '&Agrave;';
+ entities['193'] = '&Aacute;';
+ entities['194'] = '&Acirc;';
+ entities['195'] = '&Atilde;';
+ entities['196'] = '&Auml;';
+ entities['197'] = '&Aring;';
+ entities['198'] = '&AElig;';
+ entities['199'] = '&Ccedil;';
+ entities['200'] = '&Egrave;';
+ entities['201'] = '&Eacute;';
+ entities['202'] = '&Ecirc;';
+ entities['203'] = '&Euml;';
+ entities['204'] = '&Igrave;';
+ entities['205'] = '&Iacute;';
+ entities['206'] = '&Icirc;';
+ entities['207'] = '&Iuml;';
+ entities['208'] = '&ETH;';
+ entities['209'] = '&Ntilde;';
+ entities['210'] = '&Ograve;';
+ entities['211'] = '&Oacute;';
+ entities['212'] = '&Ocirc;';
+ entities['213'] = '&Otilde;';
+ entities['214'] = '&Ouml;';
+ entities['215'] = '&times;';
+ entities['216'] = '&Oslash;';
+ entities['217'] = '&Ugrave;';
+ entities['218'] = '&Uacute;';
+ entities['219'] = '&Ucirc;';
+ entities['220'] = '&Uuml;';
+ entities['221'] = '&Yacute;';
+ entities['222'] = '&THORN;';
+ entities['223'] = '&szlig;';
+ entities['224'] = '&agrave;';
+ entities['225'] = '&aacute;';
+ entities['226'] = '&acirc;';
+ entities['227'] = '&atilde;';
+ entities['228'] = '&auml;';
+ entities['229'] = '&aring;';
+ entities['230'] = '&aelig;';
+ entities['231'] = '&ccedil;';
+ entities['232'] = '&egrave;';
+ entities['233'] = '&eacute;';
+ entities['234'] = '&ecirc;';
+ entities['235'] = '&euml;';
+ entities['236'] = '&igrave;';
+ entities['237'] = '&iacute;';
+ entities['238'] = '&icirc;';
+ entities['239'] = '&iuml;';
+ entities['240'] = '&eth;';
+ entities['241'] = '&ntilde;';
+ entities['242'] = '&ograve;';
+ entities['243'] = '&oacute;';
+ entities['244'] = '&ocirc;';
+ entities['245'] = '&otilde;';
+ entities['246'] = '&ouml;';
+ entities['247'] = '&divide;';
+ entities['248'] = '&oslash;';
+ entities['249'] = '&ugrave;';
+ entities['250'] = '&uacute;';
+ entities['251'] = '&ucirc;';
+ entities['252'] = '&uuml;';
+ entities['253'] = '&yacute;';
+ entities['254'] = '&thorn;';
+ entities['255'] = '&yuml;';
+ }
+
+ if (useQuoteStyle !== 'ENT_NOQUOTES') {
+ entities['34'] = '&quot;';
+ }
+ if (useQuoteStyle === 'ENT_QUOTES') {
+ entities['39'] = '&#39;';
+ }
+ entities['60'] = '&lt;';
+ entities['62'] = '&gt;';
+
+
+ // ascii decimals to real symbols
+ for (decimal in entities) {
+ symbol = String.fromCharCode(decimal);
+ hash_map[symbol] = entities[decimal];
+ }
+
+ return hash_map;
+}
+
+
+function htmlentities (string, quote_style) {
+ // http://kevin.vanzonneveld.net
+ // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
+ // + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
+ // + improved by: nobbler
+ // + tweaked by: Jack
+ // + bugfixed by: Onno Marsman
+ // + revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
+ // + bugfixed by: Brett Zamir (http://brett-zamir.me)
+ // + input by: Ratheous
+ // - depends on: get_html_translation_table
+ // * example 1: htmlentities('Kevin & van Zonneveld');
+ // * returns 1: 'Kevin &amp; van Zonneveld'
+ // * example 2: htmlentities("foo'bar","ENT_QUOTES");
+ // * returns 2: 'foo&#039;bar'
+
+ var hash_map = {}, symbol = '', tmp_str = '', entity = '';
+ tmp_str = string.toString();
+
+ if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style))) {
+ return false;
+ }
+ hash_map["'"] = '&#039;';
+ for (symbol in hash_map) {
+ entity = hash_map[symbol];
+ tmp_str = tmp_str.split(symbol).join(entity);
+ }
+
+ return tmp_str;
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationphpfunctionsjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-navigation-php-functions.js (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-php-functions.js         (rev 0)
+++ trunk/wp-admin/js/custom-navigation-php-functions.js        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+function get_html_translation_table(i,g){var d={},f={},c=0,a="";var e={},b={};var j={},h={};e[0]="HTML_SPECIALCHARS";e[1]="HTML_ENTITIES";b[0]="ENT_NOQUOTES";b[2]="ENT_COMPAT";b[3]="ENT_QUOTES";j=!isNaN(i)?e[i]:i?i.toUpperCase():"HTML_SPECIALCHARS";h=!isNaN(g)?b[g]:g?g.toUpperCase():"ENT_COMPAT";if(j!=="HTML_SPECIALCHARS"&&j!=="HTML_ENTITIES"){throw new Error("Table: "+j+" not supported")}d["38"]="&amp;";if(j==="HTML_ENTITIES"){d["160"]="&nbsp;";d["161"]="&iexcl;";d["162"]="&cent;";d["163"]="&pound;";d["164"]="&curren;";d["165"]="&yen;";d["166"]="&brvbar;";d["167"]="&sect;";d["168"]="&uml;";d["169"]="&copy;";d["170"]="&ordf;";d["171"]="&laquo;";d["172"]="&not;";d["173"]="&shy;";d["174"]="&reg;";d["175"]="&macr;";d["176"]="&deg;";d["177"]="&plusmn;";d["178"]="&sup2;";d["179"]="&sup3;";d["180"]="&acute;";d["181"]="&micro;";d["182"]="&para;";d["183"]="&middot;";d["184"]="&cedil;";d["185"]="&sup1;";d["186"]="&ordm;";d["187"]="&raquo;";d["188"]="&frac14;";d["189"]="&frac12;";d["190"]="&frac34;";d["191"]="&iquest;";d["192"]="&Agrave;";d["193"]="&Aacute;";d["194"]="&Acirc;";d["195"]="&Atilde;";d["196"]="&Auml;";d["197"]="&Aring;";d["198"]="&AElig;";d["199"]="&Ccedil;";d["200"]="&Egrave;";d["201"]="&Eacute;";d["202"]="&Ecirc;";d["203"]="&Euml;";d["204"]="&Igrave;";d["205"]="&Iacute;";d["206"]="&Icirc;";d["207"]="&Iuml;";d["208"]="&ETH;";d["209"]="&Ntilde;";d["210"]="&Ograve;";d["211"]="&Oacute;";d["212"]="&Ocirc;";d["213"]="&Otilde;";d["214"]="&Ouml;";d["215"]="&times;";d["216"]="&Oslash;";d["217"]="&Ugrave;";d["218"]="&Uacute;";d["219"]="&Ucirc;";d["220"]="&Uuml;";d["221"]="&Yacute;";d["222"]="&THORN;";d["223"]="&szlig;";d["224"]="&agrave;";d["225"]="&aacute;";d["226"]="&acirc;";d["227"]="&atilde;";d["228"]="&auml;";d["229"]="&aring;";d["230"]="&aelig;";d["231"]="&ccedil;";d["232"]="&egrave;";d["233"]="&eacute;";d["234"]="&ecirc;";d["235"]="&euml;";d["236"]="&igrave;";d["237"]="&iacute;";d["238"]="&icirc;";d["239"]="&iuml;";d["240"]="&eth;";d["241"]="&ntilde;";d["242"]="&ograve;";d["243"]="&oacute;";d["244"]="&ocirc;";d["245"]="&otilde;";d["246"]="&ouml;";d["247"]="&divide;";d["248"]="&oslash;";d["249"]="&ugrave;";d["250"]="&uacute;";d["251"]="&ucirc;";d["252"]="&uuml;";d["253"]="&yacute;";d["254"]="&thorn;";d["255"]="&yuml;"}if(h!=="ENT_NOQUOTES"){d["34"]="&quot;"}if(h==="ENT_QUOTES"){d["39"]="&#39;"}d["60"]="&lt;";d["62"]="&gt;";for(c in d){a=String.fromCharCode(c);f[a]=d[c]}return f}function htmlentities(c,f){var e={},d="",a="",b="";a=c.toString();if(false===(e=this.get_html_translation_table("HTML_ENTITIES",f))){return false}e["'"]="&#039;";for(d in e){b=e[d];a=a.split(d).join(b)}return a};
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/menu.php (13256 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/menu.php        2010-02-20 21:09:49 UTC (rev 13256)
+++ trunk/wp-admin/menu.php        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx">         $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
</span><span class="cx">         $submenu['themes.php'][10] = array(_x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php');
</span><span class="cx">         $submenu['themes.php'][15] = array(__('Add New Themes'), 'install_themes', 'theme-install.php');
</span><ins>+        $submenu['themes.php'][20] = array(__('Custom Navigation'), 'switch_themes', 'custom-navigation.php');
</ins><span class="cx">
</span><span class="cx"> $update_plugins = get_site_transient( 'update_plugins' );
</span><span class="cx"> $update_count = 0;
</span></span></pre></div>
<a id="trunkwpincludescustomnavigationfunctionsphp"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/custom-navigation-functions.php (0 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/custom-navigation-functions.php         (rev 0)
+++ trunk/wp-includes/custom-navigation-functions.php        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -0,0 +1,993 @@
</span><ins>+<?php
+/**
+ * WordPress Administration Custom Navigation
+ * General Functions
+ *
+ * @author Jeffikus <pearce.jp@gmail.com>
+ * @version 1.1.0
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+function wp_custom_navigation_get_menu_items( $menu_objects, $key = 'ID' ) {
+        $menu_items = array();
+        if ( !empty( $menu_objects ) && !empty( $key ) ) {
+                $args = array( 'orderby' => 'menu_order', 'post_type' => 'menu_item', 'post_status' => 'menu-category,menu-page,menu-custom' );
+                if ( count( $menu_objects ) > 1 )
+                        $args['include'] = implode( ',', $menu_objects );
+                else
+                        $args['include'] = $menu_objects[0];
+                $posts = new WP_Query( $args );
+                if ( ! empty( $posts->posts ) ) {
+                        foreach( $posts->posts as $post ) {
+                                $menu_items[ $post->$key ] = $post;
+                        }
+                }
+                unset( $posts );
+                ksort( $menu_items );
+        }
+        return $menu_items;
+}
+function wp_custom_navigation_setup($override = false) {
+        
+        $nav_version = '1.1.0';
+        //Custom Navigation Menu Setup
+        
+        //Check for Upgrades
+        if (get_option('wp_settings_custom_nav_version') <> '') {
+                $nav_version_in_db = get_option('wp_settings_custom_nav_version');
+        }
+        else {
+                $nav_version_in_db = '0';
+        }
+        
+        //Override for menu descriptions
+        update_option('wp_settings_custom_nav_advanced_options','yes');
+                        
+        if(($nav_version_in_db <> $nav_version) || ($override))
+                update_option('wp_settings_custom_nav_version',$nav_version);
+
+        $custom_menus = get_terms( 'menu', array( 'hide_empty' => false ) );
+         if ( !empty( $custom_menus ) ) {
+                foreach( $custom_menus as $menu ) {
+                        $menu_objects = get_objects_in_term( $menu->term_id, 'menu' );
+                        if ( !empty( $menu_objects ) ) {
+                                foreach( $menu_objects as $item )
+                                        wp_delete_post( $item );
+                        }
+                        wp_delete_term( $menu->term_id, 'menu' );
+                }
+        }
+
+}
+
+/*-----------------------------------------------------------------------------------*/
+/* Custom Navigation Functions */
+/* wp_custom_navigation_output() displays the menu in the back/frontend
+/* wp_custom_navigation_sub_items() is a recursive sub menu item function
+/* wp_custom_nav_get_pages()
+/* wp_custom_nav_get_categories()
+/* wp_custom_navigation_default_sub_items() is a recursive sub menu item function
+/*-----------------------------------------------------------------------------------*/
+
+/*-----------------------------------------------------------------------------------*/
+/* Main Output Function
+/* args list
+/* type - frontend or backend
+/* name - name of your menu
+/* id - id of menu in db
+/* desc - 1 = show descriptions, 2 = dont show descriptions
+/* before_title - html before title is outputted in <a> tag
+/* after_title - html after title is outputted in <a> tag
+/*-----------------------------------------------------------------------------------*/
+
+function wp_custom_navigation_output($args = array()) {
+                
+                //DEFAULT ARGS
+                $type = 'frontend';
+                $name = 'Menu 1';
+                $id = 0;
+                $desc = 2;
+                $before_title = '';
+                $after_title = '';
+                
+                if (isset($args)) {
+                
+                        if ( !is_array($args) )
+                        parse_str( $args, $args );
+        
+                        extract($args);
+                }
+
+                $menu_objects = get_objects_in_term( $id, 'menu' );
+                $menu_items = wp_custom_navigation_get_menu_items( $menu_objects, 'menu_order' );
+                //Override for menu descriptions
+                $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options');
+                if ($advanced_option_descriptions == 'no')
+                {
+                        $desc = 2;
+                }
+                
+                $queried_id = 0;
+                global $wp_query;
+                if ( is_page() )
+                        $queried_id = $wp_query->post->ID;
+                elseif ( is_category() )
+                        $queried_id = $wp_query->query_vars['cat'];
+         //DISPLAY Loop
+                foreach ($menu_items as $menu_item) {
+
+                        //PREPARE Menu Data
+                        //Page Menu Item
+                        switch ( $menu_item->post_status ) {
+                                case 'menu-page':
+                                        if ($menu_item->guid == '')
+                                                $link = get_permalink( $menu_item->post_parent );
+                                        else
+                                                $link = $menu_item->guid;
+
+                                        if ( $menu_item->post_title == '' )
+                                                $title = htmlentities( get_the_title( $menu_item->post_parent ) );
+                                        else
+                                                $title = htmlentities( $menu_item->post_title );
+
+                                        if ( $menu_item->post_content == '' )
+                                                $description = htmlentities( get_post_meta( $menu_item->ID, 'page-description', true ) );
+                                        else
+                                                $description = htmlentities( $menu_item->post_content );
+                                        $target = '';
+                                break;
+                        //Category Menu Item
+                                case 'menu-category':
+                                        if ($menu_item->guid == '')
+                                                $link = get_category_link( $menu_item->post_parent );
+                                        else
+                                                $link = $menu_item->guid;
+                                
+                                        if ( $menu_item->post_title == '' ) {
+                                                $title_raw = get_categories( 'include='.$menu_item->post_parent );
+                                                $title = htmlentities($title_raw[0]->cat_name);        
+                                        } else {
+                                                $title = htmlentities( $menu_item->post_title );
+                                        }
+                                
+                                        if ( $menu_item->post_content == '' )
+                                                $description = htmlentities( strip_tags( category_description( $menu_item->post_parent ) ) );
+                                        else
+                                                $description = htmlentities( $menu_item->post_content );
+                                        $target = '';
+                                break;
+                                default:
+                        //Custom Menu Item
+                                        $link = $menu_item->guid;
+                                        $title = htmlentities( $menu_item->post_title );
+                                        $description = htmlentities( $menu_item->post_content );
+                                        $target = 'target="_blank"';
+                                break;
+                        }
+/* @todo: update to use tax/post data
+
+                        //SET anchor title
+                        if (isset($wp_custom_nav_menu_items->custom_anchor_title)) {
+                                $anchor_title = htmlentities($wp_custom_nav_menu_items->custom_anchor_title);
+                        }
+                        else {
+                                $anchor_title = $title;
+                        }
+                        
+                        if ($queried_id == $wp_custom_nav_menu_items->post_id) {
+                                $li_class = 'class="current_page_item"';
+                        }
+                        else {
+                                $li_class = '';
+                        }
+                        
+                        if (isset($wp_custom_nav_menu_items->new_window)) {
+                                if ($wp_custom_nav_menu_items->new_window > 0) {
+                                        $target = 'target="_blank"';
+                                }
+                                else {
+                                        $target = '';
+                                }
+                        }
+*/                        
+                        //List Items
+                        ?><li id="menu-<?php echo $menu_item->ID; ?>" value="<?php echo $menu_item->ID; ?>" <?php echo $li_class; ?>><?php
+                                        //@todo: update front end to use post data
+                                        //FRONTEND Link
+                                        if ($type == "frontend")
+                                        {        
+                                                ?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $before_title.$title.$after_title; ?><?php
+                                                
+                                                        if ( $advanced_option_descriptions == 'no' )
+                                                        {
+                                                                // 2 widget override do NOT display descriptions
+                                                                // 1 widget override display descriptions
+                                                                // 0 widget override not set
+                                                                if (($desc == 1) || ($desc == 0) )
+                                                                {
+                                                                        ?><span class="nav-description"><?php echo $description; ?></span><?php
+                                                                }
+                                                                elseif ($desc == 2)
+                                                                { }
+                                                                else
+                                                                { }
+                                                        }
+                                                        else
+                                                        {
+                                                                // 2 widget override do NOT display descriptions
+                                                                // 1 widget override display descriptions
+                                                                // 0 widget override not set
+                                                                if ($desc == 1)
+                                                                {
+                                                                        ?><span class="nav-description"><?php echo $description; ?></span><?php
+                                                                }
+                                                                elseif (($desc == 2) || ($desc == 0))
+                                                                { }
+                                                                else
+                                                                { }
+                                                        }
+                                                        
+                                                ?></a><?php
+                                        }
+                                        //BACKEND draggable and droppable elements
+                                        elseif ($type == "backend")
+                                                $link_type = substr( $menu_item->post_status, 5 );
+                                        {
+                                                ?>
+                                                
+                                                <dl>
+                                                        <dt>
+                                                                <span class="title"><?php echo $title; ?></span>
+                                                                <span class="controls">
+                                                                <span class="type"><?php echo $link_type; ?></span>
+                                                                <a id="edit<?php echo $menu_item->menu_order; ?>" onclick="edititem(<?php echo $menu_item->menu_order; ?>)" value="<?php echo $menu_item->menu_order; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
+                                                                <a id="remove<?php echo $menu_item->menu_order; ?>" onclick="removeitem(<?php echo $menu_item->menu_order; ?>)" value="<?php echo $menu_item->menu_order; ?>"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" /></a>
+                                                                <a id="view<?php echo $menu_item->menu_order; ?>" target="_blank" href="<?php echo $link; ?>"><img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" /></a>
+                                                                </span>
+                                                        </dt>
+                                                </dl>
+                                                
+                                                <a><span class=""></span></a>
+                                                <input type="hidden" name="dbid<?php echo $menu_item->menu_order; ?>" id="dbid<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->ID; ?>" />
+                                                <input type="hidden" name="postmenu<?php echo $menu_item->menu_order; ?>" id="postmenu<?php echo $menu_item->menu_order; ?>" value="<?php echo $id; ?>" />
+                                                <input type="hidden" name="parent<?php echo $menu_item->menu_order; ?>" id="parent<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->post_parent; ?>" />
+                                                <input type="hidden" name="title<?php echo $menu_item->menu_order; ?>" id="title<?php echo $menu_item->menu_order; ?>" value="<?php echo $title; ?>" />
+                                                <input type="hidden" name="linkurl<?php echo $menu_item->menu_order; ?>" id="linkurl<?php echo $menu_item->menu_order; ?>" value="<?php echo $link; ?>" />
+                                                <input type="hidden" name="description<?php echo $menu_item->menu_order; ?>" id="description<?php echo $menu_item->menu_order; ?>" value="<?php echo $description; ?>" />
+                                                <input type="hidden" name="icon<?php echo $menu_item->menu_order; ?>" id="icon<?php echo $menu_item->menu_order; ?>" value="0" />
+                                                <input type="hidden" name="position<?php echo $menu_item->menu_order; ?>" id="position<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->menu_order; ?>" />
+                                                <input type="hidden" name="linktype<?php echo $menu_item->menu_order; ?>" id="linktype<?php echo $menu_item->menu_order; ?>" value="<?php echo $link_type; ?>" />
+                                                <input type="hidden" name="anchortitle<?php echo $menu_item->menu_order; ?>" id="anchortitle<?php echo $menu_item->menu_order; ?>" value="<?php echo esc_html( $menu_item->post_excerpt ); ?>" />
+                                                <input type="hidden" name="newwindow<?php echo $menu_item->menu_order; ?>" id="newwindow<?php echo $menu_item->menu_order; ?>" value="<?php echo ( '' == $menu_item->post_content_filtered ? '0' : '1' ); ?>" />
+                                                
+                                                <?php
+                                        }
+
+                                        //@todo: implement menu heirarchy
+/*                                        //DISPLAY menu sub items
+                                        if ($wp_custom_nav_menu_items->parent_id == 0)
+                                        {
+                                                //FRONTEND
+                                                if ($type == 'frontend')
+                                                {
+                                                        //Recursive function
+                                                        $intj = wp_custom_navigation_sub_items($wp_custom_nav_menu_items->id,$wp_custom_nav_menu_items->link_type,$table_name,$type,$wp_custom_nav_menu_id);
+                                                }
+                                                //BACKEND
+                                                else
+                                                {
+                                                        //Recursive function
+                                                        $intj = wp_custom_navigation_sub_items($wp_custom_nav_menu_items->id,$wp_custom_nav_menu_items->link_type,$table_name,$type,$id);
+                                                }
+                                        }
+*/                        ?></li>
+                        <?php
+                }
+}
+//@todo: implement menu heirarchy
+//RECURSIVE Sub Menu Items
+function wp_custom_navigation_sub_items($post_id,$type,$table_name,$output_type,$menu_id = 0) {
+        
+        $parent_id = 0;
+        global $wpdb;
+        
+        //GET sub menu items
+        $wp_custom_nav_menu = $wpdb->get_results("SELECT id,post_id,parent_id,position,custom_title,custom_link,custom_description,menu_icon,link_type,custom_anchor_title,new_window FROM ".$table_name." WHERE parent_id = '".$post_id."' AND menu_id='".$menu_id."' ORDER BY position ASC");
+        
+        if (empty($wp_custom_nav_menu))
+        {
+        
+        }
+        else
+        {
+                ?><ul id="sub-custom-nav">
+                <?php
+         $queried_id = 0;
+                global $wp_query;
+ if (is_page()) {
+                 $queried_id = $wp_query->post->ID;
+         }
+         elseif (is_category()) {
+                 $queried_id = $wp_query->query_vars['cat'];
+         }
+         else {
+
+         }
+         //DISPLAY Loop
+                foreach ($wp_custom_nav_menu as $sub_item)
+                {
+                        //Figure out where the menu item sits
+                        $counter=$sub_item->position;
+                        
+                        //Prepare Menu Data
+                        //Category Menu Item
+                        if ($sub_item->link_type == 'category')
+                        {
+                                
+                                $parent_id = $sub_item->parent_id;
+                                $post_id = $sub_item->post_id;
+                                
+                                if ($sub_item->custom_link == '') {
+                                        $link = get_category_link($sub_item->post_id);
+                                }
+                                else {
+                                        $link = $sub_item->custom_link;
+                                }
+                                
+                                if ($sub_item->custom_title == '') {
+                                        $title_raw = get_categories('include='.$sub_item->post_id);
+                                        $title = htmlentities($title_raw[0]->cat_name);
+                                }
+                                else {
+                                        $title = htmlentities($sub_item->custom_title);
+                                }
+                                
+                                if ($sub_item->custom_description == '') {
+                                        $description = strip_tags(category_description($sub_item->post_id));
+                                }
+                                else {
+                                        $description = $sub_item->custom_description;
+                                }
+                                $target = '';
+                        }
+                        //Page Menu Item
+                        elseif ($sub_item->link_type == 'page')
+                        {
+                                
+                                $parent_id = $sub_item->parent_id;
+                                $post_id = $sub_item->post_id;
+                                
+                                if ($sub_item->custom_link == '') {
+                                        $link = get_permalink($sub_item->post_id);
+                                }
+                                else {
+                                        $link = $sub_item->custom_link;
+                                }
+
+                                if ($sub_item->custom_title == '') {
+                                        $title = htmlentities(get_the_title($sub_item->post_id));
+                                }
+                                else {
+                                        $title = htmlentities($sub_item->custom_title);
+                                }
+                                
+                                if ($sub_item->custom_description == '') {
+                                        $description = get_post_meta($sub_item->post_id, 'page-description', true);
+                                }
+                                else {
+                                        $description = $sub_item->custom_description;
+                                }
+                                $target = '';
+                                
+                        }
+                        //Custom Menu Item
+                        else
+                        {
+                                $link = $sub_item->custom_link;
+                                $title = htmlentities($sub_item->custom_title);
+                                $parent_id = $sub_item->parent_id;
+                                $post_id = $sub_item->post_id;
+                                $description = $sub_item->custom_description;
+                                $target = 'target="_blank"';
+                        }
+                        if ($queried_id == $sub_item->post_id) {
+                                $li_class = 'class="current_page_item"';
+                        }
+                        else {
+                                $li_class = '';
+                        }
+                        
+                        //SET anchor title
+                        if (isset($sub_item->custom_anchor_title)) {
+                                $anchor_title = htmlentities($sub_item->custom_anchor_title);
+                        }
+                        else {
+                                $anchor_title = $title;
+                        }
+                        
+                        if (isset($sub_item->new_window)) {
+                                if ($sub_item->new_window > 0) {
+                                        $target = 'target="_blank"';
+                                }
+                        }
+                        
+                        //List Items
+                        ?><li id="menu-<?php echo $counter; ?>" value="<?php echo $counter; ?>" <?php echo $li_class; ?>><?php
+                                                //FRONTEND
+                                                if ($output_type == "frontend")
+                                                {
+                                                        ?><a title="<?php echo $anchor_title; ?>" href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $title; ?></a><?php
+                                                }
+                                                //BACKEND
+                                                elseif ($output_type == "backend")
+                                                {
+                                                        ?>
+                                                        <dl>
+                                                        <dt>
+                                                                <span class="title"><?php echo $title; ?></span>
+                                                                <span class="controls">
+                                                                <span class="type"><?php echo $sub_item->link_type; ?></span>
+                                                                <a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
+                                                                <a id="remove<?php echo $counter; ?>" onclick="removeitem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" /></a>
+                                                                <a id="view<?php echo $counter; ?>" target="_blank" href="<?php echo $link; ?>"><img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" /></a>
+                                                                </span>
+                                                        </dt>
+                                                        </dl>
+                                                        <a class="hide" href="<?php echo $link; ?>"><?php echo $title; ?></a>
+                                                        <input type="hidden" name="dbid<?php echo $counter; ?>" id="dbid<?php echo $counter; ?>" value="<?php echo $sub_item->id; ?>" />
+                                                        <input type="hidden" name="postmenu<?php echo $counter; ?>" id="postmenu<?php echo $counter; ?>" value="<?php echo $post_id; ?>" />
+                                                        <input type="hidden" name="parent<?php echo $counter; ?>" id="parent<?php echo $counter; ?>" value="<?php echo $parent_id; ?>" />
+                                                        <input type="hidden" name="title<?php echo $counter; ?>" id="title<?php echo $counter; ?>" value="<?php echo $title; ?>" />
+                                                        <input type="hidden" name="linkurl<?php echo $counter; ?>" id="linkurl<?php echo $counter; ?>" value="<?php echo $link; ?>" />
+                                                        <input type="hidden" name="description<?php echo $counter; ?>" id="description<?php echo $counter; ?>" value="<?php echo $description; ?>" />
+                                                        <input type="hidden" name="icon<?php echo $counter; ?>" id="icon<?php echo $counter; ?>" value="0" />
+                                                        <input type="hidden" name="position<?php echo $counter; ?>" id="position<?php echo $counter; ?>" value="<?php echo $counter; ?>" />
+                                                        <input type="hidden" name="linktype<?php echo $counter; ?>" id="linktype<?php echo $counter; ?>" value="<?php echo $sub_item->link_type; ?>" />
+                                                        <input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $anchor_title; ?>" />
+                                                        <input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="<?php echo $sub_item->new_window; ?>" />
+                                                        <?php
+                                                }
+                                                
+                                                //Do recursion
+                                                wp_custom_navigation_sub_items($sub_item->id,$sub_item->link_type,$table_name,$output_type,$menu_id);
+                        ?></li>
+                        <?php
+        
+                }
+        
+        ?></ul>
+        <?php
+        
+        }
+        
+        return $parent_id;
+
+}
+
+
+//Outputs All Pages and Sub Items
+function wp_custom_nav_get_pages($counter,$type) {
+
+        $pages_args = array(
+                 'child_of' => 0,
+                        'sort_order' => 'ASC',
+                        'sort_column' => 'post_title',
+                        'hierarchical' => 1,
+                        'exclude' => '',
+                        'include' => '',
+                        'meta_key' => '',
+                        'meta_value' => '',
+                        'authors' => '',
+                        'parent' => -1,
+                        'exclude_tree' => '',
+                        'number' => '',
+                        'offset' => 0 );
+        
+        //GET all pages                
+        $pages_array = get_pages($pages_args);
+        
+        $intCounter = $counter;
+        $parentli = $intCounter;
+        
+        if ($pages_array)
+        {
+                //DISPLAY Loop
+                foreach ($pages_array as $post)
+                {
+        
+                        if ($post->post_parent == 0)
+                        {
+                                //Custom Menu
+                                if ($type == 'menu')
+                                {
+                                        $description = get_post_meta($post->ID, 'page-description', true);
+                                        ?>
+                                        
+                                        <li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
+                                
+                                                <dl>
+                                                <dt>
+                                                <span class="title"><?php echo $post->post_title; ?></span>
+                                                <span class="controls">
+                                                        <span class="type">page</span>
+                                                        <a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
+                                                        <a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>">
+                                                                <img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" />
+                                                        </a>
+                                                        <a target="_blank" href="<?php echo get_permalink($post->ID); ?>">
+                                                                <img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" />
+                                                        </a>
+                                                </span>
+                                                
+                                                </dt>
+                                                </dl>
+                                                <a class="hide" href="<?php echo get_permalink($post->ID); ?>"><span class="title"><?php echo $post->post_title; ?></span>
+                                  </a>
+                                  <input type="hidden" name="postmenu<?php echo $intCounter; ?>" id="postmenu<?php echo $intCounter; ?>" value="<?php echo $post->ID; ?>" />
+                                                <input type="hidden" name="parent<?php echo $intCounter; ?>" id="parent<?php echo $intCounter; ?>" value="0" />
+                                                <input type="hidden" name="title<?php echo $intCounter; ?>" id="title<?php echo $intCounter; ?>" value="<?php echo htmlentities($post->post_title); ?>" />
+                                                <input type="hidden" name="linkurl<?php echo $intCounter; ?>" id="linkurl<?php echo $intCounter; ?>" value="<?php echo get_permalink($post->ID); ?>" />
+                                                <input type="hidden" name="description<?php echo $intCounter; ?>" id="description<?php echo $intCounter; ?>" value="<?php echo $description; ?>" />
+                                                <input type="hidden" name="icon<?php echo $intCounter; ?>" id="icon<?php echo $intCounter; ?>" value="0" />
+                                                <input type="hidden" name="position<?php echo $intCounter; ?>" id="position<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>" />
+                                                <input type="hidden" name="linktype<?php echo $intCounter; ?>" id="linktype<?php echo $intCounter; ?>" value="page" />
+                                                <input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($post->post_title); ?>" />
+                                                <input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" />
+                                                
+                                                <?php $parentli = $post->ID; ?>
+                                                <?php $intCounter++; ?>                        
+                                                <?php
+                                                
+                                                        //Recursive function
+                                                        $intCounter = wp_custom_navigation_default_sub_items($post->ID, $intCounter, $parentli, 'pages', 'menu');
+                                                
+                                                ?>
+                                        
+                                        </li>
+                                        
+                                        <?php
+                                        
+                                }
+                                //Sidebar Menu
+                                elseif ($type == 'default')
+                                {
+                                        ?>
+                                        
+                                         <li>
+                                 <dl>
+                                 <dt>
+                                 <?php
+                                         $post_text = htmlentities($post->post_title);
+                                         $post_url = get_permalink($post->ID);
+                                         $post_id = $post->ID;
+                                         $post_parent_id = $post->post_parent;
+                                         
+                                                        $description = htmlentities(get_post_meta($post_id, 'page-description', true));
+                                                        
+                                 ?>
+                                 <?php $templatedir = get_bloginfo('url'); ?>
+                                
+                                 <span class="title"><?php echo $post->post_title; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','Page','<?php echo $post_text; ?>','<?php echo $post_url; ?>','<?php echo $post_id; ?>','<?php echo $post_parent_id ?>','<?php echo $description; ?>')" name="<?php echo $post_text; ?>" value="<?php echo get_permalink($post->ID); ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a></dt>
+                                 </dl>
+                                 <?php $parentli = $post->ID; ?>
+                                                <?php $intCounter++; ?>                        
+                                 <?php
+                                                
+                                                        //Recursive function
+                                                        $intCounter = wp_custom_navigation_default_sub_items($post_id, $intCounter, $parentli, 'pages', 'default');
+                                                
+                                                 ?>
+                                        
+                                        </li>
+        
+                                        <?php
+                                
+                                }
+                                else
+                                {
+                                
+                                }        
+                        }
+                }
+        }
+        else
+        {
+                echo 'Not Found';
+        }
+
+        return $intCounter;
+}
+
+//Outputs All Categories and Sub Items
+function wp_custom_nav_get_categories($counter, $type) {
+
+        $category_args = array(
+                        'type' => 'post',
+                        'child_of' => 0,
+                        'orderby' => 'name',
+                        'order' => 'ASC',
+                        'hide_empty' => false,
+                        'include_last_update_time' => false,
+                        'hierarchical' => 1,
+                        'exclude' => '',
+                        'include' => '',
+                        'number' => '',
+                        'pad_counts' => false );
+        
+        
+        
+        $intCounter = $counter;        
+        
+        //GET all categories        
+        $categories_array = get_categories($category_args);
+        
+        if ($categories_array)
+        {
+                //DISPLAY Loop
+                foreach ($categories_array as $cat_item)
+                {
+
+                        if ($cat_item->parent == 0)
+                        {
+                                //Custom Menu
+                                if ($type == 'menu')
+                                {
+                                        ?>
+        
+                                 <li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
+                                         <dl>
+                         <dt>
+                                 <span class="title"><?php echo $cat_item->cat_name; ?></span>
+                                                        <span class="controls">
+                                                        <span class="type">category</span>
+                                                        <a id="edit<?php echo $intCounter; ?>" onclick="edititem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
+                                                        <a id="remove<?php echo $intCounter; ?>" onclick="removeitem(<?php echo $intCounter; ?>)" value="<?php echo $intCounter; ?>">
+                                                                <img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" />
+                                                        </a>
+                                                        <a target="_blank" href="<?php echo get_category_link($cat_item->cat_ID); ?>">
+                                                                <img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" />
+                                                        </a>
+                                                        </span>
+                                        
+                         </dt>
+                         </dl>
+                         <a class="hide" href="<?php echo get_category_link($cat_item->cat_ID); ?>"><span class="title"><?php echo $cat_item->cat_name; ?></span>
+                         <?php
+                         $use_cats_raw = get_option('wp_settings_custom_nav_descriptions');
+                                                 $use_cats = strtolower($use_cats_raw);
+                                                 if ($use_cats == 'yes') { ?>
+                         <br/> <span><?php echo $cat_item->category_description; ?></span>
+                         <?php } ?>
+                                 </a>
+                         <input type="hidden" name="postmenu<?php echo $intCounter; ?>" id="postmenu<?php echo $intCounter; ?>" value="<?php echo $cat_item->cat_ID; ?>" />
+                         <input type="hidden" name="parent<?php echo $intCounter; ?>" id="parent<?php echo $intCounter; ?>" value="0" />
+                         <input type="hidden" name="title<?php echo $intCounter; ?>" id="title<?php echo $intCounter; ?>" value="<?php echo htmlentities($cat_item->cat_name); ?>" />
+                                                <input type="hidden" name="linkurl<?php echo $intCounter; ?>" id="linkurl<?php echo $intCounter; ?>" value="<?php echo get_category_link($cat_item->cat_ID); ?>" />
+                                                <input type="hidden" name="description<?php echo $intCounter; ?>" id="description<?php echo $intCounter; ?>" value="<?php echo htmlentities($cat_item->category_description); ?>" />
+                                                <input type="hidden" name="icon<?php echo $intCounter; ?>" id="icon<?php echo $intCounter; ?>" value="0" />
+                                                <input type="hidden" name="position<?php echo $intCounter; ?>" id="position<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>" />
+                                                <input type="hidden" name="linktype<?php echo $intCounter; ?>" id="linktype<?php echo $intCounter; ?>" value="category" />
+                                                <input type="hidden" name="anchortitle<?php echo $intCounter; ?>" id="anchortitle<?php echo $intCounter; ?>" value="<?php echo htmlentities($cat_item->cat_name); ?>" />
+                                                <input type="hidden" name="newwindow<?php echo $intCounter; ?>" id="newwindow<?php echo $intCounter; ?>" value="0" />
+                                                
+                         <?php $parentli = $cat_item->cat_ID; ?>
+                         <?php $intCounter++; ?>                        
+                                 <?php
+                                                
+                                                        //Recursive function
+                                                        $intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','menu');
+                                                        
+                                                ?>
+                        
+                                 </li>
+                                 
+                                 <?php
+                         }
+                         //Sidebar Menu
+                         elseif ($type == 'default')
+                         {
+                                 ?>
+                                 <li>
+                                                <dl>
+                                                <dt>
+                                                <?php
+                                 $post_text = htmlentities($cat_item->cat_name);
+                                 $post_url = get_category_link($cat_item->cat_ID);
+                                 $post_id = $cat_item->cat_ID;
+                                 $post_parent_id = $cat_item->parent;
+                                 $description = htmlentities(strip_tags($cat_item->description));
+                                 ?>
+                                 <?php $templatedir = get_bloginfo('url'); ?>
+                                                <span class="title"><?php echo $cat_item->cat_name; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','Category','<?php echo $post_text; ?>','<?php echo $post_url; ?>','<?php echo $post_id; ?>','<?php echo $post_parent_id ?>','<?php echo $description; ?>')" name="<?php echo $post_text; ?>" value="<?php echo $post_url; ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a> </dt>
+                                                </dl>
+                                                <?php $parentli = $cat_item->cat_ID; ?>
+                         <?php $intCounter++; ?>                
+                                                <?php
+                                                        //Recursive function
+                                                        $intCounter = wp_custom_navigation_default_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories','default');
+                                                ?>
+                                                
+                                        </li>
+                                        
+                                        <?php
+                         }        
+                        }
+                }
+        }
+        else
+        {
+                echo 'Not Found';
+        }
+        
+        return $intCounter;
+}
+
+//RECURSIVE Sub Menu Items of default categories and pages
+function wp_custom_navigation_default_sub_items($childof, $intCounter, $parentli, $type, $output_type) {
+
+        $counter = $intCounter;
+        
+        //Custom Menu
+        if ($output_type == 'menu')
+        {
+                $sub_args = array(
+                'child_of' => $childof,
+                'hide_empty' => false,
+                'parent' => $childof);
+        }
+        //Sidebar Menu
+        elseif ($output_type == 'default')
+        {
+                $sub_args = array(
+                'child_of' => $childof,
+                'hide_empty' => false,
+                'parent' => $childof);
+        }
+        else
+        {
+                
+        }
+        
+        //Get Sub Category Items                        
+        if ($type == 'categories')
+        {
+                $sub_array = get_categories($sub_args);        
+        }
+        //Get Sub Page Items
+        elseif ($type == 'pages')
+        {
+                $sub_array = get_pages($sub_args);
+        }
+        
+        
+        if ($sub_array)
+        {
+                ?>
+                
+                <ul id="sub-custom-nav-<?php echo $type ?>">
+                
+                <?php
+                //DISPLAY Loop
+                foreach ($sub_array as $sub_item)
+                {
+                        //Prepare Menu Data
+                        //Category Menu Item
+                        if ($type == 'categories')
+                        {
+                                $link = get_category_link($sub_item->cat_ID);
+                                $title = htmlentities($sub_item->cat_name);
+                                $parent_id = $sub_item->cat_ID;
+                                $itemid = $sub_item->cat_ID;
+                                $linktype = 'category';
+                                $appendtype = 'Category';
+                                $description = htmlentities(strip_tags($sub_item->description));                                
+                        }
+                        //Page Menu Item
+                        elseif ($type == 'pages')
+                        {
+                                $link = get_permalink($sub_item->ID);
+                                $title = htmlentities($sub_item->post_title);
+                                $parent_id = $sub_item->ID;
+                                $linktype = 'page';
+                                $itemid = $sub_item->ID;
+                                $appendtype = 'Page';
+                                $description = htmlentities(get_post_meta($itemid, 'page-description', true));
+                        }
+                        //Custom Menu Item
+                        else
+                        {
+                                $title = '';
+                                $linktype = 'custom';
+                                $appendtype= 'Custom';
+                        }
+                        
+                        //Custom Menu
+                        if ($output_type == 'menu')
+                        {
+                                ?>
+                                <li id="menu-<?php echo $counter; ?>" value="<?php echo $counter; ?>">
+                                        <dl>
+                                        <dt>
+                                                <span class="title"><?php echo $title; ?></span>
+                                                        <span class="controls">
+                                                        <span class="type"><?php echo $linktype; ?></span>
+                                                        <a id="edit<?php echo $counter; ?>" onclick="edititem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-edit.png" /></a>
+                                                                <a id="remove<?php echo $counter; ?>" onclick="removeitem(<?php echo $counter; ?>)" value="<?php echo $counter; ?>">
+                                                                        <img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-close.png" />
+                                                                </a>
+                                                                <a target="_blank" href="<?php echo $link; ?>">
+                                                                        <img alt="View Page" title="View Page" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-viewpage.png" />
+                                                                </a>
+                                                </span>
+                        
+                                        </dt>
+                                        </dl>
+                                        <a class="hide" href="<?php echo $link; ?>"><?php echo $title; ?></a>
+                                        <input type="hidden" name="dbid<?php echo $counter; ?>" id="dbid<?php echo $counter; ?>" value="<?php echo $sub_item->id; ?>" />
+                                        <input type="hidden" name="postmenu<?php echo $counter; ?>" id="postmenu<?php echo $counter; ?>" value="<?php echo $parent_id; ?>" />
+                                        <input type="hidden" name="parent<?php echo $counter; ?>" id="parent<?php echo $counter; ?>" value="<?php echo $parentli; ?>" />
+                                        <input type="hidden" name="title<?php echo $counter; ?>" id="title<?php echo $counter; ?>" value="<?php echo $title; ?>" />
+                                        <input type="hidden" name="linkurl<?php echo $counter; ?>" id="linkurl<?php echo $counter; ?>" value="<?php echo $link; ?>" />
+                                        <input type="hidden" name="description<?php echo $counter; ?>" id="description<?php echo $counter; ?>" value="<?php echo $description; ?>" />
+                                        <input type="hidden" name="icon<?php echo $counter; ?>" id="icon<?php echo $counter; ?>" value="0" />
+                                        <input type="hidden" name="position<?php echo $counter; ?>" id="position<?php echo $counter; ?>" value="<?php echo $counter; ?>" />
+                                        <input type="hidden" name="linktype<?php echo $counter; ?>" id="linktype<?php echo $counter; ?>" value="<?php echo $linktype; ?>" />
+                                        <input type="hidden" name="anchortitle<?php echo $counter; ?>" id="anchortitle<?php echo $counter; ?>" value="<?php echo $title; ?>" />
+                                        <input type="hidden" name="newwindow<?php echo $counter; ?>" id="newwindow<?php echo $counter; ?>" value="0" />
+                                        
+                                        <?php $counter++; ?>
+                                        <?php
+                                                
+                                                //Do recursion
+                                                $counter = wp_custom_navigation_default_sub_items($parent_id, $counter, $parent_id, $type, 'menu');
+                                                
+                                        ?>
+                                        
+                                </li>
+                                <?php
+                        }
+                        //Sidebar Menu
+                        elseif ($output_type == 'default')
+                        {
+                                        
+                                ?>
+                                <li>
+                                        <dl>
+                                        <dt>
+                                        
+                                        <?php $templatedir = get_bloginfo('url'); ?>
+                                        <span class="title"><?php echo $title; ?></span> <a onclick="appendToList('<?php echo $templatedir; ?>','<?php echo $appendtype; ?>','<?php echo $title; ?>','<?php echo $link; ?>','<?php echo $itemid; ?>','<?php echo $parent_id ?>','<?php echo $description; ?>')" name="<?php echo $title; ?>" value="<?php echo $link; ?>"><img alt="Add to Custom Menu" title="Add to Custom Menu" src="<?php echo get_bloginfo('url'); ?>/wp-admin/images/ico-add.png" /></a> </dt>
+                                        </dl>
+                                        <?php
+                                        
+                                                //Do recursion
+                                                $counter = wp_custom_navigation_default_sub_items($itemid, $counter, $parent_id, $type, 'default');
+                                                
+                                        ?>
+                                </li>
+                                        
+                                <?php
+                        }
+                        
+                }
+                ?>
+                
+                </ul>
+                
+        <?php
+        }
+        
+        return $counter;
+
+}
+
+/*-----------------------------------------------------------------------------------*/
+/* Recursive get children */
+/*-----------------------------------------------------------------------------------*/
+
+function get_children_menu_elements($childof, $intCounter, $parentli, $type, $menu_id, $table_name) {
+
+        $counter = $intCounter;
+        
+        global $wpdb;
+        
+        
+        
+        //Get Sub Category Items                        
+        if ($type == 'categories')
+        {
+                $sub_args = array(
+                        'child_of' => $childof,
+                        'hide_empty' => false,
+                        'parent' => $childof);
+                $sub_array = get_categories($sub_args);        
+        }
+        //Get Sub Page Items
+        elseif ($type == 'pages')
+        {
+                $sub_args = array(
+                        'child_of' => $childof,
+                        'parent' => $childof);
+        
+                $sub_array = get_pages($sub_args);
+                
+        }
+        else {
+        
+        }
+        
+        if ($sub_array)
+        {
+                //DISPLAY Loop
+                foreach ($sub_array as $sub_item)
+                {
+                        if (isset($sub_item->parent)) {
+                                $sub_item_parent = $sub_item->parent;
+                        }
+                        elseif (isset($sub_item->post_parent)) {
+                                $sub_item_parent = $sub_item->post_parent;
+                        }
+                        else {
+                        }
+                        //Is child
+                        if ($sub_item_parent == $childof)
+                        {
+                                //Prepare Menu Data
+                                //Category Menu Item
+                                if ($type == 'categories')
+                                {
+                                        $link = get_category_link($sub_item->cat_ID);
+                                        $title = htmlentities($sub_item->cat_name);
+                                        $parent_id = $sub_item->category_parent;
+                                        $itemid = $sub_item->cat_ID;
+                                        $linktype = 'category';
+                                        $appendtype= 'Category';
+                                }
+                                //Page Menu Item
+                                elseif ($type == 'pages')
+                                {
+                                        $link = get_permalink($sub_item->ID);
+                                        $title = htmlentities($sub_item->post_title);
+                                        $parent_id = $sub_item->post_parent;
+                                        $linktype = 'page';
+                                        $itemid = $sub_item->ID;
+                                        $appendtype= 'Page';
+                                }
+                                //Custom Menu Item
+                                else
+                                {
+                                        $title = '';
+                                        $linktype = 'custom';
+                                        $appendtype= 'Custom';
+                                }
+                                
+                                //CHECK for existing parent records
+                                //echo $parent_id;
+                                $wp_result = $wpdb->get_results("SELECT id FROM ".$table_name." WHERE post_id='".$parent_id."' AND link_type='".$linktype."' AND menu_id='".$menu_id."'");
+                                if ($wp_result > 0 && isset($wp_result[0]->id)) {
+                                        $parent_id = $wp_result[0]->id;
+                                }
+                                else {
+                                        //$parent_id = 0;
+                                }
+                                
+                                //INSERT item
+                                $insert = "INSERT INTO ".$table_name." (position,post_id,parent_id,custom_title,custom_link,custom_description,menu_icon,link_type,menu_id,custom_anchor_title) "."VALUES ('".$counter."','".$itemid."','".$parent_id."','".$title."','".$link."','','','".$linktype."','".$menu_id."','".$title."')";
+                                 $results = $wpdb->query( $insert );
+        
+                                 $counter++;
+                                 $counter = get_children_menu_elements($itemid, $counter, $parent_id, $type, $menu_id, $table_name);
+                        }        
+                        //Do nothing
+                        else {
+                        
+                        }
+                }
+        }
+        return $counter;
+}
+
+
+?>
</ins></span></pre></div>
<a id="trunkwpincludesdefaultwidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/default-widgets.php (13256 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/default-widgets.php        2010-02-20 21:09:49 UTC (rev 13256)
+++ trunk/wp-includes/default-widgets.php        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -1001,6 +1001,379 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Custom Navigation widget class
+ *
+ * @since 3.0.0
+ */
+ class WP_CustomNavWidget extends WP_Widget {
+
+        function WP_CustomNavWidget() {
+                $widget_ops = array('description' => 'Use this widget to add one of your Custom Navigation Menus as a widget.' );
+                parent::WP_Widget(false, __('Custom Navigation Menu'),$widget_ops);
+        }
+
+        function widget($args, $instance) {
+                $navmenu = $instance['navmenu'];
+                $navtitle = $instance['navtitle'];
+                $navdeveloper = strtolower($instance['navdeveloper']);
+                $navdiv = strtolower($instance['navdiv']);
+                $navul = strtolower($instance['navul']);
+                $navdivid = $instance['navdivid'];
+                $navdivclass = $instance['navdivclass'];
+                $navulid = $instance['navulid'];
+                $navulclass = $instance['navulclass'];
+                
+                //Override for menu descriptions
+                $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options');
+                if ($advanced_option_descriptions == 'no')
+                {
+                        $navwidgetdescription = 2;
+                }
+                else
+                {
+                        $navwidgetdescription = $instance['navwidgetdescription'];
+                }
+                $menuexists = false;
+                
+                global $wpdb;
+                
+                //GET menu name
+                if ($navmenu > 0)
+                {
+                        $table_name_menus = $wpdb->prefix . "custom_nav_menus";
+                        $wp_result = $wpdb->get_results("SELECT menu_name FROM ".$table_name_menus." WHERE id='".$navmenu."'");
+                        $wp_custom_nav_menu_name = $wp_result[0]->menu_name;
+                        $menuexists = true;
+                }
+                //Do nothing
+                else
+                {
+                        $menuexists = false;
+                }
+                ?>
+                
+                <?php
+                        //DEVELOPER settings enabled
+                        if ($navdeveloper == 'yes')
+                        {
+                                //DISPLAY Custom DIV
+                                if ($navdiv == 'yes')
+                                {
+                                        ?>
+                                        <div id="<?php echo $navdivid; ?>" class="<?php echo $navdivclass; ?>">
+                                        <?php
+                                }
+                                //Do NOT display DIV
+                                else
+                                {
+                                        
+                                }
+                                
+                        }
+                        //DISPLAY default DIV
+                        else
+                        {
+                                ?>
+                                <div class="widget">
+                                <?php
+                        }
+                ?>
+                
+                        <h3><?php echo $navtitle; ?></h3>
+                        <?php
+                        
+                        if ($menuexists)
+                        {
+                                ?>
+                 <?php
+                 
+                 //DEVELOPER settings enabled
+                                if ($navdeveloper == 'yes')
+                                {
+                                        //DISPLAY Custom UL
+                                        if ($navul == 'yes')
+                                        {
+                                                ?>
+                                                <ul id="<?php echo $navulid; ?>" class="<?php echo $navulclass; ?>">
+                                                <?php
+                                        }
+                                        //Do NOT display UL
+                                        else
+                                        {
+                                                
+                                        }
+                                        
+                                }
+                                //DISPLAY default UL
+                                else
+                                {
+                                        ?>
+                                        <ul class="custom-nav">
+                                        <?php
+                                }
+                 
+                 ?>
+                                
+                                                <?php
+                                                        //DISPLAY custom navigation menu
+                                                        if (get_option('wp_custom_nav_menu') == 'true') {
+                                                 custom_nav('name='.$wp_custom_nav_menu_name.'&desc='.$navwidgetdescription);
+                                         }                                
+                                                ?>
+                                
+                                <?php
+                                
+                                        //DEVELOPER settings enabled
+                                        if ($navdeveloper == 'yes')
+                                        {
+                                                //DISPLAY Custom UL
+                                                if ($navul == 'yes')
+                                                {
+                                                        ?>
+                                                        </ul>
+                                                        <?php
+                                                }
+                                                //Do NOT display UL
+                                                else
+                                                {
+                                                        
+                                                }
+                                                
+                                        }
+                                        //DISPLAY default UL
+                                        else
+                                        {
+                                                ?>
+                                                </ul>
+                                                <?php
+                                        }
+                                        
+                                ?>
+                        <?php
+                        }
+                        else
+                        {
+                                echo "You have not setup the custom navigation widget correctly, please check your settings in the backend.";
+                        }
+                        ?>
+                <?php
+                        //DEVELOPER settings enabled
+                        if ($navdeveloper == 'yes')
+                        {
+                                //DISPLAY Custom DIV
+                                if ($navdiv == 'yes')
+                                {
+                                        ?>
+                                        </div>
+                                        <?php
+                                }
+                                //Do NOT display DIV
+                                else
+                                {
+                                        
+                                }
+                                
+                        }
+                        //DISPLAY default DIV
+                        else
+                        {
+                                ?>
+                                </div>
+                                <?php
+                        }
+                ?><!-- /#nav-container -->
+                        
+                        <?php
+        }
+
+        function update($new_instance, $old_instance) {
+                return $new_instance;
+        }
+
+        function form($instance) {
+                $navmenu = esc_attr($instance['navmenu']);
+                $navtitle = esc_attr($instance['navtitle']);
+                $navdeveloper = esc_attr($instance['navdeveloper']);
+                $navdiv = esc_attr($instance['navdiv']);
+                $navul = esc_attr($instance['navul']);
+                $navdivid = esc_attr($instance['navdivid']);
+                $navdivclass = esc_attr($instance['navdivclass']);
+                $navulid = esc_attr($instance['navulid']);
+                $navulclass = esc_attr($instance['navulclass']);
+                $navwidgetdescription = esc_attr($instance['navwidgetdescription']);
+                                
+                global $wpdb;
+                                
+                //GET Menu Items for SELECT OPTIONS         
+                $table_name_custom_menus = $wpdb->prefix . "custom_nav_menus";
+                $custom_menu_records = $wpdb->get_results("SELECT id,menu_name FROM ".$table_name_custom_menus);
+                
+                //CHECK if menus exist
+                if ($custom_menu_records > 0)
+                {
+                
+                        ?>
+                        
+                         <p>
+         <label for="<?php echo $this->get_field_id('navmenu'); ?>"><?php _e('Select Menu:'); ?></label>
+                                
+                                <select id="<?php echo $this->get_field_id('navmenu'); ?>" name="<?php echo $this->get_field_name('navmenu'); ?>">
+                                        <?php
+                                        
+                                        //DISPLAY SELECT OPTIONS
+                                        foreach ($custom_menu_records as $custom_menu_record)
+                                        {
+                                                if ($navmenu == $custom_menu_record->id) {
+                                                        $selected_option = 'selected="selected"';
+                                                }
+                                                else {
+                                                        $selected_option = '';
+                                                }
+                                                ?>
+                                                <option value="<?php echo $custom_menu_record->id; ?>" <?php echo $selected_option; ?>><?php echo $custom_menu_record->menu_name; ?></option>
+                                                <?php
+                                                
+                                        }
+                                        ?>
+                                </select>
+        
+                        </p>
+                        
+                        <p>
+                                
+                 <label for="<?php echo $this->get_field_id('navtitle'); ?>"><?php _e('Title:'); ?></label>
+                         <input type="text" name="<?php echo $this->get_field_name('navtitle'); ?>" value="<?php echo $navtitle; ?>" class="widefat" id="<?php echo $this->get_field_id('navtitle'); ?>" />
+                 </p>
+                
+                 <p>
+                        <?php
+                         $checked = strtolower($navdeveloper);
+                        ?>
+                        
+                        <label for="<?php echo $this->get_field_id('navdeveloper'); ?>"><?php _e('Advanced Options:'); ?></label><br />         
+                        <span class="checkboxes">
+                                 <label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navdeveloper'); ?>" name="<?php echo $this->get_field_name('navdeveloper'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
+                         <label>No</label><input type="radio" id="<?php echo $this->get_field_name('navdeveloper'); ?>" name="<?php echo $this->get_field_name('navdeveloper'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
+                        </span><!-- /.checkboxes -->
+                        
+                        </p>
+                
+                 <?php
+                
+                 //DEVELOPER settings
+                 if ($checked == 'yes')
+                 {
+                         ?>
+                         
+                         <p>
+                                <?php
+                                 $checked = strtolower($navdiv);
+                                ?>
+                                
+                                <label for="<?php echo $this->get_field_id('navdiv'); ?>"><?php _e('Wrap in container DIV:'); ?></label><br />        
+                                <span class="checkboxes">
+                                         <label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navdiv'); ?>" name="<?php echo $this->get_field_name('navdiv'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
+                                 <label>No</label><input type="radio" id="<?php echo $this->get_field_name('navdiv'); ?>" name="<?php echo $this->get_field_name('navdiv'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
+                                </span><!-- /.checkboxes -->
+                        
+                        </p>
+                        
+                        <?php
+                        
+                        if ($checked == 'yes')
+                        {
+                        
+                                ?>
+                                
+                                <p>
+                                
+                 <label for="<?php echo $this->get_field_id('navdivid'); ?>"><?php _e('DIV id:'); ?></label>
+                 <input type="text" name="<?php echo $this->get_field_name('navdivid'); ?>" value="<?php echo $navdivid; ?>" class="widefat" id="<?php echo $this->get_field_id('navdivid'); ?>" />
+                 </p>
+                 <p>
+                                
+                 <label for="<?php echo $this->get_field_id('navdivclass'); ?>"><?php _e('DIV class:'); ?></label>
+                 <input type="text" name="<?php echo $this->get_field_name('navdivclass'); ?>" value="<?php echo $navdivclass; ?>" class="widefat" id="<?php echo $this->get_field_id('navdivclass'); ?>" />
+                 </p>
+                                
+                                <?php
+                                
+                        }
+                        
+                        ?>
+                        
+                        <p>
+                                <?php
+                                 $checked = strtolower($navul);
+                                ?>
+                                
+                                <label for="<?php echo $this->get_field_id('navul'); ?>"><?php _e('Wrap in container UL:'); ?></label><br />         
+                                <span class="checkboxes">
+                                         <label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navul'); ?>" name="<?php echo $this->get_field_name('navul'); ?>" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
+                                 <label>No</label><input type="radio" id="<?php echo $this->get_field_name('navul'); ?>" name="<?php echo $this->get_field_name('navul'); ?>" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
+                                </span><!-- /.checkboxes -->
+                        
+                        </p>
+                        
+                        <?php
+                
+                        if ($checked == 'yes')
+                        {
+                        
+                                ?>
+                                
+                                <p>
+                                
+                 <label for="<?php echo $this->get_field_id('navulid'); ?>"><?php _e('UL id:'); ?></label>
+                 <input type="text" name="<?php echo $this->get_field_name('navulid'); ?>" value="<?php echo $navulid; ?>" class="widefat" id="<?php echo $this->get_field_id('navulid'); ?>" />
+                 </p>
+                 <p>
+                                
+                 <label for="<?php echo $this->get_field_id('navulclass'); ?>"><?php _e('UL class:'); ?></label>
+                 <input type="text" name="<?php echo $this->get_field_name('navulclass'); ?>" value="<?php echo $navulclass; ?>" class="widefat" id="<?php echo $this->get_field_id('navulclass'); ?>" />
+                 </p>
+                                
+                                <?php
+                                
+                        }
+                        
+                        ?>
+                        <?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?>
+                        <p <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?>>
+                        
+         <?php
+                                 $checked = strtolower($navwidgetdescription);
+                                ?>
+                                
+                                <label for="<?php echo $this->get_field_id('navwidgetdescription'); ?>"><?php _e('Show Top Level Descriptions:'); ?></label><br />         
+                                <span class="checkboxes">
+                                         <label>Yes</label><input type="radio" id="<?php echo $this->get_field_name('navwidgetdescription'); ?>" name="<?php echo $this->get_field_name('navwidgetdescription'); ?>" value="1" <?php if ($checked=='1') { echo 'checked="checked"'; } ?> />
+                                 <label>No</label><input type="radio" id="<?php echo $this->get_field_name('navwidgetdescription'); ?>" name="<?php echo $this->get_field_name('navwidgetdescription'); ?>" value="2" <?php if ($checked=='1') { } else { echo 'checked="checked"'; } ?> />
+                                </span><!-- /.checkboxes -->
+         </p>
+                         <?php
+                 }
+                 //Do nothing
+                 else
+                 {
+                         
+                 }
+                        
+                }
+                //Error message for menus not existing
+                else
+                {
+                        ?>
+                        <p>
+                         <label><?php _e('The Custom Navigation has not been configured correctly. Please check your Custom Navigation settings before adding this widget.'); ?></label>
+                        </p>
+                        <?php
+                }
+        }
+        
+}
+
+/**
</ins><span class="cx"> * Register all of the default WordPress widgets on startup.
</span><span class="cx"> *
</span><span class="cx"> * Calls 'widgets_init' action after all of the WordPress widgets have been
</span><span class="lines">@@ -1035,7 +1408,9 @@
</span><span class="cx">         register_widget('WP_Widget_RSS');
</span><span class="cx">
</span><span class="cx">         register_widget('WP_Widget_Tag_Cloud');
</span><del>-
</del><ins>+        
+        register_widget('WP_CustomNavWidget');
+        
</ins><span class="cx">         do_action('widgets_init');
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/general-template.php (13256 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/general-template.php        2010-02-20 21:09:49 UTC (rev 13256)
+++ trunk/wp-includes/general-template.php        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -2215,4 +2215,14 @@
</span><span class="cx">         return apply_filters( "get_the_generator_{$type}", $gen, $type );
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+/**
+ * Outputs the Custom Navigation.
+ *
+ * @since 3.0.0
+ */
+function custom_nav($args = array()) {
+        require_once (ABSPATH . WPINC . '/custom-navigation-functions.php');
+        wp_custom_navigation_output($args);
+}
+
</ins><span class="cx"> ?>
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (13256 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2010-02-20 21:09:49 UTC (rev 13256)
+++ trunk/wp-includes/post.php        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -63,6 +63,14 @@
</span><span class="cx">                                                                                         'query_var' => false,
</span><span class="cx">                                                                                 ) );
</span><span class="cx">
</span><ins>+        register_post_type( 'menu_item', array(        'public' => false,
+                                                                                        'show_ui' => false,
+                                                                                        '_builtin' => true,
+                                                                                        'capability_type' => 'post',
+                                                                                        'hierarchical' => false,
+                                                                                        'rewrite' => false,
+                                                                                        'query_var' => false,
+                                                                                ) );
</ins><span class="cx">         register_post_status( 'publish', array(        'label' => _x('Published', 'post'),
</span><span class="cx">                                                                                         'public' => true,
</span><span class="cx">                                                                                         '_builtin' => true,
</span><span class="lines">@@ -105,6 +113,18 @@
</span><span class="cx">                                                                                         '_builtin' => true,
</span><span class="cx">                                                                                         'label_count' => _n_noop('Auto-Draft <span class="count">(%s)</span>', 'Auto-Drafts <span class="count">(%s)</span>')
</span><span class="cx">                                                                                 ) );
</span><ins>+
+        register_post_status( 'menu-category', array(        'internal' => true,
+                                                                                        '_builtin' => true
+                                                                                ) );
+
+        register_post_status( 'menu-page', array(        'internal' => true,
+                                                                                        '_builtin' => true
+                                                                                ) );
+
+        register_post_status( 'menu-custom', array(        'internal' => true,
+                                                                                        '_builtin' => true
+                                                                                ) );
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'init', 'create_initial_post_types', 0 ); // highest priority
</span><span class="cx">
</span><span class="lines">@@ -4494,4 +4514,4 @@
</span><span class="cx">
</span><span class="cx">                 add_filter('the_preview', '_set_preview');
</span><span class="cx">         }
</span><del>-}
</del><span class="cx">\ No newline at end of file
</span><ins>+}
</ins></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (13256 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-02-20 21:09:49 UTC (rev 13256)
+++ trunk/wp-includes/script-loader.php        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -394,6 +394,21 @@
</span><span class="cx">                 ) );
</span><span class="cx">
</span><span class="cx">         }
</span><ins>+        
+        //Custom Navigation
+
+        $scripts->add( 'custom-navigation-jquery', '/wp-admin/js/custom-navigation-custom-jquery-1.3.2.js', false, '1.3.2' );
+                
+        $scripts->add( 'custom-navigation-ui-custom', '/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js', array('custom-navigation-jquery'), '1.7.2' );
+        $scripts->add_data( 'custom-navigation-ui-custom', 'group', 1 );
+        
+        $scripts->add( 'custom-navigation-autocomplete', '/wp-admin/js/custom-navigation-custom-jquery-autocomplete.js', array('custom-navigation-jquery'), '1.0.0' );
+        $scripts->add_data( 'custom-navigation-autocomplete', 'group', 1 );
+        
+        $scripts->add( 'custom-navigation-default-items', '/wp-admin/js/custom-navigation-default-items.js', false, '1.0.0' );
+        $scripts->add( 'custom-navigation-dynamic-functions', '/wp-admin/js/custom-navigation-dynamic-functions.js', false, '1.0.0' );
+        $scripts->add( 'custom-navigation-php-functions', '/wp-admin/js/custom-navigation-php-functions.js', false, '1.0.0' );
+        
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -459,7 +474,8 @@
</span><span class="cx">         $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
</span><span class="cx">         $styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
</span><span class="cx">         $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
</span><del>-
</del><ins>+        $styles->add( 'custom-navigation', "/wp-admin/css/custom-navigation$suffix.css", array(), '20100215' );
+        
</ins><span class="cx">         foreach ( $rtl_styles as $rtl_style )
</span><span class="cx">                 $styles->add_data( $rtl_style, 'rtl', true );
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpincludestaxonomyphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/taxonomy.php (13256 => 13257)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/taxonomy.php        2010-02-20 21:09:49 UTC (rev 13256)
+++ trunk/wp-includes/taxonomy.php        2010-02-20 21:57:43 UTC (rev 13257)
</span><span class="lines">@@ -38,6 +38,11 @@
</span><span class="cx">                                                                                                         '_builtin' => true
</span><span class="cx">                                                                                                 ) ) ;
</span><span class="cx">
</span><ins>+        register_taxonomy( 'menu', 'post', array(        'hierarchical' => false,
+                                                                                                                'query_var' => false,
+                                                                                                                'rewrite' => false
+                                                                                                        ) ) ;
+
</ins><span class="cx">         register_taxonomy( 'link_category', 'link', array(        'hierarchical' => false,
</span><span class="cx">                                                                                                                  'label' => __('Categories'),
</span><span class="cx">                                                                                                                 'query_var' => false,
</span></span></pre>
</div>
</div>
</body>
</html>