Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated to Ember.js 0.9.3

  • Loading branch information...
commit 695f51b364329c427bd6fa3120284aed9c608043 1 parent 1a312ac
@szimek authored
Showing with 9,455 additions and 26,634 deletions.
  1. +1 −1  js/chat/app.js
  2. +3 −3 js/chat/controllers/application.js
  3. +1 −1  js/chat/controllers/chat_tabs.js
  4. +1 −1  js/chat/controllers/roster.js
  5. +1 −1  js/chat/models/chat_tab.js
  6. +1 −1  js/chat/models/message.js
  7. +1 −1  js/chat/models/message_group.js
  8. +1 −1  js/chat/models/resource.js
  9. +1 −2  js/chat/models/user.js
  10. +1 −1  js/chat/views/application.js
  11. +2 −2 js/chat/views/chat_tab/button.js
  12. +2 −2 js/chat/views/chat_tab/flyout.js
  13. +2 −2 js/chat/views/chat_tab/layout.js
  14. +8 −6 js/chat/views/chat_tab/message.js
  15. +1 −1  js/chat/views/chat_tab/message_collection.js
  16. +2 −2 js/chat/views/chat_tab/message_group.js
  17. +1 −1  js/chat/views/chat_tab/message_group_collection.js
  18. +1 −1  js/chat/views/chat_tab/text_area.js
  19. +2 −2 js/chat/views/chat_tab/unread_messages_count.js
  20. +1 −1  js/chat/views/chat_tab_collection.js
  21. +2 −2 js/chat/views/roster/flyout.js
  22. +3 −3 js/chat/views/roster/friend.js
  23. +1 −1  js/chat/views/roster/friend_collection.js
  24. +2 −2 js/chat/views/roster/layout.js
  25. +7,237 −6,174 js/libs/{sproutcore.js → ember-0.9.3.js}
  26. +11 −0 js/libs/ember-0.9.3.min.js
  27. +0 −18 js/libs/jquery-1.6.2.min.js
  28. +1,922 −1,637 js/libs/{jquery-1.6.2.js → jquery-1.7.1.js}
  29. +4 −0 js/libs/jquery-1.7.1.min.js
  30. +0 −11,758 js/libs/sproutcore-datastore.js
  31. +0 −10 js/libs/sproutcore-datastore.min.js
  32. +0 −3,264 js/libs/sproutcore-statechart.js
  33. +0 −8 js/libs/sproutcore-statechart.min.js
  34. +0 −11 js/libs/sproutcore.min.js
  35. +234 −165 js/libs/strophe.js
  36. +0 −3,543 js/strophe.js
  37. +5 −5 views/index.ejs
