-
Notifications
You must be signed in to change notification settings - Fork 2
/
timeplot-complete-min.js
1 lines (1 loc) · 278 KB
/
timeplot-complete-min.js
1
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){return;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.includeJavascriptFile(d,SimileAjax.urlPrefix+"scripts/signal.js?"+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=["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=["timeplot-single.css"];if(!("jQuery" in window)&&!("$" in window)){c.unshift("jquery-1.3.2.min.js")}if(typeof SimileAjax_urlPrefix=="string"){SimileAjax.urlPrefix=SimileAjax_urlPrefix}else{var b=SimileAjax.findScript(document,"timeplot-complete-min.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("timeplot-complete-min.js"))}SimileAjax.parseURLParameters(b,SimileAjax.params,{bundle:Boolean});if(SimileAjax.params.bundle){SimileAjax.includeJavascriptFiles(document,SimileAjax.urlPrefix,["simile-ajax-bundle.js"])}else{SimileAjax.includeJavascriptFiles(document,SimileAjax.urlPrefix+"scripts/",c)}SimileAjax.includeCssFiles(document,SimileAjax.urlPrefix+"styles/",a);SimileAjax.includeCssFile=function(e,d){return};SimileAjax.loaded=true})()}if(!("jQuery" in window)&&!("$" in window)){(function(){var W=this,ab,F=W.jQuery,S=W.$,T=W.jQuery=W.$=function(b,a){return new T.fn.init(b,a)},M=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,ac=/^.[^:#\[\.,]*$/;T.fn=T.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=T.clean([c[1]],b)}else{var a=document.getElementById(c[3]);if(a&&a.id!=c[3]){return T().find(e)}var d=T(a||[]);d.context=document;d.selector=e;return d}}else{return T(b).find(e)}}else{if(T.isFunction(e)){return T(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(T.isArray(e)?e:T.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===ab?Array.prototype.slice.call(this):this[a]},pushStack:function(c,a,d){var b=T(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 T.each(this,a,b)},index:function(a){return T.inArray(a&&a.jquery?a[0]:a,this)},attr:function(c,a,b){var d=c;if(typeof c==="string"){if(a===ab){return this[0]&&T[b||"attr"](this[0],c)}else{d={};d[c]=a}}return this.each(function(e){for(c in d){T.attr(b?this.style:this,c,T.prop(this,d[c],b,e,c))}})},css:function(b,a){if((b=="width"||b=="height")&&parseFloat(a)<0){a=ab}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="";T.each(a||this,function(){T.each(this.childNodes,function(){if(this.nodeType!=8){b+=this.nodeType!=1?this.nodeValue:T.fn.text([this])}})});return b},wrapAll:function(b){if(this[0]){var a=T(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(){T(this).contents().wrapAll(a)})},wrap:function(a){return this.each(function(){T(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||T([])},push:[].push,sort:[].sort,splice:[].splice,find:function(b){if(this.length===1){var a=this.pushStack([],"find",b);a.length=0;T.find(b,this[0],a);return a}else{return this.pushStack(T.unique(T.map(this,function(c){return T.find(b,c)})),"find",b)}},clone:function(b){var d=this.map(function(){if(!T.support.noCloneEvent&&!T.isXMLDoc(this)){var f=this.outerHTML;if(!f){var e=this.ownerDocument.createElement("div");e.appendChild(this.cloneNode(true));f=e.innerHTML}return T.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=T.data(a[c],"events");for(var e in g){for(var f in g[e]){T.event.add(this,e,g[e][f],g[e][f].data)}}c++})}return d},filter:function(a){return this.pushStack(T.isFunction(a)&&T.grep(this,function(b,c){return a.call(b,c)})||T.multiFilter(a,T.grep(this,function(b){return b.nodeType===1})),"filter",a)},closest:function(c){var a=T.expr.match.POS.test(c)?T(c):null,b=0;return this.map(function(){var d=this;while(d&&d.ownerDocument){if(a?a.index(d)>-1:T(d).is(c)){T.data(d,"closest",b);return d}d=d.parentNode;b++}})},not:function(b){if(typeof b==="string"){if(ac.test(b)){return this.pushStack(T.multiFilter(b,this,true),"not",b)}else{b=T.multiFilter(b,this)}}var a=b.length&&b[b.length-1]!==ab&&!b.nodeType;return this.filter(function(){return a?T.inArray(this,b)<0:this!=b})},add:function(a){return this.pushStack(T.unique(T.merge(this.get(),typeof a==="string"?T(a):T.makeArray(a))))},is:function(a){return !!a&&T.multiFilter(a,this).length>0},hasClass:function(a){return !!a&&this.is("."+a)},val:function(c){if(c===ab){var i=this[0];if(i){if(T.nodeName(i,"option")){return(i.attributes.value||{}).specified?i.value:i.text}if(T.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=T(g).val();if(f){return c}b.push(c)}}return b}return(i.value||"").replace(/\r/g,"")}return ab}if(typeof c==="number"){c+=""}return this.each(function(){if(this.nodeType!=1){return}if(T.isArray(c)&&/radio|checkbox/.test(this.type)){this.checked=(T.inArray(this.value,c)>=0||T.inArray(this.name,c)>=0)}else{if(T.nodeName(this,"select")){var j=T.makeArray(c);T("option",this).each(function(){this.selected=(T.inArray(this.value,j)>=0||T.inArray(this.text,j)>=0)});if(!j.length){this.selectedIndex=-1}}else{this.value=c}}})},html:function(a){return a===ab?(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(T.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=T.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){T.each(h,E)}}return this;function c(k,j){return a&&T.nodeName(k,"table")&&T.nodeName(j,"tr")?(k.getElementsByTagName("tbody")[0]||k.appendChild(k.ownerDocument.createElement("tbody"))):k}}};T.fn.init.prototype=T.fn;function E(b,a){if(a.src){T.ajax({url:a.src,async:false,dataType:"script"})}else{T.globalEval(a.text||a.textContent||a.innerHTML||"")}if(a.parentNode){a.parentNode.removeChild(a)}}function ad(){return +new Date}T.extend=T.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"&&!T.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]=T.extend(h,b||(a.length!=null?[]:{}),a)}else{if(a!==ab){c[g]=a}}}}}return c};var ag=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},L=Object.prototype.toString;T.extend({noConflict:function(a){W.$=S;if(a){W.jQuery=F}return T},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&&T.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(T.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===ab){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===ab){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(T.isFunction(a)){a=a.call(b,d)}return typeof a==="number"&&c=="curCSS"&&!ag.test(e)?a+"px":a},className:{add:function(b,a){T.each((a||"").split(/\s+/),function(d,c){if(b.nodeType==1&&!T.className.has(b.className,c)){b.className+=(b.className?" ":"")+c}})},remove:function(b,a){if(b.nodeType==1){b.className=a!==ab?T.grep(b.className.split(/\s+/),function(c){return !T.className.has(a,c)}).join(" "):""}},has:function(a,b){return a&&T.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}T.each(b,function(){if(!h){a-=parseFloat(T.curCSS(e,"padding"+this,true))||0}if(h==="margin"){a+=parseFloat(T.curCSS(e,"margin"+this,true))||0}else{a-=parseFloat(T.curCSS(e,"border"+this+"Width",true))||0}})}if(e.offsetWidth!==0){d()}else{T.swap(e,f,d)}return Math.max(0,Math.round(a))}return T.curCSS(e,g,c)},curCSS:function(e,h,g){var b,i=e.style;if(h=="opacity"&&!T.support.opacity){b=T.attr(i,"opacity");return b==""?"1":b}if(h.match(/float/i)){h=H}if(!g&&i&&i[h]){b=i[h]}else{if(Q.getComputedStyle){if(h.match(/float/i)){h="float"}h=h.replace(/([A-Z])/g,"-$1").toLowerCase();var a=Q.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");T.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>"]||!T.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];a.innerHTML=k[1]+i+k[2];while(k[0]--){a=a.lastChild}if(!T.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(T.nodeName(o[p],"tbody")&&!o[p].childNodes.length){o[p].parentNode.removeChild(o[p])}}}if(!T.support.leadingWhitespace&&/^\s/.test(i)){a.insertBefore(b.createTextNode(i.match(/^\s*/)[0]),a.firstChild)}i=T.makeArray(a.childNodes)}if(i.nodeType){f.push(i)}else{f=T.merge(f,i)}});if(d){for(var c=0;f[c];c++){if(T.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(T.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 ab}var e=!T.isXMLDoc(c),a=b!==ab;f=e&&T.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"&&T.nodeName(c,"input")&&c.parentNode){throw"type property can't be changed"}c[f]=b}if(T.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:ab}return c[f]}if(!T.support.style&&e&&f=="style"){return T.attr(c.style,"cssText",b)}if(a){c.setAttribute(f,""+b)}var h=!T.support.hrefNormalized&&e&&g?c.getAttribute(f,2):c.getAttribute(f);return h===null?ab:h}if(!T.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"||T.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(!T.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=T.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();T.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)};T.each({parent:function(a){return a.parentNode},parents:function(a){return T.dir(a,"parentNode")},next:function(a){return T.nth(a,2,"nextSibling")},prev:function(a){return T.nth(a,2,"previousSibling")},nextAll:function(a){return T.dir(a,"nextSibling")},prevAll:function(a){return T.dir(a,"previousSibling")},siblings:function(a){return T.sibling(a.parentNode.firstChild,a)},children:function(a){return T.sibling(a.firstChild)},contents:function(a){return T.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:T.makeArray(a.childNodes)}},function(b,a){T.fn[b]=function(d){var c=T.map(this,a);if(d&&typeof d=="string"){c=T.multiFilter(d,c)}return this.pushStack(T.unique(c),b,d)}});T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,a){T.fn[b]=function(h){var e=[],c=T(h);for(var d=0,g=c.length;d<g;d++){var f=(d>0?this.clone(true):this).get();T.fn[a].apply(T(c[d]),f);e=e.concat(f)}return this.pushStack(e,b,h)}});T.each({removeAttr:function(a){T.attr(this,a,"");if(this.nodeType==1){this.removeAttribute(a)}},addClass:function(a){T.className.add(this,a)},removeClass:function(a){T.className.remove(this,a)},toggleClass:function(a,b){if(typeof b!=="boolean"){b=!T.className.has(this,a)}T.className[b?"add":"remove"](this,a)},remove:function(a){if(!a||T.filter(a,[this]).length){T("*",this).add([this]).each(function(){T.event.remove(this);T.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){T(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(b,a){T.fn[b]=function(){return this.each(a,arguments)}});function Y(b,a){return b[0]&&parseInt(T.curCSS(b[0],a,true),10)||0}var aa="jQuery"+ad(),I=0,R={};T.extend({cache:{},data:function(c,d,b){c=c==W?R:c;var a=c[aa];if(!a){a=c[aa]=++I}if(d&&!T.cache[a]){T.cache[a]={}}if(b!==ab){T.cache[a][d]=b}return d?T.cache[a][d]:a},removeData:function(c,d){c=c==W?R:c;var a=c[aa];if(d){if(T.cache[a]){delete T.cache[a][d];d="";for(d in T.cache[a]){break}if(!d){T.removeData(c)}}}else{try{delete c[aa]}catch(b){if(c.removeAttribute){c.removeAttribute(aa)}}delete T.cache[a]}},queue:function(c,d,a){if(c){d=(d||"fx")+"queue";var b=T.data(c,d);if(!b||T.isArray(a)){b=T.data(c,d,T.makeArray(a))}else{if(a){b.push(a)}}}return b},dequeue:function(a,b){var d=T.queue(a,b),c=d.shift();if(!b||b==="fx"){c=d[0]}if(c!==ab){c.call(a)}}});T.fn.extend({data:function(d,b){var a=d.split(".");a[1]=a[1]?"."+a[1]:"";if(b===ab){var c=this.triggerHandler("getData"+a[1]+"!",[a[0]]);if(c===ab&&this.length){c=T.data(this[0],d)}return c===ab&&a[1]?this.data(a[0]):c}else{return this.trigger("setData"+a[1]+"!",[a[0],b]).each(function(){T.data(this,d,b)})}},removeData:function(a){return this.each(function(){T.removeData(this,a)})},queue:function(b,a){if(typeof b!=="string"){a=b;b="fx"}if(a===ab){return T.queue(this[0],b)}return this.each(function(){var c=T.queue(this,b,a);if(b=="fx"&&c.length==1){c[0].call(this)}})},dequeue:function(a){return this.each(function(){T.dequeue(this,a)})}});(function(){var b=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,h=0,l=Object.prototype.toString;var o=function(s,w,aj,ai){aj=aj||[];w=w||document;if(w.nodeType!==1&&w.nodeType!==9){return[]}if(!s||typeof s!=="string"){return aj}var r=[],u,B,y,x,D,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]]){B=j(r[0]+r[1],w)}else{B=k.relative[r[0]]?[w]:o(r.shift(),w);while(r.length){s=r.shift();if(k.relative[s]){s+=r.shift()}B=j(s,B)}}}else{var C=ai?{expr:r.pop(),set:p(ai)}:o.find(r.pop(),r.length===1&&w.parentNode?w.parentNode:w,c(w));B=o.filter(C.expr,C.set);if(r.length>0){y=p(B)}else{t=false}while(r.length){var z=r.pop(),A=z;if(!k.relative[z]){z=""}else{A=r.pop()}if(A==null){A=w}k.relative[z](y,A,c(w))}}if(!y){y=B}if(!y){throw"Syntax error, unrecognized expression: "+(z||s)}if(l.call(y)==="[object Array]"){if(!t){aj.push.apply(aj,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]))){aj.push(B[q])}}}else{for(var q=0;y[q]!=null;q++){if(y[q]&&y[q].nodeType===1){aj.push(B[q])}}}}}else{p(y,aj)}if(v){o(v,w,aj,ai);if(m){hasDuplicate=false;aj.sort(m);if(hasDuplicate){for(var q=1;q<aj.length;q++){if(aj[q]===aj[q-1]){aj.splice(q--,1)}}}}}return aj};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(D,ai,A,u){var v=D,y=[],q=ai,s,x,r=ai&&ai[0]&&c(ai[0]);while(D&&ai.length){for(var aj in k.filter){if((s=k.match[aj].exec(D))!=null){var w=k.filter[aj],z,B;x=false;if(q==y){y=[]}if(k.preFilter[aj]){s=k.preFilter[aj](s,q,A,y,u,r);if(!s){x=z=true}else{if(s===true){continue}}}if(s){for(var t=0;(B=q[t])!=null;t++){if(B){z=w(B,s,t,q);var C=u^!!z;if(A&&z!=null){if(C){x=true}else{q[t]=false}}else{if(C){y.push(B);x=true}}}}}if(z!==ab){if(!A){q=y}D=D.replace(k.match[aj],"");if(!x){return[]}break}}}if(D==v){if(x==null){throw"Syntax error, unrecognized expression: "+D}else{break}}v=D}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]:ab:[]}};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 A=w=="previousSibling"&&!z;for(var u=0,v=y.length;u<v;u++){var x=y[u];if(x){if(A&&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 A=w=="previousSibling"&&!z;for(var u=0,v=y.length;u<v;u++){var x=y[u];if(x){if(A&&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)};T.find=o;T.filter=o.filter;T.expr=o.selectors;T.expr[":"]=T.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 T.grep(T.timers,function(r){return q===r.elem}).length};T.multiFilter=function(q,s,r){if(r){q=":not("+q+")"}return o.matches(q,s)};T.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};T.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};T.sibling=function(q,r){var s=[];for(;q;q=q.nextSibling){if(q.nodeType==1&&q!=r){s.push(q)}}return s};return;W.Sizzle=o})();T.event={add:function(c,f,d,a){if(c.nodeType==3||c.nodeType==8){return}if(c.setInterval&&c!=W){c=W}if(!d.guid){d.guid=this.guid++}if(a!==ab){var e=d;d=this.proxy(e);d.data=a}var g=T.data(c,"events")||T.data(c,"events",{}),b=T.data(c,"handle")||T.data(c,"handle",function(){return typeof T!=="undefined"&&!T.event.triggered?T.event.handle.apply(arguments.callee.elem,arguments):ab});b.elem=c;T.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(T.event.specialAll[j]){T.event.specialAll[j].setup.call(c,a,i)}if(!h){h=g[j]={};if(!T.event.special[j]||T.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;T.event.global[j]=true});c=null},guid:1,global:{},remove:function(b,e,c){if(b.nodeType==3||b.nodeType==8){return}var f=T.data(b,"events"),g,h;if(f){if(e===ab||(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}T.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(T.event.specialAll[k]){T.event.specialAll[k].teardown.call(b,i)}for(g in f[k]){break}if(!g){if(!T.event.special[k]||T.event.special[k].teardown.call(b,i)===false){if(b.removeEventListener){b.removeEventListener(k,T.data(b,"handle"),false)}else{if(b.detachEvent){b.detachEvent("on"+k,T.data(b,"handle"))}}}g=null;delete f[k]}}})}for(g in f){break}if(!g){var a=T.data(b,"handle");if(a){a.elem=null}T.removeData(b,"events");T.removeData(b,"handle")}}},trigger:function(d,b,e,h){var f=d.type||d;if(!h){d=typeof d==="object"?d[aa]?d:T.extend(T.Event(f),d):T.Event(f);if(f.indexOf("!")>=0){d.type=f=f.slice(0,-1);d.exclusive=true}if(!e){d.stopPropagation();if(this.global[f]){T.each(T.cache,function(){if(this.events&&this.events[f]){T.event.trigger(d,b,this.handle.elem)}})}}if(!e||e.nodeType==3||e.nodeType==8){return ab}d.result=ab;d.target=e;b=T.makeArray(b);b.unshift(d)}d.currentTarget=e;var c=T.data(e,"handle");if(c){c.apply(e,b)}if((!e[f]||(T.nodeName(e,"a")&&f=="click"))&&e["on"+f]&&e["on"+f].apply(e,b)===false){d.result=false}if(!h&&e[f]&&!d.isDefaultPrevented()&&!(T.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){T.event.trigger(d,b,g,true)}}},handle:function(b){var c,h;b=arguments[0]=T.event.fix(b||W.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=(T.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!==ab){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[aa]){return c}var e=c;c=T.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:P,teardown:function(){}}},specialAll:{live:{setup:function(b,a){T.event.add(this,a[0],af)},teardown:function(a){if(a.length){var c=0,b=RegExp("(^|\\.)"+a[0]+"(\\.|$)");T.each((T.data(this,"events").live||{}),function(){if(b.test(this.type)){c++}});if(c<1){T.event.remove(this,a[0],af)}}}}}};T.Event=function(a){if(!this.preventDefault){return new T.Event(a)}if(a&&a.type){this.originalEvent=a;this.type=a.type}else{this.type=a}this.timeStamp=ad();this[aa]=true};function X(){return false}function J(){return true}T.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:X,isPropagationStopped:X,isImmediatePropagationStopped:X};var ah=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;T.event.handle.apply(this,arguments)}};T.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,b){T.event.special[b]={setup:function(){T.event.add(this,a,ah,b)},teardown:function(){T.event.remove(this,a,ah)}}});T.fn.extend({bind:function(b,a,c){return b=="unload"?this.one(b,a,c):this.each(function(){T.event.add(this,b,c||a,c&&a)})},one:function(b,a,c){var d=T.event.proxy(c||a,function(e){T(this).unbind(e,d);return(c||a).apply(this,arguments)});return this.each(function(){T.event.add(this,b,d,c&&a)})},unbind:function(a,b){return this.each(function(){T.event.remove(this,a,b)})},trigger:function(b,a){return this.each(function(){T.event.trigger(b,a,this)})},triggerHandler:function(c,a){if(this[0]){var b=T.Event(c);b.preventDefault();b.stopPropagation();T.event.trigger(b,a,this[0]);return b.result}},toggle:function(a){var c=arguments,b=1;while(b<c.length){T.event.proxy(a,c[b++])}return this.click(T.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){P();if(T.isReady){a.call(document,T)}else{T.readyList.push(a)}return this},live:function(a,b){var c=T.event.proxy(b);c.guid+=this.selector+a;T(document).bind(Z(a,this.selector),this.selector,c);return this},die:function(a,b){T(document).unbind(Z(a,this.selector),b?{guid:b.guid+this.selector+a}:null);return this}});function af(a){var d=RegExp("(^|\\.)"+a.type+"(\\.|$)"),b=true,c=[];T.each(T.data(this,"events").live||[],function(g,f){if(d.test(f.type)){var e=T(a.target).closest(f.data)[0];if(e){c.push({elem:e,fn:f})}}});c.sort(function(e,f){return T.data(e.elem,"closest")-T.data(f.elem,"closest")});T.each(c,function(){if(this.fn.call(this.elem,a,this.fn.data)===false){return(b=false)}});return b}function Z(a,b){return["live",a,b.replace(/\./g,"`").replace(/ /g,"|")].join(".")}T.extend({isReady:false,readyList:[],ready:function(){if(!T.isReady){T.isReady=true;if(T.readyList){T.each(T.readyList,function(){this.call(document,T)});T.readyList=null}T(document).triggerHandler("ready")}}});var G=false;function P(){if(G){return}G=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);T.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);T.ready()}});if(document.documentElement.doScroll&&W==W.top){(function(){if(T.isReady){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}T.ready()})()}}}T.event.add(W,"load",T.ready)}T.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){T.fn[b]=function(c){return c?this.bind(b,c):this.trigger(b)}});T(W).bind("unload",function(){for(var a in T.cache){if(a!=1&&T.cache[a].handle){T.event.remove(T.cache[a].handle.elem)}}});(function(){T.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}T.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(W[b]){T.support.scriptEval=true;delete W[b]}f.removeChild(e);if(a.attachEvent&&a.fireEvent){a.attachEvent("onclick",function(){T.support.noCloneEvent=false;a.detachEvent("onclick",arguments.callee)});a.cloneNode(true).fireEvent("onclick")}T(function(){var h=document.createElement("div");h.style.width=h.style.paddingLeft="1px";document.body.appendChild(h);T.boxModel=T.support.boxModel=h.offsetWidth===2;document.body.removeChild(h).style.display="none"})})();var H=T.support.cssFloat?"cssFloat":"styleFloat";T.props={"for":"htmlFor","class":"className","float":H,cssFloat:H,styleFloat:H,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};T.fn.extend({_load:T.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(T.isFunction(b)){a=b;b=null}else{if(typeof b==="object"){b=T.param(b);d="POST"}}}var f=this;T.ajax({url:e,type:d,dataType:"html",data:b,complete:function(i,h){if(h=="success"||h=="notmodified"){f.html(g?T("<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 T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?T.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=T(this).val();return a==null?null:T.isArray(a)?T.map(a,function(d,e){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});T.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(b,a){T.fn[a]=function(c){return this.bind(a,c)}});var N=ad();T.extend({get:function(d,b,a,c){if(T.isFunction(b)){a=b;b=null}return T.ajax({type:"GET",url:d,data:b,success:a,dataType:c})},getScript:function(b,a){return T.get(b,null,a,"script")},getJSON:function(c,b,a){return T.get(c,b,a,"json")},post:function(d,b,a,c){if(T.isFunction(b)){a=b;b={}}return T.ajax({type:"POST",url:d,data:b,success:a,dataType:c})},ajaxSetup:function(a){T.extend(T.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return W.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=T.extend(true,k,T.extend(true,{},T.ajaxSettings,k));var a,s=/=\?(&|$)/g,f,b,r=k.type.toUpperCase();if(k.data&&k.processData&&typeof k.data!=="string"){k.data=T.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";W[a]=function(v){b=v;p();l();W[a]=ab;try{delete W[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=ad();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&&!T.active++){T.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 ab}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",T.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&&!--T.active){T.event.trigger("ajaxStop")}o.abort();return false}if(k.global){T.event.trigger("ajaxSend",[o,k])}var j=function(w){if(o.readyState==0){if(h){clearInterval(h);h=null;if(k.global&&!--T.active){T.event.trigger("ajaxStop")}}}else{if(!m&&o&&(o.readyState==4||w=="timeout")){m=true;if(h){clearInterval(h);h=null}f=w=="timeout"?"timeout":!T.httpSuccess(o)?"error":k.ifModified&&T.httpNotModified(o,k.url)?"notmodified":"success";if(f=="success"){try{b=T.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){T.lastModified[k.url]=v}if(!a){p()}}else{T.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){T.handleError(k,o,null,e)}if(!k.async){j()}function p(){if(k.success){k.success(b,f)}if(k.global){T.event.trigger("ajaxSuccess",[o,k])}}function l(){if(k.complete){k.complete(o,f)}if(k.global){T.event.trigger("ajaxComplete",[o,k])}if(k.global&&!--T.active){T.event.trigger("ajaxStop")}}return o},handleError:function(c,a,d,b){if(c.error){c.error(a,d,b)}if(c.global){T.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==T.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"){T.globalEval(b)}if(c=="json"){b=W["eval"]("("+b+")")}}return b},param:function(d){var b=[];function a(f,e){b[b.length]=encodeURIComponent(f)+"="+encodeURIComponent(e)}if(T.isArray(d)||d.jquery){T.each(d,function(){a(this.name,this.value)})}else{for(var c in d){if(T.isArray(d[c])){T.each(d[c],function(){a(c,this)})}else{a(c,T.isFunction(d[c])?d[c]():d[c])}}}return b.join("&").replace(/%20/g,"+")}});var V={},U,ae=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function K(b,c){var a={};T.each(ae.concat.apply([],ae.slice(0,c)),function(){a[this]=b});return a}T.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=T.data(this[e],"olddisplay");this[e].style.display=h||"";if(T.css(this[e],"display")==="none"){var f=this[e].tagName,b;if(V[f]){b=V[f]}else{var d=T("<"+f+" />").appendTo("body");b=d.css("display");if(b==="none"){b="block"}d.remove();V[f]=b}T.data(this[e],"olddisplay",b)}}for(var e=0,g=this.length;e<g;e++){this[e].style.display=T.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=T.data(this[c],"olddisplay");if(!e&&e!=="none"){T.data(this[c],"olddisplay",T.css(this[c],"display"))}}for(var c=0,d=this.length;c<d;c++){this[c].style.display="none"}return this}},_toggle:T.fn.toggle,toggle:function(a,b){var c=typeof a==="boolean";return T.isFunction(a)&&T.isFunction(b)?this._toggle.apply(this,arguments):a==null||c?this.each(function(){var d=c?a:T(this).is(":hidden");T(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=T.speed(d,b,c);return this[e.queue===false?"each":"queue"](function(){var g=T.extend({},e),i,f=this.nodeType==1&&T(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=T.css(this,"display");g.overflow=this.style.overflow}}if(g.overflow!=null){this.style.overflow="hidden"}g.curAnim=T.extend({},a);T.each(a,function(p,k){var l=new T.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=T.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}});T.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(b,a){T.fn[b]=function(d,c){return this.animate(a,d,c)}});T.extend({speed:function(b,a,c){var d=typeof b==="object"?b:{complete:c||!c&&a||T.isFunction(b)&&b,duration:b,easing:c&&a||a&&!T.isFunction(a)&&a};d.duration=T.fx.off?0:typeof d.duration==="number"?d.duration:T.fx.speeds[d.duration]||T.fx.speeds._default;d.old=d.complete;d.complete=function(){if(d.queue!==false){T(this).dequeue()}if(T.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={}}}});T.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(T.fx.step[this.prop]||T.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(T.css(this.elem,this.prop,a));return b&&b>-10000?b:parseFloat(T.curCSS(this.elem,this.prop))||0},custom:function(a,b,c){this.startTime=ad();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()&&T.timers.push(d)&&!U){U=setInterval(function(){var f=T.timers;for(var g=0;g<f.length;g++){if(!f[g]()){f.splice(g--,1)}}if(!f.length){clearInterval(U);U=ab}},13)}},show:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());T(this.elem).show()},hide:function(){this.options.orig[this.prop]=T.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(c){var d=ad();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(T.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){T(this.elem).hide()}if(this.options.hide||this.options.show){for(var b in this.options.curAnim){T.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=T.easing[this.options.easing||(T.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}};T.extend(T.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){T.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){T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.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||T.boxModel&&h.scrollTop||g.scrollTop)-a,e=f.left+(self.pageXOffset||T.boxModel&&h.scrollLeft||g.scrollLeft)-b;return{top:d,left:e}}}else{T.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return T.offset.bodyOffset(this[0])}T.offset.initialized||T.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(T.offset.doesNotAddBorder&&!(T.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(T.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}}}T.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){T.offset.initialized||T.offset.initialize();var a=c.offsetTop,b=c.offsetLeft;if(T.offset.doesNotIncludeMarginInBodyOffset){a+=parseInt(T.curCSS(c,"marginTop",true),10)||0,b+=parseInt(T.curCSS(c,"marginLeft",true),10)||0}return{top:a,left:b}}};T.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-=Y(this,"marginTop");a.left-=Y(this,"marginLeft");f.top+=Y(d,"borderTopWidth");f.left+=Y(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)&&T.css(a,"position")=="static")){a=a.offsetParent}return T(a)}});T.each(["Left","Top"],function(b,c){var a="scroll"+c;T.fn[a]=function(d){if(!this[0]){return null}return d!==ab?this.each(function(){this==W||this==document?W.scrollTo(!b?d:T(W).scrollLeft(),b?d:T(W).scrollTop()):this[a]=d}):this[0]==W||this[0]==document?self[b?"pageYOffset":"pageXOffset"]||T.boxModel&&document.documentElement[a]||document.body[a]:this[0][a]}});T.each(["Height","Width"],function(b,d){var f=b?"Left":"Top",c=b?"Right":"Bottom",e=d.toLowerCase();T.fn["inner"+d]=function(){return this[0]?T.css(this[0],e,false,"padding"):null};T.fn["outer"+d]=function(g){return this[0]?T.css(this[0],e,false,g?"margin":"border"):null};var a=d.toLowerCase();T.fn[a]=function(g){return this[0]==W?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===ab?(this.length?T.css(this[0],a):null):this.css(a,typeof g==="string"?g:g+"px")}})})()}SimileAjax.version="2.2.1";SimileAjax.jQuery=jQuery.noConflict(true);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 A=SimileAjax.Graphics.getWindowDimensions();var v=A.w;var t=A.h;var w=Math.ceil(e.arrowGraphicWidth/2);var z=function(B){var C=document.createElement("div");C.className=p(e.arrowGraphicCSSClassPrefix+"point-"+B);f.appendChild(C);return C};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",E=null;var o=function(e){var G=e.split("&");for(var l=0;l<G.length;l++){var F=G[l].split("=");if(F[0]=="locales"){m=m.concat(F[1].split(","))}else{if(F[0]=="defaultLocale"){k=F[1]}else{if(F[0]=="forceLocale"){E=F[1];m=m.concat(F[1].split(","))}else{if(F[0]=="bundle"){x=F[1]!="false"}}}}}};(function(){if(typeof Timeline_urlPrefix=="string"){Timeline.urlPrefix=Timeline_urlPrefix;if(typeof Timeline_parameters=="string"){o(Timeline_parameters)}}else{var I=document.documentElement.getElementsByTagName("head");for(var H=0;H<I.length;H++){var e=I[H].getElementsByTagName("script");for(var G=0;G<e.length;G++){var l=e[G].src;var F=l.indexOf("timeplot-complete-min.js");if(F>=0){Timeline.urlPrefix=l.substr(0,F);var J=l.indexOf("?");if(J>0){o(l.substr(J+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 D=function(e,l){SimileAjax.includeCssFiles(document,e,l)};if(x){i(Timeline.urlPrefix,["timeline-bundle.js"]);D(Timeline.urlPrefix,["timeline-bundle.css"])}else{i(Timeline.urlPrefix+"scripts/",u);D(Timeline.urlPrefix+"styles/",q)}var t=[];t[k]=true;var r=function(e){for(var F=0;F<w.length;F++){if(e==w[F]){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 A=0;A<m.length;A++){y(m[A])}var p=k;var v=("language" in navigator?navigator.language:navigator.browserLanguage).split(";");for(var A=0;A<v.length;A++){var B=y(v[A]);if(B!=null){p=B;break}}for(var A=0;A<w.length;A++){var B=w[A];if(t[B]){i(Timeline.urlPrefix+"scripts/l10n/"+B+"/",s);D(Timeline.urlPrefix+"styles/l10n/"+B+"/",z)}}if(E==null){Timeline.serverLocale=k;Timeline.clientLocale=p}else{Timeline.serverLocale=E;Timeline.clientLocale=E}}catch(C){alert(C)}};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=new Timeline.LinearEther({centersOn:("date" in d)?d.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[d.intervalUnit],pixelsPerInterval:d.intervalPixels,theme:e});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{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.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 h=this._containerDiv;var e=h.ownerDocument;h.className=h.className.split(" ").concat("timeline-container").join(" ");var b=(this.isHorizontal())?"horizontal":"vertical";h.className+=" timeline-"+b;while(h.firstChild){h.removeChild(h.firstChild)}var a=SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix+(this.isHorizontal()?"images/copyright-vertical.png":"images/copyright.png"));a.className="timeline-copyright";a.title="SIMILE Timeline - http://www.simile-widgets.org/";SimileAjax.DOM.registerEvent(a,"click",function(){window.location="http://www.simile-widgets.org/"});h.appendChild(a);this._bands=[];for(var c=0;c<this._bandInfos.length;c++){var g=new Timeline._Band(this,this._bandInfos[c],c);this._bands.push(g)}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 d=SimileAjax.Graphics.createMessageBubble(e);d.containerDiv.className="timeline-message-container";h.appendChild(d.containerDiv);d.contentDiv.className="timeline-message";d.contentDiv.innerHTML="<img src='"+Timeline.urlPrefix+"images/progress-running.gif' /> Loading...";this.showLoadingMessage=function(){d.containerDiv.style.display="block"};this.hideLoadingMessage=function(){d.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(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=[];this._onOrthogonalScrollListeners=[];var a=this;this._syncWithBand=null;this._syncWithBandHandler=function(b){a._onHighlightBandScroll()};this._syncWithBandOrthogonalScrollHandler=function(b){a._onHighlightBandOrthogonalScroll()};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)}this._supportsOrthogonalScrolling=("supportsOrthogonalScrolling" in this._eventPainter)&&this._eventPainter.supportsOrthogonalScrolling();if(this._supportsOrthogonalScrolling){this._scrollBar=this._timeline.getDocument().createElement("div");this._scrollBar.id="timeline-band-scrollbar-"+c;this._scrollBar.className="timeline-band-scrollbar";this._timeline.addDiv(this._scrollBar);this._scrollBar.innerHTML='<div class="timeline-band-scrollbar-thumb"> </div>'}};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._syncWithBandOrthogonalScrollHandler=null;this._selectorListener=null;this._div=null;this._innerDiv=null;this._keyboardInput=null;this._scrollBar=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.addOnOrthogonalScrollListener=function(a){this._onOrthogonalScrollListeners.push(a)};Timeline._Band.prototype.removeOnOrthogonalScrollListener=function(b){for(var a=0;a<this._onOrthogonalScrollListeners.length;a++){if(this._onOrthogonalScrollListeners[a]==b){this._onOrthogonalScrollListeners.splice(a,1);break}}};Timeline._Band.prototype.setSyncWithBand=function(b,a){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler);this._syncWithBand.removeOnOrthogonalScrollListener(this._syncWithBandOrthogonalScrollHandler)}this._syncWithBand=b;this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);this._syncWithBand.addOnOrthogonalScrollListener(this._syncWithBandOrthogonalScrollHandler);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();this._showScrollbar()}};Timeline._Band.prototype._onMouseUp=function(b,a,c){this._dragging=false;this._keyboardInput.focus();this._bounceBack()};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;this._bounceBack()}};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._ether.shiftPixels(-a);if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px"}else{this._div.style.top=this._viewOffset+"px"}if(this._supportsOrthogonalScrolling){this._viewOrthogonalOffset=this._viewOrthogonalOffset+b}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._fireOnOrthogonalScroll=function(){for(var a=0;a<this._onOrthogonalScrollListeners.length;a++){this._onOrthogonalScrollListeners[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));this._positionHighlight()}};Timeline._Band.prototype._onHighlightBandOrthogonalScroll=function(){if(this._syncWithBand){this._positionHighlight()}};Timeline._Band.prototype._onAddMany=function(){this._paintEvents()};Timeline._Band.prototype._onClear=function(){this._paintEvents()};Timeline._Band.prototype._positionHighlight=function(){if(this._syncWithBand){var c=this._syncWithBand.getMinVisibleDate();var g=this._syncWithBand.getMaxVisibleDate();if(this._highlight){var h=0;var f=1;var b=this._syncWithBand.getEventPainter();if("supportsOrthogonalScrolling" in b&&b.supportsOrthogonalScrolling()){var e=b.getOrthogonalExtent();var d=this._syncWithBand.getViewWidth();var a=Math.max(d,e);f=d/a;h=-this._syncWithBand.getViewOrthogonalOffset()/a}this._etherPainter.setHighlight(c,g,h,f)}}};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();this._showScrollbar();this._fireOnOrthogonalScroll()};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._Band.prototype._bounceBack=function(c){if(!this._supportsOrthogonalScrolling){return}var d=0;if(this._viewOrthogonalOffset<0){var b=this._eventPainter.getOrthogonalExtent();if(this._viewOrthogonalOffset+b>=this.getViewWidth()){d=this._viewOrthogonalOffset}else{d=Math.min(0,this.getViewWidth()-b)}}if(d!=this._viewOrthogonalOffset){var a=this;SimileAjax.Graphics.createAnimation(function(e,f){a._viewOrthogonalOffset=e;a._eventPainter.softPaint();a._showScrollbar();a._fireOnOrthogonalScroll()},this._viewOrthogonalOffset,d,300,function(){a._hideScrollbar()}).run()}else{this._hideScrollbar()}};Timeline._Band.prototype._showScrollbar=function(){if(!this._supportsOrthogonalScrolling){return}var d=this._eventPainter.getOrthogonalExtent();var c=this.getViewWidth();var a=Math.max(c,d);var f=(c/a);var e=Math.round(c*f)+"px";var g=Math.round(-this._viewOrthogonalOffset*f)+"px";var b=this._scrollBar.firstChild;if(this._timeline.isHorizontal()){this._scrollBar.style.top=this._div.style.top;this._scrollBar.style.height=this._div.style.height;this._scrollBar.style.right="0px";this._scrollBar.style.width="10px";b.style.top=g;b.style.height=e}else{this._scrollBar.style.left=this._div.style.left;this._scrollBar.style.width=this._div.style.width;this._scrollBar.style.bottom="0px";this._scrollBar.style.height="10px";b.style.left=g;b.style.width=e}if(f>=1&&this._viewOrthogonalOffset==0){this._scrollBar.style.display="none"}else{this._scrollBar.style.display="block"}};Timeline._Band.prototype._hideScrollbar=function(){if(!this._supportsOrthogonalScrolling){return}};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,d,c,b){this._highlight.position(a,d,c,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,B,C,D,r){var v=Math.round(l.dateToPixelOffset(u));if(h&&C!=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(C==SimileAjax.DateTime.WEEK){var o=c.firstDayOfWeek;var x=new Date(u.getTime()+(6-o-7)*f);var A=new Date(x.getTime()+2*f);var y=Math.round(l.dateToPixelOffset(x));var t=Math.round(l.dateToPixelOffset(A));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=B.labelInterval(u,C);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);D.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(g,l,k,h){k=k||0;h=h||1;this._createHighlightDiv();var m=Math.round(e.dateToPixelOffset(g));var j=Math.round(e.dateToPixelOffset(l));var i=Math.max(j-m,3);var f=e.getViewWidth()-4;if(a){this._highlightDiv.style.left=m+"px";this._highlightDiv.style.width=i+"px";this._highlightDiv.style.top=Math.round(k*f)+"px";this._highlightDiv.style.height=Math.round(h*f)+"px"}else{this._highlightDiv.style.top=m+"px";this._highlightDiv.style.height=i+"px";this._highlightDiv.style.left=Math.round(k*f)+"px";this._highlightDiv.style.width=Math.round(h*f)+"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(f,a){var c=this._getBaseURL(a);var j=false;if(f&&f.events){var h=("wikiURL" in f)?f.wikiURL:null;var l=("wikiSection" in f)?f.wikiSection:null;var d=("dateTimeFormat" in f)?f.dateTimeFormat:null;var g=this._events.getUnit().getParser(d);for(var e=0;e<f.events.length;e++){var m=f.events[e];var b=m.isDuration||(("durationEvent" in m)&&!m.durationEvent)||(("de" in m)&&!m.de);var k=new Timeline.DefaultEventSource.Event({id:("id" in m)?m.id:undefined,start:g(m.start||m.s),end:g(m.end||m.e),latestStart:g(m.latestStart||m.ls),earliestEnd:g(m.earliestEnd||m.ee),instant:b,text:m.title||m.t,description:m.description||m.d,image:this._resolveRelativeURL(m.image,c),link:this._resolveRelativeURL(m.link,c),icon:this._resolveRelativeURL(m.icon,c),color:m.color,textColor:m.textColor,hoverText:m.hoverText,classname:m.classname||m.c,tapeImage:m.tapeImage,tapeRepeat:m.tapeRepeat,caption:m.caption,eventID:m.eventID||m.eid,trackNum:m.trackNum});k._obj=m;k.getProperty=function(i){return this._obj[i]};k.setWikiInfo(h,l);this._events.add(k);j=true}}if(j){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.supportsOrthogonalScrolling=function(){return true};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.getOrthogonalExtent=function(){var a=this._computeMetrics();return 2*a.trackOffset+this._tracks.length*a.trackIncrement};Timeline.OriginalEventPainter.prototype._setOrthogonalOffset=function(a){var b=this._band.getViewOrthogonalOffset();this._highlightLayer.style.top=this._lineLayer.style.top=this._eventLayer.style.top=b+"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,A){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 B=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 C=a+z.event.label.offsetFromLine;var e=C+k.width;var A=Math.max(e,b);var s=this._findFreeTrack(q,A);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,C,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(D,E,F){return r._onClickInstantEvent(c.elmt,E,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,A,B){return m._onClickDurationEvent(d.elmt,A,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 C=this._timeline.getDocument();var m=o.getText();var e=o.getStart();var u=o.getLatestStart();var x=o.getEnd();var B=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(B));var j=this._getLabelDivClassName(o);var k=this._frc.computeSize(m,j);var D=g;var b=D+k.width;var A=Math.max(b,a);var q=this._findFreeTrack(o,A);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,D,y,k.width,k.height,z,j,w);var f=[s.elmt,d.elmt,r.elmt];var p=this;var l=function(E,F,G){return p._onClickDurationEvent(d.elmt,F,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,A,B){return p._onClickInstantEvent(c.elmt,A,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 A=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(B){B.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(B,C,D){return m._onClickDurationEvent(c.elmt,C,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.supportsOrthogonalScrolling=function(){return true};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.getOrthogonalExtent=function(){var a=this._computeMetrics();return 2*a.trackOffset+this._tracks.length*a.trackHeight};Timeline.CompactEventPainter.prototype._setOrthogonalOffset=function(a){var b=this._band.getViewOrthogonalOffset();this._highlightLayer.style.top=this._lineLayer.style.top=this._eventLayer.style.top=b+"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,L,D,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 G=function(i){return Math.round(c.dateToPixelOffset(i))};var p=function(i){var S={url:i.getIcon()};if(S.url==null){S.url=L.defaultStackIcon;S.width=L.defaultStackIconWidth;S.height=L.defaultStackIconHeight;S.className="timeline-event-icon-stack timeline-event-icon-default"}else{S.width=i.getProperty("iconWidth")||L.customIconWidth;S.height=i.getProperty("iconHeight")||L.customIconHeight;S.className="timeline-event-icon-stack"}return S};var g=p(z[0]);var x=5;var f=0;var l=0;var R=0;var y=0;var N=[];for(var Q=0;Q<z.length&&(!r||Q<u);Q++){var C=z[Q];var B=C.getText();var w=p(C);var v=this._frc.computeSize(B);var I={text:B,iconData:w,labelSize:v,iconLeft:g.width+Q*x-w.width};I.labelLeft=g.width+Q*x+L.iconLabelGap;I.top=R;N.push(I);f=Math.min(f,I.iconLeft);R+=v.height;l=Math.max(l,I.labelLeft+v.width);y=Math.max(y,I.top+w.height)}if(r){var m=String.substitute(j,[z.length-u]);var M=this._frc.computeSize(m);var J=g.width+(u-1)*x+L.iconLabelGap;var P=R;R+=M.height;l=Math.max(l,J+M.width)}l+=L.labelRightMargin;R+=L.labelBottomMargin;y+=L.iconBottomMargin;var O=G(z[0].getStart());var t=[];var o=Math.ceil(Math.max(y,R)/L.trackHeight);var F=g.width+(z.length-1)*x;for(var Q=0;Q<o;Q++){t.push({start:f,end:F})}var H=Math.ceil(R/L.trackHeight);for(var Q=0;Q<H;Q++){var q=t[Q];q.end=Math.max(q.end,l)}var h=this._fitTracks(O,t);var A=h*L.trackHeight+L.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=O+"px";a.style.top=A+"px";a.style.width=F+"px";a.style.height=y+"px";a.innerHTML="<div style='position: relative'></div>";this._eventLayer.appendChild(a);var k=this;var s=function(T){try{var X=parseInt(this.getAttribute("index"));var V=a.firstChild.childNodes;for(var S=0;S<V.length;S++){var W=V[S];if(S==X){W.style.zIndex=V.length}else{W.style.zIndex=V.length-S}}}catch(U){}};var E=function(W){var S=N[W];var i=z[W];var X=i.getProperty("tooltip")||i.getText();var V=k._paintEventLabel({tooltip:X},{text:S.text},O+S.labelLeft,A+S.top,S.labelSize.width,S.labelSize.height,D);V.elmt.setAttribute("index",W);V.elmt.onmouseover=s;var U=SimileAjax.Graphics.createTranslucentImage(S.iconData.url);var T=k._timeline.getDocument().createElement("div");T.className="timeline-event-icon"+("className" in S.iconData?(" "+S.iconData.className):"");T.style.left=S.iconLeft+"px";T.style.top=S.top+"px";T.style.zIndex=(N.length-W);T.appendChild(U);T.setAttribute("index",W);T.onmouseover=s;a.firstChild.appendChild(T);var Y=function(Z,aa,ab){return k._onClickInstantEvent(V.elmt,aa,i)};SimileAjax.DOM.registerEvent(T,"mousedown",Y);SimileAjax.DOM.registerEvent(V.elmt,"mousedown",Y);k._eventIdToElmt[i.getID()]=T};for(var Q=0;Q<N.length;Q++){E(Q)}if(r){var d=z.slice(u);var b=this._paintEventLabel({tooltip:m},{text:m},O+J,A+P,M.width,M.height,D);var K=function(i,S,T){return k._onClickMultiplePreciseInstantEvent(b.elmt,S,d)};SimileAjax.DOM.registerEvent(b.elmt,"mousedown",K);for(var Q=0;Q<d.length;Q++){this._eventIdToElmt[d[Q].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(D,o,G,e,A,y,F,B){var u=this._band;var l=function(i){return Math.round(u.dateToPixelOffset(i))};var v=l(D);var E=[];var C=0;var q=0;var p=0;if(G!=null){C=y.tapeHeight+y.tapeBottomMargin;q=Math.ceil(y.tapeHeight/y.trackHeight);var a=l(G.end)-v;var d=l(G.start)-v;for(var s=0;s<q;s++){E.push({start:d,end:a})}p=y.trackHeight-(C%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){E[q-1].end=Math.max(E[q-1].end,x)}var k=e.height+y.iconBottomMargin+p;while(k>0){E.push({start:b,end:x});k-=y.trackHeight}}var r=A.text;var g=this._frc.computeSize(r);var c=g.height+y.labelBottomMargin+p;var f=x+g.width+y.labelRightMargin;if(q>0){E[q-1].end=Math.max(E[q-1].end,f)}for(var z=0;c>0;z++){if(q+z<E.length){var w=E[q+z];w.end=f}else{E.push({start:0,end:f})}c-=y.trackHeight}var j=this._fitTracks(v,E);var h=j*y.trackHeight+y.trackOffset;var m={};m.labelElmtData=this._paintEventLabel(o,A,v+x,h+C,g.width,g.height,F);if(G!=null){if("latestStart" in G||"earliestEnd" in G){m.impreciseTapeElmtData=this._paintEventTape(o,G,y.tapeHeight,h,l(G.start),l(G.end),F.event.duration.impreciseColor,F.event.duration.impreciseOpacity,y,F)}if(!G.isInstant&&"start" in G&&"end" in G){m.tapeElmtData=this._paintEventTape(o,G,y.tapeHeight,h,v,l("earliestEnd" in G?G.earliestEnd:G.end),G.color,100,y,F)}}if(e!=null){m.iconElmtData=this._paintEventIcon(o,e,h+C,v+b,y,F)}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)};(function(){var local=false;if(document.location.search.length>0){var params=document.location.search.substr(1).split("&");for(var i=0;i<params.length;i++){if(params[i]=="local"){local=true}}}if(!local){var heads=document.documentElement.getElementsByTagName("head");for(var h=0;h<heads.length;h++){var node=heads[h].firstChild;while(node!=null){if(node.nodeType==1&&node.tagName.toLowerCase()=="script"){var url=node.src;if(url.indexOf("timeplot-complete-min")>=0){local=(url.indexOf("local")>=0)}}node=node.nextSibling}}}var loadTimeplot=function(){if(typeof window.Timeplot!="undefined"){return}window.Timeplot={loaded:false,params:{bundle:true,autoCreate:true},namespace:"http://simile.mit.edu/2007/06/timeplot#",importers:{}};var javascriptFiles=["timeplot.js","plot.js","sources.js","geometry.js","color.js","math.js","processor.js"];var cssFiles=["timeplot.css"];var locales=["en"];var defaultClientLocales=("language" in navigator?navigator.language:navigator.browserLanguage).split(";");for(var l=0;l<defaultClientLocales.length;l++){var locale=defaultClientLocales[l];if(locale!="en"){var segments=locale.split("-");if(segments.length>1&&segments[0]!="en"){locales.push(segments[0])}locales.push(locale)}}var paramTypes={bundle:Boolean,js:Array,css:Array,autoCreate:Boolean};if(typeof Timeplot_urlPrefix=="string"){Timeplot.urlPrefix=Timeplot_urlPrefix;if("Timeplot_parameters" in window){SimileAjax.parseURLParameters(Timeplot_parameters,Timeplot.params,paramTypes)}}else{var url=SimileAjax.findScript(document,"timeplot-complete-min.js");if(url==null){Timeplot.error=new Error("Failed to derive URL prefix for Simile Timeplot API code files");return}Timeplot.urlPrefix=url.substr(0,url.indexOf("timeplot-complete-min.js"));SimileAjax.parseURLParameters(url,Timeplot.params,paramTypes)}if(Timeplot.params.locale){if(Timeplot.params.locale!="en"){var segments=Timeplot.params.locale.split("-");if(segments.length>1&&segments[0]!="en"){locales.push(segments[0])}locales.push(Timeplot.params.locale)}}var timeplotURLPrefix=(local)?"/timeplot/api/1.0/":Timeplot.urlPrefix;if(local&&!("console" in window)){var firebug=[timeplotURLPrefix+"lib/firebug/firebug.js"];SimileAjax.includeJavascriptFiles(document,"",firebug)}var canvas=document.createElement("canvas");if(!canvas.getContext){var excanvas=[timeplotURLPrefix+"lib/excanvas.js"];SimileAjax.includeJavascriptFiles(document,"",excanvas)}var scriptURLs=Timeplot.params.js||[];var cssURLs=Timeplot.params.css||[];if(Timeplot.params.bundle&&!local){scriptURLs.push(timeplotURLPrefix+"timeplot-bundle.js");cssURLs.push(timeplotURLPrefix+"timeplot-bundle.css")}else{SimileAjax.prefixURLs(scriptURLs,timeplotURLPrefix+"scripts/",javascriptFiles);SimileAjax.prefixURLs(cssURLs,timeplotURLPrefix+"styles/",cssFiles)}window.SimileAjax_onLoad=function(){if(local&&window.console.open){window.console.open()}if(Timeplot.params.callback){eval(Timeplot.params.callback+"()")}};SimileAjax.includeJavascriptFiles(document,"",scriptURLs);SimileAjax.includeCssFiles(document,"",cssURLs);Timeplot.loaded=true};var loadTimeline=function(){if(typeof Timeline!="undefined"){loadTimeplot()}else{var timelineURL=(local)?"/timeline/api-2.0/timeline-api.js?bundle=false":"http://static.simile.mit.edu/timeline/api-2.0/timeline-api.js";window.SimileAjax_onLoad=loadTimeplot;SimileAjax.includeJavascriptFile(document,timelineURL)}};if(typeof SimileAjax=="undefined"){window.SimileAjax_onLoad=loadTimeline;var url=local?"/ajax/api-2.0/simile-ajax-api.js?bundle=false":"http://static.simile.mit.edu/ajax/api-2.0/simile-ajax-api.js?bundle=true";var createScriptElement=function(){var script=document.createElement("script");script.type="text/javascript";script.language="JavaScript";script.src=url;document.getElementsByTagName("head")[0].appendChild(script)};if(document.body==null){try{document.write("<script src='"+url+"' type='text/javascript'><\/script>")}catch(e){createScriptElement()}}else{createScriptElement()}}else{loadTimeline()}})();Timeline.Debug=SimileAjax.Debug;var log=SimileAjax.Debug.log;Object.extend=function(a,c){for(var b in c){a[b]=c[b]}return a};Timeplot.create=function(a,b){return new Timeplot._Impl(a,b)};Timeplot.createPlotInfo=function(a){return{id:("id" in a)?a.id:"p"+Math.round(Math.random()*1000000),dataSource:("dataSource" in a)?a.dataSource:null,eventSource:("eventSource" in a)?a.eventSource:null,timeGeometry:("timeGeometry" in a)?a.timeGeometry:new Timeplot.DefaultTimeGeometry(),valueGeometry:("valueGeometry" in a)?a.valueGeometry:new Timeplot.DefaultValueGeometry(),timeZone:("timeZone" in a)?a.timeZone:0,fillColor:("fillColor" in a)?((a.fillColor=="string")?new Timeplot.Color(a.fillColor):a.fillColor):null,fillGradient:("fillGradient" in a)?a.fillGradient:true,fillFrom:("fillFrom" in a)?a.fillFrom:Number.NEGATIVE_INFINITY,lineColor:("lineColor" in a)?((a.lineColor=="string")?new Timeplot.Color(a.lineColor):a.lineColor):new Timeplot.Color("#606060"),lineWidth:("lineWidth" in a)?a.lineWidth:1,dotRadius:("dotRadius" in a)?a.dotRadius:2,dotColor:("dotColor" in a)?a.dotColor:null,eventLineWidth:("eventLineWidth" in a)?a.eventLineWidth:1,showValues:("showValues" in a)?a.showValues:false,roundValues:("roundValues" in a)?a.roundValues:true,valuesOpacity:("valuesOpacity" in a)?a.valuesOpacity:75,bubbleWidth:("bubbleWidth" in a)?a.bubbleWidth:300,bubbleHeight:("bubbleHeight" in a)?a.bubbleHeight:200}};Timeplot._Impl=function(a,b){this._id="t"+Math.round(Math.random()*1000000);this._containerDiv=a;this._plotInfos=b;this._painters={background:[],foreground:[]};this._painter=null;this._active=false;this._upright=false;this._initialize()};Timeplot._Impl.prototype={dispose:function(){for(var a=0;a<this._plots.length;a++){this._plots[a].dispose()}this._plots=null;this._plotsInfos=null;this._containerDiv.innerHTML=""},getElement:function(){return this._containerDiv},getDocument:function(){return this._containerDiv.ownerDocument},add:function(a){this._containerDiv.appendChild(a)},remove:function(a){this._containerDiv.removeChild(a)},addPainter:function(b,a){var d=this._painters[b];if(d){for(var c=0;c<d.length;c++){if(d[c].context._id==a.context._id){return}}d.push(a)}},removePainter:function(b,a){var d=this._painters[b];if(d){for(var c=0;c<d.length;c++){if(d[c].context._id==a.context._id){d.splice(c,1);break}}}},getWidth:function(){return this._containerDiv.clientWidth},getHeight:function(){return this._containerDiv.clientHeight},getCanvas:function(){return this._canvas},loadText:function(a,g,d,c,f){if(this._active){var h=this;var e=function(k,i,j){alert("Failed to load data xml from "+a+"\n"+k);h.hideLoadingMessage()};var b=function(i){try{d.loadText(i.responseText,g,a,c,f)}catch(j){SimileAjax.Debug.exception(j)}finally{h.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(a,e,b)},0)}},loadXML:function(b,d){if(this._active){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.loadXML(f,b)}finally{a.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(b,e,c)},0)}},putText:function(e,c,a,b){var d=this.putDiv(e,"timeplot-div "+a,b);d.innerHTML=c;return d},putDiv:function(f,b,c){var d=this._id+"-"+f;var e=document.getElementById(d);if(!e){var a=this._containerDiv.firstChild;e=document.createElement("div");e.setAttribute("id",d);a.appendChild(e)}e.setAttribute("class","timeplot-div "+b);e.setAttribute("className","timeplot-div "+b);this.placeDiv(e,c);return e},placeDiv:function(b,a){if(a){for(style in a){if(style=="left"){a[style]+=this._paddingX;a[style]+="px"}else{if(style=="right"){a[style]+=this._paddingX;a[style]+="px"}else{if(style=="top"){a[style]+=this._paddingY;a[style]+="px"}else{if(style=="bottom"){a[style]+=this._paddingY;a[style]+="px"}else{if(style=="width"){if(a[style]<0){a[style]=0}a[style]+="px"}else{if(style=="height"){if(a[style]<0){a[style]=0}a[style]+="px"}}}}}}b.style[style]=a[style]}}},locate:function(a){return{x:a.offsetLeft-this._paddingX,y:a.offsetTop-this._paddingY}},update:function(){if(this._active){for(var b=0;b<this._plots.length;b++){var c=this._plots[b];var d=c.getDataSource();if(d){var a=d.getRange();if(a){c._valueGeometry.setRange(a);c._timeGeometry.setRange(a)}}c.hideValues()}this.paint()}},repaint:function(){if(this._active){this._prepareCanvas();for(var a=0;a<this._plots.length;a++){var b=this._plots[a];if(b._timeGeometry){b._timeGeometry.reset()}if(b._valueGeometry){b._valueGeometry.reset()}}this.paint()}},paint:function(){if(this._active&&this._painter==null){var a=this;this._painter=window.setTimeout(function(){a._clearCanvas();var e=function(g,f){try{if(f.setTimeplot){f.setTimeplot(a)}g.apply(f,[])}catch(h){SimileAjax.Debug.exception(h)}};var c=a._painters.background;for(var b=0;b<c.length;b++){e(c[b].action,c[b].context)}var d=a._painters.foreground;for(var b=0;b<d.length;b++){e(d[b].action,d[b].context)}a._painter=null},20)}},_clearCanvas:function(){var b=this.getCanvas();var a=b.getContext("2d");a.clearRect(0,0,b.width,b.height)},_clearLabels:function(){var a=this._containerDiv.firstChild;if(a){this._containerDiv.removeChild(a)}a=document.createElement("div");this._containerDiv.appendChild(a)},_prepareCanvas:function(){var c=this.getCanvas();var b=SimileAjax.jQuery(this._containerDiv);this._paddingX=(parseInt(b.css("paddingLeft"))+parseInt(b.css("paddingRight")))/2;this._paddingY=(parseInt(b.css("paddingTop"))+parseInt(b.css("paddingBottom")))/2;c.width=this.getWidth()-(this._paddingX*2);c.height=this.getHeight()-(this._paddingY*2);var a=c.getContext("2d");this._setUpright(a,c);a.globalCompositeOperation="source-over"},_setUpright:function(a,b){if(!SimileAjax.Platform.browser.isIE){this._upright=false}if(!this._upright){this._upright=true;a.translate(0,b.height);a.scale(1,-1)}},_isBrowserSupported:function(b){var a=SimileAjax.Platform.browser;if((b.getContext&&window.getComputedStyle)||(a.isIE&&a.majorVersion>=6)){return true}else{return false}},_initialize:function(){SimileAjax.WindowManager.initialize();var g=this._containerDiv;var j=g.ownerDocument;g.className="timeplot-container "+g.className;while(g.firstChild){g.removeChild(g.firstChild)}var b=j.createElement("canvas");if(this._isBrowserSupported(b)){this._clearLabels();this._canvas=b;b.className="timeplot-canvas";g.appendChild(b);if(!b.getContext&&G_vmlCanvasManager){b=G_vmlCanvasManager.initElement(this._canvas);this._canvas=b}this._prepareCanvas();var c=SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix+"images/copyright.png");c.className="timeplot-copyright";c.title="Timeplot (c) SIMILE - http://simile.mit.edu/timeplot/";SimileAjax.DOM.registerEvent(c,"click",function(){window.location="http://simile.mit.edu/timeplot/"});g.appendChild(c);var e=this;var h={onAddMany:function(){e.update()},onClear:function(){e.update()}};this._plots=[];if(this._plotInfos){for(var d=0;d<this._plotInfos.length;d++){var f=new Timeplot.Plot(this,this._plotInfos[d]);var a=f.getDataSource();if(a){a.addListener(h)}this.addPainter("background",{context:f.getTimeGeometry(),action:f.getTimeGeometry().paint});this.addPainter("background",{context:f.getValueGeometry(),action:f.getValueGeometry().paint});this.addPainter("foreground",{context:f,action:f.paint});this._plots.push(f);f.initialize()}}var k=SimileAjax.Graphics.createMessageBubble(j);k.containerDiv.className="timeplot-message-container";g.appendChild(k.containerDiv);k.contentDiv.className="timeplot-message";k.contentDiv.innerHTML="<img src='"+Timeplot.urlPrefix+"images/progress-running.gif' /> Loading...";this.showLoadingMessage=function(){k.containerDiv.style.display="block"};this.hideLoadingMessage=function(){k.containerDiv.style.display="none"};this._active=true}else{this._message=SimileAjax.Graphics.createMessageBubble(j);this._message.containerDiv.className="timeplot-message-container";this._message.containerDiv.style.top="15%";this._message.containerDiv.style.left="20%";this._message.containerDiv.style.right="20%";this._message.containerDiv.style.minWidth="20em";this._message.contentDiv.className="timeplot-message";this._message.contentDiv.innerHTML="We're terribly sorry, but your browser is not currently supported by <a href='http://simile.mit.edu/timeplot/'>Timeplot</a>.<br><br> We are working on supporting it in the near future but, for now, see the <a href='http://simile.mit.edu/wiki/Timeplot_Limitations'>list of currently supported browsers</a>.";this._message.containerDiv.style.display="block";g.appendChild(this._message.containerDiv)}}};Timeplot.Plot=function(a,b){this._timeplot=a;this._canvas=a.getCanvas();this._plotInfo=b;this._id=b.id;this._timeGeometry=b.timeGeometry;this._valueGeometry=b.valueGeometry;this._theme=new Timeline.getDefaultTheme();this._dataSource=b.dataSource;this._eventSource=b.eventSource;this._bubble=null};Timeplot.Plot.prototype={initialize:function(){if(this._dataSource&&this._dataSource.getValue){this._timeFlag=this._timeplot.putDiv("timeflag","timeplot-timeflag");this._valueFlag=this._timeplot.putDiv(this._id+"valueflag","timeplot-valueflag");this._valueFlagLineLeft=this._timeplot.putDiv(this._id+"valueflagLineLeft","timeplot-valueflag-line");this._valueFlagLineRight=this._timeplot.putDiv(this._id+"valueflagLineRight","timeplot-valueflag-line");if(!this._valueFlagLineLeft.firstChild){this._valueFlagLineLeft.appendChild(SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix+"images/line_left.png"));this._valueFlagLineRight.appendChild(SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix+"images/line_right.png"))}this._valueFlagPole=this._timeplot.putDiv(this._id+"valuepole","timeplot-valueflag-pole");var d=this._plotInfo.valuesOpacity;SimileAjax.Graphics.setOpacity(this._timeFlag,d);SimileAjax.Graphics.setOpacity(this._valueFlag,d);SimileAjax.Graphics.setOpacity(this._valueFlagLineLeft,d);SimileAjax.Graphics.setOpacity(this._valueFlagLineRight,d);SimileAjax.Graphics.setOpacity(this._valueFlagPole,d);var f=this;var g=function(i,h,j){if(f._plotInfo.showValues){f._valueFlag.style.display="block";a(i,h,j)}};var b=24*60*60*1000;var e=30*b;var a=function(j,C,r){if(typeof SimileAjax!="undefined"&&f._plotInfo.showValues){var u=f._canvas;var A=Math.round(SimileAjax.DOM.getEventRelativeCoordinates(C,f._canvas).x);if(A>u.width){A=u.width}if(isNaN(A)||A<0){A=0}var D=f._timeGeometry.fromScreen(A);if(D==0){f._valueFlag.style.display="none";return}var l=f._dataSource.getClosestValidTime(D);A=f._timeGeometry.toScreen(l);var B=f._dataSource.getValue(l);if(f._plotInfo.roundValues){B=Math.round(B)}f._valueFlag.innerHTML=new String(B);var s=new Date(l);var i=f._timeGeometry.getPeriod();if(i<b){f._timeFlag.innerHTML=s.toLocaleTimeString()}else{if(i>e){f._timeFlag.innerHTML=s.toLocaleDateString()}else{f._timeFlag.innerHTML=s.toLocaleString()}}var q=f._timeFlag.clientWidth;var h=f._timeFlag.clientHeight;var k=Math.round(q/2);var z=f._valueFlag.clientWidth;var o=f._valueFlag.clientHeight;var w=f._valueGeometry.toScreen(B);if(A+k>u.width){var m=u.width-k}else{if(A-k<0){var m=k}else{var m=A}}if(f._timeGeometry._timeValuePosition=="top"){f._timeplot.placeDiv(f._valueFlagPole,{left:A,top:h-5,height:u.height-w-h+6,display:"block"});f._timeplot.placeDiv(f._timeFlag,{left:m-k,top:-6,display:"block"})}else{f._timeplot.placeDiv(f._valueFlagPole,{left:A,bottom:h-5,height:w-h+6,display:"block"});f._timeplot.placeDiv(f._timeFlag,{left:m-k,bottom:-6,display:"block"})}if(A+z+14>u.width&&w+o+4>u.height){f._valueFlagLineLeft.style.display="none";f._timeplot.placeDiv(f._valueFlagLineRight,{left:A-14,bottom:w-14,display:"block"});f._timeplot.placeDiv(f._valueFlag,{left:A-z-13,bottom:w-o-13,display:"block"})}else{if(A+z+14>u.width&&w+o+4<u.height){f._valueFlagLineRight.style.display="none";f._timeplot.placeDiv(f._valueFlagLineLeft,{left:A-14,bottom:w,display:"block"});f._timeplot.placeDiv(f._valueFlag,{left:A-z-13,bottom:w+13,display:"block"})}else{if(A+z+14<u.width&&w+o+4>u.height){f._valueFlagLineRight.style.display="none";f._timeplot.placeDiv(f._valueFlagLineLeft,{left:A,bottom:w-13,display:"block"});f._timeplot.placeDiv(f._valueFlag,{left:A+13,bottom:w-13,display:"block"})}else{f._valueFlagLineLeft.style.display="none";f._timeplot.placeDiv(f._valueFlagLineRight,{left:A,bottom:w,display:"block"});f._timeplot.placeDiv(f._valueFlag,{left:A+13,bottom:w+13,display:"block"})}}}}};var c=this._timeplot.getElement();SimileAjax.DOM.registerEvent(c,"mouseover",g);SimileAjax.DOM.registerEvent(c,"mousemove",a)}},dispose:function(){if(this._dataSource){this._dataSource.removeListener(this._paintingListener);this._paintingListener=null;this._dataSource.dispose();this._dataSource=null}},hideValues:function(){if(this._valueFlag){this._valueFlag.style.display="none"}if(this._timeFlag){this._timeFlag.style.display="none"}if(this._valueFlagLineLeft){this._valueFlagLineLeft.style.display="none"}if(this._valueFlagLineRight){this._valueFlagLineRight.style.display="none"}if(this._valueFlagPole){this._valueFlagPole.style.display="none"}},getDataSource:function(){return(this._dataSource)?this._dataSource:this._eventSource},getTimeGeometry:function(){return this._timeGeometry},getValueGeometry:function(){return this._valueGeometry},paint:function(){var p=this._canvas.getContext("2d");p.lineWidth=this._plotInfo.lineWidth;p.lineJoin="miter";if(this._dataSource){if(this._plotInfo.fillColor){if(this._plotInfo.fillGradient){var a=p.createLinearGradient(0,this._canvas.height,0,0);a.addColorStop(0,this._plotInfo.fillColor.toString());a.addColorStop(0.5,this._plotInfo.fillColor.toString());a.addColorStop(1,"rgba(255,255,255,0)");p.fillStyle=a}else{p.fillStyle=this._plotInfo.fillColor.toString()}p.beginPath();p.moveTo(0,0);this._plot(function(c,i){p.lineTo(c,i)});if(this._plotInfo.fillFrom==Number.NEGATIVE_INFINITY){p.lineTo(this._canvas.width,0)}else{if(this._plotInfo.fillFrom==Number.POSITIVE_INFINITY){p.lineTo(this._canvas.width,this._canvas.height);p.lineTo(0,this._canvas.height)}else{p.lineTo(this._canvas.width,this._valueGeometry.toScreen(this._plotInfo.fillFrom));p.lineTo(0,this._valueGeometry.toScreen(this._plotInfo.fillFrom))}}p.fill()}if(this._plotInfo.lineColor){p.strokeStyle=this._plotInfo.lineColor.toString();p.beginPath();var g=true;this._plot(function(c,i){if(g){g=false;p.moveTo(c,i)}p.lineTo(c,i)});p.stroke()}if(this._plotInfo.dotColor){p.fillStyle=this._plotInfo.dotColor.toString();var m=this._plotInfo.dotRadius;this._plot(function(c,i){p.beginPath();p.arc(c,i,m,0,2*Math.PI,true);p.fill()})}}if(this._eventSource){var a=p.createLinearGradient(0,0,0,this._canvas.height);a.addColorStop(1,"rgba(255,255,255,0)");p.strokeStyle=a;p.fillStyle=a;p.lineWidth=this._plotInfo.eventLineWidth;p.lineJoin="miter";var u=this._eventSource.getAllEventIterator();while(u.hasNext()){var t=u.next();var q=t.getColor();q=(q)?new Timeplot.Color(q):this._plotInfo.lineColor;var b=t.getStart().getTime();var v=t.getEnd().getTime();if(b==v){var y=q.toString();a.addColorStop(0,y);var f=this._timeGeometry.toScreen(b);f=Math.floor(f)+0.5;var d=f;p.beginPath();p.moveTo(f,0);p.lineTo(f,this._canvas.height);p.stroke();var h=f-4;var k=7}else{var y=q.toString(0.5);a.addColorStop(0,y);var f=this._timeGeometry.toScreen(b);f=Math.floor(f)+0.5;var d=this._timeGeometry.toScreen(v);d=Math.floor(d)+0.5;p.fillRect(f,0,d-f,this._canvas.height);var h=f;var k=d-f-1}var l=this._timeplot.putDiv(t.getID(),"timeplot-event-box",{left:Math.round(h),width:Math.round(k),top:0,height:this._canvas.height-1});var s=this;var j=function(c){return function(w,i,A){var z=s._timeplot.getDocument();s._closeBubble();var x=SimileAjax.DOM.getEventPageCoordinates(i);var r=SimileAjax.DOM.getPageCoordinates(w);s._bubble=SimileAjax.Graphics.createBubbleForPoint(x.x,r.top+s._canvas.height,s._plotInfo.bubbleWidth,s._plotInfo.bubbleHeight,"bottom");c.fillInfoBubble(s._bubble.content,s._theme,s._timeGeometry.getLabeler())}};var e=function(i,c,r){i.oldClass=i.className;i.className=i.className+" timeplot-event-box-highlight"};var o=function(i,c,r){i.className=i.oldClass;i.oldClass=null};if(!l.instrumented){SimileAjax.DOM.registerEvent(l,"click",j(t));SimileAjax.DOM.registerEvent(l,"mouseover",e);SimileAjax.DOM.registerEvent(l,"mouseout",o);l.instrumented=true}}}},_plot:function(g){var e=this._dataSource.getData();if(e){var h=e.times;var b=e.values;var c=h.length;for(var d=0;d<c;d++){var a=this._timeGeometry.toScreen(h[d]);var i=this._valueGeometry.toScreen(b[d]);g(a,i)}}},_closeBubble:function(){if(this._bubble!=null){this._bubble.close();this._bubble=null}}};Timeplot.DefaultEventSource=function(a){Timeline.DefaultEventSource.apply(this,arguments)};Object.extend(Timeplot.DefaultEventSource.prototype,Timeline.DefaultEventSource.prototype);Timeplot.DefaultEventSource.prototype.loadText=function(o,j,a,c,l){if(o==null){return}this._events.maxValues=new Array();var b=this._getBaseURL(a);if(!l){l="iso8601"}var h=this._events.getUnit().getParser(l);var g=this._parseText(o,j);var k=false;if(c){g=c(g)}if(g){for(var f=0;f<g.length;f++){var p=g[f];if(p.length>1){var e=SimileAjax.jQuery.trim(p[0]);var d=h(e);if(d){var m=new Timeplot.DefaultEventSource.NumericEvent(d,p.slice(1));this._events.add(m);k=true}}}}if(k){this._fire("onAddMany",[])}};Timeplot.DefaultEventSource.prototype._parseText=function(h,c){h=h.replace(/\r\n?/g,"\n");var f=0;var e=h.length;var i=[];while(f<e){var j=[];if(h.charAt(f)!="#"){while(f<e){if(h.charAt(f)=='"'){var a=h.indexOf('"',f+1);while(a<e&&a>-1){if(h.charAt(a+1)!='"'){break}a=h.indexOf('"',a+2)}if(a<0){}else{if(h.charAt(a+1)==c){var b=h.substr(f+1,a-f-1);b=b.replace(/""/g,'"');j[j.length]=b;f=a+2;continue}else{if(h.charAt(a+1)=="\n"||e==a+1){var b=h.substr(f+1,a-f-1);b=b.replace(/""/g,'"');j[j.length]=b;f=a+2;break}else{}}}}var g=h.indexOf(c,f);var d=h.indexOf("\n",f);if(d<0){d=e}if(g>-1&&g<d){j[j.length]=h.substr(f,g-f);f=g+1}else{j[j.length]=h.substr(f,d-f);f=d+1;break}}}else{var d=h.indexOf("\n",f);f=(d>-1)?d+1:cur}if(j.length>0){i[i.length]=j}}if(i.length<0){return}return i};Timeplot.DefaultEventSource.prototype.getRange=function(){var a=this.getEarliestDate();var b=this.getLatestDate();return{earliestDate:(a)?a:null,latestDate:(b)?b:null,min:0,max:0}};Timeplot.DefaultEventSource.NumericEvent=function(b,a){this._id="e"+Math.round(Math.random()*1000000);this._time=b;this._values=a};Timeplot.DefaultEventSource.NumericEvent.prototype={getID:function(){return this._id},getTime:function(){return this._time},getValues:function(){return this._values},getStart:function(){return this._time},getEnd:function(){return this._time}};Timeplot.DataSource=function(b){this._eventSource=b;var a=this;this._processingListener={onAddMany:function(){a._process()},onClear:function(){a._clear()}};this.addListener(this._processingListener);this._listeners=[];this._data=null;this._range=null};Timeplot.DataSource.prototype={_clear:function(){this._data=null;this._range=null},_process:function(){this._data={times:new Array(),values:new Array()};this._range={earliestDate:null,latestDate:null,min:0,max:0}},getRange:function(){return this._range},getData:function(){return this._data},getValue:function(c){if(this._data){for(var b=0;b<this._data.times.length;b++){var a=this._data.times[b];if(a>=c){return this._data.values[b]}}}return 0},getClosestValidTime:function(b){if(this._data){for(var a=0;a<this._data.times.length;a++){var c=this._data.times[a];if(c>=b){if(a<=0){return c}else{var d=this._data.times[a-1];if(b-d<c-b){return d}else{return c}}}}}return 0},addListener:function(a){this._eventSource.addListener(a)},removeListener:function(a){this._eventSource.removeListener(a)},replaceListener:function(a,b){this.removeListener(a);this.addListener(b)}};Timeplot.ColumnSource=function(b,a){Timeplot.DataSource.apply(this,arguments);this._column=a-1};Object.extend(Timeplot.ColumnSource.prototype,Timeplot.DataSource.prototype);Timeplot.ColumnSource.prototype.dispose=function(){this.removeListener(this._processingListener);this._clear()};Timeplot.ColumnSource.prototype._process=function(){var g=this._eventSource.getCount();var a=new Array(g);var k=new Array(g);var d=Number.MAX_VALUE;var h=Number.MIN_VALUE;var e=0;var f=this._eventSource.getAllEventIterator();while(f.hasNext()){var b=f.next();var c=b.getTime();a[e]=c;var j=this._getValue(b);if(!isNaN(j)){if(j<d){d=j}if(j>h){h=j}k[e]=j}e++}this._data={times:a,values:k};if(h==Number.MIN_VALUE){h=1}this._range={earliestDate:this._eventSource.getEarliestDate(),latestDate:this._eventSource.getLatestDate(),min:d,max:h}};Timeplot.ColumnSource.prototype._getValue=function(a){return parseFloat(a.getValues()[this._column])};Timeplot.ColumnDiffSource=function(c,b,a){Timeplot.ColumnSource.apply(this,arguments);this._column2=a-1};Object.extend(Timeplot.ColumnDiffSource.prototype,Timeplot.ColumnSource.prototype);Timeplot.ColumnDiffSource.prototype._getValue=function(e){var d=parseFloat(e.getValues()[this._column]);var c=parseFloat(e.getValues()[this._column2]);return d-c};Timeplot.DefaultValueGeometry=function(a){if(!a){a={}}this._id=("id" in a)?a.id:"g"+Math.round(Math.random()*1000000);this._axisColor=("axisColor" in a)?((typeof a.axisColor=="string")?new Timeplot.Color(a.axisColor):a.axisColor):new Timeplot.Color("#606060"),this._gridColor=("gridColor" in a)?((typeof a.gridColor=="string")?new Timeplot.Color(a.gridColor):a.gridColor):null,this._gridLineWidth=("gridLineWidth" in a)?a.gridLineWidth:0.5;this._axisLabelsPlacement=("axisLabelsPlacement" in a)?a.axisLabelsPlacement:"right";this._gridSpacing=("gridSpacing" in a)?a.gridStep:50;this._gridType=("gridType" in a)?a.gridType:"short";this._gridShortSize=("gridShortSize" in a)?a.gridShortSize:10;this._minValue=("min" in a)?a.min:null;this._maxValue=("max" in a)?a.max:null;this._linMap={direct:function(b){return b},inverse:function(b){return b}};this._map=this._linMap;this._labels=[];this._grid=[]};Timeplot.DefaultValueGeometry.prototype={setTimeplot:function(a){this._timeplot=a;this._canvas=a.getCanvas();this.reset()},setRange:function(a){if((this._minValue==null)||((this._minValue!=null)&&(a.min<this._minValue))){this._minValue=a.min}if((this._maxValue==null)||((this._maxValue!=null)&&(a.max*1.05>this._maxValue))){this._maxValue=a.max*1.05}this._updateMappedValues();if(!(this._minValue==0&&this._maxValue==0)){this._grid=this._calculateGrid()}},reset:function(){this._clearLabels();this._updateMappedValues();this._grid=this._calculateGrid()},toScreen:function(b){if(this._canvas&&this._maxValue){var a=b-this._minValue;return this._canvas.height*(this._map.direct(a))/this._mappedRange}else{return -50}},fromScreen:function(a){if(this._canvas){return this._map.inverse(this._mappedRange*a/this._canvas.height)+this._minValue}else{return 0}},paint:function(){if(this._timeplot){var b=this._canvas.getContext("2d");b.lineJoin="miter";if(this._gridColor){var e=b.createLinearGradient(0,0,0,this._canvas.height);e.addColorStop(0,this._gridColor.toHexString());e.addColorStop(0.3,this._gridColor.toHexString());e.addColorStop(1,"rgba(255,255,255,0.5)");b.lineWidth=this._gridLineWidth;b.strokeStyle=e;for(var d=0;d<this._grid.length;d++){var c=this._grid[d];var g=Math.floor(c.y)+0.5;if(typeof c.label!="undefined"){if(this._axisLabelsPlacement=="left"){var f=this._timeplot.putText(this._id+"-"+d,c.label,"timeplot-grid-label",{left:4,bottom:g+2,color:this._gridColor.toHexString(),visibility:"hidden"});this._labels.push(f)}else{if(this._axisLabelsPlacement=="right"){var f=this._timeplot.putText(this._id+"-"+d,c.label,"timeplot-grid-label",{right:4,bottom:g+2,color:this._gridColor.toHexString(),visibility:"hidden"});this._labels.push(f)}}if(g+f.clientHeight<this._canvas.height+10){f.style.visibility="visible"}}b.beginPath();if(this._gridType=="long"||c.label==0){b.moveTo(0,g);b.lineTo(this._canvas.width,g)}else{if(this._gridType=="short"){if(this._axisLabelsPlacement=="left"){b.moveTo(0,g);b.lineTo(this._gridShortSize,g)}else{if(this._axisLabelsPlacement=="right"){b.moveTo(this._canvas.width,g);b.lineTo(this._canvas.width-this._gridShortSize,g)}}}}b.stroke()}}var a=b.createLinearGradient(0,0,0,this._canvas.height);a.addColorStop(0,this._axisColor.toString());a.addColorStop(0.5,this._axisColor.toString());a.addColorStop(1,"rgba(255,255,255,0.5)");b.lineWidth=1;b.strokeStyle=a;b.beginPath();b.moveTo(0,this._canvas.height);b.lineTo(0,0);b.stroke();b.beginPath();b.moveTo(this._canvas.width,0);b.lineTo(this._canvas.width,this._canvas.height);b.stroke()}},_clearLabels:function(){for(var b=0;b<this._labels.length;b++){var a=this._labels[b];var c=a.parentNode;if(c){c.removeChild(a)}}},_calculateGrid:function(){var c=[];if(!this._canvas||this._valueRange==0){return c}var d=0;if(this._valueRange>1){while(Math.pow(10,d)<this._valueRange){d++}d--}else{while(Math.pow(10,d)>this._valueRange){d--}}var e=Math.pow(10,d);var f=e;while(true){var a=this.toScreen(this._minValue+f);while(a<this._gridSpacing){f+=e;a=this.toScreen(this._minValue+f)}if(a>2*this._gridSpacing){e/=10;f=e}else{break}}var b=0;var g=this.toScreen(b);if(this._minValue>=0){while(g<this._canvas.height){if(g>0){c.push({y:g,label:b})}b+=f;g=this.toScreen(b)}}else{if(this._maxValue<=0){while(g>0){if(g<this._canvas.height){c.push({y:g,label:b})}b-=f;g=this.toScreen(b)}}else{while(g<this._canvas.height){if(g>0){c.push({y:g,label:b})}b+=f;g=this.toScreen(b)}b=-f;g=this.toScreen(b);while(g>0){if(g<this._canvas.height){c.push({y:g,label:b})}b-=f;g=this.toScreen(b)}}}return c},_updateMappedValues:function(){this._valueRange=Math.abs(this._maxValue-this._minValue);this._mappedRange=this._map.direct(this._valueRange)}};Timeplot.LogarithmicValueGeometry=function(a){Timeplot.DefaultValueGeometry.apply(this,arguments);this._logMap={direct:function(b){return Math.log(b+1)/Math.log(10)},inverse:function(b){return Math.exp(Math.log(10)*b)-1}};this._mode="log";this._map=this._logMap;this._calculateGrid=this._logarithmicCalculateGrid};Timeplot.LogarithmicValueGeometry.prototype._linearCalculateGrid=Timeplot.DefaultValueGeometry.prototype._calculateGrid;Object.extend(Timeplot.LogarithmicValueGeometry.prototype,Timeplot.DefaultValueGeometry.prototype);Timeplot.LogarithmicValueGeometry.prototype._logarithmicCalculateGrid=function(){var b=[];if(!this._canvas||this._valueRange==0){return b}var a=1;var c=this.toScreen(a);while(c<this._canvas.height||isNaN(c)){if(c>0){b.push({y:c,label:a})}a*=10;c=this.toScreen(a)}return b};Timeplot.LogarithmicValueGeometry.prototype.actLinear=function(){this._mode="lin";this._map=this._linMap;this._calculateGrid=this._linearCalculateGrid;this.reset()};Timeplot.LogarithmicValueGeometry.prototype.actLogarithmic=function(){this._mode="log";this._map=this._logMap;this._calculateGrid=this._logarithmicCalculateGrid;this.reset()};Timeplot.LogarithmicValueGeometry.prototype.toggle=function(){if(this._mode=="log"){this.actLinear()}else{this.actLogarithmic()}};Timeplot.DefaultTimeGeometry=function(b){if(!b){b={}}this._id=("id" in b)?b.id:"g"+Math.round(Math.random()*1000000);this._locale=("locale" in b)?b.locale:"en";this._timeZone=("timeZone" in b)?b.timeZone:SimileAjax.DateTime.getTimezone();this._labeler=("labeller" in b)?b.labeller:null;this._axisColor=("axisColor" in b)?((b.axisColor=="string")?new Timeplot.Color(b.axisColor):b.axisColor):new Timeplot.Color("#606060"),this._gridColor=("gridColor" in b)?((b.gridColor=="string")?new Timeplot.Color(b.gridColor):b.gridColor):null,this._gridLineWidth=("gridLineWidth" in b)?b.gridLineWidth:0.5;this._axisLabelsPlacement=("axisLabelsPlacement" in b)?b.axisLabelsPlacement:"bottom";this._gridStep=("gridStep" in b)?b.gridStep:100;this._gridStepRange=("gridStepRange" in b)?b.gridStepRange:20;this._min=("min" in b)?b.min:null;this._max=("max" in b)?b.max:null;this._timeValuePosition=("timeValuePosition" in b)?b.timeValuePosition:"bottom";this._unit=("unit" in b)?b.unit:Timeline.NativeDateUnit;this._linMap={direct:function(c){return c},inverse:function(c){return c}};this._map=this._linMap;if(!this._labeler){this._labeler=this._unit.createLabeller(this._locale,this._timeZone)}var a=this._unit.getParser("iso8601");if(this._min&&!this._min.getTime){this._min=a(this._min)}if(this._max&&!this._max.getTime){this._max=a(this._max)}this._labels=[];this._grid=[]};Timeplot.DefaultTimeGeometry.prototype={setTimeplot:function(a){this._timeplot=a;this._canvas=a.getCanvas();this.reset()},setRange:function(a){if(this._min){this._earliestDate=this._min}else{if(a.earliestDate&&((this._earliestDate==null)||((this._earliestDate!=null)&&(a.earliestDate.getTime()<this._earliestDate.getTime())))){this._earliestDate=a.earliestDate}}if(this._max){this._latestDate=this._max}else{if(a.latestDate&&((this._latestDate==null)||((this._latestDate!=null)&&(a.latestDate.getTime()>this._latestDate.getTime())))){this._latestDate=a.latestDate}}if(!this._earliestDate&&!this._latestDate){this._grid=[]}else{this.reset()}},reset:function(){this._updateMappedValues();if(this._canvas){this._grid=this._calculateGrid()}},toScreen:function(c){if(this._canvas&&this._latestDate){var a=c-this._earliestDate.getTime();var b=(this._mappedPeriod>0)?this._map.direct(a)/this._mappedPeriod:0;return this._canvas.width*b}else{return -50}},fromScreen:function(a){if(this._canvas){return this._map.inverse(this._mappedPeriod*a/this._canvas.width)+this._earliestDate.getTime()}else{return 0}},getPeriod:function(){return this._period},getLabeler:function(){return this._labeler},getUnit:function(){return this._unit},paint:function(){if(this._canvas){var e=this._unit;var b=this._canvas.getContext("2d");var f=b.createLinearGradient(0,0,0,this._canvas.height);b.strokeStyle=f;b.lineWidth=this._gridLineWidth;b.lineJoin="miter";if(this._gridColor){f.addColorStop(0,this._gridColor.toString());f.addColorStop(1,"rgba(255,255,255,0.9)");for(var d=0;d<this._grid.length;d++){var c=this._grid[d];var a=Math.floor(c.x)+0.5;if(this._axisLabelsPlacement=="top"){var g=this._timeplot.putText(this._id+"-"+d,c.label,"timeplot-grid-label",{left:a+4,top:2,visibility:"hidden"});this._labels.push(g)}else{if(this._axisLabelsPlacement=="bottom"){var g=this._timeplot.putText(this._id+"-"+d,c.label,"timeplot-grid-label",{left:a+4,bottom:2,visibility:"hidden"});this._labels.push(g)}}if(a+g.clientWidth<this._canvas.width+10){g.style.visibility="visible"}b.beginPath();b.moveTo(a,0);b.lineTo(a,this._canvas.height);b.stroke()}}f.addColorStop(0,this._axisColor.toString());f.addColorStop(1,"rgba(255,255,255,0.5)");b.lineWidth=1;f.addColorStop(0,this._axisColor.toString());b.beginPath();b.moveTo(0,0);b.lineTo(this._canvas.width,0);b.stroke()}},_calculateGrid:function(){var a=[];var d=SimileAjax.DateTime;var h=this._unit;var b=this._period;if(b==0){return a}if(b>d.gregorianUnitLengths[d.MILLENNIUM]){g=d.MILLENNIUM}else{for(var g=d.MILLENNIUM;g>0;g--){if(d.gregorianUnitLengths[g-1]<=b&&b<d.gregorianUnitLengths[g]){g--;break}}}var i=h.cloneValue(this._earliestDate);do{d.roundDownToInterval(i,g,this._timeZone,1,0);var f=this.toScreen(h.toNumber(i));switch(g){case d.SECOND:var e=i.toLocaleTimeString();break;case d.MINUTE:var c=i.getMinutes();var e=i.getHours()+":"+((c<10)?"0":"")+c;break;case d.HOUR:var e=i.getHours()+":00";break;case d.DAY:case d.WEEK:case d.MONTH:var e=i.toLocaleDateString();break;case d.YEAR:case d.DECADE:case d.CENTURY:case d.MILLENNIUM:var e=i.getUTCFullYear();break}if(f>0){a.push({x:f,label:e})}d.incrementByInterval(i,g,this._timeZone)}while(i.getTime()<this._latestDate.getTime());return a},_clearLabels:function(){for(var b=0;b<this._labels.length;b++){var a=this._labels[b];var c=a.parentNode;if(c){c.removeChild(a)}}},_updateMappedValues:function(){if(this._latestDate&&this._earliestDate){this._period=this._latestDate.getTime()-this._earliestDate.getTime();this._mappedPeriod=this._map.direct(this._period)}else{this._period=0;this._mappedPeriod=0}}};Timeplot.MagnifyingTimeGeometry=function(b){Timeplot.DefaultTimeGeometry.apply(this,arguments);var a=this;this._MagnifyingMap={direct:function(d){if(d<a._leftTimeMargin){var c=d*a._leftRate}else{if(a._leftTimeMargin<d&&d<a._rightTimeMargin){var c=d*a._expandedRate+a._expandedTimeTranslation}else{var c=d*a._rightRate+a._rightTimeTranslation}}return c},inverse:function(c){if(c<a._leftScreenMargin){var d=c/a._leftRate}else{if(a._leftScreenMargin<c&&c<a._rightScreenMargin){var d=c/a._expandedRate+a._expandedScreenTranslation}else{var d=c/a._rightRate+a._rightScreenTranslation}}return d}};this._mode="lin";this._map=this._linMap};Object.extend(Timeplot.MagnifyingTimeGeometry.prototype,Timeplot.DefaultTimeGeometry.prototype);Timeplot.MagnifyingTimeGeometry.prototype.initialize=function(f){Timeplot.DefaultTimeGeometry.prototype.initialize.apply(this,arguments);if(!this._lens){this._lens=this._timeplot.putDiv("lens","timeplot-lens")}var g=1000*60*60*24*30;var h=this;var b=function(k){var m=k.clientWidth;var l=h._timeplot.locate(k);h.setMagnifyingParams(l.x+m/2,m,g);h.actMagnifying();h._timeplot.paint()};var j=function(l,k,m){h._canvas.startCoords=SimileAjax.DOM.getEventRelativeCoordinates(k,l);h._canvas.pressed=true};var i=function(l,k,o){h._canvas.pressed=false;var m=SimileAjax.DOM.getEventRelativeCoordinates(k,l);if(Timeplot.Math.isClose(m,h._canvas.startCoords,5)){h._lens.style.display="none";h.actLinear();h._timeplot.paint()}else{h._lens.style.cursor="move";b(h._lens)}};var d=function(l,k,o){if(h._canvas.pressed){var m=SimileAjax.DOM.getEventRelativeCoordinates(k,l);if(m.x<0){m.x=0}if(m.x>h._canvas.width){m.x=h._canvas.width}h._timeplot.placeDiv(h._lens,{left:h._canvas.startCoords.x,width:m.x-h._canvas.startCoords.x,bottom:0,height:h._canvas.height,display:"block"})}};var a=function(l,k,m){h._lens.startCoords=SimileAjax.DOM.getEventRelativeCoordinates(k,l);h._lens.pressed=true};var c=function(l,k,m){h._lens.pressed=false};var e=function(m,k,q){if(h._lens.pressed){var o=SimileAjax.DOM.getEventRelativeCoordinates(k,m);var l=h._lens;var p=l.offsetLeft+o.x-l.startCoords.x;if(p<h._timeplot._paddingX){p=h._timeplot._paddingX}if(p+l.clientWidth>h._canvas.width-h._timeplot._paddingX){p=h._canvas.width-l.clientWidth+h._timeplot._paddingX}l.style.left=p;b(l)}};if(!this._canvas.instrumented){SimileAjax.DOM.registerEvent(this._canvas,"mousedown",j);SimileAjax.DOM.registerEvent(this._canvas,"mousemove",d);SimileAjax.DOM.registerEvent(this._canvas,"mouseup",i);SimileAjax.DOM.registerEvent(this._canvas,"mouseup",c);this._canvas.instrumented=true}if(!this._lens.instrumented){SimileAjax.DOM.registerEvent(this._lens,"mousedown",a);SimileAjax.DOM.registerEvent(this._lens,"mousemove",e);SimileAjax.DOM.registerEvent(this._lens,"mouseup",c);SimileAjax.DOM.registerEvent(this._lens,"mouseup",i);this._lens.instrumented=true}};Timeplot.MagnifyingTimeGeometry.prototype.setMagnifyingParams=function(j,g,e){g=g/2;e=e/2;var f=this._canvas.width;var i=this._period;if(j<0){j=0}if(j>f){j=f}if(j-g<0){g=j}if(j+g>f){g=f-j}var h=this.fromScreen(j)-this._earliestDate.getTime();if(h-e<0){e=h}if(h+e>i){e=i-h}this._centerX=j;this._centerTime=h;this._aperture=g;this._aperturePeriod=e;this._leftScreenMargin=this._centerX-this._aperture;this._rightScreenMargin=this._centerX+this._aperture;this._leftTimeMargin=this._centerTime-this._aperturePeriod;this._rightTimeMargin=this._centerTime+this._aperturePeriod;this._leftRate=(j-g)/(h-e);this._expandedRate=g/e;this._rightRate=(f-j-g)/(i-h-e);this._expandedTimeTranslation=this._centerX-this._centerTime*this._expandedRate;this._expandedScreenTranslation=this._centerTime-this._centerX/this._expandedRate;this._rightTimeTranslation=(j+g)-(h+e)*this._rightRate;this._rightScreenTranslation=(h+e)-(j+g)/this._rightRate;this._updateMappedValues()};Timeplot.MagnifyingTimeGeometry.prototype.actLinear=function(){this._mode="lin";this._map=this._linMap;this.reset()};Timeplot.MagnifyingTimeGeometry.prototype.actMagnifying=function(){this._mode="Magnifying";this._map=this._MagnifyingMap;this.reset()};Timeplot.MagnifyingTimeGeometry.prototype.toggle=function(){if(this._mode=="Magnifying"){this.actLinear()}else{this.actMagnifying()}};Timeplot.Color=function(a){this._fromHex(a)};Timeplot.Color.prototype={set:function(f,e,c,d){this.r=f;this.g=e;this.b=c;this.a=(d)?d:1;return this.check()},transparency:function(b){this.a=b;return this.check()},lighten:function(b){var a=new Timeplot.Color();return a.set(this.r+=parseInt(b,10),this.g+=parseInt(b,10),this.b+=parseInt(b,10))},darken:function(b){var a=new Timeplot.Color();return a.set(this.r-=parseInt(b,10),this.g-=parseInt(b,10),this.b-=parseInt(b,10))},check:function(){if(this.r>255){this.r=255}else{if(this.r<0){this.r=0}}if(this.g>255){this.g=255}else{if(this.g<0){this.g=0}}if(this.b>255){this.b=255}else{if(this.b<0){this.b=0}}if(this.a>1){this.a=1}else{if(this.a<0){this.a=0}}return this},toString:function(c){var b=(c)?c:((this.a)?this.a:1);return"rgba("+this.r+","+this.g+","+this.b+","+b+")"},toHexString:function(){return"#"+this._toHex(this.r)+this._toHex(this.g)+this._toHex(this.b)},_fromHex:function(a){if(/^#?([\da-f]{3}|[\da-f]{6})$/i.test(a)){a=a.replace(/^#/,"").replace(/^([\da-f])([\da-f])([\da-f])$/i,"$1$1$2$2$3$3");this.r=parseInt(a.substr(0,2),16);this.g=parseInt(a.substr(2,2),16);this.b=parseInt(a.substr(4,2),16)}else{if(/^rgb *\( *\d{0,3} *, *\d{0,3} *, *\d{0,3} *\)$/i.test(a)){a=a.match(/^rgb *\( *(\d{0,3}) *, *(\d{0,3}) *, *(\d{0,3}) *\)$/i);this.r=parseInt(a[1],10);this.g=parseInt(a[2],10);this.b=parseInt(a[3],10)}}this.a=1;return this.check()},_toHex:function(d){var c="0123456789ABCDEF";if(d<0){return"00"}if(d>255){return"FF"}var b=Math.floor(d/16);var a=d%16;return c.charAt(b)+c.charAt(a)}};Timeplot.Math={range:function(g){var d=g.length;var c=Number.MAX_VALUE;var a=Number.MIN_VALUE;for(var b=0;b<d;b++){var e=g[b];if(e<c){c=e}if(e>a){a=e}}return{min:c,max:a}},movingAverage:function(i,c){var e=i.length;var d=new Array(e);for(var j=0;j<e;j++){var h=0;for(var a=j-c;a<j+c;a++){if(a<0){var b=i[0]}else{if(a>=e){var b=d[j-1]}else{var b=i[a]}}h+=b}d[j]=h/(2*c)}return d},integral:function(e){var d=e.length;var c=new Array(d);var b=0;for(var a=0;a<d;a++){b+=e[a];c[a]=b}return c},normalize:function(d){var c=d.length;var b=0;for(var a=0;a<c;a++){b+=d[a]}for(var a=0;a<c;a++){d[a]/=b}return d},convolution:function(k,j){var s=k.length;var q=j.length;var l=new Array(s);for(var h=0;h<s;h++){var d=0;var i=(h+q<s)?h+q:s;for(var e=h;e<i;e++){var p=k[e-q];var o=j[e-h];d+=p*o}l[h]=d}return l},heavyside:function(b){var d=new Array(b);var c=1/b;for(var a=0;a<b;a++){d[a]=c}return d},gaussian:function(size,threshold){with(Math){var radius=size/2;var variance=radius*radius/log(threshold);var g=new Array(size);for(var t=0;t<size;t++){var l=t-radius;g[t]=exp(-variance*l*l)}}return this.normalize(g)},round:function(x,n){with(Math){if(abs(x)>1){var l=floor(log(x)/log(10));var d=round(exp((l-n+1)*log(10)));var y=round(round(x/d)*d);return y}else{log("FIXME(SM): still to implement for 0 < abs(x) < 1");return x}}},tanh:function(a){if(a>5){return 1}else{if(a<5){return -1}else{var b=Math.exp(2*a);return(b-1)/(b+1)}}},isClose:function(d,c,e){return(d&&c&&Math.abs(d.x-c.x)<e&&Math.abs(d.y-c.y)<e)}};Timeplot.Operator={sum:function(a,b){return Timeplot.Math.integral(a.values)},average:function(c,d){var b=("size" in d)?d.size:30;var a=Timeplot.Math.movingAverage(c.values,b);return a}};Timeplot.Processor=function(d,a,c){this._dataSource=d;this._operator=a;this._params=c;this._data={times:new Array(),values:new Array()};this._range={earliestDate:null,latestDate:null,min:0,max:0};var b=this;this._processingListener={onAddMany:function(){b._process()},onClear:function(){b._clear()}};this.addListener(this._processingListener)};Timeplot.Processor.prototype={_clear:function(){this.removeListener(this._processingListener);this._dataSource._clear()},_process:function(){var d=this._dataSource.getData();var a=this._dataSource.getRange();var b=this._operator(d,this._params);var c=Timeplot.Math.range(b);this._data={times:d.times,values:b};this._range={earliestDate:a.earliestDate,latestDate:a.latestDate,min:c.min,max:c.max}},getRange:function(){return this._range},getData:function(){return this._data},getValue:Timeplot.DataSource.prototype.getValue,getClosestValidTime:Timeplot.DataSource.prototype.getClosestValidTime,addListener:function(a){this._dataSource.addListener(a)},removeListener:function(a){this._dataSource.removeListener(a)}};