(function(a,b){function B(a,c,d){if(d===b&&a.nodeType===1){d=a.getAttribute("data-"+c);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:D.isNaN(d)?G.test(d)?D.parseJSON(d):d:parseFloat(d)}catch(e){}D.data(a,c,d)}else d=b}return d}function A(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function z(){return!1}function y(){return!0}function x(a,c,d){var e=D.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,D.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function w(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o=[],p=[],q=D._data(this,"events");if(a.liveFired!==this&&q&&q.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(m=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var r=q.live.slice(0);for(h=0;h<r.length;h++)f=r[h],f.origType.replace(P,"")===a.type?p.push(f.selector):r.splice(h--,1);e=D(a.target).closest(p,a.currentTarget);for(i=0,j=e.length;i<j;i++){l=e[i];for(h=0;h<r.length;h++){f=r[h];if(l.selector===f.selector&&(!m||m.test(f.namespace))&&!l.elem.disabled){g=l.elem,d=null;if(f.preType==="mouseenter"||f.preType==="mouseleave")a.type=f.preType,d=D(a.relatedTarget).closest(f.selector)[0];(!d||d!==g)&&o.push({elem:g,handleObj:f,level:l.level})}}}for(i=0,j=o.length;i<j;i++){e=o[i];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,n=e.handleObj.origHandler.apply(e.elem,arguments);if(n===!1||a.isPropagationStopped()){c=e.level,n===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function v(a,b){return(a&&a!=="*"?a+".":"")+b.replace(R,"`").replace(S,"&")}function u(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function t(a,b,c){if(D.isFunction(b))return D.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return D.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=D.grep(a,function(a){return a.nodeType===1});if(bc.test(b))return D.filter(b,d,!c);b=D.filter(b,d)}return D.grep(a,function(a,d){return D.inArray(a,b)>=0===c})}function s(a,b){return D.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function r(a,b){if(b.nodeType===1&&D.hasData(a)){var c=D.expando,d=D.data(a),e=D.data(b,d);if(d=d[c]){var f=d.events;e=e[c]=D.extend({},d);if(f){delete e.handle,e.events={};for(var g in f)for(var h=0,i=f[g].length;h<i;h++)D.event.add(b,g+(f[g][h].namespace?".":"")+f[g][h].namespace,f[g][h],f[g][h].data)}}}}function q(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(D.expando)}}function p(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function o(a,b){b.src?D.ajax({url:b.src,async:!1,dataType:"script"}):D.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function n(a,b,c){var d=b==="width"?bw:bx,e=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return e;D.each(d,function(){c||(e-=parseFloat(D.css(a,"padding"+this))||0),c==="margin"?e+=parseFloat(D.css(a,"margin"+this))||0:e-=parseFloat(D.css(a,"border"+this+"Width"))||0});return e}function m(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(D.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,f=d.length,g,h,i;for(;e<f;e++)g=d[e],i=/^\+/.test(g),i&&(g=g.substr(1)||"*"),h=a[g]=a[g]||[],h[i?"unshift":"push"](c)}}}function l(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bU,m;for(;i<j&&(k||!m);i++)m=h[i](c,d,e),typeof m=="string"&&(!k||g[m]?m=b:(c.dataTypes.unshift(m),m=l(a,c,d,e,m,g)));(k||!m)&&!g["*"]&&(m=l(a,c,d,e,"*",g));return m}function k(a,b,c,d){if(D.isArray(b)&&b.length)D.each(b,function(b,e){c||bD.test(a)?d(a,e):k(a+"["+(typeof e=="object"||D.isArray(e)?b:"")+"]",e,c,d)});else if(c||b==null||typeof b!="object")d(a,b);else if(D.isArray(b)||D.isEmptyObject(b))d(a,"");else for(var e in b)k(a+"["+e+"]",b[e],c,d)}function j(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function i(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},f,g,h=d.length,i,j=d[0],k,l,m,n,o;for(f=1;f<h;f++){if(f===1)for(g in a.converters)typeof g=="string"&&(e[g.toLowerCase()]=a.converters[g]);k=j,j=d[f];if(j==="*")j=k;else if(k!=="*"&&k!==j){l=k+" "+j,m=e[l]||e["* "+j];if(!m){o=b;for(n in e){i=n.split(" ");if(i[0]===k||i[0]==="*"){o=e[i[1]+" "+j];if(o){n=e[n],n===!0?m=o:o===!0&&(m=n);break}}}}!m&&!o&&D.error("No conversion from "+l.replace(" "," to ")),m!==!0&&(c=m?m(c):o(n(c)))}}return c}function h(){D(a).unload(function(){for(var a in ca)ca[a](0,1)})}function g(){try{return new a.XMLHttpRequest}catch(b){}}function f(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function e(a,b){var c={};D.each(cg.concat.apply([],cg.slice(0,b)),function(){c[this]=a});return c}function d(a){if(!cc[a]){var b=D("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";cc[a]=c}return cc[a]}function c(a){return D.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var C=a.document,D=function(){function c(){if(!d.isReady){try{C.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,D=Array.prototype.slice,E=String.prototype.trim,F=Array.prototype.indexOf,G={};d.fn=d.prototype={constructor:d,init:function(a,c,e){var f,g,i,j;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!c&&C.body){this.context=C,this[0]=C.body,this.selector="body",this.length=1;return this}if(typeof a=="string"){f=h.exec(a);if(!f||!f[1]&&c)return!c||c.jquery?(c||e).find(a):this.constructor(c).find(a);if(f[1]){c=c instanceof d?c[0]:c,j=c?c.ownerDocument||c:C,i=m.exec(a),i?d.isPlainObject(c)?(a=[C.createElement(i[1])],d.fn.attr.call(a,c,!0)):a=[j.createElement(i[1])]:(i=d.buildFragment([f[1]],[j]),a=(i.cacheable?d.clone(i.fragment):i.fragment).childNodes);return d.merge(this,a)}g=C.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return e.find(a);this.length=1,this[0]=g}this.context=C,this.selector=a;return this}if(d.isFunction(a))return e.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return D.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(D.apply(this,arguments),"slice",D.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!C.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;x.resolveWith(C,[d]),d.fn.trigger&&d(C).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(C.readyState==="complete")return setTimeout(d.ready,1);if(C.addEventListener)C.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(C.attachEvent){C.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}C.documentElement.doScroll&&b&&c()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):G[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=C.head||C.getElementsByTagName("head")[0]||C.documentElement,c=C.createElement("script");d.support.scriptEval()?c.appendChild(C.createTextNode(a)):c.text=a,b.insertBefore(c,b.firstChild),b.removeChild(c)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]);return a},trim:E?function(a){return a==null?"":E.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?B.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c=="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function c(c,e){e&&e instanceof d&&!(e instanceof a)&&(e=a(e));return d.fn.init.call(this,c,e,b)},a.fn.init.prototype=a.fn;var b=a(C);return a},browser:{}}),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){G["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),F&&(d.inArray=function(a,b){return F.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(C),C.addEventListener?y=function(){C.removeEventListener("DOMContentLoaded",y,!1),d.ready()}:C.attachEvent&&(y=function(){C.readyState==="complete"&&(C.detachEvent("onreadystatechange",y),d.ready())});return d}(),E="then done fail isResolved isRejected promise".split(" "),F=[].slice;D.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,f,g,h,i,j;b&&(j=b,b=0);for(f=0,g=c.length;f<g;f++)h=c[f],i=D.type(h),i==="array"?e.done.apply(e,h):i==="function"&&a.push(h);j&&e.resolveWith(j[0],j[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(e,f)}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return c||b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=D._Deferred(),c=D._Deferred(),d;D.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(d)return d;d=a={}}var c=E.length;while(c--)a[E[c]]=b[E[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function b(a){return function(b){c[a]=arguments.length>1?F.call(arguments,0):b,--f||g.resolveWith(g,F.call(c,0))}}var c=arguments,d=0,e=c.length,f=e,g=e<=1&&a&&D.isFunction(a.promise)?a:D.Deferred();if(e>1){for(;d<e;d++)c[d]&&D.isFunction(c[d].promise)?c[d].promise().then(b(d),g.reject):--f;f||g.resolveWith(g,c)}else g!==a&&g.resolveWith(g,e?[a]:[]);return g.promise()}}),function(){D.support={};var b=C.createElement("div");b.style.display="none",b.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var c=b.getElementsByTagName("*"),d=b.getElementsByTagName("a")[0],e=C.createElement("select"),f=e.appendChild(C.createElement("option")),g=b.getElementsByTagName("input")[0];if(c&&c.length&&d){D.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.55$/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:g.value==="on",optSelected:f.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0,reliableMarginRight:!0},g.checked=!0,D.support.noCloneChecked=g.cloneNode(!0).checked,e.disabled=!0,D.support.optDisabled=!f.disabled;var h=null;D.support.scriptEval=function(){if(h===null){var b=C.documentElement,c=C.createElement("script"),d="script"+D.now();try{c.appendChild(C.createTextNode("window."+d+"=1;"))}catch(e){}b.insertBefore(c,b.firstChild),a[d]?(h=!0,delete a[d]):h=!1,b.removeChild(c)}return h};try{delete b.test}catch(i){D.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function a(){D.support.noCloneEvent=!1,b.detachEvent("onclick",a)}),b.cloneNode(!0).fireEvent("onclick")),b=C.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var j=C.createDocumentFragment();j.appendChild(b.firstChild),D.support.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,D(function(){var a=C.createElement("div"),b=C.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),D.boxModel=D.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,D.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",D.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var c=a.getElementsByTagName("td");D.support.reliableHiddenOffsets=c[0].offsetHeight===0,c[0].style.display="",c[1].style.display="none",D.support.reliableHiddenOffsets=D.support.reliableHiddenOffsets&&c[0].offsetHeight===0,a.innerHTML="",C.defaultView&&C.defaultView.getComputedStyle&&(a.style.width="1px",a.style.marginRight="0",D.support.reliableMarginRight=(parseInt(C.defaultView.getComputedStyle(a,null).marginRight,10)||0)===0),b.removeChild(a).style.display="none",a=c=null}});var k=function(a){var b=C.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var c=a in b;c||(b.setAttribute(a,"return;"),c=typeof b[a]=="function");return c};D.support.submitBubbles=k("submit"),D.support.changeBubbles=k("change"),b=c=d=null}}();var G=/^(?:\{.*\}|\[.*\])$/;D.extend({cache:{},uuid:0,expando:"jQuery"+(D.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?D.cache[a[D.expando]]:a[D.expando];return!!a&&!A(a)},data:function(a,c,d,e){if(D.acceptData(a)){var f=D.expando,g=typeof c=="string",h,i=a.nodeType,j=i?D.cache:a,k=i?a[D.expando]:a[D.expando]&&D.expando;if((!k||e&&k&&!j[k][f])&&g&&d===b)return;k||(i?a[D.expando]=k=++D.uuid:k=D.expando),j[k]||(j[k]={},i||(j[k].toJSON=D.noop));if(typeof c=="object"||typeof c=="function")e?j[k][f]=D.extend(j[k][f],c):j[k]=D.extend(j[k],c);h=j[k],e&&(h[f]||(h[f]={}),h=h[f]),d!==b&&(h[c]=d);if(c==="events"&&!h[c])return h[f]&&h[f].events;return g?h[c]:h}},removeData:function(b,c,d){if(D.acceptData(b)){var e=D.expando,f=b.nodeType,g=f?D.cache:b,h=f?b[D.expando]:D.expando;if(!g[h])return;if(c){var i=d?g[h][e]:g[h];if(i){delete i[c];if(!A(i))return}}if(d){delete g[h][e];if(!A(g[h]))return}var j=g[h][e];D.support.deleteExpando||g!=a?delete g[h]:g[h]=null,j?(g[h]={},f||(g[h].toJSON=D.noop),g[h][e]=j):f&&(D.support.deleteExpando?delete b[D.expando]:b.removeAttribute?b.removeAttribute(D.expando):b[D.expando]=null)}},_data:function(a,b,c){return D.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=D.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),D.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=D.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,f;for(var g=0,h=e.length;g<h;g++)f=e[g].name,f.indexOf("data-")===0&&(f=f.substr(5),B(this[0],f,d[f]))}}return d}if(typeof a=="object")return this.each(function(){D.data(this,a)});var i=a.split(".");i[1]=i[1]?"."+i[1]:"";if(c===b){d=this.triggerHandler("getData"+i[1]+"!",[i[0]]),d===b&&this.length&&(d=D.data(this[0],a),d=B(this[0],a,d));return d===b&&i[1]?this.data(i[0]):d}return this.each(function(){var b=D(this),d=[i[0],c];b.triggerHandler("setData"+i[1]+"!",d),D.data(this,a,c),b.triggerHandler("changeData"+i[1]+"!",d)})},removeData:function(a){return this.each(function(){D.removeData(this,a)})}}),D.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var d=D._data(a,b);if(!c)return d||[];!d||D.isArray(c)?d=D._data(a,b,D.makeArray(c)):d.push(c);return d}},dequeue:function(a,b){b=b||"fx";var c=D.queue(a,b),d=c.shift();d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){D.dequeue(a,b)})),c.length||D.removeData(a,b+"queue",!0)}}),D.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return D.queue(this[0],a);return this.each(function(b){var d=D.queue(this,a,c);a==="fx"&&d[0]!=="inprogress"&&D.dequeue(this,a)})},dequeue:function(a){return this.each(function(){D.dequeue(this,a)})},delay:function(a,b){a=D.fx?D.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){D.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var H=/[\n\t\r]/g,I=/\s+/,J=/\r/g,K=/^(?:href|src|style)$/,L=/^(?:button|input)$/i,M=/^(?:button|input|object|select|textarea)$/i,N=/^a(?:rea)?$/i,O=/^(?:radio|checkbox)$/i;D.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},D.fn.extend({attr:function(a,b){return D.access(this,a,b,!0,D.attr)},removeAttr:function(a,b){return this.each(function(){D.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(D.isFunction(a))return this.each(function(b){var c=D(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"){var b=(a||"").split(I);for(var c=0,d=this.length;c<d;c++){var e=this[c];if(e.nodeType===1)if(e.className){var f=" "+e.className+" ",g=e.className;for(var h=0,i=b.length;h<i;h++)f.indexOf(" "+b[h]+" ")<0&&(g+=" "+b[h]);e.className=D.trim(g)}else e.className=a}}return this},removeClass:function(a){if(D.isFunction(a))return this.each(function(b){var c=D(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b){var c=(a||"").split(I);for(var d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){var g=(" "+f.className+" ").replace(H," ");for(var h=0,i=c.length;h<i;h++)g=g.replace(" "+c[h]+" "," ");f.className=D.trim(g)}else f.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(D.isFunction(a))return this.each(function(c){var d=D(this);d.toggleClass(a.call(this,c,d.attr("class"),b),b)});return this.each(function(){if(c==="string"){var e,f=0,g=D(this),h=b,i=a.split(I);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&D._data(this,"__className__",this.className),this.className=this.className||a===!1?"":D._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(H," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(D.nodeName(c,"option")){var d=c.attributes.value;return!d||d.specified?c.value:c.text}if(D.nodeName(c,"select")){var e=c.selectedIndex,f=[],g=c.options,h=c.type==="select-one";if(e<0)return null;for(var i=h?e:0,j=h?e+1:g.length;i<j;i++){var k=g[i];if(k.selected&&(D.support.optDisabled?!k.disabled:k.getAttribute("disabled")===null)&&(!k.parentNode.disabled||!D.nodeName(k.parentNode,"optgroup"))){a=D(k).val();if(h)return a;f.push(a)}}if(h&&!f.length&&g.length)return D(g[e]).val();return f}if(O.test(c.type)&&!D.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(J,"")}return b}var l=D.isFunction(a);return this.each(function(b){var c=D(this),d=a;if(this.nodeType===1){l&&(d=a.call(this,b,c.val())),d==null?d="":typeof d=="number"?d+="":D.isArray(d)&&(d=D.map(d,function(a){return a==null?"":a+""}));if(D.isArray(d)&&O.test(this.type))this.checked=D.inArray(c.val(),d)>=0;else if(D.nodeName(this,"select")){var e=D.makeArray(d);D("option",this).each(function(){this.selected=D.inArray(D(this).val(),e)>=0}),e.length||(this.selectedIndex=-1)}else this.value=d}})}}),D.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(e&&c in D.attrFn)return D(a)[c](d);var f=a.nodeType!==1||!D.isXMLDoc(a),g=d!==b;c=f&&D.props[c]||c;if(a.nodeType===1){var h=K.test(c);if(c==="selected"&&!D.support.optSelected){var i=a.parentNode;i&&(i.selectedIndex,i.parentNode&&i.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&f&&!h){g&&(c==="type"&&L.test(a.nodeName)&&a.parentNode&&D.error("type property can't be changed"),d===null?a.nodeType===1&&a.removeAttribute(c):a[c]=d);if(D.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var j=a.getAttributeNode("tabIndex");return j&&j.specified?j.value:M.test(a.nodeName)||N.test(a.nodeName)&&a.href?0:b}return a[c]}if(!D.support.style&&f&&c==="style"){g&&(a.style.cssText=""+d);return a.style.cssText}g&&a.setAttribute(c,""+d);if(!a.attributes[c]&&a.hasAttribute&&!a.hasAttribute(c))return b;var k=!D.support.hrefNormalized&&f&&h?a.getAttribute(c,2):a.getAttribute(c);return k===null?b:k}g&&(a[c]=d);return a[c]}});var P=/\.(.*)$/,Q=/^(?:textarea|input|select)$/i,R=/\./g,S=/ /g,T=/[^\w\s.|`]/g,U=function(a){return a.replace(T,"\\$&")};D.event={add:function(c,d,e,f){if(c.nodeType!==3&&c.nodeType!==8){try{D.isWindow(c)&&c!==a&&!c.frameElement&&(c=a)}catch(g){}if(e===!1)e=z;else if(!e)return;var h,i;e.handler&&(h=e,e=h.handler),e.guid||(e.guid=D.guid++);var j=D._data(c);if(!j)return;var k=j.events,l=j.handle;k||(j.events=k={}),l||(j.handle=l=function(a){return typeof D!="undefined"&&D.event.triggered!==a.type?D.event.handle.apply(l.elem,arguments):b}),l.elem=c,d=d.split(" ");var m,n=0,o;while(m=d[n++]){i=h?D.extend({},h):{handler:e,data:f},m.indexOf(".")>-1?(o=m.split("."),m=o.shift(),i.namespace=o.slice(0).sort().join(".")):(o=[],i.namespace=""),i.type=m,i.guid||(i.guid=e.guid);var p=k[m],q=D.event.special[m]||{};if(!p){p=k[m]=[];if(!q.setup||q.setup.call(c,f,o,l)===!1)c.addEventListener?c.addEventListener(m,l,!1):c.attachEvent&&c.attachEvent("on"+m,l)}q.add&&(q.add.call(c,i),i.handler.guid||(i.handler.guid=e.guid)),p.push(i),D.event.global[m]=!0}c=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=z);var f,g,h,i,j=0,k,l,m,n,o,p,q,r=D.hasData(a)&&D._data(a),s=r&&r.events;if(!r||!s)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(g in s)D.event.remove(a,g+c);return}c=c.split(" ");while(g=c[j++]){q=g,p=null,k=g.indexOf(".")<0,l=[],k||(l=g.split("."),g=l.shift(),m=new RegExp("(^|\\.)"+D.map(l.slice(0).sort(),U).join("\\.(?:.*\\.)?")+"(\\.|$)")),o=s[g];if(!o)continue;if(!d){for(i=0;i<o.length;i++){p=o[i];if(k||m.test(p.namespace))D.event.remove(a,q,p.handler,i),o.splice(i--,1)}continue}n=D.event.special[g]||{};for(i=e||0;i<o.length;i++){p=o[i];if(d.guid===p.guid){if(k||m.test(p.namespace))e==null&&o.splice(i--,1),n.remove&&n.remove.call(a,p);if(e!=null)break}}if(o.length===0||e!=null&&o.length===1)(!n.teardown||n.teardown.call(a,l)===!1)&&D.removeEvent(a,g,r.handle),f=null,delete s[g]}if(D.isEmptyObject(s)){var t=r.handle;t&&(t.elem=null),delete r.events,delete r.handle,D.isEmptyObject(r)&&D.removeData(a,b,!0)}}},trigger:function(a,c,d){var e=a.type||a,f=arguments[3];if(!f){a=typeof a=="object"?a[D.expando]?a:D.extend(D.Event(e),a):D.Event(e),e.indexOf("!")>=0&&(a.type=e=e.slice(0,-1),a.exclusive=!0),d||(a.stopPropagation(),D.event.global[e]&&D.each(D.cache,function(){var b=D.expando,d=this[b];d&&d.events&&d.events[e]&&D.event.trigger(a,c,d.handle.elem)}));if(!d||d.nodeType===3||d.nodeType===8)return b;a.result=b,a.target=d,c=D.makeArray(c),c.unshift(a)}a.currentTarget=d;var g=D._data(d,"handle");g&&g.apply(d,c);var h=d.parentNode||d.ownerDocument;try{d&&d.nodeName&&D.noData[d.nodeName.toLowerCase()]||d["on"+e]&&d["on"+e].apply(d,c)===!1&&(a.result=!1,a.preventDefault())}catch(i){}if(!a.isPropagationStopped()&&h)D.event.trigger(a,c,h,!0);else if(!a.isDefaultPrevented()){var j,k=a.target,l=e.replace(P,""),m=D.nodeName(k,"a")&&l==="click",n=D.event.special[l]||{};if((!n._default||n._default.call(d,a)===!1)&&!m&&!(k&&k.nodeName&&D.noData[k.nodeName.toLowerCase()])){try{k[l]&&(j=k["on"+l],j&&(k["on"+l]=null),D.event.triggered=a.type,k[l]())}catch(o){}j&&(k["on"+l]=j),D.event.triggered=b}}},handle:function(c){var d,e,f,g,h,i=[],j=D.makeArray(arguments);c=j[0]=D.event.fix(c||a.event),c.currentTarget=this,d=c.type.indexOf(".")<0&&!c.exclusive,d||(f=c.type.split("."),c.type=f.shift(),i=f.slice(0).sort(),g=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||i.join("."),h=D._data(this,"events"),e=(h||{})[c.type];if(h&&e){e=e.slice(0);for(var k=0,l=e.length;k<l;k++){var m=e[k];if(d||g.test(m.namespace)){c.handler=m.handler,c.data=m.data,c.handleObj=m;var n=m.handler.apply(this,j);n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[D.expando])return a;var c=a;a=D.Event(c);for(var d=this.props.length,e;d;)e=this.props[--d],a[e]=c[e];a.target||(a.target=a.srcElement||C),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var f=C.documentElement,g=C.body;a.pageX=a.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=a.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:D.proxy,special:{ready:{setup:D.bindReady,teardown:D.noop},live:{add:function(a){D.event.add(this,v(a.origType,a.selector),D.extend({},a,{handler:w,guid:a.handler.guid}))},remove:function(a){D.event.remove(this,v(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){D.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},D.removeEvent=C.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},D.Event=function(a){if(!this.preventDefault)return new D.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?y:z):this.type=a,this.timeStamp=D.now(),this[D.expando]=!0},D.Event.prototype={preventDefault:function(){this.isDefaultPrevented=y;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=y;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=y,this.stopPropagation()},isDefaultPrevented:z,isPropagationStopped:z,isImmediatePropagationStopped:z};var V=function(a){var b=a.relatedTarget;try{if(b&&b!==C&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,D.event.handle.apply(this,arguments))}catch(c){}},W=function(a){a.type=a.data,D.event.handle.apply(this,arguments)};D.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){D.event.special[a]={setup:function(c){D.event.add(this,b,c&&c.selector?W:V,a)},teardown:function(a){D.event.remove(this,b,a&&a.selector?W:V)}}}),D.support.submitBubbles||(D.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")D.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&D(b).closest("form").length&&x("submit",this,arguments)}),D.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&D(b).closest("form").length&&a.keyCode===13&&x("submit",this,arguments)});else return!1},teardown:function(a){D.event.remove(this,".specialSubmit")}});if(!D.support.changeBubbles){var X,Y=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?D.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},Z=function(c){var d=c.target,e,f;if(Q.test(d.nodeName)&&!d.readOnly){e=D._data(d,"_change_data"),f=Y(d),(c.type!=="focusout"||d.type!=="radio")&&D._data(d,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)c.type="change",c.liveFired=b,D.event.trigger(c,arguments[1],d)}};D.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&Z.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&Z.call(this,a)},beforeactivate:function(a){var b=a.target;D._data(b,"_change_data",Y(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in X)D.event.add(this,c+".specialChange",X[c]);return Q.test(this.nodeName)},teardown:function(a){D.event.remove(this,".specialChange");return Q.test(this.nodeName)}},X=D.event.special.change.filters,X.focus=X.beforeactivate}C.addEventListener&&D.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){var c=D.event.fix(a);c.type=b,c.originalEvent={},D.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;D.event.special[b]={setup:function(){d++===0&&C.addEventListener(a,c,!0)},teardown:function(){--d===0&&C.removeEventListener(a,c,!0)}}}),D.each(["bind","one"],function(a,c){D.fn[c]=function(a,d,e){if(typeof a=="object"){for(var f in a)this[c](f,d,a[f],e);return this}if(D.isFunction(d)||d===!1)e=d,d=b;var g=c==="one"?D.proxy(e,function(a){D(this).unbind(a,g);return e.apply(this,arguments)}):e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var h=0,i=this.length;h<i;h++)D.event.add(this[h],a,g,d);return this}}),D.fn.extend({unbind:function(a,b){if(typeof a!="object"||a.preventDefault)for(var c=0,d=this.length;c<d;c++)D.event.remove(this[c],a,b);else for(var e in a)this.unbind(e,a[e]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){D.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=D.Event(a);c.preventDefault(),c.stopPropagation(),D.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)D.proxy(a,b[c++]);return this.click(D.proxy(a,function(d){var e=(D._data(this,"lastToggle"+a.guid)||0)%c;D._data(this,"lastToggle"+a.guid,e+1),d.preventDefault();return b[e].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var $={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};D.each(["live","die"],function(a,c){D.fn[c]=function(a,d,e,f){var g,h=0,i,j,k,l=f||this.selector,m=f?this:D(this.context);if(typeof a=="object"&&!a.preventDefault){for(var n in a)m[c](n,d,a[n],l);return this}D.isFunction(d)&&(e=d,d=b),a=(a||"").split(" ");while((g=a[h++])!=null){i=P.exec(g),j="",i&&(j=i[0],g=g.replace(P,""));if(g==="hover"){a.push("mouseenter"+j,"mouseleave"+j);continue}k=g,g==="focus"||g==="blur"?(a.push($[g]+j),g=g+j):g=($[g]||g)+j;if(c==="live")for(var o=0,p=m.length;o<p;o++)D.event.add(m[o],"live."+v(g,l),{data:d,selector:l,handler:e,origType:g,origHandler:e,preType:k});else m.unbind("live."+v(g,l),e)}return this}}),D.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){D.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},D.attrFn&&(D.attrFn[b]=!0)}),function(){function c(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}function a(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(a,b,c,e){c=c||[],b=b||C;var g=b;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!="string")return c;var h,i,j,n,o,q,r,s,u=!0,v=k.isXML(b),w=[],x=a;do{d.exec(""),h=d.exec(x);if(h){x=h[3],w.push(h[1]);if(h[2]){n=h[3];break}}}while(h);if(w.length>1&&m.exec(a))if(w.length===2&&l.relative[w[0]])i=t(w[0]+w[1],b);else{i=l.relative[w[0]]?[b]:k(w.shift(),b);while(w.length)a=w.shift(),l.relative[a]&&(a+=w.shift()),i=t(a,i)}else{!e&&w.length>1&&b.nodeType===9&&!v&&l.match.ID.test(w[0])&&!l.match.ID.test(w[w.length-1])&&(o=k.find(w.shift(),b,v),b=o.expr?k.filter(o.expr,o.set)[0]:o.set[0]);if(b){o=e?{expr:w.pop(),set:p(e)}:k.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&b.parentNode?b.parentNode:b,v),i=o.expr?k.filter(o.expr,o.set):o.set,w.length>0?j=p(i):u=!1;while(w.length)q=w.pop(),r=q,l.relative[q]?r=w.pop():q="",r==null&&(r=b),l.relative[q](j,r,v)}else j=w=[]}j||(j=i),j||k.error(q||a);if(f.call(j)==="[object Array]")if(u)if(b&&b.nodeType===1)for(s=0;j[s]!=null;s++)j[s]&&(j[s]===!0||j[s].nodeType===1&&k.contains(b,j[s]))&&c.push(i[s]);else for(s=0;j[s]!=null;s++)j[s]&&j[s].nodeType===1&&c.push(i[s]);else c.push.apply(c,j);else p(j,c);n&&(k(n,g,c,e),k.uniqueSort(c));return c};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(b,d,f){var g,h=e++,i=a;typeof d=="string"&&!j.test(d)&&(d=d.toLowerCase(),g=d,i=c),i("parentNode",d,h,b,g,f)},"~":function(b,d,f){var g,h=e++,i=a;typeof d=="string"&&!j.test(d)&&(d=d.toLowerCase(),g=d,i=c),i("previousSibling",d,h,b,g,f)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,b,c,e,f){if(a[1]==="not")if((d.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=k(a[3],null,null,b);else{var g=k.filter(a[3],b,c,!0^f);c||e.push.apply(e,g);return!1}else if(l.match.POS.test(a[0])||l.match.CHILD.test(a[0]))return!0;return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"text"===c&&(b===c||b===null)},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(C.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;C.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=C.createElement("div"),c="script"+(new Date).getTime(),d=C.documentElement;a.innerHTML="<a name='"+c+"'/>",d.insertBefore(a,d.firstChild),C.getElementById(c)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),d.removeChild(a),d=a=null}(),function(){var a=C.createElement("div");a.appendChild(C.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),C.querySelectorAll&&function(){var a=k,b=C.createElement("div"),c="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,d,e,f){d=d||C;if(!f&&!k.isXML(d)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(g&&(d.nodeType===1||d.nodeType===9)){if(g[1])return p(d.getElementsByTagName(b),e);if(g[2]&&l.find.CLASS&&d.getElementsByClassName)return p(d.getElementsByClassName(g[2]),e)}if(d.nodeType===9){if(b==="body"&&d.body)return p([d.body],e);if(g&&g[3]){var h=d.getElementById(g[3]);if(!h||!h.parentNode)return p([],e);if(h.id===g[3])return p([h],e)}try{return p(d.querySelectorAll(b),e)}catch(i){}}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d,m=d.getAttribute("id"),n=m||c,o=d.parentNode,q=/^\s*[+~]/.test(b);m?n=n.replace(/'/g,"\\$&"):d.setAttribute("id",n),q&&o&&(d=d.parentNode);try{if(!q||o)return p(d.querySelectorAll("[id='"+n+"'] "+b),e)}catch(r){}finally{m||j.removeAttribute("id")}}}return a(b,d,e,f)};for(var d in a)k[d]=a[d];b=null}}(),function(){var a=C.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(C.createElement("div"),"div"),d=!1;try{b.call(C.documentElement,"[test!='']:sizzle")}catch(e){d=!0}k.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(e)&&!/!=/.test(e)){var f=b.call(a,e);if(f||!c||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(e,null,null,[a]).length>0}}}(),function(){var a=C.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),C.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:C.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var t=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};D.find=k,D.expr=k.selectors,D.expr[":"]=D.expr.filters,D.unique=k.uniqueSort,D.text=k.getText,D.isXMLDoc=k.isXML,D.contains=k.contains}();var _=/Until$/,ba=/^(?:parents|prevUntil|prevAll)/,bb=/,/,bc=/^.[^:#\[\.,]*$/,bd=Array.prototype.slice,be=D.expr.match.POS,bf={children:!0,contents:!0,next:!0,prev:!0};D.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var d=0,e=this.length;d<e;d++){c=b.length,D.find(a,this[d],b);if(d>0)for(var f=c;f<b.length;f++)for(var g=0;g<c;g++)if(b[g]===b[f]){b.splice(f--,1);break}}return b},has:function(a){var b=D(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(D.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(t(this,a,!1),"not",a)},filter:function(a){return this.pushStack(t(this,a,!0),"filter",a)},is:function(a){return!!a&&D.filter(a,this).length>0},closest:function(a,b){var c=[],d,e,f=this[0];if(D.isArray(a)){var g,h,i={},j=1;if(f&&a.length){for(d=0,e=a.length;d<e;d++)h=a[d],i[h]||(i[h]=D.expr.match.POS.test(h)?D(h,b||this.context):h);while(f&&f.ownerDocument&&f!==b){for(h in i)g=i[h],(g.jquery?g.index(f)>-1:D(f).is(g))&&c.push({selector:h,elem:f,level:j});f=f.parentNode,j++}}return c}var k=be.test(a)?D(a,b||this.context):null;for(d=0,e=this.length;d<e;d++){f=this[d];while(f){if(k?k.index(f)>-1:D.find.matchesSelector(f,a)){c.push(f);break}f=f.parentNode;if(!f||!f.ownerDocument||f===b)break}}c=c.length>1?D.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return D.inArray(this[0],a?D(a):this.parent().children());return D.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?D(a,b):D.makeArray(a),d=D.merge(this.get(),c);return this.pushStack(u(c[0])||u(d[0])?d:D.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),D.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return D.dir(a,"parentNode")},parentsUntil:function(a,b,c){return D.dir(a,"parentNode",c)},next:function(a){return D.nth(a,2,"nextSibling")},prev:function(a){return D.nth(a,2,"previousSibling")},nextAll:function(a){return D.dir(a,"nextSibling")},prevAll:function(a){return D.dir(a,"previousSibling")},nextUntil:function(a,b,c){return D.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return D.dir(a,"previousSibling",c)},siblings:function(a){return D.sibling(a.parentNode.firstChild,a)},children:function(a){return D.sibling(a.firstChild)},contents:function(a){return D.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:D.makeArray(a.childNodes)}},function(a,b){D.fn[a]=function(c,d){var e=D.map(this,b,c),f=bd.call(arguments);_.test(a)||(d=c),d&&typeof d=="string"&&(e=D.filter(d,e)),e=this.length>1&&!bf[a]?D.unique(e):e,(this.length>1||bb.test(d))&&ba.test(a)&&(e=e.reverse());return this.pushStack(e,a,f.join(","))}}),D.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?D.find.matchesSelector(b[0],a)?[b[0]]:[]:D.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!D(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bg=/ jQuery\d+="(?:\d+|null)"/g,bh=/^\s+/,bi=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,bj=/<([\w:]+)/,bk=/<tbody/i,bl=/<|&#?\w+;/,bm=/<(?:script|object|embed|option|style)/i,bn=/checked\s*(?:[^=]|=\s*.checked.)/i,bo={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,"",""]};bo.optgroup=bo.option,bo.tbody=bo.tfoot=bo.colgroup=bo.caption=bo.thead,bo.th=bo.td,D.support.htmlSerialize||(bo._default=[1,"div<div>","</div>"]),D.fn.extend({text:function(a){if(D.isFunction(a))return this.each(function(b){var c=D(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||C).createTextNode(a));return D.text(this)},wrapAll:function(a){if(D.isFunction(a))return this.each(function(b){D(this).wrapAll(a.call(this,b))});if(this[0]){var b=D(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(D.isFunction(a))return this.each(function(b){D(this).wrapInner(a.call(this,b))});return this.each(function(){var b=D(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){D(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){D.nodeName(this,"body")||D(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=D(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,D(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||D.filter(a,[d]).length)!b&&d.nodeType===1&&(D.cleanData(d.getElementsByTagName("*")),D.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&D.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return D.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(bg,""):null;if(typeof a!="string"||bm.test(a)||!D.support.leadingWhitespace&&bh.test(a)||bo[(bj.exec(a)||["",""])[1].toLowerCase()])D.isFunction(a)?this.each(function(b){var c=D(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(bi,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(D.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(D.isFunction(a))return this.each(function(b){var c=D(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=D(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;D(this).remove(),b?D(b).before(a):D(c).append(a)})}return this.length?this.pushStack(D(D.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,f,g,h,i=a[0],j=[];if(!D.support.checkClone&&arguments.length===3&&typeof i=="string"&&bn.test(i))return this.each(function(){D(this).domManip(a,c,d,!0)});if(D.isFunction(i))return this.each(function(e){var f=D(this);a[0]=i.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){h=i&&i.parentNode,D.support.parentNode&&h&&h.nodeType===11&&h.childNodes.length===this.length?e={fragment:h}:e=D.buildFragment(a,this,j),g=e.fragment,g.childNodes.length===1?f=g=g.firstChild:f=g.firstChild;if(f){c=c&&D.nodeName(f,"tr");for(var k=0,l=this.length,m=l-1;k<l;k++)d.call(c?s(this[k],f):this[k],e.cacheable||l>1&&k<m?D.clone(g,!0,!0):g)}j.length&&D.each(j,o)}return this}}),D.buildFragment=function(a,b,c){var d,e,f,g=b&&b[0]?b[0].ownerDocument||b[0]:C;a.length===1&&typeof a[0]=="string"&&a[0].length<512&&g===C&&a[0].charAt(0)==="<"&&!bm.test(a[0])&&(D.support.checkClone||!bn.test(a[0]))&&(e=!0,f=D.fragments[a[0]],f&&f!==1&&(d=f)),d||(d=g.createDocumentFragment(),D.clean(a,g,d,c)),e&&(D.fragments[a[0]]=f?d:1);return{fragment:d,cacheable:e}},D.fragments={},D.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){D.fn[a]=function(c){var d=[],e=D(c),f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var g=0,h=e.length;g<h;g++){var i=(g>0?this.clone(!0):this).get();D(e[g])[b](i),d=d.concat(i)}return this.pushStack(d,a,e.selector)}}),D.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,f,g;if((!D.support.noCloneEvent||!D.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!D.isXMLDoc(a)){q(a,d),e=p(a),f=p(d);for(g=0;e[g];++g)q(e[g],f[g])}if(b){r(a,d);if(c){e=p(a),f=p(d);for(g=0;e[g];++g)r(e[g],f[g])}}return d},clean:function(a,b,c,d){b=b||C,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||C);var e=[];for(var f=0,g;(g=a[f])!=null;f++){typeof g=="number"&&(g+="");if(!g)continue;if(typeof g!="string"||bl.test(g)){if(typeof g=="string"){g=g.replace(bi,"<$1></$2>");var h=(bj.exec(g)||["",""])[1].toLowerCase(),i=bo[h]||bo._default,j=i[0],k=b.createElement("div");k.innerHTML=i[1]+g+i[2];while(j--)k=k.lastChild;if(!D.support.tbody){var l=bk.test(g),m=h==="table"&&!l?k.firstChild&&k.firstChild.childNodes:i[1]==="<table>"&&!l?k.childNodes:[];for(var n=m.length-1;n>=0;--n)D.nodeName(m[n],"tbody")&&!m[n].childNodes.length&&m[n].parentNode.removeChild(m[n])}!D.support.leadingWhitespace&&bh.test(g)&&k.insertBefore(b.createTextNode(bh.exec(g)[0]),k.firstChild),g=k.childNodes}}else g=b.createTextNode(g);g.nodeType?e.push(g):e=D.merge(e,g)}if(c)for(f=0;e[f];f++)!d||!D.nodeName(e[f],"script")||e[f].type&&e[f].type.toLowerCase()!=="text/javascript"?(e[f].nodeType===1&&e.splice.apply(e,[f+1,0].concat(D.makeArray(e[f].getElementsByTagName("script")))),c.appendChild(e[f])):d.push(e[f].parentNode?e[f].parentNode.removeChild(e[f]):e[f]);return e},cleanData:function(a){var b,c,d=D.cache,e=D.expando,f=D.event.special,g=D.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&D.noData[i.nodeName.toLowerCase()])continue;c=i[D.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var j in b.events)f[j]?D.event.remove(i,j):D.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[D.expando]:i.removeAttribute&&i.removeAttribute(D.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/-([a-z])/ig,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv={position:"absolute",visibility:"hidden",display:"block"},bw=["Left","Right"],bx=["Top","Bottom"],by,bz,bA,bB=function(a,b){return b.toUpperCase()};D.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return D.access(this,a,c,!0,function(a,c,d){return d!==b?D.style(a,c,d):D.css(a,c)})},D.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":D.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var f,g=D.camelCase(c),h=a.style,i=D.cssHooks[g];c=D.cssProps[g]||g;if(d===b){if(i&&"get"in i&&(f=i.get(a,!1,e))!==b)return f;return h[c]}if(typeof d=="number"&&isNaN(d)||d==null)return;typeof d=="number"&&!D.cssNumber[g]&&(d+="px");if(!i||!("set"in i)||(d=i.set(a,d))!==b)try{h[c]=d}catch(j){}}},css:function(a,c,d){var e,f=D.camelCase(c),g=D.cssHooks[f];c=D.cssProps[f]||f;if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c,f)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(br,bB)}}),D.curCSS=D.css,D.each(["height","width"],function(a,b){D.cssHooks[b]={get:function(a,c,d){var e;if(c){a.offsetWidth!==0?e=n(a,b,d):D.swap(a,bv,function(){e=n(a,b,d)});if(e<=0){e=by(a,b,b),e==="0px"&&bA&&(e=bA(a,b,b));if(e!=null)return e===""||e==="auto"?"0px":e}if(e<0||e==null){e=a.style[b];return e===""||e==="auto"?"0px":e}return typeof e=="string"?e:e+"px"}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),D.support.opacity||(D.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var d=D.isNaN(b)?"":"alpha(opacity="+b*100+")",e=c.filter||"";c.filter=bp.test(e)?e.replace(bp,d):c.filter+" "+d}}),D(function(){D.support.reliableMarginRight||(D.cssHooks.marginRight={get:function(a,b){var c;D.swap(a,{display:"inline-block"},function(){b?c=by(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),C.defaultView&&C.defaultView.getComputedStyle&&(bz=function(a,c,d){var e,f,g;d=d.replace(bs,"-$1").toLowerCase();if(!(f=a.ownerDocument.defaultView))return b;if(g=f.getComputedStyle(a,null))e=g.getPropertyValue(d),e===""&&!D.contains(a.ownerDocument.documentElement,a)&&(e=D.style(a,d));return e}),C.documentElement.currentStyle&&(bA=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bt.test(d)&&bu.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),by=bz||bA,D.expr&&D.expr.filters&&(D.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!D.support.reliableHiddenOffsets&&(a.style.display||D.css(a,"display"))==="none"},D.expr.filters.visible=function(a){return!D.expr.filters.hidden(a)});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/(^|\-)([a-z])/g,bR=function(a,b,c){return b+c.toUpperCase()},bS=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bT=D.fn.load,bU={},bV={},bW,bX;try{bW=C.location.href}catch(bY){bW=C.createElement("a"),bW.href="",bW=bW.href}bX=bS.exec(bW.toLowerCase())||[],D.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bT)return bT.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}var g="GET";c&&(D.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=D.param(c,D.ajaxSettings.traditional),g="POST"));var h=this;D.ajax({url:a,type:g,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),h.html(f?D("<div>").append(c.replace(bM,"")).find(f):c)),d&&h.each(d,[c,b,a])}});return this},serialize:function(){return D.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?D.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=D(this).val();return c==null?null:D.isArray(c)?D.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),D.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){D.fn[b]=function(a){return this.bind(b,a)}}),D.each(["get","post"],function(a,c){D[c]=function(a,d,e,f){D.isFunction(d)&&(f=f||e,e=d,d=b);return D.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),D.extend({getScript:function(a,c){return D.get(a,b,c,"script")},getJSON:function(a,b,c){return D.get(a,b,c,"json")},ajaxSetup:function(a,b){b?D.extend(!0,a,D.ajaxSettings,b):(b=a,a=D.extend(!0,D.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in D.ajaxSettings&&(a[c]=D.ajaxSettings[c]);return a},ajaxSettings:{url:bW,isLocal:bI.test(bX[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":D.parseJSON,"text xml":D.parseXML}},ajaxPrefilter:m(bU),ajaxTransport:m(bV),ajax:function(a,c){function d(a,c,d,l){if(u!==2){u=2,s&&clearTimeout(s),r=b,p=l||"",x.readyState=a?4:0;var o,q,t,w=d?j(e,x,d):b,y,z;if(a>=200&&a<300||a===304){if(e.ifModified){if(y=x.getResponseHeader("Last-Modified"))D.lastModified[n]=y;if(z=x.getResponseHeader("Etag"))D.etag[n]=z}if(a===304)c="notmodified",o=!0;else try{q=i(e,w),c="success",o=!0}catch(A){c="parsererror",t=A}}else{t=c;if(!c||a)c="error",a<0&&(a=0)}x.status=a,x.statusText=c,o?h.resolveWith(f,[q,c,x]):h.rejectWith(f,[x,c,t]),x.statusCode(m),m=b,v&&g.trigger("ajax"+(o?"Success":"Error"),[x,e,o?q:t]),k.resolveWith(f,[x,c]),v&&(g.trigger("ajaxComplete",[x,e]),--D.active||D.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var e=D.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof D)?D(f):D.event,h=D.Deferred(),k=D._Deferred(),m=e.statusCode||{},n,o={},p,q,r,s,t,u=0,v,w,x={readyState:0,setRequestHeader:function(a,b){u||(o[a.toLowerCase().replace(bQ,bR)]=b);return this},getAllResponseHeaders:function(){return u===2?p:null},getResponseHeader:function(a){var c;if(u===2){if(!q){q={};while(c=bG.exec(p))q[c[1].toLowerCase()]=c[2]}c=q[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){u||(e.mimeType=a);return this},abort:function(a){a=a||"abort",r&&r.abort(a),d(0,a);return this}};h.promise(x),x.success=x.done,x.error=x.fail,x.complete=k.done,x.statusCode=function(a){if(a){var b;if(u<2)for(b in a)m[b]=[m[b],a[b]];else b=a[x.status],x.then(b,b)}return this},e.url=((a||e.url)+"").replace(bF,"").replace(bK,bX[1]+"//"),e.dataTypes=D.trim(e.dataType||"*").toLowerCase().split(bO),e.crossDomain==null&&(t=bS.exec(e.url.toLowerCase()),e.crossDomain=t&&(t[1]!=bX[1]||t[2]!=bX[2]||(t[3]||(t[1]==="http:"?80:443))!=(bX[3]||(bX[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!="string"&&(e.data=D.param(e.data,e.traditional)),l(bU,e,c,x);if(u===2)return!1;v=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bJ.test(e.type),v&&D.active++===0&&D.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bL.test(e.url)?"&":"?")+e.data),n=e.url;if(e.cache===!1){var y=D.now(),z=e.url.replace(bP,"$1_="+y);e.url=z+(z===e.url?(bL.test(e.url)?"&":"?")+"_="+y:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)o["Content-Type"]=e.contentType;e.ifModified&&(n=n||e.url,D.lastModified[n]&&(o["If-Modified-Since"]=D.lastModified[n]),D.etag[n]&&(o["If-None-Match"]=D.etag[n])),o.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(w in e.headers)x.setRequestHeader(w,e.headers[w]);if(e.beforeSend&&(e.beforeSend.call(f,x,e)===!1||u===2)){x.abort();return!1}for(w in{success:1,error:1,complete:1})x[w](e[w]);r=l(bV,e,c,x);if(r){x.readyState=1,v&&g.trigger("ajaxSend",[x,e]),e.async&&e.timeout>0&&(s=setTimeout(function(){x.abort("timeout")},e.timeout));try{u=1,r.send(o,d)}catch(A){status<2?d(-1,A):D.error(A)}}else d(-1,"No Transport");return x},param:function(a,c){var d=[],e=function(a,b){b=D.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=D.ajaxSettings.traditional);if(D.isArray(a)||a.jquery&&!D.isPlainObject(a))D.each(a,function(){e(this.name,this.value)});else for(var f in a)k(f,a[f],c,e);return d.join("&").replace(bC,"+")}}),D.extend({active:0,lastModified:{},etag:{}});var bZ=D.now(),b$=/(\=)\?(&|$)|\?\?/i;D.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return D.expando+"_"+bZ++}}),D.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(b$.test(b.url)||e&&b$.test(b.data))){var f,g=b.jsonpCallback=D.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h=a[g],i=b.url,j=b.data,k="$1"+g+"$2",l=function(){a[g]=h,f&&D.isFunction(h)&&a[g](f[0])};b.jsonp!==!1&&(i=i.replace(b$,k),b.url===i&&(e&&(j=j.replace(b$,k)),b.data===j&&(i+=(/\?/.test(i)?"&":"?")+b.jsonp+"="+g))),b.url=i,b.data=j,a[g]=function(a){f=[a]},d.then(l,l),b.converters["script json"]=function(){f||D.error(g+" was not called");return f[0]},b.dataTypes[0]="json";return"script"}}),D.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){D.globalEval(a);return a}}}),D.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),D.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=C.head||C.getElementsByTagName("head")[0]||C.documentElement;return{send:function(e,f){c=C.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var b_=D.now(),ca,cb;D.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&g()||f()}:g,cb=D.ajaxSettings.xhr(),D.support.ajax=!!cb,D.support.cors=cb&&"withCredentials"in cb,cb=b,D.support.ajax&&D.ajaxTransport(function(a){if(!a.crossDomain||D.support.cors){var c;return{send:function(d,e){var f=a.xhr(),g,i;a.username?f.open(a.type,a.url,a.async,a.username,a.password):f.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)f[i]=a.xhrFields[i];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),!a.crossDomain&&!d["X-Requested-With"]&&(d["X-Requested-With"]="XMLHttpRequest");try{for(i in d)f.setRequestHeader(i,d[i])}catch(j){}f.send(a.hasContent&&a.data||null),c=function(d,h){var i,j,k,l,m;try{if(c&&(h||f.readyState===4)){c=b,g&&(f.onreadystatechange=D.noop,delete ca[g]);if(h)f.readyState!==4&&f.abort();else{i=f.status,k=f.getAllResponseHeaders(),l={},m=f.responseXML,m&&m.documentElement&&(l.xml=m),l.text=f.responseText;try{j=f.statusText}catch(n){j=""}i||!a.isLocal||a.crossDomain?i===1223&&(i=204):i=l.text?200:404}}}catch(o){h||e(-1,o)}l&&e(i,j,l,k)},a.async&&f.readyState!==4?(ca||(ca={},h()),g=b_++,f.onreadystatechange=ca[g]=c):c()},abort:function(){c&&c(0,1)}}}});var cc={},cd=/^(?:toggle|show|hide)$/,ce=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cf,cg=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];D.fn.extend({show:function(a,b,c){var f,g;if(a||a===0)return this.animate(e("show",3),a,b,c);for(var h=0,i=this.length;h<i;h++)f=this[h],g=f.style.display,!D._data(f,"olddisplay")&&g==="none"&&(g=f.style.display=""),g===""&&D.css(f,"display")==="none"&&D._data(f,"olddisplay",d(f.nodeName));for(h=0;h<i;h++){f=this[h],g=f.style.display;if(g===""||g==="none")f.style.display=D._data(f,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(e("hide",3),a,b,c);for(var d=0,f=this.length;d<f;d++){var g=D.css(this[d],"display");g!=="none"&&!D._data(this[d],"olddisplay")&&D._data(this[d],"olddisplay",g)}for(d=0;d<f;d++)this[d].style.display="none";return this},_toggle:D.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";D.isFunction(a)&&D.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:D(this).is(":hidden");D(this)[b?"show":"hide"]()}):this.animate(e("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=D.speed(b,c,e);if(D.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=D.extend({},f),c,e=this.nodeType===1,g=e&&D(this).is(":hidden"),h=this;for(c in a){var i=D.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(D.css(this,"display")==="inline"&&D.css(this,"float")==="none")if(D.support.inlineBlockNeedsLayout){var j=d(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}D.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=D.extend({},a),D.each(a,function(c,d){var e=new D.fx(h,b,c);if(cd.test(d))e[d==="toggle"?g?"show":"hide":d](a);else{var f=ce.exec(d),i=e.cur();if(f){var j=parseFloat(f[2]),k=f[3]||(D.cssNumber[c]?"":"px");k!=="px"&&(D.style(h,c,(j||1)+k),i=(j||1)/e.cur()*i,D.style(h,c,i+k)),f[1]&&(j=(f[1]==="-="?-1:1)*j+i),e.custom(i,j,k)}else e.custom(i,d,"")}});return!0})},stop:function(a,b){var c=D.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),D.each({slideDown:e("show",1),slideUp:e("hide",1),slideToggle:e("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){D.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),D.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?D.extend({},a):{complete:c||!c&&b||D.isFunction(a)&&a,duration:a,easing:c&&b||b&&!D.isFunction(b)&&b};d.duration=D.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in D.fx.speeds?D.fx.speeds[d.duration]:D.fx.speeds._default,d.old=d.complete,d.complete=function(){d.queue!==!1&&D(this).dequeue(),D.isFunction(d.old)&&d.old.call(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),D.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(D.fx.step[this.prop]||D.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=D.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function d(a){return e.step(a)}var e=this,f=D.fx;this.startTime=D.now(),this.start=a,this.end=b,this.unit=c||this.unit||(D.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,d.elem=this.elem,d()&&D.timers.push(d)&&!cf&&(cf=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=D.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),D(this.elem).show()},hide:function(){this.options.orig[this.prop]=D.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=D.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var d in this.options.curAnim)this.options.curAnim[d]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!D.support.shrinkWrapBlocks){var e=this.elem,f=this.options;D.each(["","X","Y"],function(a,b){e.style["overflow"+b]=f.overflow[a]})}this.options.hide&&D(this.elem).hide();if(this.options.hide||this.options.show)for(var g in this.options.curAnim)D.style(this.elem,g,this.options.orig[g]);this.options.complete.call(this.elem)}return!1}var h=b-this.startTime;this.state=h/this.options.duration;var i=this.options.specialEasing&&this.options.specialEasing[this.prop],j=this.options.easing||(D.easing.swing?"swing":"linear");this.pos=D.easing[i||j](this.state,h,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},D.extend(D.fx,{tick:function(){var a=D.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||D.fx.stop()},interval:13,stop:function(){clearInterval(cf),cf=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){D.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),D.expr&&D.expr.filters&&(D.expr.filters.animated=function(a){return D.grep(D.timers,function(b){return a===b.elem}).length});var ch=/^t(?:able|d|h)$/i,ci=/^(?:body|html)$/i;"getBoundingClientRect"in C.documentElement?D.fn.offset=function(a){var b=this[0],d;if(a)return this.each(function(b){D.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return D.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!d||!D.contains(g,b))return d?{top:d.top,left:d.left}:{top:0,left:0};var h=f.body,i=c(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||D.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||D.support.boxModel&&g.scrollLeft||h.scrollLeft,n=d.top+l-j,o=d.left+m-k;return{top:n,left:o}}:D.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){D.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return D.offset.bodyOffset(b);D.offset.initialize();var c,d=b.offsetParent,e=b,f=b.ownerDocument,g=f.documentElement,h=f.body,i=f.defaultView,j=i?i.getComputedStyle(b,null):b.currentStyle,k=b.offsetTop,l=b.offsetLeft;while((b=b.parentNode)&&b!==h&&b!==g){if(D.offset.supportsFixedPosition&&j.position==="fixed")break;c=i?i.getComputedStyle(b,null):b.currentStyle,k-=b.scrollTop,l-=b.scrollLeft,b===d&&(k+=b.offsetTop,l+=b.offsetLeft,D.offset.doesNotAddBorder&&(!D.offset.doesAddBorderForTableAndCells||!ch.test(b.nodeName))&&(k+=parseFloat(c.borderTopWidth)||0,l+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),D.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(k+=parseFloat(c.borderTopWidth)||0,l+=parseFloat(c.borderLeftWidth)||0),j=c}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;D.offset.supportsFixedPosition&&j.position==="fixed"&&(k+=Math.max(g.scrollTop,h.scrollTop),l+=Math.max(g.scrollLeft,h.scrollLeft));return{top:k,left:l}},D.offset={initialize:function(){var a=C.body,b=C.createElement("div"),c,d,e,f,g=parseFloat(D.css(a,"marginTop"))||0,h="<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>";D.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=h,a.insertBefore(b,a.firstChild),c=b.firstChild,d=c.firstChild,f=c.nextSibling.firstChild.firstChild,this.doesNotAddBorder=d.offsetTop!==5,this.doesAddBorderForTableAndCells=f.offsetTop===5,d.style.position="fixed",d.style.top="20px",this.supportsFixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",c.style.overflow="hidden",c.style.position="relative",this.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==g,a.removeChild(b),D.offset.initialize=D.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;D.offset.initialize(),D.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(D.css(a,"marginTop"))||0,c+=parseFloat(D.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=D.css(a,"position");d==="static"&&(a.style.position="relative");var e=D(a),f=e.offset(),g=D.css(a,"top"),h=D.css(a,"left"),i=(d==="absolute"||d==="fixed")&&D.inArray("auto",[g,h])>-1,j={},k={},l,m;i&&(k=e.position()),l=i?k.top:parseInt(g,10)||0,m=i?k.left:parseInt(h,10)||0,D.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},D.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ci.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(D.css(a,"marginTop"))||0,c.left-=parseFloat(D.css(a,"marginLeft"))||0,d.top+=parseFloat(D.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(D.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||C.body;while(a&&!ci.test(a.nodeName)&&D.css(a,"position")==="static")a=a.offsetParent;return a})}}),D.each(["Left","Top"],function(a,d){var e="scroll"+d;D.fn[e]=function(d){var f=this[0],g;if(!f)return null;if(d!==b)return this.each(function(){g=c(this),g?g.scrollTo(a?D(g).scrollLeft():d,a?d:D(g).scrollTop()):this[e]=d});g=c(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:D.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),D.each(["Height","Width"],function(a,c){var d=c.toLowerCase();D.fn["inner"+c]=function(){return this[0]?parseFloat(D.css(this[0],d,"padding")):null},D.fn["outer"+c]=function(a){return this[0]?parseFloat(D.css(this[0],d,a?"margin":"border")):null},D.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(D.isFunction(a))return this.each(function(b){var c=D(this);c[d](a.call(this,b,c[d]()))});if(D.isWindow(e)){var f=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&f||e.document.body["client"+c]||f}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var g=D.css(e,d),h=parseFloat(g);return D.isNaN(h)?g:h}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=D})(window),function(){var a=this,b=a._,c={},d=Array.prototype,e=Object.prototype,f=Function.prototype,g=d.slice,h=d.unshift,i=e.toString,j=e.hasOwnProperty,k=d.forEach,l=d.map,m=d.reduce,n=d.reduceRight,o=d.filter,p=d.every,q=d.some,r=d.indexOf,s=d.lastIndexOf,t=Array.isArray,u=Object.keys,v=f.bind,w=function(a){return new B(a)};typeof module!="undefined"&&module.exports?(module.exports=w,w._=w):a._=w,w.VERSION="1.1.7";var x=w.each=w.forEach=function(a,b,d){if(a!=null)if(k&&a.forEach===k)a.forEach(b,d);else if(a.length===+a.length){for(var e=0,f=a.length;e<f;e++)if(e in a&&b.call(d,a[e],e,a)===c)return}else for(var g in a)if(j.call(a,g)&&b.call(d,a[g],g,a)===c)return};w.map=function(a,b,c){var d=[];if(a==null)return d;if(l&&a.map===l)return a.map(b,c);x(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)});return d},w.reduce=w.foldl=w.inject=function(a,b,c,d){var e=c!==void 0;a==null&&(a=[]);if(m&&a.reduce===m){d&&(b=w.bind(b,d));return e?a.reduce(b,c):a.reduce(b)}x(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c},w.reduceRight=w.foldr=function(a,b,c,d){a==null&&(a=[]);if(n&&a.reduceRight===n){d&&(b=w.bind(b,d));return c!==void 0?a.reduceRight(b,c):a.reduceRight(b)}var e=(w.isArray(a)?a.slice():w.toArray(a)).reverse();return w.reduce(e,b,c,d)},w.find=w.detect=function(a,b,c){var d;y(a,function(a,e,f){if(b.call(c,a,e,f)){d=a;return!0}});return d},w.filter=w.select=function(a,b,c){var d=[];if(a==null)return d;if(o&&a.filter===o)return a.filter(b,c);x(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)});return d},w.reject=function(a,b,c){var d=[];if(a==null)return d;x(a,function(a,e,f){b.call(c,a,e,f)||(d[d.length]=a)});return d},w.every=w.all=function(a,b,d){var e=!0;if(a==null)return e;if(p&&a.every===p)return a.every(b,d);x(a,function(a,f,g){if(!(e=e&&b.call(d,a,f,g)))return c});return e};var y=w.some=w.any=function(a,b,d){b=b||w.identity;var e=!1;if(a==null)return e;if(q&&a.some===q)return a.some(b,d);x(a,function(a,f,g){if(e|=b.call(d,a,f,g))return c});return!!e};w.include=w.contains=function(a,b){var c=!1;if(a==null)return c;if(r&&a.indexOf===r)return a.indexOf(b)!=-1;y(a,function(a){if(c=a===b)return!0});return c},w.invoke=function(a,b){var c=g.call(arguments,2);return w.map(a,function(a){return(b.call?b||a:a[b]).apply(a,c)})},w.pluck=function(a,b){return w.map(a,function(a){return a[b]})},w.max=function(a,b,c){if(!b&&w.isArray(a))return Math.max.apply(Math,a);var d={computed:-Infinity};x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})});return d.value},w.min=function(a,b,c){if(!b&&w.isArray(a))return Math.min.apply(Math,a);var d={computed:Infinity};x(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})});return d.value},w.sortBy=function(a,b,c){return w.pluck(w.map(a,function(a,d,e){return{value:a,criteria:b.call(c,a,d,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")},w.groupBy=function(a,b){var c={};x(a,function(a,d){var e=b(a,d);(c[e]||(c[e]=[])).push(a)});return c},w.sortedIndex=function(a,b,c){c||(c=w.identity);var d=0,e=a.length;while(d<e){var f=d+e>>1;c(a[f])<c(b)?d=f+1:e=f}return d},w.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(w.isArray(a))return g.call(a);if(w.isArguments(a))return g.call(a);return w.values(a)},w.size=function(a){return w.toArray(a).length},w.first=w.head=function(a,b,c){return b!=null&&!c?g.call(a,0,b):a[0]},w.rest=w.tail=function(a,b,c){return g.call(a,b==null||c?1:b)},w.last=function(a){return a[a.length-1]},w.compact=function(a){return w.filter(a,function(a){return!!a})},w.flatten=function(a){return w.reduce(a,function(a,b){if(w.isArray(b))return a.concat(w.flatten(b));a[a.length]=b;return a},[])},w.without=function(a){return w.difference(a,g.call(arguments,1))},w.uniq=w.unique=function(a,b){return w.reduce(a,function(a,c,d){if(0==d||(b===!0?w.last(a)!=c:!w.include(a,c)))a[a.length]=c;return a},[])},w.union=function(){return w.uniq(w.flatten(arguments))},w.intersection=w.intersect=function(a){var b=g.call(arguments,1);return w.filter(w.uniq(a),function(a){return w.every(b,function(b){return w.indexOf(b,a)>=0})})},w.difference=function(a,b){return w.filter(a,function(a){return!w.include(b,a)})},w.zip=function(){var a=g.call(arguments),b=w.max(w.pluck(a,"length")),c=Array(b);for(var d=0;d<b;d++)c[d]=w.pluck(a,""+d);return c},w.indexOf=function(a,b,c){if(a==null)return-1;var d,e;if(c){d=w.sortedIndex(a,b);return a[d]===b?d:-1}if(r&&a.indexOf===r)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},w.lastIndexOf=function(a,b){if(a==null)return-1;if(s&&a.lastIndexOf===s)return a.lastIndexOf(b);var c=a.length;while(c--)if(a[c]===b)return c;return-1},w.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=Array(d);while(e<d)f[e++]=a,a+=c;return f},w.bind=function(a,b){if(a.bind===v&&v)return v.apply(a,g.call(arguments,1));var c=g.call(arguments,2);return function(){return a.apply(b,c.concat(g.call(arguments)))}},w.bindAll=function(a){var b=g.call(arguments,1);b.length==0&&(b=w.functions(a)),x(b,function(b){a[b]=w.bind(a[b],a)});return a},w.memoize=function(a,b){var c={};b||(b=w.identity);return function(){var d=b.apply(this,arguments);return j.call(c,d)?c[d]:c[d]=a.apply(this,arguments)}},w.delay=function(a,b){var c=g.call(arguments,2);return setTimeout(function(){return a.apply(a,c)},b)},w.defer=function(a){return w.delay.apply(w,[a,1].concat(g.call(arguments,1)))};var z=function(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}};w.throttle=function(a,b){return z(a,b,!1)},w.debounce=function(a,b){return z(a,b,!0)},w.once=function(a){var b=!1,c;return function(){if(b)return c;b=!0;return c=a.apply(this,arguments)}},w.wrap=function(a,b){return function(){var c=[a].concat(g.call(arguments));return b.apply(this,c)}},w.compose=function(){var a=g.call(arguments);return function(){var b=g.call(arguments);for(var c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},w.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}},w.keys=u||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)j.call(a,c)&&(b[b.length]=c);return b},w.values=function(a){return w.map(a,w.identity)},w.functions=w.methods=function(a){var b=[];for(var c in a)w.isFunction(a[c])&&b.push(c);return b.sort()},w.extend=function(a){x(g.call(arguments,1),function(b){for(var c in b)b[c]!==void 0&&(a[c]=b[c])});return a},w.defaults=function(a){x(g.call(arguments,1),function(b){for(var c in b)a[c]==null&&(a[c]=b[c])});return a},w.clone=function(a){return w.isArray(a)?a.slice():w.extend({},a)},w.tap=function(a,b){b(a);return a},w.isEqual=function(a,b){if(a===b)return!0;var c=typeof a,d=typeof b;if(c!=d)return!1;if(a==b)return!0;if(!a&&b||a&&!b)return!1;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual)return a.isEqual(b);if(b.isEqual)return b.isEqual(a);if(w.isDate(a)&&w.isDate(b))return a.getTime()===b.getTime();if(w.isNaN(a)&&w.isNaN(b))return!1;if(w.isRegExp(a)&&w.isRegExp(b))return a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline;if(c!=="object")return!1;if(a.length&&a.length!==b.length)return!1;var e=w.keys(a),f=w.keys(b);if(e.length!=f.length)return!1;for(var g in a)if(!(g in b)||!w.isEqual(a[g],b[g]))return!1;return!0},w.isEmpty=function(a){if(w.isArray(a)||w.isString(a))return a.length===0;for(var b in a)if(j.call(a,b))return!1;return!0},w.isElement=function(a){return!!a&&a.nodeType==1},w.isArray=t||function(a){return i.call(a)==="[object Array]"},w.isObject=function(a){return a===Object(a)},w.isArguments=function(a){return!!a&&!!j.call(a,"callee")},w.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)},w.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},w.isNumber=function(a){return!!(a===0||a&&a.toExponential&&a.toFixed)},w.isNaN=function(a){return a!==a},w.isBoolean=function(a){return a===!0||a===!1},w.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)},w.isRegExp=function(a){return!(!(a&&a.test&&a.exec)||!a.ignoreCase&&a.ignoreCase!==!1)},w.isNull=function(a){return a===null},w.isUndefined=function(a){return a===void 0},w.noConflict=function(){a._=b;return this},w.identity=function(a){return a},w.times=function(a,b,c){for(var d=0;d<a;d++)b.call(c,d)},w.mixin=function(a){x(w.functions(a),function(b){D(b,w[b]=a[b])})};var A=0;w.uniqueId=function(a){var b=A++;return a?a+b:b},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g},w.template=function(a,b){var c=w.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(c.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(c.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj",d);return b?e(b):e};var B=function(a){this._wrapped=a};w.prototype=B.prototype;var C=function(a,b){return b?w(a).chain():a},D=function(a,b){B.prototype[a]=function(){var a=g.call(arguments);h.call(a,this._wrapped);return C(b.apply(w,a),this._chain)}};w.mixin(w),x(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=d[a];B.prototype[a]=function(){b.apply(this._wrapped,arguments);return C(this._wrapped,this._chain)}}),x(["concat","join","slice"],function(a){var b=d[a];B.prototype[a]=function(){return C(b.apply(this._wrapped,arguments),this._chain)}}),B.prototype.chain=function(){this._chain=!0;return this},B.prototype.value=function(){return this._wrapped}}(),function(){var a;typeof exports!="undefined"?a=exports:a=this.Backbone={},a.VERSION="0.3.3";var b=this._;!b&&typeof require!="undefined"&&(b=require("underscore")._);var c=this.jQuery||this.Zepto;a.emulateHTTP=!1,a.emulateJSON=!1,a.Events={bind:function(a,b){var c=this._callbacks||(this._callbacks={}),d=this._callbacks[a]||(this._callbacks[a]=[]);d.push(b);return this},unbind:function(a,b){var c;if(!a)this._callbacks={};else if(c=this._callbacks)if(!b)c[a]=[];else{var d=c[a];if(!d)return this;for(var e=0,f=d.length;e<f;e++)if(b===d[e]){d.splice(e,1);break}}return this},trigger:function(a){var b,c,d,e;if(!(c=this._callbacks))return this;if(b=c[a])for(d=0,e=b.length;d<e;d++)b[d].apply(this,Array.prototype.slice.call(arguments,1));if(b=c.all)for(d=0,e=b.length;d<e;d++)b[d].apply(this,arguments);return this}},a.Model=function(a,c){a||(a={}),this.defaults&&(a=b.extend({},this.defaults,a)),this.attributes={},this._escapedAttributes={},this.cid=b.uniqueId("c"),this.set(a,{silent:!0}),this._previousAttributes=b.clone(this.attributes),c&&c.collection&&(this.collection=c.collection),this.initialize(a,c)},b.extend(a.Model.prototype,a.Events,{_previousAttributes:null,_changed:!1,initialize:function(){},toJSON:function(){return b.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;var c=this.attributes[a];return this._escapedAttributes[a]=p(c==null?"":c)},set:function(a,c){c||(c={});if(!a)return this;a.attributes&&(a=a.attributes);var d=this.attributes,e=this._escapedAttributes;if(!c.silent&&this.validate&&!this._performValidation(a,c))return!1;"id"in a&&(this.id=a.id);for(var f in a){var g=a[f];b.isEqual(d[f],g)||(d[f]=g,delete e[f],c.silent||(this._changed=!0,this.trigger("change:"+f,this,g,c)))}!c.silent&&this._changed&&this.change(c);return this},unset:function(a,b){b||(b={});var c=this.attributes[a],d={};d[a]=void 0;if(!b.silent&&this.validate&&!this._performValidation(d,b))return!1;delete this.attributes[a],delete this._escapedAttributes[a],b.silent||(this._changed=!0,this.trigger("change:"+a,this,void 0,b),this.change(b));return this},clear:function(a){a||(a={});var b=this.attributes,c={};for(attr in b)c[attr]=void 0;if(!a.silent&&this.validate&&!this._performValidation(c,a))return!1;this.attributes={},this._escapedAttributes={};if(!a.silent){this._changed=!0;for(attr in b)this.trigger("change:"+attr,this,void 0,a);this.change(a)}return this},fetch:function(b){b||(b={});var c=this,d=function(a){if(!c.set(c.parse(a),b))return!1;b.success&&b.success(c,a)},e=o(b.error,c,b);(this.sync||a.sync)("read",this,d,e);return this},save:function(b,c){c||(c={});if(b&&!this.set(b,c))return!1;var d=this,e=function(a){if(!d.set(d.parse(a),c))return!1;c.success&&c.success(d,a)},f=o(c.error,d,c),g=this.isNew()?"create":"update";(this.sync||a.sync)(g,this,e,f);return this},destroy:function(b){b||(b={});var c=this,d=function(a){c.collection&&c.collection.remove(c),b.success&&b.success(c,a)},e=o(b.error,c,b);(this.sync||a.sync)("delete",this,d,e);return this},url:function(){var a=n(this.collection);if(this.isNew())return a;return a+(a.charAt(a.length-1)=="/"?"":"/")+this.id},parse:function(a){return a},clone:function(){return new this.constructor(this)},isNew:function(){return!this.id},change:function(a){this.trigger("change",this,a),this._previousAttributes=b.clone(this.attributes),this._changed=!1},hasChanged:function(a){if(a)return this._previousAttributes[a]!=this.attributes[a];return this._changed},changedAttributes:function(a){a||(a=this.attributes);var c=this._previousAttributes,d=!1;for(var e in a)b.isEqual(c[e],a[e])||(d=d||{},d[e]=a[e]);return d},previous:function(a){if(!a||!this._previousAttributes)return null;return this._previousAttributes[a]},previousAttributes:function(){return b.clone(this._previousAttributes)},_performValidation:function(a,b){var c=this.validate(a);if(c){b.error?b.error(this,c):this.trigger("error",this,c,b);return!1}return!0}}),a.Collection=function(a,c){c||(c={}),c.comparator&&(this.comparator=c.comparator,delete c.comparator),this._boundOnModelEvent=b.bind(this._onModelEvent,this),this._reset(),a&&this.refresh(a,{silent:!0}),this.initialize(a,c)},b.extend(a.Collection.prototype,a.Events,{model:a.Model,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,c){if(b.isArray(a))for(var d=0,e=a.length;d<e;d++)this._add(a[d],c);else this._add(a,c);return this},remove:function(a,c){if(b.isArray(a))for(var d=0,e=a.length;d<e;d++)this._remove(a[d],c);else this._remove(a,c);return this},get:function(a){if(a==null)return null;return this._byId[a.id!=null?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw new Error("Cannot sort a set without a comparator");this.models=this.sortBy(this.comparator),a.silent||this.trigger("refresh",this,a);return this},pluck:function(a){return b.map(this.models,function(b){return b.get(a)})},refresh:function(a,b){a||(a=[]),b||(b={}),this._reset(),this.add(a,{silent:!0}),b.silent||this.trigger("refresh",this,b);return this},fetch:function(b){b||(b={});var c=this,d=function(a){c.refresh(c.parse(a)),b.success&&b.success(c,a)},e=o(b.error,c,b);(this.sync||a.sync)("read",this,d,e);return this},create:function(b,c){var d=this;c||(c={}),b instanceof a.Model?b.collection=d:b=new this.model(b,{collection:d});var e=function(a,b){d.add(a),c.success&&c.success(a,b)};return b.save(null,{success:e,error:c.error})},parse:function(a){return a},chain:function(){return b(this.models).chain()},_reset:function(a){this.length=0,this.models=[],this._byId={},this._byCid={}},_add:function(b,c){c||(c={}),b instanceof a.Model||(b=new this.model(b,{collection:this}));var d=this.getByCid(b);if(d)throw new Error(["Can't add the same model to a set twice",d.id]);this._byId[b.id]=b,this._byCid[b.cid]=b,b.collection=this;var e=this.comparator?this.sortedIndex(b,this.comparator):this.length;this.models.splice(e,0,b),b.bind("all",this._boundOnModelEvent),this.length++,c.silent||b.trigger("add",b,this,c);return b},_remove:function(a,b){b||(b={}),a=this.getByCid(a)||this.get(a);if(!a)return null;delete this._byId[a.id],delete this._byCid[a.cid],delete a.collection,this.models.splice(this.indexOf(a),1),this.length--,b.silent||a.trigger("remove",a,this,b),a.unbind("all",this._boundOnModelEvent);return a},_onModelEvent:function(a,b){a==="change:id"&&(delete this._byId[b.previous("id")],this._byId[b.id]=b),this.trigger.apply(this,arguments)}});var d=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","invoke","max","min","sortBy","sortedIndex","toArray","size","first","rest","last","without","indexOf","lastIndexOf","isEmpty"];b.each(d,function(c){a.Collection.prototype[c]=function(){return b[c].apply(b,[this.models].concat(b.toArray(arguments)))}}),a.Controller=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize(a)};var e=/:([\w\d]+)/g,f=/\*([\w\d]+)/g;b.extend(a.Controller.prototype,a.Events,{initialize:function(){},route:function(c,d,e){a.history||(a.history=new a.History),b.isRegExp(c)||(c=this._routeToRegExp(c)),a.history.route(c,b.bind(function(a){var b=this._extractParameters(c,a);e.apply(this,b),this.trigger.apply(this,["route:"+d].concat(b))},this))},saveLocation:function(b){a.history.saveLocation(b)},_bindRoutes:function(){if(!!this.routes)for(var a in this.routes){var b=this.routes[a];this.route(a,b,this[b])}},_routeToRegExp:function(a){a=a.replace(e,"([^/]*)").replace(f,"(.*?)");return new RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}}),a.History=function(){this.handlers=[],this.fragment=this.getFragment(),b.bindAll(this,"checkUrl")};var g=/^#*/;b.extend(a.History.prototype,{interval:50,getFragment:function(a){return(a||window.location).hash.replace(g,"")},start:function(){var a=document.documentMode,b=c.browser.msie&&(!a||a<=7);b&&(this.iframe=c('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow),"onhashchange"in window&&!b?c(window).bind("hashchange",this.checkUrl):setInterval(this.checkUrl,this.interval);return this.loadUrl()},route:function(a,b){this.handlers.push({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.iframe.location));if(a==this.fragment||a==decodeURIComponent(this.fragment))return!1;this.iframe&&(window.location.hash=this.iframe.location.hash=a),this.loadUrl()},loadUrl:function(){var a=this.fragment=this.getFragment(),c=b.any(this.handlers,function(b){if(b.route.test(a)){b.callback(a);return!0}});return c},saveLocation:function(a){a=(a||"").replace(g,"");this.fragment!=a&&(window.location.hash=this.fragment=a,this.iframe&&a!=this.getFragment(this.iframe.location)&&(this.iframe.document.open().close(),this.iframe.location.hash=a))}}),a.View=function(a){this._configure(a||{}),this._ensureElement(),this.delegateEvents(),this.initialize(a)};var h=function(a){return c(a,this.el)},i=/^(\w+)\s*(.*)$/;b.extend(a.View.prototype,a.Events,{tagName:"div",$:h,initialize:function(){},render:function(){return this},remove:function(){c(this.el).remove();return this},make:function(a,b,d){var e=document.createElement(a);b&&c(e).attr(b),d&&c(e).html(d);return e},delegateEvents:function(a){if(!!a||!!(a=this.events)){c(this.el).unbind();for(var d in a){var e=a[d],f=d.match(i),g=f[1],h=f[2],j=b.bind(this[e],this);h===""?c(this.el).bind(g,j):c(this.el).delegate(h,g,j)}}},_configure:function(a){this.options&&(a=b.extend({},this.options,a)),a.model&&(this.model=a.model),a.collection&&(this.collection=a.collection),a.el&&(this.el=a.el),a.id&&(this.id=a.id),a.className&&(this.className=a.className),a.tagName&&(this.tagName=a.tagName),this.options=a},_ensureElement:function(){if(!this.el){var a={};this.id&&(a.id=this.id),this.className&&(a["class"]=this.className),this.el=this.make(this.tagName,a)}}});var j=function(a,b){var c=m(this,a,b);c.extend=j;return c};a.Model.extend=a.Collection.extend=a.Controller.extend=a.View.extend=j;var k={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};a.sync=function(b,d,e,f){var g=k[b],h=b==="create"||b==="update"?JSON.stringify(d.toJSON()):null,i={url:n(d),type:g,contentType:"application/json",data:h,dataType:"json",processData:!1,success:e,error:f};a.emulateJSON&&(i.contentType="application/x-www-form-urlencoded",i.processData=!0,i.data=h?{model:h}:{}),a.emulateHTTP&&(g==="PUT"||g==="DELETE")&&(a.emulateJSON&&(i.data._method=g),i.type="POST",i.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",g)}),c.ajax(i)};var l=function(){},m=function(a,c,d){var e;c&&c.hasOwnProperty("constructor")?e=c.constructor:e=function(){return a.apply(this,arguments)},l.prototype=a.prototype,e.prototype=new l,c&&b.extend(e.prototype,c),d&&b.extend(e,d),e.prototype.constructor=e,e.__super__=a.prototype;return e},n=function(a){if(!a||!a.url)throw new Error("A 'url' property or function must be specified");return b.isFunction(a.url)?a.url():a.url},o=function(a,b,c){return function(d){a?a(b,d):b.trigger("error",b,d,c)}},p=function(a){return a.replace(/&(?!\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}}();var Bones=Bones||{};Bones.utils=Bones.utils||{},typeof process!="undefined"&&process.versions&&process.versions.node&&(module.exports=Bones.utils),Bones.utils.callback=function(a){return{success:function(b,c){a(null,c)},error:function(b,c){a(c)}}},Bones.utils.uncountable=["advice","enegery","excretion","digestion","cooperation","health","justice","jeans","labour","machinery","equipment","information","pollution","sewage","paper","money","species","series","rain","rice","fish","sheep","moose","deer","bison","proceedings","shears","pincers","breeches","hijinks","clippers","chassis","innings","elk","rhinoceros","swine","you","news"],Bones.utils.singularize=function(a){if(Bones.utils.uncountable.indexOf(a.toLowerCase())>=0)return a;for(var b=Bones.utils.singularize.rules.length-1;b>=0;b--){var c=Bones.utils.singularize.rules[b];if(c[0].test(a))return a.replace(c[0],c[1])}return a},Bones.utils.singularize.rules=[[/s$/i,""],[/(bu|mis|kis)s$/i,"$1s"],[/([ti])a$/i,"$1um"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i,"$1$2sis"],[/(^analy)ses$/i,"$1sis"],[/([^f])ves$/i,"$1fe"],[/([lr])ves$/i,"$1f"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/ies$/i,"ie"],[/(x|ch|ss|sh)es$/i,"$1"],[/([m|l])ice$/i,"$1ouse"],[/(bus)es$/i,"$1"],[/(o)es$/i,"$1"],[/(shoe)s$/i,"$1"],[/(cris|ax|test)es$/i,"$1is"],[/(octop|vir)i$/i,"$1us"],[/(alias|status)es$/i,"$1"],[/^(ox)en/i,"$1"],[/(vert|ind)ices$/i,"$1ex"],[/(matr)ices$/i,"$1ix"],[/(quiz)zes$/i,"$1"],[/^(p)eople$/i,"$erson"],[/^(m)en$/i,"$1an"],[/^(child)ren$/i,"$1"],[/^(move)s$/i,"$1"],[/^(sex)$es/i,"$1"]],Bones.utils.pluralize=function(a){if(Bones.utils.uncountable.indexOf(a.toLowerCase())>=0)return a;for(var b=Bones.utils.pluralize.rules.length-1;b>=0;b--){var c=Bones.utils.pluralize.rules[b];if(c[0].test(a))return a.replace(c[0],c[1])}return a},Bones.utils.pluralize.rules=[[/$/,"s"],[/(s|ss|sh|ch|x|o)$/i,"$1es"],[/y$/i,"ies"],[/(o|e)y$/i,"$1ys"],[/(octop|vir)us$/i,"$1i"],[/(alias|status)$/i,"$1es"],[/(bu)s$/i,"$1ses"],[/([ti])um$/i,"$1a"],[/sis$/i,"ses"],[/(?:([^f])fe|([lr])f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"],[/([m|l])ouse$/i,"$1ice"],[/^(ox)$/i,"$1en"],[/(quiz)$/i,"$1zes"],[/^(p)erson$/i,"$1eople"],[/^(m)an$/i,"$1en"],[/^(child)$/i,"$1ren"],[/^(move)$/i,"$1s"],[/^(sex)$/i,"$1es"]],$(function(){$.browser.msie&&$.ajaxSetup({cache:!1})}),function(){var a={},b={},c={},d={};Bones.server=!1,Bones.initialize=function(e,f){if(e==="model"){var g=f(a);g&&(a[g.title]=g)}else if(e==="view"){var h=f(a,b,d);h&&(b[h.title]=h)}else if(e==="controller"){var i=f(a,b,c);i&&(c[i.title]=i)}else if(e==="template"){var j=f(d);j&&(d[j.title]=j)}else _.isFunction(e)&&e(a,b,c,d)},Bones.start=function(){for(var a in c)new c[a];Backbone.history.start()},Bones.DEBUG={models:a,views:b,controllers:c,templates:d}}(),typeof process!="undefined"&&process.versions&&process.versions.node&&(module.exports=Backbone=require("backbone"),_=require("underscore"),$=require("jquery")),Backbone.Model.augment=Backbone.Collection.augment=Backbone.Controller.augment=Backbone.View.augment=function(a){var b=this.prototype;for(var c in a)typeof a[c]=="function"?b[c]=_.wrap(b[c],a[c]):_.isArray(a[c])?b[c]=_.isArray(b[c])?b[c].concat(a[c]):a[c]:typeof a[c]=="object"?b[c]=_.extend({},b[c],a[c]):b[c]=a[c];return this};var extend=Backbone.Controller.extend;Backbone.Model.extend=Backbone.Collection.extend=Backbone.Controller.extend=Backbone.View.extend=function(){var a=extend.apply(this,arguments);for(var b in this){if(b==="__super__"||b==="prototype"||b==="title")continue;a[b]=this[b]}return a},Backbone.View.prototype.html=function(){return $(this.el).html()},Backbone.Controller.prototype.route=function(a,b,c){Backbone.history||(Backbone.history=new Backbone.History),_.isRegExp(a)||(a=this._routeToRegExp(a)),Backbone.history.route(a,_.bind(function(d){var e=this._extractParameters(a,d);c.apply(this,e),this.trigger.apply(this,["route:"+b].concat(e))},this))},Backbone.View.augment({attach:function(){},_configure:function(a,b){a.call(this,b),this.bind("attach",this.attach)}}),Backbone.History.prototype.start=function(){var a=document.documentMode,b=$.browser.msie&&(!a||a<=7);b&&(this.iframe=$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.iframe.document.open().close(),this.iframe.location.hash=window.location.hash),"onhashchange"in window&&!b?$(window).bind("hashchange",this.checkUrl):setInterval(this.checkUrl,this.interval);return this.loadUrl()},Backbone.History.prototype._saveLocation=Backbone.History.prototype.saveLocation,Backbone.History.prototype.saveLocation=function(a){Backbone.History.prototype._saveLocation.call(this,"!"+a.replace(/^!*/,""))},Backbone.History.prototype.checkUrl=function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.iframe.location));if(a==this.fragment||a==decodeURIComponent(this.fragment))return!1;this.iframe&&(this.iframe.location.hash=a,window.location.hash="!"+a),this.loadUrl()},Backbone.History.prototype.loadUrl=function(){this.fragment=this.getFragment();var a=this.fragment.replace(/^!*/,""),b=_.any(this.handlers,function(b){if(b.route.test(a)){b.callback(a);return!0}});return b},Backbone.csrf=function(a,b){var c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXZY0123456789",d="";while(d.length<32)d+=c.charAt(Math.floor(Math.random()*c.length));a=a||"/",a=a.split("#")[0].split("?")[0];var e=(new Date(+(new Date)+(b||1e3))).toGMTString();document.cookie="bones.token="+d+";expires="+e+";path="+a+";";return d},Backbone.sync=function(a,b,c,d){function e(a){if(!a||!a.url)throw new Error("A 'url' property or function must be specified");return _.isFunction(a.url)?a.url():a.url}var f={create:"POST",update:"PUT","delete":"DELETE",read:"GET"}[a];if(a!=="read"){var g=b.toJSON?b.toJSON():b;g["bones.token"]=Backbone.csrf(e(b)),g=JSON.stringify(g)}var h={url:e(b),type:f,contentType:"application/json",data:g||null,dataType:"json",processData:!1,success:c,error:d};$.ajax(h)},Bones.initialize("controller",function(a,b,c){var d;Backbone.Controller.prototype.toError=function(a){try{var b=JSON.parse(a.responseText);return b.message||b.error&&b.error.message||""}catch(b){return""}},d=Backbone.Controller.extend({initialize:function(b){this.Collection=a.Tilesets,this.Model=a.Tileset,typeof req!="undefined"&&(this.req=req),Backbone.Controller.prototype.initialize.call(this,b)},routes:{"":"list","/":"list","/map/:id":"map"},list:function(){var a=_(this.req.query).clone();(new this.Collection([],a)).fetch({success:_.bind(function(c){a.collection=c,a.view=new b.Maps(a);var d=new b.App(a);this.res&&this.res.send(d.el)},this),error:_.bind(this.error,this)})},map:function(a){var c=_(this.req.query).clone();(new this.Model({id:a},c)).fetch({success:_.bind(function(a){c.model=a,c.view=new b.Map(c);var d=new b.App(c);this.res&&this.res.send(d.el)},this),error:_.bind(this.error,this)})},error:function(a,c){var d=_(this.req.query).clone();d.error=this.toError(c)||"Connection problem.",d.view=new b.Error(d);var e=new b.App(d);this.res&&this.res.send(e.el,503)}}),d&&!d.title&&(d.title="Router");return d}),Bones.initialize("model",function(a){var b;b=Backbone.Model,Backbone.Collection.prototype.initialize=Backbone.Model.prototype.initialize=function(a,b){this.collection&&this.collection.options?this.options=_(this.collection.options).clone():this.options=_(b||{}).clone(),this.models&&_(this.models).each(_(function(a){a.options=_(this.options).clone()}).bind(this))},b&&!b.title&&(b.title="Base");return b}),Bones.initialize("model",function(a){var b;b=Backbone.Model.extend({url:function(){return this.options.basepath+"api/Tileset/"+this.id},toZXY:function(){var a=this.get("center")[2],b=this.get("center")[1]*Math.PI/180*-1,c=parseInt((this.get("center")[0]+180)/360*Math.pow(2,a)),d=parseInt((1-Math.log(Math.tan(b)+1/Math.cos(b))/Math.PI)/2*Math.pow(2,a));return[a,c,d]},thumb:function(a){a=a||this.toZXY();return this.get("tiles")[0].replace("{z}",a[0]).replace("{x}",a[1]).replace("{y}",a[2])},wax:function(){return{api:"mm",layers:[this.get("id")],center:this.get("center")}}}),b&&!b.title&&(b.title="Tileset");return b}),Bones.initialize("model",function(a){var b;b=Backbone.Collection.extend({model:a.Tileset,url:function(){return this.options.basepath+"api/Tileset"},comparator:function(a){return(a.get("name")||a.get("id")).toLowerCase()}}),b&&!b.title&&(b.title="Tilesets");return b}),Bones.initialize("view",function(a,b,c){var d;Backbone.View.prototype.events={"click a.route":"route"},Backbone.View.prototype.href=function(a){var b=$(a).get(0).getAttribute("href",2);return $.browser.msie&&$.browser.version<8?/^([a-z]+:\/\/.+?)?(\/.*?)$/.exec(b)[2]:b},Backbone.View.prototype.route=function(a){var b=_(a).isString()?a:this.href(a.currentTarget);if(b.charAt(0)==="/"){b=b.substr(req.query.basepath.length-1);var c=_.any(Backbone.history.handlers,function(a){if(a.route.test(b)){a.callback(b);return!0}});if(c){Backbone.history.saveLocation(b);return!1}}return!0},Backbone.View.prototype.toError=function(a){try{var b=JSON.parse(a.responseText);return b.message||b.error&&b.error.message||""}catch(b){return""}},d=Backbone.View.extend({initialize:function(a){_.bindAll(this,"render"),this.render().trigger("attach")},render:function(){$("body").attr("class",""),$("#app").html(this.options.view.el),this.options.view.trigger("ready");return this}}),d&&!d.title&&(d.title="App");return d}),Bones.initialize("view",function(a,b,c){var d;d=Backbone.View.extend({initialize:function(a){_.bindAll(this,"render"),this.render().trigger("attach")},render:function(){$(this.el).html(c.Error(this.options));return this}}),d&&!d.title&&(d.title="Error");return d}),Bones.initialize("view",function(a,b,c){var d;d=Backbone.View.extend({initialize:function(a){_.bindAll(this,"hud","show","hide")},events:_.extend({"click .buttons a":"hud"},Backbone.View.prototype.events),hud:function(a){var b=$(a.currentTarget),c=b.is(".active")?!1:b.attr("href").split("#").pop();this.hide(),c&&this.show(c);return!1},show:function(a){this.active=a,$(".buttons a[href=#"+a+"]").addClass("active"),this.$(".hud."+a).addClass("active"),$("body").addClass("hudActive"),$("body").addClass("hud"+a.charAt(0).toUpperCase()+a.slice(1));return this},hide:function(){this.$(".buttons .active").removeClass("active"),this.$(".hud.active").removeClass("active"),$("body").removeClass("hudActive"),this.active&&this.active.length>0&&($("body").removeClass("hud"+this.active.charAt(0).toUpperCase()+this.active.slice(1)),this.active="");return this}}),d.title="HUD",d&&!d.title&&(d.title="HUD");return d}),Bones.initialize("view",function(a,b,c){var d;d=b.HUD.extend({initialize:function(a){b.HUD.prototype.initialize.call(this,a),_.bindAll(this,"render","format"),this.render().trigger("attach")},format:function(a,b){switch(a){case"deg":return parseInt(b*100,10)/100;case"size":return Math.ceil(parseInt(b)/1048576)+" MB"}},render:function(){var a=_({breadcrumb:[{href:this.model.options.basepath+"map/"+this.model.get("id"),title:this.model.get("name")}],buttons:[{id:"info",title:"Info"}],basepath:this.model.options.basepath,format:this.format}).extend(this.model);this.model.get("download")&&a.buttons.push({id:"download",title:"Download"}),$(this.el).html(c.Map(a)),this.map=new b.MapClient({model:this.model}),this.bind("ready",this.map.ready),$(this.el).append(this.map.el);return this}}),d&&!d.title&&(d.title="Map");return d}),Bones.initialize("view",function(a,b,c){var d;d=Backbone.View.extend({className:"MapClient",id:"map",initialize:function(a){_.bindAll(this,"ready","record","mm","mmNav")},ready:function(){var a=this.generateWax();!!a.layers&&a.layers.length!==0&&$.ajax({dataType:"jsonp",url:this.waxURL(a),context:this,callback:"grid",callbackParameter:"callback",success:this.record,error:function(){}})},waxURL:function(a){return"http://"+this.model.options.uiHost+this.model.options.basepath+"api/wax.json?"+$.param(a)},generateWax:function(a){var b=this.model.wax();b.el=$(this.el).attr("id"),b.size&&delete b.size;return b},record:function(a){if(a&&a.wax){var b=this.generateWax().api;this.map=wax.Record(a.wax),_(this[b]).isFunction()&&this[b]()}},mm:function(){this.map.addCallback("zoomed",this.mmNav),this.map.addCallback("extentset",this.mmNav),this.mmNav()},mmNav:function(){!$(".zoom").size()||($(".zoom.active").removeClass("active"),$(".zoom-"+this.map.getZoom()).addClass("active"))}}),d&&!d.title&&(d.title="MapClient");return d}),Bones.initialize("view",function(a,b,c){var d;d=b.HUD.extend({initialize:function(a){b.HUD.prototype.initialize.call(this,a),_.bindAll(this,"render"),this.render().trigger("attach")},render:function(){$(this.el).html(c.Maps(_({maps:this.collection}).extend(this.options)));var a=this;return this}}),d&&!d.title&&(d.title="Maps");return d}),Bones.initialize("template",function(templates){var template;template=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>\n<html xmlns='http://www.w3.org/1999/xhtml'>\n  <head>\n    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>\n    <title> Kartenwerkstatt.at</title>\n    <script type='text/javascript'>\n    // Redirect requests without the hash.\n    var basepath = '",basepath,"';\n    location.href.indexOf('#') === -1 &&\n    window.location.pathname !== basepath &&\n    (window.location = basepath + '#!' + window.location.pathname.substr(basepath.length - 1));\n\n    // Server-side request info.\n    var req = { query: {\n        basepath: ",JSON.stringify(basepath),",\n        uiHost: ",JSON.stringify(uiHost),",\n        tileHost: ",JSON.stringify(tileHost),'\n    }};\n    </script>\n\n    <link rel=\'shortcut icon\' href=\'/assets/tilestream/images/favicon.ico\' type=\'image/x-icon\' />\n    <link rel=\'stylesheet\' href=\'/assets/tilestream/css/vendor.css\' type=\'text/css\'/>\n    <script src="/assets/bones/all.js" type="text/javascript" charset="utf-8"></script>\n    <script type="text/javascript">$(Bones.start);</script>\n    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" />\n    <meta name="apple-mobile-web-app-capable" content="yes" />\n    <link rel="apple-touch-icon-precomposed" href="/assets/tilestream/images/apple-touch-icon-57.png" />\n    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/tilestream/images/apple-touch-icon-72.png" />\n    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/tilestream/images/apple-touch-icon-114.png" />\n    <link rel="apple-touch-startup-image" href="/assets/tilestream/images/apple-touch-startup-image-1024.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)" />\n    <link rel="apple-touch-startup-image" href="/assets/tilestream/images/apple-touch-startup-image-768.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)" />\n  </head>\n  <body>\n    <div id=\'app\'>'),view&&print(view.html()),__p.push("</div>\n  </body>\n</html>\n");return __p.join("")},template&&!template.title&&(template.title="App");return template}),Bones.initialize("template",function(templates){var template;template=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push('<?xml version="1.0"?>\n<!-- http://a.tiles.mapbox.com/crossdomain.xml -->\n<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">\n<cross-domain-policy>\n  <allow-access-from domain="*"/>\n</cross-domain-policy>\n');return __p.join("")},template&&!template.title&&(template.title="CrossdomainXML");return template}),Bones.initialize("template",function(templates){var template;template=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("",this.Header(obj),"\n<div class='error'>\n  <div class='message'>",error,"</div>\n</div>");return __p.join("")},template&&!template.title&&(template.title="Error");return template}),Bones.initialize("template",function(templates){var template;template=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<div class='bleed'><div class='header'>\n  <h1 class='breadcrumb'>\n    <a class='route logo' href='",basepath,"'>\n      <span class='icon tilestream'></span>\n      Kartenwerkstatt.at\n    </a>\n    "),obj.breadcrumb&&_(obj.breadcrumb).each(function(a){__p.push("\n      <a class='route' href='",a.href,"'>",a.title.length>20?a.title.substring(0,17)+"...":a.title,"</a>\n    ")}),__p.push("\n  </h1>\n  <div class='buttons clearfix'>\n    "),obj.buttons&&_(obj.buttons).each(function(a){__p.push("\n      <a href='#",a.id,"'>\n        <span class='icon ",a.id,"'></span>\n        ",a.title,"\n      </a>\n    ")}),__p.push("\n  </div>\n</div></div>\n");return __p.join("")},template&&!template.title&&(template.title="Header");return template}),Bones.initialize("template",function(templates){var template;template=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<div class='download hud'>\n  <ul>\n    <li>\n      <h1>Download</h1>\n    </li>\n    <li>\n      <a class='download' href='",get("download"),"'>\n        <span class='icon'></span>\n        <span class='file'>",get("id"),".mbtiles</span>\n        <span class='size'>",format("size",get("filesize")),"</span>\n      </a>\n      <div class='description'>\n      Für die Benutzung mit der <a href='http://mapbox.com/#/ipad'>MapBox iPad App</a>, <a href='http://mapbox.com/#/tilestream'>TileStream</a>, <a href='http://tilestache.org/'>TileStache</a>, <a href='http://mapproxy.org/'>MapProxy</a> oder anderen Anwendungen, welche das <a href='http://www.mbtiles.org'>MBTiles</a> Format unterstützen. Die von Kartenwerkstatt.at verwendeten Stile sind über <a href='http://bitbucket.org/Atrawog/kartenwerkstatt.at'>Bitbucket</a><p> verfügbar.\n      <p>\n        For use with the <a href='http://mapbox.com/#/ipad'>MapBox iPad app</a>, <a href='http://mapbox.com/#/tilestream'>TileStream</a>, <a href='http://tilestache.org/'>TileStache</a>, <a href='http://mapproxy.org/'>MapProxy</a>  and applications that support the <a href='http://www.mbtiles.org'>MBTiles</a> format. Styles used by Kartenwerkstatt.at can be found at <a href='http://bitbucket.org/Atrawog/kartenwerkstatt.at'>Bitbucket</a>\n      </div>\n    </li>\n  </ul>\n</div>\n");return __p.join("")},template&&!template.title&&(template.title="HUDDownload");return template}),Bones.initialize("template",function(templates){var template;template=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<div class='info hud'>\n  <ul>\n    <li>\n      <h1>",get("name"),"</h1>\n      "),get("description")&&__p.push("\n        <div class='description'>",get("description"),"</div>\n      "),__p.push("\n    </li>\n    "),get("maxzoom")&&(__p.push("\n    <li>\n      <label>Zoom levels</label>\n      <div class='zooms clearfix'>\n      "),_(get("minzoom")).chain().range(get("maxzoom")+1).each(function(a){__p.push("\n        <span class='zoom zoom-",a,"'>",a,"</span>\n      ")}),__p.push("\n      </div>\n    </li>\n    ")),__p.push("\n    <li>\n      <label>Tile URL</label>\n      "),_(get("tiles")).each(function(a){__p.push("\n        <input class='text' type='text' value='",a,"' />\n      ")}),__p.push("\n    </li>\n    "),get("type")&&__p.push("\n      <li>\n        <label>Type</label>\n        ",get("type"),"\n      </li>\n    "),__p.push("\n    "),get("bounds")&&__p.push("\n      <li class='clearfix'>\n        <label>Bounds</label>\n        <div class='column'>\n          N: ",format("deg",get("bounds")[3]),"&deg;<br/>\n          S: ",format("deg",get("bounds")[1]),"&deg;\n        </div>\n        <div class='column'>\n          E: ",format("deg",get("bounds")[2]),"&deg;<br/>\n          W: ",format("deg",get("bounds")[0]),"&deg;\n        </div>\n      </li>\n    "),__p.push("\n  </ul>\n</div>\n");return __p.join("")},template&&!template.title&&(template.title="HUDInfo");return template}),Bones.initialize("template",function(templates){var template;template=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("",this.Header(obj),"\n",this.HUDInfo(obj),"\n",this.HUDDownload(obj),"\n");return __p.join("")},template&&!template.title&&(template.title="Map");return template}),Bones.initialize("template",function(templates){var template;template=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("",this.Header(obj),"\n<div class='maps clearfix'>\n  <!--\n    Inline markup is used here as IE7 does not support `display: inline-block`\n    well on block level elements. Ideally this would be a ul / li combo but\n    alas...\n  -->\n  "),obj.maps&&obj.maps.each(_(function(a){__p.push("\n  <span>",this.MapThumb(a),"</span>\n  ")}).bind(this)),__p.push("\n  "),(!obj.maps||!obj.maps.length)&&__p.push("\n  <span class='empty'><span>No maps found.</span></span>\n  "),__p.push("\n</div>\n");return __p.join("")},template&&!template.title&&(template.title="Maps");return template}),Bones.initialize("template",function(templates){var template;template=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<a class='thumb route' href='",options.basepath,"map/",get("id"),"'>\n  <span class='thumb-layer' style='background-image: url(",thumb(),")'></span>\n  <span class='thumb-name'>",get("name"),"</span>\n</a>\n");return __p.join("")},template&&!template.title&&(template.title="MapThumb");return template});if(!com){var com={};com.modestmaps||(com.modestmaps={})}(function(a){a.extend=function(a,b){for(var c in b.prototype)typeof a.prototype[c]=="undefined"&&(a.prototype[c]=b.prototype[c]);return a},a.cancelEvent=function(a){a.cancelBubble=!0,a.cancel=!0,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault();return!1},a.addEvent=function(a,b,c){a.attachEvent?(a["e"+b+c]=c,a[b+c]=function(){a["e"+b+c](window.event)},a.attachEvent("on"+b,a[b+c])):(a.addEventListener(b,c,!1),b=="mousewheel"&&a.addEventListener("DOMMouseScroll",c,!1))},a.removeEvent=function(a,b,c){a.detachEvent?(a.detachEvent("on"+b,a[b+c]),a[b+c]=null):(a.removeEventListener(b,c,!1),b=="mousewheel"&&a.removeEventListener("DOMMouseScroll",c,!1))},a.getStyle=function(a,b){if(a.currentStyle)var c=a.currentStyle[b];else if(window.getComputedStyle)var c=document.defaultView.getComputedStyle(a,null).getPropertyValue(b);return c},a.Point=function(a,b){this.x=parseFloat(a),this.y=parseFloat(b)},a.Point.prototype={x:0,y:0,toString:function(){return"("+this.x.toFixed(3)+", "+this.y.toFixed(3)+")"}},a.Point.distance=function(a,b){var c=b.x-a.x,d=b.y-a.y;return Math.sqrt(c*c+d*d)},a.Point.interpolate=function(b,c,d){var e=b.x+(c.x-b.x)*d,f=b.y+(c.y-b.y)*d;return new a.Point(e,f)},a.Coordinate=function(a,b,c){this.row=a,this.column=b,this.zoom=c},a.Coordinate.prototype={row:0,column:0,zoom:0,toString:function(){return"("+this.row.toFixed(3)+", "+this.column.toFixed(3)+" @"+this.zoom.toFixed(3)+")"},toKey:function(){return[Math.floor(this.zoom),Math.floor(this.column),Math.floor(this.row)].join(",")},copy:function(){return new a.Coordinate(this.row,this.column,this.zoom)},container:function(){return new a.Coordinate(Math.floor(this.row),Math.floor(this.column),Math.floor(this.zoom))},zoomTo:function(b){var c=Math.pow(2,b-this.zoom);return new a.Coordinate(this.row*c,this.column*c,b)},zoomBy:function(b){var c=Math.pow(2,b);return new a.Coordinate(this.row*c,this.column*c,this.zoom+b)},up:function(b){b===undefined&&(b=1);return new a.Coordinate(this.row-b,this.column,this.zoom)},right:function(b){b===undefined&&(b=1);return new a.Coordinate(this.row,this.column+b,this.zoom)},down:function(b){b===undefined&&(b=1);return new a.Coordinate(this.row+b,this.column,this.zoom)},left:function(b){b===undefined&&(b=1);return new a.Coordinate(this.row,this.column-b,this.zoom)}},a.Location=function(a,b){this.lat=parseFloat(a),this.lon=parseFloat(b)},a.Location.prototype={lat:0,lon:0,toString:function(){return"("+this.lat.toFixed(3)+", "+this.lon.toFixed(3)+")"}},a.Location.distance=function(a,b,c){c||(c=6378e3);var d=Math.PI/180,e=a.lat*d,f=a.lon*d,g=b.lat*d,h=b.lon*d,i=Math.cos(e)*Math.cos(f)*Math.cos(g)*Math.cos(h),j=Math.cos(e)*Math.sin(f)*Math.cos(g)*Math.sin(h),k=Math.sin(e)*Math.sin(g);return Math.acos(i+j+k)*c},a.Location.interpolate=function(b,c,d){var e=Math.PI/180,f=b.lat*e,g=b.lon*e,h=c.lat*e,i=c.lon*e,j=2*Math.asin(Math.sqrt(Math.pow(Math.sin((f-h)/2),2)+Math.cos(f)*Math.cos(h)*Math.pow(Math.sin((g-i)/2),2))),k=Math.atan2(Math.sin(g-i)*Math.cos(h),Math.cos(f)*Math.sin(h)-Math.sin(f)*Math.cos(h)*Math.cos(g-i))/-(Math.PI/180);k=k<0?360+k:k;var l=Math.sin((1-d)*j)/Math.sin(j),m=Math.sin(d*j)/Math.sin(j),n=l*Math.cos(f)*Math.cos(g)+m*Math.cos(h)*Math.cos(i),o=l*Math.cos(f)*Math.sin(g)+m*Math.cos(h)*Math.sin(i),p=l*Math.sin(f)+m*Math.sin(h),q=Math.atan2(p,Math.sqrt(Math.pow(n,2)+Math.pow(o,2))),r=Math.atan2(o,n);return new a.Location(q/e,r/e)},a.Transformation=function(a,b,c,d,e,f){this.ax=a,this.bx=b,this.cx=c,this.ay=d,this.by=e,this.cy=f},a.Transformation.prototype={ax:0,bx:0,cx:0,ay:0,by:0,cy:0,transform:function(b){return new a.Point(this.ax*b.x+this.bx*b.y+this.cx,this.ay*b.x+this.by*b.y+this.cy)},untransform:function(b){return new a.Point((b.x*this.by-b.y*this.bx-this.cx*this.by+this.cy*this.bx)/(this.ax*this.by-this.ay*this.bx),(b.x*this.ay-b.y*this.ax-this.cx*this.ay+this.cy*this.ax)/(this.bx*this.ay-this.by*this.ax))}},a.deriveTransformation=function(b,c,d,e,f,g,h,i,j,k,l,m){var n=a.linearSolution(b,c,d,f,g,h,j,k,l),o=a.linearSolution(b,c,e,f,g,i,j,k,m);return new a.Transformation(n[0],n[1],n[2],o[0],o[1],o[2])},a.linearSolution=function(a,b,c,d,e,f,g,h,i){a=parseFloat(a),b=parseFloat(b),c=parseFloat(c),d=parseFloat(d),e=parseFloat(e),f=parseFloat(f),g=parseFloat(g),h=parseFloat(h),i=parseFloat(i);var j=((f-i)*(b-e)-(c-f)*(e-h))/((d-g)*(b-e)-(a-d)*(e-h)),k=((f-i)*(a-d)-(c-f)*(d-g))/((e-h)*(a-d)-(b-e)*(d-g)),l=c-a*j-b*k;return[j,k,l]},a.Projection=function(b,c){c||(c=new a.Transformation(1,0,0,0,1,0)),this.zoom=b,this.transformation=c},a.Projection.prototype={zoom:0,transformation:null,rawProject:function(a){throw"Abstract method not implemented by subclass."},rawUnproject:function(a){throw"Abstract method not implemented by subclass."},project:function(a){a=this.rawProject(a),this.transformation&&(a=this.transformation.transform(a));return a},unproject:function(a){this.transformation&&(a=this.transformation.untransform(a)),a=this.rawUnproject(a);return a},locationCoordinate:function(b){var c=new a.Point(Math.PI*b.lon/180,Math.PI*b.lat/180);c=this.project(c);return new a.Coordinate(c.y,c.x,this.zoom)},coordinateLocation:function(b){b=b.zoomTo(this.zoom);var c=new a.Point(b.column,b.row);c=this.unproject(c);return new a.Location(180*c.y/Math.PI,180*c.x/Math.PI)}},a.LinearProjection=function(b,c){a.Projection.call(this,b,c)},a.LinearProjection.prototype={rawProject:function(b){return new a.Point(b.x,b.y)},rawUnproject:function(b){return new a.Point(b.x,b.y)}},a.extend(a.LinearProjection,a.Projection),a.MercatorProjection=function(b,c){a.Projection.call(this,b,c)},a.MercatorProjection.prototype={rawProject:function(b){return new a.Point(b.x,Math.log(Math.tan(.25*Math.PI+.5*b.y)))},rawUnproject:function(b){return new a.Point(b.x,2*Math.atan(Math.pow(Math.E,b.y))-.5*Math.PI)}},a.extend(a.MercatorProjection,a.Projection),a.MapProvider=function(a){a&&(this.getTileUrl=a)},a.MapProvider.prototype={projection:new a.MercatorProjection(0,a.deriveTransformation(-Math.PI,Math.PI,0,0,Math.PI,Math.PI,1,0,-Math.PI,-Math.PI,0,1)),tileWidth:256,tileHeight:256,topLeftOuterLimit:new a.Coordinate(0,0,0),bottomRightInnerLimit:(new a.Coordinate(1,1,0)).zoomTo(18),getTileUrl:function(a){throw"Abstract method not implemented by subclass."},locationCoordinate:function(a){return this.projection.locationCoordinate(a)},coordinateLocation:function(a){return this.projection.coordinateLocation(a)},outerLimits:function(){return[this.topLeftOuterLimit.copy(),this.bottomRightInnerLimit.copy()]},setZoomRange:function(a,b){this.topLeftOuterLimit=this.topLeftOuterLimit.zoomTo(a),this.bottomRightInnerLimit=this.bottomRightInnerLimit.zoomTo(b)},sourceCoordinate:function(b){var c=this.topLeftOuterLimit.zoomTo(b.zoom),d=this.bottomRightInnerLimit.zoomTo(b.zoom),e=d.row-c.row;if(b.row<0|b.row>=e)return null;var f=d.column-c.column,g=b.column%f;while(g<0)g+=f;return new a.Coordinate(b.row,g,b.zoom)}},a.TemplatedMapProvider=function(b,c){a.MapProvider.call(this,function(a){a=this.sourceCoordinate(a);if(!a)return null;var d=b;if(c&&c.length&&d.indexOf("{S}")>=0){var e=parseInt(a.zoom+a.row+a.column,10)%c.length;d=d.replace("{S}",c[e])}return d.replace("{Z}",a.zoom.toFixed(0)).replace("{X}",a.column.toFixed(0)).replace("{Y}",a.row.toFixed(0))})},a.extend(a.TemplatedMapProvider,a.MapProvider),a.getMousePoint=function(b,c){var d=new a.Point(b.clientX,b.clientY);d.x+=document.body.scrollLeft+document.documentElement.scrollLeft,d.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var e=c.parent;e;e=e.offsetParent)d.x-=e.offsetLeft,d.y-=e.offsetTop;return d},a.MouseWheelHandler=function(a){a!==undefined&&this.init(a)},a.MouseWheelHandler.prototype={init:function(b){this.map=b,a.addEvent(b.parent,"mousewheel",this.getMouseWheel())},mouseWheelHandler:null,getMouseWheel:function(){if(!this.mouseWheelHandler){var b=this,c=(new Date).getTime();this.mouseWheelHandler=function(d){var e=0;d.wheelDelta?e=d.wheelDelta:d.detail&&(e=-d.detail);var f=(new Date).getTime()-c;if(Math.abs(e)>0&&f>200){var g=a.getMousePoint(d,b.map);b.map.zoomByAbout(e>0?1:-1,g),c=(new Date).getTime()}return a.cancelEvent(d)}}return this.mouseWheelHandler}},a.DoubleClickHandler=function(a){a!==undefined&&this.init(a)},a.DoubleClickHandler.prototype={init:function(b){this.map=b,a.addEvent(b.parent,"dblclick",this.getDoubleClick())},doubleClickHandler:null,getDoubleClick:function(){if(!this.doubleClickHandler){var b=this;this.doubleClickHandler=function(c){var d=a.getMousePoint(c,b.map);b.map.zoomByAbout(c.shiftKey?-1:1,d);return a.cancelEvent(c)}}return this.doubleClickHandler}},a.DragHandler=function(a){a!==undefined&&this.init(a)},a.DragHandler.prototype={init:function(b){this.map=b,a.addEvent(b.parent,"mousedown",this.getMouseDown())},mouseDownHandler:null,getMouseDown:function(){if(!this.mouseDownHandler){var b=this;this.mouseDownHandler=function(c){a.addEvent(document,"mouseup",b.getMouseUp()),a.addEvent(document,"mousemove",b.getMouseMove()),b.prevMouse=new a.Point(c.clientX,c.clientY),b.map.parent.style.cursor="move";return a.cancelEvent(c)}}return this.mouseDownHandler},mouseMoveHandler:null,getMouseMove:function(){if(!this.mouseMoveHandler){var b=this;this.mouseMoveHandler=function(c){b.prevMouse&&(b.map.panBy(c.clientX-b.prevMouse.x,c.clientY-b.prevMouse.y),b.prevMouse.x=c.clientX,b.prevMouse.y=c.clientY);return a.cancelEvent(c)}}return this.mouseMoveHandler},mouseUpHandler:null,getMouseUp:function(){if(!this.mouseUpHandler){var b=this;this.mouseUpHandler=function(c){a.removeEvent(document,"mouseup",b.getMouseUp()),a.removeEvent(document,"mousemove",b.getMouseMove()),b.prevMouse=null,b.map.parent.style.cursor="";return a.cancelEvent(c)}}return this.mouseUpHandler}},a.MouseHandler=function(a){a!==undefined&&this.init(a)},a.MouseHandler.prototype={init:function(b){this.map=b,new a.DragHandler(b),new a.DoubleClickHandler(b),new a.MouseWheelHandler(b)}},a.TouchHandler=function(){},a.TouchHandler.prototype={maxTapTime:150,maxTapDistance:10,maxDoubleTapDelay:350,events:[],taps:[],init:function(b){this.map=b,a.addEvent(b.parent,"touchstart",this.getTouchStartMachine()),a.addEvent(b.parent,"touchmove",this.getTouchMoveMachine()),a.addEvent(b.parent,"touchend",this.getTouchEndMachine())},interruptTouches:function(a){var b=(new Date).getTime();for(var c=0;c<a.length;c+=1){var d=a[c].touch;a[c]={screenX:d.screenX,screenY:d.screenY,touch:d,time:b,start:null,count:0,travel:0},a[c].start=a[c]}},sameTouch:function(a,b){return a&&a.touch&&b.identifier==a.touch.identifier},distance:function(a,b){return Math.sqrt(Math.pow(a.screenX-b.screenX,2)+Math.pow(a.screenY-b.screenY,2))},oneTouchMatrix:function(a){var b=a.start,c=a.screenX-b.screenX,d=a.screenY-b.screenY;return[1,0,0,1,c,d]},twoTouchMatrix:function(a,b){var c=a.start,d=b.start,e=this.distance(a,b),f=this.distance(c,d),g=e/f,h=(a.screenX+b.screenX)/2,i=(a.screenY+b.screenY)/2,j=(c.screenX+d.screenX)/2,k=(c.screenY+d.screenY)/2,l=g*-j+h,m=g*-k+i;return[g,0,0,g,l,m]},getTouchStartMachineHandler:null,getTouchStartMachine:function(){if(!this.getTouchStartMachineHandler){var b=this,c=this.events;this.getTouchStartMachineHandler=function(d){b.interruptTouches(c);for(var e=0;e<d.changedTouches.length;e+=1){var f=d.changedTouches[e],g={screenX:f.screenX,screenY:f.screenY,touch:f,time:(new Date).getTime(),start:null,count:0,travel:0};g.start=g,c.push(g)}return a.cancelEvent(d)}}return this.getTouchStartMachineHandler},getTouchStartMachineHandler:null,getTouchMoveMachine:function(){if(!this.getTouchMoveMachineHandler){var b=this,c=this.events;this.getTouchMoveMachineHandler=function(d){var e=(new Date).getTime();for(var f=0,g=d.changedTouches[f];f<d.changedTouches.length;f+=1)for(var h=0;h<c.length;h+=1)if(b.sameTouch(c[h],g)){var i={screenX:g.screenX,screenY:g.screenY,touch:g,time:e,start:null,count:c[h].count+1,travel:c[h].travel+b.distance(g,c[h])};i.start=c[h].start,c[h]=i}c.length===1?b.onPanning(c[0]):c.length===2&&b.onPinching(c[0],c[1]);return a.cancelEvent(d)}}return this.getTouchMoveMachineHandler},getTouchEndMachineHandler:null,getTouchEndMachine:function(){if(!this.getTouchEndMachineHandler){var b=this,c=this.events;this.getTouchEndMachineHandler=function(d){var e=(new Date).getTime();c.length===1?b.onPanned(c[0]):c.length===2&&b.onPinched(c[0],c[1]);for(var f=0;f<d.changedTouches.length;f+=1){var g=d.changedTouches[f];for(var h=0;h<c.length;h+=1)if(b.sameTouch(c[h],g)){var i={screenX:g.screenX,screenY:g.screenY,touch:g,time:e,start:c[h].start,count:c[h].count+1,travel:c[h].travel+b.distance(g,c[h]),last:c[h]};c.splice(h,1),h-=1;var j=e-i.start.time;i.travel>b.maxTapDistance||(j>b.maxTapTime?b.onHold({x:g.screenX,y:g.screenY,end:e,duration:j}):b.onTap({x:g.screenX,y:g.screenY,time:e}))}}b.interruptTouches(c),d.touches.length===0&&c.length>=1&&c.splice(0,c.length);return a.cancelEvent(d)}}return this.getTouchEndMachineHandler},onHold:function(a){},onTap:function(a){this.taps.length&&a.time-this.taps[0].time<this.maxDoubleTapDelay?this.onDoubleTap(a):this.taps=[a]},onDoubleTap:function(b){var c=Math.floor(this.map.getZoom()+2);c=c-this.map.getZoom();var d=new a.Point(b.x,b.y);this.map.zoomByAbout(c,d)},onPanning:function(a){var b=this.oneTouchMatrix(a);b=["1","0","0","0","0","1","0","0","0","0","1","0",b[4].toFixed(0),b[5].toFixed(0),"0","1"],b="matrix3d("+b.join(", ")+")",this.map.parent.style.webkitTransformOrigin="0px 0px",this.map.parent.style.webkitTransform=b},onPanned:function(a){var b=this.oneTouchMatrix(a);this.map.panBy(b[4],b[5]),this.map.parent.style.webkitTransform=""},onPinching:function(a,b){var c=this.twoTouchMatrix(a,b);c=[c[0].toFixed(3),"0","0","0","0",c[3].toFixed(3),"0","0","0","0","1","0",c[4].toFixed(0),c[5].toFixed(0),"0","1"],c="matrix3d("+c.join(", ")+")",this.map.parent.style.webkitTransformOrigin="0px 0px",this.map.parent.style.webkitTransform=c},onPinched:function(b,c){var d=this.twoTouchMatrix(b,c),e=Math.log(d[0])/Math.log(2),f=new a.Point(0,0);this.map.zoomByAbout(e,f).panBy(d[4],d[5]),this.map.parent.style.webkitTransform=""}},a.CallbackManager=function(a,b){this.owner=a,this.callbacks={};for(var c=0;c<b.length;c++)this.callbacks[b[c]]=[]},a.CallbackManager.prototype={owner:null,callbacks:null,addCallback:function(a,b){typeof b=="function"&&this.callbacks[a]&&this.callbacks[a].push(b)},removeCallback:function(a,b){if(typeof b=="function"&&this.callbacks[a]){var c=this.callbacks[a],d=c.length;for(var e=0;e<d;e++)if(c[e]===b){c.splice(e,1);break}}},dispatchCallback:function(a,b){if(this.callbacks[a])for(var c=0;c<this.callbacks[a].length;c+=1)try{this.callbacks[a][c](this.owner,b)}catch(d){}}},a.RequestManager=function(b){this.loadingBay=document.createDocumentFragment(),this.requestsById={},this.openRequestCount=0,this.maxOpenRequests=4,this.requestQueue=[],this.callbackManager=new a.CallbackManager(this,["requestcomplete"])},a.RequestManager.prototype={loadingBay:null,requestsById:null,requestQueue:null,openRequestCount:null,maxOpenRequests:null,callbackManager:null,addCallback:function(a,b){this.callbackManager.addCallback(a,b)},removeCallback:function(a,b){this.callbackManager.removeCallback(a,b)},dispatchCallback:function(a,b){this.callbackManager.dispatchCallback(a,b)},clear:function(){this.clearExcept({})},clearExcept:function(a){for(var b=0;b<this.requestQueue.length;b++){var c=this.requestQueue[b];c&&!(c.key in a)&&(this.requestQueue[b]=null)}var d=this.loadingBay.childNodes;for(var e=d.length-1;e>=0;e--){var f=d[e];f.id in a||(this.loadingBay.removeChild(f),this.openRequestCount--,f.src=f.coord=f.onload=f.onerror=null)}for(var g in this.requestsById)if(this.requestsById.hasOwnProperty(g)&&!(g in a)){var c=this.requestsById[g];delete this.requestsById[g],c!==null&&(c=c.key=c.coord=c.url=null)}},hasRequest:function(a){return a in this.requestsById},requestTile:function(a,b,c){if(!(a in this.requestsById)){var d={key:a,coord:b.copy(),url:c};this.requestsById[a]=d,c&&this.requestQueue.push(d)}},getProcessQueue:function(){if(!this._processQueue){var a=this;this._processQueue=function(){a.processQueue()}}return this._processQueue},processQueue:function(a){a&&this.requestQueue.length>8&&this.requestQueue.sort(a);while(this.openRequestCount<this.maxOpenRequests&&this.requestQueue.length>0){var b=this.requestQueue.pop();if(b){this.openRequestCount++;var c=document.createElement("img");c.id=b.key,c.style.position="absolute",c.coord=b.coord,this.loadingBay.appendChild(c),c.onload=c.onerror=this.getLoadComplete(),c.src=b.url,b=b.key=b.coord=b.url=null}}},_loadComplete:null,getLoadComplete:function(){if(!this._loadComplete){var a=this;this._loadComplete=function(c){c=c||window.event;var d=c.srcElement||c.target;d.onload=d.onerror=null,a.loadingBay.removeChild(d),a.openRequestCount--,delete a.requestsById[d.id],c.type==="load"&&(d.complete||d.readyState&&d.readyState=="complete")?a.dispatchCallback("requestcomplete",d):d.src=null,setTimeout(a.getProcessQueue(),0)}}return this._loadComplete}},a.Map=function(b,c,d,e){if(typeof b=="string"){b=document.getElementById(b);if(!b)throw"The ID provided to modest maps could not be found."}this.parent=b,this.parent.style.padding="0",this.parent.style.overflow="hidden";var f=a.getStyle(this.parent,"position");f!="relative"&&f!="absolute"&&(this.parent.style.position="relative");if(!d){var g=this.parent.offsetWidth,h=this.parent.offsetHeight;g||(g=640,this.parent.style.width=g+"px"),h||(h=480,this.parent.style.height=h+"px"),d=new a.Point(g,h);var i=this;a.addEvent(window,"resize",function(b){i.dimensions=new a.Point(i.parent.offsetWidth,i.parent.offsetHeight),i.draw(),i.dispatchCallback("resized",[i.dimensions])})}else this.parent.style.width=Math.round(d.x)+"px",this.parent.style.height=Math.round(d.y)+"px";this.dimensions=d,this.requestManager=new a.RequestManager(this.parent),this.requestManager.addCallback("requestcomplete",this.getTileComplete()),this.layers={},this.layerParent=document.createElement("div"),this.layerParent.id=this.parent.id+"-layers",this.layerParent.style.cssText="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; margin: 0; padding: 0; z-index: 0",this.parent.appendChild(this.layerParent),this.coordinate=new a.Coordinate(.5,.5,0),this.setProvider(c),this.enablePyramidLoading=!1,this.callbackManager=new a.CallbackManager(this,["zoomed","panned","centered","extentset","resized","drawn"]);if(e===undefined)this.eventHandlers=[],this.eventHandlers.push(new a.MouseHandler(this));else{this.eventHandlers=e;if(e instanceof Array)for(var j=0;j<e.length;j++)e[j].init(this)}},a.Map.prototype={parent:null,provider:null,dimensions:null,coordinate:null,tiles:null,layers:null,layerParent:null,requestManager:null,tileCacheSize:null,maxTileCacheSize:null,recentTiles:null,recentTilesById:null,callbackManager:null,eventHandlers:null,toString:function(){return"Map(#"+this.parent.id+")"},addCallback:function(a,b){this.callbackManager.addCallback(a,b)},removeCallback:function(a,b){this.callbackManager.removeCallback(a,b)},dispatchCallback:function(a,b){this.callbackManager.dispatchCallback(a,b)},zoomBy:function(a){this.coordinate=this.coordinate.zoomBy(a),this.draw(),this.dispatchCallback("zoomed",a);return this},zoomIn:function(){return this.zoomBy(1)},zoomOut:function(){return this.zoomBy(-1)},setZoom:function(a){return this.zoomBy(a-this.coordinate.zoom)},zoomByAbout:function(a,b){var c=this.pointLocation(b);this.zoomBy(a);var d=this.locationPoint(c);return this.panBy(b.x-d.x,b.y-d.y)},panBy:function(a,b){this.coordinate.column-=a/this.provider.tileWidth,this.coordinate.row-=b/this.provider.tileHeight,this.draw(),this.dispatchCallback("panned",[a,b]);return this},panLeft:function(){return this.panBy(100,0)},panRight:function(){return this.panBy(-100,0)},panDown:function(){return this.panBy(0,-100)},panUp:function(){return this.panBy(0,100)},setCenter:function(a){return this.setCenterZoom(a,this.coordinate.zoom)},setCenterZoom:function(a,b){this.coordinate=this.provider.locationCoordinate(a).zoomTo(parseFloat(b)||0),this.draw(),this.dispatchCallback("centered",[a,b]);return this},setExtent:function(b){var c,d;for(var e=0;e<b.length;e++){var f=this.provider.locationCoordinate(b[e]);c?(c.row=Math.min(c.row,f.row),c.column=Math.min(c.column,f.column),c.zoom=Math.min(c.zoom,f.zoom),d.row=Math.max(d.row,f.row),d.column=Math.max(d.column,f.column),d.zoom=Math.max(d.zoom,f.zoom)):(c=f.copy(),d=f.copy())}var g=this.dimensions.x+1,h=this.dimensions.y+1,i=(d.column-c.column)/(g/this.provider.tileWidth),j=Math.log(i)/Math.log(2),k=c.zoom-Math.ceil(j),l=(d.row-c.row)/(h/this.provider.tileHeight),m=Math.log(l)/Math.log(2),n=c.zoom-Math.ceil(m),o=Math.min(k,n);o=Math.min(o,this.provider.outerLimits()[1].zoom),o=Math.max(o,this.provider.outerLimits()[0].zoom);var p=(c.row+d.row)/2,q=(c.column+d.column)/2,r=c.zoom;this.coordinate=(new a.Coordinate(p,q,r)).zoomTo(o),this.draw(),this.dispatchCallback("extentset",b);return this},setSize:function(b,c){b.hasOwnProperty("x")&&b.hasOwnProperty("y")?this.dimensions=b:c!==undefined&&!isNaN(c)&&(this.dimensions=new a.Point(b,c)),this.parent.style.width=Math.round(this.dimensions.x)+"px",this.parent.style.height=Math.round(this.dimensions.y)+"px",this.draw(),this.dispatchCallback("resized",[this.dimensions]);return this},coordinatePoint:function(b){b.zoom!=this.coordinate.zoom&&(b=b.zoomTo(this.coordinate.zoom));var c=new a.Point(this.dimensions.x/2,this.dimensions.y/2);c.x+=this.provider.tileWidth*(b.column-this.coordinate.column),c.y+=this.provider.tileHeight*(b.row-this.coordinate.row);return c},pointCoordinate:function(a){var b=this.coordinate.copy();b.column+=(a.x-this.dimensions.x/2)/this.provider.tileWidth,b.row+=(a.y-this.dimensions.y/2)/this.provider.tileHeight;return b},locationPoint:function(a){return this.coordinatePoint(this.provider.locationCoordinate(a))},pointLocation:function(a){return this.provider.coordinateLocation(this.pointCoordinate(a))},getExtent:function(){var b=[];b.push(this.pointLocation(new a.Point(0,0))),b.push(this.pointLocation(this.dimensions));return b},getCenter:function(){return this.provider.coordinateLocation(this.coordinate)},getZoom:function(){return this.coordinate.zoom},setProvider:function(a){var b=!1;this.provider===null&&(b=!0);if(!b){this.requestManager.clear();for(var c in this.layers)if(this.layers.hasOwnProperty(c)){var d=this.layers[c];while(d.firstChild)d.removeChild(d.firstChild)}}this.tiles={},this.tileCacheSize=0,this.maxTileCacheSize=64,this.recentTiles=[],this.recentTilesById={},this.provider=a,b||this.draw();return this},enforceLimits:function(a){a=a.copy();var b=this.provider.outerLimits();if(b){var c=b[0].zoom,d=b[1].zoom;a.zoom<c?a=a.zoomTo(c):a.zoom>d&&(a=a.zoomTo(d))}return a},draw:function(){this.coordinate=this.enforceLimits(this.coordinate);var b=Math.round(this.coordinate.zoom),c=this.pointCoordinate(new a.Point(0,0)).zoomTo(b).container(),d=this.pointCoordinate(this.dimensions).zoomTo(b).container().right().down(),e=0;e&&(c=c.left(e).up(e),d=d.right(e).down(e));var f={},g=this.createOrGetLayer(c.zoom),h=c.copy();for(h.column=c.column;h.column<=d.column;h.column+=1)for(h.row=c.row;h.row<=d.row;h.row+=1){var i=h.toKey();f[i]=!0;if(i in this.tiles){var j=this.tiles[i];j.parentNode!=g&&g.appendChild(j)}else{if(!this.requestManager.hasRequest(i)){var k=this.provider.getTileUrl(h);this.requestManager.requestTile(i,h,k)}var l=!1,m=h.zoom;for(var n=1;n<=m;n++){var o=h.zoomBy(-n).container(),p=o.toKey();if(this.enablePyramidLoading){f[p]=!0;var q=this.createOrGetLayer(o.zoom);if(p in this.tiles){var r=this.tiles[p];r.parentNode!=q&&q.appendChild(r)}else if(!this.requestManager.hasRequest(p)){var k=this.provider.getTileUrl(o);this.requestManager.requestTile(p,o,k)}}else if(p in this.tiles){f[p]=!0,l=!0;break}}if(!l&&!this.enablePyramidLoading){var s=h.zoomBy(1);f[s.toKey()]=!0,s.column+=1,f[s.toKey()]=!0,s.row+=1,f[s.toKey()]=!0,s.column-=1,f[s.toKey()]=!0}}}for(var t in this.layers)if(this.layers.hasOwnProperty(t)){var u=parseInt(t,10);if(u>=c.zoom-5&&u<c.zoom+2)continue;var v=this.layers[t];v.style.display="none";var w=v.getElementsByTagName("img");for(var x=w.length-1;x>=0;x--)v.removeChild(w[x])}var y=(new Date).getTime(),z=c.zoom-5,A=c.zoom+2;for(var B=z;B<A;B++){var v=this.layers[B];if(!v)continue;var C=1,D=this.coordinate.copy();v.childNodes.length>0?(v.style.display="block",C=Math.pow(2,this.coordinate.zoom-B),D=D.zoomTo(B)):v.style.display="none";var E=this.provider.tileWidth*C,F=this.provider.tileHeight*C,G=new a.Point(this.dimensions.x/2,this.dimensions.y/2),w=v.getElementsByTagName("img");for(var x=w.length-1;x>=0;x--){var j=w[x];if(!f[j.id])v.removeChild(j);else{var H=G.x+(j.coord.column-D.column)*E,I=G.y+(j.coord.row-D.row)*F;j.style.left=Math.round(H)+"px",j.style.top=Math.round(I)+"px",j.style.width=Math.ceil(E)+"px",j.style.height=Math.ceil(F)+"px",this.recentTilesById[j.id].lastTouchedTime=y}}}this.requestManager.clearExcept(f),this.requestManager.processQueue(this.getCenterDistanceCompare()),this.checkCache(),this.dispatchCallback("drawn")},_tileComplete:null,getTileComplete:function(){if(!this._tileComplete){var a=this;this._tileComplete=function(c,d){a.tiles[d.id]=d,a.tileCacheSize++;var e={id:d.id,lastTouchedTime:(new Date).getTime()};a.recentTilesById[d.id]=e,a.recentTiles.push(e);var f=a.coordinate.zoomTo(d.coord.zoom),g=Math.pow(2,a.coordinate.zoom-d.coord.zoom),h=a.dimensions.x/2+(d.coord.column-f.column)*a.provider.tileWidth*g,i=a.dimensions.y/2+(d.coord.row-f.row)*a.provider.tileHeight*g;d.style.left=Math.round(h)+"px",d.style.top=Math.round(i)+"px",d.style.width=Math.ceil(a.provider.tileWidth*g)+"px",d.style.height=Math.ceil(a.provider.tileHeight*g)+"px";var j=a.layers[d.coord.zoom];j.appendChild(d),d.className="map-tile-loaded",Math.round(a.coordinate.zoom)==d.coord.zoom&&(j.style.display="block"),a.requestRedraw()}}return this._tileComplete},_redrawTimer:undefined,requestRedraw:function(){this._redrawTimer||(this._redrawTimer=setTimeout(this.getRedraw(),1e3))},_redraw:null,getRedraw:function(){if(!this._redraw){var a=this;this._redraw=function(){a.draw(),a._redrawTimer=0}}return this._redraw},createOrGetLayer:function(a){if(a in this.layers)return this.layers[a];var b=document.createElement("div");b.id=this.parent.id+"-zoom-"+a,b.style.cssText=this.layerParent.style.cssText,b.style.zIndex=a,this.layerParent.appendChild(b),this.layers[a]=b;return b},checkCache:function(){var a=this.parent.getElementsByTagName("img").length,b=Math.max(a,this.maxTileCacheSize);this.tileCacheSize>b&&this.recentTiles.sort(function(a,b){return b.lastTouchedTime<a.lastTouchedTime?-1:b.lastTouchedTime>a.lastTouchedTime?1:0});while(this.tileCacheSize>b){var c=this.recentTiles.pop(),d=(new Date).getTime();delete this.recentTilesById[c.id];var e=this.tiles[c.id];e.parentNode?alert("Gah: trying to removing cached tile even though it's still in the DOM"):(delete this.tiles[c.id],this.tileCacheSize--)}},getCenterDistanceCompare:function(){var a=this.coordinate.zoomTo(Math.round(this.coordinate.zoom));return function(c,d){if(c&&d){var e=c.coord,f=d.coord;if(e.zoom==f.zoom){var g=Math.abs(a.row-e.row-.5)+Math.abs(a.column-e.column-.5),h=Math.abs(a.row-f.row-.5)+Math.abs(a.column-f.column-.5);return g<h?1:g>h?-1:0}return e.zoom<f.zoom?1:e.zoom>f.zoom?-1:0}return c?1:d?-1:0}}},typeof module!="undefined"&&module.exports&&(module.exports={Point:a.Point,Projection:a.Projection,MercatorProjection:a.MercatorProjection,LinearProjection:a.LinearProjection,Transformation:a.Transformation,Location:a.Location,MapProvider:a.MapProvider,TemplatedMapProvider:a.TemplatedMapProvider,Coordinate:a.Coordinate})})(com.modestmaps),!function(window){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText,JSON;switch(type){case"json":resp=JSON?JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var d=xhr();d.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(d,a),d.onreadystatechange=readyState(d,b,c),a.before&&a.before(d),d.send(a.data||null);return d}var e=doc.createElement("script");window[getCallbackName(a)]=generalCallback,e.type="text/javascript",e.src=a.url,e.async=!0;var f=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(e)};e.onload=f,e.onreadystatechange=function(){/^loaded|complete$/.test(e.readyState)&&f()},head.appendChild(e)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this);var wax=wax||{};Array.prototype.reduce||(Array.prototype.reduce=function(a){"use strict";if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;if(c==0&&arguments.length==1)throw new TypeError;var d=0,e;if(arguments.length>=2)e=arguments[1];else do{if(d in b){e=b[d++];break}if(++d>=c)throw new TypeError}while(!0);while(d<c)d in b&&(e=a.call(undefined,e,b[d],d,b)),d++;return e}),wax.Record=function(a,b){var c=function(a,b){var c=a.split(".").reduce(function(a,b){return[a[1]||a[0],a[1]?a[1][b]:a[0][b]]},[b||window,null]);if(c[0]&&c[1])return c;throw a+" not found."},d=function(a,b){var d=c(a),e;b=b.length?wax.Record(b):[];if(Object.create)e=Object.create(d[1].prototype),d[1].apply(e,b);else switch(b.length){case 0:e=new d[1];break;case 1:e=new d[1](b[0]);break;case 2:e=new d[1](b[0],b[1]);break;case 3:e=new d[1](b[0],b[1],b[2]);break;case 4:e=new d[1](b[0],b[1],b[2],b[3]);break;case 5:e=new d[1](b[0],b[1],b[2],b[3],b[4]);break;default:}return e},e=function(a,b,d){var e=c(a,d),f=b.length?wax.Record(b):[];return d&&a.indexOf(".")===-1?e[1].apply(d,f):e[1].apply(e[0],f)},f=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@literal","@chain","@inject","@group"],a.split(" ")[0])!==-1},g=function(a){return wax.util.isString(a)&&wax.util.indexOf(["@new","@call","@chain"],a.split(" ")[0])!==-1},h=function(a){return wax.util.isArray(a)&&a[0]&&f(a[0])?{verb:a[0].split(" ")[0],subject:a[0].split(" ")[1],object:a.slice(1)}:!1},i,j=!1,k=null,l=null,m=h(a);if(!m){if(a!==null&&typeof a=="object"){var n=wax.util.keys(a);for(i=0;i<n.length;i++){var o=n[i];a[o]=wax.Record(a[o],b)}return a}return a}switch(m.verb){case"@group":for(i=0;i<m.object.length;i++)k=wax.Record(m.object[i],b),l=h(m.object[i]),l&&g(l.verb)&&(b=k);return b;case"@new":return d(m.subject,m.object);case"@literal":j=c(m.subject);return j?j[1]:null;case"@inject":return e(m.subject,m.object,b);case"@chain":return e(m.subject,m.object,b);case"@call":return e(m.subject,m.object,null)}},wax=wax||{},wax.attribution=function(){var a,b={};b.set=function(b){if(typeof b!="undefined"){a.innerHTML=b;return this}},b.element=function(){return a},b.init=function(){a=document.createElement("div"),a.className="wax-attribution";return this};return b.init()},wax.formatter=function(x){var formatter={},f;if(x&&typeof x=="string")try{eval("f = "+x)}catch(e){console&&console.log(e)}else x&&typeof x=="function"?f=x:f=function(){};formatter.format=function(a,b){try{return f(a,b)}catch(c){console&&console.log(c)}};return formatter},wax.GridInstance=function(a,b,c){function d(a){a>=93&&a--,a>=35&&a--,a-=32;return a}c=c||{};var e={},f=c.resolution||4;tileSize=c.tileSize||256,e.getFeature=function(c,e,g,h){if(!!a&&!!a.grid){var i=wax.util.offset(g),j=i.left,k=i.top,l=i.width/tileSize*f;if(e-k<0||c-j<0)return;if(Math.floor(e-k)>tileSize||Math.floor(c-j)>tileSize)return;var m=a.grid[Math.floor((e-k)/l)].charCodeAt(Math.floor((c-j)/l));m=d(m);if(a.keys[m]&&a.data[a.keys[m]])return b.format(h,a.data[a.keys[m]])}};return e},wax.GridManager=function(a){function c(a,b){if(typeof g!="undefined")return b(null,g);wax.request.get(h(a),function(a,c){c&&c.formatter?g=wax.formatter(c.formatter):g=!1;return b(a,g)})}function b(a){typeof a=="string"&&(a=[a]);return function b(b){if(!!b){var c=/(\d+)\/(\d+)\/(\d+)\.[\w\._]+/g.exec(b);if(!c)return;return a[parseInt(c[2],10)%a.length].replace("{z}",c[1]).replace("{x}",c[2]).replace("{y}",c[3])}}}a=a||{};var d=a.resolution||4,e={},f={},g,h=function(a){return a.replace(/\d+\/\d+\/\d+\.\w+/,"layer.json")},i=function(a){return a.replace(/(\.png|\.jpg|\.jpeg)(\d*)/,".grid.json")};f.formatter=function(a){if(!arguments.length)return g;g=wax.formatter(a);return f},f.formatterUrl=function(a){if(!arguments.length)return h;h=typeof a=="string"?function(){return a}:a;return f},f.gridUrl=function(a){if(!arguments.length)return i;i=typeof a=="function"?a:b(a);return f},f.getGrid=function(a,b){c(a,function(c,e){var f=i(a);if(c||!e||!f)return b(c,null);wax.request.get(f,function(a,c){if(a)return b(a,null);b(null,wax.GridInstance(c,e,{resolution:d||4}))})});return f},a.formatter&&f.formatter(a.formatter),a.grids&&f.gridUrl(a.grids);return f};var wax=wax||{};wax.legend=function(){var a,b={},c;b.element=function(){return c},b.content=function(b){if(!arguments.length)return a.innerHTML;b?(a.innerHTML=b,a.style.display="block"):(a.innerHTML="",a.style.display="none");return this},b.add=function(){c=document.createElement("div"),c.className="wax-legends",a=document.createElement("div"),a.className="wax-legend",a.style.display="none",c.appendChild(a);return this};return b.add()};var w=function(a){a.melt=function(b,c){return b.apply(c,[a,c])};return a},wax=wax||{};wax.request={cache:{},locks:{},promises:{},get:function(a,b){if(this.cache[a])return b(this.cache[a][0],this.cache[a][1]);this.promises[a]=this.promises[a]||[],this.promises[a].push(b);if(!this.locks[a]){var c=this;this.locks[a]=!0,reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:function(b){c.locks[a]=!1,c.cache[a]=[null,b];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])},error:function(b){c.locks[a]=!1,c.cache[a]=[b,null];for(var d=0;d<c.promises[a].length;d++)c.promises[a][d](c.cache[a][0],c.cache[a][1])}})}}};if(!wax)var wax={};wax.tilejson=function(a,b){reqwest({url:a+"?callback=grid",type:"jsonp",jsonpCallback:"callback",success:b,error:b})};var wax=wax||{};wax.tooltip={},wax.tooltip=function(a){this._currentTooltip=undefined,a=a||{},a.animationOut&&(this.animationOut=a.animationOut),a.animationIn&&(this.animationIn=a.animationIn)},wax.tooltip.prototype.isPopup=function(a){return a&&a.className.indexOf("wax-popup")!==-1},wax.tooltip.prototype.getTooltip=function(a,b,c,d){tooltip=document.createElement("div"),tooltip.className="wax-tooltip wax-tooltip-"+c,tooltip.innerHTML=a,b.appendChild(tooltip);return tooltip},wax.tooltip.prototype.hideTooltip=function(a){if(!!a){var b,c=function(){this.parentNode&&this.parentNode.removeChild(this)};a.style["-webkit-transition"]!==undefined&&this.animationOut?b="webkitTransitionEnd":a.style.MozTransition!==undefined&&this.animationOut&&(b="transitionend"),b?(a.addEventListener(b,c,!1),a.addEventListener("transitionend",c,!1),a.className+=" "+this.animationOut):a.parentNode&&a.parentNode.removeChild(a)}},wax.tooltip.prototype.click=function(a,b,c){this.unselect(b);var d=this.getTooltip(a,b,c),e=document.createElement("a");e.href="#close",e.className="close",e.innerHTML="Close";var f=wax.util.bind(function(a){this.hideTooltip(d),this._currentTooltip=undefined,a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault();return!1},this);e.addEventListener?e.addEventListener("click",f,!1):e.attachEvent&&e.attachEvent("onclick",f),d.className+=" wax-popup",d.innerHTML=a,d.appendChild(e),this._currentTooltip=d},wax.tooltip.prototype.select=function(a,b,c,d){if(!!a){if(this.isPopup(this._currentTooltip))return;this._currentTooltip=this.getTooltip(a,b,c,d),b.style.cursor="pointer"}},wax.tooltip.prototype.unselect=function(a){this.isPopup(this._currentTooltip)||(a.style.cursor="default",this._currentTooltip&&(this.hideTooltip(this._currentTooltip),this._currentTooltip=undefined))},wax.tooltip.prototype.out=wax.tooltip.prototype.unselect,wax.tooltip.prototype.over=wax.tooltip.prototype.select,wax.tooltip.prototype.click=wax.tooltip.prototype.click;var wax=wax||{};wax.util=wax.util||{},wax.util={offset:function(a){var b=a.offsetWidth||parseInt(a.style.width,10),c=a.offsetHeight||parseInt(a.style.height,10),d=0,e=0,f=function(a){if(a!==document.body&&a!==document.documentElement){d+=a.offsetTop,e+=a.offsetLeft;var b=a.style.transform||a.style["-webkit-transform"]||a.style.MozTransform;if(b)if(match=b.match(/translate\((.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/translate3d\((.+)px, (.+)px, (.+)px\)/))d+=parseInt(match[2],10),e+=parseInt(match[1],10);else if(match=b.match(/matrix3d\(([\-\d,\s]+)\)/)){var c=match[1].split(",");d+=parseInt(c[13],10),e+=parseInt(c[12],10)}}};f(a);try{while(a=a.offsetParent)f(a)}catch(g){}d+=document.body.offsetTop,e+=document.body.offsetLeft,d+=document.body.parentNode.offsetTop,e+=document.body.parentNode.offsetLeft;var h=document.defaultView?window.getComputedStyle(document.body.parentNode,null):document.body.parentNode.currentStyle;document.body.parentNode.offsetTop!==parseInt(h.marginTop,10)&&!isNaN(parseInt(h.marginTop,10))&&(d+=parseInt(h.marginTop,10),e+=parseInt(h.marginLeft,10));return{top:d,left:e,height:c,width:b}},$:function(a){return typeof a=="string"?document.getElementById(a):a},bind:function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,c.concat(Array.prototype.slice.call(arguments)))}},isString:function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)},indexOf:function(a,b){var c=Array.prototype.indexOf;if(a===null)return-1;var d,e;if(c&&a.indexOf===c)return a.indexOf(b);for(d=0,e=a.length;d<e;d++)if(a[d]===b)return d;return-1},isArray:Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},keys:Object.keys||function(a){var b=Object.prototype.hasOwnProperty;if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.call(a,d)&&(c[c.length]=d);return c},eventoffset:function(a){var b=0,c=0;if(!a)var a=window.event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};if(a.clientX||a.clientY){var d=document.documentElement,e=document.body,f=document.body.parentNode.currentStyle,g=parseInt(f.marginTop,10)||0,h=parseInt(f.marginLeft,10)||0;return{x:a.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0)+h,y:a.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)+g}}if(a.touches&&a.touches.length===1)return{x:a.touches[0].pageX,y:a.touches[0].pageY}}},wax=wax||{},wax.mm=wax.mm||{},wax.mm.attribution=function(a,b){b=b||{};var c,d={};d.element=function(){return c.element()},d.appendTo=function(a){wax.util.$(a).appendChild(c.element());return this},d.init=function(){c=wax.attribution(),c.set(b.attribution),c.element().className="wax-attribution wax-mm";return this};return d.init()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.boxselector=function(a,b,c){function h(b){var c=new j.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}function g(b){if(!!b.shiftKey){i=h(b),l.style.left=i.x+"px",l.style.top=i.y+"px",j.addEvent(a.parent,"mousemove",f),j.addEvent(a.parent,"mouseup",e),a.parent.style.cursor="crosshair";return j.cancelEvent(b)}}function f(a){var b=h(a);l.style.display="block",b.x<i.x?l.style.left=b.x+"px":l.style.left=i.x+"px",b.y<i.y?l.style.top=b.y+"px":l.style.top=i.y+"px",l.style.width=Math.abs(b.x-i.x)+"px",l.style.height=Math.abs(b.y-i.y)+"px";return j.cancelEvent(a)}function e(b){var c=h(b),d=a.pointLocation(c),g=a.pointLocation(i),l=[new j.Location(Math.max(d.lat,g.lat),Math.min(d.lon,g.lon)),new j.Location(Math.min(d.lat,g.lat),Math.max(d.lon,g.lon))];m=[d,g],k(l),j.removeEvent(a.parent,"mousemove",f),j.removeEvent(a.parent,"mouseup",e),a.parent.style.cursor="auto"}function d(a,b){if(!!l&&!!m){var c=a.locationPoint(m[0]),d=a.locationPoint(m[1]);l.style.display="block",l.style.height="auto",l.style.width="auto",l.style.left=Math.max(0,d.x)+"px",l.style.top=Math.max(0,d.y)+"px",l.style.right=Math.max(0,a.dimensions.x-c.x)+"px",l.style.bottom=Math.max(0,a.dimensions.y-c.y)+"px"}}var i=null,j=com.modestmaps,k=typeof c=="function"?c:c.callback,l,m,n={};n.add=function(a){l=l||document.createElement("div"),l.id=a.parent.id+"-boxselector-box",l.className="boxselector-box",a.parent.appendChild(l),j.addEvent(a.parent,"mousedown",g),a.addCallback("drawn",d);return this},n.remove=function(){a.parent.removeChild(l),j.removeEvent(a.parent,"mousedown",g),a.removeCallback("drawn",d)};return n.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.bwdetect=function(a,b){function e(b){(!b.options||!b.options.scheme)&&h.Map.prototype.setProvider.call(a,b);var c=[[".png",".jpg"],[k,l]];j&&c.reverse();for(var d=0;d<b.options.tiles.length;d++)b.options.tiles[d]=b.options.tiles[d].replace(c[0][0],c[1][0]).replace(c[0][1],c[1][1]);h.Map.prototype.setProvider.call(a,b)}function d(){var a=+(new Date)-start;a>g&&f.bw(0)}function c(){var a=new Image;a.src=i,start=+(new Date),h.addEvent(a,"load",d)}b=b||{};var f={},g=b.threshold||400,h=com.modestmaps,i="http://a.tiles.mapbox.com/mapbox/1.0.0/blue-marble-topo-bathy-jul/0/0/0.png?preventcache="+ +(new Date),j=1,k=b.png||".png128",l=b.jpg||".jpg70",m=b.auto===undefined?!0:b.auto;f.bw=function(b){if(!arguments.length)return j;j!=(j=b)&&e(a.provider)},f.add=function(a){a.setProvider=e,b.auto&&c();return this};return f.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.fullscreen=function(a){function b(a){a&&com.modestmaps.cancelEvent(a),(c=!c)?d.original():d.full()}var c=1,d={},e,f;d.add=function(a){e=document.createElement("a"),e.className="wax-fullscreen",e.href="#fullscreen",e.innerHTML="fullscreen",com.modestmaps.addEvent(e,"click",b);return this},d.full=function(){f=[a.parent.offsetWidth,a.parent.offsetHeight],a.parent.className+=" wax-fullscreen-map",a.setSize(a.parent.offsetWidth,a.parent.offsetHeight)},d.original=function(){a.parent.className=a.parent.className.replace("wax-fullscreen-map",""),a.setSize(f[0],f[1])},d.appendTo=function(a){wax.util.$(a).appendChild(e);return this};return d.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.locationHash={stateChange:function(a){com.modestmaps.addEvent(window,"hashchange",function(){a(location.hash.substring(1))},!1)},getState:function(){return location.hash.substring(1)},pushState:function(a){location.hash="#"+a}},wax.mm.pushState={stateChange:function(a){com.modestmaps.addEvent(window,"popstate",function(b){b.state&&b.state.map_location&&a(b.state.map_location)},!1)},getState:function(){if(!!window.history&&!!window.history.state)return history.state&&history.state.map_location},pushState:function(a){!!window.history&&!!window.history.pushState&&window.history.pushState({map_location:a},document.title,window.location.href)}},wax.mm.hash=function(a,b,c){function g(a,b,c){var d;return function(){var e=this,f=arguments,g=function(){d=null,a.apply(e,f)};c&&clearTimeout(d);if(c||!d)d=setTimeout(g,b)}}function f(a,b){return g(a,b,!1)}function e(){var a=l();h!==a&&(h=a,c.manager.pushState(h))}function d(a){a!==h&&k(h=a)&&e()}c=c||{};var h,i={},j=90-1e-8;c.manager=c.manager||wax.mm.pushState;var k=function(b){var c=b.split("/");for(var d=0;d<c.length;d++){c[d]=Number(c[d]);if(isNaN(c[d]))return!0}if(c.length<3)return!0;c.length==3&&a.setCenterZoom(new com.modestmaps.Location(c[1],c[2]),c[0])},l=function(){var b=a.getCenter(),c=a.getZoom(),d=Math.max(0,Math.ceil(Math.log(c)/Math.LN2));return[c.toFixed(2),b.lat.toFixed(d),b.lon.toFixed(d)].join("/")},m=function(){c.defaultCenter&&a.setCenter(c.defaultCenter),c.defaultZoom&&a.setZoom(c.defaultZoom)};i.add=function(a){c.manager.getState()?d(c.manager.getState()):(m(),e()),a.addCallback("drawn",f(e,500)),c.manager.stateChange(d);return this};return i.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.interaction=function(a,b,c){function l(){var b=a.createOrGetLayer(Math.round(a.getZoom()));return y||(y=function(a){var c=[];for(var d in a)if(a[d].parentNode===b){var e=wax.util.offset(a[d]);c.push([e.top,e.left,a[d]])}return c}(a.tiles))}function k(a,b){y=null}function j(a){for(var b=0,c=l();b<c.length;b++)if(c[b][0]<a.y&&c[b][0]+256>a.y&&c[b][1]<a.x&&c[b][1]+256>a.x)return c[b][2];return!1}function i(){if(t){window.clearTimeout(t),t=null;return!0}return!1}function h(b){if(!s){var c=wax.util.eventoffset(b),d=j(c),e;d&&n.getGrid(d.src,function(f,g){!f&&!!g&&((e=g.getFeature(c.x,c.y,d,{format:"teaser"}))?e&&v!==e?(v=e,o.out(a.parent),o.over(e,a.parent,0,b)):e||(v=null,o.out(a.parent)):(v=null,o.out(a.parent)))})}}function g(b){i()||(s=!0,w=wax.util.eventoffset(b),b.type==="mousedown"?m.addEvent(a.parent,"mouseup",e):b.type==="touchstart"&&b.touches.length===1&&(p=["full","teaser"],o._currentTooltip&&o.hideTooltip(o._currentTooltip),m.addEvent(a.parent,"touchend",e),m.addEvent(a.parent,"touchmove",f)))}function f(){m.removeEvent(a.parent,"touchend",e),m.removeEvent(a.parent,"touchmove",e),s=!1}function e(b){var c=wax.util.eventoffset(b);m.removeEvent(a.parent,"mouseup",e),a.parent.ontouchend&&(m.removeEvent(a.parent,"touchend",e),m.removeEvent(a.parent,"touchmove",_touchCancel)),s=!1,b.type==="touchend"?d(b,w):Math.round(c.y/x)===Math.round(w.y/x)&&Math.round(c.x/x)===Math.round(w.x/x)&&(t=window.setTimeout(function(a){return function(b){t=null,d(b,a)}}(c),300));return e}function d(b,c){var d=j(c),e;d&&n.getGrid(d.src,function(f,g){for(var h=0;g&&h<p.length;h++)if(e=g.getFeature(c.x,c.y,d,{format:p[h]}))switch(p[h]){case"full":case"teaser":return o.click(e,a.parent,0,b);case"location":return q(e)}})}c=c||{},b=b||{};var m=com.modestmaps,n=wax.GridManager(b),o=c.callbacks||new wax.tooltip,p=c.clickAction||["full"],q=c.clickHandler||function(a){window.location=a},r={},s=!1,t=!1,u="ontouchstart"in document.documentElement,v,w,x=4,y;r.add=function(){var b=["zoomed","panned","centered","extentset","resized","drawn"];for(var c=0;c<b.length;c++)a.addCallback(b[c],k);m.addEvent(a.parent,"mousemove",h),m.addEvent(a.parent,"mousedown",g),u&&m.addEvent(a.parent,"touchstart",g);return this},r.remove=function(){var b=["zoomed","panned","centered","extentset","resized","drawn"];for(var c=0;c<b.length;c++)a.removeCallback(b[c],k);m.removeEvent(a.parent,"mousemove",h),m.removeEvent(a.parent,"mousedown",g),u&&m.removeEvent(a.parent,"touchstart",g),o._currentTooltip&&o.hideTooltip(o._currentTooltip);return this};return r.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.legend=function(a,b){b=b||{};var c,d={};d.add=function(){c=wax.legend().content(b.legend||"");return this},d.content=function(a){a&&c.content(a.legend||"")},d.element=function(){return c.element()},d.appendTo=function(a){wax.util.$(a).appendChild(c.element());return this};return d.add()},wax=wax||{},wax.mm=wax.mm||{},wax.mm.mobile=function(a,b,c){c=c||{};var d=com.modestmaps,e=navigator.userAgent.toLowerCase(),f=e.indexOf("webkit")!=-1,g=e.indexOf("mobile")!=-1,h=g&&f,i=function(a){var b=document.createElement("canvas"),c=parseInt(a.style.width,10),d=parseInt(a.style.height,10),e=c/2,f=d/2,g=Math.min(c,d)/4,h=b.getContext("2d");b.setAttribute("width",c),b.setAttribute("height",d),h.globalAlpha=.5;var i=h.createLinearGradient(0,0,300,225);i.addColorStop(0,"black"),i.addColorStop(1,"rgb(200, 200, 200)"),h.fillStyle=i,h.fillRect(0,0,c,d),h.fillStyle="rgb(255, 255, 255)",h.beginPath(),h.moveTo(e-g*.6,f-g),h.lineTo(e-g*.6,f+g),h.lineTo(e+g*.6,f),h.fill(),a.appendChild(b)},j=function(a){a.style.position="absolute",a.style.height="50px",a.style.left=a.style.right="0";var b=document.createElement("canvas");b.setAttribute("width",a.offsetWidth),b.setAttribute("height",a.offsetHeight);var c=b.getContext("2d");c.globalAlpha=1,c.fillStyle="rgba(255, 255, 255, 0.5)",c.fillRect(0,0,a.offsetWidth,a.offsetHeight),c.fillStyle="rgb(0, 0, 0)",c.font="bold 20px sans-serif",c.fillText("back",20,30),a.appendChild(b)},k=function(a){a.style.position="absolute",a.style.width=a.style.height="auto",a.style.top=window.pageYOffset+"px",a.style.left=a.style.right="0px"},l=function(a){a.style.position="relative",a.style.width=a.style.height=a.style.top=a.style.left=a.style.right="auto"},m,n,o,p,q=c.overlayDraw||i,r=c.backDraw||j;bodyDraw=c.bodyDraw||function(){};var s={add:function(a){h&&(p=document.createElement("meta"),p.id="wax-touch",p.setAttribute("name","viewport"),m=document.createElement("div"),m.id=a.parent.id+"-mobileoverlay",m.className="wax-mobileoverlay",m.style.position="absolute",m.style.width=a.dimensions.x+"px",m.style.height=a.dimensions.y+"px",a.parent.appendChild(m),q(m),o=document.createElement("div"),backDiv=document.createElement("div"),n=document.body,newBody=document.createElement("body"),newBody.className="wax-mobile-body",newBody.appendChild(backDiv),d.addEvent(m,"touchstart",this.toTouch),d.addEvent(backDiv,"touchstart",this.toPage));return this},toTouch:function(){a.parent.parentNode.replaceChild(o,a.parent),newBody.insertBefore(a.parent,backDiv),document.body=newBody,bodyDraw(newBody),r(backDiv),p.setAttribute("content","initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0"),document.head.appendChild(p),a._smallSize=[a.parent.clientWidth,a.parent.clientHeight],k(a.parent),a.setSize(a.parent.offsetWidth,window.innerHeight),backDiv.style.display="block",m.style.display="none"},toPage:function(){document.body=n,o.parentNode.replaceChild(a.parent,o),l(a.parent),a.setSize(a._smallSize[0],a._smallSize[1]),backDiv.style.display="none",m.style.display="block"}};return s.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.pointselector=function(a,b,c){function h(b){var c=wax.util.eventoffset(b),d=new m.Point(c.x,c.y),e={x:parseFloat(m.getStyle(document.documentElement,"margin-left")),y:parseFloat(m.getStyle(document.documentElement,"margin-top"))};isNaN(e.x)||(d.x-=e.x),isNaN(e.y)||(d.y-=e.y);for(var f=a.parent;f;f=f.offsetParent)d.x-=f.offsetLeft,d.y-=f.offsetTop;return d}function g(a){var b=[];for(var c=0;c<a.length;c++)b.push(new m.Location(a[c].lat,a[c].lon));return b}function f(){var b=new m.Point(0,0);for(var c=0;c<o.length;c++){var e=a.locationPoint(o[c]);o[c].pointDiv||(o[c].pointDiv=document.createElement("div"),o[c].pointDiv.className="wax-point-div",o[c].pointDiv.style.position="absolute",o[c].pointDiv.style.display="block",o[c].pointDiv.location=o[c],m.addEvent(o[c].pointDiv,"mouseup",function(b){var e=o[c];return function(b){m.removeEvent(a.parent,"mouseup",d),n.deletePoint(e,b)}}()),a.parent.appendChild(o[c].pointDiv)),o[c].pointDiv.style.left=e.x+"px",o[c].pointDiv.style.top=e.y+"px"}}function e(b){i=h(b),m.addEvent(a.parent,"mouseup",d)}function d(b){!i||(j=h(b),m.Point.distance(i,j)<k&&(n.addLocation(a.pointLocation(i)),p(g(o))),i=null)}var i=null,j=null,k=5,l,m=com.modestmaps,n={},o=[],p=typeof c=="function"?c:c.callback;n.addLocation=function(a){o.push(a),f(),p(g(o))},n.add=function(a){m.addEvent(a.parent,"mousedown",e),a.addCallback("drawn",f());return this},n.deletePoint=function(a,b){confirm("Delete this point?")&&(a.pointDiv.parentNode.removeChild(a.pointDiv),o.splice(wax.util.indexOf(o,a),1),p(g(o)))};return n.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoombox=function(a){function e(b){var c=new g.Point(b.clientX,b.clientY);c.x+=document.body.scrollLeft+document.documentElement.scrollLeft,c.y+=document.body.scrollTop+document.documentElement.scrollTop;for(var d=a.parent;d;d=d.offsetParent)c.x-=d.offsetLeft,c.y-=d.offsetTop;return c}function d(c){if(!!h){h=!1;var f=e(c),k=a.pointLocation(f),l=a.pointLocation(j);a.setExtent([k,l]),i.style.display="none",g.removeEvent(a.parent,"mousemove",b),g.removeEvent(a.parent,"mouseup",d),a.parent.style.cursor="auto"}}function c(c){if(!!c.shiftKey&&!this.drawing){h=!0,j=e(c),i.style.left=j.x+"px",i.style.top=j.y+"px",g.addEvent(a.parent,"mousemove",b),g.addEvent(a.parent,"mouseup",d),a.parent.style.cursor="crosshair";return g.cancelEvent(c)}}function b(a){if(!!h){var b=e(a);i.style.display="block",b.x<j.x?i.style.left=b.x+"px":i.style.left=j.x+"px",i.style.width=Math.abs(b.x-j.x)+"px",b.y<j.y?i.style.top=b.y+"px":i.style.top=j.y+"px",i.style.height=Math.abs(b.y-j.y)+"px";return g.cancelEvent(a)}}var f={},g=com.modestmaps,h=!1,i,j=null;f.add=function(a){i=i||document.createElement("div"),i.id=a.parent.id+"-zoombox-box",i.className="zoombox-box",a.parent.appendChild(i),g.addEvent(a.parent,"mousedown",c);return this},f.remove=function(){a.parent.removeChild(i),g.removeEvent(a.parent,"mousedown",c)};return f.add(a)},wax=wax||{},wax.mm=wax.mm||{},wax.mm.zoomer=function(a){var b=com.modestmaps,c=document.createElement("a");c.innerHTML="+",c.href="#",c.className="zoomer zoomin",b.addEvent(c,"mousedown",function(a){b.cancelEvent(a)}),b.addEvent(c,"dblclick",function(a){b.cancelEvent(a)}),b.addEvent(c,"click",function(c){b.cancelEvent(c),a.zoomIn()},!1);var d=document.createElement("a");d.innerHTML="-",d.href="#",d.className="zoomer zoomout",b.addEvent(d,"mousedown",function(a){b.cancelEvent(a)}),b.addEvent(d,"dblclick",function(a){b.cancelEvent(a)}),b.addEvent(d,"click",function(c){b.cancelEvent(c),a.zoomOut()},!1);var e={add:function(a){a.addCallback("drawn",function(a,b){a.coordinate.zoom===a.provider.outerLimits()[0].zoom?d.className="zoomer zoomout zoomdisabled":a.coordinate.zoom===a.provider.outerLimits()[1].zoom?c.className="zoomer zoomin zoomdisabled":(c.className="zoomer zoomin",d.className="zoomer zoomout")});return this},appendTo:function(a){wax.util.$(a).appendChild(c),wax.util.$(a).appendChild(d);return this}};return e.add(a)};var wax=wax||{};wax.mm=wax.mm||{},wax.mm.connector=function(a){this.options={tiles:a.tiles,scheme:a.scheme||"xyz",minzoom:a.minzoom||0,maxzoom:a.maxzoom||22}},wax.mm.connector.prototype={outerLimits:function(){return[(new com.modestmaps.Coordinate(0,0,0)).zoomTo(this.options.minzoom),(new com.modestmaps.Coordinate(1,1,0)).zoomTo(this.options.maxzoom)]},getTileUrl:function(a){if(!(coord=this.sourceCoordinate(a)))return null;coord.row=this.options.scheme==="tms"?Math.pow(2,coord.zoom)-coord.row-1:coord.row;return this.options.tiles[parseInt(Math.pow(2,coord.zoom)*coord.row+coord.column,10)%this.options.tiles.length].replace("{z}",coord.zoom.toFixed(0)).replace("{x}",coord.column.toFixed(0)).replace("{y}",coord.row.toFixed(0))}},com&&com.modestmaps&&com.modestmaps.extend(wax.mm.connector,com.modestmaps.MapProvider)