View
2  js/chat/app.js
@@ -1,4 +1,4 @@
-var Chat = window.Chat = SC.Application.create({
+var Chat = window.Chat = Ember.Application.create({
connect: function (options) {
Chat.Controllers.application.connect(options);
},
View
6 js/chat/controllers/application.js
@@ -1,4 +1,4 @@
-Chat.Controllers.application = SC.Object.create({
+Chat.Controllers.application = Ember.Object.create({
debug: false,
connect: function (options) {
@@ -56,9 +56,9 @@ Chat.Controllers.application = SC.Object.create({
} else {
if (model) {
// Update user in the roster
- // TODO: figure out SC.Object#set for multiple properties
+ // TODO: figure out Ember.Object#set for multiple properties
model.beginPropertyChanges();
- SC.keys(friend).forEach(function (key) {
+ Ember.keys(friend).forEach(function (key) {
model.set(key, friend[key]);
});
model.endPropertyChanges();
View
2  js/chat/controllers/chat_tabs.js
@@ -1,4 +1,4 @@
-Chat.Controllers.chatTabs = SC.ArrayProxy.create({
+Chat.Controllers.chatTabs = Ember.ArrayProxy.create({
content: [],
activateTabFor: function (friend) {
View
2  js/chat/controllers/roster.js
@@ -1,4 +1,4 @@
-Chat.Controllers.roster = SC.ArrayProxy.create({
+Chat.Controllers.roster = Ember.ArrayProxy.create({
content: [],
online: function () {
View
2  js/chat/models/chat_tab.js
@@ -1,4 +1,4 @@
-Chat.Models.ChatTab = SC.Object.extend({
+Chat.Models.ChatTab = Ember.Object.extend({
user: null,
isActive: false,
unreadMessagesCount: '0',
View
2  js/chat/models/message.js
@@ -1,4 +1,4 @@
-Chat.Models.Message = SC.Object.extend({
+Chat.Models.Message = Ember.Object.extend({
from: null,
to: null,
body: null,
View
2  js/chat/models/message_group.js
@@ -1,4 +1,4 @@
-Chat.Models.MessageGroup = SC.Object.extend({
+Chat.Models.MessageGroup = Ember.Object.extend({
from: null,
init: function () {
View
2  js/chat/models/resource.js
@@ -1,4 +1,4 @@
-Chat.Models.Resource = SC.Object.extend({
+Chat.Models.Resource = Ember.Object.extend({
// Default attribute values
show: null,
status: null
View
3  js/chat/models/user.js
@@ -1,4 +1,4 @@
-Chat.Models.User = SC.Object.extend({
+Chat.Models.User = Ember.Object.extend({
// Default attribute values
jid: null,
subscription: 'none',
@@ -7,7 +7,6 @@ Chat.Models.User = SC.Object.extend({
init: function () {
// We have to initialize 'resources' inside init function,
// because otherwise all User objects would use the same Set object
- // TODO: Use SC.Set once this issue is fixed: https://github.com/sproutcore/sproutcore20/issues/103
this.set('resources', []);
},
View
2  js/chat/views/application.js
@@ -1,4 +1,4 @@
-Chat.Views.Application = SC.ContainerView.extend({
+Chat.Views.Application = Ember.ContainerView.extend({
childViews: [
Chat.Views.ChatTabCollection,
Chat.Views.Roster.Layout
View
4 js/chat/views/chat_tab/button.js
@@ -1,5 +1,5 @@
-Chat.Views.ChatTab.Button = SC.View.extend({
- template: SC.Handlebars.compile(
+Chat.Views.ChatTab.Button = Ember.View.extend({
+ template: Ember.Handlebars.compile(
'<div class="chat-button-content clearfix">'
+ '<div class="chat-button-options right clearfix">'
+ '<label class="chat-button-action close"><input type="button"></label>'
View
4 js/chat/views/chat_tab/flyout.js
@@ -1,5 +1,5 @@
-Chat.Views.ChatTab.Flyout = SC.View.extend({
- template: SC.Handlebars.compile(
+Chat.Views.ChatTab.Flyout = Ember.View.extend({
+ template: Ember.Handlebars.compile(
'<div class="chat-flyout-titlebar clearfix">'
+ '<div class="titlebar-text-wrapper">'
+ '<span class="titlebar-text">{{parentView.content.friend.name}}</span>'
View
4 js/chat/views/chat_tab/layout.js
@@ -1,5 +1,5 @@
-Chat.Views.ChatTab.Layout = SC.View.extend({
- template: SC.Handlebars.compile(
+Chat.Views.ChatTab.Layout = Ember.View.extend({
+ template: Ember.Handlebars.compile(
'{{view Chat.Views.ChatTab.Button}}'
+ '{{view Chat.Views.ChatTab.Flyout}}'
),
View
14 js/chat/views/chat_tab/message.js
@@ -1,17 +1,19 @@
-Chat.Views.ChatTab.Message = SC.View.extend({
- template: SC.Handlebars.compile(
+Chat.Views.ChatTab.Message = Ember.View.extend({
+ template: Ember.Handlebars.compile(
'{{content.body}}'
),
classNames: ['chat-message'],
willInsertElement: function () {
- var messageGroupCollectionView = this.parentView.parentView.parentView;
- messageGroupCollectionView.onWillInsertMessageView();
+ this.messageGroupCollectionView().onWillInsertMessageView();
},
didInsertElement: function () {
- var messageGroupCollectionView = this.parentView.parentView.parentView;
- messageGroupCollectionView.onDidInsertMessageView();
+ this.messageGroupCollectionView().onDidInsertMessageView();
+ },
+
+ messageGroupCollectionView: function () {
+ return this.getPath('collectionView.collectionView');
}
});
View
2  js/chat/views/chat_tab/message_collection.js
@@ -1,4 +1,4 @@
-Chat.Views.ChatTab.MessageCollection = SC.CollectionView.extend({
+Chat.Views.ChatTab.MessageCollection = Ember.CollectionView.extend({
itemViewClass: Chat.Views.ChatTab.Message,
contentBinding: 'parentView.content.messages',
classNames: ['chat-messages']
View
4 js/chat/views/chat_tab/message_group.js
@@ -1,5 +1,5 @@
-Chat.Views.ChatTab.MessageGroup = SC.View.extend({
- template: SC.Handlebars.compile(
+Chat.Views.ChatTab.MessageGroup = Ember.View.extend({
+ template: Ember.Handlebars.compile(
'<a class="left" href="#" >'
+ '<img class="profile-photo" src="/images/chat/fb_avatar.png" {{bindAttr title="from"}} />'
+ '</a>'
View
2  js/chat/views/chat_tab/message_group_collection.js
@@ -1,4 +1,4 @@
-Chat.Views.ChatTab.MessageGroupCollection = SC.CollectionView.extend({
+Chat.Views.ChatTab.MessageGroupCollection = Ember.CollectionView.extend({
itemViewClass: Chat.Views.ChatTab.MessageGroup,
classNames: ['message-list'],
contentBinding: 'parentView.parentView.content.messageGroups',
View
2  js/chat/views/chat_tab/text_area.js
@@ -1,4 +1,4 @@
-Chat.Views.ChatTab.TextArea = SC.TextArea.extend({
+Chat.Views.ChatTab.TextArea = Ember.TextArea.extend({
classNames: ['autogrow'],
didInsertElement: function () {
View
4 js/chat/views/chat_tab/unread_messages_count.js
@@ -1,5 +1,5 @@
-Chat.Views.ChatTab.UnreadMessagesCount = SC.View.extend({
- template: SC.Handlebars.compile(
+Chat.Views.ChatTab.UnreadMessagesCount = Ember.View.extend({
+ template: Ember.Handlebars.compile(
'{{unreadMessagesCount}}'
),
tagName: 'span',
View
2  js/chat/views/chat_tab_collection.js
@@ -1,4 +1,4 @@
-Chat.Views.ChatTabCollection = SC.CollectionView.extend({
+Chat.Views.ChatTabCollection = Ember.CollectionView.extend({
itemViewClass: Chat.Views.ChatTab.Layout,
classNames: ['chat-tab-list', 'clearfix'],
contentBinding: 'Chat.Controllers.chatTabs'
View
4 js/chat/views/roster/flyout.js
@@ -1,5 +1,5 @@
-Chat.Views.Roster.Flyout = SC.View.extend({
- template: SC.Handlebars.compile(
+Chat.Views.Roster.Flyout = Ember.View.extend({
+ template: Ember.Handlebars.compile(
'<div class="chat-flyout-titlebar clearfix">'
+ '<div class="titlebar-text-wrapper">'
+ '<div class="titlebar-text">Chat</div>'
View
6 js/chat/views/roster/friend.js
@@ -1,7 +1,7 @@
-Chat.Views.Roster.Friend = SC.View.extend({
- template: SC.Handlebars.compile(
+Chat.Views.Roster.Friend = Ember.View.extend({
+ template: Ember.Handlebars.compile(
'</img>'
- + '{{content.name}}'
+ + '<span>{{content.name}}</span>'
),
tagName: 'a',
classNames: ['chat-friend', 'clearfix'],
View
2  js/chat/views/roster/friend_collection.js
@@ -1,4 +1,4 @@
-Chat.Views.Roster.FriendCollection = SC.CollectionView.extend({
+Chat.Views.Roster.FriendCollection = Ember.CollectionView.extend({
itemViewClass: Chat.Views.Roster.Friend,
classNames: ['chat-flyout-body', 'chat-friend-list'],
contentBinding: 'Chat.Controllers.roster.online'
View
4 js/chat/views/roster/layout.js
@@ -1,5 +1,5 @@
-Chat.Views.Roster.Layout = SC.View.extend({
- template: SC.Handlebars.compile(
+Chat.Views.Roster.Layout = Ember.View.extend({
+ template: Ember.Handlebars.compile(
'<a href="#" rel="toggle" class="chat-button">'
+ '<div class="chat-button-rule">'
+ '<div class="image-block clearfix">'
View
13,411 js/libs/sproutcore.js → js/libs/ember-0.9.3.js
7,237 additions, 6,174 deletions not shown
View
11 js/libs/ember-0.9.3.min.js
11 additions, 0 deletions not shown
View
18 js/libs/jquery-1.6.2.min.js
@@ -1,18 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.6.2
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Thu Jun 30 14:16:56 2011 -0400
- */
-(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(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 bZ(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 bY(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)bY(a+"["+e+"]",b[e],c,d);else d(a,b)}function bX(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===bR,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=bX(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),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 bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(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 bh(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 bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(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(R.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 V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(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(x,"")===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 K(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 E(){return!0}function D(){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 J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,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=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};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.2",length:0,size:function(){return this.length},toArray:function(){return F.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)?E.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(),A.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(F.apply(this,arguments),"slice",F.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:E,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;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},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):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.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)},camelCase:function(a){return a.replace(w,x)},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:G?function(a){return a==null?"":G.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)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H)return H.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=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.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){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),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,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;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{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={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:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),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[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=/\:|^on/,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){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(n," ");for(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){f(this).toggleClass(a.call(this,c,this.className,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;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}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);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));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&&(h=i.get(a,c))!==null)return h;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}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=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);i&&(c=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 f.prop(a,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]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=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=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;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=D);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(),C).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)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?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,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(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()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=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?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),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&&K("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&&K("submit",this,arguments)});else return!1},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=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},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(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:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.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")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.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 L={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||D,d=b;a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l});else n.unbind("live."+N(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 O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={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(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(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]=T.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=T.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(V(c[0])||V(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=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.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 X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={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,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._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(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$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"&&bc.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?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.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)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||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(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._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=_.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&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.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++)bl(k[i]);else bl(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||bd.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 bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;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=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!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"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),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(bx)return bx(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]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bA(a,b,d);f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.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=bn.test(g)?g.replace(bn,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=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$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&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.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}),bx=by||bz,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 bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.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(bL,"")).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||bM.test(this.nodeName)||bG.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(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\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:bT,isLocal:bH.test(bU[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:bW(bR),ajaxTransport:bW(bS),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?bZ(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=b$(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=bF.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(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.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=bX(bS,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)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),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&&(ca.test(b.url)||e&&ca.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(ca,l),b.url===j&&(e&&(k=k.replace(ca,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 cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,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,cb&&delete cd[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=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("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",cs(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(cr("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(cr("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=cs(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],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.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:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("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){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(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=cn||cp(),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)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=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=cn||cp(),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(cl),cl=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 ct=/^t(?:able|d|h)$/i,cu=/^(?: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=cv(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||!ct.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=cu.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&&!cu.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=cv(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=cv(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(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,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);
View
3,559 js/libs/jquery-1.6.2.js → js/libs/jquery-1.7.1.js
1,922 additions, 1,637 deletions not shown
View
4 js/libs/jquery-1.7.1.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.7.1 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(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 cb(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 ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}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===bT,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(bP),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 bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(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 bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(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 bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(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(O.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 S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,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=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};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=m.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.7.1",length:0,size:function(){return this.length},toArray:function(){return F.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)?E.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(),A.add(a);return this},eq:function(a){a=+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(F.apply(this,arguments),"slice",F.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:E,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;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},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},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(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(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},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:G?function(a){return a==null?"":G.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)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&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=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.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=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.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){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.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:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([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&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=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,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},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"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(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(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},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.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;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){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(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){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);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+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.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}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),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,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},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},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.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}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=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,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?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]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,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.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,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);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),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 z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
+f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,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 instanceof f.Event))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()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},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)}}),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 contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.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&&!l.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&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.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&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,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(j,"")+" ";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(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.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]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),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]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.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!!m(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=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([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}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&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=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null: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=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=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(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)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 v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=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}),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)&&(o.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:[]}},o.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&&(o.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")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[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}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.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 m(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;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={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(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0: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=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.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(i?i.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)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));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(S(c[0])||S(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);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).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 V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","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,"",""]},bh=U(c);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){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):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.clean(arguments);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.clean(arguments));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(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$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?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=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,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||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(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.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&&X.test(k)&&o.insertBefore(b.createTextNode(X.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++)bn(k[i]);else bn(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.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;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:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!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,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;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]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.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,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,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,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),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&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.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(bN,"")).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||bO.test(this.nodeName)||bI.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(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(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?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[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","*":bX},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},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),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>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),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.Callbacks("once memory"),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=bH.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.add,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(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.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]!=="*"?", "+bX+"; 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$(bU,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){if(s<2)w(-1,z);else throw 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)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),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&&(ce.test(b.url)||e&&ce.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(ce,l),b.url===j&&(e&&(k=k.replace(ce,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 cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,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,cf&&delete ch[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=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;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);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].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){function g(){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||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),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;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(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,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=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.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),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);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.support.fixedPosition&&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.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.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.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.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(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():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],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["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 i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
View
11,758 js/libs/sproutcore-datastore.js
0 additions, 11,758 deletions not shown
View
10 js/libs/sproutcore-datastore.min.js
@@ -1,10 +0,0 @@
-// ==========================================================================
-// Project: SproutCore - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-(function(a){function g(a){if(a.length<1e3)return a.slice();var b=0,c=[],d=a[0];while(d!==0)c[b]=d,b=d<0?0-d:d,d=a[b];c[b]=0,f(this,0,b,c);return c}function f(a,b,c,e){e===undefined&&(e=a._content);var f=SC.IndexSet.HINT_SIZE,g=d(e[b]),h=b-b%f+f,i=b+c;while(h<i){while(g!==0&&g<=h)b=g,g=d(e[b]);g===0?delete e[h]:h!==b&&(e[h]=b),h+=f}}function e(a){return a instanceof SC.IndexSet}var b=SC.get,c=SC.set,d=Math.abs;SC.IndexSet=SC.Object.extend(SC.Enumerable,SC.MutableEnumerable,SC.Freezable,SC.Copyable,{isIndexSet:YES,length:0,max:0,min:function(){var a=this._content,b=a[0];return b===0?-1:b>0?0:d(b)}.property("[]").cacheable(),init:function(a,d){this._super(),a&&e(a)?(this._content=g(a._content),c(this,"max",b(a,"max")),c(this,"length",b(a,"length")),c(this,"source",b(a,"source"))):(this._content=[0],a!==undefined&&this.add(a,d))},firstObject:function(){return b(this,"length")>0?b(this,"min"):undefined}.property(),rangeStartForIndex:function(a){var c=this._content,e=b(this,"max"),f,g,h;if(a>=e)return e;if(d(c[a])>a)return a;h=a-a%SC.IndexSet.HINT_SIZE,f=c[h];if(f<0||f>a)f=h;g=d(c[f]);while(g<a)f=g,g=d(c[f]);return f},isEqual:function(a){if(a===this)return YES;if(!a||!e(a)||b(a,"max")!==b(this,"max")||b(a,"length")!==b(this,"length"))return NO;var c=this._content,f=a._content,g=0,h=c[g];do{if(f[g]!==h)return NO;g=d(h),h=c[g]}while(g!==0);return YES},indexBefore:function(a){if(a===0)return-1;a--;var c=this._content,d=b(this,"max"),e=this.rangeStartForIndex(a);if(!c)return null;while(e===d||c[e]<0){if(e===0)return-1;a=e-1,e=this.rangeStartForIndex(a)}return a},indexAfter:function(a){var c=this._content,e=b(this,"max"),f,g;if(!c||a>=e)return-1;a++,f=this.rangeStartForIndex(a),g=c[f];while(g<0){if(g===0)return-1;a=f=d(g),g=c[f]}return a},contains:function(a,b){var c,f,g,h,i;if(b===undefined){if(a===null||a===undefined)return NO;if("number"==typeof a)b=1;else{if(a&&e(a)){if(a===this)return YES;c=a._content,f=0,g=c[f];while(g!==0){if(g>0&&!this.contains(f,g-f))return NO;f=d(g),g=c[f]}return YES}b=a.length,a=a.start}}h=this.rangeStartForIndex(a),i=this._content[h];return i>0&&h<=a&&i>=a+b},intersects:function(a,b){var c,f,g,h;if(b===undefined)if("number"==typeof a)b=1;else{if(a&&e(a)){if(a===this)return YES;c=a._content,f=0,g=c[f];while(g!==0){if(g>0&&this.intersects(f,g-f))return YES;f=d(g),g=c[f]}return NO}b=a.length,a=a.start}f=this.rangeStartForIndex(a),c=this._content,g=c[f],h=a+b;while(f<h){if(g===0)return NO;if(g>0&&g>a)return YES;f=d(g),g=c[f]}return NO},without:function(a,b){if(a===this)return new SC.IndexSet;return this.copy().remove(a,b)},replace:function(a,d){if(d===undefined)if("number"==typeof a)d=1;else{if(a&&e(a)){var f=b(this,"length"),h=b(a,"length");this.enumerableContentWillChange(f,h),SC.beginPropertyChanges(this),this._content=g(a._content),c(this,"max",b(a,"max")),c(this,"length",h),c(this,"source",b(a,"source")),SC.endPropertyChanges(this),this.enumerableContentDidChange(f,h);return this}d=a.length,a=a.start}var i=this.length;this._content.length=1,this._content[0]=0,this.length=this.max=0;return this.add(a,d)},add:function(a,g){if(b(this,"isFrozen"))throw new Error(SC.FROZEN_ERROR);var h,i,j,k;if(a&&e(a)){a.forEachRange(this.add,this);return this}if(g===undefined){if(a===null||a===undefined)return this;"number"==typeof a?g=1:(g=a.length,a=a.start)}else g===null&&(g=1);if(!(g>0))return this;var l=b(this,"max"),m=l,n,o;h=this._content;if(a===l)this.enumerableContentWillChange(),k=!0,a>0?(i=this.rangeStartForIndex(a-1),j=h[i],j>0?(delete h[l],h[i]=l=a+g,a=i):h[l]=l=a+g):h[a]=l=g,h[l]=0,c(this,"max",l),c(this,"length",b(this,"length")+g),g=l-a;else if(a>l)this.enumerableContentWillChange(),k=!0,h[l]=0-a,h[a]=a+g,h[a+g]=0,c(this,"max",a+g),c(this,"length",this.length+g),g=a+g-l,a=l;else{i=this.rangeStartForIndex(a),j=h[i],l=a+g,n=0,a>0&&i===a&&j<=0&&(i=this.rangeStartForIndex(a-1),j=h[i]),j<0?(h[i]=0-a,d(j)>l?(h[a]=0-l,h[l]=j):h[a]=j):(a=i,j>l&&(l=j)),i=a;while(i<l)o=h[i],o===0?(h[l]=0,j=l,n+=l-i,!k&&n>0&&(this.enumerableContentWillChange(),k=!0)):(j=d(o),j>l&&(h[l]=o,j=l),o<0&&(n+=j-i,!k&&n>0&&(this.enumerableContentWillChange(),k=!0))),delete h[i],i=j;(i=h[l])>0&&(delete h[l],l=i),h[a]=l,l>m&&c(this,"max",l),c(this,"length",b(this,"length")+n),g=l-a}f(this,a,g),k&&this.enumerableContentDidChange();return this},remove:function(a,g){if(b(this,"isFrozen"))throw new Error(SC.FROZEN_ERROR);if(g===undefined){if(a===null||a===undefined)return this;if("number"==typeof a)g=1;else{if(e(a)){a.forEachRange(this.remove,this);return this}g=a.length,a=a.start}}if(!(g>0))return this;this.enumerableContentWillChange();var h=b(this,"max"),i=h,j=this._content,k,l,m,n,o;if(a>=h)return this;k=this.rangeStartForIndex(a),l=j[k],o=a+g,m=0,a>0&&k===a&&l>0&&(k=this.rangeStartForIndex(a-1),l=j[k]),l>0?(j[k]=a,l>o?(j[a]=o,j[o]=l):j[a]=l):(a=k,l=d(l),l>o&&(o=l)),k=a;while(k<o)n=j[k],n===0?(j[o]=0,l=o):(l=d(n),l>o&&(j[o]=n,l=o),n>0&&(m+=l-k)),delete j[k],k=l;(k=j[o])<0&&(delete j[o],o=d(k)),j[o]===0?(delete j[o],j[a]=0,c(this,"max",a)):j[a]=0-o,c(this,"length",b(this,"length")-m),g=o-a,f(this,a,g),this.enumerableContentDidChange();return this},clear:function(){if(b(this,"isFrozen"))throw new Error(SC.FROZEN_ERROR);var a=b(this,"length");a>0&&this.enumerableContentWillChange(),SC.beginPropertyChanges(this),this._content.length=1,this._content[0]=0,c(this,"length",0),c(this,"max",0),SC.endPropertyChanges(this),a>0&&this.enumerableContentDidChange()},addEach:function(a){if(b(this,"isFrozen"))throw new Error(SC.FROZEN_ERROR);SC.beginPropertyChanges(this),a.forEach(function(a){this.add(a)},this),SC.endPropertyChanges(this);return this},removeEach:function(a){if(b(this,"isFrozen"))throw new Error(SC.FROZEN_ERROR);SC.beginPropertyChanges(this),a.forEach(function(a){this.remove(a)},this),SC.endPropertyChanges(this);return this},copy:function(){return new SC.IndexSet(this)},clone:SC.alias("copy"),slice:SC.alias("copy"),inspect:function(){var a=this._content,b=a.length,c=0,d=[],e;for(c=0;c<b;c++)e=a[c],e!==undefined&&d.push("%@:%@".fmt(c,e));return"SC.IndexSet<%@>".fmt(d.join(" , "))},forEachRange:function(a,b){var c=this._content,e=0,f=c[e],g=this.source;b===undefined&&(b=null);while(f!==0)f>0&&a.call(b,e,f-e,this,g),e=d(f),f=c[e];return this},forEachIn:function(a,b,c,e){var f=this._content,g=0,h=0,i=a+b,j=this.source,k=f[g];e===undefined&&(e=null);while(k!==0){g<a&&(g=a);while(g<k&&g<i)c.call(e,g++,h++,this,j);g>=i?g=k=0:(g=d(k),k=f[g])}return this},lengthIn:function(a,c){var f=0;if(c===undefined){if(a===null||a===undefined)return 0;if("number"==typeof a)c=1;else{if(e(a)){a.forEachRange(function(a,b){f+=this.lengthIn(a,b)},this);return f}c=a.length,a=a.start}}if(b(this,"length")===0)return 0;var g=this._content,h=0,i=g[h],j=a+c;while(h<j&&i!==0)i>0&&(f+=i>j?j-h:i-h),h=d(i),i=g[h];return f},source:null,indexOf:function(a,c){var e=b(this,"source");if(!e)throw"%@.indexOf() requires source".fmt(this);var f=b(e,"length"),g=this._content,h=g[0]<0?d(g[0]):0,i;while(h>=0&&h<f){i=e.indexOf(a,h);if(i<0)return-1;if(this.contains(i))return i;h=i+1}return-1},lastIndexOf:function(a,c){var d=b(this,"source");if(!d)throw"%@.lastIndexOf() requires source".fmt(this);var e=b(d,"length"),f=b(this,"max")-1,g;f>=e&&(f=e-1);while(f>=0){g=d.lastIndexOf(a,f);if(g<0)return-1;if(this.contains(g))return g;f=g+1}return-1},forEachObject:function(a,c){var e=b(this,"source");if(!e)throw"%@.forEachObject() requires source".fmt(this);var f=this._content,g=0,h=0,i=f[g];c===undefined&&(c=null);while(i!==0){while(g<i)a.call(c,e.objectAt(g),g,e,this),g++;g=d(i),i=f[g]}return this},addObject:function(a,c){var d=b(this,"source");sc_assert("%@.addObject() requires source".fmt(this),!!d);var e=b(d,"length"),f=0,g;while(f>=0&&f<e){g=d.indexOf(a,f);if(!(g>=0))return this;this.add(g);if(c)return this;f=g++}return this},addObjects:function(a,b){a.forEach(function(a){this.addObject(a,b)},this);return this},removeObject:function(a,c){var d=b(this,"source");sc_assert("%@.removeObject() requires source".fmt(this),!!d);var e=d.get("length"),f=0,g;while(f>=0&&f<e){g=d.indexOf(a,f);if(!(g>=0))return this;this.remove(g);if(c)return this;f=g+1}return this},removeObjects:function(a,b){a.forEach(function(a){this.removeObject(a,b)},this);return this},LOG_OBSERVING:NO,forEach:function(a,c){var e=this._content,f=0,g=0,h=b(this,"source"),i=e[f];c===undefined&&(c=null);while(i!==0){while(f<i)a.call(c,f++,g++,this,h);f=d(i),i=e[f]}return this},nextObject:function(a,c,e){var f=this._content,g=e.next,h=b(this,"max");if(c===null)c=g=0;else{if(c>=h){delete e.next;return null}c++}if(c===g){do c=d(g),g=f[c];while(g<0);e.next=g}return c},toString:function(){var a=[];this.forEachRange(function(b,c){a.push(c===1?b:"%@..%@".fmt(b,b+c-1))},this);return"SC.IndexSet<%@>".fmt(a.join(","))}}),SC.IndexSet.reopenClass({create:function(a,b){if("number"==typeof a||e(a)){var c=this;return new c(a,b)}return this._super.apply(this,arguments)},HINT_SIZE:256,EMPTY:(new SC.IndexSet).freeze()})})({}),function(a){}({}),function(a){var b=SC.get,c=SC.set,d=SC.getPath;SC.Query=SC.Object.extend(SC.Copyable,SC.Freezable,{isQuery:YES,conditions:null,orderBy:null,recordType:null,recordTypes:null,expandedRecordTypes:function(){var a=SC.Set.create(),c,d;(c=b(this,"recordType"))?this._scq_expandRecordType(c,a):(c=b(this,"recordTypes"))?c.forEach(function(b){this._scq_expandRecordType(b,a)},this):this._scq_expandRecordType(SC.Record,a),d=SC.Query._scq_queriesWithExpandedRecordTypes,d||(d=SC.Query._scq_queriesWithExpandedRecordTypes=SC.Set.create()),d.add(this);return a.freeze()}.property("recordType","recordTypes").cacheable(),_scq_expandRecordType:function(a,b){b.contains(a)||(b.add(a),SC.typeOf(a)==="string"&&(a=d(a)),a.subclasses.forEach(function(a){this._scq_expandRecordType(a,b)},this))},parameters:null,location:"local",scope:null,isRemote:function(){return b(this,"location")===SC.Query.REMOTE}.property("location").cacheable(),isLocal:function(){return b(this,"location")===SC.Query.LOCAL}.property("location").cacheable(),isEditable:NO,contains:function(a,c){var d,e=YES;if(d=b(this,"recordTypes"))e=d.find(function(b){return a instanceof b});else if(d=b(this,"recordType"))e=a instanceof d;if(!e)return NO;var f=b(this,"scope");if(f&&!f.contains(a))return NO;this._isReady||this.parse();if(!this._isReady)return NO;c===undefined&&(c=this.parameters||this);return this._tokenTree.evaluate(a,c)},containsRecordTypes:function(a){var c=b(this,"recordType");return c?!!a.find(function(a){return c.detect(a)}):(c=b(this,"recordTypes"))?!!c.find(function(b){return!!a.find(function(a){return b.detect(a)})}):YES},compare:function(a,c){var d=0,e,f,g,h;if(a===c)return 0;this._isReady||this.parse();if(!this._isReady)return SC.compare(b(a,"id"),b(c,"id"));f=this._order;if(SC.typeOf(f)==="function")d=f.call(null,a,c);else{g=f?f.length:0;for(h=0;d===0&&h<g;h++)e=f[h].propertyName,SC.Query.comparisons[e]?d=SC.Query.comparisons[e](b(a,e),b(c,e)):d=SC.compare(b(a,e),b(c,e)),d!==0&&f[h].descending&&(d=-1*d)}return d!==0?d:SC.compare(b(a,"id"),b(c,"id"))},_isReady:NO,parse:function(){var a=b(this,"conditions"),c=b(this,"queryLanguage"),d,e;d=this._tokenList=this.tokenizeString(a,c),e=this._tokenTree=this.buildTokenTree(d,c),this._order=this.buildOrder(b(this,"orderBy")),this._isReady=!!e&&!e.error;if(e&&e.error)throw e.error;return this._isReady},queryWithScope:function(a){var b="__query__"+SC.guidFor(this),d=a[b];d||(a[b]=d=this.copy(),c(d,"scope",a),d.freeze());return d},copyKeys:["conditions","orderBy","recordType","recordTypes","parameters","location","scope"],concatenatedProperties:["copyKeys"],copy:function(){var a={},c=b(this,"copyKeys"),d=c?c.length:0,e,f,g;while(--d>=0)e=c[d],f=b(this,e),f!==undefined&&(a[e]=f);g=this.constructor.create(a),a=null;return g},queryLanguage:{UNKNOWN:{firstCharacter:/[^\s'"\w\d\(\)\{\}]/,notAllowed:/[\-\s'"\w\d\(\)\{\}]/},PROPERTY:{firstCharacter:/[a-zA-Z_]/,notAllowed:/[^a-zA-Z_0-9\.]/,evalType:"PRIMITIVE",evaluate:function(a,b){return SC.getPath(a,this.tokenValue)}},NUMBER:{firstCharacter:/[\d\-]/,notAllowed:/[^\d\-\.]/,format:/^-?\d+$|^-?\d+\.\d+$/,evalType:"PRIMITIVE",evaluate:function(a,b){return parseFloat(this.tokenValue)}},STRING:{firstCharacter:/['"]/,delimeted:!0,evalType:"PRIMITIVE",evaluate:function(a,b){return this.tokenValue}},PARAMETER:{firstCharacter:/\{/,lastCharacter:"}",delimeted:!0,evalType:"PRIMITIVE",evaluate:function(a,b){return b[this.tokenValue]}},"%@":{rememberCount:!0,reservedWord:!0,evalType:"PRIMITIVE",evaluate:function(a,b){return b[this.tokenValue]}},OPEN_PAREN:{firstCharacter:/\(/,singleCharacter:!0},CLOSE_PAREN:{firstCharacter:/\)/,singleCharacter:!0},AND:{reservedWord:!0,leftType:"BOOLEAN",rightType:"BOOLEAN",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return c&&d}},OR:{reservedWord:!0,leftType:"BOOLEAN",rightType:"BOOLEAN",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return c||d}},NOT:{reservedWord:!0,rightType:"BOOLEAN",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.rightSide.evaluate(a,b);return!c}},"=":{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return SC.isEqual(c,d)}},"!=":{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return!SC.isEqual(c,d)}},"<":{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return SC.compare(c,d)==-1}},"<=":{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return SC.compare(c,d)!=1}},">":{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return SC.compare(c,d)==1}},">=":{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return SC.compare(c,d)!=-1}},BEGINS_WITH:{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return c&&c.indexOf(d)===0}},ENDS_WITH:{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return c&&c.indexOf(d)===c.length-d.length}},CONTAINS:{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b)||[],d=this.rightSide.evaluate(a,b),e=SC.typeOf(c);if(e==="string")return c.indexOf(d)!==-1;if(e==="array"||c.toArray){e!=="array"&&(c=c.toArray());var f=!1,g=0;while(f===!1&&g<c.length)d==c[g]&&(f=!0),g++;return f}}},ANY:{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b),e=!1,f=0;while(e===!1&&f<d.length)c==d[f]&&(e=!0),f++;return e}},MATCHES:{reservedWord:!0,leftType:"PRIMITIVE",rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=this.leftSide.evaluate(a,b),d=this.rightSide.evaluate(a,b);return d.test(c)}},TYPE_IS:{reservedWord:!0,rightType:"PRIMITIVE",evalType:"BOOLEAN",evaluate:function(a,b){var c=SC.Store.recordTypeFor(a.storeKey),e=this.rightSide.evaluate(a,b),f=d(e);return c==f}},"null":{reservedWord:!0,evalType:"PRIMITIVE",evaluate:function(a,b){return null}},"undefined":{reservedWord:!0,evalType:"PRIMITIVE",evaluate:function(a,b){return undefined}},"false":{reservedWord:!0,evalType:"PRIMITIVE",evaluate:function(a,b){return!1}},"true":{reservedWord:!0,evalType:"PRIMITIVE",evaluate:function(a,b){return!0}},YES:{reservedWord:!0,evalType:"PRIMITIVE",evaluate:function(a,b){return!0}},NO:{reservedWord:!0,evalType:"PRIMITIVE",evaluate:function(a,b){return!1}}},tokenizeString:function(a,b){function q(a,d){e=b[a],e.format&&!e.format.test(d)&&(a="UNKNOWN"),e.delimeted&&(o=!0);if(!e.delimeted)for(var f in b)b[f].reservedWord&&f==d&&(a=f);e=b[a],e&&e.rememberCount&&(p[a]||(p[a]=0),d=p[a],p[a]+=1),c.push({tokenType:a,tokenValue:d}),h=null,i=null,j=null}var c=[],d=null,e=null,f=null,g=null,h=null,i=null,j=null,k=null,l=!1,m=!1,n=!1,o=!1,p={};if(!a)return[];var r=a.length;for(var s=0;s<r;s++){l=s===r-1,d=a.charAt(s),o=!1,h&&(e=b[h],m=e.delimeted?d===k:e.notAllowed.test(d),m||(j+=d),(m||l)&&q(h,j),l&&!m&&(o=!0));if(!h&&!o){for(f in b)e=b[f],e.firstCharacter&&e.firstCharacter.test(d)&&(h=f);h&&(e=b[h],j=d,e.delimeted&&(j="",e.lastCharacter?k=e.lastCharacter:k=d),(e.singleCharacter||l)&&q(h,j))}}return c},buildTokenTree:function(a,b){function s(a){k(a),k(e.pop())}function r(a){var b=a;if(b<1)return!1;c[b-1].rightSide=c[b],k(b)}function q(a){var b=a;if(b<1)return!1;c[b].leftSide=c[b-1],k(b-1)}function p(a){var b=a;if(m(b))return!1;if(!l(b))return!1;if(!m(b-1))return!1;return n(b-1,b)?!0:!1}function o(a){var b=a;if(!m(b))return!1;if(!l(b))return!1;return n(b,b-1)?!0:!1}function n(a,b){var c=b<a?"left":"right";if(a<0||b<0)return!1;if(!i(c,a))return!1;if(!j(b))return!1;return i(c,a)==j(b)?!0:!1}function m(a){var b=a;if(b<0)return!0;return i("left",b)&&!c[b].leftSide||i("right",b)&&!c[b].rightSide}function l(a){var b=a||d;return b>0?!0:!1}function k(a){c.splice(a,1),a<=d&&d--}function j(a){var b=a,c=h(b);return c?c.evalType:!1}function i(a,b){var c=b,d=h(c);if(!d)return!1;if(a=="left")return d.leftType;if(a=="right")return d.rightType}function h(a){var d=a;if(d<0)return!1;var e=b[c[d].tokenType];if(!e){g.push("logic for token '"+c[d].tokenType+"' is not defined");return!1}c[d].evaluate=e.evaluate;return e}var c=a.slice(),d=0,e=[],f=!1,g=[];if(!a||a.length===0)return{evaluate:function(){return!0}};for(d=0;d<c.length;d++)f=!1,c[d].tokenType=="UNKNOWN"&&g.push("found unknown token: "+c[d].tokenValue),c[d].tokenType=="OPEN_PAREN"&&e.push(d),c[d].tokenType=="CLOSE_PAREN"&&s(d),o(d)&&q(d),p(d)&&(r(d),f=!0),f&&d--;c.length==1?c=c[0]:g.push("string did not resolve to a single tree");return g.length>0?{error:g.join(",\n"),tree:c}:c},buildOrder:function(a){if(!a)return[];if(SC.typeOf(a)==="function")return a;var b=a.split(",");for(var c=0;c<b.length;c++){var d=b[c];d=d.replace(/^\s+|\s+$/,""),d=d.replace(/\s+/,","),d=d.split(","),b[c]={propertyName:d[0]},d[1]&&d[1]=="DESC"&&(b[c].descending=!0)}return b}}),SC.Query.reopenClass({LOCAL:"local",REMOTE:"remote",storeKeyFor:function(a){return a?b(a,"storeKey"):null},containsRecords:function(a,c,d){var e=[];for(var f=0,g=b(c,"length");f<g;f++){var h=c.objectAt(f);h&&a.contains(h)&&e.push(b(h,"storeKey"))}e=SC.Query.orderStoreKeys(e,a,d);return e},orderStoreKeys:function(a,b,c){if(a)var d=a.sort(function(a,d){return SC.Query.compareStoreKeys(b,c,a,d)});return a},compareStoreKeys:function(a,b,c,d){var e=b.materializeRecord(c),f=b.materializeRecord(d);return a.compare(e,f)},build:function(a,e,f,g){var h=null,i,j,k,l;if(e&&e.isQuery){if(b(e,"location")===a)return e;i=e.copy(),c(i,"location",a);return i.freeze()}if(typeof e=="string"){i=d(e);if(!i)throw"%@ did not resolve to a class".fmt(e);e=i}else e&&e.isEnumerable?(i=[],e.forEach(function(a){typeof a=="string"&&(a=d(a));if(!a)throw"cannot resolve record types: %@".fmt(e);i.push(a)},this),e=i):e||(e=SC.Record);g===undefined&&(g=null),f===undefined&&(f=null),!g&&typeof f!="string"&&(h=f,f=null),!g&&!h?(l=SC.Query._scq_recordTypeCache,l||(l=SC.Query._scq_recordTypeCache={}),j=l[a],j||(j=l[a]={}),e.isEnumerable?(k=e.map(function(a){return SC.guidFor(a)}),k=k.sort().join(":")):k=SC.guidFor(e),f&&(k=[k,f].join("::")),i=j[k],i||(e.isEnumerable?h={recordTypes:e.copy()}:h={recordType:e},h.location=a,h.conditions=f,i=j[k]=SC.Query.create(h).freeze())):(h||(h={}),h.location||(h.location=a),e&&e.isEnumerable?h.recordsTypes=e:h.recordType=e,f&&(h.conditions=f),g&&(h.parameters=g),i=SC.Query.create(h).freeze());return i},local:function(a,b,c){return this.build(SC.Query.LOCAL,a,b,c)},remote:function(a,b,c){return this.build(SC.Query.REMOTE,a,b,c)},_scq_didDefineRecordType:function(){var a=SC.Query._scq_queriesWithExpandedRecordTypes;a&&(a.forEach(function(a){SC.propertyWillChange(a,"expandedRecordTypes"),SC.propertyDidChange(a,"expandedRecordTypes")},this),a.clear())}}),SC.Query.comparisons={},SC.Query.registerComparison=function(a,b){SC.Query.comparisons[a]=b},SC.Query.registerQueryExtension=function(a,c){b(SC.Query,"proto").queryLanguage[a]=c}}({}),function(a){var b=SC.get,c=SC.set;SC.StoreError=SC.Object.extend({code:-1,message:"",errorValue:null,errorObject:function(){return this}.property().cacheable(),label:null,toString:function(){return"SC.StoreError:%@:%@ (%@)".fmt(SC.guidFor(this),b(this,"message"),b(this,"code"))},isError:YES}),SC.StoreError.desc=function(a,b,c,d){var e={message:a};b!==undefined&&(e.label=b),d!==undefined&&(e.code=d),c!==undefined&&(e.errorValue=c);return this.create(e)},SC.$error=function(a,b,c,d){return SC.StoreError.desc(a,b,c,d)},SC.ok=function(a){return a!==!1&&(!a||!a.isError)},SC.$ok=SC.ok,SC.val=function(a){return a&&a.isError?b(a,"errorValue"):a},SC.$val=SC.val,SC.StoreError.HAS_MULTIPLE_VALUES=-100}({}),function(a){var b=SC.get,c=SC.set,d=SC.none,e=SC.copy,f;SC.Record=SC.Object.extend({isRecord:YES,isParentRecord:NO,primaryKey:"guid",id:function(a,c){if(c!==undefined){this.writeAttribute(b(this,"primaryKey"),c);return c}return SC.Store.idFor(b(this,"storeKey"))}.property("storeKey").cacheable(),status:function(){return this.store.readStatus(b(this,"storeKey"))}.property("storeKey").cacheable(),store:null,storeKey:null,isDestroyed:function(){return!!(b(this,"status")&SC.Record.DESTROYED)}.property("status").cacheable(),isEditable:function(a,c){c!==undefined&&(this._screc_isEditable=c);return b(this,"status")&SC.Record.READY&&this._screc_isEditable}.property("status").cacheable(),_screc_isEditable:YES,isLoaded:function(){var a=b(this,"status");return a!==f.EMPTY&&a!==f.BUSY_LOADING&&a!==f.ERROR}.property("status").cacheable(),relationships:null,attributes:function(){return b(this,"store").readEditableDataHash(b(this,"storeKey"))}.property(),readOnlyAttributes:function(){var a=b(this,"store").readDataHash(b(this,"storeKey"));return a?e(a):null}.property(),nestedRecordNamespace:null,isNestedRecord:function(){var a=b(this,"store"),c=b(this,"storeKey");return!!a.parentStoreKeyExists(c)}.property("storeKey").cacheable(),parentRecord:function(){var a=b(this,"storeKey"),c=b(this,"store");return c.materializeParentRecord(a)}.property("storeKey").cacheable(),refresh:function(a,c){var e=b(this,"store"),f,g,h=b(this,"storeKey"),i=e.parentStoreKeyExists();!c&&"function"==typeof a&&(c=a,a=!1),a||d(a)&&d(i)?e.refreshRecord(null,null,h,c):i&&(f=e.materializeRecord(i),f.refresh(!1,c));return this},destroy:function(a){var c=b(this,"store"),e,f,g=b(this,"storeKey"),h=c.parentStoreKeyExists();f=a||d(a)&&d(h),f?(SC.propertyWillChange(this,"status"),c.destroyRecord(null,null,g),SC.propertyDidChange(this,"status"),this.propagateToAggregates()):h&&(e=c.materializeRecord(h),e.destroy(!1));return this},recordDidChange:function(a){var c=b(this,"parentRecord");c&&c.recordDidChange(),b(this,"store").recordDidChange(null,null,b(this,"storeKey"),a),this.notifyPropertyChange("status"),this.propagateToAggregates();return this},_editLevel:0,beginEditing:function(){this._editLevel++;return this},endEditing:function(a){--this._editLevel<=0&&(this._editLevel=0,this.recordDidChange(a));return this},readAttribute:function(a){var c=b(this,"store"),d=b(this,"storeKey"),e=c.readDataHash(d);return e?e[a]:undefined},writeAttribute:function(a,c,d){var e=b(this,"store"),g=b(this,"storeKey"),h;h=e.readEditableDataHash(g);if(!h)throw f.BAD_STATE_ERROR;c!==h[a]&&(d||this.beginEditing(),h[a]=c,a===b(this,"primaryKey")&&(SC.propertyWillChange(this,"id"),SC.Store.replaceIdFor(g,c),SC.propertyDidChange(this,"id")),d||this.endEditing(a));return this},propagateToAggregates:function(){var a=b(this,"storeKey"),c=SC.Store.recordTypeFor(a),d,e,f,g,h,i;i=c.aggregates;if(!i){var j=b(this,"store").readDataHash(a),k=SC.RecordAttribute.attrFor,l;i=[];for(var m in j)l=k(this,m),l&&b(l,"aggregate")&&i.push(m);c.aggregates=i}var n=SC.Record,o=n.DIRTY,p=n.READY_NEW,q=n.DESTROYED,r=n.READY_CLEAN,s;s=function(a){var c,d;if(a){c=b(this,"status");if(c&o||c&p||c&q)d=b(a,"status"),d===r&&b(a,"store").recordDidChange(b(a,"constructor"),null,b(a,"storeKey"),null,YES)}};for(d=0,e=i.length;d<e;++d)f=i[d],g=b(this,f),h=g instanceof SC.ManyArray?g:[g],h.forEach(s,this)},notifyPropertyChange:function(a){SC.propertyWillChange(this,a),SC.propertyDidChange(this,a)},storeDidChangeProperties:function(a,c){if(a)this.notifyPropertyChange("status");else{c||(c=b(this,"store").readDataHash(b(this,"storeKey")),c&&(c=SC.keys(c))),SC.beginPropertyChanges(this),c&&c.forEach(function(a){this.notifyPropertyChange(a)},this),this.notifyPropertyChange("status"),SC.endPropertyChanges(this);var d=this.relationships,e=d?d.length:0;while(--e>=0)d[e].recordPropertyDidChange(c)}},normalize:function(a){var c=this.primaryKey,d=b(this,"id"),e=b(this,"store"),f=b(this,"storeKey"),g,h,i,j,k,l,m,n,o,p,q=e.readEditableDataHash(f)||{};q[c]=d,i=e.readDataHash(f);var r=SC.RecordAttribute.attrFor;for(g in this){p=r(this,g);if(p){o=b(p,"key")||g,h=b(p,"typeClass"),l=SC.typeOf(b(p,"typeClass"))==="class",m=b(p,"isNestedRecordTransform");if(l)j=i[o],j!==undefined?q[o]=j:(n=b(p,"defaultValue"),"function"==typeof n?q[o]=n(this,g,n):q[o]=n);else if(m)j=b(this,g),j&&j.normalize&&j.normalize();else{j=b(this,g);if(j!==undefined||j===null&&a)j=p.fromType(this,g,j),q[o]=j}}}return this},setUnknownProperty:function(a,c){if(this[a]===undefined){var d=b(this,"storeKey"),e=SC.Store.recordTypeFor(d);if(e.ignoreUnknownProperties===YES){this[a]=c;return c}var f=b(this,"primaryKey");this.writeAttribute(a,c),a===f&&SC.Store.replaceIdFor(d,c);return this.unknownProperty(a)}return this._super(a,c)},unknownProperty:function(a){return this.readAttribute(a)},commitRecord:function(a,c,d){var e=b(this,"store"),f,g,h=b(this,"storeKey"),i=e.parentStoreKeyExists();g=c||SC.none(c)&&SC.none(i),g?e.commitRecord(undefined,undefined,b(this,"storeKey"),a,d):i&&(f=e.materializeRecord(i),f.commitRecord(a,c,d));return this},isError:function(){return b(this,"status")&SC.Record.ERROR}.property("status").cacheable(),errorValue:function(){return b(this,"isError")?SC.val(b(this,"errorObject")):null}.property("isError").cacheable(),errorObject:function(){if(b(this,"isError")){var a=b(this,"store");return a.readError(b(this,"storeKey"))||f.GENERIC_ERROR}return null}.property("isError").cacheable(),set:function(a,c){var d=this[a];if(d&&d.isProperty&&!b(d,"isEditable"))return this;return this._super(a,c)},toString:function(){var a=b(this,"store").readDataHash(b(this,"storeKey"));return"%@(%@) %@".fmt(this.constructor.toString(),SC.inspect(a),this.statusString())},statusString:function(){var a=[],c=b(this,"status");for(var d in SC.Record)d.match(/[A-Z_]$/)&&SC.Record[d]===c&&a.push(d);return a.join(" ")},registerNestedRecord:function(a,d,e){var f,g,h,i,j;SC.none(e)&&(e=d),a instanceof SC.Record?i=a:(j=this._materializeNestedRecordType(a,d),i=this.createNestedRecord(j,a)),i&&(c(this,"isParentRecord",YES),f=b(this,"store"),g=b(this,"storeKey"),h=b(i,"storeKey"),f.registerChildToParent(g,h,e));return i},_materializeNestedRecordType:function(a,c){var d,e,f,g,h;h=SC.typeOf(a);if(h==="instance"||h==="object")d=b(this,"nestedRecordNamespace"),b(a,"type")&&!SC.none(d)&&(e=b(d,b(a,"type")));!e&&c&&(g=SC.RecordAttribute.attrFor(this,c),g&&(e=b(g,"typeClass")));if(!SC.Record.detect(e))throw"SC.Child: Error during transform: Invalid record type.";return e},createNestedRecord:function(a,c){var d,e,f,g,h=null,i=null;SC.run(this,function(){c=c||{},i=c[b(a,"proto").primaryKey],d=b(this,"store");if(SC.none(d))throw"Error: during the creation of a child record: NO STORE ON PARENT!";!e&&(g=b(a,"proto").primaryKey)&&(e=c[g],f=e?d.storeKeyExists(a,e):null,f?(d.writeDataHash(f,c),h=d.materializeRecord(f)):(h=d.createRecord(a,c),SC.none(e)&&(f=b(h,"storeKey"),e="cr"+f,SC.Store.replaceIdFor(f,e),c=d.readEditableDataHash(f),c[g]=e))),SC.none(i)&&this.generateIdForChild&&this.generateIdForChild(h)});return h},_nestedRecordKey:0,generateIdForChild:function(a){}}),SC.Record.reopenClass({ignoreUnknownProperties:NO,CLEAN:1,DIRTY:2,EMPTY:256,ERROR:4096,READY:512,READY_CLEAN:513,READY_DIRTY:514,READY_NEW:515,DESTROYED:1024,DESTROYED_CLEAN:1025,DESTROYED_DIRTY:1026,BUSY:2048,BUSY_LOADING:2052,BUSY_CREATING:2056,BUSY_COMMITTING:2064,BUSY_REFRESH:2080,BUSY_REFRESH_CLEAN:2081,BUSY_REFRESH_DIRTY:2082,BUSY_DESTROYING:2112,BAD_STATE_ERROR:SC.$error("Internal Inconsistency"),RECORD_EXISTS_ERROR:SC.$error("Record Exists"),NOT_FOUND_ERROR:SC.$error("Not found "),BUSY_ERROR:SC.$error("Busy"),GENERIC_ERROR:SC.$error("Generic Error"),_nextChildKey:0,attr:function(a,b){return SC.RecordAttribute.attr(a,b).computed()},fetch:function(a,b){return SC.FetchedAttribute.attr(a,b).computed()},toMany:function(a,b){b=b||{};var c=b.nested||b.isNested,d;c?d=SC.ChildrenAttribute.attr(a,b):d=SC.ManyAttribute.attr(a,b);return d.computed()},toOne:function(a,b){b=b||{};var c=b.nested||b.isNested,d;c?d=SC.ChildAttribute.attr(a,b):d=SC.SingleAttribute.attr(a,b);return d.computed()},storeKeysById:function(){var a="storeKey-"+SC.guidFor(this),b=this[a];b||(b=this[a]={});return b},storeKeyFor:function(a){var b=this.storeKeysById(),c=b[a];c||(c=SC.Store.generateStoreKey(),SC.Store.idsByStoreKey[c]=a,SC.Store.recordTypesByStoreKey[c]=this,b[a]=c);return c},storeKeyExists:function(a){var b=this.storeKeysById(),c=b[a];return c},find:function(a,b){return a.find(this,b)},extend:function(){var a=SC.Object.extend.apply(this,arguments);a.aggregates=null,SC.Query._scq_didDefineRecordType(a);return a}}),f=SC.Record}({}),function(a){var b=SC.get,c=SC.set,d=SC.getPath;SC.RecordAttribute=SC.Object.extend({isRecordAttribute:YES,defaultValue:null,type:String,key:null,isRequired:NO,isEditable:YES,useIsoDate:YES,aggregate:NO,typeClass:function(){var a=b(this,"type");SC.typeOf(a)==="string"&&(a=d(a));return a}.property("type").cacheable(),transform:function(){var a=b(this,"typeClass")||String,c=SC.RecordAttribute.transforms,d;while(a&&!(d=c[SC.guidFor(a)]))a.superclass&&a.superclass.hasOwnProperty("create")?a=a.superclass:a="function";return d}.property("typeClass").cacheable(),toType:function(a,c,d){var e=b(this,"transform"),f=b(this,"typeClass"),g;if(e&&e.to){d=e.to(d,this,f,a,c);if(!SC.none(d)&&(g=e.observesChildren)){var h,i=g.length,j={record:a,key:c};for(h=0;h<i;h++)SC.addObserver(d,g[h],this,this._SCRA_childObserver,j)}}return d},_SCRA_childObserver:function(a,b,c,d){this.call(d.record,d.key,a),d.record.notifyPropertyChange(d.key)},fromType:function(a,c,d){var e=b(this,"transform"),f=b(this,"typeClass");e&&e.from&&(d=e.from(d,this,f,a,c));return d},call:function(a,c,d){var e=b(this,"key")||c,f;d!==undefined&&b(this,"isEditable")&&(f=this.fromType(a,c,d),a.writeAttribute(e,f)),f=d=a.readAttribute(e),SC.none(d)&&(d=b(this,"defaultValue"))?typeof d=="function"&&(d=this.defaultValue(a,c,this),f!==d&&b(a,"store").readDataHash(b(a,"storeKey"))&&a.writeAttribute(e,d,!0)):d=this.toType(a,c,d);return d},isProperty:YES,isCacheable:YES,dependentKeys:[],init:function(){this._super(),this.cacheKey="__cache__"+SC.guidFor(this),this.lastSetValueKey="__lastValue__"+SC.guidFor(this)},computed:function(){var a=this,b=SC.computed(function(b,c){return a.call(this,b,c)});b.attr=a;return b}}),SC.RecordAttribute.reopenClass({attr:function(a,b){b||(b={}),b.type||(b.type=a||String);return this.create(b)},transforms:{},registerTransform:function(a,b){SC.RecordAttribute.transforms[SC.guidFor(a)]=b},attrFor:function(a,b){var c=SC.meta(a,!1).descs[b];return c&&c.attr}}),SC.RecordAttribute.registerTransform(Boolean,{to:function(a){return SC.none(a)?null:!!a}}),SC.RecordAttribute.registerTransform(Number,{to:function(a){return SC.none(a)?null:Number(a)}}),SC.RecordAttribute.registerTransform(String,{to:function(a){typeof a!="string"&&!SC.none(a)&&a.toString&&(a=a.toString());return a}}),SC.RecordAttribute.registerTransform(Array,{to:function(a){!SC.isArray(a)&&!SC.none(a)&&(a=[]);return a},observesChildren:["[]"]}),SC.RecordAttribute.registerTransform(Object,{to:function(a){typeof a!="object"&&!SC.none(a)&&(a={});return a}}),SC.RecordAttribute.registerTransform(SC.Record,{to:function(a,c,d,e){var f=b(e,"store");return SC.none(a)||a===""?null:f.find(d,a)},from:function(a){return a?b(a,"id"):null}}),SC.RecordAttribute
-.registerTransform("function",{to:function(a,c,d,e){d=d.apply(e);var f=b(e,"store");return f.find(d,a)},from:function(a){return b(a,"id")}}),SC.RecordAttribute.registerTransform(Date,{to:function(a,c){if(SC.none(a))return a;var d;a=a.toString()||"";if(b(c,"useIsoDate")){var e="([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?",f=a.match(new RegExp(e)),g=0,h=new Date(f[1],0,1),i;f[3]&&h.setMonth(f[3]-1),f[5]&&h.setDate(f[5]),f[7]&&h.setHours(f[7]),f[8]&&h.setMinutes(f[8]),f[10]&&h.setSeconds(f[10]),f[12]&&h.setMilliseconds(Number("0."+f[12])*1e3),f[14]&&(g=Number(f[16])*60+Number(f[17]),g*=f[15]==="-"?1:-1),g-=h.getTimezoneOffset(),i=Number(h)+g*60*1e3,d=new Date,d.setTime(Number(i))}else d=new Date(Date.parse(a));return d},_dates:{},_zeropad:function(a){return(a<0?"-":"")+(a<10?"0":"")+Math.abs(a)},from:function(a){if(SC.none(a))return null;var b=this._dates[a.getTime()];if(b)return b;var c=this._zeropad,d=0-a.getTimezoneOffset()/60;d=d===0?"Z":"%@:00".fmt(c(d)),this._dates[a.getTime()]=b="%@-%@-%@T%@:%@:%@%@".fmt(c(a.getFullYear()),c(a.getMonth()+1),c(a.getDate()),c(a.getHours()),c(a.getMinutes()),c(a.getSeconds()),d);return b}}),SC.DateTime&&!SC.RecordAttribute.transforms[SC.guidFor(SC.DateTime)]&&SC.RecordAttribute.registerTransform(SC.DateTime,{to:function(a,c){if(SC.none(a)||a instanceof SC.DateTime)return a;if(SC.none(a)||a instanceof Date)return SC.DateTime.create(a.getTime());var d=b(c,"format");return SC.DateTime.parse(a,d?d:SC.DateTime.recordFormat)},from:function(a,c){if(SC.none(a))return a;var d=b(c,"format");return a.toFormattedString(d?d:SC.DateTime.recordFormat)}}),SC.RecordAttribute.registerTransform(SC.Set,{to:function(a,b,c,d,e){return SC.Set.create(a)},from:function(a,b,c,d,e){return a.toArray()},observesChildren:["[]"]})}({}),function(a){var b=SC.get,c=SC.set;SC.ChildAttribute=SC.RecordAttribute.extend({isNestedRecordTransform:YES,toType:function(a,c,d){var e=null,f,g=b(this,"typeClass");if(!a)throw"SC.Child: Error during transform: Unable to retrieve parent record.";SC.none(d)||(e=a.registerNestedRecord(d,c));return e},fromType:function(a,c,d){var e,f,g;a&&(SC.none(d)?(a.writeAttribute(c,d),g=d):(g=a.registerNestedRecord(d,c),g?(e=b(g,"storeKey"),f=b(g,"store"),a.writeAttribute(c,f.readDataHash(e))):d&&a.writeAttribute(c,d)));return g},call:function(a,c,d){var e=b(this,"key")||c,f,g="__kid__"+SC.guidFor(this);d!==undefined?d=this.fromType(a,c,d):(d=a.readAttribute(e),SC.none(d)&&(d=b(this,"defaultValue"))?typeof d=="function"&&(d=this.defaultValue(a,c,this),b(a,"attributes")&&a.writeAttribute(e,d,!0)):d=this.toType(a,c,d));return d}})}({}),function(a){var b=SC.get,c=SC.set,d=SC.getPath;SC.ChildArray=SC.Object.extend(SC.Enumerable,SC.Array,SC.MutableEnumerable,SC.MutableArray,{defaultRecordType:null,record:null,propertyName:null,children:null,store:function(){return d(this,"record.store")}.property("record").cacheable(),storeKey:function(){return d(this,"record.storeKey")}.property("record").cacheable(),readOnlyChildren:function(){return b(this,"record").readAttribute(b(this,"propertyName"))}.property(),editableChildren:function(){var a=b(this,"store"),c=b(this,"storeKey"),d=b(this,"propertyName"),e,f;e=a.readEditableProperty(c,d),e||(f=a.readEditableDataHash(c),e=f[d]=[]),e!==this._prevChildren&&this.recordPropertyDidChange();return e}.property(),length:function(){var a=b(this,"readOnlyChildren");return a?a.length:0}.property("readOnlyChildren"),objectAt:function(a){var c=this._records,d=b(this,"readOnlyChildren"),e,f,g=b(this,"propertyName"),h=b(this,"record"),i=d?d.length:0;if(!d)return undefined;if(c&&(f=c[a]))return f;c||(this._records=c=[]);if(a>=i)return undefined;e=d.objectAt(a);if(!e)return undefined;c[a]=f=h.registerNestedRecord(e,g,g+"."+a);return f},replace:function(a,c,d){var e=b(this,"editableChildren"),f=d?b(d,"length"):0,g=b(this,"record"),h,i=b(this,"propertyName"),j,k;h=this._processRecordsToHashes(d),e.replace(a,c,h),g.recordDidChange(i);return this},_processRecordsToHashes:function(a){var c,d;a=a||[],a.forEach(function(e,f){e instanceof SC.Record&&(c=b(e,"store"),d=b(e,"storeKey"),d&&(a[f]=c.readDataHash(d)))});return a},normalize:function(){this.forEach(function(a,b){a.normalize&&a.normalize()})},recordPropertyDidChange:function(a){if(a&&!a.contains(b(this,"propertyName")))return this;var c=b(this,"readOnlyChildren"),d=0,e=0,f=this._prevChildren,g=this._childrenContentDidChange;if(c===f)return this;f&&(f.removeArrayObserver(this,{willChange:this.arrayContentWillChange,didChange:g}),d=b(f,"length")),c&&(c.addArrayObserver(this,{willChange:this.arrayContentWillChange,didChange:g}),e=b(c,"length")),this.arrayContentWillChange(0,d,e),this._prevChildren=c,this._childrenContentDidChange(0,d,e);return this},_childrenContentDidChange:function(a,b,c){this._records=null,this.arrayContentDidChange(a,b,c)},init:function(){this._super(),this.recordPropertyDidChange()}})}({}),function(a){var b=SC.get,c=SC.set;SC.ChildrenAttribute=SC.ChildAttribute.extend({toType:function(a,d,e){var f=b(this,"key")||d,g="__kidsArray__"+SC.guidFor(this),h=a[g],i=b(this,"typeClass"),j;h||(h=SC.ChildArray.create({record:a,propertyName:f,defaultRecordType:i}),a[g]=h,j=b(a,"relationships"),j||c(a,"relationships",j=[]),j.push(h));return h},fromType:function(a,b,c){var d,e,f="__kidsArray__"+SC.guidFor(this),g=a[f];a&&(a.writeAttribute(b,c),g&&(g=g.recordPropertyDidChange()));return g}})}({}),function(a){var b=SC.get,c=SC.set,d=SC.RecordAttribute.attrFor;SC.ManyArray=SC.Object.extend(SC.Enumerable,SC.MutableEnumerable,SC.MutableArray,SC.Array,{recordType:null,record:null,propertyName:null,manyAttribute:null,store:function(){return b(b(this,"record"),"store")}.property("record").cacheable(),storeKey:function(){return b(b(this,"record"),"storeKey")}.property("record").cacheable(),readOnlyStoreIds:function(){return b(this,"record").readAttribute(b(this,"propertyName"))}.property(),editableStoreIds:function(){var a=b(this,"store"),c=b(this,"storeKey"),d=b(this,"propertyName"),e,f;e=a.readEditableProperty(c,d),e||(f=a.readEditableDataHash(c),e=f[d]=[]),e!==this._prevStoreIds&&this.recordPropertyDidChange();return e}.property(),isEditable:function(){var a=this.manyAttribute;return a?b(a,"isEditable"):NO}.property("manyAttribute").cacheable(),inverse:function(){var a=this.manyAttribute;return a?b(a,"inverse"):null}.property("manyAttribute").cacheable(),isMaster:function(){var a=this.manyAttribute;return a?b(a,"isMaster"):null}.property("manyAttribute").cacheable(),orderBy:function(){var a=this.manyAttribute;return a?b(a,"orderBy"):null}.property("manyAttribute").cacheable(),length:function(){var a=b(this,"readOnlyStoreIds");return a?b(a,"length"):0}.property("readOnlyStoreIds"),objectAt:function(a){var c=this._records,d=b(this,"readOnlyStoreIds"),e=b(this,"store"),f=b(this,"recordType"),g,h,i;if(!d||!e)return undefined;if(c&&(h=c[a]))return h;c||(this._records=c=[]),i=d.objectAt(a),i&&(g=e.storeKeyFor(f,i),e.readStatus(g)===SC.Record.EMPTY&&e.retrieveRecord(f,null,g),c[a]=h=e.materializeRecord(g));return h},replace:function(a,c,e){if(!b(this,"isEditable"))throw"%@.%@[] is not editable".fmt(b(this,"record"),b(this,"propertyName"));var f=b(this,"editableStoreIds"),g=e?b(e,"length"):0,h=b(this,"record"),i=b(this,"propertyName"),j,k,l,m,n,o,p;l=[];for(j=0;j<g;j++)l[j]=b(e.objectAt(j),"id");n=b(this,"inverse");if(n&&c>0){m=SC.ManyArray._toRemove,m?SC.ManyArray._toRemove=null:m=[];for(j=0;j<c;j++)m[j]=this.objectAt(a+j)}f.replace(a,c,l);if(n){for(j=0;j<c;j++)p=m[j],o=p?d(p,n):null,o&&o.inverseDidRemoveRecord&&o.inverseDidRemoveRecord(p,n,h,i);m&&(m.length=0,SC.ManyArray._toRemove||(SC.ManyArray._toRemove=m));for(j=0;j<g;j++)p=e.objectAt(j),o=p?d(p,n):null,o&&o.inverseDidAddRecord&&o.inverseDidAddRecord(p,n,h,i)}h&&(!n||b(this,"isMaster"))&&h.recordDidChange(i),this.enumerableContentDidChange(a,c,g-c);return this},removeInverseRecord:function(a){if(!a)return this;var c=b(a,"id"),d=b(this,"editableStoreIds"),e=d&&c?d.indexOf(c):-1,f;e>=0&&(d.removeAt(e),b(this,"isMaster")&&(f=b(this,"record"))&&f.recordDidChange(b(this,"propertyName")));return this},addInverseRecord:function(a){if(!a)return this;var c=b(a,"id"),d=b(this,"editableStoreIds"),e=b(this,"orderBy"),f=b(d,"length"),g,h;e?g=this._findInsertionLocation(a,0,f,e):g=f,d.insertAt(g,b(a,"id")),b(this,"isMaster")&&(h=b(this,"record"))&&h.recordDidChange(b(this,"propertyName"));return this},_findInsertionLocation:function(a,b,c,d){var e=b+Math.floor((c-b)/2),f=this.objectAt(e),g=this._compare(a,f,d);return g<0?e===0?e:this._findInsertionLocation(a,0,e,d):g>0?e>=c?e:this._findInsertionLocation(a,e,c,d):e},_compare:function(a,c,d){var e=SC.typeOf(d),f,g,h;if(e==="function")f=d(a,c);else if(e==="string")f=SC.compare(a,c);else{h=b(d,"length"),f=0;for(g=0;f===0&&g<h;g++)f=SC.compare(a,c)}return f},recordPropertyDidChange:function(a){if(a&&!a.contains(b(this,"propertyName")))return this;var c=b(this,"readOnlyStoreIds"),d,e,f=this._prevStoreIds,g=this._storeIdsContentDidChange;if(c===f)return this;f?(f.removeArrayObserver(this,{willChange:this.arrayContentWillChange,didChange:g}),d=b(f,"length")):d=0,c?(c.addArrayObserver(this,{willChange:this.arrayContentWillChange,didChange:g}),e=b(c,"length")):e=0,this.arrayContentWillChange(0,d,e),this._prevStoreIds=c,this._storeIdsContentDidChange(0,d,e)},_storeIdsContentDidChange:function(a,b,c){this._records=null,this.arrayContentDidChange(a,b,c)},init:function(){this._super(),this.recordPropertyDidChange()}})}({}),function(a){var b=SC.get,c=SC.set;SC.ManyAttribute=SC.RecordAttribute.extend({inverse:null,isMaster:YES,orderBy:null,toType:function(a,d,e){var f=b(this,"typeClass"),g=b(this,"key")||d,h="__manyArray__"+SC.guidFor(this),i=a[h],j;i||(i=SC.ManyArray.create({recordType:f,record:a,propertyName:g,manyAttribute:this}),a[h]=i,j=b(a,"relationships"),j||c(a,"relationships",j=[]),j.push(i));return i},fromType:function(a,c,d){var e=[];if(!SC.isArray(d))throw"Expects toMany attribute to be an array";var f=b(d,"length");for(var g=0;g<f;g++)e[g]=b(d.objectAt(g),"id");return e},inverseDidRemoveRecord:function(a,c,d,e){var f=b(a,c);f&&f.removeInverseRecord(d)},inverseDidAddRecord:function(a,c,d,e){var f=b(a,c);f&&f.addInverseRecord(d)}})}({}),function(a){var b=SC.get,c=SC.set,d=b(SC.RecordAttribute,"proto").call,e=SC.RecordAttribute.attrFor;SC.SingleAttribute=SC.RecordAttribute.extend({inverse:null,isMaster:YES,call:function(a,c,d){var f=b(this,"key")||c,g,h,i,j,k,l;if(d!==undefined&&b(this,"isEditable")){if(d&&!(d instanceof SC.Record))throw"%@ is not an instance of SC.Record".fmt(d);g=b(this,"inverse"),g&&(i=this._super(a,c)),l=this.fromType(a,c,d),a.writeAttribute(f,l,!b(this,"isMaster")),k=d,g&&i!==d&&(i&&(j=e(i,g))&&j.inverseDidRemoveRecord(i,g,a,c),d&&(j=e(d,g))&&j.inverseDidAddRecord(d,g,a,c))}else k=this._super(a,c,d);return k},inverseDidRemoveRecord:function(a,c,f,g){var h=b(this,"inverse"),i=d.call(this,a,c),j=b(this,"isMaster"),k;a.writeAttribute(c,null,!j),a.notifyPropertyChange(c),(i!==f||g!==h)&&i&&(k=e(i,h))&&k.inverseDidRemoveRecord(i,h,a,c)},inverseDidAddRecord:function(a,c,f,g){var h=b(this,"inverse"),i=d.call(this,a,c),j=b(this,"isMaster"),k,l;l=this.fromType(a,c,f),a.writeAttribute(c,l,!j),a.notifyPropertyChange(c),(i!==f||g!==h)&&i&&(k=e(i,h))&&k.inverseDidRemoveRecord(i,h,a,c)}})}({}),function(a){}({}),function(a){SC.MIXED_STATE="__MIXED__",SC.DataSource=SC.Object.extend({fetch:function(a,b){return NO},retrieveRecords:function(a,b,c){return this._handleEach(a,b,this.retrieveRecord,c)},commitRecords:function(a,b,c,d,e){var f,g,h;b.length>0&&(h=this.createRecords.call(this,a,b,e)),c.length>0&&(f=this.updateRecords.call(this,a,c,e),h=SC.none(h)?f:h===f?h:SC.MIXED_STATE),d.length>0&&(g=this.destroyRecords.call(this,a,d,e),h=SC.none(h)?g:h===g?h:SC.MIXED_STATE);return h||NO},cancel:function(a,b){return NO},updateRecords:function(a,b,c){return this._handleEach(a,b,this.updateRecord,null,c)},createRecords:function(a,b,c){return this._handleEach(a,b,this.createRecord,null,c)},destroyRecords:function(a,b,c){return this._handleEach(a,b,this.destroyRecord,null,c)},_handleEach:function(a,b,c,d,e){var f=b.length,g,h,i,j;for(g=0;g<f;g++)j=d?d[g]:e,i=c.call(this,a,b[g],j),h===undefined?h=i:h===YES?h=i===YES?YES:SC.MIXED_STATE:h===NO&&(h=i===NO?NO:SC.MIXED_STATE);return SC.none(h)?null:h},updateRecord:function(a,b,c){return NO},retrieveRecord:function(a,b,c){return NO},createRecord:function(a,b,c){return NO},destroyRecord:function(a,b,c){return NO}})}({}),function(a){var b=SC.get,c=SC.set;SC.CascadeDataSource=SC.DataSource.extend({dataSources:null,from:function(a){var d=b(this,"dataSources");d||c(this,"dataSources",d=[]),d.push(a);return this},fetch:function(a,c){var d=b(this,"dataSources"),e=d?d.length:0,f=NO,g,h,i;for(i=0;f!==YES&&i<e;i++)h=d.objectAt(i),g=h.fetch?h.fetch.apply(h,arguments):NO,f=this._handleResponse(f,g);return f},retrieveRecords:function(a,c,d){var e=b(this,"dataSources"),f=e?e.length:0,g=NO,h,i,j;for(j=0;g!==YES&&j<f;j++)i=e.objectAt(j),h=i.retrieveRecords.apply(i,arguments),g=this._handleResponse(g,h);return g},commitRecords:function(a,c,d,e,f){var g=b(this,"dataSources"),h=g?g.length:0,i=NO,j,k,l;for(l=0;i!==YES&&l<h;l++)k=g.objectAt(l),j=k.commitRecords.apply(k,arguments),i=this._handleResponse(i,j);return i},cancel:function(a,c){var d=b(this,"dataSources"),e=d?d.length:0,f=NO,g,h,i;for(i=0;f!==YES&&i<e;i++)h=d.objectAt(i),g=h.cancel.apply(h,arguments),f=this._handleResponse(f,g);return f},init:function(){this._super();var a=b(this,"dataSources"),c=a?b(a,"length"):0,d;while(--c>=0)d=a[c],SC.typeOf(d)==="string"&&(a[c]=b(this,d))},_handleResponse:function(a,b){return b===YES?YES:a===NO?b===NO?NO:SC.MIXED_STATE:SC.MIXED_STATE}})}({}),function(a){var b=SC.get,c=SC.set,d=SC.getPath;SC.FixturesDataSource=SC.DataSource.extend({simulateRemoteResponse:NO,latency:50,cancel:function(a,b){return NO},fetch:function(a,c){if(b(c,"location")!==SC.Query.LOCAL)throw SC.$error("SC.Fixture data source can only fetch local queries");if(!b(c,"recordType")&&!b(c,"recordTypes"))throw SC.$error("SC.Fixture data source can only fetch queries with one or more record types");b(this,"simulateRemoteResponse")?this.invokeLater(this._fetch,b(this,"latency"),a,c):this._fetch(a,c)},_fetch:function(a,c){var e=b(c,"recordType"),f=b(c,"recordTypes")||[e];f.forEach(function(b){SC.typeOf(b)==="string"&&(b=d(b)),b&&this.loadFixturesFor(a,b)},this),a.dataSourceDidFetchQuery(c)},retrieveRecords:function(a,c){var d=b(this,"latency"),e=this.hasFixturesFor(c);if(!e)return e;b(this,"simulateRemoteResponse")?this.invokeLater(this._retrieveRecords,d,a,c):this._retrieveRecords(a,c);return e},_retrieveRecords:function(a,b){b.forEach(function(b){var c=[],d=SC.Store.recordTypeFor(b),e=a.idFor(b),f=this.fixtureForStoreKey(a,b);c.push(b),a.dataSourceDidComplete(b,f,e)},this)},updateRecords:function(a,c,d){var e=b(this,"latency"),f=this.hasFixturesFor(c);if(!f)return f;b(this,"simulateRemoteResponse")?this.invokeLater(this._updateRecords,e,a,c):this._updateRecords(a,c);return f},_updateRecords:function(a,b){b.forEach(function(b){var c=a.readDataHash(b);this.setFixtureForStoreKey(a,b,c),a.dataSourceDidComplete(b)},this)},createRecords:function(a,c,d){var e=b(this,"latency");b(this,"simulateRemoteResponse")?this.invokeLater(this._createRecords,e,a,c):this._createRecords(a,c);return YES},_createRecords:function(a,b){b.forEach(function(b){var c=a.idFor(b),d=a.recordTypeFor(b),e=a.readDataHash(b),f=this.fixturesFor(d);c||(c=this.generateIdFor(d,e,a,b)),this._invalidateCachesFor(d,b,c),f[c]=e,a.dataSourceDidComplete(b,null,c)},this)},destroyRecords:function(a,c,d){var e=b(this,"latency"),f=this.hasFixturesFor(c);if(!f)return f;b(this,"simulateRemoteResponse")?this.invokeLater(this._destroyRecords,e,a,c):this._destroyRecords(a,c);return f},_destroyRecords:function(a,b){b.forEach(function(b){var c=a.idFor(b),d=a.recordTypeFor(b),e=this.fixturesFor(d);this._invalidateCachesFor(d,b,c),c&&delete e[c],a.dataSourceDidDestroy(b)},this)},loadFixturesFor:function(a,b,c){var d=[],e,f,g;e=this.fixturesFor(b);for(f in e)g=b.storeKeyFor(f),a.peekStatus(g)===SC.Record.EMPTY&&d.push(e[f]),c&&c.push(g);d&&d.length>0&&a.loadRecords(b,d);return this},generateIdFor:function(a,b,c,d){return"@id%@".fmt(SC.Store.generateStoreKey())},fixtureForStoreKey:function(a,b){var c=a.idFor(b),d=a.recordTypeFor(b),e=this.fixturesFor(d);return e?e[c]:null},setFixtureForStoreKey:function(a,b,c){var d=a.idFor(b),e=a.recordTypeFor(b),f=this.fixturesFor(e);this._invalidateCachesFor(e,b,d),f[d]=c;return this},fixturesFor:function(a){this._fixtures||(this._fixtures={});var c=this._fixtures[SC.guidFor(a)];if(c)return c;var d=a?a.FIXTURES:null,e=d?d.length:0,f=a?b(a,"proto").primaryKey:"guid",g,h,i;this._fixtures[SC.guidFor(a)]=c={};for(g=0;g<e;g++)h=d[g],i=h[f],i||(i=this.generateIdFor(a,h)),c[i]=h;return c},fixturesLoadedFor:function(a){if(!this._fixtures)return NO;var b=[],c=this._fixtures[SC.guidFor(a)];return c?YES:NO},hasFixturesFor:function(a){var b=NO;a.forEach(function(a){if(b!==SC.MIXED_STATE){var c=SC.Store.recordTypeFor(a),d=c?c.FIXTURES:null;d&&d.length&&d.length>0?b===NO&&(b=YES):b===YES&&(b=SC.MIXED_STATE)}},this);return b},_invalidateCachesFor:function(a,b,c){var d=this._storeKeyCache;d&&delete d[SC.guidFor(a)];return this}}),SC.Record.fixtures=SC.FixturesDataSource.create()}({}),function(a){}({}),function(a){var b=SC.get,c=SC.set;SC.RecordArray=SC.Object.extend(SC.Enumerable,SC.Array,SC.MutableEnumerable,SC.MutableArray,{store:null,query:null,storeKeys:null,status:SC.Record.EMPTY,isEditable:function(){var a=b(this,"query");return a?b(a,"isEditable"):YES}.property("query").cacheable(),length:function(){this.flush();var a=b(this,"storeKeys");return a?b(a,"length"):0}.property("storeKeys").cacheable(),_scra_records:null,objectAt:function(a){this.flush();var c=this._scra_records,d=b(this,"storeKeys"),e=b(this,"store"),f,g;if(!d||!e)return undefined;if(c&&(g=c[a]))return g;c||(this._scra_records=c=[]),f=d.objectAt(a),f&&(e.peekStatus(f)===SC.Record.EMPTY&&e.retrieveRecord(null,null,f),c[a]=g=e.materializeRecord(f));return g},forEach:function(a,c){this.flush();var d=this._scra_records,e=b(this,"storeKeys"),f=b(this,"store"),g=e?b(e,"length"):0,h,i,j;if(!e||!f)return this;d||(d=this._scra_records=[]),c||(c=this);for(h=0;h<g;h++)j=d[h],j||(j=d[h]=f.materializeRecord(e.objectAt(h))),a.call(c,j,h,this);return this},replace:function(a,c,d){this.flush();var e=b(this,"storeKeys"),f=d?b(d,"length"):0,g,h;if(!e)throw"Unable to edit an SC.RecordArray that does not have its storeKeys property set.";if(!b(this,"isEditable"))throw SC.RecordArray.NOT_EDITABLE;h=[];for(g=0;g<f;g++)h[g]=b(d.objectAt(g),"storeKey");e.replace(a,c,h);return this},contains:function(a){return this.indexOf(a)>=0},indexOf:function(a,c){if(!(a instanceof SC.Record)){SC.Logger.warn("Using indexOf on %@ with an object that is not an SC.Record".fmt(a));return-1}this.flush();var d=b(a,"storeKey"),e=b(this,"storeKeys");return e?e.indexOf(d,c):-1},lastIndexOf:function(a,c){if(!(a instanceof SC.Record)){SC.Logger.warn("Using lastIndexOf on %@ with an object that is not an SC.Record".fmt(a));return-1}this.flush();var d=b(a,"storeKey"),e=b(this,"storeKeys");return e?e.lastIndexOf(d,c):-1},add:function(a){if(!(a instanceof SC.Record))return this;this.indexOf(a)<0&&this.pushObject(a);return this},remove:function(a){if(!(a instanceof SC.Record))return this;this.removeObject(a);return this},find:function(a,c){return a&&a.isQuery?b(this,"store").find(a.queryWithScope(this)):this._super(a,c)},refresh:function(){b(this,"store").refreshQuery(b(this,"query"));return this},reload:function(){this.flush(YES);return this},destroy:function(){b(this,"isDestroyed")||b(this,"store").recordArrayWillDestroy(this),this._super()},storeWillFetchQuery:function(a){var d=b(this,"status"),e=SC.Record;if(d===e.EMPTY||d===e.ERROR)d=e.BUSY_LOADING;d&e.READY&&(d=e.BUSY_REFRESH),c(this,"status",d);return this},storeDidFetchQuery:function(a){c(this,"status",SC.Record.READY_CLEAN);return this},storeDidCancelQuery:function(a){var d=b(this,"status"),e=SC.Record;d===e.BUSY_LOADING?d=e.EMPTY:d===e.BUSY_REFRESH&&(d=e.READY_CLEAN),c(this,"status",d);return this},storeDidErrorQuery:function(a){c(this,"status",SC.Record.ERROR);return this},storeDidChangeStoreKeys:function(a,d){var e=b(this,"query");if(b(e,"location")!==SC.Query.LOCAL)return this;if(!e.containsRecordTypes(d))return this;var f=this._scq_changedStoreKeys;f||(f=this._scq_changedStoreKeys=SC.IndexSet.create()),f.addEach(a),c(this,"needsFlush",YES),b(this,"storeKeys")&&this.flush();return this},flush:function(a){if(this._insideFlush){c(this,"needsFlush",YES);return this}if(!b(this,"needsFlush")&&!a)return this;c(this,"needsFlush",NO);var d=b(this,"query"),e=b(this,"store");if(!e||!d||b(d,"location")!==SC.Query.LOCAL)return this;this._insideFlush=YES;var f=b(this,"storeKeys"),g=this._scq_changedStoreKeys,h=NO,i=SC.Record,j=[],k=new Date,l,m,n,o,p,q,r=f;if(f&&!a)g&&(g.forEach(function(a){j.length>0||new Date-k>SC.RecordArray.QUERY_MATCHING_THRESHOLD?j.push(a):(m=e.peekStatus(a),!(m&i.EMPTY)&&!(m&i.DESTROYED||m===i.BUSY_DESTROYING)?(l=e.materializeRecord(a),q=!!l&&!!d.contains(l)):q=NO,q?f.indexOf(a)<0&&(h||(f=f.copy()),f.pushObject(a)):f.indexOf(a)>=0&&(h||(f=f.copy()),f.removeObject(a)))},this),h=YES);else{if(p=b(d,"scope"))o=b(p.flush(),"storeKeys");else if(n=b(d,"expandedRecordTypes"))o=SC.IndexSet.create(),n.forEach(function(a){o.addEach(e.storeKeysFor(n))});f=[],o.forEach(function(a){j.length>0||new Date-k>SC.RecordArray.QUERY_MATCHING_THRESHOLD?j.push(a):(m=e.peekStatus(a),!(m&i.EMPTY)&&!(m&i.DESTROYED||m===i.BUSY_DESTROYING)&&(l=e.materializeRecord(a),l&&d.contains(l)&&f.push(a)))}),h=YES}if(j.length>0){var s=this;window.setTimeout(function(){SC.run(function(){!!s&&!b(s,"isDestroyed")&&(c(s,"needsFlush",YES),s._scq_changedStoreKeys=SC.IndexSet.create().addEach(j),s.flush())})},1)}g&&g.clear(),h&&(f&&f===r&&(f=f.copy()),f=SC.Query.orderStoreKeys(f,d,e),SC.compare(r,f)!==0&&c(this,"storeKeys",SC.copy(f))),this._insideFlush=NO;return this},needsFlush:YES,isError:function(){return b(this,"status")&SC.Record.ERROR}.property("status").cacheable(),errorValue:function(){return b(this,"isError")?SC.val(b(this,"errorObject")):null}.property("isError").cacheable(),errorObject:function(){if(b(this,"isError")){var a=b(this,"store");return a.readQueryError(b(this,"query"))||SC.Record.GENERIC_ERROR}return null}.property("isError").cacheable(),propertyWillChange:function(a){if(a==="storeKeys"){var c=b(this,"storeKeys"),d=c?b(c,"length"):0;this.arrayContentWillChange(0,d,0)}return this._super(a)},_storeKeysDidChange:function(){var a=b(this,"storeKeys"),c=this._prevStoreKeys,d,e,f=this._storeKeysContentDidChange,g=this._storeKeysStateDidChange;a!==c&&(d=c?b(c,"length"):0,e=a?b(a,"length"):0,this._storeKeysContentWillChange(c,0,d,e),c&&c.removeArrayObserver(this,{willChange:this._storeKeysContentWillChange,didChange:this._storeKeysContentDidChange}),this._prevStoreKeys=a,a&&a.addArrayObserver(this,{willChange:this._storeKeysContentWillChange,didChange:this._storeKeysContentDidChange}),this._storeKeysContentDidChange(a,0,d,e))}.observes("storeKeys"),addArrayObserver:function(){this.flush();return this._super.apply(this,arguments)},_storeKeysContentWillChange:function(a,b,c,d){this.arrayContentWillChange(b,c,d)},_storeKeysContentDidChange:function(a,b,c,d){this._scra_records&&(this._scra_records.length=0),this.arrayContentDidChange(b,c,d)},init:function(){this._super(),this._storeKeysDidChange()}}),SC.RecordArray.reopenClass({NOT_EDITABLE:SC.StoreError.desc("SC.RecordArray is not editable"),QUERY_MATCHING_THRESHOLD:100})}({}),function(a){var b=SC.get,c=SC.set,d=SC.getPath,e=SC.none;SC.Store=SC.Object.extend({name:null,nestedStores:null,dataSource:null,isNested:NO,commitRecordsAutomatically:NO,from:function(a){c(this,"dataSource",a);return this},_getDataSource:function(){var a=b(this,"dataSource");typeof a=="string"&&(a=d(a),a&&a.isClass&&(a=a.create()),a&&c(this,"dataSource",a));return a},cascade:function(a){var b=Array.prototype.slice.call(arguments);a=SC.CascadeDataSource.create({dataSources:b});return this.from(a)},chain:function(a,b){a||(a={}),a.parentStore=this,b||(b=SC.NestedStore),sc_assert("%@ is a valid class".fmt(b),SC.typeOf(b)==="class"),sc_assert("%@ is a type of SC.NestedStore".fmt(b),SC.NestedStore.detect(b)),a.childRecords=this.childRecords?SC.copy(this.childRecords):{},a.parentRecords=this.parentRecords?SC.copy(this.parentRecords):{};var c=b.create(a),d=this.nestedStores;d||(d=this.nestedStores=[]),d.push(c);return c},willDestroyNestedStore:function(a){this.nestedStores&&this.nestedStores.removeObject(a);return this},hasNestedStore:function(a){while(a&&a!==this)a=b(a,"parentStore");return a===this},dataHashes:null,statuses:null,revisions:null,editables:null,changelog:null,recordErrors:null,queryErrors:null,childRecords:null,parentRecords:null,storeKeyEditState:function(a){var b=this.editables,c=this.locks;return b&&b[a]?SC.Store.EDITABLE:SC.Store.LOCKED},readDataHash:function(a){return this.dataHashes[a]},readEditableDataHash:function(a){var b=this.dataHashes[a];if(!b)return b;var c=this.editables;c||(c=this.editables=[]),c[a]||(c[a]=1,b=this.dataHashes[a]=SC.copy(b,YES));return b},readEditableProperty:function(a,b){var c=this.readEditableDataHash(a),d=this.editables[a],e=c[b];d===1&&(d=this.editables[a]={}),d[b]||(e=c[b],e&&e.isCopyable&&(e=c[b]=e.copy(YES)),d[b]=YES);return e},writeDataHash:function(a,b,c){b&&(this.dataHashes[a]=b),c&&(this.statuses[a]=c);var d=this.editables;d||(d=this.editables=[]),d[a]=1;var e=this;this._propagateToChildren(a,function(a){e.writeDataHash(a,null,c)});return this},removeDataHash:function(a,b){this.dataHashes[a]=null,this.statuses[a]=b||SC.Record.EMPTY;var c=this.editables;c&&(c[a]=0);return this},readStatus:function(a){this.readDataHash(a);return this.statuses[a]||SC.Record.EMPTY},peekStatus:function(a){return this.statuses[a]||SC.Record.EMPTY},writeStatus:function(a,b){return this.writeDataHash(a,null,b)},dataHashDidChange:function(a,b,c,d){function j(a){i.dataHashDidChange(a,null,c,d)}b||(b=SC.Store.generateStoreKey());var e,f,g,h;e=SC.typeOf(a)==="array",e?f=a.length:(f=1,h=a);var i=this;for(g=0;g<f;g++)e&&(h=a[g]),this.revisions[h]=b,this._notifyRecordPropertyChange(h,c,d),this._propagateToChildren(h,j);return this},_notifyRecordPropertyChange:function(a,c,d){var e=this.records,f=b(this,"nestedStores"),g=SC.Store,h,i,j,k,l,m,n;j=f?f.length:0;for(k=0;k<j;k++){l=f[k],m=l.peekStatus(a),i=l.storeKeyEditState(a);if(i===g.INHERITED)l._notifyRecordPropertyChange(a,c,d);else if(m&SC.Record.BUSY){if(b(l,"hasChanges"))throw g.CHAIN_CONFLICT_ERROR;l.reset()}}var o=this.recordPropertyChanges;o||(o=this.recordPropertyChanges={storeKeys:SC.Set.create(),records:SC.Set.create(),hasDataChanges:SC.Set.create(),propertyForStoreKeys:{}}),o.storeKeys.add(a),e&&(h=e[a])&&(o.records.push(a),c||o.hasDataChanges.push(a),d?((n=o.propertyForStoreKeys[a])||(n=o.propertyForStoreKeys[a]=SC.Set.create()),n!=="*"&&n.add(d)):o.propertyForStoreKeys[a]="*"),SC.run.once(this,this.flush);return this},flush:function(){if(!this.recordPropertyChanges)return this;var a=this.recordPropertyChanges,c=a.storeKeys,d=a.hasDataChanges,e=a.records,f=a.propertyForStoreKeys,g=SC.Set.create(),h,i,j,k,l,m,n;c.forEach(function(a){e.contains(a)&&(j=d.contains(a)?NO:YES,h=this.records[a],n=f?f[a]:null,n==="*"&&(n=null),e.remove(a),h&&h.storeDidChangeProperties(j,n)),i=SC.Store.recordTypeFor(a),g.add(i)},this),b(c,"length")>0&&this._notifyRecordArrays(c,g),c.clear(),d.clear(),e.clear(),this.recordPropertyChanges.propertyForStoreKeys={};return this},reset:function(){this.dataHashes={},this.revisions={},this.statuses={},this.chainedChanges=this.locks=this.editables=null,this.changelog=null,this.recordErrors=null,this.queryErrors=null;var a=this.records,b;if(a)for(b in a){if(!a.hasOwnProperty(b))continue;this._notifyRecordPropertyChange(parseInt(b,10),NO)}c(this,"hasChanges",NO)},commitChangesFromNestedStore:function(a,c,d){d||this._verifyLockRevisions(c,a.locks);var e=c.length,f,g,h,i,j,k,l,m,n,o,p,q,r;k=this.revisions,h=this.dataHashes,i=this.statuses,j=this.editables,l=this.parentRecords?this.parentRecords:this.parentRecords={},m=this.childRecords?this.childRecords:this.childRecords={},j||(j=this.editables=[]),n=a.dataHashes,p=a.revisions,o=a.statuses,q=a.parentRecords||{},r=a.childRecords||{};for(f=0;f<e;f++)g=c[f],h[g]=n[g],i[g]=o[g],k[g]=p[g],l[g]=q[g],m[g]=r[g],j[g]=0,this._notifyRecordPropertyChange(g,NO);var s=this.changelog,t=a.changelog;t&&(s||(s=this.changelog=SC.Set.create()),s.addEach(t)),this.changelog=s,b(this,"parentStore")||this.flush();return this},_verifyLockRevisions:function(a,b){var c=a.length,d=this.revisions,e,f,g,h;if(b&&d)for(e=0;e<c;e++){f=a[e],g=b[f]||1,h=d[f]||1;if(g<h)throw SC.Store.CHAIN_CONFLICT_ERROR}return this},find:function(a,b){"string"==typeof a&&(a=d(a));if(b!==undefined||a instanceof SC.Record)return this._findRecord(a,b);sc_assert("SC.Store#find() accepts only a record type of query",SC.Record.detect(a)||a instanceof SC.Query),a instanceof SC.Query||(a=SC.Query.local(a));return this._findQuery(a,YES,YES)},findAll:function(a,b,c){SC.Logger.warn("SC.Store#findAll() will be removed in a future version of SproutCore. Use SC.Store#find() instead");if(!a||!a.isQuery)a=SC.Query.local(a,b,c);return this._findQuery(a,YES,YES)},_findQuery:function(a,d,e){var f=this._scst_recordArraysByQuery,g=SC.guidFor(a),h,i;f||(f=this._scst_recordArraysByQuery={}),h=f[g],!h&&d&&(f[g]=h=SC.RecordArray.create({store:this,query:a}),i=b(this,"recordArrays"),i||c(this,"recordArrays",i=SC.Set.create()),i.add(h),e&&this.refreshQuery(a)),this.flush();return h},_findRecord:function(a,c){var d;a&&a instanceof SC.Record?d=b(a,"storeKey"):d=c?a.storeKeyFor(c):null,d&&this.readStatus(d)===SC.Record.EMPTY&&(d=this.retrieveRecord(a,c));return d?this.materializeRecord(d):null},recordArrayWillDestroy:function(a){var c=this._scst_recordArraysByQuery,d=b(this,"recordArrays");c&&delete c[SC.guidFor(b(a,"query"))],d&&d.remove(a);return this},refreshQuery:function(a){if(!a)throw new Error("refreshQuery() requires a query");var b=this._scst_recordArraysByQuery,c=b?b[SC.guidFor(a)]:null,d=this._getDataSource();d&&d.fetch&&(c&&c.storeWillFetchQuery(a),d.fetch.call(d,this,a));return this},_notifyRecordArrays:function(a,c){var d=b(this,"recordArrays");if(!d)return this;d.forEach(function(b){b&&b.storeDidChangeStoreKeys(a,c)},this);return this},recordsFor:function(a){var b=[],c=a.storeKeysById(),d,e,f;for(d in c)e=c[d],this.readStatus(e)!==SC.RECORD_EMPTY&&b.push(e);b.length>0?f=SC.RecordArray.create({store:this,storeKeys:b}):f=b;return f},_TMP_REC_ATTRS:{},materializeRecord:function(a){var b=this.records,c,d,e;b||(b=this.records={}),c=b[a];if(c)return c;d=SC.Store.recordTypeFor(a);if(!d)return null;e=this._TMP_REC_ATTRS,e.storeKey=a,e.store=this,c=b[a]=d.create(e);return c},createRecord:function(a,c,d){var e,f,g,h=SC.Record,i,j,k,l;!d&&(e=b(a,"proto").primaryKey)&&(d=c[e],l=SC.RecordAttribute.attrFor(b(a,"proto"),e),j=l&&b(l,"defaultValue"),!d&&SC.typeOf(j)==="function"&&(d=c[e]=j())),f=d?a.storeKeyFor(d):SC.Store.generateStoreKey(),g=this.readStatus(f);if(g&h.BUSY||g&h.READY||g===h.DESTROYED_DIRTY)throw d?h.RECORD_EXISTS_ERROR:h.BAD_STATE_ERROR;if(!d&&(g===SC.DESTROYED_CLEAN||g===SC.StoreError))throw h.BAD_STATE_ERROR;this.writeDataHash(f,c?c:{},h.READY_NEW),SC.Store.replaceRecordTypeFor(f,a),this.dataHashDidChange(f),i=this.changelog,i||(i=SC.Set.create()),i.add(f),this.changelog=i,b(this,"commitRecordsAutomatically")&&SC.run.schedule("actions",this,this.commitRecords),k=this.materializeRecord(f),k&&k.propagateToAggregates();return k},createRecords:function(a,b,c){var d=[],e,f,g,h=b.length,i;g=SC.typeOf(a)==="array",g||(e=a);for(i=0;i<h;i++)g&&(e=a[i]||SC.Record),f=c?c[i]:undefined,d.push(this.createRecord(e,b[i],f));return d},unloadRecord:function(a,b,c,d){c===undefined&&(c=a.storeKeyFor(b));var e=this.readStatus(c),f=SC.Record;d=d||f.EMPTY;if(e===f.BUSY_DESTROYING||e&f.DESTROYED)return this;if(e&f.BUSY)throw f.BUSY_ERROR;e=d,this.removeDataHash(c,e),this.dataHashDidChange(c);var g=this;this._propagateToChildren(c,function(a){g.unloadRecord(null,null,a,d)});return this},unloadRecords:function(a,b,c,d){var e,f,g,h,i,j;if(c===undefined){f=SC.typeOf(a)==="array",f||(i=a);if(b===undefined){e=f?a.length:1;for(g=0;g<e;g++)f&&(i=a[g]),c=this.storeKeysFor(i),this.unloadRecords(undefined,undefined,c,d)}else{e=b.length;for(g=0;g<e;g++)f&&(i=a[g]||SC.Record),h=b?b[g]:undefined,this.unloadRecord(i,h,undefined,d)}}else{e=c.length;for(g=0;g<e;g++)j=c?c[g]:undefined,this.unloadRecord(undefined,undefined,j,d)}return this
-},destroyRecord:function(a,c,d){d===undefined&&(d=a.storeKeyFor(c));var e=this.readStatus(d),f,g=SC.Record;if(e===g.BUSY_DESTROYING||e&g.DESTROYED)return this;if(e===g.EMPTY)throw g.NOT_FOUND_ERROR;if(e&g.BUSY)throw g.BUSY_ERROR;e===g.READY_NEW?e=g.DESTROYED_CLEAN:e=g.DESTROYED_DIRTY,this.writeStatus(d,e),this.dataHashDidChange(d),f=this.changelog,f||(f=this.changelog=SC.Set.create()),e&g.DIRTY?f.add(d):f.remove(d),this.changelog=f,b(this,"commitRecordsAutomatically")&&SC.run.schedule("actions",this,this.commitRecords);var h=this;this._propagateToChildren(d,function(a){h.destroyRecord(null,null,a)});return this},destroyRecords:function(a,b,c){var d,e,f,g,h,i;if(c===undefined){d=b.length,e=SC.typeOf(a)==="array",e||(h=a);for(f=0;f<d;f++)e&&(h=a[f]||SC.Record),g=b?b[f]:undefined,this.destroyRecord(h,g,undefined)}else{d=c.length;for(f=0;f<d;f++)i=c?c[f]:undefined,this.destroyRecord(undefined,undefined,i)}return this},registerChildToParent:function(a,b,c){var d,e,f,g,h;e=this.childRecords||{},d=this.parentRecords||{},f=e[b],f&&(g=d[f],delete g[b]),h=d[a]||{},h[b]=c||YES,d[a]=h,e[b]=a,this.writeStatus(b,this.statuses[a]),this.childRecords=e,this.parentRecords=d},materializeParentRecord:function(a){var b,c;if(e(a))return null;c=this.childRecords,b=c?this.childRecords[a]:null;if(e(b))return null;return this.materializeRecord(b)},parentStoreKeyExists:function(a){if(!e(a)){var b=this.childRecords||{};return b[a]}},_propagateToChildren:function(a,b){if(!e(this.parentRecords)){var c=this.parentRecords[a]||{};if(e(b))return;for(var d in c)c.hasOwnProperty(d)&&b(d)}},recordDidChange:function(a,c,d,e,f){d===undefined&&(d=a.storeKeyFor(c));var g=this.readStatus(d),h,i=SC.Record;if(g&i.BUSY)throw i.BUSY_ERROR;if(!(g&i.READY))throw i.NOT_FOUND_ERROR;g!=i.READY_NEW&&this.writeStatus(d,i.READY_DIRTY),this.dataHashDidChange(d,null,f,e),h=this.changelog,h||(h=this.changelog=SC.Set.create()),h.add(d),this.changelog=h,b(this,"commitRecordsAutomatically")&&SC.run.schedule("actions",this,this.commitRecords);return this},recordsDidChange:function(a,b,c){var d,e,f,g,h,i;if(c===undefined){d=b.length,e=SC.typeOf(a)==="array",e||(h=a);for(f=0;f<d;f++)e&&(h=a[f]||SC.Record),g=b?b[f]:undefined,i=c?c[f]:undefined,this.recordDidChange(h,g,i)}else{d=c.length;for(f=0;f<d;f++)i=c?c[f]:undefined,this.recordDidChange(undefined,undefined,i)}return this},retrieveRecords:function(a,b,c,d,e){var f=this._getDataSource(),g=SC.typeOf(a)==="array",h=SC.typeOf(e)==="array",i=c?c.length:b.length,j=[],k=SC.Store.generateStoreKey(),l=SC.Record,m,n,o,p,q,r;g||(m=a);for(n=0;n<i;n++){c?o=c[n]:(g&&(m=a[n]),o=m.storeKeyFor(b[n])),r=h?e[n]:e,p=this.readStatus(o);if(p==l.EMPTY||p==l.ERROR||p==l.DESTROYED_CLEAN)this.writeStatus(o,l.BUSY_LOADING),this.dataHashDidChange(o,k,YES),j.push(o),this._setCallbackForStoreKey(o,r,h,c);else if(d)if(p&l.READY)this.writeStatus(o,l.BUSY_REFRESH|p&3),this.dataHashDidChange(o,k,YES),j.push(o),this._setCallbackForStoreKey(o,r,h,c);else{if(p==l.BUSY_DESTROYING||p==l.BUSY_CREATING||p==l.BUSY_COMMITTING)throw l.BUSY_ERROR;if(p==l.DESTROYED_DIRTY)throw l.BAD_STATE_ERROR}}q=NO,f&&(q=f.retrieveRecords.call(f,this,j,b));if(!q){i=j.length,k=SC.Store.generateStoreKey();for(n=0;n<i;n++)o=j[n],p=this.readStatus(o),p===l.BUSY_LOADING?(this.writeStatus(o,l.ERROR),this.dataHashDidChange(o,k,YES)):p&l.BUSY_REFRESH&&(this.writeStatus(o,l.READY|p&3),this.dataHashDidChange(o,k,YES));j.length=0}return j},_TMP_RETRIEVE_ARRAY:[],_callback_queue:{},_setCallbackForStoreKey:function(a,b,c,d){var e=this._callback_queue;c?e[a]={callback:b,otherKeys:d}:e[a]=b},_retreiveCallbackForStoreKey:function(a){var b=this._callback_queue,c=b[a],d,e;c&&(SC.typeOf(c)==="function"?(c.call(),delete b[a]):SC.typeOf(c)=="object"&&(c.completed=YES,e=c.storeKeys,e.forEach(function(a){b[a].completed||(d=YES)}),d&&(c.callback.call(),e.forEach(function(a){delete b[a]}))))},_cancelCallback:function(a){var b=this._callback_queue;b[a]&&delete b[a]},retrieveRecord:function(a,b,c,d,e){var f=this._TMP_RETRIEVE_ARRAY,g;c?(f[0]=c,c=f,b=null):(f[0]=b,b=f),g=this.retrieveRecords(a,b,c,d,e),f.length=0;return g[0]},refreshRecord:function(a,b,c,d){return!!this.retrieveRecord(a,b,c,YES,d)},refreshRecords:function(a,b,c,d){var e=this.retrieveRecords(a,b,c,YES,d);return e&&e.length>0},commitRecords:function(a,c,d,e,f){var g=this._getDataSource(),h=SC.typeOf(a)==="array",i=SC.typeOf(f)==="array",j=[],k=[],l=[],m=SC.Store.generateStoreKey(),n=SC.Record,o,p,q,r,s,t,u,v;!a&&!c&&!d&&(d=this.changelog),u=d?b(d,"length"):c?b(c,"length"):0;for(p=0;p<u;p++){d?q=d[p]:(h?o=a[p]||SC.Record:o=a,q=o.storeKeyFor(c[p])),v=i?f[p]:f,r=this.readStatus(q);if(r==n.EMPTY||r==n.ERROR)throw n.NOT_FOUND_ERROR;r==n.READY_NEW?(this.writeStatus(q,n.BUSY_CREATING),this.dataHashDidChange(q,m,YES),j.push(q),this._setCallbackForStoreKey(q,v,i,d)):r==n.READY_DIRTY?(this.writeStatus(q,n.BUSY_COMMITTING),this.dataHashDidChange(q,m,YES),k.push(q),this._setCallbackForStoreKey(q,v,i,d)):r==n.DESTROYED_DIRTY?(this.writeStatus(q,n.BUSY_DESTROYING),this.dataHashDidChange(q,m,YES),l.push(q),this._setCallbackForStoreKey(q,v,i,d)):r==n.DESTROYED_CLEAN&&this.dataHashDidChange(q,m,YES)}g&&(u>0||e)&&(t=g.commitRecords.call(g,this,j,k,l,e)),t&&!a&&!c&&(d===this.changelog?this.changelog=null:this.changelog.removeEach(d));return t},commitRecord:function(a,b,c,d,e){var f=this._TMP_RETRIEVE_ARRAY,g;if(b===undefined&&c===undefined)return NO;c!==undefined?(f[0]=c,c=f,b=null):(f[0]=b,b=f),g=this.commitRecords(a,b,c,d,e),f.length=0;return g},cancelRecords:function(a,b,c){var d=this._getDataSource(),e=SC.typeOf(a)==="array",f=SC.Record,g=[],h,i,j,k,l,m;i=c===undefined?b.length:c.length;for(j=0;j<i;j++){e?l=a[j]||SC.Record:l=a||SC.Record,k=b?b[j]:undefined,c===undefined?m=l.storeKeyFor(k):m=c?c[j]:undefined;if(m){h=this.readStatus(m);if(h==f.EMPTY||h==f.ERROR)throw f.NOT_FOUND_ERROR;g.push(m),this._cancelCallback(m)}}d&&d.cancel.call(d,this,g);return this},cancelRecord:function(a,b,c){var d=this._TMP_RETRIEVE_ARRAY,e;c!==undefined?(d[0]=c,c=d,b=null):(d[0]=b,b=d),e=this.cancelRecords(a,b,c),d.length=0;return this},loadRecord:function(a,c,d){var e=SC.Record,f,g,h;a=a||SC.Record,g=b(a,"proto").primaryKey,d=d||c[g],f=h=a.storeKeyFor(d),this.readStatus(h)&e.BUSY?this.dataSourceDidComplete(h,c,d):this.pushRetrieve(a,d,c,h);return f},loadRecords:function(a,c,d){var e=SC.typeOf(a)==="array",f=b(c,"length"),g=[],h=SC.Record,i,j,k,l,m,n;e||(i=a||SC.Record,k=b(i,"proto").primaryKey);for(l=0;l<f;l++)m=c.objectAt(l),e&&(i=a.objectAt(l)||SC.Record,k=b(i,"proto").primaryKey),j=d?d.objectAt(l):m[k],g[l]=this.loadRecord(i,m,j);return g},readError:function(a){var b=this.recordErrors;return b?b[a]:undefined},readQueryError:function(a){var b=this.queryErrors;return b?b[SC.guidFor(a)]:undefined},dataSourceDidCancel:function(a){var b=this.readStatus(a),c=SC.Record;if(!(b&c.BUSY))throw c.BAD_STATE_ERROR;switch(b){case c.BUSY_LOADING:b=c.EMPTY;break;case c.BUSY_CREATING:b=c.READY_NEW;break;case c.BUSY_COMMITTING:b=c.READY_DIRTY;break;case c.BUSY_REFRESH_CLEAN:b=c.READY_CLEAN;break;case c.BUSY_REFRESH_DIRTY:b=c.READY_DIRTY;break;case c.BUSY_DESTROYING:b=c.DESTROYED_DIRTY;break;default:throw c.BAD_STATE_ERROR}this.writeStatus(a,b),this.dataHashDidChange(a,null,YES),this._cancelCallback(a);return this},dataSourceDidComplete:function(a,b,c){var d=this.readStatus(a),f=SC.Record,g;if(!(d&f.BUSY))throw f.BAD_STATE_ERROR;if(d===f.BUSY_DESTROYING)throw f.BAD_STATE_ERROR;d=f.READY_CLEAN,this.writeStatus(a,d),b&&this.writeDataHash(a,b,d),c&&SC.Store.replaceIdFor(a,c),g=b||c?NO:YES,this.dataHashDidChange(a,null,g);var h=this.materializeRecord(a);e(h)||h.notifyPropertyChange("status"),this._retreiveCallbackForStoreKey(a);return this},dataSourceDidDestroy:function(a){var b=this.readStatus(a),c=SC.Record;if(!(b&c.BUSY))throw c.BAD_STATE_ERROR;b=c.DESTROYED_CLEAN,this.removeDataHash(a,b),this.dataHashDidChange(a);var d=this.materializeRecord(a);e(d)||d.notifyPropertyChange("status"),this._retreiveCallbackForStoreKey(a);return this},dataSourceDidError:function(a,b){var c=this.readStatus(a),d=this.recordErrors,f=SC.Record;if(!(c&f.BUSY))throw f.BAD_STATE_ERROR;c=f.ERROR,b&&b.isError&&(d||(d=this.recordErrors=[]),d[a]=b),this.writeStatus(a,c),this.dataHashDidChange(a,null,YES);var g=this.materializeRecord(a);e(g)||g.notifyPropertyChange("status"),this._retreiveCallbackForStoreKey(a);return this},pushRetrieve:function(a,b,c,d){var e=SC.Record,f;d===undefined&&(d=a.storeKeyFor(b)),f=this.readStatus(d);if(f==e.EMPTY||f==e.ERROR||f==e.READY_CLEAN||f==e.DESTROYED_CLEAN){f=e.READY_CLEAN,c===undefined?this.writeStatus(d,f):this.writeDataHash(d,c,f),this.dataHashDidChange(d);return d}return NO},pushDestroy:function(a,b,c){var d=SC.Record,e;c===undefined&&(c=a.storeKeyFor(b)),e=this.readStatus(c);if(e==d.EMPTY||e==d.ERROR||e==d.READY_CLEAN||e==d.DESTROYED_CLEAN){e=d.DESTROYED_CLEAN,this.removeDataHash(c,e),this.dataHashDidChange(c);return c}return NO},pushError:function(a,b,c,d){var e=SC.Record,f,g=this.recordErrors;d===undefined&&(d=a.storeKeyFor(b)),f=this.readStatus(d);if(f==e.EMPTY||f==e.ERROR||f==e.READY_CLEAN||f==e.DESTROYED_CLEAN){f=e.ERROR,c&&c.isError&&(g||(g=this.recordErrors=[]),g[d]=c),this.writeStatus(d,f),this.dataHashDidChange(d,null,YES);return d}return NO},loadQueryResults:function(a,d){if(b(a,"location")===SC.Query.LOCAL)throw new Error("Cannot load query results for a local query");var e=this._findQuery(a,YES,NO);e&&c(e,"storeKeys",d),this.dataSourceDidFetchQuery(a);return this},dataSourceDidFetchQuery:function(a){return this._scstore_dataSourceDidFetchQuery(a,YES)},_scstore_dataSourceDidFetchQuery:function(a,c){var d=this._findQuery(a,c,NO),e=b(this,"nestedStores"),f=e?b(e,"length"):0;d&&d.storeDidFetchQuery(a);while(--f>=0)e[f]._scstore_dataSourceDidFetchQuery(a,NO);return this},dataSourceDidCancelQuery:function(a){return this._scstore_dataSourceDidCancelQuery(a,YES)},_scstore_dataSourceDidCancelQuery:function(a,c){var d=this._findQuery(a,c,NO),e=b(this,"nestedStores"),f=e?b(e,"length"):0;d&&d.storeDidCancelQuery(a);while(--f>=0)e[f]._scstore_dataSourceDidCancelQuery(a,NO);return this},dataSourceDidErrorQuery:function(a,b){var c=this.queryErrors;b&&b.isError&&(c||(c=this.queryErrors={}),c[SC.guidFor(a)]=b);return this._scstore_dataSourceDidErrorQuery(a,YES)},_scstore_dataSourceDidErrorQuery:function(a,c){var d=this._findQuery(a,c,NO),e=b(this,"nestedStores"),f=e?b(e,"length"):0;d&&d.storeDidErrorQuery(a);while(--f>=0)e[f]._scstore_dataSourceDidErrorQuery(a,NO);return this},init:function(){this._super(),this.reset()},toString:function(){var a=b(this,"name");if(!a)return this._super();var c=this._super();return"%@ (%@)".fmt(a,c)},idFor:function(a){return SC.Store.idFor(a)},recordTypeFor:function(a){return SC.Store.recordTypeFor(a)},storeKeyFor:function(a,b){return a.storeKeyFor(b)},storeKeyExists:function(a,b){return a.storeKeyExists(b)},storeKeysFor:function(a){var b=[],c=a&&a.isEnumerable,d,e,f;if(!this.statuses)return b;for(e in SC.Store.recordTypesByStoreKey)d=SC.Store.recordTypesByStoreKey[e],c?f=a.contains(d):f=d===a,f&&this.statuses[e]&&b.push(parseInt(e,10));return b},storeKeys:function(){var a=[],b;if(!this.statuses)return a;for(b in this.statuses)this.statuses[b]!=SC.Record.EMPTY&&a.push(parseInt(b,10));return a},statusString:function(a){var b=this.materializeRecord(a);return b.statusString()}}),SC.Store.reopenClass({CHAIN_CONFLICT_ERROR:new Error("Nested Store Conflict"),NO_PARENT_STORE_ERROR:new Error("Parent Store Required"),NESTED_STORE_UNSUPPORTED_ERROR:new Error("Unsupported In Nested Store"),NESTED_STORE_RETRIEVE_DIRTY_ERROR:new Error("Cannot Retrieve Dirty Record in Nested Store"),EDITABLE:"editable",LOCKED:"locked",INHERITED:"inherited",idsByStoreKey:[],recordTypesByStoreKey:{},queriesByStoreKey:[],nextStoreKey:1,generateStoreKey:function(){return this.nextStoreKey++},idFor:function(a){return this.idsByStoreKey[a]},queryFor:function(a){return this.queriesByStoreKey[a]},recordTypeFor:function(a){return this.recordTypesByStoreKey[a]},replaceIdFor:function(a,b){var c=this.idsByStoreKey[a],d,e;if(c!==b){d=this.recordTypeFor(a);if(!d)throw new Error("replaceIdFor: storeKey %@ does not exist".fmt(a));this.idsByStoreKey[a]=b,e=d.storeKeysById(),delete e[c],e[b]=a}return this},replaceRecordTypeFor:function(a,b){this.recordTypesByStoreKey[a]=b;return this}}),SC.Store.reopen({nextStoreIndex:1}),SC.Store._getDefaultStore=function(){var a=this._store;a||(this._store=a=SC.Store.create());return a},SC.Store.updateRecords=function(a,b,c,d){SC.Logger.warn("SC.Store.updateRecords() is deprecated. Use loadRecords() instead");var e=this._getDefaultStore(),f=a.length,g,h;if(!c){c=[];for(g=0;g<f;g++)c[g]=a[g].recordType}h=e.loadRecords(c,a),f=h.length;for(g=0;g<f;g++)h[g]=e.materializeRecord(h[g]);return h},SC.Store.find=function(a,b){return this._getDefaultStore().find(b,a)},SC.Store.findAll=function(a,b){return this._getDefaultStore().findAll(a,b)}}({}),function(a){var b=SC.get,c=SC.set,d=SC.platform.create;SC.NestedStore=SC.Store.extend({hasChanges:NO,parentStore:null,isNested:YES,lockOnRead:YES,locks:null,chainedChanges:null,find:function(a){sc_assert("SC.Store#find() can only accept LOCAL queries in nested stores",!a||!(a instanceof SC.Query)||b(a,"location")===SC.Query.LOCAL);return this._super.apply(this,arguments)},commitChanges:function(a){if(b(this,"hasChanges")){var c=b(this,"parentStore");c.commitChangesFromNestedStore(this,this.chainedChanges,a)}this.reset();return this},discardChanges:function(){var a,c;if((a=this.records)&&(c=this.locks)){var d=b(this,"parentStore"),e=d.revisions,f=this.revisions,g,h,i;for(g in a){if(!a.hasOwnProperty(g))continue;if(!(h=c[g]))continue;i=e[g],(i!==h||f[g]>i)&&this._notifyRecordPropertyChange(parseInt(g,10))}}this.reset(),this.flush();return this},destroy:function(){this.discardChanges();var a=b(this,"parentStore");a&&a.willDestroyNestedStore(this),this._super();return this},reset:function(){var a,e,f,g=b(this,"parentStore");if(!g)throw SC.Store.NO_PARENT_STORE_ERROR;this.dataHashes=d(g.dataHashes),this.revisions=d(g.revisions),this.statuses=d(g.statuses),this.childRecords=g.childRecords?d(g.childRecords):{},this.parentRecords=g.parentRecords?d(g.parentRecords):{},this.chainedChanges=this.locks=this.editables=null,this.changelog=null,c(this,"hasChanges",NO)},refreshQuery:function(a){var c=b(this,"parentStore");c&&c.refreshQuery(a);return this},readError:function(a){var c=b(this,"parentStore");return c?c.readError(a):null},readQueryError:function(a){var c=b(this,"parentStore");return c?c.readQueryError(a):null},storeKeyEditState:function(a){var b=this.editables,c=this.locks;return b&&b[a]?SC.Store.EDITABLE:c&&c[a]?SC.Store.LOCKED:SC.Store.INHERITED},_lock:function(a){var c=this.locks,d,e,f,g,h,i,j,k;if(c&&c[a])return this;c||(c=this.locks=[]),e=this.editables,e&&(e[a]=0);var l=b(this,"parentStore"),m;while(l&&(m=l.storeKeyEditState(a))===SC.Store.INHERITED)l=b(l,"parentStore");l&&m===SC.Store.EDITABLE?(f=this.childRecords[a],f?(this._lock(f),g=this.parentRecords[f],g&&(h=g[a],this.dataHashes[a]=h?SC.getPath(this.dataHashes[f],h):null)):this.dataHashes[a]=SC.copy(l.dataHashes[a],YES),e||(e=this.editables=[]),e[a]=1):this.dataHashes[a]=this.dataHashes[a],this.statuses[a]=this.statuses[a],d=this.revisions[a]=this.revisions[a],c[a]=d||1;return this},readDataHash:function(a){b(this,"lockOnRead")&&this._lock(a);return this.dataHashes[a]},readEditableDataHash:function(a){this._lock(a);return this._super(a)},writeDataHash:function(a,b,c){var d=this.locks,e=NO,f;b?this.dataHashes[a]=b:(this._lock(a),e=YES),c?this.statuses[a]=c:e||(this.statuses[a]=this.statuses[a]||SC.Record.READY_NEW),e||(f=this.revisions[a]=this.revisions[a],d||(d=this.locks=[]),d[a]||(d[a]=f||1));var g=this.editables;g||(g=this.editables=[]),g[a]=1;return this},removeDataHash:function(a,b){var c=this.locks;c||(c=this.locks=[]),c[a]||(c[a]=this.revisions[a]||1);return this._super(a,b)},dataHashDidChange:function(a,b,d,e){b||(b=SC.Store.generateStoreKey());var f,g,h,i;f=SC.typeOf(a)==="array",f?g=a.length:(g=1,i=a);var j=this.chainedChanges;j||(j=this.chainedChanges=SC.Set.create());for(h=0;h<g;h++)f&&(i=a[h]),this._lock(i),this.revisions[i]=b,j.add(i),this._notifyRecordPropertyChange(i,d,e);c(this,"hasChanges",YES);return this},commitChangesFromNestedStore:function(a,d,e){this._super(a,d,e);var f=b(this,"parentStore"),g=f.revisions,h,i=this.locks,j=this.chainedChanges,k,l;i||(i=this.locks=[]),j||(j=this.chainedChanges=SC.Set.create()),k=d.length;for(h=0;h<k;h++)l=d[h],i[l]||(i[l]=g[l]||1),j.add(l);c(this,"hasChanges",b(j,"length")>0),this.flush();return this},queryFor:function(a,c,d){return b(this,"parentStore").queryFor(a,c,d)},findAll:function(a,c,d,e,f){f||(f=this);return b(this,"parentStore").findAll(a,c,d,e,f)},retrieveRecords:function(a,c,d,e){var f=b(this,"parentStore"),g,h,i,j=d?d.length:c.length,k=SC.Record,l;if(e)for(g=0;g<j;g++){h=d?d[g]:f.storeKeyFor(a,c[g]),l=this.peekStatus(h);if(l&k.DIRTY)throw SC.Store.NESTED_STORE_RETRIEVE_DIRTY_ERROR;var m=this.dataHashes,n=this.revisions,o=this.statuses,p=this.editables,q=this.locks,r=NO,s=NO;m&&m.hasOwnProperty(h)&&(delete m[h],r=YES),n&&n.hasOwnProperty(h)&&(delete n[h],r=YES),p&&delete p[h],q&&delete q[h],o&&o.hasOwnProperty(h)&&(delete o[h],r||(s=YES),r=YES),r&&this._notifyRecordPropertyChange(h,s)}return f.retrieveRecords(a,c,d,e)},commitRecords:function(a,b,c){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},commitRecord:function(a,b,c){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},cancelRecords:function(a,b,c){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},cancelRecord:function(a,b,c){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},dataSourceDidCancel:function(a){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},dataSourceDidComplete:function(a,b,c){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},dataSourceDidDestroy:function(a){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},dataSourceDidError:function(a,b){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},pushRetrieve:function(a,b,c,d){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},pushDestroy:function(a,b,c){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR},pushError:function(a,b,c,d){throw SC.Store.NESTED_STORE_UNSUPPORTED_ERROR}})}({}),function(a){}({}),function(a){}({})
View
3,264 js/libs/sproutcore-statechart.js
0 additions, 3,264 deletions not shown
View
8 js/libs/sproutcore-statechart.min.js
@@ -1,8 +0,0 @@
-// ==========================================================================
-// Project: SproutCore - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-(function(a){SC.handleActions=function(a){var b=Array.prototype.slice.call(arguments);b.shift(),a.isActionHandler=YES,a.actions=b;return a},SC.stateObserves=function(a){var b=Array.prototype.slice.call(arguments);b.shift(),a.isStateObserveHandler=YES,a.args=b;return a}})({}),function(a){SC.StatechartSequenceMatcher=SC.Object.extend({statechartMonitor:null,match:null,MISMATCH:{},begin:function(){this._stack=[],this.beginSequence(),this._start=this._stack[0];return this},end:function(){this.endSequence();if(this._stack.length>0)throw"can not match sequence. sequence matcher has been left in an invalid state";var a=this.statechartMonitor,b=this._matchSequence(this._start,0)===a.sequence.length;this.set("match",b);return b},entered:function(){this._addStatesToCurrentGroup("entered",arguments);return this},exited:function(){this._addStatesToCurrentGroup("exited",arguments);return this},beginConcurrent:function(){var a={type:"concurrent",values:[]};this._peek()&&this._peek().values.push(a),this._stack.push(a);return this},endConcurrent:function(){this._stack.pop();return this},beginSequence:function(){var a={type:"sequence",values:[]};this._peek()&&this._peek().values.push(a),this._stack.push(a);return this},endSequence:function(){this._stack.pop();return this},_peek:function(){var a=this._stack.length;return a===0?null:this._stack[a-1]},_addStatesToCurrentGroup:function(a,b){var c=this._peek(),d=b.length,e=0;for(;e<d;e+=1)c.values.push({action:a,state:b[e]})},_matchSequence:function(a,b){var c=a.values,d=c.length,e=0,f,g=this.statechartMonitor;if(d===0)return b;if(b>g.sequence.length)return this.MISMATCH;for(;e<d;e+=1){f=c[e];if(f.type==="sequence")b=this._matchSequence(f,b);else if(f.type==="concurrent")b=this._matchConcurrent(f,b);else{if(!this._matchItems(f,g.sequence[b]))return this.MISMATCH;b+=1}if(b===this.MISMATCH)return this.MISMATCH}return b},_matchConcurrent:function(a,b){var c=a.values.slice(0),d=c.length,e=0,f,g=b,h=!1,i=this.statechartMonitor;if(d===0)return b;if(b>i.sequence.length)return this.MISMATCH;while(c.length>0){for(e=0;e<d;e+=1){f=c[e],f.type==="sequence"?g=this._matchSequence(f,b):f.type==="concurrent"?g=this._matchConcurrent(f,b):this._matchItems(f,i.sequence[b])?g=b+1:g=this.MISMATCH;if(g!==this.MISMATCH)break}if(g===this.MISMATCH)return this.MISMATCH;c.removeAt(e),d=c.length,b=g}return b},_matchItems:function(a,b){if(!a||!b)return!1;if(a.action!==b.action)return!1;if(SC.typeOf(a.state)==="instance"&&a.state===b.state)return!0;if(a.state===b.state.get("stateName"))return!0;return!1}})}({}),function(a){SC.StatechartMonitor=SC.Object.extend({statechart:null,sequence:null,init:function(){this.reset()},reset:function(){this.propertyWillChange("length"),this.sequence=[],this.propertyDidChange("length")},length:function(){return this.sequence.length}.property(),pushEnteredState:function(a){this.propertyWillChange("length"),this.sequence.push({action:"entered",state:a}),this.propertyDidChange("length")},pushExitedState:function(a){this.propertyWillChange("length"),this.sequence.push({action:"exited",state:a}),this.propertyDidChange("length")},matchSequence:function(){return SC.StatechartSequenceMatcher.create({statechartMonitor:this})},matchEnteredStates:function(){var a=Array.prototype.slice.call(arguments.length===1?arguments[0]:arguments),b=this.getPath("statechart.enteredStates"),c=0,d=this.get("statechart");if(a.length!==b.length)return NO;a.forEach(function(a){SC.typeOf(a)==="string"&&(a=d.getState(a));!a||d.stateIsEntered(a)&&a.get("isEnteredState")&&(c+=1)});return c===b.length},toString:function(){var a="",b=0,c=0,d=null;a+="[",c=this.sequence.length;for(b=0;b<c;b+=1)d=this.sequence[b],a+="%@ %@".fmt(d.action,d.state.get("fullPath")),b<c-1&&(a+=", ");a+="]";return a}})}({}),function(a){}({}),function(a){SC.EXTEND_PROTOTYPES&&(Function.prototype.handleActions=function(){var a=Array.prototype.slice.call(arguments);a.unshift(this);return SC.handleActions.apply(SC,a)},Function.prototype.stateObserves=function(){var a=Array.prototype.slice.call(arguments);a.unshift(this);return SC.stateObserves.apply(SC,a)})}({}),function(a){}({}),function(a){SC.Async=SC.Object.extend({func:null,arg1:null,arg2:null,tryToPerform:function(a){var b=this.get("func"),c=this.get("arg1"),d=this.get("arg2"),e=SC.typeOf(b);e==="string"?SC.tryToPerform(a,b,c,d):e==="function"&&b.apply(a,[c,d])}}),SC.Async.reopenClass({perform:function(a,b,c){return SC.Async.create({func:a,arg1:b,arg2:c})}})}({}),function(a){var b=SC.get,c=SC.set,d=SC.getPath,e=Array.prototype.slice;SC.State=SC.Object.extend({stateName:null,parentState:null,historyState:null,initialSubstate:null,substatesAreConcurrent:!1,substates:null,statechart:null,stateIsInitialized:!1,currentSubstates:null,enteredSubstates:null,trace:function(){var a=d(this,"statechart.statechartTraceKey");return d(this,"statechart.%@".fmt(a))}.property().cacheable(),owner:function(){var a=b(this,"statechart"),c=a?b(a,"statechartOwnerKey"):null,d=a?b(a,c):null;return d?d:a}.property().cacheable(),init:function(){this._registeredActionHandlers={},this._registeredStringActionHandlers={},this._registeredRegExpActionHandlers=[],this._registeredStateObserveHandlers={};var a=b(this,"statechart"),c=a?b(a,"statechartOwnerKey"):null,d=a?b(a,"statechartTraceKey"):null;a&&(a.addObserver(c,this,"_statechartOwnerDidChange"),a.addObserver(d,this,"_statechartTraceDidChange"))},destroy:function(){var a=b(this,"statechart"),d=a?b(a,"statechartOwnerKey"):null,e=a?b(a,"statechartTraceKey"):null;a&&(SC.removeObserver(a,d,this,"_statechartOwnerDidChange"),SC.removeObserver(a,e,this,"_statechartTraceDidChange"));var f=b(this,"substates");f&&f.forEach(function(a){a.destroy()}),this._teardownAllStateObserveHandlers(),c(this,"substates",null),c(this,"currentSubstates",null),c(this,"enteredSubstates",null),c(this,"parentState",null),c(this,"historyState",null),c(this,"initialSubstate",null),c(this,"statechart",null),this.notifyPropertyChange("trace"),this.notifyPropertyChange("owner"),this._registeredActionHandlers=null,this._registeredStringActionHandlers=null,this._registeredRegExpActionHandlers=null,this._registeredStateObserveHandlers=null,this._super()},initState:function(){if(!b(this,"stateIsInitialized")){this._registerWithParentStates();var a=null,d=null,e=null,f=[],g=NO,h=b(this,"initialSubstate"),i=b(this,"substatesAreConcurrent"),j=b(this,"statechart"),k=0,l=0,m=NO,n=null;SC.HistoryState.detect(h)&&h.isClass&&(n=this.createHistoryState(h,{parentState:this,statechart:j}),c(this,"initialSubstate",n),SC.none(b(n,"defaultState"))&&(this.stateLogError("Initial substate is invalid. History state requires the name of a default state to be set"),c(this,"initialSubstate",null),n=null));for(a in this){d=this[a],m=SC.typeOf(d)==="function";if(m&&d.isActionHandler){this._registerActionHandler(a,d);continue}if(m&&d.isStateObserveHandler){this._registerStateObserveHandler(a,d);continue}m&&d.statePlugin&&(d=d.apply(this)),a==="a"&&debugger,SC.State.detect(d)&&d.isClass&&this[a]!==this.constructor&&(e=this.createSubstate(d,{stateName:a,parentState:this,statechart:j}),f.push(e),this[a]=e,e.initState(),a===h?(c(this,"initialSubstate",e),g=YES):n&&b(n,"defaultState")===a&&(c(n,"defaultState",e),g=YES))}!SC.none(h)&&!g&&this.stateLogError("Unable to set initial substate %@ since it did not match any of state's %@ substates".fmt(h,this)),f.length===0?SC.none(h)||this.stateLogWarning("Unable to make %@ an initial substate since state %@ has no substates".fmt(h,this)):f.length>0&&(SC.none(h)&&!i?(e=this.createEmptyState({parentState:this,statechart:j}),c(this,"initialSubstate",e),f.push(e),this[b(e,"stateName")]=e,e.initState(),this.stateLogWarning("state %@ has no initial substate defined. Will default to using an empty state as initial substate".fmt(this))):!SC.none(h)&&i&&(c(this,"initialSubstate",null),this.stateLogWarning("Can not use %@ as initial substate since substates are all concurrent for state %@".fmt(h,this)))),c(this,"substates",f),c(this,"currentSubstates",[]),c(this,"enteredSubstates",[]),c(this,"stateIsInitialized",YES)}},createSubstate:function(a,b){return a.create(b)},createHistoryState:function(a,b){return a.create(b)},createEmptyState:function(a){return SC.EmptyState.create(a)},_registerActionHandler:function(a,b){var c=b.actions,d=null,e=c.length,f=0;this._registeredActionHandlers[a]=b;for(;f<e;f+=1){d=c[f];if(SC.typeOf(d)==="string"){this._registeredStringActionHandlers[d]={name:a,handler:b};continue}if(d instanceof RegExp){this._registeredRegExpActionHandlers.push({name:a,handler:b,regexp:d});continue}this.stateLogError("Invalid action %@ for action handler %@ in state %@".fmt(d,a,this))}},_registerStateObserveHandler:function(a,b){var c=0,d=b.args,e=d.length,f,g=YES;for(;c<e;c+=1){f=d[c];if(SC.typeOf(f)!=="string"||SC.empty(f))this.stateLogError("Invalid argument %@ for state observe handler %@ in state %@".fmt(f,a,this)),g=NO}!g||(this._registeredStateObserveHandlers[a]=b.args)},_registerWithParentStates:function(){this._registerSubstate(this);var a=b(this,"parentState");while(!SC.none(a))a._registerSubstate(this),a=b(a,"parentState")},_registerSubstate:function(a){var c=a.pathRelativeTo(this);if(!SC.none(c)){SC.none(this._registeredSubstatePaths)&&(this._registeredSubstatePaths={},this._registeredSubstates=[]),this._registeredSubstates.push(a);var d=this._registeredSubstatePaths;d[b(a,"stateName")]===undefined&&(d[b(a,"stateName")]={__ki_paths__:[]});var e=d[b(a,"stateName")];e[c]=a,e.__ki_paths__.push(c)}},pathRelativeTo:function(a){var c=b(this,"stateName"),d=b(this,"parentState");while(!SC.none(d)&&d!==a)c="%@.%@".fmt(b(d,"stateName"),c),d=b(d,"parentState");if(d!==a&&a!==this){this.stateLogError("Can not generate relative path from %@ since it not a parent state of %@".fmt(a,this));return null}return c},getSubstate:function(a){var b=SC.typeOf(a);if(a instanceof SC.State)return this._registeredSubstates.indexOf(a)>-1?a:null;if(b!=="string"){this.stateLogError("Can not find matching subtype. value must be an object or string: %@".fmt(a));return null}var c=a.match(/(^|\.)(\w+)$/);if(!c)return null;var d=this._registeredSubstatePaths[c[2]];if(SC.none(d))return null;var e=d[a];if(!SC.none(e))return e;if(c[1]==="")if(d.__ki_paths__.length===1)e=d[d.__ki_paths__[0]];else if(d.__ki_paths__.length>1){var f="Can not find substate matching %@ in state %@. Ambiguous with the following: %@";this.stateLogError(f.fmt(a,this,d.__ki_paths__))}return e},gotoState:function(a,c){var d=null;b(this,"isCurrentState")?d=this:b(this,"hasCurrentSubstates")&&(d=b(this,"currentSubstates")[0]),b(this,"statechart").gotoState(a,d,c)},gotoHistoryState:function(a,c,d){var e=null;b(this,"isCurrentState")?e=this:b(this,"hasCurrentSubstates")&&(e=b(this,"currentSubstates")[0]),b(this,"statechart").gotoHistoryState(a,e,c,d)},resumeGotoState:function(){b(this,"statechart").resumeGotoState()},stateIsCurrentSubstate:function(a){SC.typeOf(a)==="string"&&(a=b(this,"statechart").getState(a));var c=b(this,"currentSubstates");return!!c&&c.indexOf(a)>=0},stateIsEnteredSubstate:function(a){SC.typeOf(a)==="string"&&(a=b(this,"statechart").getState(a));var c=b(this,"enteredSubstates");return!!c&&c.indexOf(a)>=0},isRootState:function(){return d(this,"statechart.rootState")===this}.property(),isCurrentState:function(){return this.stateIsCurrentSubstate(this)}.property("currentSubstates").cacheable(),isConcurrentState:function(){return d(this,"parentState.substatesAreConcurrent")}.property(),isEnteredState:function(){return this.stateIsEnteredSubstate(this)}.property("enteredSubstates").cacheable(),hasSubstates:function(){return d(this,"substates.length")>0}.property("substates"),hasCurrentSubstates:function(){var a=b(this,"currentSubstates");return!!a&&b(a,"length")>0}.property("currentSubstates").cacheable(),hasEnteredSubstates:function(){var a=b(this,"enteredSubstates");return!!a&&b(a,"length")>0}.property("enteredSubstates").cacheable(),reenter:function(){var a=b(this,"statechart");b(this,"isCurrentState")?a.gotoState(this):SC.Logger.error("Can not re-enter state %@ since it is not a current state in the statechart".fmt(this))},tryToHandleAction:function(a,c,d){var e=b(this,"trace");if(this._registeredActionHandlers[a]){this.stateLogWarning("state %@ can not handle action %@ since it is a registered action handler".fmt(this,a));return NO}if(this._registeredStateObserveHandlers[a]){this.stateLogWarning("state %@ can not handle action %@ since it is a registered state observe handler".fmt(this,a));return NO}if(SC.typeOf(this[a])==="function"){e&&this.stateLogTrace("will handle action %@".fmt(a));return this[a](c,d)!==NO}var f=this._registeredStringActionHandlers[a];if(f){e&&this.stateLogTrace("%@ will handle action %@".fmt(f.name,a));return f.handler.call(this,a,c,d)!==NO}var g=this._registeredRegExpActionHandlers.length,h=0;for(;h<g;h+=1){f=this._registeredRegExpActionHandlers[h];if(a.match(f.regexp)){e&&this.stateLogTrace("%@ will handle action %@".fmt(f.name,a));return f.handler.call(this,a,c,d)!==NO}}if(SC.typeOf(this.unknownAction)==="function"){e&&this.stateLogTrace("unknownAction will handle action %@".fmt(a));return this.unknownAction(a,c,d)!==NO}return NO},enterState:function(a){},stateWillBecomeEntered:function(){},stateDidBecomeEntered:function(){this._setupAllStateObserveHandlers()},exitState:function(a){},stateWillBecomeExited:function(){this._teardownAllStateObserveHandlers()},stateDidBecomeExited:function(){},_setupAllStateObserveHandlers:function(){this._configureAllStateObserveHandlers("addObserver")},_teardownAllStateObserveHandlers:function(){this._configureAllStateObserveHandlers("removeObserver")},_configureAllStateObserveHandlers:function(a){var b,c,d,e,f,g;for(b in this._registeredStateObserveHandlers){c=this._registeredStateObserveHandlers[b];for(f=0;f<c.length;f+=1)d=c[f],e=b,g=SC.normalizeTuple(this,d),SC[a](g[0],g[1],this,e)}},performAsync:function(a,b,c){return SC.Async.perform(a,b,c)},respondsToAction:function(a){if(this._registeredActionHandlers[a])return!1;if(SC.typeOf(this[a])==="function")return!0;if(this._registeredStringActionHandlers[a])return!0;if(this._registeredStateObserveHandlers[a])return!1;var b=this._registeredRegExpActionHandlers.length,c=0,d;for(;c<b;c+=1){d=this._registeredRegExpActionHandlers[c];if(a.match(d.regexp))return!0}return SC.typeOf(this.unknownAction)==="function"},fullPath:function(){var a=d(this,"statechart.rootState");if(!a)return b(this,"stateName");return this.pathRelativeTo(a)}.property("stateName","parentState").cacheable(),_statechartTraceDidChange:function(){this.notifyPropertyChange("trace")},_statechartOwnerDidChange:function(){this.notifyPropertyChange("owner")},stateLogTrace:function(a){var c=b(this,"statechart");c.statechartLogTrace("%@: %@".fmt(this,a))},stateLogWarning:function(a){var c=b(this,"statechart");c.statechartLogWarning(a)},stateLogError:function(a){var c=b(this,"statechart");c.statechartLogError(a)}}),SC.State.plugin=function(a){var b=e.call(arguments);b.shift();var c=function(){var c=SC.getPath(window,a);if(!c){console.error("SC.State.plugin: Unable to determine path %@".fmt(a));return undefined}if(!c.isClass||c.isInstance&&!(c instanceof SC.State)){console.error("SC.State.plugin: Unable to extend. %@ must be a class extending from SC.State".fmt(a));return undefined}return c.extend.apply(c,b)};c.statePlugin=YES;return c}}({}),function(a){SC.EMPTY_STATE_NAME="__EMPTY_STATE__",SC.EmptyState=SC.State.extend({name:SC.EMPTY_STATE_NAME,enterState:function(){var a="No initial substate was defined for state %@. Entering default empty state";this.stateLogWarning(a.fmt(this.get("parentState")))}})}({}),function(a){SC.HistoryState=SC.Object.extend({isRecursive:NO,defaultState:null,statechart:null,parentState:null,state:function(){var a=this.get("defaultState"),b=this.getPath("parentState.historyState");return!b?a:b}.property().cacheable(),parentHistoryStateDidChange:function(){this.notifyPropertyChange("state")}.observes("*parentState.historyState")})}({}),function(a){var b=SC.get,c=SC.set,d=SC.getPath;SC.StatechartManager={isStatechart:!0,statechartIsInitialized:!1,rootState:null,rootStateExample:SC.State,initialState:null,statesAreConcurrent:!1,monitorIsActive:!1,monitor:null,statechartTraceKey:"trace",trace:!1,statechartOwnerKey:"owner",owner:null,autoInitStatechart:!0,suppressStatechartWarnings:!1,init:function(){b(this,"autoInitStatechart")&&this.initStatechart()},destroy:function(){var a=b(this,"rootState"),d=b(this,"statechartTraceKey");SC.removeObserver(this,d,this,"_statechartTraceDidChange"),a.destroy(),c(this,"rootState",null),this._super()},initStatechart:function(){if(!b(this,"statechartIsInitialized")){this._gotoStateLocked=!1,this._sendActionLocked=!1,this._pendingStateTransitions=[],this._pendingSentActions=[],b(this,"monitorIsActive")&&c(this,"monitor",SC.StatechartMonitor.create({statechart:this}));var a=b(this,"statechartTraceKey");this.addObserver(a,this,"_statechartTraceDidChange"),this._statechartTraceDidChange();var d=b(this,"allowStatechartTracing"),e=b(this,"rootState"),f;d&&this.statechartLogTrace("BEGIN initialize statechart"),e?SC.typeOf(e)==="function"&&e.statePlugin&&(e=e.apply(this)):e=this._constructRootStateClass();if(!SC.State.detect(e)||!e.isClass){f="Unable to initialize statechart. Root state must be a state class",this.statechartLogError(f);throw f}e=this.createRootState(e,{statechart:this,stateName:SC.ROOT_STATE_NAME}),c(this,"rootState",e),e.initState();if(SC.EmptyState.detect(b(e,"initialSubstate"))){f="Unable to initialize statechart. Root state must have an initial substate explicilty defined",this.statechartLogError(f);throw f}if(!SC.empty(b(this,"initialState"))){var g="initialState";c(this,g,b(e,b(this,g)))}c(this,"statechartIsInitialized",!0),this.gotoState(e),d&&this.statechartLogTrace("END initialize statechart")}},createRootState:function(a,b){b||(b={}),a=a.create(b);return a},currentStates:function(){return d(this,"rootState.currentSubstates")}.property().cacheable(),firstCurrentState:function(){var a=b(this,"currentStates");return a?a.objectAt(0):null}.property("currentStates").cacheable(),currentStateCount:function(){return d(this,"currentStates.length")}.property("currentStates").cacheable(),stateIsCurrentState:function(a){return b(this,"rootState").stateIsCurrentSubstate(a)},enteredStates:function(){return d(this,"rootState.enteredSubstates")}.property().cacheable(),stateIsEntered:function(a){return b(this,"rootState").stateIsEnteredSubstate(a)},doesContainState:function(a){return!SC.none(this.getState(a))},getState:function(a){return b(this,"rootState").getSubstate(a)},gotoState:function(a,c,e,f){if(!b(this,"statechartIsInitialized"))this.statechartLogError("can not go to state %@. statechart has not yet been initialized".fmt(a));else{if(b(this,"isDestroyed")){this.statechartLogError("can not go to state %@. statechart is destroyed".fmt(this));return}var g=this._processGotoStateArgs(arguments);a=g.state,c=g.fromCurrentState,e=g.useHistory,f=g.context;var h=null,i=[],j=[],k=b(this,"allowStatechartTracing"),l=b(this,"rootState"),m=a,n=c,o,p=l.getSubstate(a);if(SC.none(p)){this.statechartLogError("Can not to goto state %@. Not a recognized state in statechart".fmt(m));return}if(this._gotoStateLocked){this._pendingStateTransitions.push({state:p,fromCurrentState:c,useHistory:e,context:f});return}this._gotoStateLocked=!0;if(!SC.none(c)){c=l.getSubstate(c);if(SC.none(c)||!b(c,"isCurrentState")){o="Can not to goto state %@. %@ is not a recognized current state in statechart",this.statechartLogError(o.fmt(m,n)),this._gotoStateLocked=!1;return}}else d(this,"currentStates.length")>0&&(c=b(this,"currentStates")[0],o="gotoState: fromCurrentState not explicitly provided. Using a default current state to transition from: %@",this.statechartLogWarning(o.fmt(c)));k&&(this.statechartLogTrace("BEGIN gotoState: %@".fmt(p)),o="starting from current state: %@",o=o.fmt(c?c:"---"),this.statechartLogTrace(o),o="current states before: %@",o=o.fmt(d(this,"currentStates.length")>0?b(this,"currentStates"):"---"),this.statechartLogTrace(o)),SC.none(c)||(i=this._createStateChain(c)),j=this._createStateChain(p),h=this._findPivotState(i,j);if(h){k&&this.statechartLogTrace("pivot state = %@".fmt(h));if(b(h,"substatesAreConcurrent")){this.statechartLogError("Can not go to state %@ from %@. Pivot state %@ has concurrent substates.".fmt(p,c,h)),this._gotoStateLocked=!1;return}}var q=[];this._traverseStatesToExit(i.shift(),i,h,q),h!==p?this._traverseStatesToEnter(j.pop(),j,h,e,q):(this._traverseStatesToExit(h,[],null,q),this._traverseStatesToEnter(h,null,null,e,q)),this._executeGotoStateActions(p,q,null,f)}},gotoStateActive:function(){return this._gotoStateLocked}.property(),gotoStateSuspended:function(){return this._gotoStateLocked&&!!this._gotoStateSuspendedPoint}.property(),resumeGotoState:function(){if(!b(this,"gotoStateSuspended"))this.statechartLogError("Can not resume goto state since it has not been suspended");else{var a=this._gotoStateSuspendedPoint;this._executeGotoStateActions(a.gotoState,a.actions,a.marker,a.context)}},_executeGotoStateActions:function(a,c,d,e){var f=null,g=c.length,h=null;d=SC.none(d)?0:d;for(;d<g;d+=1){f=c[d];switch(f.action){case SC.EXIT_STATE:h=this._exitState(f.state,e);break;case SC.ENTER_STATE:h=this._enterState(f.state,f.currentState,e)}if(h instanceof SC.Async){this._gotoStateSuspendedPoint={gotoState:a,actions:c,marker:d+1,context:e},h.tryToPerform(f.state);return}}this.beginPropertyChanges(),this.notifyPropertyChange("currentStates"),this.notifyPropertyChange("enteredStates"),this.endPropertyChanges(),b(this,"allowStatechartTracing")&&(this.statechartLogTrace("current states after: %@".fmt(b(this,"currentStates"))),this.statechartLogTrace("END gotoState: %@".fmt(a))),this._gotoStateSuspendedPoint=null,this._gotoStateLocked=!1,this._flushPendingStateTransition()},_exitState:function(a,d){var e;if(b(a,"currentSubstates").indexOf(a)>=0){e=b(a,"parentState");while(e)b(e,"currentSubstates").removeObject(a),e=b(e,"parentState")}e=a;while(e)b(e,"enteredSubstates").removeObject(a),e=b(e,"parentState");b(this,"allowStatechartTracing")&&this.statechartLogTrace("<-- exiting state: %@".fmt(a)),c(a,"currentSubstates",[]),a.notifyPropertyChange("isCurrentState"),a.stateWillBecomeExited();var f=this.exitState(a,d);a.stateDidBecomeExited(),b(this,"monitorIsActive")&&b(this,"monitor").pushExitedState(a),a._traverseStatesToExit_skipState=!1;return f},exitState:function(a,b){return a.exitState(b)},_enterState:function(a,d,e){var f=b(a,"parentState");f&&!b(a,"isConcurrentState")&&c(f,"historyState",a);if(d){f=a;while(f)b(f,"currentSubstates").pushObject(a),f=b(f,"parentState")}f=a;while(f)b(f,"enteredSubstates").pushObject(a),f=b(f,"parentState");b(this,"allowStatechartTracing")&&this.statechartLogTrace("--> entering state: %@".fmt(a)),a.notifyPropertyChange("isCurrentState"),a.stateWillBecomeEntered();var g=this.enterState(a,e);a.stateDidBecomeEntered(),b(this,"monitorIsActive")&&b(this,"monitor").pushEnteredState(a);return g},enterState:function(a,b){return a.enterState(b)},gotoHistoryState:function(a,c,d,e){if(!b(this,"statechartIsInitialized"))this.statechartLogError("can not go to state %@'s history state. Statechart has not yet been initialized".fmt(a));else{var f=this._processGotoStateArgs(arguments);a=f.state,c=f.fromCurrentState,d=f.useHistory,e=f.context,a=this.getState(a);if(!a){this.statechartLogError("Can not to goto state %@'s history state. Not a recognized state in statechart".fmt(a));return}var g=b(a,"historyState");d?this.gotoState(a,c,!0,e):g?this.gotoState(g,c,e):this.gotoState(a,c,e)}},sendAction:function(a,c,d){if(b(this,"isDestroyed"))this.statechartLogError("can send action %@. statechart is destroyed".fmt(a));else{var e=!1,f=!1,g=b(this,"currentStates").slice(),h=0,i=0,j=null,k=b(this,"allowStatechartTracing");if(this._sendActionLocked||this._goStateLocked){this._pendingSentActions.push({action:a,arg1:c,arg2:d});return}this._sendActionLocked=!0,k&&this.statechartLogTrace("BEGIN sendAction: action<%@>".fmt(a)),h=b(g,"length");for(;i<h;i+=1){f=!1,j=g[i];if(!b(j,"isCurrentState"))continue;while(!f&&j)f=j.tryToHandleAction(a,c,d),f?e=!0:j=b(j,"parentState")}this._sendActionLocked=!1,k&&(e||this.statechartLogTrace("No state was able handle action %@".fmt(a)),this.statechartLogTrace("END sendAction: action<%@>".fmt(a)));var l=this._flushPendingSentActions();return e?this:l?this:null}},_createStateChain:function(a){var c=[];while(a)c.push(a),a=b(a,"parentState");return c},_findPivotState:function(a,b){if(a.length===0||b.length===0)return null;var c=a.find(function(a,c){if(b.indexOf(a)>=0)return!0});return c},_traverseStatesToExit:function(a,c,d,e){if(!!a&&a!==d){var f=b(this,"allowStatechartTracing");if(b(a,"substatesAreConcurrent")){var g=0,h=b(a,"currentSubstates"),i=h.length,j=null;for(;g<i;g+=1){j=h[g];if(j._traverseStatesToExit_skipState===!0)continue;var k=this._createStateChain(j);this._traverseStatesToExit(k.shift(),k,a,e)}}e.push({action:SC.EXIT_STATE,state:a}),b(a,"isCurrentState")&&(a._traverseStatesToExit_skipState=!0),this._traverseStatesToExit(c.shift(),c,d,e)}},_traverseStatesToEnter:function(a,c,d,e,f){if(!!a){var g=b(this,"allowStatechartTracing");if(d)a!==d?this._traverseStatesToEnter(c.pop(),c,d,e,f):this._traverseStatesToEnter(c.pop(),c,null,e,f);else if(!c||c.length===0){var h={action:SC.ENTER_STATE,state:a,currentState:!1};f.push(h);var i=b(a,"initialSubstate"),j=b(a,"historyState");b(a,"substatesAreConcurrent")?this._traverseConcurrentStatesToEnter(b(a,"substates"),null,e,f):b(a,"hasSubstates")&&j&&e?this._traverseStatesToEnter(j,null,null,e,f):i?(i instanceof SC.HistoryState&&(e||(e=b(i,"isRecursive")),i=b(i,"state")),this._traverseStatesToEnter(i,null,null,e,f)):h.currentState=!0}else if(c.length>0){f.push({action:SC.ENTER_STATE,state:a});var k=c.pop();this._traverseStatesToEnter(k,c,null,e,f),b(a,"substatesAreConcurrent")&&this._traverseConcurrentStatesToEnter(b(a,"substates"),k,e,f)}}},respondsTo:function(a){var c=b(this,"currentStates"),d=b(c,"length"),e=0,f=null;for(;e<d;e+=1){f=c.objectAt(e);while(f){if(f.respondsToAction(a))return!0;f=b(f,"parentState")}}return SC.typeOf(this[a])==="function"},tryToPerform:function(a,b,c){if(this.respondsTo(a))return SC.typeOf(this[a])==="function"?this[a](b,c)!==!1:!!this.sendAction(a,b,c);return!1},invokeStateMethod:function(a,c,d){if(a==="unknownAction")this.statechartLogError("can not invoke method unkownAction");else{c=Array.prototype.slice.call(arguments),c.shift();var e=c.length,f=e>0?c[e-1]:null,g=SC.typeOf(f)==="function"?c.pop():null,h=b(this,"currentStates"),i=0,j=null,k={},l,m=undefined,n=0;e=b(h,"length");for(;i<e;i+=1){j=h.objectAt(i);while(j){if(k[b(j,"fullPath")])break;k[b(j,"fullPath")]=!0,l=j[a];if(SC.typeOf(l)==="function"&&!l.isActionHandler){m=l.apply(j,c),g&&g.call(this,j,m),n+=1;break}j=b(j,"parentState")}}return n===1?m:undefined}},_traverseConcurrentStatesToEnter:function(a,b,c,d){var e=0,f=a.length,g=null;for(;e<f;e+=1)g=a[e],g!==b&&this._traverseStatesToEnter(g,null,null,c,d)},_flushPendingStateTransition:function(){if(!this._pendingStateTransitions)this.statechartLogError("Unable to flush pending state transition. _pendingStateTransitions is invalid");else{var a=this._pendingStateTransitions.shift();if(!a)return;this.gotoState(a.state,a.fromCurrentState,a.useHistory,a.context)}},_flushPendingSentActions:function(){var a=this._pendingSentActions.shift();if(!a)return null;return this.sendAction(a.action,a.arg1,a.arg2)},_monitorIsActiveDidChange:function(){b(this,"monitorIsActive")&&SC.none(b(this,"monitor"))&&c(this,"monitor",SC.StatechartMonitor.create())}.observes("monitorIsActive"),_processGotoStateArgs:function(a){var b={state:null,fromCurrentState:null,useHistory:!1,context:null},c=null,d=null;a=Array.prototype.slice.call(a),a=a.filter(function(a){return a!==undefined}),c=a.length;if(c<1)return b;b.state=a[0];if(c===2){d=a[1];switch(SC.typeOf(d)){case"boolean":b.useHistory=d;break;case"object":b.context=d;break;default:b.fromCurrentState=d}}else c===3?(d=a[1],SC.typeOf(d)==="boolean"?(b.useHistory=d,b.context=a[2]):(b.fromCurrentState=d,d=a[2],SC.typeOf(d)==="boolean"?b.useHistory=d:b.context=d)):(b.fromCurrentState=a[1],b.useHistory=a[2],b.context=a[3]);return b},_constructRootStateClass:function(){var a="rootStateExample",c=b(this,a),d=b(this,"initialState"),e=b(this,"statesAreConcurrent"),f=0,g,h,i,j={};SC.typeOf(c)==="function"&&c.statePlugin&&(c=c.apply(this));if(!SC.State.detect(c)||!c.isClass){this._logStatechartCreationError("Invalid root state example");return null}if(e&&!SC.empty(d))this._logStatechartCreationError("Can not assign an initial state when states are concurrent");else if(e)j.substatesAreConcurrent=!0;else if(SC.typeOf(d)==="string")j.initialSubstate=d;else{this._logStatechartCreationError("Must either define initial state or assign states as concurrent");return null}for(g in this){if(g===a)continue;h=this[g],i=SC.typeOf(h)==="function",i&&h.statePlugin&&(h=h.apply(this)),SC.State.detect(h)&&h.isClass&&this[g]!==this.constructor&&(j[g]=h,f+=1)}if(f===0){this._logStatechartCreationError("Must define one or more states");return null}return c.extend(j)},_logStatechartCreationError:function(a){SC.Logger.error("Unable to create statechart for %@: %@.".fmt(this,a))},statechartLogTrace:function(a){SC.Logger.info("%@: %@".fmt(b(this,"statechartLogPrefix"),a))},statechartLogError:function(a){SC.Logger.error("ERROR %@: %@".fmt(b(this,"statechartLogPrefix"),a))},statechartLogWarning:function(a){b(this,"suppressStatechartWarnings")||SC.Logger.warn("WARN %@: %@".fmt(b(this,"statechartLogPrefix"),a))},statechartLogPrefix:function(){var a=this.constructor.toString(),c=b(this,"name"),d;SC.empty(c)?d="%@<%@>".fmt(a,SC.guidFor(this)):d="%@<%@, %@>".fmt(a,c,SC.guidFor(this));return d}.property().cacheable(),allowStatechartTracing:function(){var a=b(this,"statechartTraceKey");return b(this,a)}.property().cacheable(),_statechartTraceDidChange:function(){this.notifyPropertyChange("allowStatechartTracing")}},SC.ROOT_STATE_NAME="__ROOT_STATE__",SC.EXIT_STATE=0,SC.ENTER_STATE=1,SC.Statechart=SC.Object.extend(SC.StatechartManager,{autoInitStatechart:!1})}({}),function(a){}({}),function(a){}({})
View
11 js/libs/sproutcore.min.js
0 additions, 11 deletions not shown
View
399 js/libs/strophe.js
@@ -15,12 +15,12 @@ var Base64 = (function () {
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
-
+
do {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
-
+
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
@@ -31,14 +31,14 @@ var Base64 = (function () {
} else if (isNaN(chr3)) {
enc4 = 64;
}
-
+
output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) +
keyStr.charAt(enc3) + keyStr.charAt(enc4);
} while (i < input.length);
-
+
return output;
},
-
+
/**
* Decodes a base64 string.
* @param {String} input The string to decode.
@@ -48,22 +48,22 @@ var Base64 = (function () {
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
-
+
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
+
do {
enc1 = keyStr.indexOf(input.charAt(i++));
enc2 = keyStr.indexOf(input.charAt(i++));
enc3 = keyStr.indexOf(input.charAt(i++));
enc4 = keyStr.indexOf(input.charAt(i++));
-
+
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
-
+
output = output + String.fromCharCode(chr1);
-
+
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
@@ -71,7 +71,7 @@ var Base64 = (function () {
output = output + String.fromCharCode(chr3);
}
} while (i < input.length);
-
+
return output;
}
};
@@ -197,7 +197,7 @@ var MD5 = (function () {
var md5_ii = function (a, b, c, d, x, s, t) {
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
};
-
+
/*
* Calculate the MD5 of an array of little-endian words, and a bit length
*/
@@ -218,7 +218,7 @@ var MD5 = (function () {
oldb = b;
oldc = c;
oldd = d;
-
+
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
@@ -235,7 +235,7 @@ var MD5 = (function () {
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
-
+
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
@@ -252,7 +252,7 @@ var MD5 = (function () {
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
-
+
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
@@ -269,7 +269,7 @@ var MD5 = (function () {
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
-
+
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
@@ -286,7 +286,7 @@ var MD5 = (function () {
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
-
+
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
@@ -302,14 +302,14 @@ var MD5 = (function () {
var core_hmac_md5 = function (key, data) {
var bkey = str2binl(key);
if(bkey.length > 16) { bkey = core_md5(bkey, key.length * chrsz); }
-
+
var ipad = new Array(16), opad = new Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
-
+
var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
return core_md5(opad.concat(hash), 512 + 128);
};
@@ -354,7 +354,6 @@ var MD5 = (function () {
return obj;
})();
-
/*
This program is distributed under the terms of the MIT license.
Please see the LICENSE file for details.
@@ -384,6 +383,7 @@ var MD5 = (function () {
* This Function object extension method creates a bound method similar
* to those in Python. This means that the 'this' object will point
* to the instance you want. See
+ * <a href='https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind'>MDC's bind() documentation</a> and
* <a href='http://benjamin.smedbergs.us/blog/2007-01-03/bound-functions-and-function-imports-in-javascript/'>Bound Functions and Function Imports in JavaScript</a>
* for a complete explanation.
*
@@ -392,52 +392,24 @@ var MD5 = (function () {
*
* Parameters:
* (Object) obj - The object that will become 'this' in the bound function.
+ * (Object) argN - An option argument that will be prepended to the
+ * arguments given for the function call
*
* Returns:
* The bound function.
*/
if (!Function.prototype.bind) {
- Function.prototype.bind = function (obj)
+ Function.prototype.bind = function (obj /*, arg1, arg2, ... */)
{
var func = this;
- return function () { return func.apply(obj, arguments); };
- };
-}
-
-/** PrivateFunction: Function.prototype.prependArg
- * Prepend an argument to a function.
- *
- * This Function object extension method returns a Function that will
- * invoke the original function with an argument prepended. This is useful
- * when some object has a callback that needs to get that same object as
- * an argument. The following fragment illustrates a simple case of this
- * > var obj = new Foo(this.someMethod);</code></blockquote>
- *
- * Foo's constructor can now use func.prependArg(this) to ensure the
- * passed in callback function gets the instance of Foo as an argument.
- * Doing this without prependArg would mean not setting the callback
- * from the constructor.
- *
- * This is used inside Strophe for passing the Strophe.Request object to
- * the onreadystatechange handler of XMLHttpRequests.
- *
- * Parameters:
- * arg - The argument to pass as the first parameter to the function.
- *
- * Returns:
- * A new Function which calls the original with the prepended argument.
- */
-if (!Function.prototype.prependArg) {
- Function.prototype.prependArg = function (arg)
- {
- var func = this;
-
+ var _slice = Array.prototype.slice;
+ var _concat = Array.prototype.concat;
+ var _args = _slice.call(arguments, 1);
+
return function () {
- var newargs = [arg];
- for (var i = 0; i < arguments.length; i++) {
- newargs.push(arguments[i]);
- }
- return func.apply(this, newargs);
+ return func.apply(obj ? obj : this,
+ _concat.call(_args,
+ _slice.call(arguments, 0)));
};
};
}
@@ -542,7 +514,7 @@ Strophe = {
* The version of the Strophe library. Unreleased builds will have
* a version of head-HASH where HASH is a partial revision.
*/
- VERSION: "1.0.1",
+ VERSION: "1.0.2",
/** Constants: XMPP Namespace Constants
* Common namespace constants from the XMPP RFCs and XEPs.
@@ -579,7 +551,7 @@ Strophe = {
STANZAS: "urn:ietf:params:xml:ns:xmpp-stanzas"
},
- /** Function: addNamespace
+ /** Function: addNamespace
* This function is used to extend the current namespaces in
* Strophe.NS. It takes a key and a value with the key being the
* name of the new namespace, with its actual value.
@@ -589,7 +561,7 @@ Strophe = {
* Parameters:
* (String) name - The name under which the namespace will be
* referenced under Strophe.NS
- * (String) value - The actual namespace.
+ * (String) value - The actual namespace.
*/
addNamespace: function (name, value)
{
@@ -647,7 +619,8 @@ Strophe = {
*/
ElementType: {
NORMAL: 1,
- TEXT: 3
+ TEXT: 3,
+ CDATA: 4
},
/** PrivateConstants: Timeout Values
@@ -725,8 +698,8 @@ Strophe = {
_makeGenerator: function () {
var doc;
- if (window.ActiveXObject) {
- doc = new ActiveXObject("Microsoft.XMLDOM");
+ if (document.implementation.createDocument === undefined) {
+ doc = this._getIEXmlDom();
doc.appendChild(doc.createElement('strophe'));
} else {
doc = document.implementation
@@ -736,26 +709,67 @@ Strophe = {
return doc;
},
+ /** Function: xmlGenerator
+ * Get the DOM document to generate elements.
+ *
+ * Returns:
+ * The currently used DOM document.
+ */
+ xmlGenerator: function () {
+ if (!Strophe._xmlGenerator) {
+ Strophe._xmlGenerator = Strophe._makeGenerator();
+ }
+ return Strophe._xmlGenerator;
+ },
+
+ /** PrivateFunction: _getIEXmlDom
+ * Gets IE xml doc object
+ *
+ * Returns:
+ * A Microsoft XML DOM Object
+ * See Also:
+ * http://msdn.microsoft.com/en-us/library/ms757837%28VS.85%29.aspx
+ */
+ _getIEXmlDom : function() {
+ var doc = null;
+ var docStrings = [
+ "Msxml2.DOMDocument.6.0",
+ "Msxml2.DOMDocument.5.0",
+ "Msxml2.DOMDocument.4.0",
+ "MSXML2.DOMDocument.3.0",
+ "MSXML2.DOMDocument",
+ "MSXML.DOMDocument",
+ "Microsoft.XMLDOM"
+ ];
+
+ for (var d = 0; d < docStrings.length; d++) {
+ if (doc === null) {
+ try {
+ doc = new ActiveXObject(docStrings[d]);
+ } catch (e) {
+ doc = null;
+ }
+ } else {
+ break;
+ }
+ }
+
+ return doc;
+ },
+
/** Function: xmlElement
* Create an XML DOM element.
*
* This function creates an XML DOM element correctly across all
- * implementations. Specifically the Microsoft implementation of
- * document.createElement makes DOM elements with 43+ default attributes
- * unless elements are created with the ActiveX object Microsoft.XMLDOM.
- *
- * Most DOMs force element names to lowercase, so we use the
- * _realname attribute on the created element to store the case
- * sensitive name. This is required to generate proper XML for
- * things like vCard avatars (XEP 153). This attribute is stripped
- * out before being sent over the wire or serialized, but you may
- * notice it during debugging.
+ * implementations. Note that these are not HTML DOM elements, which
+ * aren't appropriate for XMPP stanzas.
*
* Parameters:
* (String) name - The name for the element.
- * (Array) attrs - An optional array of key/value pairs to use as
- * element attributes in the following format [['key1', 'value1'],
- * ['key2', 'value2']]
+ * (Array|Object) attrs - An optional array or object containing
+ * key/value pairs to use as element attributes. The object should
+ * be in the format {'key': 'value'} or {key: 'value'}. The array
+ * should have the format [['key1', 'value1'], ['key2', 'value2']].
* (String) text - The text child data for the element.
*
* Returns:
@@ -765,11 +779,7 @@ Strophe = {
{
if (!name) { return null; }
- var node = null;
- if (!Strophe._xmlGenerator) {
- Strophe._xmlGenerator = Strophe._makeGenerator();
- }
- node = Strophe._xmlGenerator.createElement(name);
+ var node = Strophe.xmlGenerator().createElement(name);
// FIXME: this should throw errors if args are the wrong type or
// there are more than two optional args
@@ -793,7 +803,7 @@ Strophe = {
if (arguments[a].hasOwnProperty(k)) {
node.setAttribute(k, arguments[a][k]);
}
- }
+ }
}
}
@@ -809,12 +819,14 @@ Strophe = {
* Returns:
* Escaped text.
*/
- xmlescape: function(text)
+ xmlescape: function(text)
{
- text = text.replace(/\&/g, "&amp;");
+ text = text.replace(/\&/g, "&amp;");
text = text.replace(/</g, "&lt;");
text = text.replace(/>/g, "&gt;");
- return text;
+ text = text.replace(/'/g, "&apos;");
+ text = text.replace(/"/g, "&quot;");
+ return text;
},
/** Function: xmlTextNode
@@ -833,10 +845,7 @@ Strophe = {
//ensure text is escaped
text = Strophe.xmlescape(text);
- if (!Strophe._xmlGenerator) {
- Strophe._xmlGenerator = Strophe._makeGenerator();
- }
- return Strophe._xmlGenerator.createTextNode(text);
+ return Strophe.xmlGenerator().createTextNode(text);
},
/** Function: getText
@@ -894,7 +903,7 @@ Strophe = {
el.appendChild(Strophe.copyElement(elem.childNodes[i]));
}
} else if (elem.nodeType == Strophe.ElementType.TEXT) {
- el = Strophe.xmlTextNode(elem.nodeValue);
+ el = Strophe.xmlGenerator().createTextNode(elem.nodeValue);
}
return el;
@@ -1011,7 +1020,7 @@ Strophe = {
*/
getBareJidFromJid: function (jid)
{
- return jid.split("/")[0];
+ return jid ? jid.split("/")[0] : null;
},
/** Function: log
@@ -1134,9 +1143,9 @@ Strophe = {
if(elem.attributes[i].nodeName != "_realname") {
result += " " + elem.attributes[i].nodeName.toLowerCase() +
"='" + elem.attributes[i].value
- .replace("&", "&amp;")
- .replace("'", "&apos;")
- .replace("<", "&lt;") + "'";
+ .replace(/&/g, "&amp;")
+ .replace(/\'/g, "&apos;")
+ .replace(/</g, "&lt;") + "'";
}
}
@@ -1144,12 +1153,18 @@ Strophe = {
result += ">";
for (i = 0; i < elem.childNodes.length; i++) {
child = elem.childNodes[i];
- if (child.nodeType == Strophe.ElementType.NORMAL) {
+ switch( child.nodeType ){
+ case Strophe.ElementType.NORMAL:
// normal element, so recurse
result += Strophe.serialize(child);
- } else if (child.nodeType == Strophe.ElementType.TEXT) {
- // text element
- result += child.nodeValue;
+ break;
+ case Strophe.ElementType.TEXT:
+ // text element to escape values
+ result += Strophe.xmlescape(child.nodeValue);
+ break;
+ case Strophe.ElementType.CDATA:
+ // cdata section so don't escape values
+ result += "<![CDATA["+child.nodeValue+"]]>";
}
}
result += "</" + nodeName + ">";
@@ -1175,7 +1190,7 @@ Strophe = {
/** Function: addConnectionPlugin
* Extends the Strophe.Connection object with the given plugin.
*
- * Paramaters:
+ * Parameters:
* (String) name - The name of the extension.
* (Object) ptype - The plugin's prototype.
*/
@@ -1192,7 +1207,7 @@ Strophe = {
* DOM element easily and rapidly. All the functions except for toString()
* and tree() return the object, so calls can be chained. Here's an
* example using the $iq() builder helper.
- * > $iq({to: 'you': from: 'me': type: 'get', id: '1'})
+ * > $iq({to: 'you', from: 'me', type: 'get', id: '1'})
* > .c('query', {xmlns: 'strophe:example'})
* > .c('example')
* > .toString()
@@ -1316,22 +1331,25 @@ Strophe.Builder.prototype = {
* Add a child to the current element and make it the new current
* element.
*
- * This function moves the current element pointer to the child. If you
- * need to add another child, it is necessary to use up() to go back
- * to the parent in the tree.
+ * This function moves the current element pointer to the child,
+ * unless text is provided. If you need to add another child, it
+ * is necessary to use up() to go back to the parent in the tree.
*
* Parameters:
* (String) name - The name of the child.
* (Object) attrs - The attributes of the child in object notation.
+ * (String) text - The text to add to the child.
*
* Returns:
* The Strophe.Builder object.
*/
- c: function (name, attrs)
+ c: function (name, attrs, text)
{
- var child = Strophe.xmlElement(name, attrs);
+ var child = Strophe.xmlElement(name, attrs, text);
this.node.appendChild(child);
- this.node = child;
+ if (!text) {
+ this.node = child;
+ }
return this;
},
@@ -1351,8 +1369,18 @@ Strophe.Builder.prototype = {
*/
cnode: function (elem)
{
- this.node.appendChild(elem);
- this.node = elem;
+ var xmlGen = Strophe.xmlGenerator();
+ try {
+ var impNode = (xmlGen.importNode !== undefined);
+ }
+ catch (e) {
+ var impNode = false;
+ }
+ var newElem = impNode ?
+ xmlGen.importNode(elem, true) :
+ Strophe.copyElement(elem);
+ this.node.appendChild(newElem);
+ this.node = newElem;
return this;
},
@@ -1414,14 +1442,14 @@ Strophe.Handler = function (handler, ns, name, type, id, from, options)
this.type = type;
this.id = id;
this.options = options || {matchbare: false};
-
+
// default matchBare to false if undefined
if (!this.options.matchBare) {
this.options.matchBare = false;
}
if (this.options.matchBare) {
- this.from = Strophe.getBareJidFromJid(from);
+ this.from = from ? Strophe.getBareJidFromJid(from) : null;
} else {
this.from = from;
}
@@ -1444,7 +1472,7 @@ Strophe.Handler.prototype = {
{
var nsMatch;
var from = null;
-
+
if (this.options.matchBare) {
from = Strophe.getBareJidFromJid(elem.getAttribute('from'));
} else {
@@ -1455,9 +1483,9 @@ Strophe.Handler.prototype = {
if (!this.ns) {
nsMatch = true;
} else {
- var self = this;
+ var that = this;
Strophe.forEachChild(elem, null, function (elem) {
- if (elem.getAttribute("xmlns") == self.ns) {
+ if (elem.getAttribute("xmlns") == that.ns) {
nsMatch = true;
}
});
@@ -1467,9 +1495,9 @@ Strophe.Handler.prototype = {
if (nsMatch &&
(!this.name || Strophe.isTagEqual(elem, this.name)) &&
- (!this.type || elem.getAttribute("type") === this.type) &&
- (!this.id || elem.getAttribute("id") === this.id) &&
- (!this.from || from === this.from)) {
+ (!this.type || elem.getAttribute("type") == this.type) &&
+ (!this.id || elem.getAttribute("id") == this.id) &&
+ (!this.from || from == this.from)) {
return true;
}
@@ -1696,7 +1724,8 @@ Strophe.Request.prototype = {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
- xhr.onreadystatechange = this.func.prependArg(this);
+ // use Function.bind() to prepend ourselves as an argument
+ xhr.onreadystatechange = this.func.bind(null, this);
return xhr;
}
@@ -1744,6 +1773,8 @@ Strophe.Connection = function (service)
/* The current session ID. */
this.sid = null;
this.streamId = null;
+ /* stream:features */
+ this.features = null;
// SASL
this.do_session = false;
@@ -1906,7 +1937,7 @@ Strophe.Connection.prototype = {
* or a full JID. If a node is not supplied, SASL ANONYMOUS
* authentication will be attempted.
* (String) pass - The user's password.
- * (Function) callback The connect callback function.
+ * (Function) callback - The connect callback function.
* (Integer) wait - The optional HTTPBIND wait value. This is the
* time the server will wait before returning an empty result for
* a request. The default setting of 60 seconds is recommended.
@@ -1947,8 +1978,8 @@ Strophe.Connection.prototype = {
this._requests.push(
new Strophe.Request(body.tree(),
- this._onRequestStateChange.bind(this)
- .prependArg(this._connect_cb.bind(this)),
+ this._onRequestStateChange.bind(
+ this, this._connect_cb.bind(this)),
body.tree().getAttribute("rid")));
this._throttledRequestHandler();
},
@@ -2096,10 +2127,10 @@ Strophe.Connection.prototype = {
/** Function: flush
* Immediately send any pending outgoing data.
- *
+ *
* Normally send() queues outgoing data until the next idle period
* (100ms), which optimizes network use in the common cases when
- * several send()s are called in succession. flush() can be used to
+ * several send()s are called in succession. flush() can be used to
* immediately send all pending data.
*/
flush: function ()
@@ -2116,9 +2147,9 @@ Strophe.Connection.prototype = {
* Parameters:
* (XMLElement) elem - The stanza to send.
* (Function) callback - The callback function for a successful request.
- * (Function) errback - The callback function for a failed or timed
+ * (Function) errback - The callback function for a failed or timed
* out request. On timeout, the stanza will be null.
- * (Integer) timeout - The time specified in milliseconds for a
+ * (Integer) timeout - The time specified in milliseconds for a
* timeout to occur.
*
* Returns:
@@ -2146,11 +2177,11 @@ Strophe.Connection.prototype = {
}
var iqtype = stanza.getAttribute('type');
- if (iqtype === 'result') {
+ if (iqtype == 'result') {
if (callback) {
callback(stanza);
}
- } else if (iqtype === 'error') {
+ } else if (iqtype == 'error') {
if (errback) {
errback(stanza);
}
@@ -2194,7 +2225,7 @@ Strophe.Connection.prototype = {
message: "Cannot queue non-DOMElement."
};
}
-
+
this._data.push(element);
},
@@ -2277,7 +2308,7 @@ Strophe.Connection.prototype = {
* boolean). When matchBare is true, the from parameter and the from
* attribute on the stanza will be matched as bare JIDs instead of
* full JIDs. To use this, pass {matchBare: true} as the value of
- * options. The default value for matchBare is false.
+ * options. The default value for matchBare is false.
*
* The return value should be saved if you wish to remove the handler
* with deleteHandler().
@@ -2468,6 +2499,12 @@ Strophe.Connection.prototype = {
reqStatus = -1;
}
+ // make sure we limit the number of retries
+ if (req.sends > 5) {
+ this._onDisconnectTimeout();
+ return;
+ }
+
var time_elapsed = req.age();
var primaryTimeout = (!isNaN(time_elapsed) &&
time_elapsed > Math.floor(Strophe.TIMEOUT * this.wait));
@@ -2498,7 +2535,6 @@ Strophe.Connection.prototype = {
Strophe.debug("request id " + req.id +
"." + req.sends + " posting");
- req.date = new Date();
try {
req.xhr.open("POST", this.service, true);
} catch (e2) {
@@ -2514,15 +2550,17 @@ Strophe.Connection.prototype = {
// Fires the XHR request -- may be invoked immediately
// or on a gradually expanding retry window for reconnects
var sendFunc = function () {
+ req.date = new Date();
req.xhr.send(req.data);
};
// Implement progressive backoff for reconnects --
// First retry (send == 1) should also be instantaneous
if (req.sends > 1) {
- // Using a cube of the retry number creats a nicely
+ // Using a cube of the retry number creates a nicely
// expanding retry window
- var backoff = Math.pow(req.sends, 3) * 1000;
+ var backoff = Math.min(Math.floor(Strophe.TIMEOUT * this.wait),
+ Math.pow(req.sends, 3)) * 1000;
setTimeout(sendFunc, backoff);
} else {
sendFunc();
@@ -2530,8 +2568,12 @@ Strophe.Connection.prototype = {
req.sends++;
- this.xmlOutput(req.xmlData);
- this.rawOutput(req.data);
+ if (this.xmlOutput !== Strophe.Connection.prototype.xmlOutput) {
+ this.xmlOutput(req.xmlData);
+ }
+ if (this.rawOutput !== Strophe.Connection.prototype.rawOutput) {
+ this.rawOutput(req.data);
+ }
} else {
Strophe.debug("_processRequest: " +
(i === 0 ? "first" : "second") +
@@ -2567,7 +2609,7 @@ Strophe.Connection.prototype = {
if (this._requests.length > 1 &&
Math.abs(this._requests[0].rid -
- this._requests[1].rid) < this.window - 1) {
+ this._requests[1].rid) < this.window) {
this._processRequest(1);
}
},
@@ -2662,7 +2704,7 @@ Strophe.Connection.prototype = {
}
}
- if (!((reqStatus > 0 && reqStatus < 10000) ||
+ if (!((reqStatus > 0 && reqStatus < 500) ||
req.sends > 5)) {
this._throttledRequestHandler();
}
@@ -2740,8 +2782,12 @@ Strophe.Connection.prototype = {
}
if (elem === null) { return; }
- this.xmlInput(elem);
- this.rawInput(Strophe.serialize(elem));
+ if (this.xmlInput !== Strophe.Connection.prototype.xmlInput) {
+ this.xmlInput(elem);
+ }
+ if (this.rawInput !== Strophe.Connection.prototype.rawInput) {
+ this.rawInput(Strophe.serialize(elem));
+ }
// remove handlers scheduled for deletion
var i, hand;
@@ -2769,6 +2815,11 @@ Strophe.Connection.prototype = {
var typ = elem.getAttribute("type");
var cond, conflict;
if (typ !== null && typ == "terminate") {
+ // Don't process stanzas that come in after disconnect
+ if (this.disconnecting) {
+ return;
+ }
+
// an error occurred
cond = elem.getAttribute("condition");
conflict = elem.getElementsByTagName("conflict");
@@ -2785,21 +2836,27 @@ Strophe.Connection.prototype = {
}
// send each incoming stanza through the handler chain
- var self = this;
+ var that = this;
Strophe.forEachChild(elem, null, function (child) {
var i, newList;
// process handlers
- newList = self.handlers;
- self.handlers = [];
+ newList = that.handlers;
+ that.handlers = [];
for (i = 0; i < newList.length; i++) {
var hand = newList[i];
- if (hand.isMatch(child) &&
- (self.authenticated || !hand.user)) {
- if (hand.run(child)) {
- self.handlers.push(hand);
+ // encapsulate 'handler.run' not to lose the whole handler list if
+ // one of the handlers throws an exception
+ try {
+ if (hand.isMatch(child) &&
+ (that.authenticated || !hand.user)) {
+ if (hand.run(child)) {
+ that.handlers.push(hand);
+ }
+ } else {
+ that.handlers.push(hand);
}
- } else {
- self.handlers.push(hand);
+ } catch(e) {
+ //if the handler throws an exception, we consider it as false
}
}
});
@@ -2827,8 +2884,8 @@ Strophe.Connection.prototype = {
this.disconnecting = true;
var req = new Strophe.Request(body.tree(),
- this._onRequestStateChange.bind(this)
- .prependArg(this._dataRecv.bind(this)),
+ this._onRequestStateChange.bind(
+ this, this._dataRecv.bind(this)),
body.tree().getAttribute("rid"));
this._requests.push(req);
@@ -2856,8 +2913,12 @@ Strophe.Connection.prototype = {
var bodyWrap = req.getResponse();
if (!bodyWrap) { return; }
- this.xmlInput(bodyWrap);
- this.rawInput(Strophe.serialize(bodyWrap));
+ if (this.xmlInput !== Strophe.Connection.prototype.xmlInput) {
+ this.xmlInput(bodyWrap);
+ }
+ if (this.rawInput !== Strophe.Connection.prototype.rawInput) {
+ this.rawInput(Strophe.serialize(bodyWrap));
+ }
var typ = bodyWrap.getAttribute("type");
var cond, conflict;
@@ -2890,7 +2951,7 @@ Strophe.Connection.prototype = {
if (hold) { this.hold = parseInt(hold, 10); }
var wait = bodyWrap.getAttribute('wait');
if (wait) { this.wait = parseInt(wait, 10); }
-
+
var do_sasl_plain = false;
var do_sasl_digest_md5 = false;
@@ -2915,8 +2976,8 @@ Strophe.Connection.prototype = {
var body = this._buildBody();
this._requests.push(
new Strophe.Request(body.tree(),
- this._onRequestStateChange.bind(this)
- .prependArg(this._connect_cb.bind(this)),
+ this._onRequestStateChange.bind(
+ this, this._connect_cb.bind(this)),
body.tree().getAttribute("rid")));
this._throttledRequestHandler();
return;
@@ -3006,7 +3067,7 @@ Strophe.Connection.prototype = {
var attribMatch = /([a-z]+)=("[^"]+"|[^,"]+)(?:,|$)/;
var challenge = Base64.decode(Strophe.getText(elem));
- var cnonce = MD5.hexdigest(Math.random() * 1234567890);
+ var cnonce = MD5.hexdigest("" + (Math.random() * 1234567890));
var realm = "";
var host = null;
var nonce = "";
@@ -3090,7 +3151,7 @@ Strophe.Connection.prototype = {
*/
_quote: function (str)
{
- return '"' + str.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"';
+ return '"' + str.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"';
//" end string workaround for emacs
},
@@ -3200,6 +3261,9 @@ Strophe.Connection.prototype = {
*/
_sasl_auth1_cb: function (elem)
{
+ // save stream:features for future usage
+ this.features = elem;
+
var i, child;
for (i = 0; i < elem.childNodes.length; i++) {
@@ -3437,6 +3501,13 @@ Strophe.Connection.prototype = {
{
var i, thand, since, newList;
+ // add timed handlers scheduled for addition
+ // NOTE: we add before remove in the case a timed handler is
+ // added and then deleted before the next _onIdle() call.
+ while (this.addTimeds.length > 0) {
+ this.timedHandlers.push(this.addTimeds.pop());
+ }
+
// remove timed handlers that have been scheduled for deletion
while (this.removeTimeds.length > 0) {
thand = this.removeTimeds.pop();
@@ -3446,11 +3517,6 @@ Strophe.Connection.prototype = {
}
}
- // add timed handlers scheduled for addition
- while (this.addTimeds.length > 0) {
- this.timedHandlers.push(this.addTimeds.pop());
- }
-
// call ready timed handlers
var now = new Date().getTime();
newList = [];
@@ -3500,8 +3566,8 @@ Strophe.Connection.prototype = {
this._data = [];
this._requests.push(
new Strophe.Request(body.tree(),
- this._onRequestStateChange.bind(this)
- .prependArg(this._dataRecv.bind(this)),
+ this._onRequestStateChange.bind(
+ this, this._dataRecv.bind(this)),
body.tree().getAttribute("rid")));
this._processRequest(this._requests.length - 1);
}
@@ -3524,9 +3590,12 @@ Strophe.Connection.prototype = {
}
}
- // reactivate the timer
clearTimeout(this._idleTimeout);
- this._idleTimeout = setTimeout(this._onIdle.bind(this), 100);
+
+ // reactivate the timer only if connected
+ if (this.connected) {
+ this._idleTimeout = setTimeout(this._onIdle.bind(this), 100);
+ }
}
};
View
3,543 js/strophe.js
0 additions, 3,543 deletions not shown