r95560 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95559‎ | r95560 | r95561 >
Date:15:44, 26 August 2011
Author:faurethomas
Status:deferred
Tags:
Comment:
new version 0.9.9
Modified paths:
  • /trunk/extensions/WikiTweet/WikiTweet.api.php (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.config.php (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.css (added) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.functions.php (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.i18n.php (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.js (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet.php (modified) (history)
  • /trunk/extensions/WikiTweet/WikiTweet2.js (modified) (history)
  • /trunk/extensions/WikiTweet/create_tables.sql (modified) (history)
  • /trunk/extensions/WikiTweet/jquery.js (modified) (history)
  • /trunk/extensions/WikiTweet/popup.css (added) (history)
  • /trunk/extensions/WikiTweet/popup.js (added) (history)

Diff [purge]

Index: trunk/extensions/WikiTweet/WikiTweet.i18n.php
@@ -44,6 +44,13 @@
4545 'wikitweet-subscribers' => 'Subscribers:',
4646 'wikitweet-hourly' => 'Hourly',
4747 'wikitweet-perperson' => 'Per person',
 48+ 'wikitweet-inresponseto' => 'In response to:',
 49+ 'wikitweet-from' => 'from',
 50+ 'wikitweet-in' => 'in',
 51+ 'wikitweet-directlink' => 'Direct link:',
 52+ 'wikitweet-mailsent' => 'mail sent',
 53+ 'wikitweet-viaroom' => 'via room',
 54+ 'wikitweet-alertsolved' => 'one of your alert was resolved in',
4855 );
4956
5057 /** Message documentation (Message documentation)
@@ -220,7 +227,7 @@
221228 'wikitweet-timeago' => 'Il y a $1',
222229 'wikitweet-inthefuture' => 'Dans le futur !!',
223230 'wikitweet-fewsecondsago' => 'Il y a quelques secondes',
224 - 'wikitweet-status' => 'Statut : ',
 231+ 'wikitweet-status' => 'Statut :',
225232 'wikitweet-status0' => 'Discussion',
226233 'wikitweet-status1' => 'Événement',
227234 'wikitweet-status2' => 'Attention',
@@ -231,6 +238,13 @@
232239 'wikitweet-subscribers' => 'Abonnés :',
233240 'wikitweet-hourly' => 'Heure par heure :',
234241 'wikitweet-perperson' => 'Par personne',
 242+ 'wikitweet-inresponseto' => 'En réponse à :',
 243+ 'wikitweet-from' => 'de',
 244+ 'wikitweet-in' => 'dans',
 245+ 'wikitweet-directlink' => 'Lien direct :',
 246+ 'wikitweet-mailsent' => 'mail envoyé',
 247+ 'wikitweet-viaroom' => 'via room',
 248+ 'wikitweet-alertsolved' => 'Une de vos alertes a été résolue dans la salle',
235249 );
236250
237251 /** Franco-Provençal (Arpetan)
Index: trunk/extensions/WikiTweet/WikiTweet.php
@@ -10,7 +10,7 @@
1111 *
1212 * @addtogroup Extensions
1313 * @author Thomas FAURÉ <faure dot thomas at gmail dot com> <@whiblog>
14 - * @copyright © 2010 Thomas FAURÉ
 14+ * @copyright © 2010-2011 Thomas FAURÉ
1515 * @licence GNU General Public Licence 3.0
1616 */
1717
@@ -36,7 +36,7 @@
3737 'author' => 'Thomas Fauré',
3838 'descriptionmsg' => 'wikitweet-desc',
3939 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiTweet',
40 - 'version' => '0.5.3'
 40+ 'version' => '0.9.0'
4141 );
4242
4343 $dir = dirname(__FILE__) . '/';
@@ -100,9 +100,106 @@
101101 return true;
102102 }
103103
 104+/**
 105+* Function which create tables if not exist
 106+* @global OBJECT $wgDBprefix;
 107+*/
 108+function tableCheck()
 109+{
 110+ global $wgDBprefix;
 111+ $dbr =& wfGetDB( DB_SLAVE );
 112+
 113+ // Check if 'approval_request' database tables exists
 114+ if (!$dbr->tableExists('wikitweet'))
 115+ {
 116+ $sql = "CREATE TABLE `".$wgDBprefix."wikitweet` (";
 117+ $sql .= "`id` int(11) NOT NULL auto_increment,";
 118+ $sql .= "`text` varchar(500) default NULL,";
 119+ $sql .= "`user` varchar(100) NOT NULL,";
 120+ $sql .= "`date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,";
 121+ $sql .= "`room` varchar(50) NOT NULL default 'main',";
 122+ $sql .= "`show` int(11) NOT NULL default '1',";
 123+ $sql .= "`status` int(11) NOT NULL default '1',";
 124+ $sql .= "`parent` int(11) default '0',";
 125+ $sql .= "`lastupdatedate` int(11) default '0',";
 126+ $sql .= "PRIMARY KEY (`id`)";
 127+ $sql .= ") ENGINE=InnoDB DEFAULT CHARSET=binary;";
 128+ $res = $dbr->query( $sql, __METHOD__ );
 129+ }
 130+ if (!$dbr->tableExists('wikitweet_alerts'))
 131+ {
 132+ $sql = "CREATE TABLE `".$wgDBprefix."wikitweet_alerts` (";
 133+ $sql .= "`id` int(11) NOT NULL auto_increment,";
 134+ $sql .= "`date` varchar(100) NOT NULL,";
 135+ $sql .= "`timestamp` int(11) NOT NULL,";
 136+ $sql .= "`attention` int(11) NOT NULL default '0',";
 137+ $sql .= "`alert` int(11) NOT NULL default '0',";
 138+ $sql .= "PRIMARY KEY (`id`)";
 139+ $sql .= ") ENGINE=InnoDB DEFAULT CHARSET=binary;";
 140+ $res = $dbr->query( $sql, __METHOD__ );
 141+ }
 142+ if (!$dbr->tableExists('wikitweet_alerts_persons'))
 143+ {
 144+ $sql = "CREATE TABLE `".$wgDBprefix."wikitweet_alerts_persons` (";
 145+ $sql .= "`id` int(11) NOT NULL auto_increment,";
 146+ $sql .= "`date` varchar(100) NOT NULL default '',";
 147+ $sql .= "`timestamp` int(11) NOT NULL default '0',";
 148+ $sql .= "`attention` int(11) NOT NULL default '0',";
 149+ $sql .= "`alert` int(11) NOT NULL default '0',";
 150+ $sql .= "`username` varchar(100) NOT NULL default '',";
 151+ $sql .= "PRIMARY KEY (`id`)";
 152+ $sql .= ") ENGINE=InnoDB DEFAULT CHARSET=binary;";
 153+ $res = $dbr->query( $sql, __METHOD__ );
 154+ }
 155+ if (!$dbr->tableExists('wikitweet_avatar'))
 156+ {
 157+ $sql = "CREATE TABLE `".$wgDBprefix."wikitweet_avatar` (";
 158+ $sql .= "`id` int(11) NOT NULL auto_increment,";
 159+ $sql .= "`user` varchar(200) NOT NULL,";
 160+ $sql .= "`avatar` varchar(1000) NOT NULL,";
 161+ $sql .= "PRIMARY KEY (`id`)";
 162+ $sql .= ") ENGINE=InnoDB DEFAULT CHARSET=binary;";
 163+ $res = $dbr->query( $sql, __METHOD__ );
 164+ }
 165+ if (!$dbr->tableExists('wikitweet_charge'))
 166+ {
 167+ $sql = "CREATE TABLE `".$wgDBprefix."wikitweet_charge` (";
 168+ $sql .= "`id` int(11) NOT NULL auto_increment,";
 169+ $sql .= "`chantier` varchar(200) NOT NULL,";
 170+ $sql .= "`jalon` varchar(1000) NOT NULL,";
 171+ $sql .= "`charge` int(11) NOT NULL,";
 172+ $sql .= "PRIMARY KEY (`id`)";
 173+ $sql .= ") ENGINE=InnoDB DEFAULT CHARSET=binary;";
 174+ $res = $dbr->query( $sql, __METHOD__ );
 175+ }
 176+ if (!$dbr->tableExists('wikitweet_responsibles'))
 177+ {
 178+ $sql = "CREATE TABLE `".$wgDBprefix."wikitweet_responsibles` (";
 179+ $sql .= "`id` int(11) NOT NULL auto_increment,";
 180+ $sql .= "`ref` varchar(100) NOT NULL default '',";
 181+ $sql .= "`title` varchar(300) NOT NULL default '',";
 182+ $sql .= "`responsible` varchar(100) NOT NULL default '',";
 183+ $sql .= "PRIMARY KEY (`id`)";
 184+ $sql .= ") ENGINE=InnoDB DEFAULT CHARSET=binary;";
 185+ $res = $dbr->query( $sql, __METHOD__ );
 186+ }
 187+ if (!$dbr->tableExists('wikitweet_subscription'))
 188+ {
 189+ $sql = "CREATE TABLE `".$wgDBprefix."wikitweet_subscription` (";
 190+ $sql .= "`id` int(11) NOT NULL auto_increment,";
 191+ $sql .= "`user` varchar(50) NOT NULL,";
 192+ $sql .= "`link` varchar(50) NOT NULL,";
 193+ $sql .= "`type` varchar(10) NOT NULL,";
 194+ $sql .= "PRIMARY KEY (`id`)";
 195+ $sql .= ") ENGINE=InnoDB DEFAULT CHARSET=binary;";
 196+ $res = $dbr->query( $sql, __METHOD__ );
 197+ }
 198+}
 199+
104200 // The actual processing
105201 function wikiTweeterRender($input, $args, $parser)
106202 {
 203+ tableCheck();
107204 // Imports
108205 global $wgOut;
109206 global $wgUser;
@@ -142,33 +239,104 @@
143240 $avatar = substr($avatar,0,$pos_guill);
144241 }
145242 // Check Avatar table
146 - $res2 = $dbr->select('wikitweet_avatar','*',"user='".mysql_real_escape_string($user)."' ",__METHOD__,false);
 243+ $res2 = $dbr->select('wikitweet_avatar','*',"user='".str_replace(' ','_',mysql_real_escape_string($user))."' ",__METHOD__,false);
147244 if ($dbr->numRows( $res2 ) == 0){
148 - $res4 = $dbr->insert('wikitweet_avatar',array('`id`'=>'','`user`'=>$user,'`avatar`'=>$avatar));
 245+ $res4 = $dbr->insert('wikitweet_avatar',array('`id`'=>'','`user`'=>str_replace(' ','_',mysql_real_escape_string($user)),'`avatar`'=>$avatar));
149246 }
150247 else {
151 - $res5 = $dbr->update('wikitweet_avatar',array('avatar'=>$avatar),array('user'=>mysql_real_escape_string($user)));
 248+ $res5 = $dbr->update('wikitweet_avatar',array('avatar'=>$avatar),array('user'=>str_replace(' ','_',mysql_real_escape_string($user))));
152249 }
153250 }
154 - $class = ($args["class"]) ? $args["class"] : "wiki-tweets";
155 - $size = ($args["size"]) ? $args["size"] : "normal" ;
156 - $rows = ($args["rows"]) ? $args["rows"] : "10" ;
157 - $room = ($args["room"]) ? $args["room"] : "main" ;
158 -
159 -
160 - $text = "<style type='text/css'>
161 - .handmouse {
162 - cursor:pointer;
 251+ $class = ($args["class"]) ? $args["class"] : "wiki-tweets";
 252+ $size = ($args["size"]) ? $args["size"] : "normal" ;
 253+ $rows = ($args["rows"]) ? $args["rows"] : $wgWikiTweet["rows"] ;
 254+ $room = ($args["room"]) ? $args["room"] : "main" ;
 255+ $allowstatus = (isset($args["status"])) ? true : false ;
 256+ $alertslevel = ($args["alertslevel"]) ? $args["alertslevel"] : "1" ;
 257+
 258+
 259+ // [GRAPH]
 260+ $text = '';
 261+ if($alertslevel=="2")
 262+ {
 263+ $res2 = $dbr->select('wikitweet_alerts','*',false,__METHOD__,array('ORDER BY' => '`timestamp` DESC'));
 264+ $chd_attention = '';
 265+ $chd_alert = '';
 266+ $chxl = '';
 267+ $max = 20;
 268+ $i = 0;
 269+ $alertsarray = array();
 270+ $sum_max = 0;
 271+ while($row2= $dbr->fetchObject($res2)){
 272+ $i += 1;
 273+ if($i<=$max){
 274+ $alertsarray[$row2->date] = array($row2->attention,$row2->alert);
 275+ if(intval($row2->attention)+intval($row2->alert)>$sum_max){
 276+ $sum_max = intval($row2->attention)+intval($row2->alert)+1;
 277+ }
 278+ $chd_attention .= $row2->attention.',';
 279+ $chd_alert .= $row2->alert.',';
 280+ $chxl = '|'.$row2->date.'h'.$chxl;
163281 }
164 - </style>";
165 -
166 - $text .= "<div class='$class'";
167 -
168 - if ($args["style"])
169 - $text .= " style='" . $args["style"]. "'";
170 - $text .= ">";
171 -
172 - $room_subscribe_text = "<a id='room_subscribe' class='handmouse' style='display:none;'>".wfMsg('wikitweet-subscribe')."</a><a id='room_unsubscribe' class='handmouse'>".wfMsg('wikitweet-unsubscribe')."</a>";
 282+ }
 283+
 284+ $chd_attention = substr($chd_attention, 0, -1);
 285+ $chd_alert = substr($chd_alert, 0, -1);
 286+ $text .="<h2>".wfMsg('wikitweet-hourly')."</h2>
 287+ <p style='text-align:center;'><img src='https://chart.googleapis.com/chart?chs=300x400&amp;
 288+ cht=bhs&amp;
 289+ chco=FF9933,FF0000&amp;
 290+ chds=0,$sum_max&amp;
 291+ chxt=y&amp;
 292+ chts=000000,15&amp;
 293+ chd=t:$chd_attention|$chd_alert&amp;
 294+ chbh=r,.6&amp;
 295+ chm=N,000000,0,,12,,c|N,000000,1,,12,,c&amp;
 296+ chxl=0:$chxl
 297+ '></p>";
 298+
 299+ if (false) {
 300+ // NOT YET IMPLEMENTED
 301+ $text .= "<h2>".wfMsg('wikitweet-perperson')."</h2>";
 302+
 303+ $res3 = $dbr->select('wikitweet_alerts_persons','*','`timestamp` IN (SELECT MAX(`timestamp`) FROM '.$dbr->tableName('wikitweet_alerts_persons').')',__METHOD__);
 304+
 305+ $chd_attention = '';
 306+ $chd_alert = '';
 307+ $chxl = '';
 308+ $sum_max = 0;
 309+ while($row3 = $dbr->fetchObject($res3)){
 310+ if(intval($row3->attention)+intval($row3->alert)>$sum_max){
 311+ $sum_max = intval($row3->attention)+intval($row3->alert)+1;
 312+ }
 313+ $chd_attention .= $row3->attention.',';
 314+ $chd_alert .= $row3->alert.',';
 315+ $chxl = '|'.$row3->username.$chxl;
 316+ }
 317+
 318+ $chd_attention = substr($chd_attention, 0, -1);
 319+ $chd_alert = substr($chd_alert, 0, -1);
 320+ $text .="
 321+ <p style='text-align:center;'><img src='https://chart.googleapis.com/chart?chs=300x400&amp;
 322+ cht=bhs&amp;
 323+ chco=FF9933,FF0000&amp;
 324+ chds=0,$sum_max&amp;
 325+ chxt=y&amp;
 326+ chts=000000,15&amp;
 327+ chd=t:$chd_attention|$chd_alert&amp;
 328+ chbh=r,.6&amp;
 329+ chm=N,000000,0,,12,,c|N,000000,1,,12,,c&amp;
 330+ chxl=0:$chxl
 331+ '></p>";
 332+ }
 333+ }
 334+
 335+ // [/GRAPH]
 336+
 337+ // $uniqueid = md5($room);
 338+ $uniqueid = rand(1,9999);
 339+ $text .= "<div class='$class'". (($args["style"]) ? " style='" . $args["style"]. "'" : '').">";
 340+ $room_subscribe_text = "<a class='room_subscribe handmouse' uniqueid='$uniqueid' style='display:none;'>".wfMsg('wikitweet-subscribe')."</a><a class='room_unsubscribe handmouse' uniqueid='$uniqueid'>".wfMsg('wikitweet-unsubscribe')."</a>";
173341 if($room!='main'){
174342 $res6 = $dbr->select(
175343 'wikitweet_subscription',
@@ -181,35 +349,52 @@
182350 __METHOD__,false
183351 );
184352 if ($dbr->numRows( $res6 ) == 0){
185 - $room_subscribe_text = "<a id='room_subscribe' class='handmouse'>".wfMsg('wikitweet-subscribe')."</a><a id='room_unsubscribe' style='display:none;' class='handmouse'>".wfMsg('wikitweet-unsubscribe')."</a>";
 353+ $room_subscribe_text = "<a class='room_subscribe handmouse' uniqueid='$uniqueid'>".wfMsg('wikitweet-subscribe')."</a><a style='display:none;' class='room_unsubscribe handmouse' uniqueid='$uniqueid'>".wfMsg('wikitweet-unsubscribe')."</a>";
186354 }
187 - $text .= "<p>".wfMsg('wikitweet-intheroom')." <b>$room</b> (<span id='id_room_subscribe'>$room_subscribe_text<span id='tempimg'></span></span>)</p>";
 355+ $text .= "<p>".wfMsg('wikitweet-intheroom')." <b>$room</b> (<span id='id_room_subscribe_$uniqueid'>$room_subscribe_text<span id='tempimg_$uniqueid'></span></span>)</p>";
188356 }
189357
190 - $text .= '<form id="status_update_form">';
191 -
 358+ $text .= '<form class="status_update_form" uniqueid="'.$uniqueid.'" style="'.(($alertslevel!='1') ? 'display:none;' : '').'">';
 359+ $text .= '<INPUT type=hidden NAME="alertslevel" value="'.$alertslevel.'"/>';
192360 if ($wgUser->isLoggedIn() or $wgWikiTweet['allowDisconnected']){
193361 $text .= '
194362 <table width=100%>
195363 <tr><td width=95%>
196 - <textarea tabindex="1" autocomplete="off" accesskey="u" name="status" id="status" rows="2" cols="40"></textarea>
 364+ <textarea tabindex="1" autocomplete="off" accesskey="u" name="status" id="status" rows="3" cols="40"></textarea>
197365 </td>
198366 <td width=5%>
199 - <div id="stringlength"><span>140</span></div>
 367+ <div class="stringlength"> <span>500</span></div>
200368 </td></tr>
201 - </table>
202 - <INPUT TYPE=submit NAME=submit VALUE="'.wfMsg('wikitweet-submit').'" onclick="return false"/>';
 369+ </table>';
 370+ if ( $allowstatus )
 371+ {
 372+ $text .= '
 373+ <label>'.wfMsg('wikitweet-status').'</label>
 374+ <select name="bstatus" size="1">
 375+ <option selected="" value="0">'.wfMsg('wikitweet-status0').'</option>
 376+ <option value="1">'.wfMsg('wikitweet-status1').'</option>
 377+ <option value="2">'.wfMsg('wikitweet-status2').'</option>
 378+ <option value="3">'.wfMsg('wikitweet-status3').'</option>
 379+ </select><br/>' ;
 380+ }
 381+ else
 382+ {
 383+ $text .= '<input type=hidden value="1" name="bstatus"/>';
 384+ }
 385+ $text .= '<input type=submit name=submit value="'.wfMsg('wikitweet-submit').'" onclick="return false" uniqueid="'.$uniqueid.'"/>';
203386 if($wgWikiTweet['allowAnonymous']){
204 - $text .= '<INPUT TYPE=submit NAME=submitanonymously VALUE="'.wfMsg('wikitweet-anonymous').'" onclick="return false" style="font-size:0.8em;" />';
 387+ $text .= '<INPUT type=submit name=submitanonymously value="'.wfMsg('wikitweet-anonymous').'" onclick="return false" style="font-size:0.8em;" uniqueid="'.$uniqueid.'" />';
205388 }
206389 if (in_array($wgUser->getName(), $wgWikiTweet['informers']))
207390 {
208 - $text .= '<INPUT TYPE=submit NAME=submitbyinformer VALUE="'.wfMsg('wikitweet-inform').'" onclick="return false" style="font-size:0.8em;" />';
 391+ $text .= '<input type=submit name=submitbyinformer value="'.wfMsg('wikitweet-inform').'" onclick="return false" style="font-size:0.8em;" uniqueid="'.$uniqueid.'" />';
209392 }
210 - $text .= '<INPUT TYPE=submit NAME=submitandmail VALUE="'.wfMsg('wikitweet-submitandmail').'" onclick="return false" style="display:none;font-size:0.8em;"/>';
211 - $text .= '<INPUT TYPE=submit NAME=submitprivate VALUE="'.wfMsg('wikitweet-private').'" onclick="return false" style="display:none;font-size:0.8em;"/>
212 - <img id ="img_loader" src="'.$wgScriptPath.'/extensions/WikiTweet/images/ajax-loader-mini.gif" style ="padding: 0 5px 0 5px;display:none;"/>
213 - ';
 393+ if($wgWikiTweet['tweetandemail']){
 394+ $text .= '<input type=submit name=submitandmail value="'.wfMsg('wikitweet-submitandmail').'" onclick="return false" style="display:none;font-size:0.8em;" uniqueid="'.$uniqueid.'"/>';
 395+ }
 396+ $text .= '<input type=submit name=submitprivate value="'.wfMsg('wikitweet-private').'" onclick="return false" style="display:none;font-size:0.8em;" uniqueid="'.$uniqueid.'"/>';
 397+
 398+ $text .= '<img class="img_loader" src="'.$wgScriptPath.'/extensions/WikiTweet/images/ajax-loader-mini.gif" style ="padding: 0 5px 0 5px;display:none;"/>';
214399 }
215400 else{
216401 $text.="<p>".wfMsg('wikitweet-pleaselogin')."</p>";
@@ -219,18 +404,42 @@
220405 <input type=hidden value="'.$rows.'" name="rows"/>
221406 <input type=hidden value="'.$room.'" name="room"/>
222407 </form>';
 408+
223409 $text .= '<script type="text/javascript" src="'.$wgScriptPath.'/extensions/WikiTweet/jquery.js"></script>';
 410+
 411+ $text .= '<script type="text/javascript" src="'.$wgScriptPath.'/extensions/WikiTweet/popup.js"></script>';
 412+ $text .= '<link rel="stylesheet" type="text/css" href="'.$wgScriptPath.'/extensions/WikiTweet/popup.css" media="screen" />';
 413+ $text .= '<link rel="stylesheet" type="text/css" href="'.$wgScriptPath.'/extensions/WikiTweet/WikiTweet.css" media="screen" />';
224414 $text .= '<script type="text/javascript">wgScriptPath = "'.$wgScriptPath.'";</script>';
225415 $text .= '<script type="text/javascript">var refreshTime='.$wgWikiTweet['refreshTime'].';</script>';
226416 $text .= '<script type="text/javascript">var InformerUser="'.$wgWikiTweet['informuser'].'";</script>';
227417 $text .= '<script type="text/javascript">var AnonymousUser="'.$wgWikiTweet['AnonymousUser'].'";</script>';
228418 $text .= '<script type="text/javascript" src="'.$wgScriptPath.'/extensions/WikiTweet/WikiTweet.js"></script>';
229419 $text .= '<script type="text/javascript" src="'.$wgScriptPath.'/extensions/WikiTweet/WikiTweet2.js"></script>';
230 - $text .= "<br/>\n";
 420+ $text .= '<script type="text/javascript">$(document).ready(function() {gettweets("'.$uniqueid.'");});</script>';
 421+
 422+ $roomssons = array();
 423+ $sql_subscriptions = '';
 424+ foreach(WikiTweetFunctions::_getParentsRoom($room,$wgWikiTweet['inherit']) as $roomparent)
 425+ {
 426+ $sql_subscriptions .= " OR (wt.link = '$roomparent' AND wt.type='room')";
 427+ }
 428+ $sql1 = "SELECT DISTINCT {$wgDBprefix}user.user_real_name,{$wgDBprefix}user.user_name FROM {$wgDBprefix}user,{$wgDBprefix}wikitweet_subscription wt WHERE wt.user={$wgDBprefix}user.user_name AND ((wt.link = '$room' AND wt.type='room'){$sql_subscriptions}) ;";
 429+ $res1 = $dbr->query( $sql1, __METHOD__ );
 430+ $text .= "<p><b>".wfMsg('wikitweet-subscribers')."</b> ";
 431+ while($row1 = $dbr->fetchObject($res1)){
 432+ $user_real_name = $row1->user_real_name;
 433+ $text .= " <a href = '$wgScriptPath/index.php/Utilisateur:{$row1->user_name}'>{$row1->user_real_name}</a>, ";
 434+ }
 435+ $text = substr($text, 0, -2);
 436+ $text .= "</p>";
 437+
 438+
231439 $text .= "<a href = '$wgScriptPath/index.php/".wfMsg('wikitweet-name')."'>".wfMsg('wikitweet-moretweets')."</a><br/>\n";
232 - $text .= "<div id='lasttweets'>\n";
 440+ $text .= "<div id='lasttweets_$uniqueid' class='lasttweets' uniqueid='$uniqueid'>\n";
233441 $text .= "</div>\n";
234442 $text .= "<a href = '$wgScriptPath/index.php/".wfMsg('wikitweet-name')."'>".wfMsg('wikitweet-name')."</a> ".wfMsg('wikitweet-infoajax')."<br/>\n";
 443+
235444 $text .= "</div>\n";
236445
237446 // Finish up and return the results
Index: trunk/extensions/WikiTweet/WikiTweet.css
@@ -0,0 +1,89 @@
 2+.bstatus1 {
 3+ background-color:#EEEEFF!important;
 4+}
 5+
 6+.bstatus2 {
 7+ background-color:#FF9933!important;
 8+}
 9+.bstatus2 span {
 10+ font-weight:bold!important;
 11+}
 12+.bstatus2 .tweetuser {
 13+ color:#663300!important;
 14+}
 15+.bstatus2 small, .bstatus2 small a {
 16+ color:#444!important;
 17+ font-weight:normal!important;
 18+}
 19+
 20+
 21+
 22+.bstatus3 {
 23+ background-color:#FF1111!important;
 24+}
 25+.bstatus3 span {
 26+ /*font-weight:bold!important;*/
 27+ color:#FFFFEE!important;
 28+ /*font-size:17px!important;*/
 29+}
 30+
 31+.bstatus3 span a {
 32+ color:#FFFF99!important;
 33+}
 34+.bstatus3 .tweetuser {
 35+ color:#FFFF99!important;
 36+}
 37+.bstatus3 small, .bstatus3 small a {
 38+ color:#FFFFCC!important;
 39+ font-weight:normal!important;
 40+ /*font-size:12px!important;*/
 41+}
 42+
 43+
 44+li.tweet_li{
 45+ display: list-item;
 46+ margin:0;
 47+ position:relative;
 48+ border:3px solid #FFF;
 49+ border-bottom:1px solid #CCC;
 50+}
 51+.span-a {
 52+ display:block;
 53+ left: 0;
 54+ margin: 0 10px 0 0;
 55+ overflow: hidden;
 56+ position: absolute;
 57+ z-index: 10;
 58+}
 59+.span-b {
 60+ display: block;
 61+ margin-left: 56px;
 62+ overflow: hidden;
 63+}
 64+.childsul{
 65+ list-style-image: none;
 66+ list-style-position: outside;
 67+ list-style-type: none;
 68+ background:#EEEEEE;
 69+}
 70+li.tweet_li_child{
 71+ display: list-item;
 72+ margin:0;
 73+ position:relative;
 74+ border:3px solid #FFF;
 75+ color:black!important;
 76+}
 77+.tweet_li_child span{
 78+ color:black!important;
 79+
 80+}
 81+.bstatus3 .tweet_li_child span{
 82+ /*font-size:14px!important;*/
 83+}
 84+.tweet_li_child span a, .tweet_li_child .tweetuser{
 85+ color:#0645AD!important;
 86+}
 87+.spancomment:hover{
 88+ text-decoration:underline;
 89+}
 90+.handmouse {cursor:pointer;}
\ No newline at end of file
Index: trunk/extensions/WikiTweet/WikiTweet.config.php
@@ -1,25 +1,39 @@
22 <?php
33 $wgWikiTweet = array(
44 // User roles configuration :
5 - 'informuser' => "Informer",
6 - 'informers' => array("Faure.thomas","user2"),
7 - 'admin' => array("Faure.thomas"),
 5+ 'informuser' => "Informer", // A special generic user, who informs
 6+ 'informers' => array("Admin","WikiSysop"), // Who are allowed to post instead of the "Informer"
 7+ 'admin' => array("Admin"), // Who are the wikitweet administrators
88 'allowAnonymous' => True, // Is it possible to tweet anonymously ?
99 'AnonymousUser' => 'Anonymous', // Who is the "Anonymous user" (fictive user)
1010 'allowDisconnected' => False, // Is it possible to post tweet when not log in ?
1111 'refreshTime' => 15000, // Time to refresh in milliseconds
 12+ 'textlength' => 500, // Tweet text length (140 by default)
 13+ 'dateformat' => 'H:i, F jS', // 'H:i, F jS' by default
 14+ 'alertroom' => 'alerts', // alert room name
 15+ 'showsubscriptions' => 0, // Show subscriptions to a room
 16+ 'rows' => 100, // How mant rows to display in a timeline
 17+ 'roomlink' => 'Discussion:' , // Prefix for the link of a room
 18+ 'tweetandemail' => True, // Allow forced "email" sending
1219
1320 // SMTP configuration :
14 - 'email'=> True, // True or False
15 - 'SMTP' => array(
16 - 'host' => "smtphost", //could also be an IP address
17 - 'IDHost' => "idhost",
 21+ 'email'=> true, // Allow email sending
 22+ 'SMTP' => array( // SMTP configuration
 23+ 'host' => "localhost", //could also be an IP address
 24+ 'IDHost' => "",
1825 'port' => 25,
1926 'auth' => false,
2027 'username'=> "",
2128 'password'=> ""
2229 ),
23 - 'wikimail' => 'admin@wikitweet',
 30+ 'wikimail' => 'wikitweet@yourdomain.com', // generic sender email
 31+ 'wikimail-concerns' => 'wikitweet-concerns@yourdomain.com',
 32+ 'wikimails' => array(
 33+ '0' => 'wikitweet@yourdomain.com',
 34+ '1' => 'wikitweet@yourdomain.com',
 35+ '2' => 'wikitweet-attention@yourdomain.com',
 36+ '3' => 'wikitweet-alert@yourdomain.com'
 37+ ),
2438
2539 // Size CSS configuration :
2640 'size' => array(
@@ -30,6 +44,12 @@
3145 'span_avatar_width' => '50px',
3246 'paddingli' => '10px 0 8px',
3347 'margin_left' => '0px',
 48+ 'child_line_height' => '13px', // Height of a tweet line
 49+ 'child_font_size' => '12px',
 50+ 'child_avatar_size' => '35', // Size of the avatar picture (in px)
 51+ 'child_span_avatar_width' => '37px',
 52+ 'child_paddingli' => '5px 0 3px',
 53+ 'child_margin_left' => '20px',
3454 ),
3555 'medium' => array(
3656 'line_height' => '13px',
@@ -38,6 +58,12 @@
3959 'span_avatar_width' => '37px',
4060 'paddingli' => '5px 0 3px',
4161 'margin_left' => '0px',
 62+ 'child_line_height' => '13px',
 63+ 'child_font_size' => '11px',
 64+ 'child_avatar_size' => '35',
 65+ 'child_span_avatar_width' => '37px',
 66+ 'child_paddingli' => '5px 0 3px',
 67+ 'child_margin_left' => '15px',
4268 ),
4369 'small' => array(
4470 'line_height' => '13px',
@@ -46,10 +72,26 @@
4773 'span_avatar_width' => '37px',
4874 'paddingli' => '5px 0 3px',
4975 'margin_left' => '0px',
 76+ 'child_line_height' => '12px',
 77+ 'child_font_size' => '10px',
 78+ 'child_avatar_size' => '28',
 79+ 'child_span_avatar_width' => '30px',
 80+ 'child_paddingli' => '5px 0 3px',
 81+ 'child_margin_left' => '10px',
5082 ),
5183 ),
52 - 'inherit' => array(
53 - 'main' => array('room1','room2','room3')
54 - )
 84+ 'inherit' => array( // inherit tree description
 85+ 'main' => array('room1','room2','room3'),
 86+ 'room1' => array('room1.1'),
 87+ 'room3' => array('room3.1','room3.2')
 88+ ),
 89+ 'titles' => array( // Aliases for the rooms
 90+ "room1" => "Title room 1",
 91+ "room1.1" => "Title room 1.1",
 92+ "room2" => "Title room 2",
 93+ "room3" => "Title room 3",
 94+ "room3.1" => "Title room 3.1",
 95+ "room3.2" => "Title room 3.2"
 96+ )
5597 );
5698 ?>
Index: trunk/extensions/WikiTweet/WikiTweet.js
@@ -1,139 +1,157 @@
2 -var g__timer;
3 -function gettweets() {
4 - var l__size = $("#status_update_form input[name=size]").val();
5 - var l__rows = $("#status_update_form input[name=rows]").val();
6 - var l__room = $("#status_update_form input[name=room]").val();
7 - var l__user = $("#status_update_form input[name=user]").val();
8 - $("#img_loader").css("display","inline");
9 - $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=get&wtwrows="+l__rows+"&wtwroom="+l__room+"&wtwuser="+l__user+"&wtwsize="+l__size,
10 - function(data) {
11 - $.each(data.query.wikitweet, function(i,item){
12 - $("#img_loader").css("display","none");
13 - $("#lasttweets").html(item);
14 - if (g__timer) clearTimeout(g__timer);
15 - g__timer = setTimeout(gettweets, refreshTime);
16 - });
17 - }
18 - );
19 -}
20 -function gettweets_with_tag(i__tag) {
21 - var l__size = $("#status_update_form input[name=size]").val();
22 - var l__rows = $("#status_update_form input[name=rows]").val();
23 - var l__room = $("#status_update_form input[name=room]").val();
24 - var l__user = $("#status_update_form input[name=user]").val();
25 - $("#img_loader").css("display","inline");
26 - $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=get&wtwrows="+l__rows+"&wtwroom="+l__room+"&wtwuser="+l__user+"&wtwsize="+l__size+"&wtwtag="+i__tag,
27 - function(data) {
28 - $.each(data.query.wikitweet, function(i,item){
29 - $("#img_loader").css("display","none");
30 - $("#lasttweets").html(item);
31 - if (g__timer) clearTimeout(g__timer);
32 - });
33 - }
34 - );
35 -}
36 -function gettweets_from_room(i__room) {
37 - var l__size = escape ( $("#status_update_form input[name=size]").val() ) ;
38 - var l__rows = escape ( $("#status_update_form input[name=rows]").val() ) ;
39 - var l__room = escape ( $("#status_update_form input[name=room]").val() ) ;
40 - var l__user = escape ( $("#status_update_form input[name=user]").val() ) ;
41 - $("#img_loader").css("display","inline");
42 - $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=get&wtwrows="+l__rows+"&wtwroom="+l__room+"&wtwuser="+l__user+"&wtwsize="+l__size+"&wtwother_room="+i__room,
43 - function(data) {
44 - $.each(data.query.wikitweet, function(i,item){
45 - $("#img_loader").css("display","none");
46 - $("#lasttweets").html(item);
47 - if (g__timer) clearTimeout(g__timer);
48 - });
49 - }
50 - );
51 -}
52 -function updatetweet(i__mail, i__userused){
53 - var l__status = escape( $("#status_update_form textarea[name=status]").val() ) ;
54 - var l__room = escape( $("#status_update_form input[name=room]").val() ) ;
55 - $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=update&wtwstatus="+l__status+"&wtwuser="+i__userused+"&wtwroom="+l__room+"&wtwtomail="+i__mail,
56 - function(data) {
57 - $("#status_update_form textarea[name=status]").val("");
58 - $("#stringlength").html("<span>140</span>");
59 - gettweets();
60 - }
61 - );
62 -}
63 -gettweets();
64 -$(document).ready(function() {
65 - $("textarea[name=status]").keyup(function() {
66 - len = $("#status_update_form textarea[name=status]").val().length;
67 - addcolor = "";
68 - if (len >= 140){
69 - addcolor = " style='color:red;' ";
70 - }
71 - len2 = 140-len;
72 - $("#stringlength").html("<span"+addcolor+">"+len2+"</span>");
73 - if ($("textarea[name=status]").val().indexOf("@") != -1){
74 - //status contains @ character
75 - $("input[name=submitandmail]").css("display","inline");
76 - $("input[name=submitprivate]").css("display","inline");
77 - }
78 - else if($("input[name=submitandmail]").css("display")=="inline"){
79 - $("input[name=submitandmail]").css("display","none");
80 - $("input[name=submitprivate]").css("display","none");
81 - }
82 -
83 - });
84 - function submit(mail, userused){
85 - if(userused == ''){
86 - userused = $("#status_update_form input[name=user]").val();
87 - }
88 - $("input[name=submitandmail]").css("display","none");
89 - $("input[name=submitprivate]").css("display","none");
90 - len = $("#status_update_form textarea[name=status]").val().length;
91 - if (len > 140){
92 - alert('Reduce your message to 140 characters max.');
93 - }
94 - else if (len == 0){
95 - gettweets();
96 - }
97 - else {
98 - updatetweet(mail, userused);
99 - }
 2+if(!alreadydeclared)
 3+{
 4+ var alreadydeclared = true;
 5+ var g__timer = {};
 6+ var g__cycle = true;
 7+ function gettweets(i__uniqueid) {
 8+ var l__size = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=size]").val();
 9+ var l__rows = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=rows]").val();
 10+ var l__room = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=room]").val();
 11+ var l__user = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=user]").val();
 12+ var l__bstatus = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=alertslevel]").val();
 13+ $(".status_update_form[uniqueid="+i__uniqueid+"] .img_loader").css("display","inline");
 14+ var l__query = wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=get&wtwrows="+l__rows+"&wtwroom="+l__room+"&wtwuser="+l__user+"&wtwsize="+l__size+"&wtwbstatus="+l__bstatus;
 15+ $.getJSON(l__query,
 16+ function(data) {
 17+ $.each(data.query.wikitweet, function(i,item){
 18+ $(".status_update_form[uniqueid="+i__uniqueid+"] .img_loader").css("display","none");
 19+ if(g__cycle==true){
 20+ $("#lasttweets_"+i__uniqueid).html(item);
 21+ }
 22+ if (g__timer['_'+i__uniqueid]) clearTimeout(g__timer['_'+i__uniqueid]);
 23+ g__timer['_'+i__uniqueid] = setTimeout('gettweets("'+i__uniqueid+'")', refreshTime);
 24+ });
 25+ }
 26+ );
