/*!
 * jQuery JavaScript Library v1.4.3
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Thu Oct 14 23:10:06 2010 -0400
 */
(function(a,b){function o(a){return q.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function n(a){if(!bB[a]){var b=q("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bB[a]=c}return bB[a]}function m(a,b){var c={};q.each(bF.concat.apply([],bF.slice(0,b)),function(){c[this]=a});return c}function l(a,b,c,d){q.isArray(b)&&b.length?q.each(b,function(b,e){c||bt.test(a)?d(a,e):l(a+"["+(typeof e=="object"||q.isArray(e)?b:"")+"]",e,c,d)}):!c&&b!=null&&typeof b=="object"?q.isEmptyObject(b)?d(a,""):q.each(b,function(b,e){l(a+"["+b+"]",e,c,d)}):d(a,b)}function k(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return d;q.each(b==="width"?bj:bk,function(){c||(d-=parseFloat(q.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(q.css(a,"margin"+this))||0:d-=parseFloat(q.css(a,"border"+this+"Width"))||0});return d}function j(a,b){b.src?q.ajax({url:b.src,async:!1,dataType:"script"}):q.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function i(a,b){var c=0;b.each(function(){if(this.nodeName===(a[c]&&a[c].nodeName)){var b=q.data(a[c++]),d=q.data(this,b);if(b=b&&b.events){delete d.handle,d.events={};for(var e in b)for(var f in b[e])q.event.add(this,e,b[e][f],b[e][f].data)}}})}function h(a,b,c){if(q.isFunction(b))return q.grep(a,function(a,d){return!!b.call(a,d,a)===c});if(b.nodeType)return q.grep(a,function(a){return a===b===c});if(typeof b=="string"){var d=q.grep(a,function(a){return a.nodeType===1});if(R.test(b))return q.filter(b,d,!c);b=q.filter(b,d)}return q.grep(a,function(a){return q.inArray(a,b)>=0===c})}function g(a,b){return(a&&a!=="*"?a+".":"")+b.replace(D,"`").replace(E,"&")}function f(a){var b,c,d=[],e=[],f,g,h,i,j,k,l,m;g=q.data(this,this.nodeType?"events":"__events__"),typeof g=="function"&&(g=g.events);if(!(a.liveFired===this||!g||!g.live||a.button&&a.type==="click")){a.namespace&&(m=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var n=g.live.slice(0);for(i=0;i<n.length;i++)g=n[i],g.origType.replace(B,"")===a.type?e.push(g.selector):n.splice(i--,1);e=q(a.target).closest(e,a.currentTarget),j=0;for(k=e.length;j<k;j++){l=e[j];for(i=0;i<n.length;i++){g=n[i];if(l.selector===g.selector&&(!m||m.test(g.namespace))){h=l.elem,f=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,f=q(a.relatedTarget).closest(g.selector)[0];(!f||f!==h)&&d.push({elem:h,handleObj:g,level:l.level})}}}j=0;for(k=d.length;j<k;j++){e=d[j];if(c&&e.level>c)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,m=e.handleObj.origHandler.apply(e.elem,arguments);if(m===!1||a.isPropagationStopped())c=e.level,m===!1&&(b=!1)}return b}}function e(a,b,c){c[0].type=a;return q.event.handle.apply(b,c)}function d(){return!0}function c(){return!1}var p=a.document,q=function(){function c(){if(!d.isReady){try{p.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\W/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,q=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,r=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,s=/(?:^|:|,)(?:\s*\[)+/g,t=/(webkit)[ \/]([\w.]+)/,u=/(opera)(?:.*version)?[ \/]([\w.]+)/,v=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,x=navigator.userAgent,y=!1,z=[],A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={init:function(a,c){var e,f,i;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!c&&p.body){this.context=p,this[0]=p.body,this.selector="body",this.length=1;return this}if(typeof a=="string"){if((e=h.exec(a))&&(e[1]||!c)){if(e[1]){i=c?c.ownerDocument||c:p,(f=n.exec(a))?d.isPlainObject(c)?(a=[p.createElement(f[1])],d.fn.attr.call(a,c,!0)):a=[i.createElement(f[1])]:(f=d.buildFragment([e[1]],[i]),a=(f.cacheable?f.fragment.cloneNode(!0):f.fragment).childNodes);return d.merge(this,a)}if((f=p.getElementById(e[2]))&&f.parentNode){if(f.id!==e[2])return g.find(a);this.length=1,this[0]=f}this.context=p,this.selector=a;return this}if(!c&&!l.test(a)){this.selector=a,this.context=p,a=p.getElementsByTagName(a);return d.merge(this,a)}return!c||c.jquery?(c||g).find(a):d(c).find(a)}if(d.isFunction(a))return g.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.4.3",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,c){var e=d();d.isArray(a)?D.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(),d.isReady?a.call(p,d):z&&z.push(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(E.apply(this,arguments),"slice",E.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||d(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a=arguments[0]||{},c=1,e=arguments.length,f=!1,g,h,i,j,k;typeof a=="boolean"&&(f=a,a=arguments[1]||{},c=2),typeof a!="object"&&!d.isFunction(a)&&(a={}),e===c&&(a=this,--c);for(;c<e;c++)if((g=arguments[c])!=null)for(h in g)i=a[h],j=g[h],a!==j&&(f&&j&&(d.isPlainObject(j)||(k=d.isArray(j)))?(k?(k=!1,clone=i&&d.isArray(i)?i:[]):clone=i&&d.isPlainObject(i)?i:{},a[h]=d.extend(f,clone,j)):j!==b&&(a[h]=j));return a},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(!p.body)return setTimeout(d.ready,1);d.isReady=!0;if(!(a!==!0&&--d.readyWait>0)){if(z){for(var b=0;a=z[b++];)a.call(p,d);z=null}d.fn.triggerHandler&&d(p).triggerHandler("ready")}}},bindReady:function(){if(!y){y=!0;if(p.readyState==="complete")return setTimeout(d.ready,1);if(p.addEventListener)p.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(p.attachEvent){p.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}p.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||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;for(var c in a);return c===b||C.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(o.test(b.replace(q,"@").replace(r,"]").replace(s,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=p.getElementsByTagName("head")[0]||p.documentElement,c=p.createElement("script");c.type="text/javascript",d.support.scriptEval?c.appendChild(p.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(e=a[0];g<h&&c.call(e,g,e)!==!1;e=a[++g]);return a},trim:F?function(a){return a==null?"":F.call(a)}:function(a){return a==null?"":a.toString().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)?D.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 for(;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){for(var d=[],e,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(j=0;j<i;j++)g(a[j],c,f?e.call(a[j],j,g(a[j],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase(),a=t.exec(a)||u.exec(a)||v.exec(a)||a.indexOf("compatible")<0&&w.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}}),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),x=d.uaMatch(x),x.browser&&(d.browser[x.browser]=!0,d.browser.version=x.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),/\s/.test(" ")||(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(p),p.addEventListener?A=function(){p.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:p.attachEvent&&(A=function(){p.readyState==="complete"&&(p.detachEvent("onreadystatechange",A),d.ready())});return a.jQuery=a.$=d}();(function(){q.support={};var b=p.documentElement,c=p.createElement("script"),d=p.createElement("div"),e="script"+q.now();d.style.display="none",d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),g=d.getElementsByTagName("a")[0],h=p.createElement("select"),i=h.appendChild(p.createElement("option"));if(!(!f||!f.length||!g)){q.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(g.getAttribute("style")),hrefNormalized:g.getAttribute("href")==="/a",opacity:/^0.55$/.test(g.style.opacity),cssFloat:!!g.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:i.selected,optDisabled:!1,checkClone:!1,scriptEval:!1,noCloneEvent:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},h.disabled=!0,q.support.optDisabled=!i.disabled,c.type="text/javascript";try{c.appendChild(p.createTextNode("window."+e+"=1;"))}catch(j){}b.insertBefore(c,b.firstChild),a[e]&&(q.support.scriptEval=!0,delete a[e]),b.removeChild(c),d.attachEvent&&d.fireEvent&&(d.attachEvent("onclick",function a(){q.support.noCloneEvent=!1,d.detachEvent("onclick",a)}),d.cloneNode(!0).fireEvent("onclick")),d=p.createElement("div"),d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>",b=p.createDocumentFragment(),b.appendChild(d.firstChild),q.support.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,q(function(){var a=p.createElement("div");a.style.width=a.style.paddingLeft="1px",p.body.appendChild(a),q.boxModel=q.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,q.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",q.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var b=a.getElementsByTagName("td");q.support.reliableHiddenOffsets=b[0].offsetHeight===0,b[0].style.display="",b[1].style.display="none",q.support.reliableHiddenOffsets=q.support.reliableHiddenOffsets&&b[0].offsetHeight===0,a.innerHTML="",p.body.removeChild(a).style.display="none"}),b=function(a){var b=p.createElement("div");a="on"+a;var c=a in b;c||(b.setAttribute(a,"return;"),c=typeof b[a]=="function");return c},q.support.submitBubbles=b("submit"),q.support.changeBubbles=b("change"),b=c=d=f=g=null}})(),q.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var r={},s=/^(?:\{.*\}|\[.*\])$/;q.extend({cache:{},uuid:0,expando:"jQuery"+q.now(),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},data:function(c,d,e){if(q.acceptData(c)){c=c==a?r:c;var f=c.nodeType,g=f?c[q.expando]:null,h=q.cache;if(!f||!!g||typeof d!="string"||e!==b){f?g||(c[q.expando]=g=++q.uuid):h=c,typeof d=="object"?f?h[g]=q.extend(h[g],d):q.extend(h,d):f&&!h[g]&&(h[g]={}),c=f?h[g]:h,e!==b&&(c[d]=e);return typeof d=="string"?c[d]:c}}},removeData:function(b,c){if(q.acceptData(b)){b=b==a?r:b;var d=b.nodeType,e=d?b[q.expando]:b,f=q.cache,g=d?f[e]:e;if(c)g&&(delete g[c],d&&q.isEmptyObject(g)&&q.removeData(b));else if(d&&q.support.deleteExpando)delete b[q.expando];else if(b.removeAttribute)b.removeAttribute(q.expando);else if(d)delete f[e];else for(var h in b)delete b[h]}},acceptData:function(a){if(a.nodeName){var b=q.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),q.fn.extend({data:function(a,c){if(typeof a=="undefined")return this.length?q.data(this[0]):null;if(typeof a=="object")return this.each(function(){q.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(c===b){var e=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(e===b&&this.length){e=q.data(this[0],a);if(e===b&&this[0].nodeType===1){e=this[0].getAttribute("data-"+a);if(typeof e=="string")try{e=e==="true"?!0:e==="false"?!1:e==="null"?null:q.isNaN(e)?s.test(e)?q.parseJSON(e):e:parseFloat(e)}catch(f){}else e=b}}return e===b&&d[1]?this.data(d[0]):e}return this.each(function(){var b=q(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),q.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){q.removeData(this,a)})}}),q.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var d=q.data(a,b);if(!c)return d||[];!d||q.isArray(c)?d=q.data(a,b,q.makeArray(c)):d.push(c);return d}},dequeue:function(a,b){b=b||"fx";var c=q.queue(a,b),d=c.shift();d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){q.dequeue(a,b)}))}}),q.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return q.queue(this[0],a);return this.each(function(){var b=q.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&q.dequeue(this,a)})},dequeue:function(a){return this.each(function(){q.dequeue(this,a)})},delay:function(a,b){a=q.fx?q.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){q.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var t=/[\n\t]/g,u=/\s+/,v=/\r/g,w=/^(?:href|src|style)$/,x=/^(?:button|input)$/i,y=/^(?:button|input|object|select|textarea)$/i,z=/^a(?:rea)?$/i,A=/^(?:radio|checkbox)$/i;q.fn.extend({attr:function(a,b){return q.access(this,a,b,!0,q.attr)},removeAttr:function(a){return this.each(function(){q.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(q.isFunction(a))return this.each(function(b){var c=q(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string")for(var b=(a||"").split(u),c=0,d=this.length;c<d;c++){var e=this[c];if(e.nodeType===1)if(e.className){for(var f=" "+e.className+" ",g=e.className,h=0,i=b.length;h<i;h++)f.indexOf(" "+b[h]+" ")<0&&(g+=" "+b[h]);e.className=q.trim(g)}else e.className=a}return this},removeClass:function(a){if(q.isFunction(a))return this.each(function(b){var c=q(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a=="string"||a===b)for(var c=(a||"").split(u),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var g=(" "+f.className+" ").replace(t," "),h=0,i=c.length;h<i;h++)g=g.replace(" "+c[h]+" "," ");f.className=q.trim(g)}else f.className=""}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(q.isFunction(a))return this.each(function(c){var d=q(this);d.toggleClass(a.call(this,c,d.attr("class"),b),b)});return this.each(function(){if(c==="string")for(var e,f=0,g=q(this),h=b,i=a.split(u);e=i[f++];)h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e);else if(c==="undefined"||c==="boolean")this.className&&q.data(this,"__className__",this.className),this.className=this.className||a===!1?"":q.data(this,"__className__")||""})},hasClass:function(a){a=" "+a+" ";for(var b=0,c=this.length;b<c;b++)if((" "+this[b].className+" ").replace(t," ").indexOf(a)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(q.nodeName(c,"option")){var d=c.attributes.value;return!d||d.specified?c.value:c.text}if(q.nodeName(c,"select")){var e=c.selectedIndex;d=[];var f=c.options;c=c.type==="select-one";if(e<0)return null;var g=c?e:0;for(e=c?e+1:f.length;g<e;g++){var h=f[g];if(h.selected&&(q.support.optDisabled?!h.disabled:h.getAttribute("disabled")===null)&&(!h.parentNode.disabled||!q.nodeName(h.parentNode,"optgroup"))){a=q(h).val();if(c)return a;d.push(a)}}return d}if(A.test(c.type)&&!q.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(v,"")}return b}var i=q.isFunction(a);return this.each(function(b){var c=q(this),d=a;if(this.nodeType===1){i&&(d=a.call(this,b,c.val())),d==null?d="":typeof d=="number"?d+="":q.isArray(d)&&(d=q.map(d,function(a){return a==null?"":a+""}));if(q.isArray(d)&&A.test(this.type))this.checked=q.inArray(c.val(),d)>=0;else if(q.nodeName(this,"select")){var e=q.makeArray(d);q("option",this).each(function(){this.selected=q.inArray(q(this).val(),e)>=0}),e.length||(this.selectedIndex=-1)}else this.value=d}})}}),q.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)return b;if(e&&c in q.attrFn)return q(a)[c](d);e=a.nodeType!==1||!q.isXMLDoc(a);var f=d!==b;c=e&&q.props[c]||c;if(a.nodeType===1){var g=w.test(c);if((c in a||a[c]!==b)&&e&&!g){f&&(c==="type"&&x.test(a.nodeName)&&a.parentNode&&q.error("type property can't be changed"),d===null?a.nodeType===1&&a.removeAttribute(c):a[c]=d);if(q.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex")return(c=a.getAttributeNode("tabIndex"))&&c.specified?c.value:y.test(a.nodeName)||z.test(a.nodeName)&&a.href?0:b;return a[c]}if(!q.support.style&&e&&c==="style"){f&&(a.style.cssText=""+d);return a.style.cssText}f&&a.setAttribute(c,""+d);if(!a.attributes[c]&&a.hasAttribute&&!a.hasAttribute(c))return b;a=!q.support.hrefNormalized&&e&&g?a.getAttribute(c,2):a.getAttribute(c);return a===null?b:a}}});var B=/\.(.*)$/,C=/^(?:textarea|input|select)$/i,D=/\./g,E=/ /g,F=/[^\w\s.|`]/g,G=function(a){return a.replace(F,"\\$&")},H={focusin:0,focusout:0};q.event={add:function(d,e,f,g){if(d.nodeType!==3&&d.nodeType!==8){q.isWindow(d)&&d!==a&&!d.frameElement&&(d=a),f===!1&&(f=c);var h,i;f.handler&&(h=f,f=h.handler),f.guid||(f.guid=q.guid++);if(i=q.data(d)){var j=d.nodeType?"events":"__events__",k=i[j],l=i.handle;typeof k=="function"?(l=k.handle,k=k.events):k||(d.nodeType||(i[j]=i=function(){}),i.events=k={}),l||(i.handle=l=function(){return typeof q!="undefined"&&!q.event.triggered?q.event.handle.apply(l.elem,arguments):b}),l.elem=d,e=e.split(" ");for(var m=0,n;j=e[m++];){i=h?q.extend({},h):{handler:f,data:g},j.indexOf(".")>-1?(n=j.split("."),j=n.shift(),i.namespace=n.slice(0).sort().join(".")):(n=[],i.namespace=""),i.type=j,i.guid||(i.guid=f.guid);var o=k[j],p=q.event.special[j]||{};if(!o){o=k[j]=[];if(!p.setup||p.setup.call(d,g,n,l)===!1)d.addEventListener?d.addEventListener(j,l,!1):d.attachEvent&&d.attachEvent("on"+j,l)}p.add&&(p.add.call(d,i),i.handler.guid||(i.handler.guid=f.guid)),o.push(i),q.event.global[j]=!0}d=null}}},global:{},remove:function(a,b,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=c);var f,g,h=0,i,j,k,l,m,n,o=a.nodeType?"events":"__events__",p=q.data(a),r=p&&p[o];if(p&&r){typeof r=="function"&&(p=r,r=r.events),b&&b.type&&(d=b.handler,b=b.type);if(!b||typeof b=="string"&&b.charAt(0)==="."){b=b||"";for(f in r)q.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[h++];){l=f,i=f.indexOf(".")<0,j=[],i||(j=f.split("."),f=j.shift(),k=RegExp("(^|\\.)"+q.map(j.slice(0).sort(),G).join("\\.(?:.*\\.)?")+"(\\.|$)"));if(m=r[f])if(d){l=q.event.special[f]||{};for(g=e||0;g<m.length;g++){n=m[g];if(d.guid===n.guid){if(i||k.test(n.namespace))e==null&&m.splice(g--,1),l.remove&&l.remove.call(a,n);if(e!=null)break}}if(m.length===0||e!=null&&m.length===1)(!l.teardown||l.teardown.call(a,j)===!1)&&q.removeEvent(a,f,p.handle),delete r[f]}else for(g=0;g<m.length;g++){n=m[g];if(i||k.test(n.namespace))q.event.remove(a,l,n.handler,g),m.splice(g--,1)}}if(q.isEmptyObject(r)){if(b=p.handle)b.elem=null;delete p.events,delete p.handle,typeof p=="function"?q.removeData(a,o):q.isEmptyObject(p)&&q.removeData(a)}}}}},trigger:function(a,c,d,e){var f=a.type||a;if(!e){a=typeof a=="object"?a[q.expando]?a:q.extend(q.Event(f),a):q.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),d||(a.stopPropagation(),q.event.global[f]&&q.each(q.cache,function(){this.events&&this.events[f]&&q.event.trigger(a,c,this.handle.elem)}));if(!d||d.nodeType===3||d.nodeType===8)return b;a.result=b,a.target=d,c=q.makeArray(c),c.unshift(a)}a.currentTarget=d,(e=d.nodeType?q.data(d,"handle"):(q.data(d,"__events__")||{}).handle)&&e.apply(d,c),e=d.parentNode||d.ownerDocument;try{d&&d.nodeName&&q.noData[d.nodeName.toLowerCase()]||d["on"+f]&&d["on"+f].apply(d,c)===!1&&(a.result=!1,a.preventDefault())}catch(g){}if(!a.isPropagationStopped()&&e)q.event.trigger(a,c,e,!0);else if(!a.isDefaultPrevented()){e=a.target;var h,i=f.replace(B,""),j=q.nodeName(e,"a")&&i==="click",k=q.event.special[i]||{};if((!k._default||k._default.call(d,a)===!1)&&!j&&!(e&&e.nodeName&&q.noData[e.nodeName.toLowerCase()])){try{if(e[i]){if(h=e["on"+i])e["on"+i]=null;q.event.triggered=!0,e[i]()}}catch(l){}h&&(e["on"+i]=h),q.event.triggered=!1}}},handle:function(c){var d,e,f;e=[];var g,h=q.makeArray(arguments);c=h[0]=q.event.fix(c||a.event),c.currentTarget=this,d=c.type.indexOf(".")<0&&!c.exclusive,d||(f=c.type.split("."),c.type=f.shift(),e=f.slice(0).sort(),f=RegExp("(^|\\.)"+e.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||e.join("."),g=q.data(this,this.nodeType?"events":"__events__"),typeof g=="function"&&(g=g.events),e=(g||{})[c.type];if(g&&e){e=e.slice(0),g=0;for(var i=e.length;g<i;g++){var j=e[g];if(d||f.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j,j=j.handler.apply(this,h),j!==b&&(c.result=j,j===!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[q.expando])return a;var c=a;a=q.Event(c);for(var d=this.props.length,e;d;)e=this.props[--d],a[e]=c[e];a.target||(a.target=a.srcElement||p),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement),a.pageX==null&&a.clientX!=null&&(c=p.documentElement,d=p.body,a.pageX=a.clientX+(c&&c.scrollLeft||d&&d.scrollLeft||0)-(c&&c.clientLeft||d&&d.clientLeft||0),a.pageY=a.clientY+(c&&c.scrollTop||d&&d.scrollTop||0)-(c&&c.clientTop||d&&d.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:q.proxy,special:{ready:{setup:q.bindReady,teardown:q.noop},live:{add:function(a){q.event.add(this,g(a.origType,a.selector),q.extend({},a,{handler:f,guid:a.handler.guid}))},remove:function(a){q.event.remove(this,g(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){q.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},q.removeEvent=p.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},q.Event=function(a){if(!this.preventDefault)return new q.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type):this.type=a,this.timeStamp=q.now(),this[q.expando]=!0},q.Event.prototype={preventDefault:function(){this.isDefaultPrevented=d;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=d;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=d,this.stopPropagation()},isDefaultPrevented:c,isPropagationStopped:c,isImmediatePropagationStopped:c};var I=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;b!==this&&(a.type=a.data,q.event.handle.apply(this,arguments))}catch(c){}},J=function(a){a.type=a.data,q.event.handle.apply(this,arguments)};q.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){q.event.special[a]={setup:function(c){q.event.add(this,b,c&&c.selector?J:I,a)},teardown:function(a){q.event.remove(this,b,a&&a.selector?J:I)}}}),q.support.submitBubbles||(q.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form")q.event.add(this,"click.specialSubmit",function(a){var c=a.target,d=c.type;if((d==="submit"||d==="image")&&q(c).closest("form").length){a.liveFired=b;return e("submit",this,arguments)}}),q.event.add(this,"keypress.specialSubmit",function(a){var c=a.target,d=c.type;if((d==="text"||d==="password")&&q(c).closest("form").length&&a.keyCode===13){a.liveFired=b;return e("submit",this,arguments)}});else return!1},teardown:function(){q.event.remove(this,".specialSubmit")}});if(!q.support.changeBubbles){var K,L=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?q.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},M=function(a,c){var d=a.target,e,f;if(!!C.test(d.nodeName)&&!d.readOnly){e=q.data(d,"_change_data"),f=L(d),(a.type!=="focusout"||d.type!=="radio")&&q.data(d,"_change_data",f);if(e!==b&&f!==e)if(e!=null||f){a.type="change",a.liveFired=b;return q.event.trigger(a,c,d)}}};q.event.special.change={filters:{focusout:M,beforedeactivate:M,click:function(a){var b=a.target,c=b.type;if(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")return M.call(this,a)},keydown:function(a){var b=a.target,c=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")return M.call(this,a)},beforeactivate:function(a){a=a.target,q.data(a,"_change_data",L(a))}},setup:function(){if(this.type==="file")return!1;for(var a in K)q.event.add(this,a+".specialChange",K[a]);return C.test(this.nodeName)},teardown:function(){q.event.remove(this,".specialChange");return C.test(this.nodeName)}},K=q.event.special.change.filters,K.focus=K.beforeactivate}p.addEventListener&&q.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=q.event.fix(a),a.type=b;return q.event.trigger(a,null,a.target)}q.event.special[b]={setup:function(){H[b]++===0&&p.addEventListener(a,c,!0)},teardown:function(){--H[b]===0&&p.removeEventListener(a,c,!0)}}}),q.each(["bind","one"],function(a,c){q.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(q.isFunction(d)||d===!1)e=d,d=b;var g=c==="one"?q.proxy(e,function(a){q(this).unbind(a,g);return e.apply(this,arguments)}):e;if(a==="unload"&&c!=="one")this.one(a,d,e);else{f=0;for(var h=this.length;f<h;f++)q.event.add(this[f],a,g,d)}return this}}),q.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else{c=0;for(var d=this.length;c<d;c++)q.event.remove(this[c],a,b)}return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){q.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=q.Event(a);c.preventDefault(),c.stopPropagation(),q.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){for(var b=arguments,c=1;c<b.length;)q.proxy(a,b[c++]);return this.click(q.proxy(a,function(d){var e=(q.data(this,"lastToggle"+a.guid)||0)%c;q.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 N={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};q.each(["live","die"],function(a,c){q.fn[c]=function(a,d,e,f){var h,i=0,j,k,l=f||this.selector;f=f?this:q(this.context);if(typeof a=="object"&&!a.preventDefault){for(h in a)f[c](h,d,a[h],l);return this}q.isFunction(d)&&(e=d,d=b);for(a=(a||"").split(" ");(h=a[i++])!=null;){j=B.exec(h),k="",j&&(k=j[0],h=h.replace(B,""));if(h==="hover")a.push("mouseenter"+k,"mouseleave"+k);else{j=h,h==="focus"||h==="blur"?(a.push(N[h]+k),h+=k):h=(N[h]||h)+k;if(c==="live"){k=0;for(var m=f.length;k<m;k++)q.event.add(f[k],"live."+g(h,l),{data:d,selector:l,handler:e,origType:h,origHandler:e,preType:j})}else f.unbind("live."+g(h,l),e)}}return this}}),q.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){q.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},q.attrFn&&(q.attrFn[b]=!0)}),a.attachEvent&&!a.addEventListener&&q(a).bind("unload",function(){for(var a in q.cache)if(q.cache[a].handle)try{q.event.remove(q.cache[a].handle.elem)}catch(b){}}),function(){function c(a,b,c,d,e,f){e=0;for(var g=d.length;e<g;e++){var h=d[e];if(h){h=h[a];for(var j=!1;h;){if(h.sizcache===c){j=d[h.sizset];break}if(h.nodeType===1){f||(h.sizcache=c,h.sizset=e);if(typeof b!="string"){if(h===b){j=!0;break}}else if(i.filter(b,[h]).length>0){j=h;break}}h=h[a]}d[e]=j}}}function a(a,b,c,d,e,f){e=0;for(var g=d.length;e<g;e++){var h=d[e];if(h){h=h[a];for(var i=!1;h;){if(h.sizcache===c){i=d[h.sizset];break}h.nodeType===1&&!f&&(h.sizcache=c,h.sizset=e);if(h.nodeName.toLowerCase()===b){i=h;break}h=h[a]}d[e]=i}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0;[0,0].sort(function(){h=!1;return 0});var i=function(a,b,c,e){c=c||[];var g=b=b||p;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!="string")return c;var h=[],l,m,o,q,r=!0,s=i.isXML(b),u=a,v;do{d.exec("");if(l=d.exec(u)){u=l[3],h.push(l[1]);if(l[2]){q=l[3];break}}}while(l);if(h.length>1&&k.exec(a))if(h.length===2&&j.relative[h[0]])m=t(h[0]+h[1],b);else for(m=j.relative[h[0]]?[b]:i(h.shift(),b);h.length;)a=h.shift(),j.relative[a]&&(a+=h.shift()),m=t(a,m);else{!e&&h.length>1&&b.nodeType===9&&!s&&j.match.ID.test(h[0])&&!j.match.ID.test(h[h.length-1])&&(l=
i.find(h.shift(),b,s),b=l.expr?i.filter(l.expr,l.set)[0]:l.set[0]);if(b){l=e?{expr:h.pop(),set:n(e)}:i.find(h.pop(),h.length===1&&(h[0]==="~"||h[0]==="+")&&b.parentNode?b.parentNode:b,s),m=l.expr?i.filter(l.expr,l.set):l.set,h.length>0?o=n(m):r=!1;for(;h.length;)l=v=h.pop(),j.relative[v]?l=h.pop():v="",l==null&&(l=b),j.relative[v](o,l,s)}else o=[]}o||(o=m),o||i.error(v||a);if(f.call(o)==="[object Array]")if(r)if(b&&b.nodeType===1)for(a=0;o[a]!=null;a++)o[a]&&(o[a]===!0||o[a].nodeType===1&&i.contains(b,o[a]))&&c.push(m[a]);else for(a=0;o[a]!=null;a++)o[a]&&o[a].nodeType===1&&c.push(m[a]);else c.push.apply(c,o);else n(o,c);q&&(i(q,g,c,e),i.uniqueSort(c));return c};i.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},i.matches=function(a,b){return i(a,null,null,b)},i.matchesSelector=function(a,b){return i(b,null,null,[a]).length>0},i.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=j.order.length;e<f;e++){var g=j.order[e],h;if(h=j.leftMatch[g].exec(a)){var i=h[1];h.splice(1,1);if(i.substr(i.length-1)!=="\\"){h[1]=(h[1]||"").replace(/\\/g,""),d=j.find[g](h,b,c);if(d!=null){a=a.replace(j.match[g],"");break}}}}d||(d=b.getElementsByTagName("*"));return{set:d,expr:a}},i.filter=function(a,c,d,e){for(var f=a,g=[],h=c,k,l,m=c&&c[0]&&i.isXML(c[0]);a&&c.length;){for(var n in j.filter)if((k=j.leftMatch[n].exec(a))!=null&&k[2]){var o=j.filter[n],p,q;q=k[1],l=!1,k.splice(1,1);if(q.substr(q.length-1)!=="\\"){h===g&&(g=[]);if(j.preFilter[n])if(k=j.preFilter[n](k,h,d,g,e,m)){if(k===!0)continue}else l=p=!0;if(k)for(var r=0;(q=h[r])!=null;r++)if(q){p=o(q,k,r,h);var s=e^!!p;d&&p!=null?s?l=!0:h[r]=!1:s&&(g.push(q),l=!0)}if(p!==b){d||(h=g),a=a.replace(j.match[n],"");if(!l)return[];break}}}if(a===f)if(l==null)i.error(a);else break;f=a}return h},i.error=function(a){throw"Syntax error, unrecognized expression: "+a};var j=i.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!/\W/.test(b);c=c&&!d,d&&(b=b.toLowerCase()),d=0;for(var e=a.length,f;d<e;d++)if(f=a[d]){for(;(f=f.previousSibling)&&f.nodeType!==1;);a[d]=c||f&&f.nodeName.toLowerCase()===b?f||!1:f===b}c&&i.filter(b,a,!0)},">":function(a,b){var c=typeof b=="string",d,e=0,f=a.length;if(c&&!/\W/.test(b)){for(b=b.toLowerCase();e<f;e++)if(d=a[e])c=d.parentNode,a[e]=c.nodeName.toLowerCase()===b?c:!1}else{for(;e<f;e++)if(d=a[e])a[e]=c?d.parentNode:d.parentNode===b;c&&i.filter(b,a,!0)}},"":function(b,d,f){var g=e++,h=c,i;typeof d=="string"&&!/\W/.test(d)&&(i=d=d.toLowerCase(),h=a),h("parentNode",d,g,b,i,f)},"~":function(b,d,f){var g=e++,h=c,i;typeof d=="string"&&!/\W/.test(d)&&(i=d=d.toLowerCase(),h=a),h("previousSibling",d,g,b,i,f)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){for(var c=[],d=b.getElementsByName(a[1]),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){return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(/\\/g,"")+" ";if(f)return a;f=0;for(var g;(g=b[f])!=null;f++)g&&(e^(g.className&&(" "+g.className+" ").replace(/[\t\n]/g," ").indexOf(a)>=0)?c||d.push(g):c&&(b[f]=!1));return!1},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){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}a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){b=a[1].replace(/\\/g,""),!f&&j.attrMap[b]&&(a[1]=j.attrMap[b]),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]=i(a[3],null,null,b);else{a=i.filter(a[3],b,c,!0^f),c||e.push.apply(e,a);return!1}else if(j.match.POS.test(a[0])||j.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){return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!i(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},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=j.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||i.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){b=b[3],c=0;for(d=b.length;c<d;c++)if(b[c]===a)return!1;return!0}i.error("Syntax error, unrecognized expression: "+e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":for(;d=d.previousSibling;)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":for(;d=d.nextSibling;)if(d.nodeType===1)return!1;return!0;case"nth":c=b[2];var e=b[3];if(c===1&&e===0)return!0;var f=b[0],g=a.parentNode;if(g&&(g.sizcache!==f||!a.nodeIndex)){var h=0;for(d=g.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++h);g.sizcache=f}d=a.nodeIndex-e;return c===0?d===0:d%c===0&&d/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1];c=j.attrHandle[c]?j.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c);var d=c+"",e=b[2],f=b[4];return c==null?e==="!=":e==="="?d===f:e==="*="?d.indexOf(f)>=0:e==="~="?(" "+d+" ").indexOf(f)>=0:f?e==="!="?d!==f:e==="^="?d.indexOf(f)===0:e==="$="?d.substr(d.length-f.length)===f:e==="|="?d===f||d.substr(0,f.length+1)===f+"-":!1:d&&c!==!1},POS:function(a,b,c,d){var e=j.setFilters[b[2]];if(e)return e(a,c,b,d)}}},k=j.match.POS,l=function(a,b){return"\\"+(b-0+1)},m;for(m in j.match)j.match[m]=RegExp(j.match[m].source+/(?![^\[]*\])(?![^\(]*\))/.source),j.leftMatch[m]=RegExp(/(^(?:.|\r|\n)*?)/.source+j.match[m].source.replace(/\\(\d+)/g,l));var n=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(p.documentElement.childNodes,0)}catch(o){n=function(a,b){var c=b||[],d=0;if(f.call(a)==="[object Array]")Array.prototype.push.apply(c,a);else if(typeof a.length=="number")for(var e=a.length;d<e;d++)c.push(a[d]);else for(;a[d];d++)c.push(a[d]);return c}}var r,s;p.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=a.parentNode,f=b.parentNode,h=e;if(a===b){g=!0;return 0}if(e===f)return s(a,b);if(!e)return-1;if(!f)return 1;for(;h;)c.unshift(h),h=h.parentNode;for(h=f;h;)d.unshift(h),h=h.parentNode;e=c.length,f=d.length;for(h=0;h<e&&h<f;h++)if(c[h]!==d[h])return s(c[h],d[h]);return h===e?s(a,d[h],-1):s(c[h],b,1)},s=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1}),i.getText=function(a){for(var b="",c,d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=i.getText(c.childNodes));return b},function(){var a=p.createElement("div"),c="script"+(new Date).getTime();a.innerHTML="<a name='"+c+"'/>";var d=p.documentElement;d.insertBefore(a,d.firstChild),p.getElementById(c)&&(j.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d)return(c=c.getElementById(a[1]))?c.id===a[1]||typeof c.getAttributeNode!="undefined"&&c.getAttributeNode("id").nodeValue===a[1]?[c]:b:[]},j.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=p.createElement("div");a.appendChild(p.createComment("")),a.getElementsByTagName("*").length>0&&(j.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){for(var d=[],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")!=="#"&&(j.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),p.querySelectorAll&&function(){var a=i,b=p.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){i=function(b,c,d,e){c=c||p;if(!e&&!i.isXML(c))if(c.nodeType===9)try{return n(c.querySelectorAll(b),d)}catch(f){}else if(c.nodeType===1&&c.nodeName.toLowerCase()!=="object"){var g=c.id,h=c.id="__sizzle__";try{return n(c.querySelectorAll("#"+h+" "+b),d)}catch(j){}finally{g?c.id=g:c.removeAttribute("id")}}return a(b,c,d,e)};for(var c in a)i[c]=a[c];b=null}}(),function(){var a=p.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,c=!1;try{b.call(p.documentElement,":sizzle")}catch(d){c=!0}b&&(i.matchesSelector=function(a,d){try{if(c||!j.match.PSEUDO.test(d))return b.call(a,d)}catch(e){}return i(d,null,null,[a]).length>0})}(),function(){var a=p.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>",!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0&&(a.lastChild.className="e",a.getElementsByClassName("e").length!==1&&(j.order.splice(1,0,"CLASS"),j.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null))}(),i.contains=p.documentElement.contains?function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:function(a,b){return!!(a.compareDocumentPosition(b)&16)},i.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?a.nodeName!=="HTML":!1};var t=function(a,b){for(var c=[],d="",e,f=b.nodeType?[b]:b;e=j.match.PSEUDO.exec(a);)d+=e[0],a=a.replace(j.match.PSEUDO,"");a=j.relative[a]?a+"*":a,e=0;for(var g=f.length;e<g;e++)i(a,f[e],c);return i.filter(d,c)};q.find=i,q.expr=i.selectors,q.expr[":"]=q.expr.filters,q.unique=i.uniqueSort,q.text=i.getText,q.isXMLDoc=i.isXML,q.contains=i.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=q.expr.match.POS;q.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),c=0,d=0,e=this.length;d<e;d++){c=b.length,q.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=q(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(q.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(h(this,a,!1),"not",a)},filter:function(a){return this.pushStack(h(this,a,!0),"filter",a)},is:function(a){return!!a&&q.filter(a,this).length>0},closest:function(a,b){var c=[],d,e,f=this[0];if(q.isArray(a)){var g={},h,i=1;if(f&&a.length){d=0;for(e=a.length;d<e;d++)h=a[d],g[h]||(g[h]=q.expr.match.POS.test(h)?q(h,b||this.context):h);for(;f&&f.ownerDocument&&f!==b;){for(h in g)d=g[h],(d.jquery?d.index(f)>-1:q(f).is(d))&&c.push({selector:h,elem:f,level:i});f=f.parentNode,i++}}return c}g=T.test(a)?q(a,b||this.context):null,d=0;for(e=this.length;d<e;d++)for(f=this[d];f;){if(g?g.index(f)>-1:q.find.matchesSelector(f,a)){c.push(f);break}f=f.parentNode;if(!f||!f.ownerDocument||f===b)break}c=c.length>1?q.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return q.inArray(this[0],a?q(a):this.parent().children());return q.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?q(a,b||this.context):q.makeArray(a),d=q.merge(this.get(),c);return this.pushStack(!c[0]||!c[0].parentNode||c[0].parentNode.nodeType===11||!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11?d:q.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),q.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return q.dir(a,"parentNode")},parentsUntil:function(a,b,c){return q.dir(a,"parentNode",c)},next:function(a){return q.nth(a,2,"nextSibling")},prev:function(a){return q.nth(a,2,"previousSibling")},nextAll:function(a){return q.dir(a,"nextSibling")},prevAll:function(a){return q.dir(a,"previousSibling")},nextUntil:function(a,b,c){return q.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return q.dir(a,"previousSibling",c)},siblings:function(a){return q.sibling(a.parentNode.firstChild,a)},children:function(a){return q.sibling(a.firstChild)},contents:function(a){return q.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:q.makeArray(a.childNodes)}},function(a,b){q.fn[a]=function(c,d){var e=q.map(this,b,c);O.test(a)||(d=c),d&&typeof d=="string"&&(e=q.filter(d,e)),e=this.length>1?q.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,S.call(arguments).join(","))}}),q.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?q.find.matchesSelector(b[0],a)?[b[0]]:[]:q.find.matches(a,b)},dir:function(a,c,d){var e=[];for(a=a[c];a&&a.nodeType!==9&&(d===b||a.nodeType!==1||!q(a).is(d));)a.nodeType===1&&e.push(a),a=a[c];return e},nth:function(a,b,c){b=b||1;for(var d=0;a;a=a[c])if(a.nodeType===1&&++d===b)break;return a},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var U=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,W=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,X=/<([\w:]+)/,Y=/<tbody/i,Z=/<|&#?\w+;/,$=/<(?:script|object|embed|option|style)/i,_=/checked\s*(?:[^=]|=\s*.checked.)/i,ba=/\=([^="'>\s]+\/)>/g,bb={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,"",""]};bb.optgroup=bb.option,bb.tbody=bb.tfoot=bb.colgroup=bb.caption=bb.thead,bb.th=bb.td,q.support.htmlSerialize||(bb._default=[1,"div<div>","</div>"]),q.fn.extend({text:function(a){if(q.isFunction(a))return this.each(function(b){var c=q(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||p).createTextNode(a));return q.text(this)},wrapAll:function(a){if(q.isFunction(a))return this.each(function(b){q(this).wrapAll(a.call(this,b))});if(this[0]){var b=q(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstChild&&a.firstChild.nodeType===1;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(q.isFunction(a))return this.each(function(b){q(this).wrapInner(a.call(this,b))});return this.each(function(){var b=q(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){q(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){q.nodeName(this,"body")||q(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=q(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,q(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||q.filter(a,[d]).length)!b&&d.nodeType===1&&(q.cleanData(d.getElementsByTagName("*")),q.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&q.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!q.support.noCloneEvent&&!q.isXMLDoc(this)){var a=this.outerHTML,b=this.ownerDocument;a||(a=b.createElement("div"),a.appendChild(this.cloneNode(!0)),a=a.innerHTML);return q.clean([a.replace(U,"").replace(ba,'="$1">').replace(V,"")],b)[0]}return this.cloneNode(!0)});a===!0&&(i(this,b),i(this.find("*"),b.find("*")));return b},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(U,""):null;if(typeof a=="string"&&!$.test(a)&&(q.support.leadingWhitespace||!V.test(a))&&!bb[(X.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(W,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(q.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else q.isFunction(a)?this.each(function(b){var c=q(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(q.isFunction(a))return this.each(function(b){var c=q(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=q(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;q(this).remove(),b?q(b).before(a):q(c).append(a)})}return this.pushStack(q(q.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,f,g=a[0],h=[],i;if(!q.support.checkClone&&arguments.length===3&&typeof g=="string"&&_.test(g))return this.each(function(){q(this).domManip(a,c,d,!0)});if(q.isFunction(g))return this.each(function(e){var f=q(this);a[0]=g.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=g&&g.parentNode,e=q.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:q.buildFragment(a,this,h),i=e.fragment;if(f=i.childNodes.length===1?i=i.firstChild:i.firstChild){c=c&&q.nodeName(f,"tr"),f=0;for(var k=this.length;f<k;f++)d.call(c?q.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):this[f]:this[f],f>0||e.cacheable||this.length>1?i.cloneNode(!0):i)}h.length&&q.each(h,j)}return this}}),q.buildFragment=function(a,b,c){var d,e,f;b=b&&b[0]?b[0].ownerDocument||b[0]:p,a.length===1&&typeof a[0]=="string"&&a[0].length<512&&b===p&&!$.test(a[0])&&(q.support.checkClone||!_.test(a[0]))&&(e=!0,(f=q.fragments[a[0]])&&f!==1&&(d=f)),d||(d=b.createDocumentFragment(),q.clean(a,b,d,c)),e&&(q.fragments[a[0]]=f?d:1);return{fragment:d,cacheable:e}},q.fragments={},q.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){q.fn[a]=function(c){var d=[];c=q(c);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&c.length===1){c[b](this[0]);return this}e=0;for(var f=c.length;e<f;e++){var g=(e>0?this.clone(!0):this).get();q(c[e])[b](g),d=d.concat(g)}return this.pushStack(d,a,c.selector)}}),q.extend({clean:function(a,b,c,d){b=b||p,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||p);for(var e=[],f=0,g;(g=a[f])!=null;f++){typeof g=="number"&&(g+="");if(g){if(typeof g=="string"&&!Z.test(g))g=b.createTextNode(g);else if(typeof g=="string"){g=g.replace(W,"<$1></$2>");var h=(X.exec(g)||["",""])[1].toLowerCase(),i=bb[h]||bb._default,j=i[0],k=b.createElement("div");for(k.innerHTML=i[1]+g+i[2];j--;)k=k.lastChild;if(!q.support.tbody){j=Y.test(g),h=h==="table"&&!j?k.firstChild&&k.firstChild.childNodes:i[1]==="<table>"&&!j?k.childNodes:[];for(i=h.length-1;i>=0;--i)q.nodeName(h[i],"tbody")&&!h[i].childNodes.length&&h[i].parentNode.removeChild(h[i])}!q.support.leadingWhitespace&&V.test(g)&&k.insertBefore(b.createTextNode(V.exec(g)[0]),k.firstChild),g=k.childNodes}g.nodeType?e.push(g):e=q.merge(e,g)}}if(c)for(f=0;e[f];f++)d&&q.nodeName(e[f],"script")&&(!e[f].type||e[f].type.toLowerCase()==="text/javascript")?d.push(e[f].parentNode?e[f].parentNode.removeChild(e[f]):e[f]):(e[f].nodeType===1&&e.splice.apply(e,[f+1,0].concat(q.makeArray(e[f].getElementsByTagName("script")))),c.appendChild(e[f]));return e},cleanData:function(a){for(var b,c,d=q.cache,e=q.event.special,f=q.support.deleteExpando,g=0,h;(h=a[g])!=null;g++)if(!h.nodeName||!q.noData[h.nodeName.toLowerCase()])if(c=h[q.expando]){if((b=d[c])&&b.events)for(var i in b.events)e[i]?q.event.remove(h,i):q.removeEvent(h,i,b.handle);f?delete h[q.expando]:h.removeAttribute&&h.removeAttribute(q.expando),delete d[c]}}});var bc=/alpha\([^)]*\)/i,bd=/opacity=([^)]*)/,be=/-([a-z])/ig,bf=/([A-Z])/g,bg=/^-?\d+(?:px)?$/i,bh=/^-?\d/,bi={position:"absolute",visibility:"hidden",display:"block"},bj=["Left","Right"],bk=["Top","Bottom"],bl,bm=p.defaultView&&p.defaultView.getComputedStyle,bn=function(a,b){return b.toUpperCase()};q.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return q.access(this,a,c,!0,function(a,c,d){return d!==b?q.style(a,c,d):q.css(a,c)})},q.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bl(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":q.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var f,g=q.camelCase(c),h=a.style,i=q.cssHooks[g];c=q.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)){typeof d=="number"&&!q.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=q.camelCase(c),g=q.cssHooks[f];c=q.cssProps[f]||f;if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bl)return bl(a,c,f)},swap:function(a,b,c){var d={},e;for(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(be,bn)}}),q.curCSS=q.css,q.each(["height","width"],function(a,b){q.cssHooks[b]={get:function(a,c,d){var e;if(c){a.offsetWidth!==0?e=k(a,b,d):q.swap(a,bi,function(){e=k(a,b,d)});return e+"px"}},set:function(a,b){if(!bg.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),q.support.opacity||(q.cssHooks.opacity={get:function(a,b){return bd.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=q.isNaN(b)?"":"alpha(opacity="+b*100+")",e=c.filter||"";c.filter=bc.test(e)?e.replace(bc,d):c.filter+" "+d}}),bm?bl=function(a,c,d){var e;d=d.replace(bf,"-$1").toLowerCase();if(!(c=a.ownerDocument.defaultView))return b;if(c=c.getComputedStyle(a,null))e=c.getPropertyValue(d),e===""&&!q.contains(a.ownerDocument.documentElement,a)&&(e=q.style(a,d));return e}:p.documentElement.currentStyle&&(bl=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;!bg.test(e)&&bh.test(e)&&(c=f.left,d=a.runtimeStyle.left,a.runtimeStyle.left=a.currentStyle.left,f.left=b==="fontSize"?"1em":e||0,e=f.pixelLeft+"px",f.left=c,a.runtimeStyle.left=d);return e}),q.expr&&q.expr.filters&&(q.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!q.support.reliableHiddenOffsets&&(a.style.display||q.css(a,"display"))==="none"},q.expr.filters.visible=function(a){return!q.expr.filters.hidden(a)});var bo=q.now(),bp=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bq=/^(?:select|textarea)/i,br=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bs=/^(?:GET|HEAD|DELETE)$/,bt=/\[\]$/,bu=/\=\?(&|$)/,bv=/\?/,bw=/([?&])_=[^&]*/,bx=/^(\w+:)?\/\/([^\/?#]+)/,by=/%20/g,bz=/#.*$/,bA=q.fn.load;q.fn.extend({load:function(a,b,c){if(typeof a!="string"&&bA)return bA.apply(this,arguments);if(!this.length)return this;var d=a.indexOf(" ");if(d>=0){var e=a.slice(d,a.length);a=a.slice(0,d)}d="GET",b&&(q.isFunction(b)?(c=b,b=null):typeof b=="object"&&(b=q.param(b,q.ajaxSettings.traditional),d="POST"));var f=this;q.ajax({url:a,type:d,dataType:"html",data:b,complete:function(a,b){(b==="success"||b==="notmodified")&&f.html(e?q("<div>").append(a.responseText.replace(bp,"")).find(e):a.responseText),c&&f.each(c,[a.responseText,b,a])}});return this},serialize:function(){return q.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?q.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bq.test(this.nodeName)||br.test(this.type))}).map(function(a,b){var c=q(this).val();return c==null?null:q.isArray(c)?q.map(c,function(a){return{name:b.name,value:a}}):{name:b.name,value:c}}).get()}}),q.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){q.fn[b]=function(a){return this.bind(b,a)}}),q.extend({get:function(a,b,c,d){q.isFunction(b)&&(d=d||c,c=b,b=null);return q.ajax({type:"GET",url:a,data:b,success:c,dataType:d})},getScript:function(a,b){return q.get(a,null,b,"script")},getJSON:function(a,b,c){return q.get(a,b,c,"json")},post:function(a,b,c,d){q.isFunction(b)&&(d=d||c,c=b,b={});return q.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},ajaxSetup:function(a){q.extend(q.ajaxSettings,a)},ajaxSettings:{url:location.href,global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,xhr:function(){return new a.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(c){var d=q.extend(!0,{},q.ajaxSettings,c),e,f,g,h=d.type.toUpperCase(),i=bs.test(h);d.url=d.url.replace(bz,""),d.context=c&&c.context!=null?c.context:d,d.data&&d.processData&&typeof d.data!="string"&&(d.data=q.param(d.data,d.traditional));if(d.dataType==="jsonp"){if(h==="GET")bu.test(d.url)||(d.url+=(bv.test(d.url)?"&":"?")+(d.jsonp||"callback")+"=?");else if(!d.data||!bu.test(d.data))d.data=(d.data?d.data+"&":"")+(d.jsonp||"callback")+"=?";d.dataType="json"}if(d.dataType==="json"&&(d.data&&bu.test(d.data)||bu.test(d.url))){e=d.jsonpCallback||"jsonp"+bo++,d.data&&(d.data=(d.data+"").replace(bu,"="+e+"$1")),d.url=d.url.replace(bu,"="+e+"$1"),d.dataType="script";var j=a[e];a[e]=function(c){g=c,q.handleSuccess(d,s,f,g),q.handleComplete(d,s,f,g);if(q.isFunction(j))j(c);else{a[e]=b;try{delete a[e]}catch(h){}}m&&m.removeChild(n)}}d.dataType==="script"&&d.cache===null&&(d.cache=!1);if(d.cache===!1&&h==="GET"){var k=q.now(),l=d.url.replace(bw,"$1_="+k);d.url=l+(l===d.url?(bv.test(d.url)?"&":"?")+"_="+k:"")}d.data&&h==="GET"&&(d.url+=(bv.test(d.url)?"&":"?")+d.data),d.global&&q.active++===0&&q.event.trigger("ajaxStart"),k=(k=bx.exec(d.url))&&(k[1]&&k[1]!==location.protocol||k[2]!==location.host);if(d.dataType==="script"&&h==="GET"&&k){var m=p.getElementsByTagName("head")[0]||p.documentElement,n=p.createElement("script");d.scriptCharset&&(n.charset=d.scriptCharset),n.src=d.url;if(!e){var o=!1;n.onload=n.onreadystatechange=function(){!o&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")&&(o=!0,q.handleSuccess(d,s,f,g),q.handleComplete(d,s,f,g),n.onload=n.onreadystatechange=null,m&&n.parentNode&&m.removeChild(n))}}m.insertBefore(n,m.firstChild);return b}var r=!1,s=d.xhr();if(s){d.username?s.open(h,d.url,d.async,d.username,d.password):s.open(h,d.url,d.async);try{(d.data!=null&&!i||c&&c.contentType)&&s.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(q.lastModified[d.url]&&s.setRequestHeader("If-Modified-Since",q.lastModified[d.url]),q.etag[d.url]&&s.setRequestHeader("If-None-Match",q.etag[d.url])),k||s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Accept",d.dataType&&d.accepts[d.dataType]?d.accepts[d.dataType]+", */*; q=0.01":d.accepts._default)}catch(t){}if(d.beforeSend&&d.beforeSend.call(d.context,s,d)===!1){d.global&&q.active--===1&&q.event.trigger("ajaxStop"),s.abort();return!1}d.global&&q.triggerGlobal(d,"ajaxSend",[s,d]);var u=s.onreadystatechange=function(a){if(!s||s.readyState===0||a==="abort")r||q.handleComplete(d,s,f,g),r=!0,s&&(s.onreadystatechange=q.noop);else if(!r&&s&&(s.readyState===4||a==="timeout")){r=!0,s.onreadystatechange=q.noop,f=a==="timeout"?"timeout":q.httpSuccess(s)?d.ifModified&&q.httpNotModified(s,d.url)?"notmodified":"success":"error";var b;if(f==="success")try{g=q.httpData(s,d.dataType,d)}catch(c){f="parsererror",b=c}f==="success"||f==="notmodified"?e||q.handleSuccess(d,s,f,g):q.handleError(d,s,f,b),e||q.handleComplete(d,s,f,g),a==="timeout"&&s.abort(),d.async&&(s=null)}};try{var v=s.abort;s.abort=function(){s&&v.call&&v.call(s),u("abort")}}catch(w){}d.async&&d.timeout>0&&setTimeout(function(){s&&!r&&u("timeout")},d.timeout);try{s.send(i||d.data==null?null:d.data)}catch(x){q.handleError(d,s,null,x),q.handleComplete(d,s,f,g)}d.async||u();return s}},param:function(a,c){var d=[],e=function(a,b){b=q.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=q.ajaxSettings.traditional);if(q.isArray(a)||a.jquery)q.each(a,function(){e(this.name,this.value)});else for(var f in a)l(f,a[f],c,e);return d.join("&").replace(by,"+")}}),q.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,c,d){a.error&&a.error.call(a.context,b,c,d),a.global&&q.triggerGlobal(a,"ajaxError",[b,a,d])},handleSuccess:function(a,b,c,d){a.success&&a.success.call(a.context,d,c,b),a.global&&q.triggerGlobal(a,"ajaxSuccess",[b,a])},handleComplete:function(a,b,c){a.complete&&a.complete.call(a.context,b,c),a.global&&q.triggerGlobal(a,"ajaxComplete",[b,a]),a.global&&q.active--===1&&q.event.trigger("ajaxStop")},triggerGlobal:function(a,b,c){(a.context&&a.context.url==null?q(a.context):q.event).trigger(b,c)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return!1},httpNotModified:function(a,b){var c=a.getResponseHeader("Last-Modified"),d=a.getResponseHeader("Etag");c&&(q.lastModified[b]=c),d&&(q.etag[b]=d);return a.status===304},httpData:function(a,b,c){var d=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&d.indexOf("xml")>=0;a=e?a.responseXML:a.responseText,e&&a.documentElement.nodeName==="parsererror"&&q.error("parsererror"),c&&c.dataFilter&&(a=c.dataFilter(a,b)),typeof a=="string"&&(b==="json"||!b&&d.indexOf("json")>=0?a=q.parseJSON(a):(b==="script"||!b&&d.indexOf("javascript")>=0)&&q.globalEval(a));return a}}),a.ActiveXObject&&(q.ajaxSettings.xhr=function(){if(a.location.protocol!=="file:")try{return new a.XMLHttpRequest}catch(b){}try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}),q.support.ajax=!!q.ajaxSettings.xhr();var bB={},bC=/^(?:toggle|show|hide)$/,bD=/^([+\-]=)?([\d+.\-]+)(.*)$/,bE,bF=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];q.fn.extend({show:function(a,b,c){if(a||a===0)return this.animate(m("show",3),a,b,c);a=0;for(b=this.length;a<b;a++)!q.data(this[a],"olddisplay")&&this[a].style.display==="none"&&(this[a].style.display=""
),this[a].style.display===""&&q.css(this[a],"display")==="none"&&q.data(this[a],"olddisplay",n(this[a].nodeName));for(a=0;a<b;a++)this[a].style.display=q.data(this[a],"olddisplay")||"";return this},hide:function(a,b,c){if(a||a===0)return this.animate(m("hide",3),a,b,c);a=0;for(b=this.length;a<b;a++)c=q.css(this[a],"display"),c!=="none"&&q.data(this[a],"olddisplay",c);for(a=0;a<b;a++)this[a].style.display="none";return this},_toggle:q.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";q.isFunction(a)&&q.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:q(this).is(":hidden");q(this)[b?"show":"hide"]()}):this.animate(m("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=q.speed(b,c,d);if(q.isEmptyObject(a))return this.each(e.complete);return this[e.queue===!1?"each":"queue"](function(){var b=q.extend({},e),c,d=this.nodeType===1,f=d&&q(this).is(":hidden"),g=this;for(c in a){var h=q.camelCase(c);c!==h&&(a[h]=a[c],delete a[c],c=h);if(a[c]==="hide"&&f||a[c]==="show"&&!f)return b.complete.call(this);d&&(c==="height"||c==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],q.css(this,"display")==="inline"&&q.css(this,"float")==="none"&&(q.support.inlineBlockNeedsLayout?n(this.nodeName)==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1):this.style.display="inline-block")),q.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=q.extend({},a),q.each(a,function(c,d){var e=new q.fx(g,b,c);if(bC.test(d))e[d==="toggle"?f?"show":"hide":d](a);else{var h=bD.exec(d),i=e.cur(!0)||0;if(h){var j=parseFloat(h[2]),k=h[3]||"px";k!=="px"&&(q.style(g,c,(j||1)+k),i=(j||1)/e.cur(!0)*i,q.style(g,c,i+k)),h[1]&&(j=(h[1]==="-="?-1:1)*j+i),e.custom(i,j,k)}else e.custom(i,d,"")}});return!0})},stop:function(a,b){var c=q.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}}),q.each({slideDown:m("show",1),slideUp:m("hide",1),slideToggle:m("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){q.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),q.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?q.extend({},a):{complete:c||!c&&b||q.isFunction(a)&&a,duration:a,easing:c&&b||b&&!q.isFunction(b)&&b};d.duration=q.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in q.fx.speeds?q.fx.speeds[d.duration]:q.fx.speeds._default,d.old=d.complete,d.complete=function(){d.queue!==!1&&q(this).dequeue(),q.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={})}}),q.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(q.fx.step[this.prop]||q.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=parseFloat(q.css(this.elem,this.prop));return a&&a>-1e4?a:0},custom:function(a,b,c){function d(a){return e.step(a)}this.startTime=q.now(),this.start=a,this.end=b,this.unit=c||this.unit||"px",this.now=this.start,this.pos=this.state=0;var e=this;a=q.fx,d.elem=this.elem,d()&&q.timers.push(d)&&!bE&&(bE=setInterval(a.tick,a.interval))},show:function(){this.options.orig[this.prop]=q.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),q(this.elem).show()},hide:function(){this.options.orig[this.prop]=q.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=q.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&&!q.support.shrinkWrapBlocks){var e=this.elem,f=this.options;q.each(["","X","Y"],function(a,b){e.style["overflow"+b]=f.overflow[a]})}this.options.hide&&q(this.elem).hide();if(this.options.hide||this.options.show)for(var g in this.options.curAnim)q.style(this.elem,g,this.options.orig[g]);this.options.complete.call(this.elem)}return!1}a=b-this.startTime,this.state=a/this.options.duration,b=this.options.easing||(q.easing.swing?"swing":"linear"),this.pos=q.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},q.extend(q.fx,{tick:function(){for(var a=q.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||q.fx.stop()},interval:13,stop:function(){clearInterval(bE),bE=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){q.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}}}),q.expr&&q.expr.filters&&(q.expr.filters.animated=function(a){return q.grep(q.timers,function(b){return a===b.elem}).length});var bG=/^t(?:able|d|h)$/i,bH=/^(?:body|html)$/i;q.fn.offset="getBoundingClientRect"in p.documentElement?function(a){var b=this[0],c;if(a)return this.each(function(b){q.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return q.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,f=e.documentElement;if(!c||!q.contains(f,b))return c||{top:0,left:0};b=e.body,e=o(e);return{top:c.top+(e.pageYOffset||q.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:c.left+(e.pageXOffset||q.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(b){q.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return q.offset.bodyOffset(b);q.offset.initialize();var c=b.offsetParent,d=b.ownerDocument,e,f=d.documentElement,g=d.body;e=(d=d.defaultView)?d.getComputedStyle(b,null):b.currentStyle;for(var h=b.offsetTop,i=b.offsetLeft;(b=b.parentNode)&&b!==g&&b!==f;){if(q.offset.supportsFixedPosition&&e.position==="fixed")break;e=d?d.getComputedStyle(b,null):b.currentStyle,h-=b.scrollTop,i-=b.scrollLeft,b===c&&(h+=b.offsetTop,i+=b.offsetLeft,q.offset.doesNotAddBorder&&(!q.offset.doesAddBorderForTableAndCells||!bG.test(b.nodeName))&&(h+=parseFloat(e.borderTopWidth)||0,i+=parseFloat(e.borderLeftWidth)||0),c=b.offsetParent),q.offset.subtractsBorderForOverflowNotVisible&&e.overflow!=="visible"&&(h+=parseFloat(e.borderTopWidth)||0,i+=parseFloat(e.borderLeftWidth)||0),e=e}if(e.position==="relative"||e.position==="static")h+=g.offsetTop,i+=g.offsetLeft;q.offset.supportsFixedPosition&&e.position==="fixed"&&(h+=Math.max(f.scrollTop,g.scrollTop),i+=Math.max(f.scrollLeft,g.scrollLeft));return{top:h,left:i}},q.offset={initialize:function(){var a=p.body,b=p.createElement("div"),c,d,e,f=parseFloat(q.css(a,"marginTop"))||0;q.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>",a.insertBefore(b,a.firstChild),c=b.firstChild,d=c.firstChild,e=c.nextSibling.firstChild.firstChild,this.doesNotAddBorder=d.offsetTop!==5,this.doesAddBorderForTableAndCells=e.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!==f,a.removeChild(b),q.offset.initialize=q.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;q.offset.initialize(),q.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(q.css(a,"marginTop"))||0,c+=parseFloat(q.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=q.css(a,"position");d==="static"&&(a.style.position="relative");var e=q(a),f=e.offset(),g=q.css(a,"top"),h=q.css(a,"left"),i=d==="absolute"&&q.inArray("auto",[g,h])>-1;d={};var j={};i&&(j=e.position()),g=i?j.top:parseInt(g,10)||0,h=i?j.left:parseInt(h,10)||0,q.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(d.top=b.top-f.top+g),b.left!=null&&(d.left=b.left-f.left+h),"using"in b?b.using.call(a,d):e.css(d)}},q.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=bH.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(q.css(a,"marginTop"))||0,c.left-=parseFloat(q.css(a,"marginLeft"))||0,d.top+=parseFloat(q.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(q.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||p.body;a&&!bH.test(a.nodeName)&&q.css(a,"position")==="static";)a=a.offsetParent;return a})}}),q.each(["Left","Top"],function(a,c){var d="scroll"+c;q.fn[d]=function(c){var e=this[0],f;if(!e)return null;return c!==b?this.each(function(){(f=o(this))?f.scrollTo(a?q(f).scrollLeft():c,a?c:q(f).scrollTop()):this[d]=c}):(f=o(e))?"pageXOffset"in f?f[a?"pageYOffset":"pageXOffset"]:q.support.boxModel&&f.document.documentElement[d]||f.document.body[d]:e[d]}}),q.each(["Height","Width"],function(a,c){var d=c.toLowerCase();q.fn["inner"+c]=function(){return this[0]?parseFloat(q.css(this[0],d,"padding")):null},q.fn["outer"+c]=function(a){return this[0]?parseFloat(q.css(this[0],d,a?"margin":"border")):null},q.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(q.isFunction(a))return this.each(function(b){var c=q(this);c[d](a.call(this,b,c[d]()))});return q.isWindow(e)?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+c]||e.document.body["client"+c]:e.nodeType===9?Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]):a===b?parseFloat(q.css(e,d)):this.css(d,typeof a=="string"?a:a+"px")}})})(window),function(a,b){var c;a.rails=c={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]",selectChangeSelector:"select[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input:file",CSRFProtection:function(b){var c=a('meta[name="csrf-token"]').attr("content");c&&b.setRequestHeader("X-CSRF-Token",c)},fire:function(b,c,d){var e=a.Event(c);b.trigger(e,d);return e.result!==!1},confirm:function(a){return confirm(a)},ajax:function(b){return a.ajax(b)},handleRemote:function(d){var e,f,g,h=d.data("cross-domain")||null,i=d.data("type")||a.ajaxSettings&&a.ajaxSettings.dataType;if(c.fire(d,"ajax:before")){if(d.is("form")){e=d.attr("method"),f=d.attr("action"),g=d.serializeArray();var j=d.data("ujs:submit-button");j&&(g.push(j),d.data("ujs:submit-button",null))}else d.is("select")?(e=d.data("method"),f=d.data("url"),g=d.serialize(),d.data("params")&&(g=g+"&"+d.data("params"))):(e=d.data("method"),f=d.attr("href"),g=d.data("params")||null);options={type:e||"GET",data:g,dataType:i,crossDomain:h,beforeSend:function(a,e){e.dataType===b&&a.setRequestHeader("accept","*/*;q=0.5, "+e.accepts.script);return c.fire(d,"ajax:beforeSend",[a,e])},success:function(a,b,c){d.trigger("ajax:success",[a,b,c])},complete:function(a,b){d.trigger("ajax:complete",[a,b])},error:function(a,b,c){d.trigger("ajax:error",[a,b,c])}},f&&a.extend(options,{url:f}),c.ajax(options)}},handleMethod:function(c){var d=c.attr("href"),e=c.data("method"),f=a("meta[name=csrf-token]").attr("content"),g=a("meta[name=csrf-param]").attr("content"),h=a('<form method="post" action="'+d+'"></form>'),i='<input name="_method" value="'+e+'" type="hidden" />';g!==b&&f!==b&&(i+='<input name="'+g+'" value="'+f+'" type="hidden" />'),h.hide().append(i).appendTo("body"),h.submit()},disableFormElements:function(b){b.find(c.disableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with",b[c]()),b[c](b.data("disable-with")),b.attr("disabled","disabled")})},enableFormElements:function(b){b.find(c.enableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with")&&b[c](b.data("ujs:enable-with")),b.removeAttr("disabled")})},allowAction:function(a){var b=a.data("confirm"),d=!1,e;if(!b)return!0;c.fire(a,"confirm")&&(d=c.confirm(b),e=c.fire(a,"confirm:complete",[d]));return d&&e},blankInputs:function(b,c,d){var e=a(),f,g=c||"input,textarea";b.find(g).each(function(){f=a(this);if(d?f.val():!f.val())e=e.add(f)});return e.length?e:!1},nonBlankInputs:function(a,b){return c.blankInputs(a,b,!0)},stopEverything:function(b){a(b.target).trigger("ujs:everythingStopped"),b.stopImmediatePropagation();return!1},callFormSubmitBindings:function(c){var d=c.data("events"),e=!0;d!==b&&d.submit!==b&&a.each(d.submit,function(a,b){if(typeof b.handler=="function")return e=b.handler(b.data)});return e}},"ajaxPrefilter"in a?a.ajaxPrefilter(function(a,b,d){a.crossDomain||c.CSRFProtection(d)}):a(document).ajaxSend(function(a,b,d){d.crossDomain||c.CSRFProtection(b)}),a(c.linkClickSelector).live("click.rails",function(d){var e=a(this);if(!c.allowAction(e))return c.stopEverything(d);if(e.data("remote")!==b){c.handleRemote(e);return!1}if(e.data("method")){c.handleMethod(e);return!1}}),a(c.selectChangeSelector).live("change.rails",function(b){var d=a(this);if(!c.allowAction(d))return c.stopEverything(b);c.handleRemote(d);return!1}),a(c.formSubmitSelector).live("submit.rails",function(d){var e=a(this),f=e.data("remote")!==b,g=c.blankInputs(e,c.requiredInputSelector),h=c.nonBlankInputs(e,c.fileInputSelector);if(!c.allowAction(e))return c.stopEverything(d);if(g&&c.fire(e,"ajax:aborted:required",[g]))return c.stopEverything(d);if(f){if(h)return c.fire(e,"ajax:aborted:file",[h]);if(!a.support.submitBubbles&&c.callFormSubmitBindings(e)===!1)return c.stopEverything(d);c.handleRemote(e);return!1}setTimeout(function(){c.disableFormElements(e)},13)}),a(c.formInputClickSelector).live("click.rails",function(b){var d=a(this);if(!c.allowAction(d))return c.stopEverything(b);var e=d.attr("name"),f=e?{name:e,value:d.val()}:null;d.closest("form").data("ujs:submit-button",f)}),a(c.formSubmitSelector).live("ajax:beforeSend.rails",function(b){this==b.target&&c.disableFormElements(a(this))}),a(c.formSubmitSelector).live("ajax:complete.rails",function(b){this==b.target&&c.enableFormElements(a(this))})}(jQuery),function(a){if(navigator.platform.indexOf("iPhone")!=-1||navigator.platform.indexOf("iPod")!=-1||navigator.platform.indexOf("iPad")!=-1)a.browser.ios=!0;a.fn.console=function(b){function bc(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/</g,"&lt;").replace(/ /g,"&nbsp;").replace(/\n/g,"<br />").replace(/([^<>&]{10})/g,"$1"+g)}function bb(){var a=p,b="";if(o>0&&a=="")b=f;else if(o==p.length)b=bc(a)+f;else{var c=a.substring(0,o),d=a.substring(o,o+1);d&&(d='<span class="jquery-console-cursor">'+bc(d)+"</span>");var e=a.substring(o+1);b=bc(c)+d+bc(e)}l.html(b),L()}function ba(){}function _(a){if(typeof a=="string"){var b=a.charCodeAt();return b>="A".charCodeAt()&&b<="Z".charCodeAt()||b>="a".charCodeAt()&&b<="z".charCodeAt()||b>="0".charCodeAt()&&b<="9".charCodeAt()}return!1}function Z(){while(o-1>=0&&!_(p[o-1])&&V());while(o-1>=0&&_(p[o-1])&&V());}function Y(){while(o<p.length&&!_(p[o])&&U());while(o<p.length&&_(p[o])&&U());}function X(){T(p.length-o)&&bb()}function W(){T(-o)&&bb()}function V(){if(T(-1)){bb();return!0}return!1}function U(){if(T(1)){bb();return!0}return!1}function T(a){if(o+a>=0&&o+a<=p.length){o+=a;return!0}return!1}function S(b,c){var d=a('<div class="jquery-console-message"></div>');c&&d.addClass(c),d.filledText(b.trim()).hide(),i.append(d),lines=b.split("\n").length,offset=11,lines>10?d.slideDown(lines*offset,function(){L()}):d.show()}function R(b){o=-1,bb(),o=0,p="",t=0,P(),k=a('<div class="jquery-console-prompt-box"></div>');var c=a('<span class="jquery-console-prompt-label"></span>'),d=b;k.append(c.text(d).show()),c.html(c.html().replace(" ","&nbsp;")),l=a('<span class="jquery-console-prompt"></span>'),k.append(l),i.append(k),bb()}function Q(a,b){o=-1,bb();if(typeof a=="string")S(a,b);else for(var c in a){var d=a[c];S(d.msg,d.className)}y()}function P(){v=!0}function O(){v=!1}function N(){if(typeof b.commandHandle=="function"){O(),E(p);var a=p;x.continuedPrompt?r?r+="\n"+p:r=p:r=undefined,r&&(a=r);var c=function(a){Q(a)},d=function(a){Q(a,"jquery-console-message-error")},e=function(){Q()},f=function(a,b){Q(a,"jquery-console-message-"+b)},g=function(a){R(a)};b.commandHandle(a,Q,g)}}function M(){typeof b.cancelHandle=="function"&&b.cancelHandle()}function L(){i.attr({scrollTop:i.attr("scrollHeight")})}function K(){var a=p;if(typeof b.commandValidate=="function"){var c=b.commandValidate(a);c==!0||c==!1?c&&N():Q(c,"jquery-console-message-error")}else N()}function J(){while(o<p.length&&!_(p[o]))F(),bb();while(o<p.length&&_(p[o]))F(),bb()}function I(){while(F())bb()}function H(){F()&&bb()}function G(){T(-1)&&(F(),bb())}function F(){if(o<p.length){p=p.substring(0,o)+p.substring(o+1),q=p;return!0}return!1}function E(a){s.push(a),q=""}function D(){B(1)}function C(){B(-1)}function B(a){if(s.length!=0){t+=a,t<0?t=s.length:t>s.length&&(t=0);var c=p;t==0?p=q:p=s[t-1],b.historyPreserveColumn?p.length<o+1?o=p.length:o==0&&(o=p.length):o=p.length,bb()}}function A(a){return(a.keyCode==c.tab||a.keyCode==192)&&a.altKey}function z(a){j.consoleInsert(a)}function y(){o=0,p="",t=0,P(),k=a('<div class="jquery-console-prompt-box"></div>');var b=a('<span class="jquery-console-prompt-label"></span>'),c=x.continuedPrompt?n:m;k.append(b.text(c).show()),b.html(b.html().replace(" ","&nbsp;")),l=a('<span class="jquery-console-prompt"></span>'),k.append(l),i.append(k),bb()}if(!a.browser.ios)var c={37:V,39:U,38:C,40:D,8:G,46:H,35:X,36:W,13:K,10:K,18:ba};else var c={127:G,10:K,13:K,8:G};var d={65:W,69:X,68:H,78:D,80:C,66:V,70:U,75:I},e={70:Y,66:Z,68:J},f='<span class="jquery-console-cursor">&nbsp;</span>',g=a.browser.opera?"":"<wbr>&shy;",h=a(this),i=a('<div class="jquery-console-inner"></div>'),j=a('<textarea class="jquery-console-typer"></textarea>'),k,l,m=b&&b.promptLabel?b.promptLabel:"> ",n=b&&b.continuedPromptLabel?b.continuedPromptLabel:"> ",o=0,p="",q="",r="",s=[],t=0,u=0,v=!0,w=!1,x={};(function(){h.append(i),i.append(j),j.css({position:"absolute",top:0,left:"-9999px"}),b.welcomeMessage&&S(b.welcomeMessage,"jquery-console-welcome"),y(),b.autofocus&&(i.addClass("jquery-console-focus"),j.focus(),setTimeout(function(){i.addClass("jquery-console-focus"),j.focus()},100)),x.inner=i,x.typer=j,x.scrollToBottom=L})(),x.reset=function(){var c=typeof b.welcomeMessage!="undefined";i.parent().fadeOut(function(){i.find("div").each(function(){c?c=!1:a(this).remove()}),y(),i.parent().fadeIn(function(){i.addClass("jquery-console-focus"),j.focus()})})},x.notice=function(b,c){var d=a('<div class="notice"></div>').append(a("<div></div>").text(b)).css({visibility:"hidden"});h.append(d);var e=!0;if(c=="fadeout")setTimeout(function(){d.fadeOut(function(){d.remove()})},4e3);else if(c=="prompt"){var f=a('<br/><div class="action"><a href="javascript:">OK</a><div class="clear"></div></div>');d.append(f),e=!1,f.click(function(){d.fadeOut(function(){d.remove(),i.css({opacity:1})})})}var g=d.height();d.css({height:"0px",visibility:"visible"}).animate({height:g+"px"},function(){e||i.css({opacity:.5})}),d.css("cursor","default");return d},h.click(function(){i.addClass("jquery-console-focus"),i.removeClass("jquery-console-nofocus"),j.focus(),L();return!1}),j.blur(function(){i.removeClass("jquery-console-focus"),i.addClass("jquery-console-nofocus")}),j.bind("paste",function(a){j.val(""),setTimeout(function(){j.consoleInsert(j.val()),j.val("")},0)}),j.keydown(function(a){u=0;var b=a.keyCode;if(a.ctrlKey&&b==67){u=b,M();return!1}if(b==229){var f="'";a.shiftKey&&(f='"'),z(f);return!1}if(v){if(b in c){u=b,c[b]();return!1}if(a.ctrlKey&&b in d){u=b,d[b]();return!1}if(a.altKey&&b in e){u=b,e[b]();return!1}}}),j.keypress(function(c){var d=c.keyCode||c.which;if(A(c))return!1;if(c.ctrlKey&&String.fromCharCode(d).toLowerCase()=="v")return!0;if(v&&u!=d&&d>=32){if(u)return!1;(typeof b.charInsertTrigger=="undefined"||typeof b.charInsertTrigger=="function"&&b.charInsertTrigger(d,p))&&j.consoleInsert(d)}if(a.browser.webkit||a.browser.mozilla)return!1}),j.consoleInsert=function(a){var b=isNaN(a)?a:String.fromCharCode(a),c=p.substring(0,o),d=p.substring(o);p=c+b+d,T(b.length),q=p,bb()},x.promptText=function(a){a&&(p=a,o=p.length,bb());return p},x.setPromptLabel=function(a){m=a};return x},a.fn.filledText=function(b){a(this).text(b),a(this).html(a(this).html().replace(/ /g,"&nbsp;").replace(/\n/g,"<br/>").replace(/\\n/g,"<br/>"));return this}}(jQuery),function(a){function k(){if(!i()){a("#facebox_overlay").fadeOut(200,function(){a("#facebox_overlay").removeClass("facebox_overlayBG"),a("#facebox_overlay").addClass("facebox_hide"),a("#facebox_overlay").remove()});return!1}}function j(){if(!i()){a("#facebox_overlay").length==0&&a("body").append('<div id="facebox_overlay" class="facebox_hide"></div>'),a("#facebox_overlay").hide().addClass("facebox_overlayBG").css("opacity",a.facebox.settings.opacity).click(function(){a(document).trigger("close.facebox")}).fadeIn(200);return!1}}function i(){return a.facebox.settings.overlay==!1||a.facebox.settings.opacity===null}function h(b,c){a.get(b,function(b){a.facebox.reveal(b,c)})}function g(b,c){var d=new Image;d.onload=function(){a.facebox.reveal('<div class="image"><img src="'+d.src+'" /></div>',c)},d.src=b}function f(b,c){if(b.match(/#/)){var d=window.location.href.split("#")[0],e=b.replace(d,"");if(e=="#")return;a.facebox.reveal(a(e).html(),c)}else b.match(a.facebox.settings.imageTypesRegexp)?g(b,c):h(b,c)}function e(){var b=a.facebox.settings;b.loadingImage=b.loading_image||b.loadingImage,b.closeImage=b.close_image||b.closeImage,b.imageTypes=b.image_types||b.imageTypes,b.faceboxHtml=b.facebox_html||b.faceboxHtml}function d(){var a;self.innerHeight?a=self.innerHeight:document.documentElement&&document.documentElement.clientHeight?a=document.documentElement.clientHeight:document.body&&(a=document.body.clientHeight);return a}function c(){var a,b;self.pageYOffset?(b=self.pageYOffset,a=self.pageXOffset):document.documentElement&&document.documentElement.scrollTop?(b=document.documentElement.scrollTop,a=document.documentElement.scrollLeft):document.body&&(b=document.body.scrollTop,a=document.body.scrollLeft);return[a,b]}function b(b){if(a.facebox.settings.inited)return!0;a.facebox.settings.inited=!0,a(document).trigger("init.facebox"),e();var c=a.facebox.settings.imageTypes.join("|");a.facebox.settings.imageTypesRegexp=new RegExp(".("+c+")$","i"),b&&a.extend(a.facebox.settings,b),a("body").append(a.facebox.settings.faceboxHtml);var d=[new Image,new Image];d[0].src=a.facebox.settings.closeImage,d[1].src=a.facebox.settings.loadingImage,a("#facebox").find(".b:first, .bl").each(function(){d.push(new Image),d.slice(-1).src=a(this).css("background-image").replace(/url\((.+)\)/,"$1")}),a("#facebox .close").click(a.facebox.close),a("#facebox .close_image").attr("src",a.facebox.settings.closeImage)}a.facebox=function(b,c){a.facebox.loading(),b.ajax?h(b.ajax,c):b.image?g(b.image,c):b.div?f(b.div,c):a.isFunction(b)?b.call(a):a.facebox.reveal(b,c)},a.extend(a.facebox,{settings:{opacity:.2,overlay:!0,loadingImage:"",closeImage:"",imageTypes:["png","jpg","jpeg","gif"],faceboxHtml:'\n    <div id="facebox" style="display:none;"> \n      <div class="popup"> \n        <div class="content"> \n        </div> \n        <a href="#" class="close"><img src="//d31j3wkilayjeo.cloudfront.net/assets/sidebar-close-4d6487820b9567bc3936399b0e413c91.png" title="close" class="close_image" /></a> \n      </div> \n    </div>'},loading:function(){b();if(a("#facebox .loading").length==1)return!0;j(),a("#facebox .content").empty(),a("#facebox .body").children().hide().end().append('<div class="loading"><img src="'+a.facebox.settings.loadingImage+'"/></div>'),a("#facebox").css({top:c()[1]+d()/10,left:a(window).width()/2-205}).show(),a(document).bind("keydown.facebox",function(b){b.keyCode==27&&a.facebox.close();return!0}),a(document).trigger("loading.facebox")},reveal:function(b,c){a(document).trigger("beforeReveal.facebox"),c&&a("#facebox .content").addClass(c),a("#facebox .content").append(b),a("#facebox .loading").remove(),a("#facebox .body").children().fadeIn("normal"),a("#facebox").css("left",a(window).width()/2-a("#facebox .popup").width()/2),a(document).trigger("reveal.facebox").trigger("afterReveal.facebox")},close:function(){a(document).trigger("close.facebox");return!1}}),a.fn.facebox=function(c){function d(){a.facebox.loading(!0);var b=this.rel.match(/facebox\[?\.(\w+)\]?/);b&&(b=b[1]),f(this.href,b);return!1}if(a(this).length!=0){b(c);return this.bind("click.facebox",d)}},a(document).bind("close.facebox",function(){a(document).unbind("keydown.facebox"),a("#facebox").fadeOut(function(){a("#facebox .content").removeClass().addClass("content"),a("#facebox .loading").remove(),a(document).trigger("afterClose.facebox")}),k()})}(jQuery),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}}();var JSON;JSON||(JSON={}),function(){function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c<f;c+=1)h[c]=str(c,i)||"null";e=h.length===0?"[]":gap?"[\n"+gap+h.join(",\n"+gap)+"\n"+g+"]":"["+h.join(",")+"]",gap=g;return e}if(rep&&typeof rep=="object"){f=rep.length;for(c=0;c<f;c+=1)typeof rep[c]=="string"&&(d=rep[c],e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e))}else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e));e=h.length===0?"{}":gap?"{\n"+gap+h.join(",\n"+gap)+"\n"+g+"}":"{"+h.join(",")+"}",gap=g;return e}}function quote(a){escapable.lastIndex=0;return escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function f(a){return a<10?"0"+a:a}"use strict",typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(a,b,c){var d;gap="",indent="";if(typeof c=="number")for(d=0;d<c;d+=1)indent+=" ";else typeof c=="string"&&(indent=c);rep=b;if(b&&typeof b!="function"&&(typeof b!="object"||typeof b.length!="number"))throw new Error("JSON.stringify");return str("",{"":a})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e=="object")for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),d!==undefined?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver=="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")})}(),function(){var a=this,b=a.Backbone,c;typeof exports!="undefined"?c=exports:c=a.Backbone={},c.VERSION="0.5.2";var d=a._;!d&&typeof require!="undefined"&&(d=require("underscore")._);var e=a.jQuery||a.Zepto;c.noConflict=function(){a.Backbone=b;return this},c.emulateHTTP=!1,c.emulateJSON=!1,c.Events={bind:function(a,b,c){var d=this._callbacks||(this._callbacks={}),e=d[a]||(d[a]=[]);e.push([b,c]);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(d[e]&&b===d[e][0]){d[e]=null;break}}return this},trigger:function(a){var b,c,d,e,f,g=2;if(!(c=this._callbacks))return this;while(g--){d=g?a:"all";if(b=c[d])for(var h=0,i=b.length;h<i;h++)(e=b[h])?(f=g?Array.prototype.slice.call(arguments,1):arguments,e[0].apply(e[1]||this,f)):(b.splice(h,1),h--,i--)}return this}},c.Model=function(a,b){var c;a||(a={});if(c=this.defaults)d.isFunction(c)&&(c=c.call(this)),a=d.extend({},c,a);this.attributes={},this._escapedAttributes={},this.cid=d.uniqueId("c"),this.set(a,{silent:!0}),this._changed=!1,this._previousAttributes=d.clone(this.attributes),b&&b.collection&&(this.collection=b.collection),this.initialize(a,b)},d.extend(c.Model.prototype,c.Events,{_previousAttributes:null,_changed:!1,idAttribute:"id",initialize:function(){},toJSON:function(){return d.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]=w(c==null?"":""+c)},has:function(a){return this.attributes[a]!=null},set:function(a,b){b||(b={});if(!a)return this;a.attributes&&(a=a.attributes);var c=this.attributes,e=this._escapedAttributes;if(!b.silent&&this.validate&&!this._performValidation(a,b))return!1;this.idAttribute in a&&(this.id=a[this.idAttribute]);var f=this._changing;this._changing=!0;for(var g in a){var h=a[g];d.isEqual(c[g],h)||(c[g]=h,delete e[g],this._changed=!0,b.silent||this.trigger("change:"+g,this,h,b))}!f&&!b.silent&&this._changed&&this.change(b),this._changing=!1;return this},unset:function(a,b){if(!(a in this.attributes))return this;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],a==this.idAttribute&&delete this.id,this._changed=!0,b.silent||(this.trigger("change:"+a,this,void 0,b),this.change(b));return this},clear:function(a){a||(a={});var b,c=this.attributes,d={};for(b in c)d[b]=void 0;if(!a.silent&&this.validate&&!this._performValidation(d,a))return!1;this.attributes={},this._escapedAttributes={},this._changed=!0;if(!a.silent){for(b in c)this.trigger("change:"+b,this,void 0,a);this.change(a)}return this},fetch:function(a){a||(a={});var b=this,d=a.success;a.success=function(c,e,f){if(!b.set(b.parse(c,f),a))return!1;d&&d(b,c)},a.error=v(a.error,b,a);return(this.sync||c.sync).call(this,"read",this,a)},save:function(a,b){b||(b={});if(a&&!this.set(a,b))return!1;var d=this,e=b.success;b.success=function(a,c,f){if(!d.set(d.parse(a,f),b))return!1;e&&e(d,a,f)},b.error=v(b.error,d,b);var f=this.isNew()?"create":"update";return(this.sync||c.sync).call(this,f,this,b)},destroy:function(a){a||(a={});if(this.isNew())return this.trigger("destroy",this,this.collection,a);var b=this,d=a.success;a.success=function(c){b.trigger("destroy",b,b.collection,a),d&&d(b,c)},a.error=v(a.error,b,a);return(this.sync||c.sync).call(this,"delete",this,a)},url:function(){var a=t(this.collection)||this.urlRoot||u();if(this.isNew())return a;return a+(a.charAt(a.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},parse:function(a,b){return a},clone:function(){return new this.constructor(this)},isNew:function(){return this.id==null},change:function(a){this.trigger("change",this,a),this._previousAttributes=d.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 b=this._previousAttributes,c=!1;for(var e in a)d.isEqual(b[e],a[e])||(c=c||{},c[e]=a[e]);return c},previous:function(a){if(!a||!this._previousAttributes)return null;return this._previousAttributes[a]},previousAttributes:function(){return d.clone(this._previousAttributes)},_performValidation:function(a,b){var c=this.validate(a);if(c){b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}return!0}}),c.Collection=function(a,b){b||(b={}),b.comparator&&(this.comparator=b.comparator),d.bindAll(this,"_onModelEvent","_removeReference"),this._reset(),a&&this.reset(a,{silent:!0}),this.initialize.apply(this,arguments)},d.extend(c.Collection.prototype,c.Events,{model:c.Model,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){if(d.isArray(a))for(var c=0,e=a.length;c<e;c++)this._add(a[c],b);else this._add(a,b);return this},remove:function(a,b){if(d.isArray(a))for(var c=0,e=a.length;c<e;c++)this._remove(a[c],b);else this._remove(a,b);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("reset",this,a);return this},pluck:function(a){return d.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]),b||(b={}),this.each(this._removeReference),this._reset(),this.add(a,{silent:!0}),b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a||(a={});var b=this,d=a.success;a.success=function(c,e,f){b[a.add?"add":"reset"](b.parse(c,f),a),d&&d(b,c)},a.error=v(a.error,b,a);return(this.sync||c.sync).call(this,"read",this,a)},create:function(a,b){var c=this;b||(b={}),a=this._prepareModel(a,b);if(!a)return!1;var d=b.success;b.success=function(a,e,f){c.add(a,b),d&&d(a,e,f)},a.save(null,b);return a},parse:function(a,b){return a},chain:function(){return d(this.models).chain()},_reset:function(a){this.length=0,this.models=[],this._byId={},this._byCid={}},_prepareModel:function(a,b){if(a instanceof c.Model)a.collection||(a.collection=this);else{var d=a;a=new this.model(d,{collection:this}),a.validate&&!a._performValidation(d,b)&&(a=!1)}return a},_add:function(a,b){b||(b={}),a=this._prepareModel(a,b);if(!a)return!1;var c=this.getByCid(a);if(c)throw new Error(["Can't add the same model to a set twice",c.id]);this._byId[a.id]=a,this._byCid[a.cid]=a;var d=b.at!=null?b.at:this.comparator?this.sortedIndex(a,this.comparator):this.length;this.models.splice(d,0,a),a.bind("all",this._onModelEvent),this.length++,b.silent||a.trigger("add",a,this,b);return a},_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],this.models.splice(this.indexOf(a),1),this.length--,b.silent||a.trigger("remove",a,this,b),this._removeReference(a);return a},_removeReference:function(a){this==a.collection&&delete a.collection,a.unbind("all",this._onModelEvent)},_onModelEvent:function(a,b,c,d){if(a!="add"&&a!="remove"||c==this)a=="destroy"&&this._remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,arguments)}});var f=["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","sortBy","sortedIndex","toArray","size","first","rest","last","without","indexOf","lastIndexOf","isEmpty"];d.each(f,function(a){c.Collection.prototype[a]=function(){return d[a].apply(d,[this.models].concat(d.toArray(arguments)))}}),c.Router=function(a){a||(a={}),a.routes&&(this.routes=a.routes),this._bindRoutes(),this.initialize.apply(this,arguments)};var g=/:([\w\d]+)/g,h=/\*([\w\d]+)/g,i=/[-[\]{}()+?.,\\^$|#\s]/g;d.extend(c.Router.prototype,c.Events,{initialize:function(){},route:function(a,b,e){c.history||(c.history=new c.History),d.isRegExp(a)||(a=this._routeToRegExp(a)),c.history.route(a,d.bind(function(c){var d=this._extractParameters(a,c);e.apply(this,d),this.trigger.apply(this,["route:"+b].concat(d))},this))},navigate:function(a,b){c.history.navigate(a,b)},_bindRoutes:function(){if(!!this.routes){var a=[];for(var b in this.routes)a.unshift([b,this.routes[b]]);for(var c=0,d=a.length;c<d;c++)this.route(a[c][0],a[c][1],this[a[c][1]])}},_routeToRegExp:function(a){a=a.replace(i,"\\$&").replace(g,"([^/]*)").replace(h,"(.*?)");return new RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}}),c.History=function(){this.handlers=[],d.bindAll(this,"checkUrl")};var j=/^#*/,k=/msie [\w.]+/,l=!1;d.extend(c.History.prototype,{interval:50,getFragment:function(a,b){if(a==null)if(this._hasPushState||b){a=window.location.pathname;var c=window.location.search;c&&(a+=c),a.indexOf(this.options.root)==0&&(a=a.substr(this.options.root.length))}else a=window.location.hash;return a.replace(j,"")},start:function(a){if(l)throw new Error("Backbone.history has already been started");this.options=d.extend({},{root:"/"},this.options,a),this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&window.history&&window.history.pushState);var b=this.getFragment(),c=document.documentMode,f=k.exec(navigator.userAgent.toLowerCase())&&(!c||c<=7);f&&(this.iframe=e('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(b)),this._hasPushState?e(window).bind("popstate",this.checkUrl):"onhashchange"in window&&!f?e(window).bind("hashchange",this.checkUrl):setInterval(this.checkUrl,this.interval),this.fragment=b,l=!0;var g=window.location,h=g.pathname==this.options.root;if(this._wantsPushState&&!this._hasPushState&&!h){this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment);return!0}this._wantsPushState&&this._hasPushState&&h&&g.hash&&(this.fragment=g.hash.replace(j,""),window.history.replaceState({},document.title,g.protocol+"//"+g.host+this.options.root+this.fragment));return this.loadUrl()},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(a){var b=this.getFragment();b==this.fragment&&this.iframe&&(b=this.getFragment(this.iframe.location.hash));if(b==this.fragment||b==decodeURIComponent(this.fragment))return!1;this.iframe&&this.navigate(b),this.loadUrl()||this.loadUrl(window.location.hash)},loadUrl:function(a){var b=this.fragment=this.getFragment(a),c=d.any(this.handlers,function(a){if(a.route.test(b)){a.callback(b);return!0}});return c},navigate:function(a,b){var c=(a||"").replace(j,"");if(this.fragment!=c&&this.fragment!=decodeURIComponent(c)){if(this._hasPushState){var d=window.location;c.indexOf(this.options.root)!=0&&(c=this.options.root+c),this.fragment=c,window.history.pushState({},document.title,d.protocol+"//"+d.host+c)}else window.location.hash=this.fragment=c,this.iframe&&c!=this.getFragment(this.iframe.location.hash)&&(this.iframe.document.open().close(),this.iframe.location.hash=c);b&&this.loadUrl(a)}}}),c.View=function(a){this.cid=d.uniqueId("view"),this._configure(a||{}),this._ensureElement(),this.delegateEvents(),this.initialize.apply(this,arguments)};var m=function(a){return e(a,this.el)},n=/^(\S+)\s*(.*)$/,o=["model","collection","el","id","attributes","className","tagName"];d.extend(c.View.prototype,c.Events,{tagName:"div",$:m,initialize:function(){},render:function(){return this},remove:function(){e(this.el).remove();return this},make:function(a,b,c){var d=document.createElement(a);b&&e(d).attr(b),c&&e(d).html(c);return d},delegateEvents:function(a){if(!!a||!!(a=this.events)){e(this.el).unbind(".delegateEvents"+this.cid);for(var b in a){var c=this[a[b]];if(!c)throw new Error('Event "'+a[b]+'" does not exist');var f=b.match(n),g=f[1],h=f[2];c=d.bind(c,this),g+=".delegateEvents"+this.cid,h===""?e(this.el).bind(g,c):e(this.el).delegate(h,g,c)}}},_configure:function(a){this.options&&(a=d.extend({},this.options,a));for(var b=0,c=o.length;b<c;b++){var e=o[b];a[e]&&(this[e]=a[e])}this.options=a},_ensureElement:function(){if(!this.el){var a=this.attributes||{};this.id&&(a.id=this.id),this.className&&(a["class"]=this.className),this.el=this.make(this.tagName,a)}else d.isString(this.el)&&(this.el=e(this.el).get(0))}});var p=function(a,b){var c=s(this,a,b);c.extend=this.extend;return c};c.Model.extend=c.Collection.extend=c.Router.extend=c.View.extend=p;var q={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};c.sync=function(a,b,f){var g=q[a],h=d.extend({type:g,dataType:"json"},f);h.url||(h.url=t(b)||u()),!h.data&&b&&(a=="create"||a=="update")&&(h.contentType="application/json",h.data=JSON.stringify(b.toJSON())),c.emulateJSON&&(h.contentType="application/x-www-form-urlencoded",h.data=h.data?{model:h.data}:{}),c.emulateHTTP&&(g==="PUT"||g==="DELETE")&&(c.emulateJSON&&(h.data._method=g),h.type="POST",h.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",g)}),h.type!=="GET"&&(h.processData=!1);return e.ajax(h)};var r=function(){},s=function(a,b,c){var e;b&&b.hasOwnProperty("constructor")?e=b.constructor:e=function(){return a.apply(this,arguments)},d.extend(e,a),r.prototype=a.prototype,e.prototype=new r,b&&d.extend(e.prototype,b),c&&d.extend(e,c),e.prototype.constructor=e,e.__super__=a.prototype;return e},t=function(a){if(!a||!a.url)return null;return d.isFunction(a.url)?a.url():a.url},u=function(){throw new Error('A "url" property or function must be specified')},v=function(a,b,c){return function(d){a?a(b,d,c):b.trigger("error",b,d,c)}},w=function(a){return a.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}}.call(this),function(){window.CourseApp={supports_pushstate:window.history!=null&&window.history.pushState!=null,log:function(a){if(typeof console!="undefined"&&console!==null&&console.log!=null)return console.log(a)},render_html:function(a){var b,c,d,e,f,g,h,i,j;h=$("#resource-tabs"),g=$("#resource-group"),$("#rendered_html").length>0&&(c=$("#rendered_html"),i=$("#challenge-panels nav a"),e=$("#challenge-panels .panel"),b=e.eq(i.index(c)),c.parent().remove(),b.remove()),f=new CourseApp.Resource({anchor:"render",id:"rendered_html",panel_id:"rendered_html",render:{iframe:a}}),d=new CourseApp.TabHeader({model:f}),h.append(d.render().el),j=new CourseApp.IframeTab({model:f}),g.append(j.render().el),j.afterInsertIntoDom();return d.focus()},inject_javascript:function(a){var b,c,d,e;d=$("#resource_iframe");if(d.length!==1){b=d[0].contentWindow.document,c=b.getElementsByTagName("head")[0],e=b.createElement("script"),e.innerHTML=a;return c.appendChild(e)}},inject_coffeescript:function(a){var b;try{b=CoffeeScript.compile(a,{bare:"on"});return CourseApp.inject_javascript(b)}catch(c){return CourseApp.log(c)}},compile_coffeescript:function(a){var b;try{b=CoffeeScript.compile(a,{bare:"on"}),$("#rendered_coffeescript_code code").html(b),$("#rendered_coffeescript_code code").attr({"data-parsed":!1});return CodeHighlighter.init()}catch(c){return CourseApp.log(c.message)}},initializeTabState:function(){var a,b,c,d,e,f,g;g=$("#challenge-panels nav li a"),d=$("#challenge-panels .panel"),c=$(".editor-tab"),f=$(".resource-tab"),a=$("#editor-group"),b=$(".editor.panel"),e=$(".resource-panel"),c.first().addClass("active editor-active"),a.addClass("active"),b.first().addClass("active editor-active"),f.first().addClass("resource-active"),e.first().addClass("resource-active");return $("#challenge-panels").delegate("nav li a","click",function(b){var c,e,f;b.preventDefault(),g=$("#challenge-panels nav a"),d=$("#challenge-panels .panel"),g.removeClass("active"),d.removeClass("active"),e=$(this),c=d.eq(g.index(e)),e.addClass("active");if(e.hasClass("editor-tab")){g.removeClass("editor-active"),d.removeClass("editor-active"),e.addClass("editor-active"),c.addClass("active editor-active"),a.addClass("active"),CourseApp.editors.map(function(a){return a.set({focused:!1})}),f=CourseApp.editors.models[g.index(e)];return f.set({focused:!0})}g.removeClass("resource-active"),d.removeClass("resource-active"),e.addClass("resource-active"),c.addClass("active resource-active");return a.removeClass("active")})}}}.call(this),function(){CourseApp.ChallengePage=Backbone.Router.extend({routes:{"levels/:level_id/challenges/:id":"home","levels/:level_id":"level_home"},initialize:function(){this.hintsHeaderView=new CourseApp.HintsHeader({model:CourseApp.hints_header_model}),this.hintsContentView=new CourseApp.HintsContent({model:CourseApp.hint_manager,active_challenge:CourseApp.active_challenge});return this.resourceTabsView=new CourseApp.ResourceTabs({collection:CourseApp.tabs,hints_content:this.hintsContentView,hints_header:this.hintsHeaderView})},home:function(a,b){var c;CourseApp.log("in home"),CourseApp.reload&&window.location.reload(),jQuery("#resource-tabs").empty(),jQuery("#resource-group").empty(),CourseApp.firstRender?this.resourceTabsView.render():(CourseApp.log("viewing level "+a+" and challenge "+b),c="/levels/"+a+"/challenges/"+b,CourseApp.hint_manager.url=""+c+"/hints",CourseApp.tabs.url=""+c+"/tabs",CourseApp.hint_manager.fetch(),CourseApp.tabs.fetch());return CourseApp.firstRender=!1},level_home:function(a){return window.location.reload()}})}.call(this),function(){CourseApp.Challenge=Backbone.Model.extend({}),CourseApp.Challenges=Backbone.Collection.extend({model:CourseApp.Challenge,url:"/levels/1/challenges"}),CourseApp.Resource=Backbone.Model.extend({view_class:function(){return this.get("render").iframe!=null?CourseApp.IframeTab:this.get("render").html!=null?CourseApp.HtmlTab:CourseApp.Tab}}),CourseApp.Resources=Backbone.Collection.extend({model:CourseApp.Resource}),CourseApp.Hint=Backbone.Model.extend({}),CourseApp.UsedHints=Backbone.Collection.extend({model:CourseApp.UsedHint}),CourseApp.HintManager=Backbone.Model.extend({}),CourseApp.Level=Backbone.Model.extend({}),CourseApp.Editor=Backbone.Model.extend({}),CourseApp.Editors=Backbone.Collection.extend({model:CourseApp.Editor}),CourseApp.SubmitModel=Backbone.Model.extend({}),CourseApp.Lab=Backbone.Model.extend({}),CourseApp.Failure=Backbone.Model.extend({})}.call(this),function(a){var b=1,c={},d=new RegExp("^(https?://)?gist.github.com/([0-9]+)(#file_(.*))?$");a.gist=function(c,d,e){!c||c===a?a(document).gist():(e=e||["gist",c,b++].join("-"),a("<div />",{id:e}).appendTo("body").gist(c,d))},a.gist.url=function(b,c){var e,f=!1;if(!b&&(e=a(this)).is("a")){var g=d.exec(e.attr("href"));g&&(f=g[1]=="https://",b=g[2],c=g[4]||c)}else typeof b=="object"&&(c=typeof b.file=="function"?b.file.apply(this):b.file,b=typeof b.id=="function"?b.id.apply(this):b.id);if(!b)return null;var h=(f?"https":"http")+"://gist.github.com/"+b+".json?";c&&(h+="file="+c+"&"),h+="callback=?";return h},a.fn.gist=function(b,d){if(this.length!==0){if(!b&&!this.is("a"))return this.find("a").gist();for(var e=0,f=this.length;e<f;e++){var g=this[e],h=a.gist.url.apply(g,arguments);h&&a.ajax({url:h,dataType:"json",data:{},context:g,success:function(b){a(b.div).replaceAll(this).trigger("gistloaded",b),b.stylesheet&&!c[b.stylesheet]&&(a(document.head).find("link[rel=stylesheet]").filter(function(){return this.href==b.stylesheet}).length||a(document.head).append('<link rel="stylesheet" href="'+b.stylesheet+'"/>'),c[b.stylesheet]=b.stylesheet)}})}return this}}}(jQuery),function(){CourseApp.Console=Backbone.View.extend({className:"editor console panel",initialize:function(){_.bindAll(this,"render","commandValidate","commandHandle","cancelHandle","handleExpirement","handleChallengeAttempt","handleChallengeChange","goToNextChallenge","goToPreviousChallenge"),this.model.bind("change",this.render);if(this.options.challenge!=null)return this.options.challenge.bind("change",this.render)},render:function(){this.cancelFlag=!1,this.editor==null&&(this.editor=jQuery(this.el).console({promptLabel:this.model.get("prompt"),animateScroll:!0,promptHistory:!0,welcomeMessage:this.model.get("welcome_message"),autofocus:!0,commandValidate:this.commandValidate,commandHandle:this.commandHandle,cancelHandle:this.cancelHandle})),jQuery(this.el).attr({id:"editor"+this.model.get("id")});return this},commandValidate:function(a){return a!==""},doSubmitCode:function(a){var b;CourseApp.inExpirementMode?this.options.challenge.get("url").match(/play/)?b=this.options.challenge.get("url"):b=""+this.options.challenge.get("url")+"/play":b=this.options.challenge.get("url"),jQuery.ajax({type:"PUT",url:b,data:{cmd:a},success:this.commandSuccess,dataType:"json"});return jQuery(this.el).addClass("loading")},goToPreviousChallenge:function(a){var b;this.options.challenge.get("url").match(/play/)?b=this.options.challenge.get("url").replace(/play/,"previous"):b=""+this.options.challenge.get("url")+"/previous",CourseApp.inExpirementMode=!1,jQuery.ajax({type:"GET",url:b,success:this.handleChallengeChange,dataType:"json"});if(a==null)return this.current_prompt(this.model.get("prompt"))},goToNextChallenge:function(a){var b;this.options.challenge.get("url").match(/play/)?b=this.options.challenge.get("url").replace(/play/,"next"):b=""+this.options.challenge.get("url")+"/next",CourseApp.inExpirementMode=!1,jQuery.ajax({type:"GET",url:b,success:this.handleChallengeChange,dataType:"json"});if(a==null)return this.current_prompt(this.model.get("prompt"))},commandHandle:function(a,b,c){this.current_line=a,this.current_report=b,this.current_prompt=c,_.bindAll(this,"commandSuccess");if(this.current_nesting_level!=null&&this.current_nesting_level!==0)return this.doSubmitCode(this.current_line);switch(this.current_line){case"clear":return this.editor.reset();case"next":return this.goToNextChallenge();case"help":return this.goToNextChallenge();case"back":return this.goToPreviousChallenge();default:return this.doSubmitCode(this.current_line)}},handleChallengeChange:function(a){var b;CourseApp.reload=a.reload,CourseApp.reload||this.options.challenge!=null&&this.options.challenge.set(a);if(a.path!=null){b=a.path,b[0]==="/"&&(b=b.substring(1,b.length));return CourseApp.app.navigate(b,!0)}},cancelHandle:function(){return this.cancelFlag=!0},blur:function(){return this.editor.blur()},commandSuccess:function(a,b,c){CourseApp.inExpirementMode?this.handleExpirement(a,b,c):this.handleChallengeAttempt(a,b,c);return jQuery(this.el).removeClass("loading")},handleExpirement:function(a,b,c){CourseApp.log("handleExpirement");if(a.go_to_next_challenge){a.hide_output?this.current_report(""):this.current_nesting_level!=null&&this.current_nesting_level>0?this.outputDots(this.current_nesting_level):this.current_report(""+this.model.get("result_prompt")+" "+a.output);return this.goToNextChallenge(!0)}this.options.challenge.set({instructions:a.instructions,title:a.title}),this.current_nesting_level=a.nesting_level,a.extra_output!=null&&CourseApp[a.extra_output.call]!=null&&CourseApp[a.extra_output.call](a.extra_output.cmd);return this.current_nesting_level!=null&&this.current_nesting_level>0?this.outputDots(this.current_nesting_level):a.hide_output?this.current_report(""):this.current_report(""+this.model.get("result_prompt")+" "+a.output)},outputDots:function(a){var b,c;b="";for(c=0;c<a;c+=1)b=""+b+"..";return this.current_prompt(""+b+"\t")},handleSuccessConsoleOutput:function(a){return this.current_nesting_level!=null&&this.current_nesting_level>0?this.outputDots(this.current_nesting_level):a.hide_output?this.current_report(""):this.current_report({msg1:{msg:""+this.model.get("result_prompt")+" "+a.output},msg2:{msg:a.result,className:"jquery-console-success-message"}})},handleFailureConsoleOutput:function(a){return this.current_nesting_level!=null&&this.current_nesting_level>0?this.outputDots(this.current_nesting_level):a.result!==a.output?this.model.get("expirement_until_correct")?this.current_report({msg1:{msg:""+this.model.get("result_prompt")+" "+a.output}}):a.hide_output?this.current_report({msg1:{msg:a.result,className:"jquery-console-error-message"}}):a.show_output_only?this.current_report({msg1:{msg:""+this.model.get("result_prompt")+" "+a.output}}):this.current_report({msg1:{msg:""+this.model.get("result_prompt")+" "+a.output},msg2:{msg:a.result,className:"jquery-console-error-message"}}):this.current_report(""+this.model.get("result_prompt")+" "+a.output)},handleChallengeAttempt:function(a,b,c){var d,e;this.current_nesting_level=a.nesting_level;if(a.success){a.extra_output!=null&&CourseApp[a.extra_output.call]!=null&&CourseApp[a.extra_output.call](a.extra_output.cmd),a.expirement?(CourseApp.inExpirementMode=!0,a.expirement_prompt!=null&&this.editor.setPromptLabel(a.expirement_prompt),d=""+this.options.challenge.get("url")+"/play",this.options.challenge.set({url:d,instructions:a.instructions,title:a.title})):(this.options.current_user!=null&&this.options.current_user.set({points:a.total_points}),this.options.challenges!=null&&a.challenges!=null&&this.options.challenges.reset(a.challenges),a.next_challenge!=null&&(a.next_challenge.console?this.handleChallengeChange(a.next_challenge):(e=new CourseApp.SuccessBox({model:a}),e.render())));return this.handleSuccessConsoleOutput(a)}return this.handleFailureConsoleOutput(a)}}),CourseApp.ConsoleSubmit=Backbone.View.extend({tagName:"footer",template:"console_submit",initialize:function(){_.bindAll(this,"render");return this.template=window.JST[this.template]},render:function(){jQuery(this.el).html(this.template);return this}})}.call(this),function(){CourseApp.ChallengeDetails=Backbone.View.extend({el:"#challenge-objective",initialize:function(){_.bindAll(this,"render","revealTitleAndInstructions","revealTitle","revealInstructions"),this.template=window.JST.challenge_details;return this.model.bind("change",this.render)},render:function(){var a;CourseApp.log("rendering this template"),CourseApp.log(this.template),a=this.template(this.model.toJSON()),jQuery(this.el).html(a);return this},revealTitleAndInstructions:function(){setTimeout(this.revealTitle,100);return setTimeout(this.revealInstructions,400)},revealTitle:function(){return this.$("h1.reveal").removeClass("reveal")},revealInstructions:function(){return this.$("p.reveal").removeClass("reveal")}})}.call(this),function(){CourseApp.EditorGroup=Backbone.View.extend({el:"#challenge-panels",template:"editor_group",events:{"click #manual_submit"
:"submitCode"},submitCode:function(a){var b,c,d;a!=null&&a.preventDefault(),this.submit_model.set({loading:!0}),c=_.map(this.editor_views,function(a){return a.getCode()}),b=c.join("#########################"),d=this.collection.first().get("url");return jQuery.ajax({type:"PUT",url:d,data:{cmd:b},success:this.handleSubmission,dataType:"json"})},handleSubmission:function(a,b,c){var d,e,f,g;this.submit_model.set({loading:!1});if(!a.success){e=new CourseApp.FailureBox({model:new CourseApp.Failure(a)});return e.render()}_.map(this.editor_views,function(a){return a.blur()}),f=new CourseApp.SuccessBox({model:a}),f.render(),g=jQuery("#sidebar"),g.addClass("increase"),setTimeout(function(){return g.removeClass("increase")},1e3),this.options.current_user!=null&&this.options.current_user.set({points:a.total_points});if(this.options.challenges!=null){d=this.options.challenges.get(a.id);if(d!=null)return d.set({completed:!0})}},initialize:function(){_.bindAll(this,"render","handleSubmission","submitCode"),this.template=window.JST[this.template],this.collection.bind("reset",this.render);return this.delegateEvents(this.events)},render:function(){var a,b,c,d,e,f,g,h;jQuery(this.el).html(this.template({})),this.$(".editor").length===0&&(c=this.collection,a=this.options.challenge,h=this.$("#editor-tabs"),e=this.$("#editor-group"),d=this.options.current_user,b=this.options.challenges,g=this,this.editor_views=c.map(function(c){var f,i;f=new CourseApp.EditorTabHeader({model:c}),h.append(f.render().el),c.get("type")==="console"?i=new CourseApp.Console({model:c,challenge:a,current_user:d,challenges:b,parent:g}):i=new CourseApp.TextEditor({model:c,challenge:a,current_user:d,challenges:b,parent:g}),e.append(i.render().el),CourseApp.editor_views==null&&(CourseApp.editor_views=[]),CourseApp.editor_views.push(i);return i}),f=c.any(function(a){return a.get("type")!=="console"}),f?this.submit_model==null&&(this.submit_model=new CourseApp.SubmitModel,this.submit_view=new CourseApp.TextEditorSubmit({model:this.submit_model,editors:this.collection}),e.append(this.submit_view.render().el)):(this.submit_view=new CourseApp.ConsoleSubmit,e.append(this.submit_view.render().el)));return this}}),CourseApp.EditorTabHeader=Backbone.View.extend({tagName:"li",template:"editor_tab_header",initialize:function(){_.bindAll(this,"render");return this.template=window.JST[this.template]},render:function(){jQuery(this.el).html(this.template(this.model.toJSON()));return this}})}.call(this),function(){CourseApp.FailureBox=Backbone.View.extend({template:"failure",initialize:function(){_.bindAll(this,"render");return this.template=JST[this.template]},render:function(){var a,b;a=this.template(_.extend(this.model.toJSON(),{model:this.model})),b=jQuery("#notifications"),b.hide(),b.html(a).fadeIn(),this.model.get("extra_output")!=null&&this.model.get("line_number")==null&&CourseApp[this.model.get("extra_output").call]!=null&&CourseApp[this.model.get("extra_output").call](this.model.get("extra_output").cmd),b.live("click",function(a){b.fadeOut();return a.preventDefault()}),jQuery(document).one("keydown","esc",function(a){b.fadeOut();return a.preventDefault()});return this}})}.call(this),function(){CourseApp.ResourceTabs=Backbone.View.extend({el:"#resource-tabs",initialize:function(){_.bindAll(this,"render");return this.collection.bind("reset",this.render)},render:function(){var a,b,c;a=this.collection,c=jQuery(this.el),b=jQuery("#resource-group"),a.each(function(b){var d;d=new CourseApp.TabHeader({model:b,collection:a});return c.append(d.render().el)}),a.each(function(c){var d,e;e=c.view_class(),d=new e({model:c,collection:a}),b.append(d.render().el);return d.afterInsertIntoDom()}),this.options.hints_content!=null&&this.options.hints_header!=null&&(c.append(this.options.hints_header.render().el),b.append(this.options.hints_content.render().el));return this}}),CourseApp.TabHeader=Backbone.View.extend({tagName:"li",template:"tab_header",initialize:function(){_.bindAll(this,"render","focus"),this.template=window.JST[this.template];return this.model.bind("change",this.render)},render:function(){var a;a=this.template(this.model.toJSON()),jQuery(this.el).html(a),this.model.get("header_id")!=null&&jQuery(this.el).attr({id:this.model.get("header_id")});return this},focus:function(){return this.$("a").click()}}),CourseApp.Tab=Backbone.View.extend({className:"resource-panel panel",template:"tab",initialize:function(){_.bindAll(this,"render","afterInsertIntoDom"),this.template=window.JST[this.template];return this.model.bind("change",this.render)},render:function(){var a;a=this.template(this.model.toJSON()),jQuery(this.el).html(a);return this},afterInsertIntoDom:function(){}}),CourseApp.IframeTab=CourseApp.Tab.extend({template:"iframe_tab",afterInsertIntoDom:function(){var a,b,c,d;this.model.get("render").iframe!=null&&(b=$("#resource_iframe").contents(),b.ready(function(){return b.find("a").click(function(a){a.preventDefault();return!1})}),b[0].open(),b[0].writeln(this.model.get("render").iframe),b[0].close(),a=b[0].getElementsByTagName("head")[0],c=b[0].createElement("script"),c.src="//d31j3wkilayjeo.cloudfront.net/assets/iframe-a2392aaa407fcc0086f6a6ee78c277a3",a.appendChild(c),d=document.createElement("link"),d.href="//d31j3wkilayjeo.cloudfront.net/assets/iframe-style.css",d.rel="stylesheet",d.type="text/css",a.appendChild(d));return this.$("a").click(function(a){var b,c,d;a.preventDefault(),b=$("#resource_iframe").contents().find("body").html(),d=new Backbone.Model({html:b}),c=new CourseApp.ViewSourceBox({model:d});return c.render()})}}),CourseApp.HtmlTab=CourseApp.Tab.extend({template:"html_tab"}),CourseApp.UsedHint=Backbone.View.extend({tagName:"li",template:"used_hint",initialize:function(){_.bindAll(this,"render");return this.template=window.JST[this.template]},render:function(){var a;a=this.template({model:this.model}),jQuery(this.el).html(a);return this}}),CourseApp.HintsHeader=CourseApp.TabHeader.extend({}),CourseApp.HintsContent=Backbone.View.extend({className:"resource-panel panel",id:"hints",template:"tab_hints",initialize:function(){_.bindAll(this,"render","nextHint","handleNextHint"),this.template=window.JST[this.template];return this.model.bind("change",this.render)},render:function(){var a,b;a=this.collection,this.model.get("hints")!=null&&(jQuery(this.el).html(this.template(this.model.toJSON())),this.$("#next_hint").bind("click.codeSchoolCourse",this.nextHint),b=this.$("ol"),_.each(this.model.get("hints"),function(a){var c;a=new CourseApp.Hint(a),c=new CourseApp.UsedHint({model:a});return b.append(c.render().el)}));return this},nextHint:function(a){var b;a.preventDefault(),b=this.$("#next_hint"),b.addClass("loading");return jQuery.getJSON(b.attr("href"),this.handleNextHint)},handleNextHint:function(a){var b,c,d,e,f;d=this.$("#next_hint"),b=this.$("ol"),c=this.$("#hints_remaining"),e=jQuery("#challenge-objective"),d.removeClass("loading"),f=new CourseApp.UsedHint({model:new CourseApp.Hint(a.hint)}),b.append(f.render().el),e.addClass("decrease"),setTimeout(function(){return e.removeClass("decrease")},1e3),CodeHighlighter.init(),a.hints_remaining===1?c.html(a.hints_remaining+" Hint"):c.html(a.hints_remaining+" Hints"),a.has_more_hints||d.remove();if(this.options.active_challenge!=null)return this.options.active_challenge.set({possible_points:a.possible_points})}})}.call(this),function(){CourseApp.ChallengeMenu=Backbone.View.extend({el:"#sidebar-nav",template:"challenge_menu",initialize:function(){_.bindAll(this,"render"),this.template=window.JST[this.template],this.model.bind("change",this.render);return this.collection.bind("reset",this.render)},render:function(){var a,b;b=this.collection,jQuery(this.el).html(this.template(this.model.toJSON())),a=this.$("ol"),b.each(function(c){var d;d=new CourseApp.ChallengeMenuItem({model:c,collection:b});return a.append(d.render().el)});return this}}),CourseApp.ChallengeMenuItem=Backbone.View.extend({tagName:"li",template:"menu_item",initialize:function(){_.bindAll(this,"render"),this.model.bind("change",this.render);return this.template=window.JST[this.template]},render:function(){var a;a=this.template(this.model.toJSON()),jQuery(this.el).html(a),this.model.get("completed")&&jQuery(this.el).addClass("completed"),this.model.get("current")&&jQuery(this.el).addClass("current");return this}}),CourseApp.Scoreboard=Backbone.View.extend({el:"#sidebar-points",template:"scoreboard",initialize:function(){_.bindAll(this,"render"),this.model.bind("change",this.render);return this.template=window.JST[this.template]},render:function(){var a;a=this.template(this.model.toJSON()),jQuery(this.el).html(a);return this}})}.call(this),function(){CourseApp.SuccessBox=Backbone.View.extend({template:"success_box",initialize:function(){_.bindAll(this,"render");return this.template=window.JST[this.template]},render:function(){var a;jQuery("#notifications").fadeOut(),a=this.template(this.model),this.model.extra_output!=null&&CourseApp[this.model.extra_output.call]!=null&&CourseApp[this.model.extra_output.call](this.model.extra_output.cmd),jQuery.facebox(a,"success"),jQuery(".success-message .share-stuff").append(jQuery("#twitter-button-wrapper").html()),jQuery(".success-close").live("click",function(a){jQuery(document).trigger("close.facebox");return a.preventDefault()});return jQuery(document).one("keydown",function(a){if(a.which===39||a.which===13){document.location.href=jQuery("#next").attr("href");return a.preventDefault()}})}})}.call(this),function(){CourseApp.TextEditor=Backbone.View.extend({className:"editor panel",initialize:function(){_.bindAll(this,"render","submitForm","tabRight","tabLeft","goLineUp","triggerPreviousCommand","getCode","resize"),this.model.bind("change",this.render);if(this.options.challenge!=null)return this.options.challenge.bind("change",this.render)},render:function(){var a,b,c,d,e;this.editor==null?(jQuery(this.el).attr({id:"editor"+this.model.get("id")}),this.editor=window.ace.edit(this.el),c=require("pilot/canon"),b=require("ace/mode/"+this.model.get("syntax")).Mode,a=require("ace/keyboard/hash_handler").HashHandler,d=new a({submitform:"Command-Return",switchtabright:"Command-Option-right",switchtableft:"Command-Option-left"}),this.editor.setKeyboardHandler(d),this.editor.renderer.setShowGutter(!1),this.editor.getSession().setTabSize(2),this.editor.setTheme("ace/theme/course"),this.editor.getSession().setMode(new b),this.editor.moveCursorTo(0),this.model.get("initial_value")!=null&&this.editor.getSession().setValue(this.model.get("initial_value")),c.addCommand({name:"submitform",exec:this.submitForm}),c.addCommand({name:"switchtabright",exec:this.tabRight}),c.addCommand({name:"switchtableft",exec:this.tabLeft}),c.addCommand({name:"golineup",exec:this.goLineUp}),this.model.get("change_event")!=null&&(e=this,this.editor.getSession().on("change",function(a){var b;b=e.editor.getSession().getValue();if(CourseApp[e.model.get("change_event")]!=null)return CourseApp[e.model.get("change_event")](b)}))):this.editor.resize(),this.model.get("focused")&&this.editor.focus();return this},blur:function(){return this.editor.blur()},submitForm:function(a,b,c){return this.options.parent.submitCode()},tabRight:function(a,b,c){return CourseApp.log("tabRight")},tabLeft:function(a,b,c){return CourseApp.log("tabLeft")},goLineUp:function(a,b,c){var d;d=a.editor.getSession().selection.selectionLead.row;return d===0?this.triggerPreviousCommand():a.editor.navigateUp(b.times)},triggerPreviousCommand:function(){return CourseApp.log("triggerPreviousCommand")},getCode:function(){return this.editor.getSession().getValue()},resize:function(){return this.editor.resize()}}),CourseApp.TextEditorSubmit=Backbone.View.extend({tagName:"footer",template:"text_editor_submit",initialize:function(){_.bindAll(this,"render"),this.model.bind("change",this.render);return this.template=window.JST[this.template]},render:function(){jQuery(this.el).html(this.template(this.model.toJSON())),this.model.get("loading")?jQuery(this.el).addClass("loading"):jQuery(this.el).removeClass("loading");return this}})}.call(this),function(){CourseApp.ViewSourceBox=Backbone.View.extend({template:"view_source_box",initialize:function(){_.bindAll(this,"render");return this.template=window.JST[this.template]},render:function(){var a;a=this.template({model:this.model}),jQuery.facebox(a,"view_source");return jQuery(".view_source-close").live("click",function(a){jQuery(document).trigger("close.facebox");return a.preventDefault()})}})}.call(this),function(){this.JST||(this.JST={}),this.JST.challenge_details=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push('<header>\n  <h1>Try Ruby</h1>\n  <h2 class="reveal">',title,'</h2>\n  <h3>Objective:</h3>\n</header>\n\n<div class="challenge-instructions reveal">\n  ',instructions,'\n</div>\n\n<footer class="affiliates">\n  <a href="#" class="affiliates-reveal">Show Our Affiliates</a>\n  <p class="chunky-bacon">A tribute to <a href="http://www.rubyinside.com/media/poignant-guide.pdf">why\'s (poignant) guide to Ruby</a>. <b>Chunky bacon.</b></p>\n  <div>\n    <p class="affiliates-credits">\n      <a href="http://codeschool.com" class="affiliates-curated" target="_blank">Curated by Code School</a>\n      <a href="http://heroku.com" class="affiliates-hosting" target="_blank">Hosting Provided by Heroku</a>\n    </p>\n    <p>\n      Try Ruby version 3 created by <a href="http://twitter.com/eallam" target="_blank">Eric Allam</a> &amp; <a href="http://twitter.com/nickawalsh" target="_blank">Nick Walsh</a><br />\n      Try Ruby version 2 created by <a href="https://github.com/Sophrinix" target="_blank">Andrew McElroy</a> &amp; <a href="https://github.com/nanothief" target="_blank">David Miani</a><br />\n      Try Ruby version 1 created by <a href="http://en.wikipedia.org/wiki/Why_the_lucky_stiff" target="_blank">why the lucky stiff</a>\n    </p>\n  </div>\n</footer>\n\n<script type="text/javascript">\n  $(document).ready(function(){\n    setTimeout(function(){reveal(\'h2.reveal\')}, 100);\n    setTimeout(function(){reveal(\'.challenge-instructions\')}, 400);\n    function reveal(selector) {\n      $(selector).removeClass(\'reveal\');\n    }\n    \n    if($(\'#popup_window\')) {\n      $(\'#popup_window\')\n        .hide().fadeIn(300)\n        .fadeOut(300).fadeIn(300)\n        .fadeOut(300).fadeIn(300)\n        .fadeOut(300).fadeIn(300);\n    }\n    \n    if($(\'.save\').is(\':hidden\')) {\n      var save = $(\'.save\');\n      save.fadeIn();\n      \n      $(\'.save-close\').one(\'click\', function(e) {\n        e.preventDefault();\n        save.fadeOut(function() {\n          save.remove();\n        });\n      });\n    }\n  });\n</script>\n');return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.challenge_menu=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<h2>\n  Level ",number,'\n  <a class="change-level button" href="',switch_labs_url,'"><b>Change Level</b></a>\n</h2>\n<ol></ol>\n');return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.console_submit=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<h4>Shortcuts &amp; Commands</h4>\n<ul>\n  <li><strong>Enter / Return</strong> &rarr; Submit code</li>\n  <li><strong>Up</strong> &rarr; Cycle through submitted code</li>\n  <li><code>clear</code> &rarr; Clear the editor window</li>\n  <li><code>back</code> &rarr; Return to the previous lesson</li>\n  <li><code>next</code> &rarr; Move to the next lesson</li>\n</ul>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.editor_group=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<nav>\n  <ol id='editor-tabs'></ol>\n  <ol id=\"resource-tabs\"></ol>\n</nav>\n<div id='editor-group' class=\"panel-group\"></div>\n<div id='resource-group' class=\"panel-group\"></div>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.editor_tab_header=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<a class=\"editor-tab\" href='#'>",anchor,"</a>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.failure=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push('<div class="error">\n  <h3>Sorry, Try Again</h3>\n  <p>\n    '),line_number!==undefined&&line_number!==null&&line_number!==""&&__p.push("\n      Line ",line_number,"\n    "),__p.push("\n    ",model.escape("result"),'\n  </p>\n  <span class="notifications-close">Click to Close</span>\n</div>\n');return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.html_tab=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("",render.html,"\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.iframe_tab=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<iframe id='resource_iframe'></iframe>\n<a href='#' id='view_frame_source'>View Source</a>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.menu_item=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push('<a href="',url,'">',title,"</a>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.resources=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push('<ol id="resource-tabs"></ol>\n');return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.scoreboard=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<em>",points,"</em>\n<b>Total Points</b>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.success_box=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<a href='#' class=\"success-close\">Close</a>\n<h2>Congratulations!</h2>\n<div class='success-message'>\n  "),typeof awarded_achievements!="undefined"&&awarded_achievements!==null&&(__p.push("\n    <div class='achievements'>\n      <h3>You've Earned the Following Badge:</h3>\n      <ul>\n        "),_.each(awarded_achievements,function(a){__p.push("\n          <li>\n            <img src='",a.url,"' alt='",a.name,"' title=\"",a.name,'">\n          </li>\n        ')}),__p.push("\n      </ul>\n    </div>\n  ")),__p.push("\n  \n  "),completed_course?__p.push("\n    <a href='",course_wrap_up_url,'\' id="next" class="button"><b><span>Wrap Up</span></b></a>\n    <h3>Congratulations, You\'ve Finished this Code School Course!</h3>\n    <p>And more importantly, unlocked the final video! Click next to view it now.</p>\n  '):completed_lab?__p.push("\n    <a href='",next_level_url,'\' id="next" class="button"><b><span>Next Level</span></b></a>\n    <h3>Congratulations, You\'ve Completed Level ',lab_number,"!</h3>\n    <p>\n      You've unlocked the next video and set of challenges! Why not let your friends know about your awesome accomplishment?\n    </p>\n    <div class='share-stuff'></div>\n  "):__p.push("\n    <a href='",next_challenge_url,'\' id="next" class="button"><b><span>Next Challenge</span></b></a>\n    <p>You\'ve Successfully Completed Challenge ',number,"!</p>\n  "),__p.push("\n</div>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.tab=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<a href='http://gist.github.com/",render.gist,"#file_",render.file,"' class='gist'>",render.file,"</a>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.tab_header=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<a href='#' id=\"",id,'" class="resource-tab">',anchor,"</a>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.tab_hints=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push(""),hints!==undefined?(__p.push("\n  "),has_more_hints&&__p.push('\n    <p>\n      <a id="next_hint" class="button" href="',url,'"><b>Next Hint <span>(-75 Points)</span></b></a>\n      <span id="hints_remaining">',hints_remaining," ",hints_text,"</span> Remaining\n    </p>\n  "),__p.push("\n\n  <ol></ol>\n")):__p.push('\n  <p>\n    <a id="next_hint" class="button" href="',url,'"><b>Next Hint <span>(-75 Points)</span></b></a>\n    <span id="hints_remaining">',hints_remaining," ",hints_text,"</span> Remaining\n  </p>\n\n  <ol></ol>\n"),__p.push("\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.text_editor_submit=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<a href='#' id='manual_submit' class='button'><b><span>Submit Code</span></b></a>\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.used_hint=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("",model.get("body"),"\n"),model.get("code")!==undefined&&model.get("code")!==null&&model.get("code")!==""&&__p.push("\n<pre><code class='",model.get("syntax"),"'>",model.escape("code"),"</code></pre>\n"),__p.push("\n");return __p.join("")}}.call(this),function(){this.JST||(this.JST={}),this.JST.view_source_box=function(obj){var __p=[],print=function(){__p.push.apply(__p,arguments)};with(obj||{})__p.push("<a href='#' class=\"view_source-close\">Close</a>\n<pre><code class='html'>",model.escape("html"),"</code></pre>\n");return __p.join("")}}.call(this),function(){window.CourseApp.popup=function(a){var b;b={"goto":function(a){console.log(a),$("#popup").show(),$("#popup iframe").attr("src",a);return $("#popup h3 a").click(function(a){a.preventDefault();return $("#popup").hide()})},make:function(a){var b;$("#popup").show(),b=$("#popup iframe").contents(),b.ready(function(){return b.find("a").click(function(a){a.preventDefault();return!1})}),b[0].open(),b[0].writeln(a),b[0].close();return $("#popup h3 a").click(function(a){a.preventDefault();return $("#popup").hide()})}};if(a&&a.call!=null)return b[a.call].apply(this,a.args)}}.call(this)
