(function(){var X=this,ac,F=X.jQuery,T=X.$,U=X.jQuery=X.$=function(b,a){return new U.fn.init(b,a)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ad=/^.[^:#\[\.,]*$/;U.fn=U.prototype={init:function(e,b){e=e||document;if(e.nodeType){this[0]=e;this.length=1;this.context=e;return this}if(typeof e==="string"){var c=M.exec(e);if(c&&(c[1]||!b)){if(c[1]){e=U.clean([c[1]],b)}else{var a=document.getElementById(c[3]);if(a&&a.id!=c[3]){return U().find(e)}var d=U(a||[]);d.context=document;d.selector=e;return d}}else{return U(b).find(e)}}else{if(U.isFunction(e)){return U(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(U.isArray(e)?e:U.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===ac?Array.prototype.slice.call(this):this[a]},pushStack:function(c,a,d){var b=U(c);b.prevObject=this;b.context=this.context;if(a==="find"){b.selector=this.selector+(this.selector?" ":"")+d}else{if(a){b.selector=this.selector+"."+a+"("+d+")"}}return b},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},each:function(a,b){return U.each(this,a,b)},index:function(a){return U.inArray(a&&a.jquery?a[0]:a,this)},attr:function(c,a,b){var d=c;if(typeof c==="string"){if(a===ac){return this[0]&&U[b||"attr"](this[0],c)}else{d={};d[c]=a}}return this.each(function(e){for(c in d){U.attr(b?this.style:this,c,U.prop(this,d[c],b,e,c))}})},css:function(b,a){if((b=="width"||b=="height")&&parseFloat(a)<0){a=ac}return this.attr(b,a,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(a))}var b="";U.each(a||this,function(){U.each(this.childNodes,function(){if(this.nodeType!=8){b+=this.nodeType!=1?this.nodeValue:U.fn.text([this])}})});return b},wrapAll:function(b){if(this[0]){var a=U(b,this[0].ownerDocument).clone();if(this[0].parentNode){a.insertBefore(this[0])}a.map(function(){var c=this;while(c.firstChild){c=c.firstChild}return c}).append(this)}return this},wrapInner:function(a){return this.each(function(){U(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){U(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.appendChild(a)}})},prepend:function(){return this.domManip(arguments,true,function(a){if(this.nodeType==1){this.insertBefore(a,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)})},end:function(){return this.prevObject||U([])},push:[].push,sort:[].sort,splice:[].splice,find:function(b){if(this.length===1){var a=this.pushStack([],"find",b);a.length=0;U.find(b,this[0],a);return a}else{return this.pushStack(U.unique(U.map(this,function(c){return U.find(b,c)})),"find",b)}},clone:function(b){var d=this.map(function(){if(!U.support.noCloneEvent&&!U.isXMLDoc(this)){var f=this.outerHTML;if(!f){var e=this.ownerDocument.createElement("div");e.appendChild(this.cloneNode(true));f=e.innerHTML}return U.clean([f.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(b===true){var a=this.find("*").andSelf(),c=0;d.find("*").andSelf().each(function(){if(this.nodeName!==a[c].nodeName){return}var g=U.data(a[c],"events");for(var e in g){for(var f in g[e]){U.event.add(this,e,g[e][f],g[e][f].data)}}c++})}return d},filter:function(a){return this.pushStack(U.isFunction(a)&&U.grep(this,function(b,c){return a.call(b,c)})||U.multiFilter(a,U.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(c){var a=U.expr.match.POS.test(c)?U(c):null,b=0;return this.map(function(){var d=this;while(d&&d.ownerDocument){if(a?a.index(d)>-1:U(d).is(c)){U.data(d,"closest",b);return d}d=d.parentNode;b++}})},not:function(b){if(typeof b==="string"){if(ad.test(b)){return this.pushStack(U.multiFilter(b,this,true),"not",b)}else{b=U.multiFilter(b,this)}}var a=b.length&&b[b.length-1]!==ac&&!b.nodeType;return this.filter(function(){return a?U.inArray(this,b)<0:this!=b})},add:function(a){return this.pushStack(U.unique(U.merge(this.get(),typeof a==="string"?U(a):U.makeArray(a))))},is:function(a){return !!a&&U.multiFilter(a,this).length>0},hasClass:function(a){return !!a&&this.is("."+a)},val:function(c){if(c===ac){var i=this[0];if(i){if(U.nodeName(i,"option")){return(i.attributes.value||{}).specified?i.value:i.text}if(U.nodeName(i,"select")){var e=i.selectedIndex,b=[],a=i.options,f=i.type=="select-one";if(e<0){return null}for(var h=f?e:0,d=f?e+1:a.length;h<d;h++){var g=a[h];if(g.selected){c=U(g).val();if(f){return c}b.push(c)}}return b}return(i.value||"").replace(/\r/g,"")}return ac}if(typeof c==="number"){c+=""}return this.each(function(){if(this.nodeType!=1){return}if(U.isArray(c)&&/radio|checkbox/.test(this.type)){this.checked=(U.inArray(this.value,c)>=0||U.inArray(this.name,c)>=0)}else{if(U.nodeName(this,"select")){var j=U.makeArray(c);U("option",this).each(function(){this.selected=(U.inArray(this.value,j)>=0||U.inArray(this.text,j)>=0)});if(!j.length){this.selectedIndex=-1}}else{this.value=c}}})},html:function(a){return a===ac?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(a)},replaceWith:function(a){return this.after(a).remove()},eq:function(a){return this.slice(a,+a+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(a){return this.pushStack(U.map(this,function(b,c){return a.call(b,c,b)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(d,a,b){if(this[0]){var e=(this[0].ownerDocument||this[0]).createDocumentFragment(),h=U.clean(d,(this[0].ownerDocument||this[0]),e),f=e.firstChild;if(f){for(var g=0,i=this.length;g<i;g++){b.call(c(this[g],f),this.length>1||g>0?e.cloneNode(true):e)}}if(h){U.each(h,E)}}return this;function c(k,j){return a&&U.nodeName(k,"table")&&U.nodeName(j,"tr")?(k.getElementsByTagName("tbody")[0]||k.appendChild(k.ownerDocument.createElement("tbody"))):k}}};U.fn.init.prototype=U.fn;function E(b,a){if(a.src){U.ajax({url:a.src,async:false,dataType:"script"})}else{U.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function ae(){return +new Date}U.extend=U.fn.extend=function(){var c=arguments[0]||{},e=1,d=arguments.length,h=false,f;if(typeof c==="boolean"){h=c;c=arguments[1]||{};e=2}if(typeof c!=="object"&&!U.isFunction(c)){c={}}if(d==e){c=this;--e}for(;e<d;e++){if((f=arguments[e])!=null){for(var g in f){var b=c[g],a=f[g];if(c===a){continue}if(h&&a&&typeof a==="object"&&!a.nodeType){c[g]=U.extend(h,b||(a.length!=null?[]:{}),a)}else{if(a!==ac){c[g]=a}}}}}return c};var ah=/z-?index|font-?weight|opacity|zoom|line-?height/i,R=document.defaultView||{},L=Object.prototype.toString;U.extend({noConflict:function(a){X.$=T;if(a){X.jQuery=F}return U},isFunction:function(a){return L.call(a)==="[object Function]"},isArray:function(a){return L.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&U.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var b=document.getElementsByTagName("head")[0]||document.documentElement,c=document.createElement("script");c.type="text/javascript";if(U.support.scriptEval){c.appendChild(document.createTextNode(a))}else{c.text=a}b.insertBefore(c,b.firstChild);b.removeChild(c)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()==b.toUpperCase()},each:function(e,a,f){var g,d=0,c=e.length;if(f){if(c===ac){for(g in e){if(a.apply(e[g],f)===false){break}}}else{for(;d<c;){if(a.apply(e[d++],f)===false){break}}}}else{if(c===ac){for(g in e){if(a.call(e[g],g,e[g])===false){break}}}else{for(var b=e[0];d<c&&a.call(b,d,b)!==false;b=e[++d]){}}}return e},prop:function(b,a,c,d,e){if(U.isFunction(a)){a=a.call(b,d)}return typeof a==="number"&&c=="curCSS"&&!ah.test(e)?a+"px":a},className:{add:function(b,a){U.each((a||"").split(/\s+/),function(d,c){if(b.nodeType==1&&!U.className.has(b.className,c)){b.className+=(b.className?" ":"")+c}})},remove:function(b,a){if(b.nodeType==1){b.className=a!==ac?U.grep(b.className.split(/\s+/),function(c){return !U.className.has(a,c)}).join(" "):""}},has:function(a,b){return a&&U.inArray(b,(a.className||a).toString().split(/\s+/))>-1}},swap:function(b,c,a){var e={};for(var d in c){e[d]=b.style[d];b.style[d]=c[d]}a.call(b);for(var d in c){b.style[d]=e[d]}},css:function(e,g,c,h){if(g=="width"||g=="height"){var a,f={position:"absolute",visibility:"hidden",display:"block"},b=g=="width"?["Left","Right"]:["Top","Bottom"];function d(){a=g=="width"?e.offsetWidth:e.offsetHeight;if(h==="border"){return}U.each(b,function(){if(!h){a-=parseFloat(U.curCSS(e,"padding"+this,true))||0}if(h==="margin"){a+=parseFloat(U.curCSS(e,"margin"+this,true))||0}else{a-=parseFloat(U.curCSS(e,"border"+this+"Width",true))||0}})}if(e.offsetWidth!==0){d()}else{U.swap(e,f,d)}return Math.max(0,Math.round(a))}return U.curCSS(e,g,c)},curCSS:function(e,h,g){var b,i=e.style;if(h=="opacity"&&!U.support.opacity){b=U.attr(i,"opacity");return b==""?"1":b}if(h.match(/float/i)){h=H}if(!g&&i&&i[h]){b=i[h]}else{if(R.getComputedStyle){if(h.match(/float/i)){h="float"}h=h.replace(/([A-Z])/g,"-$1").toLowerCase();var a=R.getComputedStyle(e,null);if(a){b=a.getPropertyValue(h)}if(h=="opacity"&&b==""){b="1"}}else{if(e.currentStyle){var d=h.replace(/\-(\w)/g,function(k,j){return j.toUpperCase()});b=e.currentStyle[h]||e.currentStyle[d];if(!/^\d+(px)?$/i.test(b)&&/^\d/.test(b)){var f=i.left,c=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left;i.left=b||0;b=i.pixelLeft+"px";i.left=f;e.runtimeStyle.left=c}}}}return b},clean:function(g,b,d){b=b||document;if(typeof b.createElement==="undefined"){b=b.ownerDocument||b[0]&&b[0].ownerDocument||document}if(!d&&g.length===1&&typeof g[0]==="string"){var e=/^<(\w+)\s*\/?>$/.exec(g[0]);if(e){return[b.createElement(e[1])]}}var f=[],h=[],a=b.createElement("div");U.each(g,function(l,i){if(typeof i==="number"){i+=""}if(!i){return}if(typeof i==="string"){i=i.replace(/(<(\w+)[^>]*?)\/>/g,function(r,q,s){return s.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?r:q+"></"+s+">"});var m=i.replace(/^\s+/,"").substring(0,10).toLowerCase();var k=!m.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!m.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||m.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!m.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!m.indexOf("<td")||!m.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!m.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!U.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];a.innerHTML=k[1]+i+k[2];while(k[0]--){a=a.lastChild}if(!U.support.tbody){var j=/<tbody/i.test(i),o=!m.indexOf("<table")&&!j?a.firstChild&&a.firstChild.childNodes:k[1]=="<table>"&&!j?a.childNodes:[];for(var p=o.length-1;p>=0;--p){if(U.nodeName(o[p],"tbody")&&!o[p].childNodes.length){o[p].parentNode.removeChild(o[p])}}}if(!U.support.leadingWhitespace&&/^\s/.test(i)){a.insertBefore(b.createTextNode(i.match(/^\s*/)[0]),a.firstChild)}i=U.makeArray(a.childNodes)}if(i.nodeType){f.push(i)}else{f=U.merge(f,i)}});if(d){for(var c=0;f[c];c++){if(U.nodeName(f[c],"script")&&(!f[c].type||f[c].type.toLowerCase()==="text/javascript")){h.push(f[c].parentNode?f[c].parentNode.removeChild(f[c]):f[c])}else{if(f[c].nodeType===1){f.splice.apply(f,[c+1,0].concat(U.makeArray(f[c].getElementsByTagName("script"))))}d.appendChild(f[c])}}return h}return f},attr:function(c,f,b){if(!c||c.nodeType==3||c.nodeType==8){return ac}var e=!U.isXMLDoc(c),a=b!==ac;f=e&&U.props[f]||f;if(c.tagName){var g=/href|src|style/.test(f);if(f=="selected"&&c.parentNode){c.parentNode.selectedIndex}if(f in c&&e&&!g){if(a){if(f=="type"&&U.nodeName(c,"input")&&c.parentNode){throw"type property can't be changed"}c[f]=b}if(U.nodeName(c,"form")&&c.getAttributeNode(f)){return c.getAttributeNode(f).nodeValue}if(f=="tabIndex"){var d=c.getAttributeNode("tabIndex");return d&&d.specified?d.value:c.nodeName.match(/(button|input|object|select|textarea)/i)?0:c.nodeName.match(/^(a|area)$/i)&&c.href?0:ac}return c[f]}if(!U.support.style&&e&&f=="style"){return U.attr(c.style,"cssText",b)}if(a){c.setAttribute(f,""+b)}var h=!U.support.hrefNormalized&&e&&g?c.getAttribute(f,2):c.getAttribute(f);return h===null?ac:h}if(!U.support.opacity&&f=="opacity"){if(a){c.zoom=1;c.filter=(c.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(b)+""=="NaN"?"":"alpha(opacity="+b*100+")")}return c.filter&&c.filter.indexOf("opacity=")>=0?(parseFloat(c.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}f=f.replace(/-([a-z])/ig,function(j,i){return i.toUpperCase()});if(a){c[f]=b}return c[f]},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var c=[];if(a!=null){var b=a.length;if(b==null||typeof a==="string"||U.isFunction(a)||a.setInterval){c[0]=a}else{while(b){c[--b]=a[b]}}}return c},inArray:function(b,a){for(var d=0,c=a.length;d<c;d++){if(a[d]===b){return d}}return -1},merge:function(b,e){var d=0,c,a=b.length;if(!U.support.getAll){while((c=e[d++])!=null){if(c.nodeType!=8){b[a++]=c}}}else{while((c=e[d++])!=null){b[a++]=c}}return b},unique:function(a){var f=[],g={};try{for(var e=0,d=a.length;e<d;e++){var b=U.data(a[e]);if(!g[b]){g[b]=true;f.push(a[e])}}}catch(c){f=a}return f},grep:function(e,a,f){var d=[];for(var c=0,b=e.length;c<b;c++){if(!f!=!a(e[c],c)){d.push(e[c])}}return d},map:function(f,a){var e=[];for(var d=0,c=f.length;d<c;d++){var b=a(f[d],d);if(b!=null){e[e.length]=b}}return e.concat.apply([],e)}});var O=navigator.userAgent.toLowerCase();U.browser={version:(O.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(O),opera:/opera/.test(O),msie:/msie/.test(O)&&!/opera/.test(O),mozilla:/mozilla/.test(O)&&!/(compatible|webkit)/.test(O)};U.each({parent:function(a){return a.parentNode},parents:function(a){return U.dir(a,"parentNode")},next:function(a){return U.nth(a,2,"nextSibling")},prev:function(a){return U.nth(a,2,"previousSibling")},nextAll:function(a){return U.dir(a,"nextSibling")},prevAll:function(a){return U.dir(a,"previousSibling")},siblings:function(a){return U.sibling(a.parentNode.firstChild,a)},children:function(a){return U.sibling(a.firstChild)},contents:function(a){return U.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:U.makeArray(a.childNodes)}},function(b,a){U.fn[b]=function(d){var c=U.map(this,a);if(d&&typeof d=="string"){c=U.multiFilter(d,c)}return this.pushStack(U.unique(c),b,d)}});U.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,a){U.fn[b]=function(h){var e=[],c=U(h);for(var d=0,g=c.length;d<g;d++){var f=(d>0?this.clone(true):this).get();U.fn[a].apply(U(c[d]),f);e=e.concat(f)}return this.pushStack(e,b,h)}});U.each({removeAttr:function(a){U.attr(this,a,"");if(this.nodeType==1){this.removeAttribute(a)}},addClass:function(a){U.className.add(this,a)},removeClass:function(a){U.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean"){b=!U.className.has(this,a)}U.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||U.filter(a,[this]).length){U("*",this).add([this]).each(function(){U.event.remove(this);U.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){U(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(b,a){U.fn[b]=function(){return this.each(a,arguments)}});function Z(b,a){return b[0]&&parseInt(U.curCSS(b[0],a,true),10)||0}var ab="jQuery"+ae(),I=0,S={};U.extend({cache:{},data:function(c,d,b){c=c==X?S:c;var a=c[ab];if(!a){a=c[ab]=++I}if(d&&!U.cache[a]){U.cache[a]={}}if(b!==ac){U.cache[a][d]=b}return d?U.cache[a][d]:a},removeData:function(c,d){c=c==X?S:c;var a=c[ab];if(d){if(U.cache[a]){delete U.cache[a][d];d="";for(d in U.cache[a]){break}if(!d){U.removeData(c)}}}else{try{delete c[ab]}catch(b){if(c.removeAttribute){c.removeAttribute(ab)}}delete U.cache[a]}},queue:function(c,d,a){if(c){d=(d||"fx")+"queue";var b=U.data(c,d);if(!b||U.isArray(a)){b=U.data(c,d,U.makeArray(a))}else{if(a){b.push(a)}}}return b},dequeue:function(a,b){var d=U.queue(a,b),c=d.shift();if(!b||b==="fx"){c=d[0]}if(c!==ac){c.call(a)}}});U.fn.extend({data:function(d,b){var a=d.split(".");a[1]=a[1]?"."+a[1]:"";if(b===ac){var c=this.triggerHandler("getData"+a[1]+"!",[a[0]]);if(c===ac&&this.length){c=U.data(this[0],d)}return c===ac&&a[1]?this.data(a[0]):c}else{return this.trigger("setData"+a[1]+"!",[a[0],b]).each(function(){U.data(this,d,b)})}},removeData:function(a){return this.each(function(){U.removeData(this,a)})},queue:function(b,a){if(typeof b!=="string"){a=b;b="fx"}if(a===ac){return U.queue(this[0],b)}return this.each(function(){var c=U.queue(this,b,a);if(b=="fx"&&c.length==1){c[0].call(this)}})},dequeue:function(a){return this.each(function(){U.dequeue(this,a)})}});(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,h=0,l=Object.prototype.toString;var o=function(s,w,al,ak){al=al||[];w=w||document;if(w.nodeType!==1&&w.nodeType!==9){return[]}if(!s||typeof s!=="string"){return al}var r=[],u,C,y,x,aj,v,t=true;b.lastIndex=0;while((u=b.exec(s))!==null){r.push(u[1]);if(u[2]){v=RegExp.rightContext;break}}if(r.length>1&&g.exec(s)){if(r.length===2&&k.relative[r[0]]){C=j(r[0]+r[1],w)}else{C=k.relative[r[0]]?[w]:o(r.shift(),w);while(r.length){s=r.shift();if(k.relative[s]){s+=r.shift()}C=j(s,C)}}}else{var D=ak?{expr:r.pop(),set:p(ak)}:o.find(r.pop(),r.length===1&&w.parentNode?w.parentNode:w,c(w));C=o.filter(D.expr,D.set);if(r.length>0){y=p(C)}else{t=false}while(r.length){var z=r.pop(),B=z;if(!k.relative[z]){z=""}else{B=r.pop()}if(B==null){B=w}k.relative[z](y,B,c(w))}}if(!y){y=C}if(!y){throw"Syntax error, unrecognized expression: "+(z||s)}if(l.call(y)==="[object Array]"){if(!t){al.push.apply(al,y)}else{if(w.nodeType===1){for(var q=0;y[q]!=null;q++){if(y[q]&&(y[q]===true||y[q].nodeType===1&&i(w,y[q]))){al.push(C[q])}}}else{for(var q=0;y[q]!=null;q++){if(y[q]&&y[q].nodeType===1){al.push(C[q])}}}}}else{p(y,al)}if(v){o(v,w,al,ak);if(m){hasDuplicate=false;al.sort(m);if(hasDuplicate){for(var q=1;q<al.length;q++){if(al[q]===al[q-1]){al.splice(q--,1)}}}}}return al};o.matches=function(r,q){return o(r,null,null,q)};o.find=function(q,x,y){var r,t;if(!q){return[]}for(var u=0,v=k.order.length;u<v;u++){var s=k.order[u],t;if((t=k.match[s].exec(q))){var w=RegExp.leftContext;if(w.substr(w.length-1)!=="\\"){t[1]=(t[1]||"").replace(/\\/g,"");r=k.find[s](t,x,y);if(r!=null){q=q.replace(k.match[s],"");break}}}}if(!r){r=x.getElementsByTagName("*")}return{set:r,expr:q}};o.filter=function(aj,ak,B,u){var v=aj,y=[],q=ak,s,x,r=ak&&ak[0]&&c(ak[0]);while(aj&&ak.length){for(var al in k.filter){if((s=k.match[al].exec(aj))!=null){var w=k.filter[al],z,C;x=false;if(q==y){y=[]}if(k.preFilter[al]){s=k.preFilter[al](s,q,B,y,u,r);if(!s){x=z=true}else{if(s===true){continue}}}if(s){for(var t=0;(C=q[t])!=null;t++){if(C){z=w(C,s,t,q);var D=u^!!z;if(B&&z!=null){if(D){x=true}else{q[t]=false}}else{if(D){y.push(C);x=true}}}}}if(z!==ac){if(!B){q=y}aj=aj.replace(k.match[al],"");if(!x){return[]}break}}}if(aj==v){if(x==null){throw"Syntax error, unrecognized expression: "+aj}else{break}}v=aj}return q};var k=o.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(q){return q.getAttribute("href")}},relative:{"+":function(q,x,r){var t=typeof x==="string",y=t&&!/\W/.test(x),s=t&&!y;if(y&&!r){x=x.toUpperCase()}for(var u=0,v=q.length,w;u<v;u++){if((w=q[u])){while((w=w.previousSibling)&&w.nodeType!==1){}q[u]=s||w&&w.nodeName===x?w||false:w===x}}if(s){o.filter(x,q,true)}},">":function(v,s,u){var x=typeof s==="string";if(x&&!/\W/.test(s)){s=u?s:s.toUpperCase();for(var r=0,t=v.length;r<t;r++){var w=v[r];if(w){var q=w.parentNode;v[r]=q.nodeName===s?q:false}}}else{for(var r=0,t=v.length;r<t;r++){var w=v[r];if(w){v[r]=x?w.parentNode:w.parentNode===s}}if(x){o.filter(s,v,true)}}},"":function(q,s,u){var r=h++,t=a;if(!s.match(/\W/)){var v=s=u?s:s.toUpperCase();t=d}t("parentNode",s,r,q,v,u)},"~":function(q,s,u){var r=h++,t=a;if(typeof s==="string"&&!s.match(/\W/)){var v=s=u?s:s.toUpperCase();t=d}t("previousSibling",s,r,q,v,u)}},find:{ID:function(s,r,q){if(typeof r.getElementById!=="undefined"&&!q){var t=r.getElementById(s[1]);return t?[t]:[]}},NAME:function(r,v,u){if(typeof v.getElementsByName!=="undefined"){var s=[],w=v.getElementsByName(r[1]);for(var q=0,t=w.length;q<t;q++){if(w[q].getAttribute("name")===r[1]){s.push(w[q])}}return s.length===0?null:s}},TAG:function(r,q){return q.getElementsByTagName(r[1])}},preFilter:{CLASS:function(q,s,r,t,v,u){q=" "+q[1].replace(/\\/g,"")+" ";if(u){return q}for(var x=0,w;(w=s[x])!=null;x++){if(w){if(v^(w.className&&(" "+w.className+" ").indexOf(q)>=0)){if(!r){t.push(w)}}else{if(r){s[x]=false}}}}return false},ID:function(q){return q[1].replace(/\\/g,"")},TAG:function(r,s){for(var q=0;s[q]===false;q++){}return s[q]&&c(s[q])?r[1]:r[1].toUpperCase()},CHILD:function(r){if(r[1]=="nth"){var q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(r[2]=="even"&&"2n"||r[2]=="odd"&&"2n+1"||!/\D/.test(r[2])&&"0n+"+r[2]||r[2]);r[2]=(q[1]+(q[2]||1))-0;r[3]=q[3]-0}r[0]=h++;return r},ATTR:function(w,s,r,t,v,u){var q=w[1].replace(/\\/g,"");if(!u&&k.attrMap[q]){w[1]=k.attrMap[q]}if(w[2]==="~="){w[4]=" "+w[4]+" "}return w},PSEUDO:function(v,s,r,t,u){if(v[1]==="not"){if(v[3].match(b).length>1||/^\w/.test(v[3])){v[3]=o(v[3],null,null,s)}else{var q=o.filter(v[3],s,r,true^u);if(!r){t.push.apply(t,q)}return false}}else{if(k.match.POS.test(v[0])||k.match.CHILD.test(v[0])){return true}}return v},POS:function(q){q.unshift(true);return q}},filters:{enabled:function(q){return q.disabled===false&&q.type!=="hidden"},disabled:function(q){return q.disabled===true},checked:function(q){return q.checked===true},selected:function(q){q.parentNode.selectedIndex;return q.selected===true},parent:function(q){return !!q.firstChild},empty:function(q){return !q.firstChild},has:function(q,r,s){return !!o(s[3],q).length},header:function(q){return/h\d/i.test(q.nodeName)},text:function(q){return"text"===q.type},radio:function(q){return"radio"===q.type},checkbox:function(q){return"checkbox"===q.type},file:function(q){return"file"===q.type},password:function(q){return"password"===q.type},submit:function(q){return"submit"===q.type},image:function(q){return"image"===q.type},reset:function(q){return"reset"===q.type},button:function(q){return"button"===q.type||q.nodeName.toUpperCase()==="BUTTON"},input:function(q){return/input|select|textarea|button/i.test(q.nodeName)}},setFilters:{first:function(q,r){return r===0},last:function(r,s,t,q){return s===q.length-1},even:function(q,r){return r%2===0},odd:function(q,r){return r%2===1},lt:function(q,r,s){return r<s[3]-0},gt:function(q,r,s){return r>s[3]-0},nth:function(q,r,s){return s[3]-0==r},eq:function(q,r,s){return s[3]-0==r}},filter:{PSEUDO:function(v,r,q,u){var s=r[1],x=k.filters[s];if(x){return x(v,q,r,u)}else{if(s==="contains"){return(v.textContent||v.innerText||"").indexOf(r[3])>=0}else{if(s==="not"){var w=r[3];for(var q=0,t=w.length;q<t;q++){if(w[q]===v){return false}}return true}}}},CHILD:function(x,u){var r=u[1],w=x;switch(r){case"only":case"first":while(w=w.previousSibling){if(w.nodeType===1){return false}}if(r=="first"){return true}w=x;case"last":while(w=w.nextSibling){if(w.nodeType===1){return false}}return true;case"nth":var v=u[2],y=u[3];if(v==1&&y==0){return true}var s=u[0],z=x.parentNode;if(z&&(z.sizcache!==s||!x.nodeIndex)){var t=0;for(w=z.firstChild;w;w=w.nextSibling){if(w.nodeType===1){w.nodeIndex=++t}}z.sizcache=s}var q=x.nodeIndex-y;if(v==0){return q==0}else{return(q%v==0&&q/v>=0)}}},ID:function(q,r){return q.nodeType===1&&q.getAttribute("id")===r},TAG:function(q,r){return(r==="*"&&q.nodeType===1)||q.nodeName===r},CLASS:function(q,r){return(" "+(q.className||q.getAttribute("class"))+" ").indexOf(r)>-1},ATTR:function(v,q){var r=q[1],t=k.attrHandle[r]?k.attrHandle[r](v):v[r]!=null?v[r]:v.getAttribute(r),u=t+"",w=q[2],s=q[4];return t==null?w==="!=":w==="="?u===s:w==="*="?u.indexOf(s)>=0:w==="~="?(" "+u+" ").indexOf(s)>=0:!s?u&&t!==false:w==="!="?u!=s:w==="^="?u.indexOf(s)===0:w==="$="?u.substr(u.length-s.length)===s:w==="|="?u===s||u.substr(0,s.length+1)===s+"-":false},POS:function(v,s,r,u){var t=s[2],q=k.setFilters[t];if(q){return q(v,r,s,u)}}}};var g=k.match.POS;for(var e in k.match){k.match[e]=RegExp(k.match[e].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var p=function(q,r){q=Array.prototype.slice.call(q);if(r){r.push.apply(r,q);return r}return q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(f){p=function(u,q){var s=q||[];if(l.call(u)==="[object Array]"){Array.prototype.push.apply(s,u)}else{if(typeof u.length==="number"){for(var r=0,t=u.length;r<t;r++){s.push(u[r])}}else{for(var r=0;u[r];r++){s.push(u[r])}}}return s}}var m;if(document.documentElement.compareDocumentPosition){m=function(r,s){var q=r.compareDocumentPosition(s)&4?-1:r===s?0:1;if(q===0){hasDuplicate=true}return q}}else{if("sourceIndex" in document.documentElement){m=function(r,s){var q=r.sourceIndex-s.sourceIndex;if(q===0){hasDuplicate=true}return q}}else{if(document.createRange){m=function(q,s){var r=q.ownerDocument.createRange(),t=s.ownerDocument.createRange();r.selectNode(q);r.collapse(true);t.selectNode(s);t.collapse(true);var u=r.compareBoundaryPoints(Range.START_TO_END,t);if(u===0){hasDuplicate=true}return u}}}}(function(){var r=document.createElement("form"),q="script"+(new Date).getTime();r.innerHTML="<input name='"+q+"'/>";var s=document.documentElement;s.insertBefore(r,s.firstChild);if(!!document.getElementById(q)){k.find.ID=function(w,v,u){if(typeof v.getElementById!=="undefined"&&!u){var t=v.getElementById(w[1]);return t?t.id===w[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===w[1]?[t]:ac:[]}};k.filter.ID=function(u,t){var v=typeof u.getAttributeNode!=="undefined"&&u.getAttributeNode("id");return u.nodeType===1&&v&&v.nodeValue===t}}s.removeChild(r)})();(function(){var q=document.createElement("div");q.appendChild(document.createComment(""));if(q.getElementsByTagName("*").length>0){k.find.TAG=function(t,u){var v=u.getElementsByTagName(t[1]);if(t[1]==="*"){var r=[];for(var s=0;v[s];s++){if(v[s].nodeType===1){r.push(v[s])}}v=r}return v}}q.innerHTML="<a href='#'></a>";if(q.firstChild&&typeof q.firstChild.getAttribute!=="undefined"&&q.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var r=o,q=document.createElement("div");q.innerHTML="<p class='TEST'></p>";if(q.querySelectorAll&&q.querySelectorAll(".TEST").length===0){return}o=function(v,w,t,s){w=w||document;if(!s&&w.nodeType===9&&!c(w)){try{return p(w.querySelectorAll(v),t)}catch(u){}}return r(v,w,t,s)};o.find=r.find;o.filter=r.filter;o.selectors=r.selectors;o.matches=r.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var q=document.createElement("div");q.innerHTML="<div class='test e'></div><div class='test'></div>";if(q.getElementsByClassName("e").length===0){return}q.lastChild.className="e";if(q.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(t,s,r){if(typeof s.getElementsByClassName!=="undefined"&&!r){return s.getElementsByClassName(t[1])}}})()}function d(w,r,s,y,q,z){var B=w=="previousSibling"&&!z;for(var u=0,v=y.length;u<v;u++){var x=y[u];if(x){if(B&&x.nodeType===1){x.sizcache=s;x.sizset=u}x=x[w];var t=false;while(x){if(x.sizcache===s){t=y[x.sizset];break}if(x.nodeType===1&&!z){x.sizcache=s;x.sizset=u}if(x.nodeName===r){t=x;break}x=x[w]}y[u]=t}}}function a(w,r,s,y,q,z){var B=w=="previousSibling"&&!z;for(var u=0,v=y.length;u<v;u++){var x=y[u];if(x){if(B&&x.nodeType===1){x.sizcache=s;x.sizset=u}x=x[w];var t=false;while(x){if(x.sizcache===s){t=y[x.sizset];break}if(x.nodeType===1){if(!z){x.sizcache=s;x.sizset=u}if(typeof r!=="string"){if(x===r){t=true;break}}else{if(o.filter(r,[x]).length>0){t=x;break}}}x=x[w]}y[u]=t}}}var i=document.compareDocumentPosition?function(q,r){return q.compareDocumentPosition(r)&16}:function(q,r){return q!==r&&(q.contains?q.contains(r):true)};var c=function(q){return q.nodeType===9&&q.documentElement.nodeName!=="HTML"||!!q.ownerDocument&&c(q.ownerDocument)};var j=function(t,v){var q=[],x="",w,r=v.nodeType?[v]:v;while((w=k.match.PSEUDO.exec(t))){x+=w[0];t=t.replace(k.match.PSEUDO,"")}t=k.relative[t]?t+"*":t;for(var u=0,s=r.length;u<s;u++){o(t,r[u],q)}return o.filter(x,q)};U.find=o;U.filter=o.filter;U.expr=o.selectors;U.expr[":"]=U.expr.filters;o.selectors.filters.hidden=function(q){return q.offsetWidth===0||q.offsetHeight===0};o.selectors.filters.visible=function(q){return q.offsetWidth>0||q.offsetHeight>0};o.selectors.filters.animated=function(q){return U.grep(U.timers,function(r){return q===r.elem}).length};U.multiFilter=function(q,s,r){if(r){q=":not("+q+")"}return o.matches(q,s)};U.dir=function(r,s){var t=[],q=r[s];while(q&&q!=document){if(q.nodeType==1){t.push(q)}q=q[s]}return t};U.nth=function(u,t,r,q){t=t||1;var s=0;for(;u;u=u[r]){if(u.nodeType==1&&++s==t){break}}return u};U.sibling=function(q,r){var s=[];for(;q;q=q.nextSibling){if(q.nodeType==1&&q!=r){s.push(q)}}return s};return;X.Sizzle=o})();U.event={add:function(c,f,d,a){if(c.nodeType==3||c.nodeType==8){return}if(c.setInterval&&c!=X){c=X}if(!d.guid){d.guid=this.guid++}if(a!==ac){var e=d;d=this.proxy(e);d.data=a}var g=U.data(c,"events")||U.data(c,"events",{}),b=U.data(c,"handle")||U.data(c,"handle",function(){return typeof U!=="undefined"&&!U.event.triggered?U.event.handle.apply(arguments.callee.elem,arguments):ac});b.elem=c;U.each(f.split(/\s+/),function(k,j){var i=j.split(".");j=i.shift();d.type=i.slice().sort().join(".");var h=g[j];if(U.event.specialAll[j]){U.event.specialAll[j].setup.call(c,a,i)}if(!h){h=g[j]={};if(!U.event.special[j]||U.event.special[j].setup.call(c,a,i)===false){if(c.addEventListener){c.addEventListener(j,b,false)}else{if(c.attachEvent){c.attachEvent("on"+j,b)}}}}h[d.guid]=d;U.event.global[j]=true});c=null},guid:1,global:{},remove:function(b,e,c){if(b.nodeType==3||b.nodeType==8){return}var f=U.data(b,"events"),g,h;if(f){if(e===ac||(typeof e==="string"&&e.charAt(0)==".")){for(var d in f){this.remove(b,d+(e||""))}}else{if(e.type){c=e.handler;e=e.type}U.each(e.split(/\s+/),function(m,k){var i=k.split(".");k=i.shift();var l=RegExp("(^|\\.)"+i.slice().sort().join(".*\\.")+"(\\.|$)");if(f[k]){if(c){delete f[k][c.guid]}else{for(var j in f[k]){if(l.test(f[k][j].type)){delete f[k][j]}}}if(U.event.specialAll[k]){U.event.specialAll[k].teardown.call(b,i)}for(g in f[k]){break}if(!g){if(!U.event.special[k]||U.event.special[k].teardown.call(b,i)===false){if(b.removeEventListener){b.removeEventListener(k,U.data(b,"handle"),false)}else{if(b.detachEvent){b.detachEvent("on"+k,U.data(b,"handle"))}}}g=null;delete f[k]}}})}for(g in f){break}if(!g){var a=U.data(b,"handle");if(a){a.elem=null}U.removeData(b,"events");U.removeData(b,"handle")}}},trigger:function(d,b,e,h){var f=d.type||d;if(!h){d=typeof d==="object"?d[ab]?d:U.extend(U.Event(f),d):U.Event(f);if(f.indexOf("!")>=0){d.type=f=f.slice(0,-1);d.exclusive=true}if(!e){d.stopPropagation();if(this.global[f]){U.each(U.cache,function(){if(this.events&&this.events[f]){U.event.trigger(d,b,this.handle.elem)}})}}if(!e||e.nodeType==3||e.nodeType==8){return ac}d.result=ac;d.target=e;b=U.makeArray(b);b.unshift(d)}d.currentTarget=e;var c=U.data(e,"handle");if(c){c.apply(e,b)}if((!e[f]||(U.nodeName(e,"a")&&f=="click"))&&e["on"+f]&&e["on"+f].apply(e,b)===false){d.result=false}if(!h&&e[f]&&!d.isDefaultPrevented()&&!(U.nodeName(e,"a")&&f=="click")){this.triggered=true;try{e[f]()}catch(a){}}this.triggered=false;if(!d.isPropagationStopped()){var g=e.parentNode||e.ownerDocument;if(g){U.event.trigger(d,b,g,true)}}},handle:function(b){var c,h;b=arguments[0]=U.event.fix(b||X.event);b.currentTarget=this;var a=b.type.split(".");b.type=a.shift();c=!a.length&&!b.exclusive;var d=RegExp("(^|\\.)"+a.slice().sort().join(".*\\.")+"(\\.|$)");h=(U.data(this,"events")||{})[b.type];for(var f in h){var e=h[f];if(c||d.test(e.type)){b.handler=e;b.data=e.data;var g=e.apply(this,arguments);if(g!==ac){b.result=g;if(g===false){b.preventDefault();b.stopPropagation()}}if(b.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(c){if(c[ab]){return c}var e=c;c=U.Event(e);for(var d=this.props.length,a;d;){a=this.props[--d];c[a]=e[a]}if(!c.target){c.target=c.srcElement||document}if(c.target.nodeType==3){c.target=c.target.parentNode}if(!c.relatedTarget&&c.fromElement){c.relatedTarget=c.fromElement==c.target?c.toElement:c.fromElement}if(c.pageX==null&&c.clientX!=null){var b=document.documentElement,f=document.body;c.pageX=c.clientX+(b&&b.scrollLeft||f&&f.scrollLeft||0)-(b.clientLeft||0);c.pageY=c.clientY+(b&&b.scrollTop||f&&f.scrollTop||0)-(b.clientTop||0)}if(!c.which&&((c.charCode||c.charCode===0)?c.charCode:c.keyCode)){c.which=c.charCode||c.keyCode}if(!c.metaKey&&c.ctrlKey){c.metaKey=c.ctrlKey}if(!c.which&&c.button){c.which=(c.button&1?1:(c.button&2?3:(c.button&4?2:0)))}return c},proxy:function(a,b){b=b||function(){return a.apply(this,arguments)};b.guid=a.guid=a.guid||b.guid||this.guid++;return b},special:{ready:{setup:Q,teardown:function(){}}},specialAll:{live:{setup:function(b,a){U.event.add(this,a[0],ag)},teardown:function(a){if(a.length){var c=0,b=RegExp("(^|\\.)"+a[0]+"(\\.|$)");U.each((U.data(this,"events").live||{}),function(){if(b.test(this.type)){c++}});if(c<1){U.event.remove(this,a[0],ag)}}}}}};U.Event=function(a){if(!this.preventDefault){return new U.Event(a)}if(a&&a.type){this.originalEvent=a;this.type=a.type}else{this.type=a}this.timeStamp=ae();this[ab]=true};function Y(){return false}function J(){return true}U.Event.prototype={preventDefault:function(){this.isDefaultPrevented=J;var a=this.originalEvent;if(!a){return}if(a.preventDefault){a.preventDefault()}a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=J;var a=this.originalEvent;if(!a){return}if(a.stopPropagation){a.stopPropagation()}a.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=J;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var ai=function(b){var c=b.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(a){c=this}}if(c!=this){b.type=b.data;U.event.handle.apply(this,arguments)}};U.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){U.event.special[b]={setup:function(){U.event.add(this,a,ai,b)},teardown:function(){U.event.remove(this,a,ai)}}});U.fn.extend({bind:function(b,a,c){return b=="unload"?this.one(b,a,c):this.each(function(){U.event.add(this,b,c||a,c&&a)})},one:function(b,a,c){var d=U.event.proxy(c||a,function(e){U(this).unbind(e,d);return(c||a).apply(this,arguments)});return this.each(function(){U.event.add(this,b,d,c&&a)})},unbind:function(a,b){return this.each(function(){U.event.remove(this,a,b)})},trigger:function(b,a){return this.each(function(){U.event.trigger(b,a,this)})},triggerHandler:function(c,a){if(this[0]){var b=U.Event(c);b.preventDefault();b.stopPropagation();U.event.trigger(b,a,this[0]);return b.result}},toggle:function(a){var c=arguments,b=1;while(b<c.length){U.event.proxy(a,c[b++])}return this.click(U.event.proxy(a,function(d){this.lastToggle=(this.lastToggle||0)%b;d.preventDefault();return c[this.lastToggle++].apply(this,arguments)||false}))},hover:function(b,a){return this.mouseenter(b).mouseleave(a)},ready:function(a){Q();if(U.isReady){a.call(document,U)}else{U.readyList.push(a)}return this},live:function(a,b){var c=U.event.proxy(b);c.guid+=this.selector+a;U(document).bind(aa(a,this.selector),this.selector,c);return this},die:function(a,b){U(document).unbind(aa(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});function ag(a){var d=RegExp("(^|\\.)"+a.type+"(\\.|$)"),b=true,c=[];U.each(U.data(this,"events").live||[],function(g,f){if(d.test(f.type)){var e=U(a.target).closest(f.data)[0];if(e){c.push({elem:e,fn:f})}}});c.sort(function(e,f){return U.data(e.elem,"closest")-U.data(f.elem,"closest")});U.each(c,function(){if(this.fn.call(this.elem,a,this.fn.data)===false){return(b=false)}});return b}function aa(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}U.extend({isReady:false,readyList:[],ready:function(){if(!U.isReady){U.isReady=true;if(U.readyList){U.each(U.readyList,function(){this.call(document,U)});U.readyList=null}U(document).triggerHandler("ready")}}});var G=false;function Q(){if(G){return}G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);U.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);U.ready()}});if(document.documentElement.doScroll&&X==X.top){(function(){if(U.isReady){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}U.ready()})()}}}U.event.add(X,"load",U.ready)}U.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(a,b){U.fn[b]=function(c){return c?this.bind(b,c):this.trigger(b)}});U(X).bind("unload",function(){for(var a in U.cache){if(a!=1&&U.cache[a].handle){U.event.remove(U.cache[a].handle.elem)}}});(function(){U.support={};var f=document.documentElement,e=document.createElement("script"),a=document.createElement("div"),b="script"+(new Date).getTime();a.style.display="none";a.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var d=a.getElementsByTagName("*"),g=a.getElementsByTagName("a")[0];if(!d||!d.length||!g){return}U.support={leadingWhitespace:a.firstChild.nodeType==3,tbody:!a.getElementsByTagName("tbody").length,objectAll:!!a.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/red/.test(g.getAttribute("style")),hrefNormalized:g.getAttribute("href")==="/a",opacity:g.style.opacity==="0.5",cssFloat:!!g.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};e.type="text/javascript";try{e.appendChild(document.createTextNode("window."+b+"=1;"))}catch(c){}f.insertBefore(e,f.firstChild);if(X[b]){U.support.scriptEval=true;delete X[b]}f.removeChild(e);if(a.attachEvent&&a.fireEvent){a.attachEvent("onclick",function(){U.support.noCloneEvent=false;a.detachEvent("onclick",arguments.callee)});a.cloneNode(true).fireEvent("onclick")}U(function(){var h=document.createElement("div");h.style.width=h.style.paddingLeft="1px";document.body.appendChild(h);U.boxModel=U.support.boxModel=h.offsetWidth===2;document.body.removeChild(h).style.display="none"})})();var H=U.support.cssFloat?"cssFloat":"styleFloat";U.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};U.fn.extend({_load:U.fn.load,load:function(e,b,a){if(typeof e!=="string"){return this._load(e)}var c=e.indexOf(" ");if(c>=0){var g=e.slice(c,e.length);e=e.slice(0,c)}var d="GET";if(b){if(U.isFunction(b)){a=b;b=null}else{if(typeof b==="object"){b=U.param(b);d="POST"}}}var f=this;U.ajax({url:e,type:d,dataType:"html",data:b,complete:function(i,h){if(h=="success"||h=="notmodified"){f.html(g?U("<div/>").append(i.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(g):i.responseText)}if(a){f.each(a,[i.responseText,h,i])}}});return this},serialize:function(){return U.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?U.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(c,b){var a=U(this).val();return a==null?null:U.isArray(a)?U.map(a,function(d,e){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});U.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(b,a){U.fn[a]=function(c){return this.bind(a,c)}});var N=ae();U.extend({get:function(d,b,a,c){if(U.isFunction(b)){a=b;b=null}return U.ajax({type:"GET",url:d,data:b,success:a,dataType:c})},getScript:function(b,a){return U.get(b,null,a,"script")},getJSON:function(c,b,a){return U.get(c,b,a,"json")},post:function(d,b,a,c){if(U.isFunction(b)){a=b;b={}}return U.ajax({type:"POST",url:d,data:b,success:a,dataType:c})},ajaxSetup:function(a){U.extend(U.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return X.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(k){k=U.extend(true,k,U.extend(true,{},U.ajaxSettings,k));var a,s=/=\?(&|$)/g,f,b,r=k.type.toUpperCase();if(k.data&&k.processData&&typeof k.data!=="string"){k.data=U.param(k.data)}if(k.dataType=="jsonp"){if(r=="GET"){if(!k.url.match(s)){k.url+=(k.url.match(/\?/)?"&":"?")+(k.jsonp||"callback")+"=?"}}else{if(!k.data||!k.data.match(s)){k.data=(k.data?k.data+"&":"")+(k.jsonp||"callback")+"=?"}}k.dataType="json"}if(k.dataType=="json"&&(k.data&&k.data.match(s)||k.url.match(s))){a="jsonp"+N++;if(k.data){k.data=(k.data+"").replace(s,"="+a+"$1")}k.url=k.url.replace(s,"="+a+"$1");k.dataType="script";X[a]=function(v){b=v;p();l();X[a]=ac;try{delete X[a]}catch(u){}if(q){q.removeChild(d)}}}if(k.dataType=="script"&&k.cache==null){k.cache=false}if(k.cache===false&&r=="GET"){var t=ae();var c=k.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+t+"$2");k.url=c+((c==k.url)?(k.url.match(/\?/)?"&":"?")+"_="+t:"")}if(k.data&&r=="GET"){k.url+=(k.url.match(/\?/)?"&":"?")+k.data;k.data=null}if(k.global&&!U.active++){U.event.trigger("ajaxStart")}var g=/^(\w+:)?\/\/([^\/?#]+)/.exec(k.url);if(k.dataType=="script"&&r=="GET"&&g&&(g[1]&&g[1]!=location.protocol||g[2]!=location.host)){var q=document.getElementsByTagName("head")[0];var d=document.createElement("script");d.src=k.url;if(k.scriptCharset){d.charset=k.scriptCharset}if(!a){var i=false;d.onload=d.onreadystatechange=function(){if(!i&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){i=true;p();l();d.onload=d.onreadystatechange=null;q.removeChild(d)}}}q.appendChild(d);return ac}var m=false;var o=k.xhr();if(k.username){o.open(r,k.url,k.async,k.username,k.password)}else{o.open(r,k.url,k.async)}try{if(k.data){o.setRequestHeader("Content-Type",k.contentType)}if(k.ifModified){o.setRequestHeader("If-Modified-Since",U.lastModified[k.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}o.setRequestHeader("X-Requested-With","XMLHttpRequest");o.setRequestHeader("Accept",k.dataType&&k.accepts[k.dataType]?k.accepts[k.dataType]+", */*":k.accepts._default)}catch(e){}if(k.beforeSend&&k.beforeSend(o,k)===false){if(k.global&&!--U.active){U.event.trigger("ajaxStop")}o.abort();return false}if(k.global){U.event.trigger("ajaxSend",[o,k])}var j=function(w){if(o.readyState==0){if(h){clearInterval(h);h=null;if(k.global&&!--U.active){U.event.trigger("ajaxStop")}}}else{if(!m&&o&&(o.readyState==4||w=="timeout")){m=true;if(h){clearInterval(h);h=null}f=w=="timeout"?"timeout":!U.httpSuccess(o)?"error":k.ifModified&&U.httpNotModified(o,k.url)?"notmodified":"success";if(f=="success"){try{b=U.httpData(o,k.dataType,k)}catch(u){f="parsererror"}}if(f=="success"){var v;try{v=o.getResponseHeader("Last-Modified")}catch(u){}if(k.ifModified&&v){U.lastModified[k.url]=v}if(!a){p()}}else{U.handleError(k,o,f)}l();if(w){o.abort()}if(k.async){o=null}}}};if(k.async){var h=setInterval(j,13);if(k.timeout>0){setTimeout(function(){if(o&&!m){j("timeout")}},k.timeout)}}try{o.send(k.data)}catch(e){U.handleError(k,o,null,e)}if(!k.async){j()}function p(){if(k.success){k.success(b,f)}if(k.global){U.event.trigger("ajaxSuccess",[o,k])}}function l(){if(k.complete){k.complete(o,f)}if(k.global){U.event.trigger("ajaxComplete",[o,k])}if(k.global&&!--U.active){U.event.trigger("ajaxStop")}}return o},handleError:function(c,a,d,b){if(c.error){c.error(a,d,b)}if(c.global){U.event.trigger("ajaxError",[a,c,b])}},active:0,httpSuccess:function(a){try{return !a.status&&location.protocol=="file:"||(a.status>=200&&a.status<300)||a.status==304||a.status==1223}catch(b){}return false},httpNotModified:function(b,d){try{var a=b.getResponseHeader("Last-Modified");return b.status==304||a==U.lastModified[d]}catch(c){}return false},httpData:function(a,c,d){var e=a.getResponseHeader("content-type"),f=c=="xml"||!c&&e&&e.indexOf("xml")>=0,b=f?a.responseXML:a.responseText;if(f&&b.documentElement.tagName=="parsererror"){throw"parsererror"}if(d&&d.dataFilter){b=d.dataFilter(b,c)}if(typeof b==="string"){if(c=="script"){U.globalEval(b)}if(c=="json"){b=X["eval"]("("+b+")")}}return b},param:function(d){var b=[];function a(f,e){b[b.length]=encodeURIComponent(f)+"="+encodeURIComponent(e)}if(U.isArray(d)||d.jquery){U.each(d,function(){a(this.name,this.value)})}else{for(var c in d){if(U.isArray(d[c])){U.each(d[c],function(){a(c,this)})}else{a(c,U.isFunction(d[c])?d[c]():d[c])}}}return b.join("&").replace(/%20/g,"+")}});var W={},V,af=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(b,c){var a={};U.each(af.concat.apply([],af.slice(0,c)),function(){a[this]=b});return a}U.fn.extend({show:function(c,a){if(c){return this.animate(K("show",3),c,a)}else{for(var e=0,g=this.length;e<g;e++){var h=U.data(this[e],"olddisplay");this[e].style.display=h||"";if(U.css(this[e],"display")==="none"){var f=this[e].tagName,b;if(W[f]){b=W[f]}else{var d=U("<"+f+" />").appendTo("body");b=d.css("display");if(b==="none"){b="block"}d.remove();W[f]=b}U.data(this[e],"olddisplay",b)}}for(var e=0,g=this.length;e<g;e++){this[e].style.display=U.data(this[e],"olddisplay")||""}return this}},hide:function(b,a){if(b){return this.animate(K("hide",3),b,a)}else{for(var c=0,d=this.length;c<d;c++){var e=U.data(this[c],"olddisplay");if(!e&&e!=="none"){U.data(this[c],"olddisplay",U.css(this[c],"display"))}}for(var c=0,d=this.length;c<d;c++){this[c].style.display="none"}return this}},_toggle:U.fn.toggle,toggle:function(a,b){var c=typeof a==="boolean";return U.isFunction(a)&&U.isFunction(b)?this._toggle.apply(this,arguments):a==null||c?this.each(function(){var d=c?a:U(this).is(":hidden");U(this)[d?"show":"hide"]()}):this.animate(K("toggle",3),a,b)},fadeTo:function(c,a,b){return this.animate({opacity:a},c,b)},animate:function(a,d,b,c){var e=U.speed(d,b,c);return this[e.queue===false?"each":"queue"](function(){var g=U.extend({},e),i,f=this.nodeType==1&&U(this).is(":hidden"),h=this;for(i in a){if(a[i]=="hide"&&f||a[i]=="show"&&!f){return g.complete.call(this)}if((i=="height"||i=="width")&&this.style){g.display=U.css(this,"display");g.overflow=this.style.overflow}}if(g.overflow!=null){this.style.overflow="hidden"}g.curAnim=U.extend({},a);U.each(a,function(p,k){var l=new U.fx(h,g,p);if(/toggle|show|hide/.test(k)){l[k=="toggle"?f?"show":"hide":k](a)}else{var m=k.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),j=l.cur(true)||0;if(m){var q=parseFloat(m[2]),o=m[3]||"px";if(o!="px"){h.style[p]=(q||1)+o;j=((q||1)/l.cur(true))*j;h.style[p]=j+o}if(m[1]){q=((m[1]=="-="?-1:1)*q)+j}l.custom(j,q,o)}else{l.custom(j,k,"")}}});return true})},stop:function(b,c){var a=U.timers;if(b){this.queue([])}this.each(function(){for(var d=a.length-1;d>=0;d--){if(a[d].elem==this){if(c){a[d](true)}a.splice(d,1)}}});if(!c){this.dequeue()}return this}});U.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,a){U.fn[b]=function(d,c){return this.animate(a,d,c)}});U.extend({speed:function(b,a,c){var d=typeof b==="object"?b:{complete:c||!c&&a||U.isFunction(b)&&b,duration:b,easing:c&&a||a&&!U.isFunction(a)&&a};d.duration=U.fx.off?0:typeof d.duration==="number"?d.duration:U.fx.speeds[d.duration]||U.fx.speeds._default;d.old=d.complete;d.complete=function(){if(d.queue!==false){U(this).dequeue()}if(U.isFunction(d.old)){d.old.call(this)}};return d},easing:{linear:function(b,a,d,c){return d+c*b},swing:function(b,a,d,c){return((-Math.cos(b*Math.PI)/2)+0.5)*c+d}},timers:[],fx:function(b,c,a){this.options=c;this.elem=b;this.prop=a;if(!c.orig){c.orig={}}}});U.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(U.fx.step[this.prop]||U.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var b=parseFloat(U.css(this.elem,this.prop,a));return b&&b>-10000?b:parseFloat(U.curCSS(this.elem,this.prop))||0},custom:function(a,b,c){this.startTime=ae();this.start=a;this.end=b;this.unit=c||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;function d(f){return e.step(f)}d.elem=this.elem;if(d()&&U.timers.push(d)&&!V){V=setInterval(function(){var f=U.timers;for(var g=0;g<f.length;g++){if(!f[g]()){f.splice(g--,1)}}if(!f.length){clearInterval(V);V=ac}},13)}},show:function(){this.options.orig[this.prop]=U.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());U(this.elem).show()},hide:function(){this.options.orig[this.prop]=U.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var d=ae();if(c||d>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var f=true;for(var e in this.options.curAnim){if(this.options.curAnim[e]!==true){f=false}}if(f){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(U.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){U(this.elem).hide()}if(this.options.hide||this.options.show){for(var b in this.options.curAnim){U.attr(this.elem.style,b,this.options.orig[b])}}this.options.complete.call(this.elem)}return false}else{var a=d-this.startTime;this.state=a/this.options.duration;this.pos=U.easing[this.options.easing||(U.easing.swing?"swing":"linear")](this.state,a,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};U.extend(U.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){U.attr(a.elem.style,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=a.now+a.unit}else{a.elem[a.prop]=a.now}}}});if(document.documentElement.getBoundingClientRect){U.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return U.offset.bodyOffset(this[0])}var f=this[0].getBoundingClientRect(),c=this[0].ownerDocument,g=c.body,h=c.documentElement,a=h.clientTop||g.clientTop||0,b=h.clientLeft||g.clientLeft||0,d=f.top+(self.pageYOffset||U.boxModel&&h.scrollTop||g.scrollTop)-a,e=f.left+(self.pageXOffset||U.boxModel&&h.scrollLeft||g.scrollLeft)-b;return{top:d,left:e}}}else{U.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return U.offset.bodyOffset(this[0])}U.offset.initialized||U.offset.initialize();var f=this[0],i=f.offsetParent,j=f,a=f.ownerDocument,c,h=a.documentElement,e=a.body,d=a.defaultView,k=d.getComputedStyle(f,null),b=f.offsetTop,g=f.offsetLeft;while((f=f.parentNode)&&f!==e&&f!==h){c=d.getComputedStyle(f,null);b-=f.scrollTop,g-=f.scrollLeft;if(f===i){b+=f.offsetTop,g+=f.offsetLeft;if(U.offset.doesNotAddBorder&&!(U.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(f.tagName))){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}j=i,i=f.offsetParent}if(U.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"){b+=parseInt(c.borderTopWidth,10)||0,g+=parseInt(c.borderLeftWidth,10)||0}k=c}if(k.position==="relative"||k.position==="static"){b+=e.offsetTop,g+=e.offsetLeft}if(k.position==="fixed"){b+=Math.max(h.scrollTop,e.scrollTop),g+=Math.max(h.scrollLeft,e.scrollLeft)}return{top:b,left:g}}}U.offset={initialize:function(){if(this.initialized){return}var c=document.body,i=document.createElement("div"),g,h,a,f,b,j,e=c.style.marginTop,d='<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>';b={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(j in b){i.style[j]=b[j]}i.innerHTML=d;c.insertBefore(i,c.firstChild);g=i.firstChild,h=g.firstChild,f=g.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(h.offsetTop!==5);this.doesAddBorderForTableAndCells=(f.offsetTop===5);g.style.overflow="hidden",g.style.position="relative";this.subtractsBorderForOverflowNotVisible=(h.offsetTop===-5);c.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(c.offsetTop===0);c.style.marginTop=e;c.removeChild(i);this.initialized=true},bodyOffset:function(c){U.offset.initialized||U.offset.initialize();var a=c.offsetTop,b=c.offsetLeft;if(U.offset.doesNotIncludeMarginInBodyOffset){a+=parseInt(U.curCSS(c,"marginTop",true),10)||0,b+=parseInt(U.curCSS(c,"marginLeft",true),10)||0}return{top:a,left:b}}};U.fn.extend({position:function(){var b=0,c=0,e;if(this[0]){var d=this.offsetParent(),a=this.offset(),f=/^body|html$/i.test(d[0].tagName)?{top:0,left:0}:d.offset();a.top-=Z(this,"marginTop");a.left-=Z(this,"marginLeft");f.top+=Z(d,"borderTopWidth");f.left+=Z(d,"borderLeftWidth");e={top:a.top-f.top,left:a.left-f.left}}return e},offsetParent:function(){var a=this[0].offsetParent||document.body;while(a&&(!/^body|html$/i.test(a.tagName)&&U.css(a,"position")=="static")){a=a.offsetParent}return U(a)}});U.each(["Left","Top"],function(b,c){var a="scroll"+c;U.fn[a]=function(d){if(!this[0]){return null}return d!==ac?this.each(function(){this==X||this==document?X.scrollTo(!b?d:U(X).scrollLeft(),b?d:U(X).scrollTop()):this[a]=d}):this[0]==X||this[0]==document?self[b?"pageYOffset":"pageXOffset"]||U.boxModel&&document.documentElement[a]||document.body[a]:this[0][a]}});U.each(["Height","Width"],function(b,d){var f=b?"Left":"Top",c=b?"Right":"Bottom",e=d.toLowerCase();U.fn["inner"+d]=function(){return this[0]?U.css(this[0],e,false,"padding"):null};U.fn["outer"+d]=function(g){return this[0]?U.css(this[0],e,false,g?"margin":"border"):null};var a=d.toLowerCase();U.fn[a]=function(g){return this[0]==X?document.compatMode=="CSS1Compat"&&document.documentElement["client"+d]||document.body["client"+d]:this[0]==document?Math.max(document.documentElement["client"+d],document.body["scroll"+d],document.documentElement["scroll"+d],document.body["offset"+d],document.documentElement["offset"+d]):g===ac?(this.length?U.css(this[0],a):null):this.css(a,typeof g==="string"?g:g+"px")}})})();(function(a){a.fn.corner=function(g){var j=a.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);function m(o,s){return parseInt(a.css(o,s))||0}function p(o){var o=parseInt(o).toString(16);return(o.length<2)?"0"+o:o}function f(t){for(;t&&t.nodeName.toLowerCase()!="html";t=t.parentNode){var o=a.css(t,"backgroundColor");if(o.indexOf("rgb")>=0){if(a.browser.safari&&o=="rgba(0, 0, 0, 0)"){continue}var s=o.match(/\d+/g);return"#"+p(s[0])+p(s[1])+p(s[2])}if(o&&o!="transparent"){return o}}return"#ffffff"}function r(o){switch(i){case"round":return Math.round(e*(1-Math.cos(Math.asin(o/e))));case"cool":return Math.round(e*(1+Math.cos(Math.asin(o/e))));case"sharp":return Math.round(e*(1-Math.cos(Math.acos(o/e))));case"bite":return Math.round(e*(Math.cos(Math.asin((e-o-1)/e))));case"slide":return Math.round(e*(Math.atan2(o,e/o)));case"jut":return Math.round(e*(Math.atan2(e,(e-o-1))));case"curl":return Math.round(e*(Math.atan(o)));case"tear":return Math.round(e*(Math.cos(o)));case"wicked":return Math.round(e*(Math.tan(o)));case"long":return Math.round(e*(Math.sqrt(o)));case"sculpt":return Math.round(e*(Math.log((e-o-1),e)));case"dog":return(o&1)?(o+1):e;case"dog2":return(o&2)?(o+1):e;case"dog3":return(o&3)?(o+1):e;case"fray":return(o%2)*e;case"notch":return e;case"bevel":return o+1}}g=(g||"").toLowerCase();var c=/keep/.test(g);var h=((g.match(/cc:(#[0-9a-f]+)/)||[])[1]);var l=((g.match(/sc:(#[0-9a-f]+)/)||[])[1]);var e=parseInt((g.match(/(\d+)px/)||[])[1])||10;var q=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var i=((g.match(q)||["round"])[0]);var k={T:0,B:1};var b={TL:/top|tl/.test(g),TR:/top|tr/.test(g),BL:/bottom|bl/.test(g),BR:/bottom|br/.test(g)};if(!b.TL&&!b.TR&&!b.BL&&!b.BR){b={TL:1,TR:1,BL:1,BR:1}}var d=document.createElement("div");d.style.overflow="hidden";d.style.height="1px";d.style.backgroundColor=l||"transparent";d.style.borderStyle="solid";return this.each(function(v){var s={T:parseInt(a.css(this,"paddingTop"))||0,R:parseInt(a.css(this,"paddingRight"))||0,B:parseInt(a.css(this,"paddingBottom"))||0,L:parseInt(a.css(this,"paddingLeft"))||0};if(a.browser.msie){this.style.zoom=1}if(!c){this.style.border="none"}d.style.borderColor=h||f(this.parentNode);var y=a.curCSS(this,"height");for(var t in k){var z=k[t];if((z&&(b.BL||b.BR))||(!z&&(b.TL||b.TR))){d.style.borderStyle="none "+(b[t+"R"]?"solid":"none")+" none "+(b[t+"L"]?"solid":"none");var B=document.createElement("div");a(B).addClass("jquery-corner");var o=B.style;z?this.appendChild(B):this.insertBefore(B,this.firstChild);if(z&&y!="auto"){if(a.css(this,"position")=="static"){this.style.position="relative"}o.position="absolute";o.bottom=o.left=o.padding=o.margin="0";if(a.browser.msie){o.setExpression("width","this.parentNode.offsetWidth")}else{o.width="100%"}}else{if(!z&&a.browser.msie){if(a.css(this,"position")=="static"){this.style.position="relative"}o.position="absolute";o.top=o.left=o.right=o.padding=o.margin="0";var C=0;if(j||!a.boxModel){C=m(this,"borderLeftWidth")+m(this,"borderRightWidth")}j?o.setExpression("width","this.parentNode.offsetWidth - "+C+'+ "px"'):o.width="100%"}else{o.margin=!z?"-"+s.T+"px -"+s.R+"px "+(s.T-e)+"px -"+s.L+"px":(s.B-e)+"px -"+s.R+"px -"+s.B+"px -"+s.L+"px"}}for(var u=0;u<e;u++){var D=Math.max(0,r(u));var x=d.cloneNode(false);x.style.borderWidth="0 "+(b[t+"R"]?D:0)+"px 0 "+(b[t+"L"]?D:0)+"px";z?B.appendChild(x):B.insertBefore(x,B.firstChild)}}}})};a.fn.uncorner=function(b){return a(".jquery-corner",this).remove()}})(jQuery);(function($){function toIntegersAtLease(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(date){return date.getUTCFullYear()+"-"+toIntegersAtLease(date.getUTCMonth()+1)+"-"+toIntegersAtLease(date.getUTCDate())};var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};$.quoteString=function(string){if(escapeable.test(string)){return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==="string"){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+string+'"'};$.toJSON=function(o){var type=typeof(o);if(type=="undefined"){return"undefined"}else{if(type=="number"||type=="boolean"){return o+""}else{if(o===null){return"null"}}}if(type=="string"){return $.quoteString(o)}if(type=="object"&&typeof o.toJSON=="function"){return o.toJSON()}if(type!="function"&&typeof(o.length)=="number"){var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i]))}return"["+ret.join(", ")+"]"}if(type=="function"){throw new TypeError("Unable to convert object of type 'function' to json.")}ret=[];for(var k in o){var name;var type=typeof(k);if(type=="number"){name='"'+k+'"'}else{if(type=="string"){name=$.quoteString(k)}else{continue}}val=$.toJSON(o[k]);if(typeof(val)!="string"){continue}ret.push(name+": "+val)}return"{"+ret.join(", ")+"}"};$.evalJSON=function(src){return eval("("+src+")")};$.secureEvalJSON=function(src){var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,"@");filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(filtered)){return eval("("+src+")")}else{throw new SyntaxError("Error parsing JSON, source is not valid.")}}})(jQuery);function forEach(d,c){for(var a=0,b=d.length;a<b;a++){c(d[a])}}function getElementsByTagAndClassName(b,a,c){c=c||document;return jQuery(b+"."+a)}function map(d,e){var a=[];for(var b=0,c=e.length;b<c;b++){a.push(d(e[b]))}return a}function findValue(b,a){return jQuery.inArray(a,b)}function filter(a,b){return jQuery.grep(b,a)}function noop(){}function addElementClass(b,a){jQuery(b).addClass(a)}function toggleElementClass(b,a){jQuery(b).toggleClass(a)}function removeElementClass(b,a){jQuery(b).removeClass(a)}hasElementClass=jQuery.className.has;function partial(b){var a=sliceList(arguments,1);return function(){return b.apply(null,merge(a,arguments))}}function log(){var a=[];for(var b=0;b<arguments.length;b++){a.push(arguments[b])}if(typeof(window)!="undefined"&&window.console&&window.console.log){window.console.log(a.join(" "))}}function getNodeAttribute(b,a){return jQuery(b).attr(a)}function isArray(a){return a&&(a instanceof Array||typeof a=="array")}function isString(a){return !!arguments.length&&a!=null&&(typeof a=="string"||a instanceof String)}function isArrayLike(a){return(a&&a!==undefined&&!isString(a)&&!jQuery.isFunction(a)&&!(a.tagName&&a.tagName.toLowerCase()=="form")&&(isArray(a)||isFinite(a.length)))}function getNode(a){if(typeof(a)=="string"){return document.getElementById(a)}return a}function jqNode(a){a=getNode(a);if(a){return jQuery(a)}return null}function evalJSON(json){return eval("("+json+")")}function urlEncode(a){if(typeof(encodeURIComponent)!="undefined"){return encodeURIComponent(a).replace(/\'/g,"%27")}else{return escape(a).replace(/\+/g,"%2B").replace(/\"/g,"%22").rval.replace(/\'/g,"%27")}}function swapDOM(a,c){a=getNode(a);var b=a.parentNode;if(c){c=getNode(c);b.replaceChild(c,a)}else{b.removeChild(a)}return c}function replaceChildNodes(c){var b=getNode(c);arguments[0]=b;var d;while((d=b.firstChild)){b.removeChild(d)}if(arguments.length<2){return b}else{for(var a=1;a<arguments.length;a++){b.appendChild(arguments[a])}return b}}update=jQuery.extend;function createDomFunction(a){function b(h,e){var f=document.createElement(a);for(key in h){var g=h[key];if(key.substring(0,2)=="on"){if(typeof g=="string"){g=new Function(g)}f[key]=g}else{jQuery(f).attr(key,h[key])}}if(e){if(!isArrayLike(e)){e=[e];for(var d=2;d<arguments.length;d++){var c=arguments[d];if(isArray(c)){e=merge(e,c)}else{e.push(c)}}}for(var d=0;d<e.length;d++){var j=e[d];if(typeof j=="string"||typeof j=="number"){j=document.createTextNode(j)}f.appendChild(j)}}return f}return b}A=createDomFunction("a");BUTTON=createDomFunction("button");BR=createDomFunction("br");CANVAS=createDomFunction("canvas");DD=createDomFunction("dd");DIV=createDomFunction("div");DL=createDomFunction("dl");DT=createDomFunction("dt");FIELDSET=createDomFunction("fieldset");FORM=createDomFunction("form");H1=createDomFunction("H1");H2=createDomFunction("H2");H3=createDomFunction("H3");H4=createDomFunction("H4");H5=createDomFunction("H5");H6=createDomFunction("H6");HR=createDomFunction("hr");IMG=createDomFunction("img");INPUT=createDomFunction("input");LABEL=createDomFunction("label");LEGEND=createDomFunction("legend");LI=createDomFunction("li");OL=createDomFunction("ol");OPTGROUP=createDomFunction("optgroup");OPTION=createDomFunction("option");P=createDomFunction("p");PRE=createDomFunction("pre");SELECT=createDomFunction("select");SPAN=createDomFunction("span");STRONG=createDomFunction("strong");TABLE=createDomFunction("table");TBODY=createDomFunction("tbody");TD=createDomFunction("td");TEXTAREA=createDomFunction("textarea");TFOOT=createDomFunction("tfoot");TH=createDomFunction("th");THEAD=createDomFunction("thead");TR=createDomFunction("tr");TT=createDomFunction("tt");UL=createDomFunction("ul");function IFRAME(d){if("name" in d){try{var b=document.createElement('<iframe name="'+d.name+'">')}catch(a){var b=document.createElement("iframe");b.id=b.name=d.name}}else{var b=document.createElement("iframe")}for(key in d){if(key!="name"){var c=d[key];if(key.substring(0,2)=="on"){if(typeof c=="string"){c=new Function(c)}b[key]=c}else{b.setAttribute(key,d[key])}}}return b}function Deferred(){this.__init__(this)}jQuery.extend(Deferred.prototype,{__init__:function(){this.onSuccess=[];this.onFailure=[];this.req=null},addCallback:function(a){this.onSuccess.push([a,sliceList(arguments,1)]);return this},addErrback:function(a){this.onFailure.push([a,sliceList(arguments,1)]);return this},success:function(a){try{for(var d=0;d<this.onSuccess.length;d++){var e=this.onSuccess[d][0];var c=merge([a,this.req],this.onSuccess[d][1]);e.apply(null,c)}}catch(b){this.error(this.xhr,null,b)}},error:function(e,a,c){for(var d=0;d<this.onFailure.length;d++){var f=this.onFailure[d][0];var b=merge([c,this.req],this.onFailure[d][1]);f.apply(null,b)}}});toISOTime=function(c,b){if(typeof(c)=="undefined"||c===null){return null}var e=c.getHours();var f=c.getMinutes();var d=c.getSeconds();var a=[((b&&(e<10))?"0"+e:e),((f<10)?"0"+f:f),((d<10)?"0"+d:d)];return a.join(":")};_padTwo=function(a){return(a>9)?a:"0"+a};toISODate=function(a){if(typeof(a)=="undefined"||a===null){return null}return[a.getFullYear(),_padTwo(a.getMonth()+1),_padTwo(a.getDate())].join("-")};toISOTimestamp=function(c,a){if(typeof(c)=="undefined"||c===null){return null}var b=a?"T":" ";var d=a?"Z":"";if(a){c=new Date(c.getTime()+(c.getTimezoneOffset()*60000))}return toISODate(c)+b+toISOTime(c,a)+d};function loadRemote(a,c,b){var e=new Deferred();jQuery.ajax({url:a,type:b,data:c,beforeSend:function(d){e.req=d},success:function(f,d){if(e.req.getResponseHeader("content-type")=="application/json"){f=evalJSON(f)}e.success(f)},error:function(g,d,f){f=evalJSON(g.responseText);e.error(g,d,f.reason)}});return e}function nodeWalkDepthFirst(c,d){var b=d(c);if(b){for(var a=0;a<b.length;a++){nodeWalkDepthFirst(b[a],d)}}}function isNotEmpty(b){for(var a=0;a<arguments.length;a++){var c=arguments[a];if(!(c&&c.length)){return false}}return true}function formContents(b){var c=[];var a=[];if(typeof(b)=="undefined"||b===null){b=document.body}else{b=getNode(b)}nodeWalkDepthFirst(b,function(m){var e=m.name;if(isNotEmpty(e)){var j=m.tagName.toUpperCase();if(j==="INPUT"&&(m.type=="radio"||m.type=="checkbox")&&!m.checked){return null}if(j==="SELECT"){if(m.type=="select-one"){if(m.selectedIndex>=0){var g=m.options[m.selectedIndex];var d=g.value;if(!d){var k=g.outerHTML;if(k&&!k.match(/^[^>]+\svalue\s*=/i)){d=g.text}}c.push(e);a.push(d);return null}c.push(e);a.push("");return null}else{var l=m.options;if(!l.length){c.push(e);a.push("");return null}for(var f=0;f<l.length;f++){var g=l[f];if(!g.selected){continue}var d=g.value;if(!d){var k=g.outerHTML;if(k&&!k.match(/^[^>]+\svalue\s*=/i)){d=g.text}}c.push(e);a.push(d)}return null}}if(j==="FORM"||j==="P"||j==="SPAN"||j==="DIV"){return m.childNodes}c.push(e);a.push(m.value||"");return null}return m.childNodes});return[c,a]}function merge(g,f){var a=[];for(var c=0,e=arguments.length;c<e;c++){var h=arguments[c];for(var b=0,d=h.length;b<d;b++){a.push(h[b])}}return a}var KEYS={KEY_ESC:27,KEY_ENTER:13};ONE_DAY=86400000;Date.prototype.equals=function(a){if(this.getYear()==a.getYear()&&this.getMonth()==a.getMonth()&&this.getDate()==a.getDate()){return true}return false};Date.prototype.add=function(b){var a=new Date();a.setTime(this.getTime()+(b*ONE_DAY));return a};Date.prototype.sub=function(a){return this.add(-a)};Date.prototype.iadd=function(a){this.setTime(this.getTime()+(a*ONE_DAY));this.setHours(12)};Date.prototype.isub=function(a){this.setTime(this.getTime()-(a*ONE_DAY))};Date.prototype.nextMonth=function(){if(this.getMonth()==11){var b=new Date(this.getFullYear()+1,0,1);return b}else{var a=new Date(this.getFullYear(),this.getMonth()+1,1);return a}};Date.prototype.getRealDay=function(){return(this.getDay()+6)%7};Date.prototype.strftime=function(a){if(this.toLocaleFormat!==undefined){return this.toLocaleFormat(a)}return this.getFullYear()+"/"+(this.getMonth()+1)+"/"+this.getDate()};var _DATE_FORMAT_REGXES={Y:new RegExp("^-?[0-9]+"),d:new RegExp("^[0-9]{1,2}"),m:new RegExp("^[0-9]{1,2}"),H:new RegExp("^[0-9]{1,2}"),M:new RegExp("^[0-9]{1,2}")};function _parseDate(f,i){var j=new RegExp("^0*[0-9]+");var g={};for(var b=0,a=0;b<i.length;b++,a++){var e=i.charAt(b);var c=f.charAt(a);if(e=="%"){e=i.charAt(++b);var d=_DATE_FORMAT_REGXES[e].exec(f.substring(a));if(!d.length){return null}d=d[0];a+=d.length-1;var h=parseInt(d,10);if(isNaN(h)){return null}g[e]=h;continue}if(e!=c){return null}}return g}function strptime(c,d){var a=_parseDate(c,d);if(!a){return null}var b=new Date(0,0,1,0,0);b.setFullYear(0);if(a.Y){b.setFullYear(a.Y)}if(a.m){if(a.m<1||a.m>12){return null}b.setMonth(a.m-1)}if(a.d){if(a.m<1||a.m>31){return null}b.setDate(a.d)}if(a.H){if(a.H<0||a.H>23){return null}b.setHours(a.H)}if(a.M){if(a.M<0||a.M>59){return null}b.setMinutes(a.M)}return b}Array.prototype.contains=function(a){return findValue(this,a)!=-1};String.prototype.startsWith=function(a){return this.indexOf(a)==0};String.prototype.endsWith=function(b){var a=this.length-b.length;if(a<0){return false}return this.lastIndexOf(b,a)==a};String.prototype.strip=function(){return this.replace(/^\s*(.*?)\s*$/,"$1")};String.prototype.in_=function(a){return findValue(a,this)!=-1};String.prototype.join=function(a){return a.join(this)};function list(d){var c=iter(d);var b=[];while(true){try{b.push(c.next())}catch(a){if(a!=StopIteration){throw a}return b}}}function getattr(c,b,a){return c[b]||a}function attrgetter(a){return function(b){return getattr(b,a)}}function sliceList(b,f,d,e){var f=f||0;var d=d||b.length;var e=e||1;if(d<0){d=max(b.length+d,0)}if(f<0){f=min(b.length+f,b.length)}var a=[];for(var c=f;c<d;c+=e){a.push(b[c])}return a}function methodcaller(b){var a=sliceList(arguments,1);return function(c){return c[b].apply(c,a)}}function min(){return listMin(arguments)}function max(){return listMax(arguments)}function dict(d,a){if(d.length!=a.length){throw"got different number of keys and values !"}var c={};for(var b=0;b<d.length;b++){c[d[b]]=a[b]}return c}function concat(){return"".join(list(arguments))}function makeUnboundMethod(a){function b(c){var d=sliceList(arguments,1);return a.apply(c,d)}b.__name__=a.__name__;return b}function attachMethodToClass(b,c,a){a.__name__=c;b.__dict__[c]=a;b[c]=makeUnboundMethod(a);b.prototype[c]=a}function _isAttrSkipped(c){var a=["__class__","__dict__","__bases__","prototype"];for(var b=0;b<a.length;b++){if(a[b]==c){return true}}return false}function makeConstructor(a){return function(){if(a){a.apply(this,arguments)}}}function defclass(c,b,h){var a=b||[];var j={};var f=[];for(var g=a.length-1;g>=0;g--){f.push(a[g])}f.push({__dict__:h});for(var g=0;g<f.length;g++){var k=f[g];for(prop in k.__dict__){if(!_isAttrSkipped(prop)){j[prop]=k.__dict__[prop]}}}var d=j.__init__;var e=makeConstructor(d);e.__name__=c;e.__bases__=a;e.__dict__={};e.prototype.__class__=e;for(methname in j){attachMethodToClass(e,methname,j[methname])}return e}CubicWeb={};Erudi=CubicWeb;CubicWeb.loaded=[];CubicWeb.require=function(a){if(!CubicWeb.loaded.contains(a)){log(a," is required but not loaded")}};CubicWeb.provide=function(a){if(!CubicWeb.loaded.contains(a)){CubicWeb.loaded.push(a)}};CubicWeb.provide("python.js");CubicWeb.require("python.js");CubicWeb.require("jquery.corner.js");function baseuri(){var a=document.baseURI;if(a){return a}var b=document.getElementsByTagName("base");if(b.length){return getNodeAttribute(b[0],"href")}return""}function setProgressCursor(){var a=document.getElementsByTagName("body")[0];a.style.cursor="progress"}function resetCursor(b){var a=document.getElementsByTagName("body")[0];a.style.cursor="default";return b}function updateMessage(b){var a=DIV({"class":"message"});a.innerHTML=b;jQuery("#appMsg").removeClass("hidden").empty().append(a)}function asURL(b){var d=[];for(key in b){var c=b[key];if(isArrayLike(c)){for(var a=0;a<c.length;a++){d.push(key+"="+c[a])}}else{d.push(key+"="+c)}}return d.join("&")}function firstSelected(a){var b=filter(attrgetter("selected"),a.options);return(b.length>0)?getNodeAttribute(b[0],"value"):null}function toggleVisibility(a){jqNode(a).toggleClass("hidden")}function popupLoginBox(){toggleVisibility("popupLoginBox");jQuery("#__login:visible").focus()}function getElementsMatching(b,a,c){c=c||document;return filter(function d(e){for(prop in a){if(getNodeAttribute(e,prop)!=a[prop]){return false}}return true},c.getElementsByTagName(b))}function setCheckboxesState(a,b){var c=getElementsMatching("input",{type:"checkbox"});filterfunc=function(d){return a&&d.name.startsWith(a)};forEach(filter(filterfunc,c),function(d){d.checked=b})}function setCheckboxesState2(a,d,b){var c=getElementsMatching("input",{type:"checkbox"});filterfunc=function(e){return a&&e.name.startsWith(a)&&e.value==d};forEach(filter(filterfunc,c),function(e){e.checked=b})}function html2dom(b){var a=SPAN();a.innerHTML=b;if(a.childNodes.length==1){return a.firstChild}else{return a}}function rql_for_eid(a){return"Any X WHERE X eid "+a}function isTextNode(a){return a.nodeType==3}function isElementNode(a){return a.nodeType==1}function autogrow(a){if(a.scrollHeight>a.clientHeight&&!window.opera){if(a.rows<20){a.rows+=2}}}CubicWeb.rounded=[["div.sideBoxBody","bottom 6px"],["div.boxTitle, div.boxPrefTitle, div.sideBoxTitle, th.month","top 6px"]];function roundedCorners(b){b=jQuery(b);for(var a=0;a<CubicWeb.rounded.length;a++){b.find(CubicWeb.rounded[a][0]).corner(CubicWeb.rounded[a][1])}}jQuery(document).ready(function(){roundedCorners(this.body)});CubicWeb.provide("corners.js");CubicWeb.provide("htmlhelpers.js");function plaintextsearch(){var a=["notice","auteur","domaine","representation","titre"];var c=jQuery("#norql").attr("value");for(var b=0;b<a.length;b++){if(c.startsWith(a[b])){return true}}document.location.href=baseuri()+"search/"+c;return false}function showSearchFields(){jQuery("#advancedSearchFields").slideDown()}jQuery(document).ready(function(){jQuery("input").focus(function(){jQuery(this).addClass("active")});jQuery("input").blur(function(){jQuery(this).removeClass("active")});jQuery("#norql").focus()});var NavIndexes={};var index=0;function prevCriteriaSearch(b){var a=NavIndexes[b];if(a===undefined){NavIndexes[b]=0;return}a--;jQuery("#"+b+" ul").hide();jQuery("#"+b+"  ul:eq("+a+")").show();NavIndexes[b]=a}function nextCriteriaSearch(a){if(index===undefined){NavIndexes[a]=0}index++;jQuery("#"+a+" ul").hide();jQuery("#"+a+" ul:eq("+index+")").show();NavIndexes[a]=index}function addSearchCriterion(b,a){var c=asyncRemoteExec("add_search_criterion",b,a);c.addCallback(function(){reloadComponent("criteria_search")})}function delSearchCriterion(b,a){var c=asyncRemoteExec("del_search_criterion",b,a);c.addCallback(function(){reloadComponent("criteria_search")})}function delAllSearchCriteria(){var a=asyncRemoteExec("del_all_search_criteria");a.addCallback(function(){reloadComponent("criteria_search")})}function selectArtitems(){var b=jQuery("#all_artitems").attr("checked");var c=[];if(b==true){jQuery("#checkAll").hide();jQuery("#unCheckAll").show();jQuery("input[name=artitems]").each(function(){this.checked=b;c.push(this.value)})}else{jQuery("#checkAll").show();jQuery("#unCheckAll").hide();jQuery("input[name=artitems]").each(function(){this.checked=b})}var a=asyncRemoteExec("add_selected_artitems",c);a.addCallback(function(){reloadBox("albumBox")})}function selectOneArtitem(){var b=[];jQuery("input[name=artitems]").each(function(){if(this.checked==true){b.push(this.value)}});var a=asyncRemoteExec("add_selected_artitems",b);a.addCallback(function(){reloadBox("albumBox")})}function tabClick(j,f,k,h,o,b){var d=jQuery("#filterbox");var c=d.find("form");if(c){var m=facetFormContent(c);var a={};for(var g=0;g<m[0].length;g++){a[m[0][g]]=m[1][g]}var e={"facets-params":jQuery.toJSON(a)}}else{var e=null}var l=function(){if(o){d.show();var i=evalJSON(c.attr("cubicweb:facetargs"));c.id=h+"Form";i[0]=h;i[1]=k;c.attr("cubicweb:facetargs",jQuery.toJSON(i))}else{d.hide()}jQuery("li[name=tab]").removeClass("ui-tabs-selected");jQuery("li[name=tab]:eq("+b+")").addClass("ui-tabs-selected")};replacePageChunk("paginated-content",j,f,e,null,l)}function addInAlbum(a){var b=jQuery(getNode("addInAlbum"));if(a){b.append(INPUT({type:"hidden",name:"album",value:a}))}b.submit()}var cbox_selected=false;function toggleFormCheckBoxes(a){cbox_selected=!cbox_selected;jQuery(a).closest("form").find("input:checkbox").each(function(){jQuery(this).attr("checked",cbox_selected)})}function toggleAllCheckBoxes(){cbox_selected=!cbox_selected;$("input[type=checkbox]").attr("checked",cbox_selected)}function addSelectInAlbum(a){var c=[];var e=jQuery("input[type=checkbox][name=selec_oeuvre][checked]");if(e.length==0){updateMessage(_("Veuillez cocher au minimum une case"));return}for(var b=0;b<e.length;b++){c.push(e[b].value)}var f=asyncRemoteExec("add_selected_to_album",a,c);f.addCallback(function(d){document.location=d})}function getSelectedPropositions(){var b=[];var c=jQuery("input[type=checkbox][name=objets][checked]");if(c.length==0){updateMessage(_("Veuillez cocher au minimum une case"));return}for(var a=0;a<c.length;a++){b.push(c[a].value)}theme_eid=jQuery("div#folderSelectProposition select[name=thematics]").children("[selected]").val();var e=asyncRemoteExec("add_selected_propositions",theme_eid,b);e.addCallback(function(d){document.location=d})}CubicWeb.require("python.js");CubicWeb.require("htmlhelpers.js");var JSON_BASE_URL=baseuri()+"json?";function _loadAjaxHtmlHead(e,c,a,d){var b=[];var f=a+"["+d+"]";jQuery("head "+f).each(function(g){b.push(this.getAttribute(d))});e.find(a).each(function(g){if(this.getAttribute(d)){if(!b.contains(this.getAttribute(d))){jQuery(this).appendTo(c)}}else{jQuery(this).appendTo(c)}});e.find(f).remove()}function loadAjaxHtmlHead(b){var a=jQuery("head");b=jQuery(b).find("div.ajaxHtmlHead");_loadAjaxHtmlHead(b,a,"script","src");_loadAjaxHtmlHead(b,a,"link","href");b.find("*").appendTo(a)}function preprocessAjaxLoad(a,b){loadAjaxHtmlHead(b)}function postAjaxLoad(a){if(typeof(Sortable)!="undefined"){Sortable.sortTables(a)}if(typeof(FCKeditor)!="undefined"){buildWysiwygEditors()}if(typeof initFacetBoxEvents!="undefined"){initFacetBoxEvents(a)}if(typeof buildWidgets!="undefined"){buildWidgets(a)}if(typeof roundedCorners!="undefined"){roundedCorners(a)}loadDynamicFragments(a);jQuery(CubicWeb).trigger("ajax-loaded")}jQuery.fn.loadxhtml=function(a,e,b,f){var d=null;if(b=="post"){d=jQuery.post}else{d=jQuery.get}if(this.size()>1){log("loadxhtml was called with more than one element")}var c=this.get(0);f=f||"replace";var g=null;if(e&&e.callback){g=e.callback;delete e.callback}d(a,e,function(h){var j=getDomFromResponse(h);preprocessAjaxLoad(c,j);if(f=="swap"){var i=c.id;c=swapDOM(c,j);if(!c.id){c.id=i}}else{if(f=="replace"){jQuery(c).empty().append(j)}else{if(f=="append"){jQuery(c).append(j)}}}postAjaxLoad(c);while(jQuery.isFunction(g)){g=g.apply(this,[j])}})};function loadDynamicFragments(a){if(a){var g=jQuery(a).find("div.dynamicFragment")}else{var g=jQuery("div.dynamicFragment")}if(g.length==0){return}if(typeof LOADING_MSG=="undefined"){LOADING_MSG="loading"}for(var c=0;c<g.length;c++){var d=g[c];d.innerHTML="<h3>"+LOADING_MSG+' ... <img src="data/loading.gif" /></h3>';var h=getNodeAttribute(d,"cubicweb:rql");var j=getNodeAttribute(d,"cubicweb:vid");var f={};var e=getNodeAttribute(d,"cubicweb:actualrql");if(e){f.actualrql=e}var b=getNodeAttribute(d,"cubicweb:fallbackvid");if(b){f.fallbackvid=b}replacePageChunk(d.id,h,j,f)}}jQuery(document).ready(function(){loadDynamicFragments()});function remoteCallFailed(b,a){if(a.status==500){updateMessage(b)}else{updateMessage(_("an error occured while processing your request"))}}function remoteExec(c){setProgressCursor();var b={fname:c,pageid:pageid,arg:map(jQuery.toJSON,sliceList(arguments,1))};var a=jQuery.ajax({url:JSON_BASE_URL,data:b,async:false}).responseText;if(a){a=evalJSON(a)}resetCursor();return a}function asyncRemoteExec(c){setProgressCursor();var b={fname:c,pageid:pageid,arg:map(jQuery.toJSON,sliceList(arguments,1))};var a=loadRemote(JSON_BASE_URL,b,"POST");a=a.addErrback(remoteCallFailed);a=a.addErrback(resetCursor);a=a.addCallback(resetCursor);return a}function _(a){return remoteExec("i18n",[a])[0]}function userCallback(a){asyncRemoteExec("user_callback",a)}function unloadPageData(){remoteExec("unload_page_data")}function openHash(){if(document.location.hash){var b=document.location.hash.replace("#","");var a=jQuery("#"+b);if(a){removeElementClass(a,"hidden")}}}jQuery(document).ready(openHash);function reloadComponent(c,b,a,g,e){a=a||"components";b=b||"";g=g||(c+"Component");e=e||{};var f=getNode(g);var h=asyncRemoteExec("component",c,b,a,e);h.addCallback(function(d,i){var j=getDomFromResponse(d);if(f){removeElementClass(f,"hidden");swapDOM(f,j);postAjaxLoad(j)}});h.addCallback(resetCursor);h.addErrback(function(d){updateMessage(_("an error occured"));log(d)});return h}function reloadBox(b,a){return reloadComponent(b,a,"boxes",b)}function userCallbackThenUpdateUI(h,c,b,g,a,e){var f=asyncRemoteExec("user_callback",h);f.addCallback(function(){reloadComponent(c,b,a,e);if(g){updateMessage(g)}});f.addCallback(resetCursor);f.addErrback(function(d){updateMessage(_("an error occured"));log(d);return resetCursor()})}function userCallbackThenReloadPage(c,b){var a=asyncRemoteExec("user_callback",c);a.addCallback(function(){window.location.reload();if(b){updateMessage(b)}});a.addCallback(resetCursor);a.addErrback(function(d){updateMessage(_("an error occured"));log(d);return resetCursor()})}function unregisterUserCallback(b){var a=asyncRemoteExec("unregister_user_callback",b);a.addCallback(function(){resetCursor()});a.addErrback(function(c){updateMessage(_("an error occured"));log(c);return resetCursor()})}function replacePageChunk(b,i,j,h,c,k){var e=null;if(k){e={callback:k}}var d=jQuery("#"+b)[0];var g={};if(d){g.rql=i;g.fname="view";g.pageid=pageid;if(j){g.vid=j}if(h){jQuery.extend(g,h)}var f=c?"swap":"replace";var a=JSON_BASE_URL+asURL(g);jQuery(d).loadxhtml(a,e,"get",f)}else{log("Node",b,"not found")}}function loadxhtml(c,a,b){jQuery("#"+c).loadxhtml(a,null,"post",b)}function buildWysiwygEditors(a){jQuery("textarea").each(function(){if(this.getAttribute("cubicweb:type")=="wysiwyg"){this.setAttribute("cubicweb:type","fckeditor");if(typeof FCKeditor!="undefined"){var b=new FCKeditor(this.id);b.Config.CustomConfigurationsPath=fckconfigpath;b.Config.DefaultLanguage=fcklang;b.BasePath="fckeditor/";b.ReplaceTextarea()}else{log("fckeditor could not be found.")}}})}jQuery(document).ready(buildWysiwygEditors);function stripEmptyTextNodes(c){var d=[];for(var a=0;a<c.length;a++){var b=c[a];if(isTextNode(b)&&!b.textContent.strip()){continue}else{d.push(b)}}return d}function getDomFromResponse(a){if(typeof(a)=="string"){return html2dom(a)}var c=a.documentElement;var b=c.childNodes;if(!b.length){return c.cloneNode(true)}b=stripEmptyTextNodes(b);if(b.length==1){return b[0].cloneNode(true)}return DIV(null,map(methodcaller("cloneNode",true),b))}function postJSON(a,b,c){return jQuery.post(a,b,c,"json")}function getJSON(a,b,c){return jQuery.get(a,b,c,"json")}CubicWeb.provide("ajax.js");jQuery(document).ready(function(){jQuery(CubicWeb).bind("facets-content-loaded",onFacetContentLoaded);jQuery(CubicWeb).bind("facets-content-loading",onFacetFiltering);jQuery(CubicWeb).bind("timeframe-changed",updateBand)});function showFacetLoading(f){var d=200;var c=100;var a=jQuery("#facetLoading");var e=jQuery("#"+f);var b=e.offset().left+(e.width()-d)/2;e.fadeTo("normal",0.2);a.css("left",b).show()}function onFacetFiltering(a,b){artItemEventSource.clear();showFacetLoading(b)}function onFacetContentLoaded(d,e,c,a,b){jQuery("#facetLoading").hide();CubicWeb._currentFacetsRql=c}jQuery(document).ready(function(){if(jQuery("div.facetBody").length){document.body.appendChild(DIV({id:"facetLoading"},IMG({src:baseuri()+"data/loading.gif"})));reorderFacetsItems()}});function _aiUrl(c,d,a){var b;if(CubicWeb._currentFacetsRql){b=baseuri()+"view?rql="+CubicWeb._currentFacetsRql}else{if(typeof"ai_rql"!="undefined"){b=baseuri()+"view?rql="+ai_rql}else{b=document.location.href;if(b.indexOf("?")==-1){b+="?"}}}b+=("&vid="+a+"&__notemplate=1&mindate="+c.getFullYear()+"&maxdate="+d.getFullYear());return b}function updateBand(b,c,d){var a=_aiUrl(c,d,"timeline-json");jQuery("div.timeline-message-container").show();Timeline.loadJSON(a,function(g,f){jQuery("div.timeline-message-container").hide();artItemEventSource.loadJSON(g,f);var e=tl._bands[0];e._paintEvents()})}CubicWeb.require("htmlhelpers.js");CubicWeb.require("ajax.js");function copyParam(d,a,c){var b=findValue(d[0],c);if(b>-1){a[c]=d[1][b]}}function facetFormContent(b){var c=[];var a=[];jQuery(b).find(".facet").each(function(){var d=jQuery(this).find(".facetTitle").attr("cubicweb:facetName");var e=jQuery(this).find(".facetValueSelected").each(function(f){c.push(d);a.push(this.getAttribute("cubicweb:value"))})});jQuery(b).find("input").each(function(){c.push(this.name);a.push(this.value)});jQuery(b).find("select option[selected]").each(function(){c.push(this.parentNode.name);a.push(this.value)});return[c,a]}function buildRQL(h,a,e,g){jQuery(CubicWeb).trigger("facets-content-loading",[h,a,e,g]);var c=getNode(h+"Form");var b=facetFormContent(c);b[0].push("facetargs");b[1].push(g);var f=asyncRemoteExec("filter_build_rql",b[0],b[1]);f.addCallback(function(i){var m=i[0];var l=jQuery("#facetBkLink");if(l.length){var k=l.attr("cubicweb:target")+"&path=view?rql="+m;if(a){k+="&vid="+a}l.attr("href",k)}var o=i[1];var j=g;var p=jQuery("#"+h).attr("cubicweb:displayactions");if(p){j.displayactions=p}if(e){j.paginate="1"}copyParam(b,j,"vid");j.divid=h;copyParam(b,j,"divid");copyParam(b,j,"subvid");replacePageChunk(h,m,a,j,true,function(){jQuery(CubicWeb).trigger("facets-content-loaded",[h,m,a,j])});if(e){if(jQuery("#edit_box").length){reloadComponent("edit_box",m,"boxes","edit_box")}if(jQuery("#breadcrumbs").length){reloadComponent("breadcrumbs",m,"components","breadcrumbs")}}var q=asyncRemoteExec("filter_select_content",o,m);q.addCallback(function(d){for(facetId in d){var r=d[facetId];jqNode(facetId).find(".facetCheckBox").each(function(){var s=this.getAttribute("cubicweb:value");if(!r.contains(s)){if(!jQuery(this).hasClass("facetValueDisabled")){jQuery(this).addClass("facetValueDisabled")}}else{if(jQuery(this).hasClass("facetValueDisabled")){jQuery(this).removeClass("facetValueDisabled")}}})}})})}var SELECTED_IMG=baseuri()+"data/black-check.png";var UNSELECTED_IMG=baseuri()+"data/no-check-no-border.png";var UNSELECTED_BORDER_IMG=baseuri()+"data/black-uncheck.png";function initFacetBoxEvents(a){a=a||document;jQuery(a).find("form").each(function(){var c=jQuery(this);var b=c.attr("cubicweb:facetargs");if(b!==undefined){c.submit(function(){buildRQL.apply(null,evalJSON(c.attr("cubicweb:facetargs")));return false});c.find("div.facet").each(function(){var d=jQuery(this);d.find("div.facetCheckBox").each(function(e){this.setAttribute("cubicweb:idx",e)});d.find("div.facetCheckBox").click(function(){var k=jQuery(this);if(k.hasClass("facetValueSelected")){k.removeClass("facetValueSelected");k.find("img").each(function(l){if(this.getAttribute("cubicweb:unselimg")){this.setAttribute("src",UNSELECTED_BORDER_IMG);this.setAttribute("alt",(_("not selected")))}else{this.setAttribute("src",UNSELECTED_IMG);this.setAttribute("alt",(_("not selected")))}});var g=parseInt(k.attr("cubicweb:idx"));if(g>0){var e=jQuery.grep(d.find(".facetValueSelected"),function(m){var l=parseInt(m.getAttribute("cubicweb:idx"));return l>g}).length;g+=e;var i=this.parentNode;var f=jQuery(i).find(".facetCheckBox:nth("+g+")");if(!(f.length==1&&e==0)){f.after(this)}}}else{var j=d.find(".facetValueSelected:last");if(j.length){j.after(this)}else{var i=this.parentNode;jQuery(i).prepend(this)}jQuery(this).addClass("facetValueSelected");var h=jQuery(this).find("img");h.attr("src",SELECTED_IMG).attr("alt",(_("selected")))}buildRQL.apply(null,evalJSON(c.attr("cubicweb:facetargs")));d.find(".facetBody").animate({scrollTop:0},"")});d.find("select.facetOperator").change(function(){var e=d.find("div.facetValueSelected").length;if(e>=2){buildRQL.apply(null,evalJSON(c.attr("cubicweb:facetargs")))}});d.find("div.facetTitle").click(function(){d.find("div.facetBody").toggleClass("hidden").toggleClass("opened");jQuery(this).toggleClass("opened")})})}})}function reorderFacetsItems(a){a=a||document;jQuery(a).find("form").each(function(){var b=jQuery(this);if(b.attr("cubicweb:facetargs")){b.find("div.facet").each(function(){var d=jQuery(this);var c=null;d.find("div.facetCheckBox").each(function(e){var g=jQuery(this);if(g.hasClass("facetValueSelected")){if(c){c.after(this)}else{var f=this.parentNode;jQuery(f).prepend(this)}c=g}})})}})}jQuery(document).ready(function(){initFacetBoxEvents()});CubicWeb.provide("facets.js");Widgets={};function buildWidget(b){var a=Widgets[b.getAttribute("cubicweb:wdgtype")];if(a){var c=new a(b)}}function buildWidgets(a){a=a||document;jQuery(a).find(".widget").each(function(){if(this.getAttribute("cubicweb:loadtype")=="auto"){buildWidget(this)}})}jQuery(document).ready(function(){buildWidgets()});Widgets.SuggestField=defclass("SuggestField",null,{__init__:function(d,c){var e=d.getAttribute("cubicweb:multi")||"no";c=c||{};c.multiple=(e=="yes")?true:false;var a=d.getAttribute("cubicweb:dataurl");var f=postJSON;if(c.method=="get"){f=function(g,h,i){jQuery.get(g,h,function(j){i(evalJSON(j))})}}var b=this;f(a,null,function(g){if(g.length&&g[0].length==2){c.formatItem=function(h){return h[1]};b.hideRealValue(d);b.setCurrentValue(d,g)}jQuery(d).autocomplete(g,c)})},hideRealValue:function(a){var b=INPUT({type:"hidden",name:a.name,value:a.value});a.parentNode.appendChild(b);jQuery(a).removeAttr("name").bind("result",function(c,d,c){b.value=d[0]})},setCurrentValue:function(d,e){var a=d.value;if(!d.value){return}for(var b=0,c=e.length;b<c;b++){var f=e[b];if(f[0]==a){d.value=f[1];return}}}});Widgets.StaticFileSuggestField=defclass("StaticSuggestField",[Widgets.SuggestField],{__init__:function(a){Widgets.SuggestField.__init__(this,a,{method:"get"})}});Widgets.RestrictedSuggestField=defclass("RestrictedSuggestField",[Widgets.SuggestField],{__init__:function(a){Widgets.SuggestField.__init__(this,a,{mustMatch:true})}});Widgets.SuggestForm=defclass("SuggestForm",null,{__init__:function(a,c,b,e,d){this.validatefunc=e||noop;this.sgfield=new Widgets.BaseSuggestField(a,c,b,d);this.oklabel=d.oklabel||"ok";this.cancellabel=d.cancellabel||"cancel";bindMethods(this);connect(this.sgfield,"validate",this,this.entryValidated)},show:function(a){var b=this.sgfield.builddom();var c=DIV({"class":"sgformbuttons"},[A({href:"javascript: noop();",onclick:this.onValidateClicked},this.oklabel)," / ",A({href:"javascript: noop();",onclick:this.destroy},escapeHTML(this.cancellabel))]);var d=DIV({"class":"sgform"},[b,c]);appendChildNodes(a,d);this.sgfield.textinput.focus();this.formnode=d;return d},destroy:function(){signal(this,"destroy");this.sgfield.destroy();removeElement(this.formnode)},onValidateClicked:function(){this.validatefunc(this,this.sgfield.taglist())},entryValidated:function(b,a){this.validatefunc(this,a)}});function toggleTree(c){var a=jQuery(this);var b=a.attr("cubicweb:loadurl");a.find("ul.placeholder").remove();if(b){a.loadxhtml(b,{callback:function(d){a.removeAttr("cubicweb:loadurl");jQuery(d).treeview({toggle:toggleTree,prerendered:true});return null}},"post","append")}}Widgets.TreeView=defclass("TreeView",null,{__init__:function(a){jQuery(a).treeview({toggle:toggleTree,prerendered:true})}});Widgets.TimelineWidget=defclass("TimelineWidget",null,{__init__:function(d){var g=DIV({id:"tl",style:"height: 200px; border: 1px solid #ccc;"});d.appendChild(g);var a=d.getAttribute("cubicweb:tlunit")||"YEAR";var e=new Timeline.DefaultEventSource();var f={eventPainter:Timeline.CubicWebEventPainter,eventSource:e,width:"100%",intervalUnit:Timeline.DateTime[a.toUpperCase()],intervalPixels:100};var c=[Timeline.createBandInfo(f)];var b=Timeline.create(g,c);var h=d.getAttribute("cubicweb:loadurl");Timeline.loadJSON(h,function(j,i){e.loadJSON(j,i)})}});Widgets.TemplateTextField=defclass("TemplateTextField",null,{__init__:function(a){this.variables=getNodeAttribute(a,"cubicweb:variables").split(",");this.options={name:a.getAttribute("cubicweb:inputid"),rows:a.getAttribute("cubicweb:rows")||40,cols:a.getAttribute("cubicweb:cols")||80};this.errorField=DIV({"class":"errorMessage"});this.textField=TEXTAREA(this.options);jQuery(this.textField).bind("keyup",{self:this},this.highlightInvalidVariables);jQuery("#substitutions").prepend(this.errorField);jQuery("#substitutions .errorMessage").hide();a.appendChild(this.textField)},highlightInvalidVariables:function(d){var a=d.data.self;var h=a.textField.value;var g=[];var b=0;var f=null;var e=/%\((\w+)\)s/g;while(f=e.exec(h)){if(!a.variables.contains(f[1])){g.push(f[1])}b++;if(b>5){break}}var c="";if(g.length){c="Detected invalid variables : "+", ".join(g);jQuery("#substitutions .errorMessage").show()}else{jQuery("#substitutions .errorMessage").hide()}a.errorField.innerHTML=c}});Widgets.AddComboBox=defclass("AddComboBox",null,{__init__:function(a){jQuery("#add_newopt").click(function(){var b=jQuery("#newopt").val();if(!b){return false}name=a.getAttribute("name").split(":");this.rel=name[0];this.eid_to=name[1];this.etype_to=a.getAttribute("cubicweb:etype_to");this.etype_from=a.getAttribute("cubicweb:etype_from");var c=asyncRemoteExec("add_and_link_new_entity",this.etype_to,this.rel,this.eid_to,this.etype_from,"new_val");c.addCallback(function(d){jQuery(a).find("option[selected]").removeAttr("selected");var e=OPTION({value:d,selected:"selected"},value=b);a.appendChild(e)});c.addErrback(function(d){log("xxx =",d)})})}});CubicWeb.provide("widgets.js");Widgets.GMapWidget=defclass("GMapWidget",null,{__init__:function(b){if(GBrowserIsCompatible()){var c=b.getAttribute("cubicweb:uselabel");var e=true;if(c){if(c=="True"){e=true}else{e=false}}var d=new GMap2(b);d.addControl(new GSmallMapControl());var f=b.getAttribute("cubicweb:loadurl");var a=this;jQuery.getJSON(f,function(j){if(j.center){var k=j.zoomlevel;d.setCenter(new GLatLng(j.center.latitude,j.center.longitude),k)}for(var h=0;h<j.markers.length;h++){var g=j.markers[h];a.createMarker(d,g,h+1,e)}});jQuery(b).after(this.legendBox)}else{jQuery.unload(GUnload)}},createMarker:function(g,b,c,f){var a=new GLatLng(b.latitude,b.longitude);var d=new GIcon();d.image=b.icon[0];d.iconSize=new GSize(b.icon[1][0],b.icon[1][1]);d.iconAnchor=new GPoint(b.icon[2][0],b.icon[2][1]);if(b.icon[3]){d.shadow4=b.icon[3]}if(typeof LabeledMarker=="undefined"){var e=new GMarker(a,{icon:d,title:b.title})}else{var e=new LabeledMarker(a,{icon:d,title:b.title,labelText:f?"<strong>"+c+"</strong>":"",labelOffset:new GSize(2,-32)})}g.addOverlay(e);GEvent.addListener(e,"click",function(){jQuery.post(b.bubbleUrl,function(h){g.openInfoWindowHtml(a,h)})})}});var SimileAjax_urlPrefix=baseuri()+"data/";var Timeline_urlPrefix=baseuri()+"data/";if(typeof SimileAjax=="undefined"){var SimileAjax={loaded:false,loadingScriptsCount:0,error:null,params:{bundle:"true"}};SimileAjax.Platform=new Object();var getHead=function(a){return a.getElementsByTagName("head")[0]};SimileAjax.findScript=function(g,c){var f=g.documentElement.getElementsByTagName("head");for(var d=0;d<f.length;d++){var e=f[d].firstChild;while(e!=null){if(e.nodeType==1&&e.tagName.toLowerCase()=="script"){var a=e.src;var b=a.indexOf(c);if(b>=0){return a}}e=e.nextSibling}}return null};SimileAjax.includeJavascriptFile=function(g,c,a,h){a=a||"";if(g.body==null){try{var d="'"+a.replace(/'/g,"&apos")+"'";g.write("<script src='"+c+"' onerror="+d+(h?" charset='"+h+"'":"")+" type='text/javascript'>"+a+"<\/script>");return}catch(f){}}var b=g.createElement("script");if(a){try{b.innerHTML=a}catch(f){}b.setAttribute("onerror",a)}if(h){b.setAttribute("charset",h)}b.type="text/javascript";b.language="JavaScript";b.src=c;return getHead(g).appendChild(b)};SimileAjax.includeJavascriptFiles=function(d,a,c){for(var b=0;b<c.length;b++){SimileAjax.includeJavascriptFile(d,a+c[b])}SimileAjax.loadingScriptsCount+=c.length};SimileAjax.includeCssFile=function(d,a){if(d.body==null){try{d.write("<link rel='stylesheet' href='"+a+"' type='text/css'/>");return}catch(c){}}var b=d.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",a);getHead(d).appendChild(b)};SimileAjax.includeCssFiles=function(d,a,c){for(var b=0;b<c.length;b++){SimileAjax.includeCssFile(d,a+c[b])}};SimileAjax.prefixURLs=function(d,a,b){for(var c=0;c<b.length;c++){d.push(a+b[c])}};SimileAjax.parseURLParameters=function(d,o,k){o=o||{};k=k||{};if(typeof d=="undefined"){d=location.href}var c=d.indexOf("?");if(c<0){return o}d=(d+"#").slice(c+1,d.indexOf("#"));var g=d.split("&"),f,m={};var a=window.decodeURIComponent||unescape;for(var j=0;f=g[j];j++){var p=f.indexOf("=");var b=a(f.slice(0,p));var e=m[b];if(typeof e=="undefined"){e=[]}else{if(!(e instanceof Array)){e=[e]}}m[b]=e.concat(a(f.slice(p+1)))}for(var j in m){if(!m.hasOwnProperty(j)){continue}var l=k[j]||String;var h=m[j];if(!(h instanceof Array)){h=[h]}if(l===Boolean&&h[0]=="false"){o[j]=false}else{o[j]=l.apply(this,h)}}return o};(function(){var c=["jquery-1.2.6.js","platform.js","debug.js","xmlhttp.js","json.js","dom.js","graphics.js","date-time.js","string.js","html.js","data-structure.js","units.js","ajax.js","history.js","window-manager.js"];var a=["graphics.css"];if(typeof SimileAjax_urlPrefix=="string"){SimileAjax.urlPrefix=SimileAjax_urlPrefix}else{var b=SimileAjax.findScript(document,"simile-ajax-api.js");if(b==null){SimileAjax.error=new Error("Failed to derive URL prefix for Simile Ajax API code files");return}SimileAjax.urlPrefix=b.substr(0,b.indexOf("simile-ajax-api.js"))}SimileAjax.parseURLParameters(b,SimileAjax.params,{bundle:Boolean});SimileAjax.loaded=true})()}SimileAjax.jQuery=jQuery;if(typeof window["$"]=="undefined"){window.$=SimileAjax.jQuery}SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};(function(){var c=navigator.appName.toLowerCase();var a=navigator.userAgent.toLowerCase();SimileAjax.Platform.os.isMac=(a.indexOf("mac")!=-1);SimileAjax.Platform.os.isWin=(a.indexOf("win")!=-1);SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(a.indexOf("95")!=-1||a.indexOf("98")!=-1||a.indexOf("nt")!=-1||a.indexOf("win32")!=-1||a.indexOf("32bit")!=-1);SimileAjax.Platform.os.isUnix=(a.indexOf("x11")!=-1);SimileAjax.Platform.browser.isIE=(c.indexOf("microsoft")!=-1);SimileAjax.Platform.browser.isNetscape=(c.indexOf("netscape")!=-1);SimileAjax.Platform.browser.isMozilla=(a.indexOf("mozilla")!=-1);SimileAjax.Platform.browser.isFirefox=(a.indexOf("firefox")!=-1);SimileAjax.Platform.browser.isOpera=(c.indexOf("opera")!=-1);SimileAjax.Platform.browser.isSafari=(c.indexOf("safari")!=-1);var e=function(g){var f=g.split(".");SimileAjax.Platform.browser.majorVersion=parseInt(f[0]);SimileAjax.Platform.browser.minorVersion=parseInt(f[1])};var b=function(h,g,j){var f=h.indexOf(g,j);return f>=0?f:h.length};if(SimileAjax.Platform.browser.isMozilla){var d=a.indexOf("mozilla/");if(d>=0){e(a.substring(d+8,b(a," ",d)))}}if(SimileAjax.Platform.browser.isIE){var d=a.indexOf("msie ");if(d>=0){e(a.substring(d+5,b(a,";",d)))}}if(SimileAjax.Platform.browser.isNetscape){var d=a.indexOf("rv:");if(d>=0){e(a.substring(d+3,b(a,")",d)))}}if(SimileAjax.Platform.browser.isFirefox){var d=a.indexOf("firefox/");if(d>=0){e(a.substring(d+8,b(a," ",d)))}}if(!("localeCompare" in String.prototype)){String.prototype.localeCompare=function(f){if(this<f){return -1}else{if(this>f){return 1}else{return 0}}}}})();SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale};SimileAjax.Debug={silent:false};SimileAjax.Debug.log=function(b){var a;if("console" in window&&"log" in window.console){a=function(c){console.log(c)}}else{a=function(c){if(!SimileAjax.Debug.silent){alert(c)}}}SimileAjax.Debug.log=a;a(b)};SimileAjax.Debug.warn=function(b){var a;if("console" in window&&"warn" in window.console){a=function(c){console.warn(c)}}else{a=function(c){if(!SimileAjax.Debug.silent){alert(c)}}}SimileAjax.Debug.warn=a;a(b)};SimileAjax.Debug.exception=function(b,d){var a,c=SimileAjax.parseURLParameters();if(c.errors=="throw"||SimileAjax.params.errors=="throw"){a=function(f,e){throw (f)}}else{if("console" in window&&"error" in window.console){a=function(f,e){if(e!=null){console.error(e+" %o",f)}else{console.error(f)}throw (f)}}else{a=function(f,e){if(!SimileAjax.Debug.silent){alert("Caught exception: "+e+"\n\nDetails: "+("description" in f?f.description:f))}throw (f)}}}SimileAjax.Debug.exception=a;a(b,d)};SimileAjax.Debug.objectToString=function(a){return SimileAjax.Debug._objectToString(a,"")};SimileAjax.Debug._objectToString=function(d,a){var c=a+" ";if(typeof d=="object"){var b="{";for(e in d){b+=c+e+": "+SimileAjax.Debug._objectToString(d[e],c)+"\n"}b+=a+"}";return b}else{if(typeof d=="array"){var b="[";for(var e=0;e<d.length;e++){b+=SimileAjax.Debug._objectToString(d[e],c)+"\n"}b+=a+"]";return b}else{return d}}};SimileAjax.XmlHttp=new Object();SimileAjax.XmlHttp._onReadyStateChange=function(a,d,b){switch(a.readyState){case 4:try{if(a.status==0||a.status==200){if(b){b(a)}}else{if(d){d(a.statusText,a.status,a)}}}catch(c){SimileAjax.Debug.exception("XmlHttp: Error handling onReadyStateChange",c)}break}};SimileAjax.XmlHttp._createRequest=function(){if(SimileAjax.Platform.browser.isIE){var a=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];for(var b=0;b<a.length;b++){try{var c=a[b];var d=function(){return new ActiveXObject(c)};var h=d();SimileAjax.XmlHttp._createRequest=d;return h}catch(g){}}}try{var d=function(){return new XMLHttpRequest()};var h=d();SimileAjax.XmlHttp._createRequest=d;return h}catch(g){throw new Error("Failed to create an XMLHttpRequest object")}};SimileAjax.XmlHttp.get=function(a,d,c){var b=SimileAjax.XmlHttp._createRequest();b.open("GET",a,true);b.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(b,d,c)};b.send(null)};SimileAjax.XmlHttp.post=function(b,a,e,d){var c=SimileAjax.XmlHttp._createRequest();c.open("POST",b,true);c.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(c,e,d)};c.send(a)};SimileAjax.XmlHttp._forceXML=function(a){try{a.overrideMimeType("text/xml")}catch(b){a.setrequestheader("Content-Type","text/xml")}};SimileAjax.JSON=new Object();(function(){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var s={array:function(x){var a=["["],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=","}a[a.length]=v;b=true}}}a[a.length]="]";return a.join("")},"boolean":function(x){return String(x)},"null":function(x){return"null"},number:function(x){return isFinite(x)?String(x):"null"},object:function(x){if(x){if(x instanceof Array){return s.array(x)}var a=["{"],b,f,i,v;for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=","}a.push(s.string(i),":",v);b=true}}}a[a.length]="}";return a.join("")}return"null"},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})}return'"'+x+'"'}};SimileAjax.JSON.toJSONString=function(o){if(o instanceof Object){return s.object(o)}else{if(o instanceof Array){return s.array(o)}else{return o.toString()}}};SimileAjax.JSON.parseJSON=function(){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+this+")")}catch(e){return false}}})();SimileAjax.DOM=new Object();SimileAjax.DOM.registerEventWithObject=function(c,a,d,b){SimileAjax.DOM.registerEvent(c,a,function(f,e,g){return d[b].call(d,f,e,g)})};SimileAjax.DOM.registerEvent=function(c,b,d){var a=function(e){e=(e)?e:((event)?event:null);if(e){var f=(e.target)?e.target:((e.srcElement)?e.srcElement:null);if(f){f=(f.nodeType==1||f.nodeType==9)?f:f.parentNode}return d(c,e,f)}return true};if(SimileAjax.Platform.browser.isIE){c.attachEvent("on"+b,a)}else{c.addEventListener(b,a,false)}};SimileAjax.DOM.getPageCoordinates=function(b){var e=0;var d=0;if(b.nodeType!=1){b=b.parentNode}var c=b;while(c!=null){e+=c.offsetLeft;d+=c.offsetTop;c=c.offsetParent}var a=document.body;while(b!=null&&b!=a){if("scrollLeft" in b){e-=b.scrollLeft;d-=b.scrollTop}b=b.parentNode}return{left:e,top:d}};SimileAjax.DOM.getSize=function(b){var a=this.getStyle(b,"width");var c=this.getStyle(b,"height");if(a.indexOf("px")>-1){a=a.replace("px","")}if(c.indexOf("px")>-1){c=c.replace("px","")}return{w:a,h:c}};SimileAjax.DOM.getStyle=function(b,a){if(b.currentStyle){var c=b.currentStyle[a]}else{if(window.getComputedStyle){var c=document.defaultView.getComputedStyle(b,null).getPropertyValue(a)}else{var c=""}}return c};SimileAjax.DOM.getEventRelativeCoordinates=function(a,b){if(SimileAjax.Platform.browser.isIE){if(a.type=="mousewheel"){var c=SimileAjax.DOM.getPageCoordinates(b);return{x:a.clientX-c.left,y:a.clientY-c.top}}else{return{x:a.offsetX,y:a.offsetY}}}else{var c=SimileAjax.DOM.getPageCoordinates(b);if((a.type=="DOMMouseScroll")&&SimileAjax.Platform.browser.isFirefox&&(SimileAjax.Platform.browser.majorVersion==2)){return{x:a.screenX-c.left,y:a.screenY-c.top}}else{return{x:a.pageX-c.left,y:a.pageY-c.top}}}};SimileAjax.DOM.getEventPageCoordinates=function(a){if(SimileAjax.Platform.browser.isIE){return{x:a.clientX+document.body.scrollLeft,y:a.clientY+document.body.scrollTop}}else{return{x:a.pageX,y:a.pageY}}};SimileAjax.DOM.hittest=function(a,c,b){return SimileAjax.DOM._hittest(document.body,a,c,b)};SimileAjax.DOM._hittest=function(c,o,m,h){var p=c.childNodes;outer:for(var g=0;g<p.length;g++){var a=p[g];for(var f=0;f<h.length;f++){if(a==h[f]){continue outer}}if(a.offsetWidth==0&&a.offsetHeight==0){var b=SimileAjax.DOM._hittest(a,o,m,h);if(b!=a){return b}}else{var l=0;var e=0;var d=a;while(d){l+=d.offsetTop;e+=d.offsetLeft;d=d.offsetParent}if(e<=o&&l<=m&&(o-e)<a.offsetWidth&&(m-l)<a.offsetHeight){return SimileAjax.DOM._hittest(a,o,m,h)}else{if(a.nodeType==1&&a.tagName=="TR"){var k=SimileAjax.DOM._hittest(a,o,m,h);if(k!=a){return k}}}}}return c};SimileAjax.DOM.cancelEvent=function(a){a.returnValue=false;a.cancelBubble=true;if("preventDefault" in a){a.preventDefault()}};SimileAjax.DOM.appendClassName=function(c,d){var b=c.className.split(" ");for(var a=0;a<b.length;a++){if(b[a]==d){return}}b.push(d);c.className=b.join(" ")};SimileAjax.DOM.createInputElement=function(a){var b=document.createElement("div");b.innerHTML="<input type='"+a+"' />";return b.firstChild};SimileAjax.DOM.createDOMFromTemplate=function(b){var a={};a.elmt=SimileAjax.DOM._createDOMFromTemplate(b,a,null);return a};SimileAjax.DOM._createDOMFromTemplate=function(a,j,e){if(a==null){return null}else{if(typeof a!="object"){var d=document.createTextNode(a);if(e!=null){e.appendChild(d)}return d}else{var c=null;if("tag" in a){var k=a.tag;if(e!=null){if(k=="tr"){c=e.insertRow(e.rows.length)}else{if(k=="td"){c=e.insertCell(e.cells.length)}}}if(c==null){c=k=="input"?SimileAjax.DOM.createInputElement(a.type):document.createElement(k);if(e!=null){e.appendChild(c)}}}else{c=a.elmt;if(e!=null){e.appendChild(c)}}for(var b in a){var g=a[b];if(b=="field"){j[g]=c}else{if(b=="className"){c.className=g}else{if(b=="id"){c.id=g}else{if(b=="title"){c.title=g}else{if(b=="type"&&c.tagName=="input"){}else{if(b=="style"){for(n in g){var h=g[n];if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat"}c.style[n]=h}}else{if(b=="children"){for(var f=0;f<g.length;f++){SimileAjax.DOM._createDOMFromTemplate(g[f],j,c)}}else{if(b!="tag"&&b!="elmt"){c.setAttribute(b,g)}}}}}}}}}return c}}};SimileAjax.DOM._cachedParent=null;SimileAjax.DOM.createElementFromString=function(a){if(SimileAjax.DOM._cachedParent==null){SimileAjax.DOM._cachedParent=document.createElement("div")}SimileAjax.DOM._cachedParent.innerHTML=a;return SimileAjax.DOM._cachedParent.firstChild};SimileAjax.DOM.createDOMFromString=function(a,c,d){var b=typeof a=="string"?document.createElement(a):a;b.innerHTML=c;var e={elmt:b};SimileAjax.DOM._processDOMChildrenConstructedFromString(e,b,d!=null?d:{});return e};SimileAjax.DOM._processDOMConstructedFromString=function(d,a,b){var e=a.id;if(e!=null&&e.length>0){a.removeAttribute("id");if(e in b){var c=a.parentNode;c.insertBefore(b[e],a);c.removeChild(a);d[e]=b[e];return}else{d[e]=a}}if(a.hasChildNodes()){SimileAjax.DOM._processDOMChildrenConstructedFromString(d,a,b)}};SimileAjax.DOM._processDOMChildrenConstructedFromString=function(e,b,d){var c=b.firstChild;while(c!=null){var a=c.nextSibling;if(c.nodeType==1){SimileAjax.DOM._processDOMConstructedFromString(e,c,d)}c=a}};SimileAjax.Graphics=new Object();SimileAjax.Graphics.pngIsTranslucent=(!SimileAjax.Platform.browser.isIE)||(SimileAjax.Platform.browser.majorVersion>6);if(!SimileAjax.Graphics.pngIsTranslucent){SimileAjax.includeCssFile(document,SimileAjax.urlPrefix+"styles/graphics-ie6.css")}SimileAjax.Graphics._createTranslucentImage1=function(a,c){var b=document.createElement("img");b.setAttribute("src",a);if(c!=null){b.style.verticalAlign=c}return b};SimileAjax.Graphics._createTranslucentImage2=function(a,c){var b=document.createElement("img");b.style.width="1px";b.style.height="1px";b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a+"', sizingMethod='image')";b.style.verticalAlign=(c!=null)?c:"middle";return b};SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2;SimileAjax.Graphics._createTranslucentImageHTML1=function(a,b){return'<img src="'+a+'"'+(b!=null?' style="vertical-align: '+b+';"':"")+" />"};SimileAjax.Graphics._createTranslucentImageHTML2=function(a,c){var b="width: 1px; height: 1px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a+"', sizingMethod='image');"+(c!=null?" vertical-align: "+c+";":"");return"<img src='"+a+"' style=\""+b+'" />'};SimileAjax.Graphics.createTranslucentImageHTML=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImageHTML1:SimileAjax.Graphics._createTranslucentImageHTML2;SimileAjax.Graphics.setOpacity=function(b,a){if(SimileAjax.Platform.browser.isIE){b.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+a+")"}else{var c=(a/100).toString();b.style.opacity=c;b.style.MozOpacity=c}};SimileAjax.Graphics.bubbleConfig={containerCSSClass:"simileAjax-bubble-container",innerContainerCSSClass:"simileAjax-bubble-innerContainer",contentContainerCSSClass:"simileAjax-bubble-contentContainer",borderGraphicSize:50,borderGraphicCSSClassPrefix:"simileAjax-bubble-border-",arrowGraphicTargetOffset:33,arrowGraphicLength:100,arrowGraphicWidth:49,arrowGraphicCSSClassPrefix:"simileAjax-bubble-arrow-",closeGraphicCSSClass:"simileAjax-bubble-close",extraPadding:20};SimileAjax.Graphics.createBubbleForContentAndPoint=function(f,d,c,a,b,e){if(typeof a!="number"){a=300}if(typeof e!="number"){e=0}f.style.position="absolute";f.style.left="-5000px";f.style.top="0px";f.style.width=a+"px";document.body.appendChild(f);window.setTimeout(function(){var j=f.scrollWidth+10;var g=f.scrollHeight+10;var i=0;if(e>0&&g>e){g=e;i=j-25}var h=SimileAjax.Graphics.createBubbleForPoint(d,c,j,g,b);document.body.removeChild(f);f.style.position="static";f.style.left="";f.style.top="";if(i>0){var k=document.createElement("div");f.style.width="";k.style.width=i+"px";k.appendChild(f);h.content.appendChild(k)}else{f.style.width=j+"px";h.content.appendChild(f)}},200)};SimileAjax.Graphics.createBubbleForPoint=function(b,a,k,m,d){k=parseInt(k,10);m=parseInt(m,10);var e=SimileAjax.Graphics.bubbleConfig;var o=SimileAjax.Graphics.pngIsTranslucent?"pngTranslucent":"pngNotTranslucent";var l=k+2*e.borderGraphicSize;var q=m+2*e.borderGraphicSize;var p=function(t){return t+" "+t+"-"+o};var h=document.createElement("div");h.className=p(e.containerCSSClass);h.style.width=k+"px";h.style.height=m+"px";var f=document.createElement("div");f.className=p(e.innerContainerCSSClass);h.appendChild(f);var i=function(){if(!j._closed){document.body.removeChild(j._div);j._doc=null;j._div=null;j._content=null;j._closed=true}};var j={_closed:false};var s=SimileAjax.WindowManager.pushLayer(i,true,h);j._div=h;j.close=function(){SimileAjax.WindowManager.popLayer(s)};var g=function(u){var t=document.createElement("div");t.className=p(e.borderGraphicCSSClassPrefix+u);f.appendChild(t)};g("top-left");g("top-right");g("bottom-left");g("bottom-right");g("left");g("right");g("top");g("bottom");var c=document.createElement("div");c.className=p(e.contentContainerCSSClass);f.appendChild(c);j.content=c;var r=document.createElement("div");r.className=p(e.closeGraphicCSSClass);f.appendChild(r);SimileAjax.WindowManager.registerEventWithObject(r,"click",j,"close");(function(){var B=SimileAjax.Graphics.getWindowDimensions();var v=B.w;var t=B.h;var w=Math.ceil(e.arrowGraphicWidth/2);var z=function(C){var D=document.createElement("div");D.className=p(e.arrowGraphicCSSClassPrefix+"point-"+C);f.appendChild(D);return D};if(b-w-e.borderGraphicSize-e.extraPadding>0&&b+w+e.borderGraphicSize+e.extraPadding<v){var y=b-Math.round(k/2);y=b<(v/2)?Math.max(y,e.extraPadding+e.borderGraphicSize):Math.min(y,v-e.extraPadding-e.borderGraphicSize-k);if((d&&d=="top")||(!d&&(a-e.arrowGraphicTargetOffset-m-e.borderGraphicSize-e.extraPadding>0))){var u=z("down");u.style.left=(b-w-y)+"px";h.style.left=y+"px";h.style.top=(a-e.arrowGraphicTargetOffset-m)+"px";return}else{if((d&&d=="bottom")||(!d&&(a+e.arrowGraphicTargetOffset+m+e.borderGraphicSize+e.extraPadding<t))){var u=z("up");u.style.left=(b-w-y)+"px";h.style.left=y+"px";h.style.top=(a+e.arrowGraphicTargetOffset)+"px";return}}}var x=a-Math.round(m/2);x=a<(t/2)?Math.max(x,e.extraPadding+e.borderGraphicSize):Math.min(x,t-e.extraPadding-e.borderGraphicSize-m);if((d&&d=="left")||(!d&&(b-e.arrowGraphicTargetOffset-k-e.borderGraphicSize-e.extraPadding>0))){var u=z("right");u.style.top=(a-w-x)+"px";h.style.top=x+"px";h.style.left=(b-e.arrowGraphicTargetOffset-k)+"px"}else{var u=z("left");u.style.top=(a-w-x)+"px";h.style.top=x+"px";h.style.left=(b+e.arrowGraphicTargetOffset)+"px"}})();document.body.appendChild(h);return j};SimileAjax.Graphics.getWindowDimensions=function(){if(typeof window.innerHeight=="number"){return{w:window.innerWidth,h:window.innerHeight}}else{if(document.documentElement&&document.documentElement.clientHeight){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight}}else{if(document.body&&document.body.clientHeight){return{w:document.body.clientWidth,h:document.body.clientHeight}}}}};SimileAjax.Graphics.createMessageBubble=function(h){var g=h.createElement("div");if(SimileAjax.Graphics.pngIsTranslucent){var i=h.createElement("div");i.style.height="33px";i.style.background="url("+SimileAjax.urlPrefix+"images/message-top-left.png) top left no-repeat";i.style.paddingLeft="44px";g.appendChild(i);var c=h.createElement("div");c.style.height="33px";c.style.background="url("+SimileAjax.urlPrefix+"images/message-top-right.png) top right no-repeat";i.appendChild(c);var f=h.createElement("div");f.style.background="url("+SimileAjax.urlPrefix+"images/message-left.png) top left repeat-y";f.style.paddingLeft="44px";g.appendChild(f);var a=h.createElement("div");a.style.background="url("+SimileAjax.urlPrefix+"images/message-right.png) top right repeat-y";a.style.paddingRight="44px";f.appendChild(a);var d=h.createElement("div");a.appendChild(d);var b=h.createElement("div");b.style.height="55px";b.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat";b.style.paddingLeft="44px";g.appendChild(b);var e=h.createElement("div");e.style.height="55px";e.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat";b.appendChild(e)}else{g.style.border="2px solid #7777AA";g.style.padding="20px";g.style.background="white";SimileAjax.Graphics.setOpacity(g,90);var d=h.createElement("div");g.appendChild(d)}return{containerDiv:g,contentDiv:d}};SimileAjax.Graphics.createAnimation=function(b,e,d,c,a){return new SimileAjax.Graphics._Animation(b,e,d,c,a)};SimileAjax.Graphics._Animation=function(b,e,d,c,a){this.f=b;this.cont=(typeof a=="function")?a:function(){};this.from=e;this.to=d;this.current=e;this.duration=c;this.start=new Date().getTime();this.timePassed=0};SimileAjax.Graphics._Animation.prototype.run=function(){var b=this;window.setTimeout(function(){b.step()},50)};SimileAjax.Graphics._Animation.prototype.step=function(){this.timePassed+=50;var b=this.timePassed/this.duration;var a=-Math.cos(b*Math.PI)/2+0.5;var d=a*(this.to-this.from)+this.from;try{this.f(d,d-this.current)}catch(c){}this.current=d;if(this.timePassed<this.duration){this.run()}else{this.f(this.to,0);this["cont"]()}};SimileAjax.Graphics.createStructuredDataCopyButton=function(f,d,a,e){var g=document.createElement("div");g.style.position="relative";g.style.display="inline";g.style.width=d+"px";g.style.height=a+"px";g.style.overflow="hidden";g.style.margin="2px";if(SimileAjax.Graphics.pngIsTranslucent){g.style.background="url("+f+") no-repeat"}else{g.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+f+"', sizingMethod='image')"}var c;if(SimileAjax.Platform.browser.isIE){c="filter:alpha(opacity=0)"}else{c="opacity: 0"}g.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+c+"' />";var b=g.firstChild;b.style.width=d+"px";b.style.height=a+"px";b.onmousedown=function(h){h=(h)?h:((event)?event:null);if(h.button==2){b.value=e();b.select()}};return g};SimileAjax.Graphics.getWidthHeight=function(c){var a,b;if(c.getBoundingClientRect==null){a=c.offsetWidth;b=c.offsetHeight}else{var d=c.getBoundingClientRect();a=Math.ceil(d.right-d.left);b=Math.ceil(d.bottom-d.top)}return{width:a,height:b}};SimileAjax.Graphics.getFontRenderingContext=function(a,b){return new SimileAjax.Graphics._FontRenderingContext(a,b)};SimileAjax.Graphics._FontRenderingContext=function(a,b){this._elmt=a;this._elmt.style.visibility="hidden";if(typeof b=="string"){this._elmt.style.width=b}else{if(typeof b=="number"){this._elmt.style.width=b+"px"}}};SimileAjax.Graphics._FontRenderingContext.prototype.dispose=function(){this._elmt=null};SimileAjax.Graphics._FontRenderingContext.prototype.update=function(){this._elmt.innerHTML="A";this._lineHeight=this._elmt.offsetHeight};SimileAjax.Graphics._FontRenderingContext.prototype.computeSize=function(d,c){var b=this._elmt;b.innerHTML=d;b.className=c===undefined?"":c;var a=SimileAjax.Graphics.getWidthHeight(b);b.className="";return a};SimileAjax.Graphics._FontRenderingContext.prototype.getLineHeight=function(){return this._lineHeight};SimileAjax.DateTime=new Object();SimileAjax.DateTime.MILLISECOND=0;SimileAjax.DateTime.SECOND=1;SimileAjax.DateTime.MINUTE=2;SimileAjax.DateTime.HOUR=3;SimileAjax.DateTime.DAY=4;SimileAjax.DateTime.WEEK=5;SimileAjax.DateTime.MONTH=6;SimileAjax.DateTime.YEAR=7;SimileAjax.DateTime.DECADE=8;SimileAjax.DateTime.CENTURY=9;SimileAjax.DateTime.MILLENNIUM=10;SimileAjax.DateTime.EPOCH=-1;SimileAjax.DateTime.ERA=-2;SimileAjax.DateTime.gregorianUnitLengths=[];(function(){var c=SimileAjax.DateTime;var b=c.gregorianUnitLengths;b[c.MILLISECOND]=1;b[c.SECOND]=1000;b[c.MINUTE]=b[c.SECOND]*60;b[c.HOUR]=b[c.MINUTE]*60;b[c.DAY]=b[c.HOUR]*24;b[c.WEEK]=b[c.DAY]*7;b[c.MONTH]=b[c.DAY]*31;b[c.YEAR]=b[c.DAY]*365;b[c.DECADE]=b[c.YEAR]*10;b[c.CENTURY]=b[c.YEAR]*100;b[c.MILLENNIUM]=b[c.YEAR]*1000})();SimileAjax.DateTime._dateRegexp=new RegExp("^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$");SimileAjax.DateTime._timezoneRegexp=new RegExp("Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$");SimileAjax.DateTime._timeRegexp=new RegExp("^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$");SimileAjax.DateTime.setIso8601Date=function(i,g){var j=g.match(SimileAjax.DateTime._dateRegexp);if(!j){throw new Error("Invalid date string: "+g)}var b=(j[1]=="-")?-1:1;var k=b*j[2];var h=j[5];var c=j[7];var f=j[9];var a=j[11];var o=(j[13])?j[13]:1;i.setUTCFullYear(k);if(f){i.setUTCMonth(0);i.setUTCDate(Number(f))}else{if(a){i.setUTCMonth(0);i.setUTCDate(1);var m=i.getUTCDay();var l=(m)?m:7;var e=Number(o)+(7*Number(a));if(l<=4){i.setUTCDate(e+1-l)}else{i.setUTCDate(e+8-l)}}else{if(h){i.setUTCDate(1);i.setUTCMonth(h-1)}if(c){i.setUTCDate(c)}}}return i};SimileAjax.DateTime.setIso8601Time=function(g,c){var h=c.match(SimileAjax.DateTime._timeRegexp);if(!h){SimileAjax.Debug.warn("Invalid time string: "+c);return false}var a=h[1];var f=Number((h[3])?h[3]:0);var e=(h[5])?h[5]:0;var b=h[7]?(Number("0."+h[7])*1000):0;g.setUTCHours(a);g.setUTCMinutes(f);g.setUTCSeconds(e);g.setUTCMilliseconds(b);return g};SimileAjax.DateTime.timezoneOffset=new Date().getTimezoneOffset();SimileAjax.DateTime.setIso8601=function(b,a){var e=null;var f=(a.indexOf("T")==-1)?a.split(" "):a.split("T");SimileAjax.DateTime.setIso8601Date(b,f[0]);if(f.length==2){var c=f[1].match(SimileAjax.DateTime._timezoneRegexp);if(c){if(c[0]=="Z"){e=0}else{e=(Number(c[3])*60)+Number(c[5]);e*=((c[2]=="-")?1:-1)}f[1]=f[1].substr(0,f[1].length-c[0].length)}SimileAjax.DateTime.setIso8601Time(b,f[1])}if(e==null){e=b.getTimezoneOffset()}b.setTime(b.getTime()+e*60000);return b};SimileAjax.DateTime.parseIso8601DateTime=function(a){try{return SimileAjax.DateTime.setIso8601(new Date(0),a)}catch(b){return null}};SimileAjax.DateTime.parseGregorianDateTime=function(i){if(i==null){return null}else{if(i instanceof Date){return i}}var b=i.toString();if(b.length>0&&b.length<8){var c=b.indexOf(" ");if(c>0){var a=parseInt(b.substr(0,c));var g=b.substr(c+1);if(g.toLowerCase()=="bc"){a=1-a}}else{var a=parseInt(b)}var h=new Date(0);h.setUTCFullYear(a);return h}try{return new Date(Date.parse(b))}catch(f){return null}};SimileAjax.DateTime.roundDownToInterval=function(b,h,k,l,a){var e=k*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];var j=new Date(b.getTime()+e);var f=function(m){m.setUTCMilliseconds(0);m.setUTCSeconds(0);m.setUTCMinutes(0);m.setUTCHours(0)};var c=function(m){f(m);m.setUTCDate(1);m.setUTCMonth(0)};switch(h){case SimileAjax.DateTime.MILLISECOND:var i=j.getUTCMilliseconds();j.setUTCMilliseconds(i-(i%l));break;case SimileAjax.DateTime.SECOND:j.setUTCMilliseconds(0);var i=j.getUTCSeconds();j.setUTCSeconds(i-(i%l));break;case SimileAjax.DateTime.MINUTE:j.setUTCMilliseconds(0);j.setUTCSeconds(0);var i=j.getUTCMinutes();j.setTime(j.getTime()-(i%l)*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);break;case SimileAjax.DateTime.HOUR:j.setUTCMilliseconds(0);j.setUTCSeconds(0);j.setUTCMinutes(0);var i=j.getUTCHours();j.setUTCHours(i-(i%l));break;case SimileAjax.DateTime.DAY:f(j);break;case SimileAjax.DateTime.WEEK:f(j);var g=(j.getUTCDay()+7-a)%7;j.setTime(j.getTime()-g*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]);break;case SimileAjax.DateTime.MONTH:f(j);j.setUTCDate(1);var i=j.getUTCMonth();j.setUTCMonth(i-(i%l));break;case SimileAjax.DateTime.YEAR:c(j);var i=j.getUTCFullYear();j.setUTCFullYear(i-(i%l));break;case SimileAjax.DateTime.DECADE:c(j);j.setUTCFullYear(Math.floor(j.getUTCFullYear()/10)*10);break;case SimileAjax.DateTime.CENTURY:c(j);j.setUTCFullYear(Math.floor(j.getUTCFullYear()/100)*100);break;case SimileAjax.DateTime.MILLENNIUM:c(j);j.setUTCFullYear(Math.floor(j.getUTCFullYear()/1000)*1000);break}b.setTime(j.getTime()-e)};SimileAjax.DateTime.roundUpToInterval=function(d,f,c,a,b){var e=d.getTime();SimileAjax.DateTime.roundDownToInterval(d,f,c,a,b);if(d.getTime()<e){d.setTime(d.getTime()+SimileAjax.DateTime.gregorianUnitLengths[f]*a)}};SimileAjax.DateTime.incrementByInterval=function(b,e,a){a=(typeof a=="undefined")?0:a;var d=a*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];var c=new Date(b.getTime()+d);switch(e){case SimileAjax.DateTime.MILLISECOND:c.setTime(c.getTime()+1);break;case SimileAjax.DateTime.SECOND:c.setTime(c.getTime()+1000);break;case SimileAjax.DateTime.MINUTE:c.setTime(c.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);break;case SimileAjax.DateTime.HOUR:c.setTime(c.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]);break;case SimileAjax.DateTime.DAY:c.setUTCDate(c.getUTCDate()+1);break;case SimileAjax.DateTime.WEEK:c.setUTCDate(c.getUTCDate()+7);break;case SimileAjax.DateTime.MONTH:c.setUTCMonth(c.getUTCMonth()+1);break;case SimileAjax.DateTime.YEAR:c.setUTCFullYear(c.getUTCFullYear()+1);break;case SimileAjax.DateTime.DECADE:c.setUTCFullYear(c.getUTCFullYear()+10);break;case SimileAjax.DateTime.CENTURY:c.setUTCFullYear(c.getUTCFullYear()+100);break;case SimileAjax.DateTime.MILLENNIUM:c.setUTCFullYear(c.getUTCFullYear()+1000);break}b.setTime(c.getTime()-d)};SimileAjax.DateTime.removeTimeZoneOffset=function(b,a){return new Date(b.getTime()+a*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR])};SimileAjax.DateTime.getTimezone=function(){var a=new Date().getTimezoneOffset();return a/-60};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.startsWith=function(a){return this.length>=a.length&&this.substr(0,a.length)==a};String.prototype.endsWith=function(a){return this.length>=a.length&&this.substr(this.length-a.length)==a};String.substitute=function(b,d){var a="";var f=0;while(f<b.length-1){var c=b.indexOf("%",f);if(c<0||c==b.length-1){break}else{if(c>f&&b.charAt(c-1)=="\\"){a+=b.substring(f,c-1)+"%";f=c+1}else{var e=parseInt(b.charAt(c+1));if(isNaN(e)||e>=d.length){a+=b.substring(f,c+2)}else{a+=b.substring(f,c)+d[e].toString()}f=c+2}}}if(f<b.length){a+=b.substring(f)}return a};SimileAjax.HTML=new Object();SimileAjax.HTML._e2uHash={};(function(){var a=SimileAjax.HTML._e2uHash;a.nbsp="\u00A0[space]";a.iexcl="\u00A1";a.cent="\u00A2";a.pound="\u00A3";a.curren="\u00A4";a.yen="\u00A5";a.brvbar="\u00A6";a.sect="\u00A7";a.uml="\u00A8";a.copy="\u00A9";a.ordf="\u00AA";a.laquo="\u00AB";a.not="\u00AC";a.shy="\u00AD";a.reg="\u00AE";a.macr="\u00AF";a.deg="\u00B0";a.plusmn="\u00B1";a.sup2="\u00B2";a.sup3="\u00B3";a.acute="\u00B4";a.micro="\u00B5";a.para="\u00B6";a.middot="\u00B7";a.cedil="\u00B8";a.sup1="\u00B9";a.ordm="\u00BA";a.raquo="\u00BB";a.frac14="\u00BC";a.frac12="\u00BD";a.frac34="\u00BE";a.iquest="\u00BF";a.Agrave="\u00C0";a.Aacute="\u00C1";a.Acirc="\u00C2";a.Atilde="\u00C3";a.Auml="\u00C4";a.Aring="\u00C5";a.AElig="\u00C6";a.Ccedil="\u00C7";a.Egrave="\u00C8";a.Eacute="\u00C9";a.Ecirc="\u00CA";a.Euml="\u00CB";a.Igrave="\u00CC";a.Iacute="\u00CD";a.Icirc="\u00CE";a.Iuml="\u00CF";a.ETH="\u00D0";a.Ntilde="\u00D1";a.Ograve="\u00D2";a.Oacute="\u00D3";a.Ocirc="\u00D4";a.Otilde="\u00D5";a.Ouml="\u00D6";a.times="\u00D7";a.Oslash="\u00D8";a.Ugrave="\u00D9";a.Uacute="\u00DA";a.Ucirc="\u00DB";a.Uuml="\u00DC";a.Yacute="\u00DD";a.THORN="\u00DE";a.szlig="\u00DF";a.agrave="\u00E0";a.aacute="\u00E1";a.acirc="\u00E2";a.atilde="\u00E3";a.auml="\u00E4";a.aring="\u00E5";a.aelig="\u00E6";a.ccedil="\u00E7";a.egrave="\u00E8";a.eacute="\u00E9";a.ecirc="\u00EA";a.euml="\u00EB";a.igrave="\u00EC";a.iacute="\u00ED";a.icirc="\u00EE";a.iuml="\u00EF";a.eth="\u00F0";a.ntilde="\u00F1";a.ograve="\u00F2";a.oacute="\u00F3";a.ocirc="\u00F4";a.otilde="\u00F5";a.ouml="\u00F6";a.divide="\u00F7";a.oslash="\u00F8";a.ugrave="\u00F9";a.uacute="\u00FA";a.ucirc="\u00FB";a.uuml="\u00FC";a.yacute="\u00FD";a.thorn="\u00FE";a.yuml="\u00FF";a.quot="\u0022";a.amp="\u0026";a.lt="\u003C";a.gt="\u003E";a.OElig="";a.oelig="\u0153";a.Scaron="\u0160";a.scaron="\u0161";a.Yuml="\u0178";a.circ="\u02C6";a.tilde="\u02DC";a.ensp="\u2002";a.emsp="\u2003";a.thinsp="\u2009";a.zwnj="\u200C";a.zwj="\u200D";a.lrm="\u200E";a.rlm="\u200F";a.ndash="\u2013";a.mdash="\u2014";a.lsquo="\u2018";a.rsquo="\u2019";a.sbquo="\u201A";a.ldquo="\u201C";a.rdquo="\u201D";a.bdquo="\u201E";a.dagger="\u2020";a.Dagger="\u2021";a.permil="\u2030";a.lsaquo="\u2039";a.rsaquo="\u203A";a.euro="\u20AC";a.fnof="\u0192";a.Alpha="\u0391";a.Beta="\u0392";a.Gamma="\u0393";a.Delta="\u0394";a.Epsilon="\u0395";a.Zeta="\u0396";a.Eta="\u0397";a.Theta="\u0398";a.Iota="\u0399";a.Kappa="\u039A";a.Lambda="\u039B";a.Mu="\u039C";a.Nu="\u039D";a.Xi="\u039E";a.Omicron="\u039F";a.Pi="\u03A0";a.Rho="\u03A1";a.Sigma="\u03A3";a.Tau="\u03A4";a.Upsilon="\u03A5";a.Phi="\u03A6";a.Chi="\u03A7";a.Psi="\u03A8";a.Omega="\u03A9";a.alpha="\u03B1";a.beta="\u03B2";a.gamma="\u03B3";a.delta="\u03B4";a.epsilon="\u03B5";a.zeta="\u03B6";a.eta="\u03B7";a.theta="\u03B8";a.iota="\u03B9";a.kappa="\u03BA";a.lambda="\u03BB";a.mu="\u03BC";a.nu="\u03BD";a.xi="\u03BE";a.omicron="\u03BF";a.pi="\u03C0";a.rho="\u03C1";a.sigmaf="\u03C2";a.sigma="\u03C3";a.tau="\u03C4";a.upsilon="\u03C5";a.phi="\u03C6";a.chi="\u03C7";a.psi="\u03C8";a.omega="\u03C9";a.thetasym="\u03D1";a.upsih="\u03D2";a.piv="\u03D6";a.bull="\u2022";a.hellip="\u2026";a.prime="\u2032";a.Prime="\u2033";a.oline="\u203E";a.frasl="\u2044";a.weierp="\u2118";a.image="\u2111";a.real="\u211C";a.trade="\u2122";a.alefsym="\u2135";a.larr="\u2190";a.uarr="\u2191";a.rarr="\u2192";a.darr="\u2193";a.harr="\u2194";a.crarr="\u21B5";a.lArr="\u21D0";a.uArr="\u21D1";a.rArr="\u21D2";a.dArr="\u21D3";a.hArr="\u21D4";a.forall="\u2200";a.part="\u2202";a.exist="\u2203";a.empty="\u2205";a.nabla="\u2207";a.isin="\u2208";a.notin="\u2209";a.ni="\u220B";a.prod="\u220F";a.sum="\u2211";a.minus="\u2212";a.lowast="\u2217";a.radic="\u221A";a.prop="\u221D";a.infin="\u221E";a.ang="\u2220";a.and="\u2227";a.or="\u2228";a.cap="\u2229";a.cup="\u222A";a["int"]="\u222B";a.there4="\u2234";a.sim="\u223C";a.cong="\u2245";a.asymp="\u2248";a.ne="\u2260";a.equiv="\u2261";a.le="\u2264";a.ge="\u2265";a.sub="\u2282";a.sup="\u2283";a.nsub="\u2284";a.sube="\u2286";a.supe="\u2287";a.oplus="\u2295";a.otimes="\u2297";a.perp="\u22A5";a.sdot="\u22C5";a.lceil="\u2308";a.rceil="\u2309";a.lfloor="\u230A";a.rfloor="\u230B";a.lang="\u2329";a.rang="\u232A";a.loz="\u25CA";a.spades="\u2660";a.clubs="\u2663";a.hearts="\u2665";a.diams="\u2666"})();SimileAjax.HTML.deEntify=function(c){var d=SimileAjax.HTML._e2uHash;var b=/&(\w+?);/;while(b.test(c)){var a=c.match(b);c=c.replace(b,d[a[1]])}return c};SimileAjax.Set=function(b){this._hash={};this._count=0;if(b instanceof Array){for(var c=0;c<b.length;c++){this.add(b[c])}}else{if(b instanceof SimileAjax.Set){this.addSet(b)}}};SimileAjax.Set.prototype.add=function(a){if(!(a in this._hash)){this._hash[a]=true;this._count++;return true}return false};SimileAjax.Set.prototype.addSet=function(b){for(var a in b._hash){this.add(a)}};SimileAjax.Set.prototype.remove=function(a){if(a in this._hash){delete this._hash[a];this._count--;return true}return false};SimileAjax.Set.prototype.removeSet=function(b){for(var a in b._hash){this.remove(a)}};SimileAjax.Set.prototype.retainSet=function(b){for(var a in this._hash){if(!b.contains(a)){delete this._hash[a];this._count--}}};SimileAjax.Set.prototype.contains=function(a){return(a in this._hash)};SimileAjax.Set.prototype.size=function(){return this._count};SimileAjax.Set.prototype.toArray=function(){var b=[];for(var c in this._hash){b.push(c)}return b};SimileAjax.Set.prototype.visit=function(a){for(var b in this._hash){if(a(b)==true){break}}};SimileAjax.SortedArray=function(b,a){this._a=(a instanceof Array)?a:[];this._compare=b};SimileAjax.SortedArray.prototype.add=function(c){var a=this;var b=this.find(function(d){return a._compare(d,c)});if(b<this._a.length){this._a.splice(b,0,c)}else{this._a.push(c)}};SimileAjax.SortedArray.prototype.remove=function(c){var a=this;var b=this.find(function(d){return a._compare(d,c)});while(b<this._a.length&&this._compare(this._a[b],c)==0){if(this._a[b]==c){this._a.splice(b,1);return true}else{b++}}return false};SimileAjax.SortedArray.prototype.removeAll=function(){this._a=[]};SimileAjax.SortedArray.prototype.elementAt=function(a){return this._a[a]};SimileAjax.SortedArray.prototype.length=function(){return this._a.length};SimileAjax.SortedArray.prototype.find=function(g){var e=0;var d=this._a.length;while(e<d){var f=Math.floor((e+d)/2);var h=g(this._a[f]);if(f==e){return h<0?e+1:e}else{if(h<0){e=f}else{d=f}}}return e};SimileAjax.SortedArray.prototype.getFirst=function(){return(this._a.length>0)?this._a[0]:null};SimileAjax.SortedArray.prototype.getLast=function(){return(this._a.length>0)?this._a[this._a.length-1]:null};SimileAjax.EventIndex=function(b){var a=this;this._unit=(b!=null)?b:SimileAjax.NativeDateUnit;this._events=new SimileAjax.SortedArray(function(d,c){return a._unit.compare(d.getStart(),c.getStart())});this._idToEvent={};this._indexed=true};SimileAjax.EventIndex.prototype.getUnit=function(){return this._unit};SimileAjax.EventIndex.prototype.getEvent=function(a){return this._idToEvent[a]};SimileAjax.EventIndex.prototype.add=function(a){this._events.add(a);this._idToEvent[a.getID()]=a;this._indexed=false};SimileAjax.EventIndex.prototype.removeAll=function(){this._events.removeAll();this._idToEvent={};this._indexed=false};SimileAjax.EventIndex.prototype.getCount=function(){return this._events.length()};SimileAjax.EventIndex.prototype.getIterator=function(a,b){if(!this._indexed){this._index()}return new SimileAjax.EventIndex._Iterator(this._events,a,b,this._unit)};SimileAjax.EventIndex.prototype.getReverseIterator=function(a,b){if(!this._indexed){this._index()}return new SimileAjax.EventIndex._ReverseIterator(this._events,a,b,this._unit)};SimileAjax.EventIndex.prototype.getAllIterator=function(){return new SimileAjax.EventIndex._AllIterator(this._events)};SimileAjax.EventIndex.prototype.getEarliestDate=function(){var a=this._events.getFirst();return(a==null)?null:a.getStart()};SimileAjax.EventIndex.prototype.getLatestDate=function(){var a=this._events.getLast();if(a==null){return null}if(!this._indexed){this._index()}var c=a._earliestOverlapIndex;var b=this._events.elementAt(c).getEnd();for(var d=c+1;d<this._events.length();d++){b=this._unit.later(b,this._events.elementAt(d).getEnd())}return b};SimileAjax.EventIndex.prototype._index=function(){var d=this._events.length();for(var e=0;e<d;e++){var c=this._events.elementAt(e);c._earliestOverlapIndex=e}var g=1;for(var e=0;e<d;e++){var c=this._events.elementAt(e);var b=c.getEnd();g=Math.max(g,e+1);while(g<d){var a=this._events.elementAt(g);var f=a.getStart();if(this._unit.compare(f,b)<0){a._earliestOverlapIndex=e;g++}else{break}}}this._indexed=true};SimileAjax.EventIndex._Iterator=function(b,a,d,c){this._events=b;this._startDate=a;this._endDate=d;this._unit=c;this._currentIndex=b.find(function(e){return c.compare(e.getStart(),a)});if(this._currentIndex-1>=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex}this._currentIndex--;this._maxIndex=b.find(function(e){return c.compare(e.getStart(),d)});this._hasNext=false;this._next=null;this._findNext()};SimileAjax.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext},next:function(){if(this._hasNext){var a=this._next;this._findNext();return a}else{return null}},_findNext:function(){var b=this._unit;while((++this._currentIndex)<this._maxIndex){var a=this._events.elementAt(this._currentIndex);if(b.compare(a.getStart(),this._endDate)<0&&b.compare(a.getEnd(),this._startDate)>0){this._next=a;this._hasNext=true;return}}this._next=null;this._hasNext=false}};SimileAjax.EventIndex._ReverseIterator=function(b,a,d,c){this._events=b;this._startDate=a;this._endDate=d;this._unit=c;this._minIndex=b.find(function(e){return c.compare(e.getStart(),a)});if(this._minIndex-1>=0){this._minIndex=this._events.elementAt(this._minIndex-1)._earliestOverlapIndex}this._maxIndex=b.find(function(e){return c.compare(e.getStart(),d)});this._currentIndex=this._maxIndex;this._hasNext=false;this._next=null;this._findNext()};SimileAjax.EventIndex._ReverseIterator.prototype={hasNext:function(){return this._hasNext},next:function(){if(this._hasNext){var a=this._next;this._findNext();return a}else{return null}},_findNext:function(){var b=this._unit;while((--this._currentIndex)>=this._minIndex){var a=this._events.elementAt(this._currentIndex);if(b.compare(a.getStart(),this._endDate)<0&&b.compare(a.getEnd(),this._startDate)>0){this._next=a;this._hasNext=true;return}}this._next=null;this._hasNext=false}};SimileAjax.EventIndex._AllIterator=function(a){this._events=a;this._index=0};SimileAjax.EventIndex._AllIterator.prototype={hasNext:function(){return this._index<this._events.length()},next:function(){return this._index<this._events.length()?this._events.elementAt(this._index++):null}};SimileAjax.NativeDateUnit=new Object();SimileAjax.NativeDateUnit.makeDefaultValue=function(){return new Date()};SimileAjax.NativeDateUnit.cloneValue=function(a){return new Date(a.getTime())};SimileAjax.NativeDateUnit.getParser=function(a){if(typeof a=="string"){a=a.toLowerCase()}return(a=="iso8601"||a=="iso 8601")?SimileAjax.DateTime.parseIso8601DateTime:SimileAjax.DateTime.parseGregorianDateTime};SimileAjax.NativeDateUnit.parseFromObject=function(a){return SimileAjax.DateTime.parseGregorianDateTime(a)};SimileAjax.NativeDateUnit.toNumber=function(a){return a.getTime()};SimileAjax.NativeDateUnit.fromNumber=function(a){return new Date(a)};SimileAjax.NativeDateUnit.compare=function(d,c){var b,a;if(typeof d=="object"){b=d.getTime()}else{b=Number(d)}if(typeof c=="object"){a=c.getTime()}else{a=Number(c)}return b-a};SimileAjax.NativeDateUnit.earlier=function(b,a){return SimileAjax.NativeDateUnit.compare(b,a)<0?b:a};SimileAjax.NativeDateUnit.later=function(b,a){return SimileAjax.NativeDateUnit.compare(b,a)>0?b:a};SimileAjax.NativeDateUnit.change=function(a,b){return new Date(a.getTime()+b)};SimileAjax.ListenerQueue=function(a){this._listeners=[];this._wildcardHandlerName=a};SimileAjax.ListenerQueue.prototype.add=function(a){this._listeners.push(a)};SimileAjax.ListenerQueue.prototype.remove=function(c){var b=this._listeners;for(var a=0;a<b.length;a++){if(b[a]==c){b.splice(a,1);break}}};SimileAjax.ListenerQueue.prototype.fire=function(b,a){var d=[].concat(this._listeners);for(var c=0;c<d.length;c++){var f=d[c];if(b in f){try{f[b].apply(f,a)}catch(g){SimileAjax.Debug.exception("Error firing event of name "+b,g)}}else{if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in f){try{f[this._wildcardHandlerName].apply(f,[b])}catch(g){SimileAjax.Debug.exception("Error firing event of name "+b+" to wildcard handler",g)}}}}};SimileAjax.History={maxHistoryLength:10,historyFile:"__history__.html",enabled:true,_initialized:false,_listeners:new SimileAjax.ListenerQueue(),_actions:[],_baseIndex:0,_currentIndex:0,_plainDocumentTitle:document.title};SimileAjax.History.formatHistoryEntryTitle=function(a){return SimileAjax.History._plainDocumentTitle+" {"+a+"}"};SimileAjax.History.initialize=function(){if(SimileAjax.History._initialized){return}if(SimileAjax.History.enabled){var a=document.createElement("iframe");a.id="simile-ajax-history";a.style.position="absolute";a.style.width="10px";a.style.height="10px";a.style.top="0px";a.style.left="0px";a.style.visibility="hidden";a.src=SimileAjax.History.historyFile+"?0";document.body.appendChild(a);SimileAjax.DOM.registerEvent(a,"load",SimileAjax.History._handleIFrameOnLoad);SimileAjax.History._iframe=a}SimileAjax.History._initialized=true};SimileAjax.History.addListener=function(a){SimileAjax.History.initialize();SimileAjax.History._listeners.add(a)};SimileAjax.History.removeListener=function(a){SimileAjax.History.initialize();SimileAjax.History._listeners.remove(a)};SimileAjax.History.addAction=function(a){SimileAjax.History.initialize();SimileAjax.History._listeners.fire("onBeforePerform",[a]);window.setTimeout(function(){try{a.perform();SimileAjax.History._listeners.fire("onAfterPerform",[a]);if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex);SimileAjax.History._actions.push(a);SimileAjax.History._currentIndex++;var c=SimileAjax.History._actions.length-SimileAjax.History.maxHistoryLength;if(c>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(c);SimileAjax.History._baseIndex+=c}try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex}catch(b){var d=SimileAjax.History.formatHistoryEntryTitle(a.label);document.title=d}}}catch(b){SimileAjax.Debug.exception(b,"Error adding action {"+a.label+"} to history")}},0)};SimileAjax.History.addLengthyAction=function(c,a,b){SimileAjax.History.addAction({perform:c,undo:a,label:b,uiLayer:SimileAjax.WindowManager.getBaseLayer(),lengthy:true})};SimileAjax.History._handleIFrameOnLoad=function(){try{var b=SimileAjax.History._iframe.contentWindow.location.search;var h=(b.length==0)?0:Math.max(0,parseInt(b.substr(1)));var g=function(){var c=h-SimileAjax.History._currentIndex;SimileAjax.History._currentIndex+=c;SimileAjax.History._baseIndex+=c;SimileAjax.History._iframe.contentWindow.location.search="?"+h};if(h<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]);window.setTimeout(function(){while(SimileAjax.History._currentIndex>h&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--;var c=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{c.undo()}catch(i){SimileAjax.Debug.exception(i,"History: Failed to undo action {"+c.label+"}")}}SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]);g()},0)}else{if(h>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]);window.setTimeout(function(){while(SimileAjax.History._currentIndex<h&&SimileAjax.History._currentIndex-SimileAjax.History._baseIndex<SimileAjax.History._actions.length){var c=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{c.perform()}catch(i){SimileAjax.Debug.exception(i,"History: Failed to redo action {"+c.label+"}")}SimileAjax.History._currentIndex++}SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]);g()},0)}else{var a=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;var f=(a>=0&&a<SimileAjax.History._actions.length)?SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[a].label):SimileAjax.History._plainDocumentTitle;SimileAjax.History._iframe.contentWindow.document.title=f;document.title=f}}}catch(d){}};SimileAjax.History.getNextUndoAction=function(){try{var a=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;return SimileAjax.History._actions[a]}catch(b){return null}};SimileAjax.History.getNextRedoAction=function(){try{var a=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex;return SimileAjax.History._actions[a]}catch(b){return null}};SimileAjax.WindowManager={_initialized:false,_listeners:[],_draggedElement:null,_draggedElementCallback:null,_dropTargetHighlightElement:null,_lastCoords:null,_ghostCoords:null,_draggingMode:"",_dragging:false,_layers:[]};SimileAjax.WindowManager.initialize=function(){if(SimileAjax.WindowManager._initialized){return}SimileAjax.DOM.registerEvent(document.body,"mousedown",SimileAjax.WindowManager._onBodyMouseDown);SimileAjax.DOM.registerEvent(document.body,"mousemove",SimileAjax.WindowManager._onBodyMouseMove);SimileAjax.DOM.registerEvent(document.body,"mouseup",SimileAjax.WindowManager._onBodyMouseUp);SimileAjax.DOM.registerEvent(document,"keydown",SimileAjax.WindowManager._onBodyKeyDown);SimileAjax.DOM.registerEvent(document,"keyup",SimileAjax.WindowManager._onBodyKeyUp);SimileAjax.WindowManager._layers.push({index:0});SimileAjax.WindowManager._historyListener={onBeforeUndoSeveral:function(){},onAfterUndoSeveral:function(){},onBeforeUndo:function(){},onAfterUndo:function(){},onBeforeRedoSeveral:function(){},onAfterRedoSeveral:function(){},onBeforeRedo:function(){},onAfterRedo:function(){}};SimileAjax.History.addListener(SimileAjax.WindowManager._historyListener);SimileAjax.WindowManager._initialized=true};SimileAjax.WindowManager.getBaseLayer=function(){SimileAjax.WindowManager.initialize();return SimileAjax.WindowManager._layers[0]};SimileAjax.WindowManager.getHighestLayer=function(){SimileAjax.WindowManager.initialize();return SimileAjax.WindowManager._layers[SimileAjax.WindowManager._layers.length-1]};SimileAjax.WindowManager.registerEventWithObject=function(d,a,e,b,c){SimileAjax.WindowManager.registerEvent(d,a,function(g,f,h){return e[b].call(e,g,f,h)},c)};SimileAjax.WindowManager.registerEvent=function(d,b,e,c){if(c==null){c=SimileAjax.WindowManager.getHighestLayer()}var a=function(g,f,i){if(SimileAjax.WindowManager._canProcessEventAtLayer(c)){SimileAjax.WindowManager._popToLayer(c.index);try{e(g,f,i)}catch(h){SimileAjax.Debug.exception(h)}}SimileAjax.DOM.cancelEvent(f);return false};SimileAjax.DOM.registerEvent(d,b,a)};SimileAjax.WindowManager.pushLayer=function(c,d,b){var a={onPop:c,index:SimileAjax.WindowManager._layers.length,ephemeral:(d),elmt:b};SimileAjax.WindowManager._layers.push(a);return a};SimileAjax.WindowManager.popLayer=function(b){for(var a=1;a<SimileAjax.WindowManager._layers.length;a++){if(SimileAjax.WindowManager._layers[a]==b){SimileAjax.WindowManager._popToLayer(a-1);break}}};SimileAjax.WindowManager.popAllLayers=function(){SimileAjax.WindowManager._popToLayer(0)};SimileAjax.WindowManager.registerForDragging=function(b,c,a){SimileAjax.WindowManager.registerEvent(b,"mousedown",function(e,d,f){SimileAjax.WindowManager._handleMouseDown(e,d,c)},a)};SimileAjax.WindowManager._popToLayer=function(c){while(c+1<SimileAjax.WindowManager._layers.length){try{var a=SimileAjax.WindowManager._layers.pop();if(a.onPop!=null){a.onPop()}}catch(b){}}};SimileAjax.WindowManager._canProcessEventAtLayer=function(b){if(b.index==(SimileAjax.WindowManager._layers.length-1)){return true}for(var a=b.index+1;a<SimileAjax.WindowManager._layers.length;a++){if(!SimileAjax.WindowManager._layers[a].ephemeral){return false}}return true};SimileAjax.WindowManager.cancelPopups=function(a){var f=(a)?SimileAjax.DOM.getEventPageCoordinates(a):{x:-1,y:-1};var e=SimileAjax.WindowManager._layers.length-1;while(e>0&&SimileAjax.WindowManager._layers[e].ephemeral){var d=SimileAjax.WindowManager._layers[e];if(d.elmt!=null){var c=d.elmt;var b=SimileAjax.DOM.getPageCoordinates(c);if(f.x>=b.left&&f.x<(b.left+c.offsetWidth)&&f.y>=b.top&&f.y<(b.top+c.offsetHeight)){break}}e--}SimileAjax.WindowManager._popToLayer(e)};SimileAjax.WindowManager._onBodyMouseDown=function(b,a,c){if(!("eventPhase" in a)||a.eventPhase==a.BUBBLING_PHASE){SimileAjax.WindowManager.cancelPopups(a)}};SimileAjax.WindowManager._handleMouseDown=function(b,a,c){SimileAjax.WindowManager._draggedElement=b;SimileAjax.WindowManager._draggedElementCallback=c;SimileAjax.WindowManager._lastCoords={x:a.clientX,y:a.clientY};SimileAjax.DOM.cancelEvent(a);return false};SimileAjax.WindowManager._onBodyKeyDown=function(c,a,d){if(SimileAjax.WindowManager._dragging){if(a.keyCode==27){SimileAjax.WindowManager._cancelDragging()}else{if((a.keyCode==17||a.keyCode==16)&&SimileAjax.WindowManager._draggingMode!="copy"){SimileAjax.WindowManager._draggingMode="copy";var b=SimileAjax.Graphics.createTranslucentImage(SimileAjax.urlPrefix+"images/copy.png");b.style.position="absolute";b.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";b.style.top=(SimileAjax.WindowManager._ghostCoords.top)+"px";document.body.appendChild(b);SimileAjax.WindowManager._draggingModeIndicatorElmt=b}}}};SimileAjax.WindowManager._onBodyKeyUp=function(b,a,c){if(SimileAjax.WindowManager._dragging){if(a.keyCode==17||a.keyCode==16){SimileAjax.WindowManager._draggingMode="";if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);SimileAjax.WindowManager._draggingModeIndicatorElmt=null}}}};SimileAjax.WindowManager._onBodyMouseMove=function(a,p,i){if(SimileAjax.WindowManager._draggedElement!=null){var r=SimileAjax.WindowManager._draggedElementCallback;var f=SimileAjax.WindowManager._lastCoords;var o=p.clientX-f.x;var k=p.clientY-f.y;if(!SimileAjax.WindowManager._dragging){if(Math.abs(o)>5||Math.abs(k)>5){try{if("onDragStart" in r){r.onDragStart()}if("ghost" in r&&r.ghost){var l=SimileAjax.WindowManager._draggedElement;SimileAjax.WindowManager._ghostCoords=SimileAjax.DOM.getPageCoordinates(l);SimileAjax.WindowManager._ghostCoords.left+=o;SimileAjax.WindowManager._ghostCoords.top+=k;var q=l.cloneNode(true);q.style.position="absolute";q.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";q.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";q.style.zIndex=1000;SimileAjax.Graphics.setOpacity(q,50);document.body.appendChild(q);r._ghostElmt=q}SimileAjax.WindowManager._dragging=true;SimileAjax.WindowManager._lastCoords={x:p.clientX,y:p.clientY};document.body.focus()}catch(h){SimileAjax.Debug.exception("WindowManager: Error handling mouse down",h);SimileAjax.WindowManager._cancelDragging()}}}else{try{SimileAjax.WindowManager._lastCoords={x:p.clientX,y:p.clientY};if("onDragBy" in r){r.onDragBy(o,k)}if("_ghostElmt" in r){var q=r._ghostElmt;SimileAjax.WindowManager._ghostCoords.left+=o;SimileAjax.WindowManager._ghostCoords.top+=k;q.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";q.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){var j=SimileAjax.WindowManager._draggingModeIndicatorElmt;j.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";j.style.top=SimileAjax.WindowManager._ghostCoords.top+"px"}if("droppable" in r&&r.droppable){var m=SimileAjax.DOM.getEventPageCoordinates(p);var i=SimileAjax.DOM.hittest(m.x,m.y,[SimileAjax.WindowManager._ghostElmt,SimileAjax.WindowManager._dropTargetHighlightElement]);i=SimileAjax.WindowManager._findDropTarget(i);if(i!=SimileAjax.WindowManager._potentialDropTarget){if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);SimileAjax.WindowManager._dropTargetHighlightElement=null;SimileAjax.WindowManager._potentialDropTarget=null}var g=false;if(i!=null){if((!("canDropOn" in r)||r.canDropOn(i))&&(!("canDrop" in i)||i.canDrop(SimileAjax.WindowManager._draggedElement))){g=true}}if(g){var c=4;var d=SimileAjax.DOM.getPageCoordinates(i);var b=document.createElement("div");b.style.border=c+"px solid yellow";b.style.backgroundColor="yellow";b.style.position="absolute";b.style.left=d.left+"px";b.style.top=d.top+"px";b.style.width=(i.offsetWidth-c*2)+"px";b.style.height=(i.offsetHeight-c*2)+"px";SimileAjax.Graphics.setOpacity(b,30);document.body.appendChild(b);SimileAjax.WindowManager._potentialDropTarget=i;SimileAjax.WindowManager._dropTargetHighlightElement=b}}}}}catch(h){SimileAjax.Debug.exception("WindowManager: Error handling mouse move",h);SimileAjax.WindowManager._cancelDragging()}}SimileAjax.DOM.cancelEvent(p);return false}};SimileAjax.WindowManager._onBodyMouseUp=function(b,a,c){if(SimileAjax.WindowManager._draggedElement!=null){try{if(SimileAjax.WindowManager._dragging){var e=SimileAjax.WindowManager._draggedElementCallback;if("onDragEnd" in e){e.onDragEnd()}if("droppable" in e&&e.droppable){var d=false;var c=SimileAjax.WindowManager._potentialDropTarget;if(c!=null){if((!("canDropOn" in e)||e.canDropOn(c))&&(!("canDrop" in c)||c.canDrop(SimileAjax.WindowManager._draggedElement))){if("onDropOn" in e){e.onDropOn(c)}c.ondrop(SimileAjax.WindowManager._draggedElement,SimileAjax.WindowManager._draggingMode);d=true}}if(!d){}}}}finally{SimileAjax.WindowManager._cancelDragging()}SimileAjax.DOM.cancelEvent(a);return false}};SimileAjax.WindowManager._cancelDragging=function(){var b=SimileAjax.WindowManager._draggedElementCallback;if("_ghostElmt" in b){var a=b._ghostElmt;document.body.removeChild(a);delete b._ghostElmt}if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);SimileAjax.WindowManager._dropTargetHighlightElement=null}if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);SimileAjax.WindowManager._draggingModeIndicatorElmt=null}SimileAjax.WindowManager._draggedElement=null;SimileAjax.WindowManager._draggedElementCallback=null;SimileAjax.WindowManager._potentialDropTarget=null;SimileAjax.WindowManager._dropTargetHighlightElement=null;SimileAjax.WindowManager._lastCoords=null;SimileAjax.WindowManager._ghostCoords=null;SimileAjax.WindowManager._draggingMode="";SimileAjax.WindowManager._dragging=false};SimileAjax.WindowManager._findDropTarget=function(a){while(a!=null){if("ondrop" in a&&(typeof a.ondrop)=="function"){break}a=a.parentNode}return a};(function(){var j="2.2.1";var h=false;if(document.location.search.length>0){var g=document.location.search.substr(1).split("&");for(var c=0;c<g.length;c++){if(g[c]=="timeline-use-local-resources"){h=true}}}var f=function(){if("Timeline" in window){return}window.Timeline=new Object();window.Timeline.DateTime=window.SimileAjax.DateTime;var x=false;var u=["timeline.js","band.js","themes.js","ethers.js","ether-painters.js","event-utils.js","labellers.js","sources.js","original-painter.js","detailed-painter.js","overview-painter.js","compact-painter.js","decorators.js","units.js"];var q=["timeline.css","ethers.css","events.css"];var s=["timeline.js","labellers.js"];var z=[];var w=["cs","de","en","es","fr","it","nl","ru","se","tr","vi","zh"];try{var m=["en"],k="en",F=null;var o=function(e){var H=e.split("&");for(var l=0;l<H.length;l++){var G=H[l].split("=");if(G[0]=="locales"){m=m.concat(G[1].split(","))}else{if(G[0]=="defaultLocale"){k=G[1]}else{if(G[0]=="forceLocale"){F=G[1];m=m.concat(G[1].split(","))}else{if(G[0]=="bundle"){x=G[1]!="false"}}}}}};(function(){if(typeof Timeline_urlPrefix=="string"){Timeline.urlPrefix=Timeline_urlPrefix;if(typeof Timeline_parameters=="string"){o(Timeline_parameters)}}else{var J=document.documentElement.getElementsByTagName("head");for(var I=0;I<J.length;I++){var e=J[I].getElementsByTagName("script");for(var H=0;H<e.length;H++){var l=e[H].src;var G=l.indexOf("timeline-api.js");if(G>=0){Timeline.urlPrefix=l.substr(0,G);var K=l.indexOf("?");if(K>0){o(l.substr(K+1))}return}}}throw new Error("Failed to derive URL prefix for Timeline API code files")}})();var i=function(e,l){SimileAjax.includeJavascriptFiles(document,e,l)};var E=function(e,l){SimileAjax.includeCssFiles(document,e,l)};if(x){i(Timeline.urlPrefix,["timeline-bundle.js"]);E(Timeline.urlPrefix,["timeline-bundle.css"])}else{}var t=[];t[k]=true;var r=function(e){for(var G=0;G<w.length;G++){if(e==w[G]){t[e]=true;return true}}return false};var y=function(e){if(r(e)){return e}var l=e.indexOf("-");if(l>0&&r(e.substr(0,l))){return e.substr(0,l)}return null};for(var B=0;B<m.length;B++){y(m[B])}var p=k;var v=("language" in navigator?navigator.language:navigator.browserLanguage).split(";");for(var B=0;B<v.length;B++){var C=y(v[B]);if(C!=null){p=C;break}}for(var B=0;B<w.length;B++){var C=w[B];if(t[C]){}}if(F==null){Timeline.serverLocale=k;Timeline.clientLocale=p}else{Timeline.serverLocale=F;Timeline.clientLocale=F}}catch(D){alert(D)}};if(typeof SimileAjax=="undefined"){window.SimileAjax_onLoad=f;var b=h?"http://127.0.0.1:9999/ajax/api/simile-ajax-api.js?bundle=false":"http://api.simile-widgets.org/ajax/"+j+"/simile-ajax-api.js";if(typeof Timeline_ajax_url=="string"){b=Timeline_ajax_url}var a=function(){var e=document.createElement("script");e.type="text/javascript";e.language="JavaScript";e.src=b;document.getElementsByTagName("head")[0].appendChild(e)};if(document.body==null){try{document.write("<script src='"+b+"' type='text/javascript'><\/script>")}catch(d){a()}}else{a()}}else{f()}})();Timeline.version="pre 2.4.0";Timeline.ajax_lib_version=SimileAjax.version;Timeline.display_version=Timeline.version+" (with Ajax lib "+Timeline.ajax_lib_version+")";Timeline.strings={};Timeline.HORIZONTAL=0;Timeline.VERTICAL=1;Timeline._defaultTheme=null;Timeline.getDefaultLocale=function(){return Timeline.clientLocale};Timeline.create=function(d,c,b,f){if(Timeline.timelines==null){Timeline.timelines=[]}var a=Timeline.timelines.length;Timeline.timelines[a]=null;var e=new Timeline._Impl(d,c,b,f,a);Timeline.timelines[a]=e;return e};Timeline.createBandInfo=function(d){var e=("theme" in d)?d.theme:Timeline.getDefaultTheme();var b=("eventSource" in d)?d.eventSource:null;var f={interval:SimileAjax.DateTime.gregorianUnitLengths[d.intervalUnit],pixelsPerInterval:d.intervalPixels,theme:e};if("startsOn" in d||"endsOn" in d){if("startsOn" in d){f.startsOn=d.startsOn}if("endsOn" in d){f.endsOn=d.endsOn}}else{f.centersOn=("date" in d)?d.date:new Date()}var g=new Timeline.LinearEther(f);var h=new Timeline.GregorianEtherPainter({unit:d.intervalUnit,multiple:("multiple" in d)?d.multiple:1,theme:e,align:("align" in d)?d.align:undefined});var j={showText:("showEventText" in d)?d.showEventText:true,theme:e};if("eventPainterParams" in d){for(var a in d.eventPainterParams){j[a]=d.eventPainterParams[a]}}if("trackHeight" in d){j.trackHeight=d.trackHeight}if("trackGap" in d){j.trackGap=d.trackGap}var i=("overview" in d&&d.overview)?"overview":("layout" in d?d.layout:"original");var c;if("eventPainter" in d){c=new d.eventPainter(j)}else{switch(i){case"overview":c=new Timeline.OverviewEventPainter(j);break;case"detailed":c=new Timeline.DetailedEventPainter(j);break;default:c=new Timeline.OriginalEventPainter(j)}}return{width:d.width,eventSource:b,timeZone:("timeZone" in d)?d.timeZone:0,ether:g,etherPainter:h,eventPainter:c,theme:e,zoomIndex:("zoomIndex" in d)?d.zoomIndex:0,zoomSteps:("zoomSteps" in d)?d.zoomSteps:null}};Timeline.createHotZoneBandInfo=function(d){var e=("theme" in d)?d.theme:Timeline.getDefaultTheme();var b=("eventSource" in d)?d.eventSource:null;var f=new Timeline.HotZoneEther({centersOn:("date" in d)?d.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[d.intervalUnit],pixelsPerInterval:d.intervalPixels,zones:d.zones,theme:e});var g=new Timeline.HotZoneGregorianEtherPainter({unit:d.intervalUnit,zones:d.zones,theme:e,align:("align" in d)?d.align:undefined});var i={showText:("showEventText" in d)?d.showEventText:true,theme:e};if("eventPainterParams" in d){for(var a in d.eventPainterParams){i[a]=d.eventPainterParams[a]}}if("trackHeight" in d){i.trackHeight=d.trackHeight}if("trackGap" in d){i.trackGap=d.trackGap}var h=("overview" in d&&d.overview)?"overview":("layout" in d?d.layout:"original");var c;if("eventPainter" in d){c=new d.eventPainter(i)}else{switch(h){case"overview":c=new Timeline.OverviewEventPainter(i);break;case"detailed":c=new Timeline.DetailedEventPainter(i);break;default:c=new Timeline.OriginalEventPainter(i)}}return{width:d.width,eventSource:b,timeZone:("timeZone" in d)?d.timeZone:0,ether:f,etherPainter:g,eventPainter:c,theme:e,zoomIndex:("zoomIndex" in d)?d.zoomIndex:0,zoomSteps:("zoomSteps" in d)?d.zoomSteps:null}};Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.getDefaultLocale())}return Timeline._defaultTheme};Timeline.setDefaultTheme=function(a){Timeline._defaultTheme=a};Timeline.loadXML=function(a,c){var d=function(g,e,f){alert("Failed to load data xml from "+a+"\n"+g)};var b=function(f){var e=f.responseXML;if(!e.documentElement&&f.responseStream){e.load(f.responseStream)}c(e,a)};SimileAjax.XmlHttp.get(a,d,b)};Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText)};var fDone=function(xmlhttp){f(eval("("+xmlhttp.responseText+")"),url)};SimileAjax.XmlHttp.get(url,fError,fDone)};Timeline.getTimelineFromID=function(a){return Timeline.timelines[a]};Timeline.writeVersion=function(a){document.getElementById(a).innerHTML=this.display_version};Timeline._Impl=function(d,c,b,e,a){SimileAjax.WindowManager.initialize();this._containerDiv=d;this._bandInfos=c;this._orientation=b==null?Timeline.HORIZONTAL:b;this._unit=(e!=null)?e:SimileAjax.NativeDateUnit;this._starting=true;this._autoResizing=false;this.autoWidth=c&&c[0]&&c[0].theme&&c[0].theme.autoWidth;this.autoWidthAnimationTime=c&&c[0]&&c[0].theme&&c[0].theme.autoWidthAnimationTime;this.timelineID=a;this.timeline_start=c&&c[0]&&c[0].theme&&c[0].theme.timeline_start;this.timeline_stop=c&&c[0]&&c[0].theme&&c[0].theme.timeline_stop;this.timeline_at_start=false;this.timeline_at_stop=false;this._initialize()};Timeline._Impl.prototype.dispose=function(){for(var a=0;a<this._bands.length;a++){this._bands[a].dispose()}this._bands=null;this._bandInfos=null;this._containerDiv.innerHTML="";Timeline.timelines[this.timelineID]=null};Timeline._Impl.prototype.getBandCount=function(){return this._bands.length};Timeline._Impl.prototype.getBand=function(a){return this._bands[a]};Timeline._Impl.prototype.finishedEventLoading=function(){this._autoWidthCheck(true);this._starting=false};Timeline._Impl.prototype.layout=function(){this._autoWidthCheck(true);this._distributeWidths()};Timeline._Impl.prototype.paint=function(){for(var a=0;a<this._bands.length;a++){this._bands[a].paint()}};Timeline._Impl.prototype.getDocument=function(){return this._containerDiv.ownerDocument};Timeline._Impl.prototype.addDiv=function(a){this._containerDiv.appendChild(a)};Timeline._Impl.prototype.removeDiv=function(a){this._containerDiv.removeChild(a)};Timeline._Impl.prototype.isHorizontal=function(){return this._orientation==Timeline.HORIZONTAL};Timeline._Impl.prototype.isVertical=function(){return this._orientation==Timeline.VERTICAL};Timeline._Impl.prototype.getPixelLength=function(){return this._orientation==Timeline.HORIZONTAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight};Timeline._Impl.prototype.getPixelWidth=function(){return this._orientation==Timeline.VERTICAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight};Timeline._Impl.prototype.getUnit=function(){return this._unit};Timeline._Impl.prototype.getWidthStyle=function(){return this._orientation==Timeline.HORIZONTAL?"height":"width"};Timeline._Impl.prototype.loadXML=function(b,d){var a=this;var e=function(h,f,g){alert("Failed to load data xml from "+b+"\n"+h);a.hideLoadingMessage()};var c=function(g){try{var f=g.responseXML;if(!f.documentElement&&g.responseStream){f.load(g.responseStream)}d(f,b)}finally{a.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(b,e,c)},0)};Timeline._Impl.prototype.loadJSON=function(url,f){var tl=this;var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);tl.hideLoadingMessage()};var fDone=function(xmlhttp){try{f(eval("("+xmlhttp.responseText+")"),url)}finally{tl.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(url,fError,fDone)},0)};Timeline._Impl.prototype._autoWidthScrollListener=function(a){a.getTimeline()._autoWidthCheck(false)};Timeline._Impl.prototype._autoWidthCheck=function(c){var e=this;var b=e._starting;var d=0;function a(){var h=e.getWidthStyle();if(b){e._containerDiv.style[h]=d+"px"}else{e._autoResizing=true;var g={};g[h]=d+"px";SimileAjax.jQuery(e._containerDiv).animate(g,e.autoWidthAnimationTime,"linear",function(){e._autoResizing=false})}}function f(){var j=0;var g=e.getPixelWidth();if(e._autoResizing){return}for(var h=0;h<e._bands.length;h++){e._bands[h].checkAutoWidth();j+=e._bandInfos[h].width}if(j>g||c){d=j;a();e._distributeWidths()}}if(!e.autoWidth){return}f()};Timeline._Impl.prototype._initialize=function(){var e=this._containerDiv;var g=e.ownerDocument;e.className=e.className.split(" ").concat("timeline-container").join(" ");var a=(this.isHorizontal())?"horizontal":"vertical";e.className+=" timeline-"+a;while(e.firstChild){e.removeChild(e.firstChild)}var b=SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix+(this.isHorizontal()?"images/copyright-vertical.png":"images/copyright.png"));b.className="timeline-copyright";b.title="Timeline copyright SIMILE - www.code.google.com/p/simile-widgets/";SimileAjax.DOM.registerEvent(b,"click",function(){window.location="http://www.simile-widgets.org/"});e.appendChild(b);this._bands=[];for(var c=0;c<this._bandInfos.length;c++){var f=this._bandInfos[c];var d=f.bandClass||Timeline._Band;var h=new d(this,this._bandInfos[c],c);this._bands.push(h)}this._distributeWidths();for(var c=0;c<this._bandInfos.length;c++){var f=this._bandInfos[c];if("syncWith" in f){this._bands[c].setSyncWithBand(this._bands[f.syncWith],("highlight" in f)?f.highlight:false)}}if(this.autoWidth){for(var c=0;c<this._bands.length;c++){this._bands[c].addOnScrollListener(this._autoWidthScrollListener)}}var j=SimileAjax.Graphics.createMessageBubble(g);j.containerDiv.className="timeline-message-container";e.appendChild(j.containerDiv);j.contentDiv.className="timeline-message";j.contentDiv.innerHTML="<img src='"+Timeline.urlPrefix+"images/progress-running.gif' /> Loading...";this.showLoadingMessage=function(){j.containerDiv.style.display="block"};this.hideLoadingMessage=function(){j.containerDiv.style.display="none"}};Timeline._Impl.prototype._distributeWidths=function(){var b=this.getPixelLength();var a=this.getPixelWidth();var c=0;for(var e=0;e<this._bands.length;e++){var j=this._bands[e];var k=this._bandInfos[e];var f=k.width;var d;if(typeof f=="string"){var h=f.indexOf("%");if(h>0){var g=parseInt(f.substr(0,h));d=Math.round(g*a/100)}else{d=parseInt(f)}}else{d=f}j.setBandShiftAndWidth(c,d);j.setViewLength(b);c+=d}};Timeline._Impl.prototype.shiftOK=function(d,b){var c=b>0,a=b<0;if((c&&this.timeline_start==null)||(a&&this.timeline_stop==null)||(b==0)){return(true)}var g=false;for(var f=0;f<this._bands.length&&!g;f++){g=this._bands[f].busy()}if(g){return(true)}if((c&&this.timeline_at_start)||(a&&this.timeline_at_stop)){return(false)}var e=false;for(var f=0;f<this._bands.length&&!e;f++){var h=this._bands[f];if(c){e=(f==d?h.getMinVisibleDateAfterDelta(b):h.getMinVisibleDate())>=this.timeline_start}else{e=(f==d?h.getMaxVisibleDateAfterDelta(b):h.getMaxVisibleDate())<=this.timeline_stop}}if(c){this.timeline_at_start=!e;this.timeline_at_stop=false}else{this.timeline_at_stop=!e;this.timeline_at_start=false}return(e)};Timeline._Impl.prototype.zoom=function(g,b,f,d){var c=new RegExp("^timeline-band-([0-9]+)$");var e=null;var a=c.exec(d.id);if(a){e=parseInt(a[1])}if(e!=null){this._bands[e].zoom(g,b,f,d)}this.paint()};Timeline._Band=function(b,c,a){if(b!==undefined){this.initialize(b,c,a)}};Timeline._Band.prototype.initialize=function(g,h,c){if(g.autoWidth&&typeof h.width=="string"){h.width=h.width.indexOf("%")>-1?0:parseInt(h.width)}this._timeline=g;this._bandInfo=h;this._index=c;this._locale=("locale" in h)?h.locale:Timeline.getDefaultLocale();this._timeZone=("timeZone" in h)?h.timeZone:0;this._labeller=("labeller" in h)?h.labeller:(("createLabeller" in g.getUnit())?g.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone));this._theme=h.theme;this._zoomIndex=("zoomIndex" in h)?h.zoomIndex:0;this._zoomSteps=("zoomSteps" in h)?h.zoomSteps:null;this._dragging=false;this._changing=false;this._originalScrollSpeed=5;this._scrollSpeed=this._originalScrollSpeed;this._viewOrthogonalOffset=0;this._onScrollListeners=[];var a=this;this._syncWithBand=null;this._syncWithBandHandler=function(b){a._onHighlightBandScroll()};this._selectorListener=function(b){a._onHighlightBandScroll()};var e=this._timeline.getDocument().createElement("div");e.className="timeline-band-input";this._timeline.addDiv(e);this._keyboardInput=document.createElement("input");this._keyboardInput.type="text";e.appendChild(this._keyboardInput);SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,"_onKeyDown");SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,"_onKeyUp");this._div=this._timeline.getDocument().createElement("div");this._div.id="timeline-band-"+c;this._div.className="timeline-band timeline-band-"+c;this._timeline.addDiv(this._div);SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown");SimileAjax.DOM.registerEventWithObject(this._div,"mousemove",this,"_onMouseMove");SimileAjax.DOM.registerEventWithObject(this._div,"mouseup",this,"_onMouseUp");SimileAjax.DOM.registerEventWithObject(this._div,"mouseout",this,"_onMouseOut");SimileAjax.DOM.registerEventWithObject(this._div,"dblclick",this,"_onDblClick");var f=this._theme!=null?this._theme.mouseWheel:"scroll";if(f==="zoom"||f==="scroll"||this._zoomSteps){if(SimileAjax.Platform.browser.isFirefox){SimileAjax.DOM.registerEventWithObject(this._div,"DOMMouseScroll",this,"_onMouseScroll")}else{SimileAjax.DOM.registerEventWithObject(this._div,"mousewheel",this,"_onMouseScroll")}}this._innerDiv=this._timeline.getDocument().createElement("div");this._innerDiv.className="timeline-band-inner";this._div.appendChild(this._innerDiv);this._ether=h.ether;h.ether.initialize(this,g);this._etherPainter=h.etherPainter;h.etherPainter.initialize(this,g);this._eventSource=h.eventSource;if(this._eventSource){this._eventListener={onAddMany:function(){a._onAddMany()},onClear:function(){a._onClear()}};this._eventSource.addListener(this._eventListener)}this._eventPainter=h.eventPainter;this._eventTracksNeeded=0;this._eventTrackIncrement=0;h.eventPainter.initialize(this,g);this._decorators=("decorators" in h)?h.decorators:[];for(var d=0;d<this._decorators.length;d++){this._decorators[d].initialize(this,g)}};Timeline._Band.SCROLL_MULTIPLES=5;Timeline._Band.prototype.dispose=function(){this.closeBubble();if(this._eventSource){this._eventSource.removeListener(this._eventListener);this._eventListener=null;this._eventSource=null}this._timeline=null;this._bandInfo=null;this._labeller=null;this._ether=null;this._etherPainter=null;this._eventPainter=null;this._decorators=null;this._onScrollListeners=null;this._syncWithBandHandler=null;this._selectorListener=null;this._div=null;this._innerDiv=null;this._keyboardInput=null};Timeline._Band.prototype.addOnScrollListener=function(a){this._onScrollListeners.push(a)};Timeline._Band.prototype.removeOnScrollListener=function(b){for(var a=0;a<this._onScrollListeners.length;a++){if(this._onScrollListeners[a]==b){this._onScrollListeners.splice(a,1);break}}};Timeline._Band.prototype.setSyncWithBand=function(b,a){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler)}this._syncWithBand=b;this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);this._highlight=a;this._positionHighlight()};Timeline._Band.prototype.getLocale=function(){return this._locale};Timeline._Band.prototype.getTimeZone=function(){return this._timeZone};Timeline._Band.prototype.getLabeller=function(){return this._labeller};Timeline._Band.prototype.getIndex=function(){return this._index};Timeline._Band.prototype.getEther=function(){return this._ether};Timeline._Band.prototype.getEtherPainter=function(){return this._etherPainter};Timeline._Band.prototype.getEventSource=function(){return this._eventSource};Timeline._Band.prototype.getEventPainter=function(){return this._eventPainter};Timeline._Band.prototype.getTimeline=function(){return this._timeline};Timeline._Band.prototype.updateEventTrackInfo=function(b,a){this._eventTrackIncrement=a;if(b>this._eventTracksNeeded){this._eventTracksNeeded=b}};Timeline._Band.prototype.checkAutoWidth=function(){if(!this._timeline.autoWidth){return}var a=this._eventPainter.getType()=="overview";var c=a?this._theme.event.overviewTrack.autoWidthMargin:this._theme.event.track.autoWidthMargin;var b=Math.ceil((this._eventTracksNeeded+c)*this._eventTrackIncrement);b+=a?this._theme.event.overviewTrack.offset:this._theme.event.track.offset;var d=this._bandInfo;if(b!=d.width){d.width=b}};Timeline._Band.prototype.layout=function(){this.paint()};Timeline._Band.prototype.paint=function(){this._etherPainter.paint();this._paintDecorators();this._paintEvents()};Timeline._Band.prototype.softLayout=function(){this.softPaint()};Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint();this._softPaintDecorators();this._softPaintEvents()};Timeline._Band.prototype.setBandShiftAndWidth=function(a,d){var c=this._keyboardInput.parentNode;var b=a+Math.floor(d/2);if(this._timeline.isHorizontal()){this._div.style.top=a+"px";this._div.style.height=d+"px";c.style.top=b+"px";c.style.left="-1em"}else{this._div.style.left=a+"px";this._div.style.width=d+"px";c.style.left=b+"px";c.style.top="-1em"}};Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetHeight}else{return this._div.offsetWidth}};Timeline._Band.prototype.setViewLength=function(a){this._viewLength=a;this._recenterDiv();this._onChanging()};Timeline._Band.prototype.getViewLength=function(){return this._viewLength};Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength};Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset};Timeline._Band.prototype.getMinDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset)};Timeline._Band.prototype.getMaxDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset+Timeline._Band.SCROLL_MULTIPLES*this._viewLength)};Timeline._Band.prototype.getMinVisibleDate=function(){return this._ether.pixelOffsetToDate(0)};Timeline._Band.prototype.getMinVisibleDateAfterDelta=function(a){return this._ether.pixelOffsetToDate(a)};Timeline._Band.prototype.getMaxVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength)};Timeline._Band.prototype.getMaxVisibleDateAfterDelta=function(a){return this._ether.pixelOffsetToDate(this._viewLength+a)};Timeline._Band.prototype.getCenterVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength/2)};Timeline._Band.prototype.setMinVisibleDate=function(a){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(a)))}};Timeline._Band.prototype.setMaxVisibleDate=function(a){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(a)))}};Timeline._Band.prototype.setCenterVisibleDate=function(a){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(a)))}};Timeline._Band.prototype.dateToPixelOffset=function(a){return this._ether.dateToPixelOffset(a)-this._viewOffset};Timeline._Band.prototype.pixelOffsetToDate=function(a){return this._ether.pixelOffsetToDate(a+this._viewOffset)};Timeline._Band.prototype.getViewOrthogonalOffset=function(){return this._viewOrthogonalOffset};Timeline._Band.prototype.setViewOrthogonalOffset=function(a){this._viewOrthogonalOffset=Math.max(0,a)};Timeline._Band.prototype.createLayerDiv=function(d,b){var c=this._timeline.getDocument().createElement("div");c.className="timeline-band-layer"+(typeof b=="string"?(" "+b):"");c.style.zIndex=d;this._innerDiv.appendChild(c);var a=this._timeline.getDocument().createElement("div");a.className="timeline-band-layer-inner";if(SimileAjax.Platform.browser.isIE){a.style.cursor="move"}else{a.style.cursor="-moz-grab"}c.appendChild(a);return a};Timeline._Band.prototype.removeLayerDiv=function(a){this._innerDiv.removeChild(a.parentNode)};Timeline._Band.prototype.scrollToCenter=function(b,c){var a=this._ether.dateToPixelOffset(b);if(a<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(a+this._viewLength))}else{if(a>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(a-this._viewLength))}}this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(b)),c)};Timeline._Band.prototype.showBubbleForEvent=function(c){var a=this.getEventSource().getEvent(c);if(a){var b=this;this.scrollToCenter(a.getStart(),function(){b._eventPainter.showBubble(a)})}};Timeline._Band.prototype.zoom=function(f,a,e,c){if(!this._zoomSteps){return}a+=this._viewOffset;var d=this._ether.pixelOffsetToDate(a);var b=this._ether.zoom(f);this._etherPainter.zoom(b);this._moveEther(Math.round(-this._ether.dateToPixelOffset(d)));this._moveEther(a)};Timeline._Band.prototype._onMouseDown=function(b,a,c){this.closeBubble();this._dragging=true;this._dragX=a.clientX;this._dragY=a.clientY};Timeline._Band.prototype._onMouseMove=function(d,a,e){if(this._dragging){var c=a.clientX-this._dragX;var b=a.clientY-this._dragY;this._dragX=a.clientX;this._dragY=a.clientY;if(this._timeline.isHorizontal()){this._moveEther(c,b)}else{this._moveEther(b,c)}this._positionHighlight()}};Timeline._Band.prototype._onMouseUp=function(b,a,c){this._dragging=false;this._keyboardInput.focus()};Timeline._Band.prototype._onMouseOut=function(b,a,d){var c=SimileAjax.DOM.getEventRelativeCoordinates(a,b);c.x+=this._viewOffset;if(c.x<0||c.x>b.offsetWidth||c.y<0||c.y>b.offsetHeight){this._dragging=false}};Timeline._Band.prototype._onMouseScroll=function(g,i,e){var a=new Date();a=a.getTime();if(!this._lastScrollTime||((a-this._lastScrollTime)>50)){this._lastScrollTime=a;var h=0;if(i.wheelDelta){h=i.wheelDelta/120}else{if(i.detail){h=-i.detail/3}}var f=this._theme.mouseWheel;if(this._zoomSteps||f==="zoom"){var d=SimileAjax.DOM.getEventRelativeCoordinates(i,g);if(h!=0){var c;if(h>0){c=true}if(h<0){c=false}this._timeline.zoom(c,d.x,d.y,g)}}else{if(f==="scroll"){var b=50*(h<0?-1:1);this._moveEther(b)}}}if(i.stopPropagation){i.stopPropagation()}i.cancelBubble=true;if(i.preventDefault){i.preventDefault()}i.returnValue=false};Timeline._Band.prototype._onDblClick=function(b,a,d){var c=SimileAjax.DOM.getEventRelativeCoordinates(a,b);var e=c.x-(this._viewLength/2-this._viewOffset);this._autoScroll(-e)};Timeline._Band.prototype._onKeyDown=function(b,a,c){if(!this._dragging){switch(a.keyCode){case 27:break;case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;default:return true}this.closeBubble();SimileAjax.DOM.cancelEvent(a);return false}return true};Timeline._Band.prototype._onKeyUp=function(b,a,c){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed;switch(a.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate());break;case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate());break;case 33:this._autoScroll(this._timeline.getPixelLength());break;case 34:this._autoScroll(-this._timeline.getPixelLength());break;default:return true}this.closeBubble();SimileAjax.DOM.cancelEvent(a);return false}return true};Timeline._Band.prototype._autoScroll=function(g,e){var c=this;var d=SimileAjax.Graphics.createAnimation(function(a,b){c._moveEther(b)},0,g,1000,e);d.run()};Timeline._Band.prototype._moveEther=function(a,b){if(b===undefined){b=0}this.closeBubble();if(!this._timeline.shiftOK(this._index,a)){return}this._viewOffset+=a;this._viewOrthogonalOffset=Math.min(0,this._viewOrthogonalOffset+b);this._ether.shiftPixels(-a);if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px"}else{this._div.style.top=this._viewOffset+"px"}if(this._viewOffset>-this._viewLength*0.5||this._viewOffset<-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)){this._recenterDiv()}else{this.softLayout()}this._onChanging()};Timeline._Band.prototype._onChanging=function(){this._changing=true;this._fireOnScroll();this._setSyncWithBandDate();this._changing=false};Timeline._Band.prototype.busy=function(){return(this._changing)};Timeline._Band.prototype._fireOnScroll=function(){for(var a=0;a<this._onScrollListeners.length;a++){this._onScrollListeners[a](this)}};Timeline._Band.prototype._setSyncWithBandDate=function(){if(this._syncWithBand){var a=this._ether.pixelOffsetToDate(this.getViewLength()/2);this._syncWithBand.setCenterVisibleDate(a)}};Timeline._Band.prototype._onHighlightBandScroll=function(){if(this._syncWithBand){var a=this._syncWithBand.getCenterVisibleDate();var b=this._ether.dateToPixelOffset(a);this._moveEther(Math.round(this._viewLength/2-b));if(this._highlight){this._etherPainter.setHighlight(this._syncWithBand.getMinVisibleDate(),this._syncWithBand.getMaxVisibleDate())}}};Timeline._Band.prototype._onAddMany=function(){this._paintEvents()};Timeline._Band.prototype._onClear=function(){this._paintEvents()};Timeline._Band.prototype._positionHighlight=function(){if(this._syncWithBand){var a=this._syncWithBand.getMinVisibleDate();var b=this._syncWithBand.getMaxVisibleDate();if(this._highlight){this._etherPainter.setHighlight(a,b)}}};Timeline._Band.prototype._recenterDiv=function(){this._viewOffset=-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1)/2;if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";this._div.style.width=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px"}else{this._div.style.top=this._viewOffset+"px";this._div.style.height=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px"}this.layout()};Timeline._Band.prototype._paintEvents=function(){this._eventPainter.paint()};Timeline._Band.prototype._softPaintEvents=function(){this._eventPainter.softPaint()};Timeline._Band.prototype._paintDecorators=function(){for(var a=0;a<this._decorators.length;a++){this._decorators[a].paint()}};Timeline._Band.prototype._softPaintDecorators=function(){for(var a=0;a<this._decorators.length;a++){this._decorators[a].softPaint()}};Timeline._Band.prototype.closeBubble=function(){SimileAjax.WindowManager.cancelPopups()};Timeline.ClassicTheme=new Object();Timeline.ClassicTheme.implementations=[];Timeline.ClassicTheme.create=function(a){if(a==null){a=Timeline.getDefaultLocale()}var b=Timeline.ClassicTheme.implementations[a];if(b==null){b=Timeline.ClassicTheme._Impl}return new b()};Timeline.ClassicTheme._Impl=function(){this.firstDayOfWeek=0;this.autoWidth=false;this.autoWidthAnimationTime=500;this.timeline_start=null;this.timeline_stop=null;this.ether={backgroundColors:[],highlightOpacity:50,interval:{line:{show:true,opacity:25},weekend:{opacity:30},marker:{hAlign:"Bottom",vAlign:"Right"}}};this.event={track:{height:10,gap:2,offset:2,autoWidthMargin:1.5},overviewTrack:{offset:20,tickHeight:6,height:2,gap:1,autoWidthMargin:5},tape:{height:4},instant:{icon:Timeline.urlPrefix+"images/dull-blue-circle.png",iconWidth:10,iconHeight:10,impreciseOpacity:20,impreciseIconMargin:3},duration:{impreciseOpacity:20},label:{backgroundOpacity:50,offsetFromLine:3},highlightColors:["#FFFF00","#FFC000","#FF0000","#0000FF"],highlightLabelBackground:false,bubble:{width:250,maxHeight:0,titleStyler:function(a){a.className="timeline-event-bubble-title"},bodyStyler:function(a){a.className="timeline-event-bubble-body"},imageStyler:function(a){a.className="timeline-event-bubble-image"},wikiStyler:function(a){a.className="timeline-event-bubble-wiki"},timeStyler:function(a){a.className="timeline-event-bubble-time"}}};this.mouseWheel="scroll"};Timeline.LinearEther=function(a){this._params=a;this._interval=a.interval;this._pixelsPerInterval=a.pixelsPerInterval};Timeline.LinearEther.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._unit=a.getUnit();if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn)}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);this.shiftPixels(-this._timeline.getPixelLength())}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);this.shiftPixels(-this._timeline.getPixelLength()/2)}else{this._start=this._unit.makeDefaultValue();this.shiftPixels(-this._timeline.getPixelLength()/2)}}}};Timeline.LinearEther.prototype.setDate=function(a){this._start=this._unit.cloneValue(a)};Timeline.LinearEther.prototype.shiftPixels=function(b){var a=this._interval*b/this._pixelsPerInterval;this._start=this._unit.change(this._start,a)};Timeline.LinearEther.prototype.dateToPixelOffset=function(a){var b=this._unit.compare(a,this._start);return this._pixelsPerInterval*b/this._interval};Timeline.LinearEther.prototype.pixelOffsetToDate=function(b){var a=b*this._interval/this._pixelsPerInterval;return this._unit.change(this._start,a)};Timeline.LinearEther.prototype.zoom=function(d){var b=0;var a=this._band._zoomIndex;var c=a;if(d&&(a>0)){c=a-1}if(!d&&(a<(this._band._zoomSteps.length-1))){c=a+1}this._band._zoomIndex=c;this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[c].unit];this._pixelsPerInterval=this._band._zoomSteps[c].pixelsPerInterval;b=this._band._zoomSteps[c].unit-this._band._zoomSteps[a].unit;return b};Timeline.HotZoneEther=function(a){this._params=a;this._interval=a.interval;this._pixelsPerInterval=a.pixelsPerInterval;this._theme=a.theme};Timeline.HotZoneEther.prototype.initialize=function(h,k){this._band=h;this._timeline=k;this._unit=k.getUnit();this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}];var b=this._params;for(var d=0;d<b.zones.length;d++){var g=b.zones[d];var e=this._unit.parseFromObject(g.start);var f=this._unit.parseFromObject(g.end);for(var c=0;c<this._zones.length&&this._unit.compare(f,e)>0;c++){var a=this._zones[c];if(this._unit.compare(e,a.endTime)<0){if(this._unit.compare(e,a.startTime)>0){this._zones.splice(c,0,{startTime:a.startTime,endTime:e,magnify:a.magnify});c++;a.startTime=e}if(this._unit.compare(f,a.endTime)<0){this._zones.splice(c,0,{startTime:e,endTime:f,magnify:g.magnify*a.magnify});c++;a.startTime=f;e=f}else{a.magnify*=g.magnify;e=a.endTime}}}}if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn)}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);this.shiftPixels(-this._timeline.getPixelLength())}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);this.shiftPixels(-this._timeline.getPixelLength()/2)}else{this._start=this._unit.makeDefaultValue();this.shiftPixels(-this._timeline.getPixelLength()/2)}}}};Timeline.HotZoneEther.prototype.setDate=function(a){this._start=this._unit.cloneValue(a)};Timeline.HotZoneEther.prototype.shiftPixels=function(a){this._start=this.pixelOffsetToDate(a)};Timeline.HotZoneEther.prototype.dateToPixelOffset=function(a){return this._dateDiffToPixelOffset(this._start,a)};Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(a){return this._pixelOffsetToDate(a,this._start)};Timeline.HotZoneEther.prototype.zoom=function(d){var b=0;var a=this._band._zoomIndex;var c=a;if(d&&(a>0)){c=a-1}if(!d&&(a<(this._band._zoomSteps.length-1))){c=a+1}this._band._zoomIndex=c;this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[c].unit];this._pixelsPerInterval=this._band._zoomSteps[c].pixelsPerInterval;b=this._band._zoomSteps[c].unit-this._band._zoomSteps[a].unit;return b};Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(i,d){var b=this._getScale();var h=i;var c=d;var a=0;if(this._unit.compare(h,c)<0){var g=0;while(g<this._zones.length){if(this._unit.compare(h,this._zones[g].endTime)<0){break}g++}while(this._unit.compare(h,c)<0){var e=this._zones[g];var f=this._unit.earlier(c,e.endTime);a+=(this._unit.compare(f,h)/(b/e.magnify));h=f;g++}}else{var g=this._zones.length-1;while(g>=0){if(this._unit.compare(h,this._zones[g].startTime)>0){break}g--}while(this._unit.compare(h,c)>0){var e=this._zones[g];var f=this._unit.later(c,e.startTime);a+=(this._unit.compare(f,h)/(b/e.magnify));h=f;g--}}return a};Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(h,c){var g=this._getScale();var e=c;if(h>0){var f=0;while(f<this._zones.length){if(this._unit.compare(e,this._zones[f].endTime)<0){break}f++}while(h>0){var a=this._zones[f];var d=g/a.magnify;if(a.endTime==Number.POSITIVE_INFINITY){e=this._unit.change(e,h*d);h=0}else{var b=this._unit.compare(a.endTime,e)/d;if(b>h){e=this._unit.change(e,h*d);h=0}else{e=a.endTime;h-=b}}f++}}else{var f=this._zones.length-1;while(f>=0){if(this._unit.compare(e,this._zones[f].startTime)>0){break}f--}h=-h;while(h>0){var a=this._zones[f];var d=g/a.magnify;if(a.startTime==Number.NEGATIVE_INFINITY){e=this._unit.change(e,-h*d);h=0}else{var b=this._unit.compare(e,a.startTime)/d;if(b>h){e=this._unit.change(e,-h*d);h=0}else{e=a.startTime;h-=b}}f--}}return e};Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval};Timeline.GregorianEtherPainter=function(a){this._params=a;this._theme=a.theme;this._unit=a.unit;this._multiple=("multiple" in a)?a.multiple:1};Timeline.GregorianEtherPainter.prototype.initialize=function(c,b){this._band=c;this._timeline=b;this._backgroundLayer=c.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.className="timeline-ether-bg";this._markerLayer=null;this._lineLayer=null;var d=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[b.isHorizontal()?"hAlign":"vAlign"];var a=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,d,a);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.GregorianEtherPainter.prototype.setHighlight=function(a,b){this._highlight.position(a,b)};Timeline.GregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var c=this._band.getMinDate();var f=this._band.getMaxDate();var b=this._band.getTimeZone();var e=this._band.getLabeller();SimileAjax.DateTime.roundDownToInterval(c,this._unit,b,this._multiple,this._theme.firstDayOfWeek);var d=this;var a=function(g){for(var h=0;h<d._multiple;h++){SimileAjax.DateTime.incrementByInterval(g,d._unit)}};while(c.getTime()<f.getTime()){this._intervalMarkerLayout.createIntervalMarker(c,e,this._unit,this._markerLayer,this._lineLayer);a(c)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.GregorianEtherPainter.prototype.softPaint=function(){};Timeline.GregorianEtherPainter.prototype.zoom=function(a){if(a!=0){this._unit+=a}};Timeline.HotZoneGregorianEtherPainter=function(g){this._params=g;this._theme=g.theme;this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,unit:g.unit,multiple:1}];for(var e=0;e<g.zones.length;e++){var b=g.zones[e];var d=SimileAjax.DateTime.parseGregorianDateTime(b.start).getTime();var f=SimileAjax.DateTime.parseGregorianDateTime(b.end).getTime();for(var c=0;c<this._zones.length&&f>d;c++){var a=this._zones[c];if(d<a.endTime){if(d>a.startTime){this._zones.splice(c,0,{startTime:a.startTime,endTime:d,unit:a.unit,multiple:a.multiple});c++;a.startTime=d}if(f<a.endTime){this._zones.splice(c,0,{startTime:d,endTime:f,unit:b.unit,multiple:(b.multiple)?b.multiple:1});c++;a.startTime=f;d=f}else{a.multiple=b.multiple;a.unit=b.unit;d=a.endTime}}}}};Timeline.HotZoneGregorianEtherPainter.prototype.initialize=function(c,b){this._band=c;this._timeline=b;this._backgroundLayer=c.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.className="timeline-ether-bg";this._markerLayer=null;this._lineLayer=null;var d=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[b.isHorizontal()?"hAlign":"vAlign"];var a=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,d,a);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.HotZoneGregorianEtherPainter.prototype.setHighlight=function(a,b){this._highlight.position(a,b)};Timeline.HotZoneGregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var d=this._band.getMinDate();var a=this._band.getMaxDate();var k=this._band.getTimeZone();var i=this._band.getLabeller();var b=this;var l=function(o,m){for(var p=0;p<m.multiple;p++){SimileAjax.DateTime.incrementByInterval(o,m.unit)}};var c=0;while(c<this._zones.length){if(d.getTime()<this._zones[c].endTime){break}c++}var e=this._zones.length-1;while(e>=0){if(a.getTime()>this._zones[e].startTime){break}e--}for(var h=c;h<=e;h++){var g=this._zones[h];var j=new Date(Math.max(d.getTime(),g.startTime));var f=new Date(Math.min(a.getTime(),g.endTime));SimileAjax.DateTime.roundDownToInterval(j,g.unit,k,g.multiple,this._theme.firstDayOfWeek);SimileAjax.DateTime.roundUpToInterval(f,g.unit,k,g.multiple,this._theme.firstDayOfWeek);while(j.getTime()<f.getTime()){this._intervalMarkerLayout.createIntervalMarker(j,i,g.unit,this._markerLayer,this._lineLayer);l(j,g)}}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.HotZoneGregorianEtherPainter.prototype.softPaint=function(){};Timeline.HotZoneGregorianEtherPainter.prototype.zoom=function(b){if(b!=0){for(var a=0;a<this._zones.length;++a){if(this._zones[a]){this._zones[a].unit+=b}}}};Timeline.YearCountEtherPainter=function(a){this._params=a;this._theme=a.theme;this._startDate=SimileAjax.DateTime.parseGregorianDateTime(a.startDate);this._multiple=("multiple" in a)?a.multiple:1};Timeline.YearCountEtherPainter.prototype.initialize=function(c,b){this._band=c;this._timeline=b;this._backgroundLayer=c.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.className="timeline-ether-bg";this._markerLayer=null;this._lineLayer=null;var d=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[b.isHorizontal()?"hAlign":"vAlign"];var a=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,d,a);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.YearCountEtherPainter.prototype.setHighlight=function(a,b){this._highlight.position(a,b)};Timeline.YearCountEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var b=new Date(this._startDate.getTime());var f=this._band.getMaxDate();var e=this._band.getMinDate().getUTCFullYear()-this._startDate.getUTCFullYear();b.setUTCFullYear(this._band.getMinDate().getUTCFullYear()-e%this._multiple);var c=this;var a=function(g){for(var h=0;h<c._multiple;h++){SimileAjax.DateTime.incrementByInterval(g,SimileAjax.DateTime.YEAR)}};var d={labelInterval:function(g,i){var h=g.getUTCFullYear()-c._startDate.getUTCFullYear();return{text:h,emphasized:h==0}}};while(b.getTime()<f.getTime()){this._intervalMarkerLayout.createIntervalMarker(b,d,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);a(b)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.YearCountEtherPainter.prototype.softPaint=function(){};Timeline.QuarterlyEtherPainter=function(a){this._params=a;this._theme=a.theme;this._startDate=SimileAjax.DateTime.parseGregorianDateTime(a.startDate)};Timeline.QuarterlyEtherPainter.prototype.initialize=function(c,b){this._band=c;this._timeline=b;this._backgroundLayer=c.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.className="timeline-ether-bg";this._markerLayer=null;this._lineLayer=null;var d=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[b.isHorizontal()?"hAlign":"vAlign"];var a=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,d,a);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.QuarterlyEtherPainter.prototype.setHighlight=function(a,b){this._highlight.position(a,b)};Timeline.QuarterlyEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var b=new Date(0);var e=this._band.getMaxDate();b.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(),this._band.getMinDate().getUTCFullYear()));b.setUTCMonth(this._startDate.getUTCMonth());var c=this;var a=function(f){f.setUTCMonth(f.getUTCMonth()+3)};var d={labelInterval:function(f,h){var g=(4+(f.getUTCMonth()-c._startDate.getUTCMonth())/3)%4;if(g!=0){return{text:"Q"+(g+1),emphasized:false}}else{return{text:"Y"+(f.getUTCFullYear()-c._startDate.getUTCFullYear()+1),emphasized:true}}}};while(b.getTime()<e.getTime()){this._intervalMarkerLayout.createIntervalMarker(b,d,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);a(b)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.QuarterlyEtherPainter.prototype.softPaint=function(){};Timeline.EtherIntervalMarkerLayout=function(m,l,c,e,h){var a=m.isHorizontal();if(a){if(e=="Top"){this.positionDiv=function(p,o){p.style.left=o+"px";p.style.top="0px"}}else{this.positionDiv=function(p,o){p.style.left=o+"px";p.style.bottom="0px"}}}else{if(e=="Left"){this.positionDiv=function(p,o){p.style.top=o+"px";p.style.left="0px"}}else{this.positionDiv=function(p,o){p.style.top=o+"px";p.style.right="0px"}}}var d=c.ether.interval.marker;var i=c.ether.interval.line;var b=c.ether.interval.weekend;var k=(a?"h":"v")+e;var g=d[k+"Styler"];var j=d[k+"EmphasizedStyler"];var f=SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY];this.createIntervalMarker=function(u,C,D,E,r){var v=Math.round(l.dateToPixelOffset(u));if(h&&D!=SimileAjax.DateTime.WEEK){var w=m.getDocument().createElement("div");w.className="timeline-ether-lines";if(i.opacity<100){SimileAjax.Graphics.setOpacity(w,i.opacity)}if(a){w.style.left=v+"px"}else{w.style.top=v+"px"}r.appendChild(w)}if(D==SimileAjax.DateTime.WEEK){var o=c.firstDayOfWeek;var x=new Date(u.getTime()+(6-o-7)*f);var B=new Date(x.getTime()+2*f);var y=Math.round(l.dateToPixelOffset(x));var t=Math.round(l.dateToPixelOffset(B));var s=Math.max(1,t-y);var q=m.getDocument().createElement("div");q.className="timeline-ether-weekends";if(b.opacity<100){SimileAjax.Graphics.setOpacity(q,b.opacity)}if(a){q.style.left=y+"px";q.style.width=s+"px"}else{q.style.top=y+"px";q.style.height=s+"px"}r.appendChild(q)}var z=C.labelInterval(u,D);var p=m.getDocument().createElement("div");p.innerHTML=z.text;p.className="timeline-date-label";if(z.emphasized){p.className+=" timeline-date-label-em"}this.positionDiv(p,v);E.appendChild(p);return p}};Timeline.EtherHighlight=function(c,e,d,b){var a=c.isHorizontal();this._highlightDiv=null;this._createHighlightDiv=function(){if(this._highlightDiv==null){this._highlightDiv=c.getDocument().createElement("div");this._highlightDiv.setAttribute("name","ether-highlight");this._highlightDiv.className="timeline-ether-highlight";var f=d.ether.highlightOpacity;if(f<100){SimileAjax.Graphics.setOpacity(this._highlightDiv,f)}b.appendChild(this._highlightDiv)}};this.position=function(f,i){this._createHighlightDiv();var j=Math.round(e.dateToPixelOffset(f));var h=Math.round(e.dateToPixelOffset(i));var g=Math.max(h-j,3);if(a){this._highlightDiv.style.left=j+"px";this._highlightDiv.style.width=g+"px";this._highlightDiv.style.height=(e.getViewWidth()-4)+"px"}else{this._highlightDiv.style.top=j+"px";this._highlightDiv.style.height=g+"px";this._highlightDiv.style.width=(e.getViewWidth()-4)+"px"}}};Timeline.EventUtils={};Timeline.EventUtils.getNewEventID=function(){if(this._lastEventID==null){this._lastEventID=0}this._lastEventID+=1;return"e"+this._lastEventID};Timeline.EventUtils.decodeEventElID=function(b){var d=b.split("-");if(d[1]!="tl"){alert("Internal Timeline problem 101, please consult support");return{band:null,evt:null}}var c=Timeline.getTimelineFromID(d[2]);var e=c.getBand(d[3]);var a=e.getEventSource.getEvent(d[4]);return{band:e,evt:a}};Timeline.EventUtils.encodeEventElID=function(c,d,b,a){return b+"-tl-"+c.timelineID+"-"+d.getIndex()+"-"+a.getID()};Timeline.GregorianDateLabeller=function(a,b){this._locale=a;this._timeZone=b};Timeline.GregorianDateLabeller.monthNames=[];Timeline.GregorianDateLabeller.dayNames=[];Timeline.GregorianDateLabeller.labelIntervalFunctions=[];Timeline.GregorianDateLabeller.getMonthName=function(b,a){return Timeline.GregorianDateLabeller.monthNames[a][b]};Timeline.GregorianDateLabeller.prototype.labelInterval=function(a,c){var b=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale];if(b==null){b=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval}return b.call(this,a,c)};Timeline.GregorianDateLabeller.prototype.labelPrecise=function(a){return SimileAjax.DateTime.removeTimeZoneOffset(a,this._timeZone).toUTCString()};Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(b,f){var c;var e=false;b=SimileAjax.DateTime.removeTimeZoneOffset(b,this._timeZone);switch(f){case SimileAjax.DateTime.MILLISECOND:c=b.getUTCMilliseconds();break;case SimileAjax.DateTime.SECOND:c=b.getUTCSeconds();break;case SimileAjax.DateTime.MINUTE:var a=b.getUTCMinutes();if(a==0){c=b.getUTCHours()+":00";e=true}else{c=a}break;case SimileAjax.DateTime.HOUR:c=b.getUTCHours()+"hr";break;case SimileAjax.DateTime.DAY:c=Timeline.GregorianDateLabeller.getMonthName(b.getUTCMonth(),this._locale)+" "+b.getUTCDate();break;case SimileAjax.DateTime.WEEK:c=Timeline.GregorianDateLabeller.getMonthName(b.getUTCMonth(),this._locale)+" "+b.getUTCDate();break;case SimileAjax.DateTime.MONTH:var a=b.getUTCMonth();if(a!=0){c=Timeline.GregorianDateLabeller.getMonthName(a,this._locale);break}case SimileAjax.DateTime.YEAR:case SimileAjax.DateTime.DECADE:case SimileAjax.DateTime.CENTURY:case SimileAjax.DateTime.MILLENNIUM:var d=b.getUTCFullYear();if(d>0){c=b.getUTCFullYear()}else{c=(1-d)+"BC"}e=(f==SimileAjax.DateTime.MONTH)||(f==SimileAjax.DateTime.DECADE&&d%100==0)||(f==SimileAjax.DateTime.CENTURY&&d%1000==0);break;default:c=b.toUTCString()}return{text:c,emphasized:e}};Timeline.DefaultEventSource=function(a){this._events=(a instanceof Object)?a:new SimileAjax.EventIndex();this._listeners=[]};Timeline.DefaultEventSource.prototype.addListener=function(a){this._listeners.push(a)};Timeline.DefaultEventSource.prototype.removeListener=function(b){for(var a=0;a<this._listeners.length;a++){if(this._listeners[a]==b){this._listeners.splice(a,1);break}}};Timeline.DefaultEventSource.prototype.loadXML=function(g,a){var c=this._getBaseURL(a);var h=g.documentElement.getAttribute("wiki-url");var l=g.documentElement.getAttribute("wiki-section");var e=g.documentElement.getAttribute("date-time-format");var f=this._events.getUnit().getParser(e);var d=g.documentElement.firstChild;var i=false;while(d!=null){if(d.nodeType==1){var k="";if(d.firstChild!=null&&d.firstChild.nodeType==3){k=d.firstChild.nodeValue}var b=(d.getAttribute("isDuration")===null&&d.getAttribute("durationEvent")===null)||d.getAttribute("isDuration")=="false"||d.getAttribute("durationEvent")=="false";var j=new Timeline.DefaultEventSource.Event({id:d.getAttribute("id"),start:f(d.getAttribute("start")),end:f(d.getAttribute("end")),latestStart:f(d.getAttribute("latestStart")),earliestEnd:f(d.getAttribute("earliestEnd")),instant:b,text:d.getAttribute("title"),description:k,image:this._resolveRelativeURL(d.getAttribute("image"),c),link:this._resolveRelativeURL(d.getAttribute("link"),c),icon:this._resolveRelativeURL(d.getAttribute("icon"),c),color:d.getAttribute("color"),textColor:d.getAttribute("textColor"),hoverText:d.getAttribute("hoverText"),classname:d.getAttribute("classname"),tapeImage:d.getAttribute("tapeImage"),tapeRepeat:d.getAttribute("tapeRepeat"),caption:d.getAttribute("caption"),eventID:d.getAttribute("eventID"),trackNum:d.getAttribute("trackNum")});j._node=d;j.getProperty=function(m){return this._node.getAttribute(m)};j.setWikiInfo(h,l);this._events.add(j);i=true}d=d.nextSibling}if(i){this._fire("onAddMany",[])}};Timeline.DefaultEventSource.prototype.loadJSON=function(g,b){var d=this._getBaseURL(b);var k=false;if(g&&g.events){var j=("wikiURL" in g)?g.wikiURL:null;var m=("wikiSection" in g)?g.wikiSection:null;var e=("dateTimeFormat" in g)?g.dateTimeFormat:null;var h=this._events.getUnit().getParser(e);for(var f=0;f<g.events.length;f++){var a=g.events[f];var c=a.isDuration||(a.durationEvent!=null&&!a.durationEvent);var l=new Timeline.DefaultEventSource.Event({id:("id" in a)?a.id:undefined,start:h(a.start),end:h(a.end),latestStart:h(a.latestStart),earliestEnd:h(a.earliestEnd),instant:c,text:a.title,description:a.description,image:this._resolveRelativeURL(a.image,d),link:this._resolveRelativeURL(a.link,d),icon:this._resolveRelativeURL(a.icon,d),color:a.color,textColor:a.textColor,hoverText:a.hoverText,classname:a.classname,tapeImage:a.tapeImage,tapeRepeat:a.tapeRepeat,caption:a.caption,eventID:a.eventID,trackNum:a.trackNum});l._obj=a;l.getProperty=function(i){return this._obj[i]};l.setWikiInfo(j,m);this._events.add(l);k=true}}if(k){this._fire("onAddMany",[])}};Timeline.DefaultEventSource.prototype.loadSPARQL=function(h,a){var d=this._getBaseURL(a);var f="iso8601";var g=this._events.getUnit().getParser(f);if(h==null){return}var e=h.documentElement.firstChild;while(e!=null&&(e.nodeType!=1||e.nodeName!="results")){e=e.nextSibling}var j=null;var m=null;if(e!=null){j=e.getAttribute("wiki-url");m=e.getAttribute("wiki-section");e=e.firstChild}var k=false;while(e!=null){if(e.nodeType==1){var c={};var i=e.firstChild;while(i!=null){if(i.nodeType==1&&i.firstChild!=null&&i.firstChild.nodeType==1&&i.firstChild.firstChild!=null&&i.firstChild.firstChild.nodeType==3){c[i.getAttribute("name")]=i.firstChild.firstChild.nodeValue}i=i.nextSibling}if(c.start==null&&c.date!=null){c.start=c.date}var b=(c.isDuration===null&&c.durationEvent===null)||c.isDuration=="false"||c.durationEvent=="false";var l=new Timeline.DefaultEventSource.Event({id:c.id,start:g(c.start),end:g(c.end),latestStart:g(c.latestStart),earliestEnd:g(c.earliestEnd),instant:b,text:c.title,description:c.description,image:this._resolveRelativeURL(c.image,d),link:this._resolveRelativeURL(c.link,d),icon:this._resolveRelativeURL(c.icon,d),color:c.color,textColor:c.textColor,hoverText:c.hoverText,caption:c.caption,classname:c.classname,tapeImage:c.tapeImage,tapeRepeat:c.tapeRepeat,eventID:c.eventID,trackNum:c.trackNum});l._bindings=c;l.getProperty=function(o){return this._bindings[o]};l.setWikiInfo(j,m);this._events.add(l);k=true}e=e.nextSibling}if(k){this._fire("onAddMany",[])}};Timeline.DefaultEventSource.prototype.add=function(a){this._events.add(a);this._fire("onAddOne",[a])};Timeline.DefaultEventSource.prototype.addMany=function(b){for(var a=0;a<b.length;a++){this._events.add(b[a])}this._fire("onAddMany",[])};Timeline.DefaultEventSource.prototype.clear=function(){this._events.removeAll();this._fire("onClear",[])};Timeline.DefaultEventSource.prototype.getEvent=function(a){return this._events.getEvent(a)};Timeline.DefaultEventSource.prototype.getEventIterator=function(a,b){return this._events.getIterator(a,b)};Timeline.DefaultEventSource.prototype.getEventReverseIterator=function(a,b){return this._events.getReverseIterator(a,b)};Timeline.DefaultEventSource.prototype.getAllEventIterator=function(){return this._events.getAllIterator()};Timeline.DefaultEventSource.prototype.getCount=function(){return this._events.getCount()};Timeline.DefaultEventSource.prototype.getEarliestDate=function(){return this._events.getEarliestDate()};Timeline.DefaultEventSource.prototype.getLatestDate=function(){return this._events.getLatestDate()};Timeline.DefaultEventSource.prototype._fire=function(b,a){for(var c=0;c<this._listeners.length;c++){var d=this._listeners[c];if(b in d){try{d[b].apply(d,a)}catch(f){SimileAjax.Debug.exception(f)}}}};Timeline.DefaultEventSource.prototype._getBaseURL=function(a){if(a.indexOf("://")<0){var c=this._getBaseURL(document.location.href);if(a.substr(0,1)=="/"){a=c.substr(0,c.indexOf("/",c.indexOf("://")+3))+a}else{a=c+a}}var b=a.lastIndexOf("/");if(b<0){return""}else{return a.substr(0,b+1)}};Timeline.DefaultEventSource.prototype._resolveRelativeURL=function(a,b){if(a==null||a==""){return a}else{if(a.indexOf("://")>0){return a}else{if(a.substr(0,1)=="/"){return b.substr(0,b.indexOf("/",b.indexOf("://")+3))+a}else{return b+a}}}};Timeline.DefaultEventSource.Event=function(a){function d(e){return(a[e]!=null&&a[e]!="")?a[e]:null}var c=a.id?a.id.trim():"";this._id=c.length>0?c:Timeline.EventUtils.getNewEventID();this._instant=a.instant||(a.end==null);this._start=a.start;this._end=(a.end!=null)?a.end:a.start;this._latestStart=(a.latestStart!=null)?a.latestStart:(a.instant?this._end:this._start);this._earliestEnd=(a.earliestEnd!=null)?a.earliestEnd:this._end;var b=[];if(this._start>this._latestStart){this._latestStart=this._start;b.push("start is > latestStart")}if(this._start>this._earliestEnd){this._earliestEnd=this._latestStart;b.push("start is > earliestEnd")}if(this._start>this._end){this._end=this._earliestEnd;b.push("start is > end")}if(this._latestStart>this._earliestEnd){this._earliestEnd=this._latestStart;b.push("latestStart is > earliestEnd")}if(this._latestStart>this._end){this._end=this._earliestEnd;b.push("latestStart is > end")}if(this._earliestEnd>this._end){this._end=this._earliestEnd;b.push("earliestEnd is > end")}this._eventID=d("eventID");this._text=(a.text!=null)?SimileAjax.HTML.deEntify(a.text):"";if(b.length>0){this._text+=" PROBLEM: "+b.join(", ")}this._description=SimileAjax.HTML.deEntify(a.description);this._image=d("image");this._link=d("link");this._title=d("hoverText");this._title=d("caption");this._icon=d("icon");this._color=d("color");this._textColor=d("textColor");this._classname=d("classname");this._tapeImage=d("tapeImage");this._tapeRepeat=d("tapeRepeat");this._trackNum=d("trackNum");if(this._trackNum!=null){this._trackNum=parseInt(this._trackNum)}this._wikiURL=null;this._wikiSection=null};Timeline.DefaultEventSource.Event.prototype={getID:function(){return this._id},isInstant:function(){return this._instant},isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd},getStart:function(){return this._start},getEnd:function(){return this._end},getLatestStart:function(){return this._latestStart},getEarliestEnd:function(){return this._earliestEnd},getEventID:function(){return this._eventID},getText:function(){return this._text},getDescription:function(){return this._description},getImage:function(){return this._image},getLink:function(){return this._link},getIcon:function(){return this._icon},getColor:function(){return this._color},getTextColor:function(){return this._textColor},getClassName:function(){return this._classname},getTapeImage:function(){return this._tapeImage},getTapeRepeat:function(){return this._tapeRepeat},getTrackNum:function(){return this._trackNum},getProperty:function(a){return null},getWikiURL:function(){return this._wikiURL},getWikiSection:function(){return this._wikiSection},setWikiInfo:function(b,a){this._wikiURL=b;this._wikiSection=a},fillDescription:function(a){a.innerHTML=this._description},fillWikiInfo:function(e){e.style.display="none";if(this._wikiURL==null||this._wikiSection==null){return}var d=this.getProperty("wikiID");if(d==null||d.length==0){d=this.getText()}if(d==null||d.length==0){return}e.style.display="inline";d=d.replace(/\s/g,"_");var c=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+d;var b=document.createElement("a");b.href=c;b.target="new";b.innerHTML=Timeline.strings[Timeline.clientLocale].wikiLinkLabel;e.appendChild(document.createTextNode("["));e.appendChild(b);e.appendChild(document.createTextNode("]"))},fillTime:function(a,b){if(this._instant){if(this.isImprecise()){a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._start)));a.appendChild(a.ownerDocument.createElement("br"));a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._end)))}else{a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._start)))}}else{if(this.isImprecise()){a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._start)+" ~ "+b.labelPrecise(this._latestStart)));a.appendChild(a.ownerDocument.createElement("br"));a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._earliestEnd)+" ~ "+b.labelPrecise(this._end)))}else{a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._start)));a.appendChild(a.ownerDocument.createElement("br"));a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._end)))}}},fillInfoBubble:function(b,e,l){var m=b.ownerDocument;var k=this.getText();var i=this.getLink();var d=this.getImage();if(d!=null){var f=m.createElement("img");f.src=d;e.event.bubble.imageStyler(f);b.appendChild(f)}var o=m.createElement("div");var c=m.createTextNode(k);if(i!=null){var j=m.createElement("a");j.href=i;j.appendChild(c);o.appendChild(j)}else{o.appendChild(c)}e.event.bubble.titleStyler(o);b.appendChild(o);var p=m.createElement("div");this.fillDescription(p);e.event.bubble.bodyStyler(p);b.appendChild(p);var h=m.createElement("div");this.fillTime(h,l);e.event.bubble.timeStyler(h);b.appendChild(h);var g=m.createElement("div");this.fillWikiInfo(g);e.event.bubble.wikiStyler(g);b.appendChild(g)}};Timeline.OriginalEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._eventPaintListeners=[];this._filterMatcher=null;this._highlightMatcher=null;this._frc=null;this._eventIdToElmt={}};Timeline.OriginalEventPainter.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._backLayer=null;this._eventLayer=null;this._lineLayer=null;this._highlightLayer=null;this._eventIdToElmt=null};Timeline.OriginalEventPainter.prototype.getType=function(){return"original"};Timeline.OriginalEventPainter.prototype.addOnSelectListener=function(a){this._onSelectListeners.push(a)};Timeline.OriginalEventPainter.prototype.removeOnSelectListener=function(b){for(var a=0;a<this._onSelectListeners.length;a++){if(this._onSelectListeners[a]==b){this._onSelectListeners.splice(a,1);break}}};Timeline.OriginalEventPainter.prototype.addEventPaintListener=function(a){this._eventPaintListeners.push(a)};Timeline.OriginalEventPainter.prototype.removeEventPaintListener=function(b){for(var a=0;a<this._eventPaintListeners.length;a++){if(this._eventPaintListeners[a]==b){this._eventPaintListeners.splice(a,1);break}}};Timeline.OriginalEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher};Timeline.OriginalEventPainter.prototype.setFilterMatcher=function(a){this._filterMatcher=a};Timeline.OriginalEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher};Timeline.OriginalEventPainter.prototype.setHighlightMatcher=function(a){this._highlightMatcher=a};Timeline.OriginalEventPainter.prototype.paint=function(){var f=this._band.getEventSource();if(f==null){return}this._eventIdToElmt={};this._fireEventPaintListeners("paintStarting",null,null);this._prepareForPainting();var d=this._computeMetrics();var e=this._band.getMinDate();var h=this._band.getMaxDate();var b=(this._filterMatcher!=null)?this._filterMatcher:function(i){return true};var g=(this._highlightMatcher!=null)?this._highlightMatcher:function(i){return -1};var c=f.getEventReverseIterator(e,h);while(c.hasNext()){var a=c.next();if(b(a)){this.paintEvent(a,d,this._params.theme,g(a))}}this._highlightLayer.style.display="block";this._lineLayer.style.display="block";this._eventLayer.style.display="block";this._band.updateEventTrackInfo(this._tracks.length,d.trackIncrement);this._fireEventPaintListeners("paintEnded",null,null);this._setOrthogonalOffset(d)};Timeline.OriginalEventPainter.prototype.softPaint=function(){this._setOrthogonalOffset(this._computeMetrics())};Timeline.OriginalEventPainter.prototype._setOrthogonalOffset=function(a){var b=2*a.trackOffset+this._tracks.length*a.trackIncrement;var d=Math.min(0,this._band.getViewWidth()-b);var c=Math.max(d,this._band.getViewOrthogonalOffset());this._highlightLayer.style.top=this._lineLayer.style.top=this._eventLayer.style.top=c+"px"};Timeline.OriginalEventPainter.prototype._computeMetrics=function(){var c=this._params.theme.event;var b=Math.max(c.track.height,c.tape.height+this._frc.getLineHeight());var a={trackOffset:c.track.offset,trackHeight:b,trackGap:c.track.gap,trackIncrement:b+c.track.gap,icon:c.instant.icon,iconWidth:c.instant.iconWidth,iconHeight:c.instant.iconHeight,labelWidth:c.label.width,maxLabelChar:c.label.maxLabelChar,impreciseIconMargin:c.instant.impreciseIconMargin};return a};Timeline.OriginalEventPainter.prototype._prepareForPainting=function(){var b=this._band;if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");this._backLayer.style.visibility="hidden";var a=document.createElement("span");a.className="timeline-event-label";this._backLayer.appendChild(a);this._frc=SimileAjax.Graphics.getFontRenderingContext(a)}this._frc.update();this._tracks=[];if(this._highlightLayer!=null){b.removeLayerDiv(this._highlightLayer)}this._highlightLayer=b.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";if(this._lineLayer!=null){b.removeLayerDiv(this._lineLayer)}this._lineLayer=b.createLayerDiv(110,"timeline-band-lines");this._lineLayer.style.display="none";if(this._eventLayer!=null){b.removeLayerDiv(this._eventLayer)}this._eventLayer=b.createLayerDiv(115,"timeline-band-events");this._eventLayer.style.display="none"};Timeline.OriginalEventPainter.prototype.paintEvent=function(b,c,d,a){if(b.isInstant()){this.paintInstantEvent(b,c,d,a)}else{this.paintDurationEvent(b,c,d,a)}};Timeline.OriginalEventPainter.prototype.paintInstantEvent=function(b,c,d,a){if(b.isImprecise()){this.paintImpreciseInstantEvent(b,c,d,a)}else{this.paintPreciseInstantEvent(b,c,d,a)}};Timeline.OriginalEventPainter.prototype.paintDurationEvent=function(b,c,d,a){if(b.isImprecise()){this.paintImpreciseDurationEvent(b,c,d,a)}else{this.paintPreciseDurationEvent(b,c,d,a)}};Timeline.OriginalEventPainter.prototype.paintPreciseInstantEvent=function(m,r,t,s){var w=this._timeline.getDocument();var l=m.getText();var e=m.getStart();var c=Math.round(this._band.dateToPixelOffset(e));var a=Math.round(c+r.iconWidth/2);var k=Math.round(c-r.iconWidth/2);var h=this._getLabelDivClassName(m);var i=this._frc.computeSize(l,h);var x=a+t.event.label.offsetFromLine;var d=x+i.width;var v=d;var p=this._findFreeTrack(m,v);var u=Math.round(r.trackOffset+p*r.trackIncrement+r.trackHeight/2-i.height/2);var b=this._paintEventIcon(m,p,k,r,t,0);var q=this._paintEventLabel(m,l,x,u,i.width,i.height,t,h,s);var f=[b.elmt,q.elmt];var o=this;var j=function(y,z,B){return o._onClickInstantEvent(b.elmt,z,m)};SimileAjax.DOM.registerEvent(b.elmt,"mousedown",j);SimileAjax.DOM.registerEvent(q.elmt,"mousedown",j);var g=this._createHighlightDiv(s,b,t,m);if(g!=null){f.push(g)}this._fireEventPaintListeners("paintedEvent",m,f);this._eventIdToElmt[m.getID()]=b.elmt;this._tracks[p]=k};Timeline.OriginalEventPainter.prototype.paintImpreciseInstantEvent=function(q,u,z,w){var C=this._timeline.getDocument();var o=q.getText();var g=q.getStart();var x=q.getEnd();var d=Math.round(this._band.dateToPixelOffset(g));var b=Math.round(this._band.dateToPixelOffset(x));var a=Math.round(d+u.iconWidth/2);var m=Math.round(d-u.iconWidth/2);var j=this._getLabelDivClassName(q);var k=this._frc.computeSize(o,j);var D=a+z.event.label.offsetFromLine;var e=D+k.width;var B=Math.max(e,b);var s=this._findFreeTrack(q,B);var p=z.event.tape.height;var y=Math.round(u.trackOffset+s*u.trackIncrement+p);var c=this._paintEventIcon(q,s,m,u,z,p);var t=this._paintEventLabel(q,o,D,y,k.width,k.height,z,j,w);var v=q.getColor();v=v!=null?v:z.event.instant.impreciseColor;var f=this._paintEventTape(q,s,d,b,v,z.event.instant.impreciseOpacity,u,z,0);var h=[c.elmt,t.elmt,f.elmt];var r=this;var l=function(E,F,G){return r._onClickInstantEvent(c.elmt,F,q)};SimileAjax.DOM.registerEvent(c.elmt,"mousedown",l);SimileAjax.DOM.registerEvent(f.elmt,"mousedown",l);SimileAjax.DOM.registerEvent(t.elmt,"mousedown",l);var i=this._createHighlightDiv(w,c,z,q);if(i!=null){h.push(i)}this._fireEventPaintListeners("paintedEvent",q,h);this._eventIdToElmt[q.getID()]=c.elmt;this._tracks[s]=m};Timeline.OriginalEventPainter.prototype.paintPreciseDurationEvent=function(l,q,u,s){var x=this._timeline.getDocument();var k=l.getText();var e=l.getStart();var t=l.getEnd();var b=Math.round(this._band.dateToPixelOffset(e));var a=Math.round(this._band.dateToPixelOffset(t));var h=this._getLabelDivClassName(l);var i=this._frc.computeSize(k,h);var y=b;var c=y+i.width;var w=Math.max(c,a);var o=this._findFreeTrack(l,w);var v=Math.round(q.trackOffset+o*q.trackIncrement+u.event.tape.height);var r=l.getColor();r=r!=null?r:u.event.duration.color;var d=this._paintEventTape(l,o,b,a,r,100,q,u,0);var p=this._paintEventLabel(l,k,y,v,i.width,i.height,u,h,s);var f=[d.elmt,p.elmt];var m=this;var j=function(z,B,C){return m._onClickDurationEvent(d.elmt,B,l)};SimileAjax.DOM.registerEvent(d.elmt,"mousedown",j);SimileAjax.DOM.registerEvent(p.elmt,"mousedown",j);var g=this._createHighlightDiv(s,d,u,l);if(g!=null){f.push(g)}this._fireEventPaintListeners("paintedEvent",l,f);this._eventIdToElmt[l.getID()]=d.elmt;this._tracks[o]=b};Timeline.OriginalEventPainter.prototype.paintImpreciseDurationEvent=function(o,t,z,w){var D=this._timeline.getDocument();var m=o.getText();var e=o.getStart();var u=o.getLatestStart();var x=o.getEnd();var C=o.getEarliestEnd();var c=Math.round(this._band.dateToPixelOffset(e));var g=Math.round(this._band.dateToPixelOffset(u));var a=Math.round(this._band.dateToPixelOffset(x));var h=Math.round(this._band.dateToPixelOffset(C));var j=this._getLabelDivClassName(o);var k=this._frc.computeSize(m,j);var E=g;var b=E+k.width;var B=Math.max(b,a);var q=this._findFreeTrack(o,B);var y=Math.round(t.trackOffset+q*t.trackIncrement+z.event.tape.height);var v=o.getColor();v=v!=null?v:z.event.duration.color;var s=this._paintEventTape(o,q,c,a,z.event.duration.impreciseColor,z.event.duration.impreciseOpacity,t,z,0);var d=this._paintEventTape(o,q,g,h,v,100,t,z,1);var r=this._paintEventLabel(o,m,E,y,k.width,k.height,z,j,w);var f=[s.elmt,d.elmt,r.elmt];var p=this;var l=function(F,G,H){return p._onClickDurationEvent(d.elmt,G,o)};SimileAjax.DOM.registerEvent(d.elmt,"mousedown",l);SimileAjax.DOM.registerEvent(r.elmt,"mousedown",l);var i=this._createHighlightDiv(w,d,z,o);if(i!=null){f.push(i)}this._fireEventPaintListeners("paintedEvent",o,f);this._eventIdToElmt[o.getID()]=d.elmt;this._tracks[q]=c};Timeline.OriginalEventPainter.prototype._encodeEventElID=function(b,a){return Timeline.EventUtils.encodeEventElID(this._timeline,this._band,b,a)};Timeline.OriginalEventPainter.prototype._findFreeTrack=function(e,a){var d=e.getTrackNum();if(d!=null){return d}for(var c=0;c<this._tracks.length;c++){var b=this._tracks[c];if(b>a){break}}return c};Timeline.OriginalEventPainter.prototype._paintEventIcon=function(j,f,b,g,e,c){var i=j.getIcon();i=i!=null?i:g.icon;var h;if(c>0){h=g.trackOffset+f*g.trackIncrement+c+g.impreciseIconMargin}else{var k=g.trackOffset+f*g.trackIncrement+g.trackHeight/2;h=Math.round(k-g.iconHeight/2)}var d=SimileAjax.Graphics.createTranslucentImage(i);var a=this._timeline.getDocument().createElement("div");a.className=this._getElClassName("timeline-event-icon",j,"icon");a.id=this._encodeEventElID("icon",j);a.style.left=b+"px";a.style.top=h+"px";a.appendChild(d);if(j._title!=null){a.title=j._title}this._eventLayer.appendChild(a);return{left:b,top:h,width:g.iconWidth,height:g.iconHeight,elmt:a}};Timeline.OriginalEventPainter.prototype._paintEventLabel=function(j,k,c,h,a,l,e,f,b){var i=this._timeline.getDocument();var g=i.createElement("div");g.className=f;g.id=this._encodeEventElID("label",j);g.style.left=c+"px";g.style.width=a+"px";g.style.top=h+"px";g.innerHTML=k;if(j._title!=null){g.title=j._title}var d=j.getTextColor();if(d==null){d=j.getColor()}if(d!=null){g.style.color=d}if(e.event.highlightLabelBackground&&b>=0){g.style.background=this._getHighlightColor(b,e)}this._eventLayer.appendChild(g);return{left:c,top:h,width:a,height:l,elmt:g}};Timeline.OriginalEventPainter.prototype._paintEventTape=function(o,i,f,a,c,h,j,g,p){var b=a-f;var e=g.event.tape.height;var k=j.trackOffset+i*j.trackIncrement;var m=this._timeline.getDocument().createElement("div");m.className=this._getElClassName("timeline-event-tape",o,"tape");m.id=this._encodeEventElID("tape"+p,o);m.style.left=f+"px";m.style.width=b+"px";m.style.height=e+"px";m.style.top=k+"px";if(o._title!=null){m.title=o._title}if(c!=null){m.style.backgroundColor=c}var l=o.getTapeImage();var d=o.getTapeRepeat();d=d!=null?d:"repeat";if(l!=null){m.style.backgroundImage="url("+l+")";m.style.backgroundRepeat=d}SimileAjax.Graphics.setOpacity(m,h);this._eventLayer.appendChild(m);return{left:f,top:k,width:b,height:e,elmt:m}};Timeline.OriginalEventPainter.prototype._getLabelDivClassName=function(a){return this._getElClassName("timeline-event-label",a,"label")};Timeline.OriginalEventPainter.prototype._getElClassName=function(b,a,d){var e=a.getClassName(),c=[];if(e){if(d){c.push(d+"-"+e+" ")}c.push(e+" ")}c.push(b);return(c.join(""))};Timeline.OriginalEventPainter.prototype._getHighlightColor=function(a,c){var b=c.event.highlightColors;return b[Math.min(a,b.length-1)]};Timeline.OriginalEventPainter.prototype._createHighlightDiv=function(a,d,f,b){var g=null;if(a>=0){var e=this._timeline.getDocument();var c=this._getHighlightColor(a,f);g=e.createElement("div");g.className=this._getElClassName("timeline-event-highlight",b,"highlight");g.id=this._encodeEventElID("highlight0",b);g.style.position="absolute";g.style.overflow="hidden";g.style.left=(d.left-2)+"px";g.style.width=(d.width+4)+"px";g.style.top=(d.top-2)+"px";g.style.height=(d.height+4)+"px";g.style.background=c;this._highlightLayer.appendChild(g)}return g};Timeline.OriginalEventPainter.prototype._onClickInstantEvent=function(b,d,a){var e=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(e.left+Math.ceil(b.offsetWidth/2),e.top+Math.ceil(b.offsetHeight/2),a);this._fireOnSelect(a.getID());d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.OriginalEventPainter.prototype._onClickDurationEvent=function(e,d,b){if("pageX" in d){var a=d.pageX;var g=d.pageY}else{var f=SimileAjax.DOM.getPageCoordinates(e);var a=d.offsetX+f.left;var g=d.offsetY+f.top}this._showBubble(a,g,b);this._fireOnSelect(b.getID());d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.OriginalEventPainter.prototype.showBubble=function(a){var b=this._eventIdToElmt[a.getID()];if(b){var d=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(d.left+b.offsetWidth/2,d.top+b.offsetHeight/2,a)}};Timeline.OriginalEventPainter.prototype._showBubble=function(a,e,b){var d=document.createElement("div");var c=this._params.theme.event.bubble;b.fillInfoBubble(d,this._params.theme,this._band.getLabeller());SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(d,a,e,c.width,null,c.maxHeight)};Timeline.OriginalEventPainter.prototype._fireOnSelect=function(b){for(var a=0;a<this._onSelectListeners.length;a++){this._onSelectListeners[a](b)}};Timeline.OriginalEventPainter.prototype._fireEventPaintListeners=function(d,a,c){for(var b=0;b<this._eventPaintListeners.length;b++){this._eventPaintListeners[b](this._band,d,a,c)}};Timeline.DetailedEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._filterMatcher=null;this._highlightMatcher=null;this._frc=null;this._eventIdToElmt={}};Timeline.DetailedEventPainter.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._backLayer=null;this._eventLayer=null;this._lineLayer=null;this._highlightLayer=null;this._eventIdToElmt=null};Timeline.DetailedEventPainter.prototype.getType=function(){return"detailed"};Timeline.DetailedEventPainter.prototype.addOnSelectListener=function(a){this._onSelectListeners.push(a)};Timeline.DetailedEventPainter.prototype.removeOnSelectListener=function(b){for(var a=0;a<this._onSelectListeners.length;a++){if(this._onSelectListeners[a]==b){this._onSelectListeners.splice(a,1);break}}};Timeline.DetailedEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher};Timeline.DetailedEventPainter.prototype.setFilterMatcher=function(a){this._filterMatcher=a};Timeline.DetailedEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher};Timeline.DetailedEventPainter.prototype.setHighlightMatcher=function(a){this._highlightMatcher=a};Timeline.DetailedEventPainter.prototype.paint=function(){var b=this._band.getEventSource();if(b==null){return}this._eventIdToElmt={};this._prepareForPainting();var i=this._params.theme.event;var g=Math.max(i.track.height,this._frc.getLineHeight());var f={trackOffset:Math.round(this._band.getViewWidth()/2-g/2),trackHeight:g,trackGap:i.track.gap,trackIncrement:g+i.track.gap,icon:i.instant.icon,iconWidth:i.instant.iconWidth,iconHeight:i.instant.iconHeight,labelWidth:i.label.width};var c=this._band.getMinDate();var a=this._band.getMaxDate();var j=(this._filterMatcher!=null)?this._filterMatcher:function(k){return true};var e=(this._highlightMatcher!=null)?this._highlightMatcher:function(k){return -1};var d=b.getEventReverseIterator(c,a);while(d.hasNext()){var h=d.next();if(j(h)){this.paintEvent(h,f,this._params.theme,e(h))}}this._highlightLayer.style.display="block";this._lineLayer.style.display="block";this._eventLayer.style.display="block";this._band.updateEventTrackInfo(this._lowerTracks.length+this._upperTracks.length,f.trackIncrement)};Timeline.DetailedEventPainter.prototype.softPaint=function(){};Timeline.DetailedEventPainter.prototype._prepareForPainting=function(){var b=this._band;if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");this._backLayer.style.visibility="hidden";var a=document.createElement("span");a.className="timeline-event-label";this._backLayer.appendChild(a);this._frc=SimileAjax.Graphics.getFontRenderingContext(a)}this._frc.update();this._lowerTracks=[];this._upperTracks=[];if(this._highlightLayer!=null){b.removeLayerDiv(this._highlightLayer)}this._highlightLayer=b.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";if(this._lineLayer!=null){b.removeLayerDiv(this._lineLayer)}this._lineLayer=b.createLayerDiv(110,"timeline-band-lines");this._lineLayer.style.display="none";if(this._eventLayer!=null){b.removeLayerDiv(this._eventLayer)}this._eventLayer=b.createLayerDiv(110,"timeline-band-events");this._eventLayer.style.display="none"};Timeline.DetailedEventPainter.prototype.paintEvent=function(b,c,d,a){if(b.isInstant()){this.paintInstantEvent(b,c,d,a)}else{this.paintDurationEvent(b,c,d,a)}};Timeline.DetailedEventPainter.prototype.paintInstantEvent=function(b,c,d,a){if(b.isImprecise()){this.paintImpreciseInstantEvent(b,c,d,a)}else{this.paintPreciseInstantEvent(b,c,d,a)}};Timeline.DetailedEventPainter.prototype.paintDurationEvent=function(b,c,d,a){if(b.isImprecise()){this.paintImpreciseDurationEvent(b,c,d,a)}else{this.paintPreciseDurationEvent(b,c,d,a)}};Timeline.DetailedEventPainter.prototype.paintPreciseInstantEvent=function(k,o,r,p){var t=this._timeline.getDocument();var j=k.getText();var e=k.getStart();var c=Math.round(this._band.dateToPixelOffset(e));var a=Math.round(c+o.iconWidth/2);var i=Math.round(c-o.iconWidth/2);var g=this._frc.computeSize(j);var d=this._findFreeTrackForSolid(a,c);var b=this._paintEventIcon(k,d,i,o,r);var u=a+r.event.label.offsetFromLine;var q=d;var f=this._getTrackData(d);if(Math.min(f.solid,f.text)>=u+g.width){f.solid=i;f.text=u}else{f.solid=i;u=c+r.event.label.offsetFromLine;q=this._findFreeTrackForText(d,u+g.width,function(v){v.line=c-2});this._getTrackData(q).text=i;this._paintEventLine(k,c,d,q,o,r)}var s=Math.round(o.trackOffset+q*o.trackIncrement+o.trackHeight/2-g.height/2);var m=this._paintEventLabel(k,j,u,s,g.width,g.height,r);var l=this;var h=function(v,w,x){return l._onClickInstantEvent(b.elmt,w,k)};SimileAjax.DOM.registerEvent(b.elmt,"mousedown",h);SimileAjax.DOM.registerEvent(m.elmt,"mousedown",h);this._createHighlightDiv(p,b,r);this._eventIdToElmt[k.getID()]=b.elmt};Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent=function(o,r,w,s){var y=this._timeline.getDocument();var m=o.getText();var h=o.getStart();var t=o.getEnd();var e=Math.round(this._band.dateToPixelOffset(h));var b=Math.round(this._band.dateToPixelOffset(t));var a=Math.round(e+r.iconWidth/2);var l=Math.round(e-r.iconWidth/2);var j=this._frc.computeSize(m);var f=this._findFreeTrackForSolid(b,e);var g=this._paintEventTape(o,f,e,b,w.event.instant.impreciseColor,w.event.instant.impreciseOpacity,r,w);var c=this._paintEventIcon(o,f,l,r,w);var i=this._getTrackData(f);i.solid=l;var x=a+w.event.label.offsetFromLine;var d=x+j.width;var u;if(d<b){u=f}else{x=e+w.event.label.offsetFromLine;d=x+j.width;u=this._findFreeTrackForText(f,d,function(z){z.line=e-2});this._getTrackData(u).text=l;this._paintEventLine(o,e,f,u,r,w)}var v=Math.round(r.trackOffset+u*r.trackIncrement+r.trackHeight/2-j.height/2);var q=this._paintEventLabel(o,m,x,v,j.width,j.height,w);var p=this;var k=function(z,B,C){return p._onClickInstantEvent(c.elmt,B,o)};SimileAjax.DOM.registerEvent(c.elmt,"mousedown",k);SimileAjax.DOM.registerEvent(g.elmt,"mousedown",k);SimileAjax.DOM.registerEvent(q.elmt,"mousedown",k);this._createHighlightDiv(s,c,w);this._eventIdToElmt[o.getID()]=c.elmt};Timeline.DetailedEventPainter.prototype.paintPreciseDurationEvent=function(j,m,t,p){var u=this._timeline.getDocument();var i=j.getText();var d=j.getStart();var q=j.getEnd();var b=Math.round(this._band.dateToPixelOffset(d));var a=Math.round(this._band.dateToPixelOffset(q));var f=this._frc.computeSize(i);var e=this._findFreeTrackForSolid(a);var o=j.getColor();o=o!=null?o:t.event.duration.color;var c=this._paintEventTape(j,e,b,a,o,100,m,t);var h=this._getTrackData(e);h.solid=b;var v=b+t.event.label.offsetFromLine;var r=this._findFreeTrackForText(e,v+f.width,function(w){w.line=b-2});this._getTrackData(r).text=b-2;this._paintEventLine(j,b,e,r,m,t);var s=Math.round(m.trackOffset+r*m.trackIncrement+m.trackHeight/2-f.height/2);var l=this._paintEventLabel(j,i,v,s,f.width,f.height,t);var k=this;var g=function(w,x,y){return k._onClickDurationEvent(c.elmt,x,j)};SimileAjax.DOM.registerEvent(c.elmt,"mousedown",g);SimileAjax.DOM.registerEvent(l.elmt,"mousedown",g);this._createHighlightDiv(p,c,t);this._eventIdToElmt[j.getID()]=c.elmt};Timeline.DetailedEventPainter.prototype.paintImpreciseDurationEvent=function(l,q,x,t){var B=this._timeline.getDocument();var k=l.getText();var d=l.getStart();var r=l.getLatestStart();var u=l.getEnd();var y=l.getEarliestEnd();var b=Math.round(this._band.dateToPixelOffset(d));var f=Math.round(this._band.dateToPixelOffset(r));var a=Math.round(this._band.dateToPixelOffset(u));var g=Math.round(this._band.dateToPixelOffset(y));var h=this._frc.computeSize(k);var e=this._findFreeTrackForSolid(a);var s=l.getColor();s=s!=null?s:x.event.duration.color;var p=this._paintEventTape(l,e,b,a,x.event.duration.impreciseColor,x.event.duration.impreciseOpacity,q,x);var c=this._paintEventTape(l,e,f,g,s,100,q,x);var j=this._getTrackData(e);j.solid=b;var z=f+x.event.label.offsetFromLine;var v=this._findFreeTrackForText(e,z+h.width,function(C){C.line=f-2});this._getTrackData(v).text=f-2;this._paintEventLine(l,f,e,v,q,x);var w=Math.round(q.trackOffset+v*q.trackIncrement+q.trackHeight/2-h.height/2);var o=this._paintEventLabel(l,k,z,w,h.width,h.height,x);var m=this;var i=function(C,D,E){return m._onClickDurationEvent(c.elmt,D,l)};SimileAjax.DOM.registerEvent(c.elmt,"mousedown",i);SimileAjax.DOM.registerEvent(o.elmt,"mousedown",i);this._createHighlightDiv(t,c,x);this._eventIdToElmt[l.getID()]=c.elmt};Timeline.DetailedEventPainter.prototype._findFreeTrackForSolid=function(b,a){for(var d=0;true;d++){if(d<this._lowerTracks.length){var c=this._lowerTracks[d];if(Math.min(c.solid,c.text)>b&&(!(a)||c.line>a)){return d}}else{this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});return d}if(d<this._upperTracks.length){var c=this._upperTracks[d];if(Math.min(c.solid,c.text)>b&&(!(a)||c.line>a)){return -1-d}}else{this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});return -1-d}}};Timeline.DetailedEventPainter.prototype._findFreeTrackForText=function(d,c,h){var f;var g;var b;var k;if(d<0){f=true;b=-d;g=this._findFreeUpperTrackForText(b,c);k=-1-g}else{if(d>0){f=false;b=d+1;g=this._findFreeLowerTrackForText(b,c);k=g}else{var a=this._findFreeUpperTrackForText(0,c);var j=this._findFreeLowerTrackForText(1,c);if(j-1<=a){f=false;b=1;g=j;k=g}else{f=true;b=0;g=a;k=-1-g}}}if(f){if(g==this._upperTracks.length){this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY})}for(var e=b;e<g;e++){h(this._upperTracks[e])}}else{if(g==this._lowerTracks.length){this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY})}for(var e=b;e<g;e++){h(this._lowerTracks[e])}}return k};Timeline.DetailedEventPainter.prototype._findFreeLowerTrackForText=function(a,c){for(;a<this._lowerTracks.length;a++){var b=this._lowerTracks[a];if(Math.min(b.solid,b.text)>=c){break}}return a};Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText=function(a,c){for(;a<this._upperTracks.length;a++){var b=this._upperTracks[a];if(Math.min(b.solid,b.text)>=c){break}}return a};Timeline.DetailedEventPainter.prototype._getTrackData=function(a){return(a<0)?this._upperTracks[-a-1]:this._lowerTracks[a]};Timeline.DetailedEventPainter.prototype._paintEventLine=function(i,c,f,a,g,d){var h=Math.round(g.trackOffset+f*g.trackIncrement+g.trackHeight/2);var j=Math.round(Math.abs(a-f)*g.trackIncrement);var e="1px solid "+d.event.label.lineColor;var b=this._timeline.getDocument().createElement("div");b.style.position="absolute";b.style.left=c+"px";b.style.width=d.event.label.offsetFromLine+"px";b.style.height=j+"px";if(f>a){b.style.top=(h-j)+"px";b.style.borderTop=e}else{b.style.top=h+"px";b.style.borderBottom=e}b.style.borderLeft=e;this._lineLayer.appendChild(b)};Timeline.DetailedEventPainter.prototype._paintEventIcon=function(i,e,b,f,d){var h=i.getIcon();h=h!=null?h:f.icon;var j=f.trackOffset+e*f.trackIncrement+f.trackHeight/2;var g=Math.round(j-f.iconHeight/2);var c=SimileAjax.Graphics.createTranslucentImage(h);var a=this._timeline.getDocument().createElement("div");a.style.position="absolute";a.style.left=b+"px";a.style.top=g+"px";a.appendChild(c);a.style.cursor="pointer";if(i._title!=null){a.title=i._title}this._eventLayer.appendChild(a);return{left:b,top:g,width:f.iconWidth,height:f.iconHeight,elmt:a}};Timeline.DetailedEventPainter.prototype._paintEventLabel=function(h,i,b,f,a,j,d){var g=this._timeline.getDocument();var k=g.createElement("div");k.style.position="absolute";k.style.left=b+"px";k.style.width=a+"px";k.style.top=f+"px";k.style.height=j+"px";k.style.backgroundColor=d.event.label.backgroundColor;SimileAjax.Graphics.setOpacity(k,d.event.label.backgroundOpacity);this._eventLayer.appendChild(k);var e=g.createElement("div");e.style.position="absolute";e.style.left=b+"px";e.style.width=a+"px";e.style.top=f+"px";e.innerHTML=i;e.style.cursor="pointer";if(h._title!=null){e.title=h._title}var c=h.getTextColor();if(c==null){c=h.getColor()}if(c!=null){e.style.color=c}this._eventLayer.appendChild(e);return{left:b,top:f,width:a,height:j,elmt:e}};Timeline.DetailedEventPainter.prototype._paintEventTape=function(l,h,e,a,c,g,i,f){var b=a-e;var d=f.event.tape.height;var m=i.trackOffset+h*i.trackIncrement+i.trackHeight/2;var j=Math.round(m-d/2);var k=this._timeline.getDocument().createElement("div");k.style.position="absolute";k.style.left=e+"px";k.style.width=b+"px";k.style.top=j+"px";k.style.height=d+"px";k.style.backgroundColor=c;k.style.overflow="hidden";k.style.cursor="pointer";if(l._title!=null){k.title=l._title}SimileAjax.Graphics.setOpacity(k,g);this._eventLayer.appendChild(k);return{left:e,top:j,width:b,height:d,elmt:k}};Timeline.DetailedEventPainter.prototype._createHighlightDiv=function(a,c,e){if(a>=0){var d=this._timeline.getDocument();var g=e.event;var b=g.highlightColors[Math.min(a,g.highlightColors.length-1)];var f=d.createElement("div");f.style.position="absolute";f.style.overflow="hidden";f.style.left=(c.left-2)+"px";f.style.width=(c.width+4)+"px";f.style.top=(c.top-2)+"px";f.style.height=(c.height+4)+"px";f.style.background=b;this._highlightLayer.appendChild(f)}};Timeline.DetailedEventPainter.prototype._onClickInstantEvent=function(b,d,a){var e=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(e.left+Math.ceil(b.offsetWidth/2),e.top+Math.ceil(b.offsetHeight/2),a);this._fireOnSelect(a.getID());d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.DetailedEventPainter.prototype._onClickDurationEvent=function(e,d,b){if("pageX" in d){var a=d.pageX;var g=d.pageY}else{var f=SimileAjax.DOM.getPageCoordinates(e);var a=d.offsetX+f.left;var g=d.offsetY+f.top}this._showBubble(a,g,b);this._fireOnSelect(b.getID());d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.DetailedEventPainter.prototype.showBubble=function(a){var b=this._eventIdToElmt[a.getID()];if(b){var d=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(d.left+b.offsetWidth/2,d.top+b.offsetHeight/2,a)}};Timeline.DetailedEventPainter.prototype._showBubble=function(a,e,b){var d=document.createElement("div");var c=this._params.theme.event.bubble;b.fillInfoBubble(d,this._params.theme,this._band.getLabeller());SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(d,a,e,c.width,null,c.maxHeight)};Timeline.DetailedEventPainter.prototype._fireOnSelect=function(b){for(var a=0;a<this._onSelectListeners.length;a++){this._onSelectListeners[a](b)}};Timeline.OverviewEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._filterMatcher=null;this._highlightMatcher=null};Timeline.OverviewEventPainter.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._eventLayer=null;this._highlightLayer=null};Timeline.OverviewEventPainter.prototype.getType=function(){return"overview"};Timeline.OverviewEventPainter.prototype.addOnSelectListener=function(a){this._onSelectListeners.push(a)};Timeline.OverviewEventPainter.prototype.removeOnSelectListener=function(b){for(var a=0;a<this._onSelectListeners.length;a++){if(this._onSelectListeners[a]==b){this._onSelectListeners.splice(a,1);break}}};Timeline.OverviewEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher};Timeline.OverviewEventPainter.prototype.setFilterMatcher=function(a){this._filterMatcher=a};Timeline.OverviewEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher};Timeline.OverviewEventPainter.prototype.setHighlightMatcher=function(a){this._highlightMatcher=a};Timeline.OverviewEventPainter.prototype.paint=function(){var b=this._band.getEventSource();if(b==null){return}this._prepareForPainting();var h=this._params.theme.event;var f={trackOffset:h.overviewTrack.offset,trackHeight:h.overviewTrack.height,trackGap:h.overviewTrack.gap,trackIncrement:h.overviewTrack.height+h.overviewTrack.gap};var c=this._band.getMinDate();var a=this._band.getMaxDate();var i=(this._filterMatcher!=null)?this._filterMatcher:function(j){return true};var e=(this._highlightMatcher!=null)?this._highlightMatcher:function(j){return -1};var d=b.getEventReverseIterator(c,a);while(d.hasNext()){var g=d.next();if(i(g)){this.paintEvent(g,f,this._params.theme,e(g))}}this._highlightLayer.style.display="block";this._eventLayer.style.display="block";this._band.updateEventTrackInfo(this._tracks.length,f.trackIncrement)};Timeline.OverviewEventPainter.prototype.softPaint=function(){};Timeline.OverviewEventPainter.prototype._prepareForPainting=function(){var a=this._band;this._tracks=[];if(this._highlightLayer!=null){a.removeLayerDiv(this._highlightLayer)}this._highlightLayer=a.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";if(this._eventLayer!=null){a.removeLayerDiv(this._eventLayer)}this._eventLayer=a.createLayerDiv(110,"timeline-band-events");this._eventLayer.style.display="none"};Timeline.OverviewEventPainter.prototype.paintEvent=function(b,c,d,a){if(b.isInstant()){this.paintInstantEvent(b,c,d,a)}else{this.paintDurationEvent(b,c,d,a)}};Timeline.OverviewEventPainter.prototype.paintInstantEvent=function(i,h,f,a){var b=i.getStart();var e=Math.round(this._band.dateToPixelOffset(b));var d=i.getColor(),c=i.getClassName();if(c){d=null}else{d=d!=null?d:f.event.duration.color}var g=this._paintEventTick(i,e,d,100,h,f);this._createHighlightDiv(a,g,f)};Timeline.OverviewEventPainter.prototype.paintDurationEvent=function(l,k,j,d){var a=l.getLatestStart();var c=l.getEarliestEnd();var b=Math.round(this._band.dateToPixelOffset(a));var e=Math.round(this._band.dateToPixelOffset(c));var i=0;for(;i<this._tracks.length;i++){if(e<this._tracks[i]){break}}this._tracks[i]=e;var h=l.getColor(),g=l.getClassName();if(g){h=null}else{h=h!=null?h:j.event.duration.color}var f=this._paintEventTape(l,i,b,e,h,100,k,j,g);this._createHighlightDiv(d,f,j)};Timeline.OverviewEventPainter.prototype._paintEventTape=function(l,b,c,k,e,g,h,f,d){var i=h.trackOffset+b*h.trackIncrement;var a=k-c;var m=h.trackHeight;var j=this._timeline.getDocument().createElement("div");j.className="timeline-small-event-tape";if(d){j.className+=" small-"+d}j.style.left=c+"px";j.style.width=a+"px";j.style.top=i+"px";j.style.height=m+"px";if(e){j.style.backgroundColor=e}if(g<100){SimileAjax.Graphics.setOpacity(j,g)}this._eventLayer.appendChild(j);return{left:c,top:i,width:a,height:m,elmt:j}};Timeline.OverviewEventPainter.prototype._paintEventTick=function(j,b,d,f,g,e){var k=e.event.overviewTrack.tickHeight;var h=g.trackOffset-k;var a=1;var i=this._timeline.getDocument().createElement("div");i.className="timeline-small-event-icon";i.style.left=b+"px";i.style.top=h+"px";var c=j.getClassName();if(c){i.className+=" small-"+c}if(f<100){SimileAjax.Graphics.setOpacity(i,f)}this._eventLayer.appendChild(i);return{left:b,top:h,width:a,height:k,elmt:i}};Timeline.OverviewEventPainter.prototype._createHighlightDiv=function(a,c,e){if(a>=0){var d=this._timeline.getDocument();var g=e.event;var b=g.highlightColors[Math.min(a,g.highlightColors.length-1)];var f=d.createElement("div");f.style.position="absolute";f.style.overflow="hidden";f.style.left=(c.left-1)+"px";f.style.width=(c.width+2)+"px";f.style.top=(c.top-1)+"px";f.style.height=(c.height+2)+"px";f.style.background=b;this._highlightLayer.appendChild(f)}};Timeline.OverviewEventPainter.prototype.showBubble=function(a){};Timeline.CompactEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._filterMatcher=null;this._highlightMatcher=null;this._frc=null;this._eventIdToElmt={}};Timeline.CompactEventPainter.prototype.getType=function(){return"compact"};Timeline.CompactEventPainter.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._backLayer=null;this._eventLayer=null;this._lineLayer=null;this._highlightLayer=null;this._eventIdToElmt=null};Timeline.CompactEventPainter.prototype.addOnSelectListener=function(a){this._onSelectListeners.push(a)};Timeline.CompactEventPainter.prototype.removeOnSelectListener=function(b){for(var a=0;a<this._onSelectListeners.length;a++){if(this._onSelectListeners[a]==b){this._onSelectListeners.splice(a,1);break}}};Timeline.CompactEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher};Timeline.CompactEventPainter.prototype.setFilterMatcher=function(a){this._filterMatcher=a};Timeline.CompactEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher};Timeline.CompactEventPainter.prototype.setHighlightMatcher=function(a){this._highlightMatcher=a};Timeline.CompactEventPainter.prototype.paint=function(){var b=this._band.getEventSource();if(b==null){return}this._eventIdToElmt={};this._prepareForPainting();var o=this._computeMetrics();var e=this._band.getMinDate();var a=this._band.getMaxDate();var r=(this._filterMatcher!=null)?this._filterMatcher:function(i){return true};var m=(this._highlightMatcher!=null)?this._highlightMatcher:function(i){return -1};var h=b.getEventIterator(e,a);var p="stackConcurrentPreciseInstantEvents" in this._params&&typeof this._params.stackConcurrentPreciseInstantEvents=="object";var l="collapseConcurrentPreciseInstantEvents" in this._params&&this._params.collapseConcurrentPreciseInstantEvents;if(l||p){var s=[];var c=null;while(h.hasNext()){var q=h.next();if(r(q)){if(!q.isInstant()||q.isImprecise()){this.paintEvent(q,o,this._params.theme,m(q))}else{if(c!=null&&c.getStart().getTime()==q.getStart().getTime()){s[s.length-1].push(q)}else{s.push([q]);c=q}}}}for(var f=0;f<s.length;f++){var k=s[f];if(k.length==1){this.paintEvent(k[0],o,this._params.theme,m(q))}else{var g=-1;for(var d=0;g<0&&d<k.length;d++){g=m(k[d])}if(p){this.paintStackedPreciseInstantEvents(k,o,this._params.theme,g)}else{this.paintCompositePreciseInstantEvents(k,o,this._params.theme,g)}}}}else{while(h.hasNext()){var q=h.next();if(r(q)){this.paintEvent(q,o,this._params.theme,m(q))}}}this._highlightLayer.style.display="block";this._lineLayer.style.display="block";this._eventLayer.style.display="block";this._setOrthogonalOffset(o)};Timeline.CompactEventPainter.prototype.softPaint=function(){this._setOrthogonalOffset(this._computeMetrics())};Timeline.CompactEventPainter.prototype._setOrthogonalOffset=function(a){var b=2*a.trackOffset+this._tracks.length*a.trackHeight;var d=Math.min(0,this._band.getViewWidth()-b);var c=Math.max(d,this._band.getViewOrthogonalOffset());this._highlightLayer.style.top=this._lineLayer.style.top=this._eventLayer.style.top=c+"px"};Timeline.CompactEventPainter.prototype._computeMetrics=function(){var b=this._params.theme;var c=b.event;var a={trackOffset:"trackOffset" in this._params?this._params.trackOffset:10,trackHeight:"trackHeight" in this._params?this._params.trackHeight:10,tapeHeight:b.event.tape.height,tapeBottomMargin:"tapeBottomMargin" in this._params?this._params.tapeBottomMargin:2,labelBottomMargin:"labelBottomMargin" in this._params?this._params.labelBottomMargin:5,labelRightMargin:"labelRightMargin" in this._params?this._params.labelRightMargin:5,defaultIcon:c.instant.icon,defaultIconWidth:c.instant.iconWidth,defaultIconHeight:c.instant.iconHeight,customIconWidth:"iconWidth" in this._params?this._params.iconWidth:c.instant.iconWidth,customIconHeight:"iconHeight" in this._params?this._params.iconHeight:c.instant.iconHeight,iconLabelGap:"iconLabelGap" in this._params?this._params.iconLabelGap:2,iconBottomMargin:"iconBottomMargin" in this._params?this._params.iconBottomMargin:2};if("compositeIcon" in this._params){a.compositeIcon=this._params.compositeIcon;a.compositeIconWidth=this._params.compositeIconWidth||a.customIconWidth;a.compositeIconHeight=this._params.compositeIconHeight||a.customIconHeight}else{a.compositeIcon=a.defaultIcon;a.compositeIconWidth=a.defaultIconWidth;a.compositeIconHeight=a.defaultIconHeight}a.defaultStackIcon="icon" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.icon:a.defaultIcon;a.defaultStackIconWidth="iconWidth" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.iconWidth:a.defaultIconWidth;a.defaultStackIconHeight="iconHeight" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.iconHeight:a.defaultIconHeight;return a};Timeline.CompactEventPainter.prototype._prepareForPainting=function(){var b=this._band;if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");this._backLayer.style.visibility="hidden";var a=document.createElement("span");a.className="timeline-event-label";this._backLayer.appendChild(a);this._frc=SimileAjax.Graphics.getFontRenderingContext(a)}this._frc.update();this._tracks=[];if(this._highlightLayer!=null){b.removeLayerDiv(this._highlightLayer)}this._highlightLayer=b.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";if(this._lineLayer!=null){b.removeLayerDiv(this._lineLayer)}this._lineLayer=b.createLayerDiv(110,"timeline-band-lines");this._lineLayer.style.display="none";if(this._eventLayer!=null){b.removeLayerDiv(this._eventLayer)}this._eventLayer=b.createLayerDiv(115,"timeline-band-events");this._eventLayer.style.display="none"};Timeline.CompactEventPainter.prototype.paintEvent=function(b,c,d,a){if(b.isInstant()){this.paintInstantEvent(b,c,d,a)}else{this.paintDurationEvent(b,c,d,a)}};Timeline.CompactEventPainter.prototype.paintInstantEvent=function(b,c,d,a){if(b.isImprecise()){this.paintImpreciseInstantEvent(b,c,d,a)}else{this.paintPreciseInstantEvent(b,c,d,a)}};Timeline.CompactEventPainter.prototype.paintDurationEvent=function(b,c,d,a){if(b.isImprecise()){this.paintImpreciseDurationEvent(b,c,d,a)}else{this.paintPreciseDurationEvent(b,c,d,a)}};Timeline.CompactEventPainter.prototype.paintPreciseInstantEvent=function(h,f,c,b){var d={tooltip:h.getProperty("tooltip")||h.getText()};var a={url:h.getIcon()};if(a.url==null){a.url=f.defaultIcon;a.width=f.defaultIconWidth;a.height=f.defaultIconHeight;a.className="timeline-event-icon-default"}else{a.width=h.getProperty("iconWidth")||f.customIconWidth;a.height=h.getProperty("iconHeight")||f.customIconHeight}var g={text:h.getText(),color:h.getTextColor()||h.getColor(),className:h.getClassName()};var j=this.paintTapeIconLabel(h.getStart(),d,null,a,g,f,c,b);var i=this;var e=function(k,l,m){return i._onClickInstantEvent(j.iconElmtData.elmt,l,h)};SimileAjax.DOM.registerEvent(j.iconElmtData.elmt,"mousedown",e);SimileAjax.DOM.registerEvent(j.labelElmtData.elmt,"mousedown",e);this._eventIdToElmt[h.getID()]=j.iconElmtData.elmt};Timeline.CompactEventPainter.prototype.paintCompositePreciseInstantEvents=function(m,h,c,b){var k=m[0];var g=[];for(var d=0;d<m.length;d++){g.push(m[d].getProperty("tooltip")||m[d].getText())}var e={tooltip:g.join("; ")};var a={url:h.compositeIcon,width:h.compositeIconWidth,height:h.compositeIconHeight,className:"timeline-event-icon-composite"};var j={text:String.substitute(this._params.compositeEventLabelTemplate,[m.length])};var o=this.paintTapeIconLabel(k.getStart(),e,null,a,j,h,c,b);var l=this;var f=function(i,p,q){return l._onClickMultiplePreciseInstantEvent(o.iconElmtData.elmt,p,m)};SimileAjax.DOM.registerEvent(o.iconElmtData.elmt,"mousedown",f);SimileAjax.DOM.registerEvent(o.labelElmtData.elmt,"mousedown",f);for(var d=0;d<m.length;d++){this._eventIdToElmt[m[d].getID()]=o.iconElmtData.elmt}};Timeline.CompactEventPainter.prototype.paintStackedPreciseInstantEvents=function(z,M,E,e){var u="limit" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.limit:10;var j="moreMessageTemplate" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.moreMessageTemplate:"%0 More Events";var r=u<=z.length-2;var c=this._band;var H=function(i){return Math.round(c.dateToPixelOffset(i))};var p=function(i){var U={url:i.getIcon()};if(U.url==null){U.url=M.defaultStackIcon;U.width=M.defaultStackIconWidth;U.height=M.defaultStackIconHeight;U.className="timeline-event-icon-stack timeline-event-icon-default"}else{U.width=i.getProperty("iconWidth")||M.customIconWidth;U.height=i.getProperty("iconHeight")||M.customIconHeight;U.className="timeline-event-icon-stack"}return U};var g=p(z[0]);var x=5;var f=0;var l=0;var T=0;var y=0;var O=[];for(var S=0;S<z.length&&(!r||S<u);S++){var D=z[S];var C=D.getText();var w=p(D);var v=this._frc.computeSize(C);var J={text:C,iconData:w,labelSize:v,iconLeft:g.width+S*x-w.width};J.labelLeft=g.width+S*x+M.iconLabelGap;J.top=T;O.push(J);f=Math.min(f,J.iconLeft);T+=v.height;l=Math.max(l,J.labelLeft+v.width);y=Math.max(y,J.top+w.height)}if(r){var m=String.substitute(j,[z.length-u]);var N=this._frc.computeSize(m);var K=g.width+(u-1)*x+M.iconLabelGap;var R=T;T+=N.height;l=Math.max(l,K+N.width)}l+=M.labelRightMargin;T+=M.labelBottomMargin;y+=M.iconBottomMargin;var Q=H(z[0].getStart());var t=[];var o=Math.ceil(Math.max(y,T)/M.trackHeight);var G=g.width+(z.length-1)*x;for(var S=0;S<o;S++){t.push({start:f,end:G})}var I=Math.ceil(T/M.trackHeight);for(var S=0;S<I;S++){var q=t[S];q.end=Math.max(q.end,l)}var h=this._fitTracks(Q,t);var B=h*M.trackHeight+M.trackOffset;var a=this._timeline.getDocument().createElement("div");a.className="timeline-event-icon-stack";a.style.position="absolute";a.style.overflow="visible";a.style.left=Q+"px";a.style.top=B+"px";a.style.width=G+"px";a.style.height=y+"px";a.innerHTML="<div style='position: relative'></div>";this._eventLayer.appendChild(a);var k=this;var s=function(V){try{var Z=parseInt(this.getAttribute("index"));var X=a.firstChild.childNodes;for(var U=0;U<X.length;U++){var Y=X[U];if(U==Z){Y.style.zIndex=X.length}else{Y.style.zIndex=X.length-U}}}catch(W){}};var F=function(Y){var U=O[Y];var i=z[Y];var Z=i.getProperty("tooltip")||i.getText();var X=k._paintEventLabel({tooltip:Z},{text:U.text},Q+U.labelLeft,B+U.top,U.labelSize.width,U.labelSize.height,E);X.elmt.setAttribute("index",Y);X.elmt.onmouseover=s;var W=SimileAjax.Graphics.createTranslucentImage(U.iconData.url);var V=k._timeline.getDocument().createElement("div");V.className="timeline-event-icon"+("className" in U.iconData?(" "+U.iconData.className):"");V.style.left=U.iconLeft+"px";V.style.top=U.top+"px";V.style.zIndex=(O.length-Y);V.appendChild(W);V.setAttribute("index",Y);V.onmouseover=s;a.firstChild.appendChild(V);var aa=function(ab,ac,ad){return k._onClickInstantEvent(X.elmt,ac,i)};SimileAjax.DOM.registerEvent(V,"mousedown",aa);SimileAjax.DOM.registerEvent(X.elmt,"mousedown",aa);k._eventIdToElmt[i.getID()]=V};for(var S=0;S<O.length;S++){F(S)}if(r){var d=z.slice(u);var b=this._paintEventLabel({tooltip:m},{text:m},Q+K,B+R,N.width,N.height,E);var L=function(i,U,V){return k._onClickMultiplePreciseInstantEvent(b.elmt,U,d)};SimileAjax.DOM.registerEvent(b.elmt,"mousedown",L);for(var S=0;S<d.length;S++){this._eventIdToElmt[d[S].getID()]=b.elmt}}};Timeline.CompactEventPainter.prototype.paintImpreciseInstantEvent=function(i,g,d,c){var e={tooltip:i.getProperty("tooltip")||i.getText()};var a={start:i.getStart(),end:i.getEnd(),latestStart:i.getLatestStart(),earliestEnd:i.getEarliestEnd(),isInstant:true};var b={url:i.getIcon()};if(b.url==null){b=null}else{b.width=i.getProperty("iconWidth")||g.customIconWidth;b.height=i.getProperty("iconHeight")||g.customIconHeight}var h={text:i.getText(),color:i.getTextColor()||i.getColor(),className:i.getClassName()};var k=this.paintTapeIconLabel(i.getStart(),e,a,b,h,g,d,c);var j=this;var f=b!=null?function(l,m,o){return j._onClickInstantEvent(k.iconElmtData.elmt,m,i)}:function(l,m,o){return j._onClickInstantEvent(k.labelElmtData.elmt,m,i)};SimileAjax.DOM.registerEvent(k.labelElmtData.elmt,"mousedown",f);SimileAjax.DOM.registerEvent(k.impreciseTapeElmtData.elmt,"mousedown",f);if(b!=null){SimileAjax.DOM.registerEvent(k.iconElmtData.elmt,"mousedown",f);this._eventIdToElmt[i.getID()]=k.iconElmtData.elmt}else{this._eventIdToElmt[i.getID()]=k.labelElmtData.elmt}};Timeline.CompactEventPainter.prototype.paintPreciseDurationEvent=function(i,g,d,c){var e={tooltip:i.getProperty("tooltip")||i.getText()};var a={start:i.getStart(),end:i.getEnd(),isInstant:false};var b={url:i.getIcon()};if(b.url==null){b=null}else{b.width=i.getProperty("iconWidth")||g.customIconWidth;b.height=i.getProperty("iconHeight")||g.customIconHeight}var h={text:i.getText(),color:i.getTextColor()||i.getColor(),className:i.getClassName()};var k=this.paintTapeIconLabel(i.getLatestStart(),e,a,b,h,g,d,c);var j=this;var f=b!=null?function(l,m,o){return j._onClickInstantEvent(k.iconElmtData.elmt,m,i)}:function(l,m,o){return j._onClickInstantEvent(k.labelElmtData.elmt,m,i)};SimileAjax.DOM.registerEvent(k.labelElmtData.elmt,"mousedown",f);SimileAjax.DOM.registerEvent(k.tapeElmtData.elmt,"mousedown",f);if(b!=null){SimileAjax.DOM.registerEvent(k.iconElmtData.elmt,"mousedown",f);this._eventIdToElmt[i.getID()]=k.iconElmtData.elmt}else{this._eventIdToElmt[i.getID()]=k.labelElmtData.elmt}};Timeline.CompactEventPainter.prototype.paintImpreciseDurationEvent=function(i,g,d,c){var e={tooltip:i.getProperty("tooltip")||i.getText()};var a={start:i.getStart(),end:i.getEnd(),latestStart:i.getLatestStart(),earliestEnd:i.getEarliestEnd(),isInstant:false};var b={url:i.getIcon()};if(b.url==null){b=null}else{b.width=i.getProperty("iconWidth")||g.customIconWidth;b.height=i.getProperty("iconHeight")||g.customIconHeight}var h={text:i.getText(),color:i.getTextColor()||i.getColor(),className:i.getClassName()};var k=this.paintTapeIconLabel(i.getLatestStart(),e,a,b,h,g,d,c);var j=this;var f=b!=null?function(l,m,o){return j._onClickInstantEvent(k.iconElmtData.elmt,m,i)}:function(l,m,o){return j._onClickInstantEvent(k.labelElmtData.elmt,m,i)};SimileAjax.DOM.registerEvent(k.labelElmtData.elmt,"mousedown",f);SimileAjax.DOM.registerEvent(k.tapeElmtData.elmt,"mousedown",f);if(b!=null){SimileAjax.DOM.registerEvent(k.iconElmtData.elmt,"mousedown",f);this._eventIdToElmt[i.getID()]=k.iconElmtData.elmt}else{this._eventIdToElmt[i.getID()]=k.labelElmtData.elmt}};Timeline.CompactEventPainter.prototype.paintTapeIconLabel=function(E,o,H,e,B,y,G,C){var u=this._band;var l=function(i){return Math.round(u.dateToPixelOffset(i))};var v=l(E);var F=[];var D=0;var q=0;var p=0;if(H!=null){D=y.tapeHeight+y.tapeBottomMargin;q=Math.ceil(y.tapeHeight/y.trackHeight);var a=l(H.end)-v;var d=l(H.start)-v;for(var s=0;s<q;s++){F.push({start:d,end:a})}p=y.trackHeight-(D%y.tapeHeight)}var b=0;var x=0;if(e!=null){if("iconAlign" in e&&e.iconAlign=="center"){b=-Math.floor(e.width/2)}x=b+e.width+y.iconLabelGap;if(q>0){F[q-1].end=Math.max(F[q-1].end,x)}var k=e.height+y.iconBottomMargin+p;while(k>0){F.push({start:b,end:x});k-=y.trackHeight}}var r=B.text;var g=this._frc.computeSize(r);var c=g.height+y.labelBottomMargin+p;var f=x+g.width+y.labelRightMargin;if(q>0){F[q-1].end=Math.max(F[q-1].end,f)}for(var z=0;c>0;z++){if(q+z<F.length){var w=F[q+z];w.end=f}else{F.push({start:0,end:f})}c-=y.trackHeight}var j=this._fitTracks(v,F);var h=j*y.trackHeight+y.trackOffset;var m={};m.labelElmtData=this._paintEventLabel(o,B,v+x,h+D,g.width,g.height,G);if(H!=null){if("latestStart" in H||"earliestEnd" in H){m.impreciseTapeElmtData=this._paintEventTape(o,H,y.tapeHeight,h,l(H.start),l(H.end),G.event.duration.impreciseColor,G.event.duration.impreciseOpacity,y,G)}if(!H.isInstant&&"start" in H&&"end" in H){m.tapeElmtData=this._paintEventTape(o,H,y.tapeHeight,h,v,l("earliestEnd" in H?H.earliestEnd:H.end),H.color,100,y,G)}}if(e!=null){m.iconElmtData=this._paintEventIcon(o,e,h+D,v+b,y,G)}return m};Timeline.CompactEventPainter.prototype._fitTracks=function(a,f){var h;for(h=0;h<this._tracks.length;h++){var e=true;for(var c=0;c<f.length&&(h+c)<this._tracks.length;c++){var g=this._tracks[h+c];var b=f[c];if(a+b.start<g){e=false;break}}if(e){break}}for(var d=0;d<f.length;d++){this._tracks[h+d]=a+f[d].end}return h};Timeline.CompactEventPainter.prototype._paintEventIcon=function(c,d,h,g,e,f){var b=SimileAjax.Graphics.createTranslucentImage(d.url);var a=this._timeline.getDocument().createElement("div");a.className="timeline-event-icon"+("className" in d?(" "+d.className):"");a.style.left=g+"px";a.style.top=h+"px";a.appendChild(b);if("tooltip" in c&&typeof c.tooltip=="string"){a.title=c.tooltip}this._eventLayer.appendChild(a);return{left:g,top:h,width:e.iconWidth,height:e.iconHeight,elmt:a}};Timeline.CompactEventPainter.prototype._paintEventLabel=function(d,g,b,f,a,i,c){var h=this._timeline.getDocument();var e=h.createElement("div");e.className="timeline-event-label";e.style.left=b+"px";e.style.width=(a+1)+"px";e.style.top=f+"px";e.innerHTML=g.text;if("tooltip" in d&&typeof d.tooltip=="string"){e.title=d.tooltip}if("color" in g&&typeof g.color=="string"){e.style.color=g.color}if("className" in g&&typeof g.className=="string"){e.className+=" "+g.className}this._eventLayer.appendChild(e);return{left:b,top:f,width:a,height:i,elmt:e}};Timeline.CompactEventPainter.prototype._paintEventTape=function(g,b,l,j,f,a,d,h,i,e){var c=a-f;var k=this._timeline.getDocument().createElement("div");k.className="timeline-event-tape";k.style.left=f+"px";k.style.top=j+"px";k.style.width=c+"px";k.style.height=l+"px";if("tooltip" in g&&typeof g.tooltip=="string"){k.title=g.tooltip}if(d!=null&&typeof b.color=="string"){k.style.backgroundColor=d}if("backgroundImage" in b&&typeof b.backgroundImage=="string"){k.style.backgroundImage="url("+backgroundImage+")";k.style.backgroundRepeat=("backgroundRepeat" in b&&typeof b.backgroundRepeat=="string")?b.backgroundRepeat:"repeat"}SimileAjax.Graphics.setOpacity(k,h);if("className" in b&&typeof b.className=="string"){k.className+=" "+b.className}this._eventLayer.appendChild(k);return{left:f,top:j,width:c,height:l,elmt:k}};Timeline.CompactEventPainter.prototype._createHighlightDiv=function(a,c,e){if(a>=0){var d=this._timeline.getDocument();var g=e.event;var b=g.highlightColors[Math.min(a,g.highlightColors.length-1)];var f=d.createElement("div");f.style.position="absolute";f.style.overflow="hidden";f.style.left=(c.left-2)+"px";f.style.width=(c.width+4)+"px";f.style.top=(c.top-2)+"px";f.style.height=(c.height+4)+"px";this._highlightLayer.appendChild(f)}};Timeline.CompactEventPainter.prototype._onClickMultiplePreciseInstantEvent=function(e,f,b){var g=SimileAjax.DOM.getPageCoordinates(e);this._showBubble(g.left+Math.ceil(e.offsetWidth/2),g.top+Math.ceil(e.offsetHeight/2),b);var d=[];for(var a=0;a<b.length;a++){d.push(b[a].getID())}this._fireOnSelect(d);f.cancelBubble=true;SimileAjax.DOM.cancelEvent(f);return false};Timeline.CompactEventPainter.prototype._onClickInstantEvent=function(b,d,a){var e=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(e.left+Math.ceil(b.offsetWidth/2),e.top+Math.ceil(b.offsetHeight/2),[a]);this._fireOnSelect([a.getID()]);d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.CompactEventPainter.prototype._onClickDurationEvent=function(e,d,b){if("pageX" in d){var a=d.pageX;var g=d.pageY}else{var f=SimileAjax.DOM.getPageCoordinates(e);var a=d.offsetX+f.left;var g=d.offsetY+f.top}this._showBubble(a,g,[b]);this._fireOnSelect([b.getID()]);d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.CompactEventPainter.prototype.showBubble=function(a){var b=this._eventIdToElmt[a.getID()];if(b){var d=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(d.left+b.offsetWidth/2,d.top+b.offsetHeight/2,[a])}};Timeline.CompactEventPainter.prototype._showBubble=function(a,f,b){var e=document.createElement("div");b=("fillInfoBubble" in b)?[b]:b;for(var d=0;d<b.length;d++){var c=document.createElement("div");e.appendChild(c);b[d].fillInfoBubble(c,this._params.theme,this._band.getLabeller())}SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(e,a,f,this._params.theme.event.bubble.width)};Timeline.CompactEventPainter.prototype._fireOnSelect=function(b){for(var a=0;a<this._onSelectListeners.length;a++){this._onSelectListeners[a](b)}};Timeline.SpanHighlightDecorator=function(a){this._unit=a.unit!=null?a.unit:SimileAjax.NativeDateUnit;this._startDate=(typeof a.startDate=="string")?this._unit.parseFromObject(a.startDate):a.startDate;this._endDate=(typeof a.endDate=="string")?this._unit.parseFromObject(a.endDate):a.endDate;this._startLabel=a.startLabel!=null?a.startLabel:"";this._endLabel=a.endLabel!=null?a.endLabel:"";this._color=a.color;this._cssClass=a.cssClass!=null?a.cssClass:null;this._opacity=a.opacity!=null?a.opacity:100;this._zIndex=(a.inFront!=null&&a.inFront)?113:10};Timeline.SpanHighlightDecorator.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._layerDiv=null};Timeline.SpanHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv)}this._layerDiv=this._band.createLayerDiv(this._zIndex);this._layerDiv.setAttribute("name","span-highlight-decorator");this._layerDiv.style.display="none";var f=this._band.getMinDate();var c=this._band.getMaxDate();if(this._unit.compare(this._startDate,c)<0&&this._unit.compare(this._endDate,f)>0){f=this._unit.later(f,this._startDate);c=this._unit.earlier(c,this._endDate);var d=this._band.dateToPixelOffset(f);var k=this._band.dateToPixelOffset(c);var i=this._timeline.getDocument();var h=function(){var l=i.createElement("table");l.insertRow(0).insertCell(0);return l};var b=i.createElement("div");b.className="timeline-highlight-decorator";if(this._cssClass){b.className+=" "+this._cssClass}if(this._color!=null){b.style.backgroundColor=this._color}if(this._opacity<100){SimileAjax.Graphics.setOpacity(b,this._opacity)}this._layerDiv.appendChild(b);var j=h();j.className="timeline-highlight-label timeline-highlight-label-start";var g=j.rows[0].cells[0];g.innerHTML=this._startLabel;if(this._cssClass){g.className="label_"+this._cssClass}this._layerDiv.appendChild(j);var a=h();a.className="timeline-highlight-label timeline-highlight-label-end";var e=a.rows[0].cells[0];e.innerHTML=this._endLabel;if(this._cssClass){e.className="label_"+this._cssClass}this._layerDiv.appendChild(a);if(this._timeline.isHorizontal()){b.style.left=d+"px";b.style.width=(k-d)+"px";j.style.right=(this._band.getTotalViewLength()-d)+"px";j.style.width=(this._startLabel.length)+"em";a.style.left=k+"px";a.style.width=(this._endLabel.length)+"em"}else{b.style.top=d+"px";b.style.height=(k-d)+"px";j.style.bottom=d+"px";j.style.height="1.5px";a.style.top=k+"px";a.style.height="1.5px"}}this._layerDiv.style.display="block"};Timeline.SpanHighlightDecorator.prototype.softPaint=function(){};Timeline.PointHighlightDecorator=function(a){this._unit=a.unit!=null?a.unit:SimileAjax.NativeDateUnit;this._date=(typeof a.date=="string")?this._unit.parseFromObject(a.date):a.date;this._width=a.width!=null?a.width:10;this._color=a.color;this._cssClass=a.cssClass!=null?a.cssClass:"";this._opacity=a.opacity!=null?a.opacity:100};Timeline.PointHighlightDecorator.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._layerDiv=null};Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv)}this._layerDiv=this._band.createLayerDiv(10);this._layerDiv.setAttribute("name","span-highlight-decorator");this._layerDiv.style.display="none";var c=this._band.getMinDate();var e=this._band.getMaxDate();if(this._unit.compare(this._date,e)<0&&this._unit.compare(this._date,c)>0){var b=this._band.dateToPixelOffset(this._date);var a=b-Math.round(this._width/2);var d=this._timeline.getDocument();var f=d.createElement("div");f.className="timeline-highlight-point-decorator";f.className+=" "+this._cssClass;if(this._color!=null){f.style.backgroundColor=this._color}if(this._opacity<100){SimileAjax.Graphics.setOpacity(f,this._opacity)}this._layerDiv.appendChild(f);if(this._timeline.isHorizontal()){f.style.left=a+"px";f.style.width=this._width}else{f.style.top=a+"px";f.style.height=this._width}}this._layerDiv.style.display="block"};Timeline.PointHighlightDecorator.prototype.softPaint=function(){};Timeline.NativeDateUnit=new Object();Timeline.NativeDateUnit.createLabeller=function(a,b){return new Timeline.GregorianDateLabeller(a,b)};Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date()};Timeline.NativeDateUnit.cloneValue=function(a){return new Date(a.getTime())};Timeline.NativeDateUnit.getParser=function(a){if(typeof a=="string"){a=a.toLowerCase()}return(a=="iso8601"||a=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime};Timeline.NativeDateUnit.parseFromObject=function(a){return Timeline.DateTime.parseGregorianDateTime(a)};Timeline.NativeDateUnit.toNumber=function(a){return a.getTime()};Timeline.NativeDateUnit.fromNumber=function(a){return new Date(a)};Timeline.NativeDateUnit.compare=function(d,c){var b,a;if(typeof d=="object"){b=d.getTime()}else{b=Number(d)}if(typeof c=="object"){a=c.getTime()}else{a=Number(c)}return b-a};Timeline.NativeDateUnit.earlier=function(b,a){return Timeline.NativeDateUnit.compare(b,a)<0?b:a};Timeline.NativeDateUnit.later=function(b,a){return Timeline.NativeDateUnit.compare(b,a)>0?b:a};Timeline.NativeDateUnit.change=function(a,b){return new Date(a.getTime()+b)};Timeline.strings.fr={wikiLinkLabel:"Discute"};Timeline.GregorianDateLabeller.monthNames.fr=["jan","fev","mar","avr","mai","jui","jui","aou","sep","oct","nov","dec"];Timeline.strings.en={wikiLinkLabel:"Discuss"};Timeline.GregorianDateLabeller.monthNames.en=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Timeline.GregorianDateLabeller.dayNames.en=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];SimileAjax.NativeDateUnit.getParser=Timeline.NativeDateUnit.getParser=function(a){if(typeof a=="string"){if(a.indexOf("%")!=-1){return function(b){if(b){return strptime(b,a)}return null}}a=a.toLowerCase()}if(a=="iso8601"||a=="iso 8601"){return Timeline.DateTime.parseIso8601DateTime}return Timeline.DateTime.parseGregorianDateTime};Timeline.CubicWebEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._filterMatcher=null;this._highlightMatcher=null;this._frc=null;this._eventIdToElmt={}};Timeline.CubicWebEventPainter.prototype=new Timeline.OriginalEventPainter();Timeline.CubicWebEventPainter.prototype._paintEventLabel=function(i,j,b,g,a,k,e){var h=this._timeline.getDocument();var f=h.createElement("div");f.className="timeline-event-label";f.style.left=b+"px";f.style.width=a+"px";f.style.top=g+"px";if(i._obj.onclick){f.appendChild(A({href:i._obj.onclick},j))}else{if(i._obj.image){f.appendChild(IMG({src:i._obj.image,width:"30px",height:"30px"}))}else{f.innerHTML=j}}if(i._title!=null){f.title=i._title}var d=i.getTextColor();if(d==null){d=i.getColor()}if(d!=null){f.style.color=d}var c=i.getClassName();if(c){f.className+=" "+c}this._eventLayer.appendChild(f);return{left:b,top:g,width:a,height:k,elmt:f}};Timeline.CubicWebEventPainter.prototype._showBubble=function(a,e,b){var d=DIV({id:"xxx"});var c=this._params.theme.event.bubble.width;if(!b._obj.bubbleUrl){b.fillInfoBubble(d,this._params.theme,this._band.getLabeller())}SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(d,a,e,c);if(b._obj.bubbleUrl){jQuery("#xxx").loadxhtml(b._obj.bubbleUrl,null,"post","replace")}};function buildTheme(){var a=Timeline.ClassicTheme.create();a.event.instant.icon=Timeline_urlPrefix+"timeline/dark-blue-circle.png";a.event.instant.impreciseIcon=Timeline_urlPrefix+"timeline/dark-red-circle.png";a.event.bubble.width=600;a.event.bubble.height=180;a.event.trackHeight=0.2;a.event.trackGap=0.1;a.event.overviewTrack.tickHeight=3;a.event.overviewTrack.gap=2;a.event.overviewTrack.trackOffset=40;return a}function TimelineControlsManager(p,e,c){this.timeline=e;c=c||{};var o=c.shift||60;var t=c.leftControlImg||baseuri()+"data/Arrow_Blue_Left_001.png";var q=c.rightControlImg||baseuri()+"data/Arrow_Blue_Right_001.png";var r=c.leftControlWidth||15;var h=c.rightControlWidth||15;var w=c.leftControlHeight||r;var m=c.rightControlHeight||h;var a=e._bands.length-1;var i=e._bands[a];var b=null;var d=null;function f(){i._syncWithBand._moveEther(-o);i._positionHighlight()}function u(){i._syncWithBand._moveEther(o);i._positionHighlight()}function l(){if(b){clearInterval(b)}b=setInterval(f,100)}function j(){clearInterval(b)}function k(){if(d){clearInterval(d)}d=setInterval(u,100)}function v(){if(d){clearInterval(d)}}function s(){i._timeframeChanged()}var g=p.width()-(r+h);p.after(DIV(null,IMG({id:"fixedBandLeftControl",src:t}),IMG({id:"fixedBandRightControl",src:q})));jQuery("#fixedBandLeftControl").mousedown(k).mouseup(v).mouseup(s).mouseout(v).css({width:r+"px",height:w+"px"});jQuery("#fixedBandRightControl").mousedown(l).mouseup(j).mouseup(s).mouseout(j).css({width:h+"px",height:m+"px",left:g+"px",position:"relative"})}function DynamicEventSource(a){this._events=(a instanceof Object)?a:new SimileAjax.EventIndex();this._listeners=[];this._loaded_ids={}}DynamicEventSource.prototype=new Timeline.DefaultEventSource();DynamicEventSource.prototype.loadJSON=function(d,b){if(d&&d.events){d.newevents=[];for(var c=0;c<d.events.length;c++){var a=d.events[c];if(!(a.id in this._loaded_ids)){d.newevents.push(a);this._loaded_ids[a.id]=null}}d.events=d.newevents}Timeline.DefaultEventSource.prototype.loadJSON.apply(this,[d,b])};var artItemEventSource=new DynamicEventSource();var tl;Widgets.CmhnTimelineWidget=defclass("CmhnTimelineWidget",null,{__init__:function(f){var i=DIV({id:"tl"});f.appendChild(i);var h=jQuery("#tl");h.css({height:"400px",width:h.parent().width()-15,border:"1px solid #ccc"});var d=new Timeline.DefaultEventSource();var e=buildTheme();var g=new Date(minDate[0],minDate[1]);var b=new Date(maxDate[0],maxDate[1]);var k={eventSource:artItemEventSource,width:"90%",intervalUnit:(b.getFullYear()-g.getFullYear())>200?SimileAjax.DateTime.DECADE:SimileAjax.DateTime.YEAR,intervalPixels:40,theme:e,date:new Date(centerDate[0],centerDate[1]),eventPainter:Timeline.CompactEventPainter,eventPainterParams:{iconLabelGap:5,labelRightMargin:20,iconWidth:40,iconHeight:40,stackConcurrentPreciseInstantEvents:{limit:5,moreMessageTemplate:"%0 More Events",icon:"no-image-20.png",iconWidth:20,iconHeight:20}}};var l={overview:true,eventSource:d,width:"10%",pxWidth:h.width(),intervalUnit:(b.getFullYear()-g.getFullYear())>200?SimileAjax.DateTime.CENTURY:SimileAjax.DateTime.DECADE,intervalPixels:40,eventPainter:DensityPainter,theme:e,startsOn:g,endsOn:b};var j=[Timeline.createBandInfo(k),createFixedBandInfo(l)];j[1].syncWith=0;j[1].highlight=true;tl=Timeline.create(i,j);var c=f.getAttribute("cubicweb:loadurl");jQuery("div.timeline-message-container").show();Timeline.loadJSON(c,function(o,m){d.loadJSON(o,m);jQuery("div.timeline-message-container").hide()});var a=new TimelineControlsManager(h,tl);tl._bands[1]._timeframeChanged()}});function showBubbleBox(a,d,b){var c=(baseuri()+"view?vid=event-bubble&__notemplate=1&rql=Any X WHERE X eid "+b[0].getID());jQuery("#tlbubble").loadxhtml(c,{callback:function(){var e=(jQuery(window).width()-700)/2;jQuery("#tlbubble").css("left",e).fadeIn("slow")}})}Timeline.CompactEventPainter.prototype._showBubble=showBubbleBox;var overviewTickTopPosition={};Timeline.OverviewEventPainter.prototype._paintEventTick=function(l,a,c,g,j,d){var e=overviewTickTopPosition;var h=20;var i;var f=1;if(a in e){i=jQuery("#div-"+a);f=e[a]+1}else{var k=this._timeline.getDocument().createElement("div");k.id="div-"+a;k.style.left=a+"px";k.style.top="0px";k.style.width="1px";k.style.overflow="hidden";k.style.position="absolute";k.style.backgroundColor="#58A0DC";this._eventLayer.appendChild(k);i=jQuery(k)}var m=f*3;i.css("height",m);e[a]=f;var b=l.getClassName();if(g<100){SimileAjax.Graphics.setOpacity(i[0],g)}return{left:a,top:0,width:1,height:m,elmt:k}};function createFixedBandInfo(d){var e=("theme" in d)?d.theme:Timeline.getDefaultTheme();var b=("eventSource" in d)?d.eventSource:null;var f=new FixedWidthEther(d);var g=new Timeline.GregorianEtherPainter({unit:d.intervalUnit,multiple:("multiple" in d)?d.multiple:1,theme:e,align:("align" in d)?d.align:undefined});var i={showText:("showEventText" in d)?d.showEventText:true,theme:e};if("eventPainterParams" in d){for(var a in d.eventPainterParams){i[a]=d.eventPainterParams[a]}}if("trackHeight" in d){i.trackHeight=d.trackHeight}if("trackGap" in d){i.trackGap=d.trackGap}var h=("overview" in d&&d.overview)?"overview":("layout" in d?d.layout:"original");var c;if("eventPainter" in d){c=new d.eventPainter(i)}else{switch(h){case"overview":c=new Timeline.OverviewEventPainter(i);break;case"detailed":c=new Timeline.DetailedEventPainter(i);break;default:c=new Timeline.OriginalEventPainter(i)}}return{bandClass:FixedBand,width:d.width,eventSource:b,timeZone:("timeZone" in d)?d.timeZone:0,ether:f,etherPainter:g,eventPainter:c,theme:e,zoomIndex:("zoomIndex" in d)?d.zoomIndex:0,zoomSteps:("zoomSteps" in d)?d.zoomSteps:null}}function FixedBand(g,h,c){this.__type__="FixedBand";if(g.autoWidth&&typeof h.width=="string"){h.width=h.width.indexOf("%")>-1?0:parseInt(h.width)}this._timeline=g;this._bandInfo=h;this._index=c;this._locale=("locale" in h)?h.locale:Timeline.getDefaultLocale();this._timeZone=("timeZone" in h)?h.timeZone:0;this._labeller=("labeller" in h)?h.labeller:(("createLabeller" in g.getUnit())?g.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone));this._theme=h.theme;this._zoomIndex=("zoomIndex" in h)?h.zoomIndex:0;this._zoomSteps=("zoomSteps" in h)?h.zoomSteps:null;this._dragging=false;this._changing=false;this._originalScrollSpeed=5;this._scrollSpeed=this._originalScrollSpeed;this._onScrollListeners=[];var a=this;this._syncWithBand=null;this._syncWithBandHandler=function(b){if(a._highlight){a._etherPainter.setHighlight(a._syncWithBand.getMinVisibleDate(),a._syncWithBand.getMaxVisibleDate())}};this._selectorListener=function(b){a._onHighlightBandScroll()};var e=this._timeline.getDocument().createElement("div");e.className="timeline-band-input";this._timeline.addDiv(e);this._keyboardInput=document.createElement("input");this._keyboardInput.type="text";e.appendChild(this._keyboardInput);SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,"_onKeyDown");SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,"_onKeyUp");this._div=this._timeline.getDocument().createElement("div");this._div.id="timeline-band-"+c;this._div.className="timeline-band timeline-band-"+c;this._timeline.addDiv(this._div);SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown");SimileAjax.DOM.registerEventWithObject(this._div,"mousemove",this,"_onMouseMove");SimileAjax.DOM.registerEventWithObject(this._div,"mouseup",this,"_onMouseUp");SimileAjax.DOM.registerEventWithObject(this._div,"mouseout",this,"_onMouseOut");SimileAjax.DOM.registerEventWithObject(this._div,"dblclick",this,"_onDblClick");var f=this._theme!=null?this._theme.mouseWheel:"scroll";if(f==="zoom"||f==="scroll"||this._zoomSteps){if(SimileAjax.Platform.browser.isFirefox){SimileAjax.DOM.registerEventWithObject(this._div,"DOMMouseScroll",this,"_onMouseScroll")}else{SimileAjax.DOM.registerEventWithObject(this._div,"mousewheel",this,"_onMouseScroll")}}this._innerDiv=this._timeline.getDocument().createElement("div");this._innerDiv.className="timeline-band-inner";this._div.appendChild(this._innerDiv);this._ether=h.ether;h.ether.initialize(this,g);this._etherPainter=h.etherPainter;h.etherPainter.initialize(this,g);this._eventSource=h.eventSource;if(this._eventSource){this._eventListener={onAddMany:function(){a._onAddMany()},onClear:function(){a._onClear()}};this._eventSource.addListener(this._eventListener)}this._eventPainter=h.eventPainter;this._eventTracksNeeded=0;this._eventTrackIncrement=0;h.eventPainter.initialize(this,g);this._decorators=("decorators" in h)?h.decorators:[];for(var d=0;d<this._decorators.length;d++){this._decorators[d].initialize(this,g)}}FixedBand.prototype=new Timeline._Band();FixedBand.prototype._onDblClick=function(b,a,e){var d=SimileAjax.DOM.getEventRelativeCoordinates(a,b);var g=d.x+this._viewOffset;var f=this._ether.pixelOffsetToDate(g);var c=this._timeline;this._syncWithBand.scrollToCenter(f);this._timeframeChanged()};FixedBand.prototype._onMouseMove=function(e,b,f){if(this._dragging){var d=b.clientX-this._dragX;var c=b.clientY-this._dragY;this._dragX=b.clientX;this._dragY=b.clientY;var a=this._timeline.isHorizontal()?d:c;this._syncWithBand._moveEther(-a);this._positionHighlight()}};FixedBand.prototype._onMouseDown=function(b,a,c){Timeline._Band.prototype._onMouseDown.apply(this,[b,a,c]);SimileAjax.Graphics.setOpacity(this._etherPainter._highlight._highlightDiv,100)};FixedBand.prototype._timeframeChanged=function(){var b=this._etherPainter._highlight._highlightDiv;var a=jQuery(b);var d=a.position().left;var e=d+a.width();var c=this.pixelOffsetToDate(d);var f=this.pixelOffsetToDate(e);jQuery(CubicWeb).trigger("timeframe-changed",[c,f])};FixedBand.prototype._onMouseUp=function(c,a,e){Timeline._Band.prototype._onMouseUp.apply(this,[c,a,e]);var b=this._etherPainter._theme.ether.highlightOpacity;var d=this._etherPainter._highlight._highlightDiv;SimileAjax.Graphics.setOpacity(d,b);this._timeframeChanged()};function guessPixelsInterval(c,b,e,d){var f=b-c;var a=f/SimileAjax.DateTime.gregorianUnitLengths[e];return d/a}function FixedWidthEther(c){var b;if("pixelsPerInterval" in c){b=c.pixelsPerInterval}else{b=guessPixelsInterval(c.startsOn,c.endsOn,c.intervalUnit,c.pxWidth)}var a={startsOn:c.startsOn,endsOn:c.endsOn,pixelsPerInterval:b,interval:SimileAjax.DateTime.gregorianUnitLengths[c.intervalUnit]};Timeline.LinearEther.apply(this,[a])}FixedWidthEther.prototype=new Timeline.LinearEther({});ArtItemEventPainter=function(a){Timeline.OriginalEventPainter.apply(this,[a])};ArtItemEventPainter.prototype=new Timeline.OriginalEventPainter({});ArtItemEventPainter.prototype.paintInstantEvent=function(b,c,d,a){this.paintPreciseInstantEvent(b,c,d,a)};ArtItemEventPainter.prototype._paintEventIcon=function(a,c,f,b,e,d){a._icon=(a.getClassName()=="imprecise")?e.event.instant.impreciseIcon:e.event.instant.icon;return Timeline.OriginalEventPainter.prototype._paintEventIcon.apply(this,[a,c,f,b,e,d])};Timeline.DefaultEventSource.Event.prototype.fillTime=function(a,b){if(this._obj.datePrecision){a.appendChild(a.ownerDocument.createTextNode(this._obj.datePrecision))}else{a.appendChild(a.ownerDocument.createTextNode(this._start.getFullYear()))}};function DensityPainter(a){Timeline.OverviewEventPainter.apply(this,arguments)}DensityPainter.prototype=new Timeline.OverviewEventPainter();DensityPainter.prototype._paintEventTick=function(j,b,d,f,g,e){var k=5;var h=0;var a=35;var i=this._timeline.getDocument().createElement("div");i.style.position="absolute";i.style.left=b+"px";i.style.top=h+"px";i.style.width=a+"px";i.style.height=k+"px";i.style.background="#1190A1";i.style.opacity=j._obj.opacity;var c=j.getClassName();if(c){i.className+=" small-"+c}if(f<100){SimileAjax.Graphics.setOpacity(i,f)}this._eventLayer.appendChild(i);return{left:b,top:h,width:a,height:k,elmt:i}};