10027 }
101 - $("#status_update_form input[name=submit]").click(function() {
102 - submit(0,'');
103 - });
104 - $("#status_update_form input[name=submitandmail]").click(function() {
105 - submit(1,'');
106 - });
107 - $("#status_update_form input[name=submitbyinformer]").click(function() {
108 - submit(0,InformerUser);
109 - });
110 - $("#status_update_form input[name=submitanonymously]").click(function() {
111 - submit(0,AnonymousUser);
112 - });
113 - $("#status_update_form input[name=submitprivate]").click(function() {
114 - submit(2,'');
115 - });
116 - $("#room_subscribe").click(function() {
117 - $("#tempimg").html('<img src="'+wgScriptPath+'/extensions/WikiTweet/images/ajax-loader-mini.gif" style ="padding: 0 5px 0 5px;"/>waiting...');
118 - var i__link = $("#status_update_form input[name=room]").val();
119 - var i__user = $("#status_update_form input[name=user]").val();
120 - $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=subscribe&wtwlink="+i__link+"&wtwuser="+i__user+"&wtwtype=room",
 28+ function gettweets_with_tag(i__uniqueid, i__tag) {
 29+ var l__size = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=size]").val();
 30+ var l__rows = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=rows]").val();
 31+ var l__room = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=room]").val();
 32+ var l__user = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=user]").val();
 33+ $(".status_update_form[uniqueid="+i__uniqueid+"] .img_loader").css("display","inline");
 34+ $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=get&wtwrows="+l__rows+"&wtwroom="+l__room+"&wtwuser="+l__user+"&wtwsize="+l__size+"&wtwtag="+i__tag,
12135 function(data) {
122 - $("#tempimg").html("");
123 - $("#room_subscribe").css("display", "none");
124 - $("#room_unsubscribe").css("display", "inline");
 36+ $.each(data.query.wikitweet, function(i,item){
 37+ $(".status_update_form[uniqueid="+i__uniqueid+"] .img_loader").css("display","none");
 38+ $("#lasttweets_"+i__uniqueid).html(item);
 39+ if (g__timer) clearTimeout(g__timer);
 40+ });
12541 }
12642 );
127 - });
128 - $("#room_unsubscribe").click(function() {
129 - $("#tempimg").html('<img src="'+wgScriptPath+'/extensions/WikiTweet/images/ajax-loader-mini.gif" style ="padding: 0 5px 0 5px;"/>waiting...');
130 - var i__link = $("#status_update_form input[name=room]").val();
131 - var i__user = $("#status_update_form input[name=user]").val();
132 - $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=unsubscribe&wtwlink="+i__link+"&wtwuser="+i__user+"&wtwtype=room",
 43+ }
 44+ function gettweets_from_room(i__uniqueid, i__room) {
 45+ var l__size = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=size]").val();
 46+ var l__rows = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=rows]").val();
 47+ var l__room = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=room]").val();
 48+ var l__user = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=user]").val();
 49+ $(".status_update_form[uniqueid="+i__uniqueid+"] .img_loader").css("display","inline");
 50+ $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=get&wtwrows="+l__rows+"&wtwroom="+l__room+"&wtwuser="+l__user+"&wtwsize="+l__size+"&wtwother_room="+i__room,
13351 function(data) {
134 - $("#tempimg").html("");
135 - $("#room_subscribe").css("display", "inline");
136 - $("#room_unsubscribe").css("display", "none");
 52+ $.each(data.query.wikitweet, function(i,item){
 53+ $(".status_update_form[uniqueid="+i__uniqueid+"] .img_loader").css("display","none");
 54+ $("#lasttweets_"+i__uniqueid).html(item);
 55+ if (g__timer) clearTimeout(g__timer);
 56+ });
13757 }
13858 );
 59+ }
 60+ function updatetweet(i__uniqueid, i__mail, i__userused){
 61+ var l__status = escape( $(".status_update_form[uniqueid="+i__uniqueid+"] textarea[name=status]").val() ) ;
 62+ var l__room = escape( $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=room]").val() ) ;
 63+ var l__bstatus = escape( $(".status_update_form[uniqueid="+i__uniqueid+"] select[name=bstatus]").val() ) ;
 64+ $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=update&wtwstatus="+l__status+"&wtwuser="+i__userused+"&wtwroom="+l__room+"&wtwtomail="+i__mail+"&wtwbstatus="+l__bstatus,
 65+ function(data) {
 66+ $(".status_update_form[uniqueid="+i__uniqueid+"] textarea[name=status]").val("");
 67+ $(".status_update_form[uniqueid="+i__uniqueid+"] .stringlength").html("<span>500</span>");
 68+ gettweets(i__uniqueid);
 69+ }
 70+ );
 71+ }
 72+
 73+ $(document).ready(function() {
 74+ $(".status_update_form textarea[name=status]").keyup(function(event) {
 75+ event.stopPropagation();
 76+ var l__uniqueid = $(this).parents('.status_update_form').attr('uniqueid');
 77+ len = $(".status_update_form[uniqueid="+l__uniqueid+"] textarea[name=status]").val().length;
 78+ addcolor = "";
 79+ if (len >= 500){
 80+ addcolor = " style='color:red;' ";
 81+ }
 82+ len2 = 500-len;
 83+ $(".status_update_form[uniqueid="+l__uniqueid+"] .stringlength").html("<span"+addcolor+">"+len2+"</span>");
 84+ if ($(".status_update_form[uniqueid="+l__uniqueid+"] textarea[name=status]").val().indexOf("@") != -1){
 85+ //status contains @ character
 86+ $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=submitandmail]").css("display","inline");
 87+ $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=submitprivate]").css("display","inline");
 88+ }
 89+ else if($(".status_update_form[uniqueid="+l__uniqueid+"] input[name=submitandmail]").css("display")=="inline"){
 90+ $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=submitandmail]").css("display","none");
 91+ $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=submitprivate]").css("display","none");
 92+ }
 93+
 94+ });
 95+ function submit(i__uniqueid, mail, userused){
 96+ if(userused == ''){
 97+ userused = $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=user]").val();
 98+ }
 99+ $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=submitandmail]").css("display","none");
 100+ $(".status_update_form[uniqueid="+i__uniqueid+"] input[name=submitprivate]").css("display","none");
 101+ len = $(".status_update_form[uniqueid="+i__uniqueid+"] textarea[name=status]").val().length;
 102+ if (len > 500){
 103+ alert('Reduce your message to 500 characters max.');
 104+ }
 105+ else if (len == 0){
 106+ gettweets(i__uniqueid);
 107+ }
 108+ else {
 109+ updatetweet(i__uniqueid, mail, userused);
 110+ }
 111+ }
 112+
 113+
 114+
 115+ $(".status_update_form input[name=submit]").click(function() {
 116+ submit($(this).parents('.status_update_form').attr('uniqueid'),0,'');
 117+ });
 118+ $(".status_update_form input[name=submitandmail]").click(function() {
 119+ submit($(this).parents('.status_update_form').attr('uniqueid'),1,'');
 120+ });
 121+ $(".status_update_form input[name=submitbyinformer]").click(function() {
 122+ submit($(this).parents('.status_update_form').attr('uniqueid'),0,InformerUser);
 123+ });
 124+ $(".status_update_form input[name=submitanonymously]").click(function() {
 125+ submit($(this).parents('.status_update_form').attr('uniqueid'),0,AnonymousUser);
 126+ });
 127+ $(".status_update_form input[name=submitprivate]").click(function() {
 128+ submit($(this).parents('.status_update_form').attr('uniqueid'),2,'');
 129+ });
 130+ $(".room_subscribe").click(function() {
 131+ l__uniqueid = $(this).attr('uniqueid');
 132+ $("#tempimg_"+l__uniqueid).html('<img src="'+wgScriptPath+'/extensions/WikiTweet/images/ajax-loader-mini.gif" style ="padding: 0 5px 0 5px;"/>waiting...');
 133+ var i__link = $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=room]").val();
 134+ var i__user = $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=user]").val();
 135+ $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=subscribe&wtwlink="+i__link+"&wtwuser="+i__user+"&wtwtype=room",
 136+ function(data) {
 137+ $("#tempimg_"+l__uniqueid).html("");
 138+ $(".room_subscribe[uniqueid="+l__uniqueid+"]").css("display", "none");
 139+ $(".room_unsubscribe[uniqueid="+l__uniqueid+"]").css("display", "inline");
 140+ }
 141+ );
 142+ });
 143+ $(".room_unsubscribe").click(function() {
 144+ l__uniqueid = $(this).attr('uniqueid');
 145+ $("#tempimg_"+l__uniqueid).html('<img src="'+wgScriptPath+'/extensions/WikiTweet/images/ajax-loader-mini.gif" style ="padding: 0 5px 0 5px;"/>waiting...');
 146+ var i__link = $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=room]").val();
 147+ var i__user = $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=user]").val();
 148+ $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=unsubscribe&wtwlink="+i__link+"&wtwuser="+i__user+"&wtwtype=room",
 149+ function(data) {
 150+ $("#tempimg_"+l__uniqueid).html("");
 151+ $(".room_subscribe[uniqueid="+l__uniqueid+"]").css("display", "inline");
 152+ $(".room_unsubscribe[uniqueid="+l__uniqueid+"]").css("display", "none");
 153+ }
 154+ );
 155+ });
 156+
139157 });
140 -});
 158+}
Index: trunk/extensions/WikiTweet/WikiTweet.functions.php
@@ -13,7 +13,7 @@
1414 }
1515 public static function send( $to, $from, $subject, $body, $replyto=null )
1616 {
17 - if(!$wgWikiTweet['email']){return false;}
 17+ //if(!$wgWikiTweet['email']){return false;}
1818 $wgOutputEncoding = 'UTF-8';
1919 $wgEnotifImpersonal = false;
2020 $wgErrorString = '';
@@ -97,4 +97,31 @@
9898 }
9999 return $result ;
100100 }
 101+
 102+ public static function getParentsRoomsString($i__room,$i__array)
 103+ {
 104+ $o__string = '>> ';
 105+ foreach(WikiTweetFunctions::_getParentsRoom($i__room,$i__array) as $l__room)
 106+ {
 107+ $o__string .= $l__room . '--';
 108+ }
 109+ return $o__string;
 110+ }
 111+ public static function _getParentsRoom($i__room,$i__array)
 112+ {
 113+ $o__room_parents = array();
 114+ foreach($i__array as $l__room_key=>$l__room_childs)
 115+ {
 116+ foreach($l__room_childs as $l__room_child)
 117+ {
 118+ if($l__room_child == $i__room)
 119+ {
 120+ $o__room_parents[] = $l__room_key;
 121+ $o__room_parents = array_merge($o__room_parents,WikiTweetFunctions::_getParentsRoom($l__room_key,$i__array));
 122+ break;
 123+ }
 124+ }
 125+ }
 126+ return $o__room_parents;
 127+ }
101128 }
Index: trunk/extensions/WikiTweet/WikiTweet2.js
@@ -4,9 +4,10 @@
55 $(this).css("border-left","3px solid #FFF");
66 });
77 $(".user_subscribe").click(function() {
 8+ var l__uniqueid = $(this).parents('.lasttweets').attr('uniqueid');
89 $("#tempimg2",this).html('<img src="'+wgScriptPath+'/extensions/WikiTweet/images/ajax-loader-mini.gif" style ="padding: 0 5px 0 5px;"/>waiting...');
910 var i__link = $("span",this).html();
10 - var i__user = $("#status_update_form input[name=user]").val();
 11+ var i__user = $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=user]").val();
1112 $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=subscribe&wtwlink="+i__link+"&wtwuser="+i__user+"&wtwtype=user",
1213 function(data) {
1314 $("#tempimg2").html("");
@@ -18,9 +19,10 @@
1920 );
2021 });
2122 $(".user_unsubscribe").click(function() {
 23+ var l__uniqueid = $(this).parents('.lasttweets').attr('uniqueid');
2224 $("#tempimg2",this).html('<img src="'+wgScriptPath+'/extensions/WikiTweet/images/ajax-loader-mini.gif" style ="padding: 0 5px 0 5px;"/>waiting...');
2325 var i__link = $("span",this).html();
24 - var i__user = $("#status_update_form input[name=user]").val();
 26+ var i__user = $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=user]").val();
2527 $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=unsubscribe&wtwlink="+i__link+"&wtwuser="+i__user+"&wtwtype=user",
2628 function(data) {
2729 $("#tempimg2").html("");
@@ -32,13 +34,23 @@
3335 );
3436 });
3537 $(".delete_tweet").click(function() {
 38+ var l__uniqueid = $(this).parents('.lasttweets').attr('uniqueid');
3639 var i__id = $("span",this).html();
3740 $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=delete&wtwid="+i__id,
3841 function(data) {
39 - gettweets();
 42+ gettweets(l__uniqueid);
4043 }
4144 );
4245 });
 46+$(".tresolve").click(function() {
 47+ var l__uniqueid = $(this).parents('.lasttweets').attr('uniqueid');
 48+ var l__id = $(this).attr('tweetid');
 49+ $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=resolve&wtwid="+l__id,
 50+ function(data) {
 51+ gettweets(l__uniqueid);
 52+ }
 53+ );
 54+});
4355 $(".answer").mouseover(function(){
4456 $(this).css("text-decoration","underline");
4557 }).mouseout(function(){
@@ -50,11 +62,49 @@
5163 $('textarea#status').focus();
5264 });
5365 $(".tag").click(function(){
54 - gettweets_with_tag($(this).attr('value'));
 66+ var l__uniqueid = $(this).parents('.lasttweets').attr('uniqueid');
 67+ gettweets_with_tag(l__uniqueid, $(this).attr('value'));
5568 });
5669 $(".room").click(function(){
57 - gettweets_from_room($(this).attr('value'));
 70+ var l__uniqueid = $(this).parents('.lasttweets').attr('uniqueid');
 71+ gettweets_from_room(l__uniqueid, $(this).attr('value'));
5872 });
5973 $(".timeline").click(function(){
60 - gettweets();
 74+ var l__uniqueid = $(this).parents('.lasttweets').attr('uniqueid');
 75+ gettweets(l__uniqueid);
6176 });
 77+
 78+
 79+$(".spancomment").click(function(){
 80+ var parent_id = $(this).attr('parent_id');
 81+ // popup(parent_id);
 82+ $('.childssharezone[parent_id='+parent_id+']').show();
 83+ $('textarea[parent_id='+parent_id+']').focus();
 84+ g__cycle = false;
 85+});
 86+$('textarea[name=childscomment]').focusout(function() {
 87+ var parent_id = $(this).attr('parent_id');
 88+ $('.childssharezone[parent_id='+parent_id+']').fadeOut(300);
 89+ g__cycle = true;
 90+});
 91+$('.childsharer').click(function(){
 92+ var l__parent_id = $(this).attr('parent_id');
 93+ var l__status = $('textarea[parent_id='+l__parent_id+']').val();
 94+ var l__uniqueid = $(this).parents('.lasttweets').attr('uniqueid');
 95+ var l__room = escape( $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=room]").val() ) ;
 96+ var l__bstatus = '1' ;
 97+ var l__userused = $(".status_update_form[uniqueid="+l__uniqueid+"] input[name=user]").val();
 98+
 99+ len = l__status.length;
 100+ if (len > 500){
 101+ popup('Reduce your message to 500 characters max.'+len+l__status);
 102+ }
 103+ else if (len > 0){
 104+ $.getJSON(wgScriptPath+"/api.php?action=query&format=json&list=wikitweet&wtwreq=update&wtwstatus="+l__status+"&wtwuser="+l__userused+"&wtwroom="+l__room+"&wtwtomail=0&wtwbstatus="+l__bstatus+"&wtwparentid="+l__parent_id,
 105+ function(data) {
 106+ $('textarea[parent_id='+l__parent_id+']').val("");
 107+ gettweets(l__uniqueid);
 108+ }
 109+ );
 110+ }
 111+});
\ No newline at end of file
Index: trunk/extensions/WikiTweet/WikiTweet.api.php
@@ -28,9 +28,19 @@
2929 * @ingroup Extensions
3030 */
3131 class ApiQueryWikiTweet extends ApiQueryBase {
32 - public function __construct( $query, $moduleName ) {
 32+ /**
 33+ * Construct function
 34+ */
 35+ public function __construct( $query, $moduleName ) {
3336 parent::__construct( $query, $moduleName, 'wtw' );
3437 }
 38+
 39+ /**
 40+ * Main function which executes the asked request
 41+ *
 42+ * @author Thomas Fauré <faure.thomas@gmail.com>
 43+ * @global OBJECT $wgUser
 44+ */
3545 public function execute() {
3646 global $wgUser;
3747 $params = $this->extractRequestParams();
@@ -44,8 +54,21 @@
4555 $size = (isset($params['size'])) ? $params['size'] : 'normal' ;
4656 $tag = (isset($params['tag'])) ? $params['tag'] : '' ;
4757 $other_room = (isset($params['other_room'])) ? $params['other_room'] : '' ;
 58+ $getbstatus = (isset($params['bstatus'])) ? $params['bstatus'] : 1 ;
4859
49 - $o__output_string = ApiQueryWikiTweet::fnGetTweetsAjax($rows,$room,$user,$size,$tag,$other_room);
 60+ $o__output = ApiQueryWikiTweet::fnGetTweetsAjax($rows,$room,$user,$size,$tag,$other_room,$getbstatus);
 61+ $o__output_string = $o__output[0];
 62+ $o__output_twids = $o__output[1];
 63+ $fit = $result-> addValue( array( 'query', $this->getModuleName() ), null, $o__output_string );
 64+ foreach($o__output_twids as $twid){
 65+ $fit2 = $result->addValue( array( 'query', 'twids' ), null, $twid );
 66+ }
 67+ $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'output' );
 68+ $result->setIndexedTagName_internal( array( 'query', 'twids'), 'twid' );
 69+ break;
 70+ case 'getchilds':
 71+ $twid = $params['id'] ;
 72+ $o__output_string = ApiQueryWikiTweet::fnGetChildsTweetsAjax($twid);
5073 $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $o__output_string );
5174 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'output' );
5275 break;
@@ -56,11 +79,15 @@
5780 ApiQueryWikiTweet::fnDelTweetAjax($id);
5881 break;
5982 case 'update':
60 - $status = $params['status'] ;
61 - $user = $params['user'] ;
62 - $room = $params['room'] ;
63 - $tomail = $params['tomail'] ;
64 - ApiQueryWikiTweet::fnUpdateTweetAjax($status, $user, $room, $tomail);
 83+ $status = $params['status'] ;
 84+ $user = $params['user'] ;
 85+ $room = $params['room'] ;
 86+ $tomail = $params['tomail'] ;
 87+ $bstatus = $params['bstatus'] ;
 88+ $parent = (isset($params['parentid'])) ? $params['parentid'] : 0 ;
 89+ $o__output_string = ApiQueryWikiTweet::fnUpdateTweetAjax ( $status, $user, $room, $tomail, $bstatus, $parent );
 90+ $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $o__output_string );
 91+ $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'output' );
6592 break;
6693 case 'subscribe':
6794 $type = (isset($params['type'])) ? $params['type'] : '' ;
@@ -78,13 +105,32 @@
79106 $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $o__output_string );
80107 $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'output' );
81108 break;
 109+ case 'resolve':
 110+ $id = (isset($params['id'])) ? $params['id'] : -1 ;
 111+ if ( $id == -1 ) $this->dieUsage( 'You must enter a parameter "id" with "resolve" option.', 'params' );
 112+ ApiQueryWikiTweet::fnResolveTweetAjax($id);
 113+ break;
82114 default:
83115 break;
84116 }
85117 }
86 -
87 -
88 - public static function fnGetTweetsAjax($rows,$room,$user,$size='normal',$tag='',$other_room='')
 118+ /**
 119+ * Get wikitweets timeline
 120+ *
 121+ * @author Thomas Fauré <faure.thomas@gmail.com>
 122+ * @param string $rows
 123+ * @param string $room
 124+ * @param string $user
 125+ * @param string $size
 126+ * @param string $tag
 127+ * @param string $other_room
 128+ * @param int $getbstatus
 129+ * @return array
 130+ * @global string $wgDBprefix
 131+ * @global string $wgScriptPath
 132+ * @global string $wgLanguageCode
 133+ */
 134+ public static function fnGetTweetsAjax($rows,$room,$user,$size='normal',$tag='',$other_room='',$getbstatus=1)
89135 {
90136 global $wgDBprefix , $wgScriptPath , $wgLanguageCode;
91137 include('WikiTweet.config.php');
@@ -97,23 +143,76 @@
98144 $span_avatar_width = $wgWikiTweet['size'][$size]['span_avatar_width'];
99145 $paddingli = $wgWikiTweet['size'][$size]['paddingli'];
100146 $margin_left = $wgWikiTweet['size'][$size]['margin_left'];
 147+
 148+ $child_line_height = $wgWikiTweet['size'][$size]['child_line_height'];
 149+ $child_font_size = $wgWikiTweet['size'][$size]['child_font_size'];
 150+ $child_avatar_size = $wgWikiTweet['size'][$size]['child_avatar_size'];
 151+ $child_span_avatar_width = $wgWikiTweet['size'][$size]['child_span_avatar_width'];
 152+ $child_paddingli = $wgWikiTweet['size'][$size]['child_paddingli'];
 153+ $child_margin_left = $wgWikiTweet['size'][$size]['child_margin_left'];
101154
102 - $text = "<ol style = ' list-style-image: none;
 155+ $text = ($size=='mobile') ? '' : "<ol style = ' list-style-image: none;
103156 list-style-position: outside;
104157 list-style-type: none;
105158 margin-left:$margin_left;'>";
106 -
 159+ //$text .= WikiTweetFunctions::getParentsRooms('REL.1.1');
107160 $dbr =& wfGetDB( DB_SLAVE );
108161
 162+ $datetemp = date('d/m/y H');
 163+ $res = $dbr->select('wikitweet_alerts','*',"`date` = '$datetemp'");
 164+ if ($dbr->numRows($res) == 0){
 165+ $res = $dbr->select('wikitweet','*',"status=2 AND `show`=1");
 166+ $attentionsnbr = $dbr->numRows($res);
 167+ $res = $dbr->select('wikitweet','*',"status=3 AND `show`=1");
 168+ $alertsnbr = $dbr->numRows($res);
 169+ $dbr->insert('wikitweet_alerts',array(
 170+ '`id`' => '' ,
 171+ '`date`' => $datetemp ,
 172+ '`timestamp`' => time() ,
 173+ '`attention`' => $attentionsnbr ,
 174+ '`alert`' => $alertsnbr
 175+ ));
 176+ $sql = "SELECT COUNT(w.`id`) as `countid`,w.`status`,r.`responsible` FROM ".$dbr->tableName('wikitweet')." w, ".$dbr->tableName('wikitweet_responsibles')." r WHERE w.`room`=r.`ref` AND w.`show`=1 AND w.`status`>1 GROUP BY r.`responsible`,w.`status`;";
 177+ $res = $dbr->query( $sql, __METHOD__ );
 178+ $results = array();
 179+ while( $row = $dbr->fetchObject( $res ) )
 180+ {
 181+ $l__countid = $row->countid;
 182+ $l__status = $row->status;
 183+ $l__responsible = $row->responsible;
 184+ if(isset($results[$l__responsible])){
 185+ $results[$l__responsible]["count".$l__status] = $l__countid;
 186+ }
 187+ else{
 188+ $results[$l__responsible] = array("count".$l__status=>$l__countid);
 189+ }
 190+ if(count($results[$l__responsible])==2){
 191+ $attentionsnbr = $results[$l__responsible]["count2"];
 192+ $alertsnbr = $results[$l__responsible]["count3"];
 193+ $dbr->insert('wikitweet_alerts_persons',array(
 194+ '`id`' => '' ,
 195+ '`date`' => $datetemp ,
 196+ '`timestamp`' => time() ,
 197+ '`attention`' => $attentionsnbr ,
 198+ '`alert`' => $alertsnbr ,
 199+ '`username`' => $l__responsible
 200+ ));
 201+ }
 202+ }
 203+ }
 204+
109205
110206 $sql_rooms = ($room == '' or $room == 'main') ? "`room`='' OR `room`='main'" : "`room`='$room'";
111207 $res1 = $dbr->select( 'wikitweet_subscription' , '*' , "user='" . mysql_real_escape_string( $user ) . "' " );
112208 $sql_subscriptions = "";
113 - while($row1 = $dbr->fetchObject($res1))
 209+ if($wgWikiTweet['showsubscriptions']==1)
114210 {
115 - $link = $row1->link;
116 - $type = $row1->type;
117 - $sql_subscriptions .= " OR `$type`='$link'";
 211+ while($row1 = $dbr->fetchObject($res1))
 212+ {
 213+ $link = $row1->link;
 214+ $type = $row1->type;
 215+ $sql_subscriptions .= " OR `$type`='$link'";
 216+ }
118217 }
119218 $roomssons = array();
120219 foreach($wgWikiTweet['inherit'] as $roominherit=>$roominheritvalue)
@@ -132,9 +231,9 @@
133232 $res = $dbr->select(
134233 'wikitweet' ,
135234 '*' ,
136 - "`text` like '%$tag%' AND (`show`=1 OR (`show`=2 AND (`text` like '%@$user%' OR `user`='$user')))",
 235+ "(`text` like '%$tag%' AND (`show`=1 OR (`show`=2 AND (`text` like '%@$user%' OR `user`='$user')))) AND `parent`=0",
137236 __METHOD__ ,
138 - array("ORDER BY" =>" `date` DESC", "LIMIT" => $rows));
 237+ array("ORDER BY" =>" `lastupdatedate`,`date` DESC", "LIMIT" => $rows));
