/*! Copyright 2009-2012 Jackson Fish Market, LLC
 *  Rev 5f91f57a
 *  Generated 2012-02-03 01:16:29 */
/*! jQuery v1.6.3 http://jquery.com/ | http://jquery.org/license */
(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1
}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");
d.remove();
if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);
if(!ci||!ch.createElement){ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close()
}d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)
}cg[a]=e
}return cg[a]
}function cq(a,b){var c={};
f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a
});
return c
}function cp(){cn=b
}function co(){setTimeout(cp,0);
return cn=f.now()
}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")
}catch(b){}}function ce(){try{return new a.XMLHttpRequest
}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));
var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;
for(g=1;
g<i;
g++){if(g===1){for(h in a.converters){typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h])
}}l=k,k=d[g];
if(k==="*"){k=l
}else{if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];
if(!n){p=b;
for(o in e){j=o.split(" ");
if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];
if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);
break
}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))
}}}return c
}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;
for(i in g){i in d&&(c[g[i]]=d[i])
}while(f[0]==="*"){f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"))
}if(h){for(i in e){if(e[i]&&e[i].test(h)){f.unshift(i);
break
}}}if(f[0] in d){j=f[0]
}else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;
break
}k||(k=i)
}j=j||k
}if(j){j!==f[0]&&f.unshift(j);
return d[j]
}}function bY(a,b,c,d){if(f.isArray(b)){f.each(b,function(b,e){c||bA.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)
})
}else{if(!c&&b!=null&&typeof b=="object"){for(var e in b){bY(a+"["+e+"]",b[e],c,d)
}}else{d(a,b)
}}}function bX(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};
for(d in c){c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d])
}e&&f.extend(!0,a,e)
}function bW(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;
var h=a[f],i=0,j=h?h.length:0,k=a===bP,l;
for(;
i<j&&(k||!l);
i++){l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bW(a,c,d,e,l,g)))
}(k||!l)&&!g["*"]&&(l=bW(a,c,d,e,"*",g));
return l
}function bV(a){return function(b,c){typeof b!="string"&&(c=b,b="*");
if(f.isFunction(c)){var d=b.toLowerCase().split(bL),e=0,g=d.length,h,i,j;
for(;
e<g;
e++){h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)
}}}
}function by(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bt:bu;
if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0
});
return d+"px"
}d=bv(a,b,b);
if(d<0||d==null){d=a.style[b]||0
}d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)
});
return d+"px"
}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)
}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName" in a&&f.grep(a.getElementsByTagName("input"),bj)
}function bj(a){if(a.type==="checkbox"||a.type==="radio"){a.defaultChecked=a.checked
}}function bi(a){return"getElementsByTagName" in a?a.getElementsByTagName("*"):"querySelectorAll" in a?a.querySelectorAll("*"):[]
}function bh(a,b){var c;
if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();
if(c==="object"){b.outerHTML=a.outerHTML
}else{if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option"){b.selected=a.defaultSelected
}else{if(c==="input"||c==="textarea"){b.defaultValue=a.defaultValue
}}}else{a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)
}}b.removeAttribute(f.expando)
}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);
if(d=d[c]){var g=d.events;
e=e[c]=f.extend({},d);
if(g){delete e.handle,e.events={};
for(var h in g){for(var i=0,j=g[h].length;
i<j;
i++){f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)
}}}}}}function bf(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a
}function V(a,b,c){b=b||0;
if(f.isFunction(b)){return f.grep(a,function(a,d){var e=!!b.call(a,d,a);
return e===c
})
}if(b.nodeType){return f.grep(a,function(a,d){return a===b===c
})
}if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1
});
if(Q.test(b)){return f.filter(b,d,!c)
}b=f.filter(b,d)
}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c
})
}function U(a){return !a||!a.parentNode||a.parentNode.nodeType===11
}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")
}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");
if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;
var s=r.live.slice(0);
for(i=0;
i<s.length;
i++){g=s[i],g.origType.replace(w,"")===a.type?q.push(g.selector):s.splice(i--,1)
}e=f(a.target).closest(q,a.currentTarget);
for(j=0,k=e.length;
j<k;
j++){m=e[j];
for(i=0;
i<s.length;
i++){g=s[i];
if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;
if(g.preType==="mouseenter"||g.preType==="mouseleave"){a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h)
}(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})
}}}for(j=0,k=p.length;
j<k;
j++){e=p[j];
if(c&&e.level>c){break
}a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);
if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);
if(a.isImmediatePropagationStopped()){break
}}}return b
}}function J(a,c,d){var e=f.extend({},d[0]);
e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()
}function D(){return !0
}function C(){return !1
}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);
i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())
},0)
}function l(a){for(var b in a){if(b!=="toJSON"){return !1
}}return !0
}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();
d=a.getAttribute(e);
if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)
}catch(g){}f.data(a,c,d)
}else{d=b
}}return d
}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")
}catch(a){setTimeout(K,1);
return
}e.ready()
}}var e=function(a,b){return new e.fn.init(a,b,h)
},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()
},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};
e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;
if(!a){return this
}if(a.nodeType){this.context=this[0]=a,this.length=1;
return this
}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;
return this
}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];
if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);
return e.merge(this,a)
}h=c.getElementById(g[2]);
if(h&&h.parentNode){if(h.id!==g[2]){return f.find(a)
}this.length=1,this[0]=h
}this.context=c,this.selector=a;
return this
}return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a)
}if(e.isFunction(a)){return f.ready(a)
}a.selector!==b&&(this.selector=a.selector,this.context=a.context);
return e.makeArray(a,this)
},selector:"",jquery:"1.6.3",length:0,size:function(){return this.length
},toArray:function(){return G.call(this,0)
},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]
},pushStack:function(a,b,c){var d=this.constructor();
e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");
return d
},each:function(a,b){return e.each(this,a,b)
},ready:function(a){e.bindReady(),B.done(a);
return this
},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)
},first:function(){return this.eq(0)
},last:function(){return this.eq(-1)
},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))
},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)
}))
},end:function(){return this.prevObject||this.constructor(null)
},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;
typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);
for(;
j<k;
j++){if((a=arguments[j])!=null){for(c in a){d=i[c],f=a[c];
if(i===f){continue
}l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)
}}}return i
},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);
return e
},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)
},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body){return setTimeout(e.ready,1)
}e.isReady=!0;
if(a!==!0&&--e.readyWait>0){return
}B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")
}},bindReady:function(){if(!B){B=e._Deferred();
if(c.readyState==="complete"){return setTimeout(e.ready,1)
}if(c.addEventListener){c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1)
}else{if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);
var b=!1;
try{b=a.frameElement==null
}catch(d){}c.documentElement.doScroll&&b&&K()
}}}},isFunction:function(a){return e.type(a)==="function"
},isArray:Array.isArray||function(a){return e.type(a)==="array"
},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a
},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)
},type:function(a){return a==null?String(a):J[D.call(a)]||"object"
},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1
}try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf")){return !1
}}catch(c){return !1
}var d;
for(d in a){}return d===b||E.call(a,d)
},isEmptyObject:function(a){for(var b in a){return !1
}return !0
},error:function(a){throw a
},parseJSON:function(b){if(typeof b!="string"||!b){return null
}b=e.trim(b);
if(a.JSON&&a.JSON.parse){return a.JSON.parse(b)
}if(o.test(b.replace(p,"@").replace(q,"]").replace(r,""))){return(new Function("return "+b))()
}e.error("Invalid JSON: "+b)
},parseXML:function(c){var d,f;
try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))
}catch(g){d=b
}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);
return d
},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)
})(b)
},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)
},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()
},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);
if(d){if(i){for(f in a){if(c.apply(a[f],d)===!1){break
}}}else{for(;
g<h;
){if(c.apply(a[g++],d)===!1){break
}}}}else{if(i){for(f in a){if(c.call(a[f],f,a[f])===!1){break
}}}else{for(;
g<h;
){if(c.call(a[g],g,a[g++])===!1){break
}}}}return a
},trim:H?function(a){return a==null?"":H.call(a)
}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")
},makeArray:function(a,b){var c=b||[];
if(a!=null){var d=e.type(a);
a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?F.call(c,a):e.merge(c,a)
}return c
},inArray:function(a,b){if(!b){return -1
}if(I){return I.call(b,a)
}for(var c=0,d=b.length;
c<d;
c++){if(b[c]===a){return c
}}return -1
},merge:function(a,c){var d=a.length,e=0;
if(typeof c.length=="number"){for(var f=c.length;
e<f;
e++){a[d++]=c[e]
}}else{while(c[e]!==b){a[d++]=c[e++]
}}a.length=d;
return a
},grep:function(a,b,c){var d=[],e;
c=!!c;
for(var f=0,g=a.length;
f<g;
f++){e=!!b(a[f],f),c!==e&&d.push(a[f])
}return d
},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));
if(k){for(;
i<j;
i++){f=c(a[i],i,d),f!=null&&(h[h.length]=f)
}}else{for(g in a){f=c(a[g],g,d),f!=null&&(h[h.length]=f)
}}return h.concat.apply([],h)
},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];
c=a,a=d
}if(!e.isFunction(a)){return b
}var f=G.call(arguments,2),g=function(){return a.apply(c,f.concat(G.call(arguments)))
};
g.guid=a.guid=a.guid||g.guid||e.guid++;
return g
},access:function(a,c,d,f,g,h){var i=a.length;
if(typeof c=="object"){for(var j in c){e.access(a,j,c[j],f,g,d)
}return a
}if(d!==b){f=!h&&f&&e.isFunction(d);
for(var k=0;
k<i;
k++){g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h)
}return a
}return i?g(a[0],c):b
},now:function(){return(new Date).getTime()
},uaMatch:function(a){a=a.toLowerCase();
var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];
return{browser:b[1]||"",version:b[2]||"0"}
},sub:function(){function a(b,c){return new a.fn.init(b,c)
}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));
return e.fn.init.call(this,d,f,b)
},a.fn.init.prototype=a.fn;
var b=a(c);
return a
},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){J["[object "+b+"]"]=b.toLowerCase()
}),A=e.uaMatch(z),A.browser&&(e.browser[A.browser]=!0,e.browser.version=A.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?C=function(){c.removeEventListener("DOMContentLoaded",C,!1),e.ready()
}:c.attachEvent&&(C=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",C),e.ready())
});
return e
}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;
f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;
b&&(k=b,b=0);
for(g=0,h=c.length;
g<h;
g++){i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i)
}k&&e.resolveWith(k[0],k[1])
}return this
},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;
try{while(a[0]){a.shift().apply(e,f)
}}finally{b=[e,f],c=0
}}return this
},resolve:function(){e.resolveWith(this,arguments);
return this
},isResolved:function(){return !!c||!!b
},cancel:function(){d=1,a=[];
return this
}};
return e
},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;
f.extend(b,{then:function(a,c){b.done(a).fail(c);
return this
},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)
},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;
f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g+"With"](this===b?d:this,[h])
}):b[a](d[g])
})
}).promise()
},promise:function(a){if(a==null){if(d){return d
}d=a={}
}var c=g.length;
while(c--){a[g[c]]=b[g[c]]
}return a
}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);
return b
},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))
}
}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();
if(d>1){for(;
c<d;
c++){b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e
}e||g.resolveWith(g,b)
}else{g!==a&&g.resolveWith(g,d?[a]:[])
}return g.promise()
}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;
a.setAttribute("className","t"),a.innerHTML="   <link><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type=checkbox>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];
if(!d||!d.length||!e){return{}
}g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;
try{delete a.test
}catch(v){k.deleteExpando=!1
}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1
}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});
for(t in p){o.style[t]=p[t]
}o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom" in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);
if(a.attachEvent){for(t in {submit:1,change:1,focusin:1}){s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u
}}o=l=g=h=m=j=a=i=null;
return k
}(),f.boxModel=f.support.boxModel;
var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;
f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];
return !!a&&!l(a)
},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;
if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b){return
}m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));
if(typeof c=="object"||typeof c=="function"){e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c)
}g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);
if(c==="events"&&!g[c]){return g[i]&&g[i].events
}j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;
return h
}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;
if(!h[i]){return
}if(b){d=c?h[i][e]:h[i];
if(d){d[b]||(b=f.camelCase(b)),delete d[b];
if(!l(d)){return
}}}if(c){delete h[i][e];
if(!l(h[i])){return
}}var j=h[i][e];
f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)
}},_data:function(a,b,c){return f.data(a,b,c,!0)
},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];
if(b){return b!==!0&&a.getAttribute("classid")===b
}}return !0
}}),f.fn.extend({data:function(a,c){var d=null;
if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);
if(this[0].nodeType===1){var e=this[0].attributes,g;
for(var h=0,i=e.length;
h<i;
h++){g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))
}}}return d
}if(typeof a=="object"){return this.each(function(){f.data(this,a)
})
}var j=a.split(".");
j[1]=j[1]?"."+j[1]:"";
if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));
return d===b&&j[1]?this.data(j[0]):d
}return this.each(function(){var b=f(this),d=[j[0],c];
b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)
})
},removeData:function(a){return this.each(function(){f.removeData(this,a)
})
}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))
},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);
if(c){d=d||"fx";
var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;
g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))
}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";
var e=f.data(a,c,b,!0);
d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));
return e||[]
}},dequeue:function(a,b){b=b||"fx";
var c=f.queue(a,b),d=c.shift(),e;
d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)
})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))
}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");
if(c===b){return f.queue(this[0],a)
}return this.each(function(){var b=f.queue(this,a,c);
a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)
})
},dequeue:function(a){return this.each(function(){f.dequeue(this,a)
})
},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";
return this.queue(b,function(){var c=this;
setTimeout(function(){f.dequeue(c,b)
},a)
})
},clearQueue:function(a){return this.queue(a||"fx",[])
},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])
}typeof a!="string"&&(c=a,a=b),a=a||"fx";
var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;
while(g--){if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0)){h++,l.done(m)
}}m();
return d.promise()
}});
var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u,v;
f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)
},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)
})
},prop:function(a,b){return f.access(this,a,b,!0,f.prop)
},removeProp:function(a){a=f.propFix[a]||a;
return this.each(function(){try{this[a]=b,delete this[a]
}catch(c){}})
},addClass:function(a){var b,c,d,e,g,h,i;
if(f.isFunction(a)){return this.each(function(b){f(this).addClass(a.call(this,b,this.className))
})
}if(a&&typeof a=="string"){b=a.split(o);
for(c=0,d=this.length;
c<d;
c++){e=this[c];
if(e.nodeType===1){if(!e.className&&b.length===1){e.className=a
}else{g=" "+e.className+" ";
for(h=0,i=b.length;
h<i;
h++){~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ")
}e.className=f.trim(g)
}}}}return this
},removeClass:function(a){var c,d,e,g,h,i,j;
if(f.isFunction(a)){return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))
})
}if(a&&typeof a=="string"||a===b){c=(a||"").split(o);
for(d=0,e=this.length;
d<e;
d++){g=this[d];
if(g.nodeType===1&&g.className){if(a){h=(" "+g.className+" ").replace(n," ");
for(i=0,j=c.length;
i<j;
i++){h=h.replace(" "+c[i]+" "," ")
}g.className=f.trim(h)
}else{g.className=""
}}}}return this
},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";
if(f.isFunction(a)){return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)
})
}return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);
while(e=j[g++]){i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)
}}else{if(c==="undefined"||c==="boolean"){this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""
}}})
},hasClass:function(a){var b=" "+a+" ";
for(var c=0,d=this.length;
c<d;
c++){if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(n," ").indexOf(b)>-1){return !0
}}return !1
},val:function(a){var c,d,e=this[0];
if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];
if(c&&"get" in c&&(d=c.get(e,"value"))!==b){return d
}d=e.value;
return typeof d=="string"?d.replace(p,""):d==null?"":d
}return b
}var g=f.isFunction(a);
return this.each(function(d){var e=f(this),h;
if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""
})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];
if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h
}}})
}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;
return !b||b.specified?a.value:a.text
}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";
if(c<0){return null
}for(var h=g?c:0,i=g?c+1:e.length;
h<i;
h++){var j=e[h];
if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();
if(g){return b
}d.push(b)
}}if(g&&!d.length&&e.length){return f(e[c]).val()
}return d
},set:function(a,b){var c=f.makeArray(b);
f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0
}),c.length||(a.selectedIndex=-1);
return c
}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;
if(!a||g===3||g===8||g===2){return b
}if(e&&c in f.attrFn){return f(a)[c](d)
}if(!("getAttribute" in a)){return f.prop(a,c,d)
}var h,i,j=g!==1||!f.isXMLDoc(a);
j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));
if(d!==b){if(d===null){f.removeAttr(a,c);
return b
}if(i&&"set" in i&&j&&(h=i.set(a,d,c))!==b){return h
}a.setAttribute(c,""+d);
return d
}if(i&&"get" in i&&j&&(h=i.get(a,c))!==null){return h
}h=a.getAttribute(c);
return h===null?b:h
},removeAttr:function(a,b){var c;
a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b) in a&&(a[c]=!1))
},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode){f.error("type property can't be changed")
}else{if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;
a.setAttribute("type",b),c&&(a.value=c);
return b
}}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button")){return u.get(a,b)
}return b in a?a.value:null
},set:function(a,b,c){if(u&&f.nodeName(a,"button")){return u.set(a,b,c)
}a.value=b
}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;
if(!a||e===3||e===8||e===2){return b
}var g,h,i=e!==1||!f.isXMLDoc(a);
i&&(c=f.propFix[c]||c,h=f.propHooks[c]);
return d!==b?h&&"set" in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get" in h&&(g=h.get(a,c))!==null?g:a[c]
},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");
return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b
}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;
return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b
},set:function(a,b,c){var d;
b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));
return c
}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;
d=a.getAttributeNode(c);
return d&&d.nodeValue!==""?d.nodeValue:b
},set:function(a,b,d){var e=a.getAttributeNode(d);
e||(e=c.createAttribute(d),a.setAttributeNode(e));
return e.nodeValue=b+""
}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");
return c
}}})
})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);
return d===null?b:d
}})
}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b
},set:function(a,b){return a.style.cssText=""+b
}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;
b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);
return null
}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value
}}
}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b)){return a.checked=f.inArray(f(a).val(),b)>=0
}}})
});
var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")
};
f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1){d=C
}else{if(!d){return
}}var g,h;
d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);
var i=f._data(a);
if(!i){return
}var j=i.events,k=i.handle;
j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b
}),k.elem=a,c=c.split(" ");
var l,m=0,n;
while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);
var o=j[l],p=f.event.special[l]||{};
if(!o){o=j[l]=[];
if(!p.setup||p.setup.call(a,e,n,k)===!1){a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)
}}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0
}a=null
}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);
var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;
if(!s||!t){return
}c&&c.type&&(d=c.handler,c=c.type);
if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";
for(h in t){f.event.remove(a,h+c)
}return
}c=c.split(" ");
while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];
if(!p){continue
}if(!d){for(j=0;
j<p.length;
j++){q=p[j];
if(l||n.test(q.namespace)){f.event.remove(a,r,q.handler,j),p.splice(j--,1)
}}continue
}o=f.event.special[h]||{};
for(j=e||0;
j<p.length;
j++){q=p[j];
if(d.guid===q.guid){if(l||n.test(q.namespace)){e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q)
}if(e!=null){break
}}}if(p.length===0||e!=null&&p.length===1){(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]
}}if(f.isEmptyObject(t)){var u=s.handle;
u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)
}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;
h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());
if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");
if(g||!e){c.preventDefault(),c.stopPropagation()
}if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];
b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)
});
return
}if(e.nodeType===3||e.nodeType===8){return
}c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);
var k=e,l=h.indexOf(":")<0?"on"+h:"";
do{var m=f._data(k,"handle");
c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a
}while(k&&!c.isPropagationStopped());
if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};
if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())
}catch(p){}n&&(e[l]=n),f.event.triggered=b
}}return c.result
}},handle:function(c){c=f.event.fix(c||a.event);
var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);
g[0]=c,c.currentTarget=this;
for(var h=0,i=d.length;
h<i;
h++){var j=d[h];
if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;
var k=j.handler.apply(this,g);
k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));
if(c.isImmediatePropagationStopped()){break
}}}return c.result
},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando]){return a
}var d=a;
a=f.Event(d);
for(var e=this.props.length,g;
e;
){g=this.props[--e],a[g]=d[g]
}a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);
if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;
a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)
}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);
return a
},guid:100000000,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,M(a.origType,a.selector),f.extend({},a,{handler:L,guid:a.handler.guid}))
},remove:function(a){f.event.remove(this,M(a.origType,a.selector),a)
}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)
},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)
}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)
}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)
},f.Event=function(a,b){if(!this.preventDefault){return new f.Event(a,b)
}a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?D:C):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0
},f.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 E=function(a){var b=a.relatedTarget,c=!1,d=a.type;
a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))
},F=function(a){a.type=a.data,f.event.handle.apply(this,arguments)
};
f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?F:E,a)
},teardown:function(a){f.event.remove(this,b,a&&a.selector?F:E)
}}
}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form")){f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";
(c==="submit"||c==="image")&&f(b).closest("form").length&&J("submit",this,arguments)
}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";
(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&J("submit",this,arguments)
})
}else{return !1
}},teardown:function(a){f.event.remove(this,".specialSubmit")
}});
if(!f.support.changeBubbles){var G,H=function(a){var b=f.nodeName(a,"input")?a.type:"",c=a.value;
b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected
}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);
return c
},I=function(c){var d=c.target,e,g;
if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);
if(e===b||g===e){return
}if(e!=null||g){c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)
}}};
f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";
(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)
},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";
(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)
},beforeactivate:function(a){var b=a.target;
f._data(b,"_change_data",H(b))
}},setup:function(a,b){if(this.type==="file"){return !1
}for(var c in G){f.event.add(this,c+".specialChange",G[c])
}return x.test(this.nodeName)
},teardown:function(a){f.event.remove(this,".specialChange");
return x.test(this.nodeName)
}},G=f.event.special.change.filters,G.focus=G.beforeactivate
}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);
c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()
}var d=0;
f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)
},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)
}}
}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;
if(typeof a=="object"){for(var h in a){this[c](h,d,a[h],e)
}return this
}if(arguments.length===2||d===!1){e=d,d=b
}c==="one"?(g=function(a){f(this).unbind(a,g);
return e.apply(this,arguments)
},g.guid=e.guid||f.guid++):g=e;
if(a==="unload"&&c!=="one"){this.one(a,d,e)
}else{for(var i=0,j=this.length;
i<j;
i++){f.event.add(this[i],a,g,d)
}}return this
}
}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault){for(var c in a){this.unbind(c,a[c])
}}else{for(var d=0,e=this.length;
d<e;
d++){f.event.remove(this[d],a,b)
}}return this
},delegate:function(a,b,c,d){return this.live(b,c,d,a)
},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)
},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)
})
},triggerHandler:function(a,b){if(this[0]){return f.event.trigger(a,b,this[0],!0)
}},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;
f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();
return b[e].apply(this,arguments)||!1
};
e.guid=c;
while(d<b.length){b[d++].guid=c
}return this.click(e)
},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)
}});
var K={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};
f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);
if(typeof a=="object"&&!a.preventDefault){for(var o in a){n[c](o,d,a[o],m)
}return this
}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);
return this
}if(d===!1||f.isFunction(d)){e=d||C,d=b
}a=(a||"").split(" ");
while((h=a[i++])!=null){j=w.exec(h),k="",j&&(k=j[0],h=h.replace(w,""));
if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);
continue
}l=h,K[h]?(a.push(K[h]+k),h=h+k):h=(K[h]||h)+k;
if(c==="live"){for(var p=0,q=n.length;
p<q;
p++){f.event.add(n[p],"live."+M(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l})
}}else{n.unbind("live."+M(h,m),e)
}}return this
}
}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);
return arguments.length>0?this.bind(b,a,c):this.trigger(b)
},f.attrFn&&(f.attrFn[b]=!0)
}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;
g<h;
g++){var i=d[g];
if(i){var j=!1;
i=i[a];
while(i){if(i.sizcache===c){j=d[i.sizset];
break
}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);
if(typeof b!="string"){if(i===b){j=!0;
break
}}else{if(k.filter(b,[i]).length>0){j=i;
break
}}}i=i[a]
}d[g]=j
}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;
g<h;
g++){var i=d[g];
if(i){var j=!1;
i=i[a];
while(i){if(i.sizcache===c){j=d[i.sizset];
break
}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);
if(i.nodeName.toLowerCase()===b){j=i;
break
}i=i[a]
}d[g]=j
}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;
[0,0].sort(function(){h=!1;
return 0
});
var k=function(b,d,f,g){f=f||[],d=d||c;
var h=d;
if(d.nodeType!==1&&d.nodeType!==9){return[]
}if(!b||typeof b!="string"){return f
}var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;
do{a.exec(""),i=a.exec(y);
if(i){y=i[3],x.push(i[1]);
if(i[2]){o=i[3];
break
}}}while(i);
if(x.length>1&&m.exec(b)){if(x.length===2&&l.relative[x[0]]){j=v(x[0]+x[1],d)
}else{j=l.relative[x[0]]?[d]:k(x.shift(),d);
while(x.length){b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)
}}}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);
if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;
while(x.length){r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)
}}else{n=x=[]
}}n||(n=j),n||k.error(r||b);
if(e.call(n)==="[object Array]"){if(!u){f.push.apply(f,n)
}else{if(d&&d.nodeType===1){for(t=0;
n[t]!=null;
t++){n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t])
}}else{for(t=0;
n[t]!=null;
t++){n[t]&&n[t].nodeType===1&&f.push(j[t])
}}}}else{p(n,f)
}o&&(k(o,h,f,g),k.uniqueSort(f));
return f
};
k.uniqueSort=function(a){if(r){g=h,a.sort(r);
if(g){for(var b=1;
b<a.length;
b++){a[b]===a[b-1]&&a.splice(b--,1)
}}}return a
},k.matches=function(a,b){return k(a,null,null,b)
},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0
},k.find=function(a,b,c){var d;
if(!a){return[]
}for(var e=0,f=l.order.length;
e<f;
e++){var g,h=l.order[e];
if(g=l.leftMatch[h].exec(a)){var j=g[1];
g.splice(1,1);
if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);
if(d!=null){a=a.replace(l.match[h],"");
break
}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);
return{set:d,expr:a}
},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);
while(a&&c.length){for(var n in l.filter){if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];
g=!1,f.splice(1,1);
if(r.substr(r.length-1)==="\\"){continue
}j===i&&(i=[]);
if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);
if(!f){g=o=!0
}else{if(f===!0){continue
}}}if(f){for(var s=0;
(p=j[s])!=null;
s++){if(p){o=q(p,f,s,j);
var t=e^!!o;
d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)
}}}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");
if(!g){return[]
}break
}}}if(a===h){if(g==null){k.error(a)
}else{break
}}h=a
}return j
},k.error=function(a){throw"Syntax error, unrecognized expression: "+a
};
var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")
},type:function(a){return a.getAttribute("type")
}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;
d&&(b=b.toLowerCase());
for(var f=0,g=a.length,h;
f<g;
f++){if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b
}}e&&k.filter(b,a,!0)
},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;
if(d&&!j.test(b)){b=b.toLowerCase();
for(;
e<f;
e++){c=a[e];
if(c){var g=c.parentNode;
a[e]=g.nodeName.toLowerCase()===b?g:!1
}}}else{for(;
e<f;
e++){c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b)
}d&&k.filter(b,a,!0)
}},"":function(a,b,c){var e,f=d++,g=u;
typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)
},"~":function(a,b,c){var e,f=d++,g=u;
typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)
}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);
return d&&d.parentNode?[d]:[]
}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);
for(var e=0,f=d.length;
e<f;
e++){d[e].getAttribute("name")===a[1]&&c.push(d[e])
}return c.length===0?null:c
}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined"){return b.getElementsByTagName(a[1])
}}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";
if(f){return a
}for(var g=0,h;
(h=b[g])!=null;
g++){h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1))
}return !1
},ID:function(a){return a[1].replace(i,"")
},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()
},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");
var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);
a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0
}else{a[2]&&k.error(a[0])
}a[0]=d++;
return a
},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");
!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");
return a
},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){b[3]=k(b[3],null,null,c)
}else{var g=k.filter(b[3],c,d,!0^f);
d||e.push.apply(e,g);
return !1
}}else{if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0])){return !0
}}return b
},POS:function(a){a.unshift(!0);
return a
}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"
},disabled:function(a){return a.disabled===!0
},checked:function(a){return a.checked===!0
},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;
return a.selected===!0
},parent:function(a){return !!a.firstChild
},empty:function(a){return !a.firstChild
},has:function(a,b,c){return !!k(c[3],a).length
},header:function(a){return/h\d/i.test(a.nodeName)
},text:function(a){var b=a.getAttribute("type"),c=a.type;
return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)
},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type
},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type
},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type
},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type
},submit:function(a){var b=a.nodeName.toLowerCase();
return(b==="input"||b==="button")&&"submit"===a.type
},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type
},reset:function(a){var b=a.nodeName.toLowerCase();
return(b==="input"||b==="button")&&"reset"===a.type
},button:function(a){var b=a.nodeName.toLowerCase();
return b==="input"&&"button"===a.type||b==="button"
},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)
},focus:function(a){return a===a.ownerDocument.activeElement
}},setFilters:{first:function(a,b){return b===0
},last:function(a,b,c,d){return b===d.length-1
},even:function(a,b){return b%2===0
},odd:function(a,b){return b%2===1
},lt:function(a,b,c){return b<c[3]-0
},gt:function(a,b,c){return b>c[3]-0
},nth:function(a,b,c){return c[3]-0===b
},eq:function(a,b,c){return c[3]-0===b
}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];
if(f){return f(a,c,b,d)
}if(e==="contains"){return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0
}if(e==="not"){var g=b[3];
for(var h=0,i=g.length;
h<i;
h++){if(g[h]===a){return !1
}}return !0
}k.error(e)
},CHILD:function(a,b){var c=b[1],d=a;
switch(c){case"only":case"first":while(d=d.previousSibling){if(d.nodeType===1){return !1
}}if(c==="first"){return !0
}d=a;
case"last":while(d=d.nextSibling){if(d.nodeType===1){return !1
}}return !0;
case"nth":var e=b[2],f=b[3];
if(e===1&&f===0){return !0
}var g=b[0],h=a.parentNode;
if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;
for(d=h.firstChild;
d;
d=d.nextSibling){d.nodeType===1&&(d.nodeIndex=++i)
}h.sizcache=g
}var j=a.nodeIndex-f;
return e===0?j===0:j%e===0&&j/e>=0
}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b
},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b
},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1
},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];
return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1
},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];
if(f){return f(a,c,b,d)
}}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)
};
for(var o in l.match){l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n))
}var p=function(a,b){a=Array.prototype.slice.call(a,0);
if(b){b.push.apply(b,a);
return b
}return a
};
try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType
}catch(q){p=function(a,b){var c=0,d=b||[];
if(e.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)
}else{if(typeof a.length=="number"){for(var f=a.length;
c<f;
c++){d.push(a[c])
}}else{for(;
a[c];
c++){d.push(a[c])
}}}return d
}
}var r,s;
c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;
return 0
}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1
}return a.compareDocumentPosition(b)&4?-1:1
}:(r=function(a,b){if(a===b){g=!0;
return 0
}if(a.sourceIndex&&b.sourceIndex){return a.sourceIndex-b.sourceIndex
}var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;
if(h===i){return s(a,b)
}if(!h){return -1
}if(!i){return 1
}while(j){e.unshift(j),j=j.parentNode
}j=i;
while(j){f.unshift(j),j=j.parentNode
}c=e.length,d=f.length;
for(var k=0;
k<c&&k<d;
k++){if(e[k]!==f[k]){return s(e[k],f[k])
}}return k===c?s(a,f[k],-1):s(e[k],b,1)
},s=function(a,b,c){if(a===b){return c
}var d=a.nextSibling;
while(d){if(d===b){return -1
}d=d.nextSibling
}return 1
}),k.getText=function(a){var b="",c;
for(var d=0;
a[d];
d++){c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes))
}return b
},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;
a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);
return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]
}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");
return a.nodeType===1&&c&&c.nodeValue===b
}),e.removeChild(a),e=a=null
}(),function(){var a=c.createElement("div");
a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);
if(a[1]==="*"){var d=[];
for(var e=0;
c[e];
e++){c[e].nodeType===1&&d.push(c[e])
}c=d
}return c
}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)
}),a=null
}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";
b.innerHTML="<p class='TEST'></p>";
if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;
if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);
if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return p(e.getElementsByTagName(b),f)
}if(h[2]&&l.find.CLASS&&e.getElementsByClassName){return p(e.getElementsByClassName(h[2]),f)
}}if(e.nodeType===9){if(b==="body"&&e.body){return p([e.body],f)
}if(h&&h[3]){var i=e.getElementById(h[3]);
if(!i||!i.parentNode){return p([],f)
}if(i.id===h[3]){return p([i],f)
}}try{return p(e.querySelectorAll(b),f)
}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);
n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);
try{if(!r||q){return p(e.querySelectorAll("[id='"+o+"'] "+b),f)
}}catch(s){}finally{n||m.removeAttribute("id")
}}}}return a(b,e,f,g)
};
for(var e in a){k[e]=a[e]
}b=null
}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;
if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;
try{b.call(c.documentElement,"[test!='']:sizzle")
}catch(f){e=!0
}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");
if(!k.isXML(a)){try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);
if(f||!d||a.document&&a.document.nodeType!==11){return f
}}}catch(g){}}return k(c,null,null,[a]).length>0
}
}}(),function(){var a=c.createElement("div");
a.innerHTML="<div class='test e'></div><div class='test'></div>";
if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";
if(a.getElementsByClassName("e").length===1){return
}l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])
}},a=null
}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)
}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)
}:k.contains=function(){return !1
},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;
return b?b.nodeName!=="HTML":!1
};
var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;
while(c=l.match.PSEUDO.exec(a)){e+=c[0],a=a.replace(l.match.PSEUDO,"")
}a=l.relative[a]?a+"*":a;
for(var g=0,h=f.length;
g<h;
g++){k(a,f[g],d)
}return k.filter(e,d)
};
f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains
}();
var N=/Until$/,O=/^(?:parents|prevUntil|prevAll)/,P=/,/,Q=/^.[^:#\[\.,]*$/,R=Array.prototype.slice,S=f.expr.match.POS,T={children:!0,contents:!0,next:!0,prev:!0};
f.fn.extend({find:function(a){var b=this,c,d;
if(typeof a!="string"){return f(a).filter(function(){for(c=0,d=b.length;
c<d;
c++){if(f.contains(b[c],this)){return !0
}}})
}var e=this.pushStack("","find",a),g,h,i;
for(c=0,d=this.length;
c<d;
c++){g=e.length,f.find(a,this[c],e);
if(c>0){for(h=g;
h<e.length;
h++){for(i=0;
i<g;
i++){if(e[i]===e[h]){e.splice(h--,1);
break
}}}}}return e
},has:function(a){var b=f(a);
return this.filter(function(){for(var a=0,c=b.length;
a<c;
a++){if(f.contains(this,b[a])){return !0
}}})
},not:function(a){return this.pushStack(V(this,a,!1),"not",a)
},filter:function(a){return this.pushStack(V(this,a,!0),"filter",a)
},is:function(a){return !!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)
},closest:function(a,b){var c=[],d,e,g=this[0];
if(f.isArray(a)){var h,i,j={},k=1;
if(g&&a.length){for(d=0,e=a.length;
d<e;
d++){i=a[d],j[i]||(j[i]=S.test(i)?f(i,b||this.context):i)
}while(g&&g.ownerDocument&&g!==b){for(i in j){h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k})
}g=g.parentNode,k++
}}return c
}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;
for(d=0,e=this.length;
d<e;
d++){g=this[d];
while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);
break
}g=g.parentNode;
if(!g||!g.ownerDocument||g===b||g.nodeType===11){break
}}}c=c.length>1?f.unique(c):c;
return this.pushStack(c,"closest",a)
},index:function(a){if(!a){return this[0]&&this[0].parentNode?this.prevAll().length:-1
}if(typeof a=="string"){return f.inArray(this[0],f(a))
}return f.inArray(a.jquery?a[0]:a,this)
},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);
return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))
},andSelf:function(){return this.add(this.prevObject)
}}),f.each({parent:function(a){var b=a.parentNode;
return b&&b.nodeType!==11?b:null
},parents:function(a){return f.dir(a,"parentNode")
},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)
},next:function(a){return f.nth(a,2,"nextSibling")
},prev:function(a){return f.nth(a,2,"previousSibling")
},nextAll:function(a){return f.dir(a,"nextSibling")
},prevAll:function(a){return f.dir(a,"previousSibling")
},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)
},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)
},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)
},children:function(a){return f.sibling(a.firstChild)
},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)
}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);
N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());
return this.pushStack(e,a,g.join(","))
}
}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");
return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)
},dir:function(a,c,d){var e=[],g=a[c];
while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d))){g.nodeType===1&&e.push(g),g=g[c]
}return e
},nth:function(a,b,c,d){b=b||1;
var e=0;
for(;
a;
a=a[c]){if(a.nodeType===1&&++e===b){break
}}return a
},sibling:function(a,b){var c=[];
for(;
a;
a=a.nextSibling){a.nodeType===1&&a!==b&&c.push(a)
}return c
}});
var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|object|embed|option|style)/i,bb=/checked\s*(?:[^=]|=\s*.checked.)/i,bc=/\/(java|ecma)script/i,bd=/^\s*<!(?:\[CDATA\[|\-\-)/,be={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,"",""]};
be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);
c.text(a.call(this,b,c.text()))
})
}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))
}return f.text(this)
},wrapAll:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapAll(a.call(this,b))
})
}if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;
while(a.firstChild&&a.firstChild.nodeType===1){a=a.firstChild
}return a
}).append(this)
}return this
},wrapInner:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapInner(a.call(this,b))
})
}return this.each(function(){var b=f(this),c=b.contents();
c.length?c.wrapAll(a):b.append(a)
})
},wrap:function(a){return this.each(function(){f(this).wrapAll(a)
})
},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)
}).end()
},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)
})
},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)
})
},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)
})
}if(arguments.length){var a=f(arguments[0]);
a.push.apply(a,this.toArray());
return this.pushStack(a,"before",arguments)
}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)
})
}if(arguments.length){var a=this.pushStack(this,"after",arguments);
a.push.apply(a,f(arguments[0]).toArray());
return a
}},remove:function(a,b){for(var c=0,d;
(d=this[c])!=null;
c++){if(!a||f.filter(a,[d]).length){!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d)
}}return this
},empty:function(){for(var a=0,b;
(b=this[a])!=null;
a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));
while(b.firstChild){b.removeChild(b.firstChild)
}}return this
},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;
return this.map(function(){return f.clone(this,a,b)
})
},html:function(a){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null
}if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");
try{for(var c=0,d=this.length;
c<d;
c++){this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)
}}catch(e){this.empty().append(a)
}}else{f.isFunction(a)?this.each(function(b){var c=f(this);
c.html(a.call(this,b,c.html()))
}):this.empty().append(a)
}return this
},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a)){return this.each(function(b){var c=f(this),d=c.html();
c.replaceWith(a.call(this,b,d))
})
}typeof a!="string"&&(a=f(a).detach());
return this.each(function(){var b=this.nextSibling,c=this.parentNode;
f(this).remove(),b?f(b).before(a):f(c).append(a)
})
}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this
},detach:function(a){return this.remove(a,!0)
},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];
if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bb.test(j)){return this.each(function(){f(this).domManip(a,c,d,!0)
})
}if(f.isFunction(j)){return this.each(function(e){var g=f(this);
a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)
})
}if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;
if(g){c=c&&f.nodeName(g,"tr");
for(var l=0,m=this.length,n=m-1;
l<m;
l++){d.call(c?bf(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)
}}k.length&&f.each(k,bl)
}return this
}}),f.buildFragment=function(a,b,d){var e,g,h,i;
b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!ba.test(a[0])&&(f.support.checkClone||!bb.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);
return{fragment:e,cacheable:g}
},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;
if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);
return this
}for(var h=0,i=e.length;
h<i;
h++){var j=(h>0?this.clone(!0):this).get();
f(e[h])[b](j),d=d.concat(j)
}return this.pushStack(d,a,e.selector)
}
}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;
if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);
for(h=0;
e[h];
++h){g[h]&&bh(e[h],g[h])
}}if(b){bg(a,d);
if(c){e=bi(a),g=bi(d);
for(h=0;
e[h];
++h){bg(e[h],g[h])
}}}e=g=null;
return d
},clean:function(a,b,d,e){var g;
b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);
var h=[],i;
for(var j=0,k;
(k=a[j])!=null;
j++){typeof k=="number"&&(k+="");
if(!k){continue
}if(typeof k=="string"){if(!_.test(k)){k=b.createTextNode(k)
}else{k=k.replace(Y,"<$1></$2>");
var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");
o.innerHTML=m[1]+k+m[2];
while(n--){o=o.lastChild
}if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];
for(i=q.length-1;
i>=0;
--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])
}}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes
}}var r;
if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;
i<r;
i++){bk(k[i])
}}else{bk(k)
}}k.nodeType?h.push(k):h=f.merge(h,k)
}if(d){g=function(a){return !a.type||bc.test(a.type)
};
for(j=0;
h[j];
j++){if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript")){e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j])
}else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);
h.splice.apply(h,[j+1,0].concat(s))
}d.appendChild(h[j])
}}}return h
},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;
for(var i=0,j;
(j=a[i])!=null;
i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()]){continue
}c=j[f.expando];
if(c){b=d[c]&&d[c][e];
if(b&&b.events){for(var k in b.events){g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle)
}b.handle&&(b.handle.elem=null)
}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]
}}}});
var bm=/alpha\([^)]*\)/i,bn=/opacity=([^)]*)/,bo=/([A-Z]|^ms)/g,bp=/^-?\d+(?:px)?$/i,bq=/^-?\d/,br=/^([\-+])=([\-+.\de]+)/,bs={position:"absolute",visibility:"hidden",display:"block"},bt=["Left","Right"],bu=["Top","Bottom"],bv,bw,bx;
f.fn.css=function(a,c){if(arguments.length===2&&c===b){return this
}return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)
})
},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bv(a,"opacity","opacity");
return c===""?"1":c
}return a.style.opacity
}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];
c=f.cssProps[i]||i;
if(d===b){if(k&&"get" in k&&(g=k.get(a,!1,e))!==b){return g
}return j[c]
}h=typeof d,h==="string"&&(g=br.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");
if(d==null||h==="number"&&isNaN(d)){return
}h==="number"&&!f.cssNumber[i]&&(d+="px");
if(!k||!("set" in k)||(d=k.set(a,d))!==b){try{j[c]=d
}catch(l){}}}},css:function(a,c,d){var e,g;
c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");
if(g&&"get" in g&&(e=g.get(a,!0,d))!==b){return e
}if(bv){return bv(a,c)
}},swap:function(a,b,c){var d={};
for(var e in b){d[e]=a.style[e],a.style[e]=b[e]
}c.call(a);
for(e in b){a.style[e]=d[e]
}}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;
if(c){if(a.offsetWidth!==0){return by(a,b,d)
}f.swap(a,bs,function(){e=by(a,b,d)
});
return e
}},set:function(a,b){if(!bp.test(b)){return b
}b=parseFloat(b);
if(b>=0){return b+"px"
}}}
}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""
},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";
c.zoom=1;
if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");
if(d&&!d.filter){return
}}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e
}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;
f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight
});
return c
}})
}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;
c=c.replace(bo,"-$1").toLowerCase();
if(!(e=a.ownerDocument.defaultView)){return b
}if(g=e.getComputedStyle(a,null)){d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c))
}return d
}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;
!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));
return d===""?"auto":d
}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;
return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"
},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)
});
var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];
try{bR=e.href
}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href
}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO){return bO.apply(this,arguments)
}if(!this.length){return this
}var e=a.indexOf(" ");
if(e>=0){var g=a.slice(e,a.length);
a=a.slice(0,e)
}var h="GET";
c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));
var i=this;
f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a
}),i.html(g?f("<div>").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])
}});
return this
},serialize:function(){return f.param(this.serializeArray())
},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this
}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))
}).map(function(a,b){var c=f(this).val();
return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}
}):{name:b.name,value:c.replace(bB,"\r\n")}
}).get()
}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)
}
}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);
return f.ajax({type:c,url:a,data:d,success:e,dataType:g})
}
}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")
},getJSON:function(a,b,c){return f.get(a,b,c,"json")
},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);
return a
},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;
var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;
if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified")){f.lastModified[k]=y
}if(z=v.getResponseHeader("Etag")){f.etag[k]=z
}}if(a===304){w="notmodified",o=!0
}else{try{r=b$(d,x),w="success",o=!0
}catch(A){w="parsererror",u=A
}}}else{u=w;
if(!w||a){w="error",a<0&&(a=0)
}}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))
}}typeof a=="object"&&(c=a,a=b),c=c||{};
var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();
a=m[c]=m[c]||a,l[a]=b
}return this
},getAllResponseHeaders:function(){return s===2?n:null
},getResponseHeader:function(a){var c;
if(s===2){if(!o){o={};
while(c=bD.exec(n)){o[c[1].toLowerCase()]=c[2]
}}c=o[a.toLowerCase()]
}return c===b?null:c
},overrideMimeType:function(a){s||(d.mimeType=a);
return this
},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);
return this
}};
h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;
if(s<2){for(b in a){j[b]=[j[b],a[b]]
}}else{b=a[v.status],v.then(b,b)
}}return this
},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);
if(s===2){return !1
}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");
if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;
if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);
d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")
}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);
for(u in d.headers){v.setRequestHeader(u,d.headers[u])
}if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();
return !1
}for(u in {success:1,error:1,complete:1}){v[u](d[u])
}p=bW(bQ,d,c,v);
if(!p){w(-1,"No Transport")
}else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")
},d.timeout));
try{s=1,p.send(l,w)
}catch(z){s<2?w(-1,z):f.error(z)
}}return v
},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)
};
c===b&&(c=f.ajaxSettings.traditional);
if(f.isArray(a)||a.jquery&&!f.isPlainObject(a)){f.each(a,function(){e(this.name,this.value)
})
}else{for(var g in a){bY(g,a[g],c,e)
}}return d.join("&").replace(bz,"+")
}}),f.extend({active:0,lastModified:{},etag:{}});
var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;
f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++
}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";
if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";
b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]
},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])
}),b.converters["script json"]=function(){g||f.error(h+" was not called");
return g[0]
},b.dataTypes[0]="json";
return"script"
}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);
return a
}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)
}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;
return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState)){d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")
}},e.insertBefore(d,e.firstChild)
},abort:function(){d&&d.onload(0,1)
}}
}});
var cb=a.ActiveXObject?function(){for(var a in cd){cd[a](0,1)
}}:!1,cc=0,cd;
f.ajaxSettings.xhr=a.ActiveXObject?function(){return !this.isLocal&&ce()||cf()
}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a})
}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;
return{send:function(e,g){var h=c.xhr(),i,j;
c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);
if(c.xhrFields){for(j in c.xhrFields){h[j]=c.xhrFields[j]
}}c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");
try{for(j in e){h.setRequestHeader(j,e[j])
}}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;
try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);
if(e){h.readyState!==4&&h.abort()
}else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;
try{k=h.statusText
}catch(o){k=""
}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)
}}}catch(p){e||g(-1,p)
}m&&g(j,k,m,l)
},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)
},abort:function(){d&&d(0,1)
}}
}});
var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;
f.fn.extend({show:function(a,b,c){var d,e;
if(a||a===0){return this.animate(cq("show",3),a,b,c)
}for(var g=0,h=this.length;
g<h;
g++){d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cr(d.nodeName)))
}for(g=0;
g<h;
g++){d=this[g];
if(d.style){e=d.style.display;
if(e===""||e==="none"){d.style.display=f._data(d,"olddisplay")||""
}}}return this
},hide:function(a,b,c){if(a||a===0){return this.animate(cq("hide",3),a,b,c)
}for(var d=0,e=this.length;
d<e;
d++){if(this[d].style){var g=f.css(this[d],"display");
g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)
}}for(d=0;
d<e;
d++){this[d].style&&(this[d].style.display="none")
}return this
},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";
f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");
f(this)[b?"show":"hide"]()
}):this.animate(cq("toggle",3),a,b,c);
return this
},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)
},animate:function(a,b,c,d){var e=f.speed(b,c,d);
if(f.isEmptyObject(a)){return this.each(e.complete,[!1])
}a=f.extend({},a);
return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);
var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;
b.animatedProperties={};
for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";
if(h==="hide"&&d||h==="show"&&!d){return b.complete.call(this)
}c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cr(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))
}b.overflow!=null&&(this.style.overflow="hidden");
for(i in a){k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""))
}return !0
})
},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;
b||f._unmark(!0,this);
while(c--){a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))
}}),b||this.dequeue();
return this
}}),f.each({slideDown:cq("show",1),slideUp:cq("hide",1),slideToggle:cq("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)
}
}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};
d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)
};
return d
},easing:{linear:function(a,b,c,d){return c+d*a
},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+0.5)*d+c
}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}
}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)
},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]
}var a,b=f.css(this.elem,this.prop);
return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a
},custom:function(a,b,c){function g(a){return d.step(a)
}var d=this,e=f.fx;
this.startTime=cn||co(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&f.timers.push(g)&&!cl&&(cl=setInterval(e.tick,e.interval))
},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()
},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)
},step:function(a){var b=cn||co(),c=!0,d=this.elem,e=this.options,g,h;
if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;
for(g in e.animatedProperties){e.animatedProperties[g]!==!0&&(c=!1)
}if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]
}),e.hide&&f(d).hide();
if(e.hide||e.show){for(var i in e.animatedProperties){f.style(d,i,e.orig[i])
}}e.complete.call(d)
}return !1
}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();
return !0
}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;
b<a.length;
++b){a[b]()||a.splice(b--,1)
}a.length||f.fx.stop()
},interval:13,stop:function(){clearInterval(cl),cl=null
},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)
},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now
}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem
}).length
});
var cs=/^t(?:able|d|h)$/i,ct=/^(?:body|html)$/i;
"getBoundingClientRect" in c.documentElement?f.fn.offset=function(a){var b=this[0],c;
if(a){return this.each(function(b){f.offset.setOffset(this,a,b)
})
}if(!b||!b.ownerDocument){return null
}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)
}try{c=b.getBoundingClientRect()
}catch(d){}var e=b.ownerDocument,g=e.documentElement;
if(!c||!f.contains(g,b)){return c?{top:c.top,left:c.left}:{top:0,left:0}
}var h=e.body,i=cu(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;
return{top:n,left:o}
}:f.fn.offset=function(a){var b=this[0];
if(a){return this.each(function(b){f.offset.setOffset(this,a,b)
})
}if(!b||!b.ownerDocument){return null
}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)
}f.offset.initialize();
var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;
while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed"){break
}c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!cs.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c
}if(k.position==="relative"||k.position==="static"){l+=i.offsetTop,m+=i.offsetLeft
}f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));
return{top:l,left:m}
},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop
},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;
f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);
return{top:b,left:c}
},setOffset:function(a,b,c){var d=f.css(a,"position");
d==="static"&&(a.style.position="relative");
var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;
j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using" in b?b.using.call(a,k):e.css(k)
}},f.fn.extend({position:function(){if(!this[0]){return null
}var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();
c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;
return{top:c.top-d.top,left:c.left-d.left}
},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;
while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static"){a=a.offsetParent
}return a
})
}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;
f.fn[d]=function(c){var e,g;
if(c===b){e=this[0];
if(!e){return null
}g=cu(e);
return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]
}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c
})
}
}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();
f.fn["inner"+c]=function(){var a=this[0];
return a&&a.style?parseFloat(f.css(a,d,"padding")):null
},f.fn["outer"+c]=function(a){var b=this[0];
return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null
},f.fn[d]=function(a){var e=this[0];
if(!e){return a==null?null:this
}if(f.isFunction(a)){return this.each(function(b){var c=f(this);
c[d](a.call(this,b,c[d]()))
})
}if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;
return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g
}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c])
}if(a===b){var i=f.css(e,d),j=parseFloat(i);
return f.isNaN(j)?i:j
}return this.css(d,typeof a=="string"?a:a+"px")
}
}),a.jQuery=a.$=f
})(window);
/*!
 * jQuery UI 1.8.7
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(d,b){function a(c){return !d(c).parents().andSelf().filter(function(){return d.curCSS(this,"visibility")==="hidden"||d.expr.filters.hidden(this)
}).length
}d.ui=d.ui||{};
if(!d.ui.version){d.extend(d.ui,{version:"1.8.7",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});
d.fn.extend({_focus:d.fn.focus,focus:function(e,c){return typeof e==="number"?this.each(function(){var f=this;
setTimeout(function(){d(f).focus();
c&&c.call(f)
},e)
}):this._focus.apply(this,arguments)
},scrollParent:function(){var c;
c=d.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(d.curCSS(this,"position",1))&&/(auto|scroll)/.test(d.curCSS(this,"overflow",1)+d.curCSS(this,"overflow-y",1)+d.curCSS(this,"overflow-x",1))
}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(d.curCSS(this,"overflow",1)+d.curCSS(this,"overflow-y",1)+d.curCSS(this,"overflow-x",1))
}).eq(0);
return/fixed/.test(this.css("position"))||!c.length?d(document):c
},zIndex:function(e){if(e!==b){return this.css("zIndex",e)
}if(this.length){e=d(this[0]);
for(var c;
e.length&&e[0]!==document;
){c=e.css("position");
if(c==="absolute"||c==="relative"||c==="fixed"){c=parseInt(e.css("zIndex"),10);
if(!isNaN(c)&&c!==0){return c
}}e=e.parent()
}}return 0
},disableSelection:function(){return this.bind((d.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(c){c.preventDefault()
})
},enableSelection:function(){return this.unbind(".ui-disableSelection")
}});
d.each(["Width","Height"],function(f,c){function l(n,i,h,e){d.each(k,function(){i-=parseFloat(d.curCSS(n,"padding"+this,true))||0;
if(h){i-=parseFloat(d.curCSS(n,"border"+this+"Width",true))||0
}if(e){i-=parseFloat(d.curCSS(n,"margin"+this,true))||0
}});
return i
}var k=c==="Width"?["Left","Right"]:["Top","Bottom"],j=c.toLowerCase(),g={innerWidth:d.fn.innerWidth,innerHeight:d.fn.innerHeight,outerWidth:d.fn.outerWidth,outerHeight:d.fn.outerHeight};
d.fn["inner"+c]=function(e){if(e===b){return g["inner"+c].call(this)
}return this.each(function(){d(this).css(j,l(this,e)+"px")
})
};
d.fn["outer"+c]=function(h,e){if(typeof h!=="number"){return g["outer"+c].call(this,h)
}return this.each(function(){d(this).css(j,l(this,h,true,e)+"px")
})
}
});
d.extend(d.expr[":"],{data:function(e,c,f){return !!d.data(e,f[3])
},focusable:function(e){var c=e.nodeName.toLowerCase(),f=d.attr(e,"tabindex");
if("area"===c){c=e.parentNode;
f=c.name;
if(!e.href||!f||c.nodeName.toLowerCase()!=="map"){return false
}e=d("img[usemap=#"+f+"]")[0];
return !!e&&a(e)
}return(/input|select|textarea|button|object/.test(c)?!e.disabled:"a"==c?e.href||!isNaN(f):!isNaN(f))&&a(e)
},tabbable:function(e){var c=d.attr(e,"tabindex");
return(isNaN(c)||c>=0)&&d(e).is(":focusable")
}});
d(function(){var e=document.body,c=e.appendChild(c=document.createElement("div"));
d.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});
d.support.minHeight=c.offsetHeight===100;
d.support.selectstart="onselectstart" in c;
e.removeChild(c).style.display="none"
});
d.extend(d.ui,{plugin:{add:function(f,c,h){f=d.ui[f].prototype;
for(var g in h){f.plugins[g]=f.plugins[g]||[];
f.plugins[g].push([c,h[g]])
}},call:function(f,c,h){if((c=f.plugins[c])&&f.element[0].parentNode){for(var g=0;
g<c.length;
g++){f.options[c[g][0]]&&c[g][1].apply(f.element,h)
}}}},contains:function(e,c){return document.compareDocumentPosition?e.compareDocumentPosition(c)&16:e!==c&&e.contains(c)
},hasScroll:function(e,c){if(d(e).css("overflow")==="hidden"){return false
}c=c&&c==="left"?"scrollLeft":"scrollTop";
var f=false;
if(e[c]>0){return true
}e[c]=1;
f=e[c]>0;
e[c]=0;
return f
},isOverAxis:function(e,c,f){return e>c&&e<c+f
},isOver:function(f,c,l,k,j,g){return d.ui.isOverAxis(f,l,j)&&d.ui.isOverAxis(c,k,g)
}})
}})(jQuery);
/*!
 * jQuery UI Widget 1.8.7
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(a,e){if(a.cleanData){var d=a.cleanData;
a.cleanData=function(b){for(var g=0,f;
(f=b[g])!=null;
g++){a(f).triggerHandler("remove")
}d(b)
}
}else{var c=a.fn.remove;
a.fn.remove=function(b,f){return this.each(function(){if(!f){if(!b||a.filter(b,[this]).length){a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")
})
}}return c.call(a(this),b,f)
})
}
}a.widget=function(b,j,i){var h=b.split(".")[0],g;
b=b.split(".")[1];
g=h+"-"+b;
if(!i){i=j;
j=a.Widget
}a.expr[":"][g]=function(f){return !!a.data(f,b)
};
a[h]=a[h]||{};
a[h][b]=function(f,k){arguments.length&&this._createWidget(f,k)
};
j=new j;
j.options=a.extend(true,{},j.options);
a[h][b].prototype=a.extend(true,j,{namespace:h,widgetName:b,widgetEventPrefix:a[h][b].prototype.widgetEventPrefix||b,widgetBaseClass:g},i);
a.widget.bridge(b,a[h][b])
};
a.widget.bridge=function(b,f){a.fn[b]=function(k){var j=typeof k==="string",i=Array.prototype.slice.call(arguments,1),g=this;
k=!j&&i.length?a.extend.apply(null,[true,k].concat(i)):k;
if(j&&k.charAt(0)==="_"){return g
}j?this.each(function(){var l=a.data(this,b),h=l&&a.isFunction(l[k])?l[k].apply(l,i):l;
if(h!==l&&h!==e){g=h;
return false
}}):this.each(function(){var h=a.data(this,b);
h?h.option(k||{})._init():a.data(this,b,new f(k,this))
});
return g
}
};
a.Widget=function(b,f){arguments.length&&this._createWidget(b,f)
};
a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,g){a.data(g,this.widgetName,this);
this.element=a(g);
this.options=a.extend(true,{},this.options,this._getCreateOptions(),b);
var f=this;
this.element.bind("remove."+this.widgetName,function(){f.destroy()
});
this._create();
this._trigger("create");
this._init()
},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]
},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);
this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")
},widget:function(){return this.element
},option:function(b,g){var f=b;
if(arguments.length===0){return a.extend({},this.options)
}if(typeof b==="string"){if(g===e){return this.options[b]
}f={};
f[b]=g
}this._setOptions(f);
return this
},_setOptions:function(b){var f=this;
a.each(b,function(h,g){f._setOption(h,g)
});
return this
},_setOption:function(b,f){this.options[b]=f;
if(b==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)
}return this
},enable:function(){return this._setOption("disabled",false)
},disable:function(){return this._setOption("disabled",true)
},_trigger:function(b,j,i){var h=this.options[b];
j=a.Event(j);
j.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();
i=i||{};
if(j.originalEvent){b=a.event.props.length;
for(var g;
b;
){g=a.event.props[--b];
j[g]=j.originalEvent[g]
}}this.element.trigger(j,i);
return !(a.isFunction(h)&&h.call(this.element[0],j,i)===false||j.isDefaultPrevented())
}}
})(jQuery);
(function(f){f.ui=f.ui||{};
var e=/left|center|right/,d=/top|center|bottom/,b=f.fn.position,a=f.fn.offset;
f.fn.position=function(c){if(!c||!c.of){return b.apply(this,arguments)
}c=f.extend({},c);
var i=f(c.of),q=i[0],o=(c.collision||"flip").split(" "),p=c.offset?c.offset.split(" "):[0,0],n,l,m;
if(q.nodeType===9){n=i.width();
l=i.height();
m={top:0,left:0}
}else{if(q.setTimeout){n=i.width();
l=i.height();
m={top:i.scrollTop(),left:i.scrollLeft()}
}else{if(q.preventDefault){c.at="left top";
n=l=0;
m={top:c.of.pageY,left:c.of.pageX}
}else{n=i.outerWidth();
l=i.outerHeight();
m=i.offset()
}}}f.each(["my","at"],function(){var g=(c[this]||"").split(" ");
if(g.length===1){g=e.test(g[0])?g.concat(["center"]):d.test(g[0])?["center"].concat(g):["center","center"]
}g[0]=e.test(g[0])?g[0]:"center";
g[1]=d.test(g[1])?g[1]:"center";
c[this]=g
});
if(o.length===1){o[1]=o[0]
}p[0]=parseInt(p[0],10)||0;
if(p.length===1){p[1]=p[0]
}p[1]=parseInt(p[1],10)||0;
if(c.at[0]==="right"){m.left+=n
}else{if(c.at[0]==="center"){m.left+=n/2
}}if(c.at[1]==="bottom"){m.top+=l
}else{if(c.at[1]==="center"){m.top+=l/2
}}m.left+=p[0];
m.top+=p[1];
return this.each(function(){var u=f(this),s=u.outerWidth(),k=u.outerHeight(),j=parseInt(f.curCSS(this,"marginLeft",true))||0,h=parseInt(f.curCSS(this,"marginTop",true))||0,y=s+j+parseInt(f.curCSS(this,"marginRight",true))||0,x=k+h+parseInt(f.curCSS(this,"marginBottom",true))||0,t=f.extend({},m),g;
if(c.my[0]==="right"){t.left-=s
}else{if(c.my[0]==="center"){t.left-=s/2
}}if(c.my[1]==="bottom"){t.top-=k
}else{if(c.my[1]==="center"){t.top-=k/2
}}t.left=Math.round(t.left);
t.top=Math.round(t.top);
g={left:t.left-j,top:t.top-h};
f.each(["left","top"],function(v,r){f.ui.position[o[v]]&&f.ui.position[o[v]][r](t,{targetWidth:n,targetHeight:l,elemWidth:s,elemHeight:k,collisionPosition:g,collisionWidth:y,collisionHeight:x,offset:p,my:c.my,at:c.at})
});
f.fn.bgiframe&&u.bgiframe();
u.offset(f.extend(t,{using:c.using}))
})
};
f.ui.position={fit:{left:function(c,g){var h=f(window);
h=g.collisionPosition.left+g.collisionWidth-h.width()-h.scrollLeft();
c.left=h>0?c.left-h:Math.max(c.left-g.collisionPosition.left,c.left)
},top:function(c,g){var h=f(window);
h=g.collisionPosition.top+g.collisionHeight-h.height()-h.scrollTop();
c.top=h>0?c.top-h:Math.max(c.top-g.collisionPosition.top,c.top)
}},flip:{left:function(c,i){if(i.at[0]!=="center"){var m=f(window);
m=i.collisionPosition.left+i.collisionWidth-m.width()-m.scrollLeft();
var k=i.my[0]==="left"?-i.elemWidth:i.my[0]==="right"?i.elemWidth:0,l=i.at[0]==="left"?i.targetWidth:-i.targetWidth,j=-2*i.offset[0];
c.left+=i.collisionPosition.left<0?k+l+j:m>0?k+l+j:0
}},top:function(c,i){if(i.at[1]!=="center"){var m=f(window);
m=i.collisionPosition.top+i.collisionHeight-m.height()-m.scrollTop();
var k=i.my[1]==="top"?-i.elemHeight:i.my[1]==="bottom"?i.elemHeight:0,l=i.at[1]==="top"?i.targetHeight:-i.targetHeight,j=-2*i.offset[1];
c.top+=i.collisionPosition.top<0?k+l+j:m>0?k+l+j:0
}}}};
if(!f.offset.setOffset){f.offset.setOffset=function(c,i){if(/static/.test(f.curCSS(c,"position"))){c.style.position="relative"
}var m=f(c),k=m.offset(),l=parseInt(f.curCSS(c,"top",true),10)||0,j=parseInt(f.curCSS(c,"left",true),10)||0;
k={top:i.top-k.top+l,left:i.left-k.left+j};
"using" in i?i.using.call(c,k):m.css(k)
};
f.fn.offset=function(c){var g=this[0];
if(!g||!g.ownerDocument){return null
}if(c){return this.each(function(){f.offset.setOffset(this,c)
})
}return a.call(this)
}
}})(jQuery);
(function(e,d){var b={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},a={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};
e.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(f){var c=e(this).css(f).offset().top;
c<0&&e(this).css("top",f.top-c)
}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},_create:function(){this.originalTitle=this.element.attr("title");
if(typeof this.originalTitle!=="string"){this.originalTitle=""
}this.options.title=this.options.title||this.originalTitle;
var i=this,c=i.options,n=c.title||"&#160;",m=e.ui.dialog.getTitleId(i.element),k=(i.uiDialog=e("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+c.dialogClass).css({zIndex:c.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(f){if(c.closeOnEscape&&f.keyCode&&f.keyCode===e.ui.keyCode.ESCAPE){i.close(f);
f.preventDefault()
}}).attr({role:"dialog","aria-labelledby":m}).mousedown(function(f){i.moveToTop(false,f)
});
i.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k);
var l=(i.uiDialogTitlebar=e("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),j=e('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")
},function(){j.removeClass("ui-state-hover")
}).focus(function(){j.addClass("ui-state-focus")
}).blur(function(){j.removeClass("ui-state-focus")
}).click(function(f){i.close(f);
return false
}).appendTo(l);
(i.uiDialogTitlebarCloseText=e("<span></span>")).addClass("ui-icon ui-icon-closethick").text(c.closeText).appendTo(j);
e("<span></span>").addClass("ui-dialog-title").attr("id",m).html(n).prependTo(l);
if(e.isFunction(c.beforeclose)&&!e.isFunction(c.beforeClose)){c.beforeClose=c.beforeclose
}l.find("*").add(l).disableSelection();
c.draggable&&e.fn.draggable&&i._makeDraggable();
c.resizable&&e.fn.resizable&&i._makeResizable();
i._createButtons(c.buttons);
i._isOpen=false;
e.fn.bgiframe&&k.bgiframe()
},_init:function(){this.options.autoOpen&&this.open()
},destroy:function(){var c=this;
c.overlay&&c.overlay.destroy();
c.uiDialog.hide();
c.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
c.uiDialog.remove();
c.originalTitle&&c.element.attr("title",c.originalTitle);
return c
},widget:function(){return this.uiDialog
},close:function(f){var c=this,h,g;
if(false!==c._trigger("beforeClose",f)){c.overlay&&c.overlay.destroy();
c.uiDialog.unbind("keypress.ui-dialog");
c._isOpen=false;
if(c.options.hide){c.uiDialog.hide(c.options.hide,function(){c._trigger("close",f)
})
}else{c.uiDialog.hide();
c._trigger("close",f)
}e.ui.dialog.overlay.resize();
if(c.options.modal){h=0;
e(".ui-dialog").each(function(){if(this!==c.uiDialog[0]){g=e(this).css("z-index");
isNaN(g)||(h=Math.max(h,g))
}});
e.ui.dialog.maxZ=h
}return c
}},isOpen:function(){return this._isOpen
},moveToTop:function(f,c){var h=this,g=h.options;
if(g.modal&&!f||!g.stack&&!g.modal){return h._trigger("focus",c)
}if(g.zIndex>e.ui.dialog.maxZ){e.ui.dialog.maxZ=g.zIndex
}if(h.overlay){e.ui.dialog.maxZ+=1;
h.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ)
}f={scrollTop:h.element.attr("scrollTop"),scrollLeft:h.element.attr("scrollLeft")};
e.ui.dialog.maxZ+=1;
h.uiDialog.css("z-index",e.ui.dialog.maxZ);
h.element.attr(f);
h._trigger("focus",c);
return h
},open:function(){if(!this._isOpen){var f=this,c=f.options,g=f.uiDialog;
f.overlay=c.modal?new e.ui.dialog.overlay(f):null;
f._size();
f._position(c.position);
g.show(c.show);
f.moveToTop(true);
c.modal&&g.bind("keypress.ui-dialog",function(j){if(j.keyCode===e.ui.keyCode.TAB){var h=e(":tabbable",this),i=h.filter(":first");
h=h.filter(":last");
if(j.target===h[0]&&!j.shiftKey){i.focus(1);
return false
}else{if(j.target===i[0]&&j.shiftKey){h.focus(1);
return false
}}}});
e(f.element.find(":tabbable").get().concat(g.find(".ui-dialog-buttonpane :tabbable").get().concat(g.get()))).eq(0).focus();
f._isOpen=true;
f._trigger("open");
return f
}},_createButtons:function(f){var c=this,j=false,i=e("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),h=e("<div></div>").addClass("ui-dialog-buttonset").appendTo(i);
c.uiDialog.find(".ui-dialog-buttonpane").remove();
typeof f==="object"&&f!==null&&e.each(f,function(){return !(j=true)
});
if(j){e.each(f,function(k,g){g=e.isFunction(g)?{click:g,text:k}:g;
k=e('<button type="button"></button>').attr(g,true).unbind("click").click(function(){g.click.apply(c.element[0],arguments)
}).appendTo(h);
e.fn.button&&k.button()
});
i.appendTo(c.uiDialog)
}},_makeDraggable:function(){function f(g){return{position:g.position,offset:g.offset}
}var c=this,j=c.options,i=e(document),h;
c.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(k,g){h=j.height==="auto"?"auto":e(this).height();
e(this).height(e(this).height()).addClass("ui-dialog-dragging");
c._trigger("dragStart",k,f(g))
},drag:function(k,g){c._trigger("drag",k,f(g))
},stop:function(k,g){j.position=[g.position.left-i.scrollLeft(),g.position.top-i.scrollTop()];
e(this).removeClass("ui-dialog-dragging").height(h);
c._trigger("dragStop",k,f(g));
e.ui.dialog.overlay.resize()
}})
},_makeResizable:function(f){function c(g){return{originalPosition:g.originalPosition,originalSize:g.originalSize,position:g.position,size:g.size}
}f=f===d?this.options.resizable:f;
var j=this,i=j.options,h=j.uiDialog.css("position");
f=typeof f==="string"?f:"n,e,s,w,se,sw,ne,nw";
j.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:j.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:j._minHeight(),handles:f,start:function(k,g){e(this).addClass("ui-dialog-resizing");
j._trigger("resizeStart",k,c(g))
},resize:function(k,g){j._trigger("resize",k,c(g))
},stop:function(k,g){e(this).removeClass("ui-dialog-resizing");
i.height=e(this).height();
i.width=e(this).width();
j._trigger("resizeStop",k,c(g));
e.ui.dialog.overlay.resize()
}}).css("position",h).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")
},_minHeight:function(){var c=this.options;
return c.height==="auto"?c.minHeight:Math.min(c.minHeight,c.height)
},_position:function(f){var c=[],h=[0,0],g;
if(f){if(typeof f==="string"||typeof f==="object"&&"0" in f){c=f.split?f.split(" "):[f[0],f[1]];
if(c.length===1){c[1]=c[0]
}e.each(["left","top"],function(i,j){if(+c[i]===c[i]){h[i]=c[i];
c[i]=j
}});
f={my:c.join(" "),at:c.join(" "),offset:h.join(" ")}
}f=e.extend({},e.ui.dialog.prototype.options.position,f)
}else{f=e.ui.dialog.prototype.options.position
}(g=this.uiDialog.is(":visible"))||this.uiDialog.show();
this.uiDialog.css({top:0,left:0}).position(e.extend({of:window},f));
g||this.uiDialog.hide()
},_setOptions:function(f){var c=this,h={},g=false;
e.each(f,function(i,j){c._setOption(i,j);
if(i in b){g=true
}if(i in a){h[i]=j
}});
g&&this._size();
this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",h)
},_setOption:function(f,c){var j=this,i=j.uiDialog;
switch(f){case"beforeclose":f="beforeClose";
break;
case"buttons":j._createButtons(c);
break;
case"closeText":j.uiDialogTitlebarCloseText.text(""+c);
break;
case"dialogClass":i.removeClass(j.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+c);
break;
case"disabled":c?i.addClass("ui-dialog-disabled"):i.removeClass("ui-dialog-disabled");
break;
case"draggable":var h=i.is(":data(draggable)");
h&&!c&&i.draggable("destroy");
!h&&c&&j._makeDraggable();
break;
case"position":j._position(c);
break;
case"resizable":(h=i.is(":data(resizable)"))&&!c&&i.resizable("destroy");
h&&typeof c==="string"&&i.resizable("option","handles",c);
!h&&c!==false&&j._makeResizable(c);
break;
case"title":e(".ui-dialog-title",j.uiDialogTitlebar).html(""+(c||"&#160;"));
break
}e.Widget.prototype._setOption.apply(j,arguments)
},_size:function(){var f=this.options,c,h,g=this.uiDialog.is(":visible");
this.element.show().css({width:"auto",minHeight:0,height:0});
if(f.minWidth>f.width){f.width=f.minWidth
}c=this.uiDialog.css({height:"auto",width:f.width}).height();
h=Math.max(0,f.minHeight-c);
if(f.height==="auto"){if(e.support.minHeight){this.element.css({minHeight:h,height:"auto"})
}else{this.uiDialog.show();
f=this.element.css("height","auto").height();
g||this.uiDialog.hide();
this.element.height(Math.max(f,h))
}}else{this.element.height(Math.max(f.height-c,0))
}this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())
}});
e.extend(e.ui.dialog,{version:"1.8.7",uuid:0,maxZ:0,getTitleId:function(c){c=c.attr("id");
if(!c){this.uuid+=1;
c=this.uuid
}return"ui-dialog-title-"+c
},overlay:function(c){this.$el=e.ui.dialog.overlay.create(c)
}});
e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(c){return c+".dialog-overlay"
}).join(" "),create:function(f){if(this.instances.length===0){setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(g){if(e(g.target).zIndex()<e.ui.dialog.overlay.maxZ){return false
}})
},1);
e(document).bind("keydown.dialog-overlay",function(g){if(f.options.closeOnEscape&&g.keyCode&&g.keyCode===e.ui.keyCode.ESCAPE){f.close(g);
g.preventDefault()
}});
e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize)
}var c=(this.oldInstances.pop()||e("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});
e.fn.bgiframe&&c.bgiframe();
this.instances.push(c);
return c
},destroy:function(f){var c=e.inArray(f,this.instances);
c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]);
this.instances.length===0&&e([document,window]).unbind(".dialog-overlay");
f.remove();
var g=0;
e.each(this.instances,function(){g=Math.max(g,this.css("z-index"))
});
this.maxZ=g
},height:function(){var f,c;
if(e.browser.msie&&e.browser.version<7){f=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);
return f<c?e(window).height()+"px":f+"px"
}else{return e(document).height()+"px"
}},width:function(){var f,c;
if(e.browser.msie&&e.browser.version<7){f=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);
c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);
return f<c?e(window).width()+"px":f+"px"
}else{return e(document).width()+"px"
}},resize:function(){var c=e([]);
e.each(e.ui.dialog.overlay.instances,function(){c=c.add(this)
});
c.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})
}});
e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)
}})
})(jQuery);
jQuery.noConflict();
(function(b){function c(f,e,n){var l=n.relative?f.position().top:f.offset().top,m=n.relative?f.position().left:f.offset().left,k=n.position[0];
l-=e.outerHeight()-n.offset[0];
m+=f.outerWidth()+n.offset[1];
if(/iPad/i.test(navigator.userAgent)){l-=b(window).scrollTop()
}var g=e.outerHeight()+f.outerHeight();
if(k=="center"){l+=g/2
}if(k=="bottom"){l+=g
}k=n.position[1];
f=e.outerWidth()+f.outerWidth();
if(k=="center"){m-=f/2
}if(k=="left"){m-=f
}return{top:l,left:m}
}function a(A,z){var y=this,w=A.add(y),x,u=0,p=0,g=A.attr("title"),f=A.attr("data-tooltip"),e=d[z.effect],n,D=A.is(":input"),B=D&&A.is(":checkbox, :radio, select, :button, :submit"),C=A.attr("type"),o=z.events[C]||z.events[D?B?"widget":"input":"def"];
if(!e){throw'Nonexistent effect "'+z.effect+'"'
}o=o.split(/,\s*/);
if(o.length!=2){throw"Tooltip: bad events configuration for "+C
}A.bind(o[0],function(h){clearTimeout(u);
if(z.predelay){p=setTimeout(function(){y.show(h)
},z.predelay)
}else{y.show(h)
}}).bind(o[1],function(h){clearTimeout(p);
if(z.delay){u=setTimeout(function(){y.hide(h)
},z.delay)
}else{y.hide(h)
}});
if(g&&z.cancelDefault){A.removeAttr("title");
A.data("title",g)
}b.extend(y,{show:function(i){if(!x){if(f){x=b(f)
}else{if(z.tip){x=b(z.tip).eq(0)
}else{if(g){x=b(z.layout).addClass(z.tipClass).appendTo(document.body).hide().append(g)
}else{x=A.next();
x.length||(x=A.parent().next())
}}}if(!x.length){throw"Cannot find tooltip for "+A
}}if(y.isShown()){return y
}x.stop(true,true);
var h=c(A,x,z);
z.tip&&x.html(A.data("title"));
i=i||b.Event();
i.type="onBeforeShow";
w.trigger(i,[h]);
if(i.isDefaultPrevented()){return y
}h=c(A,x,z);
x.css({position:"absolute",top:h.top,left:h.left});
n=true;
e[0].call(y,function(){i.type="onShow";
n="full";
w.trigger(i)
});
h=z.events.tooltip.split(/,\s*/);
if(!x.data("__set")){x.bind(h[0],function(){clearTimeout(u);
clearTimeout(p)
});
h[1]&&!A.is("input:not(:checkbox, :radio), textarea")&&x.bind(h[1],function(j){j.relatedTarget!=A[0]&&A.trigger(o[1].split(" ")[0])
});
x.data("__set",true)
}return y
},hide:function(h){if(!x||!y.isShown()){return y
}h=h||b.Event();
h.type="onBeforeHide";
w.trigger(h);
if(!h.isDefaultPrevented()){n=false;
d[z.effect][1].call(y,function(){h.type="onHide";
w.trigger(h)
});
return y
}},isShown:function(h){return h?n=="full":n
},getConf:function(){return z
},getTip:function(){return x
},getTrigger:function(){return A
}});
b.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(i,h){b.isFunction(z[h])&&b(y).bind(h,z[h]);
y[h]=function(j){j&&b(y).bind(h,j);
return y
}
})
}b.tools=b.tools||{version:"1.2.5"};
b.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(f,e,g){d[f]=[e,g]
}};
var d={toggle:[function(f){var e=this.getConf(),g=this.getTip();
e=e.opacity;
e<1&&g.css({opacity:e});
g.show();
f.call()
},function(e){this.getTip().hide();
e.call()
}],fade:[function(f){var e=this.getConf();
this.getTip().fadeTo(e.fadeInSpeed,e.opacity,f)
},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)
}]};
b.fn.tooltip=function(f){var e=this.data("tooltip");
if(e){return e
}f=b.extend(true,{},b.tools.tooltip.conf,f);
if(typeof f.position=="string"){f.position=f.position.split(/,?\s/)
}this.each(function(){e=new a(b(this),f);
b(this).data("tooltip",e)
});
return f.api?e:this
}
})(jQuery);
(function(c){var a=c.tools.tooltip;
c.extend(a.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!c.browser.msie});
var b={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};
a.addEffect("slide",function(h){var e=this.getConf(),i=this.getTip(),d=e.slideFade?{opacity:e.opacity}:{},j=b[e.direction]||b.up;
d[j[1]]=j[0]+"="+e.slideOffset;
e.slideFade&&i.css({opacity:0});
i.show().animate(d,e.slideInSpeed,h)
},function(j){var e=this.getConf(),k=e.slideOffset,d=e.slideFade?{opacity:0}:{},l=b[e.direction]||b.up,i=""+l[0];
if(e.bounce){i=i=="+"?"-":"+"
}d[l[1]]=i+"="+k;
this.getTip().animate(d,e.slideOutSpeed,function(){c(this).hide();
j.call()
})
})
})(jQuery);
(function(d){function b(e){var i=d(window),g=i.width()+i.scrollLeft(),f=i.height()+i.scrollTop();
return[e.offset().top<=i.scrollTop(),g<=e.offset().left+e.width(),f<=e.offset().top+e.height(),i.scrollLeft()>=e.offset().left]
}function a(e){for(var f=e.length;
f--;
){if(e[f]){return false
}}return true
}var c=d.tools.tooltip;
c.dynamic={conf:{classNames:"top right bottom left"}};
d.fn.dynamic=function(e){if(typeof e=="number"){e={speed:e}
}e=d.extend({},c.dynamic.conf,e);
var g=e.classNames.split(/\s/),f;
this.each(function(){var i=d(this).tooltip().onBeforeShow(function(k,j){k=this.getTip();
var h=this.getConf();
f||(f=[h.position[0],h.position[1],h.offset[0],h.offset[1],d.extend({},h)]);
d.extend(h,f[4]);
h.position=[f[0],f[1]];
h.offset=[f[2],f[3]];
k.css({visibility:"hidden",position:"absolute",top:j.top,left:j.left}).show();
j=b(k);
if(!a(j)){if(j[2]){d.extend(h,e.top);
h.position[0]="top";
k.addClass(g[0])
}if(j[3]){d.extend(h,e.right);
h.position[1]="right";
k.addClass(g[1])
}if(j[0]){d.extend(h,e.bottom);
h.position[0]="bottom";
k.addClass(g[2])
}if(j[1]){d.extend(h,e.left);
h.position[1]="left";
k.addClass(g[3])
}if(j[0]||j[2]){h.offset[0]*=-1
}if(j[1]||j[3]){h.offset[1]*=-1
}}k.css({visibility:"visible"}).hide()
});
i.onBeforeShow(function(){var h=this.getConf();
this.getTip();
setTimeout(function(){h.position=[f[0],f[1]];
h.offset=[f[2],f[3]]
},0)
});
i.onHide(function(){var h=this.getTip();
h.removeClass(e.classNames)
});
ret=i
});
return e.api?ret:this
}
})(jQuery);
(function(a){a.extend(a.fn,{validate:function(d){if(this.length){var c=a.data(this[0],"validator");
if(c){return c
}c=new a.validator(d,this[0]);
a.data(this[0],"validator",c);
if(c.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){c.cancelSubmit=true
});
c.settings.submitHandler&&this.find("input, button").filter(":submit").click(function(){c.submitButton=this
});
this.submit(function(f){function b(){if(c.settings.submitHandler){if(c.submitButton){var e=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)
}c.settings.submitHandler.call(c,c.currentForm);
c.submitButton&&e.remove();
return false
}return true
}c.settings.debug&&f.preventDefault();
if(c.cancelSubmit){c.cancelSubmit=false;
return b()
}if(c.form()){if(c.pendingRequest){c.formSubmitted=true;
return false
}return b()
}else{c.focusInvalid();
return false
}})
}return c
}else{d&&d.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")
}},valid:function(){if(a(this[0]).is("form")){return this.validate().form()
}else{var d=true,c=a(this[0].form).validate();
this.each(function(){d&=c.element(this)
});
return d
}},removeAttrs:function(e){var c={},f=this;
a.each(e.split(/\s/),function(d,b){c[b]=f.attr(b);
f.removeAttr(b)
});
return c
},rules:function(i,c){var n=this[0];
if(i){var m=a.data(n.form,"validator").settings,l=m.rules,k=a.validator.staticRules(n);
switch(i){case"add":a.extend(k,a.validator.normalizeRule(c));
l[n.name]=k;
if(c.messages){m.messages[n.name]=a.extend(m.messages[n.name],c.messages)
}break;
case"remove":if(!c){delete l[n.name];
return k
}var j={};
a.each(c.split(/\s/),function(b,d){j[d]=k[d];
delete k[d]
});
return j
}}n=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(n),a.validator.classRules(n),a.validator.attributeRules(n),a.validator.staticRules(n)),n);
if(n.required){m=n.required;
delete n.required;
n=a.extend({required:m},n)
}return n
}});
a.extend(a.expr[":"],{blank:function(b){return !a.trim(""+b.value)
},filled:function(b){return !!a.trim(""+b.value)
},unchecked:function(b){return !b.checked
}});
a.validator=function(d,c){this.settings=a.extend(true,{},a.validator.defaults,d);
this.currentForm=c;
this.init()
};
a.validator.format=function(d,c){if(arguments.length==1){return function(){var b=a.makeArray(arguments);
b.unshift(d);
return a.validator.format.apply(this,b)
}
}if(arguments.length>2&&c.constructor!=Array){c=a.makeArray(arguments).slice(1)
}if(c.constructor!=Array){c=[c]
}a.each(c,function(f,b){d=d.replace(RegExp("\\{"+f+"\\}","g"),b)
});
return d
};
a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(b){this.lastActive=b;
if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,b,this.settings.errorClass,this.settings.validClass);
this.addWrapper(this.errorsFor(b)).hide()
}},onfocusout:function(b){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)
}},onkeyup:function(b){if(b.name in this.submitted||b==this.lastElement){this.element(b)
}},onclick:function(b){if(b.name in this.submitted){this.element(b)
}else{b.parentNode.name in this.submitted&&this.element(b.parentNode)
}},highlight:function(e,c,f){e.type==="radio"?this.findByName(e.name).addClass(c).removeClass(f):a(e).addClass(c).removeClass(f)
},unhighlight:function(e,c,f){e.type==="radio"?this.findByName(e.name).removeClass(c).addClass(f):a(e).removeClass(c).addClass(f)
}},setDefaults:function(b){a.extend(a.validator.defaults,b)
},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function e(d){var b=a.data(this[0].form,"validator");
d="on"+d.type.replace(/^validate/,"");
b.settings[d]&&b.settings[d].call(b,this[0])
}this.labelContainer=a(this.settings.errorLabelContainer);
this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);
this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);
this.submitted={};
this.valueCache={};
this.pendingRequest=0;
this.pending={};
this.invalid={};
this.reset();
var c=this.groups={};
a.each(this.settings.groups,function(d,b){a.each(b.split(/\s/),function(j,i){c[i]=d
})
});
var f=this.settings.rules;
a.each(f,function(d,b){f[d]=a.validator.normalizeRule(b)
});
a(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",e).validateDelegate(":radio, :checkbox, select, option","click",e);
this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)
},form:function(){this.checkForm();
a.extend(this.submitted,this.errorMap);
this.invalid=a.extend({},this.errorMap);
this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]);
this.showErrors();
return this.valid()
},checkForm:function(){this.prepareForm();
for(var d=0,c=this.currentElements=this.elements();
c[d];
d++){this.check(c[d])
}return this.valid()
},element:function(d){this.lastElement=d=this.clean(d);
this.prepareElement(d);
this.currentElements=a(d);
var c=this.check(d);
if(c){delete this.invalid[d.name]
}else{this.invalid[d.name]=true
}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)
}this.showErrors();
return c
},showErrors:function(d){if(d){a.extend(this.errorMap,d);
this.errorList=[];
for(var c in d){this.errorList.push({message:d[c],element:this.findByName(c)[0]})
}this.successList=a.grep(this.successList,function(b){return !(b.name in d)
})
}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()
},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm();
this.submitted={};
this.prepareForm();
this.hideErrors();
this.elements().removeClass(this.settings.errorClass)
},numberOfInvalids:function(){return this.objectLength(this.invalid)
},objectLength:function(e){var c=0,f;
for(f in e){c++
}return c
},hideErrors:function(){this.addWrapper(this.toHide).hide()
},valid:function(){return this.size()==0
},size:function(){return this.errorList.length
},focusInvalid:function(){if(this.settings.focusInvalid){try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")
}catch(b){}}},findLastActive:function(){var b=this.lastActive;
return b&&a.grep(this.errorList,function(c){return c.element.name==b.name
}).length==1&&b
},elements:function(){var d=this,c={};
return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&d.settings.debug&&window.console&&console.error("%o has no name assigned",this);
if(this.name in c||!d.objectLength(a(this).rules())){return false
}return c[this.name]=true
})
},clean:function(b){return a(b)[0]
},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)
},reset:function(){this.successList=[];
this.errorList=[];
this.errorMap={};
this.toShow=a([]);
this.toHide=a([]);
this.currentElements=a([])
},prepareForm:function(){this.reset();
this.toHide=this.errors().add(this.containers)
},prepareElement:function(b){this.reset();
this.toHide=this.errorsFor(b)
},check:function(i){i=this.clean(i);
if(this.checkable(i)){i=this.findByName(i.name).not(this.settings.ignore)[0]
}var c=a(i).rules(),n=false,m;
for(m in c){var l={method:m,parameters:c[m]};
try{var k=a.validator.methods[m].call(this,i.value.replace(/\r/g,""),i,l.parameters);
if(k=="dependency-mismatch"){n=true
}else{n=false;
if(k=="pending"){this.toHide=this.toHide.not(this.errorsFor(i));
return
}if(!k){this.formatAndAdd(i,l);
return false
}}}catch(j){this.settings.debug&&window.console&&console.log("exception occured when checking element "+i.id+", check the '"+l.method+"' method",j);
throw j
}}if(!n){this.objectLength(c)&&this.successList.push(i);
return true
}},customMetaMessage:function(e,c){if(a.metadata){var f=this.settings.meta?a(e).metadata()[this.settings.meta]:a(e).metadata();
return f&&f.messages&&f.messages[c]
}},customMessage:function(e,c){var f=this.settings.messages[e];
return f&&(f.constructor==String?f:f[c])
},findDefined:function(){for(var b=0;
b<arguments.length;
b++){if(arguments[b]!==undefined){return arguments[b]
}}},defaultMessage:function(d,c){return this.findDefined(this.customMessage(d.name,c),this.customMetaMessage(d,c),!this.settings.ignoreTitle&&d.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+d.name+"</strong>")
},formatAndAdd:function(f,c){var h=this.defaultMessage(f,c.method),g=/\$?\{(\d+)\}/g;
if(typeof h=="function"){h=h.call(this,c.parameters,f)
}else{if(g.test(h)){h=jQuery.format(h.replace(g,"{$1}"),c.parameters)
}}this.errorList.push({message:h,element:f});
this.errorMap[f.name]=h;
this.submitted[f.name]=h
},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parent(this.settings.wrapper))
}return b
},defaultShowErrors:function(){for(var d=0;
this.errorList[d];
d++){var c=this.errorList[d];
this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass);
this.showLabel(c.element,c.message)
}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)
}if(this.settings.success){for(d=0;
this.successList[d];
d++){this.showLabel(this.successList[d])
}}if(this.settings.unhighlight){d=0;
for(c=this.validElements();
c[d];
d++){this.settings.unhighlight.call(this,c[d],this.settings.errorClass,this.settings.validClass)
}}this.toHide=this.toHide.not(this.toShow);
this.hideErrors();
this.addWrapper(this.toShow).show()
},validElements:function(){return this.currentElements.not(this.invalidElements())
},invalidElements:function(){return a(this.errorList).map(function(){return this.element
})
},showLabel:function(e,c){var f=this.errorsFor(e);
if(f.length){f.removeClass().addClass(this.settings.errorClass);
f.attr("generated")&&f.html(c)
}else{f=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(e),generated:true}).addClass(this.settings.errorClass).html(c||"");
if(this.settings.wrapper){f=f.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()
}this.labelContainer.append(f).length||(this.settings.errorPlacement?this.settings.errorPlacement(f,a(e)):f.insertAfter(e))
}if(!c&&this.settings.success){f.text("");
typeof this.settings.success=="string"?f.addClass(this.settings.success):this.settings.success(f)
}this.toShow=this.toShow.add(f)
},errorsFor:function(d){var c=this.idOrName(d);
return this.errors().filter(function(){return a(this).attr("for")==c
})
},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name)
},checkable:function(b){return/radio|checkbox/i.test(b.type)
},findByName:function(d){var c=this.currentForm;
return a(document.getElementsByName(d)).map(function(f,b){return b.form==c&&b.name==d&&b||null
})
},getLength:function(d,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;
case"input":if(this.checkable(c)){return this.findByName(c.name).filter(":checked").length
}}return d.length
},depend:function(d,c){return this.dependTypes[typeof d]?this.dependTypes[typeof d](d,c):true
},dependTypes:{"boolean":function(b){return b
},string:function(d,c){return !!a(d,c.form).length
},"function":function(d,c){return d(c)
}},optional:function(b){return !a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"
},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;
this.pending[b.name]=true
}},stopRequest:function(d,c){this.pendingRequest--;
if(this.pendingRequest<0){this.pendingRequest=0
}delete this.pending[d.name];
if(c&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit();
this.formSubmitted=false
}else{if(!c&&this.pendingRequest==0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this]);
this.formSubmitted=false
}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:true,message:this.defaultMessage(b,"remote")})
}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(d,c){d.constructor==String?this.classRuleSettings[d]=c:a.extend(this.classRuleSettings,d)
},classRules:function(d){var c={};
(d=a(d).attr("class"))&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])
});
return c
},attributeRules:function(f){var c={};
f=a(f);
for(var h in a.validator.methods){var g=f.attr(h);
if(g){c[h]=g
}}c.maxlength&&/-1|2147483647|524288/.test(c.maxlength)&&delete c.maxlength;
return c
},metadataRules:function(d){if(!a.metadata){return{}
}var c=a.data(d.form,"validator").settings.meta;
return c?a(d).metadata()[c]:a(d).metadata()
},staticRules:function(e){var c={},f=a.data(e.form,"validator");
if(f.settings.rules){c=a.validator.normalizeRule(f.settings.rules[e.name])||{}
}return c
},normalizeRules:function(d,c){a.each(d,function(h,g){if(g===false){delete d[h]
}else{if(g.param||g.depends){var b=true;
switch(typeof g.depends){case"string":b=!!a(g.depends,c.form).length;
break;
case"function":b=g.depends.call(c,c)
}if(b){d[h]=g.param!==undefined?g.param:true
}else{delete d[h]
}}}});
a.each(d,function(f,b){d[f]=a.isFunction(b)?b(c):b
});
a.each(["minlength","maxlength","min","max"],function(){if(d[this]){d[this]=Number(d[this])
}});
a.each(["rangelength","range"],function(){if(d[this]){d[this]=[Number(d[this][0]),Number(d[this][1])]
}});
if(a.validator.autoCreateRanges){if(d.min&&d.max){d.range=[d.min,d.max];
delete d.min;
delete d.max
}if(d.minlength&&d.maxlength){d.rangelength=[d.minlength,d.maxlength];
delete d.minlength;
delete d.maxlength
}}d.messages&&delete d.messages;
return d
},normalizeRule:function(d){if(typeof d=="string"){var c={};
a.each(d.split(/\s/),function(){c[this]=true
});
d=c
}return d
},addMethod:function(e,c,f){a.validator.methods[e]=c;
a.validator.messages[e]=f!=undefined?f:a.validator.messages[e];
c.length<3&&a.validator.addClassRules(e,a.validator.normalizeRule(e))
},methods:{required:function(e,c,f){if(!this.depend(f,c)){return"dependency-mismatch"
}switch(c.nodeName.toLowerCase()){case"select":return(e=a(c).val())&&e.length>0;
case"input":if(this.checkable(c)){return this.getLength(e,c)>0
}default:return a.trim(e).length>0
}},remote:function(h,c,l){if(this.optional(c)){return"dependency-mismatch"
}var k=this.previousValue(c);
this.settings.messages[c.name]||(this.settings.messages[c.name]={});
k.originalMessage=this.settings.messages[c.name].remote;
this.settings.messages[c.name].remote=k.message;
l=typeof l=="string"&&{url:l}||l;
if(this.pending[c.name]){return"pending"
}if(k.old===h){return k.valid
}k.old=h;
var j=this;
this.startRequest(c);
var i={};
i[c.name]=h;
a.ajax(a.extend(true,{url:l,mode:"abort",port:"validate"+c.name,dataType:"json",data:i,success:function(e){j.settings.messages[c.name].remote=k.originalMessage;
var b=e===true;
if(b){var d=j.formSubmitted;
j.prepareElement(c);
j.formSubmitted=d;
j.successList.push(c);
j.showErrors()
}else{d={};
e=e||j.defaultMessage(c,"remote");
d[c.name]=k.message=a.isFunction(e)?e(h):e;
j.showErrors(d)
}k.valid=b;
j.stopRequest(c,b)
}},l));
return"pending"
},minlength:function(e,c,f){return this.optional(c)||this.getLength(a.trim(e),c)>=f
},maxlength:function(e,c,f){return this.optional(c)||this.getLength(a.trim(e),c)<=f
},rangelength:function(e,c,f){e=this.getLength(a.trim(e),c);
return this.optional(c)||e>=f[0]&&e<=f[1]
},min:function(e,c,f){return this.optional(c)||e>=f
},max:function(e,c,f){return this.optional(c)||e<=f
},range:function(e,c,f){return this.optional(c)||e>=f[0]&&e<=f[1]
},email:function(d,c){return this.optional(c)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(d)
},url:function(d,c){return this.optional(c)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(d)
},date:function(d,c){return this.optional(c)||!/Invalid|NaN/.test(new Date(d))
},dateISO:function(d,c){return this.optional(c)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(d)
},number:function(d,c){return this.optional(c)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(d)
},digits:function(d,c){return this.optional(c)||/^\d+$/.test(d)
},creditcard:function(h,c){if(this.optional(c)){return"dependency-mismatch"
}if(/[^0-9-]+/.test(h)){return false
}var l=0,k=0,j=false;
h=h.replace(/\D/g,"");
for(var i=h.length-1;
i>=0;
i--){k=h.charAt(i);
k=parseInt(k,10);
if(j){if((k*=2)>9){k-=9
}}l+=k;
j=!j
}return l%10==0
},accept:function(e,c,f){f=typeof f=="string"?f.replace(/,/g,"|"):"png|jpe?g|gif";
return this.optional(c)||e.match(RegExp(".("+f+")$","i"))
},equalTo:function(e,c,f){f=a(f).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()
});
return e==f.val()
}}});
a.format=a.validator.format
})(jQuery);
(function(f){var e={};
if(f.ajaxPrefilter){f.ajaxPrefilter(function(c,b,a){b=c.port;
if(c.mode=="abort"){e[b]&&e[b].abort();
e[b]=a
}})
}else{var d=f.ajax;
f.ajax=function(b){var a=("port" in b?b:f.ajaxSettings).port;
if(("mode" in b?b:f.ajaxSettings).mode=="abort"){e[a]&&e[a].abort();
return e[a]=d.apply(this,arguments)
}return d.apply(this,arguments)
}
}})(jQuery);
(function(a){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&a.each({focus:"focusin",blur:"focusout"},function(e,c){function f(b){b=a.event.fix(b);
b.type=c;
return a.event.handle.call(this,b)
}a.event.special[c]={setup:function(){this.addEventListener(e,f,true)
},teardown:function(){this.removeEventListener(e,f,true)
},handler:function(b){arguments[0]=a.event.fix(b);
arguments[0].type=c;
return a.event.handle.apply(this,arguments)
}}
});
a.extend(a.fn,{validateDelegate:function(e,c,f){return this.bind(c,function(d){var b=a(d.target);
if(b.is(e)){return f.apply(b,arguments)
}})
}})
})(jQuery);
(function(X,Q,z){var B="function",C="password",O="maxLength",K="type",W="",V=true,D="placeholder",P=false,E="watermark",R=E,S="watermarkClass",H="watermarkFocus",M="watermarkSubmit",J="watermarkMaxLength",T="watermarkPassword",U="watermarkText",N=/\r/g,F="input:data("+R+"),textarea:data("+R+")",L="input:text,input:password,input[type=search],input:not([type]),textarea",I=["Page_ClientValidate"],G=P,A=D in document.createElement("input");
X.watermark=X.watermark||{version:"3.1.3",runOnce:V,options:{className:E,useNative:V,hideBeforeUnload:V},hide:function(a){X(a).filter(F).each(function(){X.watermark._hide(X(this))
})
},_hide:function(o,b){var e=o[0],d=(e.value||W).replace(N,W),h=o.data(U)||W,f=o.data(J)||0,j=o.data(S);
if(h.length&&d==h){e.value=W;
if(o.data(T)){if((o.attr(K)||W)==="text"){var k=o.data(T)||[],n=o.parent()||[];
if(k.length&&n.length){n[0].removeChild(o[0]);
n[0].appendChild(k[0]);
o=k
}}}if(f){o.attr(O,f);
o.removeData(J)
}if(b){o.attr("autocomplete","off");
Q.setTimeout(function(){o.select()
},1)
}}j&&o.removeClass(j)
},show:function(a){X(a).filter(F).each(function(){X.watermark._show(X(this))
})
},_show:function(f){var a=f[0],j=(a.value||W).replace(N,W),e=f.data(U)||W,n=f.attr(K)||W,k=f.data(S);
if((j.length==0||j==e)&&!f.data(H)){G=V;
if(f.data(T)){if(n===C){var b=f.data(T)||[],c=f.parent()||[];
if(b.length&&c.length){c[0].removeChild(f[0]);
c[0].appendChild(b[0]);
f=b;
f.attr(O,e.length);
a=f[0]
}}}if(n==="text"||n==="search"){var d=f.attr(O)||0;
if(d>0&&e.length>d){f.data(J,d);
f.attr(O,e.length)
}}k&&f.addClass(k);
a.value=e
}else{X.watermark._hide(f)
}},hideAll:function(){if(G){X.watermark.hide(L);
G=P
}},showAll:function(){X.watermark.show(L)
}};
X.fn.watermark=X.fn.watermark||function(d,e){var a="string";
if(!this.length){return this
}var b=P,c=typeof d===a;
if(c){d=d.replace(N,W)
}if(typeof e==="object"){b=typeof e.className===a;
e=X.extend({},X.watermark.options,e)
}else{if(typeof e===a){b=V;
e=X.extend({},X.watermark.options,{className:e})
}else{e=X.watermark.options
}}if(typeof e.useNative!==B){e.useNative=e.useNative?function(){return V
}:function(){return P
}
}return this.each(function(){var n="dragleave",f="dragenter",l=this,j=X(l);
if(!j.is(L)){return
}if(j.data(R)){if(c||b){X.watermark._hide(j);
c&&j.data(U,d);
b&&j.data(S,e.className)
}}else{if(A&&e.useNative.call(l,j)&&(j.attr("tagName")||W)!=="TEXTAREA"){c&&j.attr(D,d);
return
}j.data(U,c?d:W);
j.data(S,e.className);
j.data(R,1);
if((j.attr(K)||W)===C){var k=j.wrap("<span>").parent(),h=X(k.html().replace(/type=["']?password["']?/i,'type="text"'));
h.data(U,j.data(U));
h.data(S,j.data(S));
h.data(R,1);
h.attr(O,d.length);
h.focus(function(){X.watermark._hide(h,V)
}).bind(f,function(){X.watermark._hide(h)
}).bind("dragend",function(){Q.setTimeout(function(){h.blur()
},1)
});
j.blur(function(){X.watermark._show(j)
}).bind(n,function(){X.watermark._show(j)
});
h.data(T,j);
j.data(T,h)
}else{j.focus(function(){j.data(H,1);
X.watermark._hide(j,V)
}).blur(function(){j.data(H,0);
X.watermark._show(j)
}).bind(f,function(){X.watermark._hide(j)
}).bind(n,function(){X.watermark._show(j)
}).bind("dragend",function(){Q.setTimeout(function(){X.watermark._show(j)
},1)
}).bind("drop",function(o){var p=j[0],i=o.originalEvent.dataTransfer.getData("Text");
if((p.value||W).replace(N,W).replace(i,W)===j.data(U)){p.value=i
}j.focus()
})
}if(l.form){var g=l.form,m=X(g);
if(!m.data(M)){m.submit(X.watermark.hideAll);
if(g.submit){m.data(M,g.submit);
g.submit=function(o,i){return function(){var p=i.data(M);
X.watermark.hideAll();
if(p.apply){p.apply(o,Array.prototype.slice.call(arguments))
}else{p()
}}
}(g,m)
}else{m.data(M,1);
g.submit=function(i){return function(){X.watermark.hideAll();
delete i.submit;
i.submit()
}
}(g)
}}}}X.watermark._show(j)
})
};
if(X.watermark.runOnce){X.watermark.runOnce=P;
X.extend(X.expr[":"],{data:function(f,e,a){return !!X.data(f,a[3])
}});
(function(a){X.fn.val=function(){var c=this;
if(!c.length){return arguments.length?c:z
}if(!arguments.length){if(c.data(R)){var b=(c[0].value||W).replace(N,W);
return b===(c.data(U)||W)?W:b
}else{return a.apply(c,arguments)
}}else{a.apply(c,arguments);
X.watermark.show(c);
return c
}}
})(X.fn.val);
I.length&&X(function(){for(var a,f,e=I.length-1;
e>=0;
e--){a=I[e];
f=Q[a];
if(typeof f===B){Q[a]=function(c){return function(){X.watermark.hideAll();
return c.apply(null,Array.prototype.slice.call(arguments))
}
}(f)
}}});
X(Q).bind("beforeunload",function(){X.watermark.options.hideBeforeUnload&&X.watermark.hideAll()
})
}})(jQuery,window);
(function(){function N(b,n,m){if(b===n){return b!==0||1/b==1/n
}if(b==null||n==null){return b===n
}if(b._chain){b=b._wrapped
}if(n._chain){n=n._wrapped
}if(af.isFunction(b.isEqual)){return b.isEqual(n)
}if(af.isFunction(n.isEqual)){return n.isEqual(b)
}var l=typeof b;
if(l!=typeof n){return false
}if(!b!=!n){return false
}if(af.isNaN(b)){return af.isNaN(n)
}var j=af.isString(b),k=af.isString(n);
if(j||k){return j&&k&&String(b)==String(n)
}j=af.isNumber(b);
k=af.isNumber(n);
if(j||k){return j&&k&&+b==+n
}j=af.isBoolean(b);
k=af.isBoolean(n);
if(j||k){return j&&k&&+b==+n
}j=af.isDate(b);
k=af.isDate(n);
if(j||k){return j&&k&&b.getTime()==n.getTime()
}j=af.isRegExp(b);
k=af.isRegExp(n);
if(j||k){return j&&k&&b.source==n.source&&b.global==n.global&&b.multiline==n.multiline&&b.ignoreCase==n.ignoreCase
}if(l!="object"){return false
}if(b.length!==n.length){return false
}if(b.constructor!==n.constructor){return false
}for(l=m.length;
l--;
){if(m[l]==b){return true
}}m.push(b);
var l=0,j=true,i;
for(i in b){if(aa.call(b,i)&&(l++,!(j=aa.call(n,i)&&N(b[i],n[i],m)))){break
}}if(j){for(i in n){if(aa.call(n,i)&&!l--){break
}}j=!l
}m.pop();
return j
}var T=this,M=T._,Y={},ac=Array.prototype,X=Object.prototype,ae=ac.slice,K=ac.unshift,ab=X.toString,aa=X.hasOwnProperty,L=ac.forEach,h=ac.map,f=ac.reduce,d=ac.reduceRight,a=ac.filter,W=ac.every,V=ac.some,U=ac.indexOf,S=ac.lastIndexOf,X=Array.isArray,g=Object.keys,R=Function.prototype.bind,af=function(b){return new Z(b)
};
if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports){exports=module.exports=af
}exports._=af
}else{typeof define==="function"&&define.amd?define("underscore",function(){return af
}):T._=af
}af.VERSION="1.2.1";
var ad=af.each=af.forEach=function(j,m,i){if(j!=null){if(L&&j.forEach===L){j.forEach(m,i)
}else{if(j.length===+j.length){for(var l=0,k=j.length;
l<k;
l++){if(l in j&&m.call(i,j[l],l,j)===Y){break
}}}else{for(l in j){if(aa.call(j,l)&&m.call(i,j[l],l,j)===Y){break
}}}}}};
af.map=function(j,l,i){var k=[];
if(j==null){return k
}if(h&&j.map===h){return j.map(l,i)
}ad(j,function(b,n,m){k[k.length]=l.call(i,b,n,m)
});
return k
};
af.reduce=af.foldl=af.inject=function(b,l,k,j){var i=k!==void 0;
b==null&&(b=[]);
if(f&&b.reduce===f){return j&&(l=af.bind(l,j)),i?b.reduce(l,k):b.reduce(l)
}ad(b,function(n,m,o){i?k=l.call(j,k,n,m,o):(k=n,i=true)
});
if(!i){throw new TypeError("Reduce of empty array with no initial value")
}return k
};
af.reduceRight=af.foldr=function(b,k,j,i){b==null&&(b=[]);
if(d&&b.reduceRight===d){return i&&(k=af.bind(k,i)),j!==void 0?b.reduceRight(k,j):b.reduceRight(k)
}b=(af.isArray(b)?b.slice():af.toArray(b)).reverse();
return af.reduce(b,k,j,i)
};
af.find=af.detect=function(j,l,i){var k;
Q(j,function(b,n,m){if(l.call(i,b,n,m)){return k=b,true
}});
return k
};
af.filter=af.select=function(j,l,i){var k=[];
if(j==null){return k
}if(a&&j.filter===a){return j.filter(l,i)
}ad(j,function(b,n,m){l.call(i,b,n,m)&&(k[k.length]=b)
});
return k
};
af.reject=function(j,l,i){var k=[];
if(j==null){return k
}ad(j,function(b,n,m){l.call(i,b,n,m)||(k[k.length]=b)
});
return k
};
af.every=af.all=function(j,l,i){var k=true;
if(j==null){return k
}if(W&&j.every===W){return j.every(l,i)
}ad(j,function(b,n,m){if(!(k=k&&l.call(i,b,n,m))){return Y
}});
return k
};
var Q=af.some=af.any=function(b,k,j){var k=k||af.identity,i=false;
if(b==null){return i
}if(V&&b.some===V){return b.some(k,j)
}ad(b,function(m,l,n){if(i|=k.call(j,m,l,n)){return Y
}});
return !!i
};
af.include=af.contains=function(j,k){var i=false;
if(j==null){return i
}return U&&j.indexOf===U?j.indexOf(k)!=-1:i=Q(j,function(b){if(b===k){return true
}})
};
af.invoke=function(b,j){var i=ae.call(arguments,2);
return af.map(b,function(k){return(j.call?j||k:k[j]).apply(k,i)
})
};
af.pluck=function(b,i){return af.map(b,function(j){return j[i]
})
};
af.max=function(b,k,j){if(!k&&af.isArray(b)){return Math.max.apply(Math,b)
}if(!k&&af.isEmpty(b)){return -Infinity
}var i={computed:-Infinity};
ad(b,function(m,l,n){l=k?k.call(j,m,l,n):m;
l>=i.computed&&(i={value:m,computed:l})
});
return i.value
};
af.min=function(b,k,j){if(!k&&af.isArray(b)){return Math.min.apply(Math,b)
}if(!k&&af.isEmpty(b)){return Infinity
}var i={computed:Infinity};
ad(b,function(m,l,n){l=k?k.call(j,m,l,n):m;
l<i.computed&&(i={value:m,computed:l})
});
return i.value
};
af.shuffle=function(j){var i=[],k;
ad(j,function(b,l){l==0?i[0]=b:(k=Math.floor(Math.random()*(l+1)),i[l]=i[k],i[k]=b)
});
return i
};
af.sortBy=function(b,j,i){return af.pluck(af.map(b,function(l,k,m){return{value:l,criteria:j.call(i,l,k,m)}
}).sort(function(l,k){var n=l.criteria,m=k.criteria;
return n<m?-1:n>m?1:0
}),"value")
};
af.groupBy=function(b,k){var j={},i=af.isFunction(k)?k:function(l){return l[k]
};
ad(b,function(m,l){var n=i(m,l);
(j[n]||(j[n]=[])).push(m)
});
return j
};
af.sortedIndex=function(b,m,l){l||(l=af.identity);
for(var k=0,i=b.length;
k<i;
){var j=k+i>>1;
l(b[j])<l(m)?k=j+1:i=j
}return k
};
af.toArray=function(b){return !b?[]:b.toArray?b.toArray():af.isArray(b)?ae.call(b):af.isArguments(b)?ae.call(b):af.values(b)
};
af.size=function(b){return af.toArray(b).length
};
af.first=af.head=function(j,i,k){return i!=null&&!k?ae.call(j,0,i):j[0]
};
af.initial=function(j,i,k){return ae.call(j,0,j.length-(i==null||k?1:i))
};
af.last=function(j,i,k){return i!=null&&!k?ae.call(j,j.length-i):j[j.length-1]
};
af.rest=af.tail=function(j,i,k){return ae.call(j,i==null||k?1:i)
};
af.compact=function(b){return af.filter(b,function(i){return !!i
})
};
af.flatten=function(b,i){return af.reduce(b,function(j,k){if(af.isArray(k)){return j.concat(i?k:af.flatten(k))
}j[j.length]=k;
return j
},[])
};
af.without=function(b){return af.difference(b,ae.call(arguments,1))
};
af.uniq=af.unique=function(b,k,j){var j=j?af.map(b,j):b,i=[];
af.reduce(j,function(n,m,l){if(0==l||(k===true?af.last(n)!=m:!af.include(n,m))){n[n.length]=m,i[i.length]=b[l]
}return n
},[]);
return i
};
af.union=function(){return af.uniq(af.flatten(arguments,true))
};
af.intersection=af.intersect=function(b){var i=ae.call(arguments,1);
return af.filter(af.uniq(b),function(j){return af.every(i,function(k){return af.indexOf(k,j)>=0
})
})
};
af.difference=function(b,i){return af.filter(b,function(j){return !af.include(i,j)
})
};
af.zip=function(){for(var b=ae.call(arguments),k=af.max(af.pluck(b,"length")),j=Array(k),i=0;
i<k;
i++){j[i]=af.pluck(b,""+i)
}return j
};
af.indexOf=function(b,k,j){if(b==null){return -1
}var i;
if(j){return j=af.sortedIndex(b,k),b[j]===k?j:-1
}if(U&&b.indexOf===U){return b.indexOf(k)
}for(j=0,i=b.length;
j<i;
j++){if(b[j]===k){return j
}}return -1
};
af.lastIndexOf=function(j,i){if(j==null){return -1
}if(S&&j.lastIndexOf===S){return j.lastIndexOf(i)
}for(var k=j.length;
k--;
){if(j[k]===i){return k
}}return -1
};
af.range=function(j,i,n){arguments.length<=1&&(i=j||0,j=0);
for(var n=arguments[2]||1,m=Math.max(Math.ceil((i-j)/n),0),k=0,l=Array(m);
k<m;
){l[k++]=j,j+=n
}return l
};
var P=function(){};
af.bind=function(b,k){var j,i;
if(b.bind===R&&R){return R.apply(b,ae.call(arguments,1))
}if(!af.isFunction(b)){throw new TypeError
}i=ae.call(arguments,2);
return j=function(){if(!(this instanceof j)){return b.apply(k,i.concat(ae.call(arguments)))
}P.prototype=b.prototype;
var l=new P,m=b.apply(l,i.concat(ae.call(arguments)));
return Object(m)===m?m:l
}
};
af.bindAll=function(b){var i=ae.call(arguments,1);
i.length==0&&(i=af.functions(b));
ad(i,function(j){b[j]=af.bind(b[j],b)
});
return b
};
af.memoize=function(b,j){var i={};
j||(j=af.identity);
return function(){var k=j.apply(this,arguments);
return aa.call(i,k)?i[k]:i[k]=b.apply(this,arguments)
}
};
af.delay=function(j,i){var k=ae.call(arguments,2);
return setTimeout(function(){return j.apply(j,k)
},i)
};
af.defer=function(b){return af.delay.apply(af,[b,1].concat(ae.call(arguments,1)))
};
af.throttle=function(b,n){var m,l,j,k,i;
i=af.debounce(function(){k=false
},n);
return function(){l=this;
j=arguments;
var o;
m||(m=setTimeout(function(){m=null;
b.apply(l,j);
i()
},n));
k||b.apply(l,j);
i&&i();
k=true
}
};
af.debounce=function(j,i){var k;
return function(){var l=this,b=arguments;
clearTimeout(k);
k=setTimeout(function(){k=null;
j.apply(l,b)
},i)
}
};
af.once=function(j){var i=false,k;
return function(){if(i){return k
}i=true;
return k=j.apply(this,arguments)
}
};
af.wrap=function(j,i){return function(){var b=[j].concat(ae.call(arguments));
return i.apply(this,b)
}
};
af.compose=function(){var b=ae.call(arguments);
return function(){for(var i=ae.call(arguments),j=b.length-1;
j>=0;
j--){i=[b[j].apply(this,i)]
}return i[0]
}
};
af.after=function(j,i){return function(){if(--j<1){return i.apply(this,arguments)
}}
};
af.keys=g||function(j){if(j!==Object(j)){throw new TypeError("Invalid object")
}var i=[],k;
for(k in j){aa.call(j,k)&&(i[i.length]=k)
}return i
};
af.values=function(b){return af.map(b,af.identity)
};
af.functions=af.methods=function(b){var j=[],i;
for(i in b){af.isFunction(b[i])&&j.push(i)
}return j.sort()
};
af.extend=function(b){ad(ae.call(arguments,1),function(i){for(var j in i){i[j]!==void 0&&(b[j]=i[j])
}});
return b
};
af.defaults=function(b){ad(ae.call(arguments,1),function(i){for(var j in i){b[j]==null&&(b[j]=i[j])
}});
return b
};
af.clone=function(b){return !af.isObject(b)?b:af.isArray(b)?b.slice():af.extend({},b)
};
af.tap=function(j,i){i(j);
return j
};
af.isEqual=function(j,i){return N(j,i,[])
};
af.isEmpty=function(b){if(af.isArray(b)||af.isString(b)){return b.length===0
}for(var i in b){if(aa.call(b,i)){return false
}}return true
};
af.isElement=function(b){return !!(b&&b.nodeType==1)
};
af.isArray=X||function(b){return ab.call(b)=="[object Array]"
};
af.isObject=function(b){return b===Object(b)
};
af.isArguments=ab.call(arguments)=="[object Arguments]"?function(b){return ab.call(b)=="[object Arguments]"
}:function(b){return !(!b||!aa.call(b,"callee"))
};
af.isFunction=function(b){return ab.call(b)=="[object Function]"
};
af.isString=function(b){return ab.call(b)=="[object String]"
};
af.isNumber=function(b){return ab.call(b)=="[object Number]"
};
af.isNaN=function(b){return b!==b
};
af.isBoolean=function(b){return b===true||b===false||ab.call(b)=="[object Boolean]"
};
af.isDate=function(b){return ab.call(b)=="[object Date]"
};
af.isRegExp=function(b){return ab.call(b)=="[object RegExp]"
};
af.isNull=function(b){return b===null
};
af.isUndefined=function(b){return b===void 0
};
af.noConflict=function(){T._=M;
return this
};
af.identity=function(b){return b
};
af.times=function(j,i,l){for(var k=0;
k<j;
k++){i.call(l,k)
}};
af.escape=function(b){return(""+b).replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")
};
af.mixin=function(b){ad(af.functions(b),function(i){e(i,af[i]=b[i])
})
};
var c=0;
af.uniqueId=function(j){var i=c++;
return j?j+i:i
};
af.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};
af.template=function(b,j){var i=af.templateSettings,i="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+b.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(i.escape,function(l,k){return"',_.escape("+k.replace(/\\'/g,"'")+"),'"
}).replace(i.interpolate,function(l,k){return"',"+k.replace(/\\'/g,"'")+",'"
}).replace(i.evaluate||null,function(l,k){return"');"+k.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"
}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",i=new Function("obj",i);
return j?i(j):i
};
var Z=function(b){this._wrapped=b
};
af.prototype=Z.prototype;
var O=function(b,i){return i?af(b).chain():b
},e=function(b,i){Z.prototype[b]=function(){var j=ae.call(arguments);
K.call(j,this._wrapped);
return O(i.apply(af,j),this._chain)
}
};
af.mixin(af);
ad("pop,push,reverse,shift,sort,splice,unshift".split(","),function(j){var i=ac[j];
Z.prototype[j]=function(){i.apply(this._wrapped,arguments);
return O(this._wrapped,this._chain)
}
});
ad(["concat","join","slice"],function(j){var i=ac[j];
Z.prototype[j]=function(){return O(i.apply(this._wrapped,arguments),this._chain)
}
});
Z.prototype.chain=function(){this._chain=true;
return this
};
Z.prototype.value=function(){return this._wrapped
}
})();
(function(){var I=this,A=I.Backbone,L;
L=typeof exports!=="undefined"?exports:I.Backbone={};
L.VERSION="0.5.3";
var K=I._;
if(!K&&typeof require!=="undefined"){K=require("underscore")._
}var J=I.jQuery||I.Zepto;
L.noConflict=function(){I.Backbone=A;
return this
};
L.emulateHTTP=!1;
L.emulateJSON=!1;
L.Events={bind:function(f,e,h){var g=this._callbacks||(this._callbacks={});
(g[f]||(g[f]=[])).push([e,h]);
return this
},unbind:function(g,f){var j;
if(g){if(j=this._callbacks){if(f){j=j[g];
if(!j){return this
}for(var i=0,h=j.length;
i<h;
i++){if(j[i]&&f===j[i][0]){j[i]=null;
break
}}}else{j[g]=[]
}}}else{this._callbacks={}
}return this
},trigger:function(j){var i,p,o,n,m=2;
if(!(p=this._callbacks)){return this
}for(;
m--;
){if(i=m?j:"all",i=p[i]){for(var l=0,k=i.length;
l<k;
l++){(o=i[l])?(n=m?Array.prototype.slice.call(arguments,1):arguments,o[0].apply(o[1]||this,n)):(i.splice(l,1),l--,k--)
}}}return this
}};
L.Model=function(f,e){var g;
f||(f={});
if(g=this.defaults){K.isFunction(g)&&(g=g.call(this)),f=K.extend({},g,f)
}this.attributes={};
this._escapedAttributes={};
this.cid=K.uniqueId("c");
this.set(f,{silent:!0});
this._changed=!1;
this._previousAttributes=K.clone(this.attributes);
if(e&&e.collection){this.collection=e.collection
}this.initialize(f,e)
};
K.extend(L.Model.prototype,L.Events,{_previousAttributes:null,_changed:!1,idAttribute:"id",initialize:function(){},toJSON:function(){return K.clone(this.attributes)
},get:function(e){return this.attributes[e]
},escape:function(f){var e;
if(e=this._escapedAttributes[f]){return e
}e=this.attributes[f];
return this._escapedAttributes[f]=(e==null?"":""+e).replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")
},has:function(e){return this.attributes[e]!=null
},set:function(i,f){f||(f={});
if(!i){return this
}if(i.attributes){i=i.attributes
}var n=this.attributes,m=this._escapedAttributes;
if(!f.silent&&this.validate&&!this._performValidation(i,f)){return !1
}if(this.idAttribute in i){this.id=i[this.idAttribute]
}var l=this._changing;
this._changing=!0;
for(var k in i){var j=i[k];
if(!K.isEqual(n[k],j)){n[k]=j,delete m[k],this._changed=!0,f.silent||this.trigger("change:"+k,this,j,f)
}}!l&&!f.silent&&this._changed&&this.change(f);
this._changing=!1;
return this
},unset:function(f,e){if(!(f in this.attributes)){return this
}e||(e={});
var g={};
g[f]=void 0;
if(!e.silent&&this.validate&&!this._performValidation(g,e)){return !1
}delete this.attributes[f];
delete this._escapedAttributes[f];
f==this.idAttribute&&delete this.id;
this._changed=!0;
e.silent||(this.trigger("change:"+f,this,void 0,e),this.change(e));
return this
},clear:function(f){f||(f={});
var e,h=this.attributes,g={};
for(e in h){g[e]=void 0
}if(!f.silent&&this.validate&&!this._performValidation(g,f)){return !1
}this.attributes={};
this._escapedAttributes={};
this._changed=!0;
if(!f.silent){for(e in h){this.trigger("change:"+e,this,void 0,f)
}this.change(f)
}return this
},fetch:function(f){f||(f={});
var e=this,g=f.success;
f.success=function(j,i,h){if(!e.set(e.parse(j,h),f)){return !1
}g&&g(e,j)
};
f.error=H(f.error,e,f);
return(this.sync||L.sync).call(this,"read",this,f)
},save:function(g,e){e||(e={});
if(g&&!this.set(g,e)){return !1
}var j=this,i=e.success;
e.success=function(k,m,l){if(!j.set(j.parse(k,l),e)){return !1
}i&&i(j,k,l)
};
e.error=H(e.error,j,e);
var h=this.isNew()?"create":"update";
return(this.sync||L.sync).call(this,h,this,e)
},destroy:function(f){f||(f={});
if(this.isNew()){return this.trigger("destroy",this,this.collection,f)
}var e=this,g=f.success;
f.success=function(h){e.trigger("destroy",e,e.collection,f);
g&&g(e,h)
};
f.error=H(f.error,e,f);
return(this.sync||L.sync).call(this,"delete",this,f)
},url:function(){var e=F(this.collection)||this.urlRoot||E();
if(this.isNew()){return e
}return e+(e.charAt(e.length-1)=="/"?"":"/")+encodeURIComponent(this.id)
},parse:function(e){return e
},clone:function(){return new this.constructor(this)
},isNew:function(){return this.id==null
},change:function(e){this.trigger("change",this,e);
this._previousAttributes=K.clone(this.attributes);
this._changed=!1
},hasChanged:function(e){if(e){return this._previousAttributes[e]!=this.attributes[e]
}return this._changed
},changedAttributes:function(f){f||(f=this.attributes);
var e=this._previousAttributes,h=!1,g;
for(g in f){K.isEqual(e[g],f[g])||(h=h||{},h[g]=f[g])
}return h
},previous:function(e){if(!e||!this._previousAttributes){return null
}return this._previousAttributes[e]
},previousAttributes:function(){return K.clone(this._previousAttributes)
},_performValidation:function(f,e){var g=this.validate(f);
if(g){return e.error?e.error(this,g,e):this.trigger("error",this,g,e),!1
}return !0
}});
L.Collection=function(f,e){e||(e={});
if(e.comparator){this.comparator=e.comparator
}K.bindAll(this,"_onModelEvent","_removeReference");
this._reset();
f&&this.reset(f,{silent:!0});
this.initialize.apply(this,arguments)
};
K.extend(L.Collection.prototype,L.Events,{model:L.Model,initialize:function(){},toJSON:function(){return this.map(function(e){return e.toJSON()
})
},add:function(f,e){if(K.isArray(f)){for(var h=0,g=f.length;
h<g;
h++){this._add(f[h],e)
}}else{this._add(f,e)
}return this
},remove:function(f,e){if(K.isArray(f)){for(var h=0,g=f.length;
h<g;
h++){this._remove(f[h],e)
}}else{this._remove(f,e)
}return this
},get:function(e){if(e==null){return null
}return this._byId[e.id!=null?e.id:e]
},getByCid:function(e){return e&&this._byCid[e.cid||e]
},at:function(e){return this.models[e]
},sort:function(e){e||(e={});
if(!this.comparator){throw Error("Cannot sort a set without a comparator")
}this.models=this.sortBy(this.comparator);
e.silent||this.trigger("reset",this,e);
return this
},pluck:function(e){return K.map(this.models,function(f){return f.get(e)
})
},reset:function(f,e){f||(f=[]);
e||(e={});
this.each(this._removeReference);
this._reset();
this.add(f,{silent:!0});
e.silent||this.trigger("reset",this,e);
return this
},fetch:function(f){f||(f={});
var e=this,g=f.success;
f.success=function(j,h,i){e[f.add?"add":"reset"](e.parse(j,i),f);
g&&g(e,j)
};
f.error=H(f.error,e,f);
return(this.sync||L.sync).call(this,"read",this,f)
},create:function(f,e){var h=this;
e||(e={});
f=this._prepareModel(f,e);
if(!f){return !1
}var g=e.success;
e.success=function(i,k,j){h.add(i,e);
g&&g(i,k,j)
};
f.save(null,e);
return f
},parse:function(e){return e
},chain:function(){return K(this.models).chain()
},_reset:function(){this.length=0;
this.models=[];
this._byId={};
this._byCid={}
},_prepareModel:function(f,e){if(f instanceof L.Model){if(!f.collection){f.collection=this
}}else{var g=f;
f=new this.model(g,{collection:this});
f.validate&&!f._performValidation(g,e)&&(f=!1)
}return f
},_add:function(f,e){e||(e={});
f=this._prepareModel(f,e);
if(!f){return !1
}var g=this.getByCid(f);
if(g){throw Error(["Can't add the same model to a set twice",g.id])
}this._byId[f.id]=f;
this._byCid[f.cid]=f;
this.models.splice(e.at!=null?e.at:this.comparator?this.sortedIndex(f,this.comparator):this.length,0,f);
f.bind("all",this._onModelEvent);
this.length++;
e.silent||f.trigger("add",f,this,e);
return f
},_remove:function(f,e){e||(e={});
f=this.getByCid(f)||this.get(f);
if(!f){return null
}delete this._byId[f.id];
delete this._byCid[f.cid];
this.models.splice(this.indexOf(f),1);
this.length--;
e.silent||f.trigger("remove",f,this,e);
this._removeReference(f);
return f
},_removeReference:function(e){this==e.collection&&delete e.collection;
e.unbind("all",this._onModelEvent)
},_onModelEvent:function(f,e,h,g){(f=="add"||f=="remove")&&h!=this||(f=="destroy"&&this._remove(e,g),e&&f==="change:"+e.idAttribute&&(delete this._byId[e.previous(e.idAttribute)],this._byId[e.id]=e),this.trigger.apply(this,arguments))
}});
K.each(["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","groupBy"],function(e){L.Collection.prototype[e]=function(){return K[e].apply(K,[this.models].concat(K.toArray(arguments)))
}
});
L.Router=function(e){e||(e={});
if(e.routes){this.routes=e.routes
}this._bindRoutes();
this.initialize.apply(this,arguments)
};
var z=/:([\w\d]+)/g,y=/\*([\w\d]+)/g,x=/[-[\]{}()+?.,\\^$|#\s]/g;
K.extend(L.Router.prototype,L.Events,{initialize:function(){},route:function(f,e,g){L.history||(L.history=new L.History);
K.isRegExp(f)||(f=this._routeToRegExp(f));
L.history.route(f,K.bind(function(h){h=this._extractParameters(f,h);
g.apply(this,h);
this.trigger.apply(this,["route:"+e].concat(h))
},this))
},navigate:function(f,e){L.history.navigate(f,e)
},_bindRoutes:function(){if(this.routes){var f=[],e;
for(e in this.routes){f.unshift([e,this.routes[e]])
}e=0;
for(var g=f.length;
e<g;
e++){this.route(f[e][0],f[e][1],this[f[e][1]])
}}},_routeToRegExp:function(e){e=e.replace(x,"\\$&").replace(z,"([^/]*)").replace(y,"(.*?)");
return RegExp("^"+e+"$")
},_extractParameters:function(f,e){return f.exec(e).slice(1)
}});
L.History=function(){this.handlers=[];
K.bindAll(this,"checkUrl")
};
var G=/^#*/,d=/msie [\w.]+/,D=!1;
K.extend(L.History.prototype,{interval:50,getFragment:function(f,e){if(f==null){if(this._hasPushState||e){f=window.location.pathname;
var g=window.location.search;
g&&(f+=g);
f.indexOf(this.options.root)==0&&(f=f.substr(this.options.root.length))
}else{f=window.location.hash
}}return decodeURIComponent(f.replace(G,""))
},start:function(f){if(D){throw Error("Backbone.history has already been started")
}this.options=K.extend({},{root:"/"},this.options,f);
this._wantsPushState=!!this.options.pushState;
this._hasPushState=!(!this.options.pushState||!window.history||!window.history.pushState);
f=this.getFragment();
var e=document.documentMode;
if(e=d.exec(navigator.userAgent.toLowerCase())&&(!e||e<=7)){this.iframe=J('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(f)
}this._hasPushState?J(window).bind("popstate",this.checkUrl):"onhashchange" in window&&!e?J(window).bind("hashchange",this.checkUrl):setInterval(this.checkUrl,this.interval);
this.fragment=f;
D=!0;
f=window.location;
e=f.pathname==this.options.root;
if(this._wantsPushState&&!this._hasPushState&&!e){return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0
}else{if(this._wantsPushState&&this._hasPushState&&e&&f.hash){this.fragment=f.hash.replace(G,""),window.history.replaceState({},document.title,f.protocol+"//"+f.host+this.options.root+this.fragment)
}}if(!this.options.silent){return this.loadUrl()
}},route:function(f,e){this.handlers.unshift({route:f,callback:e})
},checkUrl:function(){var e=this.getFragment();
e==this.fragment&&this.iframe&&(e=this.getFragment(this.iframe.location.hash));
if(e==this.fragment||e==decodeURIComponent(this.fragment)){return !1
}this.iframe&&this.navigate(e);
this.loadUrl()||this.loadUrl(window.location.hash)
},loadUrl:function(f){var e=this.fragment=this.getFragment(f);
return K.any(this.handlers,function(g){if(g.route.test(e)){return g.callback(e),!0
}})
},navigate:function(f,e){var h=(f||"").replace(G,"");
if(!(this.fragment==h||this.fragment==decodeURIComponent(h))){if(this._hasPushState){var g=window.location;
h.indexOf(this.options.root)!=0&&(h=this.options.root+h);
this.fragment=h;
window.history.pushState({},document.title,g.protocol+"//"+g.host+h)
}else{if(window.location.hash=this.fragment=h,this.iframe&&h!=this.getFragment(this.iframe.location.hash)){this.iframe.document.open().close(),this.iframe.location.hash=h
}}e&&this.loadUrl(f)
}}});
L.View=function(e){this.cid=K.uniqueId("view");
this._configure(e||{});
this._ensureElement();
this.delegateEvents();
this.initialize.apply(this,arguments)
};
var c=/^(\S+)\s*(.*)$/,C=["model","collection","el","id","attributes","className","tagName"];
K.extend(L.View.prototype,L.Events,{tagName:"div",$:function(e){return J(e,this.el)
},initialize:function(){},render:function(){return this
},remove:function(){J(this.el).remove();
return this
},make:function(f,e,g){f=document.createElement(f);
e&&J(f).attr(e);
g&&J(f).html(g);
return f
},delegateEvents:function(g){if(g||(g=this.events)){for(var f in K.isFunction(g)&&(g=g.call(this)),J(this.el).unbind(".delegateEvents"+this.cid),g){var j=this[g[f]];
if(!j){throw Error('Event "'+g[f]+'" does not exist')
}var i=f.match(c),h=i[1];
i=i[2];
j=K.bind(j,this);
h+=".delegateEvents"+this.cid;
i===""?J(this.el).bind(h,j):J(this.el).delegate(i,h,j)
}}},_configure:function(f){this.options&&(f=K.extend({},this.options,f));
for(var e=0,h=C.length;
e<h;
e++){var g=C[e];
f[g]&&(this[g]=f[g])
}this.options=f
},_ensureElement:function(){if(this.el){if(K.isString(this.el)){this.el=J(this.el).get(0)
}}else{var e=this.attributes||{};
if(this.id){e.id=this.id
}if(this.className){e["class"]=this.className
}this.el=this.make(this.tagName,e)
}}});
L.Model.extend=L.Collection.extend=L.Router.extend=L.View.extend=function(f,e){var g=b(this,f,e);
g.extend=this.extend;
return g
};
var a={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};
L.sync=function(f,e,h){var g=a[f];
h=K.extend({type:g,dataType:"json"},h);
if(!h.url){h.url=F(e)||E()
}if(!h.data&&e&&(f=="create"||f=="update")){h.contentType="application/json",h.data=JSON.stringify(e.toJSON())
}if(L.emulateJSON){h.contentType="application/x-www-form-urlencoded",h.data=h.data?{model:h.data}:{}
}if(L.emulateHTTP&&(g==="PUT"||g==="DELETE")){if(L.emulateJSON){h.data._method=g
}h.type="POST";
h.beforeSend=function(i){i.setRequestHeader("X-HTTP-Method-Override",g)
}
}if(h.type!=="GET"&&!L.emulateJSON){h.processData=!1
}return J.ajax(h)
};
var B=function(){},b=function(f,e,h){var g;
g=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return f.apply(this,arguments)
};
K.extend(g,f);
B.prototype=f.prototype;
g.prototype=new B;
e&&K.extend(g.prototype,e);
h&&K.extend(g,h);
g.prototype.constructor=g;
g.__super__=f.prototype;
return g
},F=function(e){if(!e||!e.url){return null
}return K.isFunction(e.url)?e.url():e.url
},E=function(){throw Error('A "url" property or function must be specified')
},H=function(f,e,g){return function(h){f?f(e,h,g):e.trigger("error",e,h,g)
}
}
}).call(this);
(function(a){Backbone.View.prototype.destroy=function(){this.remove();
this.unbind();
if(this.finalize){this.finalize()
}}
})(jQuery);
var handlebars=(function(){var f={trace:function c(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,statements:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,inMustache:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,OPEN_PARTIAL:24,params:25,hash:26,param:27,STRING:28,INTEGER:29,BOOLEAN:30,hashSegments:31,hashSegment:32,ID:33,EQUALS:34,pathSegments:35,SEP:36,"$accept":0,"$end":1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},productions_:[0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],performAction:function b(g,j,k,n,m,i,l){var h=i.length-1;
switch(m){case 1:return i[h-1];
break;
case 2:this.$=new n.ProgramNode(i[h-2],i[h]);
break;
case 3:this.$=new n.ProgramNode(i[h]);
break;
case 4:this.$=new n.ProgramNode([]);
break;
case 5:this.$=[i[h]];
break;
case 6:i[h-1].push(i[h]);
this.$=i[h-1];
break;
case 7:this.$=new n.InverseNode(i[h-2],i[h-1],i[h]);
break;
case 8:this.$=new n.BlockNode(i[h-2],i[h-1],i[h]);
break;
case 9:this.$=i[h];
break;
case 10:this.$=i[h];
break;
case 11:this.$=new n.ContentNode(i[h]);
break;
case 12:this.$=new n.CommentNode(i[h]);
break;
case 13:this.$=new n.MustacheNode(i[h-1][0],i[h-1][1]);
break;
case 14:this.$=new n.MustacheNode(i[h-1][0],i[h-1][1]);
break;
case 15:this.$=i[h-1];
break;
case 16:this.$=new n.MustacheNode(i[h-1][0],i[h-1][1]);
break;
case 17:this.$=new n.MustacheNode(i[h-1][0],i[h-1][1],true);
break;
case 18:this.$=new n.PartialNode(i[h-1]);
break;
case 19:this.$=new n.PartialNode(i[h-2],i[h-1]);
break;
case 20:break;
case 21:this.$=[[i[h-2]].concat(i[h-1]),i[h]];
break;
case 22:this.$=[[i[h-1]].concat(i[h]),null];
break;
case 23:this.$=[[i[h-1]],i[h]];
break;
case 24:this.$=[[i[h]],null];
break;
case 25:i[h-1].push(i[h]);
this.$=i[h-1];
break;
case 26:this.$=[i[h]];
break;
case 27:this.$=i[h];
break;
case 28:this.$=new n.StringNode(i[h]);
break;
case 29:this.$=new n.IntegerNode(i[h]);
break;
case 30:this.$=new n.BooleanNode(i[h]);
break;
case 31:this.$=new n.HashNode(i[h]);
break;
case 32:i[h-1].push(i[h]);
this.$=i[h-1];
break;
case 33:this.$=[i[h]];
break;
case 34:this.$=[i[h-2],i[h]];
break;
case 35:this.$=[i[h-2],new n.StringNode(i[h])];
break;
case 36:this.$=[i[h-2],new n.IntegerNode(i[h])];
break;
case 37:this.$=[i[h-2],new n.BooleanNode(i[h])];
break;
case 38:this.$=new n.IdNode(i[h]);
break;
case 39:i[h-2].push(i[h]);
this.$=i[h-2];
break;
case 40:this.$=[i[h]];
break
}},table:[{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],defaultActions:{16:[2,1],37:[2,23],53:[2,21]},parseError:function d(h,g){throw new Error(h)
},parse:function e(o){var x=this,l=[0],G=[null],s=[],H=this.table,h="",q=0,E=0,j=0,n=2,u=1;
this.lexer.setInput(o);
this.lexer.yy=this.yy;
this.yy.lexer=this.lexer;
if(typeof this.lexer.yylloc=="undefined"){this.lexer.yylloc={}
}var i=this.lexer.yylloc;
s.push(i);
if(typeof this.yy.parseError==="function"){this.parseError=this.yy.parseError
}function w(p){l.length=l.length-2*p;
G.length=G.length-p;
s.length=s.length-p
}function v(){var p;
p=x.lexer.lex()||1;
if(typeof p!=="number"){p=x.symbols_[p]||p
}return p
}var D,z,k,C,I,t,B={},y,F,g,m;
while(true){k=l[l.length-1];
if(this.defaultActions[k]){C=this.defaultActions[k]
}else{if(D==null){D=v()
}C=H[k]&&H[k][D]
}if(typeof C==="undefined"||!C.length||!C[0]){if(!j){m=[];
for(y in H[k]){if(this.terminals_[y]&&y>2){m.push("'"+this.terminals_[y]+"'")
}}var A="";
if(this.lexer.showPosition){A="Parse error on line "+(q+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+m.join(", ")
}else{A="Parse error on line "+(q+1)+": Unexpected "+(D==1?"end of input":("'"+(this.terminals_[D]||D)+"'"))
}this.parseError(A,{text:this.lexer.match,token:this.terminals_[D]||D,line:this.lexer.yylineno,loc:i,expected:m})
}if(j==3){if(D==u){throw new Error(A||"Parsing halted.")
}E=this.lexer.yyleng;
h=this.lexer.yytext;
q=this.lexer.yylineno;
i=this.lexer.yylloc;
D=v()
}while(1){if((n.toString()) in H[k]){break
}if(k==0){throw new Error(A||"Parsing halted.")
}w(1);
k=l[l.length-1]
}z=D;
D=n;
k=l[l.length-1];
C=H[k]&&H[k][n];
j=3
}if(C[0] instanceof Array&&C.length>1){throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+D)
}switch(C[0]){case 1:l.push(D);
G.push(this.lexer.yytext);
s.push(this.lexer.yylloc);
l.push(C[1]);
D=null;
if(!z){E=this.lexer.yyleng;
h=this.lexer.yytext;
q=this.lexer.yylineno;
i=this.lexer.yylloc;
if(j>0){j--
}}else{D=z;
z=null
}break;
case 2:F=this.productions_[C[1]][1];
B.$=G[G.length-F];
B._$={first_line:s[s.length-(F||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(F||1)].first_column,last_column:s[s.length-1].last_column};
t=this.performAction.call(B,h,E,q,this.yy,C[1],G,s);
if(typeof t!=="undefined"){return t
}if(F){l=l.slice(0,-1*F*2);
G=G.slice(0,-1*F);
s=s.slice(0,-1*F)
}l.push(this.productions_[C[1]][0]);
G.push(B.$);
s.push(B._$);
g=H[l[l.length-2]][l[l.length-1]];
l.push(g);
break;
case 3:return true
}}return true
}};
var a=(function(){var j=({EOF:1,parseError:function l(o,n){if(this.yy.parseError){this.yy.parseError(o,n)
}else{throw new Error(o)
}},setInput:function(n){this._input=n;
this._more=this._less=this.done=false;
this.yylineno=this.yyleng=0;
this.yytext=this.matched=this.match="";
this.conditionStack=["INITIAL"];
this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};
return this
},input:function(){var o=this._input[0];
this.yytext+=o;
this.yyleng++;
this.match+=o;
this.matched+=o;
var n=o.match(/\n/);
if(n){this.yylineno++
}this._input=this._input.slice(1);
return o
},unput:function(n){this._input=n+this._input;
return this
},more:function(){this._more=true;
return this
},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);
return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")
},upcomingInput:function(){var n=this.match;
if(n.length<20){n+=this._input.substr(0,20-n.length)
}return(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")
},showPosition:function(){var n=this.pastInput();
var o=new Array(n.length+1).join("-");
return n+this.upcomingInput()+"\n"+o+"^"
},next:function(){if(this.done){return this.EOF
}if(!this._input){this.done=true
}var r,p,o,n;
if(!this._more){this.yytext="";
this.match=""
}var s=this._currentRules();
for(var q=0;
q<s.length;
q++){p=this._input.match(this.rules[s[q]]);
if(p){n=p[0].match(/\n.*/g);
if(n){this.yylineno+=n.length
}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-1:this.yylloc.last_column+p[0].length};
this.yytext+=p[0];
this.match+=p[0];
this.matches=p;
this.yyleng=this.yytext.length;
this._more=false;
this._input=this._input.slice(p[0].length);
this.matched+=p[0];
r=this.performAction.call(this,this.yy,this,s[q],this.conditionStack[this.conditionStack.length-1]);
if(r){return r
}else{return
}}}if(this._input===""){return this.EOF
}else{this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})
}},lex:function g(){var n=this.next();
if(typeof n!=="undefined"){return n
}else{return this.lex()
}},begin:function h(n){this.conditionStack.push(n)
},popState:function m(){return this.conditionStack.pop()
},_currentRules:function k(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules
}});
j.performAction=function i(r,o,q,n){var p=n;
switch(q){case 0:this.begin("mu");
if(o.yytext){return 14
}break;
case 1:return 14;
break;
case 2:return 24;
break;
case 3:return 16;
break;
case 4:return 20;
break;
case 5:return 19;
break;
case 6:return 19;
break;
case 7:return 23;
break;
case 8:return 23;
break;
case 9:o.yytext=o.yytext.substr(3,o.yyleng-5);
this.begin("INITIAL");
return 15;
break;
case 10:return 22;
break;
case 11:return 34;
break;
case 12:return 33;
break;
case 13:return 33;
break;
case 14:return 36;
break;
case 15:break;
case 16:this.begin("INITIAL");
return 18;
break;
case 17:this.begin("INITIAL");
return 18;
break;
case 18:o.yytext=o.yytext.substr(1,o.yyleng-2).replace(/\\"/g,'"');
return 28;
break;
case 19:return 30;
break;
case 20:return 30;
break;
case 21:return 29;
break;
case 22:return 33;
break;
case 23:return"INVALID";
break;
case 24:return 5;
break
}};
j.rules=[/^[^\x00]*?(?=(\{\{))/,/^[^\x00]+/,/^\{\{>/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s/.])/,/^./,/^$/];
j.conditions={mu:{rules:[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],inclusive:false},INITIAL:{rules:[0,1,24],inclusive:true}};
return j
})();
f.lexer=a;
return f
})();
if(typeof require!=="undefined"&&typeof exports!=="undefined"){exports.parser=handlebars;
exports.parse=function(){return handlebars.parse.apply(handlebars,arguments)
};
exports.main=function commonjsMain(a){if(!a[1]){throw new Error("Usage: "+a[0]+" FILE")
}if(typeof process!=="undefined"){var c=require("fs").readFileSync(require("path").join(process.cwd(),a[1]),"utf8")
}else{var b=require("file").path(require("file").cwd());
var c=b.join(a[1]).read({charset:"utf-8"})
}return exports.parser.parse(c)
};
if(typeof module!=="undefined"&&require.main===module){exports.main(typeof process!=="undefined"?process.argv.slice(1):require("system").args)
}}var Handlebars={};
Handlebars.VERSION="1.0.beta.2";
Handlebars.Parser=handlebars;
Handlebars.parse=function(a){Handlebars.Parser.yy=Handlebars.AST;
return Handlebars.Parser.parse(a)
};
Handlebars.print=function(a){return new Handlebars.PrintVisitor().accept(a)
};
Handlebars.helpers={};
Handlebars.partials={};
Handlebars.registerHelper=function(b,c,a){if(a){c.not=a
}this.helpers[b]=c
};
Handlebars.registerPartial=function(a,b){this.partials[a]=b
};
Handlebars.registerHelper("helperMissing",function(a){if(arguments.length===2){return undefined
}else{throw new Error("Could not find property '"+a+"'")
}});
Handlebars.registerHelper("blockHelperMissing",function(e,g,a){a=a||function(){};
var c="";
var f=Object.prototype.toString.call(e);
if(f==="[object Function]"){e=e()
}if(e===true){return g(this)
}else{if(e===false||e==null){return a(this)
}else{if(f==="[object Array]"){if(e.length>0){for(var d=0,b=e.length;
d<b;
d++){c=c+g(e[d])
}}else{c=a(this)
}return c
}else{return g(e)
}}}},function(a,b){return b(a)
});
Handlebars.registerHelper("each",function(e,f,a){var c="";
if(e&&e.length>0){for(var d=0,b=e.length;
d<b;
d++){c=c+f(e[d])
}}else{c=a(this)
}return c
});
Handlebars.registerHelper("if",function(b,c,a){if(!b||b==[]){return a(this)
}else{return c(this)
}});
Handlebars.registerHelper("unless",function(b,c,a){return Handlebars.helpers["if"].call(this,b,a,c)
});
Handlebars.registerHelper("with",function(a,b){return b(a)
});
Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(b,a){}};
Handlebars.log=function(b,a){Handlebars.logger.log(b,a)
};
(function(){Handlebars.AST={};
Handlebars.AST.ProgramNode=function(c,b){this.type="program";
this.statements=c;
if(b){this.inverse=new Handlebars.AST.ProgramNode(b)
}};
Handlebars.AST.MustacheNode=function(d,c,b){this.type="mustache";
this.id=d[0];
this.params=d.slice(1);
this.hash=c;
this.escaped=!b
};
Handlebars.AST.PartialNode=function(c,b){this.type="partial";
this.id=c;
this.context=b
};
var a=function(b,c){if(b.original!==c.original){throw new Handlebars.Exception(b.original+" doesn't match "+c.original)
}};
Handlebars.AST.BlockNode=function(c,b,d){a(c.id,d);
this.type="block";
this.mustache=c;
this.program=b
};
Handlebars.AST.InverseNode=function(c,b,d){a(c.id,d);
this.type="inverse";
this.mustache=c;
this.program=b
};
Handlebars.AST.ContentNode=function(b){this.type="content";
this.string=b
};
Handlebars.AST.HashNode=function(b){this.type="hash";
this.pairs=b
};
Handlebars.AST.IdNode=function(f){this.type="ID";
this.original=f.join(".");
var d=[],g=0;
for(var e=0,b=f.length;
e<b;
e++){var c=f[e];
if(c===".."){g++
}else{if(c==="."||c==="this"){continue
}else{d.push(c)
}}}this.parts=d;
this.string=d.join(".");
this.depth=g;
this.isSimple=(d.length===1)&&(g===0)
};
Handlebars.AST.StringNode=function(b){this.type="STRING";
this.string=b
};
Handlebars.AST.IntegerNode=function(b){this.type="INTEGER";
this.integer=b
};
Handlebars.AST.BooleanNode=function(b){this.type="BOOLEAN";
this.bool=b
};
Handlebars.AST.CommentNode=function(b){this.type="comment";
this.comment=b
}
})();
Handlebars.Visitor=function(){};
Handlebars.Visitor.prototype={accept:function(a){return this[a.type](a)
}};
Handlebars.Exception=function(a){this.message=a
};
Handlebars.SafeString=function(a){this.string=a
};
Handlebars.SafeString.prototype.toString=function(){return this.string.toString()
};
(function(){var c={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};
var d=/&(?!\w+;)|[<>"'`]/g;
var b=/[&<>"'`]/;
var a=function(e){return c[e]||"&amp;"
};
Handlebars.Utils={escapeExpression:function(e){if(e instanceof Handlebars.SafeString){return e.toString()
}else{if(e==null||e===false){return""
}}if(!b.test(e)){return e
}return e.replace(d,a)
},isEmpty:function(e){if(typeof e==="undefined"){return true
}else{if(e===null){return true
}else{if(e===false){return true
}else{if(Object.prototype.toString.call(e)==="[object Array]"&&e.length===0){return true
}else{return false
}}}}}}
})();
Handlebars.Compiler=function(){};
Handlebars.JavaScriptCompiler=function(){};
(function(e,d){e.OPCODE_MAP={appendContent:1,getContext:2,lookupWithHelpers:3,lookup:4,append:5,invokeMustache:6,appendEscaped:7,pushString:8,truthyOrFallback:9,functionOrFallback:10,invokeProgram:11,invokePartial:12,push:13,invokeInverse:14,assignToHash:15,pushStringParam:16};
e.MULTI_PARAM_OPCODES={appendContent:1,getContext:1,lookupWithHelpers:1,lookup:1,invokeMustache:2,pushString:1,truthyOrFallback:1,functionOrFallback:1,invokeProgram:2,invokePartial:1,push:1,invokeInverse:1,assignToHash:1,pushStringParam:1};
e.DISASSEMBLE_MAP={};
for(var g in e.OPCODE_MAP){var f=e.OPCODE_MAP[g];
e.DISASSEMBLE_MAP[f]=g
}e.multiParamSize=function(h){return e.MULTI_PARAM_OPCODES[e.DISASSEMBLE_MAP[h]]
};
e.prototype={compiler:e,disassemble:function(){var s=this.opcodes,q,m;
var p=[],u,k,v;
for(var r=0,n=s.length;
r<n;
r++){q=s[r];
if(q==="DECLARE"){k=s[++r];
v=s[++r];
p.push("DECLARE "+k+" = "+v)
}else{u=e.DISASSEMBLE_MAP[q];
var t=e.multiParamSize(q);
var h=[];
for(var o=0;
o<t;
o++){m=s[++r];
if(typeof m==="string"){m='"'+m.replace("\n","\\n")+'"'
}h.push(m)
}u=u+" "+h.join(" ");
p.push(u)
}}return p.join("\n")
},guid:0,compile:function(h,i){this.children=[];
this.depths={list:[]};
this.options=i||{};
return this.program(h)
},accept:function(h){return this[h.type](h)
},program:function(k){var j=k.statements,n;
this.opcodes=[];
for(var m=0,h=j.length;
m<h;
m++){n=j[m];
this[n.type](n)
}this.depths.list=this.depths.list.sort(function(l,i){return l-i
});
return this
},compileProgram:function(k){var h=new this.compiler().compile(k,this.options);
var m=this.guid++;
this.usePartial=this.usePartial||h.usePartial;
this.children[m]=h;
for(var n=0,j=h.depths.list.length;
n<j;
n++){depth=h.depths.list[n];
if(depth<2){continue
}else{this.addDepth(depth-1)
}}return m
},block:function(n){var k=n.mustache;
var m,o,i,j;
var l=this.setupStackForMustache(k);
var h=this.compileProgram(n.program);
if(n.program.inverse){j=this.compileProgram(n.program.inverse);
this.declare("inverse",j)
}this.opcode("invokeProgram",h,l.length);
this.declare("inverse",null);
this.opcode("append")
},inverse:function(i){this.ID(i.mustache.id);
var h=this.compileProgram(i.program);
this.opcode("invokeInverse",h);
this.opcode("append")
},hash:function(m){var k=m.pairs,o,n;
this.opcode("push","{}");
for(var j=0,h=k.length;
j<h;
j++){o=k[j];
n=o[1];
this.accept(n);
this.opcode("assignToHash",o[0])
}},partial:function(h){var i=h.id;
this.usePartial=true;
if(h.context){this.ID(h.context)
}else{this.opcode("push","context")
}this.opcode("invokePartial",i.original);
this.opcode("append")
},content:function(h){this.opcode("appendContent",h.string)
},mustache:function(h){var i=this.setupStackForMustache(h);
this.opcode("invokeMustache",i.length,h.id.original);
if(h.escaped){this.opcode("appendEscaped")
}else{this.opcode("append")
}},ID:function(k){this.addDepth(k.depth);
this.opcode("getContext",k.depth);
this.opcode("lookupWithHelpers",k.parts[0]||null);
for(var j=1,h=k.parts.length;
j<h;
j++){this.opcode("lookup",k.parts[j])
}},STRING:function(h){this.opcode("pushString",h.string)
},INTEGER:function(h){this.opcode("push",h.integer)
},BOOLEAN:function(h){this.opcode("push",h.bool)
},comment:function(){},pushParams:function(k){var h=k.length,j;
while(h--){j=k[h];
if(this.options.stringParams){if(j.depth){this.addDepth(j.depth)
}this.opcode("getContext",j.depth||0);
this.opcode("pushStringParam",j.string)
}else{this[j.type](j)
}}},opcode:function(h,j,i){this.opcodes.push(e.OPCODE_MAP[h]);
if(j!==undefined){this.opcodes.push(j)
}if(i!==undefined){this.opcodes.push(i)
}},declare:function(h,i){this.opcodes.push("DECLARE");
this.opcodes.push(h);
this.opcodes.push(i)
},addDepth:function(h){if(h===0){return
}if(!this.depths[h]){this.depths[h]=true;
this.depths.list.push(h)
}},setupStackForMustache:function(h){var i=h.params;
this.pushParams(i);
if(h.hash){this.hash(h.hash)
}else{this.opcode("push","{}")
}this.ID(h.id);
return i
}};
d.prototype={nameLookup:function(j,h,i){if(d.RESERVED_WORDS[h]||h.indexOf("-")!==-1||!isNaN(h)){return j+"['"+h+"']"
}else{if(/^[0-9]+$/.test(h)){return j+"["+h+"]"
}else{return j+"."+h
}}},appendToBuffer:function(h){return"buffer = buffer + "+h+";"
},initializeBuffer:function(){return this.quotedString("")
},compile:function(i,k){this.environment=i;
this.options=k||{};
this.preamble();
this.stackSlot=0;
this.stackVars=[];
this.registers={list:[]};
this.compileChildren(i,k);
Handlebars.log(Handlebars.logger.DEBUG,i.disassemble()+"\n\n");
var m=i.opcodes,l,j,n,h;
this.i=0;
for(b=m.length;
this.i<b;
this.i++){l=this.nextOpcode(0);
if(l[0]==="DECLARE"){this.i=this.i+2;
this[l[1]]=l[2]
}else{this.i=this.i+l[1].length;
this[l[0]].apply(this,l[1])
}}return this.createFunction()
},nextOpcode:function(q){var m=this.environment.opcodes,l=m[this.i+q],k,o;
var p,h;
if(l==="DECLARE"){k=m[this.i+1];
o=m[this.i+2];
return["DECLARE",k,o]
}else{k=e.DISASSEMBLE_MAP[l];
p=e.multiParamSize(l);
h=[];
for(var i=0;
i<p;
i++){h.push(m[this.i+i+1+q])
}return[k,h]
}},eat:function(h){this.i=this.i+h.length
},preamble:function(){var h=[];
h.push("var buffer = "+this.initializeBuffer()+", currentContext = context");
var i="helpers = helpers || Handlebars.helpers;";
if(this.environment.usePartial){i=i+" partials = partials || Handlebars.partials;"
}h.push(i);
this.lastContext=0;
this.source=h
},createFunction:function(){var j={escapeExpression:Handlebars.Utils.escapeExpression,invokePartial:Handlebars.VM.invokePartial,programs:[],program:function(q,r,p,s){var l=this.programs[q];
if(s){return Handlebars.VM.program(this.children[q],r,p,s)
}else{if(l){return l
}else{l=this.programs[q]=Handlebars.VM.program(this.children[q],r,p);
return l
}}},programWithDepth:Handlebars.VM.programWithDepth,noop:Handlebars.VM.noop};
var n=this.stackVars.concat(this.registers.list);
if(n.length>0){this.source[0]=this.source[0]+", "+n.join(", ")
}this.source[0]=this.source[0]+";";
this.source.push("return buffer;");
var o=["Handlebars","context","helpers","partials"];
if(this.options.data){o.push("data")
}for(var k=0,h=this.environment.depths.list.length;
k<h;
k++){o.push("depth"+this.environment.depths.list[k])
}if(o.length===4&&!this.environment.usePartial){o.pop()
}o.push(this.source.join("\n"));
var m=Function.apply(this,o);
m.displayName="Handlebars.js";
Handlebars.log(Handlebars.logger.DEBUG,m.toString()+"\n\n");
j.render=m;
j.children=this.environment.children;
return function(p,l,q){try{l=l||{};
var i=[Handlebars,p,l.helpers,l.partials,l.data];
var s=Array.prototype.slice.call(arguments,2);
i=i.concat(s);
return j.render.apply(j,i)
}catch(r){throw r
}}
},appendContent:function(h){this.source.push(this.appendToBuffer(this.quotedString(h)))
},append:function(){var h=this.popStack();
this.source.push("if("+h+" || "+h+" === 0) { "+this.appendToBuffer(h)+" }")
},appendEscaped:function(){var i=this.nextOpcode(1),h="";
if(i[0]==="appendContent"){h=" + "+this.quotedString(i[1][0]);
this.eat(i)
}this.source.push(this.appendToBuffer("this.escapeExpression("+this.popStack()+")"+h))
},getContext:function(h){if(this.lastContext!==h){this.lastContext=h;
if(h===0){this.source.push("currentContext = context;")
}else{this.source.push("currentContext = depth"+h+";")
}}},lookupWithHelpers:function(j){if(j){var h=this.nextStack();
var i="if('"+j+"' in helpers) { "+h+" = "+this.nameLookup("helpers",j,"helper")+"; } else { "+h+" = "+this.nameLookup("currentContext",j,"context")+"; }";
this.source.push(i)
}else{this.pushStack("currentContext")
}},lookup:function(i){var h=this.topStack();
this.source.push(h+" = "+this.nameLookup(h,i,"context")+";")
},pushStringParam:function(h){this.pushStack("currentContext");
this.pushString(h)
},pushString:function(h){this.pushStack(this.quotedString(h))
},push:function(h){this.pushStack(h)
},invokeMustache:function(i,h){this.populateParams(i,this.quotedString(h),"{}",null,function(j,l,k){this.source.push("else if("+k+"=== undefined) { "+j+" = helpers.helperMissing.call("+l+"); }");
this.source.push("else { "+j+" = "+k+"; }")
})
},invokeProgram:function(i,j){var h=this.programExpression(this.inverse);
var k=this.programExpression(i);
this.populateParams(j,null,k,h,function(l,n,m){this.source.push("else { "+l+" = helpers.blockHelperMissing.call("+n+"); }")
})
},populateParams:function(n,j,r,o,t){var h=this.popStack(),s;
var l=[],k,m;
var q=this.popStack();
this.register("tmp1",r);
this.source.push("tmp1.hash = "+q+";");
if(this.options.stringParams){this.source.push("tmp1.contexts = [];")
}for(var p=0;
p<n;
p++){k=this.popStack();
l.push(k);
if(this.options.stringParams){this.source.push("tmp1.contexts.push("+this.popStack()+");")
}}if(o){this.source.push("tmp1.fn = tmp1;");
this.source.push("tmp1.inverse = "+o+";")
}if(this.options.data){this.source.push("tmp1.data = data;")
}l.push("tmp1");
if(o){l.push(o)
}this.populateCall(l,h,j||h,t)
},populateCall:function(j,m,l,h){var i=["context"].concat(j).join(", ");
var k=["context"].concat(l).concat(j).join(", ");
nextStack=this.nextStack();
this.source.push("if(typeof "+m+" === 'function') { "+nextStack+" = "+m+".call("+i+"); }");
h.call(this,nextStack,k,m)
},invokeInverse:function(j){var h=this.programExpression(j);
var i=["context",this.topStack(),"this.noop",h];
this.pushStack("helpers.blockHelperMissing.call("+i.join(", ")+")")
},invokePartial:function(h){this.pushStack("this.invokePartial("+this.nameLookup("partials",h,"partial")+", '"+h+"', "+this.popStack()+", helpers, partials);")
},assignToHash:function(h){var i=this.popStack();
var j=this.topStack();
this.source.push(j+"['"+h+"'] = "+i+";")
},compiler:d,compileChildren:function(h,k){var n=h.children,q,o;
var p=[];
for(var m=0,j=n.length;
m<j;
m++){q=n[m];
o=new this.compiler();
p[m]=o.compile(q,k)
}h.rawChildren=n;
h.children=p
},programExpression:function(j){if(j==null){return"this.noop"
}var m=[j,"helpers","partials"];
var n=this.environment.rawChildren[j].depths.list;
if(this.options.data){m.push("data")
}for(var k=0,h=n.length;
k<h;
k++){depth=n[k];
if(depth===1){m.push("context")
}else{m.push("depth"+(depth-1))
}}if(!this.environment.usePartial){if(m[3]){m[2]="null"
}else{m.pop()
}}if(n.length===0){return"this.program("+m.join(", ")+")"
}else{m[0]="this.children["+j+"]";
return"this.programWithDepth("+m.join(", ")+")"
}},register:function(h,i){this.useRegister(h);
this.source.push(h+" = "+i+";")
},useRegister:function(h){if(!this.registers[h]){this.registers[h]=true;
this.registers.list.push(h)
}},pushStack:function(h){this.source.push(this.nextStack()+" = "+h+";");
return"stack"+this.stackSlot
},nextStack:function(){this.stackSlot++;
if(this.stackSlot>this.stackVars.length){this.stackVars.push("stack"+this.stackSlot)
}return"stack"+this.stackSlot
},popStack:function(){return"stack"+this.stackSlot--
},topStack:function(){return"stack"+this.stackSlot
},quotedString:function(h){return'"'+h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'
}};
var a=("break case catch continue default delete do else finally for function if in instanceof new return switch this throw try typeof var void while with null true false").split(" ");
compilerWords=d.RESERVED_WORDS={};
for(var c=0,b=a.length;
c<b;
c++){compilerWords[a[c]]=true
}})(Handlebars.Compiler,Handlebars.JavaScriptCompiler);
Handlebars.VM={programWithDepth:function(c,e,b,f,d){var a=Array.prototype.slice.call(arguments,4);
return function(h,g){g=g||{};
g={helpers:g.helpers||e,partials:g.partials||b,data:g.data||f};
return c.apply(this,[h,g].concat(a))
}
},program:function(b,c,a,d){return function(f,e){e=e||{};
return b(f,{helpers:e.helpers||c,partials:e.partials||a,data:e.data||d})
}
},noop:function(){return""
},compile:function(d,c){var b=Handlebars.parse(d);
var a=new Handlebars.Compiler().compile(b,c);
return new Handlebars.JavaScriptCompiler().compile(a,c)
},invokePartial:function(a,b,d,e,c){if(a===undefined){throw new Handlebars.Exception("The partial "+b+" could not be found")
}else{if(a instanceof Function){return a(d,{helpers:e,partials:c})
}else{c[b]=Handlebars.VM.compile(a);
return c[b](d,{helpers:e,partials:c})
}}}};
Handlebars.compile=Handlebars.VM.compile;
/*!
 * Raphael 1.2.1 - JavaScript Vector Library
 *
 * Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
 */
window.Raphael=(function(){var a=/[, ]+/,z=document,ab=window,h={was:"Raphael" in ab,is:ab.Raphael},Y=function(){if(Y.is(arguments[0],"array")){var e=arguments[0],E=p[ax](Y,e.splice(0,3+Y.is(e[0],W))),aA=E.set();
for(var S=0,aB=e[j];
S<aB;
S++){var R=e[S]||{};
({circle:1,rect:1,path:1,ellipse:1,text:1,image:1}[F](R.type))&&aA[c](E[R.type]().attr(R))
}return aA
}return p[ax](Y,arguments)
},ar={},u=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup"],aa="",X=" ",F="hasOwnProperty",az="prototype",o="setAttribute",ao="appendChild",ax="apply",j="length",ae="join",r="split",au="concat",c="push",J=parseFloat,v=parseInt,ap=Math.pow,al=Math.min,d=Math.max,C=Math.round,av=/^(?=[\da-f]$)/,W="number",af="toString",g={"clip-rect":"0 0 10e9 10e9",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},L={"clip-rect":"csv",cx:W,cy:W,fill:"colour","fill-opacity":W,"font-size":W,height:W,opacity:W,path:"path",r:W,rotation:"csv",rx:W,ry:W,scale:"csv",stroke:"colour","stroke-opacity":W,"stroke-width":W,translation:"csv",width:W,x:W,y:W},aq="replace";
Y.version="1.2.1";
Y.type=(ab.SVGAngle||z.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML");
Y.svg=!(Y.vml=Y.type=="VML");
Y._id=0;
Y._oid=0;
Y.fn={};
Y.is=function(i,e){e=(e+aa).toLowerCase();
return((e=="object"||e=="undefined")&&typeof i==e)||(i==null&&e=="null")||Object[az][af].call(i)[aq](/^\[object\s+|\]$/gi,aa).toLowerCase()==e
};
Y.setWindow=function(e){ab=e;
z=ab.document
};
var ah=function(e){if(Y.vml){ah=V(function(S){var aA;
try{var i=new ActiveXObject("htmlfile");
i.write("<body>");
i.close();
aA=i.body
}catch(aC){aA=createPopup().document.body
}var R=aA.createTextRange();
aA.style.color=S;
var aB=R.queryCommandValue("ForeColor");
aB=((aB&255)<<16)|(aB&65280)|((aB&16711680)>>>16);
return"#"+("000000"+aB[af](16)).slice(-6)
})
}else{var E=z.createElement("i");
E.className="Rapha\u00ebl colour picker";
E.style.cssText="display:none";
z.body[ao](E);
ah=V(function(i){E.style.color=i;
return z.defaultView.getComputedStyle(E,aa).getPropertyValue("color")
})
}return ah(e)
};
Y.hsb2rgb=V(function(aE,aC,aI){if(Y.is(aE,"object")&&"h" in aE&&"s" in aE&&"b" in aE){aI=aE.b;
aC=aE.s;
aE=aE.h
}var S,aA,aJ;
if(aI==0){return{r:0,g:0,b:0,hex:"#000"}
}if(aE>1||aC>1||aI>1){aE/=255;
aC/=255;
aI/=255
}var aB=~~(aE*6),aF=(aE*6)-aB,R=aI*(1-aC),E=aI*(1-(aC*aF)),aK=aI*(1-(aC*(1-aF)));
S=[aI,E,R,R,aK,aI,aI][aB];
aA=[aK,aI,aI,E,R,R,aK][aB];
aJ=[R,R,aK,aI,aI,E,R][aB];
S*=255;
aA*=255;
aJ*=255;
var aG={r:S,g:aA,b:aJ},e=(~~S)[af](16),aD=(~~aA)[af](16),aH=(~~aJ)[af](16);
e=e[aq](av,"0");
aD=aD[aq](av,"0");
aH=aH[aq](av,"0");
aG.hex="#"+e+aD+aH;
return aG
},Y);
Y.rgb2hsb=V(function(e,i,aC){if(Y.is(e,"object")&&"r" in e&&"g" in e&&"b" in e){aC=e.b;
i=e.g;
e=e.r
}if(Y.is(e,"string")){var aE=Y.getRGB(e);
e=aE.r;
i=aE.g;
aC=aE.b
}if(e>1||i>1||aC>1){e/=255;
i/=255;
aC/=255
}var aB=d(e,i,aC),E=al(e,i,aC),S,R,aA=aB;
if(E==aB){return{h:0,s:0,b:aB}
}else{var aD=(aB-E);
R=aD/aB;
if(e==aB){S=(i-aC)/aD
}else{if(i==aB){S=2+((aC-e)/aD)
}else{S=4+((e-i)/aD)
}}S/=6;
S<0&&S++;
S>1&&S--
}return{h:S,s:R,b:aA}
},Y);
Y._path2string=function(){var R=aa,aB;
for(var E=0,S=this[j];
E<S;
E++){for(var e=0,aA=this[E][j];
e<aA;
e++){R+=this[E][e];
e&&e!=aA-1&&(R+=",")
}E!=S-1&&(R+=X)
}return R[aq](/,(?=-)/g,aa)
};
function V(R,i,e){function E(){var S=Array[az].splice.call(arguments,0,arguments[j]),aB=S[ae]("\u25ba"),aA=E.cache=E.cache||{},aC=E.count=E.count||[];
if(aA[F](aB)){return e?e(aA[aB]):aA[aB]
}aC[j]>=1000&&delete aA[aC.shift()];
aC[c](aB);
aA[aB]=R[ax](i,S);
return e?e(aA[aB]):aA[aB]
}return E
}Y.getRGB=V(function(e){if(!e||!!((e+aa).indexOf("-")+1)){return{r:-1,g:-1,b:-1,hex:"none",error:1}
}e=e+aa;
if(e=="none"){return{r:-1,g:-1,b:-1,hex:"none"}
}!(({hs:1,rg:1}[F](e.substring(0,2))))&&(e=ah(e));
var aA,E,R,aD,aB=e.match(/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgb\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|rgb\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\)|hs[bl]\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hs[bl]\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i);
if(aB){if(aB[2]){aD=v(aB[2].substring(5),16);
R=v(aB[2].substring(3,5),16);
E=v(aB[2].substring(1,3),16)
}if(aB[3]){aD=v(aB[3].substring(3)+aB[3].substring(3),16);
R=v(aB[3].substring(2,3)+aB[3].substring(2,3),16);
E=v(aB[3].substring(1,2)+aB[3].substring(1,2),16)
}if(aB[4]){aB=aB[4][r](/\s*,\s*/);
E=J(aB[0]);
R=J(aB[1]);
aD=J(aB[2])
}if(aB[5]){aB=aB[5][r](/\s*,\s*/);
E=J(aB[0])*2.55;
R=J(aB[1])*2.55;
aD=J(aB[2])*2.55
}if(aB[6]){aB=aB[6][r](/\s*,\s*/);
E=J(aB[0]);
R=J(aB[1]);
aD=J(aB[2]);
return Y.hsb2rgb(E,R,aD)
}if(aB[7]){aB=aB[7][r](/\s*,\s*/);
E=J(aB[0])*2.55;
R=J(aB[1])*2.55;
aD=J(aB[2])*2.55;
return Y.hsb2rgb(E,R,aD)
}aB={r:E,g:R,b:aD};
var i=(~~E)[af](16),S=(~~R)[af](16),aC=(~~aD)[af](16);
i=i[aq](av,"0");
S=S[aq](av,"0");
aC=aC[aq](av,"0");
aB.hex="#"+i+S+aC;
return aB
}return{r:-1,g:-1,b:-1,hex:"none",error:1}
},Y);
Y.getColor=function(i){var E=this.getColor.start=this.getColor.start||{h:0,s:1,b:i||0.75},e=this.hsb2rgb(E.h,E.s,E.b);
E.h+=0.075;
if(E.h>1){E.h=0;
E.s-=0.2;
E.s<=0&&(this.getColor.start={h:0,s:1,b:E.b})
}return e.hex
};
Y.getColor.reset=function(){delete this.start
};
Y.parsePathString=V(function(e){if(!e){return null
}var E={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},i=[];
if(Y.is(e,"array")&&Y.is(e[0],"array")){i=ac(e)
}if(!i[j]){(e+aa)[aq](/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,function(S,R,aC){var aB=[],aA=R.toLowerCase();
aC[aq](/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,function(aE,aD){aD&&aB[c](+aD)
});
while(aB[j]>=E[aA]){i[c]([R][au](aB.splice(0,E[aA])));
if(!E[aA]){break
}}})
}i[af]=Y._path2string;
return i
});
var H=V(function(aF){if(!aF){return{x:0,y:0,width:0,height:0}
}aF=w(aF);
var aC=0,aB=0,R=[],E=[];
for(var S=0,aE=aF[j];
S<aE;
S++){if(aF[S][0]=="M"){aC=aF[S][1];
aB=aF[S][2];
R[c](aC);
E[c](aB)
}else{var aA=ag(aC,aB,aF[S][1],aF[S][2],aF[S][3],aF[S][4],aF[S][5],aF[S][6]);
R=R[au](aA.min.x,aA.max.x);
E=E[au](aA.min.y,aA.max.y)
}}var e=al[ax](0,R),aD=al[ax](0,E);
return{x:e,y:aD,width:d[ax](0,R)-e,height:d[ax](0,E)-aD}
}),ac=function(aB){var R=[];
if(!Y.is(aB,"array")||!Y.is(aB&&aB[0],"array")){aB=Y.parsePathString(aB)
}for(var E=0,S=aB[j];
E<S;
E++){R[E]=[];
for(var e=0,aA=aB[E][j];
e<aA;
e++){R[E][e]=aB[E][e]
}}R[af]=Y._path2string;
return R
},O=V(function(S){if(!Y.is(S,"array")||!Y.is(S&&S[0],"array")){S=Y.parsePathString(S)
}var aF=[],aH=0,aG=0,aK=0,aJ=0,R=0;
if(S[0][0]=="M"){aH=S[0][1];
aG=S[0][2];
aK=aH;
aJ=aG;
R++;
aF[c](["M",aH,aG])
}for(var aC=R,aL=S[j];
aC<aL;
aC++){var e=aF[aC]=[],aI=S[aC];
if(aI[0]!=aI[0].toLowerCase()){e[0]=aI[0].toLowerCase();
switch(e[0]){case"a":e[1]=aI[1];
e[2]=aI[2];
e[3]=aI[3];
e[4]=aI[4];
e[5]=aI[5];
e[6]=+(aI[6]-aH).toFixed(3);
e[7]=+(aI[7]-aG).toFixed(3);
break;
case"v":e[1]=+(aI[1]-aG).toFixed(3);
break;
case"m":aK=aI[1];
aJ=aI[2];
default:for(var aB=1,aD=aI[j];
aB<aD;
aB++){e[aB]=+(aI[aB]-((aB%2)?aH:aG)).toFixed(3)
}}}else{e=aF[aC]=[];
if(aI[0]=="m"){aK=aI[1]+aH;
aJ=aI[2]+aG
}for(var aA=0,E=aI[j];
aA<E;
aA++){aF[aC][aA]=aI[aA]
}}var aE=aF[aC][j];
switch(aF[aC][0]){case"z":aH=aK;
aG=aJ;
break;
case"h":aH+=+aF[aC][aE-1];
break;
case"v":aG+=+aF[aC][aE-1];
break;
default:aH+=+aF[aC][aE-2];
aG+=+aF[aC][aE-1]
}}aF[af]=Y._path2string;
return aF
},0,ac),n=V(function(S){if(!Y.is(S,"array")||!Y.is(S&&S[0],"array")){S=Y.parsePathString(S)
}var aE=[],aG=0,aF=0,aJ=0,aI=0,R=0;
if(S[0][0]=="M"){aG=+S[0][1];
aF=+S[0][2];
aJ=aG;
aI=aF;
R++;
aE[0]=["M",aG,aF]
}for(var aC=R,aK=S[j];
aC<aK;
aC++){var e=aE[aC]=[],aH=S[aC];
if(aH[0]!=(aH[0]+aa).toUpperCase()){e[0]=(aH[0]+aa).toUpperCase();
switch(e[0]){case"A":e[1]=aH[1];
e[2]=aH[2];
e[3]=aH[3];
e[4]=aH[4];
e[5]=aH[5];
e[6]=+(aH[6]+aG);
e[7]=+(aH[7]+aF);
break;
case"V":e[1]=+aH[1]+aF;
break;
case"H":e[1]=+aH[1]+aG;
break;
case"M":aJ=+aH[1]+aG;
aI=+aH[2]+aF;
default:for(var aB=1,aD=aH[j];
aB<aD;
aB++){e[aB]=+aH[aB]+((aB%2)?aG:aF)
}}}else{for(var aA=0,E=aH[j];
aA<E;
aA++){aE[aC][aA]=aH[aA]
}}switch(e[0]){case"Z":aG=aJ;
aF=aI;
break;
case"H":aG=e[1];
break;
case"V":aF=e[1];
break;
default:aG=aE[aC][aE[aC][j]-2];
aF=aE[aC][aE[aC][j]-1]
}}aE[af]=Y._path2string;
return aE
},null,ac),ay=function(i,R,e,E){return[i,R,e,E,e,E]
},an=function(i,R,aB,S,e,E){var aA=1/3,aC=2/3;
return[aA*i+aC*aB,aA*R+aC*S,aA*e+aC*aB,aA*E+aC*S,e,E]
},y=function(aK,be,aT,aR,aL,aF,aA,aJ,bd,aM){var S=Math.PI,aQ=S*120/180,e=S/180*(+aL||0),aX=[],aU,ba=V(function(bf,bi,i){var bh=bf*Math.cos(i)-bi*Math.sin(i),bg=bf*Math.sin(i)+bi*Math.cos(i);
return{x:bh,y:bg}
});
if(!aM){aU=ba(aK,be,-e);
aK=aU.x;
be=aU.y;
aU=ba(aJ,bd,-e);
aJ=aU.x;
bd=aU.y;
var E=Math.cos(S/180*aL),aH=Math.sin(S/180*aL),aZ=(aK-aJ)/2,aY=(be-bd)/2;
aT=d(aT,Math.abs(aZ));
aR=d(aR,Math.abs(aY));
var R=aT*aT,a2=aR*aR,a4=(aF==aA?-1:1)*Math.sqrt(Math.abs((R*a2-R*aY*aY-a2*aZ*aZ)/(R*aY*aY+a2*aZ*aZ))),aO=a4*aT*aY/aR+(aK+aJ)/2,aN=a4*-aR*aZ/aT+(be+bd)/2,aE=Math.asin((be-aN)/aR),aD=Math.asin((bd-aN)/aR);
aE=aK<aO?S-aE:aE;
aD=aJ<aO?S-aD:aD;
aE<0&&(aE=S*2+aE);
aD<0&&(aD=S*2+aD);
if(aA&&aE>aD){aE=aE-S*2
}if(!aA&&aD>aE){aD=aD-S*2
}}else{aE=aM[0];
aD=aM[1];
aO=aM[2];
aN=aM[3]
}var aI=aD-aE;
if(Math.abs(aI)>aQ){var aP=aD,aS=aJ,aG=bd;
aD=aE+aQ*(aA&&aD>aE?1:-1);
aJ=aO+aT*Math.cos(aD);
bd=aN+aR*Math.sin(aD);
aX=y(aJ,bd,aT,aR,aL,0,aA,aS,aG,[aD,aP,aO,aN])
}aI=aD-aE;
var aC=Math.cos(aE),bc=Math.sin(aE),aB=Math.cos(aD),bb=Math.sin(aD),a0=Math.tan(aI/4),a3=4/3*aT*a0,a1=4/3*aR*a0,a9=[aK,be],a8=[aK+a3*bc,be-a1*aC],a7=[aJ+a3*bb,bd-a1*aB],a5=[aJ,bd];
a8[0]=2*a9[0]-a8[0];
a8[1]=2*a9[1]-a8[1];
if(aM){return[a8,a7,a5][au](aX)
}else{aX=[a8,a7,a5][au](aX)[ae](",")[r](",");
var aV=[];
for(var a6=0,aW=aX[j];
a6<aW;
a6++){aV[a6]=a6%2?ba(aX[a6-1],aX[a6],e).y:ba(aX[a6],aX[a6+1],e).x
}return aV
}},A=V(function(i,e,aN,aL,aA,S,aC,aB,aH){var aF=ap(1-aH,3)*i+ap(1-aH,2)*3*aH*aN+(1-aH)*3*aH*aH*aA+ap(aH,3)*aC,aD=ap(1-aH,3)*e+ap(1-aH,2)*3*aH*aL+(1-aH)*3*aH*aH*S+ap(aH,3)*aB,aJ=i+2*aH*(aN-i)+aH*aH*(aA-2*aN+i),aI=e+2*aH*(aL-e)+aH*aH*(S-2*aL+e),aM=aN+2*aH*(aA-aN)+aH*aH*(aC-2*aA+aN),aK=aL+2*aH*(S-aL)+aH*aH*(aB-2*S+aL),aG=(1-aH)*i+aH*aN,aE=(1-aH)*e+aH*aL,R=(1-aH)*aA+aH*aC,E=(1-aH)*S+aH*aB;
return{x:aF,y:aD,m:{x:aJ,y:aI},n:{x:aM,y:aK},start:{x:aG,y:aE},end:{x:R,y:E}}
}),ag=V(function(i,e,R,E,aL,aK,aH,aE){var aJ=(aL-2*R+i)-(aH-2*aL+R),aG=2*(R-i)-2*(aL-R),aD=i-R,aB=(-aG+Math.sqrt(aG*aG-4*aJ*aD))/2/aJ,S=(-aG-Math.sqrt(aG*aG-4*aJ*aD))/2/aJ,aF=[e,aE],aI=[i,aH],aC=A(i,e,R,E,aL,aK,aH,aE,aB>0&&aB<1?aB:0),aA=A(i,e,R,E,aL,aK,aH,aE,S>0&&S<1?S:0);
aI=aI[au](aC.x,aA.x);
aF=aF[au](aC.y,aA.y);
aJ=(aK-2*E+e)-(aE-2*aK+E);
aG=2*(E-e)-2*(aK-E);
aD=e-E;
aB=(-aG+Math.sqrt(aG*aG-4*aJ*aD))/2/aJ;
S=(-aG-Math.sqrt(aG*aG-4*aJ*aD))/2/aJ;
aC=A(i,e,R,E,aL,aK,aH,aE,aB>0&&aB<1?aB:0);
aA=A(i,e,R,E,aL,aK,aH,aE,S>0&&S<1?S:0);
aI=aI[au](aC.x,aA.x);
aF=aF[au](aC.y,aA.y);
return{min:{x:al[ax](0,aI),y:al[ax](0,aF)},max:{x:d[ax](0,aI),y:d[ax](0,aF)}}
}),w=V(function(aK,aF){var S=n(aK),aG=aF&&n(aF),aH={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},aB=function(aL,aM){var i,aN;
if(!aL){return["C",aM.x,aM.y,aM.x,aM.y,aM.x,aM.y]
}!(aL[0] in {T:1,Q:1})&&(aM.qx=aM.qy=null);
switch(aL[0]){case"M":aM.X=aL[1];
aM.Y=aL[2];
break;
case"A":aL=["C"][au](y[ax](0,[aM.x,aM.y][au](aL.slice(1))));
break;
case"S":i=aM.x+(aM.x-(aM.bx||aM.x));
aN=aM.y+(aM.y-(aM.by||aM.y));
aL=["C",i,aN][au](aL.slice(1));
break;
case"T":aM.qx=aM.x+(aM.x-(aM.qx||aM.x));
aM.qy=aM.y+(aM.y-(aM.qy||aM.y));
aL=["C"][au](an(aM.x,aM.y,aM.qx,aM.qy,aL[1],aL[2]));
break;
case"Q":aM.qx=aL[1];
aM.qy=aL[2];
aL=["C"][au](an(aM.x,aM.y,aL[1],aL[2],aL[3],aL[4]));
break;
case"L":aL=["C"][au](ay(aM.x,aM.y,aL[1],aL[2]));
break;
case"H":aL=["C"][au](ay(aM.x,aM.y,aL[1],aM.y));
break;
case"V":aL=["C"][au](ay(aM.x,aM.y,aM.x,aL[1]));
break;
case"Z":aL=["C"][au](ay(aM.x,aM.y,aM.X,aM.Y));
break
}return aL
},E=function(aL,aM){if(aL[aM][j]>7){aL[aM].shift();
var aN=aL[aM];
while(aN[j]){aL.splice(aM++,0,["C"][au](aN.splice(0,6)))
}aL.splice(aM,1);
aI=d(S[j],aG&&aG[j]||0)
}},R=function(aP,aO,aM,aL,aN){if(aP&&aO&&aP[aN][0]=="M"&&aO[aN][0]!="M"){aO.splice(aN,0,["M",aL.x,aL.y]);
aM.bx=0;
aM.by=0;
aM.x=aP[aN][1];
aM.y=aP[aN][2];
aI=d(S[j],aG&&aG[j]||0)
}};
for(var aD=0,aI=d(S[j],aG&&aG[j]||0);
aD<aI;
aD++){S[aD]=aB(S[aD],aH);
E(S,aD);
aG&&(aG[aD]=aB(aG[aD],e));
aG&&E(aG,aD);
R(S,aG,aH,e,aD);
R(aG,S,e,aH,aD);
var aC=S[aD],aJ=aG&&aG[aD],aA=aC[j],aE=aG&&aJ[j];
aH.x=aC[aA-2];
aH.y=aC[aA-1];
aH.bx=J(aC[aA-4])||aH.x;
aH.by=J(aC[aA-3])||aH.y;
e.bx=aG&&(J(aJ[aE-4])||e.x);
e.by=aG&&(J(aJ[aE-3])||e.y);
e.x=aG&&aJ[aE-2];
e.y=aG&&aJ[aE-1]
}return aG?[S,aG]:S
},null,ac),l=V(function(aE){var aD=[];
for(var aA=0,aF=aE[j];
aA<aF;
aA++){var e={},aC=aE[aA].match(/^([^:]*):?([\d\.]*)/);
e.color=Y.getRGB(aC[1]);
if(e.color.error){return null
}e.color=e.color.hex;
aC[2]&&(e.offset=aC[2]+"%");
aD[c](e)
}for(var aA=1,aF=aD[j]-1;
aA<aF;
aA++){if(!aD[aA].offset){var E=J(aD[aA-1].offset||0),R=0;
for(var S=aA+1;
S<aF;
S++){if(aD[S].offset){R=aD[S].offset;
break
}}if(!R){R=100;
S=aF
}R=J(R);
var aB=(R-E)/(S-aA+1);
for(;
aA<S;
aA++){E+=aB;
aD[aA].offset=E+"%"
}}}return aD
}),Z=function(){var E,i,S,R,e;
if(Y.is(arguments[0],"string")||Y.is(arguments[0],"object")){if(Y.is(arguments[0],"string")){E=z.getElementById(arguments[0])
}else{E=arguments[0]
}if(E.tagName){if(arguments[1]==null){return{container:E,width:E.style.pixelWidth||E.offsetWidth,height:E.style.pixelHeight||E.offsetHeight}
}else{return{container:E,width:arguments[1],height:arguments[2]}
}}}else{if(Y.is(arguments[0],W)&&arguments[j]>3){return{container:1,x:arguments[0],y:arguments[1],width:arguments[2],height:arguments[3]}
}}},aj=function(e,E){var i=this;
for(var R in E){if(E[F](R)&&!(R in e)){switch(typeof E[R]){case"function":(function(S){e[R]=e===i?S:function(){return S[ax](i,arguments)
}
})(E[R]);
break;
case"object":e[R]=e[R]||{};
aj.call(this,e[R],E[R]);
break;
default:e[R]=E[R];
break
}}}};
if(Y.svg){ar.svgns="http://www.w3.org/2000/svg";
ar.xlink="http://www.w3.org/1999/xlink";
var C=function(e){return +e+(~~e===e)*0.5
};
var I=function(aA){for(var E=0,R=aA[j];
E<R;
E++){if(aA[E][0].toLowerCase()!="a"){for(var e=1,S=aA[E][j];
e<S;
e++){aA[E][e]=C(aA[E][e])
}}else{aA[E][6]=C(aA[E][6]);
aA[E][7]=C(aA[E][7])
}}return aA
};
var am=function(E,e){if(e){for(var i in e){if(e[F](i)){E[o](i,e[i])
}}}else{return z.createElementNS(ar.svgns,E)
}};
Y[af]=function(){return"Your browser supports SVG.\nYou are running Rapha\u00ebl "+this.version
};
var m=function(e,R){var i=am("path");
R.canvas&&R.canvas[ao](i);
var E=new ad(i,R);
E.type="path";
M(E,{fill:"none",stroke:"#000",path:e});
return E
};
var b=function(R,aI,e){var aF="linear",aC=0.5,aA=0.5,aK=R.style;
aI=(aI+aa)[aq](/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/,function(aL,i,aM){aF="radial";
if(i&&aM){aC=J(i);
aA=J(aM);
if(ap(aC-0.5,2)+ap(aA-0.5,2)>0.25){aA=Math.sqrt(0.25-ap(aC-0.5,2))+0.5
}}return aa
});
aI=aI[r](/\s*\-\s*/);
if(aF=="linear"){var aB=aI.shift();
aB=-J(aB);
if(isNaN(aB)){return null
}var S=[0,0,Math.cos(aB*Math.PI/180),Math.sin(aB*Math.PI/180)],aH=1/(d(Math.abs(S[2]),Math.abs(S[3]))||1);
S[2]*=aH;
S[3]*=aH;
if(S[2]<0){S[0]=-S[2];
S[2]=0
}if(S[3]<0){S[1]=-S[3];
S[3]=0
}}var aE=l(aI);
if(!aE){return null
}var E=am(aF+"Gradient");
E.id="r"+(Y._id++)[af](36);
aF=="radial"?am(E,{fx:aC,fy:aA}):am(E,{x1:S[0],y1:S[1],x2:S[2],y2:S[3]});
e.defs[ao](E);
for(var aD=0,aJ=aE[j];
aD<aJ;
aD++){var aG=am("stop");
am(aG,{offset:aE[aD].offset?aE[aD].offset:!aD?"0%":"100%","stop-color":aE[aD].color||"#fff"});
E[ao](aG)
}am(R,{fill:"url(#"+E.id+")",opacity:1,"fill-opacity":1});
aK.fill=aa;
aK.opacity=1;
aK.fillOpacity=1;
return 1
};
var B=function(i){var e=i.getBBox();
am(i.pattern,{patternTransform:Y.format("translate({0},{1})",e.x,e.y)})
};
var M=function(aG,aP){var aJ={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},aL=aG.node,aH=aG.attrs,aD=aG.rotate(),aA=function(aW,aV){aV=aJ[(aV+aa).toLowerCase()];
if(aV){var aT=aW.attrs["stroke-width"]||"1",aR={round:aT,square:aT,butt:0}[aW.attrs["stroke-linecap"]||aP["stroke-linecap"]]||0,aU=[];
var aS=aV[j];
while(aS--){aU[aS]=aV[aS]*aT+((aS%2)?1:-1)*aR
}am(aL,{"stroke-dasharray":aU[ae](",")})
}};
J(aD)&&aG.rotate(0,true);
for(var aK in aP){if(aP[F](aK)){if(!(aK in g)){continue
}var aI=aP[aK];
aH[aK]=aI;
switch(aK){case"href":case"title":case"target":var aN=aL.parentNode;
if(aN.tagName.toLowerCase()!="a"){var R=am("a");
aN.insertBefore(R,aL);
R[ao](aL);
aN=R
}aN.setAttributeNS(aG.paper.xlink,aK,aI);
break;
case"clip-rect":var i=(aI+aa)[r](a);
if(i[j]==4){aG.clip&&aG.clip.parentNode.parentNode.removeChild(aG.clip.parentNode);
var E=am("clipPath"),aM=am("rect");
E.id="r"+(Y._id++)[af](36);
am(aM,{x:i[0],y:i[1],width:i[2],height:i[3]});
E[ao](aM);
aG.paper.defs[ao](E);
am(aL,{"clip-path":"url(#"+E.id+")"});
aG.clip=aM
}if(!aI){var aO=z.getElementById(aL.getAttribute("clip-path")[aq](/(^url\(#|\)$)/g,aa));
aO&&aO.parentNode.removeChild(aO);
am(aL,{"clip-path":aa});
delete aG.clip
}break;
case"path":if(aI&&aG.type=="path"){aH.path=I(n(aI));
am(aL,{d:aH.path})
}break;
case"width":aL[o](aK,aI);
if(aH.fx){aK="x";
aI=aH.x
}else{break
}case"x":if(aH.fx){aI=-aH.x-(aH.width||0)
}case"rx":if(aK=="rx"&&aG.type=="rect"){break
}case"cx":aL[o](aK,C(aI));
aG.pattern&&B(aG);
break;
case"height":aL[o](aK,aI);
if(aH.fy){aK="y";
aI=aH.y
}else{break
}case"y":if(aH.fy){aI=-aH.y-(aH.height||0)
}case"ry":if(aK=="ry"&&aG.type=="rect"){break
}case"cy":aL[o](aK,C(aI));
aG.pattern&&B(aG);
break;
case"r":if(aG.type=="rect"){am(aL,{rx:aI,ry:aI})
}else{aL[o](aK,aI)
}break;
case"src":if(aG.type=="image"){aL.setAttributeNS(aG.paper.xlink,"href",aI)
}break;
case"stroke-width":aL.style.strokeWidth=aI;
aL[o](aK,aI);
if(aH["stroke-dasharray"]){aA(aG,aH["stroke-dasharray"])
}break;
case"stroke-dasharray":aA(aG,aI);
break;
case"rotation":aD=aI;
aG.rotate(aI,true);
break;
case"translation":var aB=(aI+aa)[r](a);
aG.translate((+aB[0]+1||2)-1,(+aB[1]+1||2)-1);
break;
case"scale":var aB=(aI+aa)[r](a);
aG.scale(+aB[0]||1,+aB[1]||+aB[0]||1,+aB[2]||null,+aB[3]||null);
break;
case"fill":var S=(aI+aa).match(/^url\(['"]?([^\)]+)['"]?\)$/i);
if(S){var E=am("pattern"),aF=am("image");
E.id="r"+(Y._id++)[af](36);
am(E,{x:0,y:0,patternUnits:"userSpaceOnUse"});
am(aF,{x:0,y:0});
aF.setAttributeNS(aG.paper.xlink,"href",S[1]);
E[ao](aF);
var aQ=z.createElement("img");
aQ.style.cssText="position:absolute;left:-9999em;top-9999em";
aQ.onload=function(){am(E,{width:this.offsetWidth,height:this.offsetHeight});
am(aF,{width:this.offsetWidth,height:this.offsetHeight});
z.body.removeChild(this);
ar.safari()
};
z.body[ao](aQ);
aQ.src=S[1];
aG.paper.defs[ao](E);
aL.style.fill="url(#"+E.id+")";
am(aL,{fill:"url(#"+E.id+")"});
aG.pattern=E;
aG.pattern&&B(aG);
break
}if(!Y.getRGB(aI).error){delete aP.gradient;
delete aH.gradient;
if(!Y.is(aH.opacity,"undefined")&&Y.is(aP.opacity,"undefined")){aL.style.opacity=aH.opacity;
am(aL,{opacity:aH.opacity})
}if(!Y.is(aH["fill-opacity"],"undefined")&&Y.is(aP["fill-opacity"],"undefined")){aL.style.fillOpacity=aH["fill-opacity"];
am(aL,{"fill-opacity":aH["fill-opacity"]})
}}else{if((aG.type in {circle:1,ellipse:1}||(aI+aa).charAt(0)!="r")&&b(aL,aI,aG.paper)){aH.gradient=aI;
aH.fill="none";
break
}}case"stroke":aL.style[aK]=Y.getRGB(aI).hex;
aL[o](aK,Y.getRGB(aI).hex);
break;
case"gradient":(aG.type in {circle:1,ellipse:1}||(aI+aa).charAt(0)!="r")&&b(aL,aI,aG.paper);
break;
case"opacity":case"fill-opacity":if(aH.gradient){var e=z.getElementById(aL.getAttribute("fill")[aq](/^url\(#|\)$/g,aa));
if(e){var aC=e.getElementsByTagName("stop");
aC[aC[j]-1][o]("stop-opacity",aI)
}break
}default:aK=="font-size"&&(aI=v(aI,10)+"px");
var aE=aK[aq](/(\-.)/g,function(aR){return aR.substring(1).toUpperCase()
});
aL.style[aE]=aI;
aL[o](aK,aI);
break
}}}t(aG,aP);
J(aD)&&aG.rotate(aD,true)
};
var f=1.2;
var t=function(e,S){if(e.type!="text"||!("text" in S||"font" in S||"font-size" in S||"x" in S||"y" in S)){return
}var aE=e.attrs,E=e.node,aG=E.firstChild?v(z.defaultView.getComputedStyle(E.firstChild,aa).getPropertyValue("font-size"),10):10;
if("text" in S){while(E.firstChild){E.removeChild(E.firstChild)
}var R=(S.text+aa)[r]("\n");
for(var aA=0,aF=R[j];
aA<aF;
aA++){var aC=am("tspan");
aA&&am(aC,{dy:aG*f,x:aE.x});
aC[ao](z.createTextNode(R[aA]));
E[ao](aC)
}}else{var R=E.getElementsByTagName("tspan");
for(var aA=0,aF=R[j];
aA<aF;
aA++){aA&&am(R[aA],{dy:aG*f,x:aE.x})
}}am(E,{y:aE.y});
var aB=e.getBBox(),aD=aE.y-(aB.y+aB.height/2);
aD&&isFinite(aD)&&am(E,{y:aE.y+aD})
};
var ad=function(i,e){var R=0,E=0;
this[0]=i;
this.id=Y._oid++;
this.node=i;
i.raphael=this;
this.paper=e;
this.attrs=this.attrs||{};
this.transformations=[];
this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1}
};
ad[az].rotate=function(i,e,R){if(this.removed){return this
}if(i==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy][ae](X)
}return this._.rt.deg
}var E=this.getBBox();
i=(i+aa)[r](a);
if(i[j]-1){e=J(i[1]);
R=J(i[2])
}i=J(i[0]);
if(e!=null){this._.rt.deg=i
}else{this._.rt.deg+=i
}(R==null)&&(e=null);
this._.rt.cx=e;
this._.rt.cy=R;
e=e==null?E.x+E.width/2:e;
R=R==null?E.y+E.height/2:R;
if(this._.rt.deg){this.transformations[0]=Y.format("rotate({0} {1} {2})",this._.rt.deg,e,R);
this.clip&&am(this.clip,{transform:Y.format("rotate({0} {1} {2})",-this._.rt.deg,e,R)})
}else{this.transformations[0]=aa;
this.clip&&am(this.clip,{transform:aa})
}am(this.node,{transform:this.transformations[ae](X)});
return this
};
ad[az].hide=function(){!this.removed&&(this.node.style.display="none");
return this
};
ad[az].show=function(){!this.removed&&(this.node.style.display="");
return this
};
ad[az].remove=function(){this.node.parentNode.removeChild(this.node);
for(var e in this){delete this[e]
}this.removed=true
};
ad[az].getBBox=function(){if(this.removed){return this
}if(this.type=="path"){return H(this.attrs.path)
}if(this.node.style.display=="none"){this.show();
var R=true
}var aC={};
try{aC=this.node.getBBox()
}catch(aA){}finally{aC=aC||{}
}if(this.type=="text"){aC={x:aC.x,y:Infinity,width:0,height:0};
for(var E=0,S=this.node.getNumberOfChars();
E<S;
E++){var aB=this.node.getExtentOfChar(E);
(aB.y<aC.y)&&(aC.y=aB.y);
(aB.y+aB.height-aC.y>aC.height)&&(aC.height=aB.y+aB.height-aC.y);
(aB.x+aB.width-aC.x>aC.width)&&(aC.width=aB.x+aB.width-aC.x)
}}R&&this.hide();
return aC
};
ad[az].attr=function(){if(this.removed){return this
}if(arguments[j]==1&&Y.is(arguments[0],"string")){if(arguments[0]=="translation"){return this.translate()
}if(arguments[0]=="rotation"){return this.rotate()
}if(arguments[0]=="scale"){return this.scale()
}return this.attrs[arguments[0]]
}if(arguments[j]==1&&Y.is(arguments[0],"array")){var e={};
for(var i in arguments[0]){if(arguments[0][F](i)){e[arguments[0][i]]=this.attrs[arguments[0][i]]
}}return e
}if(arguments[j]==2){var E={};
E[arguments[0]]=arguments[1];
M(this,E)
}else{if(arguments[j]==1&&Y.is(arguments[0],"object")){M(this,arguments[0])
}}return this
};
ad[az].toFront=function(){!this.removed&&this.node.parentNode[ao](this.node);
return this
};
ad[az].toBack=function(){if(this.removed){return this
}if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild)
}return this
};
ad[az].insertAfter=function(e){if(this.removed){return this
}if(e.node.nextSibling){e.node.parentNode.insertBefore(this.node,e.node.nextSibling)
}else{e.node.parentNode[ao](this.node)
}return this
};
ad[az].insertBefore=function(e){if(this.removed){return this
}var i=e.node;
i.parentNode.insertBefore(this.node,i);
return this
};
var D=function(i,e,aA,S){e=C(e);
aA=C(aA);
var R=am("circle");
i.canvas&&i.canvas[ao](R);
var E=new ad(R,i);
E.attrs={cx:e,cy:aA,r:S,fill:"none",stroke:"#000"};
E.type="circle";
am(R,E.attrs);
return E
};
var ai=function(E,e,aC,i,aA,aB){e=C(e);
aC=C(aC);
var S=am("rect");
E.canvas&&E.canvas[ao](S);
var R=new ad(S,E);
R.attrs={x:e,y:aC,width:i,height:aA,r:aB||0,rx:aB||0,ry:aB||0,fill:"none",stroke:"#000"};
R.type="rect";
am(S,R.attrs);
return R
};
var U=function(i,e,aB,aA,S){e=C(e);
aB=C(aB);
var R=am("ellipse");
i.canvas&&i.canvas[ao](R);
var E=new ad(R,i);
E.attrs={cx:e,cy:aB,rx:aA,ry:S,fill:"none",stroke:"#000"};
E.type="ellipse";
am(R,E.attrs);
return E
};
var k=function(E,aB,e,aC,i,aA){var S=am("image");
am(S,{x:e,y:aC,width:i,height:aA,preserveAspectRatio:"none"});
S.setAttributeNS(E.xlink,"href",aB);
E.canvas&&E.canvas[ao](S);
var R=new ad(S,E);
R.attrs={x:e,y:aC,width:i,height:aA,src:aB};
R.type="image";
return R
};
var K=function(i,e,aA,S){var R=am("text");
am(R,{x:e,y:aA,"text-anchor":"middle"});
i.canvas&&i.canvas[ao](R);
var E=new ad(R,i);
E.attrs={x:e,y:aA,"text-anchor":"middle",text:S,font:g.font,stroke:"none",fill:"#000"};
E.type="text";
M(E,E.attrs);
return E
};
var aw=function(i,e){this.width=i||this.width;
this.height=e||this.height;
this.canvas[o]("width",this.width);
this.canvas[o]("height",this.height);
return this
};
var p=function(){var R=Z[ax](null,arguments),E=R&&R.container,i=R.x,aC=R.y,S=R.width,e=R.height;
if(!E){throw new Error("SVG container not found.")
}ar.canvas=am("svg");
var aB=ar.canvas;
ar.width=S||512;
ar.height=e||342;
aB[o]("width",ar.width);
aB[o]("height",ar.height);
if(E==1){aB.style.cssText="position:absolute;left:"+i+"px;top:"+aC+"px";
z.body[ao](aB)
}else{if(E.firstChild){E.insertBefore(aB,E.firstChild)
}else{E[ao](aB)
}}E={canvas:aB};
for(var aA in ar){if(ar[F](aA)){E[aA]=ar[aA]
}}aj.call(E,E,Y.fn);
E.clear();
E.raphael=Y;
return E
};
ar.clear=function(){var e=this.canvas;
while(e.firstChild){e.removeChild(e.firstChild)
}(this.desc=am("desc"))[ao](z.createTextNode("Created with Rapha\u00ebl"));
e[ao](this.desc);
e[ao](this.defs=am("defs"))
};
ar.remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);
for(var e in this){delete this[e]
}}
}if(Y.vml){var ak=function(aJ){var aG=/[ahqtv]/ig,aB=n;
(aJ+aa).match(aG)&&(aB=w);
aG=/[clmz]/g;
if(aB==n&&!(aJ+aa).match(aG)){var E={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},S=/([clmz]),?([^clmz]*)/gi,aA=/-?[^,\s-]+/g;
var aF=(aJ+aa)[aq](S,function(aK,aM,i){var aL=[];
i[aq](aA,function(aN){aL[c](C(aN))
});
return E[aM]+aL
});
return aF
}var aH=aB(aJ),R,aF=[],e;
for(var aD=0,aI=aH[j];
aD<aI;
aD++){R=aH[aD];
e=(aH[aD][0]+aa).toLowerCase();
e=="z"&&(e="x");
for(var aC=1,aE=R[j];
aC<aE;
aC++){e+=C(R[aC])+(aC!=aE-1?",":aa)
}aF[c](e)
}return aF[ae](X)
};
Y[af]=function(){return"Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\u00ebl "+this.version
};
var m=function(e,aA){var R=T("group");
R.style.cssText="position:absolute;left:0;top:0;width:"+aA.width+"px;height:"+aA.height+"px";
R.coordsize=aA.coordsize;
R.coordorigin=aA.coordorigin;
var E=T("shape"),i=E.style;
i.width=aA.width+"px";
i.height=aA.height+"px";
E.coordsize=this.coordsize;
E.coordorigin=this.coordorigin;
R[ao](E);
var S=new ad(E,R,aA);
S.isAbsolute=true;
S.type="path";
S.path=[];
S.Path=aa;
e&&M(S,{fill:"none",stroke:"#000",path:e});
aA.canvas[ao](R);
return S
};
var M=function(aE,aI){aE.attrs=aE.attrs||{};
var aG=aE.node,aJ=aE.attrs,aB=aG.style,R,aN=aE;
for(var aC in aI){if(aI[F](aC)){aJ[aC]=aI[aC]
}}aI.href&&(aG.href=aI.href);
aI.title&&(aG.title=aI.title);
aI.target&&(aG.target=aI.target);
if(aI.path&&aE.type=="path"){aJ.path=aI.path;
aG.path=ak(aJ.path)
}if(aI.rotation!=null){aE.rotate(aI.rotation,true)
}if(aI.translation){R=(aI.translation+aa)[r](a);
aE.translate(R[0],R[1])
}if(aI.scale){R=(aI.scale+aa)[r](a);
aE.scale(+R[0]||1,+R[1]||+R[0]||1,+R[2]||null,+R[3]||null)
}if("clip-rect" in aI){var e=(aI["clip-rect"]+aa)[r](a);
if(e[j]==4){e[2]=+e[2]+(+e[0]);
e[3]=+e[3]+(+e[1]);
var aD=aG.clipRect||z.createElement("div"),aM=aD.style,aA=aG.parentNode;
aM.clip=Y.format("rect({1}px {2}px {3}px {0}px)",e);
if(!aG.clipRect){aM.position="absolute";
aM.top=0;
aM.left=0;
aM.width=aE.paper.width+"px";
aM.height=aE.paper.height+"px";
aA.parentNode.insertBefore(aD,aA);
aD[ao](aA);
aG.clipRect=aD
}}if(!aI["clip-rect"]){aG.clipRect&&(aG.clipRect.style.clip=aa)
}}if(aE.type=="image"&&aI.src){aG.src=aI.src
}if(aE.type=="image"&&aI.opacity){aG.filterOpacity=" progid:DXImageTransform.Microsoft.Alpha(opacity="+(aI.opacity*100)+")";
aB.filter=(aG.filterMatrix||aa)+(aG.filterOpacity||aa)
}aI.font&&(aB.font=aI.font);
aI["font-family"]&&(aB.fontFamily='"'+aI["font-family"][r](",")[0][aq](/^['"]+|['"]+$/g,aa)+'"');
aI["font-size"]&&(aB.fontSize=aI["font-size"]);
aI["font-weight"]&&(aB.fontWeight=aI["font-weight"]);
aI["font-style"]&&(aB.fontStyle=aI["font-style"]);
if(aI.opacity!=null||aI["stroke-width"]!=null||aI.fill!=null||aI.stroke!=null||aI["stroke-width"]!=null||aI["stroke-opacity"]!=null||aI["fill-opacity"]!=null||aI["stroke-dasharray"]!=null||aI["stroke-miterlimit"]!=null||aI["stroke-linejoin"]!=null||aI["stroke-linecap"]!=null){aG=aE.shape||aG;
var aH=(aG.getElementsByTagName("fill")&&aG.getElementsByTagName("fill")[0]),aK=false;
!aH&&(aK=aH=T("fill"));
if("fill-opacity" in aI||"opacity" in aI){var i=((+aJ["fill-opacity"]+1||2)-1)*((+aJ.opacity+1||2)-1);
i<0&&(i=0);
i>1&&(i=1);
aH.opacity=i
}aI.fill&&(aH.on=true);
if(aH.on==null||aI.fill=="none"){aH.on=false
}if(aH.on&&aI.fill){var E=aI.fill.match(/^url\(([^\)]+)\)$/i);
if(E){aH.src=E[1];
aH.type="tile"
}else{aH.color=Y.getRGB(aI.fill).hex;
aH.src=aa;
aH.type="solid";
if(Y.getRGB(aI.fill).error&&(aN.type in {circle:1,ellipse:1}||(aI.fill+aa).charAt(0)!="r")&&b(aN,aI.fill)){aJ.fill="none";
aJ.gradient=aI.fill
}}}aK&&aG[ao](aH);
var S=(aG.getElementsByTagName("stroke")&&aG.getElementsByTagName("stroke")[0]),aL=false;
!S&&(aL=S=T("stroke"));
if((aI.stroke&&aI.stroke!="none")||aI["stroke-width"]||aI["stroke-opacity"]!=null||aI["stroke-dasharray"]||aI["stroke-miterlimit"]||aI["stroke-linejoin"]||aI["stroke-linecap"]){S.on=true
}(aI.stroke=="none"||S.on==null||aI.stroke==0||aI["stroke-width"]==0)&&(S.on=false);
S.on&&aI.stroke&&(S.color=Y.getRGB(aI.stroke).hex);
var i=((+aJ["stroke-opacity"]+1||2)-1)*((+aJ.opacity+1||2)-1);
i<0&&(i=0);
i>1&&(i=1);
S.opacity=i;
aI["stroke-linejoin"]&&(S.joinstyle=aI["stroke-linejoin"]||"miter");
S.miterlimit=aI["stroke-miterlimit"]||8;
aI["stroke-linecap"]&&(S.endcap={butt:"flat",square:"square",round:"round"}[aI["stroke-linecap"]]||"miter");
aI["stroke-width"]&&(S.weight=(J(aI["stroke-width"])||1)*12/16);
if(aI["stroke-dasharray"]){var aF={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};
S.dashstyle=aF[aI["stroke-dasharray"]]||aa
}aL&&aG[ao](S)
}if(aN.type=="text"){var aB=aN.paper.span.style;
aJ.font&&(aB.font=aJ.font);
aJ["font-family"]&&(aB.fontFamily=aJ["font-family"]);
aJ["font-size"]&&(aB.fontSize=aJ["font-size"]);
aJ["font-weight"]&&(aB.fontWeight=aJ["font-weight"]);
aJ["font-style"]&&(aB.fontStyle=aJ["font-style"]);
aN.node.string&&(aN.paper.span.innerHTML=(aN.node.string+aa)[aq](/</g,"&#60;")[aq](/&/g,"&#38;")[aq](/\n/g,"<br>"));
aN.W=aJ.w=aN.paper.span.offsetWidth;
aN.H=aJ.h=aN.paper.span.offsetHeight;
aN.X=aJ.x;
aN.Y=aJ.y+C(aN.H/2);
switch(aJ["text-anchor"]){case"start":aN.node.style["v-text-align"]="left";
aN.bbx=C(aN.W/2);
break;
case"end":aN.node.style["v-text-align"]="right";
aN.bbx=-C(aN.W/2);
break;
default:aN.node.style["v-text-align"]="center";
break
}}};
var b=function(e,aC){e.attrs=e.attrs||{};
var aD=e.attrs,aF=e.node.getElementsByTagName("fill"),aA="linear",aB=".5 .5";
e.attrs.gradient=aC;
aC=(aC+aa)[aq](/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/,function(aH,aI,i){aA="radial";
if(aI&&i){aI=J(aI);
i=J(i);
if(ap(aI-0.5,2)+ap(i-0.5,2)>0.25){i=Math.sqrt(0.25-ap(aI-0.5,2))+0.5
}aB=aI+X+i
}return aa
});
aC=aC[r](/\s*\-\s*/);
if(aA=="linear"){var E=aC.shift();
E=-J(E);
if(isNaN(E)){return null
}}var S=l(aC);
if(!S){return null
}e=e.shape||e.node;
aF=aF[0]||T("fill");
if(S[j]){aF.on=true;
aF.method="none";
aF.type=(aA=="radial")?"gradientradial":"gradient";
aF.color=S[0].color;
aF.color2=S[S[j]-1].color;
var aG=[];
for(var R=0,aE=S[j];
R<aE;
R++){S[R].offset&&aG[c](S[R].offset+X+S[R].color)
}aF.colors.value=aG[j]?aG[ae](","):"0% "+aF.color;
if(aA=="radial"){aF.focus="100%";
aF.focussize=aB;
aF.focusposition=aB
}else{aF.angle=(270-E)%360
}}return 1
};
var ad=function(S,aB,e){var aA=0,E=0,i=0,R=1;
this[0]=S;
this.id=Y._oid++;
this.node=S;
S.raphael=this;
this.X=0;
this.Y=0;
this.attrs={};
this.Group=aB;
this.paper=e;
this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1}
};
ad[az].rotate=function(i,e,E){if(this.removed){return this
}if(i==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy][ae](X)
}return this._.rt.deg
}i=(i+aa)[r](a);
if(i[j]-1){e=J(i[1]);
E=J(i[2])
}i=J(i[0]);
if(e!=null){this._.rt.deg=i
}else{this._.rt.deg+=i
}E==null&&(e=null);
this._.rt.cx=e;
this._.rt.cy=E;
this.setBox(this.attrs,e,E);
this.Group.style.rotation=this._.rt.deg;
return this
};
ad[az].setBox=function(aA,aB,S){if(this.removed){return this
}var E=this.Group.style,aC=(this.shape&&this.shape.style)||this.node.style;
aA=aA||{};
for(var aD in aA){if(aA[F](aD)){this.attrs[aD]=aA[aD]
}}aB=aB||this._.rt.cx;
S=S||this._.rt.cy;
var aG=this.attrs,aJ,aI,aK,aF;
switch(this.type){case"circle":aJ=aG.cx-aG.r;
aI=aG.cy-aG.r;
aK=aF=aG.r*2;
break;
case"ellipse":aJ=aG.cx-aG.rx;
aI=aG.cy-aG.ry;
aK=aG.rx*2;
aF=aG.ry*2;
break;
case"rect":case"image":aJ=+aG.x;
aI=+aG.y;
aK=aG.width||0;
aF=aG.height||0;
break;
case"text":this.textpath.v=["m",C(aG.x),", ",C(aG.y-2),"l",C(aG.x)+1,", ",C(aG.y-2)][ae](aa);
aJ=aG.x-C(this.W/2);
aI=aG.y-this.H/2;
aK=this.W;
aF=this.H;
break;
case"path":if(!this.attrs.path){aJ=0;
aI=0;
aK=this.paper.width;
aF=this.paper.height
}else{var aE=H(this.attrs.path);
aJ=aE.x;
aI=aE.y;
aK=aE.width;
aF=aE.height
}break;
default:aJ=0;
aI=0;
aK=this.paper.width;
aF=this.paper.height;
break
}aB=(aB==null)?aJ+aK/2:aB;
S=(S==null)?aI+aF/2:S;
var R=aB-this.paper.width/2,aH=S-this.paper.height/2;
if(this.type=="path"||this.type=="text"){(E.left!=R+"px")&&(E.left=R+"px");
(E.top!=aH+"px")&&(E.top=aH+"px");
this.X=this.type=="text"?aJ:-R;
this.Y=this.type=="text"?aI:-aH;
this.W=aK;
this.H=aF;
(aC.left!=-R+"px")&&(aC.left=-R+"px");
(aC.top!=-aH+"px")&&(aC.top=-aH+"px")
}else{(E.left!=R+"px")&&(E.left=R+"px");
(E.top!=aH+"px")&&(E.top=aH+"px");
this.X=aJ;
this.Y=aI;
this.W=aK;
this.H=aF;
(E.width!=this.paper.width+"px")&&(E.width=this.paper.width+"px");
(E.height!=this.paper.height+"px")&&(E.height=this.paper.height+"px");
(aC.left!=aJ-R+"px")&&(aC.left=aJ-R+"px");
(aC.top!=aI-aH+"px")&&(aC.top=aI-aH+"px");
(aC.width!=aK+"px")&&(aC.width=aK+"px");
(aC.height!=aF+"px")&&(aC.height=aF+"px");
var aL=(+aA.r||0)/(al(aK,aF));
if(this.type=="rect"&&this.arcsize!=aL&&(aL||this.arcsize)){var e=T(aL?"roundrect":"rect");
e.arcsize=aL;
this.Group[ao](e);
this.node.parentNode.removeChild(this.node);
this.node=e;
this.arcsize=aL;
this.attr(this.attrs)
}}};
ad[az].hide=function(){!this.removed&&(this.Group.style.display="none");
return this
};
ad[az].show=function(){!this.removed&&(this.Group.style.display="block");
return this
};
ad[az].getBBox=function(){if(this.removed){return this
}if(this.type=="path"){return H(this.attrs.path)
}return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}
};
ad[az].remove=function(){this.node.parentNode.removeChild(this[0]);
this.Group.parentNode.removeChild(this.Group);
this.shape&&this.shape.parentNode.removeChild(this.shape);
for(var e in this){delete this[e]
}this.removed=true
};
ad[az].attr=function(){if(this.removed){return this
}if(arguments[j]==1&&Y.is(arguments[0],"string")){if(arguments[0]=="translation"){return this.translate()
}if(arguments[0]=="rotation"){return this.rotate()
}if(arguments[0]=="scale"){return this.scale()
}return this.attrs[arguments[0]]
}if(this.attrs&&arguments[j]==1&&Y.is(arguments[0],"array")){var e={};
for(var E=0,R=arguments[0][j];
E<R;
E++){e[arguments[0][E]]=this.attrs[arguments[0][E]]
}return e
}var S;
if(arguments[j]==2){S={};
S[arguments[0]]=arguments[1]
}arguments[j]==1&&Y.is(arguments[0],"object")&&(S=arguments[0]);
if(S){if(S.text&&this.type=="text"){this.node.string=S.text
}M(this,S);
if(S.gradient&&({circle:1,ellipse:1}[F](this.type)||(S.gradient+aa).charAt(0)!="r")){b(this,S.gradient)
}this.setBox(this.attrs)
}return this
};
ad[az].toFront=function(){!this.removed&&this.Group.parentNode[ao](this.Group);
return this
};
ad[az].toBack=function(){if(this.removed){return this
}if(this.Group.parentNode.firstChild!=this.Group){this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild)
}return this
};
ad[az].insertAfter=function(e){if(this.removed){return this
}if(e.Group.nextSibling){e.Group.parentNode.insertBefore(this.Group,e.Group.nextSibling)
}else{e.Group.parentNode[ao](this.Group)
}return this
};
ad[az].insertBefore=function(e){!this.removed&&e.Group.parentNode.insertBefore(this.Group,e.Group);
return this
};
var D=function(i,e,aC,aA){var S=T("group"),aB=T("oval"),E=aB.style;
S.style.cssText="position:absolute;left:0;top:0;width:"+i.width+"px;height:"+i.height+"px";
S.coordsize=i.coordsize;
S.coordorigin=i.coordorigin;
S[ao](aB);
var R=new ad(aB,S,i);
R.type="circle";
M(R,{stroke:"#000",fill:"none"});
R.attrs.cx=e;
R.attrs.cy=aC;
R.attrs.r=aA;
R.setBox({x:e-aA,y:aC-aA,width:aA*2,height:aA*2});
i.canvas[ao](S);
return R
};
var ai=function(i,aC,aB,aD,R,e){var S=T("group"),E=T(e?"roundrect":"rect"),aE=(+e||0)/(al(aD,R));
E.arcsize=aE;
S.style.cssText="position:absolute;left:0;top:0;width:"+i.width+"px;height:"+i.height+"px";
S.coordsize=i.coordsize;
S.coordorigin=i.coordorigin;
S[ao](E);
var aA=new ad(E,S,i);
aA.type="rect";
M(aA,{stroke:"#000"});
aA.arcsize=aE;
aA.setBox({x:aC,y:aB,width:aD,height:R,r:+e});
i.canvas[ao](S);
return aA
};
var U=function(e,aD,aC,E,i){var S=T("group"),R=T("oval"),aB=R.style;
S.style.cssText="position:absolute;left:0;top:0;width:"+e.width+"px;height:"+e.height+"px";
S.coordsize=e.coordsize;
S.coordorigin=e.coordorigin;
S[ao](R);
var aA=new ad(R,S,e);
aA.type="ellipse";
M(aA,{stroke:"#000"});
aA.attrs.cx=aD;
aA.attrs.cy=aC;
aA.attrs.rx=E;
aA.attrs.ry=i;
aA.setBox({x:aD-E,y:aC-i,width:E*2,height:i*2});
e.canvas[ao](S);
return aA
};
var k=function(i,e,aD,aC,aE,R){var S=T("group"),E=T("image"),aB=E.style;
S.style.cssText="position:absolute;left:0;top:0;width:"+i.width+"px;height:"+i.height+"px";
S.coordsize=i.coordsize;
S.coordorigin=i.coordorigin;
E.src=e;
S[ao](E);
var aA=new ad(E,S,i);
aA.type="image";
aA.attrs.src=e;
aA.attrs.x=aD;
aA.attrs.y=aC;
aA.attrs.w=aE;
aA.attrs.h=R;
aA.setBox({x:aD,y:aC,width:aE,height:R});
i.canvas[ao](S);
return aA
};
var K=function(i,aD,aC,aE){var S=T("group"),R=T("shape"),aB=R.style,aF=T("path"),e=aF.style,E=T("textpath");
S.style.cssText="position:absolute;left:0;top:0;width:"+i.width+"px;height:"+i.height+"px";
S.coordsize=i.coordsize;
S.coordorigin=i.coordorigin;
aF.v=Y.format("m{0},{1}l{2},{1}",C(aD),C(aC),C(aD)+1);
aF.textpathok=true;
aB.width=i.width;
aB.height=i.height;
E.string=aE+aa;
E.on=true;
R[ao](E);
R[ao](aF);
S[ao](R);
var aA=new ad(E,S,i);
aA.shape=R;
aA.textpath=aF;
aA.type="text";
aA.attrs.text=aE;
aA.attrs.x=aD;
aA.attrs.y=aC;
aA.attrs.w=1;
aA.attrs.h=1;
M(aA,{font:g.font,stroke:"none",fill:"#000"});
aA.setBox();
i.canvas[ao](S);
return aA
};
var aw=function(E,e){var i=this.canvas.style;
this.width=J(E||this.width);
this.height=J(e||this.height);
i.width=this.width+"px";
i.height=this.height+"px";
i.clip="rect(0 "+this.width+"px "+this.height+"px 0)";
this.coordsize=this.width+X+this.height;
return this
};
z.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");
try{!z.namespaces.rvml&&z.namespaces.add("rvml","urn:schemas-microsoft-com:vml");
var T=function(e){return z.createElement("<rvml:"+e+' class="rvml">')
}
}catch(P){var T=function(e){return z.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')
}
}var p=function(){var R=Z[ax](null,arguments),i=R.container,aE=R.height,aF,E=R.width,aD=R.x,aC=R.y;
if(!i){throw new Error("VML container not found.")
}var aA={},aB=aA.canvas=z.createElement("div"),S=aB.style;
E=J(E)||512;
aE=J(aE)||342;
aA.width=E;
aA.height=aE;
aA.coordsize=E+X+aE;
aA.coordorigin="0 0";
aA.span=z.createElement("span");
aA.span.style.cssText="position:absolute;left:-9999px;top:-9999px;padding:0;margin:0;line-height:1;display:inline;";
aB[ao](aA.span);
S.cssText=Y.format("width:{0}px;height:{1}px;position:absolute;clip:rect(0 {0}px {1}px 0)",E,aE);
if(i==1){z.body[ao](aB);
S.left=aD+"px";
S.top=aC+"px";
i={style:{width:E,height:aE}}
}else{i.style.width=E;
i.style.height=aE;
if(i.firstChild){i.insertBefore(aB,i.firstChild)
}else{i[ao](aB)
}}for(var e in ar){if(ar[F](e)){aA[e]=ar[e]
}}aj.call(aA,aA,Y.fn);
aA.clear=function(){aB.innerHTML=aa
};
aA.raphael=Y;
return aA
};
ar.remove=function(){this.canvas.parentNode.removeChild(this.canvas);
for(var e in this){delete this[e]
}}
}if({"Apple Computer, Inc.":1,"Google Inc.":1}[navigator.vendor]){ar.safari=function(){var e=this.rect(-99,-99,this.width+99,this.height+99);
setTimeout(function(){e.remove()
})
}
}else{ar.safari=function(){}
}var Q=(function(){if(z.addEventListener){return function(S,E,i,e){var R=function(aA){return i.call(e,aA)
};
S.addEventListener(E,R,false);
return function(){S.removeEventListener(E,R,false);
return true
}
}
}else{if(z.attachEvent){return function(aA,R,E,i){var S=function(aB){return E.call(i,aB||ab.event)
};
aA.attachEvent("on"+R,S);
var e=function(){aA.detachEvent("on"+R,S);
return true
};
if(R=="mouseover"){aA.attachEvent("onmouseenter",S);
return function(){aA.detachEvent("onmouseenter",S);
return e()
}
}else{if(R=="mouseout"){aA.attachEvent("onmouseleave",S);
return function(){aA.detachEvent("onmouseleave",S);
return e()
}
}}return e
}
}}})();
for(var N=u[j];
N--;
){(function(e){ad[az][e]=function(i){if(Y.is(i,"function")){this.events=this.events||{};
this.events[e]=this.events[e]||{};
this.events[e][i]=this.events[e][i]||[];
this.events[e][i][c](Q(this.shape||this.node,e,i,this))
}return this
};
ad[az]["un"+e]=function(i){var E=this.events;
E&&E[e]&&E[e][i]&&E[e][i][j]&&E[e][i].shift()()&&!E[e][i][j]&&delete E[e][i];
return this
}
})(u[N])
}ad[az].hover=function(i,e){return this.mouseover(i).mouseout(e)
};
ar.circle=function(e,E,i){return D(this,e||0,E||0,i||0)
};
ar.rect=function(e,S,i,E,R){return ai(this,e||0,S||0,i||0,E||0,R||0)
};
ar.ellipse=function(e,R,E,i){return U(this,e||0,R||0,E||0,i||0)
};
ar.path=function(e){e&&!Y.is(e,"string")&&!Y.is(e[0],"array")&&(e+=aa);
return m(Y.format[ax](Y,arguments),this)
};
ar.image=function(R,e,S,i,E){return k(this,R||"about:blank",e||0,S||0,i||0,E||0)
};
ar.text=function(e,E,i){return K(this,e||0,E||0,i||aa)
};
ar.set=function(e){arguments[j]>1&&(e=Array[az].splice.call(arguments,0,arguments[j]));
return new G(e)
};
ar.setSize=aw;
ad[az].scale=function(aJ,aI,R,E){if(aJ==null&&aI==null){return{x:this._.sx,y:this._.sy,toString:function(){return this.x+X+this.y
}}
}aI=aI||aJ;
!+aI&&(aI=aJ);
var aN,aL,aM,aK,aZ=this.attrs;
if(aJ!=0){var aG=this.getBBox(),aD=aG.x+aG.width/2,aA=aG.y+aG.height/2,aY=aJ/this._.sx,aX=aI/this._.sy;
R=(+R||R==0)?R:aD;
E=(+E||E==0)?E:aA;
var aF=~~(aJ/Math.abs(aJ)),aC=~~(aI/Math.abs(aI)),aQ=this.node.style,a1=R+(aD-R)*aF*aY,a0=E+(aA-E)*aC*aX;
switch(this.type){case"rect":case"image":var aE=aZ.width*aF*aY,aP=aZ.height*aC*aX,aH=aZ.r*al(aY,aX),aB=a1-aE/2,S=a0-aP/2;
this.attr({width:aE,height:aP,x:aB,y:S,r:aH});
break;
case"circle":case"ellipse":this.attr({rx:aZ.rx*aY,ry:aZ.ry*aX,r:aZ.r*al(aY,aX),cx:a1,cy:a0});
break;
case"path":var aS=O(aZ.path),aT=true;
for(var aV=0,aO=aS[j];
aV<aO;
aV++){var aR=aS[aV];
if(aR[0].toUpperCase()=="M"&&aT){continue
}else{aT=false
}if(Y.svg&&aR[0].toUpperCase()=="A"){aR[aS[aV][j]-2]*=aY;
aR[aS[aV][j]-1]*=aX;
aR[1]*=aY;
aR[2]*=aX;
aR[5]=+(aF+aC?!!+aR[5]:!+aR[5])
}else{for(var aU=1,aW=aR[j];
aU<aW;
aU++){aR[aU]*=(aU%2)?aY:aX
}}}var e=H(aS),aN=a1-e.x-e.width/2,aL=a0-e.y-e.height/2;
aS[0][1]+=aN;
aS[0][2]+=aL;
this.attr({path:aS});
break
}if(this.type in {text:1,image:1}&&(aF!=1||aC!=1)){if(this.transformations){this.transformations[2]="scale("[au](aF,",",aC,")");
this.node[o]("transform",this.transformations[ae](X));
aN=(aF==-1)?-aZ.x-(aE||0):aZ.x;
aL=(aC==-1)?-aZ.y-(aP||0):aZ.y;
this.attr({x:aN,y:aL});
aZ.fx=aF-1;
aZ.fy=aC-1
}else{this.node.filterMatrix=" progid:DXImageTransform.Microsoft.Matrix(M11="[au](aF,", M12=0, M21=0, M22=",aC,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')");
aQ.filter=(this.node.filterMatrix||aa)+(this.node.filterOpacity||aa)
}}else{if(this.transformations){this.transformations[2]=aa;
this.node[o]("transform",this.transformations[ae](X));
aZ.fx=0;
aZ.fy=0
}else{this.node.filterMatrix=aa;
aQ.filter=(this.node.filterMatrix||aa)+(this.node.filterOpacity||aa)
}}aZ.scale=[aJ,aI,R,E][ae](X);
this._.sx=aJ;
this._.sy=aI
}return this
};
Y.easing_formulas={linear:function(e){return e
},"<":function(e){return ap(e,3)
},">":function(e){return ap(e-1,3)+1
},"<>":function(e){e=e*2;
if(e<1){return ap(e,3)/2
}e-=2;
return(ap(e,3)+2)/2
},backIn:function(i){var e=1.70158;
return i*i*((e+1)*i-e)
},backOut:function(i){i=i-1;
var e=1.70158;
return i*i*((e+1)*i+e)+1
},elastic:function(E){if(E==0||E==1){return E
}var i=0.3,e=i/4;
return ap(2,-10*E)*Math.sin((E-e)*(2*Math.PI)/i)+1
},bounce:function(R){var i=7.5625,E=2.75,e;
if(R<(1/E)){e=i*R*R
}else{if(R<(2/E)){R-=(1.5/E);
e=i*R*R+0.75
}else{if(R<(2.5/E)){R-=(2.25/E);
e=i*R*R+0.9375
}else{R-=(2.625/E);
e=i*R*R+0.984375
}}}return e
}};
var x={length:0},at=function(){var aD=+new Date;
for(var aO in x){if(aO!="length"&&x[F](aO)){var aT=x[aO];
if(aT.stop){delete x[aO];
x[j]--;
continue
}var aB=aD-aT.start,aM=aT.ms,aL=aT.easing,aP=aT.from,aI=aT.diff,R=aT.to,aH=aT.t,aK=aT.prev||0,aC=aT.el,S=aT.callback,aJ={},E;
if(aB<aM){var aA=Y.easing_formulas[aL]?Y.easing_formulas[aL](aB/aM):aB/aM;
for(var aN in aP){if(aP[F](aN)){switch(L[aN]){case"number":E=+aP[aN]+aA*aM*aI[aN];
break;
case"colour":E="rgb("+[s(C(aP[aN].r+aA*aM*aI[aN].r)),s(C(aP[aN].g+aA*aM*aI[aN].g)),s(C(aP[aN].b+aA*aM*aI[aN].b))][ae](",")+")";
break;
case"path":E=[];
for(var aR=0,aG=aP[aN][j];
aR<aG;
aR++){E[aR]=[aP[aN][aR][0]];
for(var aQ=1,aS=aP[aN][aR][j];
aQ<aS;
aQ++){E[aR][aQ]=+aP[aN][aR][aQ]+aA*aM*aI[aN][aR][aQ]
}E[aR]=E[aR][ae](X)
}E=E[ae](X);
break;
case"csv":switch(aN){case"translation":var aF=aI[aN][0]*(aB-aK),aE=aI[aN][1]*(aB-aK);
aH.x+=aF;
aH.y+=aE;
E=aF+X+aE;
break;
case"rotation":E=+aP[aN][0]+aA*aM*aI[aN][0];
aP[aN][1]&&(E+=","+aP[aN][1]+","+aP[aN][2]);
break;
case"scale":E=[+aP[aN][0]+aA*aM*aI[aN][0],+aP[aN][1]+aA*aM*aI[aN][1],(2 in R[aN]?R[aN][2]:aa),(3 in R[aN]?R[aN][3]:aa)][ae](X);
break;
case"clip-rect":E=[];
var aR=4;
while(aR--){E[aR]=+aP[aN][aR]+aA*aM*aI[aN][aR]
}break
}break
}aJ[aN]=E
}}aC.attr(aJ);
aC._run&&aC._run.call(aC)
}else{(aH.x||aH.y)&&aC.translate(-aH.x,-aH.y);
R.scale&&(R.scale=R.scale+aa);
aC.attr(R);
Y.is(S,"function")&&S.call(aC);
delete x[aO];
x[j]--;
aC.in_animation=null
}aT.prev=aB
}}Y.svg&&ar.safari();
x[j]&&setTimeout(at)
},s=function(e){return e>255?255:(e<0?0:e)
};
ad[az].animateWith=function(i,E,e,S,R){x[i.id]&&(E.start=x[i.id].start);
return this.animate(E,e,S,R)
};
ad[az].onAnimation=function(e){this._run=e||null;
return this
};
ad[az].animate=function(R,e,aF,aL){if(Y.is(aF,"function")||!aF){aL=aF||null
}var aG={},aH={},aI={};
for(var aE in R){if(R[F](aE)){if(L[F](aE)){aG[aE]=this.attr(aE);
(aG[aE]==null)&&(aG[aE]=g[aE]);
aH[aE]=R[aE];
switch(L[aE]){case"number":aI[aE]=(aH[aE]-aG[aE])/e;
break;
case"colour":aG[aE]=Y.getRGB(aG[aE]);
var aC=Y.getRGB(aH[aE]);
aI[aE]={r:(aC.r-aG[aE].r)/e,g:(aC.g-aG[aE].g)/e,b:(aC.b-aG[aE].b)/e};
break;
case"path":var E=w(aG[aE],aH[aE]);
aG[aE]=E[0];
aH[aE]=E[1];
aI[aE]=[];
for(var aB=0,aK=aG[aE][j];
aB<aK;
aB++){aI[aE][aB]=[0];
for(var S=1,aD=aG[aE][aB][j];
S<aD;
S++){aI[aE][aB][S]=(aH[aE][aB][S]-aG[aE][aB][S])/e
}}break;
case"csv":var aJ=(R[aE]+aa)[r](a),aA=(aG[aE]+aa)[r](a);
switch(aE){case"translation":aG[aE]=[0,0];
aI[aE]=[aJ[0]/e,aJ[1]/e];
break;
case"rotation":aG[aE]=(aA[1]==aJ[1]&&aA[2]==aJ[2])?aA:[0,aJ[1],aJ[2]];
aI[aE]=[(aJ[0]-aG[aE][0])/e,0,0];
break;
case"scale":R[aE]=aJ;
aG[aE]=(aG[aE]+aa)[r](a);
aI[aE]=[(aJ[0]-aG[aE][0])/e,(aJ[1]-aG[aE][1])/e,0,0];
break;
case"clip-rect":aG[aE]=(aG[aE]+aa)[r](a);
aI[aE]=[];
var aB=4;
while(aB--){aI[aE][aB]=(aJ[aB]-aG[aE][aB])/e
}break
}aH[aE]=aJ
}}}}this.stop();
this.in_animation=1;
x[this.id]={start:R.start||+new Date,ms:e,easing:aF,from:aG,diff:aI,to:aH,el:this,callback:aL,t:{x:0,y:0}};
++x[j]==1&&at();
return this
};
ad[az].stop=function(){delete x[this.id];
delete this.in_animation;
return this
};
ad[az].translate=function(e,E){if(e==null){return{x:this._.tx,y:this._.ty}
}this._.tx+=+e;
this._.ty+=+E;
switch(this.type){case"circle":case"ellipse":this.attr({cx:+e+this.attrs.cx,cy:+E+this.attrs.cy});
break;
case"rect":case"image":case"text":this.attr({x:+e+this.attrs.x,y:+E+this.attrs.y});
break;
case"path":var i=O(this.attrs.path);
i[0][1]+=+e;
i[0][2]+=+E;
this.attr({path:i});
break
}return this
};
ad[az][af]=function(){return"Rapha\u00ebl\u2019s object"
};
Y.ae=x;
var G=function(e){this.items=[];
this[j]=0;
if(e){for(var E=0,R=e[j];
E<R;
E++){if(e[E]&&(e[E].constructor==ad||e[E].constructor==G)){this[this.items[j]]=this.items[this.items[j]]=e[E];
this[j]++
}}}};
G[az][c]=function(){var S,e;
for(var E=0,R=arguments[j];
E<R;
E++){S=arguments[E];
if(S&&(S.constructor==ad||S.constructor==G)){e=this.items[j];
this[e]=this.items[e]=S;
this[j]++
}}return this
};
G[az].pop=function(){delete this[this[j]--];
return this.items.pop()
};
for(var q in ad[az]){if(ad[az][F](q)){G[az][q]=(function(e){return function(){for(var E=0,R=this.items[j];
E<R;
E++){this.items[E][e][ax](this.items[E],arguments)
}return this
}
})(q)
}}G[az].attr=function(E,aB){if(E&&Y.is(E,"array")&&Y.is(E[0],"object")){for(var e=0,aA=E[j];
e<aA;
e++){this.items[e].attr(E[e])
}}else{for(var R=0,S=this.items[j];
R<S;
R++){this.items[R].attr[ax](this.items[R],arguments)
}}return this
};
G[az].animate=function(aA,E,aD,aC){(Y.is(aD,"function")||!aD)&&(aC=aD||null);
var e=this.items[j],R=e,aB=this,S;
aC&&(S=function(){!--e&&aC.call(aB)
});
this.items[--R].animate(aA,E,aD||S,S);
while(R--){this.items[R].animateWith(this.items[e-1],aA,E,aD||S,S)
}return this
};
G[az].insertAfter=function(E){var e=this.items[j];
while(e--){this.items[e].insertAfter(E)
}};
G[az].getBBox=function(){var e=[],aB=[],E=[],S=[];
for(var R=this.items[j];
R--;
){var aA=this.items[R].getBBox();
e[c](aA.x);
aB[c](aA.y);
E[c](aA.x+aA.width);
S[c](aA.y+aA.height)
}e=al[ax](0,e);
aB=al[ax](0,aB);
return{x:e,y:aB,width:d[ax](0,E)-e,height:d[ax](0,S)-aB}
};
Y.registerFont=function(i){if(!i.face){return i
}this.fonts=this.fonts||{};
var R={w:i.w,face:{},glyphs:{}},E=i.face["font-family"];
for(var aB in i.face){if(i.face[F](aB)){R.face[aB]=i.face[aB]
}}if(this.fonts[E]){this.fonts[E][c](R)
}else{this.fonts[E]=[R]
}if(!i.svg){R.face["units-per-em"]=v(i.face["units-per-em"],10);
for(var S in i.glyphs){if(i.glyphs[F](S)){var aA=i.glyphs[S];
R.glyphs[S]={w:aA.w,k:{},d:aA.d&&"M"+aA.d[aq](/[mlcxtrv]/g,function(aC){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[aC]||"M"
})+"z"};
if(aA.k){for(var e in aA.k){if(aA[F](e)){R.glyphs[S].k[e]=aA.k[e]
}}}}}}return i
};
ar.getFont=function(aD,aE,E,S){S=S||"normal";
E=E||"normal";
aE=+aE||{normal:400,bold:700,lighter:300,bolder:800}[aE]||400;
var aA=Y.fonts[aD];
if(!aA){var R=new RegExp("(^|\\s)"+aD[aq](/[^\w\d\s+!~.:_-]/g,aa)+"(\\s|$)","i");
for(var e in Y.fonts){if(Y.fonts[F](e)){if(R.test(e)){aA=Y.fonts[e];
break
}}}}var aB;
if(aA){for(var aC=0,aF=aA[j];
aC<aF;
aC++){aB=aA[aC];
if(aB.face["font-weight"]==aE&&(aB.face["font-style"]==E||!aB.face["font-style"])&&aB.face["font-stretch"]==S){break
}}}return aB
};
ar.print=function(aF,aE,aC,E,aJ){var aA=this.set(),aD=(aC+aa)[r](aa),e=0,aI=aa,S;
Y.is(E,"string")&&(E=this.getFont(E));
if(E){S=(aJ||16)/E.face["units-per-em"];
for(var aB=0,aG=aD[j];
aB<aG;
aB++){var R=aB&&E.glyphs[aD[aB-1]]||{},aH=E.glyphs[aD[aB]];
e+=aB?(R.w||E.w)+(R.k&&R.k[aD[aB]]||0):0;
aH&&aH.d&&aA[c](this.path(aH.d).attr({fill:"#000",stroke:"none",translation:[e,0]}))
}aA.scale(S,S,0,aE).translate(aF,(aJ||16)/2)
}return aA
};
Y.format=function(E){var i=Y.is(arguments[1],"array")?[0][au](arguments[1]):arguments,e=/\{(\d+)\}/g;
E&&Y.is(E,"string")&&i[j]-1&&(E=E[aq](e,function(S,R){return i[++R]==null?aa:i[R]
}));
return E||aa
};
Y.ninja=function(){var E=ab.Raphael,i;
if(h.was){ab.Raphael=h.is
}else{try{delete ab.Raphael
}catch(R){ab.Raphael=i
}}return E
};
Y.el=ad[az];
return Y
})();
var addToMyRecordingsLoader=function(d){d=jQuery(d);
var a=d.tooltip({relative:true,effect:"slide"}).data("tooltip");
var e=function(f,h,g){if(f){jQuery(".tooltip.atmr").text("This recording has been added to your My Recordings bookshelf.");
jQuery(".tooltip.rfmr").text("Click to remove this recording from your My Recordings bookshelf.");
jQuery("#add_to_myrecordings").hide();
jQuery("#remove_from_myrecordings").show()
}else{jQuery(".tooltip.atmr").text("This recording has already been added to your My Recordings bookshelf.")
}};
var c=function(h,f,g){jQuery(".tooltip.atmr").text("Oops. Try again. If this continues, let us know.")
};
var b=function(){jQuery(".tooltip.atmr").text("requesting...");
jQuery.ajax({success:e,error:c,url:favorite_reading_path,type:"POST"})
};
d.click(b)
};
var removeFromMyRecordingsLoader=function(a){a=jQuery(a);
var b=a.tooltip({relative:true,effect:"slide"}).data("tooltip");
var e=function(g,h,f){if(g){jQuery(".tooltip.rfmr").text("This recording has been removed from your My Recordings bookshelf.");
jQuery(".tooltip.atmr").text("Click to add this recording to your My Recordings bookshelf.");
jQuery("#remove_from_myrecordings").hide();
jQuery("#add_to_myrecordings").show()
}else{jQuery(".tooltip.rfmr").text("This recording has already been removed to your My Recordings bookshelf.")
}};
var d=function(h,f,g){jQuery(".tooltip.rfmr").text("Oops. Try again. If this continues, let us know.")
};
var c=function(){jQuery(".tooltip.rfmr").text("requesting...");
jQuery.ajax({success:e,error:d,url:reading_path,type:"DELETE"})
};
a.click(c)
};
var emailRecordingLoader=function(d){d=jQuery(d);
var a=function(f,i,g){e.find("input,button").removeAttr("disabled");
var h=jQuery.parseJSON(f.responseText);
e.find("#error").text(h).show()
};
var c=function(g,h,f){e.find("input,button").removeAttr("disabled");
b.dialog("close")
};
var e=d.find(".form");
e.submit(function(){data=e.serializeArray();
for(var g=0;
g<data.length;
g++){var f=data[g];
var h=e.find("[name="+f.name+"]")[0];
f.value=AutoLabel.getValue(h)
}e.find("input,button").attr("disabled","disabled");
e.find("#error").hide();
jQuery.ajax({type:"POST",url:email_reading_path,data:data,error:a,success:c});
return false
});
var b=e.dialog({autoOpen:false,width:500,modal:true,resizable:false,title:"Send this recording to a friend"});
d.click(function(){modal=jQuery("#verification_modal");
if(modal.length>0){jQuery.ajax({url:"/verification/mail",type:"POST"});
modal.dialog("open");
return
}e.find("input,button").removeAttr("disabled");
e.find("input").val("");
e.find("#error").hide();
b.dialog("open");
AutoLabel.load();
e.find("button").focus()
})
};
var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;
var a=Object.prototype.toString.call(window.opera)=="[object Opera]";
return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}
})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;
return !!(a&&a.prototype)
})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true
}var c=document.createElement("div");
var b=document.createElement("form");
var a=false;
if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true
}c=b=null;
return a
})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a
}};
if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false
}var Abstract={};
var Try={these:function(){var c;
for(var b=0,d=arguments.length;
b<d;
b++){var a=arguments[b];
try{c=a();
break
}catch(f){}}return c
}};
var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);
if(Object.isFunction(f[0])){g=f.shift()
}function d(){this.initialize.apply(this,arguments)
}Object.extend(d,Class.Methods);
d.superclass=g;
d.subclasses=[];
if(g){a.prototype=g.prototype;
d.prototype=new a;
g.subclasses.push(d)
}for(var e=0;
e<f.length;
e++){d.addMethods(f[e])
}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction
}d.prototype.constructor=d;
return d
}function c(k){var f=this.superclass&&this.superclass.prototype;
var e=Object.keys(k);
if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")
}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")
}}for(var d=0,g=e.length;
d<g;
d++){var j=e[d],h=k[j];
if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;
h=(function(i){return function(){return f[i].apply(this,arguments)
}
})(j).wrap(l);
h.valueOf=l.valueOf.bind(l);
h.toString=l.toString.bind(l)
}this.prototype[j]=h
}return this
}return{create:b,Methods:{addMethods:c}}
})();
(function(){var d=Object.prototype.toString;
function i(q,s){for(var r in s){q[r]=s[r]
}return q
}function l(q){try{if(e(q)){return"undefined"
}if(q===null){return"null"
}return q.inspect?q.inspect():String(q)
}catch(r){if(r instanceof RangeError){return"..."
}throw r
}}function k(q){var s=typeof q;
switch(s){case"undefined":case"function":case"unknown":return;
case"boolean":return q.toString()
}if(q===null){return"null"
}if(q.toJSON){return q.toJSON()
}if(h(q)){return
}var r=[];
for(var u in q){var t=k(q[u]);
if(!e(t)){r.push(u.toJSON()+": "+t)
}}return"{"+r.join(", ")+"}"
}function c(q){return $H(q).toQueryString()
}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)
}function o(q){var r=[];
for(var s in q){r.push(s)
}return r
}function m(q){var r=[];
for(var s in q){r.push(q[s])
}return r
}function j(q){return i({},q)
}function h(q){return !!(q&&q.nodeType==1)
}function g(q){return d.call(q)=="[object Array]"
}function p(q){return q instanceof Hash
}function b(q){return typeof q==="function"
}function a(q){return d.call(q)=="[object String]"
}function n(q){return d.call(q)=="[object Number]"
}function e(q){return typeof q==="undefined"
}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})
})();
Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;
function d(o,l){var n=o.length,m=l.length;
while(m--){o[n+m]=l[m]
}return o
}function i(m,l){m=k.call(m,0);
return d(m,l)
}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");
return l.length==1&&!l[0]?[]:l
}function h(n){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this
}var l=this,m=k.call(arguments,1);
return function(){var o=i(m,arguments);
return l.apply(n,o)
}
}function f(n){var l=this,m=k.call(arguments,1);
return function(p){var o=d([p||window.event],m);
return l.apply(n,o)
}
}function j(){if(!arguments.length){return this
}var l=this,m=k.call(arguments,0);
return function(){var n=i(m,arguments);
return l.apply(this,n)
}
}function e(n){var l=this,m=k.call(arguments,1);
n=n*1000;
return window.setTimeout(function(){return l.apply(l,m)
},n)
}function a(){var l=d([0.01],arguments);
return this.delay.apply(this,l)
}function c(m){var l=this;
return function(){var n=d([l.bind(this)],arguments);
return m.apply(this,n)
}
}function b(){if(this._methodized){return this._methodized
}var l=this;
return this._methodized=function(){var m=d([this],arguments);
return l.apply(null,m)
}
}return{argumentNames:g,bind:h,bindAsEventListener:f,curry:j,delay:e,defer:a,wrap:c,methodize:b}
})());
Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'
};
RegExp.prototype.match=RegExp.prototype.test;
RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")
};
var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;
this.frequency=a;
this.currentlyExecuting=false;
this.registerCallback()
},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)
},execute:function(){this.callback(this)
},stop:function(){if(!this.timer){return
}clearInterval(this.timer);
this.timer=null
},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;
this.execute();
this.currentlyExecuting=false
}catch(a){this.currentlyExecuting=false;
throw a
}}}});
Object.extend(String,{interpret:function(a){return a==null?"":String(a)
},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});
Object.extend(String.prototype,(function(){function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement
}var template=new Template(replacement);
return function(match){return template.evaluate(match)
}
}function gsub(pattern,replacement){var result="",source=this,match;
replacement=prepareReplacement(replacement);
if(Object.isString(pattern)){pattern=RegExp.escape(pattern)
}if(!(pattern.length||pattern.source)){replacement=replacement("");
return replacement+source.split("").join(replacement)+replacement
}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);
result+=String.interpret(replacement(match));
source=source.slice(match.index+match[0].length)
}else{result+=source,source=""
}}return result
}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);
count=Object.isUndefined(count)?1:count;
return this.gsub(pattern,function(match){if(--count<0){return match[0]
}return replacement(match)
})
}function scan(pattern,iterator){this.gsub(pattern,iterator);
return String(this)
}function truncate(length,truncation){length=length||30;
truncation=Object.isUndefined(truncation)?"...":truncation;
return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)
}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")
}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")
}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")
}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");
var matchOne=new RegExp(Prototype.ScriptFragment,"im");
return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]
})
}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)
})
}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")
}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")
}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);
if(!match){return{}
}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());
var value=pair.length>1?pair.join("="):pair[0];
if(value!=undefined){value=decodeURIComponent(value)
}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]
}hash[key].push(value)
}else{hash[key]=value
}}return hash
})
}function toArray(){return this.split("")
}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)
}function times(count){return count<1?"":new Array(count+1).join(this)
}function camelize(){var parts=this.split("-"),len=parts.length;
if(len==1){return parts[0]
}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];
for(var i=1;
i<len;
i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)
}return camelized
}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()
}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()
}function dasherize(){return this.replace(/_/g,"-")
}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]
}return"\\u00"+character.charCodeAt().toPaddedString(2,16)
});
if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'
}return"'"+escapedString.replace(/'/g,"\\'")+"'"
}function toJSON(){return this.inspect(true)
}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")
}function isJSON(){var str=this;
if(str.blank()){return false
}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");
return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)
}function evalJSON(sanitize){var json=this.unfilterJSON();
try{if(!sanitize||json.isJSON()){return eval("("+json+")")
}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())
}function include(pattern){return this.indexOf(pattern)>-1
}function startsWith(pattern){return this.indexOf(pattern)===0
}function endsWith(pattern){var d=this.length-pattern.length;
return d>=0&&this.lastIndexOf(pattern)===d
}function empty(){return this==""
}function blank(){return/^\s*$/.test(this)
}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)
}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}
})());
var Template=Class.create({initialize:function(a,b){this.template=a.toString();
this.pattern=b||Template.Pattern
},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()
}return this.template.gsub(this.pattern,function(d){if(a==null){return(d[1]+"")
}var f=d[1]||"";
if(f=="\\"){return d[2]
}var b=a,g=d[3];
var e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
d=e.exec(g);
if(d==null){return f
}while(d!=null){var c=d[1].startsWith("[")?d[2].replace(/\\\\]/g,"]"):d[1];
b=b[c];
if(null==b||""==d[3]){break
}g=g.substring("["==d[3]?d[1].length:d[0].length);
d=e.exec(g)
}return f+String.interpret(b)
})
}});
Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;
var $break={};
var Enumerable=(function(){function c(y,x){var w=0;
try{this._each(function(A){y.call(x,A,w++)
})
}catch(z){if(z!=$break){throw z
}}return this
}function r(z,y,x){var w=-z,A=[],B=this.toArray();
if(z<1){return B
}while((w+=z)<B.length){A.push(B.slice(w,w+z))
}return A.collect(y,x)
}function b(y,x){y=y||Prototype.K;
var w=true;
this.each(function(A,z){w=w&&!!y.call(x,A,z);
if(!w){throw $break
}});
return w
}function i(y,x){y=y||Prototype.K;
var w=false;
this.each(function(A,z){if(w=!!y.call(x,A,z)){throw $break
}});
return w
}function j(y,x){y=y||Prototype.K;
var w=[];
this.each(function(A,z){w.push(y.call(x,A,z))
});
return w
}function t(y,x){var w;
this.each(function(A,z){if(y.call(x,A,z)){w=A;
throw $break
}});
return w
}function h(y,x){var w=[];
this.each(function(A,z){if(y.call(x,A,z)){w.push(A)
}});
return w
}function g(z,y,x){y=y||Prototype.K;
var w=[];
if(Object.isString(z)){z=new RegExp(RegExp.escape(z))
}this.each(function(B,A){if(z.match(B)){w.push(y.call(x,B,A))
}});
return w
}function a(w){if(Object.isFunction(this.indexOf)){if(this.indexOf(w)!=-1){return true
}}var x=false;
this.each(function(y){if(y==w){x=true;
throw $break
}});
return x
}function q(x,w){w=Object.isUndefined(w)?null:w;
return this.eachSlice(x,function(y){while(y.length<x){y.push(w)
}return y
})
}function l(w,y,x){this.each(function(A,z){w=y.call(x,w,A,z)
});
return w
}function v(x){var w=$A(arguments).slice(1);
return this.map(function(y){return y[x].apply(y,w)
})
}function p(y,x){y=y||Prototype.K;
var w;
this.each(function(A,z){A=y.call(x,A,z);
if(w==null||A>=w){w=A
}});
return w
}function n(y,x){y=y||Prototype.K;
var w;
this.each(function(A,z){A=y.call(x,A,z);
if(w==null||A<w){w=A
}});
return w
}function e(z,x){z=z||Prototype.K;
var y=[],w=[];
this.each(function(B,A){(z.call(x,B,A)?y:w).push(B)
});
return[y,w]
}function f(x){var w=[];
this.each(function(y){w.push(y[x])
});
return w
}function d(y,x){var w=[];
this.each(function(A,z){if(!y.call(x,A,z)){w.push(A)
}});
return w
}function m(x,w){return this.map(function(z,y){return{value:z,criteria:x.call(w,z,y)}
}).sort(function(B,A){var z=B.criteria,y=A.criteria;
return z<y?-1:z>y?1:0
}).pluck("value")
}function o(){return this.map()
}function s(){var x=Prototype.K,w=$A(arguments);
if(Object.isFunction(w.last())){x=w.pop()
}var y=[this].concat(w).map($A);
return this.map(function(A,z){return x(y.pluck(z))
})
}function k(){return this.toArray().length
}function u(){return"#<Enumerable:"+this.toArray().inspect()+">"
}return{each:c,eachSlice:r,all:b,every:b,any:i,some:i,collect:j,map:j,detect:t,findAll:h,select:h,filter:h,grep:g,include:a,member:a,inGroupsOf:q,inject:l,invoke:v,max:p,min:n,partition:e,pluck:f,reject:d,sortBy:m,toArray:o,entries:o,zip:s,size:k,inspect:u,find:t}
})();
function $A(c){if(!c){return[]
}if("toArray" in Object(c)){return c.toArray()
}var b=c.length||0,a=new Array(b);
while(b--){a[b]=c[b]
}return a
}function $w(a){if(!Object.isString(a)){return[]
}a=a.strip();
return a?a.split(/\s+/):[]
}Array.from=$A;
(function(){var s=Array.prototype,m=s.slice,o=s.forEach;
function b(w){for(var v=0,x=this.length;
v<x;
v++){w(this[v])
}}if(!o){o=b
}function l(){this.length=0;
return this
}function d(){return this[0]
}function g(){return this[this.length-1]
}function i(){return this.select(function(v){return v!=null
})
}function u(){return this.inject([],function(w,v){if(Object.isArray(v)){return w.concat(v.flatten())
}w.push(v);
return w
})
}function h(){var v=m.call(arguments,0);
return this.select(function(w){return !v.include(w)
})
}function f(v){return(v!==false?this:this.toArray())._reverse()
}function k(v){return this.inject([],function(y,x,w){if(0==w||(v?y.last()!=x:!y.include(x))){y.push(x)
}return y
})
}function p(v){return this.uniq().findAll(function(w){return v.detect(function(x){return w===x
})
})
}function q(){return m.call(this,0)
}function j(){return this.length
}function t(){return"["+this.map(Object.inspect).join(", ")+"]"
}function r(){var v=[];
this.each(function(w){var x=Object.toJSON(w);
if(!Object.isUndefined(x)){v.push(x)
}});
return"["+v.join(", ")+"]"
}function a(x,v){v||(v=0);
var w=this.length;
if(v<0){v=w+v
}for(;
v<w;
v++){if(this[v]===x){return v
}}return -1
}function n(w,v){v=isNaN(v)?this.length:(v<0?this.length+v:v)+1;
var x=this.slice(0,v).reverse().indexOf(w);
return(x<0)?x:v-x-1
}function c(){var A=m.call(this,0),y;
for(var w=0,x=arguments.length;
w<x;
w++){y=arguments[w];
if(Object.isArray(y)&&!("callee" in y)){for(var v=0,z=y.length;
v<z;
v++){A.push(y[v])
}}else{A.push(y)
}}return A
}Object.extend(s,Enumerable);
if(!s._reverse){s._reverse=s.reverse
}Object.extend(s,{_each:o,clear:l,first:d,last:g,compact:i,flatten:u,without:h,reverse:f,uniq:k,intersect:p,clone:q,toArray:q,size:j,inspect:t,toJSON:r});
var e=(function(){return[].concat(arguments)[0][0]!==1
})(1,2);
if(e){s.concat=c
}if(!s.indexOf){s.indexOf=a
}if(!s.lastIndexOf){s.lastIndexOf=n
}})();
function $H(a){return new Hash(a)
}var Hash=Class.create(Enumerable,(function(){function e(q){this._object=Object.isHash(q)?q.toObject():Object.clone(q)
}function f(r){for(var q in this._object){var s=this._object[q],t=[q,s];
t.key=q;
t.value=s;
r(t)
}}function k(q,r){return this._object[q]=r
}function c(q){if(this._object[q]!==Object.prototype[q]){return this._object[q]
}}function n(q){var r=this._object[q];
delete this._object[q];
return r
}function p(){return Object.clone(this._object)
}function o(){return this.pluck("key")
}function m(){return this.pluck("value")
}function g(r){var q=this.detect(function(s){return s.value===r
});
return q&&q.key
}function i(q){return this.clone().update(q)
}function d(q){return new Hash(q).inject(this,function(r,s){r.set(s.key,s.value);
return r
})
}function b(q,r){if(Object.isUndefined(r)){return q
}return q+"="+encodeURIComponent(String.interpret(r))
}function a(){return this.inject([],function(s,t){var r=encodeURIComponent(t.key),q=t.value;
if(q&&typeof q=="object"){if(Object.isArray(q)){return s.concat(q.map(b.curry(r)))
}}else{s.push(b(r,q))
}return s
}).join("&")
}function l(){return"#<Hash:{"+this.map(function(q){return q.map(Object.inspect).join(": ")
}).join(", ")+"}>"
}function j(){return Object.toJSON(this.toObject())
}function h(){return new Hash(this)
}return{initialize:e,_each:f,set:k,get:c,unset:n,toObject:p,toTemplateReplacements:p,keys:o,values:m,index:g,merge:i,update:d,toQueryString:a,inspect:l,toJSON:j,clone:h}
})());
Hash.from=$H;
Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)
}function e(){return this+1
}function a(k,j){$R(0,this,true).each(k,j);
return this
}function b(l,k){var j=this.toString(k||10);
return"0".times(l-j.length)+j
}function f(){return isFinite(this)?this.toString():"null"
}function i(){return Math.abs(this)
}function h(){return Math.round(this)
}function g(){return Math.ceil(this)
}function c(){return Math.floor(this)
}return{toColorPart:d,succ:e,times:a,toPaddedString:b,toJSON:f,abs:i,round:h,ceil:g,floor:c}
})());
function $R(c,a,b){return new ObjectRange(c,a,b)
}var ObjectRange=Class.create(Enumerable,(function(){function b(f,d,e){this.start=f;
this.end=d;
this.exclusive=e
}function c(d){var e=this.start;
while(this.include(e)){d(e);
e=e.succ()
}}function a(d){if(d<this.start){return false
}if(this.exclusive){return d<this.end
}return d<=this.end
}return{initialize:b,_each:c,include:a}
})());
var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()
},function(){return new ActiveXObject("Msxml2.XMLHTTP")
},function(){return new ActiveXObject("Microsoft.XMLHTTP")
})||false
},activeRequestCount:0};
Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)
},register:function(a){if(!this.include(a)){this.responders.push(a)
}},unregister:function(a){this.responders=this.responders.without(a)
},dispatch:function(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a])
}catch(g){}}})
}};
Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++
},onComplete:function(){Ajax.activeRequestCount--
}});
Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};
Object.extend(this.options,a||{});
this.options.method=this.options.method.toLowerCase();
if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()
}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()
}}}});
Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,a){$super(a);
this.transport=Ajax.getTransport();
this.request(b)
},request:function(b){this.url=b;
this.method=this.options.method;
var d=Object.clone(this.options.parameters);
if(!["get","post"].include(this.method)){d._method=this.method;
this.method="post"
}this.parameters=d;
if(d=Object.toQueryString(d)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+d
}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){d+="&_="
}}}try{var a=new Ajax.Response(this);
if(this.options.onCreate){this.options.onCreate(a)
}Ajax.Responders.dispatch("onCreate",this,a);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)
}this.transport.onreadystatechange=this.onStateChange.bind(this);
this.setRequestHeaders();
this.body=this.method=="post"?(this.options.postBody||d):null;
this.transport.send(this.body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()
}}catch(c){this.dispatchException(c)
}},onStateChange:function(){var a=this.transport.readyState;
if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)
}},setRequestHeaders:function(){var e={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){e["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){e.Connection="close"
}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;
if(Object.isFunction(c.push)){for(var b=0,d=c.length;
b<d;
b+=2){e[c[b]]=c[b+1]
}}else{$H(c).each(function(f){e[f.key]=f.value
})
}}for(var a in e){this.transport.setRequestHeader(a,e[a])
}},success:function(){var a=this.getStatus();
return !a||(a>=200&&a<300)
},getStatus:function(){try{return this.transport.status||0
}catch(a){return 0
}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);
if(c=="Complete"){try{this._complete=true;
(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)
}catch(d){this.dispatchException(d)
}var f=b.getHeader("Content-type");
if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()
}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);
Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)
}catch(d){this.dispatchException(d)
}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction
}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);
return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))
},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null
}catch(b){return null
}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())
}catch(e){this.dispatchException(e)
}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);
Ajax.Responders.dispatch("onException",this,a)
}});
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Response=Class.create({initialize:function(c){this.request=c;
var d=this.transport=c.transport,a=this.readyState=d.readyState;
if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();
this.statusText=this.getStatusText();
this.responseText=String.interpret(d.responseText);
this.headerJSON=this._getHeaderJSON()
}if(a==4){var b=d.responseXML;
this.responseXML=Object.isUndefined(b)?null:b;
this.responseJSON=this._getResponseJSON()
}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""
}catch(a){return""
}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()
}catch(a){return null
}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)
},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()
},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");
if(!a){return null
}a=decodeURIComponent(escape(a));
try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())
}catch(b){this.request.dispatchException(b)
}},_getResponseJSON:function(){var a=this.request.options;
if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null
}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())
}catch(b){this.request.dispatchException(b)
}}});
Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};
b=Object.clone(b);
var d=b.onComplete;
b.onComplete=(function(e,f){this.updateContent(e.responseText);
if(Object.isFunction(d)){d(e,f)
}}).bind(this);
$super(c,b)
},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;
if(!a.evalScripts){d=d.stripScripts()
}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};
b[a.insertion]=d;
c.insert(b)
}else{a.insertion(c,d)
}}else{c.update(d)
}}}});
Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=(this.options.decay||1);
this.updater={};
this.container=a;
this.url=c;
this.start()
},start:function(){this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent()
},stop:function(){this.updater.options.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Prototype.emptyFunction).apply(this,arguments)
},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=a.responseText
}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)
},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)
}});
function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;
a<c;
a++){d.push($(arguments[a]))
}return d
}if(Object.isString(b)){b=document.getElementById(b)
}return Element.extend(b)
}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(f,a){var c=[];
var e=document.evaluate(f,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for(var b=0,d=e.snapshotLength;
b<d;
b++){c.push(Element.extend(e.snapshotItem(b)))
}return c
}
}if(!window.Node){var Node={}
}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})
}(function(c){var b=(function(){var f=document.createElement("form");
var e=document.createElement("input");
var d=document.documentElement;
e.setAttribute("name","test");
f.appendChild(e);
d.appendChild(f);
var g=f.elements?(typeof f.elements.test=="undefined"):null;
d.removeChild(f);
f=e=null;
return g
})();
var a=c.Element;
c.Element=function(f,e){e=e||{};
f=f.toLowerCase();
var d=Element.cache;
if(b&&e.name){f="<"+f+' name="'+e.name+'">';
delete e.name;
return Element.writeAttribute(document.createElement(f),e)
}if(!d[f]){d[f]=Element.extend(document.createElement(f))
}return Element.writeAttribute(d[f].cloneNode(false),e)
};
Object.extend(c.Element,a||{});
if(a){c.Element.prototype=a.prototype
}})(this);
Element.cache={};
Element.idCounter=1;
Element.Methods={visible:function(a){return $(a).style.display!="none"
},toggle:function(a){a=$(a);
Element[Element.visible(a)?"hide":"show"](a);
return a
},hide:function(a){a=$(a);
a.style.display="none";
return a
},show:function(a){a=$(a);
a.style.display="";
return a
},remove:function(a){a=$(a);
a.parentNode.removeChild(a);
return a
},update:(function(){var b=(function(){var e=document.createElement("select"),f=true;
e.innerHTML='<option value="test">test</option>';
if(e.options&&e.options[0]){f=e.options[0].nodeName.toUpperCase()!=="OPTION"
}e=null;
return f
})();
var a=(function(){try{var f=document.createElement("table");
if(f&&f.tBodies){f.innerHTML="<tbody><tr><td>test</td></tr></tbody>";
var h=typeof f.tBodies[0]=="undefined";
f=null;
return h
}}catch(g){return true
}})();
var d=(function(){var f=document.createElement("script"),h=false;
try{f.appendChild(document.createTextNode(""));
h=!f.firstChild||f.firstChild&&f.firstChild.nodeType!==3
}catch(g){h=true
}f=null;
return h
})();
function c(f,g){f=$(f);
if(g&&g.toElement){g=g.toElement()
}if(Object.isElement(g)){return f.update().insert(g)
}g=Object.toHTML(g);
var e=f.tagName.toUpperCase();
if(e==="SCRIPT"&&d){f.text=g;
return f
}if(b||a){if(e in Element._insertionTranslations.tags){while(f.firstChild){f.removeChild(f.firstChild)
}Element._getContentFromAnonymousElement(e,g.stripScripts()).each(function(h){f.appendChild(h)
})
}else{f.innerHTML=g.stripScripts()
}}else{f.innerHTML=g.stripScripts()
}g.evalScripts.bind(g).defer();
return f
}return c
})(),replace:function(b,c){b=$(b);
if(c&&c.toElement){c=c.toElement()
}else{if(!Object.isElement(c)){c=Object.toHTML(c);
var a=b.ownerDocument.createRange();
a.selectNode(b);
c.evalScripts.bind(c).defer();
c=a.createContextualFragment(c.stripScripts())
}}b.parentNode.replaceChild(c,b);
return b
},insert:function(c,e){c=$(c);
if(Object.isString(e)||Object.isNumber(e)||Object.isElement(e)||(e&&(e.toElement||e.toHTML))){e={bottom:e}
}var d,f,b,g;
for(var a in e){d=e[a];
a=a.toLowerCase();
f=Element._insertionTranslations[a];
if(d&&d.toElement){d=d.toElement()
}if(Object.isElement(d)){f(c,d);
continue
}d=Object.toHTML(d);
b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();
g=Element._getContentFromAnonymousElement(b,d.stripScripts());
if(a=="top"||a=="after"){g.reverse()
}g.each(f.curry(c));
d.evalScripts.bind(d).defer()
}return c
},wrap:function(b,c,a){b=$(b);
if(Object.isElement(c)){$(c).writeAttribute(a||{})
}else{if(Object.isString(c)){c=new Element(c,a)
}else{c=new Element("div",c)
}}if(b.parentNode){b.parentNode.replaceChild(c,b)
}c.appendChild(b);
return c
},inspect:function(b){b=$(b);
var a="<"+b.tagName.toLowerCase();
$H({id:"id",className:"class"}).each(function(f){var e=f.first(),c=f.last();
var d=(b[e]||"").toString();
if(d){a+=" "+c+"="+d.inspect(true)
}});
return a+">"
},recursivelyCollect:function(a,c){a=$(a);
var b=[];
while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))
}}return b
},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")
},descendants:function(a){return Element.select(a,"*")
},firstDescendant:function(a){a=$(a).firstChild;
while(a&&a.nodeType!=1){a=a.nextSibling
}return $(a)
},immediateDescendants:function(a){if(!(a=$(a).firstChild)){return[]
}while(a&&a.nodeType!=1){a=a.nextSibling
}if(a){return[a].concat($(a).nextSiblings())
}return[]
},previousSiblings:function(a){return Element.recursivelyCollect(a,"previousSibling")
},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")
},siblings:function(a){a=$(a);
return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))
},match:function(b,a){if(Object.isString(a)){a=new Selector(a)
}return a.match($(b))
},up:function(b,d,a){b=$(b);
if(arguments.length==1){return $(b.parentNode)
}var c=Element.ancestors(b);
return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)
},down:function(b,c,a){b=$(b);
if(arguments.length==1){return Element.firstDescendant(b)
}return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[a||0]
},previous:function(b,d,a){b=$(b);
if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b))
}var c=Element.previousSiblings(b);
return Object.isNumber(d)?c[d]:Selector.findElement(c,d,a)
},next:function(c,d,b){c=$(c);
if(arguments.length==1){return $(Selector.handlers.nextElementSibling(c))
}var a=Element.nextSiblings(c);
return Object.isNumber(d)?a[d]:Selector.findElement(a,d,b)
},select:function(b){var a=Array.prototype.slice.call(arguments,1);
return Selector.findChildElements(b,a)
},adjacent:function(b){var a=Array.prototype.slice.call(arguments,1);
return Selector.findChildElements(b.parentNode,a).without(b)
},identify:function(a){a=$(a);
var b=Element.readAttribute(a,"id");
if(b){return b
}do{b="anonymous_element_"+Element.idCounter++
}while($(b));
Element.writeAttribute(a,"id",b);
return b
},readAttribute:function(c,a){c=$(c);
if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;
if(b.values[a]){return b.values[a](c,a)
}if(b.names[a]){a=b.names[a]
}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value
}}return c.getAttribute(a)
},writeAttribute:function(e,c,f){e=$(e);
var b={},d=Element._attributeTranslations.write;
if(typeof c=="object"){b=c
}else{b[c]=Object.isUndefined(f)?true:f
}for(var a in b){c=d.names[a]||a;
f=b[a];
if(d.values[a]){c=d.values[a](e,f)
}if(f===false||f===null){e.removeAttribute(c)
}else{if(f===true){e.setAttribute(c,c)
}else{e.setAttribute(c,f)
}}}return e
},getHeight:function(a){return Element.getDimensions(a).height
},getWidth:function(a){return Element.getDimensions(a).width
},classNames:function(a){return new Element.ClassNames(a)
},hasClassName:function(a,b){if(!(a=$(a))){return
}var c=a.className;
return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))
},addClassName:function(a,b){if(!(a=$(a))){return
}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b
}return a
},removeClassName:function(a,b){if(!(a=$(a))){return
}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();
return a
},toggleClassName:function(a,b){if(!(a=$(a))){return
}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)
},cleanWhitespace:function(b){b=$(b);
var c=b.firstChild;
while(c){var a=c.nextSibling;
if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)
}c=a
}return b
},empty:function(a){return $(a).innerHTML.blank()
},descendantOf:function(b,a){b=$(b),a=$(a);
if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8
}if(a.contains){return a.contains(b)&&a!==b
}while(b=b.parentNode){if(b==a){return true
}}return false
},scrollTo:function(a){a=$(a);
var b=Element.cumulativeOffset(a);
window.scrollTo(b[0],b[1]);
return a
},getStyle:function(b,c){b=$(b);
c=c=="float"?"cssFloat":c.camelize();
var d=b.style[c];
if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(b,null);
d=a?a[c]:null
}if(c=="opacity"){return d?parseFloat(d):1
}return d=="auto"?null:d
},getOpacity:function(a){return $(a).getStyle("opacity")
},setStyle:function(b,c){b=$(b);
var e=b.style,a;
if(Object.isString(c)){b.style.cssText+=";"+c;
return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b
}for(var d in c){if(d=="opacity"){b.setOpacity(c[d])
}else{e[(d=="float"||d=="cssFloat")?(Object.isUndefined(e.styleFloat)?"cssFloat":"styleFloat"):d]=c[d]
}}return b
},setOpacity:function(a,b){a=$(a);
a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;
return a
},getDimensions:function(c){c=$(c);
var g=Element.getStyle(c,"display");
if(g!="none"&&g!=null){return{width:c.offsetWidth,height:c.offsetHeight}
}var b=c.style;
var f=b.visibility;
var d=b.position;
var a=b.display;
b.visibility="hidden";
if(d!="fixed"){b.position="absolute"
}b.display="block";
var h=c.clientWidth;
var e=c.clientHeight;
b.display=a;
b.position=d;
b.visibility=f;
return{width:h,height:e}
},makePositioned:function(a){a=$(a);
var b=Element.getStyle(a,"position");
if(b=="static"||!b){a._madePositioned=true;
a.style.position="relative";
if(Prototype.Browser.Opera){a.style.top=0;
a.style.left=0
}}return a
},undoPositioned:function(a){a=$(a);
if(a._madePositioned){a._madePositioned=undefined;
a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""
}return a
},makeClipping:function(a){a=$(a);
if(a._overflow){return a
}a._overflow=Element.getStyle(a,"overflow")||"auto";
if(a._overflow!=="hidden"){a.style.overflow="hidden"
}return a
},undoClipping:function(a){a=$(a);
if(!a._overflow){return a
}a.style.overflow=a._overflow=="auto"?"":a._overflow;
a._overflow=null;
return a
},cumulativeOffset:function(b){var a=0,c=0;
do{a+=b.offsetTop||0;
c+=b.offsetLeft||0;
b=b.offsetParent
}while(b);
return Element._returnOffset(c,a)
},positionedOffset:function(b){var a=0,d=0;
do{a+=b.offsetTop||0;
d+=b.offsetLeft||0;
b=b.offsetParent;
if(b){if(b.tagName.toUpperCase()=="BODY"){break
}var c=Element.getStyle(b,"position");
if(c!=="static"){break
}}}while(b);
return Element._returnOffset(d,a)
},absolutize:function(b){b=$(b);
if(Element.getStyle(b,"position")=="absolute"){return b
}var d=Element.positionedOffset(b);
var f=d[1];
var e=d[0];
var c=b.clientWidth;
var a=b.clientHeight;
b._originalLeft=e-parseFloat(b.style.left||0);
b._originalTop=f-parseFloat(b.style.top||0);
b._originalWidth=b.style.width;
b._originalHeight=b.style.height;
b.style.position="absolute";
b.style.top=f+"px";
b.style.left=e+"px";
b.style.width=c+"px";
b.style.height=a+"px";
return b
},relativize:function(a){a=$(a);
if(Element.getStyle(a,"position")=="relative"){return a
}a.style.position="relative";
var c=parseFloat(a.style.top||0)-(a._originalTop||0);
var b=parseFloat(a.style.left||0)-(a._originalLeft||0);
a.style.top=c+"px";
a.style.left=b+"px";
a.style.height=a._originalHeight;
a.style.width=a._originalWidth;
return a
},cumulativeScrollOffset:function(b){var a=0,c=0;
do{a+=b.scrollTop||0;
c+=b.scrollLeft||0;
b=b.parentNode
}while(b);
return Element._returnOffset(c,a)
},getOffsetParent:function(a){if(a.offsetParent){return $(a.offsetParent)
}if(a==document.body){return $(a)
}while((a=a.parentNode)&&a!=document.body){if(Element.getStyle(a,"position")!="static"){return $(a)
}}return $(document.body)
},viewportOffset:function(d){var a=0,c=0;
var b=d;
do{a+=b.offsetTop||0;
c+=b.offsetLeft||0;
if(b.offsetParent==document.body&&Element.getStyle(b,"position")=="absolute"){break
}}while(b=b.offsetParent);
b=d;
do{if(!Prototype.Browser.Opera||(b.tagName&&(b.tagName.toUpperCase()=="BODY"))){a-=b.scrollTop||0;
c-=b.scrollLeft||0
}}while(b=b.parentNode);
return Element._returnOffset(c,a)
},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
d=$(d);
var e=Element.viewportOffset(d);
b=$(b);
var f=[0,0];
var c=null;
if(Element.getStyle(b,"position")=="absolute"){c=Element.getOffsetParent(b);
f=Element.viewportOffset(c)
}if(c==document.body){f[0]-=document.body.offsetLeft;
f[1]-=document.body.offsetTop
}if(a.setLeft){b.style.left=(e[0]-f[0]+a.offsetLeft)+"px"
}if(a.setTop){b.style.top=(e[1]-f[1]+a.offsetTop)+"px"
}if(a.setWidth){b.style.width=d.offsetWidth+"px"
}if(a.setHeight){b.style.height=d.offsetHeight+"px"
}return b
}};
Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});
Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};
if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case"left":case"top":case"right":case"bottom":if(d(b,"position")==="static"){return null
}case"height":case"width":if(!Element.visible(b)){return null
}var e=parseInt(d(b,c),10);
if(e!==b["offset"+c.capitalize()]){return e+"px"
}var a;
if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]
}else{a=["border-left-width","padding-left","padding-right","border-right-width"]
}return a.inject(e,function(f,g){var h=d(b,g);
return h===null?f:f-parseInt(h,10)
})+"px";
default:return d(b,c)
}});
Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title
}return c(a,b)
})
}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(c,b){b=$(b);
try{b.offsetParent
}catch(f){return $(document.body)
}var a=b.getStyle("position");
if(a!=="static"){return c(b)
}b.setStyle({position:"relative"});
var d=c(b);
b.setStyle({position:a});
return d
});
$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(f,c){c=$(c);
try{c.offsetParent
}catch(h){return Element._returnOffset(0,0)
}var b=c.getStyle("position");
if(b!=="static"){return f(c)
}var d=c.getOffsetParent();
if(d&&d.getStyle("position")==="fixed"){d.setStyle({zoom:1})
}c.setStyle({position:"relative"});
var g=f(c);
c.setStyle({position:b});
return g
})
});
Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(b,a){try{a.offsetParent
}catch(c){return Element._returnOffset(0,0)
}return b(a)
});
Element.Methods.getStyle=function(a,b){a=$(a);
b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();
var c=a.style[b];
if(!c&&a.currentStyle){c=a.currentStyle[b]
}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100
}}return 1
}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"
}return null
}return c
};
Element.Methods.setOpacity=function(b,e){function f(g){return g.replace(/alpha\([^\)]*\)/gi,"")
}b=$(b);
var a=b.currentStyle;
if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1
}var d=b.getStyle("filter"),c=b.style;
if(e==1||e===""){(d=f(d))?c.filter=d:c.removeAttribute("filter");
return b
}else{if(e<0.00001){e=0
}}c.filter=f(d)+"alpha(opacity="+(e*100)+")";
return b
};
Element._attributeTranslations=(function(){var b="className";
var a="for";
var c=document.createElement("div");
c.setAttribute(b,"x");
if(c.className!=="x"){c.setAttribute("class","x");
if(c.className==="x"){b="class"
}}c=null;
c=document.createElement("label");
c.setAttribute(a,"x");
if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");
if(c.htmlFor==="x"){a="htmlFor"
}}c=null;
return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(d,e){return d.getAttribute(e)
},_getAttr2:function(d,e){return d.getAttribute(e,2)
},_getAttrNode:function(d,f){var e=d.getAttributeNode(f);
return e?e.value:""
},_getEv:(function(){var d=document.createElement("div");
d.onclick=Prototype.emptyFunction;
var g=d.getAttribute("onclick");
var e;
if(String(g).indexOf("{")>-1){e=function(f,h){h=f.getAttribute(h);
if(!h){return null
}h=h.toString();
h=h.split("{")[1];
h=h.split("}")[0];
return h.strip()
}
}else{if(g===""){e=function(f,h){h=f.getAttribute(h);
if(!h){return null
}return h.strip()
}
}}d=null;
return e
})(),_flag:function(d,e){return $(d).hasAttribute(e)?e:null
},style:function(d){return d.style.cssText.toLowerCase()
},title:function(d){return d.title
}}}}
})();
Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b
},style:function(a,b){a.style.cssText=b?b:""
}}};
Element._attributeTranslations.has={};
$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;
Element._attributeTranslations.has[a.toLowerCase()]=a
});
(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})
})(Element._attributeTranslations.read.values);
if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(e){var b=e.getElementsByTagName("*"),d=[];
for(var c=0,f;
f=b[c];
c++){if(f.tagName!=="!"){d.push(f)
}}return d
}Element.Methods.down=function(c,d,b){c=$(c);
if(arguments.length==1){return c.firstDescendant()
}return Object.isNumber(d)?a(c)[d]:Element.select(c,d)[b||0]
}
})()
}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);
a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;
return a
}
}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);
a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;
if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;
a.width--
}else{try{var d=document.createTextNode(" ");
a.appendChild(d);
a.removeChild(d)
}catch(c){}}}return a
};
Element.Methods.cumulativeOffset=function(b){var a=0,c=0;
do{a+=b.offsetTop||0;
c+=b.offsetLeft||0;
if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break
}}b=b.offsetParent
}while(b);
return Element._returnOffset(c,a)
}
}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(c,e){c=$(c);
if(e&&e.toElement){e=e.toElement()
}if(Object.isElement(e)){c.parentNode.replaceChild(e,c);
return c
}e=Object.toHTML(e);
var d=c.parentNode,b=d.tagName.toUpperCase();
if(Element._insertionTranslations.tags[b]){var f=c.next();
var a=Element._getContentFromAnonymousElement(b,e.stripScripts());
d.removeChild(c);
if(f){a.each(function(g){d.insertBefore(g,f)
})
}else{a.each(function(g){d.appendChild(g)
})
}}else{c.outerHTML=e.stripScripts()
}e.evalScripts.bind(e).defer();
return c
}
}Element._returnOffset=function(b,c){var a=[b,c];
a.left=b;
a.top=c;
return a
};
Element._getContentFromAnonymousElement=function(c,b){var d=new Element("div"),a=Element._insertionTranslations.tags[c];
if(a){d.innerHTML=a[0]+b+a[1];
a[2].times(function(){d=d.firstChild
})
}else{d.innerHTML=b
}return $A(d.childNodes)
};
Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)
},top:function(a,b){a.insertBefore(b,a.firstChild)
},bottom:function(a,b){a.appendChild(b)
},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)
},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
(function(){var a=Element._insertionTranslations.tags;
Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})
})();
Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;
var b=$(a).getAttributeNode(c);
return !!(b&&b.specified)
}};
Element.Methods.ByTag={};
Object.extend(Element,Element.Methods);
(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};
window.HTMLElement.prototype=a.__proto__;
Prototype.BrowserFeatures.ElementExtensions=true
}a=null
})(document.createElement("div"));
Element.extend=(function(){function c(g){if(typeof window.Element!="undefined"){var i=window.Element.prototype;
if(i){var k="_"+(Math.random()+"").slice(2);
var h=document.createElement(g);
i[k]="x";
var j=(h[k]!=="x");
delete i[k];
h=null;
return j
}}return false
}function b(h,g){for(var j in g){var i=g[j];
if(Object.isFunction(i)&&!(j in h)){h[j]=i.methodize()
}}}var d=c("object");
if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d){return function(h){if(h&&typeof h._extendedByPrototype=="undefined"){var g=h.tagName;
if(g&&(/^(?:object|applet|embed)$/i.test(g))){b(h,Element.Methods);
b(h,Element.Methods.Simulated);
b(h,Element.Methods.ByTag[g.toUpperCase()])
}}return h
}
}return Prototype.K
}var a={},e=Element.Methods.ByTag;
var f=Object.extend(function(i){if(!i||typeof i._extendedByPrototype!="undefined"||i.nodeType!=1||i==window){return i
}var g=Object.clone(a),h=i.tagName.toUpperCase();
if(e[h]){Object.extend(g,e[h])
}b(i,g);
i._extendedByPrototype=Prototype.emptyFunction;
return i
},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);
Object.extend(a,Element.Methods.Simulated)
}}});
f.refresh();
return f
})();
Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)
}return Element.Methods.Simulated.hasAttribute(a,b)
};
Element.addMethods=function(c){var i=Prototype.BrowserFeatures,d=Element.Methods.ByTag;
if(!c){Object.extend(Form,Form.Methods);
Object.extend(Form.Element,Form.Element.Methods);
Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})
}if(arguments.length==2){var b=c;
c=arguments[1]
}if(!b){Object.extend(Element.Methods,c||{})
}else{if(Object.isArray(b)){b.each(g)
}else{g(b)
}}function g(k){k=k.toUpperCase();
if(!Element.Methods.ByTag[k]){Element.Methods.ByTag[k]={}
}Object.extend(Element.Methods.ByTag[k],c)
}function a(m,l,k){k=k||false;
for(var o in m){var n=m[o];
if(!Object.isFunction(n)){continue
}if(!k||!(o in l)){l[o]=n.methodize()
}}}function e(n){var k;
var m={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};
if(m[n]){k="HTML"+m[n]+"Element"
}if(window[k]){return window[k]
}k="HTML"+n+"Element";
if(window[k]){return window[k]
}k="HTML"+n.capitalize()+"Element";
if(window[k]){return window[k]
}var l=document.createElement(n);
var o=l.__proto__||l.constructor.prototype;
l=null;
return o
}var h=window.HTMLElement?HTMLElement.prototype:Element.prototype;
if(i.ElementExtensions){a(Element.Methods,h);
a(Element.Methods.Simulated,h,true)
}if(i.SpecificElementExtensions){for(var j in Element.Methods.ByTag){var f=e(j);
if(Object.isUndefined(f)){continue
}a(d[j],f.prototype)
}}Object.extend(Element,Element.Methods);
delete Element.ByTag;
if(Element.extend.refresh){Element.extend.refresh()
}Element.cache={}
};
document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}
},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)
}};
(function(b){var g=Prototype.Browser,e=document,c,d={};
function a(){if(g.WebKit&&!e.evaluate){return document
}if(g.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body
}return document.documentElement
}function f(h){if(!c){c=a()
}d[h]="client"+h;
b["get"+h]=function(){return c[d[h]]
};
return b["get"+h]()
}b.getWidth=f.curry("Width");
b.getHeight=f.curry("Height")
})(document.viewport);
Element.Storage={UID:1};
Element.addMethods({getStorage:function(b){if(!(b=$(b))){return
}var a;
if(b===window){a=0
}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=[Element.Storage.UID++]
}a=b._prototypeUID[0]
}if(!Element.Storage[a]){Element.Storage[a]=$H()
}return Element.Storage[a]
},store:function(b,a,c){if(!(b=$(b))){return
}if(arguments.length===2){Element.getStorage(b).update(a)
}else{Element.getStorage(b).set(a,c)
}return b
},retrieve:function(c,b,a){if(!(c=$(c))){return
}var e=Element.getStorage(c),d=e.get(b);
if(Object.isUndefined(d)){e.set(b,a);
d=a
}return d
},clone:function(c,a){if(!(c=$(c))){return
}var e=c.cloneNode(a);
e._prototypeUID=void 0;
if(a){var d=Element.select(e,"*"),b=d.length;
while(b--){d[b]._prototypeUID=void 0
}}return Element.extend(e)
}});
var Selector=Class.create({initialize:function(a){this.expression=a.strip();
if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"
}else{if(this.shouldUseXPath()){this.mode="xpath";
this.compileXPathMatcher()
}else{this.mode="normal";
this.compileMatcher()
}}},shouldUseXPath:(function(){var a=(function(){var e=false;
if(document.evaluate&&window.XPathResult){var d=document.createElement("div");
d.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";
var c=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";
var b=document.evaluate(c,d,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
e=(b.snapshotLength!==2);
d=null
}return e
})();
return function(){if(!Prototype.BrowserFeatures.XPath){return false
}var b=this.expression;
if(Prototype.Browser.WebKit&&(b.include("-of-type")||b.include(":empty"))){return false
}if((/(\[[\w-]*?:|:checked)/).test(b)){return false
}if(a){return false
}return true
}
})(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false
}if(Selector.CASE_INSENSITIVE_CLASS_NAMES){return false
}if(!Selector._div){Selector._div=new Element("div")
}try{Selector._div.querySelector(this.expression)
}catch(a){return false
}return true
},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m,len=ps.length,name;
if(Selector._cache[e]){this.matcher=Selector._cache[e];
return
}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];
while(e&&le!=e&&(/\S/).test(e)){le=e;
for(var i=0;
i<len;
i++){p=ps[i].re;
name=ps[i].name;
if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).evaluate(m));
e=e.replace(m[0],"");
break
}}}this.matcher.push("return h.unique(n);\n}");
eval(this.matcher.join("\n"));
Selector._cache[this.expression]=this.matcher
},compileXPathMatcher:function(){var h=this.expression,j=Selector.patterns,c=Selector.xpath,g,b,a=j.length,d;
if(Selector._cache[h]){this.xpath=Selector._cache[h];
return
}this.matcher=[".//*"];
while(h&&g!=h&&(/\S/).test(h)){g=h;
for(var f=0;
f<a;
f++){d=j[f].name;
if(b=h.match(j[f].re)){this.matcher.push(Object.isFunction(c[d])?c[d](b):new Template(c[d]).evaluate(b));
h=h.replace(b[0],"");
break
}}}this.xpath=this.matcher.join("");
Selector._cache[this.expression]=this.xpath
},findElements:function(a){a=a||document;
var c=this.expression,b;
switch(this.mode){case"selectorsAPI":if(a!==document){var d=a.id,f=$(a).identify();
f=f.replace(/([\.:])/g,"\\$1");
c="#"+f+" "+c
}b=$A(a.querySelectorAll(c)).map(Element.extend);
a.id=d;
return b;
case"xpath":return document._getElementsByXPath(this.xpath,a);
default:return this.matcher(a)
}},match:function(k){this.tokens=[];
var q=this.expression,a=Selector.patterns,f=Selector.assertions;
var b,d,g,o=a.length,c;
while(q&&b!==q&&(/\S/).test(q)){b=q;
for(var j=0;
j<o;
j++){d=a[j].re;
c=a[j].name;
if(g=q.match(d)){if(f[c]){this.tokens.push([c,Object.clone(g)]);
q=q.replace(g[0],"")
}else{return this.findElements(document).include(k)
}}}}var n=true,c,l;
for(var j=0,h;
h=this.tokens[j];
j++){c=h[0],l=h[1];
if(!Selector.assertions[c](k,l)){n=false;
break
}}return n
},toString:function(){return this.expression
},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"
}});
if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat"){Selector.CASE_INSENSITIVE_CLASS_NAMES=(function(){var c=document.createElement("div"),a=document.createElement("span");
c.id="prototype_test_id";
a.className="Test";
c.appendChild(a);
var b=(c.querySelector("#prototype_test_id .test")!==null);
c=a=null;
return b
})()
}Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(a){if(a[1]=="*"){return""
}return"[local-name()='"+a[1].toLowerCase()+"' or local-name()='"+a[1].toUpperCase()+"']"
},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(a){a[1]=a[1].toLowerCase();
return new Template("[@#{1}]").evaluate(a)
},attr:function(a){a[1]=a[1].toLowerCase();
a[3]=a[5]||a[6];
return new Template(Selector.xpath.operators[a[2]]).evaluate(a)
},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];
if(!b){return""
}if(Object.isFunction(b)){return b(a)
}return new Template(Selector.xpath.pseudos[a[1]]).evaluate(a)
},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(f){var j=f[6],c=Selector.patterns,k=Selector.xpath,a,l,h=c.length,b;
var d=[];
while(j&&a!=j&&(/\S/).test(j)){a=j;
for(var g=0;
g<h;
g++){b=c[g].name;
if(f=j.match(c[g].re)){l=Object.isFunction(k[b])?k[b](f):new Template(k[b]).evaluate(f);
d.push("("+l.substring(1,l.length-1)+")");
j=j.replace(f[0],"");
break
}}}return"[not("+d.join(" and ")+")]"
},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a)
},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a)
},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a)
},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",a)
},"first-of-type":function(a){a[6]="1";
return Selector.xpath.pseudos["nth-of-type"](a)
},"last-of-type":function(a){a[6]="1";
return Selector.xpath.pseudos["nth-last-of-type"](a)
},"only-of-type":function(a){var b=Selector.xpath.pseudos;
return b["first-of-type"](a)+b["last-of-type"](a)
},nth:function(g,e){var h,i=e[6],d;
if(i=="even"){i="2n+0"
}if(i=="odd"){i="2n+1"
}if(h=i.match(/^(\d+)$/)){return"["+g+"= "+h[1]+"]"
}if(h=i.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(h[1]=="-"){h[1]=-1
}var f=h[1]?Number(h[1]):1;
var c=h[2]?Number(h[2]):0;
d="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";
return new Template(d).evaluate({fragment:g,a:f,b:c})
}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(a){a[3]=(a[5]||a[6]);
return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(a)
},pseudo:function(a){if(a[6]){a[6]=a[6].replace(/"/g,'\\"')
}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(a)
},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()
},className:function(a,b){return Element.hasClassName(a,b[1])
},id:function(a,b){return a.id===b[1]
},attrPresence:function(a,b){return Element.hasAttribute(a,b[1])
},attr:function(b,c){var a=Element.readAttribute(b,c[1]);
return a&&Selector.operators[c[2]](a,c[5]||c[6])
}},handlers:{concat:function(d,c){for(var e=0,f;
f=c[e];
e++){d.push(f)
}return d
},mark:function(a){var d=Prototype.emptyFunction;
for(var b=0,c;
c=a[b];
b++){c._countedByPrototype=d
}return a
},unmark:(function(){var a=(function(){var b=document.createElement("div"),e=false,d="_countedByPrototype",c="x";
b[d]=c;
e=(b.getAttribute(d)===c);
b=null;
return e
})();
return a?function(b){for(var c=0,d;
d=b[c];
c++){d.removeAttribute("_countedByPrototype")
}return b
}:function(b){for(var c=0,d;
d=b[c];
c++){d._countedByPrototype=void 0
}return b
}
})(),index:function(a,d,g){a._countedByPrototype=Prototype.emptyFunction;
if(d){for(var b=a.childNodes,e=b.length-1,c=1;
e>=0;
e--){var f=b[e];
if(f.nodeType==1&&(!g||f._countedByPrototype)){f.nodeIndex=c++
}}}else{for(var e=0,c=1,b=a.childNodes;
f=b[e];
e++){if(f.nodeType==1&&(!g||f._countedByPrototype)){f.nodeIndex=c++
}}}},unique:function(b){if(b.length==0){return b
}var d=[],e;
for(var c=0,a=b.length;
c<a;
c++){if(typeof(e=b[c])._countedByPrototype=="undefined"){e._countedByPrototype=Prototype.emptyFunction;
d.push(Element.extend(e))
}}return Selector.handlers.unmark(d)
},descendant:function(a){var d=Selector.handlers;
for(var c=0,b=[],e;
e=a[c];
c++){d.concat(b,e.getElementsByTagName("*"))
}return b
},child:function(a){var e=Selector.handlers;
for(var d=0,c=[],f;
f=a[d];
d++){for(var b=0,g;
g=f.childNodes[b];
b++){if(g.nodeType==1&&g.tagName!="!"){c.push(g)
}}}return c
},adjacent:function(a){for(var c=0,b=[],e;
e=a[c];
c++){var d=this.nextElementSibling(e);
if(d){b.push(d)
}}return b
},laterSibling:function(a){var d=Selector.handlers;
for(var c=0,b=[],e;
e=a[c];
c++){d.concat(b,Element.nextSiblings(e))
}return b
},nextElementSibling:function(a){while(a=a.nextSibling){if(a.nodeType==1){return a
}}return null
},previousElementSibling:function(a){while(a=a.previousSibling){if(a.nodeType==1){return a
}}return null
},tagName:function(a,j,c,b){var k=c.toUpperCase();
var e=[],g=Selector.handlers;
if(a){if(b){if(b=="descendant"){for(var f=0,d;
d=a[f];
f++){g.concat(e,d.getElementsByTagName(c))
}return e
}else{a=this[b](a)
}if(c=="*"){return a
}}for(var f=0,d;
d=a[f];
f++){if(d.tagName.toUpperCase()===k){e.push(d)
}}return e
}else{return j.getElementsByTagName(c)
}},id:function(a,l,b,c){var k=$(b),g=Selector.handlers;
if(l==document){if(!k){return[]
}if(!a){return[k]
}}else{if(!l.sourceIndex||l.sourceIndex<1){var a=l.getElementsByTagName("*");
for(var e=0,d;
d=a[e];
e++){if(d.id===b){return[d]
}}}}if(a){if(c){if(c=="child"){for(var f=0,d;
d=a[f];
f++){if(k.parentNode==d){return[k]
}}}else{if(c=="descendant"){for(var f=0,d;
d=a[f];
f++){if(Element.descendantOf(k,d)){return[k]
}}}else{if(c=="adjacent"){for(var f=0,d;
d=a[f];
f++){if(Selector.handlers.previousElementSibling(k)==d){return[k]
}}}else{a=g[c](a)
}}}}for(var f=0,d;
d=a[f];
f++){if(d==k){return[k]
}}return[]
}return(k&&Element.descendantOf(k,l))?[k]:[]
},className:function(b,a,c,d){if(b&&d){b=this[d](b)
}return Selector.handlers.byClassName(b,a,c)
},byClassName:function(c,b,f){if(!c){c=Selector.handlers.descendant([b])
}var h=" "+f+" ";
for(var e=0,d=[],g,a;
g=c[e];
e++){a=g.className;
if(a.length==0){continue
}if(a==f||(" "+a+" ").include(h)){d.push(g)
}}return d
},attrPresence:function(c,b,a,g){if(!c){c=b.getElementsByTagName("*")
}if(c&&g){c=this[g](c)
}var e=[];
for(var d=0,f;
f=c[d];
d++){if(Element.hasAttribute(f,a)){e.push(f)
}}return e
},attr:function(a,j,h,k,c,b){if(!a){a=j.getElementsByTagName("*")
}if(a&&b){a=this[b](a)
}var l=Selector.operators[c],f=[];
for(var e=0,d;
d=a[e];
e++){var g=Element.readAttribute(d,h);
if(g===null){continue
}if(l(g,k)){f.push(d)
}}return f
},pseudo:function(b,c,e,a,d){if(b&&d){b=this[d](b)
}if(!b){b=a.getElementsByTagName("*")
}return Selector.pseudos[c](b,e,a)
}},pseudos:{"first-child":function(b,f,a){for(var d=0,c=[],e;
e=b[d];
d++){if(Selector.handlers.previousElementSibling(e)){continue
}c.push(e)
}return c
},"last-child":function(b,f,a){for(var d=0,c=[],e;
e=b[d];
d++){if(Selector.handlers.nextElementSibling(e)){continue
}c.push(e)
}return c
},"only-child":function(b,g,a){var e=Selector.handlers;
for(var d=0,c=[],f;
f=b[d];
d++){if(!e.previousElementSibling(f)&&!e.nextElementSibling(f)){c.push(f)
}}return c
},"nth-child":function(b,c,a){return Selector.pseudos.nth(b,c,a)
},"nth-last-child":function(b,c,a){return Selector.pseudos.nth(b,c,a,true)
},"nth-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,false,true)
},"nth-last-of-type":function(b,c,a){return Selector.pseudos.nth(b,c,a,true,true)
},"first-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,false,true)
},"last-of-type":function(b,c,a){return Selector.pseudos.nth(b,"1",a,true,true)
},"only-of-type":function(b,d,a){var c=Selector.pseudos;
return c["last-of-type"](c["first-of-type"](b,d,a),d,a)
},getIndices:function(d,c,e){if(d==0){return c>0?[c]:[]
}return $R(1,e).inject([],function(a,b){if(0==(b-c)%d&&(b-c)/d>=0){a.push(b)
}return a
})
},nth:function(c,s,u,r,e){if(c.length==0){return[]
}if(s=="even"){s="2n+0"
}if(s=="odd"){s="2n+1"
}var q=Selector.handlers,p=[],d=[],g;
q.mark(c);
for(var o=0,f;
f=c[o];
o++){if(!f.parentNode._countedByPrototype){q.index(f.parentNode,r,e);
d.push(f.parentNode)
}}if(s.match(/^\d+$/)){s=Number(s);
for(var o=0,f;
f=c[o];
o++){if(f.nodeIndex==s){p.push(f)
}}}else{if(g=s.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(g[1]=="-"){g[1]=-1
}var v=g[1]?Number(g[1]):1;
var t=g[2]?Number(g[2]):0;
var w=Selector.pseudos.getIndices(v,t,c.length);
for(var o=0,f,k=w.length;
f=c[o];
o++){for(var n=0;
n<k;
n++){if(f.nodeIndex==w[n]){p.push(f)
}}}}}q.unmark(c);
q.unmark(d);
return p
},empty:function(b,f,a){for(var d=0,c=[],e;
e=b[d];
d++){if(e.tagName=="!"||e.firstChild){continue
}c.push(e)
}return c
},not:function(a,d,k){var g=Selector.handlers,l,c;
var j=new Selector(d).findElements(k);
g.mark(j);
for(var f=0,e=[],b;
b=a[f];
f++){if(!b._countedByPrototype){e.push(b)
}}g.unmark(j);
return e
},enabled:function(b,f,a){for(var d=0,c=[],e;
e=b[d];
d++){if(!e.disabled&&(!e.type||e.type!=="hidden")){c.push(e)
}}return c
},disabled:function(b,f,a){for(var d=0,c=[],e;
e=b[d];
d++){if(e.disabled){c.push(e)
}}return c
},checked:function(b,f,a){for(var d=0,c=[],e;
e=b[d];
d++){if(e.checked){c.push(e)
}}return c
}},operators:{"=":function(b,a){return b==a
},"!=":function(b,a){return b!=a
},"^=":function(b,a){return b==a||b&&b.startsWith(a)
},"$=":function(b,a){return b==a||b&&b.endsWith(a)
},"*=":function(b,a){return b==a||b&&b.include(a)
},"~=":function(b,a){return(" "+b+" ").include(" "+a+" ")
},"|=":function(b,a){return("-"+(b||"").toUpperCase()+"-").include("-"+(a||"").toUpperCase()+"-")
}},split:function(b){var a=[];
b.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(c){a.push(c[1].strip())
});
return a
},matchElements:function(f,g){var e=$$(g),d=Selector.handlers;
d.mark(e);
for(var c=0,b=[],a;
a=f[c];
c++){if(a._countedByPrototype){b.push(a)
}}d.unmark(e);
return b
},findElement:function(b,c,a){if(Object.isNumber(c)){a=c;
c=false
}return Selector.matchElements(b,c||"*")[a||0]
},findChildElements:function(e,g){g=Selector.split(g.join(","));
var d=[],f=Selector.handlers;
for(var c=0,b=g.length,a;
c<b;
c++){a=new Selector(g[c].strip());
f.concat(d,a.findElements(e))
}return(b>1)?f.unique(d):d
}});
if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var e=0,f;
f=c[e];
e++){if(f.tagName!=="!"){d.push(f)
}}return d
}})
}function $$(){return Selector.findChildElements(document,$A(arguments))
}var Form={reset:function(a){a=$(a);
a.reset();
return a
},serializeElements:function(g,b){if(typeof b!="object"){b={hash:!!b}
}else{if(Object.isUndefined(b.hash)){b.hash=true
}}var c,f,a=false,e=b.submit;
var d=g.inject({},function(h,i){if(!i.disabled&&i.name){c=i.name;
f=$(i).getValue();
if(f!=null&&i.type!="file"&&(i.type!="submit"||(!a&&e!==false&&(!e||c==e)&&(a=true)))){if(c in h){if(!Object.isArray(h[c])){h[c]=[h[c]]
}h[c].push(f)
}else{h[c]=f
}}}return h
});
return b.hash?d:Object.toQueryString(d)
}};
Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)
},getElements:function(e){var f=$(e).getElementsByTagName("*"),d,a=[],c=Form.Element.Serializers;
for(var b=0;
d=f[b];
b++){a.push(d)
}return a.inject([],function(g,h){if(c[h.tagName.toLowerCase()]){g.push(Element.extend(h))
}return g
})
},getInputs:function(g,c,d){g=$(g);
var a=g.getElementsByTagName("input");
if(!c&&!d){return $A(a).map(Element.extend)
}for(var e=0,h=[],f=a.length;
e<f;
e++){var b=a[e];
if((c&&b.type!=c)||(d&&b.name!=d)){continue
}h.push(Element.extend(b))
}return h
},disable:function(a){a=$(a);
Form.getElements(a).invoke("disable");
return a
},enable:function(a){a=$(a);
Form.getElements(a).invoke("enable");
return a
},findFirstElement:function(b){var c=$(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled
});
var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0
}).sortBy(function(d){return d.tabIndex
}).first();
return a?a:c.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)
})
},focusFirstElement:function(a){a=$(a);
a.findFirstElement().activate();
return a
},request:function(b,a){b=$(b),a=Object.clone(a||{});
var d=a.parameters,c=b.readAttribute("action")||"";
if(c.blank()){c=window.location.href
}a.parameters=b.serialize(true);
if(d){if(Object.isString(d)){d=d.toQueryParams()
}Object.extend(a.parameters,d)
}if(b.hasAttribute("method")&&!a.method){a.method=b.method
}return new Ajax.Request(c,a)
}};
Form.Element={focus:function(a){$(a).focus();
return a
},select:function(a){$(a).select();
return a
}};
Form.Element.Methods={serialize:function(a){a=$(a);
if(!a.disabled&&a.name){var b=a.getValue();
if(b!=undefined){var c={};
c[a.name]=b;
return Object.toQueryString(c)
}}return""
},getValue:function(a){a=$(a);
var b=a.tagName.toLowerCase();
return Form.Element.Serializers[b](a)
},setValue:function(a,b){a=$(a);
var c=a.tagName.toLowerCase();
Form.Element.Serializers[c](a,b);
return a
},clear:function(a){$(a).value="";
return a
},present:function(a){return $(a).value!=""
},activate:function(a){a=$(a);
try{a.focus();
if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()
}}catch(b){}return a
},disable:function(a){a=$(a);
a.disabled=true;
return a
},enable:function(a){a=$(a);
a.disabled=false;
return a
}};
var Field=Form.Element;
var $F=Form.Element.Methods.getValue;
Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(a,b);
default:return Form.Element.Serializers.textarea(a,b)
}},inputSelector:function(a,b){if(Object.isUndefined(b)){return a.checked?a.value:null
}else{a.checked=!!b
}},textarea:function(a,b){if(Object.isUndefined(b)){return a.value
}else{a.value=b
}},select:function(c,f){if(Object.isUndefined(f)){return this[c.type=="select-one"?"selectOne":"selectMany"](c)
}else{var b,d,g=!Object.isArray(f);
for(var a=0,e=c.length;
a<e;
a++){b=c.options[a];
d=this.optionValue(b);
if(g){if(d==f){b.selected=true;
return
}}else{b.selected=f.include(d)
}}}},selectOne:function(b){var a=b.selectedIndex;
return a>=0?this.optionValue(b.options[a]):null
},selectMany:function(d){var a,e=d.length;
if(!e){return null
}for(var c=0,a=[];
c<e;
c++){var b=d.options[c];
if(b.selected){a.push(this.optionValue(b))
}}return a
},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text
}};
Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);
this.element=$(a);
this.lastValue=this.getValue()
},execute:function(){var a=this.getValue();
if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);
this.lastValue=a
}}});
Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)
}});
Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)
}});
Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);
this.callback=b;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()
}else{this.registerCallback(this.element)
}},onElementEvent:function(){var a=this.getValue();
if(this.lastValue!=a){this.callback(this.element,a);
this.lastValue=a
}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)
},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));
break;
default:Event.observe(a,"change",this.onElementEvent.bind(this));
break
}}}});
Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)
}});
Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)
}});
(function(){var v={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};
var e=document.documentElement;
var w="onmouseenter" in e&&"onmouseleave" in e;
var o;
if(Prototype.Browser.IE){var h={0:1,1:4,2:2};
o=function(y,x){return y.button===h[x]
}
}else{if(Prototype.Browser.WebKit){o=function(y,x){switch(x){case 0:return y.which==1&&!y.metaKey;
case 1:return y.which==1&&y.metaKey;
default:return false
}}
}else{o=function(y,x){return y.which?(y.which===x+1):(y.button===x)
}
}}function r(x){return o(x,0)
}function q(x){return o(x,1)
}function k(x){return o(x,2)
}function c(z){z=v.extend(z);
var y=z.target,x=z.type,A=z.currentTarget;
if(A&&A.tagName){if(x==="load"||x==="error"||(x==="click"&&A.tagName.toLowerCase()==="input"&&A.type==="radio")){y=A
}}if(y.nodeType==Node.TEXT_NODE){y=y.parentNode
}return Element.extend(y)
}function m(y,A){var x=v.element(y);
if(!A){return x
}var z=[x].concat(x.ancestors());
return Selector.findElement(z,A,0)
}function p(x){return{x:b(x),y:a(x)}
}function b(z){var y=document.documentElement,x=document.body||{scrollLeft:0};
return z.pageX||(z.clientX+(y.scrollLeft||x.scrollLeft)-(y.clientLeft||0))
}function a(z){var y=document.documentElement,x=document.body||{scrollTop:0};
return z.pageY||(z.clientY+(y.scrollTop||x.scrollTop)-(y.clientTop||0))
}function n(x){v.extend(x);
x.preventDefault();
x.stopPropagation();
x.stopped=true
}v.Methods={isLeftClick:r,isMiddleClick:q,isRightClick:k,element:c,findElement:m,pointer:p,pointerX:b,pointerY:a,stop:n};
var t=Object.keys(v.Methods).inject({},function(x,y){x[y]=v.Methods[y].methodize();
return x
});
if(Prototype.Browser.IE){function g(y){var x;
switch(y.type){case"mouseover":case"mouseenter":x=y.fromElement;
break;
case"mouseout":case"mouseleave":x=y.toElement;
break;
default:return null
}return Element.extend(x)
}Object.extend(t,{stopPropagation:function(){this.cancelBubble=true
},preventDefault:function(){this.returnValue=false
},inspect:function(){return"[object Event]"
}});
v.extend=function(y,x){if(!y){return false
}if(y._extendedByPrototype){return y
}y._extendedByPrototype=Prototype.emptyFunction;
var z=v.pointer(y);
Object.extend(y,{target:y.srcElement||x,relatedTarget:g(y),pageX:z.x,pageY:z.y});
return Object.extend(y,t)
}
}else{v.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;
Object.extend(v.prototype,t);
v.extend=Prototype.K
}function l(B,A,C){var z=Element.retrieve(B,"prototype_event_registry");
if(Object.isUndefined(z)){d.push(B);
z=Element.retrieve(B,"prototype_event_registry",$H())
}var x=z.get(A);
if(Object.isUndefined(x)){x=[];
z.set(A,x)
}if(x.pluck("handler").include(C)){return false
}var y;
if(A.include(":")){y=function(D){if(Object.isUndefined(D.eventName)){return false
}if(D.eventName!==A){return false
}v.extend(D,B);
C.call(B,D)
}
}else{if(!w&&(A==="mouseenter"||A==="mouseleave")){if(A==="mouseenter"||A==="mouseleave"){y=function(E){v.extend(E,B);
var D=E.relatedTarget;
while(D&&D!==B){try{D=D.parentNode
}catch(F){D=B
}}if(D===B){return
}C.call(B,E)
}
}}else{y=function(D){v.extend(D,B);
C.call(B,D)
}
}}y.handler=C;
x.push(y);
return y
}function f(){for(var x=0,y=d.length;
x<y;
x++){v.stopObserving(d[x]);
d[x]=null
}}var d=[];
if(Prototype.Browser.IE){window.attachEvent("onunload",f)
}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)
}var j=Prototype.K;
if(!w){j=function(y){var x={mouseenter:"mouseover",mouseleave:"mouseout"};
return y in x?x[y]:y
}
}function s(A,z,B){A=$(A);
var y=l(A,z,B);
if(!y){return A
}if(z.include(":")){if(A.addEventListener){A.addEventListener("dataavailable",y,false)
}else{A.attachEvent("ondataavailable",y);
A.attachEvent("onfilterchange",y)
}}else{var x=j(z);
if(A.addEventListener){A.addEventListener(x,y,false)
}else{A.attachEvent("on"+x,y)
}}return A
}function i(C,A,D){C=$(C);
var z=Element.retrieve(C,"prototype_event_registry");
if(Object.isUndefined(z)){return C
}if(A&&!D){var B=z.get(A);
if(Object.isUndefined(B)){return C
}B.each(function(E){Element.stopObserving(C,A,E.handler)
});
return C
}else{if(!A){z.each(function(G){var E=G.key,F=G.value;
F.each(function(H){Element.stopObserving(C,E,H.handler)
})
});
return C
}}var B=z.get(A);
if(!B){return
}var y=B.find(function(E){return E.handler===D
});
if(!y){return C
}var x=j(A);
if(A.include(":")){if(C.removeEventListener){C.removeEventListener("dataavailable",y,false)
}else{C.detachEvent("ondataavailable",y);
C.detachEvent("onfilterchange",y)
}}else{if(C.removeEventListener){C.removeEventListener(x,y,false)
}else{C.detachEvent("on"+x,y)
}}z.set(A,B.without(y));
return C
}function u(A,z,y,x){A=$(A);
if(Object.isUndefined(x)){x=true
}if(A==document&&document.createEvent&&!A.dispatchEvent){A=document.documentElement
}var B;
if(document.createEvent){B=document.createEvent("HTMLEvents");
B.initEvent("dataavailable",true,true)
}else{B=document.createEventObject();
B.eventType=x?"ondataavailable":"onfilterchange"
}B.eventName=z;
B.memo=y||{};
if(document.createEvent){A.dispatchEvent(B)
}else{A.fireEvent(B.eventType,B)
}return v.extend(B)
}Object.extend(v,v.Methods);
Object.extend(v,{fire:u,observe:s,stopObserving:i});
Element.addMethods({fire:u,observe:s,stopObserving:i});
Object.extend(document,{fire:u.methodize(),observe:s.methodize(),stopObserving:i.methodize(),loaded:false});
if(window.Event){Object.extend(window.Event,v)
}else{window.Event=v
}})();
(function(){var d;
function a(){if(document.loaded){return
}if(d){window.clearTimeout(d)
}document.loaded=true;
document.fire("dom:loaded")
}function c(){if(document.readyState==="complete"){document.stopObserving("readystatechange",c);
a()
}}function b(){try{document.documentElement.doScroll("left")
}catch(f){d=b.defer();
return
}a()
}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)
}else{document.observe("readystatechange",c);
if(window==top){d=b.defer()
}}Event.observe(window,"load",a)
})();
Element.addMethods();
Hash.toQueryString=Object.toQueryString;
var Toggle={display:Element.toggle};
Element.Methods.childOf=Element.Methods.descendantOf;
var Insertion={Before:function(a,b){return Element.insert(a,{before:b})
},Top:function(a,b){return Element.insert(a,{top:b})
},Bottom:function(a,b){return Element.insert(a,{bottom:b})
},After:function(a,b){return Element.insert(a,{after:b})
}};
var $continue=new Error('"throw $continue" is deprecated, use "return" instead');
var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0
},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)
}this.xcomp=a;
this.ycomp=c;
this.offset=Element.cumulativeOffset(b);
return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)
},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);
this.xcomp=a+c[0]-this.deltaX;
this.ycomp=d+c[1]-this.deltaY;
this.offset=Element.cumulativeOffset(b);
return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)
},overlap:function(b,a){if(!b){return 0
}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight
}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth
}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();
return Element.absolutize(a)
},relativize:function(a){Position.prepare();
return Element.relativize(a)
},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};
return Element.clonePosition(c,b,a)
}};
if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"
}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,e){e=e.toString().strip();
var d=/\s/.test(e)?$w(e).map(a).join(""):a(e);
return d?document._getElementsByXPath(".//*"+d,c):[]
}:function(e,f){f=f.toString().strip();
var g=[],h=(/\s/.test(f)?$w(f):null);
if(!h&&!f){return g
}var c=$(e).getElementsByTagName("*");
f=" "+f+" ";
for(var d=0,k,j;
k=c[d];
d++){if(k.className&&(j=" "+k.className+" ")&&(j.include(f)||(h&&h.all(function(i){return !i.toString().blank()&&j.include(" "+i+" ")
})))){g.push(Element.extend(k))
}}return g
};
return function(d,c){return $(c||document.body).getElementsByClassName(d)
}
}(Element.Methods)
}Element.ClassNames=Class.create();
Element.ClassNames.prototype={initialize:function(a){this.element=$(a)
},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0
})._each(a)
},set:function(a){this.element.className=a
},add:function(a){if(this.include(a)){return
}this.set($A(this).concat(a).join(" "))
},remove:function(a){if(!this.include(a)){return
}this.set($A(this).without(a).join(" "))
},toString:function(){return $A(this).join(" ")
}};
Object.extend(Element.ClassNames.prototype,Enumerable);
String.prototype.parseColor=function(){var a="#";
if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");
var b=0;
do{a+=parseInt(c[b]).toColorPart()
}while(++b<3)
}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;
b<4;
b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()
}}if(this.length==7){a=this.toLowerCase()
}}}return(a.length==7?a:(arguments[0]||this))
};
Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))
}).flatten().join("")
};
Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))
}).flatten().join("")
};
Element.setContentZoom=function(a,b){a=$(a);
a.setStyle({fontSize:(b/100)+"em"});
if(Prototype.Browser.WebKit){window.scrollBy(0,0)
}return a
};
Element.getInlineOpacity=function(a){return $(a).style.opacity||""
};
Element.forceRerendering=function(a){try{a=$(a);
var c=document.createTextNode(" ");
a.appendChild(c);
a.removeChild(c)
}catch(b){}};
var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5
},reverse:function(a){return 1-a
},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;
return a>1?1:a
},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5
},pulse:function(b,a){return(-Math.cos((b*((a||5)-0.5)*2)*Math.PI)/2)+0.5
},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))
},none:function(a){return 0
},full:function(a){return 1
}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";
if(Prototype.Browser.IE){b+=";zoom:1"
}a=$(a);
$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(d==" "?String.fromCharCode(160):d),c)
});
Element.remove(c)
}})
},multiple:function(b,c){var e;
if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){e=b
}else{e=$(b).childNodes
}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var d=a.delay;
$A(e).each(function(g,f){new c(g,Object.extend(a,{delay:f*a.speed+d}))
})
},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c){b=$(b);
c=(c||"appear").toLowerCase();
var a=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});
Effect[b.visible()?Effect.PAIRS[c][1]:Effect.PAIRS[c][0]](b,a)
}};
Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];
this.interval=null
},_each:function(a){this.effects._each(a)
},add:function(b){var c=new Date().getTime();
var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;
switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"
}).each(function(d){d.startOn+=b.finishOn;
d.finishOn+=b.finishOn
});
break;
case"with-last":c=this.effects.pluck("startOn").max()||c;
break;
case"end":c=this.effects.pluck("finishOn").max()||c;
break
}b.startOn+=c;
b.finishOn+=c;
if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)
}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)
}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a
});
if(this.effects.length==0){clearInterval(this.interval);
this.interval=null
}},loop:function(){var c=new Date().getTime();
for(var b=0,a=this.effects.length;
b<a;
b++){this.effects[b]&&this.effects[b].loop(c)
}}});
Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a
}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())
}};
Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(a){function b(d,c){return((d[c+"Internal"]?"this.options."+c+"Internal(this);":"")+(d[c]?"this.options."+c+"(this);":""))
}if(a&&a.transition===false){a.transition=Effect.Transitions.linear
}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});
this.currentFrame=0;
this.state="idle";
this.startOn=this.options.delay*1000;
this.finishOn=this.startOn+(this.options.duration*1000);
this.fromToDelta=this.options.to-this.options.from;
this.totalTime=this.finishOn-this.startOn;
this.totalFrames=this.options.fps*this.options.duration;
this.render=(function(){function c(e,d){if(e.options[d+"Internal"]){e.options[d+"Internal"](e)
}if(e.options[d]){e.options[d](e)
}}return function(d){if(this.state==="idle"){this.state="running";
c(this,"beforeSetup");
if(this.setup){this.setup()
}c(this,"afterSetup")
}if(this.state==="running"){d=(this.options.transition(d)*this.fromToDelta)+this.options.from;
this.position=d;
c(this,"beforeUpdate");
if(this.update){this.update(d)
}c(this,"afterUpdate")
}}
})();
this.event("beforeStart");
if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)
}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);
this.cancel();
this.event("beforeFinish");
if(this.finish){this.finish()
}this.event("afterFinish");
return
}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();
if(a>this.currentFrame){this.render(b);
this.currentFrame=a
}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)
}this.state="finished"
},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)
}if(this.options[a]){this.options[a](this)
}},inspect:function(){var a=$H();
for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])
}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"
}});
Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];
this.start(arguments[1])
},update:function(a){this.effects.invoke("render",a)
},finish:function(a){this.effects.each(function(b){b.render(1);
b.cancel();
b.event("beforeFinish");
if(b.finish){b.finish(a)
}b.event("afterFinish")
})
}});
Effect.Tween=Class.create(Effect.Base,{initialize:function(c,f,e){c=Object.isString(c)?$(c):c;
var b=$A(arguments),d=b.last(),a=b.length==5?b[3]:null;
this.method=Object.isFunction(d)?d.bind(c):Object.isFunction(c[d])?c[d].bind(c):function(g){c[d]=g
};
this.start(Object.extend({from:f,to:e},a||{}))
},update:function(a){this.method(a)
}});
Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))
},update:Prototype.emptyFunction});
Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)
}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})
}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(a)
},update:function(a){this.element.setOpacity(a)
}});
Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});
this.start(a)
},setup:function(){this.element.makePositioned();
this.originalLeft=parseFloat(this.element.getStyle("left")||"0");
this.originalTop=parseFloat(this.element.getStyle("top")||"0");
if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;
this.options.y=this.options.y-this.originalTop
}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})
}});
Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))
};
Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});
this.start(a)
},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");
this.originalStyle={};
["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]
}.bind(this));
this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;
var a=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);
this.fontSizeType=b
}}.bind(this));
this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;
this.dims=null;
if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]
}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]
}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]
}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);
if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})
}this.setDimensions(this.dims[0]*b,this.dims[1]*b)
},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)
}},setDimensions:function(a,e){var f={};
if(this.options.scaleX){f.width=e.round()+"px"
}if(this.options.scaleY){f.height=a.round()+"px"
}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;
var b=(e-this.dims[1])/2;
if(this.elementPositioning=="absolute"){if(this.options.scaleY){f.top=this.originalTop-c+"px"
}if(this.options.scaleX){f.left=this.originalLeft-b+"px"
}}else{if(this.options.scaleY){f.top=-c+"px"
}if(this.options.scaleX){f.left=-b+"px"
}}}this.element.setStyle(f)
}});
Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});
this.start(a)
},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();
return
}this.oldStyle={};
if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");
this.element.setStyle({backgroundImage:"none"})
}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")
}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")
}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)
}.bind(this));
this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]
}.bind(this))
},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+((this._base[d]+(this._delta[d]*a)).round().toColorPart())
}.bind(this))})
},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))
}});
Effect.ScrollTo=function(c){var b=arguments[1]||{},a=document.viewport.getScrollOffsets(),d=$(c).cumulativeOffset();
if(b.offset){d[1]+=b.offset
}return new Effect.Tween(null,a.top,d[1],b,function(e){scrollTo(a.left,e.round())
})
};
Effect.Fade=function(c){c=$(c);
var a=c.getInlineOpacity();
var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return
}d.element.hide().setStyle({opacity:a})
}},arguments[1]||{});
return new Effect.Opacity(c,b)
};
Effect.Appear=function(b){b=$(b);
var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()
},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()
}},arguments[1]||{});
return new Effect.Opacity(b,a)
};
Effect.Puff=function(b){b=$(b);
var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};
return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)
},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)
}},arguments[1]||{}))
};
Effect.BlindUp=function(a){a=$(a);
a.makeClipping();
return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()
}},arguments[1]||{}))
};
Effect.BlindDown=function(b){b=$(b);
var a=b.getDimensions();
return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()
},afterFinishInternal:function(c){c.element.undoClipping()
}},arguments[1]||{}))
};
Effect.SwitchOff=function(b){b=$(b);
var a=b.getInlineOpacity();
return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()
},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})
}})
}},arguments[1]||{}))
};
Effect.DropOut=function(b){b=$(b);
var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()
},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)
}},arguments[1]||{}))
};
Effect.Shake=function(d){d=$(d);
var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});
var e=parseFloat(b.distance);
var c=parseFloat(b.duration)/10;
var a={top:d.getStyle("top"),left:d.getStyle("left")};
return new Effect.Move(d,{x:e,y:0,duration:c,afterFinishInternal:function(f){new Effect.Move(f.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(g){new Effect.Move(g.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(i){new Effect.Move(i.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:-e,y:0,duration:c,afterFinishInternal:function(k){k.element.undoPositioned().setStyle(a)
}})
}})
}})
}})
}})
}})
};
Effect.SlideDown=function(c){c=$(c).cleanWhitespace();
var a=c.down().getStyle("bottom");
var b=c.getDimensions();
return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();
d.element.down().makePositioned();
if(window.opera){d.element.setStyle({top:""})
}d.element.makeClipping().setStyle({height:"0px"}).show()
},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})
},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();
d.element.down().undoPositioned().setStyle({bottom:a})
}},arguments[1]||{}))
};
Effect.SlideUp=function(c){c=$(c).cleanWhitespace();
var a=c.down().getStyle("bottom");
var b=c.getDimensions();
return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();
d.element.down().makePositioned();
if(window.opera){d.element.setStyle({top:""})
}d.element.makeClipping().show()
},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})
},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();
d.element.down().undoPositioned().setStyle({bottom:a})
}},arguments[1]||{}))
};
Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()
},afterFinishInternal:function(b){b.element.hide().undoClipping()
}})
};
Effect.Grow=function(c){c=$(c);
var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};
var g=c.getDimensions();
var h,f;
var e,d;
switch(b.direction){case"top-left":h=f=e=d=0;
break;
case"top-right":h=g.width;
f=d=0;
e=-g.width;
break;
case"bottom-left":h=e=0;
f=g.height;
d=-g.height;
break;
case"bottom-right":h=g.width;
f=g.height;
e=-g.width;
d=-g.height;
break;
case"center":h=g.width/2;
f=g.height/2;
e=-g.width/2;
d=-g.height/2;
break
}return new Effect.Move(c,{x:h,y:f,duration:0.01,beforeSetup:function(i){i.element.hide().makeClipping().makePositioned()
},afterFinishInternal:function(i){new Effect.Parallel([new Effect.Opacity(i.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(i.element,{x:e,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(i.element,100,{scaleMode:{originalHeight:g.height,originalWidth:g.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(j){j.effects[0].element.setStyle({height:"0px"}).show()
},afterFinishInternal:function(j){j.effects[0].element.undoClipping().undoPositioned().setStyle(a)
}},b))
}})
};
Effect.Shrink=function(c){c=$(c);
var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};
var f=c.getDimensions();
var e,d;
switch(b.direction){case"top-left":e=d=0;
break;
case"top-right":e=f.width;
d=0;
break;
case"bottom-left":e=0;
d=f.height;
break;
case"bottom-right":e=f.width;
d=f.height;
break;
case"center":e=f.width/2;
d=f.height/2;
break
}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:e,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()
},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)
}},b))
};
Effect.Pulsate=function(c){c=$(c);
var b=arguments[1]||{},a=c.getInlineOpacity(),e=b.transition||Effect.Transitions.linear,d=function(f){return 1-e((-Math.cos((f*(b.pulses||5)*2)*Math.PI)/2)+0.5)
};
return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(f){f.element.setStyle({opacity:a})
}},b),{transition:d}))
};
Effect.Fold=function(b){b=$(b);
var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};
b.makeClipping();
return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a)
}})
}},arguments[1]||{}))
};
Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);
if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({style:{}},arguments[1]||{});
if(!Object.isString(a.style)){this.style=$H(a.style)
}else{if(a.style.include(":")){this.style=a.style.parseStyle()
}else{this.element.addClassName(a.style);
this.style=$H(this.element.getStyles());
this.element.removeClassName(a.style);
var b=this.element.getStyles();
this.style=this.style.reject(function(d){return d.value==b[d.key]
});
a.afterFinishInternal=function(d){d.element.addClassName(d.options.style);
d.transforms.each(function(e){d.element.style[e.style]=""
})
}
}}this.start(a)
},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"
}b=b.parseColor();
return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)
})
}this.transforms=this.style.map(function(g){var f=g[0],e=g[1],d=null;
if(e.parseColor("#zzzzzz")!="#zzzzzz"){e=e.parseColor();
d="color"
}else{if(f=="opacity"){e=parseFloat(e);
if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})
}}else{if(Element.CSS_LENGTH.test(e)){var c=e.match(/^([\+\-]?[0-9\.]+)(.*)$/);
e=parseFloat(c[1]);
d=(c.length==3)?c[2]:null
}}}var b=this.element.getStyle(f);
return{style:f.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(e):e,unit:d}
}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))
})
},update:function(a){var d={},b,c=this.transforms.length;
while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit)
}this.element.setStyle(d,true)
}});
Effect.Transform=Class.create({initialize:function(a){this.tracks=[];
this.options=arguments[1]||{};
this.addTracks(a)
},addTracks:function(a){a.each(function(b){b=$H(b);
var c=b.values().first();
this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))
}.bind(this));
return this
},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var d=a.get("ids"),c=a.get("effect"),b=a.get("options");
var e=[$(d)||$$(d)].flatten();
return e.map(function(f){return new c(f,Object.extend({sync:true},b))
})
}).flatten(),this.options)
}});
Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
String.__parseStyleElement=document.createElement("div");
String.prototype.parseStyle=function(){var b,a=$H();
if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style
}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';
b=String.__parseStyleElement.childNodes[0].style
}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c])
}});
if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])
}return a
};
if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);
return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=a[d];
return c
})
}
}else{Element.getStyles=function(b){b=$(b);
var a=b.currentStyle,c;
c=Element.CSS_PROPERTIES.inject({},function(d,e){d[e]=a[e];
return d
});
if(!c.opacity){c.opacity=b.getOpacity()
}return c
}
}Effect.Methods={morph:function(a,b){a=$(a);
new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));
return a
},visualEffect:function(c,e,b){c=$(c);
var d=e.dasherize().camelize(),a=d.charAt(0).toUpperCase()+d.substring(1);
new Effect[a](c,b);
return c
},highlight:function(b,a){b=$(b);
new Effect.Highlight(b,a);
return b
}};
$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);
Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);
return c
}
});
$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]
});
Element.addMethods(Effect.Methods);
if(typeof(Control)=="undefined"){Control={}
}var $proc=function(a){return typeof(a)=="function"?a:function(){return a
}
};
var $value=function(a){return typeof(a)=="function"?a():a
};
Object.Event={extend:function(a){a._objectEventSetup=function(b){this._observers=this._observers||{};
this._observers[b]=this._observers[b]||[]
};
a.observe=function(d,b){if(typeof(d)=="string"&&typeof(b)!="undefined"){this._objectEventSetup(d);
if(!this._observers[d].include(b)){this._observers[d].push(b)
}}else{for(var c in d){this.observe(c,d[c])
}}};
a.stopObserving=function(c,b){this._objectEventSetup(c);
if(c&&b){this._observers[c]=this._observers[c].without(b)
}else{if(c){this._observers[c]=[]
}else{this._observers={}
}}};
a.observeOnce=function(d,c){var b=function(){c.apply(this,arguments);
this.stopObserving(d,b)
}.bind(this);
this._objectEventSetup(d);
this._observers[d].push(b)
};
a.notify=function(g){this._objectEventSetup(g);
var d=[];
var b=$A(arguments).slice(1);
try{for(var c=0;
c<this._observers[g].length;
++c){d.push(this._observers[g][c].apply(this._observers[g][c],b)||null)
}}catch(f){if(f==$break){return false
}else{throw f
}}return d
};
if(a.prototype){a.prototype._objectEventSetup=a._objectEventSetup;
a.prototype.observe=a.observe;
a.prototype.stopObserving=a.stopObserving;
a.prototype.observeOnce=a.observeOnce;
a.prototype.notify=function(g){if(a.notify){var b=$A(arguments).slice(1);
b.unshift(this);
b.unshift(g);
a.notify.apply(a,b)
}this._objectEventSetup(g);
var b=$A(arguments).slice(1);
var d=[];
try{if(this.options&&this.options[g]&&typeof(this.options[g])=="function"){d.push(this.options[g].apply(this,b)||null)
}for(var c=0;
c<this._observers[g].length;
++c){d.push(this._observers[g][c].apply(this._observers[g][c],b)||null)
}}catch(f){if(f==$break){return false
}else{throw f
}}return d
}
}}};
Element.addMethods({observeOnce:function(c,d,b){var a=function(){b.apply(this,arguments);
Element.stopObserving(c,d,a)
};
Element.observe(c,d,a)
}});
Object.extend(Event,Event.Methods);
Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});
Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize()});
(function(){function a(c){var d;
if(c.wheelDelta){d=c.wheelDelta/120
}else{if(c.detail){d=-c.detail/3
}}if(!d){return
}var b=Event.element(c).fire("mouse:wheel",{delta:d});
if(b.stopped){Event.stop(c);
return false
}}document.observe("mousewheel",a);
document.observe("DOMMouseScroll",a)
})();
var IframeShim=Class.create({initialize:function(){this.element=new Element("iframe",{style:"position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);display:none",src:"javascript:void(0);",frameborder:0});
$(document.body).insert(this.element)
},hide:function(){this.element.hide();
return this
},show:function(){this.element.show();
return this
},positionUnder:function(a){var a=$(a);
var c=a.cumulativeOffset();
var b=a.getDimensions();
this.element.setStyle({left:c[0]+"px",top:c[1]+"px",width:b.width+"px",height:b.height+"px",zIndex:a.getStyle("zIndex")-1}).show();
return this
},setBounds:function(a){for(prop in a){a[prop]+="px"
}this.element.setStyle(a);
return this
},destroy:function(){if(this.element){this.element.remove()
}return this
}});
if(typeof(Prototype)=="undefined"){throw"Control.Tabs requires Prototype to be loaded."
}if(typeof(Object.Event)=="undefined"){throw"Control.Tabs requires Object.Event to be loaded."
}Control.Tabs=Class.create({initialize:function(c,b){if(!$(c)){throw"Control.Tabs could not find the element: "+c
}this.activeContainer=false;
this.activeLink=false;
this.containers=$H({});
this.links=[];
Control.Tabs.instances.push(this);
this.options={beforeChange:Prototype.emptyFunction,afterChange:Prototype.emptyFunction,hover:false,linkSelector:"li a",setClassOnContainer:false,activeClassName:"active",defaultTab:"first",autoLinkExternal:true,targetRegExp:/#(.+)$/,showFunction:Element.show,hideFunction:Element.hide};
Object.extend(this.options,b||{});
(typeof(this.options.linkSelector=="string")?$(c).select(this.options.linkSelector):this.options.linkSelector($(c))).findAll(function(d){return(/^#/).exec((Prototype.Browser.WebKit?decodeURIComponent(d.href):d.href).replace(window.location.href.split("#")[0],""))
}).each(function(d){this.addTab(d)
}.bind(this));
this.containers.values().each(Element.hide);
if(this.options.defaultTab=="first"){this.setActiveTab(this.links.first())
}else{if(this.options.defaultTab=="last"){this.setActiveTab(this.links.last())
}else{this.setActiveTab(this.options.defaultTab)
}}var a=this.options.targetRegExp.exec(window.location);
if(a&&a[1]){a[1].split(",").each(function(d){this.setActiveTab(this.links.find(function(e){return e.key==d
}))
}.bind(this))
}if(this.options.autoLinkExternal){$A(document.getElementsByTagName("a")).each(function(d){if(!this.links.include(d)){var e=d.href.replace(window.location.href.split("#")[0],"");
if(e.substring(0,1)=="#"){if(this.containers.keys().include(e.substring(1))){$(d).observe("click",function(g,f){this.setActiveTab(f.substring(1))
}.bindAsEventListener(this,e))
}}}}.bind(this))
}},addTab:function(b){this.links.push(b);
b.key=b.getAttribute("href").replace(window.location.href.split("#")[0],"").split("#").last().replace(/#/,"");
var a=$(b.key);
if(!a){throw"Control.Tabs: #"+b.key+" was not found on the page."
}this.containers.set(b.key,a);
b[this.options.hover?"onmouseover":"onclick"]=function(c){if(window.event){Event.stop(window.event)
}this.setActiveTab(c);
return false
}.bind(this,b)
},setActiveTab:function(a){if(!a&&typeof(a)=="undefined"){return
}if(typeof(a)=="string"){this.setActiveTab(this.links.find(function(b){return b.key==a
}))
}else{if(typeof(a)=="number"){this.setActiveTab(this.links[a])
}else{if(this.notify("beforeChange",this.activeContainer,this.containers.get(a.key))===false){return
}if(this.activeContainer){this.options.hideFunction(this.activeContainer)
}this.links.each(function(b){(this.options.setClassOnContainer?$(b.parentNode):b).removeClassName(this.options.activeClassName)
}.bind(this));
(this.options.setClassOnContainer?$(a.parentNode):a).addClassName(this.options.activeClassName);
this.activeContainer=this.containers.get(a.key);
this.activeLink=a;
this.options.showFunction(this.containers.get(a.key));
this.notify("afterChange",this.containers.get(a.key))
}}},next:function(){this.links.each(function(b,a){if(this.activeLink==b&&this.links[a+1]){this.setActiveTab(this.links[a+1]);
throw $break
}}.bind(this))
},previous:function(){this.links.each(function(b,a){if(this.activeLink==b&&this.links[a-1]){this.setActiveTab(this.links[a-1]);
throw $break
}}.bind(this))
},first:function(){this.setActiveTab(this.links.first())
},last:function(){this.setActiveTab(this.links.last())
}});
Object.extend(Control.Tabs,{instances:[],findByTabId:function(a){return Control.Tabs.instances.find(function(b){return b.links.find(function(c){return c.key==a
})
})
}});
Object.Event.extend(Control.Tabs);
if(typeof(Draggable)!="undefined"){Draggable.prototype.draw=function(j){var i=Position.cumulativeOffset(this.element);
if(this.options.ghosting){var a=Position.realOffset(this.element);
i[0]+=a[0]-Position.deltaX;
i[1]+=a[1]-Position.deltaY
}var h=this.currentDelta();
i[0]-=h[0];
i[1]-=h[1];
if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){i[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;
i[1]-=this.options.scroll.scrollTop-this.originalScrollTop
}var c=[0,1].map(function(d){return(j[d]-i[d]-this.offset[d])
}.bind(this));
if(this.options.snap){if(typeof this.options.snap=="function"){c=this.options.snap(c[0],c[1],this)
}else{if(this.options.snap instanceof Array){c=c.map(function(d,m){return Math.round(d/this.options.snap[m])*this.options.snap[m]
}.bind(this))
}else{c=c.map(function(d){return Math.round(d/this.options.snap)*this.options.snap
}.bind(this))
}}}if(this.options.onDraw){this.options.onDraw.bind(this)(c)
}else{var b=this.element.style;
if(this.options.constrainToViewport){var l=document.viewport.getDimensions();
var f=this.element.getDimensions();
var g=parseInt(this.element.getStyle("margin-top"));
var k=parseInt(this.element.getStyle("margin-left"));
var e=[[0-k,0-g],[(l.width-f.width)-k,(l.height-f.height)-g]];
if((!this.options.constraint)||(this.options.constraint=="horizontal")){if((c[0]>=e[0][0])&&(c[0]<=e[1][0])){this.element.style.left=c[0]+"px"
}else{this.element.style.left=((c[0]<e[0][0])?e[0][0]:e[1][0])+"px"
}}if((!this.options.constraint)||(this.options.constraint=="vertical")){if((c[1]>=e[0][1])&&(c[1]<=e[1][1])){this.element.style.top=c[1]+"px"
}else{this.element.style.top=((c[1]<=e[0][1])?e[0][1]:e[1][1])+"px"
}}}else{if((!this.options.constraint)||(this.options.constraint=="horizontal")){b.left=c[0]+"px"
}if((!this.options.constraint)||(this.options.constraint=="vertical")){b.top=c[1]+"px"
}}if(b.visibility=="hidden"){b.visibility=""
}}}
}if(typeof(Prototype)=="undefined"){throw"Control.Window requires Prototype to be loaded."
}if(typeof(IframeShim)=="undefined"){throw"Control.Window requires IframeShim to be loaded."
}if(typeof(Object.Event)=="undefined"){throw"Control.Window requires Object.Event to be loaded."
}Control.Window=Class.create({initialize:function(b,c){Control.Window.windows.push(this);
this.container=false;
this.isOpen=false;
this.href=false;
this.sourceContainer=false;
this.ajaxRequest=false;
this.remoteContentLoaded=false;
this.numberInSequence=Control.Window.windows.length+1;
this.indicator=false;
this.effects={fade:false,appear:false};
this.indicatorEffects={fade:false,appear:false};
this.options=Object.extend({beforeOpen:Prototype.emptyFunction,afterOpen:Prototype.emptyFunction,beforeClose:Prototype.emptyFunction,afterClose:Prototype.emptyFunction,height:null,width:null,className:false,position:"center",offsetLeft:0,offsetTop:0,iframe:false,hover:false,indicator:false,closeOnClick:false,iframeshim:true,fade:false,fadeDuration:0.75,draggable:false,onDrag:Prototype.emptyFunction,resizable:false,minHeight:false,minWidth:false,maxHeight:false,maxWidth:false,onResize:Prototype.emptyFunction,constrainToViewport:false,method:"post",parameters:{},onComplete:Prototype.emptyFunction,onSuccess:Prototype.emptyFunction,onFailure:Prototype.emptyFunction,onException:Prototype.emptyFunction,onRemoteContentLoaded:Prototype.emptyFunction,insertRemoteContentAt:false},c||{});
this.indicator=this.options.indicator?$(this.options.indicator):false;
if(b){if(typeof(b)=="string"&&b.match(Control.Window.uriRegex)){this.href=b
}else{this.container=$(b);
this.createDefaultContainer(b);
if(this.container&&((this.container.readAttribute("href")&&this.container.readAttribute("href")!="")||(this.options.hover&&this.options.hover!==true))){if(this.options.hover&&this.options.hover!==true){this.sourceContainer=$(this.options.hover)
}else{this.sourceContainer=this.container;
this.href=this.container.readAttribute("href");
var a=this.href.match(/^#(.+)$/);
if(a&&a[1]){this.container=$(a[1]);
this.href=false
}else{this.container=false
}}this.sourceContainerOpenHandler=function(e){this.open(e);
e.stop();
return false
}.bindAsEventListener(this);
this.sourceContainerCloseHandler=function(e){this.close(e)
}.bindAsEventListener(this);
this.sourceContainerMouseMoveHandler=function(e){this.position(e)
}.bindAsEventListener(this);
if(this.options.hover){this.sourceContainer.observe("mouseenter",this.sourceContainerOpenHandler);
this.sourceContainer.observe("mouseleave",this.sourceContainerCloseHandler);
if(this.options.position=="mouse"){this.sourceContainer.observe("mousemove",this.sourceContainerMouseMoveHandler)
}}else{this.sourceContainer.observe("click",this.sourceContainerOpenHandler)
}}}}this.createDefaultContainer(b);
if(this.options.insertRemoteContentAt===false){this.options.insertRemoteContentAt=this.container
}var d={margin:0,position:"absolute",zIndex:Control.Window.initialZIndexForWindow()};
if(this.options.width){d.width=$value(this.options.width)+"px"
}if(this.options.height){d.height=$value(this.options.height)+"px"
}this.container.setStyle(d);
if(this.options.className){this.container.addClassName(this.options.className)
}this.positionHandler=this.position.bindAsEventListener(this);
this.outOfBoundsPositionHandler=this.ensureInBounds.bindAsEventListener(this);
this.bringToFrontHandler=this.bringToFront.bindAsEventListener(this);
this.container.observe("mousedown",this.bringToFrontHandler);
this.container.hide();
this.closeHandler=this.close.bindAsEventListener(this);
if(this.options.iframeshim){this.iFrameShim=new IframeShim();
this.iFrameShim.hide()
}this.applyResizable();
this.applyDraggable();
Event.observe(window,"resize",this.outOfBoundsPositionHandler);
this.notify("afterInitialize")
},open:function(c){if(this.isOpen){this.bringToFront();
return false
}if(this.notify("beforeOpen")===false){return false
}if(this.options.closeOnClick){if(this.options.closeOnClick===true){this.closeOnClickContainer=$(document.body)
}else{if(this.options.closeOnClick=="container"){this.closeOnClickContainer=this.container
}else{if(this.options.closeOnClick=="overlay"){Control.Overlay.load();
this.closeOnClickContainer=Control.Overlay.container
}else{this.closeOnClickContainer=$(this.options.closeOnClick)
}}}this.closeOnClickContainer.observe("click",this.closeHandler)
}if(this.href&&!this.options.iframe&&!this.remoteContentLoaded){this.remoteContentLoaded=true;
if(this.href.match(/\.(jpe?g|gif|png|tiff?)$/i)){var a=new Element("img");
a.observe("load",function(d){this.getRemoteContentInsertionTarget().insert(d);
this.position();
if(this.notify("onRemoteContentLoaded")!==false){if(this.options.indicator){this.hideIndicator()
}this.finishOpen()
}}.bind(this,a));
a.writeAttribute("src",this.href)
}else{if(!this.ajaxRequest){if(this.options.indicator){this.showIndicator()
}this.ajaxRequest=new Ajax.Request(this.href,{method:this.options.method,parameters:this.options.parameters,onComplete:function(d){this.notify("onComplete",d);
this.ajaxRequest=false
}.bind(this),onSuccess:function(d){this.getRemoteContentInsertionTarget().insert(d.responseText);
this.notify("onSuccess",d);
if(this.notify("onRemoteContentLoaded")!==false){if(this.options.indicator){this.hideIndicator()
}this.finishOpen()
}}.bind(this),onFailure:function(d){this.notify("onFailure",d);
if(this.options.indicator){this.hideIndicator()
}}.bind(this),onException:function(d,f){this.notify("onException",d,f);
if(this.options.indicator){this.hideIndicator()
}}.bind(this)})
}}return true
}else{if(this.options.iframe&&!this.remoteContentLoaded){this.remoteContentLoaded=true;
if(this.options.indicator){this.showIndicator()
}this.getRemoteContentInsertionTarget().insert(Control.Window.iframeTemplate.evaluate({href:this.href}));
var b=this.container.down("iframe");
b.onload=function(){this.notify("onRemoteContentLoaded");
if(this.options.indicator){this.hideIndicator()
}b.onload=null
}.bind(this)
}}this.finishOpen(c);
return true
},close:function(a){if(!this.isOpen||this.notify("beforeClose",a)===false){return false
}if(this.options.closeOnClick){this.closeOnClickContainer.stopObserving("click",this.closeHandler)
}if(this.options.fade){this.effects.fade=new Effect.Fade(this.container,{queue:{position:"front",scope:"Control.Window"+this.numberInSequence},from:1,to:0,duration:this.options.fadeDuration/2,afterFinish:function(){if(this.iFrameShim){this.iFrameShim.hide()
}this.isOpen=false;
this.notify("afterClose")
}.bind(this)})
}else{this.container.hide();
if(this.iFrameShim){this.iFrameShim.hide()
}}if(this.ajaxRequest){this.ajaxRequest.transport.abort()
}if(!(this.options.draggable||this.options.resizable)&&this.options.position=="center"){Event.stopObserving(window,"resize",this.positionHandler)
}if(!this.options.draggable&&this.options.position=="center"){Event.stopObserving(window,"scroll",this.positionHandler)
}if(this.options.indicator){this.hideIndicator()
}if(!this.options.fade){this.isOpen=false;
this.notify("afterClose")
}return true
},position:function(d){if(this.options.position=="mouse"){var g=[Event.pointerX(d),Event.pointerY(d)];
this.container.setStyle({top:g[1]+$value(this.options.offsetTop)+"px",left:g[0]+$value(this.options.offsetLeft)+"px"});
return
}var h=this.container.getDimensions();
var c=document.viewport.getDimensions();
Position.prepare();
var b=(Position.deltaX+Math.floor((c.width-h.width)/2));
var a=(Position.deltaY+((c.height>h.height)?Math.floor((c.height-h.height)/2):0));
if(this.options.position=="center"){this.container.setStyle({top:(h.height<=c.height)?((a!=null&&a>0)?a:0)+"px":0,left:(h.width<=c.width)?((b!=null&&b>0)?b:0)+"px":0})
}else{if(this.options.position=="relative"){var g=this.sourceContainer.cumulativeOffset();
var f=g[1]+$value(this.options.offsetTop);
var e=g[0]+$value(this.options.offsetLeft);
this.container.setStyle({top:(h.height<=c.height)?(this.options.constrainToViewport?Math.max(0,Math.min(c.height-(h.height),f)):f)+"px":0,left:(h.width<=c.width)?(this.options.constrainToViewport?Math.max(0,Math.min(c.width-(h.width),e)):e)+"px":0})
}else{if(this.options.position.length){var f=$value(this.options.position[1])+$value(this.options.offsetTop);
var e=$value(this.options.position[0])+$value(this.options.offsetLeft);
this.container.setStyle({top:(h.height<=c.height)?(this.options.constrainToViewport?Math.max(0,Math.min(c.height-(h.height),f)):f)+"px":0,left:(h.width<=c.width)?(this.options.constrainToViewport?Math.max(0,Math.min(c.width-(h.width),e)):e)+"px":0})
}}}if(this.iFrameShim){this.updateIFrameShimZIndex()
}},ensureInBounds:function(){if(!this.isOpen){return
}var a=document.viewport.getDimensions();
var c=this.container.cumulativeOffset();
var b=this.container.getDimensions();
if(c.left+b.width>a.width){this.container.setStyle({left:(Math.max(0,a.width-b.width))+"px"})
}if(c.top+b.height>a.height){this.container.setStyle({top:(Math.max(0,a.height-b.height))+"px"})
}},bringToFront:function(){Control.Window.bringToFront(this);
this.notify("bringToFront")
},destroy:function(){this.container.stopObserving("mousedown",this.bringToFrontHandler);
if(this.draggable){Draggables.removeObserver(this.container);
this.draggable.handle.stopObserving("mousedown",this.bringToFrontHandler);
this.draggable.destroy()
}if(this.resizable){Resizables.removeObserver(this.container);
this.resizable.handle.stopObserving("mousedown",this.bringToFrontHandler);
this.resizable.destroy()
}if(this.container&&!this.sourceContainer){this.container.remove()
}if(this.sourceContainer){if(this.options.hover){this.sourceContainer.stopObserving("mouseenter",this.sourceContainerOpenHandler);
this.sourceContainer.stopObserving("mouseleave",this.sourceContainerCloseHandler);
if(this.options.position=="mouse"){this.sourceContainer.stopObserving("mousemove",this.sourceContainerMouseMoveHandler)
}}else{this.sourceContainer.stopObserving("click",this.sourceContainerOpenHandler)
}}if(this.iFrameShim){this.iFrameShim.destroy()
}Event.stopObserving(window,"resize",this.outOfBoundsPositionHandler);
Control.Window.windows=Control.Window.windows.without(this);
this.notify("afterDestroy")
},applyResizable:function(){if(this.options.resizable){if(typeof(Resizable)=="undefined"){throw"Control.Window requires resizable.js to be loaded."
}var a=null;
if(this.options.resizable===true){a=new Element("div",{className:"resizable_handle"});
this.container.insert(a)
}else{a=$(this.options.resziable)
}this.resizable=new Resizable(this.container,{handle:a,minHeight:this.options.minHeight,minWidth:this.options.minWidth,maxHeight:this.options.constrainToViewport?function(b){return(document.viewport.getDimensions().height-parseInt(b.style.top||0))-(b.getHeight()-parseInt(b.style.height||0))
}:this.options.maxHeight,maxWidth:this.options.constrainToViewport?function(b){return(document.viewport.getDimensions().width-parseInt(b.style.left||0))-(b.getWidth()-parseInt(b.style.width||0))
}:this.options.maxWidth});
this.resizable.handle.observe("mousedown",this.bringToFrontHandler);
Resizables.addObserver(new Control.Window.LayoutUpdateObserver(this,function(){if(this.iFrameShim){this.updateIFrameShimZIndex()
}this.notify("onResize")
}.bind(this)))
}},applyDraggable:function(){if(this.options.draggable){if(typeof(Draggables)=="undefined"){throw"Control.Window requires dragdrop.js to be loaded."
}var a=null;
if(this.options.draggable===true){a=new Element("div",{className:"draggable_handle"});
this.container.insert(a)
}else{a=$(this.options.draggable)
}this.draggable=new Draggable(this.container,{handle:a,constrainToViewport:this.options.constrainToViewport,zindex:this.container.getStyle("z-index"),starteffect:function(){if(Prototype.Browser.IE){this.old_onselectstart=document.onselectstart;
document.onselectstart=function(){return false
}
}}.bind(this),endeffect:function(){document.onselectstart=this.old_onselectstart
}.bind(this)});
this.draggable.handle.observe("mousedown",this.bringToFrontHandler);
Draggables.addObserver(new Control.Window.LayoutUpdateObserver(this,function(){if(this.iFrameShim){this.updateIFrameShimZIndex()
}this.notify("onDrag")
}.bind(this)))
}},createDefaultContainer:function(a){if(!this.container){this.container=new Element("div",{id:"control_window_"+this.numberInSequence});
$(document.body).insert(this.container);
if(typeof(a)=="string"&&$(a)==null&&!a.match(/^#(.+)$/)&&!a.match(Control.Window.uriRegex)){this.container.update(a)
}}},finishOpen:function(a){this.bringToFront();
if(this.options.fade){if(typeof(Effect)=="undefined"){throw"Control.Window requires effects.js to be loaded."
}if(this.effects.fade){this.effects.fade.cancel()
}this.effects.appear=new Effect.Appear(this.container,{queue:{position:"end",scope:"Control.Window."+this.numberInSequence},from:0,to:1,duration:this.options.fadeDuration/2,afterFinish:function(){if(this.iFrameShim){this.updateIFrameShimZIndex()
}this.isOpen=true;
this.notify("afterOpen")
}.bind(this)})
}else{this.container.show()
}this.position(a);
if(!(this.options.draggable||this.options.resizable)&&this.options.position=="center"){Event.observe(window,"resize",this.positionHandler,false)
}if(!this.options.draggable&&this.options.position=="center"){Event.observe(window,"scroll",this.positionHandler,false)
}if(!this.options.fade){this.isOpen=true;
this.notify("afterOpen")
}return true
},showIndicator:function(){this.showIndicatorTimeout=window.setTimeout(function(){if(this.options.fade){this.indicatorEffects.appear=new Effect.Appear(this.indicator,{queue:{position:"front",scope:"Control.Window.indicator."+this.numberInSequence},from:0,to:1,duration:this.options.fadeDuration/2})
}else{this.indicator.show()
}}.bind(this),Control.Window.indicatorTimeout)
},hideIndicator:function(){if(this.showIndicatorTimeout){window.clearTimeout(this.showIndicatorTimeout)
}this.indicator.hide()
},getRemoteContentInsertionTarget:function(){return typeof(this.options.insertRemoteContentAt)=="string"?this.container.down(this.options.insertRemoteContentAt):$(this.options.insertRemoteContentAt)
},updateIFrameShimZIndex:function(){if(this.iFrameShim){this.iFrameShim.positionUnder(this.container)
}}});
Object.extend(Control.Window,{windows:[],baseZIndex:9999,indicatorTimeout:250,iframeTemplate:new Template('<iframe src="#{href}" width="100%" height="100%" frameborder="0"></iframe>'),uriRegex:/^(\/|\#|https?\:\/\/|[\w]+\/)/,bringToFront:function(a){Control.Window.windows=Control.Window.windows.without(a);
Control.Window.windows.push(a);
Control.Window.windows.each(function(c,d){var b=Control.Window.baseZIndex+d;
c.container.setStyle({zIndex:b});
if(c.isOpen){if(c.iFrameShim){c.updateIFrameShimZIndex()
}}if(c.options.draggable){c.draggable.options.zindex=b
}})
},open:function(b,c){var a=new Control.Window(b,c);
a.open();
return a
},initialZIndexForWindow:function(a){return Control.Window.baseZIndex+(Control.Window.windows.length-1)
}});
Object.Event.extend(Control.Window);
Control.Window.LayoutUpdateObserver=Class.create({initialize:function(a,b){this.w=a;
this.element=$(a.container);
this.observer=b
},onStart:Prototype.emptyFunction,onEnd:function(b,a){if(a.element==this.element&&this.iFrameShim){this.w.updateIFrameShimZIndex()
}},onResize:function(b,a){if(a.element==this.element){this.observer(this.element)
}},onDrag:function(b,a){if(a.element==this.element){this.observer(this.element)
}}});
Control.Overlay={id:"control_overlay",loaded:false,container:false,lastOpacity:0,styles:{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:9998},ieStyles:{position:"absolute",top:0,left:0,zIndex:9998},effects:{fade:false,appear:false},load:function(){if(Control.Overlay.loaded){return false
}Control.Overlay.loaded=true;
Control.Overlay.container=new Element("div",{id:Control.Overlay.id});
$(document.body).insert(Control.Overlay.container);
if(Prototype.Browser.IE){Control.Overlay.container.setStyle(Control.Overlay.ieStyles);
Event.observe(window,"scroll",Control.Overlay.positionOverlay);
Event.observe(window,"resize",Control.Overlay.positionOverlay);
Control.Overlay.observe("beforeShow",Control.Overlay.positionOverlay)
}else{Control.Overlay.container.setStyle(Control.Overlay.styles)
}Control.Overlay.iFrameShim=new IframeShim();
Control.Overlay.iFrameShim.hide();
Event.observe(window,"resize",Control.Overlay.positionIFrameShim);
Control.Overlay.container.hide();
return true
},unload:function(){if(!Control.Overlay.loaded){return false
}Event.stopObserving(window,"resize",Control.Overlay.positionOverlay);
Control.Overlay.stopObserving("beforeShow",Control.Overlay.positionOverlay);
Event.stopObserving(window,"resize",Control.Overlay.positionIFrameShim);
Control.Overlay.iFrameShim.destroy();
Control.Overlay.container.remove();
Control.Overlay.loaded=false;
return true
},show:function(a,b){if(Control.Overlay.notify("beforeShow")===false){return false
}Control.Overlay.lastOpacity=a;
Control.Overlay.positionIFrameShim();
Control.Overlay.iFrameShim.show();
if(b){if(typeof(Effect)=="undefined"){throw"Control.Window requires effects.js to be loaded."
}if(Control.Overlay.effects.fade){Control.Overlay.effects.fade.cancel()
}Control.Overlay.effects.appear=new Effect.Appear(Control.Overlay.container,{queue:{position:"end",scope:"Control.Overlay"},afterFinish:function(){Control.Overlay.notify("afterShow")
},from:0,to:Control.Overlay.lastOpacity,duration:(b===true?0.75:b)/2})
}else{Control.Overlay.container.setStyle({opacity:a||1});
Control.Overlay.container.show();
Control.Overlay.notify("afterShow")
}return true
},hide:function(a){if(Control.Overlay.notify("beforeHide")===false){return false
}if(Control.Overlay.effects.appear){Control.Overlay.effects.appear.cancel()
}Control.Overlay.iFrameShim.hide();
if(a){Control.Overlay.effects.fade=new Effect.Fade(Control.Overlay.container,{queue:{position:"front",scope:"Control.Overlay"},afterFinish:function(){Control.Overlay.notify("afterHide")
},from:Control.Overlay.lastOpacity,to:0,duration:(a===true?0.75:a)/2})
}else{Control.Overlay.container.hide();
Control.Overlay.notify("afterHide")
}return true
},positionIFrameShim:function(){if(Control.Overlay.container.visible()){Control.Overlay.iFrameShim.positionUnder(Control.Overlay.container)
}},positionOverlay:function(){Control.Overlay.container.setStyle({width:document.body.clientWidth+"px",height:document.body.clientHeight+"px"})
}};
Object.Event.extend(Control.Overlay);
Control.ToolTip=Class.create(Control.Window,{initialize:function($super,a,c,b){$super(c,Object.extend(Object.extend(Object.clone(Control.ToolTip.defaultOptions),b||{}),{position:"mouse",hover:a}))
}});
Object.extend(Control.ToolTip,{defaultOptions:{offsetLeft:10}});
Control.Modal=Class.create(Control.Window,{initialize:function($super,a,b){Control.Modal.InstanceMethods.beforeInitialize.bind(this)();
$super(a,Object.extend(Object.clone(Control.Modal.defaultOptions),b||{}))
}});
Object.extend(Control.Modal,{defaultOptions:{overlayOpacity:0.5,closeOnClick:"overlay"},current:false,open:function(a,b){var c=new Control.Modal(a,b);
c.open();
return c
},close:function(){if(Control.Modal.current){Control.Modal.current.close()
}},InstanceMethods:{beforeInitialize:function(){Control.Overlay.load();
this.overlayFinishedOpening=false;
this.observe("beforeOpen",Control.Modal.Observers.beforeOpen.bind(this));
this.observe("afterOpen",Control.Modal.Observers.afterOpen.bind(this));
this.observe("afterClose",Control.Modal.Observers.afterClose.bind(this))
}},Observers:{beforeOpen:function(){if(!this.overlayFinishedOpening){Control.Overlay.observeOnce("afterShow",function(){this.overlayFinishedOpening=true;
this.open()
}.bind(this));
Control.Overlay.show(this.options.overlayOpacity,this.options.fade?this.options.fadeDuration:false);
throw $break
}else{Control.Window.windows.without(this).invoke("close")
}},afterOpen:function(){Control.Modal.current=this
},afterClose:function(){Control.Overlay.hide(this.options.fade?this.options.fadeDuration:false);
Control.Modal.current=false;
this.overlayFinishedOpening=false
}}});
Control.LightBox=Class.create(Control.Window,{initialize:function($super,a,b){this.allImagesLoaded=false;
if(b.modal){var b=Object.extend(Object.clone(Control.LightBox.defaultOptions),b||{});
b=Object.extend(Object.clone(Control.Modal.defaultOptions),b);
b=Control.Modal.InstanceMethods.beforeInitialize.bind(this)(b);
$super(a,b)
}else{$super(a,Object.extend(Object.clone(Control.LightBox.defaultOptions),b||{}))
}this.hasRemoteContent=this.href&&!this.options.iframe;
if(this.hasRemoteContent){this.observe("onRemoteContentLoaded",Control.LightBox.Observers.onRemoteContentLoaded.bind(this))
}else{this.applyImageObservers()
}this.observe("beforeOpen",Control.LightBox.Observers.beforeOpen.bind(this))
},applyImageObservers:function(){var a=this.getImages();
this.numberImagesToLoad=a.length;
this.numberofImagesLoaded=0;
a.each(function(b){b.observe("load",function(c){++this.numberofImagesLoaded;
if(this.numberImagesToLoad==this.numberofImagesLoaded){this.allImagesLoaded=true;
this.onAllImagesLoaded()
}}.bind(this,b));
b.hide()
}.bind(this))
},onAllImagesLoaded:function(){this.getImages().each(function(a){this.showImage(a)
}.bind(this));
if(this.hasRemoteContent){if(this.options.indicator){this.hideIndicator()
}this.finishOpen()
}else{this.open()
}},getImages:function(){return this.container.select(Control.LightBox.imageSelector)
},showImage:function(a){a.show()
}});
Object.extend(Control.LightBox,{imageSelector:"img",defaultOptions:{},Observers:{beforeOpen:function(){if(!this.hasRemoteContent&&!this.allImagesLoaded){throw $break
}},onRemoteContentLoaded:function(){this.applyImageObservers();
if(!this.allImagesLoaded){throw $break
}}}});
var LiveValidation=Class.create();
Object.extend(LiveValidation,{VERSION:"1.3 prototype",TEXTAREA:1,TEXT:2,PASSWORD:3,CHECKBOX:4,SELECT:5,FILE:6,massValidate:function(c){var d=true;
for(var b=0,a=c.length;
b<a;
++b){var e=c[b].validate();
if(d){d=e
}}return d
}});
LiveValidation.prototype={validClass:"LV_valid",invalidClass:"LV_invalid",messageClass:"LV_validation_message",validFieldClass:"LV_valid_field",invalidFieldClass:"LV_invalid_field",initialize:function(b,a){if(!b){throw new Error("LiveValidation::initialize - No element reference or element id has been provided!")
}this.element=$(b);
if(!this.element){throw new Error("LiveValidation::initialize - No element with reference or id of '"+b+"' exists!")
}this.elementType=this.getElementType();
this.validations=[];
this.form=this.element.form;
this.options=Object.extend({validMessage:"Thankyou!",onValid:function(){this.insertMessage(this.createMessageSpan());
this.addFieldClass()
},onInvalid:function(){this.insertMessage(this.createMessageSpan());
this.addFieldClass()
},insertAfterWhatNode:this.element,onlyOnBlur:false,wait:0,onlyOnSubmit:false},a||{});
var c=this.options.insertAfterWhatNode||this.element;
this.options.insertAfterWhatNode=$(c);
Object.extend(this,this.options);
if(this.form){this.formObj=LiveValidationForm.getInstance(this.form);
this.formObj.addField(this)
}this.boundFocus=this.doOnFocus.bindAsEventListener(this);
Event.observe(this.element,"focus",this.boundFocus);
if(!this.onlyOnSubmit){switch(this.elementType){case LiveValidation.CHECKBOX:this.boundClick=this.validate.bindAsEventListener(this);
Event.observe(this.element,"click",this.boundClick);
case LiveValidation.SELECT:case LiveValidation.FILE:this.boundChange=this.validate.bindAsEventListener(this);
Event.observe(this.element,"change",this.boundChange);
break;
default:if(!this.onlyOnBlur){this.boundKeyup=this.deferValidation.bindAsEventListener(this);
Event.observe(this.element,"keyup",this.boundKeyup)
}this.boundBlur=this.validate.bindAsEventListener(this);
Event.observe(this.element,"blur",this.boundBlur)
}}},destroy:function(){if(this.formObj){this.formObj.removeField(this);
this.formObj.destroy()
}Event.stopObserving(this.element,"focus",this.boundFocus);
if(!this.onlyOnSubmit){switch(this.elementType){case LiveValidation.CHECKBOX:Event.stopObserving(this.element,"click",this.boundClick);
case LiveValidation.SELECT:case LiveValidation.FILE:Event.stopObserving(this.element,"change",this.boundChange);
break;
default:if(!this.onlyOnBlur){Event.stopObserving(this.element,"keyup",this.boundKeyup)
}Event.stopObserving(this.element,"blur",this.boundBlur)
}}this.validations=[];
this.removeMessageAndFieldClass()
},add:function(a,b){this.validations.push({type:a,params:b||{}});
return this
},remove:function(a,b){this.validations=this.validations.reject(function(c){return(c.type==a&&c.params==b)
});
return this
},deferValidation:function(a){if(this.wait>=300){this.removeMessageAndFieldClass()
}if(this.timeout){clearTimeout(this.timeout)
}this.timeout=setTimeout(this.validate.bind(this),this.wait)
},doOnBlur:function(){this.focused=false;
this.validate()
},doOnFocus:function(){this.focused=true;
this.removeMessageAndFieldClass()
},getElementType:function(){switch(true){case (this.element.nodeName.toUpperCase()=="TEXTAREA"):return LiveValidation.TEXTAREA;
case (this.element.nodeName.toUpperCase()=="INPUT"&&this.element.type.toUpperCase()=="TEXT"):return LiveValidation.TEXT;
case (this.element.nodeName.toUpperCase()=="INPUT"&&this.element.type.toUpperCase()=="PASSWORD"):return LiveValidation.PASSWORD;
case (this.element.nodeName.toUpperCase()=="INPUT"&&this.element.type.toUpperCase()=="CHECKBOX"):return LiveValidation.CHECKBOX;
case (this.element.nodeName.toUpperCase()=="INPUT"&&this.element.type.toUpperCase()=="FILE"):return LiveValidation.FILE;
case (this.element.nodeName.toUpperCase()=="SELECT"):return LiveValidation.SELECT;
case (this.element.nodeName.toUpperCase()=="INPUT"):throw new Error("LiveValidation::getElementType - Cannot use LiveValidation on an "+this.element.type+" input!");
default:throw new Error("LiveValidation::getElementType - Element must be an input, select, or textarea!")
}},doValidations:function(){this.validationFailed=false;
for(var c=0,a=this.validations.length;
c<a;
++c){var b=this.validations[c];
switch(b.type){case Validate.Presence:case Validate.Confirmation:case Validate.Acceptance:this.displayMessageWhenEmpty=true;
this.validationFailed=!this.validateElement(b.type,b.params);
break;
default:this.validationFailed=!this.validateElement(b.type,b.params);
break
}if(this.validationFailed){return false
}}this.message=this.validMessage;
return true
},validateElement:function(a,c){var d=(this.elementType==LiveValidation.SELECT)?this.element.options[this.element.selectedIndex].value:this.element.value;
if(AutoLabel.isShowingPrompt(this.element)){d=""
}if(a==Validate.Acceptance){if(this.elementType!=LiveValidation.CHECKBOX){throw new Error("LiveValidation::validateElement - Element to validate acceptance must be a checkbox!")
}d=this.element.checked
}var e=true;
try{a(d,c)
}catch(b){if(b instanceof Validate.Error){if(d!==""||(d===""&&this.displayMessageWhenEmpty)){this.validationFailed=true;
this.message=b.message;
e=false
}}else{throw b
}}finally{return e
}},validate:function(){if(!this.element.disabled){var a=this.doValidations();
if(a){this.onValid();
return true
}else{this.onInvalid();
return false
}}else{return true
}},enable:function(){this.element.disabled=false;
return this
},disable:function(){this.element.disabled=true;
this.removeMessageAndFieldClass();
return this
},createMessageSpan:function(){var a=document.createElement("span");
var b=document.createTextNode(this.message);
a.appendChild(b);
return a
},insertMessage:function(b){this.removeMessage();
var a=this.validationFailed?this.invalidClass:this.validClass;
if((this.displayMessageWhenEmpty&&(this.elementType==LiveValidation.CHECKBOX||this.element.value==""))||this.element.value!=""){$(b).addClassName(this.messageClass+(" "+a));
if(nxtSibling=this.insertAfterWhatNode.nextSibling){this.insertAfterWhatNode.parentNode.insertBefore(b,nxtSibling)
}else{this.insertAfterWhatNode.parentNode.appendChild(b)
}}},addFieldClass:function(){this.removeFieldClass();
if(!this.validationFailed){if(this.displayMessageWhenEmpty||this.element.value!=""){if(!this.element.hasClassName(this.validFieldClass)){this.element.addClassName(this.validFieldClass)
}}}else{if(!this.element.hasClassName(this.invalidFieldClass)){this.element.addClassName(this.invalidFieldClass)
}}},removeMessage:function(){if(nxtEl=this.insertAfterWhatNode.next("."+this.messageClass)){nxtEl.remove()
}},removeFieldClass:function(){this.element.removeClassName(this.invalidFieldClass);
this.element.removeClassName(this.validFieldClass)
},removeMessageAndFieldClass:function(){this.removeMessage();
this.removeFieldClass()
}};
var LiveValidationForm=Class.create();
Object.extend(LiveValidationForm,{instances:{},getInstance:function(a){var b=Math.random()*Math.random();
if(!a.id){a.id="formId_"+b.toString().replace(/\./,"")+new Date().valueOf()
}if(!LiveValidationForm.instances[a.id]){LiveValidationForm.instances[a.id]=new LiveValidationForm(a)
}return LiveValidationForm.instances[a.id]
}});
LiveValidationForm.prototype={initialize:function(a){this.element=$(a);
this.fields=[];
this.oldOnSubmit=this.element.onsubmit||function(){};
this.element.onsubmit=function(c){var b=(LiveValidation.massValidate(this.fields))?this.oldOnSubmit.call(this.element,c)!==false:false;
if(!b){Event.stop(c)
}return b
}.bindAsEventListener(this)
},addField:function(a){this.fields.push(a)
},removeField:function(a){this.fields=this.fields.without(a)
},destroy:function(a){if(this.fields.length!=0&&!a){return false
}this.element.onsubmit=this.oldOnSubmit;
LiveValidationForm.instances[this.element.id]=null;
return true
}};
var Validate={Presence:function(a,b){var c=Object.extend({failureMessage:"Can't be empty!"},b||{});
if(a===""||a===null||a===undefined){Validate.fail(c.failureMessage)
}return true
},Numericality:function(b,c){var a=b;
var b=Number(b);
var c=c||{};
var d={notANumberMessage:c.notANumberMessage||"Must be a number!",notAnIntegerMessage:c.notAnIntegerMessage||"Must be an integer!",wrongNumberMessage:c.wrongNumberMessage||"Must be "+c.is+"!",tooLowMessage:c.tooLowMessage||"Must not be less than "+c.minimum+"!",tooHighMessage:c.tooHighMessage||"Must not be more than "+c.maximum+"!",is:((c.is)||(c.is==0))?c.is:null,minimum:((c.minimum)||(c.minimum==0))?c.minimum:null,maximum:((c.maximum)||(c.maximum==0))?c.maximum:null,onlyInteger:c.onlyInteger||false};
if(!isFinite(b)){Validate.fail(d.notANumberMessage)
}if(d.onlyInteger&&((/\.0+$|\.$/.test(String(a)))||(b!=parseInt(b)))){Validate.fail(d.notAnIntegerMessage)
}switch(true){case (d.is!==null):if(b!=Number(d.is)){Validate.fail(d.wrongNumberMessage)
}break;
case (d.minimum!==null&&d.maximum!==null):Validate.Numericality(b,{tooLowMessage:d.tooLowMessage,minimum:d.minimum});
Validate.Numericality(b,{tooHighMessage:d.tooHighMessage,maximum:d.maximum});
break;
case (d.minimum!==null):if(b<Number(d.minimum)){Validate.fail(d.tooLowMessage)
}break;
case (d.maximum!==null):if(b>Number(d.maximum)){Validate.fail(d.tooHighMessage)
}break
}return true
},Format:function(a,b){var a=String(a);
var c=Object.extend({failureMessage:"Not valid!",pattern:/./,negate:false},b||{});
if(!c.negate&&!c.pattern.test(a)){Validate.fail(c.failureMessage)
}if(c.negate&&c.pattern.test(a)){Validate.fail(c.failureMessage)
}return true
},emailRegex:/^[A-Z0-9_\.%\+\-]*[A-Z0-9_%\+\-]@(?:[A-Z0-9\-]+\.)+(?:[A-Z]{2,4}|museum|travel)$/i,Email:function(a,b){var c=Object.extend({failureMessage:"Must be a valid email address!"},b||{});
Validate.Format(a,{failureMessage:c.failureMessage,pattern:Validate.emailRegex});
return true
},Length:function(a,b){var a=String(a);
var b=b||{};
var c={wrongLengthMessage:b.wrongLengthMessage||"Must be "+b.is+" characters long!",tooShortMessage:b.tooShortMessage||"Must not be less than "+b.minimum+" characters long!",tooLongMessage:b.tooLongMessage||"Must not be more than "+b.maximum+" characters long!",is:((b.is)||(b.is==0))?b.is:null,minimum:((b.minimum)||(b.minimum==0))?b.minimum:null,maximum:((b.maximum)||(b.maximum==0))?b.maximum:null};
switch(true){case (c.is!==null):if(a.length!=Number(c.is)){Validate.fail(c.wrongLengthMessage)
}break;
case (c.minimum!==null&&c.maximum!==null):Validate.Length(a,{tooShortMessage:c.tooShortMessage,minimum:c.minimum});
Validate.Length(a,{tooLongMessage:c.tooLongMessage,maximum:c.maximum});
break;
case (c.minimum!==null):if(a.length<Number(c.minimum)){Validate.fail(c.tooShortMessage)
}break;
case (c.maximum!==null):if(a.length>Number(c.maximum)){Validate.fail(c.tooLongMessage)
}break;
default:throw new Error("Validate::Length - Length(s) to validate against must be provided!")
}return true
},Inclusion:function(c,d){var e=Object.extend({failureMessage:"Must be included in the list!",within:[],allowNull:false,partialMatch:false,caseSensitive:true,negate:false},d||{});
if(e.allowNull&&c==null){return true
}if(!e.allowNull&&c==null){Validate.fail(e.failureMessage)
}if(!e.caseSensitive){var a=[];
e.within.each(function(f){if(typeof f=="string"){f=f.toLowerCase()
}a.push(f)
});
e.within=a;
if(typeof c=="string"){c=c.toLowerCase()
}}var b=(e.within.indexOf(c)==-1)?false:true;
if(e.partialMatch){b=false;
e.within.each(function(f){if(c.indexOf(f)!=-1){b=true
}})
}if((!e.negate&&!b)||(e.negate&&b)){Validate.fail(e.failureMessage)
}return true
},Exclusion:function(a,b){var c=Object.extend({failureMessage:"Must not be included in the list!",within:[],allowNull:false,partialMatch:false,caseSensitive:true},b||{});
c.negate=true;
Validate.Inclusion(a,c);
return true
},Confirmation:function(a,b){if(!b.match){throw new Error("Validate::Confirmation - Error validating confirmation: Id of element to match must be provided!")
}var c=Object.extend({failureMessage:"Does not match!",match:null},b||{});
c.match=$(b.match);
if(!c.match){throw new Error("Validate::Confirmation - There is no reference with name of, or element with id of '"+c.match+"'!")
}if(a!=c.match.value){Validate.fail(c.failureMessage)
}return true
},Acceptance:function(a,b){var c=Object.extend({failureMessage:"Must be accepted!"},b||{});
if(!a){Validate.fail(c.failureMessage)
}return true
},Custom:function(a,b){var c=Object.extend({against:function(){return true
},args:{},failureMessage:"Not valid!"},b||{});
if(!c.against(a,c.args)){Validate.fail(c.failureMessage)
}return true
},now:function(a,d,c){if(!a){throw new Error("Validate::now - Validation function must be provided!")
}var e=true;
try{a(d,c||{})
}catch(b){if(b instanceof Validate.Error){e=false
}else{throw b
}}finally{return e
}},Error:function(a){this.message=a;
this.name="ValidationError"
},fail:function(a){throw new Validate.Error(a)
}};
var AutoLabel={clear:function(a){a.clear();
AutoLabel.reset(a)
},reset:function(a){if(!$F(a)){a.addClassName(AutoLabel.labelClassName);
a.value=a.title
}},getValue:function(a){if($F(a)==$(a).title){return""
}else{return $F(a)
}},isShowingPrompt:function(a){return $(a).hasClassName(AutoLabel.labelClassName)
},load:function(){$$('input[type="text"][title]',"textarea[title]").each(function(d){AutoLabel.labelClassName="_label-information";
var c=d;
var a=c.getStyle("color");
if(c.value==c.title){c.value=""
}var f=!$F(c);
var b=function(e){AutoLabel.reset(c)
};
c.observe("focus",function(e){if(c.hasClassName(AutoLabel.labelClassName)){c.value=""
}c.removeClassName(AutoLabel.labelClassName)
});
c.observe("blur",b);
b(null)
})
}};
/*!	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;
if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;
if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;
X=false;
ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);
ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);
ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0
}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);
if(ad){ab=ad.GetVariable("$version");
if(ab){X=true;
ab=ab.split(" ")[1].split(",");
ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]
}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}
}(),k=function(){if(!M.w3){return
}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()
}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)
}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);
f()
}});
if(O==top){(function(){if(J){return
}try{j.documentElement.doScroll("left")
}catch(X){setTimeout(arguments.callee,0);
return
}f()
})()
}}if(M.wk){(function(){if(J){return
}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);
return
}f()
})()
}s(f)
}}();
function f(){if(J){return
}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));
Z.parentNode.removeChild(Z)
}catch(aa){return
}J=true;
var X=U.length;
for(var Y=0;
Y<X;
Y++){U[Y]()
}}function K(X){if(J){X()
}else{U[U.length]=X
}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)
}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)
}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)
}else{if(typeof O.onload=="function"){var X=O.onload;
O.onload=function(){X();
Y()
}
}else{O.onload=Y
}}}}}function h(){if(T){V()
}else{H()
}}function V(){var X=j.getElementsByTagName("body")[0];
var aa=C(r);
aa.setAttribute("type",q);
var Z=X.appendChild(aa);
if(Z){var Y=0;
(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");
if(ab){ab=ab.split(" ")[1].split(",");
M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]
}}else{if(Y<10){Y++;
setTimeout(arguments.callee,10);
return
}}X.removeChild(aa);
Z=null;
H()
})()
}else{H()
}}function H(){var ag=o.length;
if(ag>0){for(var af=0;
af<ag;
af++){var Y=o[af].id;
var ab=o[af].callbackFn;
var aa={success:false,id:Y};
if(M.pv[0]>0){var ae=c(Y);
if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);
if(ab){aa.success=true;
aa.ref=z(Y);
ab(aa)
}}else{if(o[af].expressInstall&&A()){var ai={};
ai.data=o[af].expressInstall;
ai.width=ae.getAttribute("width")||"0";
ai.height=ae.getAttribute("height")||"0";
if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")
}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")
}var ah={};
var X=ae.getElementsByTagName("param");
var ac=X.length;
for(var ad=0;
ad<ac;
ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")
}}P(ai,ah,Y,ab)
}else{p(ae);
if(ab){ab(aa)
}}}}}else{w(Y,true);
if(ab){var Z=z(Y);
if(Z&&typeof Z.SetVariable!=D){aa.success=true;
aa.ref=Z
}ab(aa)
}}}}}function z(aa){var X=null;
var Y=c(aa);
if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y
}else{var Z=Y.getElementsByTagName(r)[0];
if(Z){X=Z
}}}return X
}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)
}function P(aa,ab,X,Z){a=true;
E=Z||null;
B={success:false,id:X};
var ae=c(X);
if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);
Q=null
}else{l=ae;
Q=X
}aa.id=R;
if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"
}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"
}j.title=j.title.slice(0,47)+" - Flash Player Installation";
var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+encodeURI(O.location).toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;
if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac
}else{ab.flashvars=ac
}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");
X+="SWFObjectNew";
Y.setAttribute("id",X);
ae.parentNode.insertBefore(Y,ae);
ae.style.display="none";
(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)
}else{setTimeout(arguments.callee,10)
}})()
}u(aa,ab,X)
}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");
Y.parentNode.insertBefore(X,Y);
X.parentNode.replaceChild(g(Y),X);
Y.style.display="none";
(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)
}else{setTimeout(arguments.callee,10)
}})()
}else{Y.parentNode.replaceChild(g(Y),Y)
}}function g(ab){var aa=C("div");
if(M.win&&M.ie){aa.innerHTML=ab.innerHTML
}else{var Y=ab.getElementsByTagName(r)[0];
if(Y){var ad=Y.childNodes;
if(ad){var X=ad.length;
for(var Z=0;
Z<X;
Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))
}}}}}return aa
}function u(ai,ag,Y){var X,aa=c(Y);
if(M.wk&&M.wk<312){return X
}if(aa){if(typeof ai.id==D){ai.id=Y
}if(M.ie&&M.win){var ah="";
for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]
}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'
}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'
}}}}}var af="";
for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'
}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";
N[N.length]=ai.id;
X=c(ai.id)
}else{var Z=C(r);
Z.setAttribute("type",q);
for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])
}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])
}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])
}}aa.parentNode.replaceChild(Z,aa);
X=Z
}}return X
}function e(Z,X,Y){var aa=C("param");
aa.setAttribute("name",X);
aa.setAttribute("value",Y);
Z.appendChild(aa)
}function y(Y){var X=c(Y);
if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";
(function(){if(X.readyState==4){b(Y)
}else{setTimeout(arguments.callee,10)
}})()
}else{X.parentNode.removeChild(X)
}}}function b(Z){var Y=c(Z);
if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null
}}Y.parentNode.removeChild(Y)
}}function c(Z){var X=null;
try{X=j.getElementById(Z)
}catch(Y){}return X
}function C(X){return j.createElement(X)
}function i(Z,X,Y){Z.attachEvent(X,Y);
I[I.length]=[Z,X,Y]
}function F(Z){var Y=M.pv,X=Z.split(".");
X[0]=parseInt(X[0],10);
X[1]=parseInt(X[1],10)||0;
X[2]=parseInt(X[2],10)||0;
return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false
}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return
}var aa=j.getElementsByTagName("head")[0];
if(!aa){return
}var X=(ad&&typeof ad=="string")?ad:"screen";
if(ab){n=null;
G=null
}if(!n||G!=X){var Z=C("style");
Z.setAttribute("type","text/css");
Z.setAttribute("media",X);
n=aa.appendChild(Z);
if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]
}G=X
}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)
}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))
}}}function w(Z,X){if(!m){return
}var Y=X?"visible":"hidden";
if(J&&c(Z)){c(Z).style.visibility=Y
}else{v("#"+Z,"visibility:"+Y)
}}function L(Y){var Z=/[\\\"<>\.;]/;
var X=Z.exec(Y)!=null;
return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y
}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;
for(var ab=0;
ab<ac;
ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])
}var Z=N.length;
for(var aa=0;
aa<Z;
aa++){y(N[aa])
}for(var Y in M){M[Y]=null
}M=null;
for(var X in swfobject){swfobject[X]=null
}swfobject=null
})
}}();
return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};
Y.id=ab;
Y.swfVersion=X;
Y.expressInstall=aa;
Y.callbackFn=Z;
o[o.length]=Y;
w(ab,false)
}else{if(Z){Z({success:false,id:ab})
}}},getObjectById:function(X){if(M.w3){return z(X)
}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};
if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);
K(function(){ae+="";
ag+="";
var aj={};
if(af&&typeof af===r){for(var al in af){aj[al]=af[al]
}}aj.data=ab;
aj.width=ae;
aj.height=ag;
var am={};
if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]
}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]
}else{am.flashvars=ai+"="+Z[ai]
}}}if(F(Y)){var an=u(aj,am,ah);
if(aj.id==ah){w(ah,true)
}X.success=true;
X.ref=an
}else{if(aa&&A()){aj.data=aa;
P(aj,am,ah,ac);
return
}else{w(ah,true)
}}if(ac){ac(X)
}})
}else{if(ac){ac(X)
}}},switchOffAutoHideShow:function(){m=false
},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}
},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)
}else{return undefined
}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)
}},removeSWF:function(X){if(M.w3){y(X)
}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)
}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;
if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]
}if(aa==null){return L(Z)
}var Y=Z.split("&");
for(var X=0;
X<Y.length;
X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))
}}}return""
},expressInstallCallback:function(){if(a){var X=c(R);
if(X&&l){X.parentNode.replaceChild(l,X);
if(Q){w(Q,true);
if(M.ie&&M.win){l.style.display="block"
}}if(E){E(B)
}}a=false
}}}
}();
BrowserHistoryUtils={addEvent:function(e,d,b,a){a=a||false;
if(e.addEventListener){e.addEventListener(d,b,a);
return true
}else{if(e.attachEvent){var c=e.attachEvent("on"+d,b);
return c
}else{e["on"+d]=b
}}}};
BrowserHistory=(function(){var B={ie:false,firefox:false,safari:false,opera:false,version:-1};
var c="";
var d=document.location.href;
var w=document.location.href;
var b=document.location.hash;
var h="history/historyFrame.html?";
var t=-1;
var E=[];
var v=l(w,w+"#"+b,b);
var y=[];
var k=[];
var i=null;
var s=navigator.userAgent.toLowerCase();
if(s.indexOf("opera")!=-1){B.opera=true
}else{if(s.indexOf("msie")!=-1){B.ie=true;
B.version=parseFloat(s.substring(s.indexOf("msie")+4))
}else{if(s.indexOf("safari")!=-1){B.safari=true;
B.version=parseFloat(s.substring(s.indexOf("safari")+7))
}else{if(s.indexOf("gecko")!=-1){B.firefox=true
}}}}if(B.ie==true&&B.version==7){window._ie_firstload=false
}function n(){return document.getElementById("ie_historyFrame")
}function q(){return document.getElementById("firefox_anchorDiv")
}function p(){return document.getElementById("safari_formDiv")
}function a(){return document.getElementById("safari_remember_field")
}function o(I){if(I&&document.getElementById(I)){var F=document.getElementById(I);
if(typeof F.SetVariable!="undefined"){return F
}else{var H=F.getElementsByTagName("object");
var G=F.getElementsByTagName("embed");
if(H.length>0&&typeof H[0].SetVariable!="undefined"){return H[0]
}else{if(G.length>0&&typeof G[0].SetVariable!="undefined"){return G[0]
}}}}else{var H=document.getElementsByTagName("object");
var G=document.getElementsByTagName("embed");
if(G.length>0&&typeof G[0].SetVariable!="undefined"){return G[0]
}else{if(H.length>0&&typeof H[0].SetVariable!="undefined"){return H[0]
}else{if(H.length>1&&typeof H[1].SetVariable!="undefined"){return H[1]
}}}}return undefined
}function u(){var G=[];
if(G.length==0){var F=document.getElementsByTagName("object");
G=F
}if(G.length==0||G[0].object==null){var F=document.getElementsByTagName("embed");
G=F
}return G
}function g(){var G=n().contentWindow.document;
var F=String(G.location.search);
if(F.length==1&&F.charAt(0)=="?"){F=""
}else{if(F.length>=2&&F.charAt(0)=="?"){F=F.substring(1)
}}return F
}function m(){var F=document.location.href.indexOf("#");
return(F>=0)?document.location.href.substr(F+1):""
}function f(F){if(F==""){F="#"
}document.location.hash=F
}function l(F,G,H){return{baseUrl:F,newUrl:G,flexAppUrl:H,title:null}
}function D(L,F,N){k=[];
if(B.ie){if(N==c&&document.location.href==w&&window._ie_firstload){d=w;
return
}if((!N||N==c)&&window._ie_firstload){F=L+"#"+c;
N=c
}else{n().src=h+N
}f(N)
}else{if(y.length==0&&v.flexAppUrl==N){v=l(L,F,N)
}else{if(y.length>0&&y[y.length-1].flexAppUrl==N){y[y.length-1]=l(L,F,N)
}}if(B.safari){if(B.version<=419.3){var H=window.location.pathname.toString();
H=H.substring(H.lastIndexOf("/")+1);
p().innerHTML='<form name="historyForm" action="'+H+"#"+N+'" method="GET"></form>';
var M=window.location.search.substring(1);
var I=M.split("&");
for(var J=0;
J<I.length;
J++){var K=I[J].split("=");
var G=document.createElement("input");
G.type="hidden";
G.name=K[0];
G.value=K[1];
document.forms.historyForm.appendChild(G)
}document.forms.historyForm.submit()
}else{top.location.hash=N
}E[history.length]=N;
x()
}else{A(N);
f(N)
}}y.push(l(L,F,N))
}function x(){if(B.safari){a().value=E.join(",")
}}function j(){var G=y.pop();
if(!G){return
}var F=y[y.length-1];
if(!F&&y.length==0){F=v
}k.push(G)
}function z(){var F=k.pop();
if(!F){return
}y.push(F)
}function e(){k=[]
}function r(){if(B.ie){if(d!=document.location.href&&d+"#"!=document.location.href){if(B.version<7){d=document.location.href;
document.location.reload()
}else{if(m()!=g()){var F=h+m();
n().src=F
}}}}if(B.safari){if(t>=0&&history.length!=t){var L=m();
if(B.version<528.16){t=history.length;
L=E[t]
}if(typeof BrowserHistory_multiple!="undefined"&&BrowserHistory_multiple==true){var J=u();
for(var I=0;
I<J.length;
I++){J[I].browserURLChange(L)
}}else{o().browserURLChange(L)
}x()
}}if(B.firefox){if(d!=document.location.href){var H=y.length;
var K={back:false,forward:false,set:false};
if((window.location.hash==b||window.location.href==w)&&(H==1)){K.back=true;
j()
}if(k.length>0){if(k[k.length-1].flexAppUrl==m()){K.forward=true;
z()
}}if((H>=2)&&(y[H-2])){if(y[H-2].flexAppUrl==m()){K.back=true;
j()
}}if(!K.back&&!K.forward){var G={back:-1,forward:-1};
for(var I=0;
I<y.length;
I++){if(y[I].flexAppUrl==m()&&I!=(H-2)){arbitraryUrl=true;
G.back=I
}}for(var I=0;
I<k.length;
I++){if(k[I].flexAppUrl==m()&&I!=(H-2)){arbitraryUrl=true;
G.forward=I
}}e()
}d=document.location.href;
var L=m();
if(L==""){}if(typeof BrowserHistory_multiple!="undefined"&&BrowserHistory_multiple==true){var J=u();
for(var I=0;
I<J.length;
I++){J[I].browserURLChange(L)
}}else{o().browserURLChange(L)
}}}}function A(F){if(document.getElementsByName(F).length==0){q().innerHTML+="<a name='"+F+"'>"+F+"</a>"
}}var C=function(){if(B.ie){var I=document.getElementsByTagName("script");
for(var M=0,P;
P=I[M];
M++){if(P.src.indexOf("history.js")>-1){var K=(new String(P.src)).replace("history.js","historyFrame.html")
}}h=K+"?";
var F=h;
var J=document.createElement("iframe");
J.id="ie_historyFrame";
J.name="ie_historyFrame";
try{document.body.appendChild(J)
}catch(N){setTimeout(function(){document.body.appendChild(J)
},0)
}}if(B.safari){var H=document.createElement("div");
H.id="safari_rememberDiv";
document.body.appendChild(H);
H.innerHTML='<input type="text" id="safari_remember_field" style="width: 500px;">';
var G=document.createElement("div");
G.id="safari_formDiv";
document.body.appendChild(G);
var O=document.createElement("div");
O.id="safarireloader";
var I=document.getElementsByTagName("script");
for(var M=0,P;
P=I[M];
M++){if(P.src.indexOf("history.js")>-1){html=(new String(P.src)).replace(".js",".html")
}}O.innerHTML='<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
document.body.appendChild(O);
O.style.position="absolute";
O.style.left=O.style.top="-9999px";
J=O.getElementsByTagName("iframe")[0];
if(document.getElementById("safari_remember_field").value!=""){E=document.getElementById("safari_remember_field").value.split(",")
}}if(B.firefox){var L=document.createElement("div");
L.id="firefox_anchorDiv";
document.body.appendChild(L)
}};
return{historyHash:E,backStack:function(){return y
},forwardStack:function(){return k
},getPlayer:o,initialize:function(F){C(F)
},setURL:function(F){document.location.href=F
},getURL:function(){return document.location.href
},getTitle:function(){return document.title
},setTitle:function(H){try{y[y.length-1].title=H
}catch(G){}if(B.safari){if(H==""){try{var F=window.location.href.toString();
H=F.substring((F.lastIndexOf("/")+1),F.lastIndexOf("#"))
}catch(G){H=""
}}}document.title=H
},setDefaultURL:function(J){c=J;
J=m();
if(B.ie){window._ie_firstload=true;
var F=h+J;
var H=function(){n().src=F;
window.location.replace("#"+J);
setInterval(r,50)
};
try{H()
}catch(K){window.setTimeout(function(){H()
},0)
}}if(B.safari){t=history.length;
if(E.length==0){E[t]=J;
var I="#"+J;
window.location.replace(I)
}else{}setInterval(r,50)
}if(B.firefox||B.opera){var G=new RegExp("#"+J+"$");
if(window.location.toString().match(G)){}else{var I="#"+J;
window.location.replace(I)
}setInterval(r,50)
}},setBrowserURL:function(J,F){if(B.ie&&typeof F!="undefined"){i=F
}var I=document.location.href.indexOf("#");
var G=I!=-1?document.location.href.substr(0,I):document.location.href;
var H=G+"#"+J;
if(document.location.href!=H&&document.location.href+"#"!=H){d=H;
D(G,H,J);
t=history.length
}},browserURLChange:function(J){var F=null;
if(B.ie&&i!=null){F=i
}pendingURL="";
if(typeof BrowserHistory_multiple!="undefined"&&BrowserHistory_multiple==true){var H=u();
for(var G=0;
G<H.length;
G++){try{H[G].browserURLChange(J)
}catch(I){}}}else{try{o(F).browserURLChange(J)
}catch(I){}}i=null
},getUserAgent:function(){return navigator.userAgent
},getPlatform:function(){return navigator.platform
}}
})();
function setURL(a){document.location.href=a
}function backButton(){history.back()
}function forwardButton(){history.forward()
}function goForwardOrBackInHistory(a){history.go(a)
}(function(i){var u=navigator.userAgent;
var e=
/*@cc_on!@*/
false;
var st=setTimeout;
if(/webkit/i.test(u)){st(function(){var dr=document.readyState;
if(dr=="loaded"||dr=="complete"){i()
}else{st(arguments.callee,10)
}},10)
}else{if((/mozilla/i.test(u)&&!/(compati)/.test(u))||(/opera/i.test(u))){document.addEventListener("DOMContentLoaded",i,false)
}else{if(e){(function(){var t=document.createElement("doc:rdy");
try{t.doScroll("left");
i();
t=null
}catch(e){st(arguments.callee,0)
}})()
}else{window.onload=i
}}}})(function(){BrowserHistory.initialize()
});
var CreditCard={CARDS:{Visa:/^4[0-9]{12}(?:[0-9]{3})?$/,MasterCard:/^5[1-5][0-9]{14}$/,DinersClub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,Amex:/^3[47][0-9]{13}$/,Discover:/^6(?:011|5[0-9]{2})[0-9]{12}$/},TEST_NUMBERS:$w("378282246310005 371449635398431 378734493671000 30569309025904 38520000023237 6011111111111117 6011000990139424 5555555555554444 5105105105105100 4012888888881881 4222222222222"),validate:function(a){if(a=="411111111111111"){return true
}return CreditCard.verifyLuhn10(a)&&!!CreditCard.type(a)&&!CreditCard.isTestNumber(a)
},verifyLuhn10:function(a){return($A(CreditCard.strip(a).split("")).reverse().inject(0,function(b,d,c){return b+$A((parseInt(d)*[1,2][c%2]).toString().split("")).inject(0,function(e,f){return e+parseInt(f)
})
})%10==0)
},isTestNumber:function(a){return CreditCard.TEST_NUMBERS.include(CreditCard.strip(a))
},strip:function(a){return a.gsub(/\s|-/,"")
},type:function(a){for(card in CreditCard.CARDS){if(CreditCard["is"+card](a)){return card
}}}};
for(card in CreditCard.CARDS){CreditCard["is"+card]=function(a){return CreditCard.CARDS[card].test(CreditCard.strip(a))
}
}BraintreeTRForm=Class.create({initialize:function(b,a){this.element=$(b);
this.errors=$(a);
this.oldOnSubmit=this.element.onsubmit||function(){};
this.element.onsubmit=function(d){var c=this.oldOnSubmit.call(this.element,d)===false?false:this.submit();
if(!c){Event.stop(d)
}}.bindAsEventListener(this);
this.submitBtn=this.element.down("#pay_button");
this.progress=this.element.down("#progress")
},setBTFields:function(a){this.btFields=a
},submit:function(a){this.formatCCExp();
this.submitBtn.hide();
this.progress.show();
return true
},formatCCExp:function(){var b="0"+this.element.down("#exp_month").value;
var a=this.element.down("#exp_year").value;
this.element.down("#ccexp").value=b.substring(b.length-2)+a.substring(a.length-2)
}});
Element.addMethods({isOrDescendantOf:function(b,a){return b==a||b.descendantOf(a)
}});
if(!window.console){window.console={log:function(){}}
}function trackPage(a){if(_gat){_gat._getTracker("UA-958509-13")._trackPageview(a)
}}var Cookie={set:function(c,f,b){var a="";
if(b>0){var g=new Date();
g.setTime(g.getTime()+(86400000*parseFloat(b)));
a="; expires="+g.toGMTString()
}var e=encodeURIComponent(c)+"="+encodeURIComponent(f||"")+a+"; path=/";
document.cookie=e
},get:function(a){var b=document.cookie.match(new RegExp("(^|;)\\s*"+encodeURIComponent(a)+"=([^;\\s]*)"));
return(b?decodeURIComponent(b[2]):null)
},erase:function(a){var b=Cookie.get(a)||true;
Cookie.set(a,"",-1);
return b
},accept:function(){if(typeof navigator.cookieEnabled=="boolean"){return navigator.cookieEnabled
}Cookie.set("_test","1");
return(Cookie.erase("_test")==="1")
}};
function RNG(a){this.m=4294967296;
this.a=1103515245;
this.c=12345;
this.state=a?a:Math.floor(Math.random()*(this.m-1))
}RNG.prototype.nextInt=function(){this.state=(this.a*this.state+this.c)%this.m;
return this.state
};
var Setup=$H({"#noscript_msg":function(a){a.setStyle({height:"0px",overflow:"hidden"})
},"#footnotes_debug":function(){$("footnotes_debug").hide();
var a=new Element("input",{id:"footnotes_debug_toggler",type:"button",value:"fn"});
a.observe("click",function(){$("footnotes_debug").toggle()
});
$(document.body).insert(a)
},"#categories":function(a){var d=$$("#categories li");
var c=$$("#texts li");
for(var b=0,e=d.length;
b<e;
b++){(function(f,g){f.observe("mouseover",function(){f.addClassName("hover");
c.each(function(h){h.hide()
});
$("howitworks").hide();
g.show()
});
f.observe("mouseout",function(){f.removeClassName("hover");
g.hide();
$("howitworks").show()
})
})(d[b],c[b])
}},"#jfm_exp_link":function(a){if(Prototype.Browser.IE){a.observe("mouseover",function(){$("jfm_exp").addClassName("hover")
});
a.observe("mouseout",function(){$("jfm_exp").removeClassName("hover")
})
}else{a.observe("mouseenter",function(){$("jfm_exp").addClassName("hover")
});
a.observe("mouseleave",function(){$("jfm_exp").removeClassName("hover")
})
}},"#subscribe_form":function(a){a.down("#loader").hide();
var b=a.down("form");
b.observe("submit",function(d){Event.stop(d);
var c=AutoLabel.getValue("email");
if(c){if(isEmail(c)){a.down("#contents").hide();
a.down("#loader").show();
new Ajax.Request("/subscribe",{asynchronous:true,evalScripts:true,method:"post",parameters:Form.serialize(a)})
}else{b.down(".subscribe_error").update("That address isn’t valid.")
}}})
},"#cc_addr, #cc_form":function(){(function(){var a=window.parent.document.getElementById("cc_iframe");
if(a){a.style.height=null
}}).defer()
},"#cc_addr":function(a){new Form.Element.Observer("country",0.2,function(c,d){if(d=="US"){$("city_label").update("City:");
$("state_field").show();
$("zip_label").update("Zip:")
}else{if(d=="CA"){$("city_label").update("City, Province:")
}else{$("city_label").update("City, State/Province/Region:")
}$("state_field").hide();
$("zip_label").update("Postal Code:")
}});
var b=a.onsubmit||function(d,c){return true
};
a.onsubmit=function(d){var c=b.call(a,d);
if(c){window.parent.document.getElementById("cc_iframe").style.height="0px"
}else{Event.stop(d)
}}.bindAsEventListener(this)
},"#cc_form":function(){window.theCCForm=new BraintreeTRForm("cc_form",window.parent.document.getElementById("errors"));
new Control.Window($(document.body).down("[href=#cvv_help]"),{position:"relative",hover:true,offsetLeft:90,offsetTop:-230,className:"tooltip"})
},"#new_block_link":function(){$("new_coupon_block").hide();
$("new_block_link").observe("click",function(){Effect.toggle("new_coupon_block")
})
},"#bookstore":function(a){var b=/^\/publisher\//.test(document.location.pathname)?"publisher":"random";
new Bookshelf(a,bookshelfData,{sort:b})
},"#mybooks":function(a){new Bookshelf(a,bookshelfData,{sort:"random"})
},"#myrecordings":function(a){new Bookshelf(a,bookshelfData,{sort:"read_at",sortDescending:true})
},"body.readings.edit":function(a){window.asbbIsDirty=false;
window.onbeforeunload=function(){if(window.asbbIsDirty){return"You haven’t finished your reading. If you leave now you can come back and continue from this page of the book."
}};
tryAVPermissionCheck()
},".status_box, #recording_status":function(a){if(!window.IsIE7){roundBox(a)
}},".slash_box":function(a){if(!window.IsIE7){slashBox(a)
}},"#not_wa_state":function(a){a.observe("change",function(){if(this.checked){$("addr_form").hide();
var b=LiveValidationForm.getInstance($("paypal_form"));
paypalAddressValidations.each(function(c){b.removeField(c)
});
$("errors").setStyle({visibility:"hidden"})
}else{$("addr_form").show();
var b=LiveValidationForm.getInstance($("paypal_form"));
paypalAddressValidations.each(function(c){b.addField(c)
});
$("errors").setStyle({visibility:""})
}})
},".dynamic_visibility":function(a){new ContentObserver(a,0.2,function(b,c){if(c.strip().empty()){b.hide()
}else{b.show()
}})
},"#mil_subscribe":function(a){new LiveValidation("email",{validMessage:"",onlyOnSubmit:true}).add(Validate.Presence,{failureMessage:"What’s your email address?"}).add(Validate.Email,{failureMessage:"Sorry, this doesn’t appear to be a valid email address."}).add(Validate.Format,{pattern:/(\.mil$|@jacksonfish\.com$)/i,failureMessage:"Sorry, you need a .MIL address to qualify."})
},"#new_refund":function(a){var b=a.onsubmit||function(d,c){return true
};
a.onsubmit=function(d){var c=b.call(a,d);
if(c){$("submit_btn").hide();
$("progress").show()
}if(!c){Event.stop(d)
}}.bindAsEventListener(this)
},"#plug_holder":function(a){if(a.childElements().length>1){var b=function(e){var d=e.select(".plug_active");
var c=null;
if(d.length>0){c=d.last().next()
}if(c==null){c=e.childElements().first()
}e.childElements().each(function(f){if(f==c){f.addClassName("plug_active");
f.appear()
}else{if(f.hasClassName("plug_active")){f.removeClassName("plug_active");
f.fade()
}else{f.hide()
}}})
};
b(a);
new PeriodicalExecuter(function(c){b(a)
},8)
}},"#slide_holder":function(a){a.setStyle({left:"1000px"});
new Effect.Move(a,{delay:2,duration:0.5,x:-1000,mode:"relative"})
},"#fb_share":function(a){a.observe("click",function(){_gaq.push(["_trackPageview","/goal/facebook/share-click"])
})
},"#add_to_myrecordings":addToMyRecordingsLoader,"#remove_from_myrecordings":removeFromMyRecordingsLoader,"#mail_to_someone_form":emailRecordingLoader});
document.observe("dom:loaded",function(){Setup.each(function(a){var b=$$(a.key);
if(b.length>0){b.each(function(c){(a.value)(c)
})
}});
AutoLabel.load()
});
function preload(){$A(arguments).each(function(a){new Image().src=a
})
}function redirect_to(a){window.location=a
}function setErrors(a){$("errors").innerHTML=a
}function isEmail(a){return Validate.emailRegex.test(a.strip())
}var ContentObserver=Class.create(Abstract.TimedObserver,{firstValue:"x",getValue:function(){var a=this.firstValue||(this.element.textContent===undefined?this.element.innerText:this.element.textContent);
this.firstValue=null;
return a
}});
var Bookshelf=Class.create((function(){function c(g,e,h){var f=new Element("div",{"class":e});
if(h==undefined){var d=a[g][e];
h={width:d.width+"px",height:d.height+"px"}
}f.setStyle(h);
return f
}var b=0.8;
var a={bookstore:{bookshelf_front:{width:704,height:81},bookshelf_back:{width:652,height:160*b+20},bookshelf_feet:{width:689,height:86},sortby:{width:41,height:14}},mybooks:{bookshelf_front:{width:704,height:81},bookshelf_back:{width:652,height:160*b+20},bookshelf_feet:{width:689,height:86},sortby:{width:41,height:14}},myrecordings:{bookshelf_top:{width:704,height:147},bookshelf_front:{width:704,height:73},bookshelf_back:{width:652,height:160*b+20},bookshelf_feet:{width:705,height:86},sortby:{width:41,height:14}}};
return{fullScale:160*b,initialize:function(g,j,f){this.element=$(g);
this.fullData=$A(j);
f=Object.extend({sort:"title",sortDescending:false,filterFunc:function(l){return true
}},f||{});
this.fullData.each(function(l){l.width*=b;
l.height*=b
});
this.data=this.fullData;
this.sort=f.sort;
this.sortDescending=f.sortDescending;
this.filter=null;
this.filterFunc=f.filterFunc;
this.styleName=this.element.id;
if(sectionData&&sectionData.header_image_url){var h={backgroundImage:"url("+sectionData.header_image_url+")",width:sectionData.header_width+"px",height:sectionData.header_height+"px"}
}var k=c(this.styleName,"bookshelf_top",h);
this.element.insert(k);
this.booksDiv=new Element("div",{"class":"books"});
this.element.insert(this.booksDiv);
this.shelvesDiv=new Element("div",{"class":"shelves"});
this.element.insert(this.shelvesDiv);
var e=(sectionData==null)?null:sectionData.sections.findAll(function(l){return l.name=="home"
}).first();
if(this.styleName!="myrecordings"&&e){k.insert(new Element("div").addClassName("home_elements").insert(new Element("a",{"class":"home_button",href:e.link})).insert(new Element("div").addClassName("vert_div")))
}k.insert(c(this.styleName,"sortby").addClassName("sortby"));
var d=new Element("div");
k.insert(d);
this.buttonBar=new ButtonBar(d,this.element.id);
if(this.styleName!="myrecordings"){var i=new Element("div",{"class":"search_box"+($("myrecordings")?" myrecordings_search_box":"")});
k.insert(i);
this.searchBox=new SearchBox(i)
}this.fullData.each(function(l){l.searchBlob=[l.title,l.summary,l.publisher,l.author,l.reader].join(" ").toLowerCase()
});
this.element.observe("buttonbar:sort_ages",function(){this.setSort("age_range")
}.bind(this));
this.element.observe("buttonbar:sort_length",function(){this.setSort("length")
}.bind(this));
this.element.observe("buttonbar:sort_title",function(){this.setSort("title")
}.bind(this));
this.element.observe("buttonbar:sort_publisher",function(){this.setSort("publisher")
}.bind(this));
this.element.observe("buttonbar:sort_reader",function(){this.setSort("reader")
}.bind(this));
this.element.observe("buttonbar:sort_read_at",function(){this.setSort("read_at",true)
}.bind(this));
TooltipManager.init(new BookTooltip());
this.setSort(this.sort,this.sortDescending)
},setFilter:function(d){d=d.strip();
this.filter=d==""?null:d;
this.filterAndSort();
this.buildShelves()
},setSort:function(d,e){this.sort=d;
this.sortDescending=e;
this.buttonBar.selectButton("sort_"+d);
this.filterAndSort();
this.buildShelves()
},filterAndSort:function(){this.data=$A(this.fullData);
if(this.filterFunc){this.data=this.data.filter(this.filterFunc)
}if(this.filter){var d=this.filter.toLowerCase().split(/\s/);
this.data=this.data.filter(function(h){return d.all(function(i){return h.searchBlob.indexOf(i)!=-1
})
})
}var g=this.sort;
if(g=="random"){var f=Cookie.get("bookseed");
if(f){f=parseInt(f)
}else{f=new Date().valueOf();
Cookie.set("bookseed",f,0)
}var e=new RNG(f);
this.data.each(function(h){h.random=e.nextInt()&16777215;
if(h.flags.indexOf("featured")!=-1){h.random*=-1
}else{if(h.flags.indexOf("new")==-1){h.random+=16777216
}}})
}this.data=this.data.sortBy(function(h){return h[g]
});
if(this.sortDescending){this.data=this.data.reverse()
}},buildShelves:function(){this.booksDiv.update();
this.shelvesDiv.update();
var d=ValueNameMap[this.sort];
var p=null;
var e=false;
var m=0;
var k=0;
var f=this.booksDiv.getWidth();
var q=(function(i,s,n){if(m+s+20>f){h();
if(this.sort=="random"&&n&&n.random<0){q(new BookshelfSign(null,"featured").element,this.fullScale,null)
}}i.setStyle({left:m+"px",top:k+"px"});
this.booksDiv.insert(i);
m+=s+10
}).bind(this);
var h=(function(){m=0;
k+=this.fullScale+30;
this.shelvesDiv.insert(c(this.styleName,"bookshelf_back"));
var i=c(this.styleName,"bookshelf_front");
i.setStyle({position:"absolute",left:0,top:(k-10)+"px"});
this.booksDiv.insert(i)
}).bind(this);
if(this.styleName!="myrecordings"&&this.data.length==0){q(new NoSearchResults().element)
}for(var j=0,g=this.data.length;
j<g;
j++){var o=this.data[j][this.sort];
if(this.sort=="random"){if(j==0&&o<0){q(new BookshelfSign(null,"featured").element,this.fullScale,null)
}if(j>0&&o>0&&p<0){h()
}}if(o!=p){if(this.sort=="publisher"){if(j>0){h()
}q(new PublisherLogo(null,this.data[j],this.fullScale).element,this.fullScale,null)
}}var r=new BookCover(null,this.data[j]).element;
q(r,this.data[j].width,this.data[j]);
if(o!=p&&$w("title read_at publisher random").indexOf(this.sort)==-1){var l=new BookLabel(null,r,d?d[o]:o);
this.booksDiv.insert(l.element)
}p=o
}if(sectionData&&sectionData.sections.length>0){h();
sectionData.sections.each(function(i){q(new SectionElement(null,i).element,i.icon_width,null)
})
}h();
this.shelvesDiv.insert(c(this.styleName,"bookshelf_feet"));
if(this.styleName!="myrecordings"){this.shelvesDiv.insert(new Element("div",{"class":"suggest_link"}).update("Don’t see the book you want? ").insert(new Element("a",{href:"/suggestions/new"}).update("Suggest it.")))
}}}
})());
var SearchBox=Class.create({initialize:function(b){this.element=$(b||new Element("div"));
this.formElement=new Element("form",{action:search_url,method:"get"});
this.element.insert(this.formElement);
var a={type:"text","class":"query",name:"query",value:params.query||""};
this.queryBox=new Element("input",a);
this.formElement.insert(this.queryBox)
}});
var BookCover=Class.create((function(){var a=["new","free","holiday"];
return{initialize:function(b,c){this.element=$(b||new Element("div"));
this.data=c;
this.element.addClassName("book_cover").setStyle({width:(c.width+8)+"px"}).update(this.linkElt=new Element("a",{href:c.link,alt:c.title,title:""}).update(new Element("span",{"class":"thumb_shadow_left"}).setStyle({width:(c.width/2+4)+"px",height:(c.height+8)+"px"})).insert(new Element("span",{"class":"thumb_shadow_right"}).setStyle({left:(c.width/2)+"px",width:(c.width/2+4)+"px",height:(c.height+8)+"px"})).insert(new Element("img",{"class":"cover_thumb",src:c.cover_thumb,width:c.width,height:c.height})));
c.flags.each(function(d){if(a.indexOf(d)!=-1){if(!(d=="free"&&window.location.pathname.indexOf("/mybooks")!=-1)){this.linkElt.insert(new Element("div",{"class":"book_tag_holder"}).setStyle({height:c.height+"px"}).update(new Element("div",{"class":"book_tag book_tag_"+d})))
}}}.bind(this));
new TooltipHandler(this.element,TooltipManager.tooltip,c)
}}
})());
var PublisherLogo=Class.create({initialize:function(c,d,b){var a=publisherData[d.publisher];
if(a){this.element=$(c||new Element("a",{href:a.url,target:"_blank"}));
this.element.addClassName("publisher_logo").setStyle({width:b+"px"}).update(new Element("img",{src:a.logo_url,width:b,height:b,alt:d.publisher,title:""}))
}else{this.element=$(c||new Element("div"))
}}});
var BookLabel=Class.create({initialize:function(b,c,d){this.element=$(b||new Element("div"));
var a=c.positionedOffset();
this.element.addClassName("book_label").setStyle({left:a[0]+"px",top:(a[1]+Bookshelf.prototype.fullScale+8)+"px"});
if(d){this.element.update(new Element("div",{"class":"label_text"}).update(d))
}}});
var SectionElement=Class.create({initialize:function(d,e){this.element=$(d||new Element("div"));
this.element.addClassName("section_element");
var c=new Element("a",{href:e.link});
this.element.update(c);
var a=new Element("img",{src:e.icon_image_url});
a.setStyle({width:e.icon_width+"px",height:e.icon_height+"px"});
c.update(a);
if(e.name=="home"){return
}var b=new Element("div",{"class":"badge"});
c.insert(b);
if(e.book_count>=100){b.addClassName("digits_3")
}else{b.addClassName("digits_2")
}b.update(e.book_count)
}});
var BookshelfSign=Class.create({initialize:function(b,a){this.element=$(b||new Element("div"));
this.element.addClassName("sign_"+a)
}});
var NoSearchResults=Class.create({initialize:function(){this.element=new Element("div");
this.element.addClassName("no_results")
}});
var TooltipManager={tooltip:null,showDelay:1000,showTimer:null,hideDelay:500,hideTimer:null,currentHandler:null,init:function(a){TooltipManager.tooltip=a;
$(document.body).insert(a.element)
},enterTarget:function(a){TooltipManager.clearTimers();
if(TooltipManager.tooltip.element.visible()){a.show()
}else{TooltipManager.showTimer=window.setTimeout(function(){a.show()
},TooltipManager.showDelay)
}TooltipManager.currentHandler=a
},leaveTarget:function(a){TooltipManager.currentHandler=null;
TooltipManager.clearTimers();
TooltipManager.hideTimer=window.setTimeout(function(){a.hide()
},TooltipManager.hideDelay)
},leaveTip:function(a){if(TooltipManager.currentHandler&&(!a.relatedTarget||!a.relatedTarget.isOrDescendantOf(TooltipManager.currentHandler.target))){TooltipManager.leaveTarget(TooltipManager.currentHandler)
}},clearTimers:function(){if(TooltipManager.showTimer){window.clearTimeout(TooltipManager.showTimer);
TooltipManager.showTimer=null
}if(TooltipManager.hideTimer){window.clearTimeout(TooltipManager.hideTimer);
TooltipManager.hideTimer=null
}}};
var TooltipHandler=Class.create({initialize:function(c,b,a){this.target=c;
this.tip=b;
this.data=a;
c.observe("mouseenter",this.enter.bind(this));
c.observe("mouseleave",this.leave.bind(this))
},enter:function(){TooltipManager.enterTarget(this)
},leave:function(a){if(!a.relatedTarget||!a.relatedTarget.isOrDescendantOf(TooltipManager.tooltip.element)){TooltipManager.leaveTarget(this)
}},show:function(){var a=this.target.cumulativeOffset();
this.tip.show(a.left+100,a.top+30,this.data)
},hide:function(){this.tip.hide()
}});
var BookTooltip=Class.create({initialize:function(){this.element=new Element("div");
this.element.hide();
this.element.addClassName("book_tip").update(new Element("div",{"class":"content"}).insert({bottom:(this.titleDiv=new Element("div",{"class":"title"}))}).insert({bottom:(this.authorDiv=new Element("div",{"class":"author"}))}).insert({bottom:(this.publisherDiv=new Element("div",{"class":"publisher"}))}).insert({bottom:(this.summaryDiv=new Element("div",{"class":"summary"}))}).insert({bottom:(this.statsDiv=new Element("div",{"class":"stats"}))}).insert({bottom:(this.priceTagDiv=new Element("div",{"class":"price_tag"}).insert(new Element("div",{"class":"text"}).insert("A Story Before Bed Price<br/>").insert(this.priceDiv=new Element("span",{"class":"price"}))))}).insert({bottom:(this.msrpDiv=new Element("div",{"class":"msrp"}))})).insert({top:new Element("div",{"class":"tip_top"})}).insert({bottom:new Element("div",{"class":"tip_bottom"})});
this.element.observe("mouseleave",this.leave.bind(this))
},leave:function(a){TooltipManager.leaveTip(a)
},show:function(a,c,b){this.titleDiv.update(b.title);
this.authorDiv.update("by "+b.author);
this.publisherDiv.update(b.publisher);
this.summaryDiv.update(b.summary);
this.statsDiv.update(b.pages+" pages<br/>Ages "+ValueNameMap.age_range[b.age_range]);
if(window.location.pathname.indexOf("/mybooks")!=-1||freeBookData.indexOf(b.id)!=-1){this.priceTagDiv.hide();
this.msrpDiv.hide()
}else{this.priceTagDiv.show();
this.msrpDiv.show()
}if(b.price){this.priceDiv.update("$"+b.price)
}else{this.priceDiv.update("Free!")
}if(b.msrp){this.msrpDiv.update("Regular price $"+b.msrp)
}if(c+this.element.getHeight()>$("wrapper").getHeight()){c=$("wrapper").getHeight()-this.element.getHeight()-30
}this.element.setStyle({left:a+"px",top:c+"px"});
this.element.show()
},hide:function(){this.element.hide()
}});
var ButtonBar=Class.create({initialize:function(c,a){this.element=$(c);
this.info=this.barData[a];
this.buttons=[];
this.selectedButton=null;
this.element.addClassName("button_bar").setStyle({height:this.info.height+"px"});
for(var b=0,e=this.info.offsets.length;
b<e;
b++){var d=new Element("div",{"class":"buttonbar_button clear_fill"}).setStyle({width:this.info.widths[b]+"px",height:"100%"});
this.buttons.push(new ButtonBarButton(d,this.info.offsets[b],this.info.commands[b]));
this.element.insert(d)
}this.element.observe("buttonbar:click",this.onClick.bind(this))
},selectButton:function(b){var a=this.buttons.find(function(c){return c.command==b
});
if(a){if(this.selectedButton){this.selectedButton.setSelected(false)
}this.selectedButton=a;
a.setSelected(true)
}},onClick:function(b){var a=b.memo;
if(a!=this.selectedButton){this.selectButton(a.command)
}},barData:{bookstore:{width:320,height:27,commands:$w("sort_title sort_publisher sort_ages sort_length"),offsets:[152,226,0,76],widths:[70,70,70,70]},mybooks:{width:320,height:27,commands:$w("sort_title sort_publisher sort_ages sort_length"),offsets:[152,226,0,76],widths:[70,70,70,70]},myrecordings:{width:320,height:27,commands:$w("sort_title sort_reader sort_read_at"),offsets:[0,75,184],widths:[70,103,126]}}});
var ButtonBarButton=Class.create({initialize:function(a,d,c){this.element=$(a);
this.command=c;
this.selected=false;
var b=this;
this.element.addClassName("button");
this.element.setStyle({backgroundPosition:-d+"px 0px",backgroundRepeat:"no-repeat"});
this.element.observe("mouseenter",function(){this.addClassName("over")
});
this.element.observe("mouseleave",function(){this.removeClassName("over");
if(!b.selected){this.removeClassName("down")
}});
this.element.observe("mousedown",function(){this.addClassName("down")
});
this.element.observe("mouseup",function(){if(!b.selected){this.removeClassName("down")
}if(this.hasClassName("over")){this.fire("buttonbar:click",b);
this.fire("buttonbar:"+c)
}})
},setSelected:function(a){this.selected=a;
if(a){this.element.addClassName("down")
}else{this.element.removeClassName("down")
}}});
function tryAVPermissionCheck(){var a=window.BookViewer||document.BookViewer;
if(a&&a.avPermissionCheck&&a.avPermissionCheck()){}else{window.setTimeout(tryAVPermissionCheck,500)
}}function reloadBookViewer(){var a=new Element("div");
$("BookViewer").insert({before:a});
swfobject.removeSWF("BookViewer");
a.setAttribute("id","BookViewer_div");
embedBookViewer();
tryAVPermissionCheck()
}function noCameras(){$("BookViewer").hide();
$("noDevicesMsg").show()
}function noMicrophones(){$("BookViewer").hide();
$("noDevicesMsg").show()
}function avDenied(){$("deniedMsg").show();
reloadBookViewer()
}function avDialog(){$("securityMsg").show();
$("BookViewer").className="securityDialog";
$("BookViewer").style.visibility=""
}function avChoose(){$("securityMsg").hide();
$("deniedMsg").hide();
$("chooserMsg").show();
$("BookViewer").className="avChooser";
$("BookViewer").style.visibility=""
}function choosingMic(){$("chooserMsg").hide();
$("micMsg").show();
$("BookViewer").className="avChooser";
$("BookViewer").style.visibility=""
}function avReady(){$("micMsg").hide();
$("BookViewer").className="";
$("BookViewer").style.visibility="";
var a=window.BookViewer||document.BookViewer;
(function(){a.launchBookViewer()
}).defer();
trackPage("/goal/av_ready")
}function roundBox(d){d=$(d);
d.makePositioned();
d.setStyle({zIndex:2});
var c=new Element("div",{style:"position: absolute; z-index: 1"});
d.insert({after:c});
c.clonePosition(d);
var f=c.getWidth();
var b=c.getHeight();
var a=12;
var h=Raphael(c,f,b);
var e=["M",a,0,"L",f-a,0,"A",a,a,0,0,1,f,a,"L",f,b-a,"A",a,a,0,0,1,f-a,b,"L",a,b,"A",a,a,0,0,1,0,b-a,"L",0,a,"A",a,a,0,0,1,a,0].join(",");
h.path(e).attr({"stroke-width":0,fill:"black","fill-opacity":0.3})
}function slashBox(c){c=$(c);
c.setStyle({zIndex:1});
var b=new Element("div",{style:"position: absolute; z-index: 2"});
c.insert({after:b});
b.clonePosition(c);
var d=b.getWidth();
var a=b.getHeight();
var e=Raphael(b,d,a);
e.path(["M",2,2,"L",d-2,a-2].join(",")).attr({"stroke-width":3,stroke:"#ff0000"})
}function facebookShare(a){window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(a),"sharer","toolbar=0,status=0,width=626,height=436");
_gaq.push(["_trackPageview","/goal/facebook/share-auto"]);
return false
}function cctest(){var a=$("cc_iframe");
$H({ccnumber:"4111111111111111",cvv:"999",firstname:"Joe",lastname:"Blow",address1:"123 Any St",city:"Cocoa Beach",state:"WA",zip:"12345",phone:"2062123456",email:"joe@example.com"}).each(function(b){var c=a.contentWindow.document.getElementById(b.key);
if(c){$(c).value=b.value
}c=a.contentWindow.document.getElementById("address_"+b.key);
if(c){$(c).value=b.value
}})
}jQuery(document).ready(function(){jQuery("#content_registration_form").validate({onkeyup:false,onfocusout:false,rules:{"user[name]":"required","user[email]":{required:true,email:true,minlength:6,maxlength:100,remote:"/account/email_available"},"user[password]":{required:true,minlength:4},"user[password_confirmation]":{equalTo:"#user_password"}},messages:{"user[name]":"Oops, what’s your name?","user[email]":{required:"Oops, what’s your email address?",email:"Oops, this doesn’t appear to be a valid email address.",minlength:"Sorry, this email address is too short (minimum is {0} characters).",maxlength:"Sorry, this email address is too long (maximum is {0} characters).",remote:"Sorry, this email address is already taken."},"user[password]":{required:"Please choose a password.",minlength:"Sorry, this password is too short (minimum is {0} characters).",},"user[password_confirmation]":{equalTo:"Oops, this doesn’t match the password above."}},highlight:function(c,a,b){jQuery(c).addClass(a).removeClass(b);
jQuery(c).parent().addClass("fieldWithErrors")
},unhighlight:function(c,a,b){jQuery(c).removeClass(a).addClass(b);
jQuery(c).parent().removeClass("fieldWithErrors")
}})
});
jQuery(document).ready(function(){jQuery("#books_to_record #close_x").click(function(){jQuery("#books_to_record").fadeOut("fast");
jQuery.ajax({url:"/account/disable_mybooks_alert",type:"POST"})
})
});
jQuery(document).ready(function(){jQuery("#reset_form").validate({onkeyup:false,onfocusout:false,rules:{"user[email]":{required:true,email:true,remote:"/account/email_exists"}},messages:{"user[email]":{required:"Oops, what’s your email address?",email:"Oops, this doesn’t appear to be a valid email address.",remote:"Sorry, there is no account with this email address."}},highlight:function(c,a,b){jQuery(c).addClass(a).removeClass(b);
jQuery(c).parent().addClass("fieldWithErrors")
},unhighlight:function(c,a,b){jQuery(c).removeClass(a).addClass(b);
jQuery(c).parent().removeClass("fieldWithErrors")
}})
});
jQuery(document).ready(function(){jQuery("#change_form").validate({onkeyup:false,onfocusout:false,rules:{"user[perishable_token]":{required:true,remote:"/account/perishable_token_exists"},"user[password]":{required:true,minlength:4},"user[password_confirmation]":{equalTo:"#user_password"}},messages:{"user[perishable_token]":{required:"Oops, check your email for a reset code.",remote:"Sorry, that reset code isn’t valid or has expired."},"user[password]":{required:"Please choose a password.",minlength:"Sorry, password must be at least {0} characters."},"user[password_confirmation]":{equalTo:"Oops, this doesn’t match the password above."}},highlight:function(c,a,b){jQuery(c).addClass(a).removeClass(b);
jQuery(c).parent().addClass("fieldWithErrors")
},unhighlight:function(c,a,b){jQuery(c).removeClass(a).addClass(b);
jQuery(c).parent().removeClass("fieldWithErrors")
}})
});
function display_verification_modal(){jQuery.ajax({url:"/verification/mail",type:"POST"});
jQuery("#verification_modal").dialog("open")
}jQuery(document).ready(function(){jQuery("#verification_form").validate({onkeyup:false,onfocusout:false,rules:{code:{required:true,remote:{url:"/verification.json",type:"POST",data:{code:function(){return jQuery("#code").val()
}}}},},messages:{code:{required:"Oops, check your email for a verification code.",remote:"Sorry, that verification code isn’t valid or has expired."}},highlight:function(c,a,b){jQuery(c).addClass(a).removeClass(b);
jQuery(c).parent().addClass("fieldWithErrors")
},unhighlight:function(c,a,b){jQuery(c).removeClass(a).addClass(b);
jQuery(c).parent().removeClass("fieldWithErrors")
}});
jQuery("#code").watermark("Enter your validation code here");
jQuery("#verification_modal").dialog({autoOpen:false,width:700,modal:true,resizable:false,closeOnEscape:false,open:function(a,b){jQuery("#code").blur();
jQuery(".ui-dialog-titlebar-close",jQuery(this).parent()).hide()
},buttons:{Verify:checkResult,"I've already verified":function(){jQuery.ajax({url:"/verification/check",type:"GET",success:function(a){if(a){verification_modal=jQuery("#verification_modal");
verification_modal.dialog("close");
verification_modal.remove()
}else{alert("Sorry, but your email address has not been verified.  Try checking your spam folder for the verification email.")
}},error:function(a){alert("An error occurred!")
}})
},"I'll do it later":function(){jQuery("#verification_modal").dialog("close");
jQuery.ajax({url:"/account/disable_verification_modal",type:"POST"})
}}})
});
function checkResult(){var a=jQuery("#verification_form").validate().element("#code");
if(typeof a=="undefined"){setTimeout("checkResult()",100)
}else{if(a){verification_modal=jQuery("#verification_modal");
verification_modal.dialog("close");
verification_modal.remove()
}}}jQuery(document).ready(function(){jQuery("#verify_form").validate({onkeyup:false,onfocusout:false,rules:{"user[perishable_token]":{required:true,remote:"/account/perishable_token_exists"}},messages:{"user[perishable_token]":{required:"Oops, check your email for a verification code.",remote:"Sorry, that verification code isn’t valid or has expired."}},highlight:function(c,a,b){jQuery(c).addClass(a).removeClass(b);
jQuery(c).parent().addClass("fieldWithErrors")
},unhighlight:function(c,a,b){jQuery(c).removeClass(a).addClass(b);
jQuery(c).parent().removeClass("fieldWithErrors")
}})
});
(function(a){window.Recording=Backbone.Model.extend({urlRoot:"/admin/recordings"})
})(jQuery);
(function(a){window.Recordings=Backbone.Collection.extend({model:Recording})
})(jQuery);
window.Admin=window.Admin||{};
window.Admin.BookGroups=window.Admin.BookGroups||{};
(function(a){window.Admin.BookGroups.RecordingViewConroller=Backbone.View.extend({el:"#recording_view_controller",events:{"keydown #recording_handle":"createRecordingOnEnter","click #create_recording":"createRecording"},initialize:function(){this.$recordingHandle=this.$("#recording_handle");
this.$recordingViews=this.$("#recording_views");
this.recordings=this.options.recordings||new Recordings;
var b=this;
this.recordings.each(function(c){b.appendRecordingView(c)
});
this.recordings.bind("add",this.appendRecordingView,this)
},finalize:function(){this.recordings.unbind("add",this.appendRecordingView)
},createRecordingOnEnter:function(b){if(b.which!=13){return
}b.preventDefault();
this.createRecording(b)
},createRecording:function(c){var d=this.$recordingHandle.val();
if(!d){this.displayRecordingHandleError("Whoops!  Please enter a recording handle.");
return false
}var b=new Recording({id:d});
b.bind("change",this.fetchRecordingSuccess,this);
b.bind("error",this.fetchRecordingError,this);
b.fetch({error:function(f,e){f.trigger("error",f,e.responseText)
}})
},unbindFetchedRecording:function(b){b.unbind("change",this.fetchRecordingSuccess);
b.unbind("error",this.fetchRecordingError)
},fetchRecordingSuccess:function(b){this.unbindFetchedRecording(b);
if(this.recordings.get(b.id)){var c="Sorry, that recording is already part of this bundle.";
this.displayRecordingHandleError(c);
return false
}this.recordings.add(b);
this.$recordingHandle.val("");
this.clearRecordingHandleError()
},fetchRecordingError:function(b,c){this.unbindFetchedRecording(b);
this.displayRecordingHandleError(c);
this.recording.destroy()
},appendRecordingView:function(b){var d=new Admin.BookGroups.RecordingView({model:b,collection:this.recordings}).render().el;
var c=(this.recordings.indexOf(b)%2==0?"even":"odd");
a(d).addClass(c);
a(d).hide().appendTo(this.$recordingViews).fadeIn("fast")
},displayRecordingHandleError:function(b){this.$recordingHandle.parent().addClass("fieldWithErrors");
this.$recordingHandle.siblings("#recording_handle_error").text(b).css("display","block")
},clearRecordingHandleError:function(){this.$recordingHandle.parent().removeClass("fieldWithErrors");
this.$recordingHandle.siblings("#recording_handle_error").hide().text("")
}})
})(jQuery);
window.Admin=window.Admin||{};
window.Admin.BookGroups=window.Admin.BookGroups||{};
(function(a){window.Admin.BookGroups.RecordingView=Backbone.View.extend({templateSelector:"#recording_view_template",className:"recording_view",events:{"click .remove":"removeRecording"},initialize:function(){this.template=Handlebars.compile(a(this.templateSelector).html())
},render:function(){a(this.el).html(this.template(this.model.toJSON()));
return this
},removeRecording:function(c){c.preventDefault();
this.collection.remove(this.model);
var b=this;
a(this.el).fadeOut("fast",function(){b.destroy()
})
}})
})(jQuery);
