/*
 * jQuery JavaScript Library v1.6.2
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Thu Jun 30 14:16:56 2011 -0400
 */
(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1
}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");
d.remove();
if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);
if(!ci||!ch.createElement){ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close()
}d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)
}cg[a]=e
}return cg[a]
}function cr(a,b){var c={};
f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a
});
return c
}function cq(){cn=b
}function cp(){setTimeout(cq,0);
return cn=f.now()
}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")
}catch(b){}}function ce(){try{return new a.XMLHttpRequest
}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));
var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;
for(g=1;
g<i;
g++){if(g===1){for(h in a.converters){typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h])
}}l=k,k=d[g];
if(k==="*"){k=l
}else{if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];
if(!n){p=b;
for(o in e){j=o.split(" ");
if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];
if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);
break
}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))
}}}return c
}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;
for(i in g){i in d&&(c[g[i]]=d[i])
}while(f[0]==="*"){f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"))
}if(h){for(i in e){if(e[i]&&e[i].test(h)){f.unshift(i);
break
}}}if(f[0] in d){j=f[0]
}else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;
break
}k||(k=i)
}j=j||k
}if(j){j!==f[0]&&f.unshift(j);
return d[j]
}}function bY(a,b,c,d){if(f.isArray(b)){f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)
})
}else{if(!c&&b!=null&&typeof b=="object"){for(var e in b){bY(a+"["+e+"]",b[e],c,d)
}}else{d(a,b)
}}}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;
var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;
for(;
i<j&&(k||!l);
i++){l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)))
}(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));
return l
}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");
if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;
for(;
e<g;
e++){h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)
}}}
}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;
if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0
});
return d+"px"
}d=bx(a,b,b);
if(d<0||d==null){d=a.style[b]||0
}d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)
});
return d+"px"
}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)
}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName" in a&&f.grep(a.getElementsByTagName("input"),bk)
}function bk(a){if(a.type==="checkbox"||a.type==="radio"){a.defaultChecked=a.checked
}}function bj(a){return"getElementsByTagName" in a?a.getElementsByTagName("*"):"querySelectorAll" in a?a.querySelectorAll("*"):[]
}function bi(a,b){var c;
if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();
if(c==="object"){b.outerHTML=a.outerHTML
}else{if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option"){b.selected=a.defaultSelected
}else{if(c==="input"||c==="textarea"){b.defaultValue=a.defaultValue
}}}else{a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)
}}b.removeAttribute(f.expando)
}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);
if(d=d[c]){var g=d.events;
e=e[c]=f.extend({},d);
if(g){delete e.handle,e.events={};
for(var h in g){for(var i=0,j=g[h].length;
i<j;
i++){f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)
}}}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a
}function W(a,b,c){b=b||0;
if(f.isFunction(b)){return f.grep(a,function(a,d){var e=!!b.call(a,d,a);
return e===c
})
}if(b.nodeType){return f.grep(a,function(a,d){return a===b===c
})
}if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1
});
if(R.test(b)){return f.filter(b,d,!c)
}b=f.filter(b,d)
}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c
})
}function V(a){return !a||!a.parentNode||a.parentNode.nodeType===11
}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")
}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");
if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;
var s=r.live.slice(0);
for(i=0;
i<s.length;
i++){g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1)
}e=f(a.target).closest(q,a.currentTarget);
for(j=0,k=e.length;
j<k;
j++){m=e[j];
for(i=0;
i<s.length;
i++){g=s[i];
if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;
if(g.preType==="mouseenter"||g.preType==="mouseleave"){a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h)
}(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})
}}}for(j=0,k=p.length;
j<k;
j++){e=p[j];
if(c&&e.level>c){break
}a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);
if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);
if(a.isImmediatePropagationStopped()){break
}}}return b
}}function K(a,c,d){var e=f.extend({},d[0]);
e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()
}function E(){return !0
}function D(){return !1
}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);
i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())
},0)
}function l(a){for(var b in a){if(b!=="toJSON"){return !1
}}return !0
}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();
d=a.getAttribute(e);
if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)
}catch(g){}f.data(a,c,d)
}else{d=b
}}return d
}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")
}catch(a){setTimeout(J,1);
return
}e.ready()
}}var e=function(a,b){return new e.fn.init(a,b,h)
},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()
},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};
e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;
if(!a){return this
}if(a.nodeType){this.context=this[0]=a,this.length=1;
return this
}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;
return this
}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];
if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);
return e.merge(this,a)
}h=c.getElementById(g[2]);
if(h&&h.parentNode){if(h.id!==g[2]){return f.find(a)
}this.length=1,this[0]=h
}this.context=c,this.selector=a;
return this
}return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a)
}if(e.isFunction(a)){return f.ready(a)
}a.selector!==b&&(this.selector=a.selector,this.context=a.context);
return e.makeArray(a,this)
},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length
},toArray:function(){return F.call(this,0)
},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]
},pushStack:function(a,b,c){var d=this.constructor();
e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");
return d
},each:function(a,b){return e.each(this,a,b)
},ready:function(a){e.bindReady(),A.done(a);
return this
},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)
},first:function(){return this.eq(0)
},last:function(){return this.eq(-1)
},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))
},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)
}))
},end:function(){return this.prevObject||this.constructor(null)
},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;
typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);
for(;
j<k;
j++){if((a=arguments[j])!=null){for(c in a){d=i[c],f=a[c];
if(i===f){continue
}l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)
}}}return i
},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);
return e
},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)
},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body){return setTimeout(e.ready,1)
}e.isReady=!0;
if(a!==!0&&--e.readyWait>0){return
}A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")
}},bindReady:function(){if(!A){A=e._Deferred();
if(c.readyState==="complete"){return setTimeout(e.ready,1)
}if(c.addEventListener){c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1)
}else{if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);
var b=!1;
try{b=a.frameElement==null
}catch(d){}c.documentElement.doScroll&&b&&J()
}}}},isFunction:function(a){return e.type(a)==="function"
},isArray:Array.isArray||function(a){return e.type(a)==="array"
},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a
},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)
},type:function(a){return a==null?String(a):I[C.call(a)]||"object"
},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1
}if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf")){return !1
}var c;
for(c in a){}return c===b||D.call(a,c)
},isEmptyObject:function(a){for(var b in a){return !1
}return !0
},error:function(a){throw a
},parseJSON:function(b){if(typeof b!="string"||!b){return null
}b=e.trim(b);
if(a.JSON&&a.JSON.parse){return a.JSON.parse(b)
}if(o.test(b.replace(p,"@").replace(q,"]").replace(r,""))){return(new Function("return "+b))()
}e.error("Invalid JSON: "+b)
},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);
return c
},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)
})(b)
},camelCase:function(a){return a.replace(w,x)
},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()
},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);
if(d){if(i){for(f in a){if(c.apply(a[f],d)===!1){break
}}}else{for(;
g<h;
){if(c.apply(a[g++],d)===!1){break
}}}}else{if(i){for(f in a){if(c.call(a[f],f,a[f])===!1){break
}}}else{for(;
g<h;
){if(c.call(a[g],g,a[g++])===!1){break
}}}}return a
},trim:G?function(a){return a==null?"":G.call(a)
}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")
},makeArray:function(a,b){var c=b||[];
if(a!=null){var d=e.type(a);
a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)
}return c
},inArray:function(a,b){if(H){return H.call(b,a)
}for(var c=0,d=b.length;
c<d;
c++){if(b[c]===a){return c
}}return -1
},merge:function(a,c){var d=a.length,e=0;
if(typeof c.length=="number"){for(var f=c.length;
e<f;
e++){a[d++]=c[e]
}}else{while(c[e]!==b){a[d++]=c[e++]
}}a.length=d;
return a
},grep:function(a,b,c){var d=[],e;
c=!!c;
for(var f=0,g=a.length;
f<g;
f++){e=!!b(a[f],f),c!==e&&d.push(a[f])
}return d
},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));
if(k){for(;
i<j;
i++){f=c(a[i],i,d),f!=null&&(h[h.length]=f)
}}else{for(g in a){f=c(a[g],g,d),f!=null&&(h[h.length]=f)
}}return h.concat.apply([],h)
},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];
c=a,a=d
}if(!e.isFunction(a)){return b
}var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))
};
g.guid=a.guid=a.guid||g.guid||e.guid++;
return g
},access:function(a,c,d,f,g,h){var i=a.length;
if(typeof c=="object"){for(var j in c){e.access(a,j,c[j],f,g,d)
}return a
}if(d!==b){f=!h&&f&&e.isFunction(d);
for(var k=0;
k<i;
k++){g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h)
}return a
}return i?g(a[0],c):b
},now:function(){return(new Date).getTime()
},uaMatch:function(a){a=a.toLowerCase();
var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];
return{browser:b[1]||"",version:b[2]||"0"}
},sub:function(){function a(b,c){return new a.fn.init(b,c)
}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));
return e.fn.init.call(this,d,f,b)
},a.fn.init.prototype=a.fn;
var b=a(c);
return a
},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()
}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()
}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())
});
return e
}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;
f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;
b&&(k=b,b=0);
for(g=0,h=c.length;
g<h;
g++){i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i)
}k&&e.resolveWith(k[0],k[1])
}return this
},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;
try{while(a[0]){a.shift().apply(e,f)
}}finally{b=[e,f],c=0
}}return this
},resolve:function(){e.resolveWith(this,arguments);
return this
},isResolved:function(){return !!c||!!b
},cancel:function(){d=1,a=[];
return this
}};
return e
},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;
f.extend(b,{then:function(a,c){b.done(a).fail(c);
return this
},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)
},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;
f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)
}):b[a](d[g])
})
}).promise()
},promise:function(a){if(a==null){if(d){return d
}d=a={}
}var c=g.length;
while(c--){a[g[c]]=b[g[c]]
}return a
}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);
return b
},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))
}
}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();
if(d>1){for(;
c<d;
c++){b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e
}e||g.resolveWith(g,b)
}else{g!==a&&g.resolveWith(g,d?[a]:[])
}return g.promise()
}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;
a.setAttribute("className","t"),a.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];
if(!d||!d.length||!e){return{}
}g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;
try{delete a.test
}catch(v){k.deleteExpando=!1
}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1
}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1000,top:-1000});
for(t in p){o.style[t]=p[t]
}o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom" in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);
if(a.attachEvent){for(t in {submit:1,change:1,focusin:1}){s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u
}}o=l=g=h=m=j=a=i=null;
return k
}(),f.boxModel=f.support.boxModel;
var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;
f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];
return !!a&&!l(a)
},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;
if((!l||e&&l&&!k[l][g])&&h&&d===b){return
}l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));
if(typeof c=="object"||typeof c=="function"){e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c)
}i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);
if(c==="events"&&!i[c]){return i[g]&&i[g].events
}return h?i[f.camelCase(c)]||i[c]:i
}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;
if(!h[i]){return
}if(c){var j=d?h[i][e]:h[i];
if(j){delete j[c];
if(!l(j)){return
}}}if(d){delete h[i][e];
if(!l(h[i])){return
}}var k=h[i][e];
f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)
}},_data:function(a,b,c){return f.data(a,b,c,!0)
},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];
if(b){return b!==!0&&a.getAttribute("classid")===b
}}return !0
}}),f.fn.extend({data:function(a,c){var d=null;
if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);
if(this[0].nodeType===1){var e=this[0].attributes,g;
for(var h=0,i=e.length;
h<i;
h++){g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))
}}}return d
}if(typeof a=="object"){return this.each(function(){f.data(this,a)
})
}var j=a.split(".");
j[1]=j[1]?"."+j[1]:"";
if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));
return d===b&&j[1]?this.data(j[0]):d
}return this.each(function(){var b=f(this),d=[j[0],c];
b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)
})
},removeData:function(a){return this.each(function(){f.removeData(this,a)
})
}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))
},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);
if(c){d=d||"fx";
var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;
g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))
}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";
var e=f.data(a,c,b,!0);
d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));
return e||[]
}},dequeue:function(a,b){b=b||"fx";
var c=f.queue(a,b),d=c.shift(),e;
d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)
})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))
}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");
if(c===b){return f.queue(this[0],a)
}return this.each(function(){var b=f.queue(this,a,c);
a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)
})
},dequeue:function(a){return this.each(function(){f.dequeue(this,a)
})
},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";
return this.queue(b,function(){var c=this;
setTimeout(function(){f.dequeue(c,b)
},a)
})
},clearQueue:function(a){return this.queue(a||"fx",[])
},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])
}typeof a!="string"&&(c=a,a=b),a=a||"fx";
var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;
while(g--){if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0)){h++,l.done(m)
}}m();
return d.promise()
}});
var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;
f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)
},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)
})
},prop:function(a,b){return f.access(this,a,b,!0,f.prop)
},removeProp:function(a){a=f.propFix[a]||a;
return this.each(function(){try{this[a]=b,delete this[a]
}catch(c){}})
},addClass:function(a){var b,c,d,e,g,h,i;
if(f.isFunction(a)){return this.each(function(b){f(this).addClass(a.call(this,b,this.className))
})
}if(a&&typeof a=="string"){b=a.split(o);
for(c=0,d=this.length;
c<d;
c++){e=this[c];
if(e.nodeType===1){if(!e.className&&b.length===1){e.className=a
}else{g=" "+e.className+" ";
for(h=0,i=b.length;
h<i;
h++){~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ")
}e.className=f.trim(g)
}}}}return this
},removeClass:function(a){var c,d,e,g,h,i,j;
if(f.isFunction(a)){return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))
})
}if(a&&typeof a=="string"||a===b){c=(a||"").split(o);
for(d=0,e=this.length;
d<e;
d++){g=this[d];
if(g.nodeType===1&&g.className){if(a){h=(" "+g.className+" ").replace(n," ");
for(i=0,j=c.length;
i<j;
i++){h=h.replace(" "+c[i]+" "," ")
}g.className=f.trim(h)
}else{g.className=""
}}}}return this
},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";
if(f.isFunction(a)){return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)
})
}return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);
while(e=j[g++]){i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)
}}else{if(c==="undefined"||c==="boolean"){this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""
}}})
},hasClass:function(a){var b=" "+a+" ";
for(var c=0,d=this.length;
c<d;
c++){if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1){return !0
}}return !1
},val:function(a){var c,d,e=this[0];
if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];
if(c&&"get" in c&&(d=c.get(e,"value"))!==b){return d
}d=e.value;
return typeof d=="string"?d.replace(p,""):d==null?"":d
}return b
}var g=f.isFunction(a);
return this.each(function(d){var e=f(this),h;
if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""
})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];
if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h
}}})
}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;
return !b||b.specified?a.value:a.text
}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";
if(c<0){return null
}for(var h=g?c:0,i=g?c+1:e.length;
h<i;
h++){var j=e[h];
if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();
if(g){return b
}d.push(b)
}}if(g&&!d.length&&e.length){return f(e[c]).val()
}return d
},set:function(a,b){var c=f.makeArray(b);
f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0
}),c.length||(a.selectedIndex=-1);
return c
}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;
if(!a||g===3||g===8||g===2){return b
}if(e&&c in f.attrFn){return f(a)[c](d)
}if(!("getAttribute" in a)){return f.prop(a,c,d)
}var h,i,j=g!==1||!f.isXMLDoc(a);
j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));
if(d!==b){if(d===null){f.removeAttr(a,c);
return b
}if(i&&"set" in i&&j&&(h=i.set(a,d,c))!==b){return h
}a.setAttribute(c,""+d);
return d
}if(i&&"get" in i&&j&&(h=i.get(a,c))!==null){return h
}h=a.getAttribute(c);
return h===null?b:h
},removeAttr:function(a,b){var c;
a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b) in a&&(a[c]=!1))
},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode){f.error("type property can't be changed")
}else{if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;
a.setAttribute("type",b),c&&(a.value=c);
return b
}}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");
return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b
}},value:{get:function(a,b){if(v&&f.nodeName(a,"button")){return v.get(a,b)
}return b in a?a.value:null
},set:function(a,b,c){if(v&&f.nodeName(a,"button")){return v.set(a,b,c)
}a.value=b
}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;
if(!a||e===3||e===8||e===2){return b
}var g,h,i=e!==1||!f.isXMLDoc(a);
i&&(c=f.propFix[c]||c,h=f.propHooks[c]);
return d!==b?h&&"set" in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get" in h&&(g=h.get(a,c))!==b?g:a[c]
},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b
},set:function(a,b,c){var d;
b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));
return c
}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;
d=a.getAttributeNode(c);
return d&&d.nodeValue!==""?d.nodeValue:b
},set:function(a,b,c){var d=a.getAttributeNode(c);
if(d){d.nodeValue=b;
return b
}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");
return c
}}})
})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);
return d===null?b:d
}})
}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b
},set:function(a,b){return a.style.cssText=""+b
}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;
b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)
}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value
}}
}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b)){return a.checked=f.inArray(f(a).val(),b)>=0
}}})
});
var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")
};
f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1){d=D
}else{if(!d){return
}}var g,h;
d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);
var i=f._data(a);
if(!i){return
}var j=i.events,k=i.handle;
j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b
}),k.elem=a,c=c.split(" ");
var l,m=0,n;
while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);
var o=j[l],p=f.event.special[l]||{};
if(!o){o=j[l]=[];
if(!p.setup||p.setup.call(a,e,n,k)===!1){a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)
}}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0
}a=null
}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);
var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;
if(!s||!t){return
}c&&c.type&&(d=c.handler,c=c.type);
if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";
for(h in t){f.event.remove(a,h+c)
}return
}c=c.split(" ");
while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];
if(!p){continue
}if(!d){for(j=0;
j<p.length;
j++){q=p[j];
if(l||n.test(q.namespace)){f.event.remove(a,r,q.handler,j),p.splice(j--,1)
}}continue
}o=f.event.special[h]||{};
for(j=e||0;
j<p.length;
j++){q=p[j];
if(d.guid===q.guid){if(l||n.test(q.namespace)){e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q)
}if(e!=null){break
}}}if(p.length===0||e!=null&&p.length===1){(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]
}}if(f.isEmptyObject(t)){var u=s.handle;
u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)
}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;
h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());
if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");
if(g||!e){c.preventDefault(),c.stopPropagation()
}if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];
b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)
});
return
}if(e.nodeType===3||e.nodeType===8){return
}c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);
var k=e,l=h.indexOf(":")<0?"on"+h:"";
do{var m=f._data(k,"handle");
c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a
}while(k&&!c.isPropagationStopped());
if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};
if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())
}catch(p){}n&&(e[l]=n),f.event.triggered=b
}}return c.result
}},handle:function(c){c=f.event.fix(c||a.event);
var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);
g[0]=c,c.currentTarget=this;
for(var h=0,i=d.length;
h<i;
h++){var j=d[h];
if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;
var k=j.handler.apply(this,g);
k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));
if(c.isImmediatePropagationStopped()){break
}}}return c.result
},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando]){return a
}var d=a;
a=f.Event(d);
for(var e=this.props.length,g;
e;
){g=this.props[--e],a[g]=d[g]
}a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);
if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;
a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)
}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);
return a
},guid:100000000,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))
},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)
}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)
},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)
}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)
}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)
},f.Event=function(a,b){if(!this.preventDefault){return new f.Event(a,b)
}a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0
},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;
var a=this.originalEvent;
!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)
},stopPropagation:function(){this.isPropagationStopped=E;
var a=this.originalEvent;
!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)
},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()
},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};
var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;
a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))
},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)
};
f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)
},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)
}}
}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form")){f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;
(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)
}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;
(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)
})
}else{return !1
}},teardown:function(a){f.event.remove(this,".specialSubmit")
}});
if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;
b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected
}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);
return c
},J=function(c){var d=c.target,e,g;
if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);
if(e===b||g===e){return
}if(e!=null||g){c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)
}}};
f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";
(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)
},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";
(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)
},beforeactivate:function(a){var b=a.target;
f._data(b,"_change_data",I(b))
}},setup:function(a,b){if(this.type==="file"){return !1
}for(var c in H){f.event.add(this,c+".specialChange",H[c])
}return y.test(this.nodeName)
},teardown:function(a){f.event.remove(this,".specialChange");
return y.test(this.nodeName)
}},H=f.event.special.change.filters,H.focus=H.beforeactivate
}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);
c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()
}var d=0;
f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)
},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)
}}
}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;
if(typeof a=="object"){for(var h in a){this[c](h,d,a[h],e)
}return this
}if(arguments.length===2||d===!1){e=d,d=b
}c==="one"?(g=function(a){f(this).unbind(a,g);
return e.apply(this,arguments)
},g.guid=e.guid||f.guid++):g=e;
if(a==="unload"&&c!=="one"){this.one(a,d,e)
}else{for(var i=0,j=this.length;
i<j;
i++){f.event.add(this[i],a,g,d)
}}return this
}
}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault){for(var c in a){this.unbind(c,a[c])
}}else{for(var d=0,e=this.length;
d<e;
d++){f.event.remove(this[d],a,b)
}}return this
},delegate:function(a,b,c,d){return this.live(b,c,d,a)
},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)
},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)
})
},triggerHandler:function(a,b){if(this[0]){return f.event.trigger(a,b,this[0],!0)
}},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;
f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();
return b[e].apply(this,arguments)||!1
};
e.guid=c;
while(d<b.length){b[d++].guid=c
}return this.click(e)
},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)
}});
var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};
f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);
if(typeof a=="object"&&!a.preventDefault){for(var o in a){n[c](o,d,a[o],m)
}return this
}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);
return this
}if(d===!1||f.isFunction(d)){e=d||D,d=b
}a=(a||"").split(" ");
while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));
if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);
continue
}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;
if(c==="live"){for(var p=0,q=n.length;
p<q;
p++){f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l})
}}else{n.unbind("live."+N(h,m),e)
}}return this
}
}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);
return arguments.length>0?this.bind(b,a,c):this.trigger(b)
},f.attrFn&&(f.attrFn[b]=!0)
}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;
g<h;
g++){var i=d[g];
if(i){var j=!1;
i=i[a];
while(i){if(i.sizcache===c){j=d[i.sizset];
break
}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);
if(typeof b!="string"){if(i===b){j=!0;
break
}}else{if(k.filter(b,[i]).length>0){j=i;
break
}}}i=i[a]
}d[g]=j
}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;
g<h;
g++){var i=d[g];
if(i){var j=!1;
i=i[a];
while(i){if(i.sizcache===c){j=d[i.sizset];
break
}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);
if(i.nodeName.toLowerCase()===b){j=i;
break
}i=i[a]
}d[g]=j
}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;
[0,0].sort(function(){h=!1;
return 0
});
var k=function(b,d,f,g){f=f||[],d=d||c;
var h=d;
if(d.nodeType!==1&&d.nodeType!==9){return[]
}if(!b||typeof b!="string"){return f
}var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;
do{a.exec(""),i=a.exec(y);
if(i){y=i[3],x.push(i[1]);
if(i[2]){o=i[3];
break
}}}while(i);
if(x.length>1&&m.exec(b)){if(x.length===2&&l.relative[x[0]]){j=v(x[0]+x[1],d)
}else{j=l.relative[x[0]]?[d]:k(x.shift(),d);
while(x.length){b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)
}}}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);
if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;
while(x.length){r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)
}}else{n=x=[]
}}n||(n=j),n||k.error(r||b);
if(e.call(n)==="[object Array]"){if(!u){f.push.apply(f,n)
}else{if(d&&d.nodeType===1){for(t=0;
n[t]!=null;
t++){n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t])
}}else{for(t=0;
n[t]!=null;
t++){n[t]&&n[t].nodeType===1&&f.push(j[t])
}}}}else{p(n,f)
}o&&(k(o,h,f,g),k.uniqueSort(f));
return f
};
k.uniqueSort=function(a){if(r){g=h,a.sort(r);
if(g){for(var b=1;
b<a.length;
b++){a[b]===a[b-1]&&a.splice(b--,1)
}}}return a
},k.matches=function(a,b){return k(a,null,null,b)
},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0
},k.find=function(a,b,c){var d;
if(!a){return[]
}for(var e=0,f=l.order.length;
e<f;
e++){var g,h=l.order[e];
if(g=l.leftMatch[h].exec(a)){var j=g[1];
g.splice(1,1);
if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);
if(d!=null){a=a.replace(l.match[h],"");
break
}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);
return{set:d,expr:a}
},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);
while(a&&c.length){for(var n in l.filter){if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];
g=!1,f.splice(1,1);
if(r.substr(r.length-1)==="\\"){continue
}j===i&&(i=[]);
if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);
if(!f){g=o=!0
}else{if(f===!0){continue
}}}if(f){for(var s=0;
(p=j[s])!=null;
s++){if(p){o=q(p,f,s,j);
var t=e^!!o;
d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)
}}}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");
if(!g){return[]
}break
}}}if(a===h){if(g==null){k.error(a)
}else{break
}}h=a
}return j
},k.error=function(a){throw"Syntax error, unrecognized expression: "+a
};
var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")
},type:function(a){return a.getAttribute("type")
}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;
d&&(b=b.toLowerCase());
for(var f=0,g=a.length,h;
f<g;
f++){if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b
}}e&&k.filter(b,a,!0)
},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;
if(d&&!j.test(b)){b=b.toLowerCase();
for(;
e<f;
e++){c=a[e];
if(c){var g=c.parentNode;
a[e]=g.nodeName.toLowerCase()===b?g:!1
}}}else{for(;
e<f;
e++){c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b)
}d&&k.filter(b,a,!0)
}},"":function(a,b,c){var e,f=d++,g=u;
typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)
},"~":function(a,b,c){var e,f=d++,g=u;
typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)
}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);
return d&&d.parentNode?[d]:[]
}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);
for(var e=0,f=d.length;
e<f;
e++){d[e].getAttribute("name")===a[1]&&c.push(d[e])
}return c.length===0?null:c
}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined"){return b.getElementsByTagName(a[1])
}}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";
if(f){return a
}for(var g=0,h;
(h=b[g])!=null;
g++){h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1))
}return !1
},ID:function(a){return a[1].replace(i,"")
},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()
},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");
var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);
a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0
}else{a[2]&&k.error(a[0])
}a[0]=d++;
return a
},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");
!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");
return a
},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){b[3]=k(b[3],null,null,c)
}else{var g=k.filter(b[3],c,d,!0^f);
d||e.push.apply(e,g);
return !1
}}else{if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0])){return !0
}}return b
},POS:function(a){a.unshift(!0);
return a
}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"
},disabled:function(a){return a.disabled===!0
},checked:function(a){return a.checked===!0
},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;
return a.selected===!0
},parent:function(a){return !!a.firstChild
},empty:function(a){return !a.firstChild
},has:function(a,b,c){return !!k(c[3],a).length
},header:function(a){return/h\d/i.test(a.nodeName)
},text:function(a){var b=a.getAttribute("type"),c=a.type;
return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)
},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type
},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type
},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type
},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type
},submit:function(a){var b=a.nodeName.toLowerCase();
return(b==="input"||b==="button")&&"submit"===a.type
},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type
},reset:function(a){var b=a.nodeName.toLowerCase();
return(b==="input"||b==="button")&&"reset"===a.type
},button:function(a){var b=a.nodeName.toLowerCase();
return b==="input"&&"button"===a.type||b==="button"
},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)
},focus:function(a){return a===a.ownerDocument.activeElement
}},setFilters:{first:function(a,b){return b===0
},last:function(a,b,c,d){return b===d.length-1
},even:function(a,b){return b%2===0
},odd:function(a,b){return b%2===1
},lt:function(a,b,c){return b<c[3]-0
},gt:function(a,b,c){return b>c[3]-0
},nth:function(a,b,c){return c[3]-0===b
},eq:function(a,b,c){return c[3]-0===b
}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];
if(f){return f(a,c,b,d)
}if(e==="contains"){return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0
}if(e==="not"){var g=b[3];
for(var h=0,i=g.length;
h<i;
h++){if(g[h]===a){return !1
}}return !0
}k.error(e)
},CHILD:function(a,b){var c=b[1],d=a;
switch(c){case"only":case"first":while(d=d.previousSibling){if(d.nodeType===1){return !1
}}if(c==="first"){return !0
}d=a;
case"last":while(d=d.nextSibling){if(d.nodeType===1){return !1
}}return !0;
case"nth":var e=b[2],f=b[3];
if(e===1&&f===0){return !0
}var g=b[0],h=a.parentNode;
if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;
for(d=h.firstChild;
d;
d=d.nextSibling){d.nodeType===1&&(d.nodeIndex=++i)
}h.sizcache=g
}var j=a.nodeIndex-f;
return e===0?j===0:j%e===0&&j/e>=0
}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b
},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b
},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1
},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];
return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1
},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];
if(f){return f(a,c,b,d)
}}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)
};
for(var o in l.match){l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n))
}var p=function(a,b){a=Array.prototype.slice.call(a,0);
if(b){b.push.apply(b,a);
return b
}return a
};
try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType
}catch(q){p=function(a,b){var c=0,d=b||[];
if(e.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)
}else{if(typeof a.length=="number"){for(var f=a.length;
c<f;
c++){d.push(a[c])
}}else{for(;
a[c];
c++){d.push(a[c])
}}}return d
}
}var r,s;
c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;
return 0
}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1
}return a.compareDocumentPosition(b)&4?-1:1
}:(r=function(a,b){if(a===b){g=!0;
return 0
}if(a.sourceIndex&&b.sourceIndex){return a.sourceIndex-b.sourceIndex
}var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;
if(h===i){return s(a,b)
}if(!h){return -1
}if(!i){return 1
}while(j){e.unshift(j),j=j.parentNode
}j=i;
while(j){f.unshift(j),j=j.parentNode
}c=e.length,d=f.length;
for(var k=0;
k<c&&k<d;
k++){if(e[k]!==f[k]){return s(e[k],f[k])
}}return k===c?s(a,f[k],-1):s(e[k],b,1)
},s=function(a,b,c){if(a===b){return c
}var d=a.nextSibling;
while(d){if(d===b){return -1
}d=d.nextSibling
}return 1
}),k.getText=function(a){var b="",c;
for(var d=0;
a[d];
d++){c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes))
}return b
},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;
a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);
return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]
}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");
return a.nodeType===1&&c&&c.nodeValue===b
}),e.removeChild(a),e=a=null
}(),function(){var a=c.createElement("div");
a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);
if(a[1]==="*"){var d=[];
for(var e=0;
c[e];
e++){c[e].nodeType===1&&d.push(c[e])
}c=d
}return c
}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)
}),a=null
}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";
b.innerHTML="<p class='TEST'></p>";
if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;
if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);
if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return p(e.getElementsByTagName(b),f)
}if(h[2]&&l.find.CLASS&&e.getElementsByClassName){return p(e.getElementsByClassName(h[2]),f)
}}if(e.nodeType===9){if(b==="body"&&e.body){return p([e.body],f)
}if(h&&h[3]){var i=e.getElementById(h[3]);
if(!i||!i.parentNode){return p([],f)
}if(i.id===h[3]){return p([i],f)
}}try{return p(e.querySelectorAll(b),f)
}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);
n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);
try{if(!r||q){return p(e.querySelectorAll("[id='"+o+"'] "+b),f)
}}catch(s){}finally{n||m.removeAttribute("id")
}}}}return a(b,e,f,g)
};
for(var e in a){k[e]=a[e]
}b=null
}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;
if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;
try{b.call(c.documentElement,"[test!='']:sizzle")
}catch(f){e=!0
}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");
if(!k.isXML(a)){try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);
if(f||!d||a.document&&a.document.nodeType!==11){return f
}}}catch(g){}}return k(c,null,null,[a]).length>0
}
}}(),function(){var a=c.createElement("div");
a.innerHTML="<div class='test e'></div><div class='test'></div>";
if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";
if(a.getElementsByClassName("e").length===1){return
}l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])
}},a=null
}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)
}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)
}:k.contains=function(){return !1
},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;
return b?b.nodeName!=="HTML":!1
};
var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;
while(c=l.match.PSEUDO.exec(a)){e+=c[0],a=a.replace(l.match.PSEUDO,"")
}a=l.relative[a]?a+"*":a;
for(var g=0,h=f.length;
g<h;
g++){k(a,f[g],d)
}return k.filter(e,d)
};
f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains
}();
var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};
f.fn.extend({find:function(a){var b=this,c,d;
if(typeof a!="string"){return f(a).filter(function(){for(c=0,d=b.length;
c<d;
c++){if(f.contains(b[c],this)){return !0
}}})
}var e=this.pushStack("","find",a),g,h,i;
for(c=0,d=this.length;
c<d;
c++){g=e.length,f.find(a,this[c],e);
if(c>0){for(h=g;
h<e.length;
h++){for(i=0;
i<g;
i++){if(e[i]===e[h]){e.splice(h--,1);
break
}}}}}return e
},has:function(a){var b=f(a);
return this.filter(function(){for(var a=0,c=b.length;
a<c;
a++){if(f.contains(this,b[a])){return !0
}}})
},not:function(a){return this.pushStack(W(this,a,!1),"not",a)
},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)
},is:function(a){return !!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)
},closest:function(a,b){var c=[],d,e,g=this[0];
if(f.isArray(a)){var h,i,j={},k=1;
if(g&&a.length){for(d=0,e=a.length;
d<e;
d++){i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i)
}while(g&&g.ownerDocument&&g!==b){for(i in j){h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k})
}g=g.parentNode,k++
}}return c
}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;
for(d=0,e=this.length;
d<e;
d++){g=this[d];
while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);
break
}g=g.parentNode;
if(!g||!g.ownerDocument||g===b||g.nodeType===11){break
}}}c=c.length>1?f.unique(c):c;
return this.pushStack(c,"closest",a)
},index:function(a){if(!a||typeof a=="string"){return f.inArray(this[0],a?f(a):this.parent().children())
}return f.inArray(a.jquery?a[0]:a,this)
},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);
return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))
},andSelf:function(){return this.add(this.prevObject)
}}),f.each({parent:function(a){var b=a.parentNode;
return b&&b.nodeType!==11?b:null
},parents:function(a){return f.dir(a,"parentNode")
},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)
},next:function(a){return f.nth(a,2,"nextSibling")
},prev:function(a){return f.nth(a,2,"previousSibling")
},nextAll:function(a){return f.dir(a,"nextSibling")
},prevAll:function(a){return f.dir(a,"previousSibling")
},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)
},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)
},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)
},children:function(a){return f.sibling(a.firstChild)
},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)
}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);
O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());
return this.pushStack(e,a,g.join(","))
}
}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");
return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)
},dir:function(a,c,d){var e=[],g=a[c];
while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d))){g.nodeType===1&&e.push(g),g=g[c]
}return e
},nth:function(a,b,c,d){b=b||1;
var e=0;
for(;
a;
a=a[c]){if(a.nodeType===1&&++e===b){break
}}return a
},sibling:function(a,b){var c=[];
for(;
a;
a=a.nextSibling){a.nodeType===1&&a!==b&&c.push(a)
}return c
}});
var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};
bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);
c.text(a.call(this,b,c.text()))
})
}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))
}return f.text(this)
},wrapAll:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapAll(a.call(this,b))
})
}if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;
while(a.firstChild&&a.firstChild.nodeType===1){a=a.firstChild
}return a
}).append(this)
}return this
},wrapInner:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapInner(a.call(this,b))
})
}return this.each(function(){var b=f(this),c=b.contents();
c.length?c.wrapAll(a):b.append(a)
})
},wrap:function(a){return this.each(function(){f(this).wrapAll(a)
})
},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)
}).end()
},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)
})
},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)
})
},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)
})
}if(arguments.length){var a=f(arguments[0]);
a.push.apply(a,this.toArray());
return this.pushStack(a,"before",arguments)
}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)
})
}if(arguments.length){var a=this.pushStack(this,"after",arguments);
a.push.apply(a,f(arguments[0]).toArray());
return a
}},remove:function(a,b){for(var c=0,d;
(d=this[c])!=null;
c++){if(!a||f.filter(a,[d]).length){!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d)
}}return this
},empty:function(){for(var a=0,b;
(b=this[a])!=null;
a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));
while(b.firstChild){b.removeChild(b.firstChild)
}}return this
},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;
return this.map(function(){return f.clone(this,a,b)
})
},html:function(a){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null
}if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");
try{for(var c=0,d=this.length;
c<d;
c++){this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)
}}catch(e){this.empty().append(a)
}}else{f.isFunction(a)?this.each(function(b){var c=f(this);
c.html(a.call(this,b,c.html()))
}):this.empty().append(a)
}return this
},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a)){return this.each(function(b){var c=f(this),d=c.html();
c.replaceWith(a.call(this,b,d))
})
}typeof a!="string"&&(a=f(a).detach());
return this.each(function(){var b=this.nextSibling,c=this.parentNode;
f(this).remove(),b?f(b).before(a):f(c).append(a)
})
}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this
},detach:function(a){return this.remove(a,!0)
},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];
if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j)){return this.each(function(){f(this).domManip(a,c,d,!0)
})
}if(f.isFunction(j)){return this.each(function(e){var g=f(this);
a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)
})
}if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;
if(g){c=c&&f.nodeName(g,"tr");
for(var l=0,m=this.length,n=m-1;
l<m;
l++){d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)
}}k.length&&f.each(k,bm)
}return this
}}),f.buildFragment=function(a,b,d){var e,g,h,i;
b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);
return{fragment:e,cacheable:g}
},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;
if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);
return this
}for(var h=0,i=e.length;
h<i;
h++){var j=(h>0?this.clone(!0):this).get();
f(e[h])[b](j),d=d.concat(j)
}return this.pushStack(d,a,e.selector)
}
}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;
if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);
for(h=0;
e[h];
++h){bi(e[h],g[h])
}}if(b){bh(a,d);
if(c){e=bj(a),g=bj(d);
for(h=0;
e[h];
++h){bh(e[h],g[h])
}}}e=g=null;
return d
},clean:function(a,b,d,e){var g;
b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);
var h=[],i;
for(var j=0,k;
(k=a[j])!=null;
j++){typeof k=="number"&&(k+="");
if(!k){continue
}if(typeof k=="string"){if(!ba.test(k)){k=b.createTextNode(k)
}else{k=k.replace(Z,"<$1></$2>");
var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");
o.innerHTML=m[1]+k+m[2];
while(n--){o=o.lastChild
}if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];
for(i=q.length-1;
i>=0;
--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])
}}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes
}}var r;
if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;
i<r;
i++){bl(k[i])
}}else{bl(k)
}}k.nodeType?h.push(k):h=f.merge(h,k)
}if(d){g=function(a){return !a.type||bd.test(a.type)
};
for(j=0;
h[j];
j++){if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript")){e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j])
}else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);
h.splice.apply(h,[j+1,0].concat(s))
}d.appendChild(h[j])
}}}return h
},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;
for(var i=0,j;
(j=a[i])!=null;
i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()]){continue
}c=j[f.expando];
if(c){b=d[c]&&d[c][e];
if(b&&b.events){for(var k in b.events){g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle)
}b.handle&&(b.handle.elem=null)
}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]
}}}});
var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;
f.fn.css=function(a,c){if(arguments.length===2&&c===b){return this
}return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)
})
},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");
return c===""?"1":c
}return a.style.opacity
}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];
c=f.cssProps[i]||i;
if(d===b){if(k&&"get" in k&&(g=k.get(a,!1,e))!==b){return g
}return j[c]
}h=typeof d;
if(h==="number"&&isNaN(d)||d==null){return
}h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");
if(!k||!("set" in k)||(d=k.set(a,d))!==b){try{j[c]=d
}catch(l){}}}},css:function(a,c,d){var e,g;
c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");
if(g&&"get" in g&&(e=g.get(a,!0,d))!==b){return e
}if(bx){return bx(a,c)
}},swap:function(a,b,c){var d={};
for(var e in b){d[e]=a.style[e],a.style[e]=b[e]
}c.call(a);
for(e in b){a.style[e]=d[e]
}}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;
if(c){if(a.offsetWidth!==0){return bA(a,b,d)
}f.swap(a,bu,function(){e=bA(a,b,d)
});
return e
}},set:function(a,b){if(!bq.test(b)){return b
}b=parseFloat(b);
if(b>=0){return b+"px"
}}}
}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""
},set:function(a,b){var c=a.style,d=a.currentStyle;
c.zoom=1;
var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";
c.filter=bn.test(g)?g.replace(bn,e):g+" "+e
}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;
f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight
});
return c
}})
}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;
c=c.replace(bp,"-$1").toLowerCase();
if(!(e=a.ownerDocument.defaultView)){return b
}if(g=e.getComputedStyle(a,null)){d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c))
}return d
}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;
!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));
return d===""?"auto":d
}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;
return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"
},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)
});
var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;
try{bT=e.href
}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href
}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ){return bQ.apply(this,arguments)
}if(!this.length){return this
}var e=a.indexOf(" ");
if(e>=0){var g=a.slice(e,a.length);
a=a.slice(0,e)
}var h="GET";
c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));
var i=this;
f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a
}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])
}});
return this
},serialize:function(){return f.param(this.serializeArray())
},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this
}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))
}).map(function(a,b){var c=f(this).val();
return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}
}):{name:b.name,value:c.replace(bD,"\r\n")}
}).get()
}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)
}
}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);
return f.ajax({type:c,url:a,data:d,success:e,dataType:g})
}
}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")
},getJSON:function(a,b,c){return f.get(a,b,c,"json")
},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));
for(var c in {context:1,url:1}){c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c])
}return a
},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;
var o,r,u,w=l?bZ(d,v,l):b,x,y;
if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified")){f.lastModified[k]=x
}if(y=v.getResponseHeader("Etag")){f.etag[k]=y
}}if(a===304){c="notmodified",o=!0
}else{try{r=b$(d,w),c="success",o=!0
}catch(z){c="parsererror",u=z
}}}else{u=c;
if(!c||a){c="error",a<0&&(a=0)
}}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))
}}typeof a=="object"&&(c=a,a=b),c=c||{};
var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();
a=m[c]=m[c]||a,l[a]=b
}return this
},getAllResponseHeaders:function(){return s===2?n:null
},getResponseHeader:function(a){var c;
if(s===2){if(!o){o={};
while(c=bF.exec(n)){o[c[1].toLowerCase()]=c[2]
}}c=o[a.toLowerCase()]
}return c===b?null:c
},overrideMimeType:function(a){s||(d.mimeType=a);
return this
},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);
return this
}};
h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;
if(s<2){for(b in a){j[b]=[j[b],a[b]]
}}else{b=a[v.status],v.then(b,b)
}}return this
},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);
if(s===2){return !1
}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");
if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;
if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);
d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")
}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);
for(u in d.headers){v.setRequestHeader(u,d.headers[u])
}if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();
return !1
}for(u in {success:1,error:1,complete:1}){v[u](d[u])
}p=bX(bS,d,c,v);
if(!p){w(-1,"No Transport")
}else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")
},d.timeout));
try{s=1,p.send(l,w)
}catch(z){status<2?w(-1,z):f.error(z)
}}return v
},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)
};
c===b&&(c=f.ajaxSettings.traditional);
if(f.isArray(a)||a.jquery&&!f.isPlainObject(a)){f.each(a,function(){e(this.name,this.value)
})
}else{for(var g in a){bY(g,a[g],c,e)
}}return d.join("&").replace(bB,"+")
}}),f.extend({active:0,lastModified:{},etag:{}});
var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;
f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++
}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";
if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";
b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]
},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])
}),b.converters["script json"]=function(){g||f.error(h+" was not called");
return g[0]
},b.dataTypes[0]="json";
return"script"
}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);
return a
}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)
}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;
return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState)){d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")
}},e.insertBefore(d,e.firstChild)
},abort:function(){d&&d.onload(0,1)
}}
}});
var cb=a.ActiveXObject?function(){for(var a in cd){cd[a](0,1)
}}:!1,cc=0,cd;
f.ajaxSettings.xhr=a.ActiveXObject?function(){return !this.isLocal&&ce()||cf()
}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a})
}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;
return{send:function(e,g){var h=c.xhr(),i,j;
c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);
if(c.xhrFields){for(j in c.xhrFields){h[j]=c.xhrFields[j]
}}c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");
try{for(j in e){h.setRequestHeader(j,e[j])
}}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;
try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);
if(e){h.readyState!==4&&h.abort()
}else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;
try{k=h.statusText
}catch(o){k=""
}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)
}}}catch(p){e||g(-1,p)
}m&&g(j,k,m,l)
},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)
},abort:function(){d&&d(0,1)
}}
}});
var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;
f.fn.extend({show:function(a,b,c){var d,e;
if(a||a===0){return this.animate(cr("show",3),a,b,c)
}for(var g=0,h=this.length;
g<h;
g++){d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)))
}for(g=0;
g<h;
g++){d=this[g];
if(d.style){e=d.style.display;
if(e===""||e==="none"){d.style.display=f._data(d,"olddisplay")||""
}}}return this
},hide:function(a,b,c){if(a||a===0){return this.animate(cr("hide",3),a,b,c)
}for(var d=0,e=this.length;
d<e;
d++){if(this[d].style){var g=f.css(this[d],"display");
g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)
}}for(d=0;
d<e;
d++){this[d].style&&(this[d].style.display="none")
}return this
},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";
f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");
f(this)[b?"show":"hide"]()
}):this.animate(cr("toggle",3),a,b,c);
return this
},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)
},animate:function(a,b,c,d){var e=f.speed(b,c,d);
if(f.isEmptyObject(a)){return this.each(e.complete,[!1])
}a=f.extend({},a);
return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);
var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;
b.animatedProperties={};
for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";
if(h==="hide"&&d||h==="show"&&!d){return b.complete.call(this)
}c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))
}b.overflow!=null&&(this.style.overflow="hidden");
for(i in a){k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""))
}return !0
})
},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;
b||f._unmark(!0,this);
while(c--){a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))
}}),b||this.dequeue();
return this
}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)
}
}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};
d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)
};
return d
},easing:{linear:function(a,b,c,d){return c+d*a
},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+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 h(a){return d.step(a)
}var d=this,e=f.fx,g;
this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())
},co(g)):cl=setInterval(e.tick,e.interval))
},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()
},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)
},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;
if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;
for(g in e.animatedProperties){e.animatedProperties[g]!==!0&&(c=!1)
}if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]
}),e.hide&&f(d).hide();
if(e.hide||e.show){for(var i in e.animatedProperties){f.style(d,i,e.orig[i])
}}e.complete.call(d)
}return !1
}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();
return !0
}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;
b<a.length;
++b){a[b]()||a.splice(b--,1)
}a.length||f.fx.stop()
},interval:13,stop:function(){clearInterval(cl),cl=null
},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)
},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now
}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem
}).length
});
var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;
"getBoundingClientRect" in c.documentElement?f.fn.offset=function(a){var b=this[0],c;
if(a){return this.each(function(b){f.offset.setOffset(this,a,b)
})
}if(!b||!b.ownerDocument){return null
}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)
}try{c=b.getBoundingClientRect()
}catch(d){}var e=b.ownerDocument,g=e.documentElement;
if(!c||!f.contains(g,b)){return c?{top:c.top,left:c.left}:{top:0,left:0}
}var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;
return{top:n,left:o}
}:f.fn.offset=function(a){var b=this[0];
if(a){return this.each(function(b){f.offset.setOffset(this,a,b)
})
}if(!b||!b.ownerDocument){return null
}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)
}f.offset.initialize();
var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;
while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed"){break
}c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c
}if(k.position==="relative"||k.position==="static"){l+=i.offsetTop,m+=i.offsetLeft
}f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));
return{top:l,left:m}
},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop
},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;
f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);
return{top:b,left:c}
},setOffset:function(a,b,c){var d=f.css(a,"position");
d==="static"&&(a.style.position="relative");
var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;
j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using" in b?b.using.call(a,k):e.css(k)
}},f.fn.extend({position:function(){if(!this[0]){return null
}var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();
c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;
return{top:c.top-d.top,left:c.left-d.left}
},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;
while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static"){a=a.offsetParent
}return a
})
}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;
f.fn[d]=function(c){var e,g;
if(c===b){e=this[0];
if(!e){return null
}g=cv(e);
return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]
}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c
})
}
}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();
f.fn["inner"+c]=function(){var a=this[0];
return a&&a.style?parseFloat(f.css(a,d,"padding")):null
},f.fn["outer"+c]=function(a){var b=this[0];
return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null
},f.fn[d]=function(a){var e=this[0];
if(!e){return a==null?null:this
}if(f.isFunction(a)){return this.each(function(b){var c=f(this);
c[d](a.call(this,b,c[d]()))
})
}if(f.isWindow(e)){var g=e.document.documentElement["client"+c];
return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g
}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c])
}if(a===b){var h=f.css(e,d),i=parseFloat(h);
return f.isNaN(i)?h:i
}return this.css(d,typeof a=="string"?a:a+"px")
}
}),a.jQuery=a.$=f
})(window);
/*
 * 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);
/*
 * jQuery UI Mouse 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/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(a){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;
this.element.bind("mousedown."+this.widgetName,function(c){return b._mouseDown(c)
}).bind("click."+this.widgetName,function(c){if(true===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent");
c.stopImmediatePropagation();
return false
}});
this.started=false
},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)
},_mouseDown:function(d){d.originalEvent=d.originalEvent||{};
if(!d.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(d);
this._mouseDownEvent=d;
var c=this,h=d.which==1,g=typeof this.options.cancel=="string"?a(d.target).parents().add(d.target).filter(this.options.cancel).length:false;
if(!h||g||!this._mouseCapture(d)){return true
}this.mouseDelayMet=!this.options.delay;
if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true
},this.options.delay)
}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=this._mouseStart(d)!==false;
if(!this._mouseStarted){d.preventDefault();
return true
}}this._mouseMoveDelegate=function(b){return c._mouseMove(b)
};
this._mouseUpDelegate=function(b){return c._mouseUp(b)
};
a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);
d.preventDefault();
return d.originalEvent.mouseHandled=true
}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button){return this._mouseUp(b)
}if(this._mouseStarted){this._mouseDrag(b);
return b.preventDefault()
}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==false)?this._mouseDrag(b):this._mouseUp(b)
}return !this._mouseStarted
},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
if(this._mouseStarted){this._mouseStarted=false;
b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",true);
this._mouseStop(b)
}return false
},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance
},_mouseDelayMet:function(){return this.mouseDelayMet
},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true
}})
})(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 x=f(this),s=x.outerWidth(),k=x.outerHeight(),j=parseInt(f.curCSS(this,"marginLeft",true))||0,h=parseInt(f.curCSS(this,"marginTop",true))||0,z=s+j+parseInt(f.curCSS(this,"marginRight",true))||0,y=k+h+parseInt(f.curCSS(this,"marginBottom",true))||0,u=f.extend({},m),g;
if(c.my[0]==="right"){u.left-=s
}else{if(c.my[0]==="center"){u.left-=s/2
}}if(c.my[1]==="bottom"){u.top-=k
}else{if(c.my[1]==="center"){u.top-=k/2
}}u.left=Math.round(u.left);
u.top=Math.round(u.top);
g={left:u.left-j,top:u.top-h};
f.each(["left","top"],function(v,r){f.ui.position[o[v]]&&f.ui.position[o[v]][r](u,{targetWidth:n,targetHeight:l,elemWidth:s,elemHeight:k,collisionPosition:g,collisionWidth:z,collisionHeight:y,offset:p,my:c.my,at:c.at})
});
f.fn.bgiframe&&x.bgiframe();
x.offset(f.extend(u,{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(a){a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,d=this.options;
this._mouseSliding=this._keySliding=false;
this._animateOff=true;
this._handleIndex=null;
this._detectOrientation();
this._mouseInit();
this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");
d.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");
this.range=a([]);
if(d.range){if(d.range===true){this.range=a("<div></div>");
if(!d.values){d.values=[this._valueMin(),this._valueMin()]
}if(d.values.length&&d.values.length!==2){d.values=[d.values[0],d.values[0]]
}}else{this.range=a("<div></div>")
}this.range.appendTo(this.element).addClass("ui-slider-range");
if(d.range==="min"||d.range==="max"){this.range.addClass("ui-slider-range-"+d.range)
}this.range.addClass("ui-widget-header")
}a(".ui-slider-handle",this.element).length===0&&a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
if(d.values&&d.values.length){for(;
a(".ui-slider-handle",this.element).length<d.values.length;
){a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle")
}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");
this.handle=this.handles.eq(0);
this.handles.add(this.range).filter("a").click(function(b){b.preventDefault()
}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")
},function(){a(this).removeClass("ui-state-hover")
}).focus(function(){if(d.disabled){a(this).blur()
}else{a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");
a(this).addClass("ui-state-focus")
}}).blur(function(){a(this).removeClass("ui-state-focus")
});
this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)
});
this.handles.keydown(function(n){var m=true,l=a(this).data("index.ui-slider-handle"),j,k,b;
if(!c.options.disabled){switch(n.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:m=false;
if(!c._keySliding){c._keySliding=true;
a(this).addClass("ui-state-active");
j=c._start(n,l);
if(j===false){return
}}break
}b=c.options.step;
j=c.options.values&&c.options.values.length?(k=c.values(l)):(k=c.value());
switch(n.keyCode){case a.ui.keyCode.HOME:k=c._valueMin();
break;
case a.ui.keyCode.END:k=c._valueMax();
break;
case a.ui.keyCode.PAGE_UP:k=c._trimAlignValue(j+(c._valueMax()-c._valueMin())/5);
break;
case a.ui.keyCode.PAGE_DOWN:k=c._trimAlignValue(j-(c._valueMax()-c._valueMin())/5);
break;
case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(j===c._valueMax()){return
}k=c._trimAlignValue(j+b);
break;
case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(j===c._valueMin()){return
}k=c._trimAlignValue(j-b);
break
}c._slide(n,l,k);
return m
}}).keyup(function(f){var b=a(this).data("index.ui-slider-handle");
if(c._keySliding){c._keySliding=false;
c._stop(f,b);
c._change(f,b);
a(this).removeClass("ui-state-active")
}});
this._refreshValue();
this._animateOff=false
},destroy:function(){this.handles.remove();
this.range.remove();
this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");
this._mouseDestroy();
return this
},_mouseCapture:function(d){var i=this.options,n,m,l,j,k;
if(i.disabled){return false
}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};
this.elementOffset=this.element.offset();
n=this._normValueFromMouse({x:d.pageX,y:d.pageY});
m=this._valueMax()-this._valueMin()+1;
j=this;
this.handles.each(function(c){var b=Math.abs(n-j.values(c));
if(m>b){m=b;
l=a(this);
k=c
}});
if(i.range===true&&this.values(1)===i.min){k+=1;
l=a(this.handles[k])
}if(this._start(d,k)===false){return false
}this._mouseSliding=true;
j._handleIndex=k;
l.addClass("ui-state-active").focus();
i=l.offset();
this._clickOffset=!a(d.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:d.pageX-i.left-l.width()/2,top:d.pageY-i.top-l.height()/2-(parseInt(l.css("borderTopWidth"),10)||0)-(parseInt(l.css("borderBottomWidth"),10)||0)+(parseInt(l.css("marginTop"),10)||0)};
this.handles.hasClass("ui-state-hover")||this._slide(d,k,n);
return this._animateOff=true
},_mouseStart:function(){return true
},_mouseDrag:function(c){var d=this._normValueFromMouse({x:c.pageX,y:c.pageY});
this._slide(c,this._handleIndex,d);
return false
},_mouseStop:function(c){this.handles.removeClass("ui-state-active");
this._mouseSliding=false;
this._stop(c,this._handleIndex);
this._change(c,this._handleIndex);
this._clickOffset=this._handleIndex=null;
return this._animateOff=false
},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"
},_normValueFromMouse:function(c){var d;
if(this.orientation==="horizontal"){d=this.elementSize.width;
c=c.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)
}else{d=this.elementSize.height;
c=c.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)
}d=c/d;
if(d>1){d=1
}if(d<0){d=0
}if(this.orientation==="vertical"){d=1-d
}c=this._valueMax()-this._valueMin();
return this._trimAlignValue(this._valueMin()+d*c)
},_start:function(d,e){var f={handle:this.handles[e],value:this.value()};
if(this.options.values&&this.options.values.length){f.value=this.values(e);
f.values=this.values()
}return this._trigger("start",d,f)
},_slide:function(d,f,h){var g;
if(this.options.values&&this.options.values.length){g=this.values(f?0:1);
if(this.options.values.length===2&&this.options.range===true&&(f===0&&h>g||f===1&&h<g)){h=g
}if(h!==this.values(f)){g=this.values();
g[f]=h;
d=this._trigger("slide",d,{handle:this.handles[f],value:h,values:g});
this.values(f?0:1);
d!==false&&this.values(f,h,true)
}}else{if(h!==this.value()){d=this._trigger("slide",d,{handle:this.handles[f],value:h});
d!==false&&this.value(h)
}}},_stop:function(d,e){var f={handle:this.handles[e],value:this.value()};
if(this.options.values&&this.options.values.length){f.value=this.values(e);
f.values=this.values()
}this._trigger("stop",d,f)
},_change:function(d,e){if(!this._keySliding&&!this._mouseSliding){var f={handle:this.handles[e],value:this.value()};
if(this.options.values&&this.options.values.length){f.value=this.values(e);
f.values=this.values()
}this._trigger("change",d,f)
}},value:function(c){if(arguments.length){this.options.value=this._trimAlignValue(c);
this._refreshValue();
this._change(null,0)
}return this._value()
},values:function(d,g){var j,i,h;
if(arguments.length>1){this.options.values[d]=this._trimAlignValue(g);
this._refreshValue();
this._change(null,d)
}if(arguments.length){if(a.isArray(arguments[0])){j=this.options.values;
i=arguments[0];
for(h=0;
h<j.length;
h+=1){j[h]=this._trimAlignValue(i[h]);
this._change(null,h)
}this._refreshValue()
}else{return this.options.values&&this.options.values.length?this._values(d):this.value()
}}else{return this._values()
}},_setOption:function(d,f){var h,g=0;
if(a.isArray(this.options.values)){g=this.options.values.length
}a.Widget.prototype._setOption.apply(this,arguments);
switch(d){case"disabled":if(f){this.handles.filter(".ui-state-focus").blur();
this.handles.removeClass("ui-state-hover");
this.handles.attr("disabled","disabled");
this.element.addClass("ui-disabled")
}else{this.handles.removeAttr("disabled");
this.element.removeClass("ui-disabled")
}break;
case"orientation":this._detectOrientation();
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);
this._refreshValue();
break;
case"value":this._animateOff=true;
this._refreshValue();
this._change(null,0);
this._animateOff=false;
break;
case"values":this._animateOff=true;
this._refreshValue();
for(h=0;
h<g;
h+=1){this._change(null,h)
}this._animateOff=false;
break
}},_value:function(){var c=this.options.value;
return c=this._trimAlignValue(c)
},_values:function(d){var e,f;
if(arguments.length){e=this.options.values[d];
return e=this._trimAlignValue(e)
}else{e=this.options.values.slice();
for(f=0;
f<e.length;
f+=1){e[f]=this._trimAlignValue(e[f])
}return e
}},_trimAlignValue:function(d){if(d<=this._valueMin()){return this._valueMin()
}if(d>=this._valueMax()){return this._valueMax()
}var e=this.options.step>0?this.options.step:1,f=(d-this._valueMin())%e;
alignValue=d-f;
if(Math.abs(f)*2>=e){alignValue+=f>0?e:-e
}return parseFloat(alignValue.toFixed(5))
},_valueMin:function(){return this.options.min
},_valueMax:function(){return this.options.max
},_refreshValue:function(){var s=this.options.range,u=this.options,r=this,q=!this._animateOff?u.animate:false,p,n={},o,m,k,d;
if(this.options.values&&this.options.values.length){this.handles.each(function(b){p=(r.values(b)-r._valueMin())/(r._valueMax()-r._valueMin())*100;
n[r.orientation==="horizontal"?"left":"bottom"]=p+"%";
a(this).stop(1,1)[q?"animate":"css"](n,u.animate);
if(r.options.range===true){if(r.orientation==="horizontal"){if(b===0){r.range.stop(1,1)[q?"animate":"css"]({left:p+"%"},u.animate)
}if(b===1){r.range[q?"animate":"css"]({width:p-o+"%"},{queue:false,duration:u.animate})
}}else{if(b===0){r.range.stop(1,1)[q?"animate":"css"]({bottom:p+"%"},u.animate)
}if(b===1){r.range[q?"animate":"css"]({height:p-o+"%"},{queue:false,duration:u.animate})
}}}o=p
})
}else{m=this.value();
k=this._valueMin();
d=this._valueMax();
p=d!==k?(m-k)/(d-k)*100:0;
n[r.orientation==="horizontal"?"left":"bottom"]=p+"%";
this.handle.stop(1,1)[q?"animate":"css"](n,u.animate);
if(s==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[q?"animate":"css"]({width:p+"%"},u.animate)
}if(s==="max"&&this.orientation==="horizontal"){this.range[q?"animate":"css"]({width:100-p+"%"},{queue:false,duration:u.animate})
}if(s==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[q?"animate":"css"]({height:p+"%"},u.animate)
}if(s==="max"&&this.orientation==="vertical"){this.range[q?"animate":"css"]({height:100-p+"%"},{queue:false,duration:u.animate})
}}}});
a.extend(a.ui.slider,{version:"1.8.7"})
})(jQuery);
(function(g,f){function e(){return ++c
}function b(){return ++a
}var c=0,a=0;
g.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)
},_setOption:function(d,h){if(d=="selected"){this.options.collapsible&&h==this.options.selected||this.select(h)
}else{this.options[d]=h;
this._tabify()
}},_tabId:function(d){return d.title&&d.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()
},_sanitizeSelector:function(d){return d.replace(/:/g,"\\:")
},_cookie:function(){var d=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+b());
return g.cookie.apply(null,[d].concat(g.makeArray(arguments)))
},_ui:function(d,h){return{tab:d,panel:h,index:this.anchors.index(d)}
},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var d=g(this);
d.html(d.data("label.tabs")).removeData("label.tabs")
})
},_tabify:function(y){function w(h,j){h.css("display","");
!g.support.opacity&&j.opacity&&h[0].style.removeAttribute("filter")
}var z=this,x=this.options,v=/^#.+/;
this.list=this.element.find("ol,ul").eq(0);
this.lis=g(" > li:has(a[href])",this.list);
this.anchors=this.lis.map(function(){return g("a",this)[0]
});
this.panels=g([]);
this.anchors.each(function(k,n){var j=g(n).attr("href"),h=j.split("#")[0],m;
if(h&&(h===location.toString().split("#")[0]||(m=g("base")[0])&&h===m.href)){j=n.hash;
n.href=j
}if(v.test(j)){z.panels=z.panels.add(z.element.find(z._sanitizeSelector(j)))
}else{if(j&&j!=="#"){g.data(n,"href.tabs",j);
g.data(n,"load.tabs",j.replace(/#.*$/,""));
j=z._tabId(n);
n.href="#"+j;
n=z.element.find("#"+j);
if(!n.length){n=g(x.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(z.panels[k-1]||z.list);
n.data("destroy.tabs",true)
}z.panels=z.panels.add(n)
}else{x.disabled.push(k)
}}});
if(y){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");
this.lis.addClass("ui-state-default ui-corner-top");
this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");
if(x.selected===f){location.hash&&this.anchors.each(function(h,j){if(j.hash==location.hash){x.selected=h;
return false
}});
if(typeof x.selected!=="number"&&x.cookie){x.selected=parseInt(z._cookie(),10)
}if(typeof x.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length){x.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))
}x.selected=x.selected||(this.lis.length?0:-1)
}else{if(x.selected===null){x.selected=-1
}}x.selected=x.selected>=0&&this.anchors[x.selected]||x.selected<0?x.selected:0;
x.disabled=g.unique(x.disabled.concat(g.map(this.lis.filter(".ui-state-disabled"),function(h){return z.lis.index(h)
}))).sort();
g.inArray(x.selected,x.disabled)!=-1&&x.disabled.splice(g.inArray(x.selected,x.disabled),1);
this.panels.addClass("ui-tabs-hide");
this.lis.removeClass("ui-tabs-selected ui-state-active");
if(x.selected>=0&&this.anchors.length){z.element.find(z._sanitizeSelector(z.anchors[x.selected].hash)).removeClass("ui-tabs-hide");
this.lis.eq(x.selected).addClass("ui-tabs-selected ui-state-active");
z.element.queue("tabs",function(){z._trigger("show",null,z._ui(z.anchors[x.selected],z.element.find(z._sanitizeSelector(z.anchors[x.selected].hash))))
});
this.load(x.selected)
}g(window).bind("unload",function(){z.lis.add(z.anchors).unbind(".tabs");
z.lis=z.anchors=z.panels=null
})
}else{x.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))
}this.element[x.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");
x.cookie&&this._cookie(x.selected,x.cookie);
y=0;
for(var u;
u=this.lis[y];
y++){g(u)[g.inArray(y,x.disabled)!=-1&&!g(u).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")
}x.cache===false&&this.anchors.removeData("cache.tabs");
this.lis.add(this.anchors).unbind(".tabs");
if(x.event!=="mouseover"){var q=function(h,j){j.is(":not(.ui-state-disabled)")&&j.addClass("ui-state-"+h)
},l=function(h,j){j.removeClass("ui-state-"+h)
};
this.lis.bind("mouseover.tabs",function(){q("hover",g(this))
});
this.lis.bind("mouseout.tabs",function(){l("hover",g(this))
});
this.anchors.bind("focus.tabs",function(){q("focus",g(this).closest("li"))
});
this.anchors.bind("blur.tabs",function(){l("focus",g(this).closest("li"))
})
}var p,i;
if(x.fx){if(g.isArray(x.fx)){p=x.fx[0];
i=x.fx[1]
}else{p=i=x.fx
}}var d=i?function(h,j){g(h).closest("li").addClass("ui-tabs-selected ui-state-active");
j.hide().removeClass("ui-tabs-hide").animate(i,i.duration||"normal",function(){w(j,i);
z._trigger("show",null,z._ui(h,j[0]))
})
}:function(h,j){g(h).closest("li").addClass("ui-tabs-selected ui-state-active");
j.removeClass("ui-tabs-hide");
z._trigger("show",null,z._ui(h,j[0]))
},A=p?function(h,j){j.animate(p,p.duration||"normal",function(){z.lis.removeClass("ui-tabs-selected ui-state-active");
j.addClass("ui-tabs-hide");
w(j,p);
z.element.dequeue("tabs")
})
}:function(h,j){z.lis.removeClass("ui-tabs-selected ui-state-active");
j.addClass("ui-tabs-hide");
z.element.dequeue("tabs")
};
this.anchors.bind(x.event+".tabs",function(){var k=this,m=g(k).closest("li"),j=z.panels.filter(":not(.ui-tabs-hide)"),h=z.element.find(z._sanitizeSelector(k.hash));
if(m.hasClass("ui-tabs-selected")&&!x.collapsible||m.hasClass("ui-state-disabled")||m.hasClass("ui-state-processing")||z.panels.filter(":animated").length||z._trigger("select",null,z._ui(this,h[0]))===false){this.blur();
return false
}x.selected=z.anchors.index(this);
z.abort();
if(x.collapsible){if(m.hasClass("ui-tabs-selected")){x.selected=-1;
x.cookie&&z._cookie(x.selected,x.cookie);
z.element.queue("tabs",function(){A(k,j)
}).dequeue("tabs");
this.blur();
return false
}else{if(!j.length){x.cookie&&z._cookie(x.selected,x.cookie);
z.element.queue("tabs",function(){d(k,h)
});
z.load(z.anchors.index(this));
this.blur();
return false
}}}x.cookie&&z._cookie(x.selected,x.cookie);
if(h.length){j.length&&z.element.queue("tabs",function(){A(k,j)
});
z.element.queue("tabs",function(){d(k,h)
});
z.load(z.anchors.index(this))
}else{throw"jQuery UI Tabs: Mismatching fragment identifier."
}g.browser.msie&&this.blur()
});
this.anchors.bind("click.tabs",function(){return false
})
},_getIndex:function(d){if(typeof d=="string"){d=this.anchors.index(this.anchors.filter("[href$="+d+"]"))
}return d
},destroy:function(){var d=this.options;
this.abort();
this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");
this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");
this.anchors.each(function(){var i=g.data(this,"href.tabs");
if(i){this.href=i
}var h=g(this).unbind(".tabs");
g.each(["href","load","cache"],function(k,j){h.removeData(j+".tabs")
})
});
this.lis.unbind(".tabs").add(this.panels).each(function(){g.data(this,"destroy.tabs")?g(this).remove():g(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")
});
d.cookie&&this._cookie(null,d.cookie);
return this
},add:function(d,m,i){if(i===f){i=this.anchors.length
}var n=this,l=this.options;
m=g(l.tabTemplate.replace(/#\{href\}/g,d).replace(/#\{label\}/g,m));
d=!d.indexOf("#")?d.replace("#",""):this._tabId(g("a",m)[0]);
m.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);
var k=n.element.find("#"+d);
k.length||(k=g(l.panelTemplate).attr("id",d).data("destroy.tabs",true));
k.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");
if(i>=this.lis.length){m.appendTo(this.list);
k.appendTo(this.list[0].parentNode)
}else{m.insertBefore(this.lis[i]);
k.insertBefore(this.panels[i])
}l.disabled=g.map(l.disabled,function(h){return h>=i?++h:h
});
this._tabify();
if(this.anchors.length==1){l.selected=0;
m.addClass("ui-tabs-selected ui-state-active");
k.removeClass("ui-tabs-hide");
this.element.queue("tabs",function(){n._trigger("show",null,n._ui(n.anchors[0],n.panels[0]))
});
this.load(0)
}this._trigger("add",null,this._ui(this.anchors[i],this.panels[i]));
return this
},remove:function(d){d=this._getIndex(d);
var i=this.options,h=this.lis.eq(d).remove(),j=this.panels.eq(d).remove();
if(h.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(d+(d+1<this.anchors.length?1:-1))
}i.disabled=g.map(g.grep(i.disabled,function(k){return k!=d
}),function(k){return k>=d?--k:k
});
this._tabify();
this._trigger("remove",null,this._ui(h.find("a")[0],j[0]));
return this
},enable:function(d){d=this._getIndex(d);
var h=this.options;
if(g.inArray(d,h.disabled)!=-1){this.lis.eq(d).removeClass("ui-state-disabled");
h.disabled=g.grep(h.disabled,function(i){return i!=d
});
this._trigger("enable",null,this._ui(this.anchors[d],this.panels[d]));
return this
}},disable:function(d){d=this._getIndex(d);
var h=this.options;
if(d!=h.selected){this.lis.eq(d).addClass("ui-state-disabled");
h.disabled.push(d);
h.disabled.sort();
this._trigger("disable",null,this._ui(this.anchors[d],this.panels[d]))
}return this
},select:function(d){d=this._getIndex(d);
if(d==-1){if(this.options.collapsible&&this.options.selected!=-1){d=this.options.selected
}else{return this
}}this.anchors.eq(d).trigger(this.options.event+".tabs");
return this
},load:function(d){d=this._getIndex(d);
var m=this,i=this.options,n=this.anchors.eq(d)[0],l=g.data(n,"load.tabs");
this.abort();
if(!l||this.element.queue("tabs").length!==0&&g.data(n,"cache.tabs")){this.element.dequeue("tabs")
}else{this.lis.eq(d).addClass("ui-state-processing");
if(i.spinner){var k=g("span",n);
k.data("label.tabs",k.html()).html(i.spinner)
}this.xhr=g.ajax(g.extend({},i.ajaxOptions,{url:l,success:function(j,o){m.element.find(m._sanitizeSelector(n.hash)).html(j);
m._cleanup();
i.cache&&g.data(n,"cache.tabs",true);
m._trigger("load",null,m._ui(m.anchors[d],m.panels[d]));
try{i.ajaxOptions.success(j,o)
}catch(h){}},error:function(j,o){m._cleanup();
m._trigger("load",null,m._ui(m.anchors[d],m.panels[d]));
try{i.ajaxOptions.error(j,o,d,n)
}catch(h){}}}));
m.element.dequeue("tabs");
return this
}},abort:function(){this.element.queue([]);
this.panels.stop(false,true);
this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));
if(this.xhr){this.xhr.abort();
delete this.xhr
}this._cleanup();
return this
},url:function(d,h){this.anchors.eq(d).removeData("cache.tabs").data("load.tabs",h);
return this
},length:function(){return this.anchors.length
}});
g.extend(g.ui.tabs,{version:"1.8.7"});
g.extend(g.ui.tabs.prototype,{rotation:null,rotate:function(d,k){var i=this,l=this.options,j=i._rotate||(i._rotate=function(h){clearTimeout(i.rotation);
i.rotation=setTimeout(function(){var m=l.selected;
i.select(++m<i.anchors.length?m:0)
},d);
h&&h.stopPropagation()
});
k=i._unrotate||(i._unrotate=!k?function(h){h.clientX&&i.rotate(null)
}:function(){t=l.selected;
j()
});
if(d){this.element.bind("tabsshow",j);
this.anchors.bind(l.event+".tabs",k);
j()
}else{clearTimeout(i.rotation);
this.element.unbind("tabsshow",j);
this.anchors.unbind(l.event+".tabs",k);
delete this._rotate;
delete this._unrotate
}return this
}})
})(jQuery);
jQuery.effects||function(l,i){function e(j){var f;
if(j&&j.constructor==Array&&j.length==3){return j
}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(j)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]
}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(j)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]
}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(j)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]
}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(j)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]
}if(/rgba\(0, 0, 0, 0\)/.exec(j)){return d.transparent
}return d[l.trim(j).toLowerCase()]
}function x(k,j){var f;
do{f=l.curCSS(k,j);
if(f!=""&&f!="transparent"||l.nodeName(k,"body")){break
}j="backgroundColor"
}while(k=k.parentNode);
return e(f)
}function c(){var n=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,j={},f,m;
if(n&&n.length&&n[0]&&n[n[0]]){for(var k=n.length;
k--;
){f=n[k];
if(typeof n[f]=="string"){m=f.replace(/\-(\w)/g,function(p,o){return o.toUpperCase()
});
j[m]=n[f]
}}}else{for(f in n){if(typeof n[f]==="string"){j[f]=n[f]
}}}return j
}function b(k){var j,f;
for(j in k){f=k[j];
if(f==null||l.isFunction(f)||j in w||/scrollbar/.test(j)||!/color/i.test(j)&&isNaN(parseFloat(f))){delete k[j]
}}return k
}function v(m,j){var f={_:0},k;
for(k in j){if(m[k]!=j[k]){f[k]=j[k]
}}return f
}function h(m,j,f,k){if(typeof m=="object"){k=j;
f=null;
j=m;
m=j.effect
}if(l.isFunction(j)){k=j;
f=null;
j={}
}if(typeof j=="number"||l.fx.speeds[j]){k=f;
f=j;
j={}
}if(l.isFunction(f)){k=f;
f=null
}j=j||{};
f=f||j.duration;
f=l.fx.off?0:typeof f=="number"?f:f in l.fx.speeds?l.fx.speeds[f]:l.fx.speeds._default;
k=k||j.complete;
return[m,j,f,k]
}function g(f){if(!f||typeof f==="number"||l.fx.speeds[f]){return true
}if(typeof f==="string"&&!l.effects[f]){return true
}return false
}l.effects={};
l.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(j,f){l.fx.step[f]=function(k){if(!k.colorInit){k.start=x(k.elem,f);
k.end=e(k.end);
k.colorInit=true
}k.elem.style[f]="rgb("+Math.max(Math.min(parseInt(k.pos*(k.end[0]-k.start[0])+k.start[0],10),255),0)+","+Math.max(Math.min(parseInt(k.pos*(k.end[1]-k.start[1])+k.start[1],10),255),0)+","+Math.max(Math.min(parseInt(k.pos*(k.end[2]-k.start[2])+k.start[2],10),255),0)+")"
}
});
var d={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},a=["add","remove","toggle"],w={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};
l.effects.animateClass=function(m,j,f,k){if(l.isFunction(f)){k=f;
f=null
}return this.each(function(){l.queue(this,"fx",function(){var r=l(this),q=r.attr("style")||" ",p=b(c.call(this)),n,o=r.attr("className");
l.each(a,function(s,u){m[u]&&r[u+"Class"](m[u])
});
n=b(c.call(this));
r.attr("className",o);
r.animate(v(p,n),j,f,function(){l.each(a,function(s,u){m[u]&&r[u+"Class"](m[u])
});
if(typeof r.attr("style")=="object"){r.attr("style").cssText="";
r.attr("style").cssText=q
}else{r.attr("style",q)
}k&&k.apply(this,arguments)
});
p=l.queue(this);
n=p.splice(p.length-1,1)[0];
p.splice(1,0,n);
l.dequeue(this)
})
})
};
l.fn.extend({_addClass:l.fn.addClass,addClass:function(m,j,f,k){return j?l.effects.animateClass.apply(this,[{add:m},j,f,k]):this._addClass(m)
},_removeClass:l.fn.removeClass,removeClass:function(m,j,f,k){return j?l.effects.animateClass.apply(this,[{remove:m},j,f,k]):this._removeClass(m)
},_toggleClass:l.fn.toggleClass,toggleClass:function(n,j,f,m,k){return typeof j=="boolean"||j===i?f?l.effects.animateClass.apply(this,[j?{add:n}:{remove:n},f,m,k]):this._toggleClass(n,j):l.effects.animateClass.apply(this,[{toggle:n},j,f,m])
},switchClass:function(n,j,f,m,k){return l.effects.animateClass.apply(this,[{add:j,remove:n},f,m,k])
}});
l.extend(l.effects,{version:"1.8.7",save:function(k,j){for(var f=0;
f<j.length;
f++){j[f]!==null&&k.data("ec.storage."+j[f],k[0].style[j[f]])
}},restore:function(k,j){for(var f=0;
f<j.length;
f++){j[f]!==null&&k.css(j[f],k.data("ec.storage."+j[f]))
}},setMode:function(j,f){if(f=="toggle"){f=j.is(":hidden")?"show":"hide"
}return f
},getBaseline:function(k,j){var f;
switch(k[0]){case"top":f=0;
break;
case"middle":f=0.5;
break;
case"bottom":f=1;
break;
default:f=k[0]/j.height
}switch(k[1]){case"left":k=0;
break;
case"center":k=0.5;
break;
case"right":k=1;
break;
default:k=k[1]/j.width
}return{x:k,y:f}
},createWrapper:function(k){if(k.parent().is(".ui-effects-wrapper")){return k.parent()
}var j={width:k.outerWidth(true),height:k.outerHeight(true),"float":k.css("float")},f=l("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});
k.wrap(f);
f=k.parent();
if(k.css("position")=="static"){f.css({position:"relative"});
k.css({position:"relative"})
}else{l.extend(j,{position:k.css("position"),zIndex:k.css("z-index")});
l.each(["top","left","bottom","right"],function(n,m){j[m]=k.css(m);
if(isNaN(parseInt(j[m],10))){j[m]="auto"
}});
k.css({position:"relative",top:0,left:0})
}return f.css(j).show()
},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)
}return f
},setTransition:function(m,j,f,k){k=k||{};
l.each(j,function(o,n){unit=m.cssUnit(n);
if(unit[0]>0){k[n]=unit[0]*f+unit[1]
}});
return k
}});
l.fn.extend({effect:function(m){var j=h.apply(this,arguments),f={options:j[1],duration:j[2],callback:j[3]};
j=f.options.mode;
var k=l.effects[m];
if(l.fx.off||!k){return j?this[j](f.duration,f.callback):this.each(function(){f.callback&&f.callback.call(this)
})
}return k.call(this,f)
},_show:l.fn.show,show:function(j){if(g(j)){return this._show.apply(this,arguments)
}else{var f=h.apply(this,arguments);
f[1].mode="show";
return this.effect.apply(this,f)
}},_hide:l.fn.hide,hide:function(j){if(g(j)){return this._hide.apply(this,arguments)
}else{var f=h.apply(this,arguments);
f[1].mode="hide";
return this.effect.apply(this,f)
}},__toggle:l.fn.toggle,toggle:function(j){if(g(j)||typeof j==="boolean"||l.isFunction(j)){return this.__toggle.apply(this,arguments)
}else{var f=h.apply(this,arguments);
f[1].mode="toggle";
return this.effect.apply(this,f)
}},cssUnit:function(k){var j=this.css(k),f=[];
l.each(["em","px","%","pt"],function(n,m){if(j.indexOf(m)>0){f=[parseFloat(j),m]
}});
return f
}});
l.easing.jswing=l.easing.swing;
l.extend(l.easing,{def:"easeOutQuad",swing:function(n,j,f,m,k){return l.easing[l.easing.def](n,j,f,m,k)
},easeInQuad:function(n,j,f,m,k){return m*(j/=k)*j+f
},easeOutQuad:function(n,j,f,m,k){return -m*(j/=k)*(j-2)+f
},easeInOutQuad:function(n,j,f,m,k){if((j/=k/2)<1){return m/2*j*j+f
}return -m/2*(--j*(j-2)-1)+f
},easeInCubic:function(n,j,f,m,k){return m*(j/=k)*j*j+f
},easeOutCubic:function(n,j,f,m,k){return m*((j=j/k-1)*j*j+1)+f
},easeInOutCubic:function(n,j,f,m,k){if((j/=k/2)<1){return m/2*j*j*j+f
}return m/2*((j-=2)*j*j+2)+f
},easeInQuart:function(n,j,f,m,k){return m*(j/=k)*j*j*j+f
},easeOutQuart:function(n,j,f,m,k){return -m*((j=j/k-1)*j*j*j-1)+f
},easeInOutQuart:function(n,j,f,m,k){if((j/=k/2)<1){return m/2*j*j*j*j+f
}return -m/2*((j-=2)*j*j*j-2)+f
},easeInQuint:function(n,j,f,m,k){return m*(j/=k)*j*j*j*j+f
},easeOutQuint:function(n,j,f,m,k){return m*((j=j/k-1)*j*j*j*j+1)+f
},easeInOutQuint:function(n,j,f,m,k){if((j/=k/2)<1){return m/2*j*j*j*j*j+f
}return m/2*((j-=2)*j*j*j*j+2)+f
},easeInSine:function(n,j,f,m,k){return -m*Math.cos(j/k*(Math.PI/2))+m+f
},easeOutSine:function(n,j,f,m,k){return m*Math.sin(j/k*(Math.PI/2))+f
},easeInOutSine:function(n,j,f,m,k){return -m/2*(Math.cos(Math.PI*j/k)-1)+f
},easeInExpo:function(n,j,f,m,k){return j==0?f:m*Math.pow(2,10*(j/k-1))+f
},easeOutExpo:function(n,j,f,m,k){return j==k?f+m:m*(-Math.pow(2,-10*j/k)+1)+f
},easeInOutExpo:function(n,j,f,m,k){if(j==0){return f
}if(j==k){return f+m
}if((j/=k/2)<1){return m/2*Math.pow(2,10*(j-1))+f
}return m/2*(-Math.pow(2,-10*--j)+2)+f
},easeInCirc:function(n,j,f,m,k){return -m*(Math.sqrt(1-(j/=k)*j)-1)+f
},easeOutCirc:function(n,j,f,m,k){return m*Math.sqrt(1-(j=j/k-1)*j)+f
},easeInOutCirc:function(n,j,f,m,k){if((j/=k/2)<1){return -m/2*(Math.sqrt(1-j*j)-1)+f
}return m/2*(Math.sqrt(1-(j-=2)*j)+1)+f
},easeInElastic:function(p,j,f,o,n){p=1.70158;
var m=0,k=o;
if(j==0){return f
}if((j/=n)==1){return f+o
}m||(m=n*0.3);
if(k<Math.abs(o)){k=o;
p=m/4
}else{p=m/(2*Math.PI)*Math.asin(o/k)
}return -(k*Math.pow(2,10*(j-=1))*Math.sin((j*n-p)*2*Math.PI/m))+f
},easeOutElastic:function(p,j,f,o,n){p=1.70158;
var m=0,k=o;
if(j==0){return f
}if((j/=n)==1){return f+o
}m||(m=n*0.3);
if(k<Math.abs(o)){k=o;
p=m/4
}else{p=m/(2*Math.PI)*Math.asin(o/k)
}return k*Math.pow(2,-10*j)*Math.sin((j*n-p)*2*Math.PI/m)+o+f
},easeInOutElastic:function(p,j,f,o,n){p=1.70158;
var m=0,k=o;
if(j==0){return f
}if((j/=n/2)==2){return f+o
}m||(m=n*0.3*1.5);
if(k<Math.abs(o)){k=o;
p=m/4
}else{p=m/(2*Math.PI)*Math.asin(o/k)
}if(j<1){return -0.5*k*Math.pow(2,10*(j-=1))*Math.sin((j*n-p)*2*Math.PI/m)+f
}return k*Math.pow(2,-10*(j-=1))*Math.sin((j*n-p)*2*Math.PI/m)*0.5+o+f
},easeInBack:function(o,j,f,n,m,k){if(k==i){k=1.70158
}return n*(j/=m)*j*((k+1)*j-k)+f
},easeOutBack:function(o,j,f,n,m,k){if(k==i){k=1.70158
}return n*((j=j/m-1)*j*((k+1)*j+k)+1)+f
},easeInOutBack:function(o,j,f,n,m,k){if(k==i){k=1.70158
}if((j/=m/2)<1){return n/2*j*j*(((k*=1.525)+1)*j-k)+f
}return n/2*((j-=2)*j*(((k*=1.525)+1)*j+k)+2)+f
},easeInBounce:function(n,j,f,m,k){return m-l.easing.easeOutBounce(n,k-j,0,m,k)+f
},easeOutBounce:function(n,j,f,m,k){return(j/=k)<1/2.75?m*7.5625*j*j+f:j<2/2.75?m*(7.5625*(j-=1.5/2.75)*j+0.75)+f:j<2.5/2.75?m*(7.5625*(j-=2.25/2.75)*j+0.9375)+f:m*(7.5625*(j-=2.625/2.75)*j+0.984375)+f
},easeInOutBounce:function(n,j,f,m,k){if(j<k/2){return l.easing.easeInBounce(n,j*2,0,m,k)*0.5+f
}return l.easing.easeOutBounce(n,j*2-k,0,m,k)*0.5+m*0.5+f
}})
}(jQuery);
(function(a){a.effects.drop=function(b){return this.queue(function(){var d=a(this),k=["position","top","left","opacity"],n=a.effects.setMode(d,b.options.mode||"hide"),c=b.options.direction||"left";
a.effects.save(d,k);
d.show();
a.effects.createWrapper(d);
var m=c=="up"||c=="down"?"top":"left";
c=c=="up"||c=="left"?"pos":"neg";
var l=b.options.distance||(m=="top"?d.outerHeight({margin:true})/2:d.outerWidth({margin:true})/2);
if(n=="show"){d.css("opacity",0).css(m,c=="pos"?-l:l)
}var j={opacity:n=="show"?1:0};
j[m]=(n=="show"?c=="pos"?"+=":"-=":c=="pos"?"-=":"+=")+l;
d.animate(j,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){n=="hide"&&d.hide();
a.effects.restore(d,k);
a.effects.removeWrapper(d);
b.callback&&b.callback.apply(this,arguments);
d.dequeue()
}})
})
}
})(jQuery);
(function(a){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),h=["backgroundImage","backgroundColor","opacity"],i=a.effects.setMode(c,b.options.mode||"show"),g={backgroundColor:c.css("backgroundColor")};
if(i=="hide"){g.opacity=0
}a.effects.save(c,h);
c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){i=="hide"&&c.hide();
a.effects.restore(c,h);
i=="show"&&!a.support.opacity&&this.style.removeAttribute("filter");
b.callback&&b.callback.apply(this,arguments);
c.dequeue()
}})
})
}
})(jQuery);
(function(a){a.effects.slide=function(b){return this.queue(function(){var d=a(this),k=["position","top","left"],m=a.effects.setMode(d,b.options.mode||"show"),c=b.options.direction||"left";
a.effects.save(d,k);
d.show();
a.effects.createWrapper(d).css({overflow:"hidden"});
var l=c=="up"||c=="down"?"top":"left";
c=c=="up"||c=="left"?"pos":"neg";
var n=b.options.distance||(l=="top"?d.outerHeight({margin:true}):d.outerWidth({margin:true}));
if(m=="show"){d.css(l,c=="pos"?isNaN(n)?"-"+n:-n:n)
}var j={};
j[l]=(m=="show"?c=="pos"?"+=":"-=":c=="pos"?"-=":"+=")+n;
d.animate(j,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){m=="hide"&&d.hide();
a.effects.restore(d,k);
a.effects.removeWrapper(d);
b.callback&&b.callback.apply(this,arguments);
d.dequeue()
}})
})
}
})(jQuery);
(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;
this.defaults.name=name
},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);
if(!settings.single.length){settings.single="metadata"
}var data=$.data(elem,settings.single);
if(data){return data
}data="{}";
var getData=function(data){if(typeof data!="string"){return data
}if(data.indexOf("{")<0){data=eval("("+data+")")
}};
var getObject=function(data){if(typeof data!="string"){return data
}data=eval("("+data+")");
return data
};
if(settings.type=="html5"){var object={};
$(elem.attributes).each(function(){var name=this.nodeName;
if(name.match(/^data-/)){name=name.replace(/^data-/,"")
}else{return true
}object[name]=getObject(this.nodeValue)
})
}else{if(settings.type=="class"){var m=settings.cre.exec(elem.className);
if(m){data=m[1]
}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return
}var e=elem.getElementsByTagName(settings.name);
if(e.length){data=$.trim(e[0].innerHTML)
}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);
if(attr){data=attr
}}}}object=getObject(data.indexOf("{")<0?"{"+data+"}":data)
}$.data(elem,settings.single,object);
return object
}}});
$.fn.metadata=function(opts){return $.metadata.get(this[0],opts)
}
})(jQuery);
/*
* jQuery corner plugin: simple corner rounding
* Examples and documentation at: http://jquery.malsup.com/corner/
* version 2.09 (11-MAR-2010)
* Requires jQuery v1.3.2 or later
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Authors: Dave Methvin and Mike Alsup
*/
(function(c){var a=document.createElement("div").style;
var h=a.MozBorderRadius!==undefined;
var j=a.WebkitBorderRadius!==undefined;
var e=a.borderRadius!==undefined||a.BorderRadius!==undefined;
var d=document.documentMode||0;
var l=c.browser.msie&&((c.browser.version<8&&!d)||d<8);
var i=c.browser.msie&&(function(){var n=document.createElement("div");
try{n.style.setExpression("width","0+0");
n.style.removeExpression("width")
}catch(m){return false
}return true
})();
function g(m,n){return parseInt(c.css(m,n))||0
}function k(m){var m=parseInt(m).toString(16);
return(m.length<2)?"0"+m:m
}function b(o){while(o){var m=c.css(o,"backgroundColor");
if(m&&m!="transparent"&&m!="rgba(0, 0, 0, 0)"){if(m.indexOf("rgb")>=0){var n=m.match(/\d+/g);
return"#"+k(n[0])+k(n[1])+k(n[2])
}return m
}o=o.parentNode
}return"#ffffff"
}function f(o,m,n){switch(o){case"round":return Math.round(n*(1-Math.cos(Math.asin(m/n))));
case"cool":return Math.round(n*(1+Math.cos(Math.asin(m/n))));
case"sharp":return Math.round(n*(1-Math.cos(Math.acos(m/n))));
case"bite":return Math.round(n*(Math.cos(Math.asin((n-m-1)/n))));
case"slide":return Math.round(n*(Math.atan2(m,n/m)));
case"jut":return Math.round(n*(Math.atan2(n,(n-m-1))));
case"curl":return Math.round(n*(Math.atan(m)));
case"tear":return Math.round(n*(Math.cos(m)));
case"wicked":return Math.round(n*(Math.tan(m)));
case"long":return Math.round(n*(Math.sqrt(m)));
case"sculpt":return Math.round(n*(Math.log((n-m-1),n)));
case"dogfold":case"dog":return(m&1)?(m+1):n;
case"dog2":return(m&2)?(m+1):n;
case"dog3":return(m&3)?(m+1):n;
case"fray":return(m%2)*n;
case"notch":return n;
case"bevelfold":case"bevel":return m+1
}}c.fn.corner=function(m){if(this.length==0){if(!c.isReady&&this.selector){var n=this.selector,o=this.context;
c(function(){c(n,o).corner(m)
})
}return this
}return this.each(function(x){var v=c(this);
var E=[v.attr(c.fn.corner.defaults.metaAttr)||"",m||""].join(" ").toLowerCase();
var L=/keep/.test(E);
var D=((E.match(/cc:(#[0-9a-f]+)/)||[])[1]);
var p=((E.match(/sc:(#[0-9a-f]+)/)||[])[1]);
var H=parseInt((E.match(/(\d+)px/)||[])[1])||10;
var F=/round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/;
var r=((E.match(F)||["round"])[0]);
var s=/dogfold|bevelfold/.test(E);
var q={T:0,B:1};
var A={TL:/top|tl|left/.test(E),TR:/top|tr|right/.test(E),BL:/bottom|bl|left/.test(E),BR:/bottom|br|right/.test(E)};
if(!A.TL&&!A.TR&&!A.BL&&!A.BR){A={TL:1,TR:1,BL:1,BR:1}
}if(c.fn.corner.defaults.useNative&&r=="round"&&(e||h||j)&&!D&&!p){if(A.TL){v.css(e?"border-top-left-radius":h?"-moz-border-radius-topleft":"-webkit-border-top-left-radius",H+"px")
}if(A.TR){v.css(e?"border-top-right-radius":h?"-moz-border-radius-topright":"-webkit-border-top-right-radius",H+"px")
}if(A.BL){v.css(e?"border-bottom-left-radius":h?"-moz-border-radius-bottomleft":"-webkit-border-bottom-left-radius",H+"px")
}if(A.BR){v.css(e?"border-bottom-right-radius":h?"-moz-border-radius-bottomright":"-webkit-border-bottom-right-radius",H+"px")
}return
}var I=document.createElement("div");
c(I).css({overflow:"hidden",height:"1px",minHeight:"1px",fontSize:"1px",backgroundColor:p||"transparent",borderStyle:"solid"});
var O={T:parseInt(c.css(this,"paddingTop"))||0,R:parseInt(c.css(this,"paddingRight"))||0,B:parseInt(c.css(this,"paddingBottom"))||0,L:parseInt(c.css(this,"paddingLeft"))||0};
if(typeof this.style.zoom!=undefined){this.style.zoom=1
}if(!L){this.style.border="none"
}I.style.borderColor=D||b(this.parentNode);
var G=c(this).outerHeight();
for(var J in q){var z=q[J];
if((z&&(A.BL||A.BR))||(!z&&(A.TL||A.TR))){I.style.borderStyle="none "+(A[J+"R"]?"solid":"none")+" none "+(A[J+"L"]?"solid":"none");
var P=document.createElement("div");
c(P).addClass("jquery-corner");
var C=P.style;
z?this.appendChild(P):this.insertBefore(P,this.firstChild);
if(z&&G!="auto"){if(c.css(this,"position")=="static"){this.style.position="relative"
}C.position="absolute";
C.bottom=C.left=C.padding=C.margin="0";
if(i){C.setExpression("width","this.parentNode.offsetWidth")
}else{C.width="100%"
}}else{if(!z&&c.browser.msie){if(c.css(this,"position")=="static"){this.style.position="relative"
}C.position="absolute";
C.top=C.left=C.right=C.padding=C.margin="0";
if(i){var M=g(this,"borderLeftWidth")+g(this,"borderRightWidth");
C.setExpression("width","this.parentNode.offsetWidth - "+M+'+ "px"')
}else{C.width="100%"
}}else{C.position="relative";
C.margin=!z?"-"+O.T+"px -"+O.R+"px "+(O.T-H)+"px -"+O.L+"px":(O.B-H)+"px -"+O.R+"px -"+O.B+"px -"+O.L+"px"
}}for(var K=0;
K<H;
K++){var y=Math.max(0,f(r,K,H));
var N=I.cloneNode(false);
N.style.borderWidth="0 "+(A[J+"R"]?y:0)+"px 0 "+(A[J+"L"]?y:0)+"px";
z?P.appendChild(N):P.insertBefore(N,P.firstChild)
}if(s&&c.support.boxModel){if(z&&l){continue
}for(var Q in A){if(!A[Q]){continue
}if(z&&(Q=="TL"||Q=="TR")){continue
}if(!z&&(Q=="BL"||Q=="BR")){continue
}var B={position:"absolute",border:"none",margin:0,padding:0,overflow:"hidden",backgroundColor:I.style.borderColor};
var u=c("<div/>").css(B).css({width:H+"px",height:"1px"});
switch(Q){case"TL":u.css({bottom:0,left:0});
break;
case"TR":u.css({bottom:0,right:0});
break;
case"BL":u.css({top:0,left:0});
break;
case"BR":u.css({top:0,right:0});
break
}P.appendChild(u[0]);
var R=c("<div/>").css(B).css({top:0,bottom:0,width:"1px",height:H+"px"});
switch(Q){case"TL":R.css({left:H});
break;
case"TR":R.css({right:H});
break;
case"BL":R.css({left:H});
break;
case"BR":R.css({right:H});
break
}P.appendChild(R[0])
}}}}})
};
c.fn.uncorner=function(){if(e||h||j){this.css(e?"border-radius":h?"-moz-border-radius":"-webkit-border-radius",0)
}c("div.jquery-corner",this).remove();
return this
};
c.fn.corner.defaults={useNative:true,metaAttr:"data-corner"}
})(jQuery);
(function(a){a.fn.ezpz_hint=function(b){var d={hintClass:"ezpz-hint",hintName:"ezpz_hint_dummy_input",attribute:"title"};
var c=a.extend(d,b);
return this.each(function(f){var j=c.hintName+"_"+f;
var h;
var e;
var g=a(this).attr(c.attribute);
a('<input type="text" id="'+j+'" value="" />').insertBefore(a(this));
h=a(this).prev("input:first");
h.attr("class",a(this).attr("class"));
h.attr("size",a(this).attr("size"));
h.attr("autocomplete","off");
h.attr("tabIndex",a(this).attr("tabIndex"));
h.addClass(c.hintClass);
h.val(g);
a(this).hide();
a(this).attr("autocomplete","off");
h.focus(function(){e=a(this);
a(this).next("input:first").show();
a(this).next("input:first").focus();
a(this).next("input:first").unbind("blur").blur(function(){if(a(this).val()==""){a(this).hide();
e.show()
}});
a(this).hide()
});
if(a(this).val()!=""){h.focus()
}})
}
})(jQuery);
(function(d,g){var f=d.jQuery||d.Cowboy||(d.Cowboy={}),e;
f.throttle=e=function(m,l,a,b){var c,n=0;
if(typeof l!=="boolean"){b=a;
a=l;
l=g
}function k(){var p=this,h=+new Date()-n,q=arguments;
function i(){n=+new Date();
a.apply(p,q)
}function j(){c=g
}if(b&&!c){i()
}c&&clearTimeout(c);
if(b===g&&h>m){i()
}else{if(l!==true){c=setTimeout(b?j:i,b===g?m-h:m)
}}}if(f.guid){k.guid=a.guid=a.guid||f.guid++
}return k
};
f.debounce=function(c,b,a){return a===g?e(c,b,false):e(c,a,b!==false)
}
})(this);
(function(i,f){var u=i.fn.domManip,h="_tmplitem",v=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,p={},e={},z,y={key:0,data:{}},x=0,q=0,g=[];
function k(C,B,E,F){var D={data:F||(B?B.data:{}),_wrap:B?B._wrap:null,tmpl:null,parent:B||null,nodes:[],calls:c,nest:b,wrap:n,html:r,update:A};
if(C){i.extend(D,C,{nodes:[],parent:B})
}if(E){D.tmpl=E;
D._ctnt=D._ctnt||D.tmpl(i,D);
D.key=++x;
(g.length?e:p)[x]=D
}return D
}i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(B,C){i.fn[B]=function(D){var G=[],J=i(D),F,H,E,K,I=this.length===1&&this[0].parentNode;
z=p||{};
if(I&&I.nodeType===11&&I.childNodes.length===1&&J.length===1){J[C](this[0]);
G=this
}else{for(H=0,E=J.length;
H<E;
H++){q=H;
F=(H>0?this.clone(true):this).get();
i.fn[C].apply(i(J[H]),F);
G=G.concat(F)
}q=0;
G=this.pushStack(G,B,J.selector)
}K=z;
z=null;
i.tmpl.complete(K);
return G
}
});
i.fn.extend({tmpl:function(D,C,B){return i.tmpl(this[0],D,C,B)
},tmplItem:function(){return i.tmplItem(this[0])
},template:function(B){return i.template(B,this[0])
},domManip:function(D,H,I,C){if(D[0]&&D[0].nodeType){var G=i.makeArray(arguments),F=D.length,E=0,B;
while(E<F&&!(B=i.data(D[E++],"tmplItem"))){}if(F>1){G[0]=[i.makeArray(D)]
}if(B&&q){G[2]=function(J){i.tmpl.afterManip(this,J,I)
}
}u.apply(this,G)
}else{u.apply(this,arguments)
}q=0;
if(!z){i.tmpl.complete(p)
}return this
}});
i.extend({tmpl:function(D,G,F,C){var E,B=!C;
if(B){C=y;
D=i.template[D]||i.template(null,D);
e={}
}else{if(!D){D=C.tmpl;
p[C.key]=C;
C.nodes=[];
if(C.wrapped){s(C,C.wrapped)
}return i(m(C,null,C.tmpl(i,C)))
}}if(!D){return[]
}if(typeof G==="function"){G=G.call(C||{})
}if(F&&F.wrapped){s(F,F.wrapped)
}E=i.isArray(G)?i.map(G,function(H){return H?k(F,C,D,H):null
}):[k(F,C,D,G)];
return B?i(m(C,null,E)):E
},tmplItem:function(C){var B;
if(C instanceof i){C=C[0]
}while(C&&C.nodeType===1&&!(B=i.data(C,"tmplItem"))&&(C=C.parentNode)){}return B||y
},template:function(C,B){if(B){if(typeof B==="string"){B=l(B)
}else{if(B instanceof i){B=B[0]||{}
}}if(B.nodeType){B=i.data(B,"tmpl")||i.data(B,"tmpl",l(B.innerHTML))
}return typeof C==="string"?(i.template[C]=B):B
}return C?(typeof C!=="string"?i.template(null,C):(i.template[C]||i.template(null,v.test(C)?C:i(C)))):null
},encode:function(B){return(""+B).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")
}});
i.extend(i.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){_=_.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(_,$1,$2);_=[];",close:"call=$item.calls();_=call._.concat($item.wrap(call,_));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){_.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){_.push($.encode($1a));}"},"!":{open:""}},complete:function(B){p={}
},afterManip:function w(D,B,E){var C=B.nodeType===11?i.makeArray(B.childNodes):B.nodeType===1?[B]:[];
E.call(D,B);
o(C);
q++
}});
function m(B,F,D){var E,C=D?i.map(D,function(G){return(typeof G==="string")?(B.key?G.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+h+'="'+B.key+'" $2'):G):m(G,B,G._ctnt)
}):B;
if(F){return C
}C=C.join("");
C.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(H,I,G,J){E=i(G).get();
o(E);
if(I){E=a(I).concat(E)
}if(J){E=E.concat(a(J))
}});
return E?E:a(C)
}function a(C){var B=document.createElement("div");
B.innerHTML=C;
return i.makeArray(B.childNodes)
}function l(B){return new Function("jQuery","$item","var $=jQuery,call,_=[],$data=$item.data;with($data){_.push('"+i.trim(B).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(J,D,H,E,F,K,G){var M=i.tmpl.tag[H],C,I,L;
if(!M){throw"Template command not found: "+H
}C=M._default||[];
if(K&&!/\w$/.test(F)){F+=K;
K=""
}if(F){F=j(F);
G=G?(","+j(G)+")"):(K?")":"");
I=K?(F.indexOf(".")>-1?F+K:("("+F+").call($item"+G)):F;
L=K?I:"(typeof("+F+")==='function'?("+F+").call($item):("+F+"))"
}else{L=I=C.$1||"null"
}E=j(E);
return"');"+M[D?"close":"open"].split("$notnull_1").join(F?"typeof("+F+")!=='undefined' && ("+F+")!=null":"true").split("$1a").join(L).split("$1").join(I).split("$2").join(E?E.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g,function(O,N,P,Q){Q=Q?(","+Q+")"):(P?")":"");
return Q?("("+N+").call($item"+Q):O
}):(C.$2||""))+"_.push('"
})+"');}return _;")
}function s(C,B){C._wrap=m(C,true,i.isArray(B)?B:[v.test(B)?B:i(B).html()]).join("")
}function j(B){return B?B.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null
}function d(B){var C=document.createElement("div");
C.appendChild(B.cloneNode(true));
return C.innerHTML
}function o(H){var J="_"+q,C,B,F={},G,E,D;
for(G=0,E=H.length;
G<E;
G++){if((C=H[G]).nodeType!==1){continue
}B=C.getElementsByTagName("*");
for(D=B.length-1;
D>=0;
D--){I(B[D])
}I(C)
}function I(P){var M,O=P,N,K,L;
if((L=P.getAttribute(h))){while(O.parentNode&&(O=O.parentNode).nodeType===1&&!(M=O.getAttribute(h))){}if(M!==L){O=O.parentNode?(O.nodeType===11?0:(O.getAttribute(h)||0)):0;
if(!(K=p[L])){K=e[L];
K=k(K,p[O]||e[O],null,true);
K.key=++x;
p[x]=K
}if(q){Q(L)
}}P.removeAttribute(h)
}else{if(q&&(K=i.data(P,"tmplItem"))){Q(K.key);
p[K.key]=K;
O=i.data(P.parentNode,"tmplItem");
O=O?O.key:0
}}if(K){N=K;
while(N&&N.key!=O){N.nodes.push(P);
N=N.parent
}delete K._ctnt;
delete K._wrap;
i.data(P,"tmplItem",K)
}function Q(R){R=R+J;
K=F[R]=(F[R]||k(K,p[K.parent.key+J]||K.parent,null,true))
}}}function c(D,B,E,C){if(!D){return g.pop()
}g.push({_:D,tmpl:B,item:this,data:E,options:C})
}function b(B,D,C){return i.tmpl(i.template(B),D,C,this)
}function n(D,B){var C=D.options||{};
C.wrapped=B;
return i.tmpl(i.template(D.tmpl),D.data,C,D.item)
}function r(C,D){var B=this._wrap;
return i.map(i(i.isArray(B)?B.join(""):B).filter(C||"*"),function(E){return D?E.innerText||E.textContent:E.outerHTML||d(E)
})
}function A(){var B=this.nodes;
i.tmpl(null,null,null,this).insertBefore(B[0]);
i(B).remove()
}})(jQuery);
(function(b){var a=b.preload=function(f,h){if(f.split){f=b(f)
}h=b.extend({},a.defaults,h);
var c=b.map(f,function(l){if(!l){return
}if(l.split){return h.base+l+h.ext
}var k=l.src||l.href;
if(typeof h.placeholder=="string"&&l.src){l.src=h.placeholder
}if(k&&h.find){k=k.replace(h.find,h.replace)
}return k||null
});
var i={loaded:0,failed:0,next:0,done:0,total:c.length};
if(!i.total){return d()
}var j=b(Array(h.threshold+1).join("<img/>")).load(g).error(g).bind("abort",g).each(e);
function g(k){i.element=this;
i.found=k.type=="load";
i.image=this.src;
i.index=this.index;
var l=i.original=f[this.index];
i[i.found?"loaded":"failed"]++;
i.done++;
if(h.enforceCache){a.cache.push(b("<img/>").attr("src",i.image)[0])
}if(h.placeholder&&l.src){l.src=i.found?i.image:h.notFound||l.src
}if(h.onComplete){h.onComplete(i)
}if(i.done<i.total){e(0,this)
}else{if(j&&j.unbind){j.unbind("load").unbind("error").unbind("abort")
}j=null;
d()
}}function e(m,l,k){if(l.attachEvent&&i.next&&i.next%a.gap==0&&!k){setTimeout(function(){e(m,l,true)
},0);
return false
}if(i.next==i.total){return false
}l.index=i.next;
l.src=c[i.next++];
if(h.onRequest){i.index=l.index;
i.element=l;
i.image=l.src;
i.original=f[i.next-1];
h.onRequest(i)
}}function d(){if(h.onFinish){h.onFinish(i)
}}};
a.gap=14;
a.cache=[];
a.defaults={threshold:2,base:"",ext:"",replace:""};
b.fn.preload=function(c){a(this,c);
return this
}
})(jQuery);
/*
 * Raphael 1.5.2 - JavaScript Vector Library
 *
 * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com)
 * Licensed under the MIT (http://raphaeljs.com/license.html) license.
 */
(function(){function aJ(){if(aJ.is(arguments[0],a8)){var b=arguments[0],d=G[bC](aJ,b.splice(0,3+aJ.is(b[0],aG))),R=d.set();
for(var E=0,S=b[s];
E<S;
E++){var e=b[E]||{};
bq[ah](e.type)&&R[k](d[e.type]().attr(e))
}return R
}return G[bC](aJ,arguments)
}aJ.version="1.5.2";
var a=/[, ]+/,bq={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},bo=/\{(\d+)\}/g,bF="prototype",ah="hasOwnProperty",ab=document,aR=window,r={was:Object[bF][ah].call(aR,"Raphael"),is:aR.Raphael},bA=function(){this.customAttributes={}
},a0,bl="appendChild",bC="apply",bx="concat",X="createTouch" in ab,aQ="",aI=" ",bD=String,J="split",T="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend orientationchange touchcancel gesturestart gesturechange gestureend"[J](aI),br={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},aX="join",s="length",bH=bD[bF].toLowerCase,ap=Math,m=ap.max,bj=ap.min,ar=ap.abs,bm=ap.pow,aN=ap.PI,aG="number",ag="string",a8="array",a1="toString",a5="fill",aU=Object[bF][a1],bu={},k="push",h=/^url\(['"]?([^\)]+?)['"]?\)$/i,H=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,aq={"NaN":1,"Infinity":1,"-Infinity":1},c=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,ae=ap.round,F="setAttribute",ak=parseFloat,U=parseInt,a6=" progid:DXImageTransform.Microsoft",bp=bD[bF].toUpperCase,q={blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},an={along:"along",blur:aG,"clip-rect":"csv",cx:aG,cy:aG,fill:"colour","fill-opacity":aG,"font-size":aG,height:aG,opacity:aG,path:"path",r:aG,rotation:"csv",rx:aG,ry:aG,scale:"csv",stroke:"colour","stroke-opacity":aG,"stroke-width":aG,translation:"csv",width:aG,x:aG,y:aG},bt="replace",bg=/^(from|to|\d+%?)$/,be=/\s*,\s*/,n={hs:1,rg:1},bb=/,?([achlmqrstvxz]),?/gi,aS=/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,aH=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,aP=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/,bn=function(e,d){return e.key-d.key
};
aJ.type=(aR.SVGAngle||ab.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML");
if(aJ.type=="VML"){var ay=ab.createElement("div"),aC;
ay.innerHTML='<v:shape adj="1"/>';
aC=ay.firstChild;
aC.style.behavior="url(#default#VML)";
if(!(aC&&typeof aC.adj=="object")){return aJ.type=null
}ay=null
}aJ.svg=!(aJ.vml=aJ.type=="VML");
bA[bF]=aJ[bF];
a0=bA[bF];
aJ._id=0;
aJ._oid=0;
aJ.fn={};
aJ.is=function(d,b){b=bH.call(b);
if(b=="finite"){return !aq[ah](+d)
}return(b=="null"&&d===null)||(b==typeof d)||(b=="object"&&d===Object(d))||(b=="array"&&Array.isArray&&Array.isArray(d))||aU.call(d).slice(8,-1).toLowerCase()==b
};
aJ.angle=function(E,S,e,R,d,i){if(d==null){var b=E-e,bI=S-R;
if(!b&&!bI){return 0
}return((b<0)*180+ap.atan(-bI/-b)*180/aN+360)%360
}else{return aJ.angle(E,S,d,i)-aJ.angle(e,R,d,i)
}};
aJ.rad=function(b){return b%360*aN/180
};
aJ.deg=function(b){return b*180/aN%360
};
aJ.snapTo=function(d,E,b){b=aJ.is(b,"finite")?b:10;
if(aJ.is(d,a8)){var e=d.length;
while(e--){if(ar(d[e]-E)<=b){return d[e]
}}}else{d=+d;
var R=E%d;
if(R<b){return E-R
}if(R>d-b){return E-R+d
}}return E
};
function j(){var d=[],b=0;
for(;
b<32;
b++){d[b]=(~~(ap.random()*16))[a1](16)
}d[12]=4;
d[16]=((d[16]&3)|8)[a1](16);
return"r-"+d[aX]("")
}aJ.setWindow=function(b){aR=b;
ab=aR.document
};
var ba=function(E){if(aJ.vml){var b=/^\s+|\s+$/g;
var S;
try{var bI=new ActiveXObject("htmlfile");
bI.write("<body>");
bI.close();
S=bI.body
}catch(bJ){S=createPopup().document.body
}var d=S.createTextRange();
ba=aB(function(i){try{S.style.color=bD(i)[bt](b,aQ);
var bK=d.queryCommandValue("ForeColor");
bK=((bK&255)<<16)|(bK&65280)|((bK&16711680)>>>16);
return"#"+("000000"+bK[a1](16)).slice(-6)
}catch(bL){return"none"
}})
}else{var R=ab.createElement("i");
R.title="Rapha\xebl Colour Picker";
R.style.display="none";
ab.body[bl](R);
ba=aB(function(e){R.style.color=e;
return ab.defaultView.getComputedStyle(R,aQ).getPropertyValue("color")
})
}return ba(E)
},aD=function(){return"hsb("+[this.h,this.s,this.b]+")"
},N=function(){return"hsl("+[this.h,this.s,this.l]+")"
},C=function(){return this.hex
};
aJ.hsb2rgb=function(i,e,d,E){if(aJ.is(i,"object")&&"h" in i&&"s" in i&&"b" in i){d=i.b;
e=i.s;
i=i.h;
E=i.o
}return aJ.hsl2rgb(i,e,d/2,E)
};
aJ.hsl2rgb=function(bI,bP,E,e){if(aJ.is(bI,"object")&&"h" in bI&&"s" in bI&&"l" in bI){E=bI.l;
bP=bI.s;
bI=bI.h
}if(bI>1||bP>1||E>1){bI/=360;
bP/=100;
E/=100
}var bN={},bK=["r","g","b"],bJ,bM,S,d,bL,bO;
if(!bP){bN={r:E,g:E,b:E}
}else{if(E<0.5){bJ=E*(1+bP)
}else{bJ=E+bP-E*bP
}bM=2*E-bJ;
for(var R=0;
R<3;
R++){S=bI+1/3*-(R-1);
S<0&&S++;
S>1&&S--;
if(S*6<1){bN[bK[R]]=bM+(bJ-bM)*6*S
}else{if(S*2<1){bN[bK[R]]=bJ
}else{if(S*3<2){bN[bK[R]]=bM+(bJ-bM)*(2/3-S)*6
}else{bN[bK[R]]=bM
}}}}}bN.r*=255;
bN.g*=255;
bN.b*=255;
bN.hex="#"+(16777216|bN.b|(bN.g<<8)|(bN.r<<16)).toString(16).slice(1);
aJ.is(e,"finite")&&(bN.opacity=e);
bN.toString=C;
return bN
};
aJ.rgb2hsb=function(b,d,bI){if(d==null&&aJ.is(b,"object")&&"r" in b&&"g" in b&&"b" in b){bI=b.b;
d=b.g;
b=b.r
}if(d==null&&aJ.is(b,ag)){var bK=aJ.getRGB(b);
b=bK.r;
d=bK.g;
bI=bK.b
}if(b>1||d>1||bI>1){b/=255;
d/=255;
bI/=255
}var S=m(b,d,bI),e=bj(b,d,bI),E,i,R=S;
if(e==S){return{h:0,s:0,b:S,toString:aD}
}else{var bJ=(S-e);
i=bJ/S;
if(b==S){E=(d-bI)/bJ
}else{if(d==S){E=2+((bI-b)/bJ)
}else{E=4+((b-d)/bJ)
}}E/=6;
E<0&&E++;
E>1&&E--
}return{h:E,s:i,b:R,toString:aD}
};
aJ.rgb2hsl=function(d,e,S){if(e==null&&aJ.is(d,"object")&&"r" in d&&"g" in d&&"b" in d){S=d.b;
e=d.g;
d=d.r
}if(e==null&&aJ.is(d,ag)){var bL=aJ.getRGB(d);
d=bL.r;
e=bL.g;
S=bL.b
}if(d>1||e>1||S>1){d/=255;
e/=255;
S/=255
}var R=m(d,e,S),i=bj(d,e,S),E,bK,b=(R+i)/2,bJ;
if(i==R){bJ={h:0,s:0,l:b}
}else{var bI=R-i;
bK=b<0.5?bI/(R+i):bI/(2-R-i);
if(d==R){E=(e-S)/bI
}else{if(e==R){E=2+(S-d)/bI
}else{E=4+(d-e)/bI
}}E/=6;
E<0&&E++;
E>1&&E--;
bJ={h:E,s:bK,l:b}
}bJ.toString=N;
return bJ
};
aJ._path2string=function(){return this.join(",")[bt](bb,"$1")
};
function aB(i,d,b){function e(){var E=Array[bF].slice.call(arguments,0),S=E[aX]("\u25ba"),R=e.cache=e.cache||{},bI=e.count=e.count||[];
if(R[ah](S)){return b?b(R[S]):R[S]
}bI[s]>=1000&&delete R[bI.shift()];
bI[k](S);
R[S]=i[bC](d,E);
return b?b(R[S]):R[S]
}return e
}aJ.getRGB=aB(function(b){if(!b||!!((b=bD(b)).indexOf("-")+1)){return{r:-1,g:-1,b:-1,hex:"none",error:1}
}if(b=="none"){return{r:-1,g:-1,b:-1,hex:"none"}
}!(n[ah](b.toLowerCase().substring(0,2))||b.charAt()=="#")&&(b=ba(b));
var E,d,e,S,i,bJ,bI,R=b.match(H);
if(R){if(R[2]){S=U(R[2].substring(5),16);
e=U(R[2].substring(3,5),16);
d=U(R[2].substring(1,3),16)
}if(R[3]){S=U((bJ=R[3].charAt(3))+bJ,16);
e=U((bJ=R[3].charAt(2))+bJ,16);
d=U((bJ=R[3].charAt(1))+bJ,16)
}if(R[4]){bI=R[4][J](be);
d=ak(bI[0]);
bI[0].slice(-1)=="%"&&(d*=2.55);
e=ak(bI[1]);
bI[1].slice(-1)=="%"&&(e*=2.55);
S=ak(bI[2]);
bI[2].slice(-1)=="%"&&(S*=2.55);
R[1].toLowerCase().slice(0,4)=="rgba"&&(i=ak(bI[3]));
bI[3]&&bI[3].slice(-1)=="%"&&(i/=100)
}if(R[5]){bI=R[5][J](be);
d=ak(bI[0]);
bI[0].slice(-1)=="%"&&(d*=2.55);
e=ak(bI[1]);
bI[1].slice(-1)=="%"&&(e*=2.55);
S=ak(bI[2]);
bI[2].slice(-1)=="%"&&(S*=2.55);
(bI[0].slice(-3)=="deg"||bI[0].slice(-1)=="\xb0")&&(d/=360);
R[1].toLowerCase().slice(0,4)=="hsba"&&(i=ak(bI[3]));
bI[3]&&bI[3].slice(-1)=="%"&&(i/=100);
return aJ.hsb2rgb(d,e,S,i)
}if(R[6]){bI=R[6][J](be);
d=ak(bI[0]);
bI[0].slice(-1)=="%"&&(d*=2.55);
e=ak(bI[1]);
bI[1].slice(-1)=="%"&&(e*=2.55);
S=ak(bI[2]);
bI[2].slice(-1)=="%"&&(S*=2.55);
(bI[0].slice(-3)=="deg"||bI[0].slice(-1)=="\xb0")&&(d/=360);
R[1].toLowerCase().slice(0,4)=="hsla"&&(i=ak(bI[3]));
bI[3]&&bI[3].slice(-1)=="%"&&(i/=100);
return aJ.hsl2rgb(d,e,S,i)
}R={r:d,g:e,b:S};
R.hex="#"+(16777216|S|(e<<8)|(d<<16)).toString(16).slice(1);
aJ.is(i,"finite")&&(R.opacity=i);
return R
}return{r:-1,g:-1,b:-1,hex:"none",error:1}
},aJ);
aJ.getColor=function(d){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:d||0.75},b=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 b.hex
};
aJ.getColor.reset=function(){delete this.start
};
aJ.parsePathString=aB(function(b){if(!b){return null
}var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=[];
if(aJ.is(b,a8)&&aJ.is(b[0],a8)){d=aT(b)
}if(!d[s]){bD(b)[bt](aS,function(E,i,bI){var S=[],R=bH.call(i);
bI[bt](aH,function(bK,bJ){bJ&&S[k](+bJ)
});
if(R=="m"&&S[s]>2){d[k]([i][bx](S.splice(0,2)));
R="l";
i=i=="m"?"l":"L"
}while(S[s]>=e[R]){d[k]([i][bx](S.splice(0,e[R])));
if(!e[R]){break
}}})
}d[a1]=aJ._path2string;
return d
});
aJ.findDotsAtSegment=function(d,b,bV,bT,S,E,bJ,bI,bP){var bN=1-bP,bM=bm(bN,3)*d+bm(bN,2)*3*bP*bV+bN*3*bP*bP*S+bm(bP,3)*bJ,bK=bm(bN,3)*b+bm(bN,2)*3*bP*bT+bN*3*bP*bP*E+bm(bP,3)*bI,bR=d+2*bP*(bV-d)+bP*bP*(S-2*bV+d),bQ=b+2*bP*(bT-b)+bP*bP*(E-2*bT+b),bU=bV+2*bP*(S-bV)+bP*bP*(bJ-2*S+bV),bS=bT+2*bP*(E-bT)+bP*bP*(bI-2*E+bT),bO=(1-bP)*d+bP*bV,bL=(1-bP)*b+bP*bT,i=(1-bP)*S+bP*bJ,e=(1-bP)*E+bP*bI,R=(90-ap.atan((bR-bU)/(bQ-bS))*180/aN);
(bR>bU||bQ<bS)&&(R+=180);
return{x:bM,y:bK,m:{x:bR,y:bQ},n:{x:bU,y:bS},start:{x:bO,y:bL},end:{x:i,y:e},alpha:R}
};
var aj=aB(function(bM){if(!bM){return{x:0,y:0,width:0,height:0}
}bM=W(bM);
var bJ=0,bI=0,E=[],d=[],e;
for(var R=0,bL=bM[s];
R<bL;
R++){e=bM[R];
if(e[0]=="M"){bJ=e[1];
bI=e[2];
E[k](bJ);
d[k](bI)
}else{var S=a7(bJ,bI,e[1],e[2],e[3],e[4],e[5],e[6]);
E=E[bx](S.min.x,S.max.x);
d=d[bx](S.min.y,S.max.y);
bJ=e[5];
bI=e[6]
}}var b=bj[bC](0,E),bK=bj[bC](0,d);
return{x:b,y:bK,width:m[bC](0,E)-b,height:m[bC](0,d)-bK}
}),aT=function(S){var e=[];
if(!aJ.is(S,a8)||!aJ.is(S&&S[0],a8)){S=aJ.parsePathString(S)
}for(var d=0,E=S[s];
d<E;
d++){e[d]=[];
for(var b=0,R=S[d][s];
b<R;
b++){e[d][b]=S[d][b]
}}e[a1]=aJ._path2string;
return e
},av=aB(function(E){if(!aJ.is(E,a8)||!aJ.is(E&&E[0],a8)){E=aJ.parsePathString(E)
}var bL=[],bN=0,bM=0,bQ=0,bP=0,e=0;
if(E[0][0]=="M"){bN=E[0][1];
bM=E[0][2];
bQ=bN;
bP=bM;
e++;
bL[k](["M",bN,bM])
}for(var bI=e,bR=E[s];
bI<bR;
bI++){var b=bL[bI]=[],bO=E[bI];
if(bO[0]!=bH.call(bO[0])){b[0]=bH.call(bO[0]);
switch(b[0]){case"a":b[1]=bO[1];
b[2]=bO[2];
b[3]=bO[3];
b[4]=bO[4];
b[5]=bO[5];
b[6]=+(bO[6]-bN).toFixed(3);
b[7]=+(bO[7]-bM).toFixed(3);
break;
case"v":b[1]=+(bO[1]-bM).toFixed(3);
break;
case"m":bQ=bO[1];
bP=bO[2];
default:for(var S=1,bJ=bO[s];
S<bJ;
S++){b[S]=+(bO[S]-((S%2)?bN:bM)).toFixed(3)
}}}else{b=bL[bI]=[];
if(bO[0]=="m"){bQ=bO[1]+bN;
bP=bO[2]+bM
}for(var R=0,d=bO[s];
R<d;
R++){bL[bI][R]=bO[R]
}}var bK=bL[bI][s];
switch(bL[bI][0]){case"z":bN=bQ;
bM=bP;
break;
case"h":bN+=+bL[bI][bK-1];
break;
case"v":bM+=+bL[bI][bK-1];
break;
default:bN+=+bL[bI][bK-2];
bM+=+bL[bI][bK-1]
}}bL[a1]=aJ._path2string;
return bL
},0,aT),z=aB(function(E){if(!aJ.is(E,a8)||!aJ.is(E&&E[0],a8)){E=aJ.parsePathString(E)
}var bK=[],bM=0,bL=0,bP=0,bO=0,e=0;
if(E[0][0]=="M"){bM=+E[0][1];
bL=+E[0][2];
bP=bM;
bO=bL;
e++;
bK[0]=["M",bM,bL]
}for(var bI=e,bQ=E[s];
bI<bQ;
bI++){var b=bK[bI]=[],bN=E[bI];
if(bN[0]!=bp.call(bN[0])){b[0]=bp.call(bN[0]);
switch(b[0]){case"A":b[1]=bN[1];
b[2]=bN[2];
b[3]=bN[3];
b[4]=bN[4];
b[5]=bN[5];
b[6]=+(bN[6]+bM);
b[7]=+(bN[7]+bL);
break;
case"V":b[1]=+bN[1]+bL;
break;
case"H":b[1]=+bN[1]+bM;
break;
case"M":bP=+bN[1]+bM;
bO=+bN[2]+bL;
default:for(var S=1,bJ=bN[s];
S<bJ;
S++){b[S]=+bN[S]+((S%2)?bM:bL)
}}}else{for(var R=0,d=bN[s];
R<d;
R++){bK[bI][R]=bN[R]
}}switch(b[0]){case"Z":bM=bP;
bL=bO;
break;
case"H":bM=b[1];
break;
case"V":bL=b[1];
break;
case"M":bP=bK[bI][bK[bI][s]-2];
bO=bK[bI][bK[bI][s]-1];
default:bM=bK[bI][bK[bI][s]-2];
bL=bK[bI][bK[bI][s]-1]
}}bK[a1]=aJ._path2string;
return bK
},null,aT),bE=function(d,i,b,e){return[d,i,b,e,b,e]
},bk=function(d,i,S,E,b,e){var R=1/3,bI=2/3;
return[R*d+bI*S,R*i+bI*E,R*b+bI*S,R*e+bI*E,b,e]
},aa=function(bP,ck,bY,bW,bQ,bK,E,bO,cj,bR){var bV=aN*120/180,b=aN/180*(+bQ||0),b2=[],bZ,cg=aB(function(cl,co,i){var cn=cl*ap.cos(i)-co*ap.sin(i),cm=cl*ap.sin(i)+co*ap.cos(i);
return{x:cn,y:cm}
});
if(!bR){bZ=cg(bP,ck,-b);
bP=bZ.x;
ck=bZ.y;
bZ=cg(bO,cj,-b);
bO=bZ.x;
cj=bZ.y;
var d=ap.cos(aN/180*bQ),bM=ap.sin(aN/180*bQ),b4=(bP-bO)/2,b3=(ck-cj)/2;
var ce=(b4*b4)/(bY*bY)+(b3*b3)/(bW*bW);
if(ce>1){ce=ap.sqrt(ce);
bY=ce*bY;
bW=ce*bW
}var e=bY*bY,b7=bW*bW,b9=(bK==E?-1:1)*ap.sqrt(ar((e*b7-e*b3*b3-b7*b4*b4)/(e*b3*b3+b7*b4*b4))),bT=b9*bY*b3/bW+(bP+bO)/2,bS=b9*-bW*b4/bY+(ck+cj)/2,bJ=ap.asin(((ck-bS)/bW).toFixed(9)),bI=ap.asin(((cj-bS)/bW).toFixed(9));
bJ=bP<bT?aN-bJ:bJ;
bI=bO<bT?aN-bI:bI;
bJ<0&&(bJ=aN*2+bJ);
bI<0&&(bI=aN*2+bI);
if(E&&bJ>bI){bJ=bJ-aN*2
}if(!E&&bI>bJ){bI=bI-aN*2
}}else{bJ=bR[0];
bI=bR[1];
bT=bR[2];
bS=bR[3]
}var bN=bI-bJ;
if(ar(bN)>bV){var bU=bI,bX=bO,bL=cj;
bI=bJ+bV*(E&&bI>bJ?1:-1);
bO=bT+bY*ap.cos(bI);
cj=bS+bW*ap.sin(bI);
b2=aa(bO,cj,bY,bW,bQ,0,E,bX,bL,[bI,bU,bT,bS])
}bN=bI-bJ;
var S=ap.cos(bJ),ci=ap.sin(bJ),R=ap.cos(bI),ch=ap.sin(bI),b5=ap.tan(bN/4),b8=4/3*bY*b5,b6=4/3*bW*b5,cf=[bP,ck],cd=[bP+b8*ci,ck-b6*S],cc=[bO+b8*ch,cj-b6*R],ca=[bO,cj];
cd[0]=2*cf[0]-cd[0];
cd[1]=2*cf[1]-cd[1];
if(bR){return[cd,cc,ca][bx](b2)
}else{b2=[cd,cc,ca][bx](b2)[aX]()[J](",");
var b0=[];
for(var cb=0,b1=b2[s];
cb<b1;
cb++){b0[cb]=cb%2?cg(b2[cb-1],b2[cb],b).y:cg(b2[cb],b2[cb+1],b).x
}return b0
}},ad=function(d,b,i,e,bJ,bI,S,R,bK){var E=1-bK;
return{x:bm(E,3)*d+bm(E,2)*3*bK*i+E*3*bK*bK*bJ+bm(bK,3)*S,y:bm(E,3)*b+bm(E,2)*3*bK*e+E*3*bK*bK*bI+bm(bK,3)*R}
},a7=aB(function(i,d,R,E,bR,bQ,bN,bK){var bP=(bR-2*R+i)-(bN-2*bR+R),bM=2*(R-i)-2*(bR-R),bJ=i-R,bI=(-bM+ap.sqrt(bM*bM-4*bP*bJ))/2/bP,S=(-bM-ap.sqrt(bM*bM-4*bP*bJ))/2/bP,bL=[d,bK],bO=[i,bN],e;
ar(bI)>"1e12"&&(bI=0.5);
ar(S)>"1e12"&&(S=0.5);
if(bI>0&&bI<1){e=ad(i,d,R,E,bR,bQ,bN,bK,bI);
bO[k](e.x);
bL[k](e.y)
}if(S>0&&S<1){e=ad(i,d,R,E,bR,bQ,bN,bK,S);
bO[k](e.x);
bL[k](e.y)
}bP=(bQ-2*E+d)-(bK-2*bQ+E);
bM=2*(E-d)-2*(bQ-E);
bJ=d-E;
bI=(-bM+ap.sqrt(bM*bM-4*bP*bJ))/2/bP;
S=(-bM-ap.sqrt(bM*bM-4*bP*bJ))/2/bP;
ar(bI)>"1e12"&&(bI=0.5);
ar(S)>"1e12"&&(S=0.5);
if(bI>0&&bI<1){e=ad(i,d,R,E,bR,bQ,bN,bK,bI);
bO[k](e.x);
bL[k](e.y)
}if(S>0&&S<1){e=ad(i,d,R,E,bR,bQ,bN,bK,S);
bO[k](e.x);
bL[k](e.y)
}return{min:{x:bj[bC](0,bO),y:bj[bC](0,bL)},max:{x:m[bC](0,bO),y:m[bC](0,bL)}}
}),W=aB(function(bQ,bL){var E=z(bQ),bM=bL&&z(bL),bN={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},b={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},S=function(bR,bS){var i,bT;
if(!bR){return["C",bS.x,bS.y,bS.x,bS.y,bS.x,bS.y]
}!(bR[0] in {T:1,Q:1})&&(bS.qx=bS.qy=null);
switch(bR[0]){case"M":bS.X=bR[1];
bS.Y=bR[2];
break;
case"A":bR=["C"][bx](aa[bC](0,[bS.x,bS.y][bx](bR.slice(1))));
break;
case"S":i=bS.x+(bS.x-(bS.bx||bS.x));
bT=bS.y+(bS.y-(bS.by||bS.y));
bR=["C",i,bT][bx](bR.slice(1));
break;
case"T":bS.qx=bS.x+(bS.x-(bS.qx||bS.x));
bS.qy=bS.y+(bS.y-(bS.qy||bS.y));
bR=["C"][bx](bk(bS.x,bS.y,bS.qx,bS.qy,bR[1],bR[2]));
break;
case"Q":bS.qx=bR[1];
bS.qy=bR[2];
bR=["C"][bx](bk(bS.x,bS.y,bR[1],bR[2],bR[3],bR[4]));
break;
case"L":bR=["C"][bx](bE(bS.x,bS.y,bR[1],bR[2]));
break;
case"H":bR=["C"][bx](bE(bS.x,bS.y,bR[1],bS.y));
break;
case"V":bR=["C"][bx](bE(bS.x,bS.y,bS.x,bR[1]));
break;
case"Z":bR=["C"][bx](bE(bS.x,bS.y,bS.X,bS.Y));
break
}return bR
},d=function(bR,bS){if(bR[bS][s]>7){bR[bS].shift();
var bT=bR[bS];
while(bT[s]){bR.splice(bS++,0,["C"][bx](bT.splice(0,6)))
}bR.splice(bS,1);
bO=m(E[s],bM&&bM[s]||0)
}},e=function(bV,bU,bS,bR,bT){if(bV&&bU&&bV[bT][0]=="M"&&bU[bT][0]!="M"){bU.splice(bT,0,["M",bR.x,bR.y]);
bS.bx=0;
bS.by=0;
bS.x=bV[bT][1];
bS.y=bV[bT][2];
bO=m(E[s],bM&&bM[s]||0)
}};
for(var bJ=0,bO=m(E[s],bM&&bM[s]||0);
bJ<bO;
bJ++){E[bJ]=S(E[bJ],bN);
d(E,bJ);
bM&&(bM[bJ]=S(bM[bJ],b));
bM&&d(bM,bJ);
e(E,bM,bN,b,bJ);
e(bM,E,b,bN,bJ);
var bI=E[bJ],bP=bM&&bM[bJ],R=bI[s],bK=bM&&bP[s];
bN.x=bI[R-2];
bN.y=bI[R-1];
bN.bx=ak(bI[R-4])||bN.x;
bN.by=ak(bI[R-3])||bN.y;
b.bx=bM&&(ak(bP[bK-4])||b.x);
b.by=bM&&(ak(bP[bK-3])||b.y);
b.x=bM&&bP[bK-2];
b.y=bM&&bP[bK-1]
}return bM?[E,bM]:E
},null,aT),x=aB(function(bL){var bK=[];
for(var S=0,bM=bL[s];
S<bM;
S++){var b={},bJ=bL[S].match(/^([^:]*):?([\d\.]*)/);
b.color=aJ.getRGB(bJ[1]);
if(b.color.error){return null
}b.color=b.color.hex;
bJ[2]&&(b.offset=bJ[2]+"%");
bK[k](b)
}for(S=1,bM=bK[s]-1;
S<bM;
S++){if(!bK[S].offset){var e=ak(bK[S-1].offset||0),E=0;
for(var R=S+1;
R<bM;
R++){if(bK[R].offset){E=bK[R].offset;
break
}}if(!E){E=100;
R=bM
}E=ak(E);
var bI=(E-e)/(R-S+1);
for(;
S<R;
S++){e+=bI;
bK[S].offset=e+"%"
}}}return bK
}),aK=function(b,E,e,i){var d;
if(aJ.is(b,ag)||aJ.is(b,"object")){d=aJ.is(b,ag)?ab.getElementById(b):b;
if(d.tagName){if(E==null){return{container:d,width:d.style.pixelWidth||d.offsetWidth,height:d.style.pixelHeight||d.offsetHeight}
}else{return{container:d,width:E,height:e}
}}}else{return{container:1,x:b,y:E,width:e,height:i}
}},bf=function(b,e){var d=this;
for(var i in e){if(e[ah](i)&&!(i in b)){switch(typeof e[i]){case"function":(function(E){b[i]=b===d?E:function(){return E[bC](d,arguments)
}
})(e[i]);
break;
case"object":b[i]=b[i]||{};
bf.call(this,b[i],e[i]);
break;
default:b[i]=e[i];
break
}}}},aF=function(b,d){b==d.top&&(d.top=b.prev);
b==d.bottom&&(d.bottom=b.next);
b.next&&(b.next.prev=b.prev);
b.prev&&(b.prev.next=b.next)
},am=function(b,d){if(d.top===b){return
}aF(b,d);
b.next=null;
b.prev=d.top;
d.top.next=b;
d.top=b
},p=function(b,d){if(d.bottom===b){return
}aF(b,d);
b.next=d.bottom;
b.prev=null;
d.bottom.prev=b;
d.bottom=b
},K=function(d,b,e){aF(d,e);
b==e.top&&(e.top=d);
b.next&&(b.next.prev=d);
d.next=b.next;
d.prev=b;
b.next=d
},aM=function(d,b,e){aF(d,e);
b==e.bottom&&(e.bottom=d);
b.prev&&(b.prev.next=d);
d.prev=b.prev;
b.prev=d;
d.next=b
},A=function(b){return function(){throw new Error("Rapha\xebl: you are calling to method \u201c"+b+"\u201d of removed object")
}
};
aJ.pathToRelative=av;
if(aJ.svg){a0.svgns="http://www.w3.org/2000/svg";
a0.xlink="http://www.w3.org/1999/xlink";
ae=function(b){return +b+(~~b===b)*0.5
};
var bi=function(e,b){if(b){for(var d in b){if(b[ah](d)){e[F](d,bD(b[d]))
}}}else{e=ab.createElementNS(a0.svgns,e);
e.style.webkitTapHighlightColor="rgba(0,0,0,0)";
return e
}};
aJ[a1]=function(){return"Your browser supports SVG.\nYou are running Rapha\xebl "+this.version
};
var y=function(b,i){var d=bi("path");
i.canvas&&i.canvas[bl](d);
var e=new aV(d,i);
e.type="path";
ao(e,{fill:"none",stroke:"#000",path:b});
return e
};
var g=function(E,bP,b){var bM="linear",bJ=0.5,S=0.5,bR=E.style;
bP=bD(bP)[bt](aP,function(bT,i,bU){bM="radial";
if(i&&bU){bJ=ak(i);
S=ak(bU);
var bS=((S>0.5)*2-1);
bm(bJ-0.5,2)+bm(S-0.5,2)>0.25&&(S=ap.sqrt(0.25-bm(bJ-0.5,2))*bS+0.5)&&S!=0.5&&(S=S.toFixed(5)-0.00001*bS)
}return aQ
});
bP=bP[J](/\s*\-\s*/);
if(bM=="linear"){var bI=bP.shift();
bI=-ak(bI);
if(isNaN(bI)){return null
}var R=[0,0,ap.cos(bI*aN/180),ap.sin(bI*aN/180)],bO=1/(m(ar(R[2]),ar(R[3]))||1);
R[2]*=bO;
R[3]*=bO;
if(R[2]<0){R[0]=-R[2];
R[2]=0
}if(R[3]<0){R[1]=-R[3];
R[3]=0
}}var bL=x(bP);
if(!bL){return null
}var d=E.getAttribute(a5);
d=d.match(/^url\(#(.*)\)$/);
d&&b.defs.removeChild(ab.getElementById(d[1]));
var e=bi(bM+"Gradient");
e.id=j();
bi(e,bM=="radial"?{fx:bJ,fy:S}:{x1:R[0],y1:R[1],x2:R[2],y2:R[3]});
b.defs[bl](e);
for(var bK=0,bQ=bL[s];
bK<bQ;
bK++){var bN=bi("stop");
bi(bN,{offset:bL[bK].offset?bL[bK].offset:!bK?"0%":"100%","stop-color":bL[bK].color||"#fff"});
e[bl](bN)
}bi(E,{fill:"url(#"+e.id+")",opacity:1,"fill-opacity":1});
bR.fill=aQ;
bR.opacity=1;
bR.fillOpacity=1;
return 1
};
var ac=function(d){var b=d.getBBox();
bi(d.pattern,{patternTransform:aJ.format("translate({0},{1})",b.x,b.y)})
};
var ao=function(bO,bX){var bR={"":[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]},bT=bO.node,bP=bO.attrs,bL=bO.rotate(),S=function(b4,b3){b3=bR[bH.call(b3)];
if(b3){var b1=b4.attrs["stroke-width"]||"1",bZ={round:b1,square:b1,butt:0}[b4.attrs["stroke-linecap"]||bX["stroke-linecap"]]||0,b2=[];
var b0=b3[s];
while(b0--){b2[b0]=b3[b0]*b1+((b0%2)?1:-1)*bZ
}bi(bT,{"stroke-dasharray":b2[aX](",")})
}};
bX[ah]("rotation")&&(bL=bX.rotation);
var bK=bD(bL)[J](a);
if(!(bK.length-1)){bK=null
}else{bK[1]=+bK[1];
bK[2]=+bK[2]
}ak(bL)&&bO.rotate(0,true);
for(var bS in bX){if(bX[ah](bS)){if(!q[ah](bS)){continue
}var bQ=bX[bS];
bP[bS]=bQ;
switch(bS){case"blur":bO.blur(bQ);
break;
case"rotation":bO.rotate(bQ,true);
break;
case"href":case"title":case"target":var bV=bT.parentNode;
if(bH.call(bV.tagName)!="a"){var E=bi("a");
bV.insertBefore(E,bT);
E[bl](bT);
bV=E
}if(bS=="target"&&bQ=="blank"){bV.setAttributeNS(bO.paper.xlink,"show","new")
}else{bV.setAttributeNS(bO.paper.xlink,bS,bQ)
}break;
case"cursor":bT.style.cursor=bQ;
break;
case"clip-rect":var d=bD(bQ)[J](a);
if(d[s]==4){bO.clip&&bO.clip.parentNode.parentNode.removeChild(bO.clip.parentNode);
var e=bi("clipPath"),bU=bi("rect");
e.id=j();
bi(bU,{x:d[0],y:d[1],width:d[2],height:d[3]});
e[bl](bU);
bO.paper.defs[bl](e);
bi(bT,{"clip-path":"url(#"+e.id+")"});
bO.clip=bU
}if(!bQ){var bW=ab.getElementById(bT.getAttribute("clip-path")[bt](/(^url\(#|\)$)/g,aQ));
bW&&bW.parentNode.removeChild(bW);
bi(bT,{"clip-path":aQ});
delete bO.clip
}break;
case"path":if(bO.type=="path"){bi(bT,{d:bQ?bP.path=z(bQ):"M0,0"})
}break;
case"width":bT[F](bS,bQ);
if(bP.fx){bS="x";
bQ=bP.x
}else{break
}case"x":if(bP.fx){bQ=-bP.x-(bP.width||0)
}case"rx":if(bS=="rx"&&bO.type=="rect"){break
}case"cx":bK&&(bS=="x"||bS=="cx")&&(bK[1]+=bQ-bP[bS]);
bT[F](bS,bQ);
bO.pattern&&ac(bO);
break;
case"height":bT[F](bS,bQ);
if(bP.fy){bS="y";
bQ=bP.y
}else{break
}case"y":if(bP.fy){bQ=-bP.y-(bP.height||0)
}case"ry":if(bS=="ry"&&bO.type=="rect"){break
}case"cy":bK&&(bS=="y"||bS=="cy")&&(bK[2]+=bQ-bP[bS]);
bT[F](bS,bQ);
bO.pattern&&ac(bO);
break;
case"r":if(bO.type=="rect"){bi(bT,{rx:bQ,ry:bQ})
}else{bT[F](bS,bQ)
}break;
case"src":if(bO.type=="image"){bT.setAttributeNS(bO.paper.xlink,"href",bQ)
}break;
case"stroke-width":bT.style.strokeWidth=bQ;
bT[F](bS,bQ);
if(bP["stroke-dasharray"]){S(bO,bP["stroke-dasharray"])
}break;
case"stroke-dasharray":S(bO,bQ);
break;
case"translation":var bI=bD(bQ)[J](a);
bI[0]=+bI[0]||0;
bI[1]=+bI[1]||0;
if(bK){bK[1]+=bI[0];
bK[2]+=bI[1]
}B.call(bO,bI[0],bI[1]);
break;
case"scale":bI=bD(bQ)[J](a);
bO.scale(+bI[0]||1,+bI[1]||+bI[0]||1,isNaN(ak(bI[2]))?null:+bI[2],isNaN(ak(bI[3]))?null:+bI[3]);
break;
case a5:var R=bD(bQ).match(h);
if(R){e=bi("pattern");
var bN=bi("image");
e.id=j();
bi(e,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});
bi(bN,{x:0,y:0});
bN.setAttributeNS(bO.paper.xlink,"href",R[1]);
e[bl](bN);
var bY=ab.createElement("img");
bY.style.cssText="position:absolute;left:-9999em;top-9999em";
bY.onload=function(){bi(e,{width:this.offsetWidth,height:this.offsetHeight});
bi(bN,{width:this.offsetWidth,height:this.offsetHeight});
ab.body.removeChild(this);
bO.paper.safari()
};
ab.body[bl](bY);
bY.src=R[1];
bO.paper.defs[bl](e);
bT.style.fill="url(#"+e.id+")";
bi(bT,{fill:"url(#"+e.id+")"});
bO.pattern=e;
bO.pattern&&ac(bO);
break
}var i=aJ.getRGB(bQ);
if(!i.error){delete bX.gradient;
delete bP.gradient;
!aJ.is(bP.opacity,"undefined")&&aJ.is(bX.opacity,"undefined")&&bi(bT,{opacity:bP.opacity});
!aJ.is(bP["fill-opacity"],"undefined")&&aJ.is(bX["fill-opacity"],"undefined")&&bi(bT,{"fill-opacity":bP["fill-opacity"]})
}else{if((({circle:1,ellipse:1})[ah](bO.type)||bD(bQ).charAt()!="r")&&g(bT,bQ,bO.paper)){bP.gradient=bQ;
bP.fill="none";
break
}}i[ah]("opacity")&&bi(bT,{"fill-opacity":i.opacity>1?i.opacity/100:i.opacity});
case"stroke":i=aJ.getRGB(bQ);
bT[F](bS,i.hex);
bS=="stroke"&&i[ah]("opacity")&&bi(bT,{"stroke-opacity":i.opacity>1?i.opacity/100:i.opacity});
break;
case"gradient":(({circle:1,ellipse:1})[ah](bO.type)||bD(bQ).charAt()!="r")&&g(bT,bQ,bO.paper);
break;
case"opacity":if(bP.gradient&&!bP[ah]("stroke-opacity")){bi(bT,{"stroke-opacity":bQ>1?bQ/100:bQ})
}case"fill-opacity":if(bP.gradient){var b=ab.getElementById(bT.getAttribute(a5)[bt](/^url\(#|\)$/g,aQ));
if(b){var bJ=b.getElementsByTagName("stop");
bJ[bJ[s]-1][F]("stop-opacity",bQ)
}break
}default:bS=="font-size"&&(bQ=U(bQ,10)+"px");
var bM=bS[bt](/(\-.)/g,function(bZ){return bp.call(bZ.substring(1))
});
bT.style[bM]=bQ;
bT[F](bS,bQ);
break
}}}Q(bO,bX);
if(bK){bO.rotate(bK.join(aI))
}else{ak(bL)&&bO.rotate(bL,true)
}};
var o=1.2,Q=function(b,E){if(b.type!="text"||!(E[ah]("text")||E[ah]("font")||E[ah]("font-size")||E[ah]("x")||E[ah]("y"))){return
}var bK=b.attrs,d=b.node,bM=d.firstChild?U(ab.defaultView.getComputedStyle(d.firstChild,aQ).getPropertyValue("font-size"),10):10;
if(E[ah]("text")){bK.text=E.text;
while(d.firstChild){d.removeChild(d.firstChild)
}var e=bD(E.text)[J]("\n");
for(var R=0,bL=e[s];
R<bL;
R++){if(e[R]){var bI=bi("tspan");
R&&bi(bI,{dy:bM*o,x:bK.x});
bI[bl](ab.createTextNode(e[R]));
d[bl](bI)
}}}else{e=d.getElementsByTagName("tspan");
for(R=0,bL=e[s];
R<bL;
R++){R&&bi(e[R],{dy:bM*o,x:bK.x})
}}bi(d,{y:bK.y});
var S=b.getBBox(),bJ=bK.y-(S.y+S.height/2);
bJ&&aJ.is(bJ,"finite")&&bi(d,{y:bK.y+bJ})
},aV=function(d,b){var i=0,e=0;
this[0]=d;
this.id=aJ._oid++;
this.node=d;
d.raphael=this;
this.paper=b;
this.attrs=this.attrs||{};
this.transformations=[];
this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1};
!b.bottom&&(b.bottom=this);
this.prev=b.top;
b.top&&(b.top.next=this);
b.top=this;
this.next=null
};
var bd=aV[bF];
aV[bF].rotate=function(d,b,i){if(this.removed){return this
}if(d==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy][aX](aI)
}return this._.rt.deg
}var e=this.getBBox();
d=bD(d)[J](a);
if(d[s]-1){b=ak(d[1]);
i=ak(d[2])
}d=ak(d[0]);
if(b!=null&&b!==false){this._.rt.deg=d
}else{this._.rt.deg+=d
}(i==null)&&(b=null);
this._.rt.cx=b;
this._.rt.cy=i;
b=b==null?e.x+e.width/2:b;
i=i==null?e.y+e.height/2:i;
if(this._.rt.deg){this.transformations[0]=aJ.format("rotate({0} {1} {2})",this._.rt.deg,b,i);
this.clip&&bi(this.clip,{transform:aJ.format("rotate({0} {1} {2})",-this._.rt.deg,b,i)})
}else{this.transformations[0]=aQ;
this.clip&&bi(this.clip,{transform:aQ})
}bi(this.node,{transform:this.transformations[aX](aI)});
return this
};
aV[bF].hide=function(){!this.removed&&(this.node.style.display="none");
return this
};
aV[bF].show=function(){!this.removed&&(this.node.style.display="");
return this
};
aV[bF].remove=function(){if(this.removed){return
}aF(this,this.paper);
this.node.parentNode.removeChild(this.node);
for(var b in this){delete this[b]
}this.removed=true
};
aV[bF].getBBox=function(){if(this.removed){return this
}if(this.type=="path"){return aj(this.attrs.path)
}if(this.node.style.display=="none"){this.show();
var d=true
}var bI={};
try{bI=this.node.getBBox()
}catch(R){}finally{bI=bI||{}
}if(this.type=="text"){bI={x:bI.x,y:Infinity,width:0,height:0};
for(var b=0,E=this.node.getNumberOfChars();
b<E;
b++){var S=this.node.getExtentOfChar(b);
(S.y<bI.y)&&(bI.y=S.y);
(S.y+S.height-bI.y>bI.height)&&(bI.height=S.y+S.height-bI.y);
(S.x+S.width-bI.x>bI.width)&&(bI.width=S.x+S.width-bI.x)
}}d&&this.hide();
return bI
};
aV[bF].attr=function(b,bK){if(this.removed){return this
}if(b==null){var bJ={};
for(var R in this.attrs){if(this.attrs[ah](R)){bJ[R]=this.attrs[R]
}}this._.rt.deg&&(bJ.rotation=this.rotate());
(this._.sx!=1||this._.sy!=1)&&(bJ.scale=this.scale());
bJ.gradient&&bJ.fill=="none"&&(bJ.fill=bJ.gradient)&&delete bJ.gradient;
return bJ
}if(bK==null&&aJ.is(b,ag)){if(b=="translation"){return B.call(this)
}if(b=="rotation"){return this.rotate()
}if(b=="scale"){return this.scale()
}if(b==a5&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient
}return this.attrs[b]
}if(bK==null&&aJ.is(b,a8)){var bM={};
for(var E=0,S=b.length;
E<S;
E++){bM[b[E]]=this.attr(b[E])
}return bM
}if(bK!=null){var d={};
d[b]=bK
}else{if(b!=null&&aJ.is(b,"object")){d=b
}}for(var bL in this.paper.customAttributes){if(this.paper.customAttributes[ah](bL)&&d[ah](bL)&&aJ.is(this.paper.customAttributes[bL],"function")){var bI=this.paper.customAttributes[bL].apply(this,[][bx](d[bL]));
this.attrs[bL]=d[bL];
for(var e in bI){if(bI[ah](e)){d[e]=bI[e]
}}}}ao(this,d);
return this
};
aV[bF].toFront=function(){if(this.removed){return this
}this.node.parentNode[bl](this.node);
var b=this.paper;
b.top!=this&&am(this,b);
return this
};
aV[bF].toBack=function(){if(this.removed){return this
}if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild);
p(this,this.paper);
var b=this.paper
}return this
};
aV[bF].insertAfter=function(b){if(this.removed){return this
}var d=b.node||b[b.length-1].node;
if(d.nextSibling){d.parentNode.insertBefore(this.node,d.nextSibling)
}else{d.parentNode[bl](this.node)
}K(this,b,this.paper);
return this
};
aV[bF].insertBefore=function(b){if(this.removed){return this
}var d=b.node||b[0].node;
d.parentNode.insertBefore(this.node,d);
aM(this,b,this.paper);
return this
};
aV[bF].blur=function(d){var b=this;
if(+d!==0){var e=bi("filter"),i=bi("feGaussianBlur");
b.attrs.blur=d;
e.id=j();
bi(i,{stdDeviation:+d||1.5});
e.appendChild(i);
b.paper.defs.appendChild(e);
b._blur=e;
bi(b.node,{filter:"url(#"+e.id+")"})
}else{if(b._blur){b._blur.parentNode.removeChild(b._blur);
delete b._blur;
delete b.attrs.blur
}b.node.removeAttribute("filter")
}};
var af=function(d,b,R,E){var i=bi("circle");
d.canvas&&d.canvas[bl](i);
var e=new aV(i,d);
e.attrs={cx:b,cy:R,r:E,fill:"none",stroke:"#000"};
e.type="circle";
bi(i,e.attrs);
return e
},bc=function(e,b,bI,d,R,S){var E=bi("rect");
e.canvas&&e.canvas[bl](E);
var i=new aV(E,e);
i.attrs={x:b,y:bI,width:d,height:R,r:S||0,rx:S||0,ry:S||0,fill:"none",stroke:"#000"};
i.type="rect";
bi(E,i.attrs);
return i
},aA=function(d,b,S,R,E){var i=bi("ellipse");
d.canvas&&d.canvas[bl](i);
var e=new aV(i,d);
e.attrs={cx:b,cy:S,rx:R,ry:E,fill:"none",stroke:"#000"};
e.type="ellipse";
bi(i,e.attrs);
return e
},w=function(e,S,b,bI,d,R){var E=bi("image");
bi(E,{x:b,y:bI,width:d,height:R,preserveAspectRatio:"none"});
E.setAttributeNS(e.xlink,"href",S);
e.canvas&&e.canvas[bl](E);
var i=new aV(E,e);
i.attrs={x:b,y:bI,width:d,height:R,src:S};
i.type="image";
return i
},al=function(d,b,R,E){var i=bi("text");
bi(i,{x:b,y:R,"text-anchor":"middle"});
d.canvas&&d.canvas[bl](i);
var e=new aV(i,d);
e.attrs={x:b,y:R,"text-anchor":"middle",text:E,font:q.font,stroke:"none",fill:"#000"};
e.type="text";
ao(e,e.attrs);
return e
},bB=function(d,b){this.width=d||this.width;
this.height=b||this.height;
this.canvas[F]("width",this.width);
this.canvas[F]("height",this.height);
return this
},G=function(){var i=aK[bC](0,arguments),e=i&&i.container,d=i.x,S=i.y,E=i.width,b=i.height;
if(!e){throw new Error("SVG container not found.")
}var R=bi("svg");
d=d||0;
S=S||0;
E=E||512;
b=b||342;
bi(R,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:E,height:b});
if(e==1){R.style.cssText="position:absolute;left:"+d+"px;top:"+S+"px";
ab.body[bl](R)
}else{if(e.firstChild){e.insertBefore(R,e.firstChild)
}else{e[bl](R)
}}e=new bA;
e.width=E;
e.height=b;
e.canvas=R;
bf.call(e,e,aJ.fn);
e.clear();
return e
};
a0.clear=function(){var b=this.canvas;
while(b.firstChild){b.removeChild(b.firstChild)
}this.bottom=this.top=null;
(this.desc=bi("desc"))[bl](ab.createTextNode("Created with Rapha\xebl"));
b[bl](this.desc);
b[bl](this.defs=bi("defs"))
};
a0.remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);
for(var b in this){this[b]=A(b)
}}
}if(aJ.vml){var O={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},aO=/([clmz]),?([^clmz]*)/gi,by=/ progid:\S+Blur\([^\)]+\)/g,bG=/-?[^,\s-]+/g,aY=1000+aI+1000,v=10,u={path:1,rect:1},bh=function(bM){var bJ=/[ahqstv]/ig,e=z;
bD(bM).match(bJ)&&(e=W);
bJ=/[clmz]/g;
if(e==z&&!bD(bM).match(bJ)){var bI=bD(bM)[bt](aO,function(bP,bR,bN){var bQ=[],i=bH.call(bR)=="m",bO=O[bR];
bN[bt](bG,function(bS){if(i&&bQ[s]==2){bO+=bQ+O[bR=="m"?"l":"L"];
bQ=[]
}bQ[k](ae(bS*v))
});
return bO+bQ
});
return bI
}var bK=e(bM),d,b;
bI=[];
for(var R=0,bL=bK[s];
R<bL;
R++){d=bK[R];
b=bH.call(bK[R][0]);
b=="z"&&(b="x");
for(var E=1,S=d[s];
E<S;
E++){b+=ae(d[E]*v)+(E!=S-1?",":aQ)
}bI[k](b)
}return bI[aX](aI)
};
aJ[a1]=function(){return"Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl "+this.version
};
y=function(e,d){var R=az("group");
R.style.cssText="position:absolute;left:0;top:0;width:"+d.width+"px;height:"+d.height+"px";
R.coordsize=d.coordsize;
R.coordorigin=d.coordorigin;
var E=az("shape"),i=E.style;
i.width=d.width+"px";
i.height=d.height+"px";
E.coordsize=aY;
E.coordorigin=d.coordorigin;
R[bl](E);
var S=new aV(E,R,d),b={fill:"none",stroke:"#000"};
e&&(b.path=e);
S.type="path";
S.path=[];
S.Path=aQ;
ao(S,b);
d.canvas[bl](R);
return S
};
ao=function(bK,bR){bK.attrs=bK.attrs||{};
var bO=bK.node,bS=bK.attrs,S=bO.style,i,bQ=(bR.x!=bS.x||bR.y!=bS.y||bR.width!=bS.width||bR.height!=bS.height||bR.r!=bS.r)&&bK.type=="rect",bW=bK;
for(var bI in bR){if(bR[ah](bI)){bS[bI]=bR[bI]
}}if(bQ){bS.path=au(bS.x,bS.y,bS.width,bS.height,bS.r);
bK.X=bS.x;
bK.Y=bS.y;
bK.W=bS.width;
bK.H=bS.height
}bR.href&&(bO.href=bR.href);
bR.title&&(bO.title=bR.title);
bR.target&&(bO.target=bR.target);
bR.cursor&&(S.cursor=bR.cursor);
"blur" in bR&&bK.blur(bR.blur);
if(bR.path&&bK.type=="path"||bQ){bO.path=bh(bS.path)
}if(bR.rotation!=null){bK.rotate(bR.rotation,true)
}if(bR.translation){i=bD(bR.translation)[J](a);
B.call(bK,i[0],i[1]);
if(bK._.rt.cx!=null){bK._.rt.cx+=+i[0];
bK._.rt.cy+=+i[1];
bK.setBox(bK.attrs,i[0],i[1])
}}if(bR.scale){i=bD(bR.scale)[J](a);
bK.scale(+i[0]||1,+i[1]||+i[0]||1,+i[2]||null,+i[3]||null)
}if("clip-rect" in bR){var b=bD(bR["clip-rect"])[J](a);
if(b[s]==4){b[2]=+b[2]+(+b[0]);
b[3]=+b[3]+(+b[1]);
var bJ=bO.clipRect||ab.createElement("div"),bV=bJ.style,R=bO.parentNode;
bV.clip=aJ.format("rect({1}px {2}px {3}px {0}px)",b);
if(!bO.clipRect){bV.position="absolute";
bV.top=0;
bV.left=0;
bV.width=bK.paper.width+"px";
bV.height=bK.paper.height+"px";
R.parentNode.insertBefore(bJ,R);
bJ[bl](R);
bO.clipRect=bJ
}}if(!bR["clip-rect"]){bO.clipRect&&(bO.clipRect.style.clip=aQ)
}}if(bK.type=="image"&&bR.src){bO.src=bR.src
}if(bK.type=="image"&&bR.opacity){bO.filterOpacity=a6+".Alpha(opacity="+(bR.opacity*100)+")";
S.filter=(bO.filterMatrix||aQ)+(bO.filterOpacity||aQ)
}bR.font&&(S.font=bR.font);
bR["font-family"]&&(S.fontFamily='"'+bR["font-family"][J](",")[0][bt](/^['"]+|['"]+$/g,aQ)+'"');
bR["font-size"]&&(S.fontSize=bR["font-size"]);
bR["font-weight"]&&(S.fontWeight=bR["font-weight"]);
bR["font-style"]&&(S.fontStyle=bR["font-style"]);
if(bR.opacity!=null||bR["stroke-width"]!=null||bR.fill!=null||bR.stroke!=null||bR["stroke-width"]!=null||bR["stroke-opacity"]!=null||bR["fill-opacity"]!=null||bR["stroke-dasharray"]!=null||bR["stroke-miterlimit"]!=null||bR["stroke-linejoin"]!=null||bR["stroke-linecap"]!=null){bO=bK.shape||bO;
var bP=(bO.getElementsByTagName(a5)&&bO.getElementsByTagName(a5)[0]),bT=false;
!bP&&(bT=bP=az(a5));
if("fill-opacity" in bR||"opacity" in bR){var d=((+bS["fill-opacity"]+1||2)-1)*((+bS.opacity+1||2)-1)*((+aJ.getRGB(bR.fill).o+1||2)-1);
d=bj(m(d,0),1);
bP.opacity=d
}bR.fill&&(bP.on=true);
if(bP.on==null||bR.fill=="none"){bP.on=false
}if(bP.on&&bR.fill){var e=bR.fill.match(h);
if(e){bP.src=e[1];
bP.type="tile"
}else{bP.color=aJ.getRGB(bR.fill).hex;
bP.src=aQ;
bP.type="solid";
if(aJ.getRGB(bR.fill).error&&(bW.type in {circle:1,ellipse:1}||bD(bR.fill).charAt()!="r")&&g(bW,bR.fill)){bS.fill="none";
bS.gradient=bR.fill
}}}bT&&bO[bl](bP);
var E=(bO.getElementsByTagName("stroke")&&bO.getElementsByTagName("stroke")[0]),bU=false;
!E&&(bU=E=az("stroke"));
if((bR.stroke&&bR.stroke!="none")||bR["stroke-width"]||bR["stroke-opacity"]!=null||bR["stroke-dasharray"]||bR["stroke-miterlimit"]||bR["stroke-linejoin"]||bR["stroke-linecap"]){E.on=true
}(bR.stroke=="none"||E.on==null||bR.stroke==0||bR["stroke-width"]==0)&&(E.on=false);
var bN=aJ.getRGB(bR.stroke);
E.on&&bR.stroke&&(E.color=bN.hex);
d=((+bS["stroke-opacity"]+1||2)-1)*((+bS.opacity+1||2)-1)*((+bN.o+1||2)-1);
var bL=(ak(bR["stroke-width"])||1)*0.75;
d=bj(m(d,0),1);
bR["stroke-width"]==null&&(bL=bS["stroke-width"]);
bR["stroke-width"]&&(E.weight=bL);
bL&&bL<1&&(d*=bL)&&(E.weight=1);
E.opacity=d;
bR["stroke-linejoin"]&&(E.joinstyle=bR["stroke-linejoin"]||"miter");
E.miterlimit=bR["stroke-miterlimit"]||8;
bR["stroke-linecap"]&&(E.endcap=bR["stroke-linecap"]=="butt"?"flat":bR["stroke-linecap"]=="square"?"square":"round");
if(bR["stroke-dasharray"]){var bM={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};
E.dashstyle=bM[ah](bR["stroke-dasharray"])?bM[bR["stroke-dasharray"]]:aQ
}bU&&bO[bl](E)
}if(bW.type=="text"){S=bW.paper.span.style;
bS.font&&(S.font=bS.font);
bS["font-family"]&&(S.fontFamily=bS["font-family"]);
bS["font-size"]&&(S.fontSize=bS["font-size"]);
bS["font-weight"]&&(S.fontWeight=bS["font-weight"]);
bS["font-style"]&&(S.fontStyle=bS["font-style"]);
bW.node.string&&(bW.paper.span.innerHTML=bD(bW.node.string)[bt](/</g,"&#60;")[bt](/&/g,"&#38;")[bt](/\n/g,"<br>"));
bW.W=bS.w=bW.paper.span.offsetWidth;
bW.H=bS.h=bW.paper.span.offsetHeight;
bW.X=bS.x;
bW.Y=bS.y+ae(bW.H/2);
switch(bS["text-anchor"]){case"start":bW.node.style["v-text-align"]="left";
bW.bbx=ae(bW.W/2);
break;
case"end":bW.node.style["v-text-align"]="right";
bW.bbx=-ae(bW.W/2);
break;
default:bW.node.style["v-text-align"]="center";
break
}}};
g=function(b,bI){b.attrs=b.attrs||{};
var bJ=b.attrs,bL,R="linear",S=".5 .5";
b.attrs.gradient=bI;
bI=bD(bI)[bt](aP,function(bN,bO,i){R="radial";
if(bO&&i){bO=ak(bO);
i=ak(i);
bm(bO-0.5,2)+bm(i-0.5,2)>0.25&&(i=ap.sqrt(0.25-bm(bO-0.5,2))*((i>0.5)*2-1)+0.5);
S=bO+aI+i
}return aQ
});
bI=bI[J](/\s*\-\s*/);
if(R=="linear"){var d=bI.shift();
d=-ak(d);
if(isNaN(d)){return null
}}var E=x(bI);
if(!E){return null
}b=b.shape||b.node;
bL=b.getElementsByTagName(a5)[0]||az(a5);
!bL.parentNode&&b.appendChild(bL);
if(E[s]){bL.on=true;
bL.method="none";
bL.color=E[0].color;
bL.color2=E[E[s]-1].color;
var bM=[];
for(var e=0,bK=E[s];
e<bK;
e++){E[e].offset&&bM[k](E[e].offset+aI+E[e].color)
}bL.colors&&(bL.colors.value=bM[s]?bM[aX]():"0% "+bL.color);
if(R=="radial"){bL.type="gradientradial";
bL.focus="100%";
bL.focussize=S;
bL.focusposition=S
}else{bL.type="gradient";
bL.angle=(270-d)%360
}}return 1
};
aV=function(E,S,b){var R=0,e=0,d=0,i=1;
this[0]=E;
this.id=aJ._oid++;
this.node=E;
E.raphael=this;
this.X=0;
this.Y=0;
this.attrs={};
this.Group=S;
this.paper=b;
this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1};
!b.bottom&&(b.bottom=this);
this.prev=b.top;
b.top&&(b.top.next=this);
b.top=this;
this.next=null
};
bd=aV[bF];
bd.rotate=function(d,b,e){if(this.removed){return this
}if(d==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy][aX](aI)
}return this._.rt.deg
}d=bD(d)[J](a);
if(d[s]-1){b=ak(d[1]);
e=ak(d[2])
}d=ak(d[0]);
if(b!=null){this._.rt.deg=d
}else{this._.rt.deg+=d
}e==null&&(b=null);
this._.rt.cx=b;
this._.rt.cy=e;
this.setBox(this.attrs,b,e);
this.Group.style.rotation=this._.rt.deg;
return this
};
bd.setBox=function(E,R,e){if(this.removed){return this
}var b=this.Group.style,S=(this.shape&&this.shape.style)||this.node.style;
E=E||{};
for(var bI in E){if(E[ah](bI)){this.attrs[bI]=E[bI]
}}R=R||this._.rt.cx;
e=e||this._.rt.cy;
var bL=this.attrs,bO,bN,bP,bK;
switch(this.type){case"circle":bO=bL.cx-bL.r;
bN=bL.cy-bL.r;
bP=bK=bL.r*2;
break;
case"ellipse":bO=bL.cx-bL.rx;
bN=bL.cy-bL.ry;
bP=bL.rx*2;
bK=bL.ry*2;
break;
case"image":bO=+bL.x;
bN=+bL.y;
bP=bL.width||0;
bK=bL.height||0;
break;
case"text":this.textpath.v=["m",ae(bL.x),", ",ae(bL.y-2),"l",ae(bL.x)+1,", ",ae(bL.y-2)][aX](aQ);
bO=bL.x-ae(this.W/2);
bN=bL.y-this.H/2;
bP=this.W;
bK=this.H;
break;
case"rect":case"path":if(!this.attrs.path){bO=0;
bN=0;
bP=this.paper.width;
bK=this.paper.height
}else{var bJ=aj(this.attrs.path);
bO=bJ.x;
bN=bJ.y;
bP=bJ.width;
bK=bJ.height
}break;
default:bO=0;
bN=0;
bP=this.paper.width;
bK=this.paper.height;
break
}R=(R==null)?bO+bP/2:R;
e=(e==null)?bN+bK/2:e;
var d=R-this.paper.width/2,bM=e-this.paper.height/2,bQ;
b.left!=(bQ=d+"px")&&(b.left=bQ);
b.top!=(bQ=bM+"px")&&(b.top=bQ);
this.X=u[ah](this.type)?-d:bO;
this.Y=u[ah](this.type)?-bM:bN;
this.W=bP;
this.H=bK;
if(u[ah](this.type)){S.left!=(bQ=-d*v+"px")&&(S.left=bQ);
S.top!=(bQ=-bM*v+"px")&&(S.top=bQ)
}else{if(this.type=="text"){S.left!=(bQ=-d+"px")&&(S.left=bQ);
S.top!=(bQ=-bM+"px")&&(S.top=bQ)
}else{b.width!=(bQ=this.paper.width+"px")&&(b.width=bQ);
b.height!=(bQ=this.paper.height+"px")&&(b.height=bQ);
S.left!=(bQ=bO-d+"px")&&(S.left=bQ);
S.top!=(bQ=bN-bM+"px")&&(S.top=bQ);
S.width!=(bQ=bP+"px")&&(S.width=bQ);
S.height!=(bQ=bK+"px")&&(S.height=bQ)
}}};
bd.hide=function(){!this.removed&&(this.Group.style.display="none");
return this
};
bd.show=function(){!this.removed&&(this.Group.style.display="block");
return this
};
bd.getBBox=function(){if(this.removed){return this
}if(u[ah](this.type)){return aj(this.attrs.path)
}return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}
};
bd.remove=function(){if(this.removed){return
}aF(this,this.paper);
this.node.parentNode.removeChild(this.node);
this.Group.parentNode.removeChild(this.Group);
this.shape&&this.shape.parentNode.removeChild(this.shape);
for(var b in this){delete this[b]
}this.removed=true
};
bd.attr=function(b,bI){if(this.removed){return this
}if(b==null){var S={};
for(var E in this.attrs){if(this.attrs[ah](E)){S[E]=this.attrs[E]
}}this._.rt.deg&&(S.rotation=this.rotate());
(this._.sx!=1||this._.sy!=1)&&(S.scale=this.scale());
S.gradient&&S.fill=="none"&&(S.fill=S.gradient)&&delete S.gradient;
return S
}if(bI==null&&aJ.is(b,"string")){if(b=="translation"){return B.call(this)
}if(b=="rotation"){return this.rotate()
}if(b=="scale"){return this.scale()
}if(b==a5&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient
}return this.attrs[b]
}if(this.attrs&&bI==null&&aJ.is(b,a8)){var bL,bK={};
for(E=0,bL=b[s];
E<bL;
E++){bK[b[E]]=this.attr(b[E])
}return bK
}var d;
if(bI!=null){d={};
d[b]=bI
}bI==null&&aJ.is(b,"object")&&(d=b);
if(d){for(var bJ in this.paper.customAttributes){if(this.paper.customAttributes[ah](bJ)&&d[ah](bJ)&&aJ.is(this.paper.customAttributes[bJ],"function")){var R=this.paper.customAttributes[bJ].apply(this,[][bx](d[bJ]));
this.attrs[bJ]=d[bJ];
for(var e in R){if(R[ah](e)){d[e]=R[e]
}}}}if(d.text&&this.type=="text"){this.node.string=d.text
}ao(this,d);
if(d.gradient&&(({circle:1,ellipse:1})[ah](this.type)||bD(d.gradient).charAt()!="r")){g(this,d.gradient)
}(!u[ah](this.type)||this._.rt.deg)&&this.setBox(this.attrs)
}return this
};
bd.toFront=function(){!this.removed&&this.Group.parentNode[bl](this.Group);
this.paper.top!=this&&am(this,this.paper);
return this
};
bd.toBack=function(){if(this.removed){return this
}if(this.Group.parentNode.firstChild!=this.Group){this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild);
p(this,this.paper)
}return this
};
bd.insertAfter=function(b){if(this.removed){return this
}if(b.constructor==ai){b=b[b.length-1]
}if(b.Group.nextSibling){b.Group.parentNode.insertBefore(this.Group,b.Group.nextSibling)
}else{b.Group.parentNode[bl](this.Group)
}K(this,b,this.paper);
return this
};
bd.insertBefore=function(b){if(this.removed){return this
}if(b.constructor==ai){b=b[0]
}b.Group.parentNode.insertBefore(this.Group,b.Group);
aM(this,b,this.paper);
return this
};
bd.blur=function(b){var d=this.node.runtimeStyle,e=d.filter;
e=e.replace(by,aQ);
if(+b!==0){this.attrs.blur=b;
d.filter=e+aI+a6+".Blur(pixelradius="+(+b||1.5)+")";
d.margin=aJ.format("-{0}px 0 0 -{0}px",ae(+b||1.5))
}else{d.filter=e;
d.margin=0;
delete this.attrs.blur
}};
af=function(d,b,bI,R){var E=az("group"),S=az("oval"),e=S.style;
E.style.cssText="position:absolute;left:0;top:0;width:"+d.width+"px;height:"+d.height+"px";
E.coordsize=aY;
E.coordorigin=d.coordorigin;
E[bl](S);
var i=new aV(S,E,d);
i.type="circle";
ao(i,{stroke:"#000",fill:"none"});
i.attrs.cx=b;
i.attrs.cy=bI;
i.attrs.r=R;
i.setBox({x:b-R,y:bI-R,width:R*2,height:R*2});
d.canvas[bl](E);
return i
};
function au(b,E,d,e,i){if(i){return aJ.format("M{0},{1}l{2},0a{3},{3},0,0,1,{3},{3}l0,{5}a{3},{3},0,0,1,{4},{3}l{6},0a{3},{3},0,0,1,{4},{4}l0,{7}a{3},{3},0,0,1,{3},{4}z",b+i,E,d-i*2,i,-i,e-i*2,i*2-d,i*2-e)
}else{return aJ.format("M{0},{1}l{2},0,0,{3},{4},0z",b,E,d,e,-d)
}}bc=function(d,S,E,bI,e,b){var bJ=au(S,E,bI,e,b),i=d.path(bJ),R=i.attrs;
i.X=R.x=S;
i.Y=R.y=E;
i.W=R.width=bI;
i.H=R.height=e;
R.r=b;
R.path=bJ;
i.type="rect";
return i
};
aA=function(b,bJ,bI,e,d){var E=az("group"),i=az("oval"),S=i.style;
E.style.cssText="position:absolute;left:0;top:0;width:"+b.width+"px;height:"+b.height+"px";
E.coordsize=aY;
E.coordorigin=b.coordorigin;
E[bl](i);
var R=new aV(i,E,b);
R.type="ellipse";
ao(R,{stroke:"#000"});
R.attrs.cx=bJ;
R.attrs.cy=bI;
R.attrs.rx=e;
R.attrs.ry=d;
R.setBox({x:bJ-e,y:bI-d,width:e*2,height:d*2});
b.canvas[bl](E);
return R
};
w=function(d,b,bI,S,bJ,i){var E=az("group"),e=az("image");
E.style.cssText="position:absolute;left:0;top:0;width:"+d.width+"px;height:"+d.height+"px";
E.coordsize=aY;
E.coordorigin=d.coordorigin;
e.src=b;
E[bl](e);
var R=new aV(e,E,d);
R.type="image";
R.attrs.src=b;
R.attrs.x=bI;
R.attrs.y=S;
R.attrs.w=bJ;
R.attrs.h=i;
R.setBox({x:bI,y:S,width:bJ,height:i});
d.canvas[bl](E);
return R
};
al=function(d,bJ,bI,bK){var E=az("group"),i=az("shape"),S=i.style,bL=az("path"),b=bL.style,e=az("textpath");
E.style.cssText="position:absolute;left:0;top:0;width:"+d.width+"px;height:"+d.height+"px";
E.coordsize=aY;
E.coordorigin=d.coordorigin;
bL.v=aJ.format("m{0},{1}l{2},{1}",ae(bJ*10),ae(bI*10),ae(bJ*10)+1);
bL.textpathok=true;
S.width=d.width;
S.height=d.height;
e.string=bD(bK);
e.on=true;
i[bl](e);
i[bl](bL);
E[bl](i);
var R=new aV(e,E,d);
R.shape=i;
R.textpath=bL;
R.type="text";
R.attrs.text=bK;
R.attrs.x=bJ;
R.attrs.y=bI;
R.attrs.w=1;
R.attrs.h=1;
ao(R,{font:q.font,stroke:"none",fill:"#000"});
R.setBox();
d.canvas[bl](E);
return R
};
bB=function(e,b){var d=this.canvas.style;
e==+e&&(e+="px");
b==+b&&(b+="px");
d.width=e;
d.height=b;
d.clip="rect(0 "+e+" "+b+" 0)";
return this
};
var az;
ab.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");
try{!ab.namespaces.rvml&&ab.namespaces.add("rvml","urn:schemas-microsoft-com:vml");
az=function(b){return ab.createElement("<rvml:"+b+' class="rvml">')
}
}catch(ax){az=function(b){return ab.createElement("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')
}
}G=function(){var e=aK[bC](0,arguments),b=e.container,bJ=e.height,bK,d=e.width,bI=e.x,S=e.y;
if(!b){throw new Error("VML container not found.")
}var E=new bA,R=E.canvas=ab.createElement("div"),i=R.style;
bI=bI||0;
S=S||0;
d=d||512;
bJ=bJ||342;
d==+d&&(d+="px");
bJ==+bJ&&(bJ+="px");
E.width=1000;
E.height=1000;
E.coordsize=v*1000+aI+v*1000;
E.coordorigin="0 0";
E.span=ab.createElement("span");
E.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";
R[bl](E.span);
i.cssText=aJ.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",d,bJ);
if(b==1){ab.body[bl](R);
i.left=bI+"px";
i.top=S+"px";
i.position="absolute"
}else{if(b.firstChild){b.insertBefore(R,b.firstChild)
}else{b[bl](R)
}}bf.call(E,E,aJ.fn);
return E
};
a0.clear=function(){this.canvas.innerHTML=aQ;
this.span=ab.createElement("span");
this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";
this.canvas[bl](this.span);
this.bottom=this.top=null
};
a0.remove=function(){this.canvas.parentNode.removeChild(this.canvas);
for(var b in this){this[b]=A(b)
}return true
}
}var V=navigator.userAgent.match(/Version\/(.*?)\s/);
if((navigator.vendor=="Apple Computer, Inc.")&&(V&&V[1]<4||navigator.platform.slice(0,2)=="iP")){a0.safari=function(){var b=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});
aR.setTimeout(function(){b.remove()
})
}
}else{a0.safari=function(){}
}var P=function(){this.returnValue=false
},bw=function(){return this.originalEvent.preventDefault()
},a4=function(){this.cancelBubble=true
},aE=function(){return this.originalEvent.stopPropagation()
},aw=(function(){if(ab.addEventListener){return function(R,i,e,d){var b=X&&br[i]?br[i]:i;
var E=function(bK){if(X&&br[ah](i)){for(var bI=0,bJ=bK.targetTouches&&bK.targetTouches.length;
bI<bJ;
bI++){if(bK.targetTouches[bI].target==R){var S=bK;
bK=bK.targetTouches[bI];
bK.originalEvent=S;
bK.preventDefault=bw;
bK.stopPropagation=aE;
break
}}}return e.call(d,bK)
};
R.addEventListener(b,E,false);
return function(){R.removeEventListener(b,E,false);
return true
}
}
}else{if(ab.attachEvent){return function(R,i,e,d){var E=function(S){S=S||aR.event;
S.preventDefault=S.preventDefault||P;
S.stopPropagation=S.stopPropagation||a4;
return e.call(d,S)
};
R.attachEvent("on"+i,E);
var b=function(){R.detachEvent("on"+i,E);
return true
};
return b
}
}}})(),a9=[],bs=function(S){var bJ=S.clientX,bI=S.clientY,bK=ab.documentElement.scrollTop||ab.body.scrollTop,bL=ab.documentElement.scrollLeft||ab.body.scrollLeft,b,d=a9.length;
while(d--){b=a9[d];
if(X){var R=S.touches.length,E;
while(R--){E=S.touches[R];
if(E.identifier==b.el._drag.id){bJ=E.clientX;
bI=E.clientY;
(S.originalEvent?S.originalEvent:S).preventDefault();
break
}}}else{S.preventDefault()
}bJ+=bL;
bI+=bK;
b.move&&b.move.call(b.move_scope||b.el,bJ-b.el._drag.x,bI-b.el._drag.y,bJ,bI,S)
}},f=function(E){aJ.unmousemove(bs).unmouseup(f);
var d=a9.length,b;
while(d--){b=a9[d];
b.el._drag={};
b.end&&b.end.call(b.end_scope||b.start_scope||b.move_scope||b.el,E)
}a9=[]
};
for(var at=T[s];
at--;
){(function(b){aJ[b]=aV[bF][b]=function(e,d){if(aJ.is(e,"function")){this.events=this.events||[];
this.events.push({name:b,f:e,unbind:aw(this.shape||this.node||ab,b,e,d||this)})
}return this
};
aJ["un"+b]=aV[bF]["un"+b]=function(i){var e=this.events,d=e[s];
while(d--){if(e[d].name==b&&e[d].f==i){e[d].unbind();
e.splice(d,1);
!e.length&&delete this.events;
return this
}}return this
}
})(T[at])
}bd.hover=function(i,b,e,d){return this.mouseover(i,e).mouseout(b,d||e)
};
bd.unhover=function(d,b){return this.unmouseover(d).unmouseout(b)
};
bd.drag=function(d,R,E,b,e,i){this._drag={};
this.mousedown(function(bI){(bI.originalEvent||bI).preventDefault();
var S=ab.documentElement.scrollTop||ab.body.scrollTop,bJ=ab.documentElement.scrollLeft||ab.body.scrollLeft;
this._drag.x=bI.clientX+bJ;
this._drag.y=bI.clientY+S;
this._drag.id=bI.identifier;
R&&R.call(e||b||this,bI.clientX+bJ,bI.clientY+S,bI);
!a9.length&&aJ.mousemove(bs).mouseup(f);
a9.push({el:this,move:d,end:E,move_scope:b,start_scope:e,end_scope:i})
});
return this
};
bd.undrag=function(b,E,e){var d=a9.length;
while(d--){a9[d].el==this&&(a9[d].move==b&&a9[d].end==e)&&a9.splice(d++,1)
}!a9.length&&aJ.unmousemove(bs).unmouseup(f)
};
a0.circle=function(b,e,d){return af(this,b||0,e||0,d||0)
};
a0.rect=function(b,E,d,e,i){return bc(this,b||0,E||0,d||0,e||0,i||0)
};
a0.ellipse=function(b,i,e,d){return aA(this,b||0,i||0,e||0,d||0)
};
a0.path=function(b){b&&!aJ.is(b,ag)&&!aJ.is(b[0],a8)&&(b+=aQ);
return y(aJ.format[bC](aJ,arguments),this)
};
a0.image=function(i,b,E,d,e){return w(this,i||"about:blank",b||0,E||0,d||0,e||0)
};
a0.text=function(b,e,d){return al(this,b||0,e||0,bD(d))
};
a0.set=function(b){arguments[s]>1&&(b=Array[bF].splice.call(arguments,0,arguments[s]));
return new ai(b)
};
a0.setSize=bB;
a0.top=a0.bottom=null;
a0.raphael=aJ;
function D(){return this.x+aI+this.y
}bd.resetScale=function(){if(this.removed){return this
}this._.sx=1;
this._.sy=1;
this.attrs.scale="1 1"
};
bd.scale=function(b0,bZ,bR,bP){if(this.removed){return this
}if(b0==null&&bZ==null){return{x:this._.sx,y:this._.sy,toString:D}
}bZ=bZ||b0;
!+bZ&&(bZ=b0);
var d,b,b8,b7,cb=this.attrs;
if(b0!=0){var cc=this.getBBox(),E=cc.x+cc.width/2,e=cc.y+cc.height/2,b5=ar(b0/this._.sx),b4=ar(bZ/this._.sy);
bR=(+bR||bR==0)?bR:E;
bP=(+bP||bP==0)?bP:e;
var bK=this._.sx>0,bJ=this._.sy>0,bQ=~~(b0/ar(b0)),bO=~~(bZ/ar(bZ)),S=b5*bQ,R=b4*bO,b1=this.node.style,bY=bR+ar(E-bR)*S*(E>bR==bK?1:-1),bX=bP+ar(e-bP)*R*(e>bP==bJ?1:-1),bU=(b0*bQ>bZ*bO?b4:b5);
switch(this.type){case"rect":case"image":var bM=cb.width*b5,bV=cb.height*b4;
this.attr({height:bV,r:cb.r*bU,width:bM,x:bY-bM/2,y:bX-bV/2});
break;
case"circle":case"ellipse":this.attr({rx:cb.rx*b5,ry:cb.ry*b4,r:cb.r*bU,cx:bY,cy:bX});
break;
case"text":this.attr({x:bY,y:bX});
break;
case"path":var b3=av(cb.path),bL=true,bT=bK?S:b5,bS=bJ?R:b4;
for(var ca=0,bW=b3[s];
ca<bW;
ca++){var b6=b3[ca],bN=bp.call(b6[0]);
if(bN=="M"&&bL){continue
}else{bL=false
}if(bN=="A"){b6[b3[ca][s]-2]*=bT;
b6[b3[ca][s]-1]*=bS;
b6[1]*=b5;
b6[2]*=b4;
b6[5]=+(bQ+bO?!!+b6[5]:!+b6[5])
}else{if(bN=="H"){for(var b9=1,bI=b6[s];
b9<bI;
b9++){b6[b9]*=bT
}}else{if(bN=="V"){for(b9=1,bI=b6[s];
b9<bI;
b9++){b6[b9]*=bS
}}else{for(b9=1,bI=b6[s];
b9<bI;
b9++){b6[b9]*=(b9%2)?bT:bS
}}}}}var b2=aj(b3);
d=bY-b2.x-b2.width/2;
b=bX-b2.y-b2.height/2;
b3[0][1]+=d;
b3[0][2]+=b;
this.attr({path:b3});
break
}if(this.type in {text:1,image:1}&&(bQ!=1||bO!=1)){if(this.transformations){this.transformations[2]="scale("[bx](bQ,",",bO,")");
this.node[F]("transform",this.transformations[aX](aI));
d=(bQ==-1)?-cb.x-(bM||0):cb.x;
b=(bO==-1)?-cb.y-(bV||0):cb.y;
this.attr({x:d,y:b});
cb.fx=bQ-1;
cb.fy=bO-1
}else{this.node.filterMatrix=a6+".Matrix(M11="[bx](bQ,", M12=0, M21=0, M22=",bO,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')");
b1.filter=(this.node.filterMatrix||aQ)+(this.node.filterOpacity||aQ)
}}else{if(this.transformations){this.transformations[2]=aQ;
this.node[F]("transform",this.transformations[aX](aI));
cb.fx=0;
cb.fy=0
}else{this.node.filterMatrix=aQ;
b1.filter=(this.node.filterMatrix||aQ)+(this.node.filterOpacity||aQ)
}}cb.scale=[b0,bZ,bR,bP][aX](aI);
this._.sx=b0;
this._.sy=bZ
}return this
};
bd.clone=function(){if(this.removed){return null
}var b=this.attr();
delete b.scale;
delete b.translation;
return this.paper[this.type]().attr(b)
};
var a3={},l=function(R,d,bK,bJ,bS,bR,bQ,bO,S){var bN=0,bM=100,E=[R,d,bK,bJ,bS,bR,bQ,bO].join(),b=a3[E],bI,e;
!b&&(a3[E]=b={data:[]});
b.timer&&clearTimeout(b.timer);
b.timer=setTimeout(function(){delete a3[E]
},2000);
if(S!=null){var bP=l(R,d,bK,bJ,bS,bR,bQ,bO);
bM=~~bP*10
}for(var bL=0;
bL<bM+1;
bL++){if(b.data[S]>bL){e=b.data[bL*bM]
}else{e=aJ.findDotsAtSegment(R,d,bK,bJ,bS,bR,bQ,bO,bL/bM);
b.data[bL]=e
}bL&&(bN+=bm(bm(bI.x-e.x,2)+bm(bI.y-e.y,2),0.5));
if(S!=null&&bN>=S){return e
}bI=e
}if(S==null){return bN
}},a2=function(b,d){return function(bQ,R,S){bQ=W(bQ);
var bM,bL,e,bI,E="",bP={},bN,bK=0;
for(var bJ=0,bO=bQ.length;
bJ<bO;
bJ++){e=bQ[bJ];
if(e[0]=="M"){bM=+e[1];
bL=+e[2]
}else{bI=l(bM,bL,e[1],e[2],e[3],e[4],e[5],e[6]);
if(bK+bI>R){if(d&&!bP.start){bN=l(bM,bL,e[1],e[2],e[3],e[4],e[5],e[6],R-bK);
E+=["C",bN.start.x,bN.start.y,bN.m.x,bN.m.y,bN.x,bN.y];
if(S){return E
}bP.start=E;
E=["M",bN.x,bN.y+"C",bN.n.x,bN.n.y,bN.end.x,bN.end.y,e[5],e[6]][aX]();
bK+=bI;
bM=+e[5];
bL=+e[6];
continue
}if(!b&&!d){bN=l(bM,bL,e[1],e[2],e[3],e[4],e[5],e[6],R-bK);
return{x:bN.x,y:bN.y,alpha:bN.alpha}
}}bK+=bI;
bM=+e[5];
bL=+e[6]
}E+=e
}bP.end=E;
bN=b?bK:d?bP:aJ.findDotsAtSegment(bM,bL,e[1],e[2],e[3],e[4],e[5],e[6],1);
bN.alpha&&(bN={x:bN.x,y:bN.y,alpha:bN.alpha});
return bN
}
};
var aL=a2(1),M=a2(),Z=a2(0,1);
bd.getTotalLength=function(){if(this.type!="path"){return
}if(this.node.getTotalLength){return this.node.getTotalLength()
}return aL(this.attrs.path)
};
bd.getPointAtLength=function(b){if(this.type!="path"){return
}return M(this.attrs.path,b)
};
bd.getSubpath=function(e,d){if(this.type!="path"){return
}if(ar(this.getTotalLength()-d)<"1e-6"){return Z(this.attrs.path,e).end
}var b=Z(this.attrs.path,d,1);
return e?Z(b,e).end:b
};
aJ.easing_formulas={linear:function(b){return b
},"<":function(b){return bm(b,3)
},">":function(b){return bm(b-1,3)+1
},"<>":function(b){b=b*2;
if(b<1){return bm(b,3)/2
}b-=2;
return(bm(b,3)+2)/2
},backIn:function(d){var b=1.70158;
return d*d*((b+1)*d-b)
},backOut:function(d){d=d-1;
var b=1.70158;
return d*d*((b+1)*d+b)+1
},elastic:function(e){if(e==0||e==1){return e
}var d=0.3,b=d/4;
return bm(2,-10*e)*ap.sin((e-b)*(2*aN)/d)+1
},bounce:function(i){var d=7.5625,e=2.75,b;
if(i<(1/e)){b=d*i*i
}else{if(i<(2/e)){i-=(1.5/e);
b=d*i*i+0.75
}else{if(i<(2.5/e)){i-=(2.25/e);
b=d*i*i+0.9375
}else{i-=(2.625/e);
b=d*i*i+0.984375
}}}return b
}};
var Y=[],bv=function(){var bJ=+new Date;
for(var bU=0;
bU<Y[s];
bU++){var bZ=Y[bU];
if(bZ.stop||bZ.el.removed){continue
}var R=bJ-bZ.start,bR=bZ.ms,bQ=bZ.easing,bV=bZ.from,bO=bZ.diff,d=bZ.to,bN=bZ.t,bI=bZ.el,bP={},b;
if(R<bR){var E=bQ(R/bR);
for(var bS in bV){if(bV[ah](bS)){switch(an[bS]){case"along":b=E*bR*bO[bS];
d.back&&(b=d.len-b);
var bT=M(d[bS],b);
bI.translate(bO.sx-bO.x||0,bO.sy-bO.y||0);
bO.x=bT.x;
bO.y=bT.y;
bI.translate(bT.x-bO.sx,bT.y-bO.sy);
d.rot&&bI.rotate(bO.r+bT.alpha,bT.x,bT.y);
break;
case aG:b=+bV[bS]+E*bR*bO[bS];
break;
case"colour":b="rgb("+[L(ae(bV[bS].r+E*bR*bO[bS].r)),L(ae(bV[bS].g+E*bR*bO[bS].g)),L(ae(bV[bS].b+E*bR*bO[bS].b))][aX](",")+")";
break;
case"path":b=[];
for(var bX=0,bM=bV[bS][s];
bX<bM;
bX++){b[bX]=[bV[bS][bX][0]];
for(var bW=1,bY=bV[bS][bX][s];
bW<bY;
bW++){b[bX][bW]=+bV[bS][bX][bW]+E*bR*bO[bS][bX][bW]
}b[bX]=b[bX][aX](aI)
}b=b[aX](aI);
break;
case"csv":switch(bS){case"translation":var bL=E*bR*bO[bS][0]-bN.x,bK=E*bR*bO[bS][1]-bN.y;
bN.x+=bL;
bN.y+=bK;
b=bL+aI+bK;
break;
case"rotation":b=+bV[bS][0]+E*bR*bO[bS][0];
bV[bS][1]&&(b+=","+bV[bS][1]+","+bV[bS][2]);
break;
case"scale":b=[+bV[bS][0]+E*bR*bO[bS][0],+bV[bS][1]+E*bR*bO[bS][1],(2 in d[bS]?d[bS][2]:aQ),(3 in d[bS]?d[bS][3]:aQ)][aX](aI);
break;
case"clip-rect":b=[];
bX=4;
while(bX--){b[bX]=+bV[bS][bX]+E*bR*bO[bS][bX]
}break
}break;
default:var S=[].concat(bV[bS]);
b=[];
bX=bI.paper.customAttributes[bS].length;
while(bX--){b[bX]=+S[bX]+E*bR*bO[bS][bX]
}break
}bP[bS]=b
}}bI.attr(bP);
bI._run&&bI._run.call(bI)
}else{if(d.along){bT=M(d.along,d.len*!d.back);
bI.translate(bO.sx-(bO.x||0)+bT.x-bO.sx,bO.sy-(bO.y||0)+bT.y-bO.sy);
d.rot&&bI.rotate(bO.r+bT.alpha,bT.x,bT.y)
}(bN.x||bN.y)&&bI.translate(-bN.x,-bN.y);
d.scale&&(d.scale+=aQ);
bI.attr(d);
Y.splice(bU--,1)
}}aJ.svg&&bI&&bI.paper&&bI.paper.safari();
Y[s]&&setTimeout(bv)
},bz=function(b,e,R,E,i){var d=R-E;
e.timeouts.push(setTimeout(function(){aJ.is(i,"function")&&i.call(e);
e.animate(b,d,b.easing)
},E))
},L=function(b){return m(bj(b,255),0)
},B=function(b,e){if(b==null){return{x:this._.tx,y:this._.ty,toString:D}
}this._.tx+=+b;
this._.ty+=+e;
switch(this.type){case"circle":case"ellipse":this.attr({cx:+b+this.attrs.cx,cy:+e+this.attrs.cy});
break;
case"rect":case"image":case"text":this.attr({x:+b+this.attrs.x,y:+e+this.attrs.y});
break;
case"path":var d=av(this.attrs.path);
d[0][1]+=+b;
d[0][2]+=+e;
this.attr({path:d});
break
}return this
};
bd.animateWith=function(e,R,b,bI,S){for(var d=0,E=Y.length;
d<E;
d++){if(Y[d].el.id==e.id){R.start=Y[d].start
}}return this.animate(R,b,bI,S)
};
bd.animateAlong=aW();
bd.animateAlongBack=aW(1);
function aW(b){return function(i,e,d,R){var E={back:b};
aJ.is(d,"function")?(R=d):(E.rot=d);
i&&i.constructor==aV&&(i=i.attrs.path);
i&&(E.along=i);
return this.animate(E,e,R)
}
}function aZ(bO,i,d,bN,bM,bI){var bJ=3*i,bL=3*(bN-i)-bJ,b=1-bJ-bL,S=3*d,bK=3*(bM-d)-S,bP=1-S-bK;
function R(bQ){return((b*bQ+bL)*bQ+bJ)*bQ
}function e(bQ,bS){var bR=E(bQ,bS);
return((bP*bR+bK)*bR+S)*bR
}function E(bQ,bX){var bW,bV,bT,bR,bU,bS;
for(bT=bQ,bS=0;
bS<8;
bS++){bR=R(bT)-bQ;
if(ar(bR)<bX){return bT
}bU=(3*b*bT+2*bL)*bT+bJ;
if(ar(bU)<0.000001){break
}bT=bT-bR/bU
}bW=0;
bV=1;
bT=bQ;
if(bT<bW){return bW
}if(bT>bV){return bV
}while(bW<bV){bR=R(bT);
if(ar(bR-bQ)<bX){return bT
}if(bQ>bR){bW=bT
}else{bV=bT
}bT=(bV-bW)/2+bW
}return bT
}return e(bO,1/(200*bI))
}bd.onAnimation=function(b){this._run=b||0;
return this
};
bd.animate=function(b1,bR,bQ,R){var d=this;
d.timeouts=d.timeouts||[];
if(aJ.is(bQ,"function")||!bQ){R=bQ||null
}if(d.removed){R&&R.call(d);
return d
}var bV={},e={},S=false,bM={};
for(var bS in b1){if(b1[ah](bS)){if(an[ah](bS)||d.paper.customAttributes[ah](bS)){S=true;
bV[bS]=d.attr(bS);
(bV[bS]==null)&&(bV[bS]=q[bS]);
e[bS]=b1[bS];
switch(an[bS]){case"along":var bZ=aL(b1[bS]);
var bT=M(b1[bS],bZ*!!b1.back);
var bI=d.getBBox();
bM[bS]=bZ/bR;
bM.tx=bI.x;
bM.ty=bI.y;
bM.sx=bT.x;
bM.sy=bT.y;
e.rot=b1.rot;
e.back=b1.back;
e.len=bZ;
b1.rot&&(bM.r=ak(d.rotate())||0);
break;
case aG:bM[bS]=(e[bS]-bV[bS])/bR;
break;
case"colour":bV[bS]=aJ.getRGB(bV[bS]);
var bU=aJ.getRGB(e[bS]);
bM[bS]={r:(bU.r-bV[bS].r)/bR,g:(bU.g-bV[bS].g)/bR,b:(bU.b-bV[bS].b)/bR};
break;
case"path":var bJ=W(bV[bS],e[bS]);
bV[bS]=bJ[0];
var bO=bJ[1];
bM[bS]=[];
for(var bY=0,bL=bV[bS][s];
bY<bL;
bY++){bM[bS][bY]=[0];
for(var bX=1,b0=bV[bS][bY][s];
bX<b0;
bX++){bM[bS][bY][bX]=(bO[bY][bX]-bV[bS][bY][bX])/bR
}}break;
case"csv":var b=bD(b1[bS])[J](a),bK=bD(bV[bS])[J](a);
switch(bS){case"translation":bV[bS]=[0,0];
bM[bS]=[b[0]/bR,b[1]/bR];
break;
case"rotation":bV[bS]=(bK[1]==b[1]&&bK[2]==b[2])?bK:[0,b[1],b[2]];
bM[bS]=[(b[0]-bV[bS][0])/bR,0,0];
break;
case"scale":b1[bS]=b;
bV[bS]=bD(bV[bS])[J](a);
bM[bS]=[(b[0]-bV[bS][0])/bR,(b[1]-bV[bS][1])/bR,0,0];
break;
case"clip-rect":bV[bS]=bD(bV[bS])[J](a);
bM[bS]=[];
bY=4;
while(bY--){bM[bS][bY]=(b[bY]-bV[bS][bY])/bR
}break
}e[bS]=b;
break;
default:b=[].concat(b1[bS]);
bK=[].concat(bV[bS]);
bM[bS]=[];
bY=d.paper.customAttributes[bS][s];
while(bY--){bM[bS][bY]=((b[bY]||0)-(bK[bY]||0))/bR
}break
}}}}if(!S){var bP=[],E;
for(var b2 in b1){if(b1[ah](b2)&&bg.test(b2)){bS={value:b1[b2]};
b2=="from"&&(b2=0);
b2=="to"&&(b2=100);
bS.key=U(b2,10);
bP.push(bS)
}}bP.sort(bn);
if(bP[0].key){bP.unshift({key:0,value:d.attrs})
}for(bY=0,bL=bP[s];
bY<bL;
bY++){bz(bP[bY].value,d,bR/100*bP[bY].key,bR/100*(bP[bY-1]&&bP[bY-1].key||0),bP[bY-1]&&bP[bY-1].value.callback)
}E=bP[bP[s]-1].value.callback;
if(E){d.timeouts.push(setTimeout(function(){E.call(d)
},bR))
}}else{var bW=aJ.easing_formulas[bQ];
if(!bW){bW=bD(bQ).match(c);
if(bW&&bW[s]==5){var bN=bW;
bW=function(i){return aZ(i,+bN[1],+bN[2],+bN[3],+bN[4],bR)
}
}else{bW=function(i){return i
}
}}Y.push({start:b1.start||+new Date,ms:bR,easing:bW,from:bV,diff:bM,to:e,el:d,t:{x:0,y:0}});
aJ.is(R,"function")&&(d._ac=setTimeout(function(){R.call(d)
},bR));
Y[s]==1&&setTimeout(bv)
}return this
};
bd.stop=function(){for(var b=0;
b<Y.length;
b++){Y[b].el.id==this.id&&Y.splice(b--,1)
}for(b=0,ii=this.timeouts&&this.timeouts.length;
b<ii;
b++){clearTimeout(this.timeouts[b])
}this.timeouts=[];
clearTimeout(this._ac);
delete this._ac;
return this
};
bd.translate=function(b,d){return this.attr({translation:b+" "+d})
};
bd[a1]=function(){return"Rapha\xebl\u2019s object"
};
aJ.ae=Y;
var ai=function(b){this.items=[];
this[s]=0;
this.type="set";
if(b){for(var d=0,e=b[s];
d<e;
d++){if(b[d]&&(b[d].constructor==aV||b[d].constructor==ai)){this[this.items[s]]=this.items[this.items[s]]=b[d];
this[s]++
}}}};
ai[bF][k]=function(){var E,b;
for(var d=0,e=arguments[s];
d<e;
d++){E=arguments[d];
if(E&&(E.constructor==aV||E.constructor==ai)){b=this.items[s];
this[b]=this.items[b]=E;
this[s]++
}}return this
};
ai[bF].pop=function(){delete this[this[s]--];
return this.items.pop()
};
for(var I in bd){if(bd[ah](I)){ai[bF][I]=(function(b){return function(){for(var d=0,e=this.items[s];
d<e;
d++){this.items[d][b][bC](this.items[d],arguments)
}return this
}
})(I)
}}ai[bF].attr=function(d,S){if(d&&aJ.is(d,a8)&&aJ.is(d[0],"object")){for(var b=0,R=d[s];
b<R;
b++){this.items[b].attr(d[b])
}}else{for(var e=0,E=this.items[s];
e<E;
e++){this.items[e].attr(d,S)
}}return this
};
ai[bF].animate=function(d,b,S,bJ){(aJ.is(S,"function")||!S)&&(bJ=S||null);
var R=this.items[s],e=R,bK,bI=this,E;
bJ&&(E=function(){!--R&&bJ.call(bI)
});
S=aJ.is(S,ag)?S:E;
bK=this.items[--e].animate(d,b,S,E);
while(e--){this.items[e]&&!this.items[e].removed&&this.items[e].animateWith(bK,d,b,S,E)
}return this
};
ai[bF].insertAfter=function(d){var b=this.items[s];
while(b--){this.items[b].insertAfter(d)
}return this
};
ai[bF].getBBox=function(){var b=[],S=[],d=[],E=[];
for(var e=this.items[s];
e--;
){var R=this.items[e].getBBox();
b[k](R.x);
S[k](R.y);
d[k](R.x+R.width);
E[k](R.y+R.height)
}b=bj[bC](0,b);
S=bj[bC](0,S);
return{x:b,y:S,width:m[bC](0,d)-b,height:m[bC](0,E)-S}
};
ai[bF].clone=function(e){e=new ai;
for(var b=0,d=this.items[s];
b<d;
b++){e[k](this.items[b].clone())
}return e
};
aJ.registerFont=function(d){if(!d.face){return d
}this.fonts=this.fonts||{};
var i={w:d.w,face:{},glyphs:{}},e=d.face["font-family"];
for(var S in d.face){if(d.face[ah](S)){i.face[S]=d.face[S]
}}if(this.fonts[e]){this.fonts[e][k](i)
}else{this.fonts[e]=[i]
}if(!d.svg){i.face["units-per-em"]=U(d.face["units-per-em"],10);
for(var E in d.glyphs){if(d.glyphs[ah](E)){var R=d.glyphs[E];
i.glyphs[E]={w:R.w,k:{},d:R.d&&"M"+R.d[bt](/[mlcxtrv]/g,function(bI){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[bI]||"M"
})+"z"};
if(R.k){for(var b in R.k){if(R[ah](b)){i.glyphs[E].k[b]=R.k[b]
}}}}}}return d
};
a0.getFont=function(bJ,bK,d,E){E=E||"normal";
d=d||"normal";
bK=+bK||{normal:400,bold:700,lighter:300,bolder:800}[bK]||400;
if(!aJ.fonts){return
}var R=aJ.fonts[bJ];
if(!R){var e=new RegExp("(^|\\s)"+bJ[bt](/[^\w\d\s+!~.:_-]/g,aQ)+"(\\s|$)","i");
for(var b in aJ.fonts){if(aJ.fonts[ah](b)){if(e.test(b)){R=aJ.fonts[b];
break
}}}}var S;
if(R){for(var bI=0,bL=R[s];
bI<bL;
bI++){S=R[bI];
if(S.face["font-weight"]==bK&&(S.face["font-style"]==d||!S.face["font-style"])&&S.face["font-stretch"]==E){break
}}}return S
};
a0.print=function(R,E,b,bJ,bK,bT,d){bT=bT||"middle";
d=m(bj(d||0,1),-1);
var bP=this.set(),bS=bD(b)[J](aQ),bQ=0,bN=aQ,bU;
aJ.is(bJ,b)&&(bJ=this.getFont(bJ));
if(bJ){bU=(bK||16)/bJ.face["units-per-em"];
var e=bJ.face.bbox.split(a),bI=+e[0],bL=+e[1]+(bT=="baseline"?e[3]-e[1]+(+bJ.face.descent):(e[3]-e[1])/2);
for(var bO=0,S=bS[s];
bO<S;
bO++){var bM=bO&&bJ.glyphs[bS[bO-1]]||{},bR=bJ.glyphs[bS[bO]];
bQ+=bO?(bM.w||bJ.w)+(bM.k&&bM.k[bS[bO]]||0)+(bJ.w*d):0;
bR&&bR.d&&bP[k](this.path(bR.d).attr({fill:"#000",stroke:"none",translation:[bQ,0]}))
}bP.scale(bU,bU,bI,bL).translate(R-bI,E-bL)
}return bP
};
aJ.format=function(d,e){var b=aJ.is(e,a8)?[0][bx](e):arguments;
d&&aJ.is(d,ag)&&b[s]-1&&(d=d[bt](bo,function(R,E){return b[++E]==null?aQ:b[E]
}));
return d||aQ
};
aJ.ninja=function(){r.was?(aR.Raphael=r.is):delete Raphael;
return aJ
};
aJ.el=bd;
aJ.st=ai[bF];
r.was?(aR.Raphael=aJ):(Raphael=aJ)
})();
/* LAB.js (LABjs :: Loading And Blocking JavaScript)
    v1.2.0 (c) Kyle Simpson
    MIT License
*/
(function(al){var ak="string",ad="head",s="body",o="script",ah="readyState",an="preloaddone",ab="loadtrigger",n="srcuri",J="preload",a="complete",Y="done",X="which",m="preserve",I="onreadystatechange",aB="onload",l="hasOwnProperty",aA="script/cache",g="[object ",ag=g+"Function]",af=g+"Array]",av=null,aq=true,ao=false,am=al.document,az=al.location,ay=al.ActiveXObject,V=al.setTimeout,ax=al.clearTimeout,f=function(e){return am.getElementsByTagName(e)
},d=Object.prototype.toString,D=function(){},aj={},c={},aw=/^[^?#]*\//.exec(az.href)[0],au=/^\w+\:\/\/\/?[^\/]+/.exec(aw)[0],ac=f(o),at=al.opera&&d.call(al.opera)==g+"Opera]",ar=("MozAppearance" in am.documentElement.style),ap=(am.createElement(o).async===true),ae={cache:!(ar||at),order:ar||at||ap,xhr:aq,dupe:aq,base:"",which:ad};
ae[m]=ao;
ae[J]=aq;
aj[ad]=am.head||f(ad);
aj[s]=f(s);
function K(e){return d.call(e)===ag
}function b(h,e){var j=/^\w+\:\/\//,i;
if(typeof h!=ak){h=""
}if(typeof e!=ak){e=""
}i=((/^\/\//.test(h))?az.protocol:"")+h;
i=(j.test(i)?"":e)+i;
return((j.test(i)?"":(i.charAt(0)==="/"?au:aw))+i)
}function aa(e){return(b(e).indexOf(au)===0)
}function W(h){var e,i=-1;
while(e=ac[++i]){if(typeof e.src==ak&&h===b(e.src)&&e.type!==aA){return aq
}}return ao
}function C(x,E){x=!(!x);
if(E==av){E=ae
}var j=ao,A=x&&E[J],i=A&&E.cache,w=A&&E.order,h=A&&E.xhr,R=E[m],P=E.which,N=E.base,e=D,v=ao,z,y=aq,B={},u=[],r=av;
A=i||h||w;
function T(Z,U){if((Z[ah]&&Z[ah]!==a&&Z[ah]!=="loaded")||U[Y]){return ao
}Z[aB]=Z[I]=av;
return aq
}function q(Z,U,aD){aD=!(!aD);
if(!aD&&!(T(Z,U))){return
}U[Y]=aq;
for(var aC in B){if(B[l](aC)&&!(B[aC][Y])){return
}}j=aq;
e()
}function S(U){if(K(U[ab])){U[ab]();
U[ab]=av
}}function L(Z,U){if(!T(Z,U)){return
}U[an]=aq;
V(function(){aj[U[X]].removeChild(Z);
S(U)
},0)
}function G(Z,U){if(Z[ah]===4){Z[I]=D;
U[an]=aq;
V(function(){S(U)
},0)
}}function p(U,aG,aE,Z,aC,aF){var aD=U[X];
V(function(){if("item" in aj[aD]){if(!aj[aD][0]){V(arguments.callee,25);
return
}aj[aD]=aj[aD][0]
}var aH=am.createElement(o);
if(typeof aE==ak){aH.type=aE
}if(typeof Z==ak){aH.charset=Z
}if(K(aC)){aH[aB]=aH[I]=function(){aC(aH,U)
};
aH.src=aG;
if(ap){aH.async=ao
}}aj[aD].insertBefore(aH,(aD===ad?aj[aD].firstChild:av));
if(typeof aF==ak){aH.text=aF;
q(aH,U,aq)
}},0)
}function Q(Z,U,aD,aC){c[Z[n]]=aq;
p(Z,U,aD,aC,q)
}function O(Z,U,aE,aD){var aC=arguments;
if(y&&Z[an]==av){Z[an]=ao;
p(Z,U,aA,aD,L)
}else{if(!y&&Z[an]!=av&&!Z[an]){Z[ab]=function(){O.apply(av,aC)
}
}else{if(!y){Q.apply(av,aC)
}}}}function M(Z,U,aF,aE){var aC=arguments,aD;
if(y&&Z[an]==av){Z[an]=ao;
aD=Z.xhr=(ay?new ay("Microsoft.XMLHTTP"):new al.XMLHttpRequest());
aD[I]=function(){G(aD,Z)
};
aD.open("GET",U);
aD.send("")
}else{if(!y&&Z[an]!=av&&!Z[an]){Z[ab]=function(){M.apply(av,aC)
}
}else{if(!y){c[Z[n]]=aq;
p(Z,U,aF,aE,av,Z.xhr.responseText);
Z.xhr=av
}}}}function H(Z){if(typeof Z=="undefined"||!Z){return
}if(Z.allowDup==av){Z.allowDup=E.dupe
}var U=Z.src,aH=Z.type,aF=Z.charset,aC=Z.allowDup,aD=b(U,N),aG,aE=aa(aD);
if(typeof aF!=ak){aF=av
}aC=!(!aC);
if(!aC&&((c[aD]!=av)||(y&&B[aD])||W(aD))){if(B[aD]!=av&&B[aD][an]&&!B[aD][Y]&&aE){q(av,B[aD],aq)
}return
}if(B[aD]==av){B[aD]={}
}aG=B[aD];
if(aG[X]==av){aG[X]=P
}aG[Y]=ao;
aG[n]=aD;
v=aq;
if(!w&&h&&aE){M(aG,aD,aH,aF)
}else{if(!w&&i){O(aG,aD,aH,aF)
}else{Q(aG,aD,aH,aF)
}}}function k(U){if(x&&!w){u.push(U)
}if(!x||A){U()
}}function F(Z){var U=[],aC;
for(aC=-1;
++aC<Z.length;
){if(d.call(Z[aC])===af){U=U.concat(F(Z[aC]))
}else{U[U.length]=Z[aC]
}}return U
}z={script:function(){ax(r);
var Z=F(arguments),U=z,aC;
if(R){for(aC=-1;
++aC<Z.length;
){if(K(Z[aC])){Z[aC]=Z[aC]()
}if(aC===0){k(function(){H((typeof Z[0]==ak)?{src:Z[0]}:Z[0])
})
}else{U=U.script(Z[aC])
}U=U.wait()
}}else{for(aC=-1;
++aC<Z.length;
){if(K(Z[aC])){Z[aC]=Z[aC]()
}}k(function(){for(aC=-1;
++aC<Z.length;
){H((typeof Z[aC]==ak)?{src:Z[aC]}:Z[aC])
}})
}r=V(function(){y=ao
},5);
return U
},wait:function(Z){ax(r);
y=ao;
if(!K(Z)){Z=D
}var U=C(x||v,E),aE=U.trigger,aD=function(){try{Z()
}catch(aF){}aE()
};
delete U.trigger;
var aC=function(){if(v&&!j){e=aD
}else{aD()
}};
if(x&&!v){u.push(aC)
}else{k(aC)
}return U
}};
if(x){z.trigger=function(){var Z,U=-1;
while(Z=u[++U]){Z()
}u=[]
}
}else{z.trigger=D
}return z
}function ai(h){var e,k={},j={UseCachePreload:"cache",UseLocalXHR:"xhr",UsePreloading:J,AlwaysPreserveOrder:m,AllowDuplicates:"dupe"},i={AppendTo:X,BasePath:"base"};
for(e in j){i[e]=j[e]
}k.order=!(!ae.order);
for(e in i){if(i[l](e)&&ae[i[e]]!=av){k[i[e]]=(h[e]!=av)?h[e]:ae[i[e]]
}}for(e in j){if(j[l](e)){k[j[e]]=!(!k[j[e]])
}}if(!k[J]){k.cache=k.order=k.xhr=ao
}k.which=(k.which===ad||k.which===s)?k.which:ad;
return k
}al.$LAB={setGlobalDefaults:function(e){ae=ai(e)
},setOptions:function(e){return C(ao,ai(e))
},script:function(){return C().script.apply(av,arguments)
},wait:function(){return C().wait.apply(av,arguments)
}};
(function(h,e,i){if(am[ah]==av&&am[h]){am[ah]="loading";
am[h](e,i=function(){am.removeEventListener(e,i,ao);
am[ah]=a
},ao)
}})("addEventListener","DOMContentLoaded")
})(window);
window.innerShiv=(function(){var d,r;
return function(h,u){if(!d){d=document.createElement("div");
r=document.createDocumentFragment();
/*@cc_on d.style.display = 'none';@*/
}var e=d.cloneNode(true);
/*@cc_on document.body.appendChild(e);@*/
e.innerHTML=h.replace(/^\s\s*/,"").replace(/\s\s*$/,"");
/*@cc_on document.body.removeChild(e);@*/
if(u===false){return e.childNodes
}var f=r.cloneNode(true),i=e.childNodes.length;
while(i--){f.appendChild(e.firstChild)
}return f
}
}());
window.routeTable={routes:{PluginsPage:{url:"plugins",defaults:{controller:"Content",action:"Plugins"}},Plugins:{url:"plugins/{Action}",defaults:{controller:"Plugins"}},ReportPlugins:{url:"api/plugins/report",defaults:{controller:"Plugins",action:"Report"}},VerseOfTheDay:{url:"bible/{resourceName}/verseoftheday",defaults:{controller:"Bible",action:"VerseOfTheDay"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},VerseOfTheDayWidget:{url:"api/plugins/verseoftheday/{resourceName}",defaults:{controller:"Bible",action:"VerseOfTheDayWidget"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},VerseOfTheDayAsFullsizeImage:{url:"api/plugins/verseoftheday/{resource}/fullsize.jpg",defaults:{controller:"Media",action:"VerseOfTheDayAsFullsizeImage"}},VerseOfTheDaySingleImage:{url:"api/plugins/verseoftheday/{resource}/{theme}/{variant}.jpg",defaults:{controller:"Media",action:"VerseOfTheDayAsSingleImage"}},VerseOfTheDayImageWithExtension:{url:"bible/images/{directory}/{reference}.{extension}",defaults:{controller:"Media",action:"VerseOfTheDay"},constraints:{extension:"png|jpg"}},VerseOfTheDayImage:{url:"bible/images/{directory}/{reference}",defaults:{controller:"Media",action:"VerseOfTheDay"}},BibleSearchBox:{url:"api/plugins/biblesearchbox",defaults:{controller:"Search",action:"BibleSearchBox"}},BibleSearchResults:{url:"api/plugins/biblesearchresults",defaults:{controller:"Search",action:"BibleSearchResults"}},EmbeddedBible:{url:"api/plugins/embeddedbible",defaults:{controller:"Resource",action:"EmbeddedBible"}},EmbeddedPreview:{url:"api/plugins/embeddedpreview",defaults:{controller:"Resource",action:"EmbeddedPreview"}},FirstVerseInResource:{url:"books/{resourceName}/firstverse",defaults:{controller:"Resource",action:"GetFirstVerseReference"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},Associated:{url:"books/associated/{resourceName}/{reference}",defaults:{controller:"Resource",action:"Associated",reference:{},pane:{}},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},Resolve:{url:"books/{resourceName}/resolve",defaults:{controller:"Resource",action:"Resolve"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},ResourceList:{url:"books",defaults:{controller:"Library",action:"List"}},Library:{url:"library",defaults:{controller:"Library",action:"List"}},Media:{url:"books/{resourceName}/media/path/{*path}",defaults:{controller:"Media",action:"Default"},constraints:{resourceName:"^[0-9.\\w -]{2,}",path:{}}},MediaDisplay:{url:"books/{resourceName}/media",defaults:{controller:"Media",action:"DisplayByOffset"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},MediaDisplayOffset:{url:"books/{resourceName}/media/{offset}",defaults:{controller:"Media",action:"DisplayByOffset"},constraints:{resourceName:"^[0-9.\\w -]{2,}",offset:{}}},MediaDisplayArticle:{url:"books/{resourceName}/media/article/{articleId}",defaults:{controller:"Media",action:"DisplayByArticle"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},ResourceReference:{url:"books/{resourceName}/{reference}",defaults:{controller:"Resource",action:"Reference",resourceName:{}},constraints:{resourceName:"^[0-9.\\w -]{2,}",reference:"^[\\p{Pd}\\w\\d:\\$\\., ]+"}},BibleReference:{url:"bible/{resourceName}/{reference}",defaults:{controller:"Bible",action:"Reference",resourceName:{}},constraints:{resourceName:"^[0-9.\\w -]{2,}",reference:"^[\\p{Pd}\\w\\d:\\$\\.,; ]+"}},ReferenceCompare:{url:"bible/compare",defaults:{controller:"bible",action:"ReferenceCompare"}},GetUrlSafeReferences:{url:"bible/urlreference",defaults:{controller:"bible",action:"GetUrlSafeRenderedReferences"}},ReferenceDefaultBible:{url:"bible/{reference}",defaults:{controller:"bible",action:"Reference"},constraints:{reference:"^[\\p{Pd}\\w\\d:\\$\\.,; ]+"}},Reference:{url:"reference/{reference}",defaults:{controller:"Resource",action:"Reference"},constraints:{reference:"^[\\p{Pd}\\w\\d:\\$\\., ]+"}},ResourceHeadword:{url:"books/{resourceName}/word/{headword}",defaults:{controller:"Resource",action:"Headword"},constraints:{resourceName:"^[0-9.\\w -]{2,}",headword:{}}},Headword:{url:"word/{headword}",defaults:{controller:"Resource",action:"Headword"},constraints:{headword:{}}},Article:{url:"books/{resourceName}/article/{*articleId}",defaults:{controller:"Resource",action:"Article"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},ResourceDefault:{url:"books/{resourceName}",defaults:{controller:"Resource",action:"Default"}},Position:{url:"books/{resourceName}/percent/{position}",defaults:{controller:"Resource",action:"Position"},constraints:{resourceName:"^[0-9.\\w -]{2,}",position:{}}},Offset:{url:"books/{resourceName}/offset/{offset}",defaults:{controller:"Resource",action:"IndexedOffset"},constraints:{resourceName:"^[0-9.\\w -]{2,}",offset:{}}},TableOfContents:{url:"tableofcontents/{resourceName}/{pathToEntry}",defaults:{controller:"Resource",action:"TableOfContents",pathToEntry:{}},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},ResourceInformation:{url:"bookinfo/{resourceName}",defaults:{controller:"Resource",action:"GetInformation"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},Content:{url:"content/{*path}",defaults:{controller:"Content",action:"Index"},constraints:{path:{}}},Tag:{url:"tag",defaults:{controller:"Content",action:"Tag"}},SearchDefault:{url:"search",defaults:{controller:"Search",action:"Default"}},Search:{url:"search/{resources}",defaults:{controller:"Search",action:"Default"},constraints:{resources:{}}},SitemapIndex:{url:"sitemap.xml",defaults:{controller:"Sitemap",action:"Index"}},FreeResourcesSitemap:{url:"sitemap-free.xml",defaults:{controller:"Sitemap",action:"FreeResources"}},BibleSitemap:{url:"sitemap-bible{index}.xml",defaults:{controller:"Sitemap",action:"Bible"},constraints:{index:{}}},SyncWriteReference:{url:"savereference/{resourceName}/{reference}/{pane}",defaults:{controller:"User",action:"SaveReferencePosition",pane:{}},constraints:{resourceName:"^[0-9.\\w -]{2,}",reference:"^[\\p{Pd}\\w\\d:\\$\\., ]+"}},SyncWriteHeadword:{url:"saveword/{resourceName}/{headword}/{pane}",defaults:{controller:"User",action:"SaveHeadwordPosition",pane:{}},constraints:{resourceName:"^[0-9.\\w -]{2,}",headword:{}}},SyncWriteOffset:{url:"saveoffset/{resourceName}/{offset}/{pane}",defaults:{controller:"User",action:"SaveOffsetPosition",pane:{}},constraints:{resourceName:"^[0-9.\\w -]{2,}",offset:{}}},SyncWriteArticle:{url:"savearticle/{resourceName}/{articleId}/{pane}",defaults:{controller:"User",action:"SaveArticlePosition",pane:{}},constraints:{resourceName:"^[0-9.\\w -]{2,}",articleId:{}}},SetDefaultBible:{url:"setdefaultbible/{resourceName}",defaults:{controller:"User",action:"SetDefaultBible"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},SetResourceRating:{url:"setresourcerating/{resourceName}/{rating}",defaults:{controller:"User",action:"SetResourceRating"},constraints:{resourceName:"^[0-9.\\w -]{2,}",rating:{}}},SetTags:{url:"setresourcetags/{resourceName}",defaults:{controller:"User",action:"SetResourceTags"},constraints:{resourceName:"^[0-9.\\w -]{2,}"}},ReadingPlanSummary:{url:"reading/summary/{readingPlanId}",defaults:{controller:"ReadingPlan",action:"Summary"}},ReadingPlanMarkRead:{url:"reading/mark/{readingPlanId}/{sessionDate}",defaults:{controller:"ReadingPlan",action:"MarkRead"}},Error:{url:"error/{status}",defaults:{controller:"Error",action:"Default",status:{}}},UpdateResourceDatabases:{url:"updateresourcedatabases",defaults:{controller:"ResourceLoaderManager",action:"UpdateDatabases"}},Default:{url:"{controller}/{action}",defaults:{controller:"Resource",action:"Default"},constraints:{controller:"Resource|Bible|Library|Search|User|ReadingPlan"}},CatchAll:{url:"{*path}",defaults:{controller:"Error",action:"Default",status:"404"}}}};
function RouteManager(d){var c=this;
this.routeTable=d||{routes:{Default:{url:"{controller}/{action}/{id}",defaults:null,constraints:null}}};
for(var a in this.routeTable.routes){var b=this.routeTable.routes[a];
if(b.defaults){for(var e in b.defaults){if(typeof b.defaults[e]!="string"){b.defaults[e]=""
}}}}}RouteManager.prototype._replaceRouteData=function(d,j,f,k){var g;
for(var e in j){var b=new RegExp("{[*]?"+e+"}");
var i=j[e];
if(i!==null&&i!==g){if(f){var c=f[e];
if(c&&typeof c=="string"){var a=new RegExp(c,"i");
if(!a.test(i)){throw new Error("Route data failed to pass constraints test.")
}}}var h=d;
d=d.replace(b,i);
if(k&&d==h){k[e]=i
}}}return d
};
RouteManager.prototype._hasParams=function(a){return a.search(/[{}]/)!==-1
};
RouteManager.prototype.buildUrl=function(i,j){var o=this;
var f;
var h=null;
var n=o.routeTable.routes;
var l=true;
if(typeof i!="string"&&j===f){l=false;
j=i
}for(var d in n){if(!l||d==i){var g=n[d];
var c=g.url;
if(!l&&!this._hasParams(c)){continue
}var k={};
try{c=o._replaceRouteData(c,j,g.constraints,k);
if(g.defaults){c=o._replaceRouteData(c,g.defaults,g.constraints)
}}catch(m){}if(c.search(/[{}]/)==-1){var e={};
for(var b in k){if(!(b in g.defaults&&k[b].toLowerCase()==g.defaults[b].toLowerCase())){e[b]=k[b]
}}var a=$.param(e);
if(a){c=c.replace(/[\/\\]$/,"")+"?"+a
}h=c[0]=="/"?c:"/"+c
}if(l||h){break
}}}return h
};
window.RESOURCE_ORDERS={relevance:"Relevance",priority:"Priority",title:"Title",authors:"Authors",rating:"Rating"};
window.PANES={left:"Left",right:"Right"};
window.RESOURCE_TYPES={ancientManuscript:"text.monograph.ancient-manuscript",audio:"lbx.audio",bible:"text.monograph.bible",bibleCommentary:"text.monograph.commentary.bible",bibleConcordance:"text.monograph.concordance.bible",bibleCriticalApparatus:"text.monograph.critical-apparatus.bible",bibleCrossReferences:"text.monograph.cross-references.bible",bibleHarmony:"text.monograph.harmony.bible",bibleLectionary:"text.monograph.lectionary.bible",bibleNotes:"text.monograph.notes.bible",bibleVisualization:"text.visualization.bible",biblicalPeople:"lbx.biblicalpeople",biblicalPeopleDiagrams:"lbx.biblicalpeoplediagrams",biblicalPlaces:"lbx.biblicalplaces",biblicalPlacesMaps:"lbx.biblicalplacesmaps",biblicalThings:"lbx.biblicalthings",calendarDevotional:"lbx.calendar-devotional",commentary:"text.monograph.commentary",criticalApparatus:"text.monograph.critical-apparatus",crossReferenceIndex:"text.monograph.cross-references",dictionary:"text.monograph.dictionary",encyclopedia:"text.monograph.encyclopedia",excerpts:"lbx.excerpts",grammaticalRelationships:"lbx.grammar",grammar:"text.monograph.grammar",help:"lbx.ldls_help.addin",journal:"text.serial.journal",lectionary:"text.monograph.lectionary.bible",lemmaList:"lbx.lemmalist",lexicon:"text.monograph.lexicon",literaryTyping:"lbx.literary.typing",logosControlledVocabulary:"lbx.logoscontrolledvocabulary",magazine:"text.serial.magazine",manual:"text.manual",media:"lbx.media",monograph:"text.monograph",pericopeSets:"lbx.pericopesets",pericopeTextIndex:"lbx.pericope-text-index",preachingThemes:"lbx.preachingthemes",pronunciations:"lbx.pronunciations",reverseInterlinear:"lbx.reverse-interlinear",studyTemplate:"lbx.studytemplate",syntaxDatabase:"lbx.syntaxdatabase",thesaurus:"text.monograph.thesaurus",timelines:"lbx.timelines"};
var biblia=biblia||{};
biblia.resourcestrings={tooltipError:"<span>Unable to load preview.</span>",referenceCompareError:"Sorry, an error was encountered while loading comparison.",resourceChangeError:"Sorry, an error was encountered while switching resources.",resourcePermissionError:"Sorry, you don't have permission to view that book.",resourceScrollError:"Sorry, an error was encountered while loading part of the book.",resourcePickerNoResults:"No matches.",resourcePickerNoResources:'Please <a href="/User/SignIn" class="signin-link" onclick="biblia.signin.show(); return false;">sign in</a> for access to more free books.'};
var biblia=biblia||{};
biblia.events={navigationRequest:"NAVIGATION_REQUEST",searchRequest:"SEARCH_REQUEST",resourceChange:"SELECTED_RESOURCE_CHANGE",primaryResourceChange:"PRIMARY_RESOURCE_CHANGE",locationMarkerChange:"LOCATION_MARKER_CHANGE",action:"APPLICATION_ACTION",userJump:"USER_INITIATED_JUMP",informationRequest:"INFORMATION_REQUEST",openResourceRequest:"OPEN_RESOURCE_INFO_REQUEST",changePageTitleRequest:"CHANGE_PAGE_TITLE_REQUEST",resizePane:"RESIZE_PANE",resizeFont:"RESIZE_FONT",paneResized:"PANE_RESIZED",info:"INFO_ALERT",markReadingPlan:"MARK_READING_PLAN",changeTab:"CHANGE_TAB",panelsLinked:"PANELS_LINKED",syncPosition:"SYNC_POSITION"};
var biblia=biblia||{};
biblia.errors={abstractMethod:function(b,a){return["Method ",a," of class ",b," is abstract and must be implemented in a child class"].join()
},invalidArgumentType:function(c,a,b){return["Argument ",a," of function ",c," must be of type ",b].join("")
},invalidArgumentValue:function(c,a,b){return["Argument ",a," of function ",c," ",b].join("")
}};
var biblia=biblia||{};
biblia.panes={left:0,right:1,fullContent:2,library:3};
biblia.paneStates={hidden:0,normal:1,expanded:2,fullscreen:3};
var biblia=biblia||{};
biblia.tabs={home:0,library:1,search:2,groups:3};
biblia.tabviews={reading:0,library:1,groups:2};
var biblia=biblia||{};
biblia.zindexes={behind:-1,normal:0,popup:3,dropdown:4};
var biblia=biblia||{};
biblia.tabviewclasses={reading:"reading-view",library:"library-view"};
biblia.panegroupclasses={full:"single-pane",columned:"split-panes"};
biblia.singlepaneclass="single-pane";
biblia.splitpanesclass="split-panes";
var biblia=biblia||{};
biblia.signin=(function(){var a=$("#signin");
var d={show:function(){a.animate({top:"0"},500);
if(d.onDisplaySignin){d.onDisplaySignin()
}setTimeout(function(){a.click()
},20)
},hide:function(){a.animate({top:"-240px"},500)
}};
function c(){$("#signin-auto-sign-in-container").hide();
$("#signin-input-container").show()
}function b(h,i,g){var f=h.token;
var e=h.name;
if(f&&e){$("#signin-identity-token").val(f);
$("#signin-auto-sign-in-name").text(e);
$("#signin-input-container").hide();
$("#signin-auto-sign-in-container").show();
$("#signin-different-user").click(function(j){j.preventDefault();
c()
});
setTimeout(c,1000*60*10)
}}d.init=function(){if(!a.length){$("#account-header form").submit(function(h){h.preventDefault();
var g=$(this);
var j=g.attr("action");
var i=g.serialize();
$.ajax({type:"post",url:j,data:i,complete:function(){window.location.reload()
}})
});
return
}if(!Modernizr.borderradius){a.svgRounded({strokeColor:"#000",strokeWidth:4,strokeOpacity:0.2,radius:16,cornerPosition:$.fn.svgRounded.cornerLocs.bottom})
}if($("#signin-identity-token").length){$.ajax({url:"https://www.logos.com/account/IdentityToken",dataType:"jsonp",success:b})
}$(".signin-link").click(function(g){g.preventDefault();
d.show()
});
$("#signin-close").click(function(g){g.preventDefault();
d.hide()
});
util.submitOnEnter(a.find("form"));
function e(g){$("#signin-header-sub").text(g).show()
}function f(g){e(g);
c()
}};
d.setOnDisplaySignin=function(e){d.onDisplaySignin=e
};
return d
})();
(function(a){a.widget("ui.infobar",{_create:function(){this.jqBar=this.element.hide();
this.jqMessageContainer=a('<div class="infobar-content"></div>').appendTo(this.jqBar);
this.jqMessage=a("<p></p>");
this.jqSubMessage=a("<p></p>").addClass("subheading");
this.jqXClose=a("<a></a>").addClass("x-close");
this.jqMessageContainer.append(this.jqXClose);
this.jqMessageContainer.append(this.jqMessage);
this.jqMessageContainer.append(this.jqSubMessage)
},_init:function(){var b=this;
this._hideBar();
this.jqXClose.click(function(c){c.preventDefault();
b._hideBar()
});
this._setLevel(a.fn.infobar.levels.info)
},_destroy:function(){},_setLevel:function(b){if(this.nCurLevel!=b){if(b<a.fn.infobar.levels.length){this.nCurLevel=b;
this.jqBar.attr("class","shadow infobar infobar-"+this.levelInfos[b].cssclass)
}else{log.error("Attempted to set the InfoBar level to an invalid value")
}}},_hideBar:function(b){if(this.fnCloseCallback){this.fnCloseCallback()
}if(b){this.jqBar.hide()
}else{this.jqBar.slideUp(this.options.animUpTime)
}this.fnCloseCallback=null;
clearTimeout(this.tmrClose)
},_quickHideBar:function(){this._hideBar(true)
},_setCloseTimer:function(b,c){if(c){if(c!=this.doNotClose){this.tmrClose=window.setTimeout(a.proxy(this._hideBar,this),c*1000)
}}else{if(b<a.fn.infobar.levels.length){if(this.levelInfos[b].closeSecs!=this.doNotClose){this.tmrClose=window.setTimeout(a.proxy(this._hideBar,this),this.levelInfos[b].closeSecs*1000)
}}else{log.error("Attempted to set the InfoBar close timeout with an invalid level")
}}},_showBar:function(f,b,e,g,h,c,d){this.fnCloseCallback=d;
if(!f){f=a.fn.infobar.levels.info
}this._setLevel(f);
if(f!=a.fn.infobar.levels.onetime||util.getCookieValue(h)!="1"){if(c){c()
}this.jqMessage.html(b);
if(e){this.jqSubMessage.html(e).show()
}else{this.jqSubMessage.hide()
}this.jqBar.slideDown(this.options.animDownTime);
clearTimeout(this.tmrClose);
this._setCloseTimer(f,g);
if(f==a.fn.infobar.levels.onetime){if(h){util.setCookie(h,"1",10*365)
}else{log.error("No cookie name specified for onetime display of InfoBar")
}}}},setPosition:function(b){this.jqBar.css("position",b)
},showBar:function(g,c,f,d,e,i,h){var j=this;
var b=function(){j._showBar(g,c,f,d,e,i,h)
};
if(this.fnCloseCallback){this._hideBar();
window.setTimeout(b,this.options.animUpTime)
}else{b()
}},hideBar:function(){this._hideBar()
},onetime:function(b,c,d,e){this.showBar(a.fn.infobar.levels.onetime,b,(c?c:""),d,e)
},info:function(b,c,d){this.showBar(a.fn.infobar.levels.info,b,(c?c:""),d,null)
},warning:function(b,c,d){this.showBar(a.fn.infobar.levels.warning,b,(c?c:""),d,null)
},error:function(b,c,d){this.showBar(a.fn.infobar.levels.error,b,(c?c:""),d,null)
},getAnimUpTime:function(){return this.options.animUpTime
},getAnimDownTime:function(){return this.options.animDownTime
},getBarHeight:function(){return this.options.height
},doNotClose:-1,levelInfos:[{t:"INFO",cssclass:"info",closeSecs:-1},{t:"ONCE",cssclass:"info",closeSecs:-1},{t:"WARN",cssclass:"warning",closeSecs:8},{t:"ERR",cssclass:"error",closeSecs:8}],options:{timeoutSecs:8,animUpTime:400,animDownTime:400,height:"40px"}});
a.fn.infobar.levels={info:0,onetime:1,warning:2,error:3,length:4}
})(jQuery);
(function(a){a.fn.baseTooltip=function(p,f){var e={selector:"a[title]",exiterSelector:null,template:"<div></div>",svgRoundedOptions:null,delay:500,loadingDelay:150,fadeDuration:150,fnGetContent:null,fnInsertContent:null,fnClickStick:null,bClickStick:true,bHoverShow:true,bShowLoading:false,onLinkClick:null,collision:"flip flip",fnPositioning:function(){return{}
}};
if(this.length>1){this.each(function(q,r){a(r).baseTooltip(p,f)
});
return this
}var d=a.extend(e,p);
var o=a(d.template);
var n=this;
function c(r,q){r.data("display-status",q)
}function m(q){return q.data("display-status")
}this.data("tooltips",this.data("tooltips")||[]);
this.data("tooltip-timers",this.data("tooltip-timers")||[]);
if(f=="destroy"||f=="cancel"){var i=this.data("tooltips");
var h=this.data("tooltip-timers");
if(i&&i.length){a.each(i,function(q,r){if(r.isInDocument()){r.remove()
}else{r.data("disabled",true)
}})
}a.each(this.find(d.selector),function(){c(a(this),"closed")
});
if(h&&h.length){a.each(h,function(q,r){clearTimeout(r)
})
}this.data("tooltip-timers",[]);
if(f=="destroy"){this.undelegate();
this.data("tooltips",[])
}return this
}if(!d.fnGetContent||!a.isFunction(d.fnGetContent)){throw new Error("The fnGetContent option of baseTooltip must be a valid function.")
}if(!d.fnInsertContent||!a.isFunction(d.fnInsertContent)){throw new Error("The fnInsertContent option of baseTooltip must be a valid function.")
}if(!Modernizr.boxshadow){o.prepend(a('<div class="shadow-fallback-all"><div class="shadow-fallback-tl" /><div class="shadow-fallback-top" /><div class="shadow-fallback-tr" /><div class="shadow-fallback-right" /><div class="shadow-fallback-br" /><div class="shadow-fallback-bottom" /><div class="shadow-fallback-bl" /><div class="shadow-fallback-left" /></div>'))
}var l=false;
var j=null;
function g(u,q,s){b(u,q);
u.data(q,s);
var r=n.data("tooltip-timers");
r.push(s);
n.data("tooltip-timers",r)
}function b(u,q){if(u){var s=u.data(q);
if(s){var r=n.data("tooltip-timers");
util.removeArrayValue(r,s);
n.data("tooltip-timers",r);
clearTimeout(s);
u.data(q,null)
}}}function k(r,u,w){function q(B,z){var y=B.data("display-element");
if(y&&y.length){if(!y.isInDocument()){y.data("anchor",B);
y.hide().appendTo(a(document.body))
}function A(){if(z){var C=a.extend({my:"left top",at:"center top",of:z,offset:"16",collision:d.collision},d.fnPositioning(z,B));
y.css({left:"0",top:"0"}).position(C);
if(y.offset().top<0){y.offset({top:4})
}var D=a(window).height();
var F=y.outerHeight()-y.height();
if(y.offset().top+y.outerHeight()>D){y.height(D-F-4*2)
}var E=y.find(".tooltip-content");
if(E.length&&E.height()>y.height()+2){E.height(y.height())
}}}if(m(B)!=="stuck"){if(B.data("display-has-content")){c(B,"open")
}else{c(B,"opening")
}}y.css("opacity","1");
y.fadeIn(d.fadeDuration,function(){y.first().css("filter","")
});
A()
}if(!Modernizr.borderradius&&d.svgRoundedOptions){y.svgRounded(d.svgRoundedOptions)
}}function x(C,B){b(C,"loading-timer");
var y=C.data("display-element");
if(!y||!y.length){y=o.clone();
C.data("display-element",y);
var A=n.data("tooltips")||n.data("tooltips",[]).data("tooltips");
A.push(y);
n.data("tooltips",A)
}else{y.data("disabled",false)
}function z(){if(!y.data("disabled")){var D=m(C);
if(D!=="opening"&&D!=="stuck"){return false
}y.children(".loading-indicator").remove();
d.fnInsertContent.apply(y,arguments);
b(C,"loading-timer");
q(C,B);
return true
}return false
}c(C,"opening");
if(d.bShowLoading){g(C,"loading-timer",setTimeout(function(){y.children(":not(.shadow-fallback-all)").empty();
y.append(a('<p class="loading-indicator">Loading...</p>'));
q(C,B)
},d.loadingDelay))
}d.fnGetContent(C,z)
}function v(){a.each(a(document.body).children("."+d.containerClass),function(z,A){var y=a(A).stop();
s(y.data("anchor"),y)
})
}function s(z,y){a.each(["display-timer","loading-timer"],function(B,A){b(z,A);
if(y&&y.length){a.each(y.find("a"),function(C,D){b(a(D),A)
})
}});
c(z,"closing");
if(y&&y.length){y.stop().fadeOut(d.fadeDuration,function(){y.detach();
c(z,"closed")
})
}}if(d.bHoverShow){r.delegate(d.selector,"mouseenter",function(y){var z=a(this);
if(l&&!w){return
}g(z,"display-timer",setTimeout(function(){x(z,y)
},d.delay))
}).delegate(d.selector,"mouseleave",function(A){var B=a(this);
var y=B.data("display-element");
b(B,"display-timer");
b(B,"loading-timer");
var z=m(B);
if((z=="open"||z=="opening")&&y){s(B,y)
}})
}if(d.bClickStick){r.delegate(d.selector,"click",function(B){var C=a(this);
var z=C.data("display-element");
if(l===true){j(B);
return
}B.stopPropagation();
B.preventDefault();
if(a.isFunction(d.fnClickStick)&&!d.fnClickStick(C)){s(C,z);
if(d.onLinkClick){d.onLinkClick(B)
}return
}b(C,"display-timer");
b(C,"loading-timer");
var y=m(C);
if(!y||y=="closing"||y=="closed"){x(C,B)
}z=C.data("display-element");
c(C,"stuck");
z.addClass("stuck");
k(z,false,true);
z.delegate("a","click",function(D){D.preventDefault();
A(D);
if(d.onLinkClick){d.onLinkClick(D)
}});
l=true;
function A(D){D.preventDefault();
D.stopPropagation();
z.removeClass("stuck");
s(C,z);
a(document).unbind("click",j);
z.undelegate();
l=false;
v()
}j=a.proxy(A,this);
z.click(function(D){if(!d.exiterSelector||a(this).filter(d.exiterSelector).length===0){D.stopPropagation()
}});
if(d.exiterSelector){z.delegate(d.exiterSelector,"click",j)
}a(document).click(j)
})
}}k(this,d.clickStick);
return this
}
})(jQuery);
(function(a){a.fn.tooltip=function(b,e){var f={selector:"a[title]",containerClass:"tooltip",bShowLoading:true,fnGetContent:function(h,g){g(a(h).attr("title"))
}};
var d=a.extend(f,b);
var c='<div class="'+d.containerClass+' ui-corner-all"><div class="'+d.containerClass+'-content"></div><div class="'+d.containerClass+'-footer"></div></div>';
a.extend(d,{template:c,fnInsertContent:function(h,i){h=h||"";
i=i||"";
if(h){var g=this.find("."+d.containerClass+"-content").first();
g.empty().append(a(h));
g.next().text(i);
if(!i){g.next().hide()
}}}});
this.baseTooltip(d,e)
}
})(jQuery);
$.widget("ui.dropdown",{_create:function(){var b=this;
this.jqBtn=this.element;
this.jqPanel=this.options.jqPanel;
if(!this.jqBtn||!this.jqPanel){throw Error("Dropdown requires a non-null button and panel to associate.")
}if(!this.jqBtn.length||!this.jqPanel.length){throw Error("Dropdown requires valid non-empty jQuery objects for the button and panel")
}if(this.options.bAddTopBorder){var a=this.jqPanel;
this.jqPanel=$("<div></div>").css({position:"absolute","z-index":biblia.zindexes.dropdown,visibility:"hidden",top:-1000,left:-1000}).append(this.jqPanel.css({display:"block",position:"static"}));
this.jqPanel.appendTo($("body"));
this.jqTopBorder=$("<div></div>").css({"background-color":"#FA7821",height:"4px",position:"absolute",top:"-4px",left:0,width:a.outerWidth()+"px","z-index":biblia.zindexes.dropdown+1});
this.jqPanel.prepend(this.jqTopBorder)
}this.jqBtn.bind(this._getEvent(),function(c){if(c.which==1){if(b.jqPanel.css("visibility")=="visible"){b.hidePanel(c)
}else{b.displayPanel(c)
}}})
},_init:function(){},_getEvent:function(){return this.options.bUseMouseDown?"mousedown":"click"
},hidePanel:function(a){$(document).unbind("click",this.clickHidePanel);
this.options.fnOnHide&&this.options.fnOnHide(a);
if(this.options.strBtnActiveClass){this.jqBtn.removeClass(this.options.strBtnActiveClass)
}this.jqPanel.css("visibility","hidden")
},displayPanel:function(a){if(this.options.strBtnActiveClass){this.jqBtn.addClass(this.options.strBtnActiveClass)
}if(this.jqTopBorder){this.jqTopBorder.width(this.jqPanel.outerWidth())
}this.jqPanel.css({top:0,left:0});
this.jqPanel.css("visibility","visible");
this.jqPanel.position({my:this.options.strPnlPos,at:this.options.strBtnPos,of:this.jqBtn,offset:this.options.strOffset,collision:this.options.strCollision});
this.options.fnOnDisplay&&this.options.fnOnDisplay(a);
this.jqPanel.bind(this._getEvent(),function(b){b.which==1&&b.stopPropagation()
});
$(document).bind(this._getEvent(),$.proxy(this.clickHidePanel,this))
},clickHidePanel:function(b){function a(d,c){while(d.length&&d.parent().get(0)!=c){d=d.parent()
}return d.parent().get(0)==c
}if(b.target!=this.jqBtn.get(0)&&!a($(b.target),this.jqBtn.get(0))){this.hidePanel()
}},options:{jqPanel:null,fnOnDisplay:null,fnOnHide:null,bUseMouseDown:true,strBtnActiveClass:"",strBtnPos:"left bottom",strPnlPos:"left top",strCollision:"fit fit",strOffset:"0 4px",bAddTopBorder:true}});
$.widget("ui.filterInput",{_create:function(){var a=this;
this.jqWrapper=$('<div class="filter-holder"></div>').css({position:"relative",width:"100%"});
this.jqWrapper.appendTo(this.element.parent());
this.element.parent().children(":not(.filter-holder)").appendTo(this.jqWrapper);
this.jqElement=this.element;
if(this.options.showClear){this.jqClearBtn=$('<a href="#clear">Clear</a>').css({background:"url("+this.options.closeImage+") no-repeat "+this.options.closeImageX+"px "+this.options.closeImageY+"px",display:"none",position:"absolute",width:this.options.closeImageWidth+"px",height:this.options.closeImageHeight+"px",overflow:"hidden",right:this.options.rightMargin+"px","text-indent":"-9999px",top:"50%","margin-top":-(this.options.closeImageHeight/2)+"px"}).appendTo(this.jqWrapper);
this.jqClearBtn.click(function(){a.jqElement.val("");
a._hideClearBtn();
if(a.options.returnFocus){a.jqElement.focus();
a.jqElement.change()
}else{a.jqElement.blur()
}if(a.options.submitOnClear){a.jqElement.closest("form").submit()
}return false
})
}if(this.options.showCount){this.jqResultCount=$('<span class="filtered-resource-count"></span>').disableSelection().css({position:"absolute",top:"50%",right:this.options.rightMargin+"px","margin-top":"-8px",color:"#999999","font-size":"10px",height:"16px","line-height":"16px","text-align":"right",cursor:"default",display:this.options.showCount?"inline-block":"none"}).appendTo(this.jqWrapper)
}if(this.jqElement.val().length>=1&&this.options.showOnLoad===true){this._showClearBtn()
}this.jqElement.keyup(function(){if(a.jqElement.val().length>=1){a._showClearBtn()
}else{a._hideClearBtn()
}});
this.jqElement.change(function(){if($(this).val()===""){a._hideClearBtn()
}});
this.jqElement.keypress(function(b){if(b.which==$.ui.keyCode.ENTER){a.jqElement.closest("form").submit();
return false
}})
},_showClearBtn:function(){if(this.jqClearBtn){this.jqClearBtn.css({display:"block","margin-right":this.options.clearBtnRightMargin})
}this.jqResultCount&&this.jqResultCount.css("right",(this.options.rightMargin+(this.options.showClear?this.options.closeImageWidth+this.options.countClearPadding:0))+"px")
},_hideClearBtn:function(){if(this.jqClearBtn){this.jqClearBtn.hide()
}this.jqResultCount&&this.jqResultCount.css("right",this.options.rightMargin+"px")
},setResultCount:function(a){if(this.jqResultCount){this.jqResultCount.text(a)
}},options:{borderAllowance:2,closeImage:"/public/images/icon-sprite.png?v=5",closeImageX:0,closeImageY:-268,closeImageHeight:14,closeImageWidth:14,rightMargin:6,countClearPadding:2,clearBtnRightMargin:-2,returnFocus:true,submitOnClear:true,showOnLoad:false,showCount:true,showClear:true}});
$.widget("biblia.resourcepicker",{_create:function(){var b=this;
$.preload.gap=13;
this.jqPickerButton=this.element;
this.jqDropDown=$('<div class="resource-picker-dropdown dropdown"><div class="resource-picker-toolbar"> 			</div></div>');
this.jqFilterInput=$('<input type="text" name="resource-filter" placeholder="Find..." class="hinted" />');
this.jqResultContainer=$('<div class="resource-picker-results"></div>');
this.jqLoadingIndicator=$('<div class="resource-picker-loading ui"><span><img src="/public/images/ajax-loader.gif" />Loading...</span></div>');
this.jqFilterInput.appendTo(this.jqDropDown.children(".resource-picker-toolbar").first()).filterInput();
this.jqResultContainer.appendTo(this.jqDropDown);
this.bVisible=false;
this.bIgnoreNextBlur=false;
this.currentResourceInfo=null;
this.jqPickerButton.css("white-space","nowrap");
var a="";
var d=$.proxy($.debounce(200,function(f){var g=this.jqFilterInput.val();
if(g!=a){a=g;
this._fetchResources(g)
}}),this);
var c=function(f){if(f.which==$.ui.keyCode.ENTER||f.which==$.ui.keyCode.UP||f.which==$.ui.keyCode.DOWN){return null
}return d.apply(this,util.argumentsArray(arguments))
};
this.jqFilterInput.change(c).keyup(c);
$(document).mousedown($.proxy(function(f){if(!(this.initialized&&this.bVisible)){return
}if(this.bIgnoreNextBlur){this.bIgnoreNextBlur=false;
return
}var g=$(f.target);
if(g.length&&g.closest(".resource-picker-dropdown").length===0){this._hideMenu()
}},this));
$(window).resize($.proxy($.debounce(20,function(f){this._onResize()
}),this));
if(this.options.initialResourceInfo){this.selectItem(this.options.initialResourceInfo)
}this.jqPickerButton.dropdown({jqPanel:this.jqDropDown,fnOnDisplay:$.proxy(function(g){g.preventDefault();
this.bVisible=true;
this.bIgnoreNextBlur=true;
this.jqFilterInput.focus().select();
this.jqFilterInput.filterInput("resetPositions");
if(!this.initialized){this._fetchResources();
this.initialized=true
}var f=this.jqDropDown.find("li.item.selected");
if(f.length){this.jqResultContainer.ajaxscroll("scrollIntoView",f)
}else{this.jqDropDown.scroll(0)
}},this),strBtnPos:this.options.pickerButtonOrigin,strPnlPos:this.options.pickerDropDownOrigin,strBtnActiveClass:"active"}).click(function(f){f.preventDefault()
});
this.jqDropDown.keydown($.proxy(function(i){if(!this.bVisible){return
}var f=this.jqDropDown.find("li.selected:first");
if(!f.length==1){return
}switch(i.keyCode||i.which){case $.ui.keyCode.UP:case $.ui.keyCode.LEFT:var h=f.prev("li.item");
if(!h.length){h=f.closest("ul").prev("ul").find("li.item:last");
if(!h.length){h=f.closest(".content-chunk").prev(".content-chunk").find("li.item:last")
}}if(h.length){f.removeClass("selected");
h.addClass("selected");
this.jqResultContainer.ajaxscroll("scrollIntoView",h)
}break;
case $.ui.keyCode.DOWN:case $.ui.keyCode.RIGHT:var g=f.next("li.item");
if(!g.length){g=f.closest("ul").next("ul").find("li.item:first");
if(!g.length){g=f.closest(".content-chunk").next(".content-chunk").find("li.item:first")
}}if(g.length){f.removeClass("selected");
g.addClass("selected");
this.jqResultContainer.ajaxscroll("scrollIntoView",g)
}break;
case $.ui.keyCode.ENTER:f.find("a").click();
break;
default:return
}},this)).delegate("li.item","mouseenter",function(){b.jqDropDown.find("li.selected:first").removeClass("selected");
$(this).addClass("selected")
});
if(!this.options.lazy){this._fetchResources();
this.initialized=true
}},_init:function(){this.jqPickerButton.show();
this._selectedElement=null;
if(!this.jqLoadingIndicator.isInDocument()){this.jqDropDown.append(this.jqLoadingIndicator)
}},_destroy:function(){},_hideMenu:function(){this.jqPickerButton.dropdown("hidePanel");
this.bVisible=false
},_itemClick:function(b){b.preventDefault();
var c=b.data;
var a=[c,this.currentResourceInfo];
this._hideMenu();
this.selectItem(c);
this._trigger("change",0,a)
},_getPage:function(d){var l=this;
var f=$('<div class="content-chunk" />');
var e=null;
var i=d.resources;
if(d.start===0&&!d.filter){i=this.options.injectResources.concat(i)
}function m(o,q,r,p){return $.map(o,function(x,u){var s=ROUTING.buildUrl("ResourceDefault",{resourceName:x.resourceName});
var w=$('<a href="'+(s||"#")+'"><div class="resource-picker-item-icon"><img src="'+(x.coverUrl?x.coverUrl:"/error/404")+'" class="drop-shadow" alt="" /></div><div class="resource-picker-item-caption">'+util.ellipsisize(q(x),l.options.captionCharCount)+"</div>"+(r?'<div class="resource-picker-item-authors">'+util.ellipsisize(r(x).join("; "),l.options.authorsCharCount)+"</div>":"")+"</a>");
w.bind("click",x,$.proxy(l._itemClick,l)).attr("title",p?p(x):"");
var v=$('<li class="item"></li>').append(w);
if(x.type=="CUSTOM"){v.addClass("item-custom")
}return v
})
}function g(p){if(p.length){var o=$("<ul></ul>");
$.each(p,function(q,r){r.appendTo(o)
});
return o
}return null
}if(i){if(typeof d.count=="number"){l.jqFilterInput.filterInput("setResultCount",d.count)
}var b=(d.filter||d.start>0)?0:this.options.topItemsCount;
var a=g(m($.grep(i,function(p,o){return o<b
}),function(o){return o.abbreviatedTitle
},null,function(o){return o.title
}));
var k=g(m($.grep(i,function(p,o){return o>=b
}),function(o){return o.userTitle||o.title
},function(o){return o.authors||[]
},function(o){return o.title
}));
if(a!==null){$('<li class="spacer"></li>').appendTo(a);
a.addClass("resource-picker-features");
f.append(a)
}f.append(k);
if(d.start===0){f.find("li.item:first").addClass("selected")
}f.find(".resource-picker-item-icon img").preload({placeholder:"/public/images/DefaultBookCover_small.png",notFound:"/public/images/DefaultBookCover_small.png"})
}var h=d.start+d.limit;
if(h<d.count){var j={type:this.options.itemSourceType,bias:this.options.itemBiasType,start:h,contentType:"js",reference:this.options.reference,publicResourcesOnly:this.options.publicResourcesOnly};
if(d.filter){j.q=d.filter
}e=ROUTING.buildUrl("ResourceList",j)
}function n(o){return $('<div class="resource-list-message" />').html(o)
}if(d.count<=this.options.noResourcesThreshold&&!d.filter&&this.options.noResourcesAvailableMessage){f.append(n(this.options.noResourcesAvailableMessage))
}else{if(!d.count&&d.filter&&this.options.noResultMessage){f.append(n(this.options.noResultMessage))
}}var c=d.start+d.limit<d.count;
return{content:f,prevPageUrl:null,nextPageUrl:e,chunkloadData:c}
},_showLoading:function(a,b){if(b[this.jqResultContainer.ajaxscroll("getChunkloadDataIdx")]){this.jqResultContainer.find(".content-chunk:last ul:not(.resource-picker-features)").append(this.jqLoadingIndicator)
}else{this.jqLoadingIndicator.detach()
}},_fetchResources:function(c){var b=this;
var a={type:this.options.itemSourceType,bias:this.options.itemBiasType,contentType:"js",publicResourcesOnly:this.options.publicResourcesOnly};
if(c){a.q=c
}if(this.options.reference!==null){a.reference=this.options.reference
}if(c){this.jqLoadingIndicator.detach()
}this.jqResultContainer.ajaxscroll({fnGetPage:$.proxy(this._getPage,this),chunkload:$.proxy(this._showLoading,this),edgeTriggerDistance:400,unloadTriggerScreens:-1,bVirtualizeScrollPosition:false,initialPageUrl:ROUTING.buildUrl("ResourceList",a),clearInitialContent:true,bShowLoading:c?true:false})
},_onResize:function(){if(this.currentResourceInfo){this.setTitle(this.currentResourceInfo.title,this.currentResourceInfo.abbreviatedTitle)
}this.jqPickerButton.dropdown("hidePanel")
},setTitle:function(c,a){if(this.options.changePickerText){if(!this.options.useAbbreviatedTitlesOnly&&c&&a){this.jqPickerButton.css("white-space","normal");
this.jqPickerButton.html(this.options.titleSuffix);
var b=this.jqPickerButton.height();
this.jqPickerButton.html(c+this.options.titleSuffix);
if(b<this.jqPickerButton.height()){this.jqPickerButton.html(a+this.options.titleSuffix)
}this.jqPickerButton.css("white-space","nowrap")
}else{if(this.options.useAbbreviatedTitlesOnly&&a){this.jqPickerButton.html(a+this.options.titleSuffix)
}}}},selectItem:function(a){if(a){this.currentResourceInfo=a;
this.setTitle(a.title,a.abbreviatedTitle)
}},options:{initialResourceInfo:null,reference:null,pickerDropDownOffset:"2 1",topItemsCount:5,itemBiasType:"bibles",itemSourceType:"",titleSuffix:"",publicResourcesOnly:false,useAbbreviatedTitlesOnly:false,pickerDropDownOrigin:"left top",pickerButtonOrigin:"left bottom",captionCharCount:80,authorsCharCount:50,noResultMessage:null,noResourcesAvailableMessage:null,noResourcesThreshold:5,injectResources:[],changePickerText:true,change:null}});
(function(a){a.widget("biblia.passageResourcePicker",{_create:function(){var b=this;
this.initialized=false;
this.jqContainer=this.element
},_init:function(){var b=this;
this.jqContainer.empty();
this.regenList=this._updateResources;
this.jqMore=a('<a href="#">more &raquo;</a>');
this.jqMore.resourcepicker({initialResourceInfo:this.options.initialResourceInfo,reference:this.options.reference,change:a.proxy(function(f,d){var c=this.resCurrent;
var g=d[0];
this.resCurrent=g;
this.regenList();
this._trigger("change",0,[g,c])
},this),itemSourceType:"bibles",topItemsCount:0,titleSuffix:"&nbsp;\u25BE",pickerDropDownOrigin:"right top",pickerButtonOrigin:"right bottom",lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources,changePickerText:false});
this.jqLinksContainer=a('<div class="passage-resource-links"></div>').prependTo(this.jqContainer).delegate("a","click",a.proxy(this._onResourceClick,this));
this.resCurrent=this.options.initialResourceInfo;
this._updateResources()
},_makeResourceLink:function(b){var c=a('<div><a href="'+ROUTING.buildUrl("BibleReference",{resourceName:b.resourceName,reference:this.options.reference})+'" title="'+b.title+'">'+b.abbreviatedTitle+'</a><div class="item-highlight ui-corner-bottom"></div></div>');
c.data("resource",b);
return c
},_updateResources:function(){var b=ROUTING.buildUrl("ResourceList",{type:"bibles",limit:this.options.numResourceLinks,contentType:"js",reference:this.options.reference});
a.ajax({url:b,success:a.proxy(function(c){this.regenList=a.proxy(function(){var g=this.jqLinksContainer.detach().empty();
var e=false;
var f=null;
var h=a.proxy(function(k){var i=this._makeResourceLink(k);
if(k.resourceName==this.resCurrent.resourceName){i.addClass("selected");
e=true
}g.append(i)
},this);
for(var j=0,d=c.resources.length;
j<d;
j++){h(c.resources[j])
}if(!e&&this.resCurrent){h(this.resCurrent)
}g.prependTo(this.jqContainer);
ui.roundCorners(g)
},this);
this.regenList();
if(!this.initialized){this.initialized=true;
this.jqContainer.append(this.jqMore)
}this._trigger("load")
},this)})
},_onResourceClick:function(f){f.preventDefault();
var d=a(f.target).closest("div");
if(d.hasClass("selected")){return
}var b=d.data("resource");
d.radioClass("selected");
var c=this.resCurrent;
this.resCurrent=b;
this._trigger("change",0,[b,c])
},_destroy:function(){this.jqMore.resourcepicker("destroy")
},options:{initialResourceInfo:null,reference:null,numResourceLinks:8}})
})(jQuery);
(function(a){a.fn.referenceCompare=function(b,e){var d=a.template(null,a("#reference-compare-template").html());
var c=a.extend({},a.fn.referenceCompare.defaults,b,{template:'<div class="ref-compare ui-corner-all"></div>',containerClass:"ref-compare",fnGetContent:function(h,g){var f=h.tmplItem();
if(!(f&&f.data)){return g(null)
}a.ajax({url:ROUTING.buildUrl("ReferenceCompare"),data:{reference:f.data.nav.reference.toUrlSafeString(),numVersions:a.fn.referenceCompare.defaults.numVersions,versionsToExclude:f.data.nav.resourceName},success:function(i){g(f.data.nav.reference.toUrlSafeString(),i)
},error:function(){g(null,null)
}})
},fnInsertContent:function(l,k){var g="Unable to load reference comparison";
if(l===null&&k===null){this.text(g);
return
}var j=null;
if(k&&k.results){var i=Logos.BibleReference.tryParse(l);
if(!i){this.text(g);
return
}var h={reference:i,results:[]};
for(var m in k.results){var o=k.results[m];
var f=new NavigationRequest({type:RESOURCE_TYPES.bible,resourceName:o.resourceName,reference:i});
h.results.push({title:o.abbreviatedTitle,text:o.preview,nav:f})
}j=a.tmpl(d,h);
var n=this;
this.delegate(".ref-compare-translation a","click",function(r){r.preventDefault();
var q=a(this);
var p=q.tmplItem();
if(!(p&&p.data&&p.data.nav)){return
}n.trigger(biblia.events.navigationRequest,p.data.nav)
})
}this.children(".ref-compare-header, .ref-compare-content").remove();
if(j){this.append(j)
}}});
this.baseTooltip(c,e)
};
a.fn.referenceCompare.defaults={numVersions:4,selector:".result-compare",bHoverShow:false,bShowLoading:true,exiterSelector:"a.x-close",collision:"fit flip"}
})(jQuery);
var ui=(function(){var a={};
a.roundCorners=function(c){var b=["left","right","top","bottom","tl","tr","br","bl"],d;
if(!Modernizr.borderradius){c.find(".ui-corner-all").not("input,button").corner("cc:#DCDCDC 5px");
$.each(b,function(e,f){c.find(".ui-corner-"+f).not("li").not("a").each(function(h,k){var g="#DCDCDC";
var j=$(this);
if(j.hasClass("toolbar-above")){g="#FAFAFA"
}j.corner(f+" 5px cc:"+g)
})
})
}};
a.ezpz=function(b){if(!Modernizr.input.placeholder){$("input[placeholder]",b).ezpz_hint({hintClass:"input-hint",attribute:"placeholder"})
}};
a.init=function(){function c(){function e(){var f=$('<div class="shadow-fallback-all"><div class="shadow-fallback-tl" /><div class="shadow-fallback-top" /><div class="shadow-fallback-tr" /><div class="shadow-fallback-right" /><div class="shadow-fallback-br" /><div class="shadow-fallback-bottom" /><div class="shadow-fallback-bl" /><div class="shadow-fallback-left" /></div>');
var i=$("#sidebar-offset");
if(i.length){f.clone().css({position:"absolute",top:"4px",right:"-7px",bottom:"4px",left:"-4px"}).insertBefore(i)
}var h=$("#content-main");
if(h.length){f.clone().css({position:"absolute",top:"-4px",right:"-4px",bottom:"-4px",left:"-4px"}).insertBefore(h)
}var g=$("#content-container");
if(g.length){f.clone().css({position:"absolute",top:"-4px",right:"-4px",bottom:"-4px",left:(g.position().left-4)+"px"}).insertBefore(g)
}$('<div class="shadow-fallback-bottom" />').insertAfter($("#selected-header")).clone().appendTo($("#infobar"))
}if(!Modernizr.boxshadow){link=document.createElement("link");
link.rel="stylesheet";
link.type="text/css";
link.href="/public/css/shadow-fallback.css";
document.getElementsByTagName("head")[0].appendChild(link);
e()
}a.roundCorners($("html"))
}function d(){a.ezpz($("body"));
var e=false;
$("input.resource-navigation").live("focusin",function(f){if(e){return
}(function(g){e=true;
setTimeout(function(){$(g).select();
e=false
},10)
})(this)
})
}function b(){$.fn.visualCue.defaults.styleOptions.color="#F25A1E"
}$("#set-mobile").click(function(f){f.preventDefault();
util.setCookie("ForceMobile",1,3650);
util.deleteCookie("NotMobile");
window.location.reload()
});
c();
biblia.signin.init();
d();
b()
};
return a
})();
var util={abortRequest:function(a){if(a){a.abort()
}return null
},sanitizeIdForSelector:function(a){return a?a.replace(/([.])/g,"\\$1"):null
},extend:function(b){function a(){}a.prototype=b.prototype||b;
return new a()
},argumentsArray:function(a){return Array.prototype.slice.call(a)
},getFormUrl:function(a,d){var b=a.attr("action");
var c=$.param(d);
return[b,(b.indexOf("?")>=0?"&":"?"),c,c?"&":"",a.serialize()].join("")
},escapeHTML:function(a){return a.split("&").join("&amp;").split("<").join("&lt;").split('"').join("&quot;")
},qualifyURL:function(a){var b=document.createElement("div");
b.innerHTML='<a href="'+util.escapeHTML(a)+'">x</a>';
return b.firstChild.href
},getCookieValue:function(a){if(document.cookie.length>0){var b=document.cookie.indexOf(a+"=");
if(b!=-1){b+=a.length+1;
var c=document.cookie.indexOf(";",b);
if(c==-1){c=document.cookie.length
}return unescape(document.cookie.substring(b,c))
}}return""
},setCookie:function(b,d,e){var c=new Date();
c.setDate(c.getDate()+e);
this.deleteCookie(b);
var a=[b,"=",escape(d),((typeof e!="number")?"":("; expires="+c.toUTCString())),"; path=/; domain=biblia.com"].join("");
document.cookie=[b,"=",escape(d),((typeof e!="number")?"":("; expires="+c.toUTCString())),"; path=/; domain=biblia.com"].join("")
},deleteCookie:function(a){var b=new Date();
b.setDate(b.getDate()-1);
document.cookie=[a,"=; expires=",b.toUTCString(),"; domain=biblia.com"].join("")
},getTitlePart:function(e,h){var k="",b="",j,c,d=[];
if(e&&typeof e!="string"&&e.render&&$.isFunction(e.render)){e=e.render()
}if(e&&e.indexOf(";")!==-1){j=e.split(";");
for(var f=0,l=j.length;
f<l;
f++){c=Logos.BibleReference.tryParse(j[f]);
if(c){d.push(c)
}}e=util.ellipsisize($.map(d,function(i){return i.toString(false,true)
}).join(", "),30)
}if(h){k=h.title||"";
b=h.abbreviatedTitle||""
}var g=e||k;
var a=[g];
if(b){a.push(" (",b,")")
}return a.join("")
},referenceToUrl:function(a){return a.toUrlSafeString?a.toUrlSafeString():a
},renderReference:function(a){return a.render?a.render():a
},addUrlParameter:function(c,a,b){return c+((/[?]/).test(c)?"&":"?")+a+"="+b
},loadScriptAsync:function(b,c){var a=document.createElement("script");
a.src=b;
if(c){a.onloadDone=false;
a.onload=c;
a.onreadystatechange=function(){if("loaded"===a.readyState&&!a.onloadDone){a.onloadDone=true;
a.onload()
}}
}document.getElementsByTagName("head")[0].appendChild(a)
},ellipsisize:function(g,c,a,f){var e;
var d="...";
g=g||"";
a=a===e?true:a;
f=f===e?true:f;
if(g.length>c&&g.length>d.length){var b=g.charAt(c-d.length);
g=g.substring(0,c-d.length);
if(a&&(/\w/).test(b)&&(/\w/).test(g[c-d.length-1])){g=g.replace(/[\w]*$/,"")
}if(f){g=g.replace(/\s*$/,"")
}g+="..."
}return g
},defaultTo:function(a,c){var b;
return(a===b)?c:a
},submitOnEnter:function(a){a.each(function(b,c){$(c).keydown(function(f){if(f.which==$.ui.keyCode.ENTER){f.preventDefault();
var d=$(c).closest("form");
if(d.length){d.submit()
}}})
})
},removeArrayValue:function(c,b){var a=$.inArray(b,c);
if(a!=-1){c.splice(a,1)
}},objectEquivalent:function(d,c){var g=0;
if(typeof d!="object"||typeof c!="object"){return false
}for(var f in d){if(!c[f]||(d[f]!=c[f]&&!util.objectEquivalent(d[f],c[f]))){return false
}g++
}var e=0;
for(var f in c){e++
}return g==e
},findClosestTopElement:function(d,c,b,a){return util.findTopInFrame(d,c,null,b,a)
},findTopInFrame:function(g,f,e,c,a){var d=g.find(a);
var b=null;
d.binarySearch(null,function(j,i){j=$(j);
var h=j.iposition();
if(c+h.top>f&&(e===null||c+h.top<e)){b=j;
return 1
}return -1
});
return b||null
},browserDetect:{init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";
this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";
this.OS=this.searchString(this.dataOS)||"an unknown OS"
},searchString:function(d){for(var a=0;
a<d.length;
a++){var b=d[a].string;
var c=d[a].prop;
this.versionSearchString=d[a].versionSearch||d[a].identity;
if(b){if(b.indexOf(d[a].subString)!=-1){return d[a].identity
}}else{if(c){return d[a].identity
}}}},searchVersion:function(b){var a=b.indexOf(this.versionSearchString);
if(a==-1){return
}return parseFloat(b.substring(a+this.versionSearchString.length+1))
},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari",versionSearch:"Version"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]}};
util.browserDetect.init();
window.log=(function(){var y=this,w=Array.prototype.slice,z=y.console,r={},v,u,q=9,x=["error","warn","info","debug","log"],n="assert clear count dir dirxml group groupEnd profile profileEnd time timeEnd trace".split(" "),p=n.length,A=[];
while(--p>=0){(function(a){r[a]=function(){q!==0&&z&&z[a]&&z[a].apply(z,arguments)
}
})(n[p])
}p=x.length;
while(--p>=0){(function(b,a){r[a]=function(){var c=w.call(arguments),d=[a].concat(c);
A.push(d);
s(d);
if(!z||!o(b)){return
}z.firebug?z[a].apply(y,c):z[a]?z[a](c):z.log(c)
}
})(p,x[p])
}function s(a){if(v&&(u||!z||!z.log)){v.apply(y,a)
}}r.setLevel=function(a){q=typeof a==="number"?a:9
};
function o(a){return q>0?q>a:x.length+q<=a
}r.setCallback=function(){var b=w.call(arguments),c=A.length,a=c;
v=b.shift()||null;
u=typeof b[0]==="boolean"?b.shift():false;
a-=typeof b[0]==="number"?b.shift():c;
while(a<c){s(A[a++])
}};
return r
})();
(function(a){a.fn.extend({radioClass:function(b){return this.each(function(){a(this).siblings().removeClass(b).end().addClass(b)
})
}})
})(jQuery);
(function(a){a.extend(a.fn,{binarySearch:function(g,c){var b=0;
var f=this.length-1;
var d;
var e;
while(b<=f){d=Math.floor((b+f)/2,10);
e=c(this[d],g);
if(e<0){b=d+1;
continue
}if(e>0){f=d-1;
continue
}return d
}return null
}})
})(jQuery);
(function(a){a.extend(a.fn,{isInDocument:function(){return a.contains(document.body,this.get(0))
},contains:function(b){return a.contains(this.get(0),b.get(0))
}})
})(jQuery);
(function(a){function b(e){var g=e.parent();
var d=g.contents().detach();
var c=d.index(e);
if(c<0||c>=d.length){return false
}var f=g.clone(true);
g.append(d.slice(0,c));
f.append(d.slice(c+1));
g.after(f).after(e);
return true
}a.extend(a.fn,{domSplit:function(c){return this.each(function(){var d=a(this);
var e=typeof c=="string"?d.closest(c):c;
while(a.contains(e.get(0),this)){b(d)
}})
}})
})(jQuery);
(function(b){var a={all:0,left:1,top:2,right:4,bottom:8,topleft:3,topright:6,bottomright:12,bottomleft:9};
b.widget("ui.svgRounded",{_create:function(){},_init:function(){var o=this;
this.jqContainer=this.element;
function p(r){return !!(r&a.bottom)
}function i(r){return !!(r&a.right)
}function s(r){return !!(r&a.top)
}function x(r){return !!(r&a.left)
}function l(r){return r+"px"
}this.jqBackground=b("<div></div>").addClass(this.options.classPrefix+"-background");
var h={top:parseInt(this.jqContainer.css("padding-top"),10),left:parseInt(this.jqContainer.css("padding-left"),10),bottom:parseInt(this.jqContainer.css("padding-bottom"),10),right:parseInt(this.jqContainer.css("padding-right"),10)};
h.horizontal=h.left+h.right;
h.vertical=h.top+h.bottom;
var k=this.jqContainer.width();
var j=this.jqContainer.height();
var c=k+h.horizontal;
var w=j+h.vertical;
var n=this.options.radius;
var d=this.options.cornerPosition;
var u=this.options.strokeWidth;
var e=u>1?u:0;
var m={width:c+2*u,height:w+2*u};
var f={left:u,top:u,width:c,height:w};
if(i(d)){m.width=c+e;
f.left=-n;
f.width=c+n
}else{if(x(d)){m.width=c+e;
f.width=c+n
}}if(p(d)){m.height=w+e;
f.top=-n;
f.height=w+n
}else{if(s(d)){m.height=w+e;
f.height=w+n
}}this.jqBackground.css({position:"absolute",top:"0",left:"0","margin-top":-u+"px","margin-left":-u+"px",overflow:"visible"});
var g=new Raphael(this.jqBackground[0],m.width,m.height);
var q=g.rect(f.left,f.top,f.width,f.height,n).attr({fill:this.jqContainer.css("background-color"),"stroke-opacity":0});
var v=g.rect(f.left-e/2,f.top-e/2,f.width+e,f.height+e,n+e/2).attr({"stroke-width":this.options.strokeWidth,stroke:this.options.strokeColor,"stroke-opacity":this.options.strokeOpacity});
v.toFront();
this.jqContainer.css("background","none");
this.jqContainer.css("border","none");
this.jqBackground.prependTo(this.jqContainer)
},options:{radius:16,strokeWidth:4,strokeOpacity:0.2,strokeColor:"#333",cornerPosition:a.all,classPrefix:"rounded"}});
b.fn.svgRounded.cornerLocs=a
})(jQuery);
(function(){var b=null;
var a=null;
$.extend($.expr[":"],{reference:function(f,g,k,j){var c=k[3];
var d;
if(a&&b===c){d=a
}else{b=c;
d=a=Logos.BibleReference.tryParse(c)
}var i=$(f).metadata({type:"html5"});
var h=i.reference;
if(h){var e=Logos.BibleReference.tryParse(i.reference);
return e&&e.equals(d)
}return false
}})
})();
(function(b){var a=b("<span>*</span>");
b.extend(b.fn,{iposition:function(){if(!this.length||navigator.userAgent.indexOf("AppleWebKit")===-1){return this.position()
}var d=this.first();
a.appendTo(d);
var c=d.position();
a.remove();
return c
}})
})(jQuery);
(function(a){a.fn.simpleTree=function(c){var b=this;
a.fn.simpleTree.ajaxQuery(c,this,true);
this.delegate(".simple-tree-expander","click",function(){var f=a(this);
var e=f.closest("li");
var d=e.children("ul");
if(d.length===0){a.fn.simpleTree.ajaxQuery(c,e)
}else{d.addClass("simple-tree-expanded")
}f.removeClass("simple-tree-expander").addClass("simple-tree-contractor")
});
this.delegate(".simple-tree-contractor","click",function(){var f=a(this);
var e=f.closest("li");
var d=e.children("ul");
if(d.length>0){d.removeClass("simple-tree-expanded")
}f.removeClass("simple-tree-contractor").addClass("simple-tree-expander")
});
return this
};
a.fn.simpleTree.loadData=function(e,d,b){var c=a("<ul></ul>");
if(b){d.addClass("simple-tree")
}c.addClass("simple-tree-expanded");
a.each(e,function(f,g){var k=a("<li></li>").attr(g.itemAttr||{});
if(g.itemMetadata){k.data(g.itemMetadata)
}var i=a("<div></div>").addClass("simple-tree-icon").appendTo(k);
var j=a("<a></a>").attr(g.anchorAttr||{}).text(g.title).appendTo(k);
if(g.hasChildren){var h=null;
if(g.children){loadData(g.children,k)
}if(e.isExpanded){i.addClass("simple-tree-contractor");
if(h&&h.length>0){h.addClass("simple-tree-expanded")
}}else{i.addClass("simple-tree-expander")
}}c.append(k)
});
d.append(c)
};
a.fn.simpleTree.ajaxQuery=function(d,c,b){a.ajax(a.extend({},d.ajax,{url:d.ajax.url+((d.getUrlSuffix&&a.isFunction(d.getUrlSuffix))?d.getUrlSuffix(c):""),data:(d.getParameters&&a.isFunction(d.getParameters))?d.getParameters(c):d.ajax.data||{},success:function(e){if(d.ajax.success&&a.isFunction(d.ajax.success)){d.ajax.success(e)
}a.fn.simpleTree.loadData((d.transformResult&&a.isFunction(d.transformResult))?d.transformResult(e):e||{},c,b)
}}))
}
})(jQuery);
$.widget("ui.ajaxscroll",{_create:function(){this.jqContainer=this.element;
if(!this.jqContainer.children().length){$('<div class="scrolling-content"><div class="content-wrapper"></div></div>').appendTo(this.jqContainer)
}this.jqScrollPlaceholder=this.jqContainer.find(".scrolling-content").first();
this.jqWrapper=this.jqContainer.find(".content-wrapper").first()
},_init:function(){var b=this;
this.currentUpRequest=this._abortRequest(this.currentUpRequest);
this.currentDownRequest=this._abortRequest(this.currentDownRequest);
this.requestList=[];
this.abortedList=[];
this.loadedUrls={};
this.contentChunkSelector="."+this.options.contentChunkClass;
if(this.options.clearInitialContent){this.jqWrapper.empty()
}var e=this.jqWrapper.find(this.contentChunkSelector).first();
var f;
var d=function(){if(typeof f==="number"){b._requestPage(b.options.fnGetRelativePositionUrl(f),"jump")
}};
var a=$.debounce(200,d);
this._checkJumpSoon=function(g){f=g;
a()
};
var c=-1;
this.fnScroll=$.throttle(300,$.proxy(function(){if(this.jqContainer.closest(":not(:visible)").length){return
}var g=b.jqContainer.scrollTop();
if(g==c){return false
}c=g;
this._checkScroll()
},this));
this._checkScrollSoon=$.debounce(20,this._checkScroll);
this._checkUnloadSoon=$.throttle(1000,this._checkUnload);
this.jqContainer.scroll(b.fnScroll);
this.loadedChunks={};
this.nTotalChunks=1;
this.bDensityInitialized=false;
this.fAverageDensity=2.5;
this.fLastScrollPosition=null;
this.fScrollHeight=0;
if(!this.ajaxLoadNotifier){this.ajaxLoadNotifier=new AjaxLoadNotifier($('<div class="ajax-loading ui"><img src="/public/images/ajax-loader.gif" />Loading</div>').appendTo(this.jqContainer))
}if(e.length){this._loadPage(this.options.fnGetPage(e),null)
}else{if(this.options.initialPageUrl){this._requestPage(this.options.initialPageUrl)
}}},_destroy:function(){this.jqContainer.unbind("scroll",this.fnScroll);
this.currentUpRequest=this._abortRequest(this.currentUpRequest);
this.currentDownRequest=this._abortRequest(this.currentDownRequest)
},_abortRequest:function(a){if(a&&a.request){if(a.url){this._removeRequest(a.url)
}this.abortedList.push(a.url);
a.request.abort()
}return null
},_pushRequest:function(a){this.requestList.push(a)
},_removeRequest:function(b){var a=$.inArray(b,this.requestList);
a!=-1&&this.requestList.splice(a,1)
},_getPrevUrl:function(){return this.jqWrapper.children(this.contentChunkSelector).first().data("prev")
},_getNextUrl:function(){return this.jqWrapper.children(this.contentChunkSelector).last().data("next")
},_getPositionData:function(){var a=this.jqContainer.scrollTop();
return{contentHeight:this.jqWrapper.height(),contentPosition:this.jqWrapper.data("top")||0,scrollTop:a,scrollPosition:(a/this.fScrollHeight)||0,scrollHeight:this.fScrollHeight,viewHeight:this.jqContainer.height()}
},_getSpacerElements:function(h,c,e){var g=Math.floor(h/c);
var d=h%c;
var l=$("<div></div>").addClass(e);
var k=$([]);
for(var f=0,j=g+1;
f<j;
f++){var a=f==g?d:c;
var b=l.clone();
b.height(a);
k=k.add(b[0])
}return k
},_setScrollHeight:function(b){var a=Math.round(b);
this.fScrollHeight=a;
var c=this._getSpacerElements(a,this.options.maxElementHeight,"scroll-spacing");
this.jqContainer.children(".scroll-spacing").remove();
this.jqContainer.append(c)
},_setContentPosition:function(a){if(a<0){this.options.debug&&log.error("Content position less than 0");
this.jqContainer.scrollTop(this.jqContainer.scrollTop()-a);
a=0
}this.jqWrapper.prevAll(".wrapper-spacing").remove();
var b=this._getSpacerElements(a,this.options.maxElementHeight,"wrapper-spacing");
b.insertBefore(this.jqWrapper);
this.jqWrapper.data("top",a)
},_doResizePage:function(a,e){var d=(e-a)/this.fAverageDensity;
if(d>8000000&&util.browserDetect.browser=="Explorer"&&util.browserDetect.version<9&&util.browserDetect.version>6){this.options.bVirtualizeScrollPosition=false;
return
}var b=this.jqWrapper.children(this.contentChunkSelector).first().data("indexedOffset");
var c=Math.round(d*(b-a)/(e-a));
this._setScrollHeight(d);
this._setContentPosition(c)
},_scalePage:function(h,c,d,i,e){var a=0;
var b=this._getPositionData();
var j;
log.group("ajaxscroll scalePage");
log.time("scalePage");
log.debug("initial position: ",b);
this.jqWrapper.children(this.contentChunkSelector).each(function(){a+=$(this).data("indexedLength")
});
if(!(d in this.loadedChunks)||e){var g=a/Math.max(1,b.contentHeight);
var f=e?this.loadedChunks[d]:0;
if(!this.options.bGuessDensity&&!this.bDensityInitialized){this.fAverageDensity=(g-(f||0))||0.1
}else{this.fAverageDensity=((this.fAverageDensity*this.nTotalChunks)+g-(f||0))/(this.nTotalChunks+1)
}this.nTotalChunks++;
this.loadedChunks[d]=g;
log.debug("avg density: ",this.fAverageDensity)
}this._doResizePage(h,c);
j=this._getPositionData();
log.debug("scaled position: ",j);
if(i!="jump"&&i!="tryjump"){this.jqContainer.scrollTop(Math.round(b.scrollPosition*j.scrollHeight))
}log.debug("final position: ",this._getPositionData());
log.timeEnd("scalePage");
log.groupEnd()
},_loadPage:function(f,h,b){this._removeRequest(b);
this.bSuppressScrollCheck=true;
var j=this;
if(h===null){h="jump"
}var i=h=="jump"||h=="tryjump";
var e=$(f?f.content:null);
if(!e.length){log.error("page has no content.",f);
return false
}function c(){var k=j._getPositionData();
$(this).css({height:"auto"});
if(h=="up"){j._setContentPosition(Math.round(k.contentPosition-this.clientHeight+17))
}}var a=e.find(".resourcetext img").height(0);
a.each(function(l,k){var m=$(k);
m.load(c);
if(k.complete||k.readyState===4){m.trigger("load")
}});
var d=this._getPositionData();
var g=f.targetSelector?e.find(f.targetSelector):[];
log.time("loadPage");
e.data({prev:f.prevPageUrl,next:f.nextPageUrl,indexedLength:f.chunkLength,indexedOffset:f.chunkOffset,hash:f.hash});
if(!e.isInDocument()&&!(f.hash&&this.loadedUrls[f.hash])){if(h=="up"){e.prependTo(this.jqWrapper);
this._setContentPosition(Math.round(d.contentPosition+(d.contentHeight-this.jqWrapper.height())))
}else{if(i){this._removeChunks(this.jqWrapper.children(this.contentChunkSelector))
}e.appendTo(this.jqWrapper)
}if(f.hash){this.loadedUrls[f.hash]=b
}}else{f.targetSelector=f.targetSelector||"."+this.options.contentChunkClass
}if(this.options.bVirtualizeScrollPosition&&i){this._scalePage(f.indexedResourceStart,f.indexedResourceEnd,f.hash,h)
}if(i){this.scrollToElement(f.targetSelector,true)
}this._trigger("chunkload",0,[h,g.length?g:undefined,f.targetSelector,f.chunkloadData]);
this.bSuppressScrollCheck=false;
this._checkScrollSoon();
log.timeEnd("loadPage");
log.groupEnd("ajaxscroll loadPage");
return true
},_requestPage:function(b,g,c,f){var a=this;
if($.inArray(b,this.requestList)==-1){function e(h){if(g=="down"){a.currentDownRequest=h
}else{a.currentUpRequest=h
}}if((g=="down"&&this.currentDownRequest)||this.currentUpRequest){return false
}if(g=="jump"||g=="tryjump"){this.currentDownRequest=this._abortRequest(this.currentDownRequest);
this.currentUpRequest=this._abortRequest(this.currentUpRequest)
}this._pushRequest(b);
var d=$.ajax({type:"GET",url:b,success:function(i){var h=$(i);
if(c){c(h?h.metadata():null)
}a._loadPage(a.options.fnGetPage(i),g||null,b)
},beforeSend:function(){if(a.options.bShowLoading){a.ajaxLoadNotifier.show()
}},complete:function(){if(a.options.bShowLoading){a.ajaxLoadNotifier.hide()
}e(null)
},error:function(){var h=$.inArray(b,a.abortedList);
if(h==-1){a._trigger("error",0,[g].concat(util.argumentsArray(arguments)));
if(f){f(util.argumentsArray(arguments))
}}else{a.abortedList.splice(h,1)
}a._removeRequest(b)
}});
e({request:d,url:b});
return true
}return false
},_removeChunks:function(a){var b=this;
$.each(a,function(){var c=$(this);
if(b.options.fnChunkRemove&&$.isFunction(b.options.fnChunkRemove)){b.options.fnChunkRemove(c)
}delete b.loadedUrls[c.data("hash")];
c.empty().remove()
})
},_checkScroll:function(){if(this.bSuppressScrollCheck){return
}var a=this._getPositionData();
if(a.viewHeight<1){log.error("Invalid position data.");
return
}var d=this._getPrevUrl();
var e=this._getNextUrl();
var b=a.scrollPosition*100;
log.time("ajaxscroll checkScroll");
if(a.contentPosition<a.scrollTop+a.viewHeight+this.options.edgeTriggerDistance&&a.contentPosition+a.contentHeight>a.scrollTop-this.options.edgeTriggerDistance){if(e&&(a.contentPosition+a.contentHeight<a.scrollTop+a.viewHeight+this.options.edgeTriggerDistance)){setTimeout($.proxy(function(){this._requestPage(e,"down")
},this),10)
}if(d&&a.contentPosition>a.scrollTop-this.options.edgeTriggerDistance){setTimeout($.proxy(function(){this._requestPage(d,"up")
},this),10)
}}else{if(this.options.bVirtualizeScrollPosition){this._checkJumpSoon(b)
}}if(this.options.unloadTriggerScreens>0&&(this.fLastScrollPosition===null||Math.abs(this.fLastScrollPosition.scrollTop-a.scrollTop)>200)){var c=this.fLastScrollPosition!==null&&this.fLastScrollPosition.scrollPosition<a.scrollPosition?"down":"up";
setTimeout($.proxy(function(){this._checkUnloadSoon(c)
},this),20);
this.fLastScrollPosition=a
}setTimeout($.proxy(function(){this._trigger("scroll",0,[a])
},this),50);
log.timeEnd("ajaxscroll checkScroll")
},_checkUnload:function(h){var d=this._getPositionData();
var g=d.viewHeight*this.options.unloadTriggerScreens;
if(this.jqScrollPlaceholder.isInDocument()){var c=this.jqScrollPlaceholder.find("."+this.options.contentChunkClass);
var e,f,b,a;
if(this.options.unloadTriggerScreens<1){return
}log.time("ajaxscroll checkUnload: "+h);
if(h=="down"){jqFirstChunk=c.eq(0);
b=jqFirstChunk.position();
a=jqFirstChunk.height();
if(b&&(d.scrollTop-d.contentPosition-a>g)){this._removeChunks(jqFirstChunk);
this._setContentPosition(Math.round(d.contentPosition+(d.contentHeight-this.jqWrapper.height())))
}}else{for(e=c.length-1;
e>=0;
e++){f=c.eq(e);
b=f.position();
if(b&&((d.contentPosition+b.top)-(d.scrollTop+d.viewHeight)>g)){this._removeChunks(f)
}else{break
}}}}log.timeEnd("ajaxScroll checkUnload: "+h)
},tryJumpTo:function(a,c,b){if(typeof a=="string"){return this._requestPage(a,"tryjump",$.proxy(function(d){this.currentUpRequest=this._abortRequest(this.currentUpRequest);
this.currentDownRequest=this._abortRequest(this.currentDownRequest);
this._removeChunks(this.jqWrapper.children(this.contentChunkSelector));
if(c){c(d)
}},this),b)
}else{return this._loadPage(a,null)
}},canScrollToElement:function(a){return this.jqWrapper.find(a).length!==0
},scrollToElement:function(a,e,f){var c=this.jqWrapper.find(a||"").first();
var h=0;
var b=!!c.length;
if(c.length){h=c.iposition().top
}if(b||e){var d=this.jqWrapper.position().top;
var g=d+h+this.options.scrollToElementPadding;
this.jqContainer.scrollTop(g)
}this._trigger("scrolltoelement",0,[c,b,f]);
return b
},scrollIntoView:function(c){var f=(typeof c=="string"?this.jqWrapper.find(c):c).first();
if(f.length){if(!this.jqWrapper.contains(f)){throw new Error("Element out of scope")
}nOffset=f.iposition().top;
var e=this._getPositionData();
var b=-1;
var a=e.contentPosition+nOffset;
var d=a+f.height()+16;
if(e.scrollTop>a){b=a
}else{if(e.scrollTop+e.viewHeight<d){b=d-e.viewHeight
}}if(b>=0){this.jqContainer.scrollTop(b)
}}},getChunkloadDataIdx:function(){return 3
},options:{fnGetPage:null,fnGetRelativePositionUrl:null,fnChunkRemove:null,edgeTriggerDistance:1200,unloadTriggerScreens:3,bVirtualizeScrollPosition:false,initialPageUrl:null,contentChunkClass:"content-chunk",containerPadding:24,clearInitialContent:false,bShowLoading:false,maxElementHeight:500000,scrollToElementPadding:0,debug:false,bGuessDensity:true}});
(function(a){a.fn.extend({visualCue:function(b){b=a.extend(a.fn.visualCue.defaults,b);
var e=a("<span>*</span>");
var c={bouncingcircle:function(i,h,j,f){f=a.extend({color:"red",r0:(b.size-4)/2,r1:20,r2:40,r3:0},f);
var g=i.circle(h.x,h.y,f.r0).attr({stroke:f.color,"stroke-width":3}).animate({r:f.r1,opacity:0.8},500,"<",function(){g.animate({r:f.r2},150,">",function(){g.animate({r:f.r3},500,"<",function(){j&&j()
})
})
})
},doublecircle:function(i,h,j,g){g=a.extend({color:"red",r0:(b.size-4)/2,r1:0},g);
i.circle(h.x,h.y,g.r0).attr({stroke:g.color,"stroke-width":3}).animate({r:g.r1,opacity:0.8},1000,"<");
var f=i.circle(h.x,h.y,g.r0).attr({stroke:g.color,"stroke-width":3});
setTimeout(function(){f.animate({r:g.r1,opacity:0.8},1000,"<",function(){j&&j()
})
},300)
}};
var d=function(f){if(b.fnError){b.fnError(f)
}};
return this.each(function(){var j=a(this);
e.appendTo(j);
var i=j.offset();
e.remove();
if(!i||(!i.top&&!i.left)){d("Element must be visible");
return
}var g=b.size/2;
var f=a("<div />").css({height:b.size,width:b.size,position:"absolute",top:Math.floor(i.top-g),left:Math.floor(i.left-g),zIndex:biblia.zindexes.popup}).appendTo(document.body);
var h=Raphael(f[0],b.size,b.size);
if(c[b.style]){c[b.style](h,{x:g,y:g},function(){f.remove()
},b.styleOptions)
}else{throw"Unknown visual cue"
}})
}});
a.fn.visualCue.defaults={size:124,style:"bouncingcircle",styleOptions:{},fnCallback:null,fnError:null}
})(jQuery);
(function(a){a.fn.snow=function(c,e){var f={flakes:20,flakeClass:"snowflake",trickle:false};
var d=a.extend(f,c);
if(!a("#snow-animation-style").length){var b=a("<style>",{id:"snow-animation-style",attr:{type:"text/css"}});
b.html("@-webkit-keyframes snowfall {from {top: 0%;-webkit-transform: rotate(0deg);}50% {-webkit-transform: rotate(360deg);}to {top: 100%;-webkit-transform: rotate(0deg);}}");
b.appendTo(a("head"))
}return this.each(function(){var g=a(this),m=a("<div></div>",{css:{position:"absolute",top:0,right:0,bottom:0,left:0,zIndex:-1,overflow:"hidden"}}),l=0;
function k(p,i){return p+(Math.random()*(i-p))
}function n(){var q=40,i=k(10,q),p=a("<span>*</span>");
p.css({position:"absolute",left:Math.round(k(0,100))+"%","-webkit-animation-name":"snowfall","-webkit-animation-iteration-count":"infinite","-webkit-animation-timing-function":"linear","-webkit-animation-duration":i+"s","font-size":(q-i)+10+"px"}).addClass(d.flakeClass);
return p
}function o(){return d.trickle?k(0,40*1000):0
}for(var h=0,j=d.flakes;
h<j;
h++){setTimeout(function(){m.append(n())
},o())
}m.appendTo(g)
})
}
})(jQuery);
function PanelBase(d,c,b){var a=this;
if(!d){throw new Error("Invalid container element.")
}this.jqContainer=typeof(d)=="string"?$(d):d;
this.strPanelId=c;
this.bIsMuted=!!b;
this.paneState=biblia.paneStates.normal;
this.eventQueue=[];
this.jqToolbar=this.jqContainer.find(".toolbar").first();
this.fnClick=function(g){var f=$(g.target).closest("a");
if(f.length){return a.onLinkClick.call(a,f,g)
}};
this.jqContainer.delegate(".resource-content, #library-content","click",this.fnClick)
}PanelBase.prototype.navigateTo=function(a){return false
};
PanelBase.prototype.onLinkClick=function(c,d){if(c.is('[rel="popup"]')){return true
}d.stopPropagation();
clearTimeout(c.data("tooltip.timer"));
var a=c.metadata();
var b=this.getNavigationRequestForLinkMetadata(a);
if(b){b.bIsUserInitiated=true;
this.navigateTo(b);
return false
}return true
};
PanelBase.prototype.getNavigationRequestForLinkMetadata=function(c){var b={};
var d=false;
for(var e in NavigationRequest.defaults){var a=e.toLowerCase();
if(c.hasOwnProperty(a)){b[e]=c[a];
d=true
}}if(!d){return null
}if(c.datatype&&c.datatype=="bible"){b.type=RESOURCE_TYPES.bible
}if(b.reference){b.reference=Logos.LocationMarker.tryParse(b.reference,b.reference)
}return new NavigationRequest(b)
};
PanelBase.prototype.reattachElements=$.noop;
PanelBase.prototype.detachElements=$.noop;
PanelBase.prototype.mute=function(){this.bIsMuted=true
};
PanelBase.prototype.unmute=function(){if(this.bIsMuted){this.bIsMuted=false;
this.eventQueue=[]
}};
PanelBase.prototype.setPaneState=function(a){this.paneState=a
};
PanelBase.prototype.trigger=function(c){var a=this;
var d=util.argumentsArray(arguments).slice(1);
var b=$.proxy(function(){this.jqContainer.trigger(c,d)
},this);
if(this.bIsMuted){this.eventQueue.push(b)
}else{setTimeout(b,0)
}};
PanelBase.prototype.unload=function(){this.jqContainer.unbind()
};
function ResourcePanel(j,i,b,a,c){PanelBase.call(this,j,i,b);
var k=this;
this.resourceInfo=null;
this.bIsLinked=false;
this.bIsLinkable=false;
this.bMinimalLayout=this.jqContainer.metadata().layout==="minimal";
this.bEmbeddedPreview=this.jqContainer.metadata().embeddedpreview;
this.jqResourceContent=a;
this.jqToolbar=this.jqContainer.find(".toolbar");
this.jqPanelMenu=$("#panel-menu").clone().attr("id","");
this.jqMenuBtn=this.jqToolbar.find(".toolbar-cover-section").first();
this.jqCard=this.jqResourceContent.closest(".card");
this.jqCloseBtn=this.jqToolbar.find(".x-flip").first();
this.strTooltipSelector=".resourcetext a";
this.strTooltipCollision=c?"flip flip":"fit fit";
this.jqToolbar.find(".toolbar-cover-section img").preload({placeholder:"/public/images/DefaultBookCover_small.png",notFound:"/public/images/DefaultBookCover_small.png"});
this.jqContainer.delegate(".table-of-contents a","click",function(p){var n=$(this);
if(!n.parent()||n.parent().data("offset")===undefined){throw new Error("ToC entry does not have valid parent element with offset data")
}var o=new NavigationRequest({resourceName:k.resourceInfo.resourceName,indexedOffset:n.parent().data("offset")});
k.navigateTo(o);
p.preventDefault()
});
this.onToCClick=function(o){var n=k.jqCard.find(".back .table-of-contents");
if(!n.children(".tree-area").is(".simple-tree")){k.initToC(n)
}k.setIsFlipped(null,"toc")
};
var f=this.jqToolbar.find(".resource-info-show").first();
f.click(function(n){k.setIsFlipped(true,"")
});
this.jqPanelMenu.add(this.jqToolbar).delegate(".toc-show","click",this.onToCClick);
this.jqCloseBtn.click(function(n){k.setIsFlipped(false)
});
this.jqPanelMenu.find(".link-panels").first().click(function(o){var n=$(this);
if(k.bIsLinkable){k.bIsLinked=!k.bIsLinked;
n.toggleClass("selected",k.bIsLinked);
k.trigger(biblia.events.panelsLinked,k.bIsLinked)
}});
function m(n){k.trigger(biblia.events.resizePane,biblia.paneStates.normal,k)
}this.jqToolbar.find(".close-expanded:first, .close-fullscreen:first").add(this.jqPanelMenu.find(".restore-pane:first")).click(function(){if(!$(this).hasClass("selected")){m()
}});
this.jqPanelMenu.find(".expand-pane:first, .fullscreen-pane:first").click(function(p){var o=$(this);
var n=o.hasClass("expand-pane")?biblia.paneStates.expanded:biblia.paneStates.fullscreen;
if(!o.hasClass("selected")){k.trigger(biblia.events.resizePane,n,k)
}});
var h=10;
this.defaultFontValue=4;
this.fontSizeEmDiff=0.125;
var e=0;
this.jqFontSlider=this.jqPanelMenu.find(".font-resize .slider");
function l(n,o){k.trigger(biblia.events.resizeFont,1+(o.value-k.defaultFontValue)*k.fontSizeEmDiff,function(){k.navigateTo(k.getCurrentPosition())
})
}this.jqFontSlider.slider({value:k.defaultFontValue,min:e,max:h,slide:l,change:function(n,o){if(!n.originalEvent){l(n,o)
}}});
this.jqPanelMenu.find(".small-font a").click(function(n){n.preventDefault();
n.stopPropagation();
k.jqFontSlider.slider("value",k.jqFontSlider.slider("value")-1)
});
this.jqPanelMenu.find(".large-font a").click(function(n){n.preventDefault();
n.stopPropagation();
k.jqFontSlider.slider("value",k.jqFontSlider.slider("value")+1)
});
for(var d=e+1;
d<h;
d++){var g=$("<div></div>").addClass("notch").css("left",d*10+"%");
if(d==this.defaultFontValue){g.addClass("defaultNotch")
}this.jqFontSlider.append(g)
}this.onMenuDisplay=function(){k.jqPanelMenu.find(".toc-show").toggleClass("selected",k.jqCard.hasClass("flipped")&&k.jqCard.children(".back").first().hasClass("toc"));
k.jqPanelMenu.find(".link-panels").toggleClass("disabled",!k.bIsLinkable).toggleClass("selected",k.bIsLinked);
k.jqPanelMenu.find(".restore-pane").toggleClass("selected",k.paneState===biblia.paneStates.normal);
k.jqPanelMenu.find(".expand-pane").toggleClass("selected",k.paneState===biblia.paneStates.expanded);
k.jqPanelMenu.find(".fullscreen-pane").toggleClass("selected",k.paneState===biblia.paneStates.fullscreen);
k.jqPanelMenu.find(".menu-option:not(.disabled)").click(function(n){k.jqMenuBtn.dropdown("clickHidePanel",n)
})
};
this.setMenuButton(this.jqMenuBtn);
this.secondsBeforeSync=10;
this.syncTimer=null;
if(user.isAuthenticated){this.syncPosition=$.debounce(this.secondsBeforeSync*1000,function(p,o,n){k.trigger(biblia.events.syncPosition,p,o,n)
})
}else{this.syncPosition=$.noop
}}ResourcePanel.prototype=util.extend(PanelBase);
ResourcePanel.prototype.init=function(){this.initResourceTitle();
this.initTooltip()
};
ResourcePanel.prototype.setMenuButton=function(a){this.jqMenuBtn=a;
this.jqMenuBtn.dropdown({jqPanel:this.jqPanelMenu,fnOnDisplay:this.onMenuDisplay,strBtnActiveClass:"active"})
};
ResourcePanel.prototype.initResourceTitle=function(){var b=this.jqToolbar.find(".resource-title").first(),a=this.jqToolbar.width();
if(b.width()>(this.bMinimalLayout?a/4:a/2-this.jqMenuBtn.width())){b.html(util.ellipsisize(this.resourceInfo.abbreviatedTitle,15)+'&nbsp;<div class="arrow"></div>')
}};
ResourcePanel.prototype.initTooltip=function(){var a=this;
this.jqResourceContent.tooltip({selector:this.strTooltipSelector,fnClickStick:function(b){return b.is('[rel="popup"]')
},onLinkClick:this.fnClick,fnGetContent:function(g,f){var c=g.metadata();
if(g.is('[rel="popup"][data-content]')){var e=$(c.content);
f($.trim(e.text())?e:biblia.resourcestrings.tooltipError)
}else{var d=a.getNavigationRequestForLinkMetadata(c);
function b(h){var i=a.adjustRequestUrl(h.toUrl("js",true,false,true));
if(!i){return
}$.ajax({url:i,success:function(k){var j=[];
if(k.refRequested){j.push(k.refRequested)
}if(k.resourceName&&k.resourceTitle&&k.resourceName!=a.getCurrentResourceName()){j.push(k.resourceTitle)
}f(k.content,j.join(" | ")||null)
},error:function(){f(biblia.resourcestrings.tooltipError)
}})
}if(d){if(!d.resourceName&&d.reference instanceof Logos.BibleReference){a.trigger(biblia.events.informationRequest,[d,b])
}else{b(d)
}}else{f(biblia.resourcestrings.tooltipError)
}}},collision:this.strTooltipCollision})
};
ResourcePanel.prototype.cancelTooltips=function(){this.jqResourceContent.tooltip(null,"cancel")
};
ResourcePanel.prototype.setIsFlipped=function(b,c){var a=this.jqCard.children(".back").first();
if(b===null&&c&&a.hasClass(c)){this.jqCard.toggleClass("flipped")
}else{this.jqCard.toggleClass("flipped",b!==null?b:true)
}if(this.jqCard.hasClass("flipped")){this.jqToolbar.find(".toolbar-bottom-section").toggleClass("flipped",true)
}else{this.jqToolbar.find(".toolbar-bottom-section").toggleClass("flipped",false)
}a.toggleClass("toc",c==="toc")
};
ResourcePanel.prototype.setFontSizerLocation=function(a){this.jqFontSlider.slider("value",this.defaultFontValue+(a-1)/this.fontSizeEmDiff)
};
ResourcePanel.prototype.onLinkClick=function(a,b){return PanelBase.prototype.onLinkClick.apply(this,util.argumentsArray(arguments))
};
ResourcePanel.prototype.getCurrentResourceName=function(){return this.resourceInfo?(this.resourceInfo.resourceName||null):null
};
ResourcePanel.prototype.getCurrentPosition=function(){throw new Error("getCurrentPosition must be implemented by the concrete class.")
};
ResourcePanel.prototype.initToC=function(b){var a=this;
b.children(".tree-area").simpleTree({ajax:{url:ROUTING.buildUrl("TableOfContents",{resourceName:a.resourceInfo.resourceName}),error:function(){log.error("jsTree request fail",arguments);
a._trigger("error",0,[direction].concat(util.argumentsArray(arguments)))
}},getUrlSuffix:function(c){if(c&&c!=-1){return c.data("path")||""
}return""
},getParameters:function(c){if(c&&c!=-1){return{groupOffset:c.data("group-offset"),groupSize:c.data("group-size")}
}return null
},transformResult:function(c){function d(f){if(!f){return null
}var e={title:f.title,anchorAttr:{href:ROUTING.buildUrl("Offset",{resourceName:a.resourceInfo.resourceName,offset:f.indexedOffset})},itemMetadata:{path:f.path.toString(),"group-offset":f.groupOffset,"group-size":f.groupSize,offset:f.indexedOffset},hasChildren:f.hasChildren,isExpanded:false};
if(f.children){e.children=$.map(f.children,d)
}return e
}return $.map(c,d)
}})
};
ResourcePanel.prototype.setLinkable=function(a){this.bIsLinkable=a;
this.bIsLinked=this.bIsLinked&&this.bIsLinkable
};
ResourcePanel.prototype.setLinked=function(a){this.bIsLinked=a
};
ResourcePanel.prototype.unload=function(){this.jqResourceContent.tooltip({selector:this.strTooltipSelector},"destroy");
this.jqPanelMenu.add(this.jqToolbar).undelegate(".toc-show","click",this.onToCClick);
PanelBase.prototype.unload.call(this)
};
ResourcePanel.prototype.adjustRequestUrl=function(a){return this.bEmbeddedPreview?util.addUrlParameter(a,"embeddedPreview",true):a
};
function DocumentPanel(c,b,a){PanelBase.call(this,c,b,a)
}DocumentPanel.prototype=util.extend(PanelBase);
DocumentPanel.prototype.init=function(){};
function PagedResourcePanel(i,h,d,a,b){ResourcePanel.call(this,i,h,d,a);
var j=this;
this.jqContentWrapper=b;
this.bLock=null;
this.strTooltipSelector=".resourcetext a";
this.resetLinkStatusTimer=null;
this.bNavWasLinked=false;
this.curArticleId=null;
this.curIndexedOffset=null;
this.jqReferenceInput=this.jqContainer.find(".toolbar input[name='input']").first().focus(function(k){$(this).data("hasFocus",true)
}).blur(function(k){$(this).data("hasFocus",false)
});
this.strLastLocInput="";
if(this.jqResourceContent){var c=this.jqResourceContent.find(".content-chunk").first();
if(c.length){var f=c.metadata().resource;
var g=[f,this.resourceInfo];
this.resourceInfo=f;
this.trigger(biblia.events.resourceChange,g);
this.updateMilestoneNow()
}}this.updateMilestoneSoon=$.throttle(350,this.updateMilestoneNow);
function e(){j.bNavWasLinked=false
}this.resetLinkStatusSoon=function(){clearTimeout(this.resetLinkStatusTimer);
this.resetLinkStatusTimer=setTimeout(e,2000)
}
}PagedResourcePanel.prototype=util.extend(ResourcePanel);
PagedResourcePanel.prototype.init=function(){var a=this;
this.jqResourceContent.ajaxscroll({fnGetPage:$.proxy(this.ajaxScrollGetPage,this),fnGetRelativePositionUrl:$.proxy(this.getRelativePositionUrl,this),fnChunkRemove:function(b){b.tooltip({selector:a.strTooltipSelector},"destroy")
},chunkload:$.proxy(this.onChunkLoad,this),scroll:$.proxy(this.onScroll,this),scrolltoelement:$.proxy(this.onScrollToElement,this),error:$.proxy(this.onError,this),edgeTriggerDistance:800,unloadTriggerScreens:4,bVirtualizeScrollPosition:true,scrollToElementPadding:-20});
ResourcePanel.prototype.init.call(this)
};
PagedResourcePanel.prototype.triggerLocationMarkerChange=function(c,b,a){if(!c){return null
}if(!(c instanceof Logos.LocationMarker)){throw new Error('Parameter "loc" passed to triggerLocationMarkerChange must be of type Logos.LocationMarker')
}if(a?!c.isEqualOrLessSpecificThan(this.locationCurrent):!c.equals(this.locationCurrent)){this.trigger(biblia.events.locationMarkerChange,[c,this.locationCurrent,b])
}};
PagedResourcePanel.prototype.setLocationMarker=function(a,c){var b=a?a.render():"";
if(!c||!this.jqReferenceInput.data("hasFocus")){this.jqReferenceInput.val(b)
}this.strLastLocInput=b;
this.locationCurrent=a;
if(a){this.syncPosition(a instanceof Logos.Reference?"SyncWriteReference":"SyncWriteHeadword",this.resourceInfo.resourceName,a.toUrlSafeString())
}else{this.syncPosition("SyncWriteOffset",this.resourceInfo.resourceName,this.curIndexedOffset)
}};
PagedResourcePanel.prototype.getCurrentResourceName=function(){return this.resourceInfo?(this.resourceInfo.resourceName||null):null
};
PagedResourcePanel.prototype.updateMilestoneNow=function(f){var b=this;
var g=this.jqResourceContent.scrollTop();
var d=this.jqContentWrapper.data("top")||0;
if(!this.updateMilestoneCore||this.bLock){return
}function e(h){return util.findClosestTopElement(b.jqResourceContent,g,d,h)
}function c(){var j=g+b.jqResourceContent.height();
var h=a?a.closest(".content-chunk"):null;
if(h===null){h=util.findTopInFrame(b.jqResourceContent,g,j,d,".content-chunk")
}if(h){var i=h.metadata();
if(i&&i.article){b.curArticleId=i.article.articleId||null;
b.curIndexedOffset=i.article.offset||null
}else{b.curArticleId=null;
b.curIndexedOffset=null
}}}var a=null;
if(f=="milestone"||f=="ms"){a=e("a[rel='milestone']")
}else{if(f=="headword"||f=="hw"){a=e("span[rel='headword']")
}else{if(f=="abs"){a=e("a[rel='milestone'],span[rel='headword']")
}else{a=e("a[rel='milestone']")||e("span[rel='headword']")
}}}c();
this.updateMilestoneCore(a)
};
PagedResourcePanel.prototype.ajaxScrollGetPage=function(){return this.ajaxScrollGetPageCore.apply(this,util.argumentsArray(arguments))
};
PagedResourcePanel.prototype.ajaxScrollGetPageCore=function(c){var a=$(c);
if(!a.length){return null
}var b=a.metadata();
if(!b){return null
}if(user.isAuthenticated){ReadingPlanManager.processContentChunk(a)
}var d=b.article;
var e=b.resource;
if(!d||!e){return null
}if(d.requestedReference&&!this.bLock){this.setRequestedReference(d.requestedReference,d.requestedReferenceUrl)
}return this.filterPageData({content:a,prevPageUrl:d.prevArticleId?this.adjustRequestUrl(ROUTING.buildUrl("Article",{resourceName:e.resourceName,articleId:d.prevArticleId,contentType:"xhtml"})):null,nextPageUrl:d.nextArticleId?this.adjustRequestUrl(ROUTING.buildUrl("Article",{resourceName:e.resourceName,articleId:d.nextArticleId,contentType:"xhtml"})):null,indexedResourceStart:d.resourceStart,indexedResourceEnd:d.resourceStart+d.resourceLength,chunkOffset:d.offset,chunkLength:d.length,hash:d.articleId,targetSelector:d.targetId?"#"+d.targetId:null,metadata:d},d.requestedReference)
};
PagedResourcePanel.prototype.filterPageData=function(a){return a
};
PagedResourcePanel.prototype.setRequestedReference=function(a,b,d){if(!a){return
}if(typeof a!=="string"){throw new Error("Parameter strLocRequested passed to PagedResourcePanel.setRequestedReference must be of type string")
}var c=Logos.LocationMarker.tryParse(a,b);
if(c){d&&d(c);
this.lockReference();
this.setLocationMarker(c)
}};
PagedResourcePanel.prototype.detachElements=function(){this.detachedElements=this.jqContentWrapper.children().detach()
};
PagedResourcePanel.prototype.reattachElements=function(){if(this.detachedElements){this.jqContentWrapper.append(this.detachedElements);
this.detachedElements=null
}};
PagedResourcePanel.prototype.getOffsetNavRequest=function(){if(this.curIndexedOffset){return new NavigationRequest({resourceName:this.resourceInfo.resourceName,indexedOffset:this.curIndexedOffset})
}return null
};
PagedResourcePanel.prototype.getRelativePositionUrl=function(a){return this.adjustRequestUrl(ROUTING.buildUrl("Position",{resourceName:this.getCurrentResourceName(),position:a,contentType:"xhtml"}))
};
PagedResourcePanel.prototype.onChunkLoad=function(b,a){if(a[0]!="jump"){this.extendLock()
}};
PagedResourcePanel.prototype.onScroll=function(b,a){if(this.bNavWasLinked){this.resetLinkStatusSoon()
}if(this.onScrollCore){this.onScrollCore.apply(this,util.argumentsArray(arguments))
}this.updateMilestoneSoon()
};
PagedResourcePanel.prototype.onScrollToElement=$.debounce(400,function(c,b){if(this.bNavWasLinked){this.resetLinkStatusSoon();
return
}if(!b){return
}var d=b[0];
var a=b[1];
if(d&&d.is('.requested-position,[rel="milestone"],[rel="headword"]')&&a){if(!this.bIsMuted&&!(b[2] instanceof NavigationRequest&&b[2].bIsLinkRequest)){d.visualCue()
}}});
PagedResourcePanel.prototype.lockReference=function(){var a=this;
this.bLock=setTimeout(function(){a.unlockReference()
},3000)
};
PagedResourcePanel.prototype.extendLock=function(){if(this.bLock){this.unlockReference();
this.lockReference()
}};
PagedResourcePanel.prototype.unlockReference=function(){if(this.bLock){clearTimeout(this.bLock);
this.bLock=null
}};
PagedResourcePanel.prototype.onError=function(a,b){if(b[0]!=="tryjump"){this.trigger(biblia.events.info,{nLevel:$.fn.infobar.levels.error,strMsg:biblia.resourcestrings.resourceScrollError})
}};
PagedResourcePanel.prototype.getCurrentPosition=function(){throw new Error("getCurrentPosition must be implemented by the concrete class.")
};
PagedResourcePanel.prototype.onLinkClick=function(a,b){return PanelBase.prototype.onLinkClick.apply(this,util.argumentsArray(arguments))
};
PagedResourcePanel.prototype.canNavigateTo=function(c,e,g,b,a){c=$.extend({},c);
if(c.resourceName!==this.getCurrentResourceName()){if(c.resourceName||(c.isBibleRequest()&&this.resourceInfo.type!==RESOURCE_TYPES.bible)){g();
return
}}if(c.urlLocationMarker){c.resourceName=this.getCurrentResourceName()
}var d=c.reference;
if(d instanceof Logos.BibleReference&&this.resourceInfo.type==RESOURCE_TYPES.bible&&this.jqResourceContent.ajaxscroll("canScrollToElement",this.getSelectorForReference(d))){e();
return
}var f=this.adjustRequestUrl(c.toUrl("xhtml",false,a,b,false,true));
$.ajax({type:"GET",url:f,success:function(j){var h=null;
var i=$(j);
if(j&&i.length){h=i.metadata()
}if((b&&c.urlLocationMarker)||(h&&h.resource&&h.resource.resourceName==c.resourceName)){e()
}else{g()
}},error:function(h){g(h)
}})
};
PagedResourcePanel.prototype.navigateTo=function(f,a,e){var c=this;
var b=true;
if(f.resourceName!==this.getCurrentResourceName()){if(f.resourceName||(f.isBibleRequest()&&this.resourceInfo.type!==RESOURCE_TYPES.bible)){this.trigger(biblia.events.navigationRequest,f);
return
}b=false
}if(!f.resourceName){f=$.extend({},f);
f.resourceName=this.getCurrentResourceName()
}var g=this.adjustRequestUrl(f.toUrl("xhtml",false,b,e,false,true));
var h=f.reference;
if(!h||!(h instanceof Logos.LocationMarker)){h=f.headword
}this.lockReference();
function d(){c.trigger(biblia.events.userJump,f)
}if(h instanceof Logos.BibleReference&&c.jqResourceContent.ajaxscroll("scrollToElement",this.getSelectorForReference(h),false,f)){this.triggerLocationMarkerChange(h,f.bIsLinkRequest);
this.setLocationMarker(h);
if(f.bIsUserInitiated){d()
}if(a&&$.isFunction(a)){a()
}}else{this.canNavigateTo(f,function(){c.jqResourceContent.ajaxscroll("tryJumpTo",g,function(i){if(i.resource&&i.resource.resourceName!==c.getCurrentResourceName()){c.trigger(biblia.events.navigationRequest,new NavigationRequest({resourceName:i.resource.resourceName,indexedOffset:i.article.offset,type:c.getCurrentPosition().type,bIsUserInitiated:f.bIsUserInitiated}));
return
}var j=Logos.LocationMarker.tryParse(i.article.requestedReference,i.article.urlReference||i.article.requestedReference,i.article.requestedReferenceType);
var k=h&&j instanceof Logos.BibleReference&&!f.bIsLinkRequest&&h.isEqualOrLessSpecificThan(j)?h:j;
if(k){c.triggerLocationMarkerChange(k,f.bIsLinkRequest);
c.setLocationMarker(k);
c.lockReference();
if(f.bIsUserInitiated){d()
}}else{c.jqReferenceInput.val(c.strLastLocInput);
c.unlockReference()
}},function(j){c.jqReferenceInput.val(c.strLastLocInput);
var i="";
if(j[0].status===404){i="Not found"
}else{if(j[0].status===403){i="You do not have access to that resource"
}else{if(j[0].status===500){i="There has been an error"
}}}c.trigger(biblia.events.info,{nLevel:$.fn.infobar.levels.error,strMsg:"Unable to navigate to that location"+(i?": "+i:"")})
},$.noop)
},function(){if(f.bPreventPropagation){c.jqReferenceInput.val(c.strLastLocInput)
}else{f.resourceName=null;
c.trigger(biblia.events.navigationRequest,f)
}},e,b);
this.bNavWasLinked=!!f.bIsLinkRequest
}if(!f.bIsLinkRequest){biblia.history.trackPageView(g)
}this.setIsFlipped(false);
return true
};
PagedResourcePanel.prototype.getSelectorForReference=function(a){var b=a.isRange?a.startReference:a;
return"a[rel='milestone']:reference("+util.sanitizeIdForSelector(b.render())+")"
};
PagedResourcePanel.prototype.unload=function(){this.jqResourceContent.ajaxscroll("destroy");
ResourcePanel.prototype.unload.call(this)
};
function BiblePanel(d,c,b){PagedResourcePanel.call(this,d,c,b,d.find(".resource-content").first(),d.find(".content-wrapper").first());
var a=this;
this.refHighlight=null;
this.highlighter=new Highlighter(this.jqResourceContent);
this.jqReferenceInput.attr("placeholder","Reference");
this.highlightNow=function(){if(this.refHighlight.isRange){this.highlighter.highlight(this.refHighlight.startReference,this.refHighlight.endReference)
}else{this.highlighter.highlight(this.refHighlight)
}};
this.highlightSoon=$.debounce(200,this.highlightNow);
this.jqReferenceInput.closest("form").submit(function(g){var f=Logos.BibleReference.tryParse(a.jqReferenceInput.val());
a.unlockReference();
g.preventDefault();
a.highlighter.unhighlight();
if(f===null){a.jqReferenceInput.val(a.strLastLocInput||"")
}else{a.refHighlight=f;
a.navigateTo(new NavigationRequest({resourceName:a.getCurrentResourceName(),reference:f,bPreventPropagation:true,bIsUserInitiated:true}),$.proxy(function(){a.highlightNow()
},a))
}});
this.shareButton=new ShareButton(this.jqToolbar.find(".toolbar-bottom-section"));
this.shareButton.setShareInfo(this.getCurrentPosition(),this.resourceInfo,true);
this.jqContainer.bind(biblia.events.locationMarkerChange,function(g,f){a.shareButton.setShareInfo(a.getCurrentPosition(),a.resourceInfo,true)
});
this.init()
}BiblePanel.prototype=util.extend(PagedResourcePanel);
BiblePanel.prototype.updateMilestoneCore=function(a){var b=a===null?null:Logos.LocationMarker.tryParse(a.metadata().reference);
this.triggerLocationMarkerChange(b,this.bNavWasLinked);
this.setLocationMarker(b,true)
};
BiblePanel.prototype.setRequestedReference=function(b){var a=this;
PagedResourcePanel.prototype.setRequestedReference.call(this,b,"reference",function(c){log.debug("setting refHighlight: ",c);
a.refHighlight=c
})
};
BiblePanel.prototype.filterPageData=function(c,b){if(b&&!c.targetSelector){var a=Logos.BibleReference.tryParse(b);
if(a){c.targetSelector=this.getSelectorForReference(a)
}}return c
};
BiblePanel.prototype.onChunkLoad=function(c,a){var b=a[0];
if(this.refHighlight){if(!this.highlighter.update()){if(b=="jump"){this.highlightSoon()
}else{this.highlightNow()
}}}else{log.debug("no reference to highlight")
}PagedResourcePanel.prototype.onChunkLoad.apply(this,util.argumentsArray(arguments))
};
BiblePanel.prototype.getCurrentPosition=function(){return new NavigationRequest({resourceName:this.getCurrentResourceName(),reference:this.locationCurrent,type:RESOURCE_TYPES.bible,indexedOffset:this.curIndexedOffset,articleId:this.curArticleId})
};
BiblePanel.prototype.onLinkClick=function(d,e){var c=d.metadata();
if(c.reference){var b=Logos.BibleReference.tryParse(c.reference,c.datatype);
log.debug("Reference link click",b);
var a=c.resourcename?c.resourcename==this.getCurrentResourceName():true;
if(b&&a){this.navigateTo(new NavigationRequest({resourceName:this.getCurrentResourceName(),reference:b,bIsUserInitiated:true}));
return
}}PagedResourcePanel.prototype.onLinkClick.apply(this,util.argumentsArray(arguments))
};
function MediaPanel(g,f,c){ResourcePanel.call(this,g,f,c,g.find(".resource-content").first());
var e=this.jqContainer.find(".content-media").first().metadata();
this.resourceInfo=e.resource;
this.init();
this.jqImgSection=this.jqResourceContent.find(".media-image-section");
this.jqInfoSection=this.jqResourceContent.find(".media-information-section");
this.bLoading=false;
var b=this;
function a(){b.descHeight=Math.max(parseInt(b.jqInfoSection.css("min-height"),10)+b.infoPadding,b.jqInfoSection.find(".media-description-section").outerHeight()+b.infoPadding);
var h=Math.min(b.imgHeight,b.jqResourceContent.outerHeight()-b.descHeight-b.imgMargin);
b.jqImgSection.find(".media-placeholder").css("height",h+"px");
b.jqInfoSection.css("top",b.jqImgSection.outerHeight()+b.imgMargin+"px");
return h
}this.mediaInit=function(l,h){if(!h){h=b.jqResourceContent
}h.css("overflow","hidden");
b.indexedOffset=l.offset;
var p=h.find(".media-nav-left");
var i=h.find(".media-nav-right");
b.prevOffset=p.length?p.metadata().offset:null;
b.nextOffset=i.length?i.metadata().offset:null;
b.imgWidth=l.width;
b.imgHeight=l.height;
b.jqImgSection=h.find(".media-image-section");
b.jqInfoSection=h.find(".media-information-section");
b.imgMargin=2*12;
b.infoPadding=parseInt(b.jqInfoSection.css("padding-top"),10)+parseInt(b.jqInfoSection.css("padding-bottom"),10);
b.mediaTitle=l.title;
b.shareButton.setShareInfo(b.getCurrentPosition(),b.resourceInfo,false,b.mediaTitle);
var j=a();
var n=b.jqImgSection.find(".media-ajax-loading");
n.css("left",(b.jqImgSection.width()/2-n.width()/2)+"px");
n.show();
var m=b.getCurrentResourceName();
var k=[];
l.nextimg&&k.push(ROUTING.buildUrl("Media",{resourceName:m,path:l.nextimg}));
l.previmg&&k.push(ROUTING.buildUrl("Media",{resourceName:m,path:l.previmg}));
h.find(".media-related").each(function(){k.push(ROUTING.buildUrl("Media",{resourceName:m,path:$(this).metadata().path}))
});
$.preload(k);
var o=$("<img />",{src:l.src,width:l.width,"class":"media-image"});
function q(){b.jqImgSection.attr("title",b.mediaTitle).children().remove();
o.appendTo(b.jqImgSection);
if(o.height()!=j){var r=j/b.imgHeight;
o.css({width:Math.max(Math.round(b.imgWidth*r),20)+"px",top:b.imgMargin+"px"})
}setTimeout(a,0);
h.find(".media-nav-left, .media-nav-right").appendTo(h).css("display","inline-block")
}if(o[0].complete||o[0].readyState===4){q()
}else{o.load(q)
}b.syncPosition("SyncWriteOffset",b.resourceInfo.resourceName,b.indexedOffset,0);
setTimeout(function(){b.jqContainer.trigger(biblia.events.userJump,b.getCurrentPosition());
b.trigger(biblia.events.changePageTitleRequest,{title:l.title,url:l.url})
},0);
b.jqContainer.find(".card").focus()
};
function d(){var h=a();
var j=b.jqImgSection.find("img");
if(j.height()!=h){var i=h/b.imgHeight;
j.css({width:Math.max(Math.round(b.imgWidth*i),20)+"px"})
}}$(window).resize(function(h){d()
});
this.jqContainer.bind(biblia.events.paneResized,function(i,h){d();
d()
});
this.shareButton=new ShareButton(this.jqToolbar.find(".toolbar-bottom-section"));
this.mediaInit(e);
this.jqToolbar.find(".resource-navigation-form").remove();
this.jqContainer.delegate(".card","keydown",function(h){if(!b.bLoading){if(h.which==$.ui.keyCode.LEFT&&b.prevOffset){h.preventDefault();
b.navigateTo(new NavigationRequest({resourceName:b.resourceInfo.resourceName,indexedOffset:b.prevOffset,type:RESOURCE_TYPES.media}),null,b.prevOffset,true)
}if(h.which==$.ui.keyCode.RIGHT&&b.nextOffset){h.preventDefault();
b.navigateTo(new NavigationRequest({resourceName:b.resourceInfo.resourceName,indexedOffset:b.nextOffset,type:RESOURCE_TYPES.media}),null,b.nextOffset,true)
}}})
}MediaPanel.prototype=util.extend(ResourcePanel);
MediaPanel.prototype.getCurrentPosition=function(){return new NavigationRequest({resourceName:this.getCurrentResourceName(),indexedOffset:this.indexedOffset,type:RESOURCE_TYPES.media})
};
MediaPanel.prototype.init=function(){var a=this;
ResourcePanel.prototype.init.call(this)
};
MediaPanel.prototype.navigateTo=function(c,a,e,d){var b=this;
if(c.resourceName!==this.getCurrentResourceName()){this.trigger(biblia.events.navigationRequest,c);
return
}if(c.type==RESOURCE_TYPES.media||c.indexedOffset){if(!e||!d){b.jqResourceContent.empty()
}if(!b.bLoading){b.bLoading=true;
$.ajax({url:c.toUrl("xhtml"),success:function(i){var j=$(i);
if(e&&d){var k=b.jqResourceContent.clone().empty();
var g="";
var f="";
if(b.indexedOffset<e){f="-"
}else{g="-"
}k.append(j).appendTo(b.jqResourceContent.parent());
var h=k.outerWidth()+"px";
k.css({left:g+h,right:f+h}).animate({left:"0",right:"0"},800);
b.jqResourceContent.animate({left:f+h,right:g+h},800,function(){b.jqResourceContent.remove();
b.jqResourceContent=k;
b.bLoading=false;
b.initTooltip()
});
b.jqResourceContent.find(".media-nav-left, .media-nav-right").remove();
b.mediaInit(j.metadata(),k)
}else{b.jqResourceContent.append(j);
b.mediaInit(j.metadata());
b.bLoading=false
}}})
}}this.setIsFlipped(false)
};
MediaPanel.prototype.onLinkClick=function(a,b){if(a.is(".media-nav")){b.stopPropagation();
this.navigateTo(new NavigationRequest({resourceName:this.getCurrentResourceName(),url:a.attr("href"),type:RESOURCE_TYPES.media}),null,a.metadata().offset,true);
return false
}else{return PanelBase.prototype.onLinkClick.apply(this,util.argumentsArray(arguments))
}};
MediaPanel.prototype.unload=function(){this.shareButton.destroy();
PanelBase.prototype.unload.call(this)
};
function ContentPanel(d,c,a){PanelBase.call(this,d,c,a);
var e=d.find("#content-body");
if(e.length){var b=e.metadata();
if(b&&b.title){this.trigger(biblia.events.changePageTitleRequest,{title:b.title,url:b.url})
}}}ContentPanel.prototype=util.extend(PanelBase);
ContentPanel.prototype.getCurrentPosition=function(){throw new Error("Not implemented.")
};
ContentPanel.prototype.navigateTo=function(a){var b=a.toUrl("xhtml",false,true);
this.jqContainer.load(b);
biblia.history.trackPageView(b)
};
ContentPanel.prototype.unload=function(){PanelBase.prototype.unload.call(this)
};
function TagPanel(o,i,a){ContentPanel.call(this,o,i,a);
var p=this,k=this.jqContainer.find("textarea.in").not(".input-hint"),h=this.jqContainer.find("textarea.out"),m=this.jqContainer.find(".validation-error"),j=this.jqContainer.find("input.in").not(".input-hint"),d=this.jqContainer.find("input.out:first"),g,n="esv",l="esv";
function e(r,q){return util.qualifyURL("/bible/"+q+"/"+r)
}function c(){function r(s){return !(/<(html|head|body)/gi).test(s)
}function q(){var u,s=k.val();
m.hide();
if(!r(s)){h.val("");
m.text("Full HTML documents are not supported. Please paste only the contents of the <body> tag.").show();
return
}u=p.processHtml(k.val());
h.val(u)
}if(!Logos.ReferenceTagging){$LAB.script("http://bible.logos.com/jsapi/referencetagging.js").wait(function(){Logos.ReferenceTagging.lbsUseTooltip=false;
Logos.ReferenceTagging.lbsNoSearchTagNames=["h1","h2","h3","style","iframe"];
Logos.ReferenceTagging.generateLink=function(s,u){var v=encodeURIComponent(s.replace(/:/g,".").replace(/(\s|\r?\n)+/g," "));
return e(v,l)
};
q()
})
}else{q()
}}function f(){var q=$.map(j,function(u,s){return $.trim($(u).val())||null
});
function r(s){d.val(s?e(s,n):"")
}g=util.abortRequest(g);
if(!q.length){r();
return
}g=$.ajax({url:"/bible/urlreference",type:"POST",data:{references:q},traditional:true,success:function(s){if(s&&s.references){r(s.references)
}}})
}this.jqContainer.find("textarea.in").bind("change keyup",$.debounce(100,c));
j.bind("change keyup",$.debounce(100,f));
d.add(h).bind("focus click",$.debounce(20,function(){$(this).select()
}));
function b(r,q){r.resourcepicker({change:q,useAbbreviatedTitlesOnly:true,itemSourceType:"bibles",topItemsCount:0,pickerDropDownOrigin:"left top",pickerButtonOrigin:"left bottom",pickerDropDownOffset:"-2 3",titleSuffix:'&nbsp;<div class="arrow"></div>',lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources})
}b($(".build .resource-picker-button"),function(r,q){n=q[0].resourceName;
f()
});
b($(".autotag .resource-picker-button"),function(r,q){l=q[0].resourceName;
c()
})
}TagPanel.prototype=util.extend(ContentPanel);
TagPanel.prototype.processHtml=function(b){var a=document.createElement("div");
a.innerHTML=b;
Logos.ReferenceTagging.tag(a,"biblia.com/tag");
return a.innerHTML
};
TagPanel.prototype.unload=function(){ContentPanel.prototype.unload.call(this)
};
function PluginWidgetPanel(d,c,b){ContentPanel.call(this,d,c,b);
var a=this;
this.bibleVersion="esv";
this.initDomEvents=function(e){this.initResourcePicker(d.find(".resource-picker-button"),function(h,g){a.bibleVersion=g[0].resourceName;
a.updateWidget()
});
if(e){function f(){var g=d.find('input[name="style-selector-button"]:checked');
a.onStyleSelect(g);
a.updateWidget()
}d.find('input[name="style-selector-button"]').change(f);
d.find(".style-thumbnail").click(function(){$(this).parent().find("input:radio").attr("checked","checked");
f()
});
d.find('input[name="style-selector-button"]').first().attr("checked","checked");
f()
}};
this.updateWidget=function(){var e=a.getFrameMarkup();
d.find("#plugin-widget-demo").html(a.getPluginFrame());
d.find("#html-markup-textarea").val(e);
d.find("#html-markup-script-textarea").val(a.getPluginScripts())
};
this.getElementId=function(){return this.idPrefix+"-"+Math.floor(Math.random()*100000)
}
}PluginWidgetPanel.prototype=util.extend(ContentPanel);
PluginWidgetPanel.prototype.getFrameMarkup=function(){return this.getPluginComment()+this.getPluginElement()
};
PluginWidgetPanel.prototype.getPluginElement=function(){var c=this.getIframeAttributes(),b=[];
for(var a in c){if(c.hasOwnProperty(a)){b.push(a+'="'+c[a]+'"')
}}return["<biblia:",this.elementName,' id="',this.getElementId(),'" ',b.join(" "),"></biblia:",this.elementName,">"].join("")
};
PluginWidgetPanel.prototype.getPluginFrame=function(){return['<iframe src="',this.getUrl(),'" id="',this.getElementId(),'" width="',this.getWidth(),'" height="',this.getHeight(),'"></iframe>'].join("")
};
PluginWidgetPanel.prototype.getPluginScripts=function(){return'<script src="http://'+location.hostname+'/api/logos.biblia.js"><\/script>\r\n<script>logos.biblia.init();<\/script>'
};
PluginWidgetPanel.prototype.getPluginComment=function(){throw new Error("getPluginComment must be implemented by the concrete class.")
};
PluginWidgetPanel.prototype.getUrl=function(){throw new Error("getUrl must be implemented by the concrete class.")
};
PluginWidgetPanel.prototype.getIframeAttributes=function(){throw new Error("getIframeAttributes must be implemented by the concrete class.")
};
PluginWidgetPanel.prototype.getWidth=function(){throw new Error("getWidth must be implemented by the concrete class.")
};
PluginWidgetPanel.prototype.getHeight=function(){throw new Error("getWidth must be implemented by the concrete class.")
};
PluginWidgetPanel.prototype.onStyleSelect=function(){throw new Error("onStyleSelect must be implemented by the concrete class.")
};
PluginWidgetPanel.prototype.initResourcePicker=function(){throw new Error("initResourcePicker must be implemented by the concrete class.")
};
function VerseOfTheDayPanel(d,c,b){PluginWidgetPanel.call(this,d,c,b);
var a=this;
this.widgetTheme="colorbar";
this.widgetVariant="orange";
this.singleImage=false;
this.elementName="verseoftheday";
this.idPrefix="verse-of-the-day";
this.width=300;
this.height=250;
this.onStyleSelect=function(e){this.widgetVariant=e.attr("data-variant");
this.widgetTheme=e.attr("data-theme")
};
this.initResourcePicker=function(f,e){f.resourcepicker({change:e,useAbbreviatedTitlesOnly:true,itemSourceType:"bibles",publicResourcesOnly:true,topItemsCount:0,pickerDropDownOffset:"-2 3",titleSuffix:'&nbsp;<div class="arrow"></div>',lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources})
};
this.getSingleImage=function(){return'<a target="_blank" href="'+util.qualifyURL(ROUTING.buildUrl("VerseOfTheDay",{resourceName:this.bibleVersion}))+'"><img src="'+this.getUrl()+'" width="300" height="250" /></a>'
};
d.find('input[name="single-image"]').change(function(){a.singleImage=this.checked;
var f=d.find("#textual-theme-options");
if(a.singleImage){f.hide();
var e=$('input[name="style-selector-button"]');
e.first().attr("checked","checked");
e.change()
}else{f.show()
}a.updateWidget()
});
this.initDomEvents(true)
}VerseOfTheDayPanel.prototype=util.extend(PluginWidgetPanel);
VerseOfTheDayPanel.prototype.getPluginFrame=function(){if(this.singleImage){return this.getSingleImage()
}return['<iframe src="',this.getUrl(),'" id="',this.getElementId(),'" width="',this.getWidth(),'" height="',this.getHeight(),'"></iframe>'].join("")
};
VerseOfTheDayPanel.prototype.getFrameMarkup=function(){if(!this.singleImage){return this.getPluginComment()+this.getPluginElement()
}else{return this.getPluginComment()+this.getSingleImage()
}};
VerseOfTheDayPanel.prototype.getPluginScripts=function(){if(this.singleImage){return""
}return PluginWidgetPanel.prototype.getPluginScripts.call(this)
};
VerseOfTheDayPanel.prototype.getPluginComment=function(){return"<!-- Verse of the Day. "+util.qualifyURL(ROUTING.buildUrl("Plugins",{Action:"verseoftheday"}))+" -->\r\n"
};
VerseOfTheDayPanel.prototype.getUrl=function(){var a=this.getIframeAttributes();
a.resourceName=a.resource;
delete a.resource;
return util.qualifyURL(ROUTING.buildUrl("VerseOfTheDayWidget",a))
};
VerseOfTheDayPanel.prototype.getIframeAttributes=function(){return{resource:this.bibleVersion,width:this.width,height:this.height,singleImage:this.singleImage,theme:this.widgetTheme,variant:this.widgetVariant}
};
VerseOfTheDayPanel.prototype.getWidth=function(){return this.width
};
VerseOfTheDayPanel.prototype.getHeight=function(){return this.height
};
function BibleSearchBoxPanel(e,d,c){PluginWidgetPanel.call(this,e,d,c);
var b=this;
this.style="light";
this.sizes={small:{width:160,height:80},large:{width:300,height:135}};
this.widgetSize="small";
this.elementName="biblesearchbox";
this.idPrefix="bible-search-box";
function a(){b.widgetSize=$(this).val();
b.updateWidget()
}this.onStyleSelect=function(f){b.style=f.attr("data-style")
};
this.initResourcePicker=function(g,f){g.resourcepicker({change:f,useAbbreviatedTitlesOnly:true,itemSourceType:"bibles",checkLicenses:true,topItemsCount:0,pickerDropDownOrigin:"left top",pickerButtonOrigin:"left bottom",pickerDropDownOffset:"-2 3",titleSuffix:'&nbsp;<div class="arrow"></div>',injectResources:[BibleSearchBoxPanel.defaultVersion],lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources})
};
e.find("form select").change(a);
this.bibleVersion=BibleSearchBoxPanel.defaultVersion.resourceName;
this.initDomEvents(true)
}BibleSearchBoxPanel.prototype=util.extend(PluginWidgetPanel);
BibleSearchBoxPanel.prototype.getPluginComment=function(){return"<!-- Bible Search Box. "+util.qualifyURL(ROUTING.buildUrl("Plugins",{Action:"BibleSearchBox"}))+" -->\r\n"
};
BibleSearchBoxPanel.prototype.getUrl=function(){var a=this.getIframeAttributes();
delete a.width;
delete a.height;
return util.qualifyURL(ROUTING.buildUrl("BibleSearchBox",this.getIframeAttributes()))
};
BibleSearchBoxPanel.prototype.getIframeAttributes=function(){var a={style:this.style,size:this.widgetSize,width:this.getWidth(),height:this.getHeight()};
if(this.bibleVersion!=BibleSearchBoxPanel.defaultVersion.resourceName){a.resource=this.bibleVersion
}return a
};
BibleSearchBoxPanel.prototype.getWidth=function(){return this.sizes[this.widgetSize].width
};
BibleSearchBoxPanel.prototype.getHeight=function(){return this.sizes[this.widgetSize].height
};
BibleSearchBoxPanel.defaultVersion={resourceName:"DEFAULT_VERSION",title:"Default Version",type:"CUSTOM",abbreviatedTitle:"Default Version",authors:[]};
function BibleSearchResultsPanel(e,d,c){PluginWidgetPanel.call(this,e,d,c);
var b=this;
this.style="light";
this.sizes={small:{width:160,height:200},large:{width:300,height:400}};
this.widgetSize="small";
this.elementName="biblesearchresults";
this.idPrefix="bible-search-results";
function a(){b.widgetSize=$(this).val();
b.updateWidget()
}this.onStyleSelect=function(f){b.style=f.attr("data-style")
};
this.initResourcePicker=function(g,f){g.resourcepicker({change:f,useAbbreviatedTitlesOnly:true,itemSourceType:"bibles",checkLicenses:true,topItemsCount:0,pickerDropDownOrigin:"left top",pickerButtonOrigin:"left bottom",pickerDropDownOffset:"-2 3",titleSuffix:'&nbsp;<div class="arrow"></div>',injectResources:[BibleSearchResultsPanel.defaultVersion],lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources})
};
e.find("form select").change(a);
this.bibleVersion=BibleSearchResultsPanel.defaultVersion.resourceName;
this.initDomEvents(true)
}BibleSearchResultsPanel.prototype=util.extend(PluginWidgetPanel);
BibleSearchResultsPanel.prototype.getPluginComment=function(){return"<!-- Bible Search Results. "+util.qualifyURL(ROUTING.buildUrl("Plugins",{Action:"BibleSearchResults"}))+" -->\r\n"
};
BibleSearchResultsPanel.prototype.getUrl=function(){var a=this.getIframeAttributes();
delete a.width;
delete a.height;
return util.qualifyURL(ROUTING.buildUrl("BibleSearchResults",this.getIframeAttributes()))
};
BibleSearchResultsPanel.prototype.getIframeAttributes=function(){return{resource:this.bibleVersion,style:this.style,size:this.widgetSize,width:this.getWidth(),height:this.getHeight()}
};
BibleSearchResultsPanel.prototype.getWidth=function(){return this.sizes[this.widgetSize].width
};
BibleSearchResultsPanel.prototype.getHeight=function(){return this.sizes[this.widgetSize].height
};
BibleSearchResultsPanel.defaultVersion={resourceName:"esv",title:"Default Version",type:"CUSTOM",abbreviatedTitle:"Default Version",authors:[]};
function EmbeddedBiblePanel(i,g,a){PluginWidgetPanel.call(this,i,g,a);
var j=this;
var c=i.find("form");
var d=c.find("input[name=startingReference]");
var h=c.find("input[name=width]");
var k=c.find("input[name=height]");
this.startingRef=null;
this.width=0;
this.height=0;
this.jqContainer=i;
this.elementName="bible";
this.idPrefix="bible";
function f(){var p=true;
var o=new RegExp("^\\d+%?$");
var n=Logos.BibleReference.tryParse(d.val());
if(n!=null){d.toggleClass("invalid",false);
j.startingRef=n
}else{d.toggleClass("invalid",true);
p=false
}var m=h.val();
if(o.test(m)){h.toggleClass("invalid",false);
j.width=m
}else{h.toggleClass("invalid",true);
p=false
}var l=k.val();
if(o.test(l)){k.toggleClass("invalid",false);
j.height=l
}else{k.toggleClass("invalid",true);
p=false
}return p
}function b(){$.ajax({url:ROUTING.buildUrl("FirstVerseInResource",{resourceName:j.bibleVersion}),success:function(l){if(l&&l.firstVerse){j.startingRef=Logos.BibleReference.tryParse(l.firstVerse);
d.val(l.firstVerse);
d.toggleClass("invalid",false);
j.updateWidget()
}else{startingRef.val("")
}},error:function(){startingRef.val("")
}})
}this.initResourcePicker=function(m,l){m.resourcepicker({change:function(o,n){l(o,n);
b()
},useAbbreviatedTitlesOnly:true,itemSourceType:"bibles",checkLicenses:true,topItemsCount:0,pickerDropDownOrigin:"left top",pickerButtonOrigin:"left bottom",pickerDropDownOffset:"-2 3",publicResourcesOnly:true,titleSuffix:'&nbsp;<div class="arrow"></div>',lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources})
};
var e=$.throttle(1000,function(){if(f()){j.updateWidget()
}});
c.change(function(l){e()
});
this.bibleVersion="esv";
b();
f();
this.initDomEvents(false)
}EmbeddedBiblePanel.prototype=util.extend(PluginWidgetPanel);
EmbeddedBiblePanel.prototype.getPluginComment=function(){return"<!-- Embedded Bible. "+util.qualifyURL(ROUTING.buildUrl("Plugins",{Action:"embeddedbible"}))+" -->\r\n"
};
EmbeddedBiblePanel.prototype.getUrl=function(){var a=this.getIframeAttributes();
a.resourceName=a.resource;
delete a.resource;
return util.qualifyURL(ROUTING.buildUrl("EmbeddedBible",a))
};
EmbeddedBiblePanel.prototype.getIframeAttributes=function(){var c=this.jqContainer.find("form");
var d=c.find("input[type=checkbox]");
var b=c.find("select");
var a={layout:b.val(),resource:this.bibleVersion,width:this.width,height:this.height};
d.not(":checked").each(function(){a[$(this).attr("name")]=false
});
if(this.startingRef!=null){a.startingReference=this.startingRef.toUrlSafeString()
}return a
};
EmbeddedBiblePanel.prototype.getWidth=function(){return this.width
};
EmbeddedBiblePanel.prototype.getHeight=function(){return this.height
};
function ReferencePanel(e,d,b){PanelBase.call(this,e,d,b);
var a=this;
this.resourceInfo=null;
this.references=null;
this.firstBibleReference=null;
this.strTooltipSelector=".resourcetext a";
if(this.jqToolbar&&this.jqToolbar.length){this.shareButton=new ShareButton(this.jqToolbar.find(".toolbar-center-section"))
}this.jqContent=e.find("#content-bible");
if(this.jqContent.length){var c=this.jqContent.metadata();
if(c){this.initResourceInfo(c)
}}this.fnClick=function(g){var f=$(g.target).closest("a");
if(f.length&&!f.is('[rel="external"]')){g.preventDefault();
return a.onLinkClick.call(a,f,g)
}};
this.jqContainer.click(this.fnClick);
this.jqContainer.tooltip({selector:".resourcetext a",clickStick:function(f){return f.is('[rel="popup"]')
},onLinkClick:this.fnClick,fnGetContent:function(k,j){var f=k.metadata();
if(k.is('[rel="popup"][href^="#"]')){var i=$(k.attr("href"));
j(i.length&&$.trim(i.text())?i.children().clone():biblia.resourcestrings.tooltipError)
}var g=a.getNavigationRequestForLinkMetadata(f);
if(!g.resourceName){g.resourceName=a.resourceInfo.resourceName
}var h=g.toUrl("js",true,false,true);
if(!h){return
}$.ajax({url:h,success:function(m){var l=[];
if(m.refRequested){l.push(m.refRequested)
}if(m.resourceName&&m.resourceTitle&&m.resourceName!=a.resourceInfo.resourceName){l.push(m.resourceTitle)
}j(m.content,l.join(" | ")||null)
},error:function(){j(biblia.resourcestrings.tooltipError)
}})
}});
if(this.firstBibleReference){this.jqPickerContainer=$('<div class="passage-resource-picker"></div>');
this.jqPickerContainer.appendTo(this.jqToolbar.find(".toolbar-center-section"));
this.jqPickerContainer.passageResourcePicker({initialResourceInfo:this.resourceInfo,reference:this.firstBibleReference.toUrlSafeString(),change:$.proxy(this.onSelectedResourceChanged,this),noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources})
}e.find(".bible-reference-chunk").each(function(){var g=$(this);
var f=new Image();
$(f).load(function(){$('<a rel="external" href="'+ROUTING.buildUrl("VerseOfTheDayImage",{directory:"1920",reference:g.metadata().reference,fallbackOnFailure:false})+'" target="_blank"></a>').append(f).insertAfter(g)
});
f.src=ROUTING.buildUrl("VerseOfTheDayImage",{directory:"300x250",reference:g.metadata().reference,extension:"png",fallbackOnFailure:false})
})
}ReferencePanel.prototype=util.extend(PanelBase);
ReferencePanel.prototype.initResourceInfo=function(b){var a=this;
if(b.resource){this.trigger(biblia.events.resourceChange,[b.resource,this.resourceInfo]);
this.resourceInfo=b.resource;
this.setTitle()
}if(b.coverurl){this.jqToolbar.find(".toolbar-cover-section").find("img").attr("src",b.coverurl)
}if(b.reference){this.references=$.grep($.map(b.reference.split(";"),function(c){return c.split(",")
}),function(c){return c.length!==0
});
if(this.references.length){this.firstBibleReference=Logos.BibleReference.tryParse(this.references[0]);
setTimeout(function(){a.trigger(biblia.events.locationMarkerChange,[a.firstBibleReference])
},0)
}}this.shareButton.setShareInfo(this.getCurrentPosition(),this.resourceInfo,true)
};
ReferencePanel.prototype.setTitle=function(){var a=this.jqToolbar.find(".resource-title");
a.text(this.resourceInfo.title);
if(a.outerWidth(true)>=this.jqToolbar.width()-a.siblings(".share-button").outerWidth(true)-this.jqToolbar.find(".toolbar-cover-section").outerWidth(true)-this.jqToolbar.find(".passage-resource-picker").outerWidth(true)){a.text(this.resourceInfo.abbreviatedTitle)
}};
ReferencePanel.prototype.onSelectedResourceChanged=function(f,c){var a=this;
var h=c[0];
var b=this.getCurrentPosition();
b.resourceName=h.resourceName;
this.setTitle();
var d=setTimeout(function(){a.jqContainer.find("#content-bible").empty().append($('<div class="pane-loading ui"><img src="/public/images/ajax-loader.gif" />Loading...</div>'))
},150);
var g=b.toUrl("xhtml");
if(g){$.ajax({url:g,success:function(i){clearTimeout(d);
a.jqContainer.find("#content-bible").remove();
a.jqContent=$(i);
a.jqContent.appendTo(a.jqContainer);
var e=a.jqContent.metadata();
if(e){a.initResourceInfo(e)
}},error:function(i){var e=i&&i.status==403?biblia.resourcestrings.resourcePermissionError:biblia.resourcestrings.resourceChangeError;
a.trigger(biblia.events.info,{nLevel:$.fn.infobar.levels.error,strMsg:e})
}})
}else{a.trigger(biblia.events.info,{nLevel:$.fn.infobar.levels.error,strMsg:biblia.resourcestrings.resourceChangeError})
}};
ReferencePanel.prototype.getCurrentPosition=function(){var a=this.resourceInfo;
a.type=RESOURCE_TYPES.bible;
if(this.references.length>1){a.reference=new Logos.Reference(this.references.join(";"))
}else{if(this.references.length===1){a.reference=Logos.BibleReference.tryParse(this.references[0])
}}a.forceShareUrl=true;
return new NavigationRequest(a)
};
ReferencePanel.prototype.getPreferredPane=function(){var a=this.jqContent.metadata();
if(a&&a.preferredpane){if(a.preferredpane===PANES.left){return biblia.panes.left
}if(a.preferredpane===PANES.right){return biblia.panes.right
}}return null
};
ReferencePanel.prototype.navigateTo=function(a){a.forceShareUrl=false;
this.trigger(biblia.events.navigationRequest,a,false);
this.unload()
};
ReferencePanel.prototype.unload=function(){PanelBase.prototype.unload.call(this);
this.jqContainer.tooltip({selector:this.strTooltipSelector},"destroy");
this.shareButton&&this.shareButton.destroy();
if(this.jqPickerContainer){this.jqPickerContainer.passageResourcePicker("destroy");
this.jqPickerContainer.remove()
}this.jqContainer.empty()
};
function StandardResourcePanel(d,c,b){PagedResourcePanel.call(this,d,c,b,d.find(".resource-content").first(),d.find(".content-wrapper").first());
var a=this;
this.jqReferenceInput.attr("placeholder","Headword");
this.jqReferenceInput.closest("form").submit(function(g){g.preventDefault();
var f=a.jqReferenceInput.val();
a.navigateTo(new NavigationRequest({resourceName:a.getCurrentResourceName(),urlLocationMarker:f,bPreventPropagation:true,bIsUserInitiated:true}))
});
this.jqContainer.bind(biblia.events.locationMarkerChange,function(g,f){a.shareButton.setShareInfo(a.getCurrentPosition(),a.resourceInfo,false)
});
this.init();
this.shareButton=new ShareButton(this.jqToolbar.find(".toolbar-bottom-section"));
this.shareButton.setShareInfo(this.getCurrentPosition(),this.resourceInfo,false)
}StandardResourcePanel.prototype=util.extend(PagedResourcePanel);
StandardResourcePanel.prototype.updateMilestoneCore=function(b){if(this.bLock){return
}if(b===null){this.setLocationMarker(null);
return
}var c=b.metadata();
var a=c.reference?Logos.LocationMarker.tryParse(c.reference,c.urlreference,"reference"):Logos.LocationMarker.tryParse(c.headword,c.urlheadword,"headword");
if(a){this.triggerLocationMarkerChange(a,this.bNavWasLinked)
}this.setLocationMarker(a,true)
};
StandardResourcePanel.prototype.getCurrentPosition=function(){var a=this.resourceInfo?this.resourceInfo:{resourceName:this.getCurrentResourceName()};
if(this.locationCurrent instanceof Logos.Reference){a.reference=this.locationCurrent
}else{if(this.locationCurrent instanceof Logos.Headword){a.headword=this.locationCurrent
}else{if(this.curArticleId){a.articleId=this.curArticleId
}else{if(this.curIndexedOffset){a.indexedOffset=this.curIndexedOffset
}}}}return new NavigationRequest(a)
};
function ReadingPlanPanel(d,c,b){DocumentPanel.call(this,d,c,b);
var a=this;
var e=this.jqContainer.children("#content-reading-plan").metadata();
this.readingPlanId=e?e.readingplanid:null;
this.jqEditBtn=this.jqContainer.find(".reading-plan-edit-button");
this.jqGenerateBtn=this.jqContainer.find(".reading-plan-generate");
this.jqCancelBtn=this.jqContainer.find(".reading-plan-cancel");
this.jqDeleteBtn=this.jqContainer.find(".document-delete");
this.jqEditSection=this.jqContainer.find(".reading-plan-edit");
this.jqListSection=this.jqContainer.find(".reading-plan-list");
this.jqEditBtn.click(function(){a.jqEditSection.slideDown();
a.jqEditBtn.fadeOut()
});
this.jqCancelBtn.click(function(){a.jqEditSection.slideUp();
a.jqEditBtn.fadeIn()
});
var f=$("<div></div>").addClass("dropdown").text("Are you sure?").css("padding","4px");
this.jqDeleteBtn.dropdown({jqPanel:f,strBtnPos:"right bottom",strPnlPos:"right top",strBtnActiveClass:"active"});
this.jqContainer.find("a.reading-link").click(function(){var g=$(this);
var h=g.metadata();
var i=g.closest("tr");
if(h&&h.item&&i){$.extend(h,i.metadata());
a.startReading(h.sessiondate,h.item)
}});
this.jqContainer.find(".mark-read").click(function(){var h=$(this).closest("tr");
var g=h.metadata();
$(document).trigger(biblia.events.markReadingPlan,[a.readingPlanId,g.sessiondate])
});
$(document).bind(biblia.events.markReadingPlan,function(j,k,g){if(!k||!g){return
}var i=a.jqContainer.find("tr");
var h=i.filter(function(){var m=$(this).metadata();
if(m&&m.sessiondate){return m.sessiondate==g
}return false
}).first();
var l=h.next();
if(l){h.find(".mark-read").appendTo(l.children("td").first())
}h.remove();
i.removeClass("even");
i.filter(":even").addClass("even")
});
this.jqEditPnl=this.jqContainer.find(".reading-plan-edit");
this.jqEditPnl.find(".rp-resource-picker").resourcepicker({changePickerText:true,pickerDropDownOrigin:"left top",pickerButtonOrigin:"left bottom",initialResourceInfo:{},change:$.proxy(this.onResourceChanged,this),lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources});
this.jqEditPnl.find(".rp-range").click(function(i){var h=$(this);
var g=a.jqEditPnl.find(".rp-range-select").first();
h.hide();
g.show();
g.change(function(){h.text(g.find("option:selected").first().text());
g.hide();
h.show()
});
g.click();
function j(k){if($(k.target).closest(".rp-range-select").length===0){g.hide();
h.show();
$(document).unbind("click",j)
}}$(document).click(j);
i.stopPropagation()
});
this.jqFrequencyPnl=$("#reading-plan-frequency").clone().attr("id","");
this.jqTimeframePnl=$("#reading-plan-timeframe").clone().attr("id","");
this.jqEditPnl.find(".rp-frequency").dropdown({jqPanel:this.jqFrequencyPnl,strBtnPos:"right bottom",strPnlPos:"right top"});
this.jqEditPnl.find(".rp-timeframe").dropdown({jqPanel:this.jqTimeframePnl,strBtnPos:"right bottom",strPnlPos:"right top"});
this.jqFrequencyPnl.add(this.jqTimeframePnl).find("label").click(function(){$(this).prevAll("input").click()
})
}ReadingPlanPanel.prototype=util.extend(DocumentPanel);
ReadingPlanPanel.prototype.init=function(){};
ReadingPlanPanel.prototype.startReading=function(b,c){var a=this;
$.ajax({type:"POST",url:"/readingplan/startreading",data:{readingPlanId:a.readingPlanId,sessionDate:b,item:c},success:$.proxy(function(e){var d=new NavigationRequest({resourceName:e.resourceName,indexedOffset:e.offset,type:e.type});
this.trigger(biblia.events.navigationRequest,d)
},this)})
};
ReadingPlanPanel.prototype.onResourceChanged=function(){this.jqEditPnl.find("")
};
function LibraryPanel(i,h,a){PanelBase.call(this,i,h,a);
var j=this;
this.jqContent=i.find("#library-content");
this.jqWrapper=this.jqContent.find(".content-wrapper");
this.jqFilterInput=$("#sidebar-pane-library").find("input[name='q']").first();
this.jqSortButton=this.jqContainer.find(".library-sort-button");
this.jqSortPanel=$("#library-sort-panel");
var c=this.jqWrapper.find(".library-item-info").width();
this.titleLength=Math.floor(c/4);
this.authorAndTypeLength=Math.floor(c/6);
this.strFilter="";
this.maxSize=0;
this.pageSize=0;
this.numPages=0;
this.page=0;
var d=this.jqContent.find(".library-chunk");
if(d.length){this.trigger(biblia.events.changePageTitleRequest,{title:"Library",url:"/library"});
var g=d.first().metadata();
this.strOrderBy=g.orderby;
this.strSortDirection=g.sortdirection;
this.initialized=true
}this.jqHoverInformation=null;
this.infoTemplate=$.template(null,$("#resource-info-template").html());
this.tooltipOptions={selector:"li.library-list-item",containerClass:"library-hover-info",bShowLoading:false,bClickStick:false,collision:"fit fit",fnPositioning:function(k,l){if(l.closest(".library-bibles-list").length){return{my:"left center",at:"right center",offset:"8px 0",collision:"fit fit",of:l}
}return{my:"right center",at:"left center",offset:"-8px 0",collision:"fit fit",of:l}
},fnGetContent:function(m,k){var l=$(m).children("div.library-item").metadata();
var n=ROUTING.buildUrl("ResourceInformation",{resourceName:l.resourcename});
$.ajax({url:n,success:function(p,o,q){p.description=util.ellipsisize(p.description,j.hoverDescriptionLength);
k($.tmpl(j.infoTemplate,p))
}})
},fnInsertContent:function(k){this.html($(k).html())
},template:$.tmpl(j.infoTemplate,null)};
this.init();
this.jqWrapper.find(".library-item-title").each(function(){$(this).text(util.ellipsisize($(this).text(),this.titleLength))
});
this.jqWrapper.find(".library-item-resource-type",this.jqContent).add(".library-item-authors",this.jqContent).each(function(){$(this).text(util.ellipsisize($(this).text(),this.authorAndTypeLength))
});
var e=$.proxy(function(k){var l=this.jqFilterInput.val();
if(l!=j.strFilter){this.jqFilterInput.closest("form").submit()
}},this);
var b=function(k){if(k.which==$.ui.keyCode.ENTER||k.which==$.ui.keyCode.UP||k.which==$.ui.keyCode.DOWN){return null
}return e.apply(this,util.argumentsArray(arguments))
};
this.jqFilterInput.submit(b);
this.jqFilterInput.closest("form").submit(function(l){l.preventDefault();
var k=j.getCurrentPosition();
if(!j.strFilter){$.extend(k,{orderBy:RESOURCE_ORDERS.relevance})
}j.strFilter=j.jqFilterInput.val();
if(!j.strFilter&&j.strOrderBy==RESOURCE_ORDERS.relevance){$.extend(k,{orderBy:RESOURCE_ORDERS.title})
}j.navigateTo(j.createNavRequest($.extend(k,{query:j.strFilter,start:0})))
});
this.jqWrapper.delegate("a.set-default-bible-link","click",function(l){l.preventDefault();
var k=$(this);
$.ajax({type:"POST",url:k.attr("href"),success:function(o){var p=j.jqContent.find(".default-resource-checked");
var n=k.children(".default-resource-unchecked");
if(p.length){p.removeClass("default-resource-checked").attr("title","Set as default Bible").addClass("default-resource-unchecked").parent().removeClass().addClass("set-default-bible-link")
}var m=n.removeClass("default-resource-unchecked").addClass("default-resource-checked").attr("title","Default Bible").parent().removeClass().addClass("dead-link").closest("li");
if(j.strOrderBy==RESOURCE_ORDERS.priority){j.navigateTo(j.getCurrentPosition())
}},error:function(m){j.jqContent.trigger(biblia.events.info,{nLevel:$.fn.infobar.levels.error,strMsg:"Error setting default bible"})
}})
});
this.jqWrapper.delegate("a.dead-link","click",function(k){k.preventDefault()
});
function f(l,k,m){return l.children(k).filter(function(n){var o=$(this);
return o.offset().left+o.outerWidth()>m.pageX&&o.offset().left<m.pageX
})
}this.jqWrapper.delegate("div.library-item-rating","mouseenter",function(k){$(this).children("span.rating-star").each(function(){var l=$(this);
l.data("old-class",l.attr("class"))
})
});
this.jqWrapper.delegate("div.library-item-rating","mousemove",function(k){var l=f($(this),"span.rating-star",k);
if(l.data("old-class")){l.prevAll().add(l).each(function(m){$(this).removeClass().addClass("rating-star filled")
});
l.nextAll().each(function(m){var n=$(this);
n.removeClass().addClass("rating-star")
})
}});
this.jqWrapper.delegate("div.library-item-rating","mouseleave",function(k){$(this).children("span.rating-star").each(function(){var l=$(this);
l.removeClass().addClass(l.data("old-class"));
l.data("old-class",null)
})
});
this.jqWrapper.delegate("div.library-item-rating","click",function(m){var n=f($(this),"span.rating-star",m);
var k=n.closest(".library-item").metadata();
var l=n.prevAll().length+1;
n.parent().children().each(function(){var o=$(this);
o.data("original-class",o.data("old-class"));
o.data("old-class",o.attr("class"))
});
$.ajax({type:"POST",url:ROUTING.buildUrl("SetResourceRating",{resourceName:k.resourcename,rating:l}),success:function(){if(j.strOrderBy==RESOURCE_ORDERS.rating){j.navigateTo(j.getCurrentPosition())
}},error:function(){n.parent().children().each(function(){var o=$(this);
o.data("old-class",o.data("original-class"));
o.attr("class",o.data("old-class"));
o.data("original-class",null)
});
j.jqContent.trigger(biblia.events.info,{nLevel:$.fn.infobar.levels.error,strMsg:"Error setting resource rating"})
}})
});
this.jqSortButton.dropdown({jqPanel:j.jqSortPanel});
this.jqSortPanel.find(".library-sort-option").click(function(k){k.preventDefault();
j.navigateTo(j.createNavRequest({orderBy:$(this).metadata().type}));
j.jqSortButton.dropdown("clickHidePanel",k)
})
}LibraryPanel.prototype=util.extend(PanelBase);
LibraryPanel.prototype.titleLength=0;
LibraryPanel.prototype.authorAndTypeLength=0;
LibraryPanel.prototype.hoverDelay=800;
LibraryPanel.prototype.hoverDescriptionLength=600;
LibraryPanel.prototype.init=function(){var b=this;
var a=$('<div class="library-heading">filler</div>').css({position:"relative",left:-10000}).appendTo($("body"));
this.jqContent.ajaxscroll({fnGetPage:$.proxy(this.ajaxScrollGetPage,this),fnGetRelativePositionUrl:$.proxy(this.getRelativePositionUrl,this),error:$.proxy(this.onError,this),chunkload:$.proxy(this.onChunkLoad,this),edgeTriggerDistance:2400,fnChunkRemove:function(c){c.baseTooltip({selector:"li.library-list-item"},"destroy")
},bVirtualizeScrollPosition:true,unloadTriggerScreens:1,contentChunkClass:"library-chunk",bGuessDensity:false,nInitialChunkAdjust:-1*a.outerHeight(true)});
a.remove()
};
LibraryPanel.prototype.reattachElement=function(){this.detachedElements=this.jqWrapper.children().detach()
};
LibraryPanel.prototype.detachElement=function(){if(this.detachedElements){this.jqWrapper.append(this.detachedElements);
this.detachedElements=null
}};
LibraryPanel.prototype.createNavRequest=function(a){return new LibraryNavRequest($.extend({},this.getCurrentPosition(),a))
};
LibraryPanel.prototype.setSortInfo=function(b,a){this.strOrderBy=b;
this.strSortDirection=a;
this.jqSortButton.find(".orderby").text(b)
};
LibraryPanel.prototype.onChunkLoad=function(g,d){var c=this;
var b=d[0]=="up"?"first":"last";
var a=this.jqContent.find(".library-chunk:"+b);
if(!a.data("library-loaded")){a.find("span.library-item-title").each(function(){var e=$(this);
e.text(util.ellipsisize(e.text(),c.titleLength))
});
function f(){$(this).text(util.ellipsisize($(this).text(),c.authorAndTypeLength))
}a.find("div.library-item-resource-type").each(f);
a.find("div.library-item-authors").each(f);
a.baseTooltip(this.tooltipOptions);
a.data("library-loaded",true)
}};
LibraryPanel.prototype.ajaxScrollGetPage=function(c){var a=$(c);
if(!a.length){return null
}var b=a.metadata();
this.maxSize=b.maxsize;
this.pageSize=b.pagesize;
this.strFilter=b.filter;
this.jqFilterInput.filterInput("setResultCount",b.totalsize);
this.setSortInfo(b.orderby,b.sortdirection);
this.numPages=b.numpages;
this.page=Math.floor(b.start/this.pageSize);
if(!b){return null
}return{content:a,prevPageUrl:b.start>0?ROUTING.buildUrl("Library",{q:this.strFilter,start:Math.max(b.start-this.pageSize,0),orderBy:this.strOrderBy,sortDirection:this.strSortDirection,contentType:"xhtml"}):null,nextPageUrl:b.start<(b.numpages-1)*this.pageSize?ROUTING.buildUrl("Library",{q:this.strFilter,start:b.start+this.pageSize,orderBy:this.strOrderBy,sortDirection:this.strSortDirection,contentType:"xhtml"}):null,indexedResourceStart:0,indexedResourceEnd:Math.floor((this.maxSize/b.pagesize)*250),chunkOffset:this.page*250,chunkLength:(b.maxcount/b.pagesize)*250,hash:this.strFilter+"__"+b.start,targetSelector:b.offset?"#list-item-"+b.start+"-"+b.offset:null}
};
LibraryPanel.prototype.getRelativePositionUrl=function(c){var b=Math.round((c/100)*this.maxSize);
var a=Math.floor(b/this.pageSize);
return ROUTING.buildUrl("Library",{q:this.strFilter,start:a*this.pageSize,offset:b-a*this.pageSize,orderBy:this.strOrderBy,sortDirection:this.strSortDirection,contentType:"xhtml"})
};
LibraryPanel.prototype.onError=function(a){};
LibraryPanel.prototype.getCurrentPosition=function(){var d=this.jqContent.scrollTop();
var c=this.jqWrapper.data("top");
var b=util.findClosestTopElement(this.jqContent,d,c,".library-list-item");
var a=b?b.closest(".library-chunk"):null;
return new LibraryNavRequest({query:this.strFilter,start:a?a.metadata().start:0,offset:b?b.metadata().index:0,orderBy:this.strOrderBy,sortDirection:this.strSortDirection})
};
LibraryPanel.prototype.navigateTo=function(b){var a=this;
if(!(b instanceof LibraryNavRequest)){this.jqWrapper.find(".library-chunk").baseTooltip(null,"cancel");
this.trigger(biblia.events.navigationRequest,b);
return
}var c=b.toUrl("xhtml");
this.jqContent.ajaxscroll("tryJumpTo",c);
biblia.history.trackPageView(c)
};
LibraryPanel.prototype.unload=function(){this.jqWrapper.find(".library-chunk").baseTooltip(null,"destroy");
PanelBase.prototype.unload.call(this)
};
function TabController(c,a,b){if(!c||c.length!==1){throw new Error("invalid container")
}this.container=c;
this.title=a;
this.jqTitle=$("<span></span>").text(a);
this.fnUpdateTitle=b
}TabController.prototype.getTitle=function(){return this.jqTitle
};
function HomeController(d,a,c){TabController.call(this,d,a,c);
var b=this;
this.form=this.container.find("form").first();
this.tmplKeylink=$.template(null,$("#keylink-results-template").html());
this.jqLoadingIndicator=$('<div class="search-ajax-loading ui"><img src="/public/images/ajax-loader.gif" />Loading...</div>');
this.entireLibraryToken="ENTIRE_LIBRARY";
this.lastViewClass="";
this.form.submit(function(g){g.preventDefault();
var f=$(this);
if(!f.find("input[name='query']").first().val()){return
}HomeController.prototype.keylink.call(b,f.attr("action")+"?"+f.serialize())
});
this.container.find("#keylink-results").delegate("li a","click",function(h){h.preventDefault();
var g=$(this);
var f=g.tmplItem();
if(!(f&&f.data&&f.data.nav)){return
}b.requestNavigation(f.data.nav)
});
this.initExpanders=function(){function f(){$(this).siblings(".expander-content:first:not(:empty)").slideDown().parent().addClass("expanded").closest(".sidebar-section").addClass("expanded")
}function e(){$(this).siblings(".expander-content:first").slideUp().parent().removeClass("expanded").closest(".sidebar-section").removeClass("expanded")
}this.container.find(".expander:not(.disabled):not(.expanded)").find(".expander-title").toggle(f,e);
this.container.find(".expander.expanded:not(.disabled)").find(".expander-title").toggle(e,f)
};
this.initExpanders();
this.readingPlanManager=new ReadingPlanManager(this.container.find("#reading-plans"));
if(user.isAuthenticated){this.readingPlanManager.loadReadingPlans()
}}HomeController.prototype=util.extend(TabController);
HomeController.prototype.requestNavigation=function(a){this.container.trigger(a.type=="search"?biblia.events.searchRequest:biblia.events.navigationRequest,a)
};
HomeController.prototype.keylink=function(d){var a=this;
var c=function(){if(a.currentRequest){a.currentRequest.abort();
a.currentRequest=null
}};
c();
var b=a.container.find("#keylink-results").empty();
b.append(this.jqLoadingIndicator).show();
$.ajax({url:d,success:function(f){var g=false;
if(f.reference){f.reference.nav=new NavigationRequest({type:f.reference.dataType});
f.reference.nav.setReference(f.reference.reference);
g=true
}if(f.resource){f.resource.nav=new NavigationRequest({resourceName:f.resource.resourceName,type:f.resource.type});
g=true
}if(f.headword){f.headword.nav=new NavigationRequest({resourceName:f.headword.resourceData.resourceName});
f.headword.nav.setHeadword(f.headword.urlHeadword);
g=true
}f.searches=[{title:SearchController.entireLibraryResource.title,nav:new NavigationRequest({type:"search",query:f.query,resources:SearchController.entireLibraryResource})},{title:SearchController.openResources.title,nav:new NavigationRequest({type:"search",query:f.query,resources:SearchController.openResources})}];
var e=a.container.find("#keylink-results").empty().hide();
if(g){e.html($.tmpl(a.tmplKeylink,f)).find("li a:first").click().parent().hide();
e.slideDown()
}else{a.requestNavigation(f.searches[0].nav)
}},complete:function(){a.jqLoadingIndicator.remove()
}})
};
HomeController.prototype.executeKeylink=function(a){};
HomeController.prototype.saveViewClass=function(a){this.lastViewClass=a
};
HomeController.prototype.getViewClass=function(){return this.lastViewClass
};
function LibraryController(d,a,c){TabController.call(this,d,a,c);
var b=this;
this.jqForm=this.container.find("form").first();
this.jqSearchInput=this.jqForm.find("input[name='q']").first().filterInput({showClear:false,rightMargin:38});
this.jqForm.submit(function(g){g.preventDefault();
var f=$(this)
})
}LibraryController.prototype=util.extend(TabController);
function SearchController(e,a,c,d){TabController.call(this,e,a,c);
var b=this;
this.form=this.container.find("form").first();
this.jqSearchInput=this.form.find("input").first().filterInput({showClear:false,rightMargin:38});
this.template=$.template(null,$("#search-results-template").html());
this.jqResourceSelector=this.container.find("#search-resource-link");
this.jqTitle=$("<span></span>").text(this.title+" ").append($("<span></span>").addClass("extra-title").text(" for:").prepend(this.jqResourceSelector));
this.jqLoadingIndicator=$('<div class="search-ajax-loading ui"><img src="/public/images/ajax-loader.gif" />Loading...</div>');
this.setCurrentResource(d);
this.strUrl=null;
this.params=null;
this.injectedResources=[SearchController.openResources,SearchController.topBibles,SearchController.entireLibraryResource];
this.initResourcePicker=function(){b.jqResourceSelector.resourcepicker({initialResourceInfo:b.resourceInfo,change:$.proxy(b.onSelectedResourceChanged,b),useAbbreviatedTitlesOnly:true,itemSourceType:"",topItemsCount:0,pickerDropDownOrigin:"left top",pickerButtonOrigin:"left bottom",pickerDropDownOffset:"-2 3",lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources,injectResources:b.injectedResources})
};
if(d){this.initResourcePicker()
}$(document).bind(biblia.events.primaryResourceChange,function(g,f){if(!b.resourceInfo){b.resourceInfo=f;
b.setCurrentResource(b.resourceInfo)
}});
this.getTitle=function(){this.initResourcePicker();
return this.jqTitle
};
this.container.delegate(".search-result","click",function(i){i.preventDefault();
var g=$(this);
var f=g.tmplItem();
g.radioClass("selected");
if(!(g.length&&f&&f.data)){return
}var h=f.data.nav;
if(!h){return
}b.container.trigger(biblia.events.navigationRequest,h)
});
this.form.submit(function(g){g.preventDefault();
var f=$(this);
b.requestResults(f.attr("action"),{query:f.find("input[name='query']").first().val(),resources:f.find("input[name='resources']").first().val(),contentType:"js"})
})
}SearchController.prototype=util.extend(TabController);
SearchController.prototype.runSearch=function(d,e){this.form.find("input[name='query']").first().val(d);
this.form.find("input.input-hint").focus();
for(var a in this.injectedResources){var c=this.injectedResources[a];
if(e==c.resourceName){e=c
}}var b=e||SearchController.entireLibraryResource;
this.jqResourceSelector.resourcepicker("selectItem",b);
this.setCurrentResource(b)
};
SearchController.prototype.setCurrentResource=function(a){if(a){this.resourceInfo=a;
this.fnUpdateTitle(this.getTitle());
this.form.find("input[name='resources']").val(a.resourceName).submit()
}};
SearchController.prototype.requestResults=function(f,e){var a=this;
var d=e.query;
var c=function(){if(a.currentRequest){a.currentRequest.abort();
a.currentRequest=null
}};
c();
if(!d||!$.trim(d)){return
}function b(){a.strUrl=f;
a.params=e;
var h=f+"?"+$.param(e);
a.positionResults();
var g=a.container.find("#search-results-container");
g.ajaxscroll({fnGetPage:$.proxy(a.getPage,a),chunkload:$.proxy(a.showLoading,a),error:$.proxy(a.onError,a),edgeTriggerDistance:400,unloadTriggerScreens:-1,bVirtualizeScrollPosition:false,initialPageUrl:h,clearInitialContent:true}).append(a.jqLoadingIndicator);
g.referenceCompare();
biblia.history.trackPageView(h)
}if(e.resources==SearchController.openResources.resourceName){a.container.trigger(biblia.events.openResourceRequest,[function(i){var g=[];
for(var h in i){if(i[h].resourceName){g.push(i[h].resourceName)
}}e.resources=g.join(",");
b()
}])
}else{b()
}};
SearchController.prototype.onError=function(){this.jqSearchInput.filterInput("setResultCount","Error.");
this.jqLoadingIndicator.detach()
};
SearchController.prototype.getPage=function(b){var a={hitCount:b.hitCount,resultCount:b.resultCount,results:[],phrases:b.phrases};
$.each(b.results,function(c,e){var d=new NavigationRequest({type:e.resourceType,resourceName:e.resourceName});
if(e.reference){d.setReference(e.reference)
}else{if(e.headword){d.setHeadword(e.headword)
}else{if(e.articleId){d.articleId=e.articleId
}}}a.results.push({nav:d,title:e.title,resourceTitle:e.resourceTitle,resourceAbbreviatedTitle:e.resourceAbbreviatedTitle,preview:e.preview})
});
jqChunk=$('<div class="content-chunk"></div>').append($.tmpl(this.template,a));
if(!jqChunk.children().length){jqChunk.append($("<div></div>").attr("id","search-result-summary").text("No results found"))
}this.jqSearchInput.filterInput("setResultCount",b.resultCount);
this.positionResults();
this.params.start=b.start+b.limit;
return{content:jqChunk,prevPageUrl:null,nextPageUrl:b.start+b.limit>=b.resultCount?null:(this.strUrl+"?"+$.param(this.params)),chunkloadData:b.start+b.limit<b.resultCount}
};
SearchController.prototype.showLoading=function(b,c){var a=this.container.find("#search-results-container");
if(c[a.ajaxscroll("getChunkloadDataIdx")]){a.find(".content-chunk:last").append(this.jqLoadingIndicator)
}else{this.jqLoadingIndicator.detach()
}};
SearchController.prototype.positionResults=function(){var b=this;
var a=b.container.find("#search-results-container");
if(a&&a.is(":visible")){var c={my:"left top",at:"left bottom",of:a.prev(),offset:"0"};
a.position(c)
}};
SearchController.prototype.onSelectedResourceChanged=function(b,a){this.positionResults();
this.setCurrentResource(a[0])
};
SearchController.prototype.onShow=function(){this.positionResults()
};
SearchController.entireLibraryResource={resourceName:"ENTIRE_LIBRARY",title:"Entire Library",type:"CUSTOM",abbreviatedTitle:"Entire Library",authors:[]};
SearchController.topBibles={resourceName:"TOP_BIBLES",title:"Top Bibles",type:"CUSTOM",abbreviatedTitle:"Top Bibles",authors:[]};
SearchController.openResources={resourceName:"OPEN_RESOURCES",title:"Open Books",type:"CUSTOM",abbreviatedTitle:"All Open Books",authors:[]};
function ContentPaneBase(c){var b=this,a=false;
this.jqContainer=c;
this.jqResourceContainer=c.children(".resource-pane").first();
this.jqPickerButton=null;
this.resourceInfo=null;
this.historyManager=biblia.history.getHistoryManager();
this.initialized=false;
this.fontSizeEms=1;
this.registerInitialHistoryState=function(){if(this.panelInstance instanceof PagedResourcePanel){this.jqContainer.one(biblia.events.locationMarkerChange,$.proxy(function(f){var d=this.panelInstance.getCurrentPosition();
if(d&&!this.historyManager.hasInitialState()){this.historyManager.replaceState(d)
}this.updateHistoryControls()
},this))
}};
this.jqContainer.bind(biblia.events.resourceChange,function(f,d){b.jqPickerButton&&b.jqPickerButton.resourcepicker("selectItem",d[0])
});
this.jqContainer.bind(biblia.events.userJump,function(f,d){if(a){a=false;
return
}if(!d){throw new Error(biblia.events.userJump+" triggered, but no navRequest provided.")
}b.historyManager.pushState(d);
b.updateHistoryControls()
});
this.jqContainer.bind(biblia.events.resizeFont,function(g,d,f){b.jqResourceContainer.find(".face").each(function(){$(this).css("font-size",d+"em")
});
b.fontSizeEms=d;
f()
});
this.jqContainer.delegate("div.history","click",function(h){var f=$(this),d=f.is(".history-back")?"back":"forward",g=b.historyManager[d]();
if(g){a=true;
b.load(g)
}b.updateHistoryControls()
})
}ContentPaneBase.prototype.getCurrentReference=function(){if(this.panelInstance instanceof ResourcePanel){return this.panelInstance.getCurrentPosition().reference
}return null
};
ContentPaneBase.prototype.load=function(c,f,e,a){var b=this;
function d(){var i=c.toUrl("html",false,true),h;
if(e){b.jqResourceContainer.empty()
}else{h=setTimeout(function(){b.jqResourceContainer.find(".panel-content").first().empty().append($('<div class="pane-loading ui"><img src="/public/images/ajax-loader.gif" />Loading...</div>'))
},150)
}var g=!!c.isPreloading;
if(i){$.ajax({url:i,success:function(j){clearTimeout(h);
var k=biblia.paneStates.normal;
if(b.panelInstance){k=b.panelInstance.paneState;
b.panelInstance.unload();
b.panelInstance=null;
b.jqResourceContainer.empty()
}if(util.browserDetect.browser=="Explorer"&&util.browserDetect.version<9){b.jqResourceContainer.append(innerShiv(j))
}else{b.jqResourceContainer.append(j)
}ui.roundCorners(b.jqResourceContainer);
ui.ezpz(b.jqResourceContainer);
b.fnInitialize(g);
b.panelInstance.setPaneState(k);
if(b.panelInstance instanceof ResourcePanel){b.panelInstance.setFontSizerLocation(b.fontSizeEms);
b.panelInstance.unlockReference&&b.panelInstance.unlockReference()
}if(!g){biblia.history.trackPageView(i)
}f&&f(b.resourceInfo)
},error:function(k){var j=k&&k.status==403?biblia.resourcestrings.resourcePermissionError:biblia.resourcestrings.resourceChangeError;
b.jqContainer.trigger(biblia.events.info,{nLevel:$.fn.infobar.levels.error,strMsg:j})
}})
}else{b.jqContainer.trigger(biblia.events.info,{nLevel:$.fn.infobar.levels.error,strMsg:biblia.resourcestrings.resourceChangeError})
}}if(!e&&!a&&this.panelInstance instanceof PagedResourcePanel){this.panelInstance.canNavigateTo(c,function(){b.panelInstance instanceof ResourcePanel&&b.panelInstance.cancelTooltips();
b.panelInstance.navigateTo(c,null,true);
f&&f()
},function(){d()
})
}else{d()
}};
ContentPaneBase.prototype.updateHistoryControls=function(){if(!this.panelInstance.jqToolbar||!this.panelInstance.jqToolbar.length){return
}var c=this.panelInstance.jqToolbar.find("div.history"),a=c.filter(".history-back"),b=c.filter(".history-forward");
if(!(a.length&&b.length)){return
}a.toggleClass("unavailable",!this.historyManager.hasBackState());
b.toggleClass("unavailable",!this.historyManager.hasForwardState())
};
ContentPaneBase.prototype.onSelectedResourceChanged=function(c,b,d){this.resourceInfo=b[0];
var a=this.panelInstance instanceof ResourcePanel?this.panelInstance.getCurrentPosition():new NavigationRequest();
a.resourceName=this.resourceInfo?this.resourceInfo.resourceName:null;
a.bIsUserInitiated=true;
delete a.indexedOffset;
delete a.articleId;
if(a.reference&&!(a.reference instanceof Logos.BibleReference)){delete a.reference;
delete a.urlLocationMarker
}a.type=this.resourceInfo.type;
if(a.type==RESOURCE_TYPES.media){delete a.reference;
delete a.headword;
delete a.urlLocationMarker
}this.jqContainer.trigger(biblia.events.userJump,a);
this.load(a,null,d,true)
};
ContentPaneBase.prototype.defaultPanelHandler={};
ContentPaneBase.prototype.panelKindHandlers={};
ContentPaneBase.prototype.getPanelKindHandler=function(d,e){if(!e||!this.panelKindHandlers[e]){var a=d.find(".content-chunk").first();
if(a.length){var f=null;
var b=a.metadata();
if(b&&b.resource&&b.resource.type){f=b.resource.type
}if(f){e=f
}}}if(!e){var c=d.find(".panel-content:first");
if(c.length){e=c.metadata().panel||null
}}return this.panelKindHandlers[e]||this.defaultPanelHandler
};
function ContentPane(c,b){ContentPaneBase.call(this,c);
var a=this,d=0;
this.strPaneId=b;
this.getPanelId=function(){return b+"."+d++
};
this.fnInitialize=function(f){if(this.jqContainer.children().length){var e=this.getPanelKindHandler(this.jqResourceContainer);
this.panelInstance=new e.ctor(this.jqResourceContainer,this.getPanelId(),f);
if(this.panelInstance){if(this.panelInstance.resourceInfo||this.panelInstance instanceof DocumentPanel){this.resourceInfo=this.panelInstance.resourceInfo||null;
if(e.requiresResourcePicker){if(!this.initialized){this.registerInitialHistoryState()
}if(this.panelInstance.jqToolbar.length){this.jqPickerButton=this.panelInstance.jqToolbar.find(".resource-picker-button").children(".resource-title").first();
if(this.jqPickerButton.length){this.jqPickerButton.resourcepicker({changePickerText:false,initialResourceInfo:this.resourceInfo,change:$.proxy(this.onSelectedResourceChanged,this),itemSourceType:e.itemSourceType,itemBiasType:e.itemBiasType,titleSuffix:'&nbsp;<div class="arrow"></div>',lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources})
}}}this.initialized=true
}else{if(this.jqContainer.is("#content-pane-full")){this.initialized=true
}else{if(this.jqContainer.is("#library-pane")&&this.panelInstance.initialized){this.initialized=true
}}}}if(this.panelInstance.jqToolbar&&this.panelInstance.jqToolbar.length>0){this.panelInstance.jqToolbar.find(".x-close").click(function(g){g.preventDefault();
g.stopPropagation();
a.jqContainer.trigger(biblia.events.action,[{type:"close"}])
})
}this.updateHistoryControls()
}};
this.fnInitialize()
}ContentPane.prototype=util.extend(ContentPaneBase);
ContentPane.prototype.defaultPanelHandler={ctor:StandardResourcePanel,itemBiasType:"-bibles",requiresResourcePicker:true};
ContentPane.prototype.panelKindHandlers={resource:ContentPane.prototype.defaultPanelHandler,content:{ctor:ContentPanel},tag:{ctor:TagPanel},reference:{ctor:ReferencePanel,requiresResourcePicker:false},library:{ctor:LibraryPanel,requiresResourcePicker:false},"reading-plan":{ctor:ReadingPlanPanel,requiresResourcePicker:true},"verse-of-the-day":{ctor:VerseOfTheDayPanel},"bible-search-box":{ctor:BibleSearchBoxPanel},"bible-search-results":{ctor:BibleSearchResultsPanel},"embedded-bible":{ctor:EmbeddedBiblePanel}};
ContentPane.prototype.panelKindHandlers[RESOURCE_TYPES.bible]={ctor:BiblePanel,itemBiasType:"bibles",requiresResourcePicker:true};
ContentPane.prototype.panelKindHandlers[RESOURCE_TYPES.media]={ctor:MediaPanel,itemBiasType:"-bibles",requiresResourcePicker:true};
ContentPane.prototype.reattachElements=function(){this.panelInstance.reattachElements()
};
ContentPane.prototype.detachElements=function(){this.panelInstance.detachElements()
};
ContentPane.prototype.hide=function(){this.jqContainer.css("z-index",biblia.zindexes.behind)
};
ContentPane.prototype.mute=function(){this.panelInstance.mute()
};
ContentPane.prototype.unmute=function(){this.panelInstance.unmute()
};
ContentPane.prototype.display=function(){if(this.panelInstance){var a=this.panelInstance.getCurrentPosition();
if(a){biblia.history.trackPageView(a.toUrl())
}}this.panelInstance.unmute()
};
ContentPane.prototype.getDisplayState=function(){return this.panelInstance.paneState
};
ContentPane.prototype.setDisplayState=function(a){var b=null;
this.panelInstance.setPaneState(a);
if(a==biblia.paneStates.fullscreen){this.jqPrevParent=this.jqContainer.parent();
this.jqContainer.removeClass("expanded");
b=this.panelInstance.getCurrentPosition();
this.jqContainer.appendTo($("body")).addClass("fullscreen");
if(b){this.panelInstance.navigateTo(b,null,false)
}}else{b=this.panelInstance.getCurrentPosition();
if(this.jqPrevParent){this.jqContainer.appendTo(this.jqPrevParent).removeClass("fullscreen");
if(b){this.panelInstance.navigateTo(b,null,false)
}this.jqPrevParent=null
}if(a==biblia.paneStates.hidden){this.jqContainer.addClass("invisible");
this.jqContainer.removeClass("expanded")
}else{if(a==biblia.paneStates.normal){if(!this.jqContainer.hasClass("invisible")){if(b){this.panelInstance.navigateTo(b,null,false)
}}this.jqContainer.removeClass("invisible");
this.jqContainer.removeClass("expanded")
}else{if(a==biblia.paneStates.expanded){this.jqContainer.removeClass("invisible");
this.jqContainer.addClass("expanded");
if(b){this.panelInstance.navigateTo(b,null,false)
}}}}}};
ContentPane.prototype.setLinkable=function(a){if(this.panelInstance instanceof ResourcePanel){this.panelInstance.setLinkable(a)
}};
ContentPane.prototype.setLinked=function(a){if(this.panelInstance instanceof ResourcePanel){this.panelInstance.setLinked(a)
}};
ContentPane.create=function(b,a){return new ContentPane(b,a)
};
function EmbeddedResourcePane(a){ContentPaneBase.call(this,a);
this.fnInitialize=function(){if(this.jqContainer.children().length){var e=this.jqResourceContainer.metadata().layout==="minimal";
var c=this.getPanelKindHandler(this.jqResourceContainer);
this.panelInstance=new c.ctor(this.jqResourceContainer,"embedded-resource-pane",false);
if(this.panelInstance){if(!this.initialized){this.registerInitialHistoryState()
}if(this.panelInstance.jqToolbar.length){this.jqPickerButton=this.panelInstance.jqToolbar.find(".resource-picker-button").children(".resource-title").first();
if(this.jqPickerButton.length&&c.requiresResourcePicker){if(!a.is(".disable-resource-picker")){if(this.jqPickerButton){this.jqPickerButton.resourcepicker({changePickerText:false,initialResourceInfo:this.resourceInfo,change:$.proxy(this.onSelectedResourceChanged,this),itemSourceType:c.itemSourceType,itemBiasType:c.itemBiasType,titleSuffix:'&nbsp;<div class="arrow"></div>',lazy:true,noResultMessage:biblia.resourcestrings.resourcePickerNoResults,noResourcesAvailableMessage:biblia.resourcestrings.resourcePickerNoResources})
}}else{this.jqPickerButton.siblings(".arrow").remove();
this.jqPickerButton.unwrap()
}this.initialized=true
}if(e&&!this.jqContainer.is(".hide-text-size-button")){var b=$('<a class="toc-show show-normal"></a>'),d=$('<a class="text-resize-button show-normal">Aa&nbsp;<div class="arrow"></div></a>');
this.panelInstance.jqToolbar.find(".toolbar-bottom-section").append(b).append(d);
this.panelInstance.setMenuButton(d)
}}}this.updateHistoryControls()
}};
this.fnInitialize()
}EmbeddedResourcePane.prototype=util.extend(ContentPaneBase);
EmbeddedResourcePane.create=function(a){return new EmbeddedResourcePane(a)
};
EmbeddedResourcePane.prototype.defaultPanelHandler={ctor:StandardResourcePanel,itemBiasType:"-bibles",requiresResourcePicker:true};
EmbeddedResourcePane.prototype.panelKindHandlers[RESOURCE_TYPES.bible]={ctor:BiblePanel,itemSourceType:"bibles",requiresResourcePicker:true};
function NavigationRequest(a){$.extend(this,NavigationRequest.defaults,a);
if(a){if(a.reference){this.setReference(a.reference)
}if(a.headword){this.setHeadword(a.headword)
}}}NavigationRequest.defaults={pane:null,resourceName:null,datatype:null,type:null,reference:null,headword:null,language:null,articleId:null,relativePosition:null,indexedOffset:null,originatingResourceName:null,associated:false,resourceFallback:null,bPreventPropagation:false};
NavigationRequest.prototype.setReference=function(a){if(!a){return
}else{if(!(a instanceof Logos.Reference)&&$.isPlainObject(a)){this.reference=Logos.LocationMarker.createFromObj(a,Logos.LocationMarker.types.reference)
}else{if(typeof a=="string"){this.reference=Logos.LocationMarker.tryParse(a,encodeURIComponent(a),Logos.LocationMarker.types.reference)
}else{if(a instanceof Logos.Reference){this.reference=a
}else{throw new TypeError(biblia.errors.invalidArgumentType("NavigationRequest.setReference","reference","Logos.Reference or string"))
}}}}this.urlLocationMarker=this.reference.toUrlSafeString()
};
NavigationRequest.prototype.setHeadword=function(a){if(!a){return
}else{if(!(a instanceof Logos.Headword)&&$.isPlainObject(a)){this.headword=Logos.LocationMarker.createFromObj(a,Logos.LocationMarker.types.headword)
}else{if(typeof a=="string"){this.headword=Logos.LocationMarker.tryParse(a,encodeURIComponent(a),Logos.LocationMarker.types.headword)
}else{if(a instanceof Logos.Headword){this.headword=a
}else{throw new TypeError(biblia.errors.invalidArgumentType("NavigationRequest.setHeadword","headword","Logos.Headword or string"))
}}}}this.urlLocationMarker=this.headword.urlHeadword
};
NavigationRequest.prototype.isBibleRequest=function(){return this.type==RESOURCE_TYPES.bible||(!this.type&&this.reference instanceof Logos.BibleReference)
};
NavigationRequest.prototype.toShareUrl=function(b,d,c,a){return this.toUrl(b,d,c,a,true,false)
};
NavigationRequest.prototype.toUrl=function(d,g,b,a,h,i){var c={};
var f;
var e=null;
if(this.defaultAll){e="/?contentType=html"
}else{if(this.type=="search"){e="#"
}else{if(this.url){e=this.url
}else{if(this.associated){f="Associated";
if(this.reference){$.extend(c,{reference:util.referenceToUrl(this.reference)})
}if(this.pane){$.extend(c,{pane:util.referenceToUrl(this.pane)})
}}else{if(this.reference){if((h||this.forceShareUrl)&&(this.type=="bible"||this.type==RESOURCE_TYPES.bible||this.reference instanceof Logos.BibleReference)){f=this.resourceName?"BibleReference":"ReferenceDefaultBible"
}else{f=this.resourceName?"ResourceReference":"Reference"
}$.extend(c,{reference:this.reference.toUrlSafeString()})
}else{if(this.headword){f=(this.resourceName?"Resource":"")+"Headword";
$.extend(c,{headword:this.headword.toUrlSafeString(),language:this.language||null})
}else{if(this.articleId){f="Article";
$.extend(c,{articleId:this.articleId})
}else{if(this.type==RESOURCE_TYPES.media){if(this.indexedOffset){f="MediaDisplayOffset";
$.extend(c,{offset:this.indexedOffset})
}else{f="MediaDisplay"
}}else{if(this.urlLocationMarker){f="Resolve";
$.extend(c,{input:this.urlLocationMarker})
}else{if(this.indexedOffset){f="Offset";
$.extend(c,{offset:this.indexedOffset})
}else{if(this.relativePosition){f="Position";
$.extend(c,{position:this.relativePosition})
}else{if(this.resourceName){f="ResourceDefault"
}}}}}}}}}}}}if(d){if(this.url){e+=(this.url.indexOf("?")!=-1?"&":"?")+"contentType="+d
}else{$.extend(c,{contentType:d})
}}if(g){c.preview=true
}if(b||this.positionFallback){c.positionFallback=true
}if(i||this.preventDefaultFallback){c.preventDefaultFallback=true
}if(a||this.resourceFallback){c.resourceFallback=true
}if(this.resourceName){c.resourceName=this.resourceName
}return e||(f?ROUTING.buildUrl(f,c):ROUTING.buildUrl(c))
};
NavigationRequest.prototype.clone=function(){return $.extend(true,{},this)
};
NavigationRequest.prototype.removeDefaults=function(){for(var a in NavigationRequest.defaults){if(this[a]===NavigationRequest.defaults[a]){delete this[a]
}}};
function LibraryNavRequest(a){$.extend(this,LibraryNavRequest.defaults,a)
}LibraryNavRequest.defaults=$.extend({query:"",start:0,offset:0},NavigationRequest.defaults);
LibraryNavRequest.prototype=util.extend(NavigationRequest);
LibraryNavRequest.prototype.toUrl=function(a){return ROUTING.buildUrl("Library",{q:this.query,start:this.start,offset:this.offset,orderBy:this.orderBy,sortDirection:this.sortDirection,contentType:a})
};
function ReadingPlanNavRequest(a){$.extend(this,ReadingPlanNavRequest.defaults,a)
}ReadingPlanNavRequest.actions={create:0,view:1,edit:2,remove:3};
ReadingPlanNavRequest.defaults={readingPlanId:"",action:ReadingPlanNavRequest.actions.view};
ReadingPlanNavRequest.prototype=util.extend(NavigationRequest);
ReadingPlanNavRequest.prototype.toUrl=function(a){if(this.action==ReadingPlanNavRequest.actions.view){return ROUTING.buildUrl("ReadingPlan",{readingPlanId:this.readingPlanId,contentType:a})
}else{if(this.action==ReadingPlanNavRequest.actions.create){return null
}else{if(this.action==ReadingPlanNavRequest.actions.edit){return null
}else{if(this.action==ReadingPlanNavRequest.actions.remove){return null
}}}}};
var Logos=Logos||{};
Logos.LocationMarker=function(){};
Logos.LocationMarker.prototype.render=function(){throw new Error(biblia.errors.abstractMethod("Logos.LocationMarker","render"))
};
Logos.LocationMarker.prototype.toUrlSafeString=function(){throw new Error(biblia.errors.abstractMethod("Logos.LocationMarker","toUrlSafeString"))
};
Logos.LocationMarker.prototype.equals=function(){throw new Error(biblia.errors.abstractMethod("Logos.LocationMarker","equals"))
};
Logos.LocationMarker.prototype.isEqualOrLessSpecificThan=function(){throw new Error(biblia.errors.abstractMethod("Logos.LocationMarker","isEqualOrLessSpecificThan"))
};
Logos.LocationMarker.types={reference:"reference",headword:"headword"};
Logos.LocationMarker.tryParse=function(d,c,b){if(d instanceof Logos.LocationMarker){return d
}b=util.defaultTo(b,Logos.LocationMarker.types.reference);
if(!d){return null
}if(b===Logos.LocationMarker.types.reference){var a=Logos.BibleReference.tryParse(d);
if(a){return a
}if(c){return new Logos.Reference(d,c)
}}else{if(b===Logos.LocationMarker.types.headword&&c){return new Logos.Headword(d,c)
}else{throw new TypeError(biblia.errors.invalidArgumentValue("Logos.LocationMarker.tryParse","type","must be a member of Logos.LocationMarker.types"))
}}return null
};
Logos.LocationMarker.createFromObj=function(b,a){if($.isPlainObject(b)){if(b.isBibleReference){return $.extend(new Logos.BibleReference(),b)
}if(b.isReference){return $.extend(new Logos.Reference(),b)
}if(b.isHeadword){return $.extend(new Logos.Headword(),b)
}}return null
};
var Logos=Logos||{};
Logos.Reference=function(b,a){Logos.LocationMarker.call(this);
this.strReference=b;
this.strUrlReference=(a&&a.replace("%3A","."))||b;
this.isReference=true
};
Logos.Reference.prototype=util.extend(Logos.LocationMarker);
Logos.Reference.prototype.render=function(){return this.strReference
};
Logos.Reference.prototype.toUrlSafeString=function(){return this.strUrlReference
};
Logos.Reference.prototype.equals=function(a){if(a instanceof Logos.Reference&&a.strReference){return this.strUrlReference===a.strUrlReference
}return false
};
Logos.Reference.prototype.isEqualOrLessSpecificThan=function(a){return this.equals(a)
};
var Logos=Logos||{};
Logos.Headword=function(b,a){Logos.LocationMarker.call(this);
this.strHeadword=b;
this.strUrlHeadword=a||b;
this.isHeadword=true
};
Logos.Headword.prototype=util.extend(Logos.LocationMarker);
Logos.Headword.prototype.render=function(){return this.strHeadword
};
Logos.Headword.prototype.toUrlSafeString=function(){return this.strUrlHeadword
};
Logos.Headword.prototype.equals=function(a){if(a instanceof Logos.Headword&&a.strHeadword){return this.strUrlHeadword===a.strUrlHeadword
}return false
};
Logos.Headword.prototype.isEqualOrLessSpecificThan=function(a){return this.equals(a)
};
var Logos=Logos||{};
Logos.BibleReference=function(d,b){Logos.Reference.call(this);
if(d){d=d.replace(/^\s+|\s+$/g,"");
var e=Logos.BibleReference.refRegExp.exec(d);
if(e){var a=Logos.BibleReference.getBookInfo(e[3]);
if(a==null){throw new Error("Not a reference: "+d)
}this.isRange=false;
this.book=a.shortReference;
this.chapter=e[4]?Number(e[4]):null;
this.isSingleChapterBook=a.isSingleChapterBook;
this.section=a.section;
if(e[5]){var f=Logos.BibleReference.verseSuffixRegExp.exec(e[5]);
if(f){this.verse=Number(f[1]);
if(f[3]){this.isRange=true;
this.startReference=new Logos.BibleReference();
this.startReference.book=this.book;
this.startReference.chapter=this.chapter;
this.startReference.verse=this.verse;
this.endReference=new Logos.BibleReference();
this.endReference.book=this.book;
this.endReference.chapter=this.chapter;
if(f[3]=="f"){this.endReference.verse=this.verse+1
}else{if(f[3]=="ff"){this.endReference.verse=this.verse+10
}}}}else{this.verse=Number(e[5])
}}else{this.verse=null
}if(this.isSingleChapterBook){if(this.chapter!=null&&this.verse==null){this.verse=this.chapter;
this.chapter=1
}}if(e[6]){var c=Logos.BibleReference.refRangeRegExp.exec(e[6]);
if(c){this.isRange=true;
this.startReference=new Logos.BibleReference();
this.startReference.book=this.book;
this.startReference.chapter=this.chapter;
this.startReference.verse=this.verse;
this.endReference=new Logos.BibleReference();
this.endReference.book=this.book;
if(c[2]){this.endReference.chapter=Number(c[1]);
this.endReference.verse=Number(c[2])
}else{this.endReference.chapter=this.chapter;
this.endReference.verse=Number(c[1])
}}}}else{var a=Logos.BibleReference.getBookInfo(d);
if(a==null){throw new Error("Not a reference: "+d)
}this.book=a.shortReference;
this.chapter=null;
this.verse=null;
this.isRange=false;
this.isSingleChapterBook=a.isSingleChapterBook;
this.section=a.section
}this.datatype=(b&&b.replace("+",""))||null;
this.isBibleReference=true
}};
Logos.BibleReference.prototype=util.extend(Logos.Reference);
Logos.BibleReference.refRegExp=new RegExp("(\\W|^)((Z(?:e(?:p(?:h(?:aniah)?)?|c(?:h(?:ariah)?)?)|[pc])|W(?:is(?:d(?:om(?:\\s+of\\s+(?:Ben\\s+Sirah?|Solomon))?|\\.?\\s+of\\s+Sol))?|s)|T(?:ob(?:it)?|i?t(?:us)?|he(?:\\s+(?:Song\\s+of\\s+(?:Three\\s+(?:Youth|Jew)s|the\\s+Three\\s+Holy\\s+Children)|Re(?:velation|st\\s+of\\s+Esther))|ssalonians)|b)|S(?:us(?:anna)?|o(?:ng(?:\\s+(?:of\\s+(?:Thr(?:ee(?:\\s+(?:(?:Youth|Jew)s|Children))?)?|So(?:l(?:omon)?|ngs)|the\\s+Three\\s+Holy\\s+Children)|Thr))?)?|ir(?:a(?:c?h)?)?|OS)|R(?:u(?:th)?|o(?:m(?:ans)?)?|e(?:v(?:elation)?|st\\s+of\\s+Esther)?|[vm]|th)|Qoh(?:eleth)?|P(?:s(?:\\s+Sol(?:omon)?|a(?:lm(?:s(?:\\s+(?:of\\s+)?Solomon)?)?)?|Sol|s|l?m)?|r(?:ov(?:erbs)?|\\s+(?:(?:of\\s+)?Man|Az)|ayer\\s+of\\s+(?:Manasse[sh]|Azariah)|v)?|h(?:il(?:e(?:m(?:on)?)?|ippians)?|[pm])|p|Ma)|O(?:b(?:ad(?:iah)?)?|des)|N(?:u(?:m(?:bers)?)?|e(?:h(?:emiah)?)?|a(?:h(?:um)?)?|[mb])|M(?:rk?|ic(?:ah)?|a(?:t(?:t(?:hew)?)?|l(?:achi)?|rk)|[tlk])|L(?:uke?|e(?:v(?:iticus)?|t(?:ter\\s+of\\s+Jeremiah|\\s+Jer))?|a(?:od(?:iceans)?|m(?:entations)?)?|[vk]|tr\\s+Jer|Je)|J(?:u?d(?:g(?:es)?|ith|e)?|o(?:s(?:h(?:ua)?)?|n(?:ah)?|el?|hn|b)|nh?|e(?:r(?:emiah)?)?|d(?:th?|gs?)|a(?:me)?s|[ts]h|[rmlgb]|hn)|Is(?:a(?:iah)?)?|H(?:o(?:s(?:ea)?)?|e(?:b(?:rews)?)?|a(?:g(?:gai)?|b(?:akkuk)?)|g)|G(?:e(?:n(?:esis)?)?|a(?:l(?:atians)?)?|n)|E(?:z(?:ra?|e(?:k(?:iel)?)?|k)|x(?:o(?:d(?:us)?)?)?|s(?:th(?:er)?)?|p(?:ist(?:le\\s+(?:to\\s+(?:the\\s+)?Laodiceans|Laodiceans)|\\s+Laodiceans)|h(?:es(?:ians)?)?|\\s+Laod)?|c(?:cl(?:es(?:iast(?:icu|e)s)?|us)?)?|noch)|D(?:eut(?:eronomy)?|a(?:n(?:iel)?)?|[tn])|C(?:ol?(?:ossians)?|anticle(?:\\s+of\\s+Canticle)?s)|B(?:el(?:\\s+and\\s+the\\s+Dragon)?|ar(?:uch)?)|A(?:m(?:os)?|dd(?:\\s+(?:Ps(?:alm)?|Es(?:th)?)|ition(?:s\\s+to\\s+Esther|al\\s+Psalm)|Esth)|c(?:ts)?|zariah|Es)|\\u03C8|(?:4(?:th\\s)?|[Ff]ourth\\s|(?:IIII|IV)\\s)\\s*(?:Ma(?:c(?:c(?:abees)?)?)?)|(?:3(?:rd\\s)?|[Tt]hird\\s|III\\s)\\s*(?:Ma(?:c(?:c(?:abees)?)?)?|Jo(?:h(?:n)?)?|Jn\\.?|Jhn|J)|(?:(?:2(?:nd\\s)?|[Ss]econd\\s|II\\s)|(?:1(?:st\\s)?|[Ff]irst\\s|I\\s))\\s*(?:T(?:i(?:m(?:othy)?)?|h(?:es(?:s(?:alonians)?)?)?)|S(?:a(?:m(?:uel)?)?|m)?|P(?:e(?:t(?:er)?)?|t)?|Ma(?:c(?:c(?:abees)?)?)?|K(?:i(?:n(?:gs)?)?|(?:gs)?)|J(?:o(?:hn?)?|h?n?)|Es(?:d(?:r(?:as)?)?)?|C(?:o(?:r(?:inthians)?)?|h(?:r(?:on(?:icles)?)?)?)))(?:\\.?\\s*(\\d{1,3})(?:\\s?\\:\\s?|\\.|\\s)?(?:(\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?)(\\s?(?:-|--|\\u2013|\\u2014)\\s?\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?((?:\\s?\\:\\s?|\\.|\\s)\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?)?(?!\\s*(?:T(?:i(?:m(?:othy)?)?|h(?:es(?:s(?:alonians)?)?)?)|S(?:a(?:m(?:uel)?)?|m)?|P(?:e(?:t(?:er)?)?|t)?|Ma(?:c(?:c(?:abees)?)?)?|K(?:i(?:n(?:gs)?)?|(?:gs)?)|J(?:o(?:hn?)?|h?n)|Es(?:d(?:r(?:as)?)?)?|C(?:o(?:r(?:inthians)?)?|h(?:r(?:on(?:icles)?)?)?))(?:\\W)))?)?)|(Ob(?:ad(?:iah)?)?|P(?:h(?:ile(?:m(?:on)?)?|m)|m)|(?:(?:2(?:nd\\s)?|[Ss]econd\\s|II\\s)|(?:3(?:rd\\s)?|[Tt]hird\\s|III\\s))\\s*J(?:o(?:hn?)?|h?n?)|Ju?de?)\\s*\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?(?:\\s?(?:-|--|\\u2013|\\u2014)\\s?\\d{1,3}(?:(?:\\s?(?:[a-z]|ff))(?=\\W|$))?)?)","i");
Logos.BibleReference.refRangeRegExp=new RegExp("(?:\\s?(?:-|--|\\u2013|\\u2014)\\s?(\\d{1,3}))\\s?(?::|.)?\\s?(\\d{1,3})?");
Logos.BibleReference.verseSuffixRegExp=new RegExp("^(\\d+)\\s*([a-e])?(f{1,2})?");
Logos.BibleReference.prototype.compareTo=function(b){if(this.book==null||b.book==null){return null
}if(this.book.toLowerCase()==b.book.toLowerCase()){if(this.chapter==b.chapter||this.chapter==null||b.chapter==null){if(this.verse==b.verse||this.verse==null||b.verse==null){return 0
}else{if(this.verse<b.verse){return -1
}else{if(this.verse>b.verse){return 1
}}}}else{if(this.chapter<b.chapter){return -1
}else{if(this.chapter>b.chapter){return 1
}}}}else{if(this.book!=null&&b.book!=null){var e=null;
var d=null;
for(var a=0;
a<Logos.BibleReference.bookInfoTable.length;
a++){var c=Logos.BibleReference.bookInfoTable[a];
if(this.book==c.shortReference){e=a
}if(b.book==c.shortReference){d=a
}}if(e!=null&&d!=null){return(e<d)?-1:1
}}}return null
};
Logos.BibleReference.prototype.equals=function(c){if(c){var b=this.book!=null?this.book.toLowerCase():null;
var a=c.book!=null?c.book.toLowerCase():null;
return b==a&&this.chapter==c.chapter&&this.verse==c.verse
}return false
};
Logos.BibleReference.prototype.isEqualOrLessSpecificThan=function(d){var c=this.clone();
if(d){var b=c.book!=null?c.book.toLowerCase():null;
var a=d.book!=null?d.book.toLowerCase():null;
if(b==a){c.chapter=c.chapter||1;
c.verse=c.verse||1;
if(c.chapter==d.chapter&&c.verse==d.verse){if(!c.isRange&&!d.isRange){return true
}if(c.isRange&&d.isRange&&c.startReference.equals(d.startReference)&&c.endReference.equals(d.endReference)){return true
}if(c.isRange&&!d.isRange&&c.startReference.equals(d)){return true
}if(!c.isRange&&d.isRange&&c.equals(d.startReference)){return true
}}}}return false
};
Logos.BibleReference.prototype.clone=function(){return new Logos.BibleReference(this.toString())
};
Logos.BibleReference.prototype.render=function(){return this.toString(true)
};
Logos.BibleReference.prototype.toUrlSafeString=function(){var a=this.toString().replace(/\s/g,"").replace(/[:]/g,".");
if(this.datatype&&this.datatype!="bible"){return this.datatype+"."+a
}return a
};
Logos.BibleReference.prototype.toString=function(c,b){var d="";
if(b){d=Logos.BibleReference.getBookInfo(this.book).shortReference
}else{if(c){var a=Logos.BibleReference.getBookInfo(this.book);
d=a.displayReference
}else{d=this.book
}}if(!this.isSingleChapterBook){if(this.chapter!=null){d+=" "+this.chapter
}if(this.verse!=null){d+=":"+this.verse
}if(this.isRange){d+="-";
if(this.endReference.chapter==this.chapter){d+=this.endReference.verse
}else{d+=this.endReference.chapter+":"+this.endReference.verse
}}}else{if(this.verse!=null){d+=" "+this.verse;
if(this.isRange){d+="-"+this.endReference.verse
}}}return d
};
Logos.BibleReference.prototype.toShortestString=function(){var a=Logos.BibleReference.getBookInfo(this.book);
var b=a.shortestReference;
if(!this.isSingleChapterBook){if(this.chapter!=null){b+=this.chapter
}if(this.verse!=null){b+="."+this.verse
}if(this.isRange){if(this.endReference.chapter==this.chapter){if(this.endReference.verse==this.verse+1){b+="f"
}else{b+="-"+this.endReference.verse
}}else{b+="-"+this.endReference.chapter+"."+this.endReference.verse
}}}else{if(this.verse!=null){b+=this.verse;
if(this.isRange){b+="-"+this.endReference.verse
}}}return b
};
Logos.BibleReference.tryParse=function(c,b){if(!c){return null
}if(c instanceof Logos.BibleReference){return c
}if(typeof c!="string"){throw new Error("Invalid non-string parameter passed to Logos.BibleReference.tryParse")
}var a=null;
try{a=new Logos.BibleReference(c,b)
}catch(d){a=null
}return a
};
Logos.BibleReference.isBibleReference=function(a){var b=Logos.BibleReference.tryParse(a);
return b!==null
};
Logos.BibleReference.containsReference=function(a){return Logos.BibleReference.refRegExp.test(a)
};
Logos.BibleReference.isBook=function(a){return Logos.BibleReference.getBookInfo(a)!=null
};
Logos.BibleReference.toShortForm=function(b){var a=Logos.BibleReference.getBookInfo(b);
if(a!=null){return a.shortReference
}return b
};
Logos.BibleReference.getBookInfo=function(b){for(var a=0;
a<Logos.BibleReference.bookInfoTable.length;
a++){var c=Logos.BibleReference.bookInfoTable[a];
if(c.RE.test(b)){return c
}}return null
};
Logos.BibleReference.bookInfoTable=[{RE:new RegExp("^\\s*(G(?:e(?:n(?:esis)?)?|n))\\s*$","i"),shortReference:"Ge",shortestReference:"Ge",displayReference:"Genesis",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Ex(?:o(?:d(?:us)?)?)?)\\s*$","i"),shortReference:"Ex",shortestReference:"Ex",displayReference:"Exodus",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(L(?:e(?:v(?:iticus)?)?|v))\\s*$","i"),shortReference:"Le",shortestReference:"Le",displayReference:"Leviticus",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(N(?:u(?:m(?:b(?:ers)?)?)?|[mb]))\\s*$","i"),shortReference:"Nu",shortestReference:"Nu",displayReference:"Numbers",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(D(?:e(?:ut(?:eronomy)?)?|t))\\s*$","i"),shortReference:"Dt",shortestReference:"Dt",displayReference:"Deuteronomy",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(J(?:os(?:h(?:ua)?)?|sh))\\s*$","i"),shortReference:"Jos",shortestReference:"Jos",displayReference:"Joshua",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(J(?:dgs?|udg(?:es)?|g))\\s*$","i"),shortReference:"Jdg",shortestReference:"Jg",displayReference:"Judges",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(R(?:u(?:th)?|th))\\s*$","i"),shortReference:"Ru",shortestReference:"Ru",displayReference:"Ruth",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*((?:1(?: ?S(?:a(?:muel)?|m)?|st S(?:a(?:m(?:uel)?)?|m)?| Sam)|I(?: S(?:a(?:m(?:uel)?)|m)| S| Sa|Sam|Samuel)|First S(?:a(?:m(?:uel)?)?|m)?))\\s*$","i"),shortReference:"1 Sa",shortestReference:"1S",displayReference:"1 Samuel",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*((?:2(?: ?S(?:a(?:m(?:uel)?)?|m)?|nd S(?:a(?:m(?:uel)?)?|m)?)|II ?S(?:a(?:m(?:uel)?)?|m)?|Second S(?:a(?:m(?:uel)?)?|m)?))\\s*$","i"),shortReference:"2 Sa",shortestReference:"2S",displayReference:"2 Samuel",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*((?:1(?: ?K(?:i(?:n(?:gs)?)?|gs)?|st K(?:i(?:n(?:gs)?)?|gs)?)|I ?K(?:i(?:n(?:gs)?)?|gs)?|First K(?:i(?:n(?:gs)?)?|gs)?))\\s*$","i"),shortReference:"1 Ki",shortestReference:"1K",displayReference:"1 Kings",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*((?:2(?: ?K(?:i(?:n(?:gs)?)?|gs)?|nd K(?:i(?:n(?:gs)?)?|gs)?)|II ?K(?:i(?:n(?:gs)?)?|gs)?|Second K(?:i(?:n(?:gs)?)?|gs)?))\\s*$","i"),shortReference:"2 Ki",shortestReference:"2K",displayReference:"2 Kings",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*((?:1(?: ?Ch(?:r(?:on(?:icles)?)?)?|st Ch(?:r(?:on(?:icles)?)?)?)|I ?Ch(?:r(?:on(?:icles)?)?)?|First Ch(?:r(?:on(?:icles)?)?)?))\\s*$","i"),shortReference:"1 Ch",shortestReference:"1Ch",displayReference:"1 Chronicles",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*((?:2(?: ?Ch(?:r(?:on(?:icles)?)?)?|nd Ch(?:r(?:on(?:icles)?)?)?)|II ?Ch(?:r(?:on(?:icles)?)?)?|Second Ch(?:r(?:on(?:icles)?)?)?))\\s*$","i"),shortReference:"2 Ch",shortestReference:"2Ch",displayReference:"2 Chronicles",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Ez(?:ra?)?)\\s*$","i"),shortReference:"Ezr",shortestReference:"Ezr",displayReference:"Ezra",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Ne(?:h(?:em(?:iah)?)?)?)\\s*$","i"),shortReference:"Ne",shortestReference:"Ne",displayReference:"Nehemiah",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Es(?:th(?:er)?)?)\\s*$","i"),shortReference:"Es",shortestReference:"Es",displayReference:"Esther",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Jo?b)\\s*$","i"),shortReference:"Job",shortestReference:"Jb",displayReference:"Job",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Ps(?:alms?|lm|a|m|s)?)\\s*$","i"),shortReference:"Ps",shortestReference:"Ps",displayReference:"Psalm",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Pr(?:ov(?:erbs?)?|v)?)\\s*$","i"),shortReference:"Pr",shortestReference:"Pr",displayReference:"Proverbs",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*((?:Ec(?:c(?:l(?:es(?:iastes)?)?)?)?|Qoh(?:eleth)?))\\s*$","i"),shortReference:"Ec",shortestReference:"Ec",displayReference:"Ecclesiastes",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*((?:S(?:o(?:ng(?: of So(?:l(?:omon)?|ngs))?)?|OS)|Canticle(?: of Canticle)?s))\\s*$","i"),shortReference:"So",shortestReference:"So",displayReference:"Song of Solomon",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Is(?:a(?:i(?:ah)?)?)?)\\s*$","i"),shortReference:"Is",shortestReference:"Is",displayReference:"Isaiah",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(J(?:e(?:r(?:em(?:iah)?)?)?|r))\\s*$","i"),shortReference:"Je",shortestReference:"Je",displayReference:"Jeremiah",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(La(?:m(?:entations)?)?)\\s*$","i"),shortReference:"La",shortestReference:"La",displayReference:"Lamentations",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Ez(?:e(?:k(?:iel)?)?|k))\\s*$","i"),shortReference:"Eze",shortestReference:"Eze",displayReference:"Ezekiel",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(D(?:a(?:n(?:iel)?)?|n))\\s*$","i"),shortReference:"Da",shortestReference:"Da",displayReference:"Daniel",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Ho(?:s(?:ea)?)?)\\s*$","i"),shortReference:"Ho",shortestReference:"Ho",displayReference:"Hosea",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(J(?:oel?|l))\\s*$","i"),shortReference:"Joe",shortestReference:"Jl",displayReference:"Joel",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Am(?:os)?)\\s*$","i"),shortReference:"Am",shortestReference:"Am",displayReference:"Amos",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Ob(?:ad(?:iah)?)?)\\s*$","i"),shortReference:"Ob",shortestReference:"Ob",displayReference:"Obadiah",isSingleChapterBook:true,section:"old"},{RE:new RegExp("^\\s*(J(?:on(?:ah)?|nh))\\s*$","i"),shortReference:"Jon",shortestReference:"Jon",displayReference:"Jonah",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Mi?c(?:ah)?)\\s*$","i"),shortReference:"Mic",shortestReference:"Mc",displayReference:"Micah",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Na(?:h(?:um)?)?)\\s*$","i"),shortReference:"Na",shortestReference:"Na",displayReference:"Nahum",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Ha?b(?:akkuk)?)\\s*$","i"),shortReference:"Hab",shortestReference:"Hb",displayReference:"Habakkuk",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Z(?:ep(?:h(?:aniah)?)?|p))\\s*$","i"),shortReference:"Zep",shortestReference:"Zp",displayReference:"Zephaniah",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(H(?:ag(?:gai)?|g))\\s*$","i"),shortReference:"Hag",shortestReference:"Hg",displayReference:"Haggai",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(Z(?:ec(?:h(?:ariah)?)?|c))\\s*$","i"),shortReference:"Zec",shortestReference:"Zc",displayReference:"Zechariah",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(M(?:al(?:achi)?|l))\\s*$","i"),shortReference:"Mal",shortestReference:"Ml",displayReference:"Malachi",isSingleChapterBook:false,section:"old"},{RE:new RegExp("^\\s*(T(?:ob(?:it)?|b))\\s*$","i"),shortReference:"Tob",shortestReference:"Tb",displayReference:"Tobit",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(J(?:dth?|(?:udi)?th))\\s*$","i"),shortReference:"Jdt",shortestReference:"Jdt",displayReference:"Judith",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:A(?:dd(?: ?Esth| Es|itions to Esther)|Es)|(?:The )?Rest of Esther))\\s*$","i"),shortReference:"Add Es",shortestReference:"AEs",displayReference:"Additions to Esther",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(W(?:is(?:d(?:om(?: of Solomon)?|.? of Sol))?|s))\\s*$","i"),shortReference:"Wis",shortestReference:"Wis",displayReference:"Wisdom of Solomon",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:Sir(?:a(?:c?h)?)?|Wisdom of Ben Sirah?|Ben Sirah?|Eccl(?:esiastic)?us))\\s*$","i"),shortReference:"Sir",shortestReference:"Sr",displayReference:"Sirach",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(Bar(?:uch)?)\\s*$","i"),shortReference:"Bar",shortestReference:"Bar",displayReference:"Baruch",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(L(?:et(?: Jer|ter of Jeremiah)|Je|tr Jer))\\s*$","i"),shortReference:"Let Jer",shortestReference:"LJ",displayReference:"Letter of Jeremiah",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:Song (?:of (?:Thr(?:ee(?: (?:(?:Youth|Jew)s|Children))?)?|the Three Holy Children)|Thr)|The Song of (?:Three (?:Youth|Jew)s|the Three Holy Children)|Pr(?: Az|ayer of Azariah)|Azariah))\\s*$","i"),shortReference:"Song Thr",shortestReference:"ST",displayReference:"Song of Three Youths",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(Sus(?:anna)?)\\s*$","i"),shortReference:"Sus",shortestReference:"Su",displayReference:"Susanna",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(Bel(?: and the Dragon)?)\\s*$","i"),shortReference:"Bel",shortestReference:"Bl",displayReference:"Bel and the Dragon",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:1(?: ?M(?:a(?:cc(?:abees)?)?)?|st M(?:a(?:c(?:c(?:abees)?)?)?)?| Mac)|I ?M(?:a(?:c(?:c(?:abees)?)?)?)?|First M(?:a(?:c(?:c(?:abees)?)?)?)?))\\s*$","i"),shortReference:"1 Mac",shortestReference:"1M",displayReference:"1 Maccabees",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:2(?: ?M(?:a(?:c(?:c(?:abees)?)?)?)?|nd M(?:a(?:c(?:c(?:abees)?)?)?)?)|II ?M(?:a(?:c(?:c(?:abees)?)?)?)?|Second M(?:a(?:c(?:c(?:abees)?)?)?)?))\\s*$","i"),shortReference:"2 Mac",shortestReference:"2M",displayReference:"2 Maccabees",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:1(?: ?Es(?:d(?:r(?:as)?)?)?|st Es(?:d(?:r(?:as)?)?)?)|I ?Es(?:d(?:r(?:as)?)?)?|First Es(?:d(?:r(?:as)?)?)?))\\s*$","i"),shortReference:"1 Esd",shortestReference:"1E",displayReference:"1 Esdras",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(P(?:r(?: (?:of )?Man|ayer of Manasse[hs])|Ma))\\s*$","i"),shortReference:"Pr Man",shortestReference:"PMa",displayReference:"Prayer of Manasseh",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(Add(?: Ps(?:alm)?|itional Psalm))\\s*$","i"),shortReference:"Add Ps",shortestReference:"APs",displayReference:"Additional Psalm",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:3(?: ?M(?:a(?:c(?:c(?:abees)?)?)?)?|rd M(?:a(?:c(?:c(?:abees)?)?)?)?)|III ?M(?:a(?:c(?:c(?:abees)?)?)?)?|Third M(?:a(?:c(?:c(?:abees)?)?)?)?))\\s*$","i"),shortReference:"3 Mac",shortestReference:"3M",displayReference:"3 Maccabees",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:2(?: ?Es(?:d(?:r(?:as)?)?)?|nd Es(?:d(?:r(?:as)?)?)?)|I(?:I(?: ?Es(?:d(?:r(?:as)?)?)?|II ?Ez(?:ra?)?)|V ?Ez(?:ra?)?)|4(?: ?Ez(?:ra?)?|th Ez(?:ra?)?)|Second Es(?:d(?:r(?:as)?)?)?|Fourth Ez(?:ra?)?))\\s*$","i"),shortReference:"2 Esd",shortestReference:"2E",displayReference:"2 Esdras",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:4(?: ?M(?:a(?:c(?:c(?:abees)?)?)?)?|th M(?:a(?:c(?:c(?:abees)?)?)?)?)|I(?:V ?M(?:a(?:c(?:c(?:abees)?)?)?)?|III ?M(?:a(?:c(?:c(?:abees)?)?)?)?)|Fourth M(?:a(?:c(?:c(?:abees)?)?)?)?))\\s*$","i"),shortReference:"4 Mac",shortestReference:"4M",displayReference:"4 Maccabees",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(Odes?)\\s*$","i"),shortReference:"Ode",shortestReference:"Od",displayReference:"Odes",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(Ps(?:alms (?:of )?Solomon| ?Sol| Solomon))\\s*$","i"),shortReference:"Ps Sol",shortestReference:"PsSo",displayReference:"Psalms of Solomon",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((?:Laod(?:iceans)?|Ep(?:ist(?:le (?:to (?:the )?Laodiceans|Laodiceans)| Laodiceans)| Laod)))\\s*$","i"),shortReference:"Laod",shortestReference:"Ld",displayReference:"Epistle to the Laodiceans",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*((Enoch))\\s*$","i"),shortReference:"Enoch",shortestReference:"En",displayReference:"Enoch",isSingleChapterBook:false,section:"apocrypha"},{RE:new RegExp("^\\s*(M(?:at(?:t(?:h(?:ew)?)?)?|t))\\s*$","i"),shortReference:"Mt",shortestReference:"Mt",displayReference:"Matthew",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(M(?:rk?|(?:ar)?k))\\s*$","i"),shortReference:"Mk",shortestReference:"Mk",displayReference:"Mark",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(L(?:ke?|uke?))\\s*$","i"),shortReference:"Lk",shortestReference:"Lk",displayReference:"Luke",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(J(?:no?|o?hn))\\s*$","i"),shortReference:"Jn",shortestReference:"Jn",displayReference:"John",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(Ac(?:ts)?)\\s*$","i"),shortReference:"Ac",shortestReference:"Ac",displayReference:"Acts",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(R(?:o(?:m(?:ans)?)?|m))\\s*$","i"),shortReference:"Ro",shortestReference:"Ro",displayReference:"Romans",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?Co(?:r(?:inthians)?)?|st Co(?:r(?:inthians)?)?)|I ?Co(?:r(?:inthians)?)?|First Co(?:r(?:inthians)?)?))\\s*$","i"),shortReference:"1 Co",shortestReference:"1Co",displayReference:"1 Corinthians",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?Co(?:r(?:inthians)?)?|nd Co(?:r(?:inthians)?)?)|II ?Co(?:r(?:inthians)?)?|Second Co(?:r(?:inthians)?)?))\\s*$","i"),shortReference:"2 Co",shortestReference:"2Co",displayReference:"2 Corinthians",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(Ga(?:l(?:atians)?)?)\\s*$","i"),shortReference:"Ga",shortestReference:"Ga",displayReference:"Galatians",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(Ep(?:h(?:es(?:ians)?)?)?)\\s*$","i"),shortReference:"Eph",shortestReference:"Ep",displayReference:"Ephesians",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(P(?:h(?:il(?:ippians)?|p)|p))\\s*$","i"),shortReference:"Php",shortestReference:"Pp",displayReference:"Philippians",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(Co(?:l(?:ossians)?)?)\\s*$","i"),shortReference:"Col",shortestReference:"Co",displayReference:"Colossians",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?Th(?:es(?:s(?:alonians)?)?)?|st Th(?:es(?:s(?:alonians)?)?)?)|I ?Th(?:es(?:s(?:alonians)?)?)?|First Th(?:es(?:s(?:alonians)?)?)?))\\s*$","i"),shortReference:"1 Th",shortestReference:"1Th",displayReference:"1 Thessalonians",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?Th(?:es(?:s(?:alonians)?)?)?|nd Th(?:es(?:s(?:alonians)?)?)?)|II ?Th(?:es(?:s(?:alonians)?)?)?|Second Th(?:es(?:s(?:alonians)?)?)?))\\s*$","i"),shortReference:"2 Th",shortestReference:"2Th",displayReference:"2 Thessalonians",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?Ti(?:m(?:othy)?)?|st Ti(?:m(?:othy)?)?)|I ?Ti(?:m(?:othy)?)?|First Ti(?:m(?:othy)?)?))\\s*$","i"),shortReference:"1 Ti",shortestReference:"1Ti",displayReference:"1 Timothy",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?Ti(?:m(?:othy)?)?|nd Ti(?:m(?:othy)?)?)|II ?Ti(?:m(?:othy)?)?|Second Ti(?:m(?:othy)?)?))\\s*$","i"),shortReference:"2 Ti",shortestReference:"2Ti",displayReference:"2 Timothy",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(Ti?t(?:us)?)\\s*$","i"),shortReference:"Tt",shortestReference:"Tt",displayReference:"Titus",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(P(?:h(?:ile(?:m(?:on)?)?|m)|m))\\s*$","i"),shortReference:"Phm",shortestReference:"Pm",displayReference:"Philemon",isSingleChapterBook:true,section:"new"},{RE:new RegExp("^\\s*(He(?:b(?:rews)?)?)\\s*$","i"),shortReference:"Heb",shortestReference:"He",displayReference:"Hebrews",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*(J(?:a(?:me?)?s?|m))\\s*$","i"),shortReference:"Jas",shortestReference:"Jm",displayReference:"James",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?P(?:e(?:t(?:er)?)?|t)?|st P(?:e(?:t(?:er)?)?|t)?)|I ?P(?:e(?:t(?:er)?)?|t)?|First P(?:e(?:t(?:er)?)?|t)?))\\s*$","i"),shortReference:"1 Pe",shortestReference:"1P",displayReference:"1 Peter",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?P(?:e(?:t(?:er)?)?|t)?|nd P(?:e(?:t(?:er)?)?|t)?)|II ?P(?:e(?:t(?:er)?)?|t)?|Second P(?:e(?:t(?:er)?)?|t)?))\\s*$","i"),shortReference:"2 Pe",shortestReference:"2P",displayReference:"2 Peter",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:1(?: ?J(?:o(?:hn?)?|h?n)?|st J(?:o(?:hn?)?|h?n)?)|I ?J(?:o(?:hn?)?|h?n)?|First J(?:o(?:hn?)?|h?n)?))\\s*$","i"),shortReference:"1 Jn",shortestReference:"1J",displayReference:"1 John",isSingleChapterBook:false,section:"new"},{RE:new RegExp("^\\s*((?:2(?: ?J(?:o(?:hn?)?|h?n)?|nd J(?:o(?:hn?)?|h?n)?)|II ?J(?:o(?:hn?)?|h?n)?|Second J(?:o(?:hn?)?|h?n)?))\\s*$","i"),shortReference:"2 Jn",shortestReference:"2J",displayReference:"2 John",isSingleChapterBook:true,section:"new"},{RE:new RegExp("^\\s*((?:3(?: ?J(?:o(?:hn?)?|h?n)?|rd J(?:o(?:hn?)?|h?n)?)|III ?J(?:o(?:hn?)?|h?n)?|Third J(?:o(?:hn?)?|h?n)?))\\s*$","i"),shortReference:"3 Jn",shortestReference:"3J",displayReference:"3 John",isSingleChapterBook:true,section:"new"},{RE:new RegExp("^\\s*(Ju?de?)\\s*$","i"),shortReference:"Jud",shortestReference:"Jd",displayReference:"Jude",isSingleChapterBook:true,section:"new"},{RE:new RegExp("^\\s*((?:R(?:e(?:v(?:elation)?)?|v)|The Revelation))\\s*$","i"),shortReference:"Re",shortestReference:"Re",displayReference:"Revelation",isSingleChapterBook:false,section:"new"}];
function SidebarManager(c,b){var a=this;
this.panelInfos={searchController:{selector:"#sidebar-pane-search",ctor:SearchController,tab:biblia.tabs.search,title:"Search"},homeController:{selector:"#sidebar-pane-home",ctor:HomeController,tab:biblia.tabs.home,title:"Home"},libraryController:{selector:"#sidebar-pane-library",ctor:LibraryController,tab:biblia.tabs.library,title:"Library"}};
if(!c||c.length!==1){throw new Error("invalid container")
}this.container=c;
this.searchController=null;
$(document).bind(biblia.events.primaryResourceChange,function(f,d){b=d
});
this.container.bind("tabsselect",function(f,g){var h=$(g.panel);
var e;
for(var d in a.panelInfos){e=a.panelInfos[d];
if(h.is(e.selector)){if(!a[d]&&e.ctor){log.log("initializing panel: ",e);
a[d]=new e.ctor(h,e.title,a.updateTabTitle,b)
}c.trigger(biblia.events.changeTab,e.tab);
if(e.click&&$.isFunction(e.click)){e.click()
}if(e.onInit&&$.isFunction(e.onInit)){e.onInit();
delete e.onInit
}}}});
this.container.bind("tabsshow",function(f,g){var h=$(g.panel);
var e;
for(var d in a.panelInfos){e=a.panelInfos[d];
if(h.is(e.selector)){if(a[d].onShow&&$.isFunction(a[d].onShow)){a[d].onShow()
}}}});
this.initMainTabs()
}SidebarManager.prototype.updateTabTitle=function(b){var a=$("#selected-header-text");
a.children().detach();
a.append(b)
};
SidebarManager.prototype.selectPanelInfoBy=function(b,a){for(var c in this.panelInfos){if(this.panelInfos[c][b]===a){return this.panelInfos[c]
}}return null
};
SidebarManager.prototype.selectControllerBy=function(b,a){for(var c in this.panelInfos){if(this.panelInfos[c][b]===a){return this[c]
}}return null
};
SidebarManager.prototype.initMainTabs=function(){var c=this;
var e=$("#selected-header-text");
function g(j){var i=$(j);
var h=c.selectControllerBy("selector",i.attr("href"));
if(h){return h.getTitle()
}return $(j).metadata().description.title
}function d(i){var h=$(this);
if(!h.closest("li").hasClass("ui-state-disabled")){$(e).empty().append(g(h))
}}$("#sidebar div.ui-tabs .hidden").removeClass("hidden");
var b={"reading-view":0,"library-view":1};
var a=0;
var f=$("#content-container");
$.each(biblia.tabviewclasses,function(){if(f.hasClass(this)){a=b[this]
}});
this.jqTabs=$("#sidebar div.ui-tabs").tabs({disabled:[3],collapsible:true,selected:-1,select:function(h,i){d.call(i.tab,h)
}}).tabs("select",a).tabs("option","collapsible",false).removeClass(".ui-corner-all");
$("#selected-header, #selected-header-accent").show();
$("#sidebar .ui-tabs-nav a").hover(d,function(h){$(e).empty().append(g($(this).closest("ul").find("li.ui-tabs-selected:first a")))
});
$("#sidebar .ui-tabs-nav").removeClass("ui-corner-all").addClass("ui-corner-tl");
util.submitOnEnter(this.container.find("form"))
};
SidebarManager.prototype.runSearch=function(c,d){var b=this;
var a=function(){setTimeout(function(){b.searchController.runSearch(c,d)
},50)
};
if(this.searchController){a()
}else{this.panelInfos.searchController.onInit=a
}this.jqTabs.tabs("select",2)
};
SidebarManager.prototype.selectTab=function(a){this.jqTabs.tabs("select",a)
};
function ReadingPlanManager(b){var a=this;
this.container=b;
this.tmplReadingPlan=$.template(null,$("#reading-plan-template").html());
this.tmplReadingPlans=$.template(null,$("#reading-plans-template").html());
function c(g,h,e,d){var f=ROUTING.buildUrl("ReadingPlanMarkRead",{readingPlanId:h,sessionDate:e});
$.ajax({url:f,type:"POST",success:function(j){var i=g.tmplItem().data.numberBehind;
var k=$.tmpl(a.tmplReadingPlan,j);
g.replaceWith(k);
if(d){k.find("a:first").click()
}a.updateNotificationNumber(+a.container.find(".notification-icon").text()-(i-j.numberBehind))
}})
}this.container.delegate("a","click",function(i){i.preventDefault();
i.stopPropagation();
var h=$(this);
if(h.is(".edit-reading-plan")){var d=h.tmplItem();
$(document).trigger(biblia.events.navigationRequest,new ReadingPlanNavRequest({readingPlanId:d.data.id,action:ReadingPlanNavRequest.actions.view}))
}else{var f=h.tmplItem();
var g=f.parent;
a.startReading(g.data.readingPlanId,g.data.date,h.closest("li").index())
}}).delegate(":checkbox","change",function(f){var g=$(this);
if(!g.is(":checked")){return false
}var d=g.tmplItem();
$(document).trigger(biblia.events.markReadingPlan,[d.data.readingPlanId,d.data.date])
});
$(document).bind(biblia.events.markReadingPlan,function(f,g,d){if(!g||!d){return
}a.container.find(".note").each(function(j,k){var h=$(k);
var e=h.tmplItem();
if(e.data.id==g){c(h,g,d,true);
return false
}})
})
}ReadingPlanManager.prototype.loadReadingPlans=function(){$.getJSON("/readingplan/list",$.proxy(function(a){if(!(a&&a.results)){return
}this.container.show();
if(a.results.length){this.container.find(".expander-content").html($.tmpl(this.tmplReadingPlans,{plans:a.results}))
}else{this.container.find(".expander-content").html("<p>No reading plans available</p>")
}this.updateNotification(a.results)
},this))
};
ReadingPlanManager.prototype.updateNotification=function(d){var a=0;
for(var b=0,c=d.length;
b<c;
b++){a+=d[b].numberBehind
}this.updateNotificationNumber(a)
};
ReadingPlanManager.prototype.updateNotificationNumber=function(a){if(a>0){this.container.find(".notification-icon").attr("title",["Behind by ",a," reading",(a!=1?"s":"")].join("")).css("visibility","visible").children(".content").text(a).show()
}else{this.container.find(".notification-icon").hide()
}};
ReadingPlanManager.prototype.startReading=function(c,a,b){$.ajax({type:"POST",url:"/readingplan/startreading",data:{readingPlanId:c,sessionDate:a,item:b},success:$.proxy(function(e){var d=new NavigationRequest({resourceName:e.resourceName,indexedOffset:e.offset,type:e.type});
this.container.trigger(biblia.events.navigationRequest,d)
},this)})
};
ReadingPlanManager.tmplMarker=$.template(null,$("#reading-marker-template").html());
ReadingPlanManager.processContentChunk=function(a){var b=a.find(".reading-marker");
if(!b.length){return false
}b.domSplit("p");
function c(d){return{start:"Start Reading","continue":"Keep Reading",stop:"Stop Reading"}[d]
}b.each(function(g,j){var e=$(j);
var f=e.metadata();
var d={type:(/reading-(start|stop|continue)/).exec(e.attr("class"))[1],title:f.title||"",displayDate:f.displaydate,date:f.date,readingPlanId:f.readingplanid,nextTitle:f.nexttitle,nextResource:f.nextresource,nextReference:f.nextreference,nextStartOffset:f.nextstartoffset};
var k=$.tmpl(ReadingPlanManager.tmplMarker,d,{getDisplayType:c});
function h(l,m){m.preventDefault();
m.stopPropagation();
var i=l.tmplItem();
l.closest(".content-wrapper").find(".resource-reading-marker").remove();
return i
}if(d.type=="stop"){k.find("a.mark-read").click(function(l){var i=h($(this),l);
$(document).trigger(biblia.events.markReadingPlan,[i.data.readingPlanId,i.data.date])
}).bind("mouseenter mouseleave",false)
}if(d.type=="continue"){k.find("a.continue-to-next").click(function(l){var i=h($(this),l);
$(document).trigger(biblia.events.navigationRequest,new NavigationRequest({reference:i.data.nextReference,indexedOffset:i.data.nextStartOffset,resourceName:i.data.nextResource}))
})
}e.replaceWith(k)
});
return true
};
function TabView(c,d,b){var a=this;
if(!b||!b.length){log.error("A TabView must have at least one associated paneGroup");
return
}this.viewClass=c;
this.associatedTabs=d;
this.jqParentContainer=$("#content-container");
this.paneGroups=b;
this.curPaneGroupIdx=null;
if(this.isActive()){$.each(this.paneGroups,function(e,f){if(a.jqParentContainer.hasClass(f.displayClass)){a.curPaneGroupIdx=e
}})
}if(this.curPaneGroupIdx===null){this.curPaneGroupIdx=0
}}TabView.prototype.hasPane=function(a){return this.getGroupIdxOfPane(a)!==-1
};
TabView.prototype.getLastHistory=function(){return this.history
};
TabView.prototype.getGroupIdxOfPane=function(c){for(var a=0,b=this.paneGroups.length;
a<b;
a++){if($.inArray(c,this.paneGroups[a].panes)!==-1){return a
}}return -1
};
TabView.prototype.hasAssociatedTab=function(a){return $.inArray(a,this.associatedTabs)!=-1
};
TabView.prototype.isActivePane=function(c,a){var b=this.getGroupIdxOfPane(c);
return this.hasPane(c)&&b==this.curPaneGroupIdx&&(!a||this.paneGroups[b].panes[0]==c)
};
TabView.prototype.isActive=function(){return this.jqParentContainer.hasClass(this.viewClass)
};
TabView.prototype.curPaneIsCloseable=function(){return this.paneGroups[this.curPaneGroupIdx].isCloseable
};
TabView.prototype.getActiveReference=function(){return this.paneGroups[this.curPaneGroupIdx].panes[0].getCurrentReference()
};
TabView.prototype.getLeftmostBiblePane=function(){for(var a=0,b=this.paneGroups[this.curPaneGroupIdx].panes.length;
a<b;
a++){if(this.paneGroups[this.curPaneGroupIdx].panes[a].panelInstance instanceof BiblePanel){return this.paneGroups[this.curPaneGroupIdx].panes[a]
}}return null
};
TabView.prototype.goToPane=function(d){var a=this;
var b,c;
for(b=0,c=this.paneGroups.length;
b<c;
b++){if($.inArray(d,this.paneGroups[b].panes)!==-1){break
}}if(b<c){this.goToPaneGroup(b);
if(d.getDisplayState()==biblia.paneStates.hidden){$.each(this.paneGroups[this.curPaneGroupIdx].panes,function(e,f){a.resizePane(d,biblia.paneStates.normal)
})
}}else{log.error("Attempted to go to a pane not contained in this TabView")
}};
TabView.prototype.goToPaneGroup=function(a){var b=this;
$.each(biblia.panegroupclasses,function(c,d){b.jqParentContainer.removeClass(d)
});
b.jqParentContainer.addClass(this.paneGroups[a].displayClass);
this.curPaneGroupIdx=a;
$.each(this.paneGroups[this.curPaneGroupIdx].panes,function(c,d){d.getDisplayState()!==biblia.paneStates.hidden&&d.unmute()
})
};
TabView.prototype.resizePane=function(c,a){c.setDisplayState(a);
c.panelInstance.trigger(biblia.events.paneResized,a);
var b=this.getGroupIdxOfPane(c);
if(a==biblia.paneStates.expanded||a==biblia.paneStates.fullscreen){$.each(this.paneGroups[b].panes,function(d,e){if(e!=c){e.setDisplayState(biblia.paneStates.hidden);
e.mute()
}})
}else{if(a==biblia.paneStates.normal){c.unmute();
$.each(this.paneGroups[b].panes,function(d,e){if(e!=c){e.setDisplayState(biblia.paneStates.normal);
e.unmute();
e.panelInstance.trigger(biblia.events.paneResized,a)
}})
}}};
TabView.prototype.setLastHistory=function(a){this.history=a
};
TabView.prototype.display=function(){var a=this;
$.each(biblia.tabviewclasses,function(b,c){if(c==a.viewClass){!a.jqParentContainer.hasClass(c)&&a.jqParentContainer.addClass(c)
}else{a.jqParentContainer.removeClass(c)
}});
this.goToPaneGroup(this.curPaneGroupIdx);
$.each(this.paneGroups[this.curPaneGroupIdx].panes,function(b,c){c.reattachElements()
});
if(!this.paneGroups[this.curPaneGroupIdx].panes[0].initialized&&this.viewClass==biblia.tabviewclasses.library){this.paneGroups[this.curPaneGroupIdx].panes[0].load(new LibraryNavRequest())
}this.unmute()
};
TabView.prototype.hide=function(){this.mute();
$.each(this.paneGroups[this.curPaneGroupIdx].panes,function(a,b){b.detachElements()
})
};
TabView.prototype.closeCurPane=function(){if(!this.paneGroups[this.curPaneGroupIdx].isCloseable){log.error("Attempting to close a non-closeable pane");
return
}for(var a=0,b=this.paneGroups.length;
a<b;
a++){if(!this.paneGroups[a].isCloseable){this.goToPaneGroup(a);
return
}}};
TabView.prototype.mute=function(){$.each(this.paneGroups,function(a,b){$.each(b.panes,function(c,d){d.mute()
})
})
};
TabView.prototype.unmute=function(){$.each(this.paneGroups,function(a,b){$.each(b.panes,function(c,d){d.unmute()
})
})
};
function Application(e){var c=this;
window.ROUTING=new RouteManager(window.routeTable);
this.jqInfobar=$("#infobar").infobar();
this.configure(!!e);
ui.init();
biblia.signin.setOnDisplaySignin(function(){c.jqInfobar.infobar("hideBar")
});
this.contentPanes=[];
this.tabViews=[];
this.jqContent=$("#content-container");
this.primaryResource=null;
this.primaryBibleResource=null;
this.activeReference=null;
this.secondaryReference=null;
this.preferredBiblePaneIdx=null;
this.lastTabTitles={};
this.curTabView=null;
this.bAreLinked=false;
$(".content-pane").each(function(h,j){c.contentPanes.push(ContentPane.create($(j),h+""))
});
this.tabViews[biblia.tabviews.reading]=new TabView(biblia.tabviewclasses.reading,[biblia.tabs.home,biblia.tabs.search],[{displayClass:biblia.panegroupclasses.columned,panes:[this.contentPanes[biblia.panes.left],this.contentPanes[biblia.panes.right]]},{displayClass:biblia.panegroupclasses.full,panes:[this.contentPanes[biblia.panes.fullContent]],isCloseable:true}]);
this.tabViews[biblia.tabviews.library]=new TabView(biblia.tabviewclasses.library,[biblia.tabs.library],[{displayClass:biblia.panegroupclasses.full,panes:[this.contentPanes[biblia.panes.library]]}]);
this.contentPanes[biblia.panes.fullContent].parentTabView=this.tabViews[biblia.tabviews.reading];
this.contentPanes[biblia.panes.left].parentTabView=this.tabViews[biblia.tabviews.reading];
this.contentPanes[biblia.panes.right].parentTabView=this.tabViews[biblia.tabviews.reading];
this.contentPanes[biblia.panes.library].parentTabView=this.tabViews[biblia.tabviews.library];
this.curTabView=$.grep(this.tabViews,function(i,h){return $.inArray(i.viewClass,c.jqContent.attr("class").split(" "))!=-1
})[0];
if(!this.curTabView){log.error("Failure attempting to determine the starting tab view.")
}this.activeReference=this.curTabView.getActiveReference();
var f=this.tabViews[biblia.tabviews.reading].getLeftmostBiblePane();
this.preferredBiblePaneIdx=f==this.contentPanes[biblia.panes.right]?biblia.panes.right:biblia.panes.left;
if(f){this.primaryBibleResource=f.resourceInfo
}var b=function(h){var i="Biblia.com";
if(h){i=[h,i].join(" - ")
}return i
};
var d=function(k,j){if((Modernizr.historymanagement||Modernizr.history)&&j){var i=j.toUrl();
window.history.replaceState(j,"",i)
}if(k){var h=b(k);
document.title=h
}c.curTabView.setLastHistory({title:h,url:i})
};
this.setHistoryStateSoon=$.debounce(200,d);
function a(){if(c.activeReference||c.primaryResource){var h=util.getTitlePart((c.activeReference&&c.activeReference.render)?c.activeReference.render():c.activeReference,c.primaryResource);
c.setHistoryStateSoon(h,new NavigationRequest({reference:c.activeReference,resourceName:c.primaryResource&&(c.primaryResource.resourceName||c.primaryResource)}))
}}function g(k){$("body").delegate("a","click",function(l){if($(this).attr("href")=="#"){l.preventDefault()
}});
function h(l){if(!l.resourceName||(c.primaryBibleResource&&l.resourceName==c.primaryBibleResource.resourceName)){l.removeDefaults();
return $.extend({},new NavigationRequest(c.primaryBibleResource),l)
}if(!l.reference&&!l.indexedOffset&&l.type==RESOURCE_TYPES.bible){l.reference=c.activeReference
}return l
}k.bind(biblia.events.navigationRequest,function(r,n){var l=c.contentPanes[biblia.panes.left];
var m=c.contentPanes[biblia.panes.right];
function p(v){var s=v.target&&$(v.target).closest(".content-pane");
var u=null;
if(s){u=$.grep(c.contentPanes,function(w){return w.jqContainer.attr("id")==s.attr("id")
});
if(u.length===0){u=null
}else{u=u[0];
if(!(u==l||u==m)){u=null
}}}return u
}var o=p(r);
var q=o?(o==l?m:l):null;
if(!n.type&&n.reference instanceof Logos.BibleReference){n.type=RESOURCE_TYPES.bible
}if(o){c.loadPane(q,n)
}else{c.loadPane(c.getNavigationRequestTargetPane(n),n)
}});
k.bind(biblia.events.searchRequest,function(m,l){if(!l.query){log.log("received invalid search request: no query",l);
return
}log.log("received search request",l);
c.sidebar.runSearch(l.query,l.resources)
});
k.bind(biblia.events.action,function(m,l){log.log("received action request",l);
if(l.type=="close"){if(c.curTabView.curPaneIsCloseable()){c.curTabView.closeCurPane();
c.loadLazyContent(true);
a()
}}});
this.handleLinking=$.debounce(300,function(n,l){var m=c.getEventOriginPane(n).panelInstance;
var o=c.contentPanes[biblia.panes.left].panelInstance==m?c.contentPanes[biblia.panes.right].panelInstance:c.contentPanes[biblia.panes.left].panelInstance;
o.navigateTo(new NavigationRequest({resourceName:o.resourceInfo.resourceName,reference:l[0],bIsLinkRequest:true,preventDefaultFallback:true}))
});
k.bind(biblia.events.locationMarkerChange,function(m,l){log.log("received reference change request",l);
if(c.eventOriginatedInPrimaryPane(m)){c.activeReference=l[0];
a()
}if(c.bAreLinked&&l[0] instanceof Logos.BibleReference&&!l[2]){handleLinking(m,l)
}});
k.bind(biblia.events.informationRequest,function(n,m){var l=m[0];
var o=m[1];
if(c.primaryBibleResource){l.removeDefaults();
o(h(l))
}else{o(l)
}});
k.bind(biblia.events.openResourceRequest,function(m,n){var l=(function(){var o=[];
var p={};
return{add:function(q){if(!p[q.resourceName]){o.push(q);
p[q.resourceName]=true
}},toList:function(){return o
}}
})();
if(c.primaryResource){l.add(c.primaryResource)
}$.each(c.contentPanes,function(o,p){if(p.resourceInfo&&p.resourceInfo.resourceName){l.add(p.resourceInfo)
}});
if($.isFunction(n)){n(l.toList())
}});
k.bind(biblia.events.changeTab,function(m,l){if(!(c.curTabView&&c.curTabView.hasAssociatedTab(l))){$.each(c.tabViews,function(){if(this.hasAssociatedTab(l)){this.display();
c.curTabView=this;
var n=this.getLastHistory();
if(n){d(n.title,n.url?new NavigationRequest({url:n.url}):null)
}}else{this.hide()
}})
}});
k.bind(biblia.events.syncPosition,function(p,r,o,m){var n=c.getEventOriginPane(p);
var q=n==c.contentPanes[biblia.panes.left]?PANES.left:(n==c.contentPanes[biblia.panes.right]?PANES.right:null);
if(q!==null){var l=ROUTING.buildUrl(r,$.extend({resourceName:o},r=="SyncWriteReference"?{reference:m,pane:q}:{},r=="SyncWriteHeadword"?{headword:m,pane:q}:{},r=="SyncWriteOffset"?{offset:m,pane:q}:{}));
if(!l){return
}$.post(l)
}});
k.bind(biblia.events.resizePane,function(p,o,l){for(var m=0,n=c.contentPanes.length;
m<n;
m++){var q=c.contentPanes[m];
if(q.panelInstance==l){q.parentTabView.resizePane(q,o);
return
}}});
k.delegate("a","click",function(o){var n=$(o.target);
var l=n.attr("href");
if((/(.*biblia\.com\/content.*)|(^\/content.*)/).test((l||"").toLowerCase())||n.hasClass("content")){o.preventDefault();
var m=new NavigationRequest({url:l});
c.loadPane(c.contentPanes[biblia.panes.fullContent],m)
}});
function j(l){c.bAreLinked=c.bAreLinked&&l;
c.contentPanes[biblia.panes.left].setLinkable(l);
c.contentPanes[biblia.panes.right].setLinkable(l);
c.contentPanes[biblia.panes.left].setLinked(c.bAreLinked);
c.contentPanes[biblia.panes.right].setLinked(c.bAreLinked)
}function i(l){c.bAreLinked=l;
c.contentPanes[biblia.panes.left].panelInstance.setLinked(l);
c.contentPanes[biblia.panes.right].panelInstance.setLinked(l)
}k.bind(biblia.events.panelsLinked,function(m,l){i(l)
});
k.bind(biblia.events.resourceChange,function(o,n){var m=c.curTabView.getLeftmostBiblePane();
c.primaryBibleResource=m?m.resourceInfo:null;
if(c.eventOriginatedInPrimaryPane(o)){if(!c.curTabView.isActivePane(c.contentPanes[biblia.panes.left])&&n[0]&&n[1]){c.contentPanes[c.preferredBiblePaneIdx].initialized=false
}c.primaryResource=n[0];
c.activeReference=null;
a();
$(document).trigger(biblia.events.primaryResourceChange,n)
}else{c.secondaryReference=n[0].reference
}var l=c.contentPanes[biblia.panes.left].resourceInfo&&c.contentPanes[biblia.panes.left].resourceInfo.supportsBibleRefs&&c.contentPanes[biblia.panes.right].resourceInfo&&c.contentPanes[biblia.panes.right].resourceInfo.supportsBibleRefs;
j(l)
});
k.bind(biblia.events.changePageTitleRequest,function(o,n){if(!n){return
}var l=n,m;
if(typeof n=="string"){l=n
}else{if(n){if(n.title){l=n.title
}if(n.url){m=n.url
}}}c.setHistoryStateSoon(l,m?new NavigationRequest({url:m}):null)
});
k.bind(biblia.events.info,function(m,l){c.jqInfobar.infobar("showBar",l.nLevel,l.strMsg,l.strSubMsg,l.nCloseSecs,l.strCookieName)
})
}g($(document));
this.sidebar=new SidebarManager($("#sidebar-offset > .ui-tabs").first(),this.contentPanes[biblia.panes.left].resourceInfo||SearchController.topBibles);
setTimeout($.proxy(function(){this.loadLazyContent()
},this),100)
}Application.prototype.loadPane=function(b,f){var d=this;
var e=null;
var c=[];
$.each(this.tabViews,function(g,h){if(h.hasPane(b)){e=h
}else{c.push(h)
}});
if(e){if(d.curTabView!==e){if(e.associatedTabs.length===0){log.error("Each TabView must have at least one tab associated with it.")
}this.sidebar.selectTab(e.associatedTabs[0])
}if(e.goToPane(b)){var a=null
}b.load(f,a);
this.curTabView=e
}};
Application.prototype.getNavigationRequestTargetPane=function(a){if(a instanceof LibraryNavRequest){return this.contentPanes[biblia.panes.library]
}var b=this.contentPanes[biblia.panes.left];
var h=this.contentPanes[biblia.panes.right];
var c=b;
var i=h;
if(b.resourceInfo&&h.resourceInfo&&b.resourceInfo.type!==RESOURCE_TYPES.bible&&h.resourceInfo.type===RESOURCE_TYPES.bible){c=h;
i=b
}var f=[b,h];
if(a.resourceName){var d=$.grep(f,function(j){return j.resourceInfo&&j.resourceInfo.resourceName===a.resourceName
});
if(d.length==1){return d[0]
}}if(a.datatype){var g=$.grep(f,function(j){return j.resourceInfo&&$.inArray(j.resourceInfo.supportedDataTypes,a.datatype)!==-1
});
if(g.length==1){return g[0]
}}if(a.type){var e=$.grep(f,function(j){return j.resourceInfo&&(j.resourceInfo.type===a.type||(j.resourceInfo.type!==RESOURCE_TYPES.bible&&a.type!==RESOURCE_TYPES.bible))
});
if(e.length==1){return e[0]
}}if(a.isBibleRequest()){return c
}else{return i
}};
Application.prototype.loadLazyContent=function(c){var h=this;
var b=$.grep(this.contentPanes,function(l,k){return !l.initialized&&l.parentTabView!==h.tabViews[biblia.tabviews.library]
});
var d=$.grep(this.contentPanes,function(l,k){return l.initialized
});
if(!c&&this.curTabView.isActivePane(this.contentPanes[biblia.panes.left])){if(d[0].resourceInfo){for(var e=0,g=b.length;
e<g;
e++){b[e].load(new NavigationRequest({associated:true,pane:b[e]==this.contentPanes[biblia.panes.left]?PANES.left:PANES.right,reference:this.activeReference||this.secondaryReference,resourceName:this.primaryResource?this.primaryResource.resourceName:d[0].resourceInfo.resourceName}))
}}else{for(var e=0,g=b.length;
e<g;
e++){b[e].load(new NavigationRequest({defaultAll:true}))
}}}else{if(b.length){var j=0;
if(d.length&&d[0].panelInstance instanceof ReferencePanel){this.preferredBiblePaneIdx=d[0].panelInstance.getPreferredPane();
if(this.preferredBiblePaneIdx!==null){for(var e=0,g=b.length;
e<g;
e++){if(b[e]===this.contentPanes[this.preferredBiblePaneIdx]){j=e
}}}else{this.preferredBiblePaneIdx=biblia.panes.left
}}var f=(this.activeReference||this.primaryResource)?new NavigationRequest({reference:this.activeReference,resourceName:this.primaryResource?this.primaryResource.resourceName:d[0].resourceInfo.resourceName}):new NavigationRequest({defaultAll:true});
var a=!h.curTabView.isActivePane(this.contentPanes[biblia.panes.left]);
$.extend(f,{isPreloading:a});
b[j].load(f,function(k){for(var l=0,m=b.length;
l<m;
l++){if(l!=j){b[l].load(new NavigationRequest({associated:true,pane:b[l]==h.contentPanes[biblia.panes.left]?PANES.left:PANES.right,reference:h.activeReference,resourceName:k?k.resourceName:f.resourceName,isPreloading:a}))
}}})
}}};
Application.prototype.getEventOriginPane=function(c){var e=$(c.target);
if(e.length){for(var a=0,b=this.contentPanes.length;
a<b;
a++){var d=this.contentPanes[a];
if(d.jqContainer.contains(e)||d.jqContainer.get(0)===e.get(0)){return d
}}}return null
};
Application.prototype.eventOriginatedInPrimaryPane=function(b){var a=this.getEventOriginPane(b);
return a!==null&&this.curTabView.isActivePane(a,true)
};
Application.prototype.configure=function(a){if(!a){log.setLevel(0)
}$.metadata.setType("html5")
};
function Highlighter(a){this.jqContainer=$(a);
this.highlightBar=this.jqContainer.children(".highlight-bar");
this.elStart=null;
this.jqHighlightBase=$("<div></div>",{css:{height:"0",overflow:"visible"}});
this.jqHighlightBase.prependTo(this.jqContainer);
if(this.highlightBar.length===0){this.highlightBar=$('<div class="highlight-bar highlight-bar-left ui-corner-right" />').appendTo(this.jqHighlightBase)
}if(!Modernizr.borderradius){this.highlightBar.filter(".ui-corner-right").corner("5px right");
this.highlightBar.filter(".ui-corner-left").corner("5px left")
}this.complete=true
}Highlighter.prototype.getSpacerElements=function(h,c,e){var g=Math.floor(h/c);
var d=h%c;
var l=$("<div></div>").addClass(e);
var k=$([]);
for(var f=0,j=g+1;
f<j;
f++){var a=f==g?d:c;
var b=l.clone();
b.height(a);
k=k.add(b[0])
}return k
};
Highlighter.prototype.setHighlightTop=function(b){var a=this.getSpacerElements(Math.round(b),1000000,"highlight-spacing");
this.jqHighlightBase.children(".highlight-spacing").remove();
a.prependTo(this.jqHighlightBase)
};
Highlighter.prototype.highlight=function(f,s){var l;
var o=this.jqContainer.find(".content-wrapper").first().position().top;
var c=f.render();
var h,d=o;
var n,g,b,r,p,k,m;
log.group("highlighter");
log.time("highlight");
log.debug("highlighting: ",f," - ",s);
if(f.chapter===null||f.verse===null){this.highlightBar.hide();
return
}l=this.jqContainer.find("a[rel='milestone']");
if(!s){s=f
}this.refStart=f;
this.refEnd=s;
this.complete=false;
for(p=0,k=l.length;
p<k;
p++){n=l.eq(p);
g=Logos.BibleReference.tryParse(n.metadata().reference);
if(!g){continue
}if(!b&&(g.equals(f)||(f.verse===null&&g.compareTo(f)===0))){b=n
}if(g.compareTo(s)>0){r=n;
this.complete=true;
break
}}if(l.length){if(!b){var j=Logos.BibleReference.tryParse(l.first().metadata.reference);
if(j&&f.compareTo(j)<0){b=l.first()
}}if(!r){r=n
}}if(b&&r){var q=b.iposition();
var e;
if(g&&g.compareTo(s)<=0){r=r.parent();
r.position()
}else{e=r.iposition()
}if(!q||!e){this.highlightBar.hide();
return
}h=o+q.top;
if(q.left>=b.closest("p").first().width()-2){h+=b.height()
}var a=e.left;
if(b.closest("p").get(0)!=r.closest("p").get(0)&&a<32){d+=r.parent().position().top
}else{if(a<32){d+=e.top
}else{d+=e.top+r.height()
}}if(!f.equals(s)){c+=" - "+s.render()
}m=Math.max(d-h+4,20);
this.highlightBar.css({position:"absolute",height:Math.round(m)+"px",display:"block"}).attr("title",c);
this.setHighlightTop(h)
}else{this.highlightBar.hide()
}log.timeEnd("highlight");
log.groupEnd("highlighter")
};
Highlighter.prototype.unhighlight=function(){this.refStart=null;
this.refEnd=null;
this.highlightBar.hide();
this.elStart=null
};
Highlighter.prototype.update=function(){if(this.refStart&&this.refEnd){if(this.elStart!==null&&this.elStart.length&&this.elStart.isInDocument()){var a=this.jqContainer.find(".content-wrapper").first().data("top");
this.setHighlightTop(ontentTop+this.elStart.iposition().top)
}else{this.elStart=null;
this.highlight(this.refStart,this.refEnd)
}return true
}return false
};
function ShareButton(b){var a=this;
this.strUrl="";
this.strTitle="";
this.jqButton=$('<a class="share-button show-normal"><div></div></a>');
this.sharingLinks=[{displayText:"Facebook",code:"facebook",urlChunks:["http://www.facebook.com/sharer.php?u=","","&t=",""],urlIdx:1,titleIdx:3},{displayText:"Twitter",code:"twitter",fnGetShareUrl:this.reflyize,maxLength:144-"  via @Logos".length,urlChunks:["http://twitter.com/share?via=Logos&url=&text=","","%20"],urlIdx:3,contentIdx:1},{displayText:"Email",code:"email",maxLength:144,urlChunks:["mailto:?Subject=","","&body=","","%0D%0A",""],urlIdx:5,titleIdx:1,contentIdx:3}];
this.jqHoverPanel=$('<div class="share-container-panel dropdown"></div>');
this.jqUrlTitle=$('<div class="share-title"></div>');
this.jqUrlText=$('<input type="text" spellcheck="false" />');
this.jqContentPanel=$('<div class="share-content-panel"></div>');
this.jqHoverPanel.append(this.jqUrlTitle);
this.jqHoverPanel.append(this.jqUrlText);
this.jqHoverPanel.append(this.jqContentPanel);
this.jqLeftPanel=$('<div class="share-link-container"></div>');
this.jqRightPanel=$('<div class="share-link-container"></div>');
$.each(this.sharingLinks,function(c,d){var e=$('<a class="share-link" target="_blank"></a>').text(d.displayText).addClass("share-button-"+d.code);
e.prepend($("<span></span>").addClass("share-icon"));
if(c%2===0){a.jqLeftPanel.append(e)
}else{a.jqRightPanel.append(e)
}});
this.jqContentPanel.append(this.jqLeftPanel);
this.jqContentPanel.append(this.jqRightPanel);
this.jqContentPanel.append($('<div class="clear"></div>'));
this.jqButton.dropdown({jqPanel:this.jqHoverPanel,fnOnDisplay:function(){a.onDisplay(a.jqButton,a.curNavRequest,a.resourceInfo,a.bIsBibleReq)
},strBtnActiveClass:"active"});
b.append(this.jqButton)
}ShareButton.prototype.reflyize=function(){if(this.bIsBibleReq&&this.bIsNormalReference){return["http://ref.ly/",this.strUrlRef||this.strRef,";",this.strVersion].join("")
}else{return this.strUrl
}};
ShareButton.prototype.getShortenedTitle=function(b){if(this.strRef){var d="";
if(this.resourceInfo){d=this.resourceInfo.abbreviatedTitle||""
}var a=this.strRef;
var c=a+" ("+d+")";
if(c.length<=b){return c
}var f=Logos.BibleReference.tryParse(this.strRef);
if(f){a=f.toShortestString();
var e=a+" ("+d+")";
if(e.length<=b){return e
}}if(a.length>0&&a.length<=b){return a
}}else{if(this.resourceInfo){return this.resourceInfo.abbreviatedTitle&&this.resourceInfo.abbreviatedTitle.length<=b?this.resourceInfo.abbreviatedTitle:""
}}return""
};
ShareButton.prototype.destroy=function(){this.jqButton.remove()
};
ShareButton.prototype.setShareUrl=function(d,e){var b=this;
function c(g){if(b.bIsBibleReq||b.bIsHeadwordReq){e.removeAttr("href");
$.ajax({url:g,data:{contentType:"json"},success:function(j){try{j=$.isArray(j)?j:$.parseJSON(j);
var h=d.maxLength?d.maxLength-(d.urlIdx?d.urlChunks[d.urlIdx].length:0)-(d.titleIdx?d.urlChunks[d.titleIdx].length:0):1000;
d.urlChunks[d.contentIdx]=encodeURIComponent($.map(j,function(k){return'"'+util.ellipsisize(k,Math.floor(h/j.length)-2)+'"'
}).join("; "));
e.attr("href",d.urlChunks.join(""))
}catch(i){d.urlChunks[d.contentIdx]=b.strTitle;
e.attr("href",d.urlChunks.join(""))
}}})
}else{d.urlChunks[d.contentIdx]=b.strTitle;
e.attr("href",d.urlChunks.join(""))
}}var f=d.fnGetShareUrl?$.proxy(d.fnGetShareUrl,this)():this.strUrl;
var a=this.strTitle;
if(d.maxLength&&(f.length+a.length)>d.maxLength){a=$.proxy(this.getShortenedTitle,this)(this.strTitle.length-(f.length-d.maxLength))
}if(d.urlIdx){d.urlChunks[d.urlIdx]=encodeURIComponent(f)
}if(d.titleIdx){d.urlChunks[d.titleIdx]=encodeURIComponent(a)
}if(d.contentIdx){c(this.strUrl)
}else{e.attr("href",d.urlChunks.join(""))
}};
ShareButton.prototype.onDisplay=function(){var a=this;
var b=$();
$.each(this.sharingLinks,function(c,d){var e=a.jqContentPanel.find(".share-button-"+d.code);
b=b.add(e);
$.proxy(a.setShareUrl,a)(d,e)
});
this.jqUrlTitle.text(this.strTitle);
this.jqUrlText.val(this.strUrl);
this.jqUrlText.click(function(){a.jqUrlText.select()
});
b.click(function(c){if($(this).attr("href")){c.stopPropagation();
a.jqButton.dropdown("clickHidePanel",c)
}})
};
ShareButton.prototype.panelIsVisible=function(){return this.jqHoverPanel.is(":visible")
};
ShareButton.prototype.setShareInfo=function(d,b,c,a){this.strUrl=util.qualifyURL(d.toShareUrl());
this.bIsBibleReq=c;
this.bIsHeadwordReq=d.headword;
if(d.reference){this.strRef=d.reference.render?d.reference.render():d.reference;
this.strUrlRef=d.reference.toUrlSafeString?d.reference.toUrlSafeString():d.reference
}else{if(d.headword){this.strRef=d.headword.render?d.headword.render():d.headword;
this.strUrlRef=d.headword.toUrlSafeString?d.headword.toUrlSafeString():d.headword
}}this.strTitle=a||util.getTitlePart(this.strRef,b);
this.strVersion=c?d.resourceName:null;
this.resourceInfo=b;
this.bIsBibleReq=c;
this.bIsNormalReference=d.reference&&d.reference.toUrlSafeString().split(";").length===1
};
function AjaxLoadNotifier(a){this.jqLoading=a;
this.displayTimeout=null
}AjaxLoadNotifier.prototype.show=function(){var a=this;
clearTimeout(this.displayTimeout);
this.displayTimeout=setTimeout(function(){a.jqLoading.show()
},80)
};
AjaxLoadNotifier.prototype.hide=function(){clearTimeout(this.displayTimeout);
this.jqLoading.hide()
};
(function(){function a(){var d;
var c=[];
var b=[];
return{pushState:function(e){if(e===d||e===null){throw new Error("stateObj is required to represent current state")
}b=[];
c.push(e)
},replaceState:function(e){if(e===d||e===null){throw new Error("stateObj is required to represent current state")
}b=[];
c.pop();
c.push(e)
},back:function(f){if(f===d){f=1
}if(!f||(+f!==f)||f>c.length||f<=0){return null
}f=Math.min(f,(c.length||1)-1);
for(var e=0;
e<f;
e++){b.push(c.pop())
}return c.length>0&&f?c[c.length-1]:null
},forward:function(f){if(f===d){f=1
}if(!f||(+f!==f)||f>b.length||f<=0){return null
}for(var e=0;
e<f;
e++){c.push(b.pop())
}return c[c.length-1]
},hasBackState:function(){return c.length>1
},hasForwardState:function(){return b.length>0
},hasInitialState:function(){return !!c.length
}}
}window._gaq=window._gaq||[];
window.biblia=window.biblia||{};
window.biblia.history={trackPageView:function(c){var b=["_trackPageview"];
if(c){b.push(c)
}window._gaq.push(b)
},getHistoryManager:a}
})();