139238 $text .= "<h2>".wfMsg ( 'wikitweet-tweets-tagged' ) ." <a>#$tag</a></h2>";
140239 $text .= "<p><a class='handmouse timeline'>".wfMsg('wikitweet-back-timeline')."...</a></p>";
141240 }
@@ -142,58 +241,84 @@
143242 $res = $dbr->select(
144243 'wikitweet' ,
145244 '*' ,
146 - "`room`='$other_room' AND (`show`=1 OR (`show`=2 AND (`text` like '%@$user%' OR `user`='$user')))",
 245+ "`room`='($other_room' AND (`show`=1 OR (`show`=2 AND (`text` like '%@$user%' OR `user`='$user')))) AND `parent`=0",
147246 __METHOD__ ,
148 - array("ORDER BY" =>" `date` DESC", "LIMIT" => $rows));
 247+ array("ORDER BY" =>" `lastupdatedate`,`date` DESC", "LIMIT" => $rows));
149248 $text .= "<h2>".wfMsg('wikitweet-tweets-from-room')." \"<a>$other_room</a>\"</h2>";
150249 $text .= "<p><a class='handmouse timeline'>".wfMsg('wikitweet-back-timeline')."...</a></p>";
151250
152251 }
153252 else{
 253+ $getbstatusstring = ($getbstatus>1) ? ( ($getbstatus>2) ? '`status`=2':'`status`>=2' ) :'1=0' ;
154254 $res = $dbr->select(
155255 'wikitweet' ,
156256 '*' ,
157 - "(($sql_rooms $sql_subscriptions )AND `show`=1) OR (`show`=2 AND (`text` like '%@$user%' OR `user`='$user'))",
 257+ "((($sql_rooms $sql_subscriptions )AND (`show`=1 OR (`show`=2 AND (`text` like '%@$user%' OR `user`='$user')))) OR ($getbstatusstring AND `show`=1)) AND `parent`=0",
158258 __METHOD__ ,
159 - array("ORDER BY" =>" `date` DESC", "LIMIT" => $rows));
 259+ array("ORDER BY" =>" `lastupdatedate` DESC", "LIMIT" => $rows));
160260 }
161 -
 261+ $o__twids = array();
