(function(a,f){function g(c){return l.isWindow(c)?c:c.nodeType===9?c.defaultView||c.parentWindow:false}function k(c){if(!Bb[c]){var h=l("<"+c+">").appendTo("body"),n=h.css("display");h.remove();if(n==="none"||n==="")n="block";Bb[c]=n}return Bb[c]}function s(c,h){var n={};l.each(Kb.concat.apply([],Kb.slice(0,h)),function(){n[this]=c});return n}function r(){try{return new a.XMLHttpRequest}catch(c){}}function v(){l(a).unload(function(){for(var c in rb)rb[c](0,1)})}function C(c,h,n,u){if(l.isArray(h)&&
h.length)l.each(h,function(b,e){n||Xb.test(c)?u(c,e):C(c+"["+(typeof e==="object"||l.isArray(e)?b:"")+"]",e,n,u)});else if(n||h==null||typeof h!=="object")u(c,h);else if(l.isArray(h)||l.isEmptyObject(h))u(c,"");else for(var z in h)C(c+"["+z+"]",h[z],n,u)}function F(c,h,n,u,z,b){z=z||h.dataTypes[0];b=b||{};b[z]=true;z=c[z];for(var e=0,m=z?z.length:0,p=c===Cb,q;e<m&&(p||!q);e++){q=z[e](h,n,u);typeof q==="string"&&(!p||b[q]?q=f:(h.dataTypes.unshift(q),q=F(c,h,n,u,q,b)))}(p||!q)&&!b["*"]&&(q=F(c,h,n,
u,"*",b));return q}function H(c){return function(h,n){typeof h!=="string"&&(n=h,h="*");if(l.isFunction(n))for(var u=h.toLowerCase().split(ma),z=0,b=u.length,e,m;z<b;z++){e=u[z];(m=/^\+/.test(e))&&(e=e.substr(1)||"*");e=c[e]=c[e]||[];e[m?"unshift":"push"](n)}}}function K(c,h,n){var u=h==="width"?c.offsetWidth:c.offsetHeight;if(n==="border")return u;l.each(h==="width"?Db:Yb,function(){n||(u-=parseFloat(l.css(c,"padding"+this))||0);n==="margin"?u+=parseFloat(l.css(c,"margin"+this))||0:u-=parseFloat(l.css(c,
"border"+this+"Width"))||0});return u}function M(c,h){h.src?l.ajax({url:h.src,async:false,dataType:"script"}):l.globalEval(h.text||h.textContent||h.innerHTML||"");h.parentNode&&h.parentNode.removeChild(h)}function Q(c){return"getElementsByTagName"in c?c.getElementsByTagName("*"):"querySelectorAll"in c?c.querySelectorAll("*"):[]}function S(c,h){if(h.nodeType===1){var n=h.nodeName.toLowerCase();h.clearAttributes();h.mergeAttributes(c);if(n==="object")h.outerHTML=c.outerHTML;else if(n!=="input"||c.type!==
"checkbox"&&c.type!=="radio")if(n==="option")h.selected=c.defaultSelected;else{if(n==="input"||n==="textarea")h.defaultValue=c.defaultValue}else{c.checked&&(h.defaultChecked=h.checked=c.checked);h.value!==c.value&&(h.value=c.value)}h.removeAttribute(l.expando)}}function W(c,h){if(h.nodeType===1&&l.hasData(c)){var n=l.expando,u=l.data(c),z=l.data(h,u);if(u=u[n]){var b=u.events;z=z[n]=l.extend({},u);if(b){delete z.handle;z.events={};for(var e in b){n=0;for(u=b[e].length;n<u;n++)l.event.add(h,e+(b[e][n].namespace?
".":"")+b[e][n].namespace,b[e][n],b[e][n].data)}}}}}function ha(c,h,n){if(l.isFunction(h))return l.grep(c,function(z,b){return!!h.call(z,b,z)===n});if(h.nodeType)return l.grep(c,function(z){return z===h===n});if(typeof h==="string"){var u=l.grep(c,function(z){return z.nodeType===1});if(Ga.test(h))return l.filter(h,u,!n);h=l.filter(h,u)}return l.grep(c,function(z){return l.inArray(z,h)>=0===n})}function fa(c,h){return(c&&c!=="*"?c+".":"")+h.replace(Ra,"`").replace(lb,"&")}function ia(c){var h,n,u,
z,b,e,m,p,q,o,y,A=[];z=[];b=l._data(this,"events");if(c.liveFired!==this&&b&&b.live&&!c.target.disabled&&(!c.button||c.type!=="click")){c.namespace&&(y=RegExp("(^|\\.)"+c.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)"));c.liveFired=this;var B=b.live.slice(0);for(m=0;m<B.length;m++){b=B[m];b.origType.replace(la,"")===c.type?z.push(b.selector):B.splice(m--,1)}z=l(c.target).closest(z,c.currentTarget);p=0;for(q=z.length;p<q;p++){o=z[p];for(m=0;m<B.length;m++){b=B[m];if(o.selector===b.selector&&
(!y||y.test(b.namespace))&&!o.elem.disabled){e=o.elem;u=null;if(b.preType==="mouseenter"||b.preType==="mouseleave"){c.type=b.preType;u=l(c.relatedTarget).closest(b.selector)[0]}(!u||u!==e)&&A.push({elem:e,handleObj:b,level:o.level})}}}p=0;for(q=A.length;p<q;p++){z=A[p];if(n&&z.level>n)break;c.currentTarget=z.elem;c.data=z.handleObj.data;c.handleObj=z.handleObj;y=z.handleObj.origHandler.apply(z.elem,arguments);if(y===false||c.isPropagationStopped()){n=z.level;y===false&&(h=false);if(c.isImmediatePropagationStopped())break}}return h}}
function Aa(c,h,n){var u=l.extend({},n[0]);u.type=c;u.originalEvent={};u.liveFired=f;l.event.handle.call(h,u);u.isDefaultPrevented()&&n[0].preventDefault()}function ra(){return true}function xa(){return false}function Qa(c){for(var h in c)if(h!=="toJSON")return false;return true}function Ia(c,h,n){if(n===f&&c.nodeType===1){n=c.getAttribute("data-"+h);if(typeof n==="string"){try{n=n==="true"?true:n==="false"?false:n==="null"?null:l.isNaN(n)?Ca.test(n)?l.parseJSON(n):n:parseFloat(n)}catch(u){}l.data(c,
h,n)}else n=f}return n}var V=a.document,l=function(){function c(){if(!h.isReady){try{V.documentElement.doScroll("left")}catch(G){setTimeout(c,1);return}h.ready()}}var h=function(G,U){return new h.fn.init(G,U,z)},n=a.jQuery,u=a.$,z,b=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,e=/\S/,m=/^\s+/,p=/\s+$/,q=/\d/,o=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,y=/^[\],:{}\s]*$/,A=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,B=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,D=/(?:^|:|,)(?:\s*\[)+/g,O=/(webkit)[ \/]([\w.]+)/,
T=/(opera)(?:.*version)?[ \/]([\w.]+)/,da=/(msie) ([\w.]+)/,ca=/(mozilla)(?:.*? rv:([\w.]+))?/,t=navigator.userAgent,E,L,J=Object.prototype.toString,I=Object.prototype.hasOwnProperty,P=Array.prototype.push,ea=Array.prototype.slice,ga=String.prototype.trim,ya=Array.prototype.indexOf,Ua={};h.fn=h.prototype={constructor:h,init:function(G,U,Y){var aa,qa;if(!G)return this;if(G.nodeType){this.context=this[0]=G;this.length=1;return this}if(G==="body"&&!U&&V.body){this.context=V;this[0]=V.body;this.selector=
"body";this.length=1;return this}if(typeof G==="string"){aa=b.exec(G);if(!aa||!aa[1]&&U)return!U||U.jquery?(U||Y).find(G):this.constructor(U).find(G);if(aa[1]){qa=(U=U instanceof h?U[0]:U)?U.ownerDocument||U:V;(Y=o.exec(G))?h.isPlainObject(U)?(G=[V.createElement(Y[1])],h.fn.attr.call(G,U,true)):G=[qa.createElement(Y[1])]:(Y=h.buildFragment([aa[1]],[qa]),G=(Y.cacheable?h.clone(Y.fragment):Y.fragment).childNodes);return h.merge(this,G)}if((U=V.getElementById(aa[2]))&&U.parentNode){if(U.id!==aa[2])return Y.find(G);
this.length=1;this[0]=U}this.context=V;this.selector=G;return this}if(h.isFunction(G))return Y.ready(G);G.selector!==f&&(this.selector=G.selector,this.context=G.context);return h.makeArray(G,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return ea.call(this,0)},get:function(G){return G==null?this.toArray():G<0?this[this.length+G]:this[G]},pushStack:function(G,U,Y){var aa=this.constructor();h.isArray(G)?P.apply(aa,G):h.merge(aa,G);aa.prevObject=this;
aa.context=this.context;U==="find"?aa.selector=this.selector+(this.selector?" ":"")+Y:U&&(aa.selector=this.selector+"."+U+"("+Y+")");return aa},each:function(G,U){return h.each(this,G,U)},ready:function(G){h.bindReady();E.done(G);return this},eq:function(G){return G===-1?this.slice(G):this.slice(G,+G+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(ea.apply(this,arguments),"slice",ea.call(arguments).join(","))},map:function(G){return this.pushStack(h.map(this,
function(U,Y){return G.call(U,Y,U)}))},end:function(){return this.prevObject||this.constructor(null)},push:P,sort:[].sort,splice:[].splice};h.fn.init.prototype=h.fn;h.extend=h.fn.extend=function(){var G,U,Y,aa,qa,ta,La=arguments[0]||{},Wa=1,Eb=arguments.length,mb=false;typeof La==="boolean"&&(mb=La,La=arguments[1]||{},Wa=2);typeof La!=="object"&&!h.isFunction(La)&&(La={});for(Eb===Wa&&(La=this,--Wa);Wa<Eb;Wa++)if((G=arguments[Wa])!=null)for(U in G){Y=La[U];aa=G[U];if(La!==aa)mb&&aa&&(h.isPlainObject(aa)||
(qa=h.isArray(aa)))?(qa?(qa=false,ta=Y&&h.isArray(Y)?Y:[]):ta=Y&&h.isPlainObject(Y)?Y:{},La[U]=h.extend(mb,ta,aa)):aa!==f&&(La[U]=aa)}return La};h.extend({noConflict:function(G){a.$=u;G&&(a.jQuery=n);return h},isReady:false,readyWait:1,ready:function(G){G===true&&h.readyWait--;if(!h.readyWait||G!==true&&!h.isReady){if(!V.body)return setTimeout(h.ready,1);h.isReady=true;if(!(G!==true&&--h.readyWait>0)){E.resolveWith(V,[h]);h.fn.trigger&&h(V).trigger("ready").unbind("ready")}}},bindReady:function(){if(!E){E=
h._Deferred();if(V.readyState==="complete")return setTimeout(h.ready,1);if(V.addEventListener){V.addEventListener("DOMContentLoaded",L,false);a.addEventListener("load",h.ready,false)}else if(V.attachEvent){V.attachEvent("onreadystatechange",L);a.attachEvent("onload",h.ready);var G=false;try{G=a.frameElement==null}catch(U){}V.documentElement.doScroll&&G&&c()}}},isFunction:function(G){return h.type(G)==="function"},isArray:Array.isArray||function(G){return h.type(G)==="array"},isWindow:function(G){return G&&
typeof G==="object"&&"setInterval"in G},isNaN:function(G){return G==null||!q.test(G)||isNaN(G)},type:function(G){return G==null?String(G):Ua[J.call(G)]||"object"},isPlainObject:function(G){if(!G||h.type(G)!=="object"||G.nodeType||h.isWindow(G))return false;if(G.constructor&&!I.call(G,"constructor")&&!I.call(G.constructor.prototype,"isPrototypeOf"))return false;var U;for(U in G);return U===f||I.call(G,U)},isEmptyObject:function(G){for(var U in G)return false;return true},error:function(G){throw G;
},parseJSON:function(G){if(typeof G!=="string"||!G)return null;G=h.trim(G);if(y.test(G.replace(A,"@").replace(B,"]").replace(D,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(G):(new Function("return "+G))();h.error("Invalid JSON: "+G)},parseXML:function(G,U,Y){a.DOMParser?(Y=new DOMParser,U=Y.parseFromString(G,"text/xml")):(U=new ActiveXObject("Microsoft.XMLDOM"),U.async="false",U.loadXML(G));Y=U.documentElement;(!Y||!Y.nodeName||Y.nodeName==="parsererror")&&h.error("Invalid XML: "+G);return U},noop:function(){},
globalEval:function(G){if(G&&e.test(G)){var U=V.head||V.getElementsByTagName("head")[0]||V.documentElement,Y=V.createElement("script");h.support.scriptEval()?Y.appendChild(V.createTextNode(G)):Y.text=G;U.insertBefore(Y,U.firstChild);U.removeChild(Y)}},nodeName:function(G,U){return G.nodeName&&G.nodeName.toUpperCase()===U.toUpperCase()},each:function(G,U,Y){var aa,qa=0,ta=G.length,La=ta===f||h.isFunction(G);if(Y)if(La)for(aa in G){if(U.apply(G[aa],Y)===false)break}else for(;qa<ta;){if(U.apply(G[qa++],
Y)===false)break}else if(La)for(aa in G){if(U.call(G[aa],aa,G[aa])===false)break}else for(Y=G[0];qa<ta&&U.call(Y,qa,Y)!==false;Y=G[++qa]);return G},trim:ga?function(G){return G==null?"":ga.call(G)}:function(G){return G==null?"":(G+"").replace(m,"").replace(p,"")},makeArray:function(G,U){var Y=U||[];if(G!=null){var aa=h.type(G);G.length==null||aa==="string"||aa==="function"||aa==="regexp"||h.isWindow(G)?P.call(Y,G):h.merge(Y,G)}return Y},inArray:function(G,U){if(U.indexOf)return U.indexOf(G);for(var Y=
0,aa=U.length;Y<aa;Y++)if(U[Y]===G)return Y;return-1},merge:function(G,U){var Y=G.length,aa=0;if(typeof U.length==="number")for(var qa=U.length;aa<qa;aa++)G[Y++]=U[aa];else for(;U[aa]!==f;)G[Y++]=U[aa++];G.length=Y;return G},grep:function(G,U,Y){var aa=[],qa;Y=!!Y;for(var ta=0,La=G.length;ta<La;ta++){qa=!!U(G[ta],ta);Y!==qa&&aa.push(G[ta])}return aa},map:function(G,U,Y){for(var aa=[],qa,ta=0,La=G.length;ta<La;ta++){qa=U(G[ta],ta,Y);qa!=null&&(aa[aa.length]=qa)}return aa.concat.apply([],aa)},guid:1,
proxy:function(G,U,Y){arguments.length===2&&(typeof U==="string"?(Y=G,G=Y[U],U=f):U&&!h.isFunction(U)&&(Y=U,U=f));!U&&G&&(U=function(){return G.apply(Y||this,arguments)});G&&(U.guid=G.guid=G.guid||U.guid||h.guid++);return U},access:function(G,U,Y,aa,qa,ta){var La=G.length;if(typeof U==="object"){for(var Wa in U)h.access(G,Wa,U[Wa],aa,qa,Y);return G}if(Y!==f){aa=!ta&&aa&&h.isFunction(Y);for(Wa=0;Wa<La;Wa++)qa(G[Wa],U,aa?Y.call(G[Wa],Wa,qa(G[Wa],U)):Y,ta);return G}return La?qa(G[0],U):f},now:function(){return(new Date).getTime()},
uaMatch:function(G){G=G.toLowerCase();G=O.exec(G)||T.exec(G)||da.exec(G)||G.indexOf("compatible")<0&&ca.exec(G)||[];return{browser:G[1]||"",version:G[2]||"0"}},sub:function(){function G(Y,aa){return new G.fn.init(Y,aa)}h.extend(true,G,this);G.superclass=this;G.fn=G.prototype=this();G.fn.constructor=G;G.subclass=this.subclass;G.fn.init=function Y(Y,aa){aa&&aa instanceof h&&!(aa instanceof G)&&(aa=G(aa));return h.fn.init.call(this,Y,aa,U)};G.fn.init.prototype=G.fn;var U=G(V);return G},browser:{}});
h.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(G,U){Ua["[object "+U+"]"]=U.toLowerCase()});t=h.uaMatch(t);t.browser&&(h.browser[t.browser]=true,h.browser.version=t.version);h.browser.webkit&&(h.browser.safari=true);ya&&(h.inArray=function(G,U){return ya.call(U,G)});e.test("\u00a0")&&(m=/^[\s\xA0]+/,p=/[\s\xA0]+$/);z=h(V);V.addEventListener?L=function(){V.removeEventListener("DOMContentLoaded",L,false);h.ready()}:V.attachEvent&&(L=function(){V.readyState==="complete"&&
(V.detachEvent("onreadystatechange",L),h.ready())});return h}(),wa="then done fail isResolved isRejected promise".split(" "),Da=[].slice;l.extend({_Deferred:function(){var c=[],h,n,u,z={done:function(){if(!u){var b=arguments,e,m,p,q,o;h&&(o=h,h=0);e=0;for(m=b.length;e<m;e++){p=b[e];q=l.type(p);q==="array"?z.done.apply(z,p):q==="function"&&c.push(p)}o&&z.resolveWith(o[0],o[1])}return this},resolveWith:function(b,e){if(!u&&!h&&!n){e=e||[];n=1;try{for(;c[0];)c.shift().apply(b,e)}finally{h=[b,e];n=0}}return this},
resolve:function(){z.resolveWith(this,arguments);return this},isResolved:function(){return n||h},cancel:function(){u=1;c=[];return this}};return z},Deferred:function(c){var h=l._Deferred(),n=l._Deferred(),u;l.extend(h,{then:function(z,b){h.done(z).fail(b);return this},fail:n.done,rejectWith:n.resolveWith,reject:n.resolve,isRejected:n.isResolved,promise:function(z){if(z==null){if(u)return u;u=z={}}for(var b=wa.length;b--;)z[wa[b]]=h[wa[b]];return z}});h.done(n.cancel).fail(h.cancel);delete h.cancel;
c&&c.call(h,h);return h},when:function(c){function h(m){return function(p){n[m]=arguments.length>1?Da.call(arguments,0):p;--b||e.resolveWith(e,Da.call(n,0))}}var n=arguments,u=0,z=n.length,b=z,e=z<=1&&c&&l.isFunction(c.promise)?c:l.Deferred();if(z>1){for(;u<z;u++)n[u]&&l.isFunction(n[u].promise)?n[u].promise().then(h(u),e.reject):--b;b||e.resolveWith(e,n)}else e!==c&&e.resolveWith(e,z?[c]:[]);return e.promise()}});(function(){l.support={};var c=V.createElement("div");c.style.display="none";c.innerHTML=
"   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var h=c.getElementsByTagName("*"),n=c.getElementsByTagName("a")[0],u=V.createElement("select"),z=u.appendChild(V.createElement("option")),b=c.getElementsByTagName("input")[0];if(h&&h.length&&n){l.support={leadingWhitespace:c.firstChild.nodeType===3,tbody:!c.getElementsByTagName("tbody").length,htmlSerialize:!!c.getElementsByTagName("link").length,style:/red/.test(n.getAttribute("style")),
hrefNormalized:n.getAttribute("href")==="/a",opacity:/^0.55$/.test(n.style.opacity),cssFloat:!!n.style.cssFloat,checkOn:b.value==="on",optSelected:z.selected,deleteExpando:true,optDisabled:false,checkClone:false,noCloneEvent:true,noCloneChecked:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true,reliableMarginRight:true};b.checked=true;l.support.noCloneChecked=b.cloneNode(true).checked;u.disabled=true;l.support.optDisabled=!z.disabled;var e=null;l.support.scriptEval=
function(){if(e===null){var p=V.documentElement,q=V.createElement("script"),o="script"+l.now();try{q.appendChild(V.createTextNode("window."+o+"=1;"))}catch(y){}p.insertBefore(q,p.firstChild);a[o]?(e=true,delete a[o]):e=false;p.removeChild(q)}return e};try{delete c.test}catch(m){l.support.deleteExpando=false}!c.addEventListener&&c.attachEvent&&c.fireEvent&&(c.attachEvent("onclick",function p(){l.support.noCloneEvent=false;c.detachEvent("onclick",p)}),c.cloneNode(true).fireEvent("onclick"));c=V.createElement("div");
c.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";h=V.createDocumentFragment();h.appendChild(c.firstChild);l.support.checkClone=h.cloneNode(true).cloneNode(true).lastChild.checked;l(function(){var p=V.createElement("div"),q=V.getElementsByTagName("body")[0];if(q){p.style.width=p.style.paddingLeft="1px";q.appendChild(p);l.boxModel=l.support.boxModel=p.offsetWidth===2;"zoom"in p.style&&(p.style.display="inline",p.style.zoom=1,l.support.inlineBlockNeedsLayout=p.offsetWidth===2,p.style.display=
"",p.innerHTML="<div style='width:4px;'></div>",l.support.shrinkWrapBlocks=p.offsetWidth!==2);p.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var o=p.getElementsByTagName("td");l.support.reliableHiddenOffsets=o[0].offsetHeight===0;o[0].style.display="";o[1].style.display="none";l.support.reliableHiddenOffsets=l.support.reliableHiddenOffsets&&o[0].offsetHeight===0;p.innerHTML="";V.defaultView&&V.defaultView.getComputedStyle&&(p.style.width="1px",p.style.marginRight=
"0",l.support.reliableMarginRight=(parseInt(V.defaultView.getComputedStyle(p,null).marginRight,10)||0)===0);q.removeChild(p).style.display="none"}});h=function(p){var q=V.createElement("div");p="on"+p;if(!q.attachEvent)return true;var o=p in q;o||(q.setAttribute(p,"return;"),o=typeof q[p]==="function");return o};l.support.submitBubbles=h("submit");l.support.changeBubbles=h("change");c=h=n=null}})();var Ca=/^(?:\{.*\}|\[.*\])$/;l.extend({cache:{},uuid:0,expando:"jQuery"+(l.fn.jquery+Math.random()).replace(/\D/g,
""),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},hasData:function(c){c=c.nodeType?l.cache[c[l.expando]]:c[l.expando];return!!c&&!Qa(c)},data:function(c,h,n,u){if(l.acceptData(c)){var z=l.expando,b=typeof h==="string",e=c.nodeType,m=e?l.cache:c,p=e?c[l.expando]:c[l.expando]&&l.expando;if(!((!p||u&&p&&!m[p][z])&&b&&n===f)){p||(e?c[l.expando]=p=++l.uuid:p=l.expando);m[p]||(m[p]={},e||(m[p].toJSON=l.noop));if(typeof h==="object"||typeof h==="function")u?m[p][z]=
l.extend(m[p][z],h):m[p]=l.extend(m[p],h);c=m[p];u&&(c[z]||(c[z]={}),c=c[z]);n!==f&&(c[h]=n);if(h==="events"&&!c[h])return c[z]&&c[z].events;return b?c[h]:c}}},removeData:function(c,h,n){if(l.acceptData(c)){var u=l.expando,z=c.nodeType,b=z?l.cache:c,e=z?c[l.expando]:l.expando;if(b[e]){if(h){var m=n?b[e][u]:b[e];if(m){delete m[h];if(!Qa(m))return}}if(n){delete b[e][u];if(!Qa(b[e]))return}h=b[e][u];l.support.deleteExpando||b!=a?delete b[e]:b[e]=null;h?(b[e]={},z||(b[e].toJSON=l.noop),b[e][u]=h):z&&
(l.support.deleteExpando?delete c[l.expando]:c.removeAttribute?c.removeAttribute(l.expando):c[l.expando]=null)}}},_data:function(c,h,n){return l.data(c,h,n,true)},acceptData:function(c){if(c.nodeName){var h=l.noData[c.nodeName.toLowerCase()];if(h)return h!==true&&c.getAttribute("classid")===h}return true}});l.fn.extend({data:function(c,h){var n=null;if(typeof c==="undefined"){if(this.length){n=l.data(this[0]);if(this[0].nodeType===1)for(var u=this[0].attributes,z,b=0,e=u.length;b<e;b++){z=u[b].name;
z.indexOf("data-")===0&&(z=z.substr(5),Ia(this[0],z,n[z]))}}return n}if(typeof c==="object")return this.each(function(){l.data(this,c)});var m=c.split(".");m[1]=m[1]?"."+m[1]:"";if(h===f){n=this.triggerHandler("getData"+m[1]+"!",[m[0]]);n===f&&this.length&&(n=l.data(this[0],c),n=Ia(this[0],c,n));return n===f&&m[1]?this.data(m[0]):n}return this.each(function(){var p=l(this),q=[m[0],h];p.triggerHandler("setData"+m[1]+"!",q);l.data(this,c,h);p.triggerHandler("changeData"+m[1]+"!",q)})},removeData:function(c){return this.each(function(){l.removeData(this,
c)})}});l.extend({queue:function(c,h,n){if(c){h=(h||"fx")+"queue";var u=l._data(c,h);if(!n)return u||[];!u||l.isArray(n)?u=l._data(c,h,l.makeArray(n)):u.push(n);return u}},dequeue:function(c,h){h=h||"fx";var n=l.queue(c,h),u=n.shift();u==="inprogress"&&(u=n.shift());u&&(h==="fx"&&n.unshift("inprogress"),u.call(c,function(){l.dequeue(c,h)}));n.length||l.removeData(c,h+"queue",true)}});l.fn.extend({queue:function(c,h){typeof c!=="string"&&(h=c,c="fx");if(h===f)return l.queue(this[0],c);return this.each(function(){var n=
l.queue(this,c,h);c==="fx"&&n[0]!=="inprogress"&&l.dequeue(this,c)})},dequeue:function(c){return this.each(function(){l.dequeue(this,c)})},delay:function(c,h){c=l.fx?l.fx.speeds[c]||c:c;h=h||"fx";return this.queue(h,function(){var n=this;setTimeout(function(){l.dequeue(n,h)},c)})},clearQueue:function(c){return this.queue(c||"fx",[])}});var Ea=/[\n\t\r]/g,ua=/\s+/,ab=/\r/g,ba=/^(?:href|src|style)$/,sa=/^(?:button|input)$/i,Ba=/^(?:button|input|object|select|textarea)$/i,Ha=/^a(?:rea)?$/i,Va=/^(?:radio|checkbox)$/i;
l.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};l.fn.extend({attr:function(c,h){return l.access(this,c,h,true,l.attr)},removeAttr:function(c){return this.each(function(){l.attr(this,c,"");this.nodeType===1&&this.removeAttribute(c)})},addClass:function(c){if(l.isFunction(c))return this.each(function(q){var o=l(this);o.addClass(c.call(this,
q,o.attr("class")))});if(c&&typeof c==="string")for(var h=(c||"").split(ua),n=0,u=this.length;n<u;n++){var z=this[n];if(z.nodeType===1)if(z.className){for(var b=" "+z.className+" ",e=z.className,m=0,p=h.length;m<p;m++)b.indexOf(" "+h[m]+" ")<0&&(e+=" "+h[m]);z.className=l.trim(e)}else z.className=c}return this},removeClass:function(c){if(l.isFunction(c))return this.each(function(p){var q=l(this);q.removeClass(c.call(this,p,q.attr("class")))});if(c&&typeof c==="string"||c===f)for(var h=(c||"").split(ua),
n=0,u=this.length;n<u;n++){var z=this[n];if(z.nodeType===1&&z.className)if(c){for(var b=(" "+z.className+" ").replace(Ea," "),e=0,m=h.length;e<m;e++)b=b.replace(" "+h[e]+" "," ");z.className=l.trim(b)}else z.className=""}return this},toggleClass:function(c,h){var n=typeof c,u=typeof h==="boolean";if(l.isFunction(c))return this.each(function(z){var b=l(this);b.toggleClass(c.call(this,z,b.attr("class"),h),h)});return this.each(function(){if(n==="string")for(var z,b=0,e=l(this),m=h,p=c.split(ua);z=p[b++];){m=
u?m:!e.hasClass(z);e[m?"addClass":"removeClass"](z)}else if(n==="undefined"||n==="boolean"){this.className&&l._data(this,"__className__",this.className);this.className=this.className||c===false?"":l._data(this,"__className__")||""}})},hasClass:function(c){c=" "+c+" ";for(var h=0,n=this.length;h<n;h++)if((" "+this[h].className+" ").replace(Ea," ").indexOf(c)>-1)return true;return false},val:function(c){if(!arguments.length){var h=this[0];if(h){if(l.nodeName(h,"option")){var n=h.attributes.value;return!n||
n.specified?h.value:h.text}if(l.nodeName(h,"select")){n=h.selectedIndex;var u=[],z=h.options;h=h.type==="select-one";if(n<0)return null;for(var b=h?n:0,e=h?n+1:z.length;b<e;b++){var m=z[b];if(m.selected&&(l.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!l.nodeName(m.parentNode,"optgroup"))){c=l(m).val();if(h)return c;u.push(c)}}if(h&&!u.length&&z.length)return l(z[n]).val();return u}if(Va.test(h.type)&&!l.support.checkOn)return h.getAttribute("value")===
null?"on":h.value;return(h.value||"").replace(ab,"")}return f}var p=l.isFunction(c);return this.each(function(q){var o=l(this),y=c;if(this.nodeType===1){p&&(y=c.call(this,q,o.val()));y==null?y="":typeof y==="number"?y+="":l.isArray(y)&&(y=l.map(y,function(B){return B==null?"":B+""}));if(l.isArray(y)&&Va.test(this.type))this.checked=l.inArray(o.val(),y)>=0;else if(l.nodeName(this,"select")){var A=l.makeArray(y);l("option",this).each(function(){this.selected=l.inArray(l(this).val(),A)>=0});A.length||
(this.selectedIndex=-1)}else this.value=y}})}});l.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(c,h,n,u){if(!c||c.nodeType===3||c.nodeType===8||c.nodeType===2)return f;if(u&&h in l.attrFn)return l(c)[h](n);u=c.nodeType!==1||!l.isXMLDoc(c);var z=n!==f;h=u&&l.props[h]||h;if(c.nodeType===1){var b=ba.test(h);if((h in c||c[h]!==f)&&u&&!b){z&&(h==="type"&&sa.test(c.nodeName)&&c.parentNode&&l.error("type property can't be changed"),n===
null?c.nodeType===1&&c.removeAttribute(h):c[h]=n);if(l.nodeName(c,"form")&&c.getAttributeNode(h))return c.getAttributeNode(h).nodeValue;if(h==="tabIndex")return(h=c.getAttributeNode("tabIndex"))&&h.specified?h.value:Ba.test(c.nodeName)||Ha.test(c.nodeName)&&c.href?0:f;return c[h]}if(!l.support.style&&u&&h==="style"){z&&(c.style.cssText=""+n);return c.style.cssText}z&&c.setAttribute(h,""+n);if(!c.attributes[h]&&c.hasAttribute&&!c.hasAttribute(h))return f;c=!l.support.hrefNormalized&&u&&b?c.getAttribute(h,
2):c.getAttribute(h);return c===null?f:c}z&&(c[h]=n);return c[h]}});var la=/\.(.*)$/,Ma=/^(?:textarea|input|select)$/i,Ra=/\./g,lb=/ /g,va=/[^\w\s.|`]/g,Na=function(c){return c.replace(va,"\\$&")};l.event={add:function(c,h,n,u){if(c.nodeType!==3&&c.nodeType!==8){try{l.isWindow(c)&&c!==a&&!c.frameElement&&(c=a)}catch(z){}if(n===false)n=xa;else if(!n)return;var b,e;n.handler&&(b=n,n=b.handler);n.guid||(n.guid=l.guid++);if(e=l._data(c)){var m=e.events,p=e.handle;m||(e.events=m={});p||(e.handle=p=function(D){return typeof l!==
"undefined"&&l.event.triggered!==D.type?l.event.handle.apply(p.elem,arguments):f});p.elem=c;h=h.split(" ");for(var q,o=0,y;q=h[o++];){e=b?l.extend({},b):{handler:n,data:u};q.indexOf(".")>-1?(y=q.split("."),q=y.shift(),e.namespace=y.slice(0).sort().join(".")):(y=[],e.namespace="");e.type=q;e.guid||(e.guid=n.guid);var A=m[q],B=l.event.special[q]||{};if(!A){A=m[q]=[];if(!B.setup||B.setup.call(c,u,y,p)===false)c.addEventListener?c.addEventListener(q,p,false):c.attachEvent&&c.attachEvent("on"+q,p)}B.add&&
(B.add.call(c,e),e.handler.guid||(e.handler.guid=n.guid));A.push(e);l.event.global[q]=true}c=null}}},global:{},remove:function(c,h,n,u){if(c.nodeType!==3&&c.nodeType!==8){n===false&&(n=xa);var z,b,e=0,m,p,q,o,y,A,B=l.hasData(c)&&l._data(c),D=B&&B.events;if(B&&D){h&&h.type&&(n=h.handler,h=h.type);if(!h||typeof h==="string"&&h.charAt(0)==="."){h=h||"";for(z in D)l.event.remove(c,z+h)}else{for(h=h.split(" ");z=h[e++];){o=z;m=z.indexOf(".")<0;p=[];m||(p=z.split("."),z=p.shift(),q=RegExp("(^|\\.)"+l.map(p.slice(0).sort(),
Na).join("\\.(?:.*\\.)?")+"(\\.|$)"));if(y=D[z])if(n){o=l.event.special[z]||{};for(b=u||0;b<y.length;b++){A=y[b];if(n.guid===A.guid){if(m||q.test(A.namespace)){u==null&&y.splice(b--,1);o.remove&&o.remove.call(c,A)}if(u!=null)break}}if(y.length===0||u!=null&&y.length===1){(!o.teardown||o.teardown.call(c,p)===false)&&l.removeEvent(c,z,B.handle);delete D[z]}}else for(b=0;b<y.length;b++){A=y[b];if(m||q.test(A.namespace)){l.event.remove(c,o,A.handler,b);y.splice(b--,1)}}}if(l.isEmptyObject(D)){(h=B.handle)&&
(h.elem=null);delete B.events;delete B.handle;l.isEmptyObject(B)&&l.removeData(c,f,true)}}}}},trigger:function(c,h,n,u){var z=c.type||c;if(!u){c=typeof c==="object"?c[l.expando]?c:l.extend(l.Event(z),c):l.Event(z);z.indexOf("!")>=0&&(c.type=z=z.slice(0,-1),c.exclusive=true);n||(c.stopPropagation(),l.event.global[z]&&l.each(l.cache,function(){var y=this[l.expando];y&&y.events&&y.events[z]&&l.event.trigger(c,h,y.handle.elem)}));if(!n||n.nodeType===3||n.nodeType===8)return f;c.result=f;c.target=n;h=
l.makeArray(h);h.unshift(c)}c.currentTarget=n;(u=l._data(n,"handle"))&&u.apply(n,h);u=n.parentNode||n.ownerDocument;try{n&&n.nodeName&&l.noData[n.nodeName.toLowerCase()]||n["on"+z]&&n["on"+z].apply(n,h)===false&&(c.result=false,c.preventDefault())}catch(b){}if(!c.isPropagationStopped()&&u)l.event.trigger(c,h,u,true);else if(!c.isDefaultPrevented()){var e;u=c.target;var m=z.replace(la,""),p=l.nodeName(u,"a")&&m==="click",q=l.event.special[m]||{};if((!q._default||q._default.call(n,c)===false)&&!p&&
!(u&&u.nodeName&&l.noData[u.nodeName.toLowerCase()])){try{u[m]&&(e=u["on"+m],e&&(u["on"+m]=null),l.event.triggered=c.type,u[m]())}catch(o){}e&&(u["on"+m]=e);l.event.triggered=f}}},handle:function(c){var h,n,u,z;z=[];var b=l.makeArray(arguments);c=b[0]=l.event.fix(c||a.event);c.currentTarget=this;(h=c.type.indexOf(".")<0&&!c.exclusive)||(n=c.type.split("."),c.type=n.shift(),z=n.slice(0).sort(),u=RegExp("(^|\\.)"+z.join("\\.(?:.*\\.)?")+"(\\.|$)"));c.namespace=c.namespace||z.join(".");z=l._data(this,
"events");n=(z||{})[c.type];if(z&&n){n=n.slice(0);z=0;for(var e=n.length;z<e;z++){var m=n[z];if(h||u.test(m.namespace)){c.handler=m.handler;c.data=m.data;c.handleObj=m;m=m.handler.apply(this,b);m!==f&&(c.result=m,m===false&&(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(c){if(c[l.expando])return c;var h=c;c=l.Event(h);for(var n=this.props.length,u;n;){u=this.props[--n];c[u]=h[u]}c.target||(c.target=c.srcElement||V);c.target.nodeType===3&&(c.target=c.target.parentNode);!c.relatedTarget&&c.fromElement&&(c.relatedTarget=c.fromElement===c.target?c.toElement:c.fromElement);if(c.pageX==null&&c.clientX!=null){h=V.documentElement;n=V.body;c.pageX=c.clientX+(h&&h.scrollLeft||n&&n.scrollLeft||0)-(h&&h.clientLeft||n&&n.clientLeft||0);c.pageY=c.clientY+(h&&h.scrollTop||
n&&n.scrollTop||0)-(h&&h.clientTop||n&&n.clientTop||0)}c.which==null&&(c.charCode!=null||c.keyCode!=null)&&(c.which=c.charCode!=null?c.charCode:c.keyCode);!c.metaKey&&c.ctrlKey&&(c.metaKey=c.ctrlKey);!c.which&&c.button!==f&&(c.which=c.button&1?1:c.button&2?3:c.button&4?2:0);return c},guid:1E8,proxy:l.proxy,special:{ready:{setup:l.bindReady,teardown:l.noop},live:{add:function(c){l.event.add(this,fa(c.origType,c.selector),l.extend({},c,{handler:ia,guid:c.handler.guid}))},remove:function(c){l.event.remove(this,
fa(c.origType,c.selector),c)}},beforeunload:{setup:function(c,h,n){l.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(c,h){this.onbeforeunload===h&&(this.onbeforeunload=null)}}}};l.removeEvent=V.removeEventListener?function(c,h,n){c.removeEventListener&&c.removeEventListener(h,n,false)}:function(c,h,n){c.detachEvent&&c.detachEvent("on"+h,n)};l.Event=function(c){if(!this.preventDefault)return new l.Event(c);c&&c.type?(this.originalEvent=c,this.type=c.type,this.isDefaultPrevented=c.defaultPrevented||
c.returnValue===false||c.getPreventDefault&&c.getPreventDefault()?ra:xa):this.type=c;this.timeStamp=l.now();this[l.expando]=true};l.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ra;var c=this.originalEvent;c&&(c.preventDefault?c.preventDefault():c.returnValue=false)},stopPropagation:function(){this.isPropagationStopped=ra;var c=this.originalEvent;c&&(c.stopPropagation&&c.stopPropagation(),c.cancelBubble=true)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=
ra;this.stopPropagation()},isDefaultPrevented:xa,isPropagationStopped:xa,isImmediatePropagationStopped:xa};var za=function(c){var h=c.relatedTarget;try{if(!(h&&h!==V&&!h.parentNode)){for(;h&&h!==this;)h=h.parentNode;h!==this&&(c.type=c.data,l.event.handle.apply(this,arguments))}}catch(n){}},Ja=function(c){c.type=c.data;l.event.handle.apply(this,arguments)};l.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(c,h){l.event.special[c]={setup:function(n){l.event.add(this,h,n&&n.selector?Ja:
za,c)},teardown:function(n){l.event.remove(this,h,n&&n.selector?Ja:za)}}});l.support.submitBubbles||(l.event.special.submit={setup:function(){if(this.nodeName&&this.nodeName.toLowerCase()!=="form"){l.event.add(this,"click.specialSubmit",function(c){var h=c.target,n=h.type;(n==="submit"||n==="image")&&l(h).closest("form").length&&Aa("submit",this,arguments)});l.event.add(this,"keypress.specialSubmit",function(c){var h=c.target,n=h.type;(n==="text"||n==="password")&&l(h).closest("form").length&&c.keyCode===
13&&Aa("submit",this,arguments)})}else return false},teardown:function(){l.event.remove(this,".specialSubmit")}});if(!l.support.changeBubbles){var fb,cb=function(c){var h=c.type,n=c.value;h==="radio"||h==="checkbox"?n=c.checked:h==="select-multiple"?n=c.selectedIndex>-1?l.map(c.options,function(u){return u.selected}).join("-"):"":c.nodeName.toLowerCase()==="select"&&(n=c.selectedIndex);return n},Oa=function(c,h){var n=c.target,u,z;if(Ma.test(n.nodeName)&&!n.readOnly){u=l._data(n,"_change_data");z=
cb(n);(c.type!=="focusout"||n.type!=="radio")&&l._data(n,"_change_data",z);if(!(u===f||z===u))if(u!=null||z){c.type="change";c.liveFired=f;l.event.trigger(c,h,n)}}};l.event.special.change={filters:{focusout:Oa,beforedeactivate:Oa,click:function(c){var h=c.target,n=h.type;(n==="radio"||n==="checkbox"||h.nodeName.toLowerCase()==="select")&&Oa.call(this,c)},keydown:function(c){var h=c.target,n=h.type;(c.keyCode===13&&h.nodeName.toLowerCase()!=="textarea"||c.keyCode===32&&(n==="checkbox"||n==="radio")||
n==="select-multiple")&&Oa.call(this,c)},beforeactivate:function(c){c=c.target;l._data(c,"_change_data",cb(c))}},setup:function(){if(this.type==="file")return false;for(var c in fb)l.event.add(this,c+".specialChange",fb[c]);return Ma.test(this.nodeName)},teardown:function(){l.event.remove(this,".specialChange");return Ma.test(this.nodeName)}};fb=l.event.special.change.filters;fb.focus=fb.beforeactivate}V.addEventListener&&l.each({focus:"focusin",blur:"focusout"},function(c,h){function n(z){var b=
l.event.fix(z);b.type=h;b.originalEvent={};l.event.trigger(b,null,b.target);b.isDefaultPrevented()&&z.preventDefault()}var u=0;l.event.special[h]={setup:function(){u++===0&&V.addEventListener(c,n,true)},teardown:function(){--u===0&&V.removeEventListener(c,n,true)}}});l.each(["bind","one"],function(c,h){l.fn[h]=function(n,u,z){if(typeof n==="object"){for(var b in n)this[h](b,u,n[b],z);return this}if(l.isFunction(u)||u===false){z=u;u=f}var e=h==="one"?l.proxy(z,function(p){l(this).unbind(p,e);return z.apply(this,
arguments)}):z;if(n==="unload"&&h!=="one")this.one(n,u,z);else{b=0;for(var m=this.length;b<m;b++)l.event.add(this[b],n,e,u)}return this}});l.fn.extend({unbind:function(c,h){if(typeof c!=="object"||c.preventDefault)for(var n=0,u=this.length;n<u;n++)l.event.remove(this[n],c,h);else for(n in c)this.unbind(n,c[n]);return this},delegate:function(c,h,n,u){return this.live(h,n,u,c)},undelegate:function(c,h,n){return arguments.length===0?this.unbind("live"):this.die(h,null,n,c)},trigger:function(c,h){return this.each(function(){l.event.trigger(c,
h,this)})},triggerHandler:function(c,h){if(this[0]){var n=l.Event(c);n.preventDefault();n.stopPropagation();l.event.trigger(n,h,this[0]);return n.result}},toggle:function(c){for(var h=arguments,n=1;n<h.length;)l.proxy(c,h[n++]);return this.click(l.proxy(c,function(u){var z=(l._data(this,"lastToggle"+c.guid)||0)%n;l._data(this,"lastToggle"+c.guid,z+1);u.preventDefault();return h[z].apply(this,arguments)||false}))},hover:function(c,h){return this.mouseenter(c).mouseleave(h||c)}});var Z={focus:"focusin",
blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};l.each(["live","die"],function(c,h){l.fn[h]=function(n,u,z,b){var e,m=0,p,q,o=b||this.selector;b=b?this:l(this.context);if(typeof n==="object"&&!n.preventDefault){for(e in n)b[h](e,u,n[e],o);return this}l.isFunction(u)&&(z=u,u=f);for(n=(n||"").split(" ");(e=n[m++])!=null;){p=la.exec(e);q="";p&&(q=p[0],e=e.replace(la,""));if(e==="hover")n.push("mouseenter"+q,"mouseleave"+q);else{p=e;e==="focus"||e==="blur"?(n.push(Z[e]+q),e+=q):e=(Z[e]||
e)+q;if(h==="live"){q=0;for(var y=b.length;q<y;q++)l.event.add(b[q],"live."+fa(e,o),{data:u,selector:o,handler:z,origType:e,origHandler:z,preType:p})}else b.unbind("live."+fa(e,o),z)}}return this}});l.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(c,h){l.fn[h]=function(n,u){u==null&&(u=n,n=null);return arguments.length>0?this.bind(h,
n,u):this.trigger(h)};l.attrFn&&(l.attrFn[h]=true)});(function(){function c(t,E,L,J,I,P){I=0;for(var ea=J.length;I<ea;I++){var ga=J[I];if(ga){var ya=false;for(ga=ga[t];ga;){if(ga.sizcache===L){ya=J[ga.sizset];break}if(ga.nodeType===1){P||(ga.sizcache=L,ga.sizset=I);if(typeof E!=="string"){if(ga===E){ya=true;break}}else if(q.filter(E,[ga]).length>0){ya=ga;break}}ga=ga[t]}J[I]=ya}}}function h(t,E,L,J,I,P){I=0;for(var ea=J.length;I<ea;I++){var ga=J[I];if(ga){var ya=false;for(ga=ga[t];ga;){if(ga.sizcache===
L){ya=J[ga.sizset];break}ga.nodeType===1&&!P&&(ga.sizcache=L,ga.sizset=I);if(ga.nodeName.toLowerCase()===E){ya=ga;break}ga=ga[t]}J[I]=ya}}}var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,u=0,z=Object.prototype.toString,b=false,e=true,m=/\\/g,p=/\W/;[0,0].sort(function(){e=false;return 0});var q=function(t,E,L,J){L=L||[];var I=E=E||V;if(E.nodeType!==1&&E.nodeType!==9)return[];if(!t||typeof t!=="string")return L;
var P,ea,ga,ya,Ua,G,U=true,Y=q.isXML(E),aa=[],qa=t;do{n.exec("");if(P=n.exec(qa)){qa=P[3];aa.push(P[1]);if(P[2]){ya=P[3];break}}}while(P);if(aa.length>1&&y.exec(t))if(aa.length===2&&o.relative[aa[0]])ea=ca(aa[0]+aa[1],E);else for(ea=o.relative[aa[0]]?[E]:q(aa.shift(),E);aa.length;){t=aa.shift();o.relative[t]&&(t+=aa.shift());ea=ca(t,ea)}else{!J&&aa.length>1&&E.nodeType===9&&!Y&&o.match.ID.test(aa[0])&&!o.match.ID.test(aa[aa.length-1])&&(Ua=q.find(aa.shift(),E,Y),E=Ua.expr?q.filter(Ua.expr,Ua.set)[0]:
Ua.set[0]);if(E){Ua=J?{expr:aa.pop(),set:D(J)}:q.find(aa.pop(),aa.length===1&&(aa[0]==="~"||aa[0]==="+")&&E.parentNode?E.parentNode:E,Y);ea=Ua.expr?q.filter(Ua.expr,Ua.set):Ua.set;for(aa.length>0?ga=D(ea):U=false;aa.length;){P=G=aa.pop();o.relative[G]?P=aa.pop():G="";P==null&&(P=E);o.relative[G](ga,P,Y)}}else ga=[]}ga||(ga=ea);ga||q.error(G||t);if(z.call(ga)==="[object Array]")if(U)if(E&&E.nodeType===1)for(t=0;ga[t]!=null;t++)ga[t]&&(ga[t]===true||ga[t].nodeType===1&&q.contains(E,ga[t]))&&L.push(ea[t]);
else for(t=0;ga[t]!=null;t++)ga[t]&&ga[t].nodeType===1&&L.push(ea[t]);else L.push.apply(L,ga);else D(ga,L);ya&&(q(ya,I,L,J),q.uniqueSort(L));return L};q.uniqueSort=function(t){if(T){b=e;t.sort(T);if(b)for(var E=1;E<t.length;E++)t[E]===t[E-1]&&t.splice(E--,1)}return t};q.matches=function(t,E){return q(t,null,null,E)};q.matchesSelector=function(t,E){return q(E,null,null,[t]).length>0};q.find=function(t,E,L){var J;if(!t)return[];for(var I=0,P=o.order.length;I<P;I++){var ea,ga=o.order[I];if(ea=o.leftMatch[ga].exec(t)){var ya=
ea[1];ea.splice(1,1);if(ya.substr(ya.length-1)!=="\\"){ea[1]=(ea[1]||"").replace(m,"");J=o.find[ga](ea,E,L);if(J!=null){t=t.replace(o.match[ga],"");break}}}}J||(J=typeof E.getElementsByTagName!=="undefined"?E.getElementsByTagName("*"):[]);return{set:J,expr:t}};q.filter=function(t,E,L,J){for(var I,P,ea=t,ga=[],ya=E,Ua=E&&E[0]&&q.isXML(E[0]);t&&E.length;){for(var G in o.filter)if((I=o.leftMatch[G].exec(t))!=null&&I[2]){var U,Y,aa=o.filter[G];Y=I[1];P=false;I.splice(1,1);if(Y.substr(Y.length-1)!=="\\"){ya===
ga&&(ga=[]);if(o.preFilter[G])if(I=o.preFilter[G](I,ya,L,ga,J,Ua)){if(I===true)continue}else P=U=true;if(I)for(var qa=0;(Y=ya[qa])!=null;qa++)if(Y){U=aa(Y,I,qa,ya);var ta=J^!!U;L&&U!=null?ta?P=true:ya[qa]=false:ta&&(ga.push(Y),P=true)}if(U!==f){L||(ya=ga);t=t.replace(o.match[G],"");if(!P)return[];break}}}if(t===ea)if(P==null)q.error(t);else break;ea=t}return ya};q.error=function(t){throw"Syntax error, unrecognized expression: "+t;};var o=q.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(t){return t.getAttribute("href")},type:function(t){return t.getAttribute("type")}},relative:{"+":function(t,E){var L=typeof E==="string",J=L&&!p.test(E);L=L&&!J;J&&(E=E.toLowerCase());J=0;for(var I=t.length,P;J<I;J++)if(P=t[J]){for(;(P=P.previousSibling)&&P.nodeType!==1;);t[J]=L||P&&P.nodeName.toLowerCase()===E?P||false:P===E}L&&q.filter(E,t,true)},">":function(t,E){var L,J=typeof E==="string",I=0,P=t.length;if(J&&
!p.test(E))for(E=E.toLowerCase();I<P;I++){if(L=t[I]){L=L.parentNode;t[I]=L.nodeName.toLowerCase()===E?L:false}}else{for(;I<P;I++)(L=t[I])&&(t[I]=J?L.parentNode:L.parentNode===E);J&&q.filter(E,t,true)}},"":function(t,E,L){var J,I=u++,P=c;typeof E==="string"&&!p.test(E)&&(E=E.toLowerCase(),J=E,P=h);P("parentNode",E,I,t,J,L)},"~":function(t,E,L){var J,I=u++,P=c;typeof E==="string"&&!p.test(E)&&(E=E.toLowerCase(),J=E,P=h);P("previousSibling",E,I,t,J,L)}},find:{ID:function(t,E,L){if(typeof E.getElementById!==
"undefined"&&!L)return(t=E.getElementById(t[1]))&&t.parentNode?[t]:[]},NAME:function(t,E){if(typeof E.getElementsByName!=="undefined"){for(var L=[],J=E.getElementsByName(t[1]),I=0,P=J.length;I<P;I++)J[I].getAttribute("name")===t[1]&&L.push(J[I]);return L.length===0?null:L}},TAG:function(t,E){if(typeof E.getElementsByTagName!=="undefined")return E.getElementsByTagName(t[1])}},preFilter:{CLASS:function(t,E,L,J,I,P){t=" "+t[1].replace(m,"")+" ";if(P)return t;P=0;for(var ea;(ea=E[P])!=null;P++)ea&&(I^
(ea.className&&(" "+ea.className+" ").replace(/[\t\n\r]/g," ").indexOf(t)>=0)?L||J.push(ea):L&&(E[P]=false));return false},ID:function(t){return t[1].replace(m,"")},TAG:function(t){return t[1].replace(m,"").toLowerCase()},CHILD:function(t){if(t[1]==="nth"){t[2]||q.error(t[0]);t[2]=t[2].replace(/^\+|\s*/g,"");var E=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(t[2]==="even"&&"2n"||t[2]==="odd"&&"2n+1"||!/\D/.test(t[2])&&"0n+"+t[2]||t[2]);t[2]=E[1]+(E[2]||1)-0;t[3]=E[3]-0}else t[2]&&q.error(t[0]);t[0]=u++;return t},
ATTR:function(t,E,L,J,I,P){E=t[1]=t[1].replace(m,"");!P&&o.attrMap[E]&&(t[1]=o.attrMap[E]);t[4]=(t[4]||t[5]||"").replace(m,"");t[2]==="~="&&(t[4]=" "+t[4]+" ");return t},PSEUDO:function(t,E,L,J,I){if(t[1]==="not")if((n.exec(t[3])||"").length>1||/^\w/.test(t[3]))t[3]=q(t[3],null,null,E);else{t=q.filter(t[3],E,L,true^I);L||J.push.apply(J,t);return false}else if(o.match.POS.test(t[0])||o.match.CHILD.test(t[0]))return true;return t},POS:function(t){t.unshift(true);return t}},filters:{enabled:function(t){return t.disabled===
false&&t.type!=="hidden"},disabled:function(t){return t.disabled===true},checked:function(t){return t.checked===true},selected:function(t){return t.selected===true},parent:function(t){return!!t.firstChild},empty:function(t){return!t.firstChild},has:function(t,E,L){return!!q(L[3],t).length},header:function(t){return/h\d/i.test(t.nodeName)},text:function(t){var E=t.getAttribute("type");t=t.type;return"text"===t&&(E===t||E===null)},radio:function(t){return"radio"===t.type},checkbox:function(t){return"checkbox"===
t.type},file:function(t){return"file"===t.type},password:function(t){return"password"===t.type},submit:function(t){return"submit"===t.type},image:function(t){return"image"===t.type},reset:function(t){return"reset"===t.type},button:function(t){return"button"===t.type||t.nodeName.toLowerCase()==="button"},input:function(t){return/input|select|textarea|button/i.test(t.nodeName)}},setFilters:{first:function(t,E){return E===0},last:function(t,E,L,J){return E===J.length-1},even:function(t,E){return E%2===
0},odd:function(t,E){return E%2===1},lt:function(t,E,L){return E<L[3]-0},gt:function(t,E,L){return E>L[3]-0},nth:function(t,E,L){return L[3]-0===E},eq:function(t,E,L){return L[3]-0===E}},filter:{PSEUDO:function(t,E,L,J){var I=E[1],P=o.filters[I];if(P)return P(t,L,E,J);if(I==="contains")return(t.textContent||t.innerText||q.getText([t])||"").indexOf(E[3])>=0;if(I==="not"){E=E[3];L=0;for(J=E.length;L<J;L++)if(E[L]===t)return false;return true}q.error(I)},CHILD:function(t,E){var L=E[1],J=t;switch(L){case "only":case "first":for(;J=
J.previousSibling;)if(J.nodeType===1)return false;if(L==="first")return true;J=t;case "last":for(;J=J.nextSibling;)if(J.nodeType===1)return false;return true;case "nth":L=E[2];var I=E[3];if(L===1&&I===0)return true;var P=E[0],ea=t.parentNode;if(ea&&(ea.sizcache!==P||!t.nodeIndex)){var ga=0;for(J=ea.firstChild;J;J=J.nextSibling)J.nodeType===1&&(J.nodeIndex=++ga);ea.sizcache=P}J=t.nodeIndex-I;return L===0?J===0:J%L===0&&J/L>=0}},ID:function(t,E){return t.nodeType===1&&t.getAttribute("id")===E},TAG:function(t,
E){return E==="*"&&t.nodeType===1||t.nodeName.toLowerCase()===E},CLASS:function(t,E){return(" "+(t.className||t.getAttribute("class"))+" ").indexOf(E)>-1},ATTR:function(t,E){var L=E[1];L=o.attrHandle[L]?o.attrHandle[L](t):t[L]!=null?t[L]:t.getAttribute(L);var J=L+"",I=E[2],P=E[4];return L==null?I==="!=":I==="="?J===P:I==="*="?J.indexOf(P)>=0:I==="~="?(" "+J+" ").indexOf(P)>=0:P?I==="!="?J!==P:I==="^="?J.indexOf(P)===0:I==="$="?J.substr(J.length-P.length)===P:I==="|="?J===P||J.substr(0,P.length+1)===
P+"-":false:J&&L!==false},POS:function(t,E,L,J){var I=o.setFilters[E[2]];if(I)return I(t,L,E,J)}}},y=o.match.POS,A=function(t,E){return"\\"+(E-0+1)};for(var B in o.match){o.match[B]=RegExp(o.match[B].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[B]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[B].source.replace(/\\(\d+)/g,A))}var D=function(t,E){t=Array.prototype.slice.call(t,0);if(E){E.push.apply(E,t);return E}return t};try{Array.prototype.slice.call(V.documentElement.childNodes,0)}catch(O){D=
function(t,E){var L=0,J=E||[];if(z.call(t)==="[object Array]")Array.prototype.push.apply(J,t);else if(typeof t.length==="number")for(var I=t.length;L<I;L++)J.push(t[L]);else for(;t[L];L++)J.push(t[L]);return J}}var T,da;V.documentElement.compareDocumentPosition?T=function(t,E){if(t===E){b=true;return 0}if(!t.compareDocumentPosition||!E.compareDocumentPosition)return t.compareDocumentPosition?-1:1;return t.compareDocumentPosition(E)&4?-1:1}:(T=function(t,E){var L,J,I=[],P=[];L=t.parentNode;J=E.parentNode;
var ea=L;if(t===E){b=true;return 0}if(L===J)return da(t,E);if(!L)return-1;if(!J)return 1;for(;ea;){I.unshift(ea);ea=ea.parentNode}for(ea=J;ea;){P.unshift(ea);ea=ea.parentNode}L=I.length;J=P.length;for(ea=0;ea<L&&ea<J;ea++)if(I[ea]!==P[ea])return da(I[ea],P[ea]);return ea===L?da(t,P[ea],-1):da(I[ea],E,1)},da=function(t,E,L){if(t===E)return L;for(t=t.nextSibling;t;){if(t===E)return-1;t=t.nextSibling}return 1});q.getText=function(t){for(var E="",L,J=0;t[J];J++){L=t[J];L.nodeType===3||L.nodeType===4?
E+=L.nodeValue:L.nodeType!==8&&(E+=q.getText(L.childNodes))}return E};(function(){var t=V.createElement("div"),E="script"+(new Date).getTime(),L=V.documentElement;t.innerHTML="<a name='"+E+"'/>";L.insertBefore(t,L.firstChild);V.getElementById(E)&&(o.find.ID=function(J,I,P){if(typeof I.getElementById!=="undefined"&&!P)return(I=I.getElementById(J[1]))?I.id===J[1]||typeof I.getAttributeNode!=="undefined"&&I.getAttributeNode("id").nodeValue===J[1]?[I]:f:[]},o.filter.ID=function(J,I){var P=typeof J.getAttributeNode!==
"undefined"&&J.getAttributeNode("id");return J.nodeType===1&&P&&P.nodeValue===I});L.removeChild(t);L=t=null})();(function(){var t=V.createElement("div");t.appendChild(V.createComment(""));t.getElementsByTagName("*").length>0&&(o.find.TAG=function(E,L){var J=L.getElementsByTagName(E[1]);if(E[1]==="*"){for(var I=[],P=0;J[P];P++)J[P].nodeType===1&&I.push(J[P]);J=I}return J});t.innerHTML="<a href='#'></a>";t.firstChild&&typeof t.firstChild.getAttribute!=="undefined"&&t.firstChild.getAttribute("href")!==
"#"&&(o.attrHandle.href=function(E){return E.getAttribute("href",2)});t=null})();V.querySelectorAll&&function(){var t=q,E=V.createElement("div");E.innerHTML="<p class='TEST'></p>";if(!E.querySelectorAll||E.querySelectorAll(".TEST").length!==0){q=function(J,I,P,ea){I=I||V;if(!ea&&!q.isXML(I)){var ga=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(J);if(ga&&(I.nodeType===1||I.nodeType===9)){if(ga[1])return D(I.getElementsByTagName(J),P);if(ga[2]&&o.find.CLASS&&I.getElementsByClassName)return D(I.getElementsByClassName(ga[2]),
P)}if(I.nodeType===9){if(J==="body"&&I.body)return D([I.body],P);if(ga&&ga[3]){var ya=I.getElementById(ga[3]);if(!ya||!ya.parentNode)return D([],P);if(ya.id===ga[3])return D([ya],P)}try{return D(I.querySelectorAll(J),P)}catch(Ua){}}else if(I.nodeType===1&&I.nodeName.toLowerCase()!=="object"){ga=I;var G=(ya=I.getAttribute("id"))||"__sizzle__",U=I.parentNode,Y=/^\s*[+~]/.test(J);ya?G=G.replace(/'/g,"\\$&"):I.setAttribute("id",G);Y&&U&&(I=I.parentNode);try{if(!Y||U)return D(I.querySelectorAll("[id='"+
G+"'] "+J),P)}catch(aa){}finally{ya||ga.removeAttribute("id")}}}return t(J,I,P,ea)};for(var L in t)q[L]=t[L];E=null}}();(function(){var t=V.documentElement,E=t.matchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.msMatchesSelector;if(E){var L=!E.call(V.createElement("div"),"div"),J=false;try{E.call(V.documentElement,"[test!='']:sizzle")}catch(I){J=true}q.matchesSelector=function(P,ea){ea=ea.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!q.isXML(P))try{if(J||!o.match.PSEUDO.test(ea)&&!/!=/.test(ea)){var ga=
E.call(P,ea);if(ga||!L||P.document&&P.document.nodeType!==11)return ga}}catch(ya){}return q(ea,null,null,[P]).length>0}}})();(function(){var t=V.createElement("div");t.innerHTML="<div class='test e'></div><div class='test'></div>";if(t.getElementsByClassName&&t.getElementsByClassName("e").length!==0){t.lastChild.className="e";if(t.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(E,L,J){if(typeof L.getElementsByClassName!=="undefined"&&!J)return L.getElementsByClassName(E[1])};
t=null}}})();V.documentElement.contains?q.contains=function(t,E){return t!==E&&(t.contains?t.contains(E):true)}:V.documentElement.compareDocumentPosition?q.contains=function(t,E){return!!(t.compareDocumentPosition(E)&16)}:q.contains=function(){return false};q.isXML=function(t){return(t=(t?t.ownerDocument||t:0).documentElement)?t.nodeName!=="HTML":false};var ca=function(t,E){for(var L,J=[],I="",P=E.nodeType?[E]:E;L=o.match.PSEUDO.exec(t);){I+=L[0];t=t.replace(o.match.PSEUDO,"")}t=o.relative[t]?t+"*":
t;L=0;for(var ea=P.length;L<ea;L++)q(t,P[L],J);return q.filter(I,J)};l.find=q;l.expr=q.selectors;l.expr[":"]=l.expr.filters;l.unique=q.uniqueSort;l.text=q.getText;l.isXMLDoc=q.isXML;l.contains=q.contains})();var Xa=/Until$/,ka=/^(?:parents|prevUntil|prevAll)/,$a=/,/,Ga=/^.[^:#\[\.,]*$/,N=Array.prototype.slice,Ya=l.expr.match.POS,Ta={children:true,contents:true,next:true,prev:true};l.fn.extend({find:function(c){for(var h=this.pushStack("","find",c),n=0,u=0,z=this.length;u<z;u++){n=h.length;l.find(c,
this[u],h);if(u>0)for(var b=n;b<h.length;b++)for(var e=0;e<n;e++)if(h[e]===h[b]){h.splice(b--,1);break}}return h},has:function(c){var h=l(c);return this.filter(function(){for(var n=0,u=h.length;n<u;n++)if(l.contains(this,h[n]))return true})},not:function(c){return this.pushStack(ha(this,c,false),"not",c)},filter:function(c){return this.pushStack(ha(this,c,true),"filter",c)},is:function(c){return!!c&&l.filter(c,this).length>0},closest:function(c,h){var n=[],u,z,b=this[0];if(l.isArray(c)){var e,m={},
p=1;if(b&&c.length){u=0;for(z=c.length;u<z;u++){e=c[u];m[e]||(m[e]=l.expr.match.POS.test(e)?l(e,h||this.context):e)}for(;b&&b.ownerDocument&&b!==h;){for(e in m){u=m[e];(u.jquery?u.index(b)>-1:l(b).is(u))&&n.push({selector:e,elem:b,level:p})}b=b.parentNode;p++}}return n}e=Ya.test(c)?l(c,h||this.context):null;u=0;for(z=this.length;u<z;u++)for(b=this[u];b;){if(e?e.index(b)>-1:l.find.matchesSelector(b,c)){n.push(b);break}b=b.parentNode;if(!b||!b.ownerDocument||b===h)break}n=n.length>1?l.unique(n):n;return this.pushStack(n,
"closest",c)},index:function(c){if(!c||typeof c==="string")return l.inArray(this[0],c?l(c):this.parent().children());return l.inArray(c.jquery?c[0]:c,this)},add:function(c,h){var n=typeof c==="string"?l(c,h):l.makeArray(c),u=l.merge(this.get(),n);return this.pushStack(!n[0]||!n[0].parentNode||n[0].parentNode.nodeType===11||!u[0]||!u[0].parentNode||u[0].parentNode.nodeType===11?u:l.unique(u))},andSelf:function(){return this.add(this.prevObject)}});l.each({parent:function(c){return(c=c.parentNode)&&
c.nodeType!==11?c:null},parents:function(c){return l.dir(c,"parentNode")},parentsUntil:function(c,h,n){return l.dir(c,"parentNode",n)},next:function(c){return l.nth(c,2,"nextSibling")},prev:function(c){return l.nth(c,2,"previousSibling")},nextAll:function(c){return l.dir(c,"nextSibling")},prevAll:function(c){return l.dir(c,"previousSibling")},nextUntil:function(c,h,n){return l.dir(c,"nextSibling",n)},prevUntil:function(c,h,n){return l.dir(c,"previousSibling",n)},siblings:function(c){return l.sibling(c.parentNode.firstChild,
c)},children:function(c){return l.sibling(c.firstChild)},contents:function(c){return l.nodeName(c,"iframe")?c.contentDocument||c.contentWindow.document:l.makeArray(c.childNodes)}},function(c,h){l.fn[c]=function(n,u){var z=l.map(this,h,n),b=N.call(arguments);Xa.test(c)||(u=n);u&&typeof u==="string"&&(z=l.filter(u,z));z=this.length>1&&!Ta[c]?l.unique(z):z;(this.length>1||$a.test(u))&&ka.test(c)&&(z=z.reverse());return this.pushStack(z,c,b.join(","))}});l.extend({filter:function(c,h,n){n&&(c=":not("+
c+")");return h.length===1?l.find.matchesSelector(h[0],c)?[h[0]]:[]:l.find.matches(c,h)},dir:function(c,h,n){var u=[];for(c=c[h];c&&c.nodeType!==9&&(n===f||c.nodeType!==1||!l(c).is(n));){c.nodeType===1&&u.push(c);c=c[h]}return u},nth:function(c,h,n){h=h||1;for(var u=0;c;c=c[n])if(c.nodeType===1&&++u===h)break;return c},sibling:function(c,h){for(var n=[];c;c=c.nextSibling)c.nodeType===1&&c!==h&&n.push(c);return n}});var pa=/ jQuery\d+="(?:\d+|null)"/g,hb=/^\s+/,X=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
ja=/<([\w:]+)/,Ka=/<tbody/i,Sa=/<|&#?\w+;/,db=/<(?:script|object|embed|option|style)/i,Fa=/checked\s*(?:[^=]|=\s*.checked.)/i,na={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,"",""]};na.optgroup=na.option;na.tbody=na.tfoot=na.colgroup=
na.caption=na.thead;na.th=na.td;l.support.htmlSerialize||(na._default=[1,"div<div>","</div>"]);l.fn.extend({text:function(c){if(l.isFunction(c))return this.each(function(h){var n=l(this);n.text(c.call(this,h,n.text()))});if(typeof c!=="object"&&c!==f)return this.empty().append((this[0]&&this[0].ownerDocument||V).createTextNode(c));return l.text(this)},wrapAll:function(c){if(l.isFunction(c))return this.each(function(n){l(this).wrapAll(c.call(this,n))});if(this[0]){var h=l(c,this[0].ownerDocument).eq(0).clone(true);
this[0].parentNode&&h.insertBefore(this[0]);h.map(function(){for(var n=this;n.firstChild&&n.firstChild.nodeType===1;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(c){if(l.isFunction(c))return this.each(function(h){l(this).wrapInner(c.call(this,h))});return this.each(function(){var h=l(this),n=h.contents();n.length?n.wrapAll(c):h.append(c)})},wrap:function(c){return this.each(function(){l(this).wrapAll(c)})},unwrap:function(){return this.parent().each(function(){l.nodeName(this,
"body")||l(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.appendChild(c)})},prepend:function(){return this.domManip(arguments,true,function(c){this.nodeType===1&&this.insertBefore(c,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(h){this.parentNode.insertBefore(h,this)});if(arguments.length){var c=l(arguments[0]);c.push.apply(c,this.toArray());return this.pushStack(c,
"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(h){this.parentNode.insertBefore(h,this.nextSibling)});if(arguments.length){var c=this.pushStack(this,"after",arguments);c.push.apply(c,l(arguments[0]).toArray());return c}},remove:function(c,h){for(var n=0,u;(u=this[n])!=null;n++)if(!c||l.filter(c,[u]).length){!h&&u.nodeType===1&&(l.cleanData(u.getElementsByTagName("*")),l.cleanData([u]));u.parentNode&&u.parentNode.removeChild(u)}return this},
empty:function(){for(var c=0,h;(h=this[c])!=null;c++)for(h.nodeType===1&&l.cleanData(h.getElementsByTagName("*"));h.firstChild;)h.removeChild(h.firstChild);return this},clone:function(c,h){c=c==null?false:c;h=h==null?c:h;return this.map(function(){return l.clone(this,c,h)})},html:function(c){if(c===f)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(pa,""):null;if(typeof c!=="string"||db.test(c)||!l.support.leadingWhitespace&&hb.test(c)||na[(ja.exec(c)||["",""])[1].toLowerCase()])l.isFunction(c)?
this.each(function(z){var b=l(this);b.html(c.call(this,z,b.html()))}):this.empty().append(c);else{c=c.replace(X,"<$1></$2>");try{for(var h=0,n=this.length;h<n;h++)this[h].nodeType===1&&(l.cleanData(this[h].getElementsByTagName("*")),this[h].innerHTML=c)}catch(u){this.empty().append(c)}}return this},replaceWith:function(c){if(this[0]&&this[0].parentNode){if(l.isFunction(c))return this.each(function(h){var n=l(this),u=n.html();n.replaceWith(c.call(this,h,u))});typeof c!=="string"&&(c=l(c).detach());
return this.each(function(){var h=this.nextSibling,n=this.parentNode;l(this).remove();h?l(h).before(c):l(n).append(c)})}return this.length?this.pushStack(l(l.isFunction(c)?c():c),"replaceWith",c):this},detach:function(c){return this.remove(c,true)},domManip:function(c,h,n){var u,z,b,e=c[0],m=[];if(!l.support.checkClone&&arguments.length===3&&typeof e==="string"&&Fa.test(e))return this.each(function(){l(this).domManip(c,h,n,true)});if(l.isFunction(e))return this.each(function(o){var y=l(this);c[0]=
e.call(this,o,h?y.html():f);y.domManip(c,h,n)});if(this[0]){b=e&&e.parentNode;l.support.parentNode&&b&&b.nodeType===11&&b.childNodes.length===this.length?u={fragment:b}:u=l.buildFragment(c,this,m);b=u.fragment;b.childNodes.length===1?z=b=b.firstChild:z=b.firstChild;if(z){h=h&&l.nodeName(z,"tr");z=0;for(var p=this.length,q=p-1;z<p;z++)n.call(h?l.nodeName(this[z],"table")?this[z].getElementsByTagName("tbody")[0]||this[z].appendChild(this[z].ownerDocument.createElement("tbody")):this[z]:this[z],u.cacheable||
p>1&&z<q?l.clone(b,true,true):b)}m.length&&l.each(m,M)}return this}});l.buildFragment=function(c,h,n){var u,z,b;h=h&&h[0]?h[0].ownerDocument||h[0]:V;c.length===1&&typeof c[0]==="string"&&c[0].length<512&&h===V&&c[0].charAt(0)==="<"&&!db.test(c[0])&&(l.support.checkClone||!Fa.test(c[0]))&&(z=true,b=l.fragments[c[0]],b&&b!==1&&(u=b));u||(u=h.createDocumentFragment(),l.clean(c,h,u,n));z&&(l.fragments[c[0]]=b?u:1);return{fragment:u,cacheable:z}};l.fragments={};l.each({appendTo:"append",prependTo:"prepend",
insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(c,h){l.fn[c]=function(n){var u=[];n=l(n);var z=this.length===1&&this[0].parentNode;if(z&&z.nodeType===11&&z.childNodes.length===1&&n.length===1){n[h](this[0]);return this}z=0;for(var b=n.length;z<b;z++){var e=(z>0?this.clone(true):this).get();l(n[z])[h](e);u=u.concat(e)}return this.pushStack(u,c,n.selector)}});l.extend({clone:function(c,h,n){var u=c.cloneNode(true),z,b,e;if((!l.support.noCloneEvent||!l.support.noCloneChecked)&&
(c.nodeType===1||c.nodeType===11)&&!l.isXMLDoc(c)){S(c,u);z=Q(c);b=Q(u);for(e=0;z[e];++e)S(z[e],b[e])}if(h){W(c,u);if(n){z=Q(c);b=Q(u);for(e=0;z[e];++e)W(z[e],b[e])}}return u},clean:function(c,h,n,u){h=h||V;typeof h.createElement==="undefined"&&(h=h.ownerDocument||h[0]&&h[0].ownerDocument||V);for(var z=[],b=0,e;(e=c[b])!=null;b++){typeof e==="number"&&(e+="");if(e){if(typeof e!=="string"||Sa.test(e)){if(typeof e==="string"){e=e.replace(X,"<$1></$2>");var m=(ja.exec(e)||["",""])[1].toLowerCase(),p=
na[m]||na._default,q=p[0],o=h.createElement("div");for(o.innerHTML=p[1]+e+p[2];q--;)o=o.lastChild;if(!l.support.tbody){q=Ka.test(e);m=m==="table"&&!q?o.firstChild&&o.firstChild.childNodes:p[1]==="<table>"&&!q?o.childNodes:[];for(p=m.length-1;p>=0;--p)l.nodeName(m[p],"tbody")&&!m[p].childNodes.length&&m[p].parentNode.removeChild(m[p])}!l.support.leadingWhitespace&&hb.test(e)&&o.insertBefore(h.createTextNode(hb.exec(e)[0]),o.firstChild);e=o.childNodes}}else e=h.createTextNode(e);e.nodeType?z.push(e):
z=l.merge(z,e)}}if(n)for(b=0;z[b];b++)!u||!l.nodeName(z[b],"script")||z[b].type&&z[b].type.toLowerCase()!=="text/javascript"?(z[b].nodeType===1&&z.splice.apply(z,[b+1,0].concat(l.makeArray(z[b].getElementsByTagName("script")))),n.appendChild(z[b])):u.push(z[b].parentNode?z[b].parentNode.removeChild(z[b]):z[b]);return z},cleanData:function(c){for(var h,n,u=l.cache,z=l.expando,b=l.event.special,e=l.support.deleteExpando,m=0,p;(p=c[m])!=null;m++)if(!(p.nodeName&&l.noData[p.nodeName.toLowerCase()]))if(n=
p[l.expando]){if((h=u[n]&&u[n][z])&&h.events){for(var q in h.events)b[q]?l.event.remove(p,q):l.removeEvent(p,q,h.handle);h.handle&&(h.handle.elem=null)}e?delete p[l.expando]:p.removeAttribute&&p.removeAttribute(l.expando);delete u[n]}}});var bb=/alpha\([^)]*\)/i,ib=/opacity=([^)]*)/,eb=/-([a-z])/ig,nb=/([A-Z]|^ms)/g,Pa=/^-?\d+(?:px)?$/i,sb=/^-?\d/,Zb={position:"absolute",visibility:"hidden",display:"block"},Db=["Left","Right"],Yb=["Top","Bottom"],tb,ob,pb,Lb=function(c,h){return h.toUpperCase()};
l.fn.css=function(c,h){if(arguments.length===2&&h===f)return this;return l.access(this,c,h,true,function(n,u,z){return z!==f?l.style(n,u,z):l.css(n,u)})};l.extend({cssHooks:{opacity:{get:function(c,h){if(h){var n=tb(c,"opacity","opacity");return n===""?"1":n}return c.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,zoom:true,lineHeight:true},cssProps:{"float":l.support.cssFloat?"cssFloat":"styleFloat"},style:function(c,h,n,u){if(c&&c.nodeType!==3&&c.nodeType!==8&&c.style){var z,
b=l.camelCase(h),e=c.style,m=l.cssHooks[b];h=l.cssProps[b]||b;if(n===f){if(m&&"get"in m&&(z=m.get(c,false,u))!==f)return z;return e[h]}if(!(typeof n==="number"&&isNaN(n)||n==null)){typeof n==="number"&&!l.cssNumber[b]&&(n+="px");if(!m||!("set"in m)||(n=m.set(c,n))!==f)try{e[h]=n}catch(p){}}}},css:function(c,h,n){var u,z=l.camelCase(h),b=l.cssHooks[z];h=l.cssProps[z]||z;if(b&&"get"in b&&(u=b.get(c,true,n))!==f)return u;if(tb)return tb(c,h,z)},swap:function(c,h,n){var u={};for(var z in h){u[z]=c.style[z];
c.style[z]=h[z]}n.call(c);for(z in h)c.style[z]=u[z]},camelCase:function(c){return c.replace(eb,Lb)}});l.curCSS=l.css;l.each(["height","width"],function(c,h){l.cssHooks[h]={get:function(n,u,z){var b;if(u){n.offsetWidth!==0?b=K(n,h,z):l.swap(n,Zb,function(){b=K(n,h,z)});if(b<=0){b=tb(n,h,h);b==="0px"&&pb&&(b=pb(n,h,h));if(b!=null)return b===""||b==="auto"?"0px":b}if(b<0||b==null){b=n.style[h];return b===""||b==="auto"?"0px":b}return typeof b==="string"?b:b+"px"}},set:function(n,u){if(!Pa.test(u))return u;
u=parseFloat(u);if(u>=0)return u+"px"}}});l.support.opacity||(l.cssHooks.opacity={get:function(c,h){return ib.test((h&&c.currentStyle?c.currentStyle.filter:c.style.filter)||"")?parseFloat(RegExp.$1)/100+"":h?"1":""},set:function(c,h){var n=c.style;n.zoom=1;var u=l.isNaN(h)?"":"alpha(opacity="+h*100+")",z=n.filter||"";n.filter=bb.test(z)?z.replace(bb,u):n.filter+" "+u}});l(function(){l.support.reliableMarginRight||(l.cssHooks.marginRight={get:function(c,h){var n;l.swap(c,{display:"inline-block"},function(){h?
n=tb(c,"margin-right","marginRight"):n=c.style.marginRight});return n}})});V.defaultView&&V.defaultView.getComputedStyle&&(ob=function(c,h,n){var u;n=n.replace(nb,"-$1").toLowerCase();if(!(h=c.ownerDocument.defaultView))return f;if(h=h.getComputedStyle(c,null)){u=h.getPropertyValue(n);u===""&&!l.contains(c.ownerDocument.documentElement,c)&&(u=l.style(c,n))}return u});V.documentElement.currentStyle&&(pb=function(c,h){var n,u=c.currentStyle&&c.currentStyle[h],z=c.runtimeStyle&&c.runtimeStyle[h],b=c.style;
!Pa.test(u)&&sb.test(u)&&(n=b.left,z&&(c.runtimeStyle.left=c.currentStyle.left),b.left=h==="fontSize"?"1em":u||0,u=b.pixelLeft+"px",b.left=n,z&&(c.runtimeStyle.left=z));return u===""?"auto":u});tb=ob||pb;l.expr&&l.expr.filters&&(l.expr.filters.hidden=function(c){var h=c.offsetHeight;return c.offsetWidth===0&&h===0||!l.support.reliableHiddenOffsets&&(c.style.display||l.css(c,"display"))==="none"},l.expr.filters.visible=function(c){return!l.expr.filters.hidden(c)});var wb=/%20/g,Xb=/\[\]$/,xb=/\r?\n/g,
Pb=/#.*$/,Qb=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,oa=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Rb=/^(?:GET|HEAD)$/,yb=/^\/\//,Fb=/\?/,gb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,$b=/^(?:select|textarea)/i,ma=/\s+/,Sb=/([?&])_=[^&]*/,Tb=/(^|\-)([a-z])/g,Ub=function(c,h,n){return h+n.toUpperCase()},Mb=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Nb=l.fn.load,Cb={},Gb={},jb,qb;try{jb=V.location.href}catch(dc){jb=V.createElement("a");
jb.href="";jb=jb.href}qb=Mb.exec(jb.toLowerCase())||[];l.fn.extend({load:function(c,h,n){if(typeof c!=="string"&&Nb)return Nb.apply(this,arguments);if(!this.length)return this;var u=c.indexOf(" ");if(u>=0){var z=c.slice(u,c.length);c=c.slice(0,u)}u="GET";h&&(l.isFunction(h)?(n=h,h=f):typeof h==="object"&&(h=l.param(h,l.ajaxSettings.traditional),u="POST"));var b=this;l.ajax({url:c,type:u,dataType:"html",data:h,complete:function(e,m,p){p=e.responseText;e.isResolved()&&(e.done(function(q){p=q}),b.html(z?
l("<div>").append(p.replace(gb,"")).find(z):p));n&&b.each(n,[p,m,e])}});return this},serialize:function(){return l.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?l.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||$b.test(this.nodeName)||oa.test(this.type))}).map(function(c,h){var n=l(this).val();return n==null?null:l.isArray(n)?l.map(n,function(u){return{name:h.name,value:u.replace(xb,"\r\n")}}):
{name:h.name,value:n.replace(xb,"\r\n")}}).get()}});l.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(c,h){l.fn[h]=function(n){return this.bind(h,n)}});l.each(["get","post"],function(c,h){l[h]=function(n,u,z,b){l.isFunction(u)&&(b=b||z,z=u,u=f);return l.ajax({type:h,url:n,data:u,success:z,dataType:b})}});l.extend({getScript:function(c,h){return l.get(c,f,h,"script")},getJSON:function(c,h,n){return l.get(c,h,n,"json")},ajaxSetup:function(c,h){h?l.extend(true,
c,l.ajaxSettings,h):(h=c,c=l.extend(true,l.ajaxSettings,h));for(var n in{context:1,url:1})n in h?c[n]=h[n]:n in l.ajaxSettings&&(c[n]=l.ajaxSettings[n]);return c},ajaxSettings:{url:jb,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|widget):$/.test(qb[1]),global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,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":true,"text json":l.parseJSON,"text xml":l.parseXML}},ajaxPrefilter:H(Cb),ajaxTransport:H(Gb),ajax:function(c,h){function n(J,I,P,ea){if(T!==2){T=2;D&&clearTimeout(D);B=f;y=ea||"";t.readyState=J?4:0;var ga,ya,Ua;if(P){ea=u;var G=t,U=ea.contents,Y=ea.dataTypes,aa=ea.responseFields,qa,ta,La,Wa;for(ta in aa)ta in P&&(G[aa[ta]]=P[ta]);for(;Y[0]==="*";){Y.shift();qa===f&&(qa=ea.mimeType||
G.getResponseHeader("content-type"))}if(qa)for(ta in U)if(U[ta]&&U[ta].test(qa)){Y.unshift(ta);break}if(Y[0]in P)La=Y[0];else{for(ta in P){if(!Y[0]||ea.converters[ta+" "+Y[0]]){La=ta;break}Wa||(Wa=ta)}La=La||Wa}if(La){La!==Y[0]&&Y.unshift(La);P=P[La]}else P=void 0}else P=f;P=P;if(J>=200&&J<300||J===304){if(u.ifModified){if(qa=t.getResponseHeader("Last-Modified"))l.lastModified[q]=qa;if(qa=t.getResponseHeader("Etag"))l.etag[q]=qa}if(J===304){I="notmodified";ga=true}else try{qa=u;P=P;qa.dataFilter&&
(P=qa.dataFilter(P,qa.dataType));var Eb=qa.dataTypes;ta={};var mb,Vb,fc=Eb.length,Wb,ub=Eb[0],Hb,ac,vb,zb,Ib;for(mb=1;mb<fc;mb++){if(mb===1)for(Vb in qa.converters)typeof Vb==="string"&&(ta[Vb.toLowerCase()]=qa.converters[Vb]);Hb=ub;ub=Eb[mb];if(ub==="*")ub=Hb;else if(Hb!=="*"&&Hb!==ub){ac=Hb+" "+ub;vb=ta[ac]||ta["* "+ub];if(!vb){Ib=f;for(zb in ta){Wb=zb.split(" ");if(Wb[0]===Hb||Wb[0]==="*")if(Ib=ta[Wb[1]+" "+ub]){zb=ta[zb];zb===true?vb=Ib:Ib===true&&(vb=zb);break}}}!vb&&!Ib&&l.error("No conversion from "+
ac.replace(" "," to "));vb!==true&&(P=vb?vb(P):Ib(zb(P)))}}ya=P;I="success";ga=true}catch(gc){I="parsererror";Ua=gc}}else{Ua=I;if(!I||J){I="error";J<0&&(J=0)}}t.status=J;t.statusText=I;ga?e.resolveWith(z,[ya,I,t]):e.rejectWith(z,[t,I,Ua]);t.statusCode(p);p=f;da&&b.trigger("ajax"+(ga?"Success":"Error"),[t,u,ga?ya:Ua]);m.resolveWith(z,[t,I]);da&&(b.trigger("ajaxComplete",[t,u]),--l.active||l.event.trigger("ajaxStop"))}}typeof c==="object"&&(h=c,c=f);h=h||{};var u=l.ajaxSetup({},h),z=u.context||u,b=
z!==u&&(z.nodeType||z instanceof l)?l(z):l.event,e=l.Deferred(),m=l._Deferred(),p=u.statusCode||{},q,o={},y,A,B,D,O,T=0,da,ca,t={readyState:0,setRequestHeader:function(J,I){T||(o[J.toLowerCase().replace(Tb,Ub)]=I);return this},getAllResponseHeaders:function(){return T===2?y:null},getResponseHeader:function(J){var I;if(T===2){if(!A)for(A={};I=Qb.exec(y);)A[I[1].toLowerCase()]=I[2];I=A[J.toLowerCase()]}return I===f?null:I},overrideMimeType:function(J){T||(u.mimeType=J);return this},abort:function(J){J=
J||"abort";B&&B.abort(J);n(0,J);return this}};e.promise(t);t.success=t.done;t.error=t.fail;t.complete=m.done;t.statusCode=function(J){if(J){var I;if(T<2)for(I in J)p[I]=[p[I],J[I]];else{I=J[t.status];t.then(I,I)}}return this};u.url=((c||u.url)+"").replace(Pb,"").replace(yb,qb[1]+"//");u.dataTypes=l.trim(u.dataType||"*").toLowerCase().split(ma);u.crossDomain==null&&(O=Mb.exec(u.url.toLowerCase()),u.crossDomain=O&&(O[1]!=qb[1]||O[2]!=qb[2]||(O[3]||(O[1]==="http:"?80:443))!=(qb[3]||(qb[1]==="http:"?
80:443))));u.data&&u.processData&&typeof u.data!=="string"&&(u.data=l.param(u.data,u.traditional));F(Cb,u,h,t);if(T===2)return false;da=u.global;u.type=u.type.toUpperCase();u.hasContent=!Rb.test(u.type);da&&l.active++===0&&l.event.trigger("ajaxStart");if(!u.hasContent){u.data&&(u.url+=(Fb.test(u.url)?"&":"?")+u.data);q=u.url;if(u.cache===false){O=l.now();var E=u.url.replace(Sb,"$1_="+O);u.url=E+(E===u.url?(Fb.test(u.url)?"&":"?")+"_="+O:"")}}if(u.data&&u.hasContent&&u.contentType!==false||h.contentType)o["Content-Type"]=
u.contentType;u.ifModified&&(q=q||u.url,l.lastModified[q]&&(o["If-Modified-Since"]=l.lastModified[q]),l.etag[q]&&(o["If-None-Match"]=l.etag[q]));o.Accept=u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+(u.dataTypes[0]!=="*"?", */*; q=0.01":""):u.accepts["*"];for(ca in u.headers)t.setRequestHeader(ca,u.headers[ca]);if(u.beforeSend&&(u.beforeSend.call(z,t,u)===false||T===2)){t.abort();return false}for(ca in{success:1,error:1,complete:1})t[ca](u[ca]);if(B=F(Gb,u,h,t)){t.readyState=
1;da&&b.trigger("ajaxSend",[t,u]);u.async&&u.timeout>0&&(D=setTimeout(function(){t.abort("timeout")},u.timeout));try{T=1;B.send(o,n)}catch(L){status<2?n(-1,L):l.error(L)}}else n(-1,"No Transport");return t},param:function(c,h){var n=[],u=function(b,e){e=l.isFunction(e)?e():e;n[n.length]=encodeURIComponent(b)+"="+encodeURIComponent(e)};h===f&&(h=l.ajaxSettings.traditional);if(l.isArray(c)||c.jquery&&!l.isPlainObject(c))l.each(c,function(){u(this.name,this.value)});else for(var z in c)C(z,c[z],h,u);
return n.join("&").replace(wb,"+")}});l.extend({active:0,lastModified:{},etag:{}});var Ab=l.now(),kb=/(\=)\?(&|$)|\?\?/i;l.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return l.expando+"_"+Ab++}});l.ajaxPrefilter("json jsonp",function(c,h,n){var u=typeof c.data==="string";if(c.dataTypes[0]==="jsonp"||h.jsonpCallback||h.jsonp!=null||c.jsonp!==false&&(kb.test(c.url)||u&&kb.test(c.data))){var z,b=c.jsonpCallback=l.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,e=a[b];h=c.url;var m=
c.data,p="$1"+b+"$2",q=function(){a[b]=e;z&&l.isFunction(e)&&a[b](z[0])};c.jsonp!==false&&(h=h.replace(kb,p),c.url===h&&(u&&(m=m.replace(kb,p)),c.data===m&&(h+=(/\?/.test(h)?"&":"?")+c.jsonp+"="+b)));c.url=h;c.data=m;a[b]=function(o){z=[o]};n.then(q,q);c.converters["script json"]=function(){z||l.error(b+" was not called");return z[0]};c.dataTypes[0]="json";return"script"}});l.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},
converters:{"text script":function(c){l.globalEval(c);return c}}});l.ajaxPrefilter("script",function(c){c.cache===f&&(c.cache=false);c.crossDomain&&(c.type="GET",c.global=false)});l.ajaxTransport("script",function(c){if(c.crossDomain){var h,n=V.head||V.getElementsByTagName("head")[0]||V.documentElement;return{send:function(u,z){h=V.createElement("script");h.async="async";c.scriptCharset&&(h.charset=c.scriptCharset);h.src=c.url;h.onload=h.onreadystatechange=function(b,e){if(!h.readyState||/loaded|complete/.test(h.readyState)){h.onload=
h.onreadystatechange=null;n&&h.parentNode&&n.removeChild(h);h=f;e||z(200,"success")}};n.insertBefore(h,n.firstChild)},abort:function(){h&&h.onload(0,1)}}}});var bc=l.now(),rb;l.ajaxSettings.xhr=a.ActiveXObject?function(){var c;if(!(c=!this.isLocal&&r()))a:{try{c=new a.ActiveXObject("Microsoft.XMLHTTP");break a}catch(h){}c=void 0}return c}:r;ob=l.ajaxSettings.xhr();l.support.ajax=!!ob;l.support.cors=ob&&"withCredentials"in ob;ob=f;l.support.ajax&&l.ajaxTransport(function(c){if(!c.crossDomain||l.support.cors){var h;
return{send:function(n,u){var z=c.xhr(),b,e;c.username?z.open(c.type,c.url,c.async,c.username,c.password):z.open(c.type,c.url,c.async);if(c.xhrFields)for(e in c.xhrFields)z[e]=c.xhrFields[e];c.mimeType&&z.overrideMimeType&&z.overrideMimeType(c.mimeType);!c.crossDomain&&!n["X-Requested-With"]&&(n["X-Requested-With"]="XMLHttpRequest");try{for(e in n)z.setRequestHeader(e,n[e])}catch(m){}z.send(c.hasContent&&c.data||null);h=function(p,q){var o,y,A,B,D;try{if(h&&(q||z.readyState===4)){h=f;b&&(z.onreadystatechange=
l.noop,delete rb[b]);if(q)z.readyState!==4&&z.abort();else{o=z.status;A=z.getAllResponseHeaders();B={};(D=z.responseXML)&&D.documentElement&&(B.xml=D);B.text=z.responseText;try{y=z.statusText}catch(O){y=""}o||!c.isLocal||c.crossDomain?o===1223&&(o=204):o=B.text?200:404}}}catch(T){q||u(-1,T)}B&&u(o,y,B,A)};c.async&&z.readyState!==4?(rb||(rb={},v()),b=bc++,z.onreadystatechange=rb[b]=h):h()},abort:function(){h&&h(0,1)}}}});var Bb={},Za=/^(?:toggle|show|hide)$/,ec=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,Jb,
Kb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];l.fn.extend({show:function(c,h,n){if(c||c===0)return this.animate(s("show",3),c,h,n);n=0;for(var u=this.length;n<u;n++){c=this[n];h=c.style.display;!l._data(c,"olddisplay")&&h==="none"&&(h=c.style.display="");h===""&&l.css(c,"display")==="none"&&l._data(c,"olddisplay",k(c.nodeName))}for(n=0;n<u;n++){c=this[n];h=c.style.display;if(h===""||h==="none")c.style.display=
l._data(c,"olddisplay")||""}return this},hide:function(c,h,n){if(c||c===0)return this.animate(s("hide",3),c,h,n);c=0;for(h=this.length;c<h;c++){n=l.css(this[c],"display");n!=="none"&&!l._data(this[c],"olddisplay")&&l._data(this[c],"olddisplay",n)}for(c=0;c<h;c++)this[c].style.display="none";return this},_toggle:l.fn.toggle,toggle:function(c,h,n){var u=typeof c==="boolean";l.isFunction(c)&&l.isFunction(h)?this._toggle.apply(this,arguments):c==null||u?this.each(function(){var z=u?c:l(this).is(":hidden");
l(this)[z?"show":"hide"]()}):this.animate(s("toggle",3),c,h,n);return this},fadeTo:function(c,h,n,u){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:h},c,n,u)},animate:function(c,h,n,u){var z=l.speed(h,n,u);if(l.isEmptyObject(c))return this.each(z.complete);return this[z.queue===false?"each":"queue"](function(){var b=l.extend({},z),e,m=this.nodeType===1,p=m&&l(this).is(":hidden"),q=this;for(e in c){var o=l.camelCase(e);e!==o&&(c[o]=c[e],delete c[e],e=o);if(c[e]==="hide"&&
p||c[e]==="show"&&!p)return b.complete.call(this);if(m&&(e==="height"||e==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(l.css(this,"display")==="inline"&&l.css(this,"float")==="none")if(l.support.inlineBlockNeedsLayout)k(this.nodeName)==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1);else this.style.display="inline-block"}l.isArray(c[e])&&((b.specialEasing=b.specialEasing||{})[e]=c[e][1],c[e]=c[e][0])}b.overflow!=
null&&(this.style.overflow="hidden");b.curAnim=l.extend({},c);l.each(c,function(y,A){var B=new l.fx(q,b,y);if(Za.test(A))B[A==="toggle"?p?"show":"hide":A](c);else{var D=ec.exec(A),O=B.cur();if(D){var T=parseFloat(D[2]),da=D[3]||(l.cssNumber[y]?"":"px");da!=="px"&&(l.style(q,y,(T||1)+da),O=(T||1)/B.cur()*O,l.style(q,y,O+da));D[1]&&(T=(D[1]==="-="?-1:1)*T+O);B.custom(O,T,da)}else B.custom(O,A,"")}});return true})},stop:function(c,h){var n=l.timers;c&&this.queue([]);this.each(function(){for(var u=n.length-
1;u>=0;u--)n[u].elem===this&&(h&&n[u](true),n.splice(u,1))});h||this.dequeue();return this}});l.each({slideDown:s("show",1),slideUp:s("hide",1),slideToggle:s("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(c,h){l.fn[c]=function(n,u,z){return this.animate(h,n,u,z)}});l.extend({speed:function(c,h,n){var u=c&&typeof c==="object"?l.extend({},c):{complete:n||!n&&h||l.isFunction(c)&&c,duration:c,easing:n&&h||h&&!l.isFunction(h)&&h};u.duration=l.fx.off?
0:typeof u.duration==="number"?u.duration:u.duration in l.fx.speeds?l.fx.speeds[u.duration]:l.fx.speeds._default;u.old=u.complete;u.complete=function(){u.queue!==false&&l(this).dequeue();l.isFunction(u.old)&&u.old.call(this)};return u},easing:{linear:function(c,h,n,u){return n+u*c},swing:function(c,h,n,u){return(-Math.cos(c*Math.PI)/2+0.5)*u+n}},timers:[],fx:function(c,h,n){this.options=h;this.elem=c;this.prop=n;h.orig||(h.orig={})}});l.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,
this.now,this);(l.fx.step[this.prop]||l.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 c,h=l.css(this.elem,this.prop);return isNaN(c=parseFloat(h))?!h||h==="auto"?0:h:c},custom:function(c,h,n){function u(e){return z.step(e)}var z=this,b=l.fx;this.startTime=l.now();this.start=c;this.end=h;this.unit=n||this.unit||(l.cssNumber[this.prop]?"":"px");this.now=this.start;this.pos=this.state=0;u.elem=
this.elem;u()&&l.timers.push(u)&&!Jb&&(Jb=setInterval(b.tick,b.interval))},show:function(){this.options.orig[this.prop]=l.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());l(this.elem).show()},hide:function(){this.options.orig[this.prop]=l.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var h=l.now(),n=true;if(c||h>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=
1;this.update();this.options.curAnim[this.prop]=true;for(var u in this.options.curAnim)this.options.curAnim[u]!==true&&(n=false);if(n){if(this.options.overflow!=null&&!l.support.shrinkWrapBlocks){var z=this.elem,b=this.options;l.each(["","X","Y"],function(m,p){z.style["overflow"+p]=b.overflow[m]})}this.options.hide&&l(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)l.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}c=
h-this.startTime;this.state=c/this.options.duration;h=this.options.easing||(l.easing.swing?"swing":"linear");this.pos=l.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||h](this.state,c,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update();return true}};l.extend(l.fx,{tick:function(){for(var c=l.timers,h=0;h<c.length;h++)c[h]()||c.splice(h--,1);c.length||l.fx.stop()},interval:13,stop:function(){clearInterval(Jb);Jb=null},speeds:{slow:600,
fast:200,_default:400},step:{opacity:function(c){l.style(c.elem,"opacity",c.now)},_default:function(c){c.elem.style&&c.elem.style[c.prop]!=null?c.elem.style[c.prop]=(c.prop==="width"||c.prop==="height"?Math.max(0,c.now):c.now)+c.unit:c.elem[c.prop]=c.now}}});l.expr&&l.expr.filters&&(l.expr.filters.animated=function(c){return l.grep(l.timers,function(h){return c===h.elem}).length});var cc=/^t(?:able|d|h)$/i,Ob=/^(?:body|html)$/i;"getBoundingClientRect"in V.documentElement?l.fn.offset=function(c){var h=
this[0],n;if(c)return this.each(function(e){l.offset.setOffset(this,c,e)});if(!h||!h.ownerDocument)return null;if(h===h.ownerDocument.body)return l.offset.bodyOffset(h);try{n=h.getBoundingClientRect()}catch(u){}var z=h.ownerDocument,b=z.documentElement;if(!n||!l.contains(b,h))return n?{top:n.top,left:n.left}:{top:0,left:0};h=z.body;z=g(z);return{top:n.top+(z.pageYOffset||l.support.boxModel&&b.scrollTop||h.scrollTop)-(b.clientTop||h.clientTop||0),left:n.left+(z.pageXOffset||l.support.boxModel&&b.scrollLeft||
h.scrollLeft)-(b.clientLeft||h.clientLeft||0)}}:l.fn.offset=function(c){var h=this[0];if(c)return this.each(function(o){l.offset.setOffset(this,c,o)});if(!h||!h.ownerDocument)return null;if(h===h.ownerDocument.body)return l.offset.bodyOffset(h);l.offset.initialize();var n,u=h.offsetParent,z=h,b=h.ownerDocument,e=b.documentElement,m=b.body;n=(b=b.defaultView)?b.getComputedStyle(h,null):h.currentStyle;for(var p=h.offsetTop,q=h.offsetLeft;(h=h.parentNode)&&h!==m&&h!==e;){if(l.offset.supportsFixedPosition&&
n.position==="fixed")break;n=b?b.getComputedStyle(h,null):h.currentStyle;p-=h.scrollTop;q-=h.scrollLeft;h===u&&(p+=h.offsetTop,q+=h.offsetLeft,l.offset.doesNotAddBorder&&(!l.offset.doesAddBorderForTableAndCells||!cc.test(h.nodeName))&&(p+=parseFloat(n.borderTopWidth)||0,q+=parseFloat(n.borderLeftWidth)||0),z=u,u=h.offsetParent);l.offset.subtractsBorderForOverflowNotVisible&&n.overflow!=="visible"&&(p+=parseFloat(n.borderTopWidth)||0,q+=parseFloat(n.borderLeftWidth)||0);n=n}if(n.position==="relative"||
n.position==="static"){p+=m.offsetTop;q+=m.offsetLeft}l.offset.supportsFixedPosition&&n.position==="fixed"&&(p+=Math.max(e.scrollTop,m.scrollTop),q+=Math.max(e.scrollLeft,m.scrollLeft));return{top:p,left:q}};l.offset={initialize:function(){var c=V.body,h=V.createElement("div"),n,u,z,b=parseFloat(l.css(c,"marginTop"))||0;l.extend(h.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});h.innerHTML="<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>";
c.insertBefore(h,c.firstChild);n=h.firstChild;u=n.firstChild;z=n.nextSibling.firstChild.firstChild;this.doesNotAddBorder=u.offsetTop!==5;this.doesAddBorderForTableAndCells=z.offsetTop===5;u.style.position="fixed";u.style.top="20px";this.supportsFixedPosition=u.offsetTop===20||u.offsetTop===15;u.style.position=u.style.top="";n.style.overflow="hidden";n.style.position="relative";this.subtractsBorderForOverflowNotVisible=u.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=c.offsetTop!==b;c.removeChild(h);
l.offset.initialize=l.noop},bodyOffset:function(c){var h=c.offsetTop,n=c.offsetLeft;l.offset.initialize();l.offset.doesNotIncludeMarginInBodyOffset&&(h+=parseFloat(l.css(c,"marginTop"))||0,n+=parseFloat(l.css(c,"marginLeft"))||0);return{top:h,left:n}},setOffset:function(c,h,n){var u=l.css(c,"position");u==="static"&&(c.style.position="relative");var z=l(c),b=z.offset(),e=l.css(c,"top"),m=l.css(c,"left"),p=(u==="absolute"||u==="fixed")&&l.inArray("auto",[e,m])>-1;u={};var q={};p&&(q=z.position());
e=p?q.top:parseInt(e,10)||0;m=p?q.left:parseInt(m,10)||0;l.isFunction(h)&&(h=h.call(c,n,b));h.top!=null&&(u.top=h.top-b.top+e);h.left!=null&&(u.left=h.left-b.left+m);"using"in h?h.using.call(c,u):z.css(u)}};l.fn.extend({position:function(){if(!this[0])return null;var c=this[0],h=this.offsetParent(),n=this.offset(),u=Ob.test(h[0].nodeName)?{top:0,left:0}:h.offset();n.top-=parseFloat(l.css(c,"marginTop"))||0;n.left-=parseFloat(l.css(c,"marginLeft"))||0;u.top+=parseFloat(l.css(h[0],"borderTopWidth"))||
0;u.left+=parseFloat(l.css(h[0],"borderLeftWidth"))||0;return{top:n.top-u.top,left:n.left-u.left}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent||V.body;c&&!Ob.test(c.nodeName)&&l.css(c,"position")==="static";)c=c.offsetParent;return c})}});l.each(["Left","Top"],function(c,h){var n="scroll"+h;l.fn[n]=function(u){var z=this[0],b;if(!z)return null;if(u!==f)return this.each(function(){(b=g(this))?b.scrollTo(c?l(b).scrollLeft():u,c?u:l(b).scrollTop()):this[n]=u});return(b=
g(z))?"pageXOffset"in b?b[c?"pageYOffset":"pageXOffset"]:l.support.boxModel&&b.document.documentElement[n]||b.document.body[n]:z[n]}});l.each(["Height","Width"],function(c,h){var n=h.toLowerCase();l.fn["inner"+h]=function(){return this[0]?parseFloat(l.css(this[0],n,"padding")):null};l.fn["outer"+h]=function(u){return this[0]?parseFloat(l.css(this[0],n,u?"margin":"border")):null};l.fn[n]=function(u){var z=this[0];if(!z)return u==null?null:this;if(l.isFunction(u))return this.each(function(e){var m=
l(this);m[n](u.call(this,e,m[n]()))});if(l.isWindow(z)){var b=z.document.documentElement["client"+h];return z.document.compatMode==="CSS1Compat"&&b||z.document.body["client"+h]||b}if(z.nodeType===9)return Math.max(z.documentElement["client"+h],z.body["scroll"+h],z.documentElement["scroll"+h],z.body["offset"+h],z.documentElement["offset"+h]);if(u===f){z=l.css(z,n);b=parseFloat(z);return l.isNaN(b)?z:b}return this.css(n,typeof u==="string"?u:u+"px")}});a.jQuery=a.$=l})(window);var Class={create:function(){function a(){this.initialize.apply(this,arguments)}var f=null,g=$A(arguments);if(Object.isFunction(g[0]))f=g.shift();Object.extend(a,Class.Methods);a.superclass=f;a.subclasses=[];if(f){var k=function(){};k.prototype=f.prototype;a.prototype=new k;f.subclasses.push(a)}for(f=0;f<g.length;f++)a.addMethods(g[f]);if(!a.prototype.initialize)a.prototype.initialize=this.emptyFunction;return a.prototype.constructor=a},emptyFunction:function(){}};
Class.Methods={addMethods:function(a){var f=this.superclass&&this.superclass.prototype,g=Object.keys(a);Object.keys({toString:true}).length||g.push("toString","valueOf");for(var k=0,s=g.length;k<s;k++){var r=g[k],v=a[r];if(f&&Object.isFunction(v)&&v.argumentNames().first()=="$super"){var C=v;v=Object.extend(function(F){return function(){return f[F].apply(this,arguments)}}(r).wrap(C),{valueOf:function(){return C},toString:function(){return C.toString()}})}this.prototype[r]=v}return this}};
Object.extend=function(a,f){for(var g in f)a[g]=f[g];return a};
Object.extend(Object,{inspect:function(a){try{if(Object.isUndefined(a))return"undefined";if(a===null)return"null";return a.inspect?a.inspect():String(a)}catch(f){if(f instanceof RangeError)return"...";throw f;}},toJSON:function(a){switch(typeof a){case "undefined":case "function":case "unknown":return;case "boolean":return a.toString()}if(a===null)return"null";if(a.toJSON)return a.toJSON();if(!Object.isElement(a)){var f=[];for(var g in a){var k=Object.toJSON(a[g]);Object.isUndefined(k)||f.push(g.toJSON()+
": "+k)}return"{"+f.join(", ")+"}"}},toQueryString:function(a){return $H(a).toQueryString()},toHTML:function(a){return a&&a.toHTML?a.toHTML():String.interpret(a)},keys:function(a){var f=[];for(var g in a)f.push(g);return f},values:function(a){var f=[];for(var g in a)f.push(a[g]);return f},clone:function(a){return Object.extend({},a)},isElement:function(a){return a&&a.nodeType==1},isArray:function(a){return a!=null&&typeof a=="object"&&"splice"in a&&"join"in a},isHash:function(a){return a instanceof
Hash},isFunction:function(a){return typeof a=="function"},isString:function(a){return typeof a=="string"},isNumber:function(a){return typeof a=="number"},isUndefined:function(a){return typeof a=="undefined"}});function $A(a){if(!a)return[];if(a.toArray)return a.toArray();for(var f=a.length||0,g=Array(f);f--;)g[f]=a[f];return g}
if(WebKit=navigator.userAgent.indexOf("AppleWebKit/")>-1)$A=function(a){if(!a)return[];if(!(Object.isFunction(a)&&a=="[object NodeList]")&&a.toArray)return a.toArray();for(var f=a.length||0,g=Array(f);f--;)g[f]=a[f];return g};var b2Settings=Class.create();b2Settings.prototype={initialize:function(){}};b2Settings.USHRT_MAX=65535;b2Settings.b2_pi=Math.PI;b2Settings.b2_massUnitsPerKilogram=1;b2Settings.b2_timeUnitsPerSecond=1;b2Settings.b2_lengthUnitsPerMeter=30;b2Settings.b2_maxManifoldPoints=2;
b2Settings.b2_maxShapesPerBody=64;b2Settings.b2_maxPolyVertices=8;b2Settings.b2_maxProxies=1024;b2Settings.b2_maxPairs=8*b2Settings.b2_maxProxies;b2Settings.b2_linearSlop=0.0050*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_angularSlop=2/180*b2Settings.b2_pi;b2Settings.b2_velocityThreshold=1*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_maxLinearCorrection=0.2*b2Settings.b2_lengthUnitsPerMeter;b2Settings.b2_maxAngularCorrection=8/180*b2Settings.b2_pi;
b2Settings.b2_contactBaumgarte=0.2;b2Settings.b2_timeToSleep=0.5*b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_linearSleepTolerance=0.01*b2Settings.b2_lengthUnitsPerMeter/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2_angularSleepTolerance=2/180/b2Settings.b2_timeUnitsPerSecond;b2Settings.b2Assert=function(a){a||(void 0).x++};var b2Vec2=Class.create();
b2Vec2.prototype={initialize:function(a,f){this.x=a;this.y=f},SetZero:function(){this.y=this.x=0},Set:function(a,f){this.x=a;this.y=f},SetV:function(a){this.x=a.x;this.y=a.y},Negative:function(){return new b2Vec2(-this.x,-this.y)},Copy:function(){return new b2Vec2(this.x,this.y)},Add:function(a){this.x+=a.x;this.y+=a.y},Subtract:function(a){this.x-=a.x;this.y-=a.y},Multiply:function(a){this.x*=a;this.y*=a},MulM:function(a){var f=this.x;this.x=a.col1.x*f+a.col2.x*this.y;this.y=a.col1.y*f+a.col2.y*
this.y},MulTM:function(a){var f=b2Math.b2Dot(this,a.col1);this.y=b2Math.b2Dot(this,a.col2);this.x=f},CrossVF:function(a){var f=this.x;this.x=a*this.y;this.y=-a*f},CrossFV:function(a){var f=this.x;this.x=-a*this.y;this.y=a*f},MinV:function(a){this.x=this.x<a.x?this.x:a.x;this.y=this.y<a.y?this.y:a.y},MaxV:function(a){this.x=this.x>a.x?this.x:a.x;this.y=this.y>a.y?this.y:a.y},Abs:function(){this.x=Math.abs(this.x);this.y=Math.abs(this.y)},Length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},
Normalize:function(){var a=this.Length();if(a<Number.MIN_VALUE)return 0;var f=1/a;this.x*=f;this.y*=f;return a},IsValid:function(){return b2Math.b2IsValid(this.x)&&b2Math.b2IsValid(this.y)},x:null,y:null};b2Vec2.Make=function(a,f){return new b2Vec2(a,f)};var b2Mat22=Class.create();
b2Mat22.prototype={initialize:function(a,f,g){if(a==null)a=0;this.col1=new b2Vec2;this.col2=new b2Vec2;if(f!=null&&g!=null){this.col1.SetV(f);this.col2.SetV(g)}else{f=Math.cos(a);a=Math.sin(a);this.col1.x=f;this.col2.x=-a;this.col1.y=a;this.col2.y=f}},Set:function(a){var f=Math.cos(a);a=Math.sin(a);this.col1.x=f;this.col2.x=-a;this.col1.y=a;this.col2.y=f},SetVV:function(a,f){this.col1.SetV(a);this.col2.SetV(f)},Copy:function(){return new b2Mat22(0,this.col1,this.col2)},SetM:function(a){this.col1.SetV(a.col1);
this.col2.SetV(a.col2)},AddM:function(a){this.col1.x+=a.col1.x;this.col1.y+=a.col1.y;this.col2.x+=a.col2.x;this.col2.y+=a.col2.y},SetIdentity:function(){this.col1.x=1;this.col2.x=0;this.col1.y=0;this.col2.y=1},SetZero:function(){this.col1.x=0;this.col2.x=0;this.col1.y=0;this.col2.y=0},Invert:function(a){var f=this.col1.x,g=this.col2.x,k=this.col1.y,s=this.col2.y,r=f*s-g*k;r=1/r;a.col1.x=r*s;a.col2.x=-r*g;a.col1.y=-r*k;a.col2.y=r*f;return a},Solve:function(a,f,g){var k=this.col1.x,s=this.col2.x,r=
this.col1.y,v=this.col2.y,C=k*v-s*r;C=1/C;a.x=C*(v*f-s*g);a.y=C*(k*g-r*f);return a},Abs:function(){this.col1.Abs();this.col2.Abs()},col1:new b2Vec2,col2:new b2Vec2};var b2Math=Class.create();b2Math.prototype={initialize:function(){}};b2Math.b2IsValid=function(a){return isFinite(a)};b2Math.b2Dot=function(a,f){return a.x*f.x+a.y*f.y};b2Math.b2CrossVV=function(a,f){return a.x*f.y-a.y*f.x};b2Math.b2CrossVF=function(a,f){return new b2Vec2(f*a.y,-f*a.x)};
b2Math.b2CrossFV=function(a,f){return new b2Vec2(-a*f.y,a*f.x)};b2Math.b2MulMV=function(a,f){return new b2Vec2(a.col1.x*f.x+a.col2.x*f.y,a.col1.y*f.x+a.col2.y*f.y)};b2Math.b2MulTMV=function(a,f){return new b2Vec2(b2Math.b2Dot(f,a.col1),b2Math.b2Dot(f,a.col2))};b2Math.AddVV=function(a,f){return new b2Vec2(a.x+f.x,a.y+f.y)};b2Math.SubtractVV=function(a,f){return new b2Vec2(a.x-f.x,a.y-f.y)};b2Math.MulFV=function(a,f){return new b2Vec2(a*f.x,a*f.y)};
b2Math.AddMM=function(a,f){return new b2Mat22(0,b2Math.AddVV(a.col1,f.col1),b2Math.AddVV(a.col2,f.col2))};b2Math.b2MulMM=function(a,f){return new b2Mat22(0,b2Math.b2MulMV(a,f.col1),b2Math.b2MulMV(a,f.col2))};b2Math.b2MulTMM=function(a,f){var g=new b2Vec2(b2Math.b2Dot(a.col1,f.col1),b2Math.b2Dot(a.col2,f.col1)),k=new b2Vec2(b2Math.b2Dot(a.col1,f.col2),b2Math.b2Dot(a.col2,f.col2));return new b2Mat22(0,g,k)};b2Math.b2Abs=function(a){return a>0?a:-a};
b2Math.b2AbsV=function(a){return new b2Vec2(b2Math.b2Abs(a.x),b2Math.b2Abs(a.y))};b2Math.b2AbsM=function(a){return new b2Mat22(0,b2Math.b2AbsV(a.col1),b2Math.b2AbsV(a.col2))};b2Math.b2Min=function(a,f){return a<f?a:f};b2Math.b2MinV=function(a,f){return new b2Vec2(b2Math.b2Min(a.x,f.x),b2Math.b2Min(a.y,f.y))};b2Math.b2Max=function(a,f){return a>f?a:f};b2Math.b2MaxV=function(a,f){return new b2Vec2(b2Math.b2Max(a.x,f.x),b2Math.b2Max(a.y,f.y))};
b2Math.b2Clamp=function(a,f,g){return b2Math.b2Max(f,b2Math.b2Min(a,g))};b2Math.b2ClampV=function(a,f,g){return b2Math.b2MaxV(f,b2Math.b2MinV(a,g))};b2Math.b2Swap=function(a,f){var g=a[0];a[0]=f[0];f[0]=g};b2Math.b2Random=function(){return Math.random()*2-1};b2Math.b2NextPowerOfTwo=function(a){a|=a>>1&2147483647;a|=a>>2&1073741823;a|=a>>4&268435455;a|=a>>8&16777215;a|=a>>16&65535;return a+1};b2Math.b2IsPowerOfTwo=function(a){return a>0&&(a&a-1)==0};b2Math.tempVec2=new b2Vec2;b2Math.tempVec3=new b2Vec2;
b2Math.tempVec4=new b2Vec2;b2Math.tempVec5=new b2Vec2;b2Math.tempMat=new b2Mat22;var b2AABB=Class.create();b2AABB.prototype={IsValid:function(){var a=this.maxVertex.x,f=this.maxVertex.y;a=this.maxVertex.x;f=this.maxVertex.y;a-=this.minVertex.x;f-=this.minVertex.y;return a>=0&&f>=0&&this.minVertex.IsValid()&&this.maxVertex.IsValid()},minVertex:new b2Vec2,maxVertex:new b2Vec2,initialize:function(){this.minVertex=new b2Vec2;this.maxVertex=new b2Vec2}};var b2Bound=Class.create();
b2Bound.prototype={IsLower:function(){return(this.value&1)==0},IsUpper:function(){return(this.value&1)==1},Swap:function(a){var f=this.value,g=this.proxyId,k=this.stabbingCount;this.value=a.value;this.proxyId=a.proxyId;this.stabbingCount=a.stabbingCount;a.value=f;a.proxyId=g;a.stabbingCount=k},value:0,proxyId:0,stabbingCount:0,initialize:function(){}};var b2BoundValues=Class.create();
b2BoundValues.prototype={lowerValues:[0,0],upperValues:[0,0],initialize:function(){this.lowerValues=[0,0];this.upperValues=[0,0]}};var b2Pair=Class.create();
b2Pair.prototype={SetBuffered:function(){this.status|=b2Pair.e_pairBuffered},ClearBuffered:function(){this.status&=~b2Pair.e_pairBuffered},IsBuffered:function(){return(this.status&b2Pair.e_pairBuffered)==b2Pair.e_pairBuffered},SetRemoved:function(){this.status|=b2Pair.e_pairRemoved},ClearRemoved:function(){this.status&=~b2Pair.e_pairRemoved},IsRemoved:function(){return(this.status&b2Pair.e_pairRemoved)==b2Pair.e_pairRemoved},SetFinal:function(){this.status|=b2Pair.e_pairFinal},IsFinal:function(){return(this.status&
b2Pair.e_pairFinal)==b2Pair.e_pairFinal},userData:null,proxyId1:0,proxyId2:0,next:0,status:0,initialize:function(){}};b2Pair.b2_nullPair=b2Settings.USHRT_MAX;b2Pair.b2_nullProxy=b2Settings.USHRT_MAX;b2Pair.b2_tableCapacity=b2Settings.b2_maxPairs;b2Pair.b2_tableMask=b2Pair.b2_tableCapacity-1;b2Pair.e_pairBuffered=1;b2Pair.e_pairRemoved=2;b2Pair.e_pairFinal=4;var b2PairCallback=Class.create();b2PairCallback.prototype={PairAdded:function(){return null},PairRemoved:function(){},initialize:function(){}};
var b2BufferedPair=Class.create();b2BufferedPair.prototype={proxyId1:0,proxyId2:0,initialize:function(){}};var b2PairManager=Class.create();
b2PairManager.prototype={initialize:function(){var a=0;this.m_hashTable=Array(b2Pair.b2_tableCapacity);for(a=0;a<b2Pair.b2_tableCapacity;++a)this.m_hashTable[a]=b2Pair.b2_nullPair;this.m_pairs=Array(b2Settings.b2_maxPairs);for(a=0;a<b2Settings.b2_maxPairs;++a)this.m_pairs[a]=new b2Pair;this.m_pairBuffer=Array(b2Settings.b2_maxPairs);for(a=0;a<b2Settings.b2_maxPairs;++a)this.m_pairBuffer[a]=new b2BufferedPair;for(a=0;a<b2Settings.b2_maxPairs;++a){this.m_pairs[a].proxyId1=b2Pair.b2_nullProxy;this.m_pairs[a].proxyId2=
b2Pair.b2_nullProxy;this.m_pairs[a].userData=null;this.m_pairs[a].status=0;this.m_pairs[a].next=a+1}this.m_pairs[b2Settings.b2_maxPairs-1].next=b2Pair.b2_nullPair;this.m_pairCount=0},Initialize:function(a,f){this.m_broadPhase=a;this.m_callback=f},AddBufferedPair:function(a,f){var g=this.AddPair(a,f);if(g.IsBuffered()==false){g.SetBuffered();this.m_pairBuffer[this.m_pairBufferCount].proxyId1=g.proxyId1;this.m_pairBuffer[this.m_pairBufferCount].proxyId2=g.proxyId2;++this.m_pairBufferCount}g.ClearRemoved();
b2BroadPhase.s_validate&&this.ValidateBuffer()},RemoveBufferedPair:function(a,f){var g=this.Find(a,f);if(g!=null){if(g.IsBuffered()==false){g.SetBuffered();this.m_pairBuffer[this.m_pairBufferCount].proxyId1=g.proxyId1;this.m_pairBuffer[this.m_pairBufferCount].proxyId2=g.proxyId2;++this.m_pairBufferCount}g.SetRemoved();b2BroadPhase.s_validate&&this.ValidateBuffer()}},Commit:function(){var a=0,f=0,g=this.m_broadPhase.m_proxyPool;for(a=0;a<this.m_pairBufferCount;++a){var k=this.Find(this.m_pairBuffer[a].proxyId1,
this.m_pairBuffer[a].proxyId2);k.ClearBuffered();var s=g[k.proxyId1],r=g[k.proxyId2];if(k.IsRemoved()){k.IsFinal()==true&&this.m_callback.PairRemoved(s.userData,r.userData,k.userData);this.m_pairBuffer[f].proxyId1=k.proxyId1;this.m_pairBuffer[f].proxyId2=k.proxyId2;++f}else if(k.IsFinal()==false){k.userData=this.m_callback.PairAdded(s.userData,r.userData);k.SetFinal()}}for(a=0;a<f;++a)this.RemovePair(this.m_pairBuffer[a].proxyId1,this.m_pairBuffer[a].proxyId2);this.m_pairBufferCount=0;b2BroadPhase.s_validate&&
this.ValidateTable()},AddPair:function(a,f){if(a>f){var g=a;a=f;f=g}g=b2PairManager.Hash(a,f)&b2Pair.b2_tableMask;var k=k=this.FindHash(a,f,g);if(k!=null)return k;var s=this.m_freePair;k=this.m_pairs[s];this.m_freePair=k.next;k.proxyId1=a;k.proxyId2=f;k.status=0;k.userData=null;k.next=this.m_hashTable[g];this.m_hashTable[g]=s;++this.m_pairCount;return k},RemovePair:function(a,f){if(a>f){var g=a;a=f;f=g}for(var k=b2PairManager.Hash(a,f)&b2Pair.b2_tableMask,s=this.m_hashTable[k],r=null;s!=b2Pair.b2_nullPair;)if(b2PairManager.Equals(this.m_pairs[s],
a,f)){g=s;if(r)r.next=this.m_pairs[s].next;else this.m_hashTable[k]=this.m_pairs[s].next;k=this.m_pairs[g];s=k.userData;k.next=this.m_freePair;k.proxyId1=b2Pair.b2_nullProxy;k.proxyId2=b2Pair.b2_nullProxy;k.userData=null;k.status=0;this.m_freePair=g;--this.m_pairCount;return s}else{r=this.m_pairs[s];s=r.next}return null},Find:function(a,f){if(a>f){var g=a;a=f;f=g}g=b2PairManager.Hash(a,f)&b2Pair.b2_tableMask;return this.FindHash(a,f,g)},FindHash:function(a,f,g){for(g=this.m_hashTable[g];g!=b2Pair.b2_nullPair&&
b2PairManager.Equals(this.m_pairs[g],a,f)==false;)g=this.m_pairs[g].next;if(g==b2Pair.b2_nullPair)return null;return this.m_pairs[g]},ValidateBuffer:function(){},ValidateTable:function(){},m_broadPhase:null,m_callback:null,m_pairs:null,m_freePair:0,m_pairCount:0,m_pairBuffer:null,m_pairBufferCount:0,m_hashTable:null};b2PairManager.Hash=function(a,f){var g=f<<16&4294901760|a;g=~g+(g<<15&4294934528);g^=g>>12&1048575;g+=g<<2&4294967292;g^=g>>4&268435455;g*=2057;g^=g>>16&65535;return g};
b2PairManager.Equals=function(a,f,g){return a.proxyId1==f&&a.proxyId2==g};b2PairManager.EqualsPair=function(a,f){return a.proxyId1==f.proxyId1&&a.proxyId2==f.proxyId2};var b2BroadPhase=Class.create();
b2BroadPhase.prototype={initialize:function(a,f){this.m_pairManager=new b2PairManager;this.m_proxyPool=Array(b2Settings.b2_maxPairs);this.m_bounds=Array(2*b2Settings.b2_maxProxies);this.m_queryResults=Array(b2Settings.b2_maxProxies);this.m_quantizationFactor=new b2Vec2;var g=0;this.m_pairManager.Initialize(this,f);this.m_worldAABB=a;for(g=this.m_proxyCount=0;g<b2Settings.b2_maxProxies;g++)this.m_queryResults[g]=0;this.m_bounds=Array(2);for(g=0;g<2;g++){this.m_bounds[g]=Array(2*b2Settings.b2_maxProxies);
for(var k=0;k<2*b2Settings.b2_maxProxies;k++)this.m_bounds[g][k]=new b2Bound}g=a.maxVertex.x;k=a.maxVertex.y;g-=a.minVertex.x;k-=a.minVertex.y;this.m_quantizationFactor.x=b2Settings.USHRT_MAX/g;this.m_quantizationFactor.y=b2Settings.USHRT_MAX/k;for(g=0;g<b2Settings.b2_maxProxies-1;++g){k=new b2Proxy;this.m_proxyPool[g]=k;k.SetNext(g+1);k.timeStamp=0;k.overlapCount=b2BroadPhase.b2_invalid;k.userData=null}k=new b2Proxy;this.m_proxyPool[b2Settings.b2_maxProxies-1]=k;k.SetNext(b2Pair.b2_nullProxy);k.timeStamp=
0;k.overlapCount=b2BroadPhase.b2_invalid;k.userData=null;this.m_freeProxy=0;this.m_timeStamp=1;this.m_queryResultCount=0},InRange:function(a){var f,g,k,s;f=a.minVertex.x;g=a.minVertex.y;f-=this.m_worldAABB.maxVertex.x;g-=this.m_worldAABB.maxVertex.y;k=this.m_worldAABB.minVertex.x;s=this.m_worldAABB.minVertex.y;k-=a.maxVertex.x;s-=a.maxVertex.y;f=b2Math.b2Max(f,k);g=b2Math.b2Max(g,s);return b2Math.b2Max(f,g)<0},GetProxy:function(a){if(a==b2Pair.b2_nullProxy||this.m_proxyPool[a].IsValid()==false)return null;
return this.m_proxyPool[a]},CreateProxy:function(a,f){var g=0,k,s=this.m_freeProxy;k=this.m_proxyPool[s];this.m_freeProxy=k.GetNext();k.overlapCount=0;k.userData=f;k=2*this.m_proxyCount;var r=[],v=[];this.ComputeBounds(r,v,a);for(var C=0;C<2;++C){var F=this.m_bounds[C],H=0,K=0;H=[H];K=[K];this.Query(H,K,r[C],v[C],F,k,C);H=H[0];K=K[0];g=[];var M=0,Q=k-K,S,W;for(M=0;M<Q;M++){g[M]=new b2Bound;S=g[M];W=F[K+M];S.value=W.value;S.proxyId=W.proxyId;S.stabbingCount=W.stabbingCount}Q=g.length;var ha=K+2;for(M=
0;M<Q;M++){W=g[M];S=F[ha+M];S.value=W.value;S.proxyId=W.proxyId;S.stabbingCount=W.stabbingCount}g=[];Q=K-H;for(M=0;M<Q;M++){g[M]=new b2Bound;S=g[M];W=F[H+M];S.value=W.value;S.proxyId=W.proxyId;S.stabbingCount=W.stabbingCount}Q=g.length;ha=H+1;for(M=0;M<Q;M++){W=g[M];S=F[ha+M];S.value=W.value;S.proxyId=W.proxyId;S.stabbingCount=W.stabbingCount}++K;F[H].value=r[C];F[H].proxyId=s;F[K].value=v[C];F[K].proxyId=s;F[H].stabbingCount=H==0?0:F[H-1].stabbingCount;F[K].stabbingCount=F[K-1].stabbingCount;for(g=
H;g<K;++g)F[g].stabbingCount++;for(g=H;g<k+2;++g){H=this.m_proxyPool[F[g].proxyId];if(F[g].IsLower())H.lowerBounds[C]=g;else H.upperBounds[C]=g}}++this.m_proxyCount;for(k=0;k<this.m_queryResultCount;++k)this.m_pairManager.AddBufferedPair(s,this.m_queryResults[k]);this.m_pairManager.Commit();this.m_queryResultCount=0;this.IncrementTimeStamp();return s},DestroyProxy:function(a){for(var f=this.m_proxyPool[a],g=2*this.m_proxyCount,k=0;k<2;++k){var s=this.m_bounds[k],r=f.lowerBounds[k],v=f.upperBounds[k],
C=s[r].value,F=s[v].value,H=[],K=0,M=v-r-1,Q,S;for(K=0;K<M;K++){H[K]=new b2Bound;Q=H[K];S=s[r+1+K];Q.value=S.value;Q.proxyId=S.proxyId;Q.stabbingCount=S.stabbingCount}M=H.length;var W=r;for(K=0;K<M;K++){S=H[K];Q=s[W+K];Q.value=S.value;Q.proxyId=S.proxyId;Q.stabbingCount=S.stabbingCount}H=[];M=g-v-1;for(K=0;K<M;K++){H[K]=new b2Bound;Q=H[K];S=s[v+1+K];Q.value=S.value;Q.proxyId=S.proxyId;Q.stabbingCount=S.stabbingCount}M=H.length;W=v-1;for(K=0;K<M;K++){S=H[K];Q=s[W+K];Q.value=S.value;Q.proxyId=S.proxyId;
Q.stabbingCount=S.stabbingCount}M=g-2;for(H=r;H<M;++H){K=this.m_proxyPool[s[H].proxyId];if(s[H].IsLower())K.lowerBounds[k]=H;else K.upperBounds[k]=H}for(M=v-1;r<M;++r)s[r].stabbingCount--;this.Query([0],[0],C,F,s,g-2,k)}for(g=0;g<this.m_queryResultCount;++g)this.m_pairManager.RemoveBufferedPair(a,this.m_queryResults[g]);this.m_pairManager.Commit();this.m_queryResultCount=0;this.IncrementTimeStamp();f.userData=null;f.overlapCount=b2BroadPhase.b2_invalid;f.lowerBounds[0]=b2BroadPhase.b2_invalid;f.lowerBounds[1]=
b2BroadPhase.b2_invalid;f.upperBounds[0]=b2BroadPhase.b2_invalid;f.upperBounds[1]=b2BroadPhase.b2_invalid;f.SetNext(this.m_freeProxy);this.m_freeProxy=a;--this.m_proxyCount},MoveProxy:function(a,f){var g=0,k=0,s,r,v=0,C;if(!(a==b2Pair.b2_nullProxy||b2Settings.b2_maxProxies<=a))if(f.IsValid()!=false){var F=2*this.m_proxyCount,H=this.m_proxyPool[a],K=new b2BoundValues;this.ComputeBounds(K.lowerValues,K.upperValues,f);var M=new b2BoundValues;for(g=0;g<2;++g){M.lowerValues[g]=this.m_bounds[g][H.lowerBounds[g]].value;
M.upperValues[g]=this.m_bounds[g][H.upperBounds[g]].value}for(g=0;g<2;++g){var Q=this.m_bounds[g],S=H.lowerBounds[g],W=H.upperBounds[g],ha=K.lowerValues[g],fa=K.upperValues[g],ia=ha-Q[S].value,Aa=fa-Q[W].value;Q[S].value=ha;Q[W].value=fa;if(ia<0)for(k=S;k>0&&ha<Q[k-1].value;){s=Q[k];r=Q[k-1];v=r.proxyId;C=this.m_proxyPool[r.proxyId];r.stabbingCount++;if(r.IsUpper()==true){this.TestOverlap(K,C)&&this.m_pairManager.AddBufferedPair(a,v);C.upperBounds[g]++;s.stabbingCount++}else{C.lowerBounds[g]++;s.stabbingCount--}H.lowerBounds[g]--;
s.Swap(r);--k}if(Aa>0)for(k=W;k<F-1&&Q[k+1].value<=fa;){s=Q[k];r=Q[k+1];v=r.proxyId;C=this.m_proxyPool[v];r.stabbingCount++;if(r.IsLower()==true){this.TestOverlap(K,C)&&this.m_pairManager.AddBufferedPair(a,v);C.lowerBounds[g]--;s.stabbingCount++}else{C.upperBounds[g]--;s.stabbingCount--}H.upperBounds[g]++;s.Swap(r);k++}if(ia>0)for(k=S;k<F-1&&Q[k+1].value<=ha;){s=Q[k];r=Q[k+1];v=r.proxyId;C=this.m_proxyPool[v];r.stabbingCount--;if(r.IsUpper()){this.TestOverlap(M,C)&&this.m_pairManager.RemoveBufferedPair(a,
v);C.upperBounds[g]--;s.stabbingCount--}else{C.lowerBounds[g]--;s.stabbingCount++}H.lowerBounds[g]++;s.Swap(r);k++}if(Aa<0)for(k=W;k>0&&fa<Q[k-1].value;){s=Q[k];r=Q[k-1];v=r.proxyId;C=this.m_proxyPool[v];r.stabbingCount--;if(r.IsLower()==true){this.TestOverlap(M,C)&&this.m_pairManager.RemoveBufferedPair(a,v);C.lowerBounds[g]++;s.stabbingCount--}else{C.upperBounds[g]++;s.stabbingCount++}H.upperBounds[g]--;s.Swap(r);k--}}}},Commit:function(){this.m_pairManager.Commit()},QueryAABB:function(a,f,g){var k=
[],s=[];this.ComputeBounds(k,s,a);a=[0];var r=[0];this.Query(a,r,k[0],s[0],this.m_bounds[0],2*this.m_proxyCount,0);this.Query(a,r,k[1],s[1],this.m_bounds[1],2*this.m_proxyCount,1);for(s=k=0;s<this.m_queryResultCount&&k<g;++s,++k)f[s]=this.m_proxyPool[this.m_queryResults[s]].userData;this.m_queryResultCount=0;this.IncrementTimeStamp();return k},Validate:function(){for(var a=0;a<2;++a)for(var f=this.m_bounds[a],g=2*this.m_proxyCount,k=0,s=0;s<g;++s)if(f[s].IsLower()==true)k++;else k--},ComputeBounds:function(a,
f,g){var k=g.minVertex.x,s=g.minVertex.y;k=b2Math.b2Min(k,this.m_worldAABB.maxVertex.x);s=b2Math.b2Min(s,this.m_worldAABB.maxVertex.y);k=b2Math.b2Max(k,this.m_worldAABB.minVertex.x);s=b2Math.b2Max(s,this.m_worldAABB.minVertex.y);var r=g.maxVertex.x;g=g.maxVertex.y;r=b2Math.b2Min(r,this.m_worldAABB.maxVertex.x);g=b2Math.b2Min(g,this.m_worldAABB.maxVertex.y);r=b2Math.b2Max(r,this.m_worldAABB.minVertex.x);g=b2Math.b2Max(g,this.m_worldAABB.minVertex.y);a[0]=this.m_quantizationFactor.x*(k-this.m_worldAABB.minVertex.x)&
b2Settings.USHRT_MAX-1;f[0]=this.m_quantizationFactor.x*(r-this.m_worldAABB.minVertex.x)&65535|1;a[1]=this.m_quantizationFactor.y*(s-this.m_worldAABB.minVertex.y)&b2Settings.USHRT_MAX-1;f[1]=this.m_quantizationFactor.y*(g-this.m_worldAABB.minVertex.y)&65535|1},TestOverlapValidate:function(a,f){for(var g=0;g<2;++g){var k=this.m_bounds[g];if(k[a.lowerBounds[g]].value>k[f.upperBounds[g]].value)return false;if(k[a.upperBounds[g]].value<k[f.lowerBounds[g]].value)return false}return true},TestOverlap:function(a,
f){for(var g=0;g<2;++g){var k=this.m_bounds[g];if(a.lowerValues[g]>k[f.upperBounds[g]].value)return false;if(a.upperValues[g]<k[f.lowerBounds[g]].value)return false}return true},Query:function(a,f,g,k,s,r,v){g=b2BroadPhase.BinarySearch(s,r,g);k=b2BroadPhase.BinarySearch(s,r,k);for(r=g;r<k;++r)s[r].IsLower()&&this.IncrementOverlapCount(s[r].proxyId);if(g>0){r=g-1;for(var C=s[r].stabbingCount;C;){if(s[r].IsLower())if(g<=this.m_proxyPool[s[r].proxyId].upperBounds[v]){this.IncrementOverlapCount(s[r].proxyId);
--C}--r}}a[0]=g;f[0]=k},IncrementOverlapCount:function(a){var f=this.m_proxyPool[a];if(f.timeStamp<this.m_timeStamp){f.timeStamp=this.m_timeStamp;f.overlapCount=1}else{f.overlapCount=2;this.m_queryResults[this.m_queryResultCount]=a;++this.m_queryResultCount}},IncrementTimeStamp:function(){if(this.m_timeStamp==b2Settings.USHRT_MAX){for(var a=0;a<b2Settings.b2_maxProxies;++a)this.m_proxyPool[a].timeStamp=0;this.m_timeStamp=1}else++this.m_timeStamp},m_pairManager:new b2PairManager,m_proxyPool:Array(b2Settings.b2_maxPairs),
m_freeProxy:0,m_bounds:Array(2*b2Settings.b2_maxProxies),m_queryResults:Array(b2Settings.b2_maxProxies),m_queryResultCount:0,m_worldAABB:null,m_quantizationFactor:new b2Vec2,m_proxyCount:0,m_timeStamp:0};b2BroadPhase.s_validate=false;b2BroadPhase.b2_invalid=b2Settings.USHRT_MAX;b2BroadPhase.b2_nullEdge=b2Settings.USHRT_MAX;b2BroadPhase.BinarySearch=function(a,f,g){var k=0;for(f-=1;k<=f;){var s=Math.floor((k+f)/2);if(a[s].value>g)f=s-1;else if(a[s].value<g)k=s+1;else return s}return k};
var b2Collision=Class.create();b2Collision.prototype={initialize:function(){}};b2Collision.b2_nullFeature=255;b2Collision.ClipSegmentToLine=function(a,f,g,k){var s=0,r=f[0].v,v=f[1].v,C=b2Math.b2Dot(g,f[0].v)-k;g=b2Math.b2Dot(g,f[1].v)-k;if(C<=0)a[s++]=f[0];if(g<=0)a[s++]=f[1];if(C*g<0){g=C/(C-g);k=a[s].v;k.x=r.x+g*(v.x-r.x);k.y=r.y+g*(v.y-r.y);a[s].id=C>0?f[0].id:f[1].id;++s}return s};
b2Collision.EdgeSeparation=function(a,f,g){var k=a.m_vertices,s=g.m_vertexCount,r=g.m_vertices,v=a.m_normals[f].x,C=a.m_normals[f].y,F=v,H=a.m_R;v=H.col1.x*F+H.col2.x*C;C=H.col1.y*F+H.col2.y*C;var K=v,M=C;H=g.m_R;F=K*H.col1.x+M*H.col1.y;M=K*H.col2.x+M*H.col2.y;K=F;F=0;H=Number.MAX_VALUE;for(var Q=0;Q<s;++Q){var S=r[Q];S=S.x*K+S.y*M;if(S<H){H=S;F=Q}}H=a.m_R;s=a.m_position.x+(H.col1.x*k[f].x+H.col2.x*k[f].y);a=a.m_position.y+(H.col1.y*k[f].x+H.col2.y*k[f].y);H=g.m_R;f=g.m_position.x+(H.col1.x*r[F].x+
H.col2.x*r[F].y);g=g.m_position.y+(H.col1.y*r[F].x+H.col2.y*r[F].y);f-=s;g-=a;return f*v+g*C};
b2Collision.FindMaxSeparation=function(a,f,g,k){var s=f.m_vertexCount,r=g.m_position.x-f.m_position.x,v=g.m_position.y-f.m_position.y,C=r*f.m_R.col1.x+v*f.m_R.col1.y;v=r*f.m_R.col2.x+v*f.m_R.col2.y;r=0;for(var F=-Number.MAX_VALUE,H=0;H<s;++H){var K=f.m_normals[H].x*C+f.m_normals[H].y*v;if(K>F){F=K;r=H}}C=b2Collision.EdgeSeparation(f,r,g);if(C>0&&k==false)return C;H=r-1>=0?r-1:s-1;K=b2Collision.EdgeSeparation(f,H,g);if(K>0&&k==false)return K;v=r+1<s?r+1:0;var M=b2Collision.EdgeSeparation(f,v,g);if(M>
0&&k==false)return M;if(K>C&&K>M){F=-1;v=H;H=K}else if(M>C){F=1;v=v;H=M}else{a[0]=r;return C}for(;;){r=F==-1?v-1>=0?v-1:s-1:v+1<s?v+1:0;C=b2Collision.EdgeSeparation(f,r,g);if(C>0&&k==false)return C;if(C>H){v=r;H=C}else break}a[0]=v;return H};
b2Collision.FindIncidentEdge=function(a,f,g,k){var s=f.m_vertices,r=k.m_vertexCount,v=k.m_vertices,C=s[g+1==f.m_vertexCount?0:g+1],F=C.x,H=C.y;C=s[g];F-=C.x;H-=C.y;C=F;F=H;H=-C;C=1/Math.sqrt(F*F+H*H);F*=C;H*=C;C=F;s=f.m_R;F=s.col1.x*C+s.col2.x*H;H=s.col1.y*C+s.col2.y*H;f=F;s=k.m_R;C=f*s.col1.x+H*s.col1.y;H=f*s.col2.x+H*s.col2.y;f=C;s=F=0;for(var K=Number.MAX_VALUE,M=0;M<r;++M){var Q=M,S=M+1<r?M+1:0;C=v[S];var W=C.x,ha=C.y;C=v[Q];W-=C.x;ha-=C.y;C=W;W=ha;ha=-C;C=1/Math.sqrt(W*W+ha*ha);W*=C;ha*=C;C=
W*f+ha*H;if(C<K){K=C;F=Q;s=S}}r=a[0];C=r.v;C.SetV(v[F]);C.MulM(k.m_R);C.Add(k.m_position);r.id.features.referenceFace=g;r.id.features.incidentEdge=F;r.id.features.incidentVertex=F;r=a[1];C=r.v;C.SetV(v[s]);C.MulM(k.m_R);C.Add(k.m_position);r.id.features.referenceFace=g;r.id.features.incidentEdge=F;r.id.features.incidentVertex=s};b2Collision.b2CollidePolyTempVec=new b2Vec2;
b2Collision.b2CollidePoly=function(a,f,g,k){var s=a.pointCount=0,r=[s],v=b2Collision.FindMaxSeparation(r,f,g,k);s=r[0];if(!(v>0&&k==false)){var C=0;r=[C];var F=b2Collision.FindMaxSeparation(r,g,f,k);C=r[0];if(!(F>0&&k==false)){var H=0;if(F>0.98*v+0.0010){v=g;H=C;r=1}else{v=f;f=g;H=s;r=0}g=[new ClipVertex,new ClipVertex];b2Collision.FindIncidentEdge(g,v,H,f);f=v.m_vertices;var K=f[H],M=H+1<v.m_vertexCount?f[H+1]:f[0];s=M.x-K.x;C=M.y-K.y;var Q=s,S=v.m_R;s=S.col1.x*Q+S.col2.x*C;C=S.col1.y*Q+S.col2.y*
C;H=1/Math.sqrt(s*s+C*C);s*=H;C*=H;H=s;f=C;Q=H;H=f;f=-Q;F=K.x;var W=K.y;Q=F;S=v.m_R;F=S.col1.x*Q+S.col2.x*W;W=S.col1.y*Q+S.col2.y*W;F+=v.m_position.x;W+=v.m_position.y;K=M.x;M=M.y;Q=K;S=v.m_R;K=S.col1.x*Q+S.col2.x*M;M=S.col1.y*Q+S.col2.y*M;K+=v.m_position.x;M+=v.m_position.y;v=H*F+f*W;Q=-(s*F+C*W);K=s*K+C*M;M=[new ClipVertex,new ClipVertex];F=[new ClipVertex,new ClipVertex];b2Collision.b2CollidePolyTempVec.Set(-s,-C);S=b2Collision.ClipSegmentToLine(M,g,b2Collision.b2CollidePolyTempVec,Q);if(!(S<2)){b2Collision.b2CollidePolyTempVec.Set(s,
C);S=b2Collision.ClipSegmentToLine(F,M,b2Collision.b2CollidePolyTempVec,K);if(!(S<2)){r?a.normal.Set(-H,-f):a.normal.Set(H,f);for(s=g=0;s<b2Settings.b2_maxManifoldPoints;++s){C=F[s].v;C=H*C.x+f*C.y-v;if(C<=0||k==true){K=a.points[g];K.separation=C;K.position.SetV(F[s].v);K.id.Set(F[s].id);K.id.features.flip=r;++g}}a.pointCount=g}}}}};
b2Collision.b2CollideCircle=function(a,f,g,k){a.pointCount=0;var s=g.m_position.x-f.m_position.x,r=g.m_position.y-f.m_position.y,v=s*s+r*r;f=f.m_radius+g.m_radius;if(!(v>f*f&&k==false)){if(v<Number.MIN_VALUE){k=-f;a.normal.Set(0,1)}else{v=Math.sqrt(v);k=v-f;v=1/v;a.normal.x=v*s;a.normal.y=v*r}a.pointCount=1;s=a.points[0];s.id.set_key(0);s.separation=k;s.position.x=g.m_position.x-g.m_radius*a.normal.x;s.position.y=g.m_position.y-g.m_radius*a.normal.y}};
b2Collision.b2CollidePolyAndCircle=function(a,f,g){a.pointCount=0;var k,s,r;s=g.m_position.x-f.m_position.x;r=g.m_position.y-f.m_position.y;var v=f.m_R,C=s*v.col1.x+r*v.col1.y;r=s*v.col2.x+r*v.col2.y;s=C;var F=0,H=-Number.MAX_VALUE;C=g.m_radius;for(k=0;k<f.m_vertexCount;++k){var K=f.m_normals[k].x*(s-f.m_vertices[k].x)+f.m_normals[k].y*(r-f.m_vertices[k].y);if(K>C)return;if(K>H){H=K;F=k}}if(H<Number.MIN_VALUE){a.pointCount=1;r=f.m_normals[F];a.normal.x=v.col1.x*r.x+v.col2.x*r.y;a.normal.y=v.col1.y*
r.x+v.col2.y*r.y;k=a.points[0];k.id.features.incidentEdge=F;k.id.features.incidentVertex=b2Collision.b2_nullFeature;k.id.features.referenceFace=b2Collision.b2_nullFeature;k.id.features.flip=0;k.position.x=g.m_position.x-C*a.normal.x;k.position.y=g.m_position.y-C*a.normal.y;k.separation=H-C}else{H=F+1<f.m_vertexCount?F+1:0;var M=f.m_vertices[H].x-f.m_vertices[F].x;K=f.m_vertices[H].y-f.m_vertices[F].y;var Q=Math.sqrt(M*M+K*K);M/=Q;K/=Q;if(Q<Number.MIN_VALUE){s-=f.m_vertices[F].x;r-=f.m_vertices[F].y;
f=Math.sqrt(s*s+r*r);s/=f;r/=f;if(!(f>C)){a.pointCount=1;a.normal.Set(v.col1.x*s+v.col2.x*r,v.col1.y*s+v.col2.y*r);k=a.points[0];k.id.features.incidentEdge=b2Collision.b2_nullFeature;k.id.features.incidentVertex=F;k.id.features.referenceFace=b2Collision.b2_nullFeature;k.id.features.flip=0;k.position.x=g.m_position.x-C*a.normal.x;k.position.y=g.m_position.y-C*a.normal.y;k.separation=f-C}}else{var S=(s-f.m_vertices[F].x)*M+(r-f.m_vertices[F].y)*K;k=a.points[0];k.id.features.incidentEdge=b2Collision.b2_nullFeature;
k.id.features.incidentVertex=b2Collision.b2_nullFeature;k.id.features.referenceFace=b2Collision.b2_nullFeature;k.id.features.flip=0;if(S<=0){M=f.m_vertices[F].x;f=f.m_vertices[F].y;k.id.features.incidentVertex=F}else if(S>=Q){M=f.m_vertices[H].x;f=f.m_vertices[H].y;k.id.features.incidentVertex=H}else{M=M*S+f.m_vertices[F].x;f=K*S+f.m_vertices[F].y;k.id.features.incidentEdge=F}s-=M;r-=f;f=Math.sqrt(s*s+r*r);s/=f;r/=f;if(!(f>C)){a.pointCount=1;a.normal.Set(v.col1.x*s+v.col2.x*r,v.col1.y*s+v.col2.y*
r);k.position.x=g.m_position.x-C*a.normal.x;k.position.y=g.m_position.y-C*a.normal.y;k.separation=f-C}}}};b2Collision.b2TestOverlap=function(a,f){var g=f.minVertex,k=a.maxVertex,s=g.x-k.x,r=g.y-k.y;g=a.minVertex;k=f.maxVertex;var v=g.y-k.y;if(s>0||r>0)return false;if(g.x-k.x>0||v>0)return false;return true};var Features=Class.create();
Features.prototype={set_referenceFace:function(a){this._referenceFace=a;this._m_id._key=this._m_id._key&4294967040|this._referenceFace&255},get_referenceFace:function(){return this._referenceFace},_referenceFace:0,set_incidentEdge:function(a){this._incidentEdge=a;this._m_id._key=this._m_id._key&4294902015|this._incidentEdge<<8&65280},get_incidentEdge:function(){return this._incidentEdge},_incidentEdge:0,set_incidentVertex:function(a){this._incidentVertex=a;this._m_id._key=this._m_id._key&4278255615|
this._incidentVertex<<16&16711680},get_incidentVertex:function(){return this._incidentVertex},_incidentVertex:0,set_flip:function(a){this._flip=a;this._m_id._key=this._m_id._key&16777215|this._flip<<24&4278190080},get_flip:function(){return this._flip},_flip:0,_m_id:null,initialize:function(){}};var b2ContactID=Class.create();
b2ContactID.prototype={initialize:function(){this.features=new Features;this.features._m_id=this},Set:function(a){this.set_key(a._key)},Copy:function(){var a=new b2ContactID;a.set_key(this._key);return a},get_key:function(){return this._key},set_key:function(a){this._key=a;this.features._referenceFace=this._key&255;this.features._incidentEdge=(this._key&65280)>>8&255;this.features._incidentVertex=(this._key&16711680)>>16&255;this.features._flip=(this._key&4278190080)>>24&255},features:new Features,
_key:0};var b2ContactPoint=Class.create();b2ContactPoint.prototype={position:new b2Vec2,separation:null,normalImpulse:null,tangentImpulse:null,id:new b2ContactID,initialize:function(){this.position=new b2Vec2;this.id=new b2ContactID}};var b2Distance=Class.create();b2Distance.prototype={initialize:function(){}};
b2Distance.ProcessTwo=function(a,f,g,k,s){var r=-s[1].x,v=-s[1].y,C=s[0].x-s[1].x,F=s[0].y-s[1].y,H=Math.sqrt(C*C+F*F);C/=H;F/=H;r=r*C+v*F;if(r<=0||H<Number.MIN_VALUE){a.SetV(g[1]);f.SetV(k[1]);g[0].SetV(g[1]);k[0].SetV(k[1]);s[0].SetV(s[1]);return 1}r/=H;a.x=g[1].x+r*(g[0].x-g[1].x);a.y=g[1].y+r*(g[0].y-g[1].y);f.x=k[1].x+r*(k[0].x-k[1].x);f.y=k[1].y+r*(k[0].y-k[1].y);return 2};
b2Distance.ProcessThree=function(a,f,g,k,s){var r=s[0].x,v=s[0].y,C=s[1].x,F=s[1].y,H=s[2].x,K=s[2].y,M=C-r,Q=F-v,S=H-r,W=K-v,ha=H-C,fa=K-F,ia=-(r*S+v*W),Aa=H*S+K*W,ra=-(C*ha+F*fa);ha=H*ha+K*fa;if(Aa<=0&&ha<=0){a.SetV(g[2]);f.SetV(k[2]);g[0].SetV(g[2]);k[0].SetV(k[2]);s[0].SetV(s[2]);return 1}Q=M*W-Q*S;M=Q*(r*F-v*C);C=Q*(C*K-F*H);if(C<=0&&ra>=0&&ha>=0){ia=ra/(ra+ha);a.x=g[1].x+ia*(g[2].x-g[1].x);a.y=g[1].y+ia*(g[2].y-g[1].y);f.x=k[1].x+ia*(k[2].x-k[1].x);f.y=k[1].y+ia*(k[2].y-k[1].y);g[0].SetV(g[2]);
k[0].SetV(k[2]);s[0].SetV(s[2]);return 2}r=Q*(H*v-K*r);if(r<=0&&ia>=0&&Aa>=0){ia/=ia+Aa;a.x=g[0].x+ia*(g[2].x-g[0].x);a.y=g[0].y+ia*(g[2].y-g[0].y);f.x=k[0].x+ia*(k[2].x-k[0].x);f.y=k[0].y+ia*(k[2].y-k[0].y);g[1].SetV(g[2]);k[1].SetV(k[2]);s[1].SetV(s[2]);return 2}ia=C+r+M;ia=1/ia;s=C*ia;ia=r*ia;Aa=1-s-ia;a.x=s*g[0].x+ia*g[1].x+Aa*g[2].x;a.y=s*g[0].y+ia*g[1].y+Aa*g[2].y;f.x=s*k[0].x+ia*k[1].x+Aa*k[2].x;f.y=s*k[0].y+ia*k[1].y+Aa*k[2].y;return 3};
b2Distance.InPoinsts=function(a,f,g){for(var k=0;k<g;++k)if(a.x==f[k].x&&a.y==f[k].y)return true;return false};
b2Distance.Distance=function(a,f,g,k){var s=Array(3),r=Array(3),v=Array(3),C=0;a.SetV(g.m_position);f.SetV(k.m_position);for(var F=0,H=0;H<20;++H){var K=f.x-a.x,M=f.y-a.y,Q=g.Support(K,M),S=k.Support(-K,-M);F=K*K+M*M;var W=S.x-Q.x,ha=S.y-Q.y;if(F-b2Dot(K*W+M*ha)<=0.01*F){if(C==0){a.SetV(Q);f.SetV(S)}b2Distance.g_GJK_Iterations=H;return Math.sqrt(F)}switch(C){case 0:s[0].SetV(Q);r[0].SetV(S);v[0]=w;a.SetV(s[0]);f.SetV(r[0]);++C;break;case 1:s[1].SetV(Q);r[1].SetV(S);v[1].x=W;v[1].y=ha;C=b2Distance.ProcessTwo(a,
f,s,r,v);break;case 2:s[2].SetV(Q);r[2].SetV(S);v[2].x=W;v[2].y=ha;C=b2Distance.ProcessThree(a,f,s,r,v);break}if(C==3){b2Distance.g_GJK_Iterations=H;return 0}K=-Number.MAX_VALUE;for(M=0;M<C;++M)K=b2Math.b2Max(K,v[M].x*v[M].x+v[M].y*v[M].y);if(C==3||F<=100*Number.MIN_VALUE*K){b2Distance.g_GJK_Iterations=H;return Math.sqrt(F)}}b2Distance.g_GJK_Iterations=20;return Math.sqrt(F)};b2Distance.g_GJK_Iterations=0;var b2Manifold=Class.create();
b2Manifold.prototype={initialize:function(){this.points=Array(b2Settings.b2_maxManifoldPoints);for(var a=0;a<b2Settings.b2_maxManifoldPoints;a++)this.points[a]=new b2ContactPoint;this.normal=new b2Vec2},points:null,normal:null,pointCount:0};var b2OBB=Class.create();b2OBB.prototype={R:new b2Mat22,center:new b2Vec2,extents:new b2Vec2,initialize:function(){this.R=new b2Mat22;this.center=new b2Vec2;this.extents=new b2Vec2}};var b2Proxy=Class.create();
b2Proxy.prototype={GetNext:function(){return this.lowerBounds[0]},SetNext:function(a){this.lowerBounds[0]=a},IsValid:function(){return this.overlapCount!=b2BroadPhase.b2_invalid},lowerBounds:[0,0],upperBounds:[0,0],overlapCount:0,timeStamp:0,userData:null,initialize:function(){this.lowerBounds=[0,0];this.upperBounds=[0,0]}};var ClipVertex=Class.create();ClipVertex.prototype={v:new b2Vec2,id:new b2ContactID,initialize:function(){this.v=new b2Vec2;this.id=new b2ContactID}};var b2Shape=Class.create();
b2Shape.prototype={TestPoint:function(){return false},GetUserData:function(){return this.m_userData},GetType:function(){return this.m_type},GetBody:function(){return this.m_body},GetPosition:function(){return this.m_position},GetRotationMatrix:function(){return this.m_R},ResetProxy:function(){},GetNext:function(){return this.m_next},initialize:function(a,f){this.m_R=new b2Mat22;this.m_position=new b2Vec2;this.m_userData=a.userData;this.m_friction=a.friction;this.m_restitution=a.restitution;this.m_body=
f;this.m_proxyId=b2Pair.b2_nullProxy;this.m_maxRadius=0;this.m_categoryBits=a.categoryBits;this.m_maskBits=a.maskBits;this.m_groupIndex=a.groupIndex},DestroyProxy:function(){if(this.m_proxyId!=b2Pair.b2_nullProxy){this.m_body.m_world.m_broadPhase.DestroyProxy(this.m_proxyId);this.m_proxyId=b2Pair.b2_nullProxy}},Synchronize:function(){},QuickSync:function(){},Support:function(){},GetMaxRadius:function(){return this.m_maxRadius},m_next:null,m_R:new b2Mat22,m_position:new b2Vec2,m_type:0,m_userData:null,
m_body:null,m_friction:null,m_restitution:null,m_maxRadius:null,m_proxyId:0,m_categoryBits:0,m_maskBits:0,m_groupIndex:0};b2Shape.Create=function(a,f,g){switch(a.type){case b2Shape.e_circleShape:return new b2CircleShape(a,f,g);case b2Shape.e_boxShape:case b2Shape.e_polyShape:return new b2PolyShape(a,f,g)}return null};b2Shape.Destroy=function(a){a.m_proxyId!=b2Pair.b2_nullProxy&&a.m_body.m_world.m_broadPhase.DestroyProxy(a.m_proxyId)};b2Shape.e_unknownShape=-1;b2Shape.e_circleShape=0;
b2Shape.e_boxShape=1;b2Shape.e_polyShape=2;b2Shape.e_meshShape=3;b2Shape.e_shapeTypeCount=4;
b2Shape.PolyMass=function(a,f,g,k){var s=new b2Vec2;s.SetZero();for(var r=0,v=0,C=new b2Vec2(0,0),F=1/3,H=0;H<g;++H){var K=C,M=f[H],Q=H+1<g?f[H+1]:f[0],S=b2Math.SubtractVV(M,K),W=b2Math.SubtractVV(Q,K),ha=b2Math.b2CrossVV(S,W),fa=0.5*ha;r+=fa;var ia=new b2Vec2;ia.SetV(K);ia.Add(M);ia.Add(Q);ia.Multiply(F*fa);s.Add(ia);M=K.x;K=K.y;Q=S.x;S=S.y;fa=W.x;W=W.y;v+=ha*(F*(0.25*(Q*Q+fa*Q+fa*fa)+(M*Q+M*fa))+0.5*M*M+(F*(0.25*(S*S+W*S+W*W)+(K*S+K*W))+0.5*K*K))}a.mass=k*r;s.Multiply(1/r);a.center=s;v=k*(v-r*b2Math.b2Dot(s,
s));a.I=v};b2Shape.PolyCentroid=function(a,f,g){for(var k=0,s=0,r=0,v=1/3,C=0;C<f;++C){var F=a[C].x,H=a[C].y,K=C+1<f?a[C+1].x:a[0].x,M=C+1<f?a[C+1].y:a[0].y,Q=0.5*((F-0)*(M-0)-(H-0)*(K-0));r+=Q;k+=Q*v*(0+F+K);s+=Q*v*(0+H+M)}k*=1/r;s*=1/r;g.Set(k,s)};var b2ShapeDef=Class.create();
b2ShapeDef.prototype={initialize:function(){this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0,0);this.localRotation=0;this.friction=0.2;this.density=this.restitution=0;this.categoryBits=1;this.maskBits=65535;this.groupIndex=0},ComputeMass:function(a){a.center=new b2Vec2(0,0);if(this.density==0){a.mass=0;a.center.Set(0,0);a.I=0}switch(this.type){case b2Shape.e_circleShape:a.mass=this.density*b2Settings.b2_pi*this.radius*this.radius;a.center.Set(0,0);a.I=0.5*a.mass*
this.radius*this.radius;break;case b2Shape.e_boxShape:a.mass=4*this.density*this.extents.x*this.extents.y;a.center.Set(0,0);a.I=a.mass/3*b2Math.b2Dot(this.extents,this.extents);break;case b2Shape.e_polyShape:b2Shape.PolyMass(a,this.vertices,this.vertexCount,this.density);break;default:a.mass=0;a.center.Set(0,0);a.I=0;break}},type:0,userData:null,localPosition:null,localRotation:null,friction:null,restitution:null,density:null,categoryBits:0,maskBits:0,groupIndex:0};var b2BoxDef=Class.create();
Object.extend(b2BoxDef.prototype,b2ShapeDef.prototype);Object.extend(b2BoxDef.prototype,{initialize:function(){this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0,0);this.localRotation=0;this.friction=0.2;this.density=this.restitution=0;this.categoryBits=1;this.maskBits=65535;this.groupIndex=0;this.type=b2Shape.e_boxShape;this.extents=new b2Vec2(1,1)},extents:null});var b2CircleDef=Class.create();Object.extend(b2CircleDef.prototype,b2ShapeDef.prototype);
Object.extend(b2CircleDef.prototype,{initialize:function(){this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0,0);this.localRotation=0;this.friction=0.2;this.density=this.restitution=0;this.categoryBits=1;this.maskBits=65535;this.groupIndex=0;this.type=b2Shape.e_circleShape;this.radius=1},radius:null});var b2CircleShape=Class.create();Object.extend(b2CircleShape.prototype,b2Shape.prototype);
Object.extend(b2CircleShape.prototype,{TestPoint:function(a){var f=new b2Vec2;f.SetV(a);f.Subtract(this.m_position);return b2Math.b2Dot(f,f)<=this.m_radius*this.m_radius},initialize:function(a,f,g){this.m_R=new b2Mat22;this.m_position=new b2Vec2;this.m_userData=a.userData;this.m_friction=a.friction;this.m_restitution=a.restitution;this.m_body=f;this.m_proxyId=b2Pair.b2_nullProxy;this.m_maxRadius=0;this.m_categoryBits=a.categoryBits;this.m_maskBits=a.maskBits;this.m_groupIndex=a.groupIndex;this.m_localPosition=
new b2Vec2;this.m_localPosition.Set(a.localPosition.x-g.x,a.localPosition.y-g.y);this.m_type=b2Shape.e_circleShape;this.m_radius=a.radius;this.m_R.SetM(this.m_body.m_R);a=this.m_R.col1.x*this.m_localPosition.x+this.m_R.col2.x*this.m_localPosition.y;f=this.m_R.col1.y*this.m_localPosition.x+this.m_R.col2.y*this.m_localPosition.y;this.m_position.x=this.m_body.m_position.x+a;this.m_position.y=this.m_body.m_position.y+f;this.m_maxRadius=Math.sqrt(a*a+f*f)+this.m_radius;a=new b2AABB;a.minVertex.Set(this.m_position.x-
this.m_radius,this.m_position.y-this.m_radius);a.maxVertex.Set(this.m_position.x+this.m_radius,this.m_position.y+this.m_radius);f=this.m_body.m_world.m_broadPhase;this.m_proxyId=f.InRange(a)?f.CreateProxy(a,this):b2Pair.b2_nullProxy;this.m_proxyId==b2Pair.b2_nullProxy&&this.m_body.Freeze()},Synchronize:function(a,f,g,k){this.m_R.SetM(k);this.m_position.x=k.col1.x*this.m_localPosition.x+k.col2.x*this.m_localPosition.y+g.x;this.m_position.y=k.col1.y*this.m_localPosition.x+k.col2.y*this.m_localPosition.y+
g.y;if(this.m_proxyId!=b2Pair.b2_nullProxy){g=a.x+(f.col1.x*this.m_localPosition.x+f.col2.x*this.m_localPosition.y);k=a.y+(f.col1.y*this.m_localPosition.x+f.col2.y*this.m_localPosition.y);a=Math.min(g,this.m_position.x);f=Math.min(k,this.m_position.y);g=Math.max(g,this.m_position.x);var s=Math.max(k,this.m_position.y);k=new b2AABB;k.minVertex.Set(a-this.m_radius,f-this.m_radius);k.maxVertex.Set(g+this.m_radius,s+this.m_radius);a=this.m_body.m_world.m_broadPhase;a.InRange(k)?a.MoveProxy(this.m_proxyId,
k):this.m_body.Freeze()}},QuickSync:function(a,f){this.m_R.SetM(f);this.m_position.x=f.col1.x*this.m_localPosition.x+f.col2.x*this.m_localPosition.y+a.x;this.m_position.y=f.col1.y*this.m_localPosition.x+f.col2.y*this.m_localPosition.y+a.y},ResetProxy:function(a){if(this.m_proxyId!=b2Pair.b2_nullProxy){a.GetProxy(this.m_proxyId);a.DestroyProxy(this.m_proxyId);var f=new b2AABB;f.minVertex.Set(this.m_position.x-this.m_radius,this.m_position.y-this.m_radius);f.maxVertex.Set(this.m_position.x+this.m_radius,
this.m_position.y+this.m_radius);this.m_proxyId=a.InRange(f)?a.CreateProxy(f,this):b2Pair.b2_nullProxy;this.m_proxyId==b2Pair.b2_nullProxy&&this.m_body.Freeze()}},Support:function(a,f,g){var k=Math.sqrt(a*a+f*f);a/=k;f/=k;g.Set(this.m_position.x+this.m_radius*a,this.m_position.y+this.m_radius*f)},m_localPosition:new b2Vec2,m_radius:null});var b2MassData=Class.create();b2MassData.prototype={mass:0,center:new b2Vec2(0,0),I:0,initialize:function(){this.center=new b2Vec2(0,0)}};var b2PolyDef=Class.create();
Object.extend(b2PolyDef.prototype,b2ShapeDef.prototype);
Object.extend(b2PolyDef.prototype,{initialize:function(){this.type=b2Shape.e_unknownShape;this.userData=null;this.localPosition=new b2Vec2(0,0);this.localRotation=0;this.friction=0.2;this.density=this.restitution=0;this.categoryBits=1;this.maskBits=65535;this.groupIndex=0;this.vertices=Array(b2Settings.b2_maxPolyVertices);this.type=b2Shape.e_polyShape;for(var a=this.vertexCount=0;a<b2Settings.b2_maxPolyVertices;a++)this.vertices[a]=new b2Vec2},vertices:Array(b2Settings.b2_maxPolyVertices),vertexCount:0});
var b2PolyShape=Class.create();Object.extend(b2PolyShape.prototype,b2Shape.prototype);
Object.extend(b2PolyShape.prototype,{TestPoint:function(a){var f=new b2Vec2;f.SetV(a);f.Subtract(this.m_position);f.MulTM(this.m_R);for(a=0;a<this.m_vertexCount;++a){var g=new b2Vec2;g.SetV(f);g.Subtract(this.m_vertices[a]);if(b2Math.b2Dot(this.m_normals[a],g)>0)return false}return true},initialize:function(a,f,g){this.m_R=new b2Mat22;this.m_position=new b2Vec2;this.m_userData=a.userData;this.m_friction=a.friction;this.m_restitution=a.restitution;this.m_body=f;this.m_proxyId=b2Pair.b2_nullProxy;this.m_maxRadius=
0;this.m_categoryBits=a.categoryBits;this.m_maskBits=a.maskBits;this.m_groupIndex=a.groupIndex;this.syncAABB=new b2AABB;this.syncMat=new b2Mat22;this.m_localCentroid=new b2Vec2;this.m_localOBB=new b2OBB;var k=0,s;f=new b2AABB;this.m_vertices=Array(b2Settings.b2_maxPolyVertices);this.m_coreVertices=Array(b2Settings.b2_maxPolyVertices);this.m_normals=Array(b2Settings.b2_maxPolyVertices);this.m_type=b2Shape.e_polyShape;var r=new b2Mat22(a.localRotation);if(a.type==b2Shape.e_boxShape){this.m_localCentroid.x=
a.localPosition.x-g.x;this.m_localCentroid.y=a.localPosition.y-g.y;this.m_vertexCount=4;g=a.extents.x;s=a.extents.y;a=Math.max(0,g-2*b2Settings.b2_linearSlop);var v=Math.max(0,s-2*b2Settings.b2_linearSlop);k=this.m_vertices[0]=new b2Vec2;k.x=r.col1.x*g+r.col2.x*s;k.y=r.col1.y*g+r.col2.y*s;k=this.m_vertices[1]=new b2Vec2;k.x=r.col1.x*-g+r.col2.x*s;k.y=r.col1.y*-g+r.col2.y*s;k=this.m_vertices[2]=new b2Vec2;k.x=r.col1.x*-g+r.col2.x*-s;k.y=r.col1.y*-g+r.col2.y*-s;k=this.m_vertices[3]=new b2Vec2;k.x=r.col1.x*
g+r.col2.x*-s;k.y=r.col1.y*g+r.col2.y*-s;k=this.m_coreVertices[0]=new b2Vec2;k.x=r.col1.x*a+r.col2.x*v;k.y=r.col1.y*a+r.col2.y*v;k=this.m_coreVertices[1]=new b2Vec2;k.x=r.col1.x*-a+r.col2.x*v;k.y=r.col1.y*-a+r.col2.y*v;k=this.m_coreVertices[2]=new b2Vec2;k.x=r.col1.x*-a+r.col2.x*-v;k.y=r.col1.y*-a+r.col2.y*-v;k=this.m_coreVertices[3]=new b2Vec2;k.x=r.col1.x*a+r.col2.x*-v;k.y=r.col1.y*a+r.col2.y*-v}else{this.m_vertexCount=a.vertexCount;b2Shape.PolyCentroid(a.vertices,a.vertexCount,b2PolyShape.tempVec);
v=b2PolyShape.tempVec.x;var C=b2PolyShape.tempVec.y;this.m_localCentroid.x=a.localPosition.x+(r.col1.x*v+r.col2.x*C)-g.x;this.m_localCentroid.y=a.localPosition.y+(r.col1.y*v+r.col2.y*C)-g.y;for(k=0;k<this.m_vertexCount;++k){this.m_vertices[k]=new b2Vec2;this.m_coreVertices[k]=new b2Vec2;g=a.vertices[k].x-v;s=a.vertices[k].y-C;this.m_vertices[k].x=r.col1.x*g+r.col2.x*s;this.m_vertices[k].y=r.col1.y*g+r.col2.y*s;g=this.m_vertices[k].x;s=this.m_vertices[k].y;var F=Math.sqrt(g*g+s*s);if(F>Number.MIN_VALUE){g*=
1/F;s*=1/F}this.m_coreVertices[k].x=this.m_vertices[k].x-2*b2Settings.b2_linearSlop*g;this.m_coreVertices[k].y=this.m_vertices[k].y-2*b2Settings.b2_linearSlop*s}}a=r=Number.MAX_VALUE;g=-Number.MAX_VALUE;s=-Number.MAX_VALUE;for(k=this.m_maxRadius=0;k<this.m_vertexCount;++k){v=this.m_vertices[k];r=Math.min(r,v.x);a=Math.min(a,v.y);g=Math.max(g,v.x);s=Math.max(s,v.y);this.m_maxRadius=Math.max(this.m_maxRadius,v.Length())}this.m_localOBB.R.SetIdentity();this.m_localOBB.center.Set((r+g)*0.5,(a+s)*0.5);
this.m_localOBB.extents.Set((g-r)*0.5,(s-a)*0.5);for(k=0;k<this.m_vertexCount;++k){this.m_normals[k]=new b2Vec2;r=k;a=k+1<this.m_vertexCount?k+1:0;this.m_normals[k].x=this.m_vertices[a].y-this.m_vertices[r].y;this.m_normals[k].y=-(this.m_vertices[a].x-this.m_vertices[r].x);this.m_normals[k].Normalize()}for(k=0;k<this.m_vertexCount;++k);this.m_R.SetM(this.m_body.m_R);this.m_position.x=this.m_body.m_position.x+(this.m_R.col1.x*this.m_localCentroid.x+this.m_R.col2.x*this.m_localCentroid.y);this.m_position.y=
this.m_body.m_position.y+(this.m_R.col1.y*this.m_localCentroid.x+this.m_R.col2.y*this.m_localCentroid.y);b2PolyShape.tAbsR.col1.x=this.m_R.col1.x*this.m_localOBB.R.col1.x+this.m_R.col2.x*this.m_localOBB.R.col1.y;b2PolyShape.tAbsR.col1.y=this.m_R.col1.y*this.m_localOBB.R.col1.x+this.m_R.col2.y*this.m_localOBB.R.col1.y;b2PolyShape.tAbsR.col2.x=this.m_R.col1.x*this.m_localOBB.R.col2.x+this.m_R.col2.x*this.m_localOBB.R.col2.y;b2PolyShape.tAbsR.col2.y=this.m_R.col1.y*this.m_localOBB.R.col2.x+this.m_R.col2.y*
this.m_localOBB.R.col2.y;b2PolyShape.tAbsR.Abs();g=b2PolyShape.tAbsR.col1.x*this.m_localOBB.extents.x+b2PolyShape.tAbsR.col2.x*this.m_localOBB.extents.y;s=b2PolyShape.tAbsR.col1.y*this.m_localOBB.extents.x+b2PolyShape.tAbsR.col2.y*this.m_localOBB.extents.y;k=this.m_position.x+(this.m_R.col1.x*this.m_localOBB.center.x+this.m_R.col2.x*this.m_localOBB.center.y);r=this.m_position.y+(this.m_R.col1.y*this.m_localOBB.center.x+this.m_R.col2.y*this.m_localOBB.center.y);f.minVertex.x=k-g;f.minVertex.y=r-s;
f.maxVertex.x=k+g;f.maxVertex.y=r+s;k=this.m_body.m_world.m_broadPhase;this.m_proxyId=k.InRange(f)?k.CreateProxy(f,this):b2Pair.b2_nullProxy;this.m_proxyId==b2Pair.b2_nullProxy&&this.m_body.Freeze()},syncAABB:new b2AABB,syncMat:new b2Mat22,Synchronize:function(a,f,g,k){this.m_R.SetM(k);this.m_position.x=this.m_body.m_position.x+(k.col1.x*this.m_localCentroid.x+k.col2.x*this.m_localCentroid.y);this.m_position.y=this.m_body.m_position.y+(k.col1.y*this.m_localCentroid.x+k.col2.y*this.m_localCentroid.y);
if(this.m_proxyId!=b2Pair.b2_nullProxy){var s,r;s=f.col1;r=f.col2;var v=this.m_localOBB.R.col1,C=this.m_localOBB.R.col2;this.syncMat.col1.x=s.x*v.x+r.x*v.y;this.syncMat.col1.y=s.y*v.x+r.y*v.y;this.syncMat.col2.x=s.x*C.x+r.x*C.y;this.syncMat.col2.y=s.y*C.x+r.y*C.y;this.syncMat.Abs();s=this.m_localCentroid.x+this.m_localOBB.center.x;r=this.m_localCentroid.y+this.m_localOBB.center.y;v=a.x+(f.col1.x*s+f.col2.x*r);a=a.y+(f.col1.y*s+f.col2.y*r);s=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*
this.m_localOBB.extents.y;r=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=v-s;this.syncAABB.minVertex.y=a-r;this.syncAABB.maxVertex.x=v+s;this.syncAABB.maxVertex.y=a+r;s=k.col1;r=k.col2;v=this.m_localOBB.R.col1;C=this.m_localOBB.R.col2;this.syncMat.col1.x=s.x*v.x+r.x*v.y;this.syncMat.col1.y=s.y*v.x+r.y*v.y;this.syncMat.col2.x=s.x*C.x+r.x*C.y;this.syncMat.col2.y=s.y*C.x+r.y*C.y;this.syncMat.Abs();s=this.m_localCentroid.x+this.m_localOBB.center.x;
r=this.m_localCentroid.y+this.m_localOBB.center.y;v=g.x+(k.col1.x*s+k.col2.x*r);a=g.y+(k.col1.y*s+k.col2.y*r);s=this.syncMat.col1.x*this.m_localOBB.extents.x+this.syncMat.col2.x*this.m_localOBB.extents.y;r=this.syncMat.col1.y*this.m_localOBB.extents.x+this.syncMat.col2.y*this.m_localOBB.extents.y;this.syncAABB.minVertex.x=Math.min(this.syncAABB.minVertex.x,v-s);this.syncAABB.minVertex.y=Math.min(this.syncAABB.minVertex.y,a-r);this.syncAABB.maxVertex.x=Math.max(this.syncAABB.maxVertex.x,v+s);this.syncAABB.maxVertex.y=
Math.max(this.syncAABB.maxVertex.y,a+r);g=this.m_body.m_world.m_broadPhase;g.InRange(this.syncAABB)?g.MoveProxy(this.m_proxyId,this.syncAABB):this.m_body.Freeze()}},QuickSync:function(a,f){this.m_R.SetM(f);this.m_position.x=a.x+(f.col1.x*this.m_localCentroid.x+f.col2.x*this.m_localCentroid.y);this.m_position.y=a.y+(f.col1.y*this.m_localCentroid.x+f.col2.y*this.m_localCentroid.y)},ResetProxy:function(a){if(this.m_proxyId!=b2Pair.b2_nullProxy){a.GetProxy(this.m_proxyId);a.DestroyProxy(this.m_proxyId);
var f=b2Math.b2MulMM(this.m_R,this.m_localOBB.R);f=b2Math.b2AbsM(f);f=b2Math.b2MulMV(f,this.m_localOBB.extents);var g=b2Math.b2MulMV(this.m_R,this.m_localOBB.center);g.Add(this.m_position);var k=new b2AABB;k.minVertex.SetV(g);k.minVertex.Subtract(f);k.maxVertex.SetV(g);k.maxVertex.Add(f);this.m_proxyId=a.InRange(k)?a.CreateProxy(k,this):b2Pair.b2_nullProxy;this.m_proxyId==b2Pair.b2_nullProxy&&this.m_body.Freeze()}},Support:function(a,f,g){var k=a*this.m_R.col1.x+f*this.m_R.col1.y;a=a*this.m_R.col2.x+
f*this.m_R.col2.y;f=0;for(var s=this.m_coreVertices[0].x*k+this.m_coreVertices[0].y*a,r=1;r<this.m_vertexCount;++r){var v=this.m_coreVertices[r].x*k+this.m_coreVertices[r].y*a;if(v>s){f=r;s=v}}g.Set(this.m_position.x+(this.m_R.col1.x*this.m_coreVertices[f].x+this.m_R.col2.x*this.m_coreVertices[f].y),this.m_position.y+(this.m_R.col1.y*this.m_coreVertices[f].x+this.m_R.col2.y*this.m_coreVertices[f].y))},m_localCentroid:new b2Vec2,m_localOBB:new b2OBB,m_vertices:null,m_coreVertices:null,m_vertexCount:0,
m_normals:null});b2PolyShape.tempVec=new b2Vec2;b2PolyShape.tAbsR=new b2Mat22;var b2Body=Class.create();
b2Body.prototype={SetOriginPosition:function(a,f){if(!this.IsFrozen()){this.m_rotation=f;this.m_R.Set(this.m_rotation);this.m_position=b2Math.AddVV(a,b2Math.b2MulMV(this.m_R,this.m_center));this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;for(var g=this.m_shapeList;g!=null;g=g.m_next)g.Synchronize(this.m_position,this.m_R,this.m_position,this.m_R);this.m_world.m_broadPhase.Commit()}},GetOriginPosition:function(){return b2Math.SubtractVV(this.m_position,b2Math.b2MulMV(this.m_R,
this.m_center))},SetCenterPosition:function(a,f){if(!this.IsFrozen()){this.m_rotation=f;this.m_R.Set(this.m_rotation);this.m_position.SetV(a);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;for(var g=this.m_shapeList;g!=null;g=g.m_next)g.Synchronize(this.m_position,this.m_R,this.m_position,this.m_R);this.m_world.m_broadPhase.Commit()}},GetCenterPosition:function(){return this.m_position},GetRotation:function(){return this.m_rotation},GetRotationMatrix:function(){return this.m_R},
SetLinearVelocity:function(a){this.m_linearVelocity.SetV(a)},GetLinearVelocity:function(){return this.m_linearVelocity},SetAngularVelocity:function(a){this.m_angularVelocity=a},GetAngularVelocity:function(){return this.m_angularVelocity},ApplyForce:function(a,f){if(this.IsSleeping()==false){this.m_force.Add(a);this.m_torque+=b2Math.b2CrossVV(b2Math.SubtractVV(f,this.m_position),a)}},ApplyTorque:function(a){if(this.IsSleeping()==false)this.m_torque+=a},ApplyImpulse:function(a,f){if(this.IsSleeping()==
false){this.m_linearVelocity.Add(b2Math.MulFV(this.m_invMass,a));this.m_angularVelocity+=this.m_invI*b2Math.b2CrossVV(b2Math.SubtractVV(f,this.m_position),a)}},GetMass:function(){return this.m_mass},GetInertia:function(){return this.m_I},GetWorldPoint:function(a){return b2Math.AddVV(this.m_position,b2Math.b2MulMV(this.m_R,a))},GetWorldVector:function(a){return b2Math.b2MulMV(this.m_R,a)},GetLocalPoint:function(a){return b2Math.b2MulTMV(this.m_R,b2Math.SubtractVV(a,this.m_position))},GetLocalVector:function(a){return b2Math.b2MulTMV(this.m_R,
a)},IsStatic:function(){return(this.m_flags&b2Body.e_staticFlag)==b2Body.e_staticFlag},IsFrozen:function(){return(this.m_flags&b2Body.e_frozenFlag)==b2Body.e_frozenFlag},IsSleeping:function(){return(this.m_flags&b2Body.e_sleepFlag)==b2Body.e_sleepFlag},AllowSleeping:function(a){if(a)this.m_flags|=b2Body.e_allowSleepFlag;else{this.m_flags&=~b2Body.e_allowSleepFlag;this.WakeUp()}},WakeUp:function(){this.m_flags&=~b2Body.e_sleepFlag;this.m_sleepTime=0},GetShapeList:function(){return this.m_shapeList},
GetContactList:function(){return this.m_contactList},GetJointList:function(){return this.m_jointList},GetNext:function(){return this.m_next},GetUserData:function(){return this.m_userData},initialize:function(a,f){this.sMat0=new b2Mat22;this.m_position=new b2Vec2;this.m_R=new b2Mat22(0);this.m_position0=new b2Vec2;var g=0,k,s;this.m_flags=0;this.m_position.SetV(a.position);this.m_rotation=a.rotation;this.m_R.Set(this.m_rotation);this.m_position0.SetV(this.m_position);this.m_rotation0=this.m_rotation;
this.m_world=f;this.m_linearDamping=b2Math.b2Clamp(1-a.linearDamping,0,1);this.m_angularDamping=b2Math.b2Clamp(1-a.angularDamping,0,1);this.m_force=new b2Vec2(0,0);this.m_mass=this.m_torque=0;var r=Array(b2Settings.b2_maxShapesPerBody);for(g=0;g<b2Settings.b2_maxShapesPerBody;g++)r[g]=new b2MassData;this.m_shapeCount=0;this.m_center=new b2Vec2(0,0);for(g=0;g<b2Settings.b2_maxShapesPerBody;++g){k=a.shapes[g];if(k==null)break;s=r[g];k.ComputeMass(s);this.m_mass+=s.mass;this.m_center.x+=s.mass*(k.localPosition.x+
s.center.x);this.m_center.y+=s.mass*(k.localPosition.y+s.center.y);++this.m_shapeCount}if(this.m_mass>0){this.m_center.Multiply(1/this.m_mass);this.m_position.Add(b2Math.b2MulMV(this.m_R,this.m_center))}else this.m_flags|=b2Body.e_staticFlag;for(g=this.m_I=0;g<this.m_shapeCount;++g){k=a.shapes[g];s=r[g];this.m_I+=s.I;k=b2Math.SubtractVV(b2Math.AddVV(k.localPosition,s.center),this.m_center);this.m_I+=s.mass*b2Math.b2Dot(k,k)}this.m_invMass=this.m_mass>0?1/this.m_mass:0;this.m_invI=this.m_I>0&&a.preventRotation==
false?1/this.m_I:this.m_I=0;this.m_linearVelocity=b2Math.AddVV(a.linearVelocity,b2Math.b2CrossFV(a.angularVelocity,this.m_center));this.m_angularVelocity=a.angularVelocity;this.m_shapeList=this.m_next=this.m_prev=this.m_contactList=this.m_jointList=null;for(g=0;g<this.m_shapeCount;++g){k=a.shapes[g];s=b2Shape.Create(k,this,this.m_center);s.m_next=this.m_shapeList;this.m_shapeList=s}this.m_sleepTime=0;if(a.allowSleep)this.m_flags|=b2Body.e_allowSleepFlag;if(a.isSleeping)this.m_flags|=b2Body.e_sleepFlag;
if(this.m_flags&b2Body.e_sleepFlag||this.m_invMass==0){this.m_linearVelocity.Set(0,0);this.m_angularVelocity=0}this.m_userData=a.userData},Destroy:function(){for(var a=this.m_shapeList;a;){var f=a;a=a.m_next;b2Shape.Destroy(f)}},sMat0:new b2Mat22,SynchronizeShapes:function(){this.sMat0.Set(this.m_rotation0);for(var a=this.m_shapeList;a!=null;a=a.m_next)a.Synchronize(this.m_position0,this.sMat0,this.m_position,this.m_R)},QuickSyncShapes:function(){for(var a=this.m_shapeList;a!=null;a=a.m_next)a.QuickSync(this.m_position,
this.m_R)},IsConnected:function(a){for(var f=this.m_jointList;f!=null;f=f.next)if(f.other==a)return f.joint.m_collideConnected==false;return false},Freeze:function(){this.m_flags|=b2Body.e_frozenFlag;this.m_linearVelocity.SetZero();this.m_angularVelocity=0;for(var a=this.m_shapeList;a!=null;a=a.m_next)a.DestroyProxy()},m_flags:0,m_position:new b2Vec2,m_rotation:null,m_R:new b2Mat22(0),m_position0:new b2Vec2,m_rotation0:null,m_linearVelocity:null,m_angularVelocity:null,m_force:null,m_torque:null,m_center:null,
m_world:null,m_prev:null,m_next:null,m_shapeList:null,m_shapeCount:0,m_jointList:null,m_contactList:null,m_mass:null,m_invMass:null,m_I:null,m_invI:null,m_linearDamping:null,m_angularDamping:null,m_sleepTime:null,m_userData:null};b2Body.e_staticFlag=1;b2Body.e_frozenFlag=2;b2Body.e_islandFlag=4;b2Body.e_sleepFlag=8;b2Body.e_allowSleepFlag=16;b2Body.e_destroyFlag=32;var b2BodyDef=Class.create();
b2BodyDef.prototype={initialize:function(){this.shapes=[];this.userData=null;for(var a=0;a<b2Settings.b2_maxShapesPerBody;a++)this.shapes[a]=null;this.position=new b2Vec2(0,0);this.rotation=0;this.linearVelocity=new b2Vec2(0,0);this.angularDamping=this.linearDamping=this.angularVelocity=0;this.allowSleep=true;this.preventRotation=this.isSleeping=false},userData:null,shapes:[],position:null,rotation:null,linearVelocity:null,angularVelocity:null,linearDamping:null,angularDamping:null,allowSleep:null,
isSleeping:null,preventRotation:null,AddShape:function(a){for(var f=0;f<b2Settings.b2_maxShapesPerBody;++f)if(this.shapes[f]==null){this.shapes[f]=a;break}}};var b2CollisionFilter=Class.create();b2CollisionFilter.prototype={ShouldCollide:function(a,f){if(a.m_groupIndex==f.m_groupIndex&&a.m_groupIndex!=0)return a.m_groupIndex>0;return(a.m_maskBits&f.m_categoryBits)!=0&&(a.m_categoryBits&f.m_maskBits)!=0},initialize:function(){}};b2CollisionFilter.b2_defaultFilter=new b2CollisionFilter;
var b2Island=Class.create();
b2Island.prototype={initialize:function(a,f,g,k){var s=0;this.m_bodyCapacity=a;this.m_contactCapacity=f;this.m_jointCapacity=g;this.m_jointCount=this.m_contactCount=this.m_bodyCount=0;this.m_bodies=Array(a);for(s=0;s<a;s++)this.m_bodies[s]=null;this.m_contacts=Array(f);for(s=0;s<f;s++)this.m_contacts[s]=null;this.m_joints=Array(g);for(s=0;s<g;s++)this.m_joints[s]=null;this.m_allocator=k},Clear:function(){this.m_jointCount=this.m_contactCount=this.m_bodyCount=0},Solve:function(a,f){var g=0,k;for(g=
0;g<this.m_bodyCount;++g){k=this.m_bodies[g];if(k.m_invMass!=0){k.m_linearVelocity.Add(b2Math.MulFV(a.dt,b2Math.AddVV(f,b2Math.MulFV(k.m_invMass,k.m_force))));k.m_angularVelocity+=a.dt*k.m_invI*k.m_torque;k.m_linearVelocity.Multiply(k.m_linearDamping);k.m_angularVelocity*=k.m_angularDamping;k.m_position0.SetV(k.m_position);k.m_rotation0=k.m_rotation}}var s=new b2ContactSolver(this.m_contacts,this.m_contactCount,this.m_allocator);s.PreSolve();for(g=0;g<this.m_jointCount;++g)this.m_joints[g].PrepareVelocitySolver();
for(g=0;g<a.iterations;++g){s.SolveVelocityConstraints();for(k=0;k<this.m_jointCount;++k)this.m_joints[k].SolveVelocityConstraints(a)}for(g=0;g<this.m_bodyCount;++g){k=this.m_bodies[g];if(k.m_invMass!=0){k.m_position.x+=a.dt*k.m_linearVelocity.x;k.m_position.y+=a.dt*k.m_linearVelocity.y;k.m_rotation+=a.dt*k.m_angularVelocity;k.m_R.Set(k.m_rotation)}}for(g=0;g<this.m_jointCount;++g)this.m_joints[g].PreparePositionSolver();if(b2World.s_enablePositionCorrection)for(b2Island.m_positionIterationCount=
0;b2Island.m_positionIterationCount<a.iterations;++b2Island.m_positionIterationCount){k=s.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);var r=true;for(g=0;g<this.m_jointCount;++g){var v=this.m_joints[g].SolvePositionConstraints();r=r&&v}if(k&&r)break}s.PostSolve();for(g=0;g<this.m_bodyCount;++g){k=this.m_bodies[g];if(k.m_invMass!=0){k.m_R.Set(k.m_rotation);k.SynchronizeShapes();k.m_force.Set(0,0);k.m_torque=0}}},UpdateSleep:function(a){var f=0,g,k=Number.MAX_VALUE,s=b2Settings.b2_linearSleepTolerance*
b2Settings.b2_linearSleepTolerance,r=b2Settings.b2_angularSleepTolerance*b2Settings.b2_angularSleepTolerance;for(f=0;f<this.m_bodyCount;++f){g=this.m_bodies[f];if(g.m_invMass!=0){if((g.m_flags&b2Body.e_allowSleepFlag)==0)k=g.m_sleepTime=0;if((g.m_flags&b2Body.e_allowSleepFlag)==0||g.m_angularVelocity*g.m_angularVelocity>r||b2Math.b2Dot(g.m_linearVelocity,g.m_linearVelocity)>s)k=g.m_sleepTime=0;else{g.m_sleepTime+=a;k=b2Math.b2Min(k,g.m_sleepTime)}}}if(k>=b2Settings.b2_timeToSleep)for(f=0;f<this.m_bodyCount;++f){g=
this.m_bodies[f];g.m_flags|=b2Body.e_sleepFlag}},AddBody:function(a){this.m_bodies[this.m_bodyCount++]=a},AddContact:function(a){this.m_contacts[this.m_contactCount++]=a},AddJoint:function(a){this.m_joints[this.m_jointCount++]=a},m_allocator:null,m_bodies:null,m_contacts:null,m_joints:null,m_bodyCount:0,m_jointCount:0,m_contactCount:0,m_bodyCapacity:0,m_contactCapacity:0,m_jointCapacity:0,m_positionError:null};b2Island.m_positionIterationCount=0;var b2TimeStep=Class.create();
b2TimeStep.prototype={dt:null,inv_dt:null,iterations:0,initialize:function(){}};var b2ContactNode=Class.create();b2ContactNode.prototype={other:null,contact:null,prev:null,next:null,initialize:function(){}};var b2Contact=Class.create();
b2Contact.prototype={GetManifolds:function(){return null},GetManifoldCount:function(){return this.m_manifoldCount},GetNext:function(){return this.m_next},GetShape1:function(){return this.m_shape1},GetShape2:function(){return this.m_shape2},initialize:function(a,f){this.m_node1=new b2ContactNode;this.m_node2=new b2ContactNode;this.m_flags=0;if(!a||!f)this.m_shape2=this.m_shape1=null;else{this.m_shape1=a;this.m_shape2=f;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);
this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_next=this.m_prev=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null}},Evaluate:function(){},m_flags:0,m_prev:null,m_next:null,m_node1:new b2ContactNode,m_node2:new b2ContactNode,m_shape1:null,m_shape2:null,m_manifoldCount:0,m_friction:null,m_restitution:null};
b2Contact.e_islandFlag=1;b2Contact.e_destroyFlag=2;b2Contact.AddType=function(a,f,g,k){b2Contact.s_registers[g][k].createFcn=a;b2Contact.s_registers[g][k].destroyFcn=f;b2Contact.s_registers[g][k].primary=true;if(g!=k){b2Contact.s_registers[k][g].createFcn=a;b2Contact.s_registers[k][g].destroyFcn=f;b2Contact.s_registers[k][g].primary=false}};
b2Contact.InitializeRegisters=function(){b2Contact.s_registers=Array(b2Shape.e_shapeTypeCount);for(var a=0;a<b2Shape.e_shapeTypeCount;a++){b2Contact.s_registers[a]=Array(b2Shape.e_shapeTypeCount);for(var f=0;f<b2Shape.e_shapeTypeCount;f++)b2Contact.s_registers[a][f]=new b2ContactRegister}b2Contact.AddType(b2CircleContact.Create,b2CircleContact.Destroy,b2Shape.e_circleShape,b2Shape.e_circleShape);b2Contact.AddType(b2PolyAndCircleContact.Create,b2PolyAndCircleContact.Destroy,b2Shape.e_polyShape,b2Shape.e_circleShape);
b2Contact.AddType(b2PolyContact.Create,b2PolyContact.Destroy,b2Shape.e_polyShape,b2Shape.e_polyShape)};b2Contact.Create=function(a,f,g){if(b2Contact.s_initialized==false){b2Contact.InitializeRegisters();b2Contact.s_initialized=true}var k=a.m_type,s=f.m_type,r=b2Contact.s_registers[k][s].createFcn;if(r)if(b2Contact.s_registers[k][s].primary)return r(a,f,g);else{a=r(f,a,g);for(f=0;f<a.GetManifoldCount();++f){g=a.GetManifolds()[f];g.normal=g.normal.Negative()}return a}else return null};
b2Contact.Destroy=function(a,f){if(a.GetManifoldCount()>0){a.m_shape1.m_body.WakeUp();a.m_shape2.m_body.WakeUp()}var g=b2Contact.s_registers[a.m_shape1.m_type][a.m_shape2.m_type].destroyFcn;g(a,f)};b2Contact.s_registers=null;b2Contact.s_initialized=false;var b2ContactConstraint=Class.create();
b2ContactConstraint.prototype={initialize:function(){this.normal=new b2Vec2;this.points=Array(b2Settings.b2_maxManifoldPoints);for(var a=0;a<b2Settings.b2_maxManifoldPoints;a++)this.points[a]=new b2ContactConstraintPoint},points:null,normal:new b2Vec2,manifold:null,body1:null,body2:null,friction:null,restitution:null,pointCount:0};var b2ContactConstraintPoint=Class.create();
b2ContactConstraintPoint.prototype={localAnchor1:new b2Vec2,localAnchor2:new b2Vec2,normalImpulse:null,tangentImpulse:null,positionImpulse:null,normalMass:null,tangentMass:null,separation:null,velocityBias:null,initialize:function(){this.localAnchor1=new b2Vec2;this.localAnchor2=new b2Vec2}};var b2ContactRegister=Class.create();b2ContactRegister.prototype={createFcn:null,destroyFcn:null,primary:null,initialize:function(){}};var b2ContactSolver=Class.create();
b2ContactSolver.prototype={initialize:function(a,f,g){this.m_constraints=[];this.m_allocator=g;var k,s;for(g=this.m_constraintCount=0;g<f;++g)this.m_constraintCount+=a[g].GetManifoldCount();for(g=0;g<this.m_constraintCount;g++)this.m_constraints[g]=new b2ContactConstraint;var r=0;for(g=0;g<f;++g){var v=a[g],C=v.m_shape1.m_body,F=v.m_shape2.m_body,H=v.GetManifoldCount(),K=v.GetManifolds(),M=v.m_friction;v=v.m_restitution;for(var Q=C.m_linearVelocity.x,S=C.m_linearVelocity.y,W=F.m_linearVelocity.x,
ha=F.m_linearVelocity.y,fa=C.m_angularVelocity,ia=F.m_angularVelocity,Aa=0;Aa<H;++Aa){var ra=K[Aa],xa=ra.normal.x,Qa=ra.normal.y,Ia=this.m_constraints[r];Ia.body1=C;Ia.body2=F;Ia.manifold=ra;Ia.normal.x=xa;Ia.normal.y=Qa;Ia.pointCount=ra.pointCount;Ia.friction=M;Ia.restitution=v;for(var V=0;V<Ia.pointCount;++V){var l=ra.points[V],wa=Ia.points[V];wa.normalImpulse=l.normalImpulse;wa.tangentImpulse=l.tangentImpulse;wa.separation=l.separation;var Da=l.position.x-C.m_position.x,Ca=l.position.y-C.m_position.y,
Ea=l.position.x-F.m_position.x;l=l.position.y-F.m_position.y;k=wa.localAnchor1;s=C.m_R;k.x=Da*s.col1.x+Ca*s.col1.y;k.y=Da*s.col2.x+Ca*s.col2.y;k=wa.localAnchor2;s=F.m_R;k.x=Ea*s.col1.x+l*s.col1.y;k.y=Ea*s.col2.x+l*s.col2.y;k=Da*Da+Ca*Ca;s=Ea*Ea+l*l;var ua=Da*xa+Ca*Qa,ab=Ea*xa+l*Qa,ba=C.m_invMass+F.m_invMass;ba+=C.m_invI*(k-ua*ua)+F.m_invI*(s-ab*ab);wa.normalMass=1/ba;ab=Qa;ba=-xa;ua=Da*ab+Ca*ba;ab=Ea*ab+l*ba;ba=C.m_invMass+F.m_invMass;ba+=C.m_invI*(k-ua*ua)+F.m_invI*(s-ab*ab);wa.tangentMass=1/ba;
wa.velocityBias=0;if(wa.separation>0)wa.velocityBias=-60*wa.separation;Da=Ia.normal.x*(W+-ia*l-Q- -fa*Ca)+Ia.normal.y*(ha+ia*Ea-S-fa*Da);if(Da<-b2Settings.b2_velocityThreshold)wa.velocityBias+=-Ia.restitution*Da}++r}}},PreSolve:function(){for(var a,f,g=0;g<this.m_constraintCount;++g){var k=this.m_constraints[g],s=k.body1,r=k.body2,v=s.m_invMass,C=s.m_invI,F=r.m_invMass,H=r.m_invI,K=k.normal.x,M=k.normal.y,Q=M,S=-K,W=0,ha=0;if(b2World.s_enableWarmStarting){ha=k.pointCount;for(W=0;W<ha;++W){var fa=
k.points[W],ia=fa.normalImpulse*K+fa.tangentImpulse*Q,Aa=fa.normalImpulse*M+fa.tangentImpulse*S;f=s.m_R;a=fa.localAnchor1;var ra=f.col1.x*a.x+f.col2.x*a.y,xa=f.col1.y*a.x+f.col2.y*a.y;f=r.m_R;a=fa.localAnchor2;var Qa=f.col1.x*a.x+f.col2.x*a.y;a=f.col1.y*a.x+f.col2.y*a.y;s.m_angularVelocity-=C*(ra*Aa-xa*ia);s.m_linearVelocity.x-=v*ia;s.m_linearVelocity.y-=v*Aa;r.m_angularVelocity+=H*(Qa*Aa-a*ia);r.m_linearVelocity.x+=F*ia;r.m_linearVelocity.y+=F*Aa;fa.positionImpulse=0}}else{ha=k.pointCount;for(W=
0;W<ha;++W){s=k.points[W];s.normalImpulse=0;s.tangentImpulse=0;s.positionImpulse=0}}}},SolveVelocityConstraints:function(){for(var a=0,f,g,k,s,r,v,C,F,H=0;H<this.m_constraintCount;++H){var K=this.m_constraints[H],M=K.body1,Q=K.body2,S=M.m_angularVelocity,W=M.m_linearVelocity,ha=Q.m_angularVelocity,fa=Q.m_linearVelocity,ia=M.m_invMass,Aa=M.m_invI,ra=Q.m_invMass,xa=Q.m_invI,Qa=K.normal.x,Ia=K.normal.y,V=Ia,l=-Qa,wa=K.pointCount;for(a=0;a<wa;++a){f=K.points[a];r=M.m_R;v=f.localAnchor1;g=r.col1.x*v.x+
r.col2.x*v.y;k=r.col1.y*v.x+r.col2.y*v.y;r=Q.m_R;v=f.localAnchor2;s=r.col1.x*v.x+r.col2.x*v.y;r=r.col1.y*v.x+r.col2.y*v.y;v=fa.x+-ha*r-W.x- -S*k;C=fa.y+ha*s-W.y-S*g;v=-f.normalMass*(v*Qa+C*Ia-f.velocityBias);C=b2Math.b2Max(f.normalImpulse+v,0);v=C-f.normalImpulse;F=v*Qa;v*=Ia;W.x-=ia*F;W.y-=ia*v;S-=Aa*(g*v-k*F);fa.x+=ra*F;fa.y+=ra*v;ha+=xa*(s*v-r*F);f.normalImpulse=C;v=fa.x+-ha*r-W.x- -S*k;C=fa.y+ha*s-W.y-S*g;v=f.tangentMass*-(v*V+C*l);C=K.friction*f.normalImpulse;C=b2Math.b2Clamp(f.tangentImpulse+
v,-C,C);v=C-f.tangentImpulse;F=v*V;v*=l;W.x-=ia*F;W.y-=ia*v;S-=Aa*(g*v-k*F);fa.x+=ra*F;fa.y+=ra*v;ha+=xa*(s*v-r*F);f.tangentImpulse=C}M.m_angularVelocity=S;Q.m_angularVelocity=ha}},SolvePositionConstraints:function(a){for(var f=0,g,k,s=0;s<this.m_constraintCount;++s){for(var r=this.m_constraints[s],v=r.body1,C=r.body2,F=v.m_position,H=v.m_rotation,K=C.m_position,M=C.m_rotation,Q=v.m_invMass,S=v.m_invI,W=C.m_invMass,ha=C.m_invI,fa=r.normal.x,ia=r.normal.y,Aa=r.pointCount,ra=0;ra<Aa;++ra){var xa=r.points[ra];
g=v.m_R;k=xa.localAnchor1;var Qa=g.col1.x*k.x+g.col2.x*k.y,Ia=g.col1.y*k.x+g.col2.y*k.y;g=C.m_R;k=xa.localAnchor2;var V=g.col1.x*k.x+g.col2.x*k.y;g=g.col1.y*k.x+g.col2.y*k.y;k=(K.x+V-(F.x+Qa))*fa+(K.y+g-(F.y+Ia))*ia+xa.separation;f=b2Math.b2Min(f,k);k=a*b2Math.b2Clamp(k+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0);k=-xa.normalMass*k;var l=xa.positionImpulse;xa.positionImpulse=b2Math.b2Max(l+k,0);k=xa.positionImpulse-l;xa=k*fa;k*=ia;F.x-=Q*xa;F.y-=Q*k;H-=S*(Qa*k-Ia*xa);v.m_R.Set(H);
K.x+=W*xa;K.y+=W*k;M+=ha*(V*k-g*xa);C.m_R.Set(M)}v.m_rotation=H;C.m_rotation=M}return f>=-b2Settings.b2_linearSlop},PostSolve:function(){for(var a=0;a<this.m_constraintCount;++a)for(var f=this.m_constraints[a],g=f.manifold,k=0;k<f.pointCount;++k){var s=g.points[k],r=f.points[k];s.normalImpulse=r.normalImpulse;s.tangentImpulse=r.tangentImpulse}},m_allocator:null,m_constraints:[],m_constraintCount:0};var b2CircleContact=Class.create();Object.extend(b2CircleContact.prototype,b2Contact.prototype);
Object.extend(b2CircleContact.prototype,{initialize:function(a,f){this.m_node1=new b2ContactNode;this.m_node2=new b2ContactNode;this.m_flags=0;if(!a||!f)this.m_shape2=this.m_shape1=null;else{this.m_shape1=a;this.m_shape2=f;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_next=this.m_prev=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=
null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold];this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0;this.m_manifold[0].points[0].tangentImpulse=0}},Evaluate:function(){b2Collision.b2CollideCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,false);this.m_manifoldCount=this.m_manifold[0].pointCount>0?1:0},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold]});
b2CircleContact.Create=function(a,f){return new b2CircleContact(a,f)};b2CircleContact.Destroy=function(){};var b2Conservative=Class.create();b2Conservative.prototype={initialize:function(){}};b2Conservative.R1=new b2Mat22;b2Conservative.R2=new b2Mat22;b2Conservative.x1=new b2Vec2;b2Conservative.x2=new b2Vec2;
b2Conservative.Conservative=function(a,f){var g=a.GetBody(),k=f.GetBody(),s=g.m_position.x-g.m_position0.x,r=g.m_position.y-g.m_position0.y,v=g.m_rotation-g.m_rotation0,C=k.m_position.x-k.m_position0.x,F=k.m_position.y-k.m_position0.y,H=k.m_rotation-k.m_rotation0,K=a.GetMaxRadius(),M=f.GetMaxRadius(),Q=g.m_position0.x,S=g.m_position0.y,W=g.m_rotation0,ha=k.m_position0.x,fa=k.m_position0.y,ia=k.m_rotation0,Aa=Q,ra=S,xa=W,Qa=ha,Ia=fa,V=ia;b2Conservative.R1.Set(xa);b2Conservative.R2.Set(V);a.QuickSync(p1,
b2Conservative.R1);f.QuickSync(p2,b2Conservative.R2);var l=0,wa,Da;wa=0;for(var Ca=true,Ea=0;Ea<10;++Ea){var ua=b2Distance.Distance(b2Conservative.x1,b2Conservative.x2,a,f);if(ua<b2Settings.b2_linearSlop){Ca=Ea==0?false:true;break}if(Ea==0){wa=b2Conservative.x2.x-b2Conservative.x1.x;Da=b2Conservative.x2.y-b2Conservative.x1.y;wa=wa*(s-C)+Da*(r-F)+Math.abs(v)*K+Math.abs(H)*M;if(Math.abs(wa)<Number.MIN_VALUE){Ca=false;break}wa=1/wa}ua=l+ua*wa;if(ua<0||1<ua){Ca=false;break}if(ua<(1+100*Number.MIN_VALUE)*
l){Ca=true;break}l=ua;Aa=Q+l*v1.x;ra=S+l*v1.y;xa=W+l*v;Qa=ha+l*v2.x;Ia=fa+l*v2.y;V=ia+l*H;b2Conservative.R1.Set(xa);b2Conservative.R2.Set(V);a.QuickSync(p1,b2Conservative.R1);f.QuickSync(p2,b2Conservative.R2)}if(Ca){wa=b2Conservative.x2.x-b2Conservative.x1.x;Da=b2Conservative.x2.y-b2Conservative.x1.y;s=Math.sqrt(wa*wa+Da*Da);if(s>FLT_EPSILON)d*=b2_linearSlop/s;if(g.IsStatic()){g.m_position.x=Aa;g.m_position.y=ra}else{g.m_position.x=Aa-wa;g.m_position.y=ra-Da}g.m_rotation=xa;g.m_R.Set(xa);g.QuickSyncShapes();
if(k.IsStatic()){k.m_position.x=Qa;k.m_position.y=Ia}else{k.m_position.x=Qa+wa;k.m_position.y=Ia+Da}k.m_position.x=Qa+wa;k.m_position.y=Ia+Da;k.m_rotation=V;k.m_R.Set(V);k.QuickSyncShapes();return true}a.QuickSync(g.m_position,g.m_R);f.QuickSync(k.m_position,k.m_R);return false};var b2NullContact=Class.create();Object.extend(b2NullContact.prototype,b2Contact.prototype);
Object.extend(b2NullContact.prototype,{initialize:function(a,f){this.m_node1=new b2ContactNode;this.m_node2=new b2ContactNode;this.m_flags=0;if(!a||!f)this.m_shape2=this.m_shape1=null;else{this.m_shape1=a;this.m_shape2=f;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_next=this.m_prev=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=
null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null}},Evaluate:function(){},GetManifolds:function(){return null}});var b2PolyAndCircleContact=Class.create();Object.extend(b2PolyAndCircleContact.prototype,b2Contact.prototype);
Object.extend(b2PolyAndCircleContact.prototype,{initialize:function(a,f){this.m_node1=new b2ContactNode;this.m_node2=new b2ContactNode;this.m_flags=0;if(!a||!f)this.m_shape2=this.m_shape1=null;else{this.m_shape1=a;this.m_shape2=f;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_next=this.m_prev=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=
null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m_manifold=[new b2Manifold];b2Settings.b2Assert(this.m_shape1.m_type==b2Shape.e_polyShape);b2Settings.b2Assert(this.m_shape2.m_type==b2Shape.e_circleShape);this.m_manifold[0].pointCount=0;this.m_manifold[0].points[0].normalImpulse=0;this.m_manifold[0].points[0].tangentImpulse=0}},Evaluate:function(){b2Collision.b2CollidePolyAndCircle(this.m_manifold[0],this.m_shape1,this.m_shape2,
false);this.m_manifoldCount=this.m_manifold[0].pointCount>0?1:0},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold]});b2PolyAndCircleContact.Create=function(a,f){return new b2PolyAndCircleContact(a,f)};b2PolyAndCircleContact.Destroy=function(){};var b2PolyContact=Class.create();Object.extend(b2PolyContact.prototype,b2Contact.prototype);
Object.extend(b2PolyContact.prototype,{initialize:function(a,f){this.m_node1=new b2ContactNode;this.m_node2=new b2ContactNode;this.m_flags=0;if(!a||!f)this.m_shape2=this.m_shape1=null;else{this.m_shape1=a;this.m_shape2=f;this.m_manifoldCount=0;this.m_friction=Math.sqrt(this.m_shape1.m_friction*this.m_shape2.m_friction);this.m_restitution=b2Math.b2Max(this.m_shape1.m_restitution,this.m_shape2.m_restitution);this.m_next=this.m_prev=null;this.m_node1.contact=null;this.m_node1.prev=null;this.m_node1.next=
null;this.m_node1.other=null;this.m_node2.contact=null;this.m_node2.prev=null;this.m_node2.next=null;this.m_node2.other=null;this.m0=new b2Manifold;this.m_manifold=[new b2Manifold];this.m_manifold[0].pointCount=0}},m0:new b2Manifold,Evaluate:function(){for(var a=this.m_manifold[0],f=this.m0.points,g=0;g<a.pointCount;g++){var k=f[g],s=a.points[g];k.normalImpulse=s.normalImpulse;k.tangentImpulse=s.tangentImpulse;k.id=s.id.Copy()}this.m0.pointCount=a.pointCount;b2Collision.b2CollidePoly(a,this.m_shape1,
this.m_shape2,false);if(a.pointCount>0){f=[false,false];for(g=0;g<a.pointCount;++g){k=a.points[g];k.normalImpulse=0;k.tangentImpulse=0;s=k.id.key;for(var r=0;r<this.m0.pointCount;++r)if(f[r]!=true){var v=this.m0.points[r];if(v.id.key==s){f[r]=true;k.normalImpulse=v.normalImpulse;k.tangentImpulse=v.tangentImpulse;break}}}this.m_manifoldCount=1}else this.m_manifoldCount=0},GetManifolds:function(){return this.m_manifold},m_manifold:[new b2Manifold]});
b2PolyContact.Create=function(a,f){return new b2PolyContact(a,f)};b2PolyContact.Destroy=function(){};var b2ContactManager=Class.create();Object.extend(b2ContactManager.prototype,b2PairCallback.prototype);
Object.extend(b2ContactManager.prototype,{initialize:function(){this.m_nullContact=new b2NullContact;this.m_world=null;this.m_destroyImmediate=false},PairAdded:function(a,f){var g=a,k=f,s=g.m_body,r=k.m_body;if(s.IsStatic()&&r.IsStatic())return this.m_nullContact;if(g.m_body==k.m_body)return this.m_nullContact;if(r.IsConnected(s))return this.m_nullContact;if(this.m_world.m_filter!=null&&this.m_world.m_filter.ShouldCollide(g,k)==false)return this.m_nullContact;if(r.m_invMass==0){s=g;g=k;k=s}g=b2Contact.Create(g,
k,this.m_world.m_blockAllocator);if(g==null)return this.m_nullContact;else{g.m_prev=null;g.m_next=this.m_world.m_contactList;if(this.m_world.m_contactList!=null)this.m_world.m_contactList.m_prev=g;this.m_world.m_contactList=g;this.m_world.m_contactCount++}return g},PairRemoved:function(a,f,g){if(g!=null)if(g!=this.m_nullContact)if(this.m_destroyImmediate==true)this.DestroyContact(g);else g.m_flags|=b2Contact.e_destroyFlag},DestroyContact:function(a){if(a.m_prev)a.m_prev.m_next=a.m_next;if(a.m_next)a.m_next.m_prev=
a.m_prev;if(a==this.m_world.m_contactList)this.m_world.m_contactList=a.m_next;if(a.GetManifoldCount()>0){var f=a.m_shape1.m_body,g=a.m_shape2.m_body,k=a.m_node1,s=a.m_node2;f.WakeUp();g.WakeUp();if(k.prev)k.prev.next=k.next;if(k.next)k.next.prev=k.prev;if(k==f.m_contactList)f.m_contactList=k.next;k.prev=null;k.next=null;if(s.prev)s.prev.next=s.next;if(s.next)s.next.prev=s.prev;if(s==g.m_contactList)g.m_contactList=s.next;s.prev=null;s.next=null}b2Contact.Destroy(a,this.m_world.m_blockAllocator);--this.m_world.m_contactCount},
CleanContactList:function(){for(var a=this.m_world.m_contactList;a!=null;){var f=a;a=a.m_next;f.m_flags&b2Contact.e_destroyFlag&&this.DestroyContact(f)}},Collide:function(){for(var a,f,g,k,s=this.m_world.m_contactList;s!=null;s=s.m_next)if(!(s.m_shape1.m_body.IsSleeping()&&s.m_shape2.m_body.IsSleeping())){a=s.GetManifoldCount();s.Evaluate();f=s.GetManifoldCount();if(a==0&&f>0){a=s.m_shape1.m_body;f=s.m_shape2.m_body;g=s.m_node1;k=s.m_node2;g.contact=s;g.other=f;g.prev=null;g.next=a.m_contactList;
if(g.next!=null)g.next.prev=s.m_node1;a.m_contactList=s.m_node1;k.contact=s;k.other=a;k.prev=null;k.next=f.m_contactList;if(k.next!=null)k.next.prev=k;f.m_contactList=k}else if(a>0&&f==0){a=s.m_shape1.m_body;f=s.m_shape2.m_body;g=s.m_node1;k=s.m_node2;if(g.prev)g.prev.next=g.next;if(g.next)g.next.prev=g.prev;if(g==a.m_contactList)a.m_contactList=g.next;g.prev=null;g.next=null;if(k.prev)k.prev.next=k.next;if(k.next)k.next.prev=k.prev;if(k==f.m_contactList)f.m_contactList=k.next;k.prev=null;k.next=
null}}},m_world:null,m_nullContact:new b2NullContact,m_destroyImmediate:null});var b2World=Class.create();
b2World.prototype={initialize:function(a,f,g){this.step=new b2TimeStep;this.m_contactManager=new b2ContactManager;this.m_listener=null;this.m_filter=b2CollisionFilter.b2_defaultFilter;this.m_jointList=this.m_contactList=this.m_bodyList=null;this.m_jointCount=this.m_contactCount=this.m_bodyCount=0;this.m_bodyDestroyList=null;this.m_allowSleep=g;this.m_gravity=f;this.m_contactManager.m_world=this;this.m_broadPhase=new b2BroadPhase(a,this.m_contactManager);this.m_groundBody=this.CreateBody(new b2BodyDef)},
SetListener:function(a){this.m_listener=a},SetFilter:function(a){this.m_filter=a},CreateBody:function(a){a=new b2Body(a,this);a.m_prev=null;if(a.m_next=this.m_bodyList)this.m_bodyList.m_prev=a;this.m_bodyList=a;++this.m_bodyCount;return a},DestroyBody:function(a){if(!(a.m_flags&b2Body.e_destroyFlag)){if(a.m_prev)a.m_prev.m_next=a.m_next;if(a.m_next)a.m_next.m_prev=a.m_prev;if(a==this.m_bodyList)this.m_bodyList=a.m_next;a.m_flags|=b2Body.e_destroyFlag;--this.m_bodyCount;a.m_prev=null;a.m_next=this.m_bodyDestroyList;
this.m_bodyDestroyList=a}},CleanBodyList:function(){this.m_contactManager.m_destroyImmediate=true;for(var a=this.m_bodyDestroyList;a;){var f=a;a=a.m_next;for(var g=f.m_jointList;g;){var k=g;g=g.next;this.m_listener&&this.m_listener.NotifyJointDestroyed(k.joint);this.DestroyJoint(k.joint)}f.Destroy()}this.m_bodyDestroyList=null;this.m_contactManager.m_destroyImmediate=false},CreateJoint:function(a){var f=b2Joint.Create(a,this.m_blockAllocator);f.m_prev=null;if(f.m_next=this.m_jointList)this.m_jointList.m_prev=
f;this.m_jointList=f;++this.m_jointCount;f.m_node1.joint=f;f.m_node1.other=f.m_body2;f.m_node1.prev=null;if(f.m_node1.next=f.m_body1.m_jointList)f.m_body1.m_jointList.prev=f.m_node1;f.m_body1.m_jointList=f.m_node1;f.m_node2.joint=f;f.m_node2.other=f.m_body1;f.m_node2.prev=null;if(f.m_node2.next=f.m_body2.m_jointList)f.m_body2.m_jointList.prev=f.m_node2;f.m_body2.m_jointList=f.m_node2;if(a.collideConnected==false)for(a=(a.body1.m_shapeCount<a.body2.m_shapeCount?a.body1:a.body2).m_shapeList;a;a=a.m_next)a.ResetProxy(this.m_broadPhase);
return f},DestroyJoint:function(a){var f=a.m_collideConnected;if(a.m_prev)a.m_prev.m_next=a.m_next;if(a.m_next)a.m_next.m_prev=a.m_prev;if(a==this.m_jointList)this.m_jointList=a.m_next;var g=a.m_body1,k=a.m_body2;g.WakeUp();k.WakeUp();if(a.m_node1.prev)a.m_node1.prev.next=a.m_node1.next;if(a.m_node1.next)a.m_node1.next.prev=a.m_node1.prev;if(a.m_node1==g.m_jointList)g.m_jointList=a.m_node1.next;a.m_node1.prev=null;a.m_node1.next=null;if(a.m_node2.prev)a.m_node2.prev.next=a.m_node2.next;if(a.m_node2.next)a.m_node2.next.prev=
a.m_node2.prev;if(a.m_node2==k.m_jointList)k.m_jointList=a.m_node2.next;a.m_node2.prev=null;a.m_node2.next=null;b2Joint.Destroy(a,this.m_blockAllocator);--this.m_jointCount;if(f==false)for(a=(g.m_shapeCount<k.m_shapeCount?g:k).m_shapeList;a;a=a.m_next)a.ResetProxy(this.m_broadPhase)},GetGroundBody:function(){return this.m_groundBody},step:new b2TimeStep,Step:function(a,f){var g,k;this.step.dt=a;this.step.iterations=f;this.step.inv_dt=a>0?1/a:0;this.m_positionIterationCount=0;this.m_contactManager.CleanContactList();
this.CleanBodyList();this.m_contactManager.Collide();var s=new b2Island(this.m_bodyCount,this.m_contactCount,this.m_jointCount,this.m_stackAllocator);for(g=this.m_bodyList;g!=null;g=g.m_next)g.m_flags&=~b2Body.e_islandFlag;for(var r=this.m_contactList;r!=null;r=r.m_next)r.m_flags&=~b2Contact.e_islandFlag;for(r=this.m_jointList;r!=null;r=r.m_next)r.m_islandFlag=false;r=Array(this.m_bodyCount);for(var v=0;v<this.m_bodyCount;v++)r[v]=null;for(v=this.m_bodyList;v!=null;v=v.m_next)if(!(v.m_flags&(b2Body.e_staticFlag|
b2Body.e_islandFlag|b2Body.e_sleepFlag|b2Body.e_frozenFlag))){s.Clear();var C=0;r[C++]=v;for(v.m_flags|=b2Body.e_islandFlag;C>0;){g=r[--C];s.AddBody(g);g.m_flags&=~b2Body.e_sleepFlag;if(!(g.m_flags&b2Body.e_staticFlag)){for(var F=g.m_contactList;F!=null;F=F.next)if(!(F.contact.m_flags&b2Contact.e_islandFlag)){s.AddContact(F.contact);F.contact.m_flags|=b2Contact.e_islandFlag;k=F.other;if(!(k.m_flags&b2Body.e_islandFlag)){r[C++]=k;k.m_flags|=b2Body.e_islandFlag}}for(g=g.m_jointList;g!=null;g=g.next)if(g.joint.m_islandFlag!=
true){s.AddJoint(g.joint);g.joint.m_islandFlag=true;k=g.other;if(!(k.m_flags&b2Body.e_islandFlag)){r[C++]=k;k.m_flags|=b2Body.e_islandFlag}}}}s.Solve(this.step,this.m_gravity);this.m_positionIterationCount=b2Math.b2Max(this.m_positionIterationCount,b2Island.m_positionIterationCount);this.m_allowSleep&&s.UpdateSleep(a);for(k=0;k<s.m_bodyCount;++k){g=s.m_bodies[k];if(g.m_flags&b2Body.e_staticFlag)g.m_flags&=~b2Body.e_islandFlag;if(g.IsFrozen()&&this.m_listener)if(this.m_listener.NotifyBoundaryViolated(g)==
b2WorldListener.b2_destroyBody){this.DestroyBody(g);s.m_bodies[k]=null}}}this.m_broadPhase.Commit()},Query:function(a,f,g){var k=[];a=this.m_broadPhase.QueryAABB(a,k,g);for(g=0;g<a;++g)f[g]=k[g];return a},GetBodyList:function(){return this.m_bodyList},GetJointList:function(){return this.m_jointList},GetContactList:function(){return this.m_contactList},m_blockAllocator:null,m_stackAllocator:null,m_broadPhase:null,m_contactManager:new b2ContactManager,m_bodyList:null,m_contactList:null,m_jointList:null,
m_bodyCount:0,m_contactCount:0,m_jointCount:0,m_bodyDestroyList:null,m_gravity:null,m_allowSleep:null,m_groundBody:null,m_listener:null,m_filter:null,m_positionIterationCount:0};b2World.s_enablePositionCorrection=1;b2World.s_enableWarmStarting=1;var b2WorldListener=Class.create();b2WorldListener.prototype={NotifyJointDestroyed:function(){},NotifyBoundaryViolated:function(){return b2WorldListener.b2_freezeBody},initialize:function(){}};b2WorldListener.b2_freezeBody=0;
b2WorldListener.b2_destroyBody=1;jQuery.preloadCssImages=function(a){function f(){clearTimeout(C);if(r&&r.length&&r[s]){s++;if(a.statusTextEl){var F=r[s]?"Now Loading: <span>"+r[s].split("/")[r[s].split("/").length-1]:"Loading complete";jQuery(a.statusTextEl).html('<span class="numLoaded">'+s+'</span> of <span class="numTotal">'+r.length+'</span> loaded (<span class="percentLoaded">'+(s/r.length*100).toFixed(0)+'%</span>) <span class="currentImg">'+F+"</span></span>")}if(a.statusBarEl){F=jQuery(a.statusBarEl).width();jQuery(a.statusBarEl).css("background-position",
-(F-(F*s/r.length).toFixed(0))+"px 50%")}g()}}function g(){if(r&&r.length&&r[s]){var F=new Image;F.src=r[s];F.complete?f():jQuery(F).bind("error load onreadystatechange",f);C=setTimeout(f,a.errorDelay)}}function k(F,H){for(var K=[],M=[],Q,S=F.length;S--;){var W="";if(H&&H[S])Q=H[S];else{Q=(F[S].href?F[S].href:"window.location.href").split("/");Q.pop();if(Q=Q.join("/"))Q+="/"}if(F[S].cssRules||F[S].rules){v=F[S].cssRules?F[S].cssRules:F[S].rules;for(var ha=v.length;ha--;)if(v[ha].style&&v[ha].style.cssText){var fa=
v[ha].style.cssText;if(fa.toLowerCase().indexOf("url")!=-1)W+=fa}}if(W=W.match(/[^\("]+\.(gif|jpg|jpeg|png)/g))for(ha=W.length;ha--;){fa=W[ha].charAt(0)=="/"||W[ha].match("://")?W[ha]:Q+W[ha];jQuery.inArray(fa,r)==-1&&r.push(fa)}if(F[S].imports&&F[S].imports.length){W=0;for(ha=F[S].imports.length;W<ha;W++){fa=F[S].imports[W].href;fa=fa.split("/");fa.pop();if(fa=fa.join("/"))fa+="/";fa=fa.charAt(0)=="/"||fa.match("://")?fa:Q+fa;M.push(fa);K.push(F[S].imports[W])}}}if(K.length){k(K,M);return false}for(K=
a.simultaneousCacheLoading;K--;)setTimeout(g,K)}a=jQuery.extend({statusTextEl:null,statusBarEl:null,errorDelay:999,simultaneousCacheLoading:2},a);var s=0,r=[],v,C;k(document.styleSheets);return r};(function(a){function f(){var r=s.parse(this.title);isNaN(r)||a(this).text(g(r));return this}function g(r){return s.inWords((new Date).getTime()-r.getTime())}function k(r,v){return(a.isFunction(r)?r(v):r).replace(/%d/i,v)}a.timeago=function(r){return r instanceof Date?g(r):typeof r=="string"?g(a.timeago.parse(r)):g(a.timeago.parse(a(r).attr("title")))};var s=a.timeago;a.extend(a.timeago,{settings:{refreshMillis:6E4,allowFuture:false,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",
ago:null,fromNow:null,seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years"}},inWords:function(r){var v=this.settings.strings,C=v.prefixAgo,F=v.suffixAgo||v.ago;if(this.settings.allowFuture){if(r<0){C=v.prefixFromNow;F=v.suffixFromNow||v.fromNow}r=Math.abs(r)}r=r/1E3;var H=r/60,K=H/60,M=K/24,Q=M/365;v=r<45&&k(v.seconds,Math.round(r))||
r<90&&k(v.minute,1)||H<45&&k(v.minutes,Math.round(H))||H<90&&k(v.hour,1)||K<24&&k(v.hours,Math.round(K))||K<48&&k(v.day,1)||M<30&&k(v.days,Math.floor(M))||M<60&&k(v.month,1)||M<365&&k(v.months,Math.floor(M/30))||Q<2&&k(v.year,1)||k(v.years,Math.floor(Q));return a.trim([C,v,F].join(" "))},parse:function(r){r=a.trim(r);r=r.replace(/-/,"/").replace(/-/,"/");r=r.replace(/T/," ").replace(/Z/," UTC");r=r.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2");return new Date(r)}});a.fn.timeago=function(){var r=this;r.each(f);
var v=s.settings;v.refreshMillis>0&&setInterval(function(){r.each(f)},v.refreshMillis);return r};a.browser.msie&&a.browser.version<7&&document.createElement("abbr")})(jQuery);Raphael=function(){function a(){if(a.is(arguments[0],Ta)){for(var b=arguments[0],e=Gb[Ma](a,b.splice(0,3+a.is(b[0],N))),m=e.set(),p=0,q=b[Z];p<q;p++){var o=b[p]||{};ab.test(o.type)&&m[ja](e[o.type]().attr(o))}return m}return Gb[Ma](a,arguments)}function f(){}function g(b){if(a.vml){var e=/^\s+|\s+$/g;g=r(function(p){var q;p=za(p)[Pa](e,va);try{var o=new Ha.ActiveXObject("htmlfile");o.write("<body>");o.close();q=o.body}catch(y){q=Ha.createPopup().document.body}o=q.createTextRange();try{q.style.color=
p;var A=o.queryCommandValue("ForeColor");A=(A&255)<<16|A&65280|(A&16711680)>>>16;return"#"+("000000"+A[pa](16)).slice(-6)}catch(B){return"none"}})}else{var m=Ba.createElement("i");m.title="Rapha\u00ebl Colour Picker";m.style.display="none";Ba.body[la](m);g=r(function(p){m.style.color=p;return Ba.defaultView.getComputedStyle(m,va).getPropertyValue("color")})}return g(b)}function k(){return"hsb("+[this.h,this.s,this.b]+")"}function s(){return this.hex}function r(b,e,m){function p(){var q=Array[ba].slice.call(arguments,
0),o=q[Oa]("\u25ba"),y=p.cache=p.cache||{},A=p.count=p.count||[];if(y[sa](o))return m?m(y[o]):y[o];A[Z]>=1E3&&delete y[A.shift()];A[ja](o);y[o]=b[Ma](e,q);return m?m(y[o]):y[o]}return p}function v(b){var e=[];if(!a.is(b,Ta)||!a.is(b&&b[0],Ta))b=a.parsePathString(b);for(var m=0,p=b[Z];m<p;m++){e[m]=[];for(var q=0,o=b[m][Z];q<o;q++)e[m][q]=b[m][q]}e[pa]=a._path2string;return e}function C(b,e,m,p,q,o){var y=1/3,A=2/3;return[y*b+A*m,y*e+A*p,y*q+A*m,y*o+A*p,q,o]}function F(b,e,m,p,q,o,y,A,B,D){var O=ka.PI,
T=O*120/180,da=O/180*(+q||0),ca=[],t,E=r(function(P,ea,ga){var ya=P*ka.cos(ga)-ea*ka.sin(ga);P=P*ka.sin(ga)+ea*ka.cos(ga);return{x:ya,y:P}});if(D){I=D[0];t=D[1];o=D[2];J=D[3]}else{t=E(b,e,-da);b=t.x;e=t.y;t=E(A,B,-da);A=t.x;B=t.y;ka.cos(O/180*q);ka.sin(O/180*q);t=(b-A)/2;I=(e-B)/2;J=t*t/(m*m)+I*I/(p*p);if(J>1){J=ka.sqrt(J);m=J*m;p=J*p}J=m*m;var L=p*p;J=(o==y?-1:1)*ka.sqrt(ka.abs((J*L-J*I*I-L*t*t)/(J*I*I+L*t*t)));o=J*m*I/p+(b+A)/2;var J=J*-p*t/m+(e+B)/2,I=ka.asin(((e-J)/p).toFixed(7));t=ka.asin(((B-
J)/p).toFixed(7));I=b<o?O-I:I;t=A<o?O-t:t;I<0&&(I=O*2+I);t<0&&(t=O*2+t);if(y&&I>t)I-=O*2;if(!y&&t>I)t-=O*2}O=t-I;if(ka.abs(O)>T){ca=t;O=A;L=B;t=I+T*(y&&t>I?1:-1);A=o+m*ka.cos(t);B=J+p*ka.sin(t);ca=F(A,B,m,p,q,0,y,O,L,[t,ca,o,J])}O=t-I;q=ka.cos(I);o=ka.sin(I);y=ka.cos(t);t=ka.sin(t);O=ka.tan(O/4);m=4/3*m*O;O=4/3*p*O;p=[b,e];b=[b+m*o,e-O*q];e=[A+m*t,B-O*y];A=[A,B];b[0]=2*p[0]-b[0];b[1]=2*p[1]-b[1];if(D)return[b,e,A][Ra](ca);else{ca=[b,e,A][Ra](ca)[Oa]()[Ja](",");D=[];A=0;for(B=ca[Z];A<B;A++)D[A]=A%
2?E(ca[A-1],ca[A],da).y:E(ca[A],ca[A+1],da).x;return D}}function H(b,e,m,p,q,o,y,A,B){var D=1-B;return{x:X(D,3)*b+X(D,2)*3*B*m+D*3*B*B*q+X(B,3)*y,y:X(D,3)*e+X(D,2)*3*B*p+D*3*B*B*o+X(B,3)*A}}function K(b,e,m,p){if(a.is(b,Ya)||a.is(b,"object")){b=a.is(b,Ya)?Ba.getElementById(b):b;if(b.tagName)return e==null?{container:b,width:b.style.pixelWidth||b.offsetWidth,height:b.style.pixelHeight||b.offsetHeight}:{container:b,width:e,height:m}}else return{container:1,x:b,y:e,width:m,height:p}}function M(b,e){var m=
this;for(var p in e)if(e[sa](p)&&!(p in b))switch(typeof e[p]){case "function":(function(q){b[p]=b===m?q:function(){return q[Ma](m,arguments)}})(e[p]);break;case "object":b[p]=b[p]||{};M.call(this,b[p],e[p]);break;default:b[p]=e[p];break}}function Q(b,e){b==e.top&&(e.top=b.prev);b==e.bottom&&(e.bottom=b.next);b.next&&(b.next.prev=b.prev);b.prev&&(b.prev.next=b.next)}function S(b,e){if(e.top!==b){Q(b,e);b.next=null;b.prev=e.top;e.top.next=b;e.top=b}}function W(b,e){if(e.bottom!==b){Q(b,e);b.next=e.bottom;
b.prev=null;e.bottom.prev=b;e.bottom=b}}function ha(b,e,m){Q(b,m);e==m.top&&(m.top=b);e.next&&(e.next.prev=b);b.next=e.next;b.prev=e;e.next=b}function fa(b,e,m){Q(b,m);e==m.bottom&&(m.bottom=b);e.prev&&(e.prev.next=b);b.prev=e.prev;e.prev=b;b.next=e}function ia(b){return function(){throw Error("Rapha\u00ebl: you are calling to method \u201c"+b+"\u201d of removed object");}}function Aa(){this.returnValue=false}function ra(){return this.originalEvent.preventDefault()}function xa(){this.cancelBubble=
true}function Qa(){return this.originalEvent.stopPropagation()}function Ia(){return this.x+Na+this.y}function V(b,e){return function(m,p,q){m=xb(m);for(var o,y,A,B,D="",O={},T=0,da=0,ca=m.length;da<ca;da++){A=m[da];if(A[0]=="M"){o=+A[1];y=+A[2]}else{B=cc(o,y,A[1],A[2],A[3],A[4],A[5],A[6]);if(T+B>p){if(e&&!O.start){o=Kb(o,y,A[1],A[2],A[3],A[4],A[5],A[6],p-T);D+=["C",o.start.x,o.start.y,o.m.x,o.m.y,o.x,o.y];if(q)return D;O.start=D;D=["M",o.x,o.y+"C",o.n.x,o.n.y,o.end.x,o.end.y,A[5],A[6]][Oa]();T+=B;
o=+A[5];y=+A[6];continue}if(!b&&!e){o=Kb(o,y,A[1],A[2],A[3],A[4],A[5],A[6],p-T);return{x:o.x,y:o.y,alpha:o.alpha}}}T+=B;o=+A[5];y=+A[6]}D+=A}O.end=D;o=b?T:e?O:a.findDotsAtSegment(o,y,A[1],A[2],A[3],A[4],A[5],A[6],1);o.alpha&&(o={x:o.x,y:o.y,alpha:o.alpha});return o}}function l(){var b=+new Date;for(var e in n)if(e!="length"&&n[sa](e)){var m=n[e];if(m.stop||m.el.removed){delete n[e];n[Z]--}else{var p=b-m.start,q=m.ms,o=m.easing,y=m.from,A=m.diff,B=m.to,D=m.t,O=m.prev||0,T=m.el,da=m.callback,ca={},
t;if(p<q){da=a.easing_formulas[o]?a.easing_formulas[o](p/q):p/q;for(var E in y)if(y[sa](E)){switch(nb[E]){case "along":t=da*q*A[E];B.back&&(t=B.len-t);o=c(B[E],t);T.translate(A.sx-A.x||0,A.sy-A.y||0);A.x=o.x;A.y=o.y;T.translate(o.x-A.sx,o.y-A.sy);B.rot&&T.rotate(A.r+o.alpha,o.x,o.y);break;case N:t=+y[E]+da*q*A[E];break;case "colour":t="rgb("+[wa(Fa(y[E].r+da*q*A[E].r)),wa(Fa(y[E].g+da*q*A[E].g)),wa(Fa(y[E].b+da*q*A[E].b))][Oa](",")+")";break;case "path":t=[];o=0;for(var L=y[E][Z];o<L;o++){t[o]=[y[E][o][0]];
for(var J=1,I=y[E][o][Z];J<I;J++)t[o][J]=+y[E][o][J]+da*q*A[E][o][J];t[o]=t[o][Oa](Na)}t=t[Oa](Na);break;case "csv":switch(E){case "translation":t=A[E][0]*(p-O);o=A[E][1]*(p-O);D.x+=t;D.y+=o;t=t+Na+o;break;case "rotation":t=+y[E][0]+da*q*A[E][0];y[E][1]&&(t+=","+y[E][1]+","+y[E][2]);break;case "scale":t=[+y[E][0]+da*q*A[E][0],+y[E][1]+da*q*A[E][1],2 in B[E]?B[E][2]:va,3 in B[E]?B[E][3]:va][Oa](Na);break;case "clip-rect":t=[];for(o=4;o--;)t[o]=+y[E][o]+da*q*A[E][o];break}break}ca[E]=t}T.attr(ca);T._run&&
T._run.call(T)}else{if(B.along){o=c(B.along,B.len*!B.back);T.translate(A.sx-(A.x||0)+o.x-A.sx,A.sy-(A.y||0)+o.y-A.sy);B.rot&&T.rotate(A.r+o.alpha,o.x,o.y)}(D.x||D.y)&&T.translate(-D.x,-D.y);B.scale&&(B.scale+=va);T.attr(B);delete n[e];n[Z]--;T.in_animation=null;a.is(da,"function")&&da.call(T)}m.prev=p}}a.svg&&T&&T.paper&&T.paper.safari();n[Z]&&Ha.setTimeout(l)}function wa(b){return $a(Ga(b,255),0)}function Da(b,e){if(b==null)return{x:this._.tx,y:this._.ty,toString:Ia};this._.tx+=+b;this._.ty+=+e;
switch(this.type){case "circle":case "ellipse":this.attr({cx:+b+this.attrs.cx,cy:+e+this.attrs.cy});break;case "rect":case "image":case "text":this.attr({x:+b+this.attrs.x,y:+e+this.attrs.y});break;case "path":var m=Lb(this.attrs.path);m[0][1]+=+b;m[0][2]+=+e;this.attr({path:m});break}return this}function Ca(b){return function(e,m,p,q){var o={back:b};a.is(p,"function")?q=p:o.rot=p;e&&e.constructor==ma&&(e=e.attrs.path);e&&(o.along=e);return this.animate(o,m,q)}}function Ea(b){this.items=[];this[Z]=
0;this.type="set";if(b)for(var e=0,m=b[Z];e<m;e++)if(b[e]&&(b[e].constructor==ma||b[e].constructor==Ea)){this[this.items[Z]]=this.items[this.items[Z]]=b[e];this[Z]++}}a.version="1.4.4";var ua=/[, ]+/,ab=/^(circle|rect|path|ellipse|text|image)$/,ba="prototype",sa="hasOwnProperty",Ba=document,Ha=window,Va={was:Object[ba][sa].call(Ha,"Raphael"),is:Ha.Raphael},la="appendChild",Ma="apply",Ra="concat",lb="createTouch"in Ba,va="",Na=" ",za=String,Ja="split",fb="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend orientationchange touchcancel gesturestart gesturechange gestureend"[Ja](Na),
cb={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},Oa="join",Z="length",Xa=String[ba].toLowerCase,ka=Math,$a=ka.max,Ga=ka.min,N="number",Ya="string",Ta="array",pa="toString",hb=Object[ba][pa],X=ka.pow,ja="push",Ka=/^(?=[\da-f]$)/,Sa=/^url\(['"]?([^\)]+?)['"]?\)$/i,db=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+(?:\s*,\s*[\d\.]+)?)\s*\)|rgba?\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%(?:\s*,\s*[\d\.]+%))\s*\)|hs[bl]\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hs[bl]\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i,
Fa=ka.round,na=parseFloat,bb=parseInt,ib=String[ba].toUpperCase,eb={blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,
target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},nb={along:"along",blur:N,"clip-rect":"csv",cx:N,cy:N,fill:"colour","fill-opacity":N,"font-size":N,height:N,opacity:N,path:"path",r:N,rotation:"csv",rx:N,ry:N,scale:"csv",stroke:"colour","stroke-opacity":N,"stroke-width":N,translation:"csv",width:N,x:N,y:N},Pa="replace";a.type=Ha.SVGAngle||Ba.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(a.type=="VML"){var sb=
Ba.createElement("div");sb.innerHTML="<!--[if vml]><br><br><![endif]--\>";if(sb.childNodes[Z]!=2)return a.type=null;sb=null}a.svg=!(a.vml=a.type=="VML");f[ba]=a[ba];a._id=0;a._oid=0;a.fn={};a.is=function(b,e){e=Xa.call(e);return e=="object"&&b===Object(b)||e=="undefined"&&typeof b==e||e=="null"&&b==null||Xa.call(hb.call(b).slice(8,-1))==e};a.setWindow=function(b){Ha=b;Ba=Ha.document};a.hsb2rgb=r(function(b,e,m){if(a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b){m=b.b;e=b.s;b=b.h}var p;if(m==0)return{r:0,
g:0,b:0,hex:"#000"};if(b>1||e>1||m>1){b/=255;e/=255;m/=255}p=~~(b*6);b=b*6-p;var q=m*(1-e),o=m*(1-e*b),y=m*(1-e*(1-b));b=[m,o,q,q,y,m,m][p];e=[y,m,m,o,q,q,y][p];p=[q,q,y,m,m,o,q][p];b*=255;e*=255;p*=255;m={r:b,g:e,b:p,toString:s};b=(~~b)[pa](16);e=(~~e)[pa](16);p=(~~p)[pa](16);b=b[Pa](Ka,"0");e=e[Pa](Ka,"0");p=p[Pa](Ka,"0");m.hex="#"+b+e+p;return m},a);a.rgb2hsb=r(function(b,e,m){if(a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b){m=b.b;e=b.g;b=b.r}if(a.is(b,Ya)){var p=a.getRGB(b);b=p.r;e=p.g;m=p.b}if(b>
1||e>1||m>1){b/=255;e/=255;m/=255}var q=$a(b,e,m),o=Ga(b,e,m);p=q;if(o==q)return{h:0,s:0,b:q};else{var y=q-o;o=y/q;b=b==q?(e-m)/y:e==q?2+(m-b)/y:4+(b-e)/y;b/=6;b<0&&b++;b>1&&b--}return{h:b,s:o,b:p,toString:k}},a);var Zb=/,?([achlmqrstvxz]),?/gi,Db=/\s*,\s*/,Yb={hs:1,rg:1};a._path2string=function(){return this.join(",")[Pa](Zb,"$1")};a.getRGB=r(function(b){if(!b||(b=za(b)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none"};!(Yb[sa](b.substring(0,
2))||b.charAt()=="#")&&(b=g(b));var e,m,p,q,o;if(b=b.match(db)){if(b[2]){p=bb(b[2].substring(5),16);m=bb(b[2].substring(3,5),16);e=bb(b[2].substring(1,3),16)}if(b[3]){p=bb((o=b[3].charAt(3))+o,16);m=bb((o=b[3].charAt(2))+o,16);e=bb((o=b[3].charAt(1))+o,16)}if(b[4]){b=b[4][Ja](Db);e=na(b[0]);m=na(b[1]);p=na(b[2]);q=na(b[3])}if(b[5]){b=b[5][Ja](Db);e=na(b[0])*2.55;m=na(b[1])*2.55;p=na(b[2])*2.55;q=na(b[3])}if(b[6]){b=b[6][Ja](Db);e=na(b[0]);m=na(b[1]);p=na(b[2]);return a.hsb2rgb(e,m,p)}if(b[7]){b=b[7][Ja](Db);
e=na(b[0])*2.55;m=na(b[1])*2.55;p=na(b[2])*2.55;return a.hsb2rgb(e,m,p)}b={r:e,g:m,b:p};e=(~~e)[pa](16);m=(~~m)[pa](16);p=(~~p)[pa](16);e=e[Pa](Ka,"0");m=m[Pa](Ka,"0");p=p[Pa](Ka,"0");b.hex="#"+e+m+p;isFinite(na(q))&&(b.o=q);return b}return{r:-1,g:-1,b:-1,hex:"none",error:1}},a);a.getColor=function(b){b=this.getColor.start=this.getColor.start||{h:0,s:1,b:b||0.75};var e=this.hsb2rgb(b.h,b.s,b.b);b.h+=0.075;if(b.h>1){b.h=0;b.s-=0.2;b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})}return e.hex};a.getColor.reset=
function(){delete this.start};var tb=/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,ob=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig;a.parsePathString=r(function(b){if(!b)return null;var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},m=[];if(a.is(b,Ta)&&a.is(b[0],Ta))m=v(b);m[Z]||za(b)[Pa](tb,function(p,q,o){var y=[];p=Xa.call(q);o[Pa](ob,function(A,B){B&&y[ja](+B)});if(p=="m"&&y[Z]>2){m[ja]([q][Ra](y.splice(0,2)));p="l";q=q=="m"?"l":"L"}for(;y[Z]>=e[p];){m[ja]([q][Ra](y.splice(0,e[p])));if(!e[p])break}});
m[pa]=a._path2string;return m});a.findDotsAtSegment=function(b,e,m,p,q,o,y,A,B){var D=1-B,O=X(D,3)*b+X(D,2)*3*B*m+D*3*B*B*q+X(B,3)*y;D=X(D,3)*e+X(D,2)*3*B*p+D*3*B*B*o+X(B,3)*A;var T=b+2*B*(m-b)+B*B*(q-2*m+b),da=e+2*B*(p-e)+B*B*(o-2*p+e),ca=m+2*B*(q-m)+B*B*(y-2*q+m),t=p+2*B*(o-p)+B*B*(A-2*o+p);b=(1-B)*b+B*m;e=(1-B)*e+B*p;q=(1-B)*q+B*y;o=(1-B)*o+B*A;A=90-ka.atan((T-ca)/(da-t))*180/ka.PI;(T>ca||da<t)&&(A+=180);return{x:O,y:D,m:{x:T,y:da},n:{x:ca,y:t},start:{x:b,y:e},end:{x:q,y:o},alpha:A}};var pb=r(function(b){if(!b)return{x:0,
y:0,width:0,height:0};b=xb(b);for(var e=0,m=0,p=[],q=[],o,y=0,A=b[Z];y<A;y++){o=b[y];if(o[0]=="M"){e=o[1];m=o[2];p[ja](e);q[ja](m)}else{e=Xb(e,m,o[1],o[2],o[3],o[4],o[5],o[6]);p=p[Ra](e.min.x,e.max.x);q=q[Ra](e.min.y,e.max.y);e=o[5];m=o[6]}}b=Ga[Ma](0,p);o=Ga[Ma](0,q);return{x:b,y:o,width:$a[Ma](0,p)-b,height:$a[Ma](0,q)-o}}),Lb=r(function(b){if(!a.is(b,Ta)||!a.is(b&&b[0],Ta))b=a.parsePathString(b);var e=[],m=0,p=0,q=0,o=0,y=0;if(b[0][0]=="M"){m=b[0][1];p=b[0][2];q=m;o=p;y++;e[ja](["M",m,p])}for(var A=
b[Z];y<A;y++){var B=e[y]=[],D=b[y];if(D[0]!=Xa.call(D[0])){B[0]=Xa.call(D[0]);switch(B[0]){case "a":B[1]=D[1];B[2]=D[2];B[3]=D[3];B[4]=D[4];B[5]=D[5];B[6]=+(D[6]-m).toFixed(3);B[7]=+(D[7]-p).toFixed(3);break;case "v":B[1]=+(D[1]-p).toFixed(3);break;case "m":q=D[1];o=D[2];default:for(var O=1,T=D[Z];O<T;O++)B[O]=+(D[O]-(O%2?m:p)).toFixed(3)}}else{e[y]=[];if(D[0]=="m"){q=D[1]+m;o=D[2]+p}B=0;for(O=D[Z];B<O;B++)e[y][B]=D[B]}D=e[y][Z];switch(e[y][0]){case "z":m=q;p=o;break;case "h":m+=+e[y][D-1];break;
case "v":p+=+e[y][D-1];break;default:m+=+e[y][D-2];p+=+e[y][D-1]}}e[pa]=a._path2string;return e},0,v),wb=r(function(b){if(!a.is(b,Ta)||!a.is(b&&b[0],Ta))b=a.parsePathString(b);var e=[],m=0,p=0,q=0,o=0,y=0;if(b[0][0]=="M"){m=+b[0][1];p=+b[0][2];q=m;o=p;y++;e[0]=["M",m,p]}for(var A=b[Z];y<A;y++){var B=e[y]=[],D=b[y];if(D[0]!=ib.call(D[0])){B[0]=ib.call(D[0]);switch(B[0]){case "A":B[1]=D[1];B[2]=D[2];B[3]=D[3];B[4]=D[4];B[5]=D[5];B[6]=+(D[6]+m);B[7]=+(D[7]+p);break;case "V":B[1]=+D[1]+p;break;case "H":B[1]=
+D[1]+m;break;case "M":q=+D[1]+m;o=+D[2]+p;default:for(var O=1,T=D[Z];O<T;O++)B[O]=+D[O]+(O%2?m:p)}}else{O=0;for(T=D[Z];O<T;O++)e[y][O]=D[O]}switch(B[0]){case "Z":m=q;p=o;break;case "H":m=B[1];break;case "V":p=B[1];break;case "M":q=e[y][e[y][Z]-2];o=e[y][e[y][Z]-1];default:m=e[y][e[y][Z]-2];p=e[y][e[y][Z]-1]}}e[pa]=a._path2string;return e},null,v),Xb=r(function(b,e,m,p,q,o,y,A){var B=q-2*m+b-(y-2*q+m),D=2*(m-b)-2*(q-m),O=b-m,T=(-D+ka.sqrt(D*D-4*B*O))/2/B;B=(-D-ka.sqrt(D*D-4*B*O))/2/B;var da=[e,A],
ca=[b,y];ka.abs(T)>1E12&&(T=0.5);ka.abs(B)>1E12&&(B=0.5);if(T>0&&T<1){T=H(b,e,m,p,q,o,y,A,T);ca[ja](T.x);da[ja](T.y)}if(B>0&&B<1){T=H(b,e,m,p,q,o,y,A,B);ca[ja](T.x);da[ja](T.y)}B=o-2*p+e-(A-2*o+p);D=2*(p-e)-2*(o-p);O=e-p;T=(-D+ka.sqrt(D*D-4*B*O))/2/B;B=(-D-ka.sqrt(D*D-4*B*O))/2/B;ka.abs(T)>1E12&&(T=0.5);ka.abs(B)>1E12&&(B=0.5);if(T>0&&T<1){T=H(b,e,m,p,q,o,y,A,T);ca[ja](T.x);da[ja](T.y)}if(B>0&&B<1){T=H(b,e,m,p,q,o,y,A,B);ca[ja](T.x);da[ja](T.y)}return{min:{x:Ga[Ma](0,ca),y:Ga[Ma](0,da)},max:{x:$a[Ma](0,
ca),y:$a[Ma](0,da)}}}),xb=r(function(b,e){function m(ca,t){var E;if(!ca)return["C",t.x,t.y,t.x,t.y,t.x,t.y];!(ca[0]in{T:1,Q:1})&&(t.qx=t.qy=null);switch(ca[0]){case "M":t.X=ca[1];t.Y=ca[2];break;case "A":ca=["C"][Ra](F[Ma](0,[t.x,t.y][Ra](ca.slice(1))));break;case "S":E=t.x+(t.x-(t.bx||t.x));t=t.y+(t.y-(t.by||t.y));ca=["C",E,t][Ra](ca.slice(1));break;case "T":t.qx=t.x+(t.x-(t.qx||t.x));t.qy=t.y+(t.y-(t.qy||t.y));ca=["C"][Ra](C(t.x,t.y,t.qx,t.qy,ca[1],ca[2]));break;case "Q":t.qx=ca[1];t.qy=ca[2];ca=
["C"][Ra](C(t.x,t.y,ca[1],ca[2],ca[3],ca[4]));break;case "L":ca=["C"][Ra]([t.x,t.y,ca[1],ca[2],ca[1],ca[2]]);break;case "H":ca=["C"][Ra]([t.x,t.y,ca[1],t.y,ca[1],t.y]);break;case "V":ca=["C"][Ra]([t.x,t.y,t.x,ca[1],t.x,ca[1]]);break;case "Z":ca=["C"][Ra]([t.x,t.y,t.X,t.Y,t.X,t.Y]);break}return ca}function p(ca,t){if(ca[t][Z]>7){ca[t].shift();for(var E=ca[t];E[Z];)ca.splice(t++,0,["C"][Ra](E.splice(0,6)));ca.splice(t,1);B=$a(o[Z],y&&y[Z]||0)}}function q(ca,t,E,L,J){if(ca&&t&&ca[J][0]=="M"&&t[J][0]!=
"M"){t.splice(J,0,["M",L.x,L.y]);E.bx=0;E.by=0;E.x=ca[J][1];E.y=ca[J][2];B=$a(o[Z],y&&y[Z]||0)}}var o=wb(b),y=e&&wb(e);b={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};for(var A=0,B=$a(o[Z],y&&y[Z]||0);A<B;A++){o[A]=m(o[A],b);p(o,A);y&&(y[A]=m(y[A],e));y&&p(y,A);q(o,y,b,e,A);q(y,o,e,b,A);var D=o[A],O=y&&y[A],T=D[Z],da=y&&O[Z];b.x=D[T-2];b.y=D[T-1];b.bx=na(D[T-4])||b.x;b.by=na(D[T-3])||b.y;e.bx=y&&(na(O[da-4])||e.x);e.by=y&&(na(O[da-3])||e.y);e.x=y&&O[da-
2];e.y=y&&O[da-1]}return y?[o,y]:o},null,v),Pb=r(function(b){for(var e=[],m=0,p=b[Z];m<p;m++){var q={},o=b[m].match(/^([^:]*):?([\d\.]*)/);q.color=a.getRGB(o[1]);if(q.color.error)return null;q.color=q.color.hex;o[2]&&(q.offset=o[2]+"%");e[ja](q)}m=1;for(p=e[Z]-1;m<p;m++)if(!e[m].offset){b=na(e[m-1].offset||0);o=0;for(q=m+1;q<p;q++)if(e[q].offset){o=e[q].offset;break}if(!o){o=100;q=p}o=na(o);for(o=(o-b)/(q-m+1);m<q;m++){b+=o;e[m].offset=b+"%"}}return e}),Qb=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;a.pathToRelative=
Lb;if(a.svg){f[ba].svgns="http://www.w3.org/2000/svg";f[ba].xlink="http://www.w3.org/1999/xlink";Fa=function(b){return+b+(~~b===b)*0.5};var oa=function(b,e){if(e)for(var m in e)e[sa](m)&&b.setAttribute(m,za(e[m]));else{b=Ba.createElementNS(f[ba].svgns,b);b.style.webkitTapHighlightColor="rgba(0,0,0,0)";return b}};a[pa]=function(){return"Your browser supports SVG.\nYou are running Rapha\u00ebl "+this.version};var Rb=function(b,e){var m=oa("path");e.canvas&&e.canvas[la](m);e=new ma(m,e);e.type="path";
gb(e,{fill:"none",stroke:"#000",path:b});return e},yb=function(b,e,m){var p="linear",q=0.5,o=0.5,y=b.style;e=za(e)[Pa](Qb,function(O,T,da){p="radial";if(T&&da){q=na(T);o=na(da);O=(o>0.5)*2-1;X(q-0.5,2)+X(o-0.5,2)>0.25&&(o=ka.sqrt(0.25-X(q-0.5,2))*O+0.5)&&o!=0.5&&(o=o.toFixed(5)-1.0E-5*O)}return va});e=e[Ja](/\s*\-\s*/);if(p=="linear"){var A=e.shift();A=-na(A);if(isNaN(A))return null;A=[0,0,ka.cos(A*ka.PI/180),ka.sin(A*ka.PI/180)];var B=1/($a(ka.abs(A[2]),ka.abs(A[3]))||1);A[2]*=B;A[3]*=B;if(A[2]<
0){A[0]=-A[2];A[2]=0}if(A[3]<0){A[1]=-A[3];A[3]=0}}e=Pb(e);if(!e)return null;B=b.getAttribute("fill");(B=B.match(/^url\(#(.*)\)$/))&&m.defs.removeChild(Ba.getElementById(B[1]));B=oa(p+"Gradient");B.id="r"+(a._id++)[pa](36);oa(B,p=="radial"?{fx:q,fy:o}:{x1:A[0],y1:A[1],x2:A[2],y2:A[3]});m.defs[la](B);m=0;for(A=e[Z];m<A;m++){var D=oa("stop");oa(D,{offset:e[m].offset?e[m].offset:!m?"0%":"100%","stop-color":e[m].color||"#fff"});B[la](D)}oa(b,{fill:"url(#"+B.id+")",opacity:1,"fill-opacity":1});y.fill=
va;y.opacity=1;return y.fillOpacity=1},Fb=function(b){var e=b.getBBox();oa(b.pattern,{patternTransform:a.format("translate({0},{1})",e.x,e.y)})},gb=function(b,e){function m(t,E){if(E=p[Xa.call(E)]){var L=t.attrs["stroke-width"]||"1";t={round:L,square:L,butt:0}[t.attrs["stroke-linecap"]||e["stroke-linecap"]]||0;for(var J=[],I=E[Z];I--;)J[I]=E[I]*L+(I%2?1:-1)*t;oa(q,{"stroke-dasharray":J[Oa](",")})}}var p={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],
"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},q=b.node,o=b.attrs,y=b.rotate();e[sa]("rotation")&&(y=e.rotation);var A=za(y)[Ja](ua);if(A.length-1){A[1]=+A[1];A[2]=+A[2]}else A=null;na(y)&&b.rotate(0,true);for(var B in e)if(e[sa](B))if(eb[sa](B)){var D=e[B];o[B]=D;switch(B){case "blur":b.blur(D);break;case "rotation":b.rotate(D,true);break;case "href":case "title":case "target":var O=q.parentNode;if(Xa.call(O.tagName)!="a"){var T=oa("a");O.insertBefore(T,q);T[la](q);O=T}O.setAttributeNS(b.paper.xlink,
B,D);break;case "cursor":q.style.cursor=D;break;case "clip-rect":O=za(D)[Ja](ua);if(O[Z]==4){b.clip&&b.clip.parentNode.parentNode.removeChild(b.clip.parentNode);var da=oa("clipPath");T=oa("rect");da.id="r"+(a._id++)[pa](36);oa(T,{x:O[0],y:O[1],width:O[2],height:O[3]});da[la](T);b.paper.defs[la](da);oa(q,{"clip-path":"url(#"+da.id+")"});b.clip=T}if(!D){(D=Ba.getElementById(q.getAttribute("clip-path")[Pa](/(^url\(#|\)$)/g,va)))&&D.parentNode.removeChild(D);oa(q,{"clip-path":va});delete b.clip}break;
case "path":if(b.type=="path")oa(q,{d:D?o.path=wb(D):"M0,0"});break;case "width":q.setAttribute(B,D);if(o.fx){B="x";D=o.x}else break;case "x":if(o.fx)D=-o.x-(o.width||0);case "rx":if(B=="rx"&&b.type=="rect")break;case "cx":A&&(B=="x"||B=="cx")&&(A[1]+=D-o[B]);q.setAttribute(B,Fa(D));b.pattern&&Fb(b);break;case "height":q.setAttribute(B,D);if(o.fy){B="y";D=o.y}else break;case "y":if(o.fy)D=-o.y-(o.height||0);case "ry":if(B=="ry"&&b.type=="rect")break;case "cy":A&&(B=="y"||B=="cy")&&(A[2]+=D-o[B]);
q.setAttribute(B,Fa(D));b.pattern&&Fb(b);break;case "r":b.type=="rect"?oa(q,{rx:D,ry:D}):q.setAttribute(B,D);break;case "src":b.type=="image"&&q.setAttributeNS(b.paper.xlink,"href",D);break;case "stroke-width":q.style.strokeWidth=D;q.setAttribute(B,D);o["stroke-dasharray"]&&m(b,o["stroke-dasharray"]);break;case "stroke-dasharray":m(b,D);break;case "translation":D=za(D)[Ja](ua);D[0]=+D[0]||0;D[1]=+D[1]||0;if(A){A[1]+=D[0];A[2]+=D[1]}Da.call(b,D[0],D[1]);break;case "scale":D=za(D)[Ja](ua);b.scale(+D[0]||
1,+D[1]||+D[0]||1,isNaN(na(D[2]))?null:+D[2],isNaN(na(D[3]))?null:+D[3]);break;case "fill":if(O=za(D).match(Sa)){da=oa("pattern");var ca=oa("image");da.id="r"+(a._id++)[pa](36);oa(da,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});oa(ca,{x:0,y:0});ca.setAttributeNS(b.paper.xlink,"href",O[1]);da[la](ca);D=Ba.createElement("img");D.style.cssText="position:absolute;left:-9999em;top-9999em";D.onload=function(){oa(da,{width:this.offsetWidth,height:this.offsetHeight});oa(ca,{width:this.offsetWidth,
height:this.offsetHeight});Ba.body.removeChild(this);b.paper.safari()};Ba.body[la](D);D.src=O[1];b.paper.defs[la](da);q.style.fill="url(#"+da.id+")";oa(q,{fill:"url(#"+da.id+")"});b.pattern=da;b.pattern&&Fb(b);break}O=a.getRGB(D);if(O.error){if(({circle:1,ellipse:1}[sa](b.type)||za(D).charAt()!="r")&&yb(q,D,b.paper)){o.gradient=D;o.fill="none";break}}else{delete e.gradient;delete o.gradient;!a.is(o.opacity,"undefined")&&a.is(e.opacity,"undefined")&&oa(q,{opacity:o.opacity});!a.is(o["fill-opacity"],
"undefined")&&a.is(e["fill-opacity"],"undefined")&&oa(q,{"fill-opacity":o["fill-opacity"]})}O[sa]("o")&&oa(q,{"fill-opacity":O.o/100});case "stroke":O=a.getRGB(D);q.setAttribute(B,O.hex);B=="stroke"&&O[sa]("o")&&oa(q,{"stroke-opacity":O.o/100});break;case "gradient":(({circle:1,ellipse:1})[sa](b.type)||za(D).charAt()!="r")&&yb(q,D,b.paper);break;case "opacity":case "fill-opacity":if(o.gradient){if(O=Ba.getElementById(q.getAttribute("fill")[Pa](/^url\(#|\)$/g,va))){O=O.getElementsByTagName("stop");
O[O[Z]-1].setAttribute("stop-opacity",D)}break}default:B=="font-size"&&(D=bb(D,10)+"px");O=B[Pa](/(\-.)/g,function(t){return ib.call(t.substring(1))});q.style[O]=D;q.setAttribute(B,D);break}}$b(b,e);if(A)b.rotate(A.join(Na));else na(y)&&b.rotate(y,true)},$b=function(b,e){if(!(b.type!="text"||!(e[sa]("text")||e[sa]("font")||e[sa]("font-size")||e[sa]("x")||e[sa]("y")))){var m=b.attrs,p=b.node,q=p.firstChild?bb(Ba.defaultView.getComputedStyle(p.firstChild,va).getPropertyValue("font-size"),10):10;if(e[sa]("text")){for(m.text=
e.text;p.firstChild;)p.removeChild(p.firstChild);e=za(e.text)[Ja]("\n");for(var o=0,y=e[Z];o<y;o++)if(e[o]){var A=oa("tspan");o&&oa(A,{dy:q*1.2,x:m.x});A[la](Ba.createTextNode(e[o]));p[la](A)}}else{e=p.getElementsByTagName("tspan");o=0;for(y=e[Z];o<y;o++)o&&oa(e[o],{dy:q*1.2,x:m.x})}oa(p,{y:m.y});b=b.getBBox();(b=m.y-(b.y+b.height/2))&&isFinite(b)&&oa(p,{y:m.y+b})}},ma=function(b,e){this[0]=b;this.id=a._oid++;this.node=b;b.raphael=this;this.paper=e;this.attrs=this.attrs||{};this.transformations=[];
this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1};!e.bottom&&(e.bottom=this);(this.prev=e.top)&&(e.top.next=this);e.top=this;this.next=null};ma[ba].rotate=function(b,e,m){if(this.removed)return this;if(b==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][Oa](Na);return this._.rt.deg}var p=this.getBBox();b=za(b)[Ja](ua);if(b[Z]-1){e=na(b[1]);m=na(b[2])}b=na(b[0]);if(e!=null)this._.rt.deg=b;else this._.rt.deg+=b;m==null&&(e=null);this._.rt.cx=e;this._.rt.cy=m;e=e==null?p.x+p.width/
2:e;m=m==null?p.y+p.height/2:m;if(this._.rt.deg){this.transformations[0]=a.format("rotate({0} {1} {2})",this._.rt.deg,e,m);this.clip&&oa(this.clip,{transform:a.format("rotate({0} {1} {2})",-this._.rt.deg,e,m)})}else{this.transformations[0]=va;this.clip&&oa(this.clip,{transform:va})}oa(this.node,{transform:this.transformations[Oa](Na)});return this};ma[ba].hide=function(){!this.removed&&(this.node.style.display="none");return this};ma[ba].show=function(){!this.removed&&(this.node.style.display="");
return this};ma[ba].remove=function(){if(!this.removed){Q(this,this.paper);this.node.parentNode.removeChild(this.node);for(var b in this)delete this[b];this.removed=true}};ma[ba].getBBox=function(){if(this.removed)return this;if(this.type=="path")return pb(this.attrs.path);if(this.node.style.display=="none"){this.show();var b=true}var e={};try{e=this.node.getBBox()}catch(m){}finally{e=e||{}}if(this.type=="text"){e={x:e.x,y:Infinity,width:0,height:0};for(var p=0,q=this.node.getNumberOfChars();p<q;p++){var o=
this.node.getExtentOfChar(p);o.y<e.y&&(e.y=o.y);o.y+o.height-e.y>e.height&&(e.height=o.y+o.height-e.y);o.x+o.width-e.x>e.width&&(e.width=o.x+o.width-e.x)}}b&&this.hide();return e};ma[ba].attr=function(b,e){if(this.removed)return this;if(b==null){b={};for(var m in this.attrs)if(this.attrs[sa](m))b[m]=this.attrs[m];this._.rt.deg&&(b.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(b.scale=this.scale());b.gradient&&b.fill=="none"&&(b.fill=b.gradient)&&delete b.gradient;return b}if(e==null&&a.is(b,
Ya)){if(b=="translation")return Da.call(this);if(b=="rotation")return this.rotate();if(b=="scale")return this.scale();if(b=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[b]}if(e==null&&a.is(b,Ta)){e={};m=0;for(var p=b.length;m<p;m++)e[b[m]]=this.attr(b[m]);return e}if(e!=null){m={};m[b]=e;gb(this,m)}else b!=null&&a.is(b,"object")&&gb(this,b);return this};ma[ba].toFront=function(){if(this.removed)return this;this.node.parentNode[la](this.node);var b=
this.paper;b.top!=this&&S(this,b);return this};ma[ba].toBack=function(){if(this.removed)return this;if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild);W(this,this.paper)}return this};ma[ba].insertAfter=function(b){if(this.removed)return this;var e=b.node;e.nextSibling?e.parentNode.insertBefore(this.node,e.nextSibling):e.parentNode[la](this.node);ha(this,b,this.paper);return this};ma[ba].insertBefore=function(b){if(this.removed)return this;
var e=b.node;e.parentNode.insertBefore(this.node,e);fa(this,b,this.paper);return this};ma[ba].blur=function(b){if(+b!==0){var e=oa("filter"),m=oa("feGaussianBlur");this.attrs.blur=b;e.id="r"+(a._id++)[pa](36);oa(m,{stdDeviation:+b||1.5});e.appendChild(m);this.paper.defs.appendChild(e);this._blur=e;oa(this.node,{filter:"url(#"+e.id+")"})}else{if(this._blur){this._blur.parentNode.removeChild(this._blur);delete this._blur;delete this.attrs.blur}this.node.removeAttribute("filter")}};var Sb=function(b,
e,m,p){e=Fa(e);m=Fa(m);var q=oa("circle");b.canvas&&b.canvas[la](q);b=new ma(q,b);b.attrs={cx:e,cy:m,r:p,fill:"none",stroke:"#000"};b.type="circle";oa(q,b.attrs);return b},Tb=function(b,e,m,p,q,o){e=Fa(e);m=Fa(m);var y=oa("rect");b.canvas&&b.canvas[la](y);b=new ma(y,b);b.attrs={x:e,y:m,width:p,height:q,r:o||0,rx:o||0,ry:o||0,fill:"none",stroke:"#000"};b.type="rect";oa(y,b.attrs);return b},Ub=function(b,e,m,p,q){e=Fa(e);m=Fa(m);var o=oa("ellipse");b.canvas&&b.canvas[la](o);b=new ma(o,b);b.attrs={cx:e,
cy:m,rx:p,ry:q,fill:"none",stroke:"#000"};b.type="ellipse";oa(o,b.attrs);return b},Mb=function(b,e,m,p,q,o){var y=oa("image");oa(y,{x:m,y:p,width:q,height:o,preserveAspectRatio:"none"});y.setAttributeNS(b.xlink,"href",e);b.canvas&&b.canvas[la](y);b=new ma(y,b);b.attrs={x:m,y:p,width:q,height:o,src:e};b.type="image";return b},Nb=function(b,e,m,p){var q=oa("text");oa(q,{x:e,y:m,"text-anchor":"middle"});b.canvas&&b.canvas[la](q);b=new ma(q,b);b.attrs={x:e,y:m,"text-anchor":"middle",text:p,font:eb.font,
stroke:"none",fill:"#000"};b.type="text";gb(b,b.attrs);return b},Cb=function(b,e){this.width=b||this.width;this.height=e||this.height;this.canvas.setAttribute("width",this.width);this.canvas.setAttribute("height",this.height);return this},Gb=function(){var b=K[Ma](0,arguments),e=b&&b.container,m=b.x,p=b.y,q=b.width;b=b.height;if(!e)throw Error("SVG container not found.");var o=oa("svg");m=m||0;p=p||0;q=q||512;b=b||342;oa(o,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:q,height:b});if(e==1){o.style.cssText=
"position:absolute;left:"+m+"px;top:"+p+"px";Ba.body[la](o)}else e.firstChild?e.insertBefore(o,e.firstChild):e[la](o);e=new f;e.width=q;e.height=b;e.canvas=o;M.call(e,e,a.fn);e.clear();return e};f[ba].clear=function(){for(var b=this.canvas;b.firstChild;)b.removeChild(b.firstChild);this.bottom=this.top=null;(this.desc=oa("desc"))[la](Ba.createTextNode("Created with Rapha\u00ebl"));b[la](this.desc);b[la](this.defs=oa("defs"))};f[ba].remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);
for(var b in this)this[b]=ia(b)}}if(a.vml){var jb={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},qb=/([clmz]),?([^clmz]*)/gi,dc=/-?[^,\s-]+/g,Ab=1E3+Na+1E3,kb={path:1,rect:1},bc=function(b){var e=/[ahqstv]/ig,m=wb;za(b).match(e)&&(m=xb);e=/[clmz]/g;if(m==wb&&!za(b).match(e))return b=za(b)[Pa](qb,function(B,D,O){var T=[],da=Xa.call(D)=="m",ca=jb[D];O[Pa](dc,function(t){if(da&&T[Z]==2){ca+=T+jb[D=="m"?"l":"L"];T=[]}T[ja](Fa(t*10))});return ca+T});e=m(b);var p;b=[];for(var q=0,o=e[Z];q<o;q++){m=e[q];
p=Xa.call(e[q][0]);p=="z"&&(p="x");for(var y=1,A=m[Z];y<A;y++)p+=Fa(m[y]*10)+(y!=A-1?",":va);b[ja](p)}return b[Oa](Na)};a[pa]=function(){return"Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\u00ebl "+this.version};Rb=function(b,e){var m=Za("group");m.style.cssText="position:absolute;left:0;top:0;width:"+e.width+"px;height:"+e.height+"px";m.coordsize=e.coordsize;m.coordorigin=e.coordorigin;var p=Za("shape"),q=p.style;q.width=e.width+"px";q.height=e.height+"px";p.coordsize=
Ab;p.coordorigin=e.coordorigin;m[la](p);p=new ma(p,m,e);q={fill:"none",stroke:"#000"};b&&(q.path=b);p.isAbsolute=true;p.type="path";p.path=[];p.Path=va;gb(p,q);e.canvas[la](m);return p};gb=function(b,e){b.attrs=b.attrs||{};var m=b.node,p=b.attrs,q=m.style,o;o=(e.x!=p.x||e.y!=p.y||e.width!=p.width||e.height!=p.height||e.r!=p.r)&&b.type=="rect";var y=b;for(var A in e)if(e[sa](A))p[A]=e[A];if(o){p.path=Bb(p.x,p.y,p.width,p.height,p.r);b.X=p.x;b.Y=p.y;b.W=p.width;b.H=p.height}e.href&&(m.href=e.href);
e.title&&(m.title=e.title);e.target&&(m.target=e.target);e.cursor&&(q.cursor=e.cursor);"blur"in e&&b.blur(e.blur);if(e.path&&b.type=="path"||o)m.path=bc(p.path);e.rotation!=null&&b.rotate(e.rotation,true);if(e.translation){o=za(e.translation)[Ja](ua);Da.call(b,o[0],o[1]);if(b._.rt.cx!=null){b._.rt.cx+=+o[0];b._.rt.cy+=+o[1];b.setBox(b.attrs,o[0],o[1])}}if(e.scale){o=za(e.scale)[Ja](ua);b.scale(+o[0]||1,+o[1]||+o[0]||1,+o[2]||null,+o[3]||null)}if("clip-rect"in e){o=za(e["clip-rect"])[Ja](ua);if(o[Z]==
4){o[2]=+o[2]+ +o[0];o[3]=+o[3]+ +o[1];A=m.clipRect||Ba.createElement("div");var B=A.style,D=m.parentNode;B.clip=a.format("rect({1}px {2}px {3}px {0}px)",o);if(!m.clipRect){B.position="absolute";B.top=0;B.left=0;B.width=b.paper.width+"px";B.height=b.paper.height+"px";D.parentNode.insertBefore(A,D);A[la](D);m.clipRect=A}}if(!e["clip-rect"])m.clipRect&&(m.clipRect.style.clip=va)}if(b.type=="image"&&e.src)m.src=e.src;if(b.type=="image"&&e.opacity){m.filterOpacity=" progid:DXImageTransform.Microsoft.Alpha(opacity="+
e.opacity*100+")";q.filter=(m.filterMatrix||va)+(m.filterOpacity||va)}e.font&&(q.font=e.font);e["font-family"]&&(q.fontFamily='"'+e["font-family"][Ja](",")[0][Pa](/^['"]+|['"]+$/g,va)+'"');e["font-size"]&&(q.fontSize=e["font-size"]);e["font-weight"]&&(q.fontWeight=e["font-weight"]);e["font-style"]&&(q.fontStyle=e["font-style"]);if(e.opacity!=null||e["stroke-width"]!=null||e.fill!=null||e.stroke!=null||e["stroke-width"]!=null||e["stroke-opacity"]!=null||e["fill-opacity"]!=null||e["stroke-dasharray"]!=
null||e["stroke-miterlimit"]!=null||e["stroke-linejoin"]!=null||e["stroke-linecap"]!=null){m=b.shape||m;q=m.getElementsByTagName("fill")&&m.getElementsByTagName("fill")[0];o=false;!q&&(o=q=Za("fill"));if("fill-opacity"in e||"opacity"in e){b=((+p["fill-opacity"]+1||2)-1)*((+p.opacity+1||2)-1)*((+a.getRGB(e.fill).o+1||2)-1);b<0&&(b=0);b>1&&(b=1);q.opacity=b}e.fill&&(q.on=true);if(q.on==null||e.fill=="none")q.on=false;if(q.on&&e.fill)if(b=e.fill.match(Sa)){q.src=b[1];q.type="tile"}else{q.color=a.getRGB(e.fill).hex;
q.src=va;q.type="solid";if(a.getRGB(e.fill).error&&(y.type in{circle:1,ellipse:1}||za(e.fill).charAt()!="r")&&yb(y,e.fill)){p.fill="none";p.gradient=e.fill}}o&&m[la](q);q=m.getElementsByTagName("stroke")&&m.getElementsByTagName("stroke")[0];o=false;!q&&(o=q=Za("stroke"));if(e.stroke&&e.stroke!="none"||e["stroke-width"]||e["stroke-opacity"]!=null||e["stroke-dasharray"]||e["stroke-miterlimit"]||e["stroke-linejoin"]||e["stroke-linecap"])q.on=true;(e.stroke=="none"||q.on==null||e.stroke==0||e["stroke-width"]==
0)&&(q.on=false);b=a.getRGB(e.stroke);q.on&&e.stroke&&(q.color=b.hex);b=((+p["stroke-opacity"]+1||2)-1)*((+p.opacity+1||2)-1)*((+b.o+1||2)-1);A=(na(e["stroke-width"])||1)*0.75;b<0&&(b=0);b>1&&(b=1);e["stroke-width"]==null&&(A=p["stroke-width"]);e["stroke-width"]&&(q.weight=A);A&&A<1&&(b*=A)&&(q.weight=1);q.opacity=b;e["stroke-linejoin"]&&(q.joinstyle=e["stroke-linejoin"]||"miter");q.miterlimit=e["stroke-miterlimit"]||8;e["stroke-linecap"]&&(q.endcap=e["stroke-linecap"]=="butt"?"flat":e["stroke-linecap"]==
"square"?"square":"round");if(e["stroke-dasharray"]){b={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};q.dashstyle=b[sa](e["stroke-dasharray"])?b[e["stroke-dasharray"]]:va}o&&m[la](q)}if(y.type=="text"){q=y.paper.span.style;p.font&&(q.font=p.font);p["font-family"]&&(q.fontFamily=p["font-family"]);p["font-size"]&&(q.fontSize=p["font-size"]);p["font-weight"]&&(q.fontWeight=
p["font-weight"]);p["font-style"]&&(q.fontStyle=p["font-style"]);y.node.string&&(y.paper.span.innerHTML=za(y.node.string)[Pa](/</g,"&#60;")[Pa](/&/g,"&#38;")[Pa](/\n/g,"<br>"));y.W=p.w=y.paper.span.offsetWidth;y.H=p.h=y.paper.span.offsetHeight;y.X=p.x;y.Y=p.y+Fa(y.H/2);switch(p["text-anchor"]){case "start":y.node.style["v-text-align"]="left";y.bbx=Fa(y.W/2);break;case "end":y.node.style["v-text-align"]="right";y.bbx=-Fa(y.W/2);break;default:y.node.style["v-text-align"]="center";break}}};yb=function(b,
e){b.attrs=b.attrs||{};var m="linear",p=".5 .5";b.attrs.gradient=e;e=za(e)[Pa](Qb,function(B,D,O){m="radial";if(D&&O){D=na(D);O=na(O);X(D-0.5,2)+X(O-0.5,2)>0.25&&(O=ka.sqrt(0.25-X(D-0.5,2))*((O>0.5)*2-1)+0.5);p=D+Na+O}return va});e=e[Ja](/\s*\-\s*/);if(m=="linear"){var q=e.shift();q=-na(q);if(isNaN(q))return null}var o=Pb(e);if(!o)return null;b=b.shape||b.node;e=b.getElementsByTagName("fill")[0]||Za("fill");!e.parentNode&&b.appendChild(e);if(o[Z]){e.on=true;e.method="none";e.color=o[0].color;e.color2=
o[o[Z]-1].color;b=[];for(var y=0,A=o[Z];y<A;y++)o[y].offset&&b[ja](o[y].offset+Na+o[y].color);e.colors&&(e.colors.value=b[Z]?b[Oa]():"0% "+e.color);if(m=="radial"){e.type="gradientradial";e.focus="100%";e.focussize=p;e.focusposition=p}else{e.type="gradient";e.angle=(270-q)%360}}return 1};ma=function(b,e,m){this[0]=b;this.id=a._oid++;this.node=b;b.raphael=this;this.Y=this.X=0;this.attrs={};this.Group=e;this.paper=m;this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1};!m.bottom&&(m.bottom=this);(this.prev=m.top)&&
(m.top.next=this);m.top=this;this.next=null};ma[ba].rotate=function(b,e,m){if(this.removed)return this;if(b==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][Oa](Na);return this._.rt.deg}b=za(b)[Ja](ua);if(b[Z]-1){e=na(b[1]);m=na(b[2])}b=na(b[0]);if(e!=null)this._.rt.deg=b;else this._.rt.deg+=b;m==null&&(e=null);this._.rt.cx=e;this._.rt.cy=m;this.setBox(this.attrs,e,m);this.Group.style.rotation=this._.rt.deg;return this};ma[ba].setBox=function(b,e,m){if(this.removed)return this;
var p=this.Group.style,q=this.shape&&this.shape.style||this.node.style;b=b||{};for(var o in b)if(b[sa](o))this.attrs[o]=b[o];e=e||this._.rt.cx;m=m||this._.rt.cy;var y=this.attrs,A;switch(this.type){case "circle":b=y.cx-y.r;o=y.cy-y.r;A=y=y.r*2;break;case "ellipse":b=y.cx-y.rx;o=y.cy-y.ry;A=y.rx*2;y=y.ry*2;break;case "image":b=+y.x;o=+y.y;A=y.width||0;y=y.height||0;break;case "text":this.textpath.v=["m",Fa(y.x),", ",Fa(y.y-2),"l",Fa(y.x)+1,", ",Fa(y.y-2)][Oa](va);b=y.x-Fa(this.W/2);o=y.y-this.H/2;
A=this.W;y=this.H;break;case "rect":case "path":if(this.attrs.path){y=pb(this.attrs.path);b=y.x;o=y.y;A=y.width;y=y.height}else{o=b=0;A=this.paper.width;y=this.paper.height}break;default:o=b=0;A=this.paper.width;y=this.paper.height;break}e=e==null?b+A/2:e;m=m==null?o+y/2:m;e-=this.paper.width/2;m-=this.paper.height/2;var B;p.left!=(B=e+"px")&&(p.left=B);p.top!=(B=m+"px")&&(p.top=B);this.X=kb[sa](this.type)?-e:b;this.Y=kb[sa](this.type)?-m:o;this.W=A;this.H=y;if(kb[sa](this.type)){q.left!=(B=-e*10+
"px")&&(q.left=B);q.top!=(B=-m*10+"px")&&(q.top=B)}else if(this.type=="text"){q.left!=(B=-e+"px")&&(q.left=B);q.top!=(B=-m+"px")&&(q.top=B)}else{p.width!=(B=this.paper.width+"px")&&(p.width=B);p.height!=(B=this.paper.height+"px")&&(p.height=B);q.left!=(B=b-e+"px")&&(q.left=B);q.top!=(B=o-m+"px")&&(q.top=B);q.width!=(B=A+"px")&&(q.width=B);q.height!=(B=y+"px")&&(q.height=B)}};ma[ba].hide=function(){!this.removed&&(this.Group.style.display="none");return this};ma[ba].show=function(){!this.removed&&
(this.Group.style.display="block");return this};ma[ba].getBBox=function(){if(this.removed)return this;if(kb[sa](this.type))return pb(this.attrs.path);return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}};ma[ba].remove=function(){if(!this.removed){Q(this,this.paper);this.node.parentNode.removeChild(this.node);this.Group.parentNode.removeChild(this.Group);this.shape&&this.shape.parentNode.removeChild(this.shape);for(var b in this)delete this[b];this.removed=true}};ma[ba].attr=function(b,
e){if(this.removed)return this;if(b==null){b={};for(var m in this.attrs)if(this.attrs[sa](m))b[m]=this.attrs[m];this._.rt.deg&&(b.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(b.scale=this.scale());b.gradient&&b.fill=="none"&&(b.fill=b.gradient)&&delete b.gradient;return b}if(e==null&&a.is(b,Ya)){if(b=="translation")return Da.call(this);if(b=="rotation")return this.rotate();if(b=="scale")return this.scale();if(b=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;
return this.attrs[b]}if(this.attrs&&e==null&&a.is(b,Ta)){var p={};m=0;for(e=b[Z];m<e;m++)p[b[m]]=this.attr(b[m]);return p}if(e!=null){p={};p[b]=e}e==null&&a.is(b,"object")&&(p=b);if(p){if(p.text&&this.type=="text")this.node.string=p.text;gb(this,p);if(p.gradient&&({circle:1,ellipse:1}[sa](this.type)||za(p.gradient).charAt()!="r"))yb(this,p.gradient);(!kb[sa](this.type)||this._.rt.deg)&&this.setBox(this.attrs)}return this};ma[ba].toFront=function(){!this.removed&&this.Group.parentNode[la](this.Group);
this.paper.top!=this&&S(this,this.paper);return this};ma[ba].toBack=function(){if(this.removed)return this;if(this.Group.parentNode.firstChild!=this.Group){this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild);W(this,this.paper)}return this};ma[ba].insertAfter=function(b){if(this.removed)return this;b.Group.nextSibling?b.Group.parentNode.insertBefore(this.Group,b.Group.nextSibling):b.Group.parentNode[la](this.Group);ha(this,b,this.paper);return this};ma[ba].insertBefore=
function(b){if(this.removed)return this;b.Group.parentNode.insertBefore(this.Group,b.Group);fa(this,b,this.paper);return this};var rb=/ progid:\S+Blur\([^\)]+\)/g;ma[ba].blur=function(b){var e=this.node.runtimeStyle,m=e.filter;m=m.replace(rb,va);if(+b!==0){this.attrs.blur=b;e.filter=m+Na+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+b||1.5)+")";e.margin=Raphael.format("-{0}px 0 0 -{0}px",Math.round(+b||1.5))}else{e.filter=m;e.margin=0;delete this.attrs.blur}};Sb=function(b,e,m,p){var q=
Za("group"),o=Za("oval");q.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px";q.coordsize=Ab;q.coordorigin=b.coordorigin;q[la](o);o=new ma(o,q,b);o.type="circle";gb(o,{stroke:"#000",fill:"none"});o.attrs.cx=e;o.attrs.cy=m;o.attrs.r=p;o.setBox({x:e-p,y:m-p,width:p*2,height:p*2});b.canvas[la](q);return o};var Bb=function(b,e,m,p,q){return q?a.format("M{0},{1}l{2},0a{3},{3},0,0,1,{3},{3}l0,{5}a{3},{3},0,0,1,{4},{3}l{6},0a{3},{3},0,0,1,{4},{4}l0,{7}a{3},{3},0,0,1,{3},{4}z",
b+q,e,m-q*2,q,-q,p-q*2,q*2-m,q*2-p):a.format("M{0},{1}l{2},0,0,{3},{4},0z",b,e,m,p,-m)};Tb=function(b,e,m,p,q,o){var y=Bb(e,m,p,q,o);b=b.path(y);var A=b.attrs;b.X=A.x=e;b.Y=A.y=m;b.W=A.width=p;b.H=A.height=q;A.r=o;A.path=y;b.type="rect";return b};Ub=function(b,e,m,p,q){var o=Za("group"),y=Za("oval");o.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px";o.coordsize=Ab;o.coordorigin=b.coordorigin;o[la](y);y=new ma(y,o,b);y.type="ellipse";gb(y,{stroke:"#000"});y.attrs.cx=
e;y.attrs.cy=m;y.attrs.rx=p;y.attrs.ry=q;y.setBox({x:e-p,y:m-q,width:p*2,height:q*2});b.canvas[la](o);return y};Mb=function(b,e,m,p,q,o){var y=Za("group"),A=Za("image");y.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px";y.coordsize=Ab;y.coordorigin=b.coordorigin;A.src=e;y[la](A);A=new ma(A,y,b);A.type="image";A.attrs.src=e;A.attrs.x=m;A.attrs.y=p;A.attrs.w=q;A.attrs.h=o;A.setBox({x:m,y:p,width:q,height:o});b.canvas[la](y);return A};Nb=function(b,e,m,p){var q=
Za("group"),o=Za("shape"),y=o.style,A=Za("path"),B=Za("textpath");q.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px";q.coordsize=Ab;q.coordorigin=b.coordorigin;A.v=a.format("m{0},{1}l{2},{1}",Fa(e*10),Fa(m*10),Fa(e*10)+1);A.textpathok=true;y.width=b.width;y.height=b.height;B.string=za(p);B.on=true;o[la](B);o[la](A);q[la](o);y=new ma(B,q,b);y.shape=o;y.textpath=A;y.type="text";y.attrs.text=p;y.attrs.x=e;y.attrs.y=m;y.attrs.w=1;y.attrs.h=1;gb(y,{font:eb.font,
stroke:"none",fill:"#000"});y.setBox();b.canvas[la](q);return y};Cb=function(b,e){var m=this.canvas.style;b==+b&&(b+="px");e==+e&&(e+="px");m.width=b;m.height=e;m.clip="rect(0 "+b+" "+e+" 0)";return this};var Za;Ba.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!Ba.namespaces.rvml&&Ba.namespaces.add("rvml","urn:schemas-microsoft-com:vml");Za=function(b){return Ba.createElement("<rvml:"+b+' class="rvml">')}}catch(ec){Za=function(b){return Ba.createElement("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}Gb=
function(){var b=K[Ma](0,arguments),e=b.container,m=b.height,p=b.width,q=b.x;b=b.y;if(!e)throw Error("VML container not found.");var o=new f,y=o.canvas=Ba.createElement("div"),A=y.style;q=q||0;b=b||0;p=p||512;m=m||342;p==+p&&(p+="px");m==+m&&(m+="px");o.width=1E3;o.height=1E3;o.coordsize=1E4+Na+1E4;o.coordorigin="0 0";o.span=Ba.createElement("span");o.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";y[la](o.span);A.cssText=a.format("width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",
p,m);if(e==1){Ba.body[la](y);A.left=q+"px";A.top=b+"px";A.position="absolute"}else e.firstChild?e.insertBefore(y,e.firstChild):e[la](y);M.call(o,o,a.fn);return o};f[ba].clear=function(){this.canvas.innerHTML=va;this.span=Ba.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[la](this.span);this.bottom=this.top=null};f[ba].remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=
ia(b);return true}}f[ba].safari=/^Apple|^Google/.test(Ha.navigator.vendor)&&(!(Ha.navigator.userAgent.indexOf("Version/4.0")+1)||Ha.navigator.platform.slice(0,2)=="iP")?function(){var b=this.rect(-99,-99,this.width+99,this.height+99);Ha.setTimeout(function(){b.remove()})}:function(){};var Jb=function(){if(Ba.addEventListener)return function(b,e,m,p){function q(y){if(lb&&cb[sa](e))for(var A=0,B=y.targetTouches&&y.targetTouches.length;A<B;A++)if(y.targetTouches[A].target==b){B=y;y=y.targetTouches[A];
y.originalEvent=B;y.preventDefault=ra;y.stopPropagation=Qa;break}return m.call(p,y)}var o=lb&&cb[e]?cb[e]:e;b.addEventListener(o,q,false);return function(){b.removeEventListener(o,q,false);return true}};else if(Ba.attachEvent)return function(b,e,m,p){function q(o){o=o||Ha.event;o.preventDefault=o.preventDefault||Aa;o.stopPropagation=o.stopPropagation||xa;return m.call(p,o)}b.attachEvent("on"+e,q);return function(){b.detachEvent("on"+e,q);return true}}}();for(sb=fb[Z];sb--;)(function(b){a[b]=ma[ba][b]=
function(e){if(a.is(e,"function")){this.events=this.events||[];this.events.push({name:b,f:e,unbind:Jb(this.shape||this.node||Ba,b,e,this)})}return this};a["un"+b]=ma[ba]["un"+b]=function(e){for(var m=this.events,p=m[Z];p--;)if(m[p].name==b&&m[p].f==e){m[p].unbind();m.splice(p,1);!m.length&&delete this.events;return this}return this}})(fb[sb]);ma[ba].hover=function(b,e){return this.mouseover(b).mouseout(e)};ma[ba].unhover=function(b,e){return this.unmouseover(b).unmouseout(e)};ma[ba].drag=function(b,
e,m){function p(y){var A=y.clientX,B=y.clientY;if(lb)for(var D=y.touches.length,O;D--;){O=y.touches[D];if(O.identifier==o._drag.id){A=O.clientX;B=O.clientY;(y.originalEvent?y.originalEvent:y).preventDefault();break}}else y.preventDefault();b&&b.call(o,A-o._drag.x,B-o._drag.y,A,B)}function q(){o._drag={};Raphael.unmousemove(p).unmouseup(q);m&&m.call(o)}this._drag={};var o=this.mousedown(function(y){(y.originalEvent?y.originalEvent:y).preventDefault();this._drag.x=y.clientX;this._drag.y=y.clientY;this._drag.id=
y.identifier;e&&e.call(this,y.clientX,y.clientY);Raphael.mousemove(p).mouseup(q)});return this};f[ba].circle=function(b,e,m){return Sb(this,b||0,e||0,m||0)};f[ba].rect=function(b,e,m,p,q){return Tb(this,b||0,e||0,m||0,p||0,q||0)};f[ba].ellipse=function(b,e,m,p){return Ub(this,b||0,e||0,m||0,p||0)};f[ba].path=function(b){b&&!a.is(b,Ya)&&!a.is(b[0],Ta)&&(b+=va);return Rb(a.format[Ma](a,arguments),this)};f[ba].image=function(b,e,m,p,q){return Mb(this,b||"about:blank",e||0,m||0,p||0,q||0)};f[ba].text=
function(b,e,m){return Nb(this,b||0,e||0,m||va)};f[ba].set=function(b){arguments[Z]>1&&(b=Array[ba].splice.call(arguments,0,arguments[Z]));return new Ea(b)};f[ba].setSize=Cb;f[ba].top=f[ba].bottom=null;f[ba].raphael=a;ma[ba].resetScale=function(){if(this.removed)return this;this._.sx=1;this._.sy=1;this.attrs.scale="1 1"};ma[ba].scale=function(b,e,m,p){if(this.removed)return this;if(b==null&&e==null)return{x:this._.sx,y:this._.sy,toString:Ia};e=e||b;!+e&&(e=b);var q,o,y=this.attrs;if(b!=0){var A=this.getBBox(),
B=A.x+A.width/2,D=A.y+A.height/2;q=b/this._.sx;o=e/this._.sy;m=+m||m==0?m:B;p=+p||p==0?p:D;A=~~(b/ka.abs(b));var O=~~(e/ka.abs(e)),T=this.node.style,da=m+(B-m)*q;D=p+(D-p)*o;switch(this.type){case "rect":case "image":var ca=y.width*A*q,t=y.height*O*o;this.attr({height:t,r:y.r*Ga(A*q,O*o),width:ca,x:da-ca/2,y:D-t/2});break;case "circle":case "ellipse":this.attr({rx:y.rx*A*q,ry:y.ry*O*o,r:y.r*Ga(A*q,O*o),cx:da,cy:D});break;case "text":this.attr({x:da,y:D});break;case "path":B=Lb(y.path);for(var E=true,
L=0,J=B[Z];L<J;L++){var I=B[L],P=ib.call(I[0]);if(!(P=="M"&&E)){E=false;if(P=="A"){I[B[L][Z]-2]*=q;I[B[L][Z]-1]*=o;I[1]*=A*q;I[2]*=O*o;I[5]=+!(A+O?!+I[5]:+I[5])}else if(P=="H"){P=1;for(var ea=I[Z];P<ea;P++)I[P]*=q}else if(P=="V"){P=1;for(ea=I[Z];P<ea;P++)I[P]*=o}else{P=1;for(ea=I[Z];P<ea;P++)I[P]*=P%2?q:o}}}o=pb(B);q=da-o.x-o.width/2;o=D-o.y-o.height/2;B[0][1]+=q;B[0][2]+=o;this.attr({path:B});break}if(this.type in{text:1,image:1}&&(A!=1||O!=1))if(this.transformations){this.transformations[2]="scale("[Ra](A,
",",O,")");this.node.setAttribute("transform",this.transformations[Oa](Na));q=A==-1?-y.x-(ca||0):y.x;o=O==-1?-y.y-(t||0):y.y;this.attr({x:q,y:o});y.fx=A-1;y.fy=O-1}else{this.node.filterMatrix=" progid:DXImageTransform.Microsoft"+".Matrix(M11="[Ra](A,", M12=0, M21=0, M22=",O,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')");T.filter=(this.node.filterMatrix||va)+(this.node.filterOpacity||va)}else if(this.transformations){this.transformations[2]=va;this.node.setAttribute("transform",
this.transformations[Oa](Na));y.fx=0;y.fy=0}else{this.node.filterMatrix=va;T.filter=(this.node.filterMatrix||va)+(this.node.filterOpacity||va)}y.scale=[b,e,m,p][Oa](Na);this._.sx=b;this._.sy=e}return this};ma[ba].clone=function(){if(this.removed)return null;var b=this.attr();delete b.scale;delete b.translation;return this.paper[this.type]().attr(b)};var Kb=r(function(b,e,m,p,q,o,y,A,B){for(var D=0,O,T=0;T<1.001;T+=0.0010){var da=a.findDotsAtSegment(b,e,m,p,q,o,y,A,T);T&&(D+=X(X(O.x-da.x,2)+X(O.y-
da.y,2),0.5));if(D>=B)return da;O=da}}),cc=r(function(b,e,m,p,q,o,y,A){for(var B={x:0,y:0},D=0,O=0;O<1.01;O+=0.01){var T=H(b,e,m,p,q,o,y,A,O);O&&(D+=X(X(B.x-T.x,2)+X(B.y-T.y,2),0.5));B=T}return D}),Ob=V(1),c=V(),h=V(0,1);ma[ba].getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return Ob(this.attrs.path)}};ma[ba].getPointAtLength=function(b){if(this.type=="path")return c(this.attrs.path,b)};ma[ba].getSubpath=function(b,e){if(this.type=="path"){if(ka.abs(this.getTotalLength()-
e)<1.0E-6)return h(this.attrs.path,b).end;e=h(this.attrs.path,e,1);return b?h(e,b).end:e}};a.easing_formulas={linear:function(b){return b},"<":function(b){return X(b,3)},">":function(b){return X(b-1,3)+1},"<>":function(b){b*=2;if(b<1)return X(b,3)/2;b-=2;return(X(b,3)+2)/2},backIn:function(b){return b*b*(2.70158*b-1.70158)},backOut:function(b){b-=1;return b*b*(2.70158*b+1.70158)+1},elastic:function(b){if(b==0||b==1)return b;return X(2,-10*b)*ka.sin((b-0.075)*2*ka.PI/0.3)+1},bounce:function(b){if(b<
1/2.75)b=7.5625*b*b;else if(b<2/2.75){b-=1.5/2.75;b=7.5625*b*b+0.75}else if(b<2.5/2.75){b-=2.25/2.75;b=7.5625*b*b+0.9375}else{b-=2.625/2.75;b=7.5625*b*b+0.984375}return b}};var n={length:0};ma[ba].animateWith=function(b,e,m,p,q){n[b.id]&&(e.start=n[b.id].start);return this.animate(e,m,p,q)};ma[ba].animateAlong=Ca();ma[ba].animateAlongBack=Ca(1);ma[ba].onAnimation=function(b){this._run=b||0;return this};ma[ba].animate=function(b,e,m,p){if(a.is(m,"function")||!m)p=m||null;var q={},o={},y={};for(var A in b)if(b[sa](A))if(nb[sa](A)){q[A]=
this.attr(A);q[A]==null&&(q[A]=eb[A]);o[A]=b[A];switch(nb[A]){case "along":var B=Ob(b[A]),D=c(b[A],B*!!b.back),O=this.getBBox();y[A]=B/e;y.tx=O.x;y.ty=O.y;y.sx=D.x;y.sy=D.y;o.rot=b.rot;o.back=b.back;o.len=B;b.rot&&(y.r=na(this.rotate())||0);break;case N:y[A]=(o[A]-q[A])/e;break;case "colour":q[A]=a.getRGB(q[A]);B=a.getRGB(o[A]);y[A]={r:(B.r-q[A].r)/e,g:(B.g-q[A].g)/e,b:(B.b-q[A].b)/e};break;case "path":B=xb(q[A],o[A]);q[A]=B[0];D=B[1];y[A]=[];B=0;for(O=q[A][Z];B<O;B++){y[A][B]=[0];for(var T=1,da=
q[A][B][Z];T<da;T++)y[A][B][T]=(D[B][T]-q[A][B][T])/e}break;case "csv":D=za(b[A])[Ja](ua);B=za(q[A])[Ja](ua);switch(A){case "translation":q[A]=[0,0];y[A]=[D[0]/e,D[1]/e];break;case "rotation":q[A]=B[1]==D[1]&&B[2]==D[2]?B:[0,D[1],D[2]];y[A]=[(D[0]-q[A][0])/e,0,0];break;case "scale":b[A]=D;q[A]=za(q[A])[Ja](ua);y[A]=[(D[0]-q[A][0])/e,(D[1]-q[A][1])/e,0,0];break;case "clip-rect":q[A]=za(q[A])[Ja](ua);y[A]=[];for(B=4;B--;)y[A][B]=(D[B]-q[A][B])/e;break}o[A]=D}}this.stop();this.in_animation=1;n[this.id]=
{start:b.start||+new Date,ms:e,easing:m,from:q,diff:y,to:o,el:this,callback:p,t:{x:0,y:0}};++n[Z]==1&&l();return this};ma[ba].stop=function(){n[this.id]&&n[Z]--;delete n[this.id];return this};ma[ba].translate=function(b,e){return this.attr({translation:b+" "+e})};ma[ba][pa]=function(){return"Rapha\u00ebl\u2019s object"};a.ae=n;Ea[ba][ja]=function(){for(var b,e,m=0,p=arguments[Z];m<p;m++)if((b=arguments[m])&&(b.constructor==ma||b.constructor==Ea)){e=this.items[Z];this[e]=this.items[e]=b;this[Z]++}return this};
Ea[ba].pop=function(){delete this[this[Z]--];return this.items.pop()};for(var u in ma[ba])if(ma[ba][sa](u))Ea[ba][u]=function(b){return function(){for(var e=0,m=this.items[Z];e<m;e++)this.items[e][b][Ma](this.items[e],arguments);return this}}(u);Ea[ba].attr=function(b,e){if(b&&a.is(b,Ta)&&a.is(b[0],"object")){e=0;for(var m=b[Z];e<m;e++)this.items[e].attr(b[e])}else{m=0;for(var p=this.items[Z];m<p;m++)this.items[m].attr(b,e)}return this};Ea[ba].animate=function(b,e,m,p){(a.is(m,"function")||!m)&&(p=
m||null);var q=this.items[Z],o=q,y,A=this,B;p&&(B=function(){!--q&&p.call(A)});m=a.is(m,Ya)?m:B;for(y=this.items[--o].animate(b,e,m,B);o--;)this.items[o].animateWith(y,b,e,m,B);return this};Ea[ba].insertAfter=function(b){for(var e=this.items[Z];e--;)this.items[e].insertAfter(b);return this};Ea[ba].getBBox=function(){for(var b=[],e=[],m=[],p=[],q=this.items[Z];q--;){var o=this.items[q].getBBox();b[ja](o.x);e[ja](o.y);m[ja](o.x+o.width);p[ja](o.y+o.height)}b=Ga[Ma](0,b);e=Ga[Ma](0,e);return{x:b,y:e,
width:$a[Ma](0,m)-b,height:$a[Ma](0,p)-e}};Ea[ba].clone=function(b){b=new Ea;for(var e=0,m=this.items[Z];e<m;e++)b[ja](this.items[e].clone());return b};a.registerFont=function(b){if(!b.face)return b;this.fonts=this.fonts||{};var e={w:b.w,face:{},glyphs:{}},m=b.face["font-family"];for(var p in b.face)if(b.face[sa](p))e.face[p]=b.face[p];if(this.fonts[m])this.fonts[m][ja](e);else this.fonts[m]=[e];if(!b.svg){e.face["units-per-em"]=bb(b.face["units-per-em"],10);for(var q in b.glyphs)if(b.glyphs[sa](q)){m=
b.glyphs[q];e.glyphs[q]={w:m.w,k:{},d:m.d&&"M"+m.d[Pa](/[mlcxtrv]/g,function(y){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[y]||"M"})+"z"};if(m.k)for(var o in m.k)if(m[sa](o))e.glyphs[q].k[o]=m.k[o]}}return b};f[ba].getFont=function(b,e,m,p){p=p||"normal";m=m||"normal";e=+e||{normal:400,bold:700,lighter:300,bolder:800}[e]||400;if(a.fonts){var q=a.fonts[b];if(!q){b=RegExp("(^|\\s)"+b[Pa](/[^\w\d\s+!~.:_-]/g,va)+"(\\s|$)","i");for(var o in a.fonts)if(a.fonts[sa](o))if(b.test(o)){q=a.fonts[o];break}}var y;
if(q){o=0;for(b=q[Z];o<b;o++){y=q[o];if(y.face["font-weight"]==e&&(y.face["font-style"]==m||!y.face["font-style"])&&y.face["font-stretch"]==p)break}}return y}};f[ba].print=function(b,e,m,p,q,o){o=o||"middle";var y=this.set(),A=za(m)[Ja](va),B=0;a.is(p,m)&&(p=this.getFont(p));if(p){m=(q||16)/p.face["units-per-em"];var D=p.face.bbox.split(ua);q=+D[0];o=+D[1]+(o=="baseline"?D[3]-D[1]+ +p.face.descent:(D[3]-D[1])/2);D=0;for(var O=A[Z];D<O;D++){var T=D&&p.glyphs[A[D-1]]||{},da=p.glyphs[A[D]];B+=D?(T.w||
p.w)+(T.k&&T.k[A[D]]||0):0;da&&da.d&&y[ja](this.path(da.d).attr({fill:"#000",stroke:"none",translation:[B,0]}))}y.scale(m,m,q,o).translate(b-q,e-o)}return y};var z=/\{(\d+)\}/g;a.format=function(b,e){var m=a.is(e,Ta)?[0][Ra](e):arguments;b&&a.is(b,Ya)&&m[Z]-1&&(b=b[Pa](z,function(p,q){return m[++q]==null?va:m[q]}));return b||va};a.ninja=function(){Va.was?Raphael=Va.is:delete Raphael;return a};a.el=ma[ba];return a}();(function(a,f){function g(X,ja){X=X?' id="'+ia+X+'"':"";return a("<div"+X+(ja?' style="'+ja+'"':"")+"/>")}function k(X,ja){ja=ja===W?Va.width():Va.height();return typeof X==="string"?Math.round(X.match(/%/)?ja/100*parseInt(X,10):parseInt(X,10)):X}function s(X){X=a.isFunction(X)?X.call(ka):X;return N.photo||X.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function r(){for(var X in N)if(a.isFunction(N[X])&&X.substring(0,2)!==S)N[X]=N[X].call(ka);N.rel=N.rel||ka.rel||Q;N.href=N.href||a(ka).attr("href");
N.title=N.title||ka.title}function v(X){ka=X;N=a.extend({},a(ka).data(fa));r();if(N.rel!==Q){Ha=a("."+hb).filter(function(){return(a(this).data(fa).rel||this.rel)===N.rel});Ga=Ha.index(ka);if(Ga===-1){Ha=Ha.add(ka);Ga=Ha.length-1}}else{Ha=a(ka);Ga=0}if(!Ya){Ya=Ta=M;$a=ka;try{$a.blur()}catch(ja){}a.event.trigger(Aa);N.onOpen&&N.onOpen.call(ka);Da.css({opacity:+N.opacity,cursor:N.overlayClose?"pointer":K}).show();N.w=k(N.initialWidth,W);N.h=k(N.initialHeight,H);pa.position(0);l&&Va.bind(F+wa+" scroll."+
wa,function(){Da.css({width:Va.width(),height:Va.height(),top:Va.scrollTop(),left:Va.scrollLeft()})}).trigger("scroll."+wa)}va.add(Ja).add(za).add(Na).add(lb).hide();fb.html(N.close).show();pa.slideshow();pa.load()}var C="click",F="resize.",H="y",K="auto",M=true,Q="nofollow",S="on",W="x",ha={transition:"elastic",speed:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:M,scrolling:M,inline:false,html:false,
iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:M,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,loop:M,slideshow:false,slideshowAuto:M,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,overlayClose:M,escKey:M,arrowKey:M},fa="colorbox",ia="cbox",Aa=ia+"_open",ra=ia+"_load",xa=ia+"_complete",Qa=ia+"_cleanup",Ia=ia+
"_closed",V=a.browser.msie&&!a.support.opacity,l=V&&a.browser.version<7,wa=ia+"_IE6",Da,Ca,Ea,ua,ab,ba,sa,Ba,Ha,Va,la,Ma,Ra,lb,va,Na,za,Ja,fb,cb,Oa,Z,Xa,ka,$a,Ga,N,Ya,Ta,pa,hb=ia+"Element";pa=a.fn[fa]=a[fa]=function(X,ja){var Ka=this;if(!Ka[0]&&Ka.selector)return Ka;X=X||{};if(ja)X.onComplete=ja;if(!Ka[0]||Ka.selector===undefined){Ka=a("<a/>");X.open=M}Ka.each(function(){a(this).data(fa,a.extend({},a(this).data(fa)||ha,X)).addClass(hb)});X.open&&v(Ka[0]);return Ka};pa.init=function(){Va=a(f);Ca=g().attr({id:fa,
"class":V?ia+"IE":""});Da=g("Overlay",l?"position:absolute":"").hide();Ea=g("Wrapper");ua=g("Content").append(la=g("LoadedContent","width:0; height:0"),Ra=g("LoadingOverlay").add(g("LoadingGraphic")),lb=g("Title"),va=g("Current"),za=g("Next"),Ja=g("Previous"),Na=g("Slideshow"),fb=g("Close"));Ea.append(g().append(g("TopLeft"),ab=g("TopCenter"),g("TopRight")),g().append(ba=g("MiddleLeft"),ua,sa=g("MiddleRight")),g().append(g("BottomLeft"),Ba=g("BottomCenter"),g("BottomRight"))).children().children().css({"float":"left"});
Ma=g(false,"position:absolute; width:9999px; visibility:hidden; display:none");a("body").prepend(Da,Ca.append(Ea,Ma));ua.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover");cb=ab.height()+Ba.height()+ua.outerHeight(M)-ua.height();Oa=ba.width()+sa.width()+ua.outerWidth(M)-ua.width();Z=la.outerHeight(M);Xa=la.outerWidth(M);Ca.css({"padding-bottom":cb,"padding-right":Oa}).hide();za.click(pa.next);Ja.click(pa.prev);fb.click(pa.close);ua.children().removeClass("hover");
a("."+hb).live(C,function(X){if(X.button!==0&&typeof X.button!=="undefined"||X.ctrlKey||X.shiftKey||X.altKey)return M;else{v(this);return false}});Da.click(function(){N.overlayClose&&pa.close()});a(document).bind("keydown",function(X){if(Ya&&N.escKey&&X.keyCode===27){X.preventDefault();pa.close()}if(Ya&&N.arrowKey&&!Ta&&Ha[1])if(X.keyCode===37&&(Ga||N.loop)){X.preventDefault();Ja.click()}else if(X.keyCode===39&&(Ga<Ha.length-1||N.loop)){X.preventDefault();za.click()}})};pa.remove=function(){Ca.add(Da).remove();
a("."+hb).die(C).removeData(fa).removeClass(hb)};pa.position=function(X,ja){function Ka(na){ab[0].style.width=Ba[0].style.width=ua[0].style.width=na.style.width;Ra[0].style.height=Ra[1].style.height=ua[0].style.height=ba[0].style.height=sa[0].style.height=na.style.height}var Sa,db=Math.max(Va.height()-N.h-Z-cb,0)/2+Va.scrollTop(),Fa=Math.max(Va.width()-N.w-Xa-Oa,0)/2+Va.scrollLeft();Sa=Ca.width()===N.w+Xa&&Ca.height()===N.h+Z?0:X;Ea[0].style.width=Ea[0].style.height="9999px";Ca.dequeue().animate({width:N.w+
Xa,height:N.h+Z,top:db,left:Fa},{duration:Sa,complete:function(){Ka(this);Ta=false;Ea[0].style.width=N.w+Xa+Oa+"px";Ea[0].style.height=N.h+Z+cb+"px";ja&&ja()},step:function(){Ka(this)}})};pa.resize=function(X){if(Ya){X=X||{};if(X.width)N.w=k(X.width,W)-Xa-Oa;if(X.innerWidth)N.w=k(X.innerWidth,W);la.css({width:N.w});if(X.height)N.h=k(X.height,H)-Z-cb;if(X.innerHeight)N.h=k(X.innerHeight,H);if(!X.innerHeight&&!X.height){X=la.wrapInner("<div style='overflow:auto'></div>").children();N.h=X.height();X.replaceWith(X.children())}la.css({height:N.h});
pa.position(N.transition==="none"?0:N.speed)}};pa.prep=function(X){function ja(db){var Fa,na,bb,ib,eb=Ha.length,nb=N.loop;pa.position(db,function(){function Pa(){V&&Ca[0].style.removeAttribute("filter")}if(Ya){V&&Ka&&la.fadeIn(100);N.iframe&&a("<iframe frameborder=0"+(N.scrolling?"":" scrolling='no'")+(V?" allowtransparency='true'":"")+"/>").appendTo(la).attr({src:N.href,name:(new Date).getTime()});la.show();lb.show().html(N.title);if(eb>1){va.html(N.current.replace(/\{current\}/,Ga+1).replace(/\{total\}/,
eb)).show();za[nb||Ga<eb-1?"show":"hide"]().html(N.next);Ja[nb||Ga?"show":"hide"]().html(N.previous);Fa=Ga?Ha[Ga-1]:Ha[eb-1];bb=Ga<eb-1?Ha[Ga+1]:Ha[0];if(N.slideshow){Na.show();Ga===eb-1&&!nb&&Ca.is("."+ia+"Slideshow_on")&&Na.click()}if(N.preloading){ib=a(bb).data(fa).href||bb.href;na=a(Fa).data(fa).href||Fa.href;if(s(ib))a("<img/>")[0].src=ib;if(s(na))a("<img/>")[0].src=na}}Ra.hide();N.transition==="fade"?Ca.fadeTo(Sa,1,function(){Pa()}):Pa();Va.bind(F+ia,function(){pa.position(0)});a.event.trigger(xa);
N.onComplete&&N.onComplete.call(ka)}})}if(Ya){var Ka,Sa=N.transition==="none"?0:N.speed;Va.unbind(F+ia);la.remove();la=g("LoadedContent").html(X);la.hide().appendTo(Ma.show()).css({width:function(){N.w=N.w||la.width();N.w=N.mw&&N.mw<N.w?N.mw:N.w;return N.w}(),overflow:N.scrolling?K:"hidden"}).css({height:function(){N.h=N.h||la.height();N.h=N.mh&&N.mh<N.h?N.mh:N.h;return N.h}()}).prependTo(ua);Ma.hide();a("#"+ia+"Photo").css({cssFloat:"none"});l&&a("select").not(Ca.find("select")).filter(function(){return this.style.visibility!==
"hidden"}).css({visibility:"hidden"}).one(Qa,function(){this.style.visibility="inherit"});N.transition==="fade"?Ca.fadeTo(Sa,0,function(){ja(0)}):ja(Sa)}};pa.load=function(){var X,ja,Ka,Sa=pa.prep;Ta=M;ka=Ha[Ga];N=a.extend({},a(ka).data(fa));r();a.event.trigger(ra);N.onLoad&&N.onLoad.call(ka);N.h=N.height?k(N.height,H)-Z-cb:N.innerHeight&&k(N.innerHeight,H);N.w=N.width?k(N.width,W)-Xa-Oa:N.innerWidth&&k(N.innerWidth,W);N.mw=N.w;N.mh=N.h;if(N.maxWidth){N.mw=k(N.maxWidth,W)-Xa-Oa;N.mw=N.w&&N.w<N.mw?
N.w:N.mw}if(N.maxHeight){N.mh=k(N.maxHeight,H)-Z-cb;N.mh=N.h&&N.h<N.mh?N.h:N.mh}X=N.href;Ra.show();if(N.inline){g("InlineTemp").hide().insertBefore(a(X)[0]).bind(ra+" "+Qa,function(){a(this).replaceWith(la.children())});Sa(a(X))}else if(N.iframe)Sa(" ");else if(N.html)Sa(N.html);else if(s(X)){ja=new Image;ja.onload=function(){var db;ja.onload=null;ja.id=ia+"Photo";a(ja).css({margin:K,border:"none",display:"block",cssFloat:"left"});if(N.scalePhotos){Ka=function(){ja.height-=ja.height*db;ja.width-=
ja.width*db};if(N.mw&&ja.width>N.mw){db=(ja.width-N.mw)/ja.width;Ka()}if(N.mh&&ja.height>N.mh){db=(ja.height-N.mh)/ja.height;Ka()}}if(N.h)ja.style.marginTop=Math.max(N.h-ja.height,0)/2+"px";setTimeout(function(){Sa(ja)},1);Ha[1]&&(Ga<Ha.length-1||N.loop)&&a(ja).css({cursor:"pointer"}).click(pa.next);if(V)ja.style.msInterpolationMode="bicubic"};ja.src=X}else g().appendTo(Ma).load(X,function(db,Fa,na){Sa(Fa==="error"?"Request unsuccessful: "+na.statusText:this)})};pa.next=function(){if(!Ta){Ga=Ga<Ha.length-
1?Ga+1:0;pa.load()}};pa.prev=function(){if(!Ta){Ga=Ga?Ga-1:Ha.length-1;pa.load()}};pa.slideshow=function(){function X(){Na.text(N.slideshowStop).bind(xa,function(){Ka=setTimeout(pa.next,N.slideshowSpeed)}).bind(ra,function(){clearTimeout(Ka)}).one(C,function(){ja()});Ca.removeClass(Sa+"off").addClass(Sa+S)}var ja,Ka,Sa=ia+"Slideshow_";Na.bind(Ia,function(){Na.unbind();clearTimeout(Ka);Ca.removeClass(Sa+"off "+Sa+S)});ja=function(){clearTimeout(Ka);Na.text(N.slideshowStart).unbind(xa+" "+ra).one(C,
function(){X();Ka=setTimeout(pa.next,N.slideshowSpeed)});Ca.removeClass(Sa+S).addClass(Sa+"off")};if(N.slideshow&&Ha[1])N.slideshowAuto?X():ja()};pa.close=function(){if(Ya){Ya=false;a.event.trigger(Qa);N.onCleanup&&N.onCleanup.call(ka);Va.unbind("."+ia+" ."+wa);Da.fadeTo("fast",0);Ca.stop().fadeTo("fast",0,function(){Ca.find("iframe").attr("src","about:blank");la.remove();Ca.add(Da).css({opacity:1,cursor:K}).hide();try{$a.focus()}catch(X){}setTimeout(function(){a.event.trigger(Ia);N.onClosed&&N.onClosed.call(ka)},
1)})}};pa.element=function(){return a(ka)};pa.settings=ha;a(pa.init)})(jQuery,this);(function(a){function f(v){function C(F){var H=RegExp(a.map(F,encodeURIComponent).join("|"),"ig");return function(K){return K.replace(H,decodeURIComponent)}}v=a.extend({unescape:false},v||{});g.encoder=function(F){if(F===true)return function(H){return H};if(typeof F=="string"&&(F=C(F.split("")))||typeof F=="function")return function(H){return F(encodeURIComponent(H))};return encodeURIComponent}(v.unescape)}var g={put:function(v,C){(C||window).location.hash=this.encoder(v)},get:function(v){v=(v||window).location.hash.replace(/^#/,
"");try{return a.browser.mozilla?v:decodeURIComponent(v)}catch(C){return v}},encoder:encodeURIComponent},k={id:"__jQuery_history",init:function(){var v='<iframe id="'+this.id+'" style="display:none" src="javascript:false;" />';a("body").prepend(v);return this},_document:function(){return a("#"+this.id)[0].contentWindow.document},put:function(v){var C=this._document();C.open();C.close();g.put(v,C)},get:function(){return g.get(this._document())}},s={};s.base={callback:undefined,type:undefined,check:function(){},
load:function(){},init:function(v,C){f(C);r.callback=v;r._options=C;r._init()},_init:function(){},_options:{}};s.timer={_appState:undefined,_init:function(){var v=g.get();r._appState=v;r.callback(v);setInterval(r.check,100)},check:function(){var v=g.get();if(v!=r._appState){r._appState=v;r.callback(v)}},load:function(v){if(v!=r._appState){g.put(v);r._appState=v;r.callback(v)}}};s.iframeTimer={_appState:undefined,_init:function(){var v=g.get();r._appState=v;k.init().put(v);r.callback(v);setInterval(r.check,
100)},check:function(){var v=k.get(),C=g.get();if(C!=v)if(C==r._appState){r._appState=v;g.put(v);r.callback(v)}else{r._appState=C;k.put(C);r.callback(C)}},load:function(v){if(v!=r._appState){g.put(v);k.put(v);r._appState=v;r.callback(v)}}};s.hashchangeEvent={_init:function(){r.callback(g.get());a(window).bind("hashchange",r.check)},check:function(){r.callback(g.get())},load:function(v){g.put(v)}};var r=a.extend({},s.base);r.type=a.browser.msie&&(a.browser.version<8||document.documentMode<8)?"iframeTimer":
"onhashchange"in window?"hashchangeEvent":"timer";a.extend(r,s[r.type]);a.history=r})(jQuery);var stage=[window.screenX,window.screenY,window.innerWidth,window.innerHeight],res_current=-1,res=[{multiplier:1,name:"sd",cssFile:"assets/css/ftm-sd.css",gaugeIndicatorNeedleSrc:"assets/img/sd/pressure-display-pointer-sd.png",spawnY:-215,bubbleSizeMax:200,bubbleSizeMin:130,avatarLeft:"-22%",avatarTop:"20px",maxBubbles:8,logoWidth:220},{multiplier:1.4,name:"hd",cssFile:"assets/css/ftm-hd.css",gaugeIndicatorNeedleSrc:"assets/img/hd/pressure-display-pointer-hd.png",spawnY:-280,bubbleSizeMax:300,bubbleSizeMin:190,
avatarLeft:"-22%",avatarTop:"20px",maxBubbles:10,logoWidth:310}],version="",worldAABB,world,iterations=1,time_step=1/30,walls=[],wall_thickness=200,wallsSetted=false,bodies=[],elements=[],text,bubble_wrapper,search_query="",PI2=Math.PI*2,gravity_y=-50,gravity_y_inverted=150,gauge_max_minutes=20,spawn_y_impulse=-15,spawn_y_impulse_inverted=-400,spawn_y_impulse_current=spawn_y_impulse,interval_spawn,interval_loop,timeout_data_interval,timeout_data_interval_time=6E4,timeout_getcustomsearch,fresh_custom_search=
true,debug=false,data_update_count=0,bubble_count=0,lamp_time_on=1E3,pool=[],pool_index=0,pool_count_spawned=0,timeline_data,timeline_data_max_id=0,sb_timeline_step=0,search_data="",search_data_max_id=0,sb_clock_step=0,sb_clock_last=0,sb_ffdownloads_step=0,sb_ffdownloads_last=0,sb_ffdownloads_total=0,sb_followers_step=0,sb_followers_last=0,sb_followers_total=0,keywords,ds_type,ds_datetime,ds_datetime_description,ds_datetime_reached,ds_datetime_interval,ds_followers,ds_followers_description,ds_stats_retweets=
0,ds_stats_facebook_shares=0,idleTimeout,isIdle=true;getBrowserDimensions();function loadCSS(a){var f=document.createElement("link");f.href=a;f.rel="stylesheet";f.type="text/css";f.media="screen, projection";document.getElementsByTagName("head")[0].appendChild(f)}
$(document).ready(function(){$(window).resize(function(){getBrowserDimensions();setWalls()});loadCSS(res[res_current].cssFile);init();play();timeout_data_interval=setInterval(getDataFromProxy,timeout_data_interval_time);$.history.init(function(a){if(a!=""){$("#search-input").val(decodeURIComponent(a));search()}},{unescape:""});$("#flow-transposer a").click(function(){var a=$(this).parent();if(a.hasClass("up")){a.removeClass("up").addClass("down");pause()}else{a.removeClass("down").addClass("up");
play()}return false});$("#gravity-inverter a").click(function(){var a=$(this).parent();if(world.m_gravity.y==gravity_y){a.removeClass("up").addClass("down");world.m_gravity.y=gravity_y_inverted;spawn_y_impulse_current=spawn_y_impulse_inverted}else{a.removeClass("down").addClass("up");world.m_gravity.y=gravity_y;spawn_y_impulse_current=spawn_y_impulse}return false});$("form#search-box").submit(function(){search();$.history.load(search_query);return false});$("a.colorbox").colorbox({width:"50%",opacity:0.8,
inline:true,href:"#colophon",title:" ",scrolling:false,onComplete:function(){$.colorbox.resize()}});$(this).mousemove(function(){isIdle=false;idleTimeout||(idleTimeout=setTimeout("setIdle()",3E3))});input_field_values=[];$("input").each(function(){input_field_values[$(this).attr("name")]=$(this).attr("value")}).focus(function(){input_field_values[$(this).attr("name")]==$(this).attr("value")&&$(this).attr("value","")}).blur(function(){$(this).attr("value")==""&&$(this).attr("value",input_field_values[$(this).attr("name")])})});
function setIdle(){clearTimeout(idleTimeout);idleTimeout=null;isIdle=true}function play(){interval_loop=setInterval(loop,25);interval_spwan=setInterval(spawn,4E3)}function pause(){clearInterval(interval_loop);clearInterval(interval_spwan)}
function init(){bubble_wrapper=document.getElementById("bubbles");worldAABB=new b2AABB;worldAABB.minVertex.Set(-200,0);worldAABB.maxVertex.Set(screen.width+200,screen.height+1E3);world=new b2World(worldAABB,new b2Vec2(0,0),false);world.m_gravity.y=gravity_y;setWalls()}
function calculateGauge(){if(search_data.length){var a=new Date(search_data[0].created_at),f=search_data.length<=10?new Date(search_data[search_data.length-1].created_at):new Date(search_data[9].created_at);a=Math.abs(a.getTime()-f.getTime())/6E4;degrees=a>gauge_max_minutes?2:180-a*180/gauge_max_minutes}else degrees=0;gaugeIndicatorNeedleMove(degrees)}
function getDataFromProxy(){$.getJSON("/proxy.php",function(a){if(a.status.http_code==200){data_update_count++;sb_clock_step=a.contents.special_bubbles.sb_clock_step;sb_ffdownloads_step=a.contents.special_bubbles.sb_ffdownloads_step;sb_ffdownloads_total=a.contents.special_bubbles.sb_ffdownloads_total;sb_followers_step=a.contents.special_bubbles.sb_followers_step;sb_timeline_step=a.contents.special_bubbles.sb_timeline_step;ds_type=a.contents.display.ds_type;ds_datetime=a.contents.display.ds_datetime;
ds_datetime_description=a.contents.display.ds_datetime_description;ds_datetime_reached=a.contents.display.ds_datetime_reached;ds_followers=a.contents.display.ds_followers;ds_followers_description=a.contents.display.ds_followers_description;ds_stats_facebook_shares=a.contents.display.ds_stats_facebook_shares;ds_stats_retweets=a.contents.display.ds_stats_retweets;keywords=a.contents.keywords;checkVersion(a.contents.version);if(a.contents.timeline.length){sb_followers_total=a.contents.timeline[0].user.followers_count;
timeline_data=a.contents.timeline;timeline_data.reverse()}else throwError("Twitter REST API down");if(search_query=="")if(a.contents.search_results.results){search_data=a.contents.search_results.results;process_search_result()}else throwError("Twitter Search API down");specialBubbleFFDownloadsCheck();specialBubbleFollowersCheck();updateStats();updateCountdown()}else throwError("Error (HTTP Code "+a.status.http_code+")");spawn()})}
function checkVersion(a){if(a!=version&&version!="")window.location=window.location;version=a}function search(){clearPool();$("#search-submit-bttn").addClass("loading");search_query=encodeURIComponent($("#search-input").val());if($("#search-input").val()=="Search")search_query="";fresh_custom_search=true;clearTimeout(timeout_getcustomsearch);getCustomSearch()}
function getCustomSearch(){$.getJSON("http://search.twitter.com/search.json?callback=?&rpp=40&q="+search_query,function(a){if(a.results){search_data=a.results;process_search_result()}else throwError("Twitter Search API down");$("#search-submit-bttn").removeClass("loading")});timeout_getcustomsearch=setTimeout(getCustomSearch,3E5)}
function process_search_result(){calculateGauge();search_data.reverse();var a=[],f;for(f=0;f<search_data.length;f++){var g=search_data[f];if(g.id>search_data_max_id){pool.splice(pool_index,0,{type:"search",data:g});a.push(g.from_user);search_data_max_id=g.id}}a.length>0&&$.getJSON("proxy.php?screen_names="+a.toString(),function(k){if(k)for(f=0;f<k.contents.length;f++)for(j=0;j<pool.length;j++)if(pool[j].type=="search")if(pool[j].data.from_user.toLowerCase()==k.contents[f].screen_name.toLowerCase())pool[j].data.user=
k.contents[f]});if(fresh_custom_search){if(f==0)pool.splice(pool_index,0,{type:"search_presenter",data:{h1:"Sorry",p:"Zero tweets found"}});else if(search_query!=""){search_query_clean=decodeURIComponent(search_query);search_query_clean=search_query_clean.replace("<","&lt;");search_query_clean=search_query_clean.replace(">","&gt;");search_query_clean='"'+friendlyTrim(search_query_clean,16)+'"';pool.splice(pool_index,0,{type:"search_presenter",data:{h1:"Showing results for",p:search_query_clean}})}else pool.splice(pool_index,
0,{type:"search_presenter",data:{h1:"Showing Firefox activity on twitter",p:""}});fresh_custom_search=false}}function clearPool(){pool_index=search_data_max_id=0;pool=[]}function friendlyTrim(a,f){var g=a.substr(0,f);if(a.length>f)g+="...";return g}
function updateCountdown(){var a;clearInterval(ds_datetime_interval);if(ds_type=="followers"){if(sb_followers_total>ds_followers){counter_dd=addCommas(sb_followers_total)+" followers";a="Previous milestone: "+addCommas(ds_followers)}else{counter_dd=addCommas(sb_followers_total)+" followers";a=addCommas(ds_followers-sb_followers_total)+" to reach "+addCommas(ds_followers)}$("#counter dd").text(counter_dd).attr("title",counter_dd)}else if(ds_type=="datetime"){a=ds_datetime_description;ds_datetime_interval=
setInterval(datetimeCountdown,1E3)}else a=counter_dd="";$("#counter dt").text(a).attr("title",a)}function updateStats(){$("dd.twitter-follow a").text(addCommas(sb_followers_total));$("dd.twitter-retweet a").text(addCommas(ds_stats_retweets));$("dd.fb-share a").text(addCommas(ds_stats_facebook_shares))}
function spawn(){if(pool.length!=0)if(!(bodies.length>=res[res_current].maxBubbles)){if(pool_index+1>pool.length)pool_index=0;createBubble(pool[pool_index].type,pool[pool_index].data);pool_count_spawned++;pool_index++;specialBubbleTimelineCheck()}}function getHeightClass(a){var f="";return f=res_current==0?a<=100?"s":a<=140?"m":a<=180?"l":a<=220?"xl":"xxl":a<=150?"s":a<=200?"m":a<=250?"l":a<=300?"xl":"xxl"}
function createBubble(a,f){var g=stage[2]/2,k=stage[3]+res[res_current].spawnY;bubble_count++;var s;turnLampOn();setTimeout(turnLampOff,lamp_time_on);var r=document.createElement("article");switch(a){case "search":s="high";if(f.user){followers_count=parseInt(f.user.followers_count);s=followers_count<=100?"low":followers_count<=300?"med":followers_count<=600?"high":"vhigh"}r.className="bubble tweet "+s;r.innerHTML=buildBubbleTweet(f);break;case "clock":r.className="bubble time";r.innerHTML=buildBubbleClock(f);
pool.splice(pool_index,1);pool_index--;break;case "ffdownloads":r.className="bubble downloads";r.innerHTML=buildBubbleDownloads(f);pool.splice(pool_index,1);pool_index--;break;case "followers":r.className="bubble followers";r.innerHTML=buildBubbleFollowers(f);pool.splice(pool_index,1);pool_index--;break;case "timeline":r.className="bubble tweet firefox vhigh";r.innerHTML=buildBubbleTweet(f);pool.splice(pool_index,1);pool_index--;break;case "error":r.className="bubble error";r.innerHTML=buildBubbleError(f);
pool.splice(pool_index,1);pool_index--;break;case "search_presenter":r.className="bubble search";r.innerHTML=buildBubbleSearch(f);pool.splice(pool_index,1);pool_index--;break}r.style.position="absolute";r.style.left="-600px";r.style.top="0px";r.id=bubble_count;jquery_element=$(r);$(bubble_wrapper).append(r);height=jquery_element.height();height_class=getHeightClass(height);jquery_element.addClass(height_class);$.data(jquery_element,"height_class",height_class);s=0.5*res[res_current].bubbleSizeMax+
0.5*height;if(s>res[res_current].bubbleSizeMax)s=res[res_current].bubbleSizeMax;if(s<res[res_current].bubbleSizeMin)s=res[res_current].bubbleSizeMin;r.width=s;r.height=s;jquery_element.hover(function(){if(!isIdle){$(this).css({"z-index":"999"}).find("nav").fadeIn(20);bubble_left=Math.floor($(this).css("left").replace("px",""));bubble_top=Math.floor($(this).css("top").replace("px",""));bubble_left-res[res_current].logoWidth<0&&bubble_top-150<0&&$("header").css({"z-index":"10"});for(var F=bodies.length,
H=$(this).attr("id"),K=0;K<F;K++)if(bodies[K].m_userData.id==H)bodies[K].m_userData.hover=true}},function(){$(this).css({"z-index":"10"}).find("nav").fadeOut(100);$("header").css({"z-index":"40"});for(var F=0;F<bodies.length;F++)if(bodies[F].m_userData.id==$(this).attr("id"))bodies[F].m_userData.hover=false});jquery_element.find("li.flip a").click(function(){for(var F=bodies.length,H=$(this).parents(".bubble").attr("id"),K="",M=0;M<F;M++)if(bodies[M].m_userData.id==H)K=bodies[M].m_userData.height_class;
if($(this).parents(".bubble").find("section").hasClass("hide")){$(this).parents(".bubble").find("p.text, header, section").toggleClass("hide");$(this).parents(".bubble").removeClass(K);height=$(this).parents(".bubble").height();new_height_class=getHeightClass(height);$(this).parents(".bubble").addClass(new_height_class)}else{$(this).parents(".bubble").removeClass("s m l xl xxl");$(this).parents(".bubble").addClass(K);$(this).parents(".bubble").find("p.text, header, section").toggleClass("hide")}return false});
$(bubble_wrapper).find(".avatar-wrapper").delay(500).animate({left:res[res_current].avatarLeft,top:res[res_current].avatarTop},1E3);elements.push(r);var v=new b2BodyDef,C=new b2CircleDef;C.radius=s>>1;C.density=1;C.friction=0.6;C.restitution=0.3;C.preventRotation=true;v.AddShape(C);v.userData={element:r,id:bubble_count,hover:false,height_class:height_class};v.position.Set(g,k);v.linearVelocity.Set(Math.random()*400-200,spawn_y_impulse_current);bodies.push(world.CreateBody(v))}
function setWalls(){if(wallsSetted){world.DestroyBody(walls[0]);world.DestroyBody(walls[1]);world.DestroyBody(walls[2]);world.DestroyBody(walls[3]);walls[0]=null;walls[1]=null;walls[2]=null;walls[3]=null}walls[0]=createBox(world,stage[2]/2,0,stage[2],10*res[res_current].multiplier);walls[1]=createBox(world,stage[2]/2,stage[3],stage[2],100*res[res_current].multiplier);walls[2]=createPoly(world,stage[2]/2+100*res[res_current].multiplier,stage[3]-330*res[res_current].multiplier,[[10*res[res_current].multiplier,
0],[40*res[res_current].multiplier,0],[110*res[res_current].multiplier,60*res[res_current].multiplier],[110*res[res_current].multiplier,330*res[res_current].multiplier],[0,330*res[res_current].multiplier]],true);walls[3]=createPoly(world,stage[2]/2-210*res[res_current].multiplier,stage[3]-330*res[res_current].multiplier,[[70*res[res_current].multiplier,0],[100*res[res_current].multiplier,0],[110*res[res_current].multiplier,330*res[res_current].multiplier],[0,330*res[res_current].multiplier],[0,60*
res[res_current].multiplier]],true);wallsSetted=true}function specialBubbleClockCheck(){if(sb_clock_step>0){var a=new Date;hours=a.getHours();minutes=a.getMinutes();seconds=a.getSeconds();if(minutes<10)minutes="0"+minutes;if(seconds==0&&minutes%sb_clock_step==0&&hours+"h"+minutes!=sb_clock_last){sb_clock_last=hours+"h"+minutes;pool.splice(pool_index,0,{type:"clock",data:sb_clock_last})}}}
function specialBubbleFFDownloadsCheck(){if(sb_ffdownloads_step>0){if(sb_ffdownloads_last==0)sb_ffdownloads_last=sb_ffdownloads_total;if(sb_ffdownloads_total>sb_ffdownloads_last&&Math.floor(sb_ffdownloads_total/sb_ffdownloads_step)>Math.floor(sb_ffdownloads_last/sb_ffdownloads_step)){sb_ffdownloads_last=sb_ffdownloads_total;pool.splice(pool_index,0,{type:"ffdownloads",data:addCommas(Math.floor(sb_ffdownloads_total/sb_ffdownloads_step)*sb_ffdownloads_step)})}}}
function specialBubbleFollowersCheck(){if(sb_followers_step>0){if(sb_followers_last==0)sb_followers_last=sb_followers_total;if(sb_followers_total>sb_followers_last&&Math.floor(sb_followers_total/sb_followers_step)>Math.floor(sb_followers_last/sb_followers_step)){sb_followers_last=sb_followers_total;pool.splice(pool_index,0,{type:"followers",data:addCommas(Math.floor(sb_followers_total/sb_followers_step)*sb_followers_step)})}}}
function specialBubbleTimelineCheck(){if(timeline_data)if(sb_timeline_step>0&&timeline_data.length>0)if(pool_count_spawned%sb_timeline_step==0||!search_data.length){for(var a=0,f=false;a<timeline_data.length&&!f;){var g=timeline_data[a];if(g.id>timeline_data_max_id){pool.splice(pool_index,0,{type:"timeline",data:g});timeline_data_max_id=g.id;f=true}a++}if(!f){timeline_data_max_id=0;specialBubbleTimelineCheck()}}}
function loop(){specialBubbleClockCheck();world.Step(time_step,iterations);for(i=0;i<bodies.length;i++){var a=bodies[i],f=elements[i];newLeft=a.m_position0.x-(f.width>>1);newTop=a.m_position0.y-(f.height>>1)-10*res[res_current].multiplier;f.style.left=newLeft+"px";f.style.top=newTop+"px";a.m_userData.hover&&a.m_linearVelocity.SetZero();if(newLeft+Math.floor(f.width)<=-100||newLeft>stage[2]+100){world.DestroyBody(a);bodies.splice(i,1);elements.splice(i,1);$(f).remove()}if(Math.abs(a.m_position0.x-
stage[2]/2)<150&&newTop<20){if(Math.abs(a.m_linearVelocity.x)<20){newx=a.m_position0.x-stage[2]/2<0?-50:50;a.m_linearVelocity.Set(newx,a.m_linearVelocity.y)}}else newTop<2&&a.m_linearVelocity.y<0&&a.m_linearVelocity.Set(a.m_linearVelocity.x,40)}}function createBox(a,f,g,k,s,r){if(typeof r=="undefined")r=true;var v=new b2BoxDef;if(!r)v.density=1;v.extents.Set(k,s);k=new b2BodyDef;k.AddShape(v);k.position.Set(f,g);return a.CreateBody(k)}
function createPoly(a,f,g,k,s){var r=new b2PolyDef;if(!s)r.density=1;r.vertexCount=k.length;for(s=0;s<k.length;s++)r.vertices[s].Set(k[s][0],k[s][1]);k=new b2BodyDef;k.AddShape(r);k.position.Set(f,g);return a.CreateBody(k)}function getBrowserDimensions(){stage[0]=window.screenX;stage[1]=window.screenY;stage[2]=window.innerWidth;stage[3]=window.innerHeight;res_new=stage[2]>=1400&&stage[3]>=840?1:0;if(res_new!=res_current&&res_current!=-1)window.location=window.location;res_current=res_new}
function buildBubbleTweet(a){var f="",g="",k="",s="",r="",v="",C="";if(a.user){f=a.user.name;g=a.user.screen_name;k=a.user.profile_image_url;s=a.user.location;r=a.user.url;v=a.user.description}if(a.from_user)g=a.from_user;if(a.profile_image_url)k=a.profile_image_url;if(res_current==1){k=k.replace("normal","bigger");profile_image_size=65}else profile_image_size=48;C=create_urls(a.text);C=filterKeywords(C);created_at=new Date(a.created_at.substring(4));status_id=g!="firefox"?a.id_str:a.id;html='\t\t<header class="">\t\t\t<h1><a href="http://twitter.com/'+
g+'" title="'+g+'" rel="author external">'+g+'</a> wrote</h1>\t\t\t<time datetime="'+created_at+'" pubdate><a href="http://twitter.com/'+g+"/status/"+status_id+'" rel="bookmark external" title="permalink">'+jQuery.timeago(a.created_at.substring(4))+'</a></time>\t\t</header>\t\t<p class="avatar-wrapper"><a href="http://twitter.com/'+g+'" title="'+g+'" rel="author external"><img alt="'+g+' avatar" src="\t\t'+k+'" height="'+profile_image_size+'" width="'+profile_image_size+'" /></a></p>\t\t<p class="text">'+
C+'</p>\t\t<section class="hide">\t\t\t<dl>';html=f?html+"\t\t\t\t  <dt>Name</dt>\t\t\t\t  <dd>"+f+"</dd>":html+"\t\t\t\t  <dt>Profile</dt>\t\t\t\t  <dd>N/A</dd>";if(s)html=html+"\t\t\t\t  <dt>Location</dt>\t\t\t\t  <dd>"+s+"</dd>";if(r)html=html+'\t\t\t\t  <dt>Web</dt>\t\t\t\t  <dd><a href="'+r+'" rel="author external" title="Web">'+friendlyTrim(r.replace("http://",""),12)+"</a></dd>";if(v)html=html+"\t\t\t\t  <dt>Bio</dt>\t\t\t\t  <dd>"+friendlyTrim(v,44)+"</dd>";return html=html+'\t\t    </dl>\t\t</section>\t\t<nav class="hide">\t\t\t<ul>\t\t\t\t<li class="flip"><a href="#section-id-01" title="Flip bubble">Flip</a></li>\t\t\t\t<li class="retweet"><a href="http://button.topsy.com/retweet?nick='+
g+"&title="+a.text+'" title="Retweet" rel="external">Retweet</a></li>\t\t\t\t<li class="follow"><a href="http://twitter.com/'+g+'" title="Follow '+g+'" rel="external">Follow</a></li>\t\t\t</ul>\t\t</nav>\t'}function buildBubbleClock(a){return html="\t\t<h1>Cuckoo!</h1>\t\t<p>"+a+"</p>  "}function buildBubbleFollowers(a){return html='\t\t<a href="http://twitter.com/firefox/followers" title="Firefox followers" rel="external">\t\t\t<h1>@firefox followers</h1>\t\t\t<p>'+a+"</p>\t\t</a>  "}
function buildBubbleDownloads(a){return html='\t\t<a href="http://www.mozilla.com/en-US/firefox/stats/" title="Firefox downloads" rel="external">\t\t\t<h1>Firefox downloads</h1>\t\t\t<p>'+a+"</p>\t\t</a>  "}function buildBubbleError(a){return html="  \t<h1>Malfunction!</h1>  \t<p>"+a+"</p>  "}function buildBubbleSearch(a){return html="  \t<h1>"+a.h1+"</h1>  \t<p>"+a.p+"</p>  "}function throwError(a){pool.splice(pool_index,0,{type:"error",data:a})}
function addCommas(a){a+="";x=a.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";for(a=/(\d+)(\d{3})/;a.test(x1);)x1=x1.replace(a,"$1,$2");return x1+x2}function turnLampOn(){$("#activity-indicator").removeClass("off").addClass("on")}function turnLampOff(){$("#activity-indicator").removeClass("on").addClass("off")}
function create_urls(a){return a.replace(/(ftp|http|https|file):\/\/([\S]+(\b|$))/gim,'<a href="$&" class="my_link" target="_blank">$2</a>').replace(/([^\/])(www[\S]+(\b|$))/gim,'$1<a href="http://$2" class="my_link" target="_blank">$2</a>').replace(/(^|\s)@(\w+)/g,'$1<a href="http://twitter.com/$2" class="my_link" target="_blank">@$2</a>').replace(/(^|\s)#(\S+)/g,'$1<a href="http://search.twitter.com/search?q=%23$2" class="my_link" target="_blank">#$2</a>')}
function filterKeywords(a){if(keywords){for(var f in keywords.highlights)if(keywords.highlights.hasOwnProperty(f)){fKwords=keywords.highlights[f].replace(/,/gi,"|");if(fKwords!=""){var g=RegExp("(\\s|:|^)("+fKwords+")(\\s|:\\s|(\\.\\s)|(\\,\\s)|$)","gi");a=a.replace(g,'$1<span class="mood '+f+'">$2</span>$3')}}fKwords=keywords.excluded.replace(/,/gi,"|");if(fKwords!=""){g=RegExp("(\\s|:|^)("+fKwords+")","gi");a=a.replace(g,"$1#@*%");g=RegExp("("+fKwords+")(\\s|:\\s|(\\.\\s)|(\\,\\s)|$)","gi");a=a.replace(g,
"#@*%$2")}}return a}
function datetimeCountdown(){dateFuture=new Date(ds_datetime);localDate=new Date;utc=localDate.getTime()+localDate.getTimezoneOffset()*6E4;dateNow=new Date(utc+-25200000);amount=dateFuture.getTime()-dateNow.getTime();delete dateNow;if(amount<0)$("#counter dd").text(ds_datetime_reached).attr("title",ds_datetime_reached);else{secs=mins=hours=days=0;out="";amount=Math.floor(amount/1E3);days=Math.floor(amount/86400);amount%=86400;hours=Math.floor(amount/3600);amount%=3600;mins=Math.floor(amount/60);amount%=
60;secs=Math.floor(amount);if(days!=0)out+=days+"d : ";if(days!=0||hours!=0)out+=hours+"h : ";if(days!=0||hours!=0||mins!=0)out+=mins+"m : ";out+=secs+"s";$("#counter dd").text(out).attr("title",out)}};$(document).ready(function(){if(!isAndroid()){gauge_indicator_needle_src=res[res_current].gaugeIndicatorNeedleSrc;gauge_indicator_needle_angle=-90;$(".pointer").attr("id","pointer").text("");R=Raphael("pointer",70*res[res_current].multiplier,30*res[res_current].multiplier);gauge_indicator_needle=R.image(gauge_indicator_needle_src,30*res[res_current].multiplier,-4*res[res_current].multiplier,8*res[res_current].multiplier,56*res[res_current].multiplier);R.safari()}});
function gaugeIndicatorNeedleMove(a){if(!isAndroid()){gauge_indicator_needle.animate({rotation:-90},300,"linear");a-=90;setTimeout(function(){gauge_indicator_needle.animate({rotation:a},2500,"bounce")},300)}}var uagent=navigator.userAgent.toLowerCase();function isAndroid(){return uagent.search("android")>-1?true:false};$(document).ready(function(){modifier_keys_pressed=keyboard_debug=false;$(document).keydown(function(a){if(!$("input#search-input:focus").length&&!modifier_keys_pressed){if(a.keyCode==71){"console"in window&&keyboard_debug&&console.log("pressed G - toggling gravity");$("#gravity-inverter a").trigger("click");return false}else if(a.keyCode==80){"console"in window&&keyboard_debug&&console.log("pressed P - toggling play");$("#flow-transposer a").trigger("click");return false}else if(a.keyCode==83){"console"in
window&&keyboard_debug&&console.log("pressed S - focusing search box");$("input#search-input").focus();return false}else if(a.keyCode==66){"console"in window&&keyboard_debug&&console.log("pressed B - spawning bubble");spawn();return false}else if(a.keyCode==65){"console"in window&&keyboard_debug&&console.log("pressed A - showing about box");$("a.colorbox").trigger("click");return false}else if(a.ctrlKey||a.metaKey||a.altKey||a.shiftKey){"console"in window&&keyboard_debug&&console.log("cmd or ctrl pressed");
modifier_keys_pressed=true}if("console"in window&&keyboard_debug){console.log(a);console.log("mod keys: "+modifier_keys_pressed)}}else if(a.keyCode==27){"console"in window&&keyboard_debug&&console.log("pressed Esc - removing focus (blurring) search box");$("input#search-input").blur();return false}}).keyup(function(){modifier_keys_pressed=false;if("console"in window&&keyboard_debug){console.log("keys released");console.log("mod keys: "+modifier_keys_pressed)}})});$(document).ready(function(){$("#page").css({opacity:0});setTimeout(function(){$.preloadCssImages()},500)});$(window).load(function(){$("#page").animate({opacity:1},500);getDataFromProxy()});function WebTrends(){this.dcsid="dcsvj81q5wz5bd3hm5k1vpmtq_7x7i";this.domain="statse.webtrendslive.com";this.timezone=0;this.fpcdom=".firefoxtweetmachine.com";this.onsitedoms="";this.downloadtypes="xls,doc,pdf,txt,csv,zip, xpi";this.navigationtag="div,table";this.enabled=this.trimoffsiteparams=this.trackevents=true;this.i18n=false;this.fpc="WT_FPC";this.paidsearchparams="gclid";this.DCS={};this.WT={};this.DCSext={};this.images=[];this.index=0;this.exre=window.RegExp?/dcs(uri)|(ref)|(aut)|(met)|(sta)|(sip)|(pro)|(byt)|(dat)|(p3p)|(cfg)|(redirect)|(cip)/i:
"";this.re=window.RegExp?this.i18n?{"%25":/\%/g}:{"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g,"%22":/\"/g,"%7F":/\x7F/g,"%A0":/\xA0/g}:""}
WebTrends.prototype.dcsGetId=function(){if(this.enabled&&document.cookie.indexOf(this.fpc+"=")==-1&&document.cookie.indexOf("WTLOPTOUT=")==-1){script_tag=document.createElement("script");script_tag.type="text/javascript";script_tag.src="http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+this.domain+"/"+this.dcsid+"/wtid.js";document.body.appendChild(script_tag)}};
WebTrends.prototype.dcsGetCookie=function(a){var f=document.cookie.split("; "),g=[],k=0,s=0,r=a.length,v=f.length;for(s=0;s<v;s++){var C=f[s];if(C.substring(0,r+1)==a+"=")g[k++]=C}f=g.length;if(f>0){k=0;if(f>1&&a==this.fpc){a=new Date(0);for(s=0;s<f;s++){v=parseInt(this.dcsGetCrumb(g[s],"lv"));v=new Date(v);if(v>a){a.setTime(v.getTime());k=s}}}return unescape(g[k].substring(r+1))}else return null};
WebTrends.prototype.dcsGetCrumb=function(a,f,g){a=a.split(g||":");for(g=0;g<a.length;g++){var k=a[g].split("=");if(f==k[0])return k[1]}return null};WebTrends.prototype.dcsGetIdCrumb=function(a,f){for(var g=a.substring(0,a.indexOf(":lv=")).split("="),k=0;k<g.length;k++)if(f==g[0])return g[1];return null};WebTrends.prototype.dcsIsFpcSet=function(a,f,g,k){if(a=this.dcsGetCookie(a))return f==this.dcsGetIdCrumb(a,"id")&&g==this.dcsGetCrumb(a,"lv")&&k==this.dcsGetCrumb(a,"ss")?0:3;return 2};
WebTrends.prototype.dcsFPC=function(){if(document.cookie.indexOf("WTLOPTOUT=")==-1){var a=this.WT,f=this.fpc,g=new Date,k=g.getTimezoneOffset()*6E4+this.timezone*36E5;g.setTime(g.getTime()+k);var s=new Date(g.getTime()+31536E7),r=new Date(g.getTime());a.co_f=a.vtid=a.vtvs=a.vt_f=a.vt_f_a=a.vt_f_s=a.vt_f_d=a.vt_f_tlh=a.vt_f_tlv="";if(document.cookie.indexOf(f+"=")==-1){if(typeof gWtId!="undefined"&&gWtId!="")a.co_f=gWtId;else{if(typeof gTempWtId!="undefined"&&gTempWtId!="")a.co_f=gTempWtId;else{a.co_f=
"2";for(var v=g.getTime().toString(),C=2;C<=32-v.length;C++)a.co_f+=Math.floor(Math.random()*16).toString(16);a.co_f+=v}a.vt_f="1"}if(typeof gWtAccountRollup=="undefined")a.vt_f_a="1";a.vt_f_s=a.vt_f_d="1";a.vt_f_tlh=a.vt_f_tlv="0"}else{var F=this.dcsGetCookie(f);v=this.dcsGetIdCrumb(F,"id");C=parseInt(this.dcsGetCrumb(F,"lv"));F=parseInt(this.dcsGetCrumb(F,"ss"));if(v==null||v=="null"||isNaN(C)||isNaN(F))return;a.co_f=v;v=new Date(C);a.vt_f_tlh=Math.floor((v.getTime()-k)/1E3);r.setTime(F);if(g.getTime()>
v.getTime()+18E5||g.getTime()>r.getTime()+288E5){a.vt_f_tlv=Math.floor((r.getTime()-k)/1E3);r.setTime(g.getTime());a.vt_f_s="1"}if(g.getDay()!=v.getDay()||g.getMonth()!=v.getMonth()||g.getYear()!=v.getYear())a.vt_f_d="1"}a.co_f=escape(a.co_f);a.vtid=typeof this.vtid=="undefined"?a.co_f:this.vtid||"";a.vtvs=(r.getTime()-k).toString();k="; expires="+s.toGMTString();g=g.getTime().toString();r=r.getTime().toString();document.cookie=f+"=id="+a.co_f+":lv="+g+":ss="+r+k+"; path=/"+(this.fpcdom!=""?"; domain="+
this.fpcdom:"");f=this.dcsIsFpcSet(f,a.co_f,g,r);if(f!=0){a.co_f=a.vtvs=a.vt_f_s=a.vt_f_d=a.vt_f_tlh=a.vt_f_tlv="";if(typeof this.vtid=="undefined")a.vtid="";a.vt_f=a.vt_f_a=f}}};WebTrends.prototype.dcsIsOnsite=function(a){if(a.length>0){a=a.toLowerCase();if(a==window.location.hostname.toLowerCase())return true;if(typeof this.onsitedoms.test=="function")return this.onsitedoms.test(a);else if(this.onsitedoms.length>0)for(var f=this.dcsSplit(this.onsitedoms),g=f.length,k=0;k<g;k++)if(a==f[k])return true}return false};
WebTrends.prototype.dcsTypeMatch=function(a,f){for(var g=a.toLowerCase().substring(a.lastIndexOf(".")+1,a.length),k=this.dcsSplit(f),s=k.length,r=0;r<s;r++)if(g==k[r])return true;return false};WebTrends.prototype.dcsEvt=function(a,f){for(var g=a.target||a.srcElement;g.tagName&&g.tagName.toLowerCase()!=f.toLowerCase();)g=g.parentElement||g.parentNode;return g};
WebTrends.prototype.dcsNavigation=function(a){var f="",g="",k=this.dcsSplit(this.navigationtag),s=k.length,r,v;for(r=0;r<s;r++){v=k[r];if(v.length){g=this.dcsEvt(a,v);f=g.getAttribute&&g.getAttribute("id")?g.getAttribute("id"):"";g=g.className||"";if(f.length||g.length)break}}return f.length?f:g};
WebTrends.prototype.dcsBind=function(a,f){if(typeof f=="function"&&document.body)if(document.body.addEventListener)document.body.addEventListener(a,f.wtbind(this),true);else document.body.attachEvent&&document.body.attachEvent("on"+a,f.wtbind(this))};WebTrends.prototype.dcsET=function(){var a=navigator.appVersion.indexOf("MSIE")!=-1?"click":"mousedown";this.dcsBind(a,this.dcsDownload);this.dcsBind(a,this.dcsOffsite);this.dcsBind("contextmenu",this.dcsRightClick)};
WebTrends.prototype.dcsMultiTrack=function(){var a=dcsMultiTrack.arguments?dcsMultiTrack.arguments:arguments;if(a.length%2==0){this.dcsSetProps(a);this.DCS.dcsdat=(new Date).getTime();this.dcsFPC();this.dcsTag()}};WebTrends.prototype.dcsCleanUp=function(){this.DCS={};this.WT={};this.DCSext={};arguments.length%2==0&&this.dcsSetProps(arguments)};
WebTrends.prototype.dcsSetProps=function(a){for(var f=0;f<a.length;f+=2)if(a[f].indexOf("WT.")==0)this.WT[a[f].substring(3)]=a[f+1];else if(a[f].indexOf("DCS.")==0)this.DCS[a[f].substring(4)]=a[f+1];else if(a[f].indexOf("DCSext.")==0)this.DCSext[a[f].substring(7)]=a[f+1]};WebTrends.prototype.dcsSplit=function(a){a=a.toLowerCase().split(",");for(var f=a.length,g=0;g<f;g++)a[g]=a[g].replace(/^\s*/,"").replace(/\s*$/,"");return a};
WebTrends.prototype.dcsDownload=function(a){if((a=a||window.event||"")&&(typeof a.which!="number"||a.which==1)){var f=this.dcsEvt(a,"A");if(f.href){var g=f.hostname?f.hostname.split(":")[0]:"";if(this.dcsIsOnsite(g)&&this.dcsTypeMatch(f.pathname,this.downloadtypes)){f.search&&f.search.substring(f.search.indexOf("?")+1,f.search.length);var k=f.pathname?f.pathname.indexOf("/")!=0?"/"+f.pathname:f.pathname:"/",s="",r=document.all?f.innerText:f.text,v=this.dcsEvt(a,"IMG");if(v.alt)s=v.alt;else if(r)s=
r;else if(f.innerHTML)s=f.innerHTML;this.dcsMultiTrack("DCS.dcssip",g,"DCS.dcsuri",k,"DCS.dcsqry",f.search||"","WT.ti","Download:"+s,"WT.dl","20","WT.nv",this.dcsNavigation(a));this.DCS.dcssip=this.DCS.dcsuri=this.DCS.dcsqry=this.WT.ti=this.WT.dl=this.WT.nv=""}}}};
WebTrends.prototype.dcsRightClick=function(a){if(a=a||window.event||"")if((a.which||a.button)!=1||navigator.userAgent.indexOf("Safari")!=-1){a=this.dcsEvt(a,"A");if(typeof a.href!="undefined"&&a.href)if(typeof a.protocol!="undefined"&&a.protocol&&a.protocol.indexOf("http")!=-1)if(typeof a.pathname!="undefined"&&this.dcsTypeMatch(a.pathname,this.downloadtypes)){var f=a.pathname?a.pathname.indexOf("/")!=0?"/"+a.pathname:a.pathname:"/";this.dcsMultiTrack("DCS.dcssip",a.hostname?a.hostname.split(":")[0]:
"","DCS.dcsuri",f,"DCS.dcsqry","","WT.ti","RightClick:"+f,"WT.dl","25");this.DCS.dcssip=this.DCS.dcsuri=this.WT.ti=this.WT.dl=this.WT.nv=""}}};
WebTrends.prototype.dcsOffsite=function(a){if((a=a||window.event||"")&&(typeof a.which!="number"||a.which==1)){var f=this.dcsEvt(a,"A");if(f.href){var g=f.hostname?f.hostname.split(":")[0]:"",k=f.protocol||"";if(g.length>0&&k.indexOf("http")==0&&!this.dcsIsOnsite(g)){k=f.search?f.search.substring(f.search.indexOf("?")+1,f.search.length):"";f=f.pathname?f.pathname.indexOf("/")!=0?"/"+f.pathname:f.pathname:"/";this.dcsMultiTrack("DCS.dcssip",g,"DCS.dcsuri",f,"DCS.dcsqry",this.trimoffsiteparams?"":k,
"DCS.dcsref",window.location,"WT.ti","Offsite:"+g+f+"?"+k,"WT.dl","24","WT.nv",this.dcsNavigation(a));this.DCS.dcssip=this.DCS.dcsuri=this.DCS.dcsqry=this.DCS.dcsref=this.WT.ti=this.WT.dl=this.WT.nv=""}}}};WebTrends.prototype.dcsAdv=function(){if(this.trackevents&&typeof this.dcsET=="function")if(window.addEventListener)window.addEventListener("load",this.dcsET.wtbind(this),false);else window.attachEvent&&window.attachEvent("onload",this.dcsET.wtbind(this));this.dcsFPC()};
WebTrends.prototype.dcsVar=function(){var a=new Date,f=this.WT,g=this.DCS;f.tz=parseInt(a.getTimezoneOffset()/60*-1)||"0";f.bh=a.getHours()||"0";f.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;if(typeof screen=="object"){f.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;f.sr=screen.width+"x"+screen.height}if(typeof navigator.javaEnabled()=="boolean")f.jo=navigator.javaEnabled()?"Yes":"No";if(document.title)if(window.RegExp){var k=RegExp("^"+window.location.protocol+
"//"+window.location.hostname+"\\s-\\s");f.ti=document.title.replace(k,"")}else f.ti=document.title;f.js="Yes";f.jv=function(){var v=navigator.userAgent.toLowerCase(),C=parseInt(navigator.appVersion),F=v.indexOf("mac")!=-1,H=v.indexOf("firefox")!=-1,K=v.indexOf("firefox/0.")!=-1,M=v.indexOf("firefox/1.0")!=-1,Q=v.indexOf("firefox/1.5")!=-1,S=v.indexOf("firefox/2.0")!=-1,W=H&&!K&&!M&!Q&!S,ha=!H&&v.indexOf("mozilla")!=-1&&v.indexOf("compatible")==-1;H=ha&&C==4;ha=ha&&C>=5;var fa=v.indexOf("msie")!=
-1&&v.indexOf("opera")==-1;C=fa&&C==4&&v.indexOf("msie 4")!=-1;fa=fa&&!C;var ia=v.indexOf("opera")!=-1,Aa=v.indexOf("opera 5")!=-1||v.indexOf("opera/5")!=-1;v=v.indexOf("opera 6")!=-1||v.indexOf("opera/6")!=-1;ia=ia&&!Aa&&!v;var ra="1.1";if(W)ra="1.8";else if(S)ra="1.7";else if(Q)ra="1.6";else if(K||M||ha||ia)ra="1.5";else if(F&&fa||v)ra="1.4";else if(fa||H||Aa)ra="1.3";else if(C)ra="1.2";return ra}();f.ct="unknown";if(document.body&&document.body.addBehavior)try{document.body.addBehavior("#default#clientCaps");
f.ct=document.body.connectionType||"unknown";document.body.addBehavior("#default#homePage");f.hp=document.body.isHomePage(location.href)?"1":"0"}catch(s){}f.bs=document.all?document.body?document.body.offsetWidth+"x"+document.body.offsetHeight:"unknown":window.innerWidth+"x"+window.innerHeight;f.fv=function(){var v;if(window.ActiveXObject)for(v=10;v>0;v--)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+v);return v+".0"}catch(C){}else if(navigator.plugins&&navigator.plugins.length)for(v=0;v<
navigator.plugins.length;v++)if(navigator.plugins[v].name.indexOf("Shockwave Flash")!=-1)return navigator.plugins[v].description.split(" ")[2];return"Not enabled"}();f.slv=function(){var v="Not enabled";try{if(navigator.userAgent.indexOf("MSIE")!=-1){if(new ActiveXObject("AgControl.AgControl"))v="Unknown"}else if(navigator.plugins["Silverlight Plug-In"])v="Unknown"}catch(C){}if(v!="Not enabled"){var F,H,K;if(typeof Silverlight=="object"&&typeof Silverlight.isInstalled=="function")for(F=3;F>0;F--){for(H=
9;H>=0;H--){K=F+"."+H;if(Silverlight.isInstalled(K)){v=K;break}}if(v==K)break}}return v}();if(this.i18n)f.le=typeof document.defaultCharset=="string"?document.defaultCharset:typeof document.characterSet=="string"?document.characterSet:"unknown";f.tv="8.6.2";f.dl="0";f.ssl=window.location.protocol.indexOf("https:")==0?"1":"0";g.dcsdat=a.getTime();g.dcssip=window.location.hostname;g.dcsuri=window.location.pathname;f.es=g.dcssip+g.dcsuri;if(window.location.search)g.dcsqry=window.location.search;if(g.dcsqry){a=
g.dcsqry.toLowerCase();k=this.paidsearchparams.length?this.paidsearchparams.toLowerCase().split(","):[];for(var r=0;r<k.length;r++)if(a.indexOf(k[r]+"=")!=-1){f.srch="1";break}}if(window.document.referrer!=""&&window.document.referrer!="-")if(!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4))g.dcsref=window.document.referrer};WebTrends.prototype.dcsEscape=function(a,f){if(f!=""){a=a.toString();for(var g in f)if(f[g]instanceof RegExp)a=a.replace(f[g],g);return a}else return escape(a)};
WebTrends.prototype.dcsA=function(a,f){if(this.i18n&&this.exre!=""&&!this.exre.test(a))if(a=="dcsqry"){for(var g="",k=f.substring(1).split("&"),s=0;s<k.length;s++){var r=k[s],v=r.indexOf("=");if(v!=-1){var C=r.substring(0,v);r=r.substring(v+1);if(s!=0)g+="&";g+=C+"="+this.dcsEncode(r)}}f=f.substring(0,1)+g}else f=this.dcsEncode(f);return"&"+a+"="+this.dcsEscape(f,this.re)};WebTrends.prototype.dcsEncode=function(a){return typeof encodeURIComponent=="function"?encodeURIComponent(a):escape(a)};
WebTrends.prototype.dcsCreateImage=function(a){if(document.images){this.images[this.index]=new Image;this.images[this.index].src=a;this.index++}else document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+a+'">')};
WebTrends.prototype.dcsMeta=function(){var a;if(document.all)a=document.all.tags("meta");else if(document.documentElement)a=document.getElementsByTagName("meta");if(typeof a!="undefined")for(var f=a.length,g=0;g<f;g++){var k=a.item(g).name,s=a.item(g).content;a.item(g);if(k.length>0)if(k.toUpperCase().indexOf("WT.")==0)this.WT[k.substring(3)]=s;else if(k.toUpperCase().indexOf("DCSEXT.")==0)this.DCSext[k.substring(7)]=s;else if(k.toUpperCase().indexOf("DCS.")==0)this.DCS[k.substring(4)]=s}};
WebTrends.prototype.dcsTag=function(){if(document.cookie.indexOf("WTLOPTOUT=")==-1){var a=this.WT,f=this.DCS,g=this.DCSext,k=this.i18n,s="http"+(window.location.protocol.indexOf("https:")==0?"s":"")+"://"+this.domain+(this.dcsid==""?"":"/"+this.dcsid)+"/dcs.gif?";if(k)a.dep="";for(var r in f)if(f[r]&&typeof f[r]!="function")s+=this.dcsA(r,f[r]);f=["co_f","vtid","vtvs","vt_f_tlv"];for(var v=0;v<f.length;v++){var C=f[v];if(a[C]){s+=this.dcsA("WT."+C,a[C]);delete a[C]}}for(r in a)if(a[r]&&typeof a[r]!=
"function")s+=this.dcsA("WT."+r,a[r]);for(r in g)if(g[r]&&typeof g[r]!="function"){if(k)a.dep=a.dep.length==0?r:a.dep+";"+r;s+=this.dcsA(r,g[r])}if(k&&a.dep.length>0)s+=this.dcsA("WT.dep",a.dep);if(s.length>2048&&navigator.userAgent.indexOf("MSIE")>=0)s=s.substring(0,2040)+"&WT.tu=1";this.dcsCreateImage(s);this.WT.ad=""}};
WebTrends.prototype.dcsDebug=function(){var a=this.images[0].src,f=a.indexOf("?"),g=a.substring(0,f).split("/"),k="<b>Protocol</b><br><code>"+g[0]+"<br></code>";k+="<b>Domain</b><br><code>"+g[2]+"<br></code>";k+="<b>Path</b><br><code>/"+g[3]+"/"+g[4]+"<br></code>";k+="<b>Query Params</b><code>"+a.substring(f+1).replace(/\&/g,"<br>")+"</code>";k+="<br><b>Cookies</b><br><code>"+document.cookie.replace(/\;/g,"<br>")+"</code>";this.w&&!this.w.closed&&this.w.close();this.w=window.open("","dcsDebug","width=500,height=650,scrollbars=yes,resizable=yes");
this.w.document.write(k);this.w.focus()};WebTrends.prototype.dcsCollect=function(){if(this.enabled){this.dcsVar();this.dcsMeta();this.dcsAdv();this.dcsTag()}};function dcsMultiTrack(){if(typeof _tag!="undefined")return _tag.dcsMultiTrack()}function dcsDebug(){if(typeof _tag!="undefined")return _tag.dcsDebug()}Function.prototype.wtbind=function(a){var f=this;return function(){return f.apply(a,arguments)}};