162262 while( $row = $dbr->fetchObject( $res ) )
163263 {
164264 // Pull out the fields
165265 $id = $row->id;
166266 $twext = $row->text;
167 - $tweetuser = mysql_real_escape_string($row->user);
 267+ $tweetuser = str_replace(' ','_',mysql_real_escape_string($row->user));
168268 $date = $row->date;
169269 $tweet_room = $row->room;
170270 $show = $row->show;
 271+ $bstatus = $row->status;
171272 $background_color = "#FFF";
172273 $viaroom = "";
173274 $private = "";
174275 if ( $tweet_room != $room ) {
175276 $background_color = "#EFEFEF";
176 - $viaroom = "- via room <a class='handmouse room' value='$tweet_room'>$tweet_room</a>";
 277+ $tweetroom_title = (isset($wgWikiTweet['titles'][$tweet_room])) ? $tweet_room.' - '.$wgWikiTweet['titles'][$tweet_room] : $tweet_room;
 278+ $viaroom = ($wgWikiTweet['roomlink'] == '') ? "- ".wfMsg('wikitweet-viaroom')." <a class='handmouse room' value='$tweet_room'>$tweetroom_title</a> " : "- ".wfMsg('wikitweet-viaroom')." <a class='handmouse' href='$wgScriptPath/index.php/{$wgWikiTweet['roomlink']}$tweet_room' target='_blank'>$tweetroom_title</a> ";
 279+ $viaroom = ($size=='mobile') ? "- ".wfMsg('wikitweet-viaroom')." $tweetroom_title " : $viaroom;
177280 }
178281 if ( $show == 2 ) {
179282 $background_color = "#C6DEFE";
180283 $private = "<img src='$wgScriptPath/extensions/WikiTweet/images/lock-small.png' />";
181284 }
182285
183 - $dateSrc = $date.' GMT';
184 - $date_to_display = WikiTweetFunctions::Convert_Date(strtotime($dateSrc));
185 - //$date_to_display = date('H:i, F jS', strtotime($dateSrc));
 286+ //$date_to_display = WikiTweetFunctions::Convert_Date(strtotime($dateSrc));
 287+ $date_to_display = date(($wgWikiTweet['dateformat']=='') ? 'H:i, F jS' : $wgWikiTweet['dateformat'],strtotime($date));
186288
187289 $res2 = $dbr->select('wikitweet_avatar','avatar',"`user`='".mysql_real_escape_string($tweetuser)."' ",__METHOD__,false);
188290 $row2 = $dbr->fetchObject ( $res2 );
189291 $avatar = (count($row2)>0) ? $row2->avatar : '';
190292
191 - $conversion_tab = array(
 293+ $conversion_tab = ($size=='mobile') ? array(
 294+ "/http(\S*)/is" => "<a href='http$1' target='_blank'>http$1</a>",
 295+ "/ www(\S*)/is" => " <a href='http://www$1' target='_blank'>www$1</a>",
 296+ "/\n/is" => "<br/>",
 297+ "/%u2019/is" => "'",
 298+ "/%u20AC/is" => "€"
 299+ ) :
 300+ array(
192301 "/\>(\S*)/is" => "><a href='$wgScriptPath/index.php/$1'>$1</a>",
193302 "/\@(\S*)/is" => "@<a href='$wgScriptPath/index.php/User:$1'>$1</a>",
194303 "/\#(\S*)/is" => "<a class='handmouse tag' value='$1'>#$1</a>",
195304 "/http(\S*)/is" => "<a href='http$1' target='_blank'>http$1</a>",
196305 "/ www(\S*)/is" => " <a href='http://www$1' target='_blank'>www$1</a>",
 306+ "/\n/is" => "<br/>",
 307+ "/%u2019/is" => "'",
 308+ "/%u20AC/is" => "€"
197309 );
 310+ $resusers = $dbr->select(
 311+ 'user' ,
 312+ '*' ,
 313+ '',
 314+ __METHOD__ ,
 315+ array());
 316+
 317+ while( $rowuser = $dbr->fetchObject( $resusers ) )
 318+ {
 319+ $twext = str_replace("@".$rowuser->user_name,"@".str_replace(' ','_',$rowuser->user_name),$twext);
 320+ }
 321+
 322+
198323 $twext = preg_replace(array_keys($conversion_tab), array_values($conversion_tab), $twext);
199324 $user_subscribe_text = "";
200325 $unsubscribe_string = wfMsg('wikitweet-unsubscribe');
@@ -203,6 +328,7 @@
204329 $tweetuserclas = str_replace(".","__dot__",$tweetuser);
205330 $delete_tweet = "";
206331 $answer = "";
 332+ $comment = "<span class='spancomment' parent_id='$id' style='cursor:pointer;'>".wfMsg('wikitweet-comment')."</span>";
207333 if($tweetuser!=$user){
208334 $form_user = "<form style='display:none;'><input type=hidden value='$tweetuser' name='tweetuser' /></form>";
209335 $user_subscribe_text = "- <a class='handmouse user_subscribe subscribe$tweetuserclas' id='user_subscribe' style='color:#999;display:none;'>$subscribe_string<span id='tweetuser' style='display:none'>$tweetuser</span>$form_user</a><a style='color:#999;' class='handmouse user_unsubscribe unsubscribe$tweetuserclas'>$unsubscribe_string<span id='tweetuser' style='display:none'>$tweetuser</span>$form_user</a>";
@@ -219,54 +345,218 @@
220346 if((in_array($user, $wgWikiTweet['informers']) and $tweetuser == $wgWikiTweet['informuser']) or $tweetuser==$user or in_array($user, $wgWikiTweet['admin'])){
221347 $delete_tweet = " - <a class='handmouse delete_tweet' style='color:#999;'>$delete_string<span style='display:none'>$id</span></a>";
222348 }
223 - $text .= "<li class='tweet_li' id='$id' user='$tweetuser'
224 - style = ' display: list-item;
225 - margin:0;
226 - line-height: $line_height;
227 - padding: $paddingli;
228 - position:relative;
229 - background-color:$background_color;
230 - border:3px solid #FFF;
231 - border-bottom:1px solid #CCC;
232 - '>
233 - <span style = ' display:block;
234 - height: $span_avatar_width;
235 - left: 0;
236 - margin: 0 10px 0 0;
237 - overflow: hidden;
238 - position: absolute;
239 - width:$span_avatar_width;
240 - z-index: 10;
241 - /*border-bottom:1px solid #CCC;*/
242 - '>
243 - <a href='$wgScriptPath/index.php/User:$tweetuser'>
244 - <img src= '$avatar' width=$avatar_size height=$avatar_size alt='$tweetuser' border=0/>
245 - </a>
246 - </span>
247 - <span style = ' display: block;
248 - margin-left: 56px;
249 - min-height: ".$avatar_size."px;
250 - overflow: hidden;
251 - width:$width ;
252 - line-height: $line_height;
253 - font-size:$font_size;
254 - /*border-bottom:1px solid #CCC;*/
255 - '>
256 -
257 - <span style = ' line-height: $line_height;
258 - font-size:$font_size;'>
259 - <b>
260 - <a href='$wgScriptPath/index.php/User:$tweetuser'>$tweetuser</a>
261 - </b>
262 - $twext<br/>
263 - <small style='color:#999;'>$date_to_display $viaroom <span id='id_user_subscribe'>$user_subscribe_text</span><span id='tempimg2'></span>$delete_tweet $private $answer</small>
 349+ $imagestatus = "<img src='$wgScriptPath/extensions/WikiTweet/images/";
 350+ $imagestatus .= ( $bstatus > 0 ) ? (( $bstatus > 1 ) ? (($bstatus>2) ? "exclamation-red.png": "exclamation-octagon.png") : 'information-button.png') : 'balloon.png';
 351+ $imagestatus .= "'/> ";
 352+ // if($bstatus==0){$imagestatus='';}
 353+ $resolveit = ($bstatus > 1 ) ? "- <a style='color:#999;' class='handmouse tresolve' tweetid='$id'>".wfMsg('wikitweet-resolve')."</a>" : '';
 354+ array_push($o__twids,"$id");
 355+ if($size=='mobile')
 356+ {
 357+ $imagestatus = ( $bstatus > 1 ) ? (($bstatus>2) ? "<img src='/mediawiki/extensions/WikiTweet/images/exclamation-red.png' class='ui-li-icon'/> ": "<img src='/mediawiki/extensions/WikiTweet/images/exclamation-octagon.png' class='ui-li-icon'/> ") : '';
 358+ $themestatus = ( $bstatus == 3 ) ? ' data-theme="e"' : '';
 359+
 360+ $reschild = $dbr->select(
 361+ 'wikitweet' ,
 362+ 'count(*) as `countchild`' ,
 363+ "`show`=1 AND `parent`=$id",
 364+ __METHOD__ ,
 365+ array());
 366+ $arraycountchild = $dbr->fetchObject( $reschild );
 367+ $commentscount = $arraycountchild->countchild;
 368+
 369+ $text .= "<li$themestatus>";
 370+ $text .= "<a href='#comment$id'>";
 371+ $text .= "$imagestatus
 372+ <p style='white-space:normal!important;'><strong>@$tweetuser</strong> : $twext</p>
 373+ <p>$date_to_display $viaroom></p>";
 374+ $text .= "<span class='ui-li-count'>$commentscount</span></a>
 375+ </li>
 376+ ";
 377+ }
 378+ else
 379+ {
 380+ $text .= "<li class='tweet_li bstatus$bstatus' id='$id' user='$tweetuser' style='
 381+ line-height: $line_height;
 382+ padding: $paddingli;
 383+ background-color:$background_color;'>
 384+ <span class='span-a' style='height:$span_avatar_width;width:$span_avatar_width;'>
 385+ <a href='$wgScriptPath/index.php/User:$tweetuser'>
 386+ <img src= '$avatar' width=$avatar_size height=$avatar_size alt='$tweetuser' border=0/>
 387+ </a>
264388 </span>
265 - </span>
266 - </li>";
 389+ <span class='span-b' style = '
 390+ min-height: ".$avatar_size."px;
 391+ width:$width ;
 392+ line-height: $line_height;
 393+ font-size:$font_size;
 394+ '>
 395+
 396+ <span style = ' line-height: $line_height;
 397+ font-size:$font_size;'>
 398+ <b>
 399+ <a href='$wgScriptPath/index.php/User:$tweetuser' class='tweetuser'>$tweetuser</a>
 400+ </b>
 401+ $imagestatus
 402+ $twext<br/>
 403+ <small style='color:#999;'>$date_to_display $viaroom <span id='id_user_subscribe'>$user_subscribe_text</span><span id='tempimg2'></span>$delete_tweet $resolveit $private $answer - $comment - $id</small>
 404+ </span>
 405+ </span>";
 406+
 407+
 408+ $text .= "<div class='childs' parent_id='{$id}'>";
 409+ $reschild = $dbr->select(
 410+ 'wikitweet' ,
 411+ '*' ,
 412+ "`show`=1 AND `parent`=$id",
 413+ __METHOD__ ,
 414+ array("ORDER BY" =>" `date` ASC"));
 415+ $l__childs = array();
 416+ $text .= "<ol style = 'margin-left:$child_margin_left;' class='childsul'>";
 417+ $l__countchild = 0;
 418+ while( $rowchild = $dbr->fetchObject( $reschild ) )
 419+ {
 420+ $l__countchild+=1;
 421+ $idchild = $rowchild->id;
 422+ $twextchild = $rowchild->text;
 423+ $tweetuserchild = str_replace(' ','_',mysql_real_escape_string($rowchild->user));
 424+ $datechild = $rowchild->date;
 425+
 426+ $twextchild = preg_replace(array_keys($conversion_tab), array_values($conversion_tab), $twextchild);
 427+ $date_to_displaychild = date(($wgWikiTweet['dateformat']=='') ? 'H:i, F jS' : $wgWikiTweet['dateformat'], strtotime($datechild));
 428+
 429+ if((in_array($user, $wgWikiTweet['informers']) and $tweetuser == $wgWikiTweet['informuser']) or $tweetuser==$user or $tweetuserchild==$user or in_array($user, $wgWikiTweet['admin'])){
 430+ $delete_tweetchild = " - <a class='handmouse delete_tweet' style='color:#999;'>$delete_string<span style='display:none'>$idchild</span></a>";
 431+ }
 432+
 433+ $res2c = $dbr->select('wikitweet_avatar','avatar',"`user`='".mysql_real_escape_string($tweetuserchild)."' ",__METHOD__,false);
 434+ $row2c = $dbr->fetchObject ( $res2c );
 435+ $avatarchild = (count($row2c)>0) ? $row2c->avatar : '';
 436+
 437+ $text .= "
 438+ <li class='tweet_li_child bstatus0' id='{$idchild}' user='{$tweetuserchild}' style='
 439+ line-height: $child_line_height;
 440+ padding: $child_paddingli;
 441+ background-color:$child_background_color;'>
 442+ <span class='span-a' style='height:$child_span_avatar_width;width:$child_span_avatar_width;'>
 443+ <a href='$wgScriptPath/index.php/User:$tweetuserchild'>
 444+ <img src= '$avatarchild' width=$child_avatar_size height=$child_avatar_size alt='$tweetuserchild' border=0/>
 445+ </a>
 446+ </span>
 447+ <span class='span-b' style = '
 448+ min-height: ".$child_avatar_size."px;
 449+ width:$child_width ;
 450+ line-height: $child_line_height;
 451+ font-size:$child_font_size;
 452+ '>
 453+
 454+ <span style = ' line-height: $child_line_height;
 455+ font-size:$child_font_size;'>
 456+ <b>
 457+ <a href='$wgScriptPath/index.php/User:$tweetuserchild' class='tweetuser'>$tweetuserchild</a>
 458+ </b>
 459+ $twextchild<br/>
 460+ <small style='color:#999;'>$date_to_displaychild $delete_tweetchild</small>
 461+ </span>
 462+ </span>
 463+ </li>";
 464+
 465+ }
 466+ $text .= "</ol>";
 467+
 468+ if($l__countchild>0)
 469+ {
 470+ $text .= "$comment";
 471+ }
 472+
 473+ $text .= " <div class='childssharezone' parent_id='{$id}' style='display:none;'>";
 474+ $text .= " <textarea type='text' name='childscomment' class='childstextarea' parent_id='$id'></textarea>
 475+ <div class='underchildstextarea' parent_id='{$id}'>
 476+ <img src='images/ajax-loader.gif' class='childajaxloader' style='display:none;'/>
 477+ <button class='childsharer' parent_id='{$id}' uniqueid=''>".'Partager'."</button>
 478+ </div><!--div class='underchildstextarea'-->";
 479+ $text .= " </div>";
 480+ $text .= "</div>";
 481+ $text .="</li>";
 482+ }
267483 }
268 - $text .= '<script type="text/javascript" src="'.$wgScriptPath.'/extensions/WikiTweet/WikiTweet2.js"></script>';
269 - $text .= "</ol>";
 484+ $text .= ($size=='mobile') ? '' : '<script type="text/javascript" src="'.$wgScriptPath.'/extensions/WikiTweet/WikiTweet2.js"></script>';
 485+ $text .= ($size=='mobile') ? '' : "</ol>";
270486
 487+ return array($text,$o__twids);
 488+ }
 489+ /**
 490+ * Get childs wikitweets of a given wikitweet timeline
 491+ *
 492+ * @author Thomas Fauré <faure.thomas@gmail.com>
 493+ * @param string $twid parent wikitweet ID
 494+ * @return array
 495+ * @global string $wgDBprefix
 496+ * @global string $wgScriptPath
 497+ * @global string $wgLanguageCode
 498+ */
 499+ public static function fnGetChildsTweetsAjax($twid)
 500+ {
 501+ global $wgDBprefix , $wgScriptPath , $wgLanguageCode;
 502+ include('WikiTweet.config.php');
 503+
 504+
 505+ $dbr =& wfGetDB( DB_SLAVE );
 506+ $res = $dbr->select(
 507+ 'wikitweet' ,
 508+ '*' ,
 509+ "`show`=1 AND `parent`='$twid'",
 510+ __METHOD__ ,
 511+ array("ORDER BY" =>" `date` ASC", "LIMIT" => $rows));
 512+
 513+
 514+ while( $row = $dbr->fetchObject( $res ) )
 515+ {
 516+ // Pull out the fields
 517+ $id = $row->id;
 518+ $twext = $row->text;
 519+ $tweetuser = str_replace(' ','_',mysql_real_escape_string($row->user));
 520+ $date = $row->date;
 521+ $tweet_room = $row->room;
 522+ $show = $row->show;
 523+
 524+ $date_to_display = date(($wgWikiTweet['dateformat']=='') ? 'H:i, F jS' : $wgWikiTweet['dateformat'],strtotime($date));
 525+
 526+ $res2 = $dbr->select('wikitweet_avatar','avatar',"`user`='".mysql_real_escape_string($tweetuser)."' ",__METHOD__,false);
 527+ $row2 = $dbr->fetchObject ( $res2 );
 528+ $avatar = (count($row2)>0) ? $row2->avatar : '';
 529+
 530+ $conversion_tab = array(
 531+ "/http(\S*)/is" => "<a href='http$1' target='_blank'>http$1</a>",
 532+ "/ www(\S*)/is" => " <a href='http://www$1' target='_blank'>www$1</a>",
 533+ "/\n/is" => "<br/>",
 534+ "/%u2019/is" => "'",
 535+ "/%u20AC/is" => "€"
 536+ );
 537+ $resusers = $dbr->select(
 538+ 'user' ,
 539+ '*' ,
 540+ '',
 541+ __METHOD__ ,
 542+ array());
 543+
 544+ while( $rowuser = $dbr->fetchObject( $resusers ) )
 545+ {
 546+ $twext = str_replace("@".$rowuser->user_name,"@".str_replace(' ','_',$rowuser->user_name),$twext);
 547+ }
 548+
 549+
 550+ $twext = preg_replace(array_keys($conversion_tab), array_values($conversion_tab), $twext);
 551+ $tweetuserclas = str_replace(".","__dot__",$tweetuser);
 552+
 553+
 554+ $text .= "<li>";
 555+ $text .= "<p style='white-space:normal!important;'><strong>@$tweetuser</strong> : $twext</p>
 556+ <p>$date_to_display</p>
 557+ </li>
 558+ ";
 559+
 560+ }
271561 return $text;
272562 }
273563 public static function fnDelTweetAjax($id){
@@ -277,34 +567,65 @@
278568 $o__response = new AjaxResponse('ok');
279569 return $o__response;
280570 }
281 - public static function fnUpdateTweetAjax($status, $user, $room, $tomail) {
282 - $text = '';
 571+ public static function fnResolveTweetAjax($id){
283572 include('WikiTweet.config.php');
 573+ global $wgDBprefix;
 574+ $dbr =& wfGetDB( DB_SLAVE );
 575+ $dbr->update('wikitweet',array('`status`' => 1),array('id' => $id));
 576+
 577+ $sql1 = "SELECT DISTINCT {$wgDBprefix}user.user_email,{$wgDBprefix}wikitweet.room, {$wgDBprefix}wikitweet.text, {$wgDBprefix}wikitweet.id FROM {$wgDBprefix}user, {$wgDBprefix}wikitweet WHERE {$wgDBprefix}wikitweet.user={$wgDBprefix}user.user_name AND {$wgDBprefix}wikitweet.id=$id ;";
 578+ $res1 = $dbr->query( $sql1, __METHOD__ );
 579+ $results = array();
 580+ while( $row1 = $dbr->fetchObject( $res1 ) )
 581+ {
 582+ $useremail = $row1->user_email;
 583+ $room = $row1->room;
 584+ $text = $row1->text;
 585+ $twid = $row1->id;
 586+ $sender = $wgWikiTweet['wikimails']['2'];
 587+ WikiTweetFunctions::send( $useremail, $sender , "[WikiTweet] ".date('d/m H:i')." ".wfMsg('wikitweet-alertsolved')." $room", "$text");
 588+ }
 589+ $o__response = new AjaxResponse('ok');
 590+ // TODO : WikiTweetFunctions::send( 'sender email', $sender ,"L'alerte $twid a été résolue dans la salle $room : $text","");
 591+ return $o__response;
 592+ }
 593+ public static function fnUpdateTweetAjax($status, $user, $room, $tomail, $bstatus, $parent) {
 594+ $text = 'hello world;';
 595+ include('WikiTweet.config.php');
284596 $show = ($tomail==2) ? 2 : 1;
285 - global $wgDBprefix, $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname;
 597+ global $wgDBprefix, $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, $wgLanguageCode, $IP, $wgServer ;
286598 $db = mysql_connect($wgDBserver, $wgDBuser, $wgDBpassword);
287599 mysql_select_db($wgDBname,$db);
288600
289601 $dbr =& wfGetDB( DB_SLAVE );
290602 $dbr->insert('wikitweet',array(
291 - '`id`' => '' ,
292 - '`text`' => $status ,
293 - '`user`' => $user ,
294 - '`room`' => $room ,
295 - '`show`' => $show
 603+ '`id`' => '' ,
 604+ '`text`' => $status ,
 605+ '`user`' => $user ,
 606+ '`room`' => $room ,
 607+ '`show`' => $show ,
 608+ '`status`' => $bstatus,
 609+ '`parent`' => $parent,
 610+ '`lastupdatedate`' => time()
296611 ));
 612+
 613+ if( $parent != 0 )
 614+ {
 615+ // update last update date parent tweet
 616+ $dbr->update( 'wikitweet', array('`lastupdatedate`' => time()), array('id' => $parent) ) ;
 617+ }
297618
298 - $dest=array();
299 - $user_email = $wgWikiTweet['wikimail'];
300 - if($tomail==1 or $tomail==2){
 619+ $dest=array('concerned'=>array(),'subscribers'=>array()); // initialisation de la liste des récepteurs
 620+ $user_email = $wgWikiTweet['wikimail']; // initialisation du sender
 621+ if($tomail==1 or $tomail==2 or !$wgWikiTweet['tweetandemail']){ // si l'option tomail est à 1 ou 2 > mails directs, mentions, privés
301622 $res = $dbr->select('user','user_email',"user_name = '$user' ");
 623+
302624 if ($dbr->numRows($res) > 0){
303625 $row = $dbr->fetchObject($res);
304626 $user_email = $row->user_email;
305627 if ($user_email!=''){
306628 $status_array = split("@",$status);
307629 $i = -1;
308 -
309630 foreach($status_array as $values){
310631 $i += 1;
311632 if ($i>0){
@@ -315,32 +636,83 @@
316637 $row2 = $dbr->fetchObject($res2);
317638 $useremail = $row2->user_email;
318639 if ($useremail!='')
319 - array_push($dest,$useremail);
 640+ array_push($dest['concerned'],$useremail);
320641 }
321642 }
322643 }
323644 }
324645 }
325646 }
326 - // récupération des abonnés pour envoi de mail (abonnés user ou abonnés room)
327 - $sql1 = "SELECT DISTINCT {$wgDBprefix}user.user_email FROM {$wgDBprefix}user,{$wgDBprefix}wikitweet_subscription wt WHERE wt.user={$wgDBprefix}user.user_name AND ((wt.link = '$room' AND wt.type='room') or (wt.link='$user' AND wt.type='user')) AND wt.user!='$user' ;";
328 - $req1 = mysql_query($sql1) or die('Error SQL !');
329 - // TODO
 647+ if( $tomail!=2)
 648+ {
 649+ // pas d'envoi de mails groupés pour les tweets privés
 650+ // à ce stade, $dest contient les utilisateurs qui sont spécifiques au tweets, et non pas abonnés.
 651+ $roomssons = array();
 652+ $sql_subscriptions = '';
 653+ // récupération des abonnés pour envoi de mail (abonnés user ou abonnés room + inherit rooms)
 654+ foreach(WikiTweetFunctions::_getParentsRoom($room,$wgWikiTweet['inherit']) as $roomparent)
 655+ {
 656+ $sql_subscriptions .= " OR (wt.link = '$roomparent' AND wt.type='room')";
 657+ }
 658+ $sql1 = "SELECT DISTINCT {$wgDBprefix}user.user_email FROM {$wgDBprefix}user,{$wgDBprefix}wikitweet_subscription wt WHERE wt.user={$wgDBprefix}user.user_name AND ((wt.link = '$room' AND wt.type='room') or (wt.link='$user' AND wt.type='user'){$sql_subscriptions}) ;";
330659
331 - while($row1 = mysql_fetch_assoc($req1)){
332 - $useremail = $row1['user_email'];
333 - array_push($dest,$useremail);
334 - $text .= $useremail.'---';
 660+ $res1 = $dbr->query( $sql1, __METHOD__ );
 661+ while( $row1 = $dbr->fetchObject( $res1 ) )
 662+ {
 663+ $useremail = $row1->user_email;
 664+ array_push($dest['subscribers'],$useremail);
 665+ $text .= $useremail.'---';
 666+ }
335667 }
336 - $lenlist = 0;
337 - foreach($dest as $destmail){
338 - $lenlist += strlen($destmail);
 668+ $lenlist = array('concerned'=>0,'subscribers'=>0);
 669+ foreach($dest as $desttype=>$destarray)
 670+ {
 671+ foreach($dest[$desttype] as $destmail){
 672+ $lenlist[$desttype] += strlen($destmail);
 673+ $text .= "--g:$desttype:$destmail--";
 674+ }
339675 }
340 - if($lenlist>0){
341 - WikiTweetFunctions::send( $dest, $user_email, "A new tweet for or about you !", $status);
342 - $text .= 'mail sent';
 676+ $bstatus_string = ($bstatus > 1) ? ' ['.wfMsg('wikitweet-status'.$bstatus).']' : '';
 677+
 678+ foreach($dest as $desttype=>$destarray)
 679+ {
 680+ if($lenlist[$desttype]>0){
 681+ $room_title = (isset($wgWikiTweet['titles'][$room])) ? $room.' - '.$wgWikiTweet['titles'][$room] : $room;
 682+ $concernsstring = ($desttype == 'concerned') ? "[".wfMsg('wikitweet-concerns')."]" : "";
 683+ $sender = ($desttype == 'concerned') ? $wgWikiTweet['wikimail-concerns'] : $wgWikiTweet['wikimails'][$bstatus];
 684+
 685+ $answering = '';
 686+ if( $parent != 0 )
 687+ {
 688+ // en réponse au wikitweet
 689+ $res = $dbr->select(
 690+ 'wikitweet' ,
 691+ '*' ,
 692+ "`show`=1 AND `id`='$parent'",
 693+ __METHOD__ ,
 694+ array("ORDER BY" =>" `date` ASC", "LIMIT" => $rows)
 695+ );
 696+ $row = $dbr->fetchObject( $res );
 697+ $answering = wfMsg('wikitweet-inresponseto')." \n\n".wfMsg('wikitweet-from')." @{$row->user} ({$row->date}) : {$row->text}\n";
 698+
 699+ $res = $dbr->select(
 700+ 'wikitweet' ,
 701+ '*' ,
 702+ "`show`=1 AND `parent`='$parent'",
 703+ __METHOD__ ,
 704+ array("ORDER BY" =>" `date` ASC", "LIMIT" => $rows)
 705+ );
 706+ while( $row = $dbr->fetchObject( $res ) )
 707+ {
 708+ $answering .= "\n\t|----\n\t| ".wfMsg('wikitweet-from')." @{$row->user} ({$row->date}) : {$row->text}";
 709+ }
 710+ $answering .= "\n\t|----";
 711+ }
 712+
 713+ WikiTweetFunctions::send( $dest[$desttype], $sender , "[WikiTweet]$bstatus_string $concernsstring ".date('d/m H:i')." @$user (".wfMsg('wikitweet-in')." $room_title)", wfMsg('wikitweet-from')." @$user :\n----\n".$status."\n----\n\n$answering(".wfMsg('wikitweet-in')." \"$room_title\")\n\n".wfMsg('wikitweet-directlink')." $wgServer/mediawiki/index.php/{$wgWikiTweet['roomlink']}$room");
 714+ $text .= wfMsg('wikitweet-mailsent');
 715+ }
343716 }
344 -
345717 mysql_close();
346718 return $text;
347719 }
@@ -376,10 +748,12 @@
377749 ApiBase :: PARAM_DFLT => 'get',
378750 ApiBase :: PARAM_TYPE => array (
379751 'get',
 752+ 'getchilds',
380753 'delete',
381754 'update',
382755 'subscribe',
383 - 'unsubscribe'
 756+ 'unsubscribe',
 757+ 'resolve'
384758 )
385759 ),
386760 'rows' => array (
@@ -419,15 +793,26 @@
420794 'link' => array (
421795 ApiBase :: PARAM_TYPE => 'string'
422796 ),
 797+ 'bstatus' => array (
 798+ ApiBase :: PARAM_TYPE => 'integer'
 799+ ),
 800+ 'parentid' => array (
 801+ ApiBase :: PARAM_TYPE => 'integer'
 802+ )
423803 );
424804 }
425805
 806+ private function log() {
 807+
 808+ }
426809 public function getParamDescription() {
427810 return array(
428811 'get' => 'Get tweets',
 812+ 'getchilds' => 'Get childs',
429813 'delete' => 'Delete a given tweet',
430814 'update' => 'Add a tweet',
431 - 'subscribe' => 'Subscription management'
 815+ 'subscribe' => 'Subscription management',
 816+ 'resolve' => 'Resolve a tweet (alert or warning)',
432817 );
433818 }
434819
Index: trunk/extensions/WikiTweet/jquery.js
@@ -1,4241 +1,18 @@
22 /*!
3 - * jQuery JavaScript Library v1.3.1
 3+ * jQuery JavaScript Library v1.6.1
44 * http://jquery.com/
55 *
6 - * Copyright (c) 2009 John Resig
7 - * Dual licensed under the MIT and GPL licenses.
8 - * http://docs.jquery.com/License
 6+ * Copyright 2011, John Resig
 7+ * Dual licensed under the MIT or GPL Version 2 licenses.
 8+ * http://jquery.org/license
99 *
10 - * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
11 - * Revision: 6158
 10+ * Includes Sizzle.js
 11+ * http://sizzlejs.com/
 12+ * Copyright 2011, The Dojo Foundation
 13+ * Released under the MIT, BSD, and GPL Licenses.
 14+ *
 15+ * Date: Thu May 12 15:04:36 2011 -0400
1216 */
13 -(function(){
14 -
15 -var
16 - // Will speed up references to window, and allows munging its name.
17 - window = this,
18 - // Will speed up references to undefined, and allows munging its name.
19 - undefined,
20 - // Map over jQuery in case of overwrite
21 - _jQuery = window.jQuery,
22 - // Map over the $ in case of overwrite
23 - _$ = window.$,
24 -
25 - jQuery = window.jQuery = window.$ = function( selector, context ) {
26 - // The jQuery object is actually just the init constructor 'enhanced'
27 - return new jQuery.fn.init( selector, context );
28 - },
29 -
30 - // A simple way to check for HTML strings or ID strings
31 - // (both of which we optimize for)
32 - quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
33 - // Is it a simple selector
34 - isSimple = /^.[^:#\[\.,]*$/;
35 -
36 -jQuery.fn = jQuery.prototype = {
37 - init: function( selector, context ) {
38 - // Make sure that a selection was provided
39 - selector = selector || document;
40 -
41 - // Handle $(DOMElement)
42 - if ( selector.nodeType ) {
43 - this[0] = selector;
44 - this.length = 1;
45 - this.context = selector;
46 - return this;
47 - }
48 - // Handle HTML strings
49 - if ( typeof selector === "string" ) {
50 - // Are we dealing with HTML string or an ID?
51 - var match = quickExpr.exec( selector );
52 -
53 - // Verify a match, and that no context was specified for #id
54 - if ( match && (match[1] || !context) ) {
55 -
56 - // HANDLE: $(html) -> $(array)
57 - if ( match[1] )
58 - selector = jQuery.clean( [ match[1] ], context );
59 -
60 - // HANDLE: $("#id")
61 - else {
62 - var elem = document.getElementById( match[3] );
63 -
64 - // Handle the case where IE and Opera return items
65 - // by name instead of ID
66 - if ( elem && elem.id != match[3] )
67 - return jQuery().find( selector );
68 -
69 - // Otherwise, we inject the element directly into the jQuery object
70 - var ret = jQuery( elem || [] );
71 - ret.context = document;
72 - ret.selector = selector;
73 - return ret;
74 - }
75 -
76 - // HANDLE: $(expr, [context])
77 - // (which is just equivalent to: $(content).find(expr)
78 - } else
79 - return jQuery( context ).find( selector );
80 -
81 - // HANDLE: $(function)
82 - // Shortcut for document ready
83 - } else if ( jQuery.isFunction( selector ) )
84 - return jQuery( document ).ready( selector );
85 -
86 - // Make sure that old selector state is passed along
87 - if ( selector.selector && selector.context ) {
88 - this.selector = selector.selector;
89 - this.context = selector.context;
90 - }
91 -
92 - return this.setArray(jQuery.makeArray(selector));
93 - },
94 -
95 - // Start with an empty selector
96 - selector: "",
97 -
98 - // The current version of jQuery being used
99 - jquery: "1.3.1",
100 -
101 - // The number of elements contained in the matched element set
102 - size: function() {
103 - return this.length;
104 - },
105 -
106 - // Get the Nth element in the matched element set OR
107 - // Get the whole matched element set as a clean array
108 - get: function( num ) {
109 - return num === undefined ?
110 -
111 - // Return a 'clean' array
112 - jQuery.makeArray( this ) :
113 -
114 - // Return just the object
115 - this[ num ];
116 - },
117 -
118 - // Take an array of elements and push it onto the stack
119 - // (returning the new matched element set)
120 - pushStack: function( elems, name, selector ) {
121 - // Build a new jQuery matched element set
122 - var ret = jQuery( elems );
123 -
124 - // Add the old object onto the stack (as a reference)
125 - ret.prevObject = this;
126 -
127 - ret.context = this.context;
128 -
129 - if ( name === "find" )
130 - ret.selector = this.selector + (this.selector ? " " : "") + selector;
131 - else if ( name )
132 - ret.selector = this.selector + "." + name + "(" + selector + ")";
133 -
134 - // Return the newly-formed element set
135 - return ret;
136 - },
137 -
138 - // Force the current matched set of elements to become
139 - // the specified array of elements (destroying the stack in the process)
140 - // You should use pushStack() in order to do this, but maintain the stack
141 - setArray: function( elems ) {
142 - // Resetting the length to 0, then using the native Array push
143 - // is a super-fast way to populate an object with array-like properties
144 - this.length = 0;
145 - Array.prototype.push.apply( this, elems );
146 -
147 - return this;
148 - },
149 -
150 - // Execute a callback for every element in the matched set.
151 - // (You can seed the arguments with an array of args, but this is
152 - // only used internally.)
153 - each: function( callback, args ) {
154 - return jQuery.each( this, callback, args );
155 - },
156 -
157 - // Determine the position of an element within
158 - // the matched set of elements
159 - index: function( elem ) {
160 - // Locate the position of the desired element
161 - return jQuery.inArray(
162 - // If it receives a jQuery object, the first element is used
163 - elem && elem.jquery ? elem[0] : elem
164 - , this );
165 - },
166 -
167 - attr: function( name, value, type ) {
168 - var options = name;
169 -
170 - // Look for the case where we're accessing a style value
171 - if ( typeof name === "string" )
172 - if ( value === undefined )
173 - return this[0] && jQuery[ type || "attr" ]( this[0], name );
174 -
175 - else {
176 - options = {};
177 - options[ name ] = value;
178 - }
179 -
180 - // Check to see if we're setting style values
181 - return this.each(function(i){
182 - // Set all the styles
183 - for ( name in options )
184 - jQuery.attr(
185 - type ?
186 - this.style :
187 - this,
188 - name, jQuery.prop( this, options[ name ], type, i, name )
189 - );
190 - });
191 - },
192 -
193 - css: function( key, value ) {
194 - // ignore negative width and height values
195 - if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
196 - value = undefined;
197 - return this.attr( key, value, "curCSS" );
198 - },
199 -
200 - text: function( text ) {
201 - if ( typeof text !== "object" && text != null )
202 - return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
203 -
204 - var ret = "";
205 -
206 - jQuery.each( text || this, function(){
207 - jQuery.each( this.childNodes, function(){
208 - if ( this.nodeType != 8 )
209 - ret += this.nodeType != 1 ?
210 - this.nodeValue :
211 - jQuery.fn.text( [ this ] );
212 - });
213 - });
214 -
215 - return ret;
216 - },
217 -
218 - wrapAll: function( html ) {
219 - if ( this[0] ) {
220 - // The elements to wrap the target around
221 - var wrap = jQuery( html, this[0].ownerDocument ).clone();
222 -
223 - if ( this[0].parentNode )
224 - wrap.insertBefore( this[0] );
225 -
226 - wrap.map(function(){
227 - var elem = this;
228 -
229 - while ( elem.firstChild )
230 - elem = elem.firstChild;
231 -
232 - return elem;
233 - }).append(this);
234 - }
235 -
236 - return this;
237 - },
238 -
239 - wrapInner: function( html ) {
240 - return this.each(function(){
241 - jQuery( this ).contents().wrapAll( html );
242 - });
243 - },
244 -
245 - wrap: function( html ) {
246 - return this.each(function(){
247 - jQuery( this ).wrapAll( html );
248 - });
249 - },
250 -
251 - append: function() {
252 - return this.domManip(arguments, true, function(elem){
253 - if (this.nodeType == 1)
254 - this.appendChild( elem );
255 - });
256 - },
257 -
258 - prepend: function() {
259 - return this.domManip(arguments, true, function(elem){
260 - if (this.nodeType == 1)
261 - this.insertBefore( elem, this.firstChild );
262 - });
263 - },
264 -
265 - before: function() {
266 - return this.domManip(arguments, false, function(elem){
267 - this.parentNode.insertBefore( elem, this );
268 - });
269 - },
270 -
271 - after: function() {
272 - return this.domManip(arguments, false, function(elem){
273 - this.parentNode.insertBefore( elem, this.nextSibling );
274 - });
275 - },
276 -
277 - end: function() {
278 - return this.prevObject || jQuery( [] );
279 - },
280 -
281 - // For internal use only.
282 - // Behaves like an Array's .push method, not like a jQuery method.
283 - push: [].push,
284 -
285 - find: function( selector ) {
286 - if ( this.length === 1 && !/,/.test(selector) ) {
287 - var ret = this.pushStack( [], "find", selector );
288 - ret.length = 0;
289 - jQuery.find( selector, this[0], ret );
290 - return ret;
291 - } else {
292 - var elems = jQuery.map(this, function(elem){
293 - return jQuery.find( selector, elem );
294 - });
295 -
296 - return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
297 - jQuery.unique( elems ) :
298 - elems, "find", selector );
299 - }
300 - },
301 -
302 - clone: function( events ) {
303 - // Do the clone
304 - var ret = this.map(function(){
305 - if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
306 - // IE copies events bound via attachEvent when
307 - // using cloneNode. Calling detachEvent on the
308 - // clone will also remove the events from the orignal
309 - // In order to get around this, we use innerHTML.
310 - // Unfortunately, this means some modifications to
311 - // attributes in IE that are actually only stored
312 - // as properties will not be copied (such as the
313 - // the name attribute on an input).
314 - var clone = this.cloneNode(true),
315 - container = document.createElement("div");
316 - container.appendChild(clone);
317 - return jQuery.clean([container.innerHTML])[0];
318 - } else
319 - return this.cloneNode(true);
320 - });
321 -
322 - // Need to set the expando to null on the cloned set if it exists
323 - // removeData doesn't work here, IE removes it from the original as well
324 - // this is primarily for IE but the data expando shouldn't be copied over in any browser
325 - var clone = ret.find("*").andSelf().each(function(){
326 - if ( this[ expando ] !== undefined )
327 - this[ expando ] = null;
328 - });
329 -
330 - // Copy the events from the original to the clone
331 - if ( events === true )
332 - this.find("*").andSelf().each(function(i){
333 - if (this.nodeType == 3)
334 - return;
335 - var events = jQuery.data( this, "events" );
336 -
337 - for ( var type in events )
338 - for ( var handler in events[ type ] )
339 - jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
340 - });
341 -
342 - // Return the cloned set
343 - return ret;
344 - },
345 -
346 - filter: function( selector ) {
347 - return this.pushStack(
348 - jQuery.isFunction( selector ) &&
349 - jQuery.grep(this, function(elem, i){
350 - return selector.call( elem, i );
351 - }) ||
352 -
353 - jQuery.multiFilter( selector, jQuery.grep(this, function(elem){
354 - return elem.nodeType === 1;
355 - }) ), "filter", selector );
356 - },
357 -
358 - closest: function( selector ) {
359 - var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null;
360 -
361 - return this.map(function(){
362 - var cur = this;
363 - while ( cur && cur.ownerDocument ) {
364 - if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) )
365 - return cur;
366 - cur = cur.parentNode;
367 - }
368 - });
369 - },
370 -
371 - not: function( selector ) {
372 - if ( typeof selector === "string" )
373 - // test special case where just one selector is passed in
374 - if ( isSimple.test( selector ) )
375 - return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector );
376 - else
377 - selector = jQuery.multiFilter( selector, this );
378 -
379 - var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
380 - return this.filter(function() {
381 - return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
382 - });
383 - },
384 -
385 - add: function( selector ) {
386 - return this.pushStack( jQuery.unique( jQuery.merge(
387 - this.get(),
388 - typeof selector === "string" ?
389 - jQuery( selector ) :
390 - jQuery.makeArray( selector )
391 - )));
392 - },
393 -
394 - is: function( selector ) {
395 - return !!selector && jQuery.multiFilter( selector, this ).length > 0;
396 - },
397 -
398 - hasClass: function( selector ) {
399 - return !!selector && this.is( "." + selector );
400 - },
401 -
402 - val: function( value ) {
403 - if ( value === undefined ) {
404 - var elem = this[0];
405 -
406 - if ( elem ) {
407 - if( jQuery.nodeName( elem, 'option' ) )
408 - return (elem.attributes.value || {}).specified ? elem.value : elem.text;
409 -
410 - // We need to handle select boxes special
411 - if ( jQuery.nodeName( elem, "select" ) ) {
412 - var index = elem.selectedIndex,
413 - values = [],
414 - options = elem.options,
415 - one = elem.type == "select-one";
416 -
417 - // Nothing was selected
418 - if ( index < 0 )
419 - return null;
420 -
421 - // Loop through all the selected options
422 - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
423 - var option = options[ i ];
424 -
425 - if ( option.selected ) {
426 - // Get the specifc value for the option
427 - value = jQuery(option).val();
428 -
429 - // We don't need an array for one selects
430 - if ( one )
431 - return value;
432 -
433 - // Multi-Selects return an array
434 - values.push( value );
435 - }
436 - }
437 -
438 - return values;
439 - }
440 -
441 - // Everything else, we just grab the value
442 - return (elem.value || "").replace(/\r/g, "");
443 -
444 - }
445 -
446 - return undefined;
447 - }
448 -
449 - if ( typeof value === "number" )
450 - value += '';
451 -
452 - return this.each(function(){
453 - if ( this.nodeType != 1 )
454 - return;
455 -
456 - if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
457 - this.checked = (jQuery.inArray(this.value, value) >= 0 ||
458 - jQuery.inArray(this.name, value) >= 0);
459 -
460 - else if ( jQuery.nodeName( this, "select" ) ) {
461 - var values = jQuery.makeArray(value);
462 -
463 - jQuery( "option", this ).each(function(){
464 - this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
465 - jQuery.inArray( this.text, values ) >= 0);
466 - });
467 -
468 - if ( !values.length )
469 - this.selectedIndex = -1;
470 -
471 - } else
472 - this.value = value;
473 - });
474 - },
475 -
476 - html: function( value ) {
477 - return value === undefined ?
478 - (this[0] ?
479 - this[0].innerHTML :
480 - null) :
481 - this.empty().append( value );
482 - },
483 -
484 - replaceWith: function( value ) {
485 - return this.after( value ).remove();
486 - },
487 -
488 - eq: function( i ) {
489 - return this.slice( i, +i + 1 );
490 - },
491 -
492 - slice: function() {
493 - return this.pushStack( Array.prototype.slice.apply( this, arguments ),
494 - "slice", Array.prototype.slice.call(arguments).join(",") );
495 - },
496 -
497 - map: function( callback ) {
498 - return this.pushStack( jQuery.map(this, function(elem, i){
499 - return callback.call( elem, i, elem );
500 - }));
501 - },
502 -
503 - andSelf: function() {
504 - return this.add( this.prevObject );
505 - },
506 -
507 - domManip: function( args, table, callback ) {
508 - if ( this[0] ) {
509 - var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
510 - scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
511 - first = fragment.firstChild,
512 - extra = this.length > 1 ? fragment.cloneNode(true) : fragment;
513 -
514 - if ( first )
515 - for ( var i = 0, l = this.length; i < l; i++ )
516 - callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment );
517 -
518 - if ( scripts )
519 - jQuery.each( scripts, evalScript );
520 - }
521 -
522 - return this;
523 -
524 - function root( elem, cur ) {
525 - return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ?
526 - (elem.getElementsByTagName("tbody")[0] ||
527 - elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
528 - elem;
529 - }
530 - }
531 -};
532 -
533 -// Give the init function the jQuery prototype for later instantiation
534 -jQuery.fn.init.prototype = jQuery.fn;
535 -
536 -function evalScript( i, elem ) {
537 - if ( elem.src )
538 - jQuery.ajax({
539 - url: elem.src,
540 - async: false,
541 - dataType: "script"
542 - });
543 -
544 - else
545 - jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
546 -
547 - if ( elem.parentNode )
548 - elem.parentNode.removeChild( elem );
549 -}
550 -
551 -function now(){
552 - return +new Date;
553 -}
554 -
555 -jQuery.extend = jQuery.fn.extend = function() {
556 - // copy reference to target object
557 - var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
558 -
559 - // Handle a deep copy situation
560 - if ( typeof target === "boolean" ) {
561 - deep = target;
562 - target = arguments[1] || {};
563 - // skip the boolean and the target
564 - i = 2;
565 - }
566 -
567 - // Handle case when target is a string or something (possible in deep copy)
568 - if ( typeof target !== "object" && !jQuery.isFunction(target) )
569 - target = {};
570 -
571 - // extend jQuery itself if only one argument is passed
572 - if ( length == i ) {
573 - target = this;
574 - --i;
575 - }
576 -
577 - for ( ; i < length; i++ )
578 - // Only deal with non-null/undefined values
579 - if ( (options = arguments[ i ]) != null )
580 - // Extend the base object
581 - for ( var name in options ) {
582 - var src = target[ name ], copy = options[ name ];
583 -
584 - // Prevent never-ending loop
585 - if ( target === copy )
586 - continue;
587 -
588 - // Recurse if we're merging object values
589 - if ( deep && copy && typeof copy === "object" && !copy.nodeType )
590 - target[ name ] = jQuery.extend( deep,
591 - // Never move original objects, clone them
592 - src || ( copy.length != null ? [ ] : { } )
593 - , copy );
594 -
595 - // Don't bring in undefined values
596 - else if ( copy !== undefined )
597 - target[ name ] = copy;
598 -
599 - }
600 -
601 - // Return the modified object
602 - return target;
603 -};
604 -
605 -// exclude the following css properties to add px
606 -var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
607 - // cache defaultView
608 - defaultView = document.defaultView || {},
609 - toString = Object.prototype.toString;
610 -
611 -jQuery.extend({
612 - noConflict: function( deep ) {
613 - window.$ = _$;
614 -
615 - if ( deep )
616 - window.jQuery = _jQuery;
617 -
618 - return jQuery;
619 - },
620 -
621 - // See test/unit/core.js for details concerning isFunction.
622 - // Since version 1.3, DOM methods and functions like alert
623 - // aren't supported. They return false on IE (#2968).
624 - isFunction: function( obj ) {
625 - return toString.call(obj) === "[object Function]";
626 - },
627 -
628 - isArray: function( obj ) {
629 - return toString.call(obj) === "[object Array]";
630 - },
631 -
632 - // check if an element is in a (or is an) XML document
633 - isXMLDoc: function( elem ) {
634 - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
635 - !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument );
636 - },
637 -
638 - // Evalulates a script in a global context
639 - globalEval: function( data ) {
640 - data = jQuery.trim( data );
641 -
642 - if ( data ) {
643 - // Inspired by code by Andrea Giammarchi
644 - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
645 - var head = document.getElementsByTagName("head")[0] || document.documentElement,
646 - script = document.createElement("script");
647 -
648 - script.type = "text/javascript";
649 - if ( jQuery.support.scriptEval )
650 - script.appendChild( document.createTextNode( data ) );
651 - else
652 - script.text = data;
653 -
654 - // Use insertBefore instead of appendChild to circumvent an IE6 bug.
655 - // This arises when a base node is used (#2709).
656 - head.insertBefore( script, head.firstChild );
657 - head.removeChild( script );
658 - }
659 - },
660 -
661 - nodeName: function( elem, name ) {
662 - return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
663 - },
664 -
665 - // args is for internal usage only
666 - each: function( object, callback, args ) {
667 - var name, i = 0, length = object.length;
668 -
669 - if ( args ) {
670 - if ( length === undefined ) {
671 - for ( name in object )
672 - if ( callback.apply( object[ name ], args ) === false )
673 - break;
674 - } else
675 - for ( ; i < length; )
676 - if ( callback.apply( object[ i++ ], args ) === false )
677 - break;
678 -
679 - // A special, fast, case for the most common use of each
680 - } else {
681 - if ( length === undefined ) {
682 - for ( name in object )
683 - if ( callback.call( object[ name ], name, object[ name ] ) === false )
684 - break;
685 - } else
686 - for ( var value = object[0];
687 - i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
688 - }
689 -
690 - return object;
691 - },
692 -
693 - prop: function( elem, value, type, i, name ) {
694 - // Handle executable functions
695 - if ( jQuery.isFunction( value ) )
696 - value = value.call( elem, i );
697 -
698 - // Handle passing in a number to a CSS property
699 - return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ?
700 - value + "px" :
701 - value;
702 - },
703 -
704 - className: {
705 - // internal only, use addClass("class")
706 - add: function( elem, classNames ) {
707 - jQuery.each((classNames || "").split(/\s+/), function(i, className){
708 - if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
709 - elem.className += (elem.className ? " " : "") + className;
710 - });
711 - },
712 -
713 - // internal only, use removeClass("class")
714 - remove: function( elem, classNames ) {
715 - if (elem.nodeType == 1)
716 - elem.className = classNames !== undefined ?
717 - jQuery.grep(elem.className.split(/\s+/), function(className){
718 - return !jQuery.className.has( classNames, className );
719 - }).join(" ") :
720 - "";
721 - },
722 -
723 - // internal only, use hasClass("class")
724 - has: function( elem, className ) {
725 - return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
726 - }
727 - },
728 -
729 - // A method for quickly swapping in/out CSS properties to get correct calculations
730 - swap: function( elem, options, callback ) {
731 - var old = {};
732 - // Remember the old values, and insert the new ones
733 - for ( var name in options ) {
734 - old[ name ] = elem.style[ name ];
735 - elem.style[ name ] = options[ name ];
736 - }
737 -
738 - callback.call( elem );
739 -
740 - // Revert the old values
741 - for ( var name in options )
742 - elem.style[ name ] = old[ name ];
743 - },
744 -
745 - css: function( elem, name, force ) {
746 - if ( name == "width" || name == "height" ) {
747 - var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
748 -
749 - function getWH() {
750 - val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
751 - var padding = 0, border = 0;
752 - jQuery.each( which, function() {
753 - padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
754 - border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
755 - });
756 - val -= Math.round(padding + border);
757 - }
758 -
759 - if ( jQuery(elem).is(":visible") )
760 - getWH();
761 - else
762 - jQuery.swap( elem, props, getWH );
763 -
764 - return Math.max(0, val);
765 - }
766 -
767 - return jQuery.curCSS( elem, name, force );
768 - },
769 -
770 - curCSS: function( elem, name, force ) {
771 - var ret, style = elem.style;
772 -
773 - // We need to handle opacity special in IE
774 - if ( name == "opacity" && !jQuery.support.opacity ) {
775 - ret = jQuery.attr( style, "opacity" );
776 -
777 - return ret == "" ?
778 - "1" :
779 - ret;
780 - }
781 -
782 - // Make sure we're using the right name for getting the float value
783 - if ( name.match( /float/i ) )
784 - name = styleFloat;
785 -
786 - if ( !force && style && style[ name ] )
787 - ret = style[ name ];
788 -
789 - else if ( defaultView.getComputedStyle ) {
790 -
791 - // Only "float" is needed here
792 - if ( name.match( /float/i ) )
793 - name = "float";
794 -
795 - name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
796 -
797 - var computedStyle = defaultView.getComputedStyle( elem, null );
798 -
799 - if ( computedStyle )
800 - ret = computedStyle.getPropertyValue( name );
801 -
802 - // We should always get a number back from opacity
803 - if ( name == "opacity" && ret == "" )
804 - ret = "1";
805 -
806 - } else if ( elem.currentStyle ) {
807 - var camelCase = name.replace(/\-(\w)/g, function(all, letter){
808 - return letter.toUpperCase();
809 - });
810 -
811 - ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
812 -
813 - // From the awesome hack by Dean Edwards
814 - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
815 -
816 - // If we're not dealing with a regular pixel number
817 - // but a number that has a weird ending, we need to convert it to pixels
818 - if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
819 - // Remember the original values
820 - var left = style.left, rsLeft = elem.runtimeStyle.left;
821 -
822 - // Put in the new values to get a computed value out
823 - elem.runtimeStyle.left = elem.currentStyle.left;
824 - style.left = ret || 0;
825 - ret = style.pixelLeft + "px";
826 -
827 - // Revert the changed values
828 - style.left = left;
829 - elem.runtimeStyle.left = rsLeft;
830 - }
831 - }
832 -
833 - return ret;
834 - },
835 -
836 - clean: function( elems, context, fragment ) {
837 - context = context || document;
838 -
839 - // !context.createElement fails in IE with an error but returns typeof 'object'
840 - if ( typeof context.createElement === "undefined" )
841 - context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
842 -
843 - // If a single string is passed in and it's a single tag
844 - // just do a createElement and skip the rest
845 - if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
846 - var match = /^<(\w+)\s*\/?>$/.exec(elems[0]);
847 - if ( match )
848 - return [ context.createElement( match[1] ) ];
849 - }
850 -
851 - var ret = [], scripts = [], div = context.createElement("div");
852 -
853 - jQuery.each(elems, function(i, elem){
854 - if ( typeof elem === "number" )
855 - elem += '';
856 -
857 - if ( !elem )
858 - return;
859 -
860 - // Convert html string into DOM nodes
861 - if ( typeof elem === "string" ) {
862 - // Fix "XHTML"-style tags in all browsers
863 - elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
864 - return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
865 - all :
866 - front + "></" + tag + ">";
867 - });
868 -
869 - // Trim whitespace, otherwise indexOf won't work as expected
870 - var tags = jQuery.trim( elem ).toLowerCase();
871 -
872 - var wrap =
873 - // option or optgroup
874 - !tags.indexOf("<opt") &&
875 - [ 1, "<select multiple='multiple'>", "</select>" ] ||
876 -
877 - !tags.indexOf("<leg") &&
878 - [ 1, "<fieldset>", "</fieldset>" ] ||
879 -
880 - tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
881 - [ 1, "<table>", "</table>" ] ||
882 -
883 - !tags.indexOf("<tr") &&
884 - [ 2, "<table><tbody>", "</tbody></table>" ] ||
885 -
886 - // <thead> matched above
887 - (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
888 - [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
889 -
890 - !tags.indexOf("<col") &&
891 - [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
892 -
893 - // IE can't serialize <link> and <script> tags normally
894 - !jQuery.support.htmlSerialize &&
895 - [ 1, "div<div>", "</div>" ] ||
896 -
897 - [ 0, "", "" ];
898 -
899 - // Go to html and back, then peel off extra wrappers
900 - div.innerHTML = wrap[1] + elem + wrap[2];
901 -
902 - // Move to the right depth
903 - while ( wrap[0]-- )
904 - div = div.lastChild;
905 -
906 - // Remove IE's autoinserted <tbody> from table fragments
907 - if ( !jQuery.support.tbody ) {
908 -
909 - // String was a <table>, *may* have spurious <tbody>
910 - var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
911 - div.firstChild && div.firstChild.childNodes :
912 -
913 - // String was a bare <thead> or <tfoot>
914 - wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
915 - div.childNodes :
916 - [];
917 -
918 - for ( var j = tbody.length - 1; j >= 0 ; --j )
919 - if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
920 - tbody[ j ].parentNode.removeChild( tbody[ j ] );
921 -
922 - }
923 -
924 - // IE completely kills leading whitespace when innerHTML is used
925 - if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
926 - div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
927 -
928 - elem = jQuery.makeArray( div.childNodes );
929 - }
930 -
931 - if ( elem.nodeType )
932 - ret.push( elem );
933 - else
934 - ret = jQuery.merge( ret, elem );
935 -
936 - });
937 -
938 - if ( fragment ) {
939 - for ( var i = 0; ret[i]; i++ ) {
940 - if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
941 - scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
942 - } else {
943 - if ( ret[i].nodeType === 1 )
944 - ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
945 - fragment.appendChild( ret[i] );
946 - }
947 - }
948 -
949 - return scripts;
950 - }
951 -
952 - return ret;
953 - },
954 -
955 - attr: function( elem, name, value ) {
956 - // don't set attributes on text and comment nodes
957 - if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
958 - return undefined;
959 -
960 - var notxml = !jQuery.isXMLDoc( elem ),
961 - // Whether we are setting (or getting)
962 - set = value !== undefined;
963 -
964 - // Try to normalize/fix the name
965 - name = notxml && jQuery.props[ name ] || name;
966 -
967 - // Only do all the following if this is a node (faster for style)
968 - // IE elem.getAttribute passes even for style
969 - if ( elem.tagName ) {
970 -
971 - // These attributes require special treatment
972 - var special = /href|src|style/.test( name );
973 -
974 - // Safari mis-reports the default selected property of a hidden option
975 - // Accessing the parent's selectedIndex property fixes it
976 - if ( name == "selected" && elem.parentNode )
977 - elem.parentNode.selectedIndex;
978 -
979 - // If applicable, access the attribute via the DOM 0 way
980 - if ( name in elem && notxml && !special ) {
981 - if ( set ){
982 - // We can't allow the type property to be changed (since it causes problems in IE)
983 - if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
984 - throw "type property can't be changed";
985 -
986 - elem[ name ] = value;
987 - }
988 -
989 - // browsers index elements by id/name on forms, give priority to attributes.
990 - if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
991 - return elem.getAttributeNode( name ).nodeValue;
992 -
993 - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
994 - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
995 - if ( name == "tabIndex" ) {
996 - var attributeNode = elem.getAttributeNode( "tabIndex" );
997 - return attributeNode && attributeNode.specified
998 - ? attributeNode.value
999 - : elem.nodeName.match(/(button|input|object|select|textarea)/i)
1000 - ? 0
1001 - : elem.nodeName.match(/^(a|area)$/i) && elem.href
1002 - ? 0
1003 - : undefined;
1004 - }
1005 -
1006 - return elem[ name ];
1007 - }
1008 -
1009 - if ( !jQuery.support.style && notxml && name == "style" )
1010 - return jQuery.attr( elem.style, "cssText", value );
1011 -
1012 - if ( set )
1013 - // convert the value to a string (all browsers do this but IE) see #1070
1014 - elem.setAttribute( name, "" + value );
1015 -
1016 - var attr = !jQuery.support.hrefNormalized && notxml && special
1017 - // Some attributes require a special call on IE
1018 - ? elem.getAttribute( name, 2 )
1019 - : elem.getAttribute( name );
1020 -
1021 - // Non-existent attributes return null, we normalize to undefined
1022 - return attr === null ? undefined : attr;
1023 - }
1024 -
1025 - // elem is actually elem.style ... set the style
1026 -
1027 - // IE uses filters for opacity
1028 - if ( !jQuery.support.opacity && name == "opacity" ) {
1029 - if ( set ) {
1030 - // IE has trouble with opacity if it does not have layout
1031 - // Force it by setting the zoom level
1032 - elem.zoom = 1;
1033 -
1034 - // Set the alpha filter to set the opacity
1035 - elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
1036 - (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
1037 - }
1038 -
1039 - return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
1040 - (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
1041 - "";
1042 - }
1043 -
1044 - name = name.replace(/-([a-z])/ig, function(all, letter){
1045 - return letter.toUpperCase();
1046 - });
1047 -
1048 - if ( set )
1049 - elem[ name ] = value;
1050 -
1051 - return elem[ name ];
1052 - },
1053 -
1054 - trim: function( text ) {
1055 - return (text || "").replace( /^\s+|\s+$/g, "" );
1056 - },
1057 -
1058 - makeArray: function( array ) {
1059 - var ret = [];
1060 -
1061 - if( array != null ){
1062 - var i = array.length;
1063 - // The window, strings (and functions) also have 'length'
1064 - if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval )
1065 - ret[0] = array;
1066 - else
1067 - while( i )
1068 - ret[--i] = array[i];
1069 - }
1070 -
1071 - return ret;
1072 - },
1073 -
1074 - inArray: function( elem, array ) {
1075 - for ( var i = 0, length = array.length; i < length; i++ )
1076 - // Use === because on IE, window == document
1077 - if ( array[ i ] === elem )
1078 - return i;
1079 -
1080 - return -1;
1081 - },
1082 -
1083 - merge: function( first, second ) {
1084 - // We have to loop this way because IE & Opera overwrite the length
1085 - // expando of getElementsByTagName
1086 - var i = 0, elem, pos = first.length;
1087 - // Also, we need to make sure that the correct elements are being returned
1088 - // (IE returns comment nodes in a '*' query)
1089 - if ( !jQuery.support.getAll ) {
1090 - while ( (elem = second[ i++ ]) != null )
1091 - if ( elem.nodeType != 8 )
1092 - first[ pos++ ] = elem;
1093 -
1094 - } else
1095 - while ( (elem = second[ i++ ]) != null )
1096 - first[ pos++ ] = elem;
1097 -
1098 - return first;
1099 - },
1100 -
1101 - unique: function( array ) {
1102 - var ret = [], done = {};
1103 -
1104 - try {
1105 -
1106 - for ( var i = 0, length = array.length; i < length; i++ ) {
1107 - var id = jQuery.data( array[ i ] );
1108 -
1109 - if ( !done[ id ] ) {
1110 - done[ id ] = true;
1111 - ret.push( array[ i ] );
1112 - }
1113 - }
1114 -
1115 - } catch( e ) {
1116 - ret = array;
1117 - }
1118 -
1119 - return ret;
1120 - },
1121 -
1122 - grep: function( elems, callback, inv ) {
1123 - var ret = [];
1124 -
1125 - // Go through the array, only saving the items
1126 - // that pass the validator function
1127 - for ( var i = 0, length = elems.length; i < length; i++ )
1128 - if ( !inv != !callback( elems[ i ], i ) )
1129 - ret.push( elems[ i ] );
1130 -
1131 - return ret;
1132 - },
1133 -
1134 - map: function( elems, callback ) {
1135 - var ret = [];
1136 -
1137 - // Go through the array, translating each of the items to their
1138 - // new value (or values).
1139 - for ( var i = 0, length = elems.length; i < length; i++ ) {
1140 - var value = callback( elems[ i ], i );
1141 -
1142 - if ( value != null )
1143 - ret[ ret.length ] = value;
1144 - }
1145 -
1146 - return ret.concat.apply( [], ret );
1147 - }
1148 -});
1149 -
1150 -// Use of jQuery.browser is deprecated.
1151 -// It's included for backwards compatibility and plugins,
1152 -// although they should work to migrate away.
1153 -
1154 -var userAgent = navigator.userAgent.toLowerCase();
1155 -
1156 -// Figure out what browser is being used
1157 -jQuery.browser = {
1158 - version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
1159 - safari: /webkit/.test( userAgent ),
1160 - opera: /opera/.test( userAgent ),
1161 - msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
1162 - mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
1163 -};
1164 -
1165 -jQuery.each({
1166 - parent: function(elem){return elem.parentNode;},
1167 - parents: function(elem){return jQuery.dir(elem,"parentNode");},
1168 - next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
1169 - prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
1170 - nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
1171 - prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
1172 - siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
1173 - children: function(elem){return jQuery.sibling(elem.firstChild);},
1174 - contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
1175 -}, function(name, fn){
1176 - jQuery.fn[ name ] = function( selector ) {
1177 - var ret = jQuery.map( this, fn );
1178 -
1179 - if ( selector && typeof selector == "string" )
1180 - ret = jQuery.multiFilter( selector, ret );
1181 -
1182 - return this.pushStack( jQuery.unique( ret ), name, selector );
1183 - };
1184 -});
1185 -
1186 -jQuery.each({
1187 - appendTo: "append",
1188 - prependTo: "prepend",
1189 - insertBefore: "before",
1190 - insertAfter: "after",
1191 - replaceAll: "replaceWith"
1192 -}, function(name, original){
1193 - jQuery.fn[ name ] = function() {
1194 - var args = arguments;
1195 -
1196 - return this.each(function(){
1197 - for ( var i = 0, length = args.length; i < length; i++ )
1198 - jQuery( args[ i ] )[ original ]( this );
1199 - });
1200 - };
1201 -});
1202 -
1203 -jQuery.each({
1204 - removeAttr: function( name ) {
1205 - jQuery.attr( this, name, "" );
1206 - if (this.nodeType == 1)
1207 - this.removeAttribute( name );
1208 - },
1209 -
1210 - addClass: function( classNames ) {
1211 - jQuery.className.add( this, classNames );
1212 - },
1213 -
1214 - removeClass: function( classNames ) {
1215 - jQuery.className.remove( this, classNames );
1216 - },
1217 -
1218 - toggleClass: function( classNames, state ) {
1219 - if( typeof state !== "boolean" )
1220 - state = !jQuery.className.has( this, classNames );
1221 - jQuery.className[ state ? "add" : "remove" ]( this, classNames );
1222 - },
1223 -
1224 - remove: function( selector ) {
1225 - if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
1226 - // Prevent memory leaks
1227 - jQuery( "*", this ).add([this]).each(function(){
1228 - jQuery.event.remove(this);
1229 - jQuery.removeData(this);
1230 - });
1231 - if (this.parentNode)
1232 - this.parentNode.removeChild( this );
1233 - }
1234 - },
1235 -
1236 - empty: function() {
1237 - // Remove element nodes and prevent memory leaks
1238 - jQuery( ">*", this ).remove();
1239 -
1240 - // Remove any remaining nodes
1241 - while ( this.firstChild )
1242 - this.removeChild( this.firstChild );
1243 - }
1244 -}, function(name, fn){
1245 - jQuery.fn[ name ] = function(){
1246 - return this.each( fn, arguments );
1247 - };
1248 -});
1249 -
1250 -// Helper function used by the dimensions and offset modules
1251 -function num(elem, prop) {
1252 - return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
1253 -}
1254 -var expando = "jQuery" + now(), uuid = 0, windowData = {};
1255 -
1256 -jQuery.extend({
1257 - cache: {},
1258 -
1259 - data: function( elem, name, data ) {
1260 - elem = elem == window ?
1261 - windowData :
1262 - elem;
1263 -
1264 - var id = elem[ expando ];
1265 -
1266 - // Compute a unique ID for the element
1267 - if ( !id )
1268 - id = elem[ expando ] = ++uuid;
1269 -
1270 - // Only generate the data cache if we're
1271 - // trying to access or manipulate it
1272 - if ( name && !jQuery.cache[ id ] )
1273 - jQuery.cache[ id ] = {};
1274 -
1275 - // Prevent overriding the named cache with undefined values
1276 - if ( data !== undefined )
1277 - jQuery.cache[ id ][ name ] = data;
1278 -
1279 - // Return the named cache data, or the ID for the element
1280 - return name ?
1281 - jQuery.cache[ id ][ name ] :
1282 - id;
1283 - },
1284 -
1285 - removeData: function( elem, name ) {
1286 - elem = elem == window ?
1287 - windowData :
1288 - elem;
1289 -
1290 - var id = elem[ expando ];
1291 -
1292 - // If we want to remove a specific section of the element's data
1293 - if ( name ) {
1294 - if ( jQuery.cache[ id ] ) {
1295 - // Remove the section of cache data
1296 - delete jQuery.cache[ id ][ name ];
1297 -
1298 - // If we've removed all the data, remove the element's cache
1299 - name = "";
1300 -
1301 - for ( name in jQuery.cache[ id ] )
1302 - break;
1303 -
1304 - if ( !name )
1305 - jQuery.removeData( elem );
1306 - }
1307 -
1308 - // Otherwise, we want to remove all of the element's data
1309 - } else {
1310 - // Clean up the element expando
1311 - try {
1312 - delete elem[ expando ];
1313 - } catch(e){
1314 - // IE has trouble directly removing the expando
1315 - // but it's ok with using removeAttribute
1316 - if ( elem.removeAttribute )
1317 - elem.removeAttribute( expando );
1318 - }
1319 -
1320 - // Completely remove the data cache
1321 - delete jQuery.cache[ id ];
1322 - }
1323 - },
1324 - queue: function( elem, type, data ) {
1325 - if ( elem ){
1326 -
1327 - type = (type || "fx") + "queue";
1328 -
1329 - var q = jQuery.data( elem, type );
1330 -
1331 - if ( !q || jQuery.isArray(data) )
1332 - q = jQuery.data( elem, type, jQuery.makeArray(data) );
1333 - else if( data )
1334 - q.push( data );
1335 -
1336 - }
1337 - return q;
1338 - },
1339 -
1340 - dequeue: function( elem, type ){
1341 - var queue = jQuery.queue( elem, type ),
1342 - fn = queue.shift();
1343 -
1344 - if( !type || type === "fx" )
1345 - fn = queue[0];
1346 -
1347 - if( fn !== undefined )
1348 - fn.call(elem);
1349 - }
1350 -});
1351 -
1352 -jQuery.fn.extend({
1353 - data: function( key, value ){
1354 - var parts = key.split(".");
1355 - parts[1] = parts[1] ? "." + parts[1] : "";
1356 -
1357 - if ( value === undefined ) {
1358 - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
1359 -
1360 - if ( data === undefined && this.length )
1361 - data = jQuery.data( this[0], key );
1362 -
1363 - return data === undefined && parts[1] ?
1364 - this.data( parts[0] ) :
1365 - data;
1366 - } else
1367 - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
1368 - jQuery.data( this, key, value );
1369 - });
1370 - },
1371 -
1372 - removeData: function( key ){
1373 - return this.each(function(){
1374 - jQuery.removeData( this, key );
1375 - });
1376 - },
1377 - queue: function(type, data){
1378 - if ( typeof type !== "string" ) {
1379 - data = type;
1380 - type = "fx";
1381 - }
1382 -
1383 - if ( data === undefined )
1384 - return jQuery.queue( this[0], type );
1385 -
1386 - return this.each(function(){
1387 - var queue = jQuery.queue( this, type, data );
1388 -
1389 - if( type == "fx" && queue.length == 1 )
1390 - queue[0].call(this);
1391 - });
1392 - },
1393 - dequeue: function(type){
1394 - return this.each(function(){
1395 - jQuery.dequeue( this, type );
1396 - });
1397 - }
1398 -});/*!
1399 - * Sizzle CSS Selector Engine - v0.9.3
1400 - * Copyright 2009, The Dojo Foundation
1401 - * Released under the MIT, BSD, and GPL Licenses.
1402 - * More information: http://sizzlejs.com/
1403 - */
1404 -(function(){
1405 -
1406 -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,
1407 - done = 0,
1408 - toString = Object.prototype.toString;
1409 -
1410 -var Sizzle = function(selector, context, results, seed) {
1411 - results = results || [];
1412 - context = context || document;
1413 -
1414 - if ( context.nodeType !== 1 && context.nodeType !== 9 )
1415 - return [];
1416 -
1417 - if ( !selector || typeof selector !== "string" ) {
1418 - return results;
1419 - }
1420 -
1421 - var parts = [], m, set, checkSet, check, mode, extra, prune = true;
1422 -
1423 - // Reset the position of the chunker regexp (start from head)
1424 - chunker.lastIndex = 0;
1425 -
1426 - while ( (m = chunker.exec(selector)) !== null ) {
1427 - parts.push( m[1] );
1428 -
1429 - if ( m[2] ) {
1430 - extra = RegExp.rightContext;
1431 - break;
1432 - }
1433 - }
1434 -
1435 - if ( parts.length > 1 && origPOS.exec( selector ) ) {
1436 - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
1437 - set = posProcess( parts[0] + parts[1], context );
1438 - } else {
1439 - set = Expr.relative[ parts[0] ] ?
1440 - [ context ] :
1441 - Sizzle( parts.shift(), context );
1442 -
1443 - while ( parts.length ) {
1444 - selector = parts.shift();
1445 -
1446 - if ( Expr.relative[ selector ] )
1447 - selector += parts.shift();
1448 -
1449 - set = posProcess( selector, set );
1450 - }
1451 - }
1452 - } else {
1453 - var ret = seed ?
1454 - { expr: parts.pop(), set: makeArray(seed) } :
1455 - Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );
1456 - set = Sizzle.filter( ret.expr, ret.set );
1457 -
1458 - if ( parts.length > 0 ) {
1459 - checkSet = makeArray(set);
1460 - } else {
1461 - prune = false;
1462 - }
1463 -
1464 - while ( parts.length ) {
1465 - var cur = parts.pop(), pop = cur;
1466 -
1467 - if ( !Expr.relative[ cur ] ) {
1468 - cur = "";
1469 - } else {
1470 - pop = parts.pop();
1471 - }
1472 -
1473 - if ( pop == null ) {
1474 - pop = context;
1475 - }
1476 -
1477 - Expr.relative[ cur ]( checkSet, pop, isXML(context) );
1478 - }
1479 - }
1480 -
1481 - if ( !checkSet ) {
1482 - checkSet = set;
1483 - }
1484 -
1485 - if ( !checkSet ) {
1486 - throw "Syntax error, unrecognized expression: " + (cur || selector);
1487 - }
1488 -
1489 - if ( toString.call(checkSet) === "[object Array]" ) {
1490 - if ( !prune ) {
1491 - results.push.apply( results, checkSet );
1492 - } else if ( context.nodeType === 1 ) {
1493 - for ( var i = 0; checkSet[i] != null; i++ ) {
1494 - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
1495 - results.push( set[i] );
1496 - }
1497 - }
1498 - } else {
1499 - for ( var i = 0; checkSet[i] != null; i++ ) {
1500 - if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
1501 - results.push( set[i] );
1502 - }
1503 - }
1504 - }
1505 - } else {
1506 - makeArray( checkSet, results );
1507 - }
1508 -
1509 - if ( extra ) {
1510 - Sizzle( extra, context, results, seed );
1511 - }
1512 -
1513 - return results;
1514 -};
1515 -
1516 -Sizzle.matches = function(expr, set){
1517 - return Sizzle(expr, null, null, set);
1518 -};
1519 -
1520 -Sizzle.find = function(expr, context, isXML){
1521 - var set, match;
1522 -
1523 - if ( !expr ) {
1524 - return [];
1525 - }
1526 -
1527 - for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
1528 - var type = Expr.order[i], match;
1529 -
1530 - if ( (match = Expr.match[ type ].exec( expr )) ) {
1531 - var left = RegExp.leftContext;
1532 -
1533 - if ( left.substr( left.length - 1 ) !== "\\" ) {
1534 - match[1] = (match[1] || "").replace(/\\/g, "");
1535 - set = Expr.find[ type ]( match, context, isXML );
1536 - if ( set != null ) {
1537 - expr = expr.replace( Expr.match[ type ], "" );
1538 - break;
1539 - }
1540 - }
1541 - }
1542 - }
1543 -
1544 - if ( !set ) {
1545 - set = context.getElementsByTagName("*");
1546 - }
1547 -
1548 - return {set: set, expr: expr};
1549 -};
1550 -
1551 -Sizzle.filter = function(expr, set, inplace, not){
1552 - var old = expr, result = [], curLoop = set, match, anyFound;
1553 -
1554 - while ( expr && set.length ) {
1555 - for ( var type in Expr.filter ) {
1556 - if ( (match = Expr.match[ type ].exec( expr )) != null ) {
1557 - var filter = Expr.filter[ type ], found, item;
1558 - anyFound = false;
1559 -
1560 - if ( curLoop == result ) {
1561 - result = [];
1562 - }
1563 -
1564 - if ( Expr.preFilter[ type ] ) {
1565 - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not );
1566 -
1567 - if ( !match ) {
1568 - anyFound = found = true;
1569 - } else if ( match === true ) {
1570 - continue;
1571 - }
1572 - }
1573 -
1574 - if ( match ) {
1575 - for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
1576 - if ( item ) {
1577 - found = filter( item, match, i, curLoop );
1578 - var pass = not ^ !!found;
1579 -
1580 - if ( inplace && found != null ) {
1581 - if ( pass ) {
1582 - anyFound = true;
1583 - } else {
1584 - curLoop[i] = false;
1585 - }
1586 - } else if ( pass ) {
1587 - result.push( item );
1588 - anyFound = true;
1589 - }
1590 - }
1591 - }
1592 - }
1593 -
1594 - if ( found !== undefined ) {
1595 - if ( !inplace ) {
1596 - curLoop = result;
1597 - }
1598 -
1599 - expr = expr.replace( Expr.match[ type ], "" );
1600 -
1601 - if ( !anyFound ) {
1602 - return [];
1603 - }
1604 -
1605 - break;
1606 - }
1607 - }
1608 - }
1609 -
1610 - expr = expr.replace(/\s*,\s*/, "");
1611 -
1612 - // Improper expression
1613 - if ( expr == old ) {
1614 - if ( anyFound == null ) {
1615 - throw "Syntax error, unrecognized expression: " + expr;
1616 - } else {
1617 - break;
1618 - }
1619 - }
1620 -
1621 - old = expr;
1622 - }
1623 -
1624 - return curLoop;
1625 -};
1626 -
1627 -var Expr = Sizzle.selectors = {
1628 - order: [ "ID", "NAME", "TAG" ],
1629 - match: {
1630 - ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
1631 - CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
1632 - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
1633 - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
1634 - TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
1635 - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
1636 - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
1637 - PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
1638 - },
1639 - attrMap: {
1640 - "class": "className",
1641 - "for": "htmlFor"
1642 - },
1643 - attrHandle: {
1644 - href: function(elem){
1645 - return elem.getAttribute("href");
1646 - }
1647 - },
1648 - relative: {
1649 - "+": function(checkSet, part){
1650 - for ( var i = 0, l = checkSet.length; i < l; i++ ) {
1651 - var elem = checkSet[i];
1652 - if ( elem ) {
1653 - var cur = elem.previousSibling;
1654 - while ( cur && cur.nodeType !== 1 ) {
1655 - cur = cur.previousSibling;
1656 - }
1657 - checkSet[i] = typeof part === "string" ?
1658 - cur || false :
1659 - cur === part;
1660 - }
1661 - }
1662 -
1663 - if ( typeof part === "string" ) {
1664 - Sizzle.filter( part, checkSet, true );
1665 - }
1666 - },
1667 - ">": function(checkSet, part, isXML){
1668 - if ( typeof part === "string" && !/\W/.test(part) ) {
1669 - part = isXML ? part : part.toUpperCase();
1670 -
1671 - for ( var i = 0, l = checkSet.length; i < l; i++ ) {
1672 - var elem = checkSet[i];
1673 - if ( elem ) {
1674 - var parent = elem.parentNode;
1675 - checkSet[i] = parent.nodeName === part ? parent : false;
1676 - }
1677 - }
1678 - } else {
1679 - for ( var i = 0, l = checkSet.length; i < l; i++ ) {
1680 - var elem = checkSet[i];
1681 - if ( elem ) {
1682 - checkSet[i] = typeof part === "string" ?
1683 - elem.parentNode :
1684 - elem.parentNode === part;
1685 - }
1686 - }
1687 -
1688 - if ( typeof part === "string" ) {
1689 - Sizzle.filter( part, checkSet, true );
1690 - }
1691 - }
1692 - },
1693 - "": function(checkSet, part, isXML){
1694 - var doneName = "done" + (done++), checkFn = dirCheck;
1695 -
1696 - if ( !part.match(/\W/) ) {
1697 - var nodeCheck = part = isXML ? part : part.toUpperCase();
1698 - checkFn = dirNodeCheck;
1699 - }
1700 -
1701 - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
1702 - },
1703 - "~": function(checkSet, part, isXML){
1704 - var doneName = "done" + (done++), checkFn = dirCheck;
1705 -
1706 - if ( typeof part === "string" && !part.match(/\W/) ) {
1707 - var nodeCheck = part = isXML ? part : part.toUpperCase();
1708 - checkFn = dirNodeCheck;
1709 - }
1710 -
1711 - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
1712 - }
1713 - },
1714 - find: {
1715 - ID: function(match, context, isXML){
1716 - if ( typeof context.getElementById !== "undefined" && !isXML ) {
1717 - var m = context.getElementById(match[1]);
1718 - return m ? [m] : [];
1719 - }
1720 - },
1721 - NAME: function(match, context, isXML){
1722 - if ( typeof context.getElementsByName !== "undefined" && !isXML ) {
1723 - return context.getElementsByName(match[1]);
1724 - }
1725 - },
1726 - TAG: function(match, context){
1727 - return context.getElementsByTagName(match[1]);
1728 - }
1729 - },
1730 - preFilter: {
1731 - CLASS: function(match, curLoop, inplace, result, not){
1732 - match = " " + match[1].replace(/\\/g, "") + " ";
1733 -
1734 - var elem;
1735 - for ( var i = 0; (elem = curLoop[i]) != null; i++ ) {
1736 - if ( elem ) {
1737 - if ( not ^ (" " + elem.className + " ").indexOf(match) >= 0 ) {
1738 - if ( !inplace )
1739 - result.push( elem );
1740 - } else if ( inplace ) {
1741 - curLoop[i] = false;
1742 - }
1743 - }
1744 - }
1745 -
1746 - return false;
1747 - },
1748 - ID: function(match){
1749 - return match[1].replace(/\\/g, "");
1750 - },
1751 - TAG: function(match, curLoop){
1752 - for ( var i = 0; curLoop[i] === false; i++ ){}
1753 - return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
1754 - },
1755 - CHILD: function(match){
1756 - if ( match[1] == "nth" ) {
1757 - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
1758 - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
1759 - match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
1760 - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
1761 -
1762 - // calculate the numbers (first)n+(last) including if they are negative
1763 - match[2] = (test[1] + (test[2] || 1)) - 0;
1764 - match[3] = test[3] - 0;
1765 - }
1766 -
1767 - // TODO: Move to normal caching system
1768 - match[0] = "done" + (done++);
1769 -
1770 - return match;
1771 - },
1772 - ATTR: function(match){
1773 - var name = match[1].replace(/\\/g, "");
1774 -
1775 - if ( Expr.attrMap[name] ) {
1776 - match[1] = Expr.attrMap[name];
1777 - }
1778 -
1779 - if ( match[2] === "~=" ) {
1780 - match[4] = " " + match[4] + " ";
1781 - }
1782 -
1783 - return match;
1784 - },
1785 - PSEUDO: function(match, curLoop, inplace, result, not){
1786 - if ( match[1] === "not" ) {
1787 - // If we're dealing with a complex expression, or a simple one
1788 - if ( match[3].match(chunker).length > 1 ) {
1789 - match[3] = Sizzle(match[3], null, null, curLoop);
1790 - } else {
1791 - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
1792 - if ( !inplace ) {
1793 - result.push.apply( result, ret );
1794 - }
1795 - return false;
1796 - }
1797 - } else if ( Expr.match.POS.test( match[0] ) ) {
1798 - return true;
1799 - }
1800 -
1801 - return match;
1802 - },
1803 - POS: function(match){
1804 - match.unshift( true );
1805 - return match;
1806 - }
1807 - },
1808 - filters: {
1809 - enabled: function(elem){
1810 - return elem.disabled === false && elem.type !== "hidden";
1811 - },
1812 - disabled: function(elem){
1813 - return elem.disabled === true;
1814 - },
1815 - checked: function(elem){
1816 - return elem.checked === true;
1817 - },
1818 - selected: function(elem){
1819 - // Accessing this property makes selected-by-default
1820 - // options in Safari work properly
1821 - elem.parentNode.selectedIndex;
1822 - return elem.selected === true;
1823 - },
1824 - parent: function(elem){
1825 - return !!elem.firstChild;
1826 - },
1827 - empty: function(elem){
1828 - return !elem.firstChild;
1829 - },
1830 - has: function(elem, i, match){
1831 - return !!Sizzle( match[3], elem ).length;
1832 - },
1833 - header: function(elem){
1834 - return /h\d/i.test( elem.nodeName );
1835 - },
1836 - text: function(elem){
1837 - return "text" === elem.type;
1838 - },
1839 - radio: function(elem){
1840 - return "radio" === elem.type;
1841 - },
1842 - checkbox: function(elem){
1843 - return "checkbox" === elem.type;
1844 - },
1845 - file: function(elem){
1846 - return "file" === elem.type;
1847 - },
1848 - password: function(elem){
1849 - return "password" === elem.type;
1850 - },
1851 - submit: function(elem){
1852 - return "submit" === elem.type;
1853 - },
1854 - image: function(elem){
1855 - return "image" === elem.type;
1856 - },
1857 - reset: function(elem){
1858 - return "reset" === elem.type;
1859 - },
1860 - button: function(elem){
1861 - return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
1862 - },
1863 - input: function(elem){
1864 - return /input|select|textarea|button/i.test(elem.nodeName);
1865 - }
1866 - },
1867 - setFilters: {
1868 - first: function(elem, i){
1869 - return i === 0;
1870 - },
1871 - last: function(elem, i, match, array){
1872 - return i === array.length - 1;
1873 - },
1874 - even: function(elem, i){
1875 - return i % 2 === 0;
1876 - },
1877 - odd: function(elem, i){
1878 - return i % 2 === 1;
1879 - },
1880 - lt: function(elem, i, match){
1881 - return i < match[3] - 0;
1882 - },
1883 - gt: function(elem, i, match){
1884 - return i > match[3] - 0;
1885 - },
1886 - nth: function(elem, i, match){
1887 - return match[3] - 0 == i;
1888 - },
1889 - eq: function(elem, i, match){
1890 - return match[3] - 0 == i;
1891 - }
1892 - },
1893 - filter: {
1894 - CHILD: function(elem, match){
1895 - var type = match[1], parent = elem.parentNode;
1896 -
1897 - var doneName = match[0];
1898 -
1899 - if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) {
1900 - var count = 1;
1901 -
1902 - for ( var node = parent.firstChild; node; node = node.nextSibling ) {
1903 - if ( node.nodeType == 1 ) {
1904 - node.nodeIndex = count++;
1905 - }
1906 - }
1907 -
1908 - parent[ doneName ] = count - 1;
1909 - }
1910 -
1911 - if ( type == "first" ) {
1912 - return elem.nodeIndex == 1;
1913 - } else if ( type == "last" ) {
1914 - return elem.nodeIndex == parent[ doneName ];
1915 - } else if ( type == "only" ) {
1916 - return parent[ doneName ] == 1;
1917 - } else if ( type == "nth" ) {
1918 - var add = false, first = match[2], last = match[3];
1919 -
1920 - if ( first == 1 && last == 0 ) {
1921 - return true;
1922 - }
1923 -
1924 - if ( first == 0 ) {
1925 - if ( elem.nodeIndex == last ) {
1926 - add = true;
1927 - }
1928 - } else if ( (elem.nodeIndex - last) % first == 0 && (elem.nodeIndex - last) / first >= 0 ) {
1929 - add = true;
1930 - }
1931 -
1932 - return add;
1933 - }
1934 - },
1935 - PSEUDO: function(elem, match, i, array){
1936 - var name = match[1], filter = Expr.filters[ name ];
1937 -
1938 - if ( filter ) {
1939 - return filter( elem, i, match, array );
1940 - } else if ( name === "contains" ) {
1941 - return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
1942 - } else if ( name === "not" ) {
1943 - var not = match[3];
1944 -
1945 - for ( var i = 0, l = not.length; i < l; i++ ) {
1946 - if ( not[i] === elem ) {
1947 - return false;
1948 - }
1949 - }
1950 -
1951 - return true;
1952 - }
1953 - },
1954 - ID: function(elem, match){
1955 - return elem.nodeType === 1 && elem.getAttribute("id") === match;
1956 - },
1957 - TAG: function(elem, match){
1958 - return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
1959 - },
1960 - CLASS: function(elem, match){
1961 - return match.test( elem.className );
1962 - },
1963 - ATTR: function(elem, match){
1964 - var result = Expr.attrHandle[ match[1] ] ? Expr.attrHandle[ match[1] ]( elem ) : elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4];
1965 - return result == null ?
1966 - type === "!=" :
1967 - type === "=" ?
1968 - value === check :
1969 - type === "*=" ?
1970 - value.indexOf(check) >= 0 :
1971 - type === "~=" ?
1972 - (" " + value + " ").indexOf(check) >= 0 :
1973 - !match[4] ?
1974 - result :
1975 - type === "!=" ?
1976 - value != check :
1977 - type === "^=" ?
1978 - value.indexOf(check) === 0 :
1979 - type === "$=" ?
1980 - value.substr(value.length - check.length) === check :
1981 - type === "|=" ?
1982 - value === check || value.substr(0, check.length + 1) === check + "-" :
1983 - false;
1984 - },
1985 - POS: function(elem, match, i, array){
1986 - var name = match[2], filter = Expr.setFilters[ name ];
1987 -
1988 - if ( filter ) {
1989 - return filter( elem, i, match, array );
1990 - }
1991 - }
1992 - }
1993 -};
1994 -
1995 -var origPOS = Expr.match.POS;
1996 -
1997 -for ( var type in Expr.match ) {
1998 - Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
1999 -}
2000 -
2001 -var makeArray = function(array, results) {
2002 - array = Array.prototype.slice.call( array );
2003 -
2004 - if ( results ) {
2005 - results.push.apply( results, array );
2006 - return results;
2007 - }
2008 -
2009 - return array;
2010 -};
2011 -
2012 -// Perform a simple check to determine if the browser is capable of
2013 -// converting a NodeList to an array using builtin methods.
2014 -try {
2015 - Array.prototype.slice.call( document.documentElement.childNodes );
2016 -
2017 -// Provide a fallback method if it does not work
2018 -} catch(e){
2019 - makeArray = function(array, results) {
2020 - var ret = results || [];
2021 -
2022 - if ( toString.call(array) === "[object Array]" ) {
2023 - Array.prototype.push.apply( ret, array );
2024 - } else {
2025 - if ( typeof array.length === "number" ) {
2026 - for ( var i = 0, l = array.length; i < l; i++ ) {
2027 - ret.push( array[i] );
2028 - }
2029 - } else {
2030 - for ( var i = 0; array[i]; i++ ) {
2031 - ret.push( array[i] );
2032 - }
2033 - }
2034 - }
2035 -
2036 - return ret;
2037 - };
2038 -}
2039 -
2040 -// Check to see if the browser returns elements by name when
2041 -// querying by getElementById (and provide a workaround)
2042 -(function(){
2043 - // We're going to inject a fake input element with a specified name
2044 - var form = document.createElement("form"),
2045 - id = "script" + (new Date).getTime();
2046 - form.innerHTML = "<input name='" + id + "'/>";
2047 -
2048 - // Inject it into the root element, check its status, and remove it quickly
2049 - var root = document.documentElement;
2050 - root.insertBefore( form, root.firstChild );
2051 -
2052 - // The workaround has to do additional checks after a getElementById
2053 - // Which slows things down for other browsers (hence the branching)
2054 - if ( !!document.getElementById( id ) ) {
2055 - Expr.find.ID = function(match, context, isXML){
2056 - if ( typeof context.getElementById !== "undefined" && !isXML ) {
2057 - var m = context.getElementById(match[1]);
2058 - return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
2059 - }
2060 - };
2061 -
2062 - Expr.filter.ID = function(elem, match){
2063 - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
2064 - return elem.nodeType === 1 && node && node.nodeValue === match;
2065 - };
2066 - }
2067 -
2068 - root.removeChild( form );
2069 -})();
2070 -
2071 -(function(){
2072 - // Check to see if the browser returns only elements
2073 - // when doing getElementsByTagName("*")
2074 -
2075 - // Create a fake element
2076 - var div = document.createElement("div");
2077 - div.appendChild( document.createComment("") );
2078 -
2079 - // Make sure no comments are found
2080 - if ( div.getElementsByTagName("*").length > 0 ) {
2081 - Expr.find.TAG = function(match, context){
2082 - var results = context.getElementsByTagName(match[1]);
2083 -
2084 - // Filter out possible comments
2085 - if ( match[1] === "*" ) {
2086 - var tmp = [];
2087 -
2088 - for ( var i = 0; results[i]; i++ ) {
2089 - if ( results[i].nodeType === 1 ) {
2090 - tmp.push( results[i] );
2091 - }
2092 - }
2093 -
2094 - results = tmp;
2095 - }
2096 -
2097 - return results;
2098 - };
2099 - }
2100 -
2101 - // Check to see if an attribute returns normalized href attributes
2102 - div.innerHTML = "<a href='#'></a>";
2103 - if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) {
2104 - Expr.attrHandle.href = function(elem){
2105 - return elem.getAttribute("href", 2);
2106 - };
2107 - }
2108 -})();
2109 -
2110 -if ( document.querySelectorAll ) (function(){
2111 - var oldSizzle = Sizzle, div = document.createElement("div");
2112 - div.innerHTML = "<p class='TEST'></p>";
2113 -
2114 - // Safari can't handle uppercase or unicode characters when
2115 - // in quirks mode.
2116 - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
2117 - return;
2118 - }
2119 -
2120 - Sizzle = function(query, context, extra, seed){
2121 - context = context || document;
2122 -
2123 - // Only use querySelectorAll on non-XML documents
2124 - // (ID selectors don't work in non-HTML documents)
2125 - if ( !seed && context.nodeType === 9 && !isXML(context) ) {
2126 - try {
2127 - return makeArray( context.querySelectorAll(query), extra );
2128 - } catch(e){}
2129 - }
2130 -
2131 - return oldSizzle(query, context, extra, seed);
2132 - };
2133 -
2134 - Sizzle.find = oldSizzle.find;
2135 - Sizzle.filter = oldSizzle.filter;
2136 - Sizzle.selectors = oldSizzle.selectors;
2137 - Sizzle.matches = oldSizzle.matches;
2138 -})();
2139 -
2140 -if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) {
2141 - Expr.order.splice(1, 0, "CLASS");
2142 - Expr.find.CLASS = function(match, context) {
2143 - return context.getElementsByClassName(match[1]);
2144 - };
2145 -}
2146 -
2147 -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
2148 - for ( var i = 0, l = checkSet.length; i < l; i++ ) {
2149 - var elem = checkSet[i];
2150 - if ( elem ) {
2151 - elem = elem[dir];
2152 - var match = false;
2153 -
2154 - while ( elem && elem.nodeType ) {
2155 - var done = elem[doneName];
2156 - if ( done ) {
2157 - match = checkSet[ done ];
2158 - break;
2159 - }
2160 -
2161 - if ( elem.nodeType === 1 && !isXML )
2162 - elem[doneName] = i;
2163 -
2164 - if ( elem.nodeName === cur ) {
2165 - match = elem;
2166 - break;
2167 - }
2168 -
2169 - elem = elem[dir];
2170 - }
2171 -
2172 - checkSet[i] = match;
2173 - }
2174 - }
2175 -}
2176 -
2177 -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
2178 - for ( var i = 0, l = checkSet.length; i < l; i++ ) {
2179 - var elem = checkSet[i];
2180 - if ( elem ) {
2181 - elem = elem[dir];
2182 - var match = false;
2183 -
2184 - while ( elem && elem.nodeType ) {
2185 - if ( elem[doneName] ) {
2186 - match = checkSet[ elem[doneName] ];
2187 - break;
2188 - }
2189 -
2190 - if ( elem.nodeType === 1 ) {
2191 - if ( !isXML )
2192 - elem[doneName] = i;
2193 -
2194 - if ( typeof cur !== "string" ) {
2195 - if ( elem === cur ) {
2196 - match = true;
2197 - break;
2198 - }
2199 -
2200 - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
2201 - match = elem;
2202 - break;
2203 - }
2204 - }
2205 -
2206 - elem = elem[dir];
2207 - }
2208 -
2209 - checkSet[i] = match;
2210 - }
2211 - }
2212 -}
2213 -
2214 -var contains = document.compareDocumentPosition ? function(a, b){
2215 - return a.compareDocumentPosition(b) & 16;
2216 -} : function(a, b){
2217 - return a !== b && (a.contains ? a.contains(b) : true);
2218 -};
2219 -
2220 -var isXML = function(elem){
2221 - return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
2222 - !!elem.ownerDocument && isXML( elem.ownerDocument );
2223 -};
2224 -
2225 -var posProcess = function(selector, context){
2226 - var tmpSet = [], later = "", match,
2227 - root = context.nodeType ? [context] : context;
2228 -
2229 - // Position selectors must be done after the filter
2230 - // And so must :not(positional) so we move all PSEUDOs to the end
2231 - while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
2232 - later += match[0];
2233 - selector = selector.replace( Expr.match.PSEUDO, "" );
2234 - }
2235 -
2236 - selector = Expr.relative[selector] ? selector + "*" : selector;
2237 -
2238 - for ( var i = 0, l = root.length; i < l; i++ ) {
2239 - Sizzle( selector, root[i], tmpSet );
2240 - }
2241 -
2242 - return Sizzle.filter( later, tmpSet );
2243 -};
2244 -
2245 -// EXPOSE
2246 -jQuery.find = Sizzle;
2247 -jQuery.filter = Sizzle.filter;
2248 -jQuery.expr = Sizzle.selectors;
2249 -jQuery.expr[":"] = jQuery.expr.filters;
2250 -
2251 -Sizzle.selectors.filters.hidden = function(elem){
2252 - return "hidden" === elem.type ||
2253 - jQuery.css(elem, "display") === "none" ||
2254 - jQuery.css(elem, "visibility") === "hidden";
2255 -};
2256 -
2257 -Sizzle.selectors.filters.visible = function(elem){
2258 - return "hidden" !== elem.type &&
2259 - jQuery.css(elem, "display") !== "none" &&
2260 - jQuery.css(elem, "visibility") !== "hidden";
2261 -};
2262 -
2263 -Sizzle.selectors.filters.animated = function(elem){
2264 - return jQuery.grep(jQuery.timers, function(fn){
2265 - return elem === fn.elem;
2266 - }).length;
2267 -};
2268 -
2269 -jQuery.multiFilter = function( expr, elems, not ) {
2270 - if ( not ) {
2271 - expr = ":not(" + expr + ")";
2272 - }
2273 -
2274 - return Sizzle.matches(expr, elems);
2275 -};
2276 -
2277 -jQuery.dir = function( elem, dir ){
2278 - var matched = [], cur = elem[dir];
2279 - while ( cur && cur != document ) {
2280 - if ( cur.nodeType == 1 )
2281 - matched.push( cur );
2282 - cur = cur[dir];
2283 - }
2284 - return matched;
2285 -};
2286 -
2287 -jQuery.nth = function(cur, result, dir, elem){
2288 - result = result || 1;
2289 - var num = 0;
2290 -
2291 - for ( ; cur; cur = cur[dir] )
2292 - if ( cur.nodeType == 1 && ++num == result )
2293 - break;
2294 -
2295 - return cur;
2296 -};
2297 -
2298 -jQuery.sibling = function(n, elem){
2299 - var r = [];
2300 -
2301 - for ( ; n; n = n.nextSibling ) {
2302 - if ( n.nodeType == 1 && n != elem )
2303 - r.push( n );
2304 - }
2305 -
2306 - return r;
2307 -};
2308 -
2309 -return;
2310 -
2311 -window.Sizzle = Sizzle;
2312 -
2313 -})();
2314 -/*
2315 - * A number of helper functions used for managing events.
2316 - * Many of the ideas behind this code originated from
2317 - * Dean Edwards' addEvent library.
2318 - */
2319 -jQuery.event = {
2320 -
2321 - // Bind an event to an element
2322 - // Original by Dean Edwards
2323 - add: function(elem, types, handler, data) {
2324 - if ( elem.nodeType == 3 || elem.nodeType == 8 )
2325 - return;
2326 -
2327 - // For whatever reason, IE has trouble passing the window object
2328 - // around, causing it to be cloned in the process
2329 - if ( elem.setInterval && elem != window )
2330 - elem = window;
2331 -
2332 - // Make sure that the function being executed has a unique ID
2333 - if ( !handler.guid )
2334 - handler.guid = this.guid++;
2335 -
2336 - // if data is passed, bind to handler
2337 - if ( data !== undefined ) {
2338 - // Create temporary function pointer to original handler
2339 - var fn = handler;
2340 -
2341 - // Create unique handler function, wrapped around original handler
2342 - handler = this.proxy( fn );
2343 -
2344 - // Store data in unique handler
2345 - handler.data = data;
2346 - }
2347 -
2348 - // Init the element's event structure
2349 - var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
2350 - handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
2351 - // Handle the second event of a trigger and when
2352 - // an event is called after a page has unloaded
2353 - return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
2354 - jQuery.event.handle.apply(arguments.callee.elem, arguments) :
2355 - undefined;
2356 - });
2357 - // Add elem as a property of the handle function
2358 - // This is to prevent a memory leak with non-native
2359 - // event in IE.
2360 - handle.elem = elem;
2361 -
2362 - // Handle multiple events separated by a space
2363 - // jQuery(...).bind("mouseover mouseout", fn);
2364 - jQuery.each(types.split(/\s+/), function(index, type) {
2365 - // Namespaced event handlers
2366 - var namespaces = type.split(".");
2367 - type = namespaces.shift();
2368 - handler.type = namespaces.slice().sort().join(".");
2369 -
2370 - // Get the current list of functions bound to this event
2371 - var handlers = events[type];
2372 -
2373 - if ( jQuery.event.specialAll[type] )
2374 - jQuery.event.specialAll[type].setup.call(elem, data, namespaces);
2375 -
2376 - // Init the event handler queue
2377 - if (!handlers) {
2378 - handlers = events[type] = {};
2379 -
2380 - // Check for a special event handler
2381 - // Only use addEventListener/attachEvent if the special
2382 - // events handler returns false
2383 - if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
2384 - // Bind the global event handler to the element
2385 - if (elem.addEventListener)
2386 - elem.addEventListener(type, handle, false);
2387 - else if (elem.attachEvent)
2388 - elem.attachEvent("on" + type, handle);
2389 - }
2390 - }
2391 -
2392 - // Add the function to the element's handler list
2393 - handlers[handler.guid] = handler;
2394 -
2395 - // Keep track of which events have been used, for global triggering
2396 - jQuery.event.global[type] = true;
2397 - });
2398 -
2399 - // Nullify elem to prevent memory leaks in IE
2400 - elem = null;
2401 - },
2402 -
2403 - guid: 1,
2404 - global: {},
2405 -
2406 - // Detach an event or set of events from an element
2407 - remove: function(elem, types, handler) {
2408 - // don't do events on text and comment nodes
2409 - if ( elem.nodeType == 3 || elem.nodeType == 8 )
2410 - return;
2411 -
2412 - var events = jQuery.data(elem, "events"), ret, index;
2413 -
2414 - if ( events ) {
2415 - // Unbind all events for the element
2416 - if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )
2417 - for ( var type in events )
2418 - this.remove( elem, type + (types || "") );
2419 - else {
2420 - // types is actually an event object here
2421 - if ( types.type ) {
2422 - handler = types.handler;
2423 - types = types.type;
2424 - }
2425 -
2426 - // Handle multiple events seperated by a space
2427 - // jQuery(...).unbind("mouseover mouseout", fn);
2428 - jQuery.each(types.split(/\s+/), function(index, type){
2429 - // Namespaced event handlers
2430 - var namespaces = type.split(".");
2431 - type = namespaces.shift();
2432 - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
2433 -
2434 - if ( events[type] ) {
2435 - // remove the given handler for the given type
2436 - if ( handler )
2437 - delete events[type][handler.guid];
2438 -
2439 - // remove all handlers for the given type
2440 - else
2441 - for ( var handle in events[type] )
2442 - // Handle the removal of namespaced events
2443 - if ( namespace.test(events[type][handle].type) )
2444 - delete events[type][handle];
2445 -
2446 - if ( jQuery.event.specialAll[type] )
2447 - jQuery.event.specialAll[type].teardown.call(elem, namespaces);
2448 -
2449 - // remove generic event handler if no more handlers exist
2450 - for ( ret in events[type] ) break;
2451 - if ( !ret ) {
2452 - if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
2453 - if (elem.removeEventListener)
2454 - elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
2455 - else if (elem.detachEvent)
2456 - elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
2457 - }
2458 - ret = null;
2459 - delete events[type];
2460 - }
2461 - }
2462 - });
2463 - }
2464 -
2465 - // Remove the expando if it's no longer used
2466 - for ( ret in events ) break;
2467 - if ( !ret ) {
2468 - var handle = jQuery.data( elem, "handle" );
2469 - if ( handle ) handle.elem = null;
2470 - jQuery.removeData( elem, "events" );
2471 - jQuery.removeData( elem, "handle" );
2472 - }
2473 - }
2474 - },
2475 -
2476 - // bubbling is internal
2477 - trigger: function( event, data, elem, bubbling ) {
2478 - // Event object or event type
2479 - var type = event.type || event;
2480 -
2481 - if( !bubbling ){
2482 - event = typeof event === "object" ?
2483 - // jQuery.Event object
2484 - event[expando] ? event :
2485 - // Object literal
2486 - jQuery.extend( jQuery.Event(type), event ) :
2487 - // Just the event type (string)
2488 - jQuery.Event(type);
2489 -
2490 - if ( type.indexOf("!") >= 0 ) {
2491 - event.type = type = type.slice(0, -1);
2492 - event.exclusive = true;
2493 - }
2494 -
2495 - // Handle a global trigger
2496 - if ( !elem ) {
2497 - // Don't bubble custom events when global (to avoid too much overhead)
2498 - event.stopPropagation();
2499 - // Only trigger if we've ever bound an event for it
2500 - if ( this.global[type] )
2501 - jQuery.each( jQuery.cache, function(){
2502 - if ( this.events && this.events[type] )
2503 - jQuery.event.trigger( event, data, this.handle.elem );
2504 - });
2505 - }
2506 -
2507 - // Handle triggering a single element
2508 -
2509 - // don't do events on text and comment nodes
2510 - if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
2511 - return undefined;
2512 -
2513 - // Clean up in case it is reused
2514 - event.result = undefined;
2515 - event.target = elem;
2516 -
2517 - // Clone the incoming data, if any
2518 - data = jQuery.makeArray(data);
2519 - data.unshift( event );
2520 - }
2521 -
2522 - event.currentTarget = elem;
2523 -
2524 - // Trigger the event, it is assumed that "handle" is a function
2525 - var handle = jQuery.data(elem, "handle");
2526 - if ( handle )
2527 - handle.apply( elem, data );
2528 -
2529 - // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
2530 - if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
2531 - event.result = false;
2532 -
2533 - // Trigger the native events (except for clicks on links)
2534 - if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
2535 - this.triggered = true;
2536 - try {
2537 - elem[ type ]();
2538 - // prevent IE from throwing an error for some hidden elements
2539 - } catch (e) {}
2540 - }
2541 -
2542 - this.triggered = false;
2543 -
2544 - if ( !event.isPropagationStopped() ) {
2545 - var parent = elem.parentNode || elem.ownerDocument;
2546 - if ( parent )
2547 - jQuery.event.trigger(event, data, parent, true);
2548 - }
2549 - },
2550 -
2551 - handle: function(event) {
2552 - // returned undefined or false
2553 - var all, handlers;
2554 -
2555 - event = arguments[0] = jQuery.event.fix( event || window.event );
2556 -
2557 - // Namespaced event handlers
2558 - var namespaces = event.type.split(".");
2559 - event.type = namespaces.shift();
2560 -
2561 - // Cache this now, all = true means, any handler
2562 - all = !namespaces.length && !event.exclusive;
2563 -
2564 - var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
2565 -
2566 - handlers = ( jQuery.data(this, "events") || {} )[event.type];
2567 -
2568 - for ( var j in handlers ) {
2569 - var handler = handlers[j];
2570 -
2571 - // Filter the functions by class
2572 - if ( all || namespace.test(handler.type) ) {
2573 - // Pass in a reference to the handler function itself
2574 - // So that we can later remove it
2575 - event.handler = handler;
2576 - event.data = handler.data;
2577 -
2578 - var ret = handler.apply(this, arguments);
2579 -
2580 - if( ret !== undefined ){
2581 - event.result = ret;
2582 - if ( ret === false ) {
2583 - event.preventDefault();
2584 - event.stopPropagation();
2585 - }
2586 - }
2587 -
2588 - if( event.isImmediatePropagationStopped() )
2589 - break;
2590 -
2591 - }
2592 - }
2593 - },
2594 -
2595 - 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(" "),
2596 -
2597 - fix: function(event) {
2598 - if ( event[expando] )
2599 - return event;
2600 -
2601 - // store a copy of the original event object
2602 - // and "clone" to set read-only properties
2603 - var originalEvent = event;
2604 - event = jQuery.Event( originalEvent );
2605 -
2606 - for ( var i = this.props.length, prop; i; ){
2607 - prop = this.props[ --i ];
2608 - event[ prop ] = originalEvent[ prop ];
2609 - }
2610 -
2611 - // Fix target property, if necessary
2612 - if ( !event.target )
2613 - event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
2614 -
2615 - // check if target is a textnode (safari)
2616 - if ( event.target.nodeType == 3 )
2617 - event.target = event.target.parentNode;
2618 -
2619 - // Add relatedTarget, if necessary
2620 - if ( !event.relatedTarget && event.fromElement )
2621 - event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
2622 -
2623 - // Calculate pageX/Y if missing and clientX/Y available
2624 - if ( event.pageX == null && event.clientX != null ) {
2625 - var doc = document.documentElement, body = document.body;
2626 - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
2627 - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
2628 - }
2629 -
2630 - // Add which for key events
2631 - if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
2632 - event.which = event.charCode || event.keyCode;
2633 -
2634 - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
2635 - if ( !event.metaKey && event.ctrlKey )
2636 - event.metaKey = event.ctrlKey;
2637 -
2638 - // Add which for click: 1 == left; 2 == middle; 3 == right
2639 - // Note: button is not normalized, so don't use it
2640 - if ( !event.which && event.button )
2641 - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
2642 -
2643 - return event;
2644 - },
2645 -
2646 - proxy: function( fn, proxy ){
2647 - proxy = proxy || function(){ return fn.apply(this, arguments); };
2648 - // Set the guid of unique handler to the same of original handler, so it can be removed
2649 - proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
2650 - // So proxy can be declared as an argument
2651 - return proxy;
2652 - },
2653 -
2654 - special: {
2655 - ready: {
2656 - // Make sure the ready event is setup
2657 - setup: bindReady,
2658 - teardown: function() {}
2659 - }
2660 - },
2661 -
2662 - specialAll: {
2663 - live: {
2664 - setup: function( selector, namespaces ){
2665 - jQuery.event.add( this, namespaces[0], liveHandler );
2666 - },
2667 - teardown: function( namespaces ){
2668 - if ( namespaces.length ) {
2669 - var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
2670 -
2671 - jQuery.each( (jQuery.data(this, "events").live || {}), function(){
2672 - if ( name.test(this.type) )
2673 - remove++;
2674 - });
2675 -
2676 - if ( remove < 1 )
2677 - jQuery.event.remove( this, namespaces[0], liveHandler );
2678 - }
2679 - }
2680 - }
2681 - }
2682 -};
2683 -
2684 -jQuery.Event = function( src ){
2685 - // Allow instantiation without the 'new' keyword
2686 - if( !this.preventDefault )
2687 - return new jQuery.Event(src);
2688 -
2689 - // Event object
2690 - if( src && src.type ){
2691 - this.originalEvent = src;
2692 - this.type = src.type;
2693 - // Event type
2694 - }else
2695 - this.type = src;
2696 -
2697 - // timeStamp is buggy for some events on Firefox(#3843)
2698 - // So we won't rely on the native value
2699 - this.timeStamp = now();
2700 -
2701 - // Mark it as fixed
2702 - this[expando] = true;
2703 -};
2704 -
2705 -function returnFalse(){
2706 - return false;
2707 -}
2708 -function returnTrue(){
2709 - return true;
2710 -}
2711 -
2712 -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
2713 -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
2714 -jQuery.Event.prototype = {
2715 - preventDefault: function() {
2716 - this.isDefaultPrevented = returnTrue;
2717 -
2718 - var e = this.originalEvent;
2719 - if( !e )
2720 - return;
2721 - // if preventDefault exists run it on the original event
2722 - if (e.preventDefault)
2723 - e.preventDefault();
2724 - // otherwise set the returnValue property of the original event to false (IE)
2725 - e.returnValue = false;
2726 - },
2727 - stopPropagation: function() {
2728 - this.isPropagationStopped = returnTrue;
2729 -
2730 - var e = this.originalEvent;
2731 - if( !e )
2732 - return;
2733 - // if stopPropagation exists run it on the original event
2734 - if (e.stopPropagation)
2735 - e.stopPropagation();
2736 - // otherwise set the cancelBubble property of the original event to true (IE)
2737 - e.cancelBubble = true;
2738 - },
2739 - stopImmediatePropagation:function(){
2740 - this.isImmediatePropagationStopped = returnTrue;
2741 - this.stopPropagation();
2742 - },
2743 - isDefaultPrevented: returnFalse,
2744 - isPropagationStopped: returnFalse,
2745 - isImmediatePropagationStopped: returnFalse
2746 -};
2747 -// Checks if an event happened on an element within another element
2748 -// Used in jQuery.event.special.mouseenter and mouseleave handlers
2749 -var withinElement = function(event) {
2750 - // Check if mouse(over|out) are still within the same parent element
2751 - var parent = event.relatedTarget;
2752 - // Traverse up the tree
2753 - while ( parent && parent != this )
2754 - try { parent = parent.parentNode; }
2755 - catch(e) { parent = this; }
2756 -
2757 - if( parent != this ){
2758 - // set the correct event type
2759 - event.type = event.data;
2760 - // handle event if we actually just moused on to a non sub-element
2761 - jQuery.event.handle.apply( this, arguments );
2762 - }
2763 -};
2764 -
2765 -jQuery.each({
2766 - mouseover: 'mouseenter',
2767 - mouseout: 'mouseleave'
2768 -}, function( orig, fix ){
2769 - jQuery.event.special[ fix ] = {
2770 - setup: function(){
2771 - jQuery.event.add( this, orig, withinElement, fix );
2772 - },
2773 - teardown: function(){
2774 - jQuery.event.remove( this, orig, withinElement );
2775 - }
2776 - };
2777 -});
2778 -
2779 -jQuery.fn.extend({
2780 - bind: function( type, data, fn ) {
2781 - return type == "unload" ? this.one(type, data, fn) : this.each(function(){
2782 - jQuery.event.add( this, type, fn || data, fn && data );
2783 - });
2784 - },
2785 -
2786 - one: function( type, data, fn ) {
2787 - var one = jQuery.event.proxy( fn || data, function(event) {
2788 - jQuery(this).unbind(event, one);
2789 - return (fn || data).apply( this, arguments );
2790 - });
2791 - return this.each(function(){
2792 - jQuery.event.add( this, type, one, fn && data);
2793 - });
2794 - },
2795 -
2796 - unbind: function( type, fn ) {
2797 - return this.each(function(){
2798 - jQuery.event.remove( this, type, fn );
2799 - });
2800 - },
2801 -
2802 - trigger: function( type, data ) {
2803 - return this.each(function(){
2804 - jQuery.event.trigger( type, data, this );
2805 - });
2806 - },
2807 -
2808 - triggerHandler: function( type, data ) {
2809 - if( this[0] ){
2810 - var event = jQuery.Event(type);
2811 - event.preventDefault();
2812 - event.stopPropagation();
2813 - jQuery.event.trigger( event, data, this[0] );
2814 - return event.result;
2815 - }
2816 - },
2817 -
2818 - toggle: function( fn ) {
2819 - // Save reference to arguments for access in closure
2820 - var args = arguments, i = 1;
2821 -
2822 - // link all the functions, so any of them can unbind this click handler
2823 - while( i < args.length )
2824 - jQuery.event.proxy( fn, args[i++] );
2825 -
2826 - return this.click( jQuery.event.proxy( fn, function(event) {
2827 - // Figure out which function to execute
2828 - this.lastToggle = ( this.lastToggle || 0 ) % i;
2829 -
2830 - // Make sure that clicks stop
2831 - event.preventDefault();
2832 -
2833 - // and execute the function
2834 - return args[ this.lastToggle++ ].apply( this, arguments ) || false;
2835 - }));
2836 - },
2837 -
2838 - hover: function(fnOver, fnOut) {
2839 - return this.mouseenter(fnOver).mouseleave(fnOut);
2840 - },
2841 -
2842 - ready: function(fn) {
2843 - // Attach the listeners
2844 - bindReady();
2845 -
2846 - // If the DOM is already ready
2847 - if ( jQuery.isReady )
2848 - // Execute the function immediately
2849 - fn.call( document, jQuery );
2850 -
2851 - // Otherwise, remember the function for later
2852 - else
2853 - // Add the function to the wait list
2854 - jQuery.readyList.push( fn );
2855 -
2856 - return this;
2857 - },
2858 -
2859 - live: function( type, fn ){
2860 - var proxy = jQuery.event.proxy( fn );
2861 - proxy.guid += this.selector + type;
2862 -
2863 - jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );
2864 -
2865 - return this;
2866 - },
2867 -
2868 - die: function( type, fn ){
2869 - jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );
2870 - return this;
2871 - }
2872 -});
2873 -
2874 -function liveHandler( event ){
2875 - var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
2876 - stop = true,
2877 - elems = [];
2878 -
2879 - jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
2880 - if ( check.test(fn.type) ) {
2881 - var elem = jQuery(event.target).closest(fn.data)[0];
2882 - if ( elem )
2883 - elems.push({ elem: elem, fn: fn });
2884 - }
2885 - });
2886 -
2887 - jQuery.each(elems, function(){
2888 - if ( this.fn.call(this.elem, event, this.fn.data) === false )
2889 - stop = false;
2890 - });
2891 -
2892 - return stop;
2893 -}
2894 -
2895 -function liveConvert(type, selector){
2896 - return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
2897 -}
2898 -
2899 -jQuery.extend({
2900 - isReady: false,
2901 - readyList: [],
2902 - // Handle when the DOM is ready
2903 - ready: function() {
2904 - // Make sure that the DOM is not already loaded
2905 - if ( !jQuery.isReady ) {
2906 - // Remember that the DOM is ready
2907 - jQuery.isReady = true;
2908 -
2909 - // If there are functions bound, to execute
2910 - if ( jQuery.readyList ) {
2911 - // Execute all of them
2912 - jQuery.each( jQuery.readyList, function(){
2913 - this.call( document, jQuery );
2914 - });
2915 -
2916 - // Reset the list of functions
2917 - jQuery.readyList = null;
2918 - }
2919 -
2920 - // Trigger any bound ready events
2921 - jQuery(document).triggerHandler("ready");
2922 - }
2923 - }
2924 -});
2925 -
2926 -var readyBound = false;
2927 -
2928 -function bindReady(){
2929 - if ( readyBound ) return;
2930 - readyBound = true;
2931 -
2932 - // Mozilla, Opera and webkit nightlies currently support this event
2933 - if ( document.addEventListener ) {
2934 - // Use the handy event callback
2935 - document.addEventListener( "DOMContentLoaded", function(){
2936 - document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
2937 - jQuery.ready();
2938 - }, false );
2939 -
2940 - // If IE event model is used
2941 - } else if ( document.attachEvent ) {
2942 - // ensure firing before onload,
2943 - // maybe late but safe also for iframes
2944 - document.attachEvent("onreadystatechange", function(){
2945 - if ( document.readyState === "complete" ) {
2946 - document.detachEvent( "onreadystatechange", arguments.callee );
2947 - jQuery.ready();
2948 - }
2949 - });
2950 -
2951 - // If IE and not an iframe
2952 - // continually check to see if the document is ready
2953 - if ( document.documentElement.doScroll && typeof window.frameElement === "undefined" ) (function(){
2954 - if ( jQuery.isReady ) return;
2955 -
2956 - try {
2957 - // If IE is used, use the trick by Diego Perini
2958 - // http://javascript.nwbox.com/IEContentLoaded/
2959 - document.documentElement.doScroll("left");
2960 - } catch( error ) {
2961 - setTimeout( arguments.callee, 0 );
2962 - return;
2963 - }
2964 -
2965 - // and execute any waiting functions
2966 - jQuery.ready();
2967 - })();
2968 - }
2969 -
2970 - // A fallback to window.onload, that will always work
2971 - jQuery.event.add( window, "load", jQuery.ready );
2972 -}
2973 -
2974 -jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
2975 - "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
2976 - "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){
2977 -
2978 - // Handle event binding
2979 - jQuery.fn[name] = function(fn){
2980 - return fn ? this.bind(name, fn) : this.trigger(name);
2981 - };
2982 -});
2983 -
2984 -// Prevent memory leaks in IE
2985 -// And prevent errors on refresh with events like mouseover in other browsers
2986 -// Window isn't included so as not to unbind existing unload events
2987 -jQuery( window ).bind( 'unload', function(){
2988 - for ( var id in jQuery.cache )
2989 - // Skip the window
2990 - if ( id != 1 && jQuery.cache[ id ].handle )
2991 - jQuery.event.remove( jQuery.cache[ id ].handle.elem );
2992 -});
2993 -(function(){
2994 -
2995 - jQuery.support = {};
2996 -
2997 - var root = document.documentElement,
2998 - script = document.createElement("script"),
2999 - div = document.createElement("div"),
3000 - id = "script" + (new Date).getTime();
3001 -
3002 - div.style.display = "none";
3003 - div.innerHTML = ' <link/><table></table><a href="https://www.mediawiki.org/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
3004 -
3005 - var all = div.getElementsByTagName("*"),
3006 - a = div.getElementsByTagName("a")[0];
3007 -
3008 - // Can't get basic test support
3009 - if ( !all || !all.length || !a ) {
3010 - return;
3011 - }
3012 -
3013 - jQuery.support = {
3014 - // IE strips leading whitespace when .innerHTML is used
3015 - leadingWhitespace: div.firstChild.nodeType == 3,
3016 -
3017 - // Make sure that tbody elements aren't automatically inserted
3018 - // IE will insert them into empty tables
3019 - tbody: !div.getElementsByTagName("tbody").length,
3020 -
3021 - // Make sure that you can get all elements in an <object> element
3022 - // IE 7 always returns no results
3023 - objectAll: !!div.getElementsByTagName("object")[0]
3024 - .getElementsByTagName("*").length,
3025 -
3026 - // Make sure that link elements get serialized correctly by innerHTML
3027 - // This requires a wrapper element in IE
3028 - htmlSerialize: !!div.getElementsByTagName("link").length,
3029 -
3030 - // Get the style information from getAttribute
3031 - // (IE uses .cssText insted)
3032 - style: /red/.test( a.getAttribute("style") ),
3033 -
3034 - // Make sure that URLs aren't manipulated
3035 - // (IE normalizes it by default)
3036 - hrefNormalized: a.getAttribute("href") === "/a",
3037 -
3038 - // Make sure that element opacity exists
3039 - // (IE uses filter instead)
3040 - opacity: a.style.opacity === "0.5",
3041 -
3042 - // Verify style float existence
3043 - // (IE uses styleFloat instead of cssFloat)
3044 - cssFloat: !!a.style.cssFloat,
3045 -
3046 - // Will be defined later
3047 - scriptEval: false,
3048 - noCloneEvent: true,
3049 - boxModel: null
3050 - };
3051 -
3052 - script.type = "text/javascript";
3053 - try {
3054 - script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
3055 - } catch(e){}
3056 -
3057 - root.insertBefore( script, root.firstChild );
3058 -
3059 - // Make sure that the execution of code works by injecting a script
3060 - // tag with appendChild/createTextNode
3061 - // (IE doesn't support this, fails, and uses .text instead)
3062 - if ( window[ id ] ) {
3063 - jQuery.support.scriptEval = true;
3064 - delete window[ id ];
3065 - }
3066 -
3067 - root.removeChild( script );
3068 -
3069 - if ( div.attachEvent && div.fireEvent ) {
3070 - div.attachEvent("onclick", function(){
3071 - // Cloning a node shouldn't copy over any
3072 - // bound event handlers (IE does this)
3073 - jQuery.support.noCloneEvent = false;
3074 - div.detachEvent("onclick", arguments.callee);
3075 - });
3076 - div.cloneNode(true).fireEvent("onclick");
3077 - }
3078 -
3079 - // Figure out if the W3C box model works as expected
3080 - // document.body must exist before we can do this
3081 - jQuery(function(){
3082 - var div = document.createElement("div");
3083 - div.style.width = "1px";
3084 - div.style.paddingLeft = "1px";
3085 -
3086 - document.body.appendChild( div );
3087 - jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
3088 - document.body.removeChild( div );
3089 - });
3090 -})();
3091 -
3092 -var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
3093 -
3094 -jQuery.props = {
3095 - "for": "htmlFor",
3096 - "class": "className",
3097 - "float": styleFloat,
3098 - cssFloat: styleFloat,
3099 - styleFloat: styleFloat,
3100 - readonly: "readOnly",
3101 - maxlength: "maxLength",
3102 - cellspacing: "cellSpacing",
3103 - rowspan: "rowSpan",
3104 - tabindex: "tabIndex"
3105 -};
3106 -jQuery.fn.extend({
3107 - // Keep a copy of the old load
3108 - _load: jQuery.fn.load,
3109 -
3110 - load: function( url, params, callback ) {
3111 - if ( typeof url !== "string" )
3112 - return this._load( url );
3113 -
3114 - var off = url.indexOf(" ");
3115 - if ( off >= 0 ) {
3116 - var selector = url.slice(off, url.length);
3117 - url = url.slice(0, off);
3118 - }
3119 -
3120 - // Default to a GET request
3121 - var type = "GET";
3122 -
3123 - // If the second parameter was provided
3124 - if ( params )
3125 - // If it's a function
3126 - if ( jQuery.isFunction( params ) ) {
3127 - // We assume that it's the callback
3128 - callback = params;
3129 - params = null;
3130 -
3131 - // Otherwise, build a param string
3132 - } else if( typeof params === "object" ) {
3133 - params = jQuery.param( params );
3134 - type = "POST";
3135 - }
3136 -
3137 - var self = this;
3138 -
3139 - // Request the remote document
3140 - jQuery.ajax({
3141 - url: url,
3142 - type: type,
3143 - dataType: "html",
3144 - data: params,
3145 - complete: function(res, status){
3146 - // If successful, inject the HTML into all the matched elements
3147 - if ( status == "success" || status == "notmodified" )
3148 - // See if a selector was specified
3149 - self.html( selector ?
3150 - // Create a dummy div to hold the results
3151 - jQuery("<div/>")
3152 - // inject the contents of the document in, removing the scripts
3153 - // to avoid any 'Permission Denied' errors in IE
3154 - .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
3155 -
3156 - // Locate the specified elements
3157 - .find(selector) :
3158 -
3159 - // If not, just inject the full result
3160 - res.responseText );
3161 -
3162 - if( callback )
3163 - self.each( callback, [res.responseText, status, res] );
3164 - }
3165 - });
3166 - return this;
3167 - },
3168 -
3169 - serialize: function() {
3170 - return jQuery.param(this.serializeArray());
3171 - },
3172 - serializeArray: function() {
3173 - return this.map(function(){
3174 - return this.elements ? jQuery.makeArray(this.elements) : this;
3175 - })
3176 - .filter(function(){
3177 - return this.name && !this.disabled &&
3178 - (this.checked || /select|textarea/i.test(this.nodeName) ||
3179 - /text|hidden|password/i.test(this.type));
3180 - })
3181 - .map(function(i, elem){
3182 - var val = jQuery(this).val();
3183 - return val == null ? null :
3184 - jQuery.isArray(val) ?
3185 - jQuery.map( val, function(val, i){
3186 - return {name: elem.name, value: val};
3187 - }) :
3188 - {name: elem.name, value: val};
3189 - }).get();
3190 - }
3191 -});
3192 -
3193 -// Attach a bunch of functions for handling common AJAX events
3194 -jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
3195 - jQuery.fn[o] = function(f){
3196 - return this.bind(o, f);
3197 - };
3198 -});
3199 -
3200 -var jsc = now();
3201 -
3202 -jQuery.extend({
3203 -
3204 - get: function( url, data, callback, type ) {
3205 - // shift arguments if data argument was ommited
3206 - if ( jQuery.isFunction( data ) ) {
3207 - callback = data;
3208 - data = null;
3209 - }
3210 -
3211 - return jQuery.ajax({
3212 - type: "GET",
3213 - url: url,
3214 - data: data,
3215 - success: callback,
3216 - dataType: type
3217 - });
3218 - },
3219 -
3220 - getScript: function( url, callback ) {
3221 - return jQuery.get(url, null, callback, "script");
3222 - },
3223 -
3224 - getJSON: function( url, data, callback ) {
3225 - return jQuery.get(url, data, callback, "json");
3226 - },
3227 -
3228 - post: function( url, data, callback, type ) {
3229 - if ( jQuery.isFunction( data ) ) {
3230 - callback = data;
3231 - data = {};
3232 - }
3233 -
3234 - return jQuery.ajax({
3235 - type: "POST",
3236 - url: url,
3237 - data: data,
3238 - success: callback,
3239 - dataType: type
3240 - });
3241 - },
3242 -
3243 - ajaxSetup: function( settings ) {
3244 - jQuery.extend( jQuery.ajaxSettings, settings );
3245 - },
3246 -
3247 - ajaxSettings: {
3248 - url: location.href,
3249 - global: true,
3250 - type: "GET",
3251 - contentType: "application/x-www-form-urlencoded",
3252 - processData: true,
3253 - async: true,
3254 - /*
3255 - timeout: 0,
3256 - data: null,
3257 - username: null,
3258 - password: null,
3259 - */
3260 - // Create the request object; Microsoft failed to properly
3261 - // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
3262 - // This function can be overriden by calling jQuery.ajaxSetup
3263 - xhr:function(){
3264 - return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
3265 - },
3266 - accepts: {
3267 - xml: "application/xml, text/xml",
3268 - html: "text/html",
3269 - script: "text/javascript, application/javascript",
3270 - json: "application/json, text/javascript",
3271 - text: "text/plain",
3272 - _default: "*/*"
3273 - }
3274 - },
3275 -
3276 - // Last-Modified header cache for next request
3277 - lastModified: {},
3278 -
3279 - ajax: function( s ) {
3280 - // Extend the settings, but re-extend 's' so that it can be
3281 - // checked again later (in the test suite, specifically)
3282 - s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
3283 -
3284 - var jsonp, jsre = /=\?(&|$)/g, status, data,
3285 - type = s.type.toUpperCase();
3286 -
3287 - // convert data if not already a string
3288 - if ( s.data && s.processData && typeof s.data !== "string" )
3289 - s.data = jQuery.param(s.data);
3290 -
3291 - // Handle JSONP Parameter Callbacks
3292 - if ( s.dataType == "jsonp" ) {
3293 - if ( type == "GET" ) {
3294 - if ( !s.url.match(jsre) )
3295 - s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
3296 - } else if ( !s.data || !s.data.match(jsre) )
3297 - s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
3298 - s.dataType = "json";
3299 - }
3300 -
3301 - // Build temporary JSONP function
3302 - if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
3303 - jsonp = "jsonp" + jsc++;
3304 -
3305 - // Replace the =? sequence both in the query string and the data
3306 - if ( s.data )
3307 - s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
3308 - s.url = s.url.replace(jsre, "=" + jsonp + "$1");
3309 -
3310 - // We need to make sure
3311 - // that a JSONP style response is executed properly
3312 - s.dataType = "script";
3313 -
3314 - // Handle JSONP-style loading
3315 - window[ jsonp ] = function(tmp){
3316 - data = tmp;
3317 - success();
3318 - complete();
3319 - // Garbage collect
3320 - window[ jsonp ] = undefined;
3321 - try{ delete window[ jsonp ]; } catch(e){}
3322 - if ( head )
3323 - head.removeChild( script );
3324 - };
3325 - }
3326 -
3327 - if ( s.dataType == "script" && s.cache == null )
3328 - s.cache = false;
3329 -
3330 - if ( s.cache === false && type == "GET" ) {
3331 - var ts = now();
3332 - // try replacing _= if it is there
3333 - var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
3334 - // if nothing was replaced, add timestamp to the end
3335 - s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
3336 - }
3337 -
3338 - // If data is available, append data to url for get requests
3339 - if ( s.data && type == "GET" ) {
3340 - s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
3341 -
3342 - // IE likes to send both get and post data, prevent this
3343 - s.data = null;
3344 - }
3345 -
3346 - // Watch for a new set of requests
3347 - if ( s.global && ! jQuery.active++ )
3348 - jQuery.event.trigger( "ajaxStart" );
3349 -
3350 - // Matches an absolute URL, and saves the domain
3351 - var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
3352 -
3353 - // If we're requesting a remote document
3354 - // and trying to load JSON or Script with a GET
3355 - if ( s.dataType == "script" && type == "GET" && parts
3356 - && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
3357 -
3358 - var head = document.getElementsByTagName("head")[0];
3359 - var script = document.createElement("script");
3360 - script.src = s.url;
3361 - if (s.scriptCharset)
3362 - script.charset = s.scriptCharset;
3363 -
3364 - // Handle Script loading
3365 - if ( !jsonp ) {
3366 - var done = false;
3367 -
3368 - // Attach handlers for all browsers
3369 - script.onload = script.onreadystatechange = function(){
3370 - if ( !done && (!this.readyState ||
3371 - this.readyState == "loaded" || this.readyState == "complete") ) {
3372 - done = true;
3373 - success();
3374 - complete();
3375 - head.removeChild( script );
3376 - }
3377 - };
3378 - }
3379 -
3380 - head.appendChild(script);
3381 -
3382 - // We handle everything using the script element injection
3383 - return undefined;
3384 - }
3385 -
3386 - var requestDone = false;
3387 -
3388 - // Create the request object
3389 - var xhr = s.xhr();
3390 -
3391 - // Open the socket
3392 - // Passing null username, generates a login popup on Opera (#2865)
3393 - if( s.username )
3394 - xhr.open(type, s.url, s.async, s.username, s.password);
3395 - else
3396 - xhr.open(type, s.url, s.async);
3397 -
3398 - // Need an extra try/catch for cross domain requests in Firefox 3
3399 - try {
3400 - // Set the correct header, if data is being sent
3401 - if ( s.data )
3402 - xhr.setRequestHeader("Content-Type", s.contentType);
3403 -
3404 - // Set the If-Modified-Since header, if ifModified mode.
3405 - if ( s.ifModified )
3406 - xhr.setRequestHeader("If-Modified-Since",
3407 - jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
3408 -
3409 - // Set header so the called script knows that it's an XMLHttpRequest
3410 - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
3411 -
3412 - // Set the Accepts header for the server, depending on the dataType
3413 - xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
3414 - s.accepts[ s.dataType ] + ", */*" :
3415 - s.accepts._default );
3416 - } catch(e){}
3417 -
3418 - // Allow custom headers/mimetypes and early abort
3419 - if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
3420 - // Handle the global AJAX counter
3421 - if ( s.global && ! --jQuery.active )
3422 - jQuery.event.trigger( "ajaxStop" );
3423 - // close opended socket
3424 - xhr.abort();
3425 - return false;
3426 - }
3427 -
3428 - if ( s.global )
3429 - jQuery.event.trigger("ajaxSend", [xhr, s]);
3430 -
3431 - // Wait for a response to come back
3432 - var onreadystatechange = function(isTimeout){
3433 - // The request was aborted, clear the interval and decrement jQuery.active
3434 - if (xhr.readyState == 0) {
3435 - if (ival) {
3436 - // clear poll interval
3437 - clearInterval(ival);
3438 - ival = null;
3439 - // Handle the global AJAX counter
3440 - if ( s.global && ! --jQuery.active )
3441 - jQuery.event.trigger( "ajaxStop" );
3442 - }
3443 - // The transfer is complete and the data is available, or the request timed out
3444 - } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
3445 - requestDone = true;
3446 -
3447 - // clear poll interval
3448 - if (ival) {
3449 - clearInterval(ival);
3450 - ival = null;
3451 - }
3452 -
3453 - status = isTimeout == "timeout" ? "timeout" :
3454 - !jQuery.httpSuccess( xhr ) ? "error" :
3455 - s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :
3456 - "success";
3457 -
3458 - if ( status == "success" ) {
3459 - // Watch for, and catch, XML document parse errors
3460 - try {
3461 - // process the data (runs the xml through httpData regardless of callback)
3462 - data = jQuery.httpData( xhr, s.dataType, s );
3463 - } catch(e) {
3464 - status = "parsererror";
3465 - }
3466 - }
3467 -
3468 - // Make sure that the request was successful or notmodified
3469 - if ( status == "success" ) {
3470 - // Cache Last-Modified header, if ifModified mode.
3471 - var modRes;
3472 - try {
3473 - modRes = xhr.getResponseHeader("Last-Modified");
3474 - } catch(e) {} // swallow exception thrown by FF if header is not available
3475 -
3476 - if ( s.ifModified && modRes )
3477 - jQuery.lastModified[s.url] = modRes;
3478 -
3479 - // JSONP handles its own success callback
3480 - if ( !jsonp )
3481 - success();
3482 - } else
3483 - jQuery.handleError(s, xhr, status);
3484 -
3485 - // Fire the complete handlers
3486 - complete();
3487 -
3488 - if ( isTimeout )
3489 - xhr.abort();
3490 -
3491 - // Stop memory leaks
3492 - if ( s.async )
3493 - xhr = null;
3494 - }
3495 - };
3496 -
3497 - if ( s.async ) {
3498 - // don't attach the handler to the request, just poll it instead
3499 - var ival = setInterval(onreadystatechange, 13);
3500 -
3501 - // Timeout checker
3502 - if ( s.timeout > 0 )
3503 - setTimeout(function(){
3504 - // Check to see if the request is still happening
3505 - if ( xhr && !requestDone )
3506 - onreadystatechange( "timeout" );
3507 - }, s.timeout);
3508 - }
3509 -
3510 - // Send the data
3511 - try {
3512 - xhr.send(s.data);
3513 - } catch(e) {
3514 - jQuery.handleError(s, xhr, null, e);
3515 - }
3516 -
3517 - // firefox 1.5 doesn't fire statechange for sync requests
3518 - if ( !s.async )
3519 - onreadystatechange();
3520 -
3521 - function success(){
3522 - // If a local callback was specified, fire it and pass it the data
3523 - if ( s.success )
3524 - s.success( data, status );
3525 -
3526 - // Fire the global callback
3527 - if ( s.global )
3528 - jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
3529 - }
3530 -
3531 - function complete(){
3532 - // Process result
3533 - if ( s.complete )
3534 - s.complete(xhr, status);
3535 -
3536 - // The request was completed
3537 - if ( s.global )
3538 - jQuery.event.trigger( "ajaxComplete", [xhr, s] );
3539 -
3540 - // Handle the global AJAX counter
3541 - if ( s.global && ! --jQuery.active )
3542 - jQuery.event.trigger( "ajaxStop" );
3543 - }
3544 -
3545 - // return XMLHttpRequest to allow aborting the request etc.
3546 - return xhr;
3547 - },
3548 -
3549 - handleError: function( s, xhr, status, e ) {
3550 - // If a local callback was specified, fire it
3551 - if ( s.error ) s.error( xhr, status, e );
3552 -
3553 - // Fire the global callback
3554 - if ( s.global )
3555 - jQuery.event.trigger( "ajaxError", [xhr, s, e] );
3556 - },
3557 -
3558 - // Counter for holding the number of active queries
3559 - active: 0,
3560 -
3561 - // Determines if an XMLHttpRequest was successful or not
3562 - httpSuccess: function( xhr ) {
3563 - try {
3564 - // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
3565 - return !xhr.status && location.protocol == "file:" ||
3566 - ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;
3567 - } catch(e){}
3568 - return false;
3569 - },
3570 -
3571 - // Determines if an XMLHttpRequest returns NotModified
3572 - httpNotModified: function( xhr, url ) {
3573 - try {
3574 - var xhrRes = xhr.getResponseHeader("Last-Modified");
3575 -
3576 - // Firefox always returns 200. check Last-Modified date
3577 - return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
3578 - } catch(e){}
3579 - return false;
3580 - },
3581 -
3582 - httpData: function( xhr, type, s ) {
3583 - var ct = xhr.getResponseHeader("content-type"),
3584 - xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
3585 - data = xml ? xhr.responseXML : xhr.responseText;
3586 -
3587 - if ( xml && data.documentElement.tagName == "parsererror" )
3588 - throw "parsererror";
3589 -
3590 - // Allow a pre-filtering function to sanitize the response
3591 - // s != null is checked to keep backwards compatibility
3592 - if( s && s.dataFilter )
3593 - data = s.dataFilter( data, type );
3594 -
3595 - // The filter can actually parse the response
3596 - if( typeof data === "string" ){
3597 -
3598 - // If the type is "script", eval it in global context
3599 - if ( type == "script" )
3600 - jQuery.globalEval( data );
3601 -
3602 - // Get the JavaScript object, if JSON is used.
3603 - if ( type == "json" )
3604 - data = window["eval"]("(" + data + ")");
3605 - }
3606 -
3607 - return data;
3608 - },
3609 -
3610 - // Serialize an array of form elements or a set of
3611 - // key/values into a query string
3612 - param: function( a ) {
3613 - var s = [ ];
3614 -
3615 - function add( key, value ){
3616 - s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
3617 - };
3618 -
3619 - // If an array was passed in, assume that it is an array
3620 - // of form elements
3621 - if ( jQuery.isArray(a) || a.jquery )
3622 - // Serialize the form elements
3623 - jQuery.each( a, function(){
3624 - add( this.name, this.value );
3625 - });
3626 -
3627 - // Otherwise, assume that it's an object of key/value pairs
3628 - else
3629 - // Serialize the key/values
3630 - for ( var j in a )
3631 - // If the value is an array then the key names need to be repeated
3632 - if ( jQuery.isArray(a[j]) )
3633 - jQuery.each( a[j], function(){
3634 - add( j, this );
3635 - });
3636 - else
3637 - add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
3638 -
3639 - // Return the resulting serialization
3640 - return s.join("&").replace(/%20/g, "+");
3641 - }
3642 -
3643 -});
3644 -var elemdisplay = {},
3645 - timerId,
3646 - fxAttrs = [
3647 - // height animations
3648 - [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
3649 - // width animations
3650 - [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
3651 - // opacity animations
3652 - [ "opacity" ]
3653 - ];
3654 -
3655 -function genFx( type, num ){
3656 - var obj = {};
3657 - jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
3658 - obj[ this ] = type;
3659 - });
3660 - return obj;
3661 -}
3662 -
3663 -jQuery.fn.extend({
3664 - show: function(speed,callback){
3665 - if ( speed ) {
3666 - return this.animate( genFx("show", 3), speed, callback);
3667 - } else {
3668 - for ( var i = 0, l = this.length; i < l; i++ ){
3669 - var old = jQuery.data(this[i], "olddisplay");
3670 -
3671 - this[i].style.display = old || "";
3672 -
3673 - if ( jQuery.css(this[i], "display") === "none" ) {
3674 - var tagName = this[i].tagName, display;
3675 -
3676 - if ( elemdisplay[ tagName ] ) {
3677 - display = elemdisplay[ tagName ];
3678 - } else {
3679 - var elem = jQuery("<" + tagName + " />").appendTo("body");
3680 -
3681 - display = elem.css("display");
3682 - if ( display === "none" )
3683 - display = "block";
3684 -
3685 - elem.remove();
3686 -
3687 - elemdisplay[ tagName ] = display;
3688 - }
3689 -
3690 - this[i].style.display = jQuery.data(this[i], "olddisplay", display);
3691 - }
3692 - }
3693 -
3694 - return this;
3695 - }
3696 - },
3697 -
3698 - hide: function(speed,callback){
3699 - if ( speed ) {
3700 - return this.animate( genFx("hide", 3), speed, callback);
3701 - } else {
3702 - for ( var i = 0, l = this.length; i < l; i++ ){
3703 - var old = jQuery.data(this[i], "olddisplay");
3704 - if ( !old && old !== "none" )
3705 - jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
3706 - this[i].style.display = "none";
3707 - }
3708 - return this;
3709 - }
3710 - },
3711 -
3712 - // Save the old toggle function
3713 - _toggle: jQuery.fn.toggle,
3714 -
3715 - toggle: function( fn, fn2 ){
3716 - var bool = typeof fn === "boolean";
3717 -
3718 - return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
3719 - this._toggle.apply( this, arguments ) :
3720 - fn == null || bool ?
3721 - this.each(function(){
3722 - var state = bool ? fn : jQuery(this).is(":hidden");
3723 - jQuery(this)[ state ? "show" : "hide" ]();
3724 - }) :
3725 - this.animate(genFx("toggle", 3), fn, fn2);
3726 - },
3727 -
3728 - fadeTo: function(speed,to,callback){
3729 - return this.animate({opacity: to}, speed, callback);
3730 - },
3731 -
3732 - animate: function( prop, speed, easing, callback ) {
3733 - var optall = jQuery.speed(speed, easing, callback);
3734 -
3735 - return this[ optall.queue === false ? "each" : "queue" ](function(){
3736 -
3737 - var opt = jQuery.extend({}, optall), p,
3738 - hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
3739 - self = this;
3740 -
3741 - for ( p in prop ) {
3742 - if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
3743 - return opt.complete.call(this);
3744 -
3745 - if ( ( p == "height" || p == "width" ) && this.style ) {
3746 - // Store display property
3747 - opt.display = jQuery.css(this, "display");
3748 -
3749 - // Make sure that nothing sneaks out
3750 - opt.overflow = this.style.overflow;
3751 - }
3752 - }
3753 -
3754 - if ( opt.overflow != null )
3755 - this.style.overflow = "hidden";
3756 -
3757 - opt.curAnim = jQuery.extend({}, prop);
3758 -
3759 - jQuery.each( prop, function(name, val){
3760 - var e = new jQuery.fx( self, opt, name );
3761 -
3762 - if ( /toggle|show|hide/.test(val) )
3763 - e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
3764 - else {
3765 - var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
3766 - start = e.cur(true) || 0;
3767 -
3768 - if ( parts ) {
3769 - var end = parseFloat(parts[2]),
3770 - unit = parts[3] || "px";
3771 -
3772 - // We need to compute starting value
3773 - if ( unit != "px" ) {
3774 - self.style[ name ] = (end || 1) + unit;
3775 - start = ((end || 1) / e.cur(true)) * start;
3776 - self.style[ name ] = start + unit;
3777 - }
3778 -
3779 - // If a +=/-= token was provided, we're doing a relative animation
3780 - if ( parts[1] )
3781 - end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
3782 -
3783 - e.custom( start, end, unit );
3784 - } else
3785 - e.custom( start, val, "" );
3786 - }
3787 - });
3788 -
3789 - // For JS strict compliance
3790 - return true;
3791 - });
3792 - },
3793 -
3794 - stop: function(clearQueue, gotoEnd){
3795 - var timers = jQuery.timers;
3796 -
3797 - if (clearQueue)
3798 - this.queue([]);
3799 -
3800 - this.each(function(){
3801 - // go in reverse order so anything added to the queue during the loop is ignored
3802 - for ( var i = timers.length - 1; i >= 0; i-- )
3803 - if ( timers[i].elem == this ) {
3804 - if (gotoEnd)
3805 - // force the next step to be the last
3806 - timers[i](true);
3807 - timers.splice(i, 1);
3808 - }
3809 - });
3810 -
3811 - // start the next in the queue if the last step wasn't forced
3812 - if (!gotoEnd)
3813 - this.dequeue();
3814 -
3815 - return this;
3816 - }
3817 -
3818 -});
3819 -
3820 -// Generate shortcuts for custom animations
3821 -jQuery.each({
3822 - slideDown: genFx("show", 1),
3823 - slideUp: genFx("hide", 1),
3824 - slideToggle: genFx("toggle", 1),
3825 - fadeIn: { opacity: "show" },
3826 - fadeOut: { opacity: "hide" }
3827 -}, function( name, props ){
3828 - jQuery.fn[ name ] = function( speed, callback ){
3829 - return this.animate( props, speed, callback );
3830 - };
3831 -});
3832 -
3833 -jQuery.extend({
3834 -
3835 - speed: function(speed, easing, fn) {
3836 - var opt = typeof speed === "object" ? speed : {
3837 - complete: fn || !fn && easing ||
3838 - jQuery.isFunction( speed ) && speed,
3839 - duration: speed,
3840 - easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
3841 - };
3842 -
3843 - opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
3844 - jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
3845 -
3846 - // Queueing
3847 - opt.old = opt.complete;
3848 - opt.complete = function(){
3849 - if ( opt.queue !== false )
3850 - jQuery(this).dequeue();
3851 - if ( jQuery.isFunction( opt.old ) )
3852 - opt.old.call( this );
3853 - };
3854 -
3855 - return opt;
3856 - },
3857 -
3858 - easing: {
3859 - linear: function( p, n, firstNum, diff ) {
3860 - return firstNum + diff * p;
3861 - },
3862 - swing: function( p, n, firstNum, diff ) {
3863 - return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
3864 - }
3865 - },
3866 -
3867 - timers: [],
3868 -
3869 - fx: function( elem, options, prop ){
3870 - this.options = options;
3871 - this.elem = elem;
3872 - this.prop = prop;
3873 -
3874 - if ( !options.orig )
3875 - options.orig = {};
3876 - }
3877 -
3878 -});
3879 -
3880 -jQuery.fx.prototype = {
3881 -
3882 - // Simple function for setting a style value
3883 - update: function(){
3884 - if ( this.options.step )
3885 - this.options.step.call( this.elem, this.now, this );
3886 -
3887 - (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
3888 -
3889 - // Set display property to block for height/width animations
3890 - if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
3891 - this.elem.style.display = "block";
3892 - },
3893 -
3894 - // Get the current size
3895 - cur: function(force){
3896 - if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
3897 - return this.elem[ this.prop ];
3898 -
3899 - var r = parseFloat(jQuery.css(this.elem, this.prop, force));
3900 - return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
3901 - },
3902 -
3903 - // Start an animation from one number to another
3904 - custom: function(from, to, unit){
3905 - this.startTime = now();
3906 - this.start = from;
3907 - this.end = to;
3908 - this.unit = unit || this.unit || "px";
3909 - this.now = this.start;
3910 - this.pos = this.state = 0;
3911 -
3912 - var self = this;
3913 - function t(gotoEnd){
3914 - return self.step(gotoEnd);
3915 - }
3916 -
3917 - t.elem = this.elem;
3918 -
3919 - if ( t() && jQuery.timers.push(t) == 1 ) {
3920 - timerId = setInterval(function(){
3921 - var timers = jQuery.timers;
3922 -
3923 - for ( var i = 0; i < timers.length; i++ )
3924 - if ( !timers[i]() )
3925 - timers.splice(i--, 1);
3926 -
3927 - if ( !timers.length ) {
3928 - clearInterval( timerId );
3929 - }
3930 - }, 13);
3931 - }
3932 - },
3933 -
3934 - // Simple 'show' function
3935 - show: function(){
3936 - // Remember where we started, so that we can go back to it later
3937 - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
3938 - this.options.show = true;
3939 -
3940 - // Begin the animation
3941 - // Make sure that we start at a small width/height to avoid any
3942 - // flash of content
3943 - this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
3944 -
3945 - // Start by showing the element
3946 - jQuery(this.elem).show();
3947 - },
3948 -
3949 - // Simple 'hide' function
3950 - hide: function(){
3951 - // Remember where we started, so that we can go back to it later
3952 - this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
3953 - this.options.hide = true;
3954 -
3955 - // Begin the animation
3956 - this.custom(this.cur(), 0);
3957 - },
3958 -
3959 - // Each step of an animation
3960 - step: function(gotoEnd){
3961 - var t = now();
3962 -
3963 - if ( gotoEnd || t >= this.options.duration + this.startTime ) {
3964 - this.now = this.end;
3965 - this.pos = this.state = 1;
3966 - this.update();
3967 -
3968 - this.options.curAnim[ this.prop ] = true;
3969 -
3970 - var done = true;
3971 - for ( var i in this.options.curAnim )
3972 - if ( this.options.curAnim[i] !== true )
3973 - done = false;
3974 -
3975 - if ( done ) {
3976 - if ( this.options.display != null ) {
3977 - // Reset the overflow
3978 - this.elem.style.overflow = this.options.overflow;
3979 -
3980 - // Reset the display
3981 - this.elem.style.display = this.options.display;
3982 - if ( jQuery.css(this.elem, "display") == "none" )
3983 - this.elem.style.display = "block";
3984 - }
3985 -
3986 - // Hide the element if the "hide" operation was done
3987 - if ( this.options.hide )
3988 - jQuery(this.elem).hide();
3989 -
3990 - // Reset the properties, if the item has been hidden or shown
3991 - if ( this.options.hide || this.options.show )
3992 - for ( var p in this.options.curAnim )
3993 - jQuery.attr(this.elem.style, p, this.options.orig[p]);
3994 -
3995 - // Execute the complete function
3996 - this.options.complete.call( this.elem );
3997 - }
3998 -
3999 - return false;
4000 - } else {
4001 - var n = t - this.startTime;
4002 - this.state = n / this.options.duration;
4003 -
4004 - // Perform the easing function, defaults to swing
4005 - this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
4006 - this.now = this.start + ((this.end - this.start) * this.pos);
4007 -
4008 - // Perform the next step of the animation
4009 - this.update();
4010 - }
4011 -
4012 - return true;
4013 - }
4014 -
4015 -};
4016 -
4017 -jQuery.extend( jQuery.fx, {
4018 - speeds:{
4019 - slow: 600,
4020 - fast: 200,
4021 - // Default speed
4022 - _default: 400
4023 - },
4024 - step: {
4025 -
4026 - opacity: function(fx){
4027 - jQuery.attr(fx.elem.style, "opacity", fx.now);
4028 - },
4029 -
4030 - _default: function(fx){
4031 - if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
4032 - fx.elem.style[ fx.prop ] = fx.now + fx.unit;
4033 - else
4034 - fx.elem[ fx.prop ] = fx.now;
4035 - }
4036 - }
4037 -});
4038 -if ( document.documentElement["getBoundingClientRect"] )
4039 - jQuery.fn.offset = function() {
4040 - if ( !this[0] ) return { top: 0, left: 0 };
4041 - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
4042 - var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
4043 - clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
4044 - top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
4045 - left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
4046 - return { top: top, left: left };
4047 - };
4048 -else
4049 - jQuery.fn.offset = function() {
4050 - if ( !this[0] ) return { top: 0, left: 0 };
4051 - if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
4052 - jQuery.offset.initialized || jQuery.offset.initialize();
4053 -
4054 - var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
4055 - doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
4056 - body = doc.body, defaultView = doc.defaultView,
4057 - prevComputedStyle = defaultView.getComputedStyle(elem, null),
4058 - top = elem.offsetTop, left = elem.offsetLeft;
4059 -
4060 - while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
4061 - computedStyle = defaultView.getComputedStyle(elem, null);
4062 - top -= elem.scrollTop, left -= elem.scrollLeft;
4063 - if ( elem === offsetParent ) {
4064 - top += elem.offsetTop, left += elem.offsetLeft;
4065 - if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )
4066 - top += parseInt( computedStyle.borderTopWidth, 10) || 0,
4067 - left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
4068 - prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
4069 - }
4070 - if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )
4071 - top += parseInt( computedStyle.borderTopWidth, 10) || 0,
4072 - left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
4073 - prevComputedStyle = computedStyle;
4074 - }
4075 -
4076 - if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )
4077 - top += body.offsetTop,
4078 - left += body.offsetLeft;
4079 -
4080 - if ( prevComputedStyle.position === "fixed" )
4081 - top += Math.max(docElem.scrollTop, body.scrollTop),
4082 - left += Math.max(docElem.scrollLeft, body.scrollLeft);
4083 -
4084 - return { top: top, left: left };
4085 - };
4086 -
4087 -jQuery.offset = {
4088 - initialize: function() {
4089 - if ( this.initialized ) return;
4090 - var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
4091 - html = '<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>';
4092 -
4093 - rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
4094 - for ( prop in rules ) container.style[prop] = rules[prop];
4095 -
4096 - container.innerHTML = html;
4097 - body.insertBefore(container, body.firstChild);
4098 - innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
4099 -
4100 - this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
4101 - this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
4102 -
4103 - innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
4104 - this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
4105 -
4106 - body.style.marginTop = '1px';
4107 - this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
4108 - body.style.marginTop = bodyMarginTop;
4109 -
4110 - body.removeChild(container);
4111 - this.initialized = true;
4112 - },
4113 -
4114 - bodyOffset: function(body) {
4115 - jQuery.offset.initialized || jQuery.offset.initialize();
4116 - var top = body.offsetTop, left = body.offsetLeft;
4117 - if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
4118 - top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0,
4119 - left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;
4120 - return { top: top, left: left };
4121 - }
4122 -};
4123 -
4124 -
4125 -jQuery.fn.extend({
4126 - position: function() {
4127 - var left = 0, top = 0, results;
4128 -
4129 - if ( this[0] ) {
4130 - // Get *real* offsetParent
4131 - var offsetParent = this.offsetParent(),
4132 -
4133 - // Get correct offsets
4134 - offset = this.offset(),
4135 - parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
4136 -
4137 - // Subtract element margins
4138 - // note: when an element has margin: auto the offsetLeft and marginLeft
4139 - // are the same in Safari causing offset.left to incorrectly be 0
4140 - offset.top -= num( this, 'marginTop' );
4141 - offset.left -= num( this, 'marginLeft' );
4142 -
4143 - // Add offsetParent borders
4144 - parentOffset.top += num( offsetParent, 'borderTopWidth' );
4145 - parentOffset.left += num( offsetParent, 'borderLeftWidth' );
4146 -
4147 - // Subtract the two offsets
4148 - results = {
4149 - top: offset.top - parentOffset.top,
4150 - left: offset.left - parentOffset.left
4151 - };
4152 - }
4153 -
4154 - return results;
4155 - },
4156 -
4157 - offsetParent: function() {
4158 - var offsetParent = this[0].offsetParent || document.body;
4159 - while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
4160 - offsetParent = offsetParent.offsetParent;
4161 - return jQuery(offsetParent);
4162 - }
4163 -});
4164 -
4165 -
4166 -// Create scrollLeft and scrollTop methods
4167 -jQuery.each( ['Left', 'Top'], function(i, name) {
4168 - var method = 'scroll' + name;
4169 -
4170 - jQuery.fn[ method ] = function(val) {
4171 - if (!this[0]) return null;
4172 -
4173 - return val !== undefined ?
4174 -
4175 - // Set the scroll offset
4176 - this.each(function() {
4177 - this == window || this == document ?
4178 - window.scrollTo(
4179 - !i ? val : jQuery(window).scrollLeft(),
4180 - i ? val : jQuery(window).scrollTop()
4181 - ) :
4182 - this[ method ] = val;
4183 - }) :
4184 -
4185 - // Return the scroll offset
4186 - this[0] == window || this[0] == document ?
4187 - self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
4188 - jQuery.boxModel && document.documentElement[ method ] ||
4189 - document.body[ method ] :
4190 - this[0][ method ];
4191 - };
4192 -});
4193 -// Create innerHeight, innerWidth, outerHeight and outerWidth methods
4194 -jQuery.each([ "Height", "Width" ], function(i, name){
4195 -
4196 - var tl = i ? "Left" : "Top", // top or left
4197 - br = i ? "Right" : "Bottom"; // bottom or right
4198 -
4199 - // innerHeight and innerWidth
4200 - jQuery.fn["inner" + name] = function(){
4201 - return this[ name.toLowerCase() ]() +
4202 - num(this, "padding" + tl) +
4203 - num(this, "padding" + br);
4204 - };
4205 -
4206 - // outerHeight and outerWidth
4207 - jQuery.fn["outer" + name] = function(margin) {
4208 - return this["inner" + name]() +
4209 - num(this, "border" + tl + "Width") +
4210 - num(this, "border" + br + "Width") +
4211 - (margin ?
4212 - num(this, "margin" + tl) + num(this, "margin" + br) : 0);
4213 - };
4214 -
4215 - var type = name.toLowerCase();
4216 -
4217 - jQuery.fn[ type ] = function( size ) {
4218 - // Get window width or height
4219 - return this[0] == window ?
4220 - // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
4221 - document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] ||
4222 - document.body[ "client" + name ] :
4223 -
4224 - // Get document width or height
4225 - this[0] == document ?
4226 - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
4227 - Math.max(
4228 - document.documentElement["client" + name],
4229 - document.body["scroll" + name], document.documentElement["scroll" + name],
4230 - document.body["offset" + name], document.documentElement["offset" + name]
4231 - ) :
4232 -
4233 - // Get or set width or height on the element
4234 - size === undefined ?
4235 - // Get width or height on the element
4236 - (this.length ? jQuery.css( this[0], type ) : null) :
4237 -
4238 - // Set the width or height on the element (default to pixels if value is unitless)
4239 - this.css( type, typeof size === "string" ? size : size + "px" );
4240 - };
4241 -
4242 -});})();
 17+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!cj[a]){var b=f("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),c.body.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write("<!doctype><html><body></body></html>");b=cl.createElement(a),cl.body.appendChild(b),d=f.css(b,"display"),c.body.removeChild(ck)}cj[a]=d}return cj[a]}function cu(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function ct(){cq=b}function cs(){setTimeout(ct,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bF.test(a)?d(a,e):b_(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bU,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bQ),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bD(a,b,c){var d=b==="width"?bx:by,e=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return e;f.each(d,function(){c||(e-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?e+=parseFloat(f.css(a,"margin"+this))||0:e-=parseFloat(f.css(a,"border"+this+"Width"))||0});return e}function bn(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bm(a){f.nodeName(a,"input")?bl(a):a.getElementsByTagName&&f.grep(a.getElementsByTagName("input"),bl)}function bl(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bk(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bj(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bi(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function bh(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function X(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(S.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function W(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function O(a,b){return(a&&a!=="*"?a+".":"")+b.replace(A,"`").replace(B,"&")}function N(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++)g=s[i],g.origType.replace(y,"")===a.type?q.push(g.selector):s.splice(i--,1);e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h);(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function L(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function F(){return!0}function E(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function H(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(H,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=d.userAgent,x,y,z,A=Object.prototype.toString,B=Object.prototype.hasOwnProperty,C=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.1",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?C.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:C,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;y.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!y){y=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",z,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",z),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&H()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[A.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!B.call(a,"constructor")&&!B.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||B.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:E?function(a){return a==null?"":E.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?C.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(F)return F.call(b,a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=D.call(arguments,2),g=function(){return a.apply(c,f.concat(D.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){G["[object "+b+"]"]=b.toLowerCase()}),x=e.uaMatch(w),x.browser&&(e.browser[x.browser]=!0,e.browser.version=x.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?z=function(){c.removeEventListener("DOMContentLoaded",z,!1),e.ready()}:c.attachEvent&&(z=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",z),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i);k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d)return d;d=a={}}var c=g.length;while(c--)a[g[c]]=b[g[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++)b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e;e||g.resolveWith(g,b)}else g!==a&&g.resolveWith(g,d?[a]:[]);return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};f=c.createElement("select"),g=f.appendChild(c.createElement("option")),h=a.getElementsByTagName("input")[0],j={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},h.checked=!0,j.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,j.optDisabled=!g.disabled;try{delete a.test}catch(s){j.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function b(){j.noCloneEvent=!1,a.detachEvent("onclick",b)}),a.cloneNode(!0).fireEvent("onclick")),h=c.createElement("input"),h.value="t",h.setAttribute("type","radio"),j.radioValue=h.value==="t",h.setAttribute("checked","checked"),a.appendChild(h),k=c.createDocumentFragment(),k.appendChild(a.firstChild),j.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",l=c.createElement("body"),m={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};for(q in m)l.style[q]=m[q];l.appendChild(a),b.insertBefore(l,b.firstChild),j.appendChecked=h.checked,j.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,j.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",j.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",n=a.getElementsByTagName("td"),r=n[0].offsetHeight===0,n[0].style.display="",n[1].style.display="none",j.reliableHiddenOffsets=r&&n[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(i=c.createElement("div"),i.style.width="0",i.style.marginRight="0",a.appendChild(i),j.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(i,null)||{marginRight:0}).marginRight,10)||0)===0),l.innerHTML="",b.removeChild(l);if(a.attachEvent)for(q in{submit:1,change:1,focusin:1})p="on"+q,r=p in a,r||(a.setAttribute(p,"return;"),r=typeof a[p]=="function"),j[q+"Bubbles"]=r;return j}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++)g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}return d}if(typeof a=="object")return this.each(function(){f.data(this,a)});var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0))h++,l.done(m);m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.addClass(a.call(this,b,c.attr("class")||""))});if(a&&typeof a=="string"){var b=(a||"").split(o);for(var c=0,d=this.length;c<d;c++){var e=this[c];if(e.nodeType===1)if(!e.className)e.className=a;else{var g=" "+e.className+" ",h=e.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);e.className=f.trim(h)}}}return this},removeClass:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b){var c=(a||"").split(o);for(var d=0,e=this.length;d<e;d++){var g=this[d];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(n," ");for(var i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){var d=f(this);d.toggleClass(a.call(this,c,d.attr("class"),b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;return(e.value||"").replace(p,"")}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g)return b;d.push(b)}}if(g&&!d.length&&e.length)return f(e[c]).val();return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);c=j&&f.attrFix[c]||c,i=f.attrHooks[c],i||(!t.test(c)||typeof d!="boolean"&&d!==b&&d.toLowerCase()!==c.toLowerCase()?v&&(f.nodeName(a,"form")||u.test(c))&&(i=v):i=w);if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j)return i.get(a,c);h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);c=i&&f.propFix[c]||c,h=f.propHooks[c];return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return a[f.propFix[c]||c]?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=b),a.setAttribute(c,c.toLowerCase()));return c}},f.attrHooks.value={get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return a.value},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=Object.prototype.hasOwnProperty,y=/\.(.*)$/,z=/^(?:textarea|input|select)$/i,A=/\./g,B=/ /g,C=/[^\w\s.|`]/g,D=function(a){return a.replace(C,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=E;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=E);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),D).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))f.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace))e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(e!=null)break}}if(p.length===0||e!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem
 18+)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando])return a;var d=a;a=f.Event(d);for(var e=this.props.length,g;e;)g=this.props[--e],a[g]=d[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,O(a.origType,a.selector),f.extend({},a,{handler:N,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,O(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault)return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?F:E):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=F;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=F;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=F,this.stopPropagation()},isDefaultPrevented:E,isPropagationStopped:E,isImmediatePropagationStopped:E};var G=function(a){var b=a.relatedTarget;a.type=a.data;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&f.event.handle.apply(this,arguments)}catch(d){}},H=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?H:G,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?H:G)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form"))f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&L("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&L("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var I,J=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},K=function(c){var d=c.target,e,g;if(!!z.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=J(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:K,beforedeactivate:K,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&K.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&K.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",J(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in I)f.event.add(this,c+".specialChange",I[c]);return z.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return z.test(this.nodeName)}},I=f.event.special.change.filters,I.focus=I.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i<j;i++)f.event.add(this[i],a,g,d);return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else for(var d=0,e=this.length;d<e;d++)f.event.remove(this[d],a,b);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var M={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a)n[c](o,d,a[o],m);return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d))e=d||E,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=y.exec(h),k="",j&&(k=j[0],h=h.replace(y,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,M[h]?(a.push(M[h]+k),h=h+k):h=(M[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+O(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+O(h,m),e)}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f)g=o=!0;else if(f===!0)continue}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.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|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c<f;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var P=/Until$/,Q=/^(?:parents|prevUntil|prevAll)/,R=/,/,S=/^.[^:#\[\.,]*$/,T=Array.prototype.slice,U=f.expr.match.POS,V={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(X(this,a,!1),"not",a)},filter:function(a){return this.pushStack(X(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++)i=a[d],j[i]||(j[i]=U.test(i)?f(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=U.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(W(c[0])||W(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=T.call(arguments);P.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!V[a]?f.unique(e):e,(this.length>1||R.test(d))&&Q.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y=/ jQuery\d+="(?:\d+|null)"/g,Z=/^\s+/,$=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,_=/<([\w:]+)/,ba=/<tbody/i,bb=/<|&#?\w+;/,bc=/<(?:script|object|embed|option|style)/i,bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Y,""):null;if(typeof a=="string"&&!bc.test(a)&&(f.support.leadingWhitespace||!Z.test(a))&&!bg[(_.exec(a)||["",""])[1].toLowerCase()]){a=a.replace($,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bh(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bn)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bc.test(a[0])&&(f.support.checkClone||!bd.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bj(a,d),e=bk(a),g=bk(d);for(h=0;e[h];++h)bj(e[h],g[h])}if(b){bi(a,d);if(c){e=bk(a),g=bk(d);for(h=0;e[h];++h)bi(e[h],g[h])}}return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||
 19+b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bb.test(k))k=b.createTextNode(k);else{k=k.replace($,"<$1></$2>");var l=(_.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=ba.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Z.test(k)&&o.insertBefore(b.createTextNode(Z.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bm(k[i]);else bm(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()])continue;c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events)g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bo=/alpha\([^)]*\)/i,bp=/opacity=([^)]*)/,bq=/-([a-z])/ig,br=/([A-Z]|^ms)/g,bs=/^-?\d+(?:px)?$/i,bt=/^-?\d/,bu=/^[+\-]=/,bv=/[^+\-\.\de]+/g,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB,bC=function(a,b){return b.toUpperCase()};f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0,widows:!0,orphans:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null)return;h==="string"&&bu.test(d)&&(d=+d.replace(bv,"")+parseFloat(f.css(a,c))),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bq,bC)}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){a.offsetWidth!==0?e=bD(a,b,d):f.swap(a,bw,function(){e=bD(a,b,d)});if(e<=0){e=bz(a,b,b),e==="0px"&&bB&&(e=bB(a,b,b));if(e!=null)return e===""||e==="auto"?"0px":e}if(e<0||e==null){e=a.style[b];return e===""||e==="auto"?"0px":e}return typeof e=="string"?e:e+"px"}},set:function(a,b){if(!bs.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bp.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bo.test(g)?g.replace(bo,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,c){var d,e,g;c=c.replace(br,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bs.test(d)&&bt.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bE=/%20/g,bF=/\[\]$/,bG=/\r?\n/g,bH=/#.*$/,bI=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bJ=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bK=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bL=/^(?:GET|HEAD)$/,bM=/^\/\//,bN=/\?/,bO=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bP=/^(?:select|textarea)/i,bQ=/\s+/,bR=/([?&])_=[^&]*/,bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=f.fn.load,bU={},bV={},bW,bX;try{bW=e.href}catch(bY){bW=c.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bO,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bP.test(this.nodeName)||bJ.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bG,"\r\n")}}):{name:b.name,value:c.replace(bG,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bK.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bZ(bU),ajaxTransport:bZ(bV),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?ca(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=cb(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bI.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bH,"").replace(bM,bX[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bQ),d.crossDomain==null&&(r=bS.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bX[1]&&r[2]==bX[2]&&(r[3]||(r[1]==="http:"?80:443))==(bX[3]||(bX[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bU,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bL.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bN.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bR,"$1_="+x);d.url=y+(y===d.url?(bN.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bV,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bE,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq,cr=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);for(var d=0,e=this.length;d<e;d++)if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}for(d=0;d<e;d++)this[d].style&&(this[d].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cv(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)k=new f.fx(this,b,i),h=a[i],cm.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=cn.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""));return!0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--)a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}),b||this.dequeue();return this}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this),f.isFunction(d.old)&&d.old.call(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cq||cs(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!co&&(cr?(co=1,g=function(){co&&(cr(g),e.tick())},cr(g)):co=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cq||cs(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b)a[b]()||a.splice(b--,1);a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<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>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){return this[0]?parseFloat(f.css(this[0],d,"padding")):null},f.fn["outer"+c]=function(a){return this[0]?parseFloat(f.css(this[0],d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
\ No newline at end of file
Index: trunk/extensions/WikiTweet/popup.css
@@ -0,0 +1,39 @@
 2+.popup{
 3+ display:block;
 4+ position:fixed;
 5+ bottom:0px;
 6+ background-color:#D6D6D6;
 7+ background-color:#F2F2F2;
 8+ right:30px;
 9+ min-width:300px;
 10+ z-index:999999;
 11+ padding:5px;
 12+ border:1px solid #D2D2D2;
 13+ border-bottom:none;
 14+}
 15+.popup h1{
 16+ background-color:#2F2F31;
 17+ background-color:#627AAD;
 18+ margin:0px;
 19+ padding:5px;
 20+ font-size:1.5em;
 21+ color:#99FF00;
 22+ color:#FFF;
 23+ cursor:default;
 24+}
 25+.popup h1 img{
 26+ float:right;
 27+ cursor:pointer;
 28+}
 29+.popup p{
 30+ margin:0px;
 31+ padding:5px;
 32+ padding-bottom:20px;
 33+ font-size:1.3em;
 34+ color:#2F2F31;
 35+ cursor:default;
 36+}
 37+
 38+.popup li{
 39+ color:#2F2F31;
 40+}
\ No newline at end of file
Index: trunk/extensions/WikiTweet/create_tables.sql
@@ -1,59 +1,118 @@
22 --
 3+-- Table structure for table `mw_wikitweet_alerts`
 4+--
35
 6+DROP TABLE IF EXISTS `mw_wikitweet`;
 7+SET @saved_cs_client = @@character_set_client;
 8+SET character_set_client = utf8;
 9+CREATE TABLE `mw_wikitweet` (
 10+ `id` int(11) NOT NULL auto_increment,
 11+ `text` varchar(500) default NULL,
 12+ `user` varchar(100) NOT NULL,
 13+ `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 14+ `room` varchar(50) NOT NULL default 'main',
 15+ `show` int(11) NOT NULL default '1',
 16+ `status` int(11) NOT NULL default '1',
 17+ `parent` int(11) default '0',
 18+ `lastupdatedate` int(11) default '0',
 19+ PRIMARY KEY (`id`)
 20+) ENGINE=InnoDB DEFAULT CHARSET=binary;
 21+SET character_set_client = @saved_cs_client;
422
523 --
 24+-- Table structure for table `mw_wikitweet_alerts`
625 --
726
 27+DROP TABLE IF EXISTS `mw_wikitweet_alerts`;
 28+SET @saved_cs_client = @@character_set_client;
 29+SET character_set_client = utf8;
 30+CREATE TABLE `mw_wikitweet_alerts` (
 31+ `id` int(11) NOT NULL auto_increment,
 32+ `date` varchar(100) NOT NULL,
 33+ `timestamp` int(11) NOT NULL,
 34+ `attention` int(11) NOT NULL default '0',
 35+ `alert` int(11) NOT NULL default '0',
 36+ PRIMARY KEY (`id`)
 37+) ENGINE=InnoDB DEFAULT CHARSET=binary;
 38+SET character_set_client = @saved_cs_client;
839
940 --
 41+-- Table structure for table `mw_wikitweet_alerts_persons`
1042 --
1143
12 -CREATE TABLE IF NOT EXISTS `wikitweet` (
 44+DROP TABLE IF EXISTS `mw_wikitweet_alerts_persons`;
 45+SET @saved_cs_client = @@character_set_client;
 46+SET character_set_client = utf8;
 47+CREATE TABLE `mw_wikitweet_alerts_persons` (
1348 `id` int(11) NOT NULL auto_increment,
14 - `text` varchar(160) NOT NULL,
15 - `user` varchar(100) NOT NULL,
16 - `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
17 - `room` varchar(50) NOT NULL default 'main',
18 - `show` int(11) NOT NULL default '1',
 49+ `date` varchar(100) NOT NULL default '',
 50+ `timestamp` int(11) NOT NULL default '0',
 51+ `attention` int(11) NOT NULL default '0',
 52+ `alert` int(11) NOT NULL default '0',
 53+ `username` varchar(100) NOT NULL default '',
1954 PRIMARY KEY (`id`)
20 -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=130 ;
 55+) ENGINE=InnoDB DEFAULT CHARSET=binary;
 56+SET character_set_client = @saved_cs_client;
2157
22 -
23 -
2458 --
 59+-- Table structure for table `mw_wikitweet_avatar`
2560 --
2661
27 -CREATE TABLE IF NOT EXISTS `wikitweet_avatar` (
 62+DROP TABLE IF EXISTS `mw_wikitweet_avatar`;
 63+SET @saved_cs_client = @@character_set_client;
 64+SET character_set_client = utf8;
 65+CREATE TABLE `mw_wikitweet_avatar` (
2866 `id` int(11) NOT NULL auto_increment,
2967 `user` varchar(200) NOT NULL,
3068 `avatar` varchar(1000) NOT NULL,
3169 PRIMARY KEY (`id`)
32 -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=30 ;
 70+) ENGINE=InnoDB DEFAULT CHARSET=binary;
 71+SET character_set_client = @saved_cs_client;
3372
 73+--
 74+-- Table structure for table `mw_wikitweet_charge`
 75+--
3476
 77+DROP TABLE IF EXISTS `mw_wikitweet_charge`;
 78+SET @saved_cs_client = @@character_set_client;
 79+SET character_set_client = utf8;
 80+CREATE TABLE `mw_wikitweet_charge` (
 81+ `id` int(11) NOT NULL auto_increment,
 82+ `chantier` varchar(200) NOT NULL,
 83+ `jalon` varchar(1000) NOT NULL,
 84+ `charge` int(11) NOT NULL,
 85+ PRIMARY KEY (`id`)
 86+) ENGINE=InnoDB DEFAULT CHARSET=binary;
 87+SET character_set_client = @saved_cs_client;
3588
3689 --
 90+-- Table structure for table `mw_wikitweet_responsibles`
3791 --
3892
39 -CREATE TABLE IF NOT EXISTS `wikitweet_subscription` (
 93+DROP TABLE IF EXISTS `mw_wikitweet_responsibles`;
 94+SET @saved_cs_client = @@character_set_client;
 95+SET character_set_client = utf8;
 96+CREATE TABLE `mw_wikitweet_responsibles` (
4097 `id` int(11) NOT NULL auto_increment,
 98+ `ref` varchar(100) NOT NULL default '',
 99+ `title` varchar(300) NOT NULL default '',
 100+ `responsible` varchar(100) NOT NULL default '',
 101+ PRIMARY KEY (`id`)
 102+) ENGINE=InnoDB DEFAULT CHARSET=binary;
 103+SET character_set_client = @saved_cs_client;
 104+
 105+--
 106+-- Table structure for table `mw_wikitweet_subscription`
 107+--
 108+
 109+DROP TABLE IF EXISTS `mw_wikitweet_subscription`;
 110+SET @saved_cs_client = @@character_set_client;
 111+SET character_set_client = utf8;
 112+CREATE TABLE `mw_wikitweet_subscription` (
 113+ `id` int(11) NOT NULL auto_increment,
41114 `user` varchar(50) NOT NULL,
42115 `link` varchar(50) NOT NULL,
43116 `type` varchar(10) NOT NULL,
44117 PRIMARY KEY (`id`)
45 -) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=80 ;
46 -
 118+) ENGINE=InnoDB DEFAULT CHARSET=binary;
 119+SET character_set_client = @saved_cs_client;
Index: trunk/extensions/WikiTweet/popup.js
@@ -0,0 +1,30 @@
 2+var popup_number = 0;
 3+var popup_bottom = 0;
 4+function popup(i__text,i__title,i__seconds){
 5+ l__title = (typeof i__title == 'undefined') ? 'Info' : i__title;
 6+ l__seconds = (typeof i__seconds == 'undefined') ? 5 : i__seconds;
 7+ popup_number += 1;
 8+ var popupid = "popup"+(new Date().getTime());
 9+ $('body').append("<div id='"+popupid+"' class='popup' style='bottom:"+popup_bottom+"px'><h1>"+l__title+"<img popupid='"+popupid+"' class='imgpopup' src='images/cross-small.png'/></h1><p>"+i__text+"</p></div>");
 10+ popup_bottom += parseInt($("#"+popupid).css('height'));
 11+ $('#'+popupid).hide();
 12+ $('#'+popupid).slideDown('normal',function(){
 13+ });
 14+ $('#'+popupid).click(function(){
 15+ delete_popup(popupid);
 16+ });
 17+ setTimeout("delete_popup('"+popupid+"')", l__seconds*1000);
 18+}
 19+
 20+function delete_popup(popupid){
 21+ popup_number -= 1;
 22+ var last_height = parseInt($("#"+popupid).css('height'));
 23+ var last_bottom = parseInt($("#"+popupid).css('bottom'));
 24+ popup_bottom -= last_height;
 25+ $('#'+popupid).slideUp('normal',function(){$('#'+popupid).remove();});
 26+ $('.popup').each(function(){
 27+ if(last_bottom < parseInt($(this).css('bottom'))){
 28+ $(this).animate({bottom:'-='+last_height});
 29+ }
 30+ });
 31+}
\ No newline at end of file

Status & tagging log