Skip to content

Instantly share code, notes, and snippets.

@zerolab
Created September 10, 2010 08:58
Show Gist options
  • Save zerolab/573337 to your computer and use it in GitHub Desktop.
Save zerolab/573337 to your computer and use it in GitHub Desktop.
packed Timeline pre-2.4.0
/* Timeline API pre 2.4.0
* Copyright Massachusetts Institute of Technology
* and Contributors 2006-2009 ~ Some rights reserved
* Timeline is open source software and is licensed
* under the BSD license.
* http://www.simile-widgets.org/timeline/
*/
(function(){var Timeline,SimileAjax;var loadMe=function(){Timeline=window.Timeline=new Object();Timeline.DateTime=SimileAjax.DateTime;try{(function(){if(typeof Timeline_urlPrefix=="string"){Timeline.urlPrefix=Timeline_urlPrefix;if(typeof Timeline_parameters=="string"){parseURLParameters(Timeline_parameters)}}else{var heads=document.documentElement.getElementsByTagName("head");for(var h=0;h<heads.length;h++){var scripts=heads[h].getElementsByTagName("script");for(var s=0;s<scripts.length;s++){var url=scripts[s].src;var i=url.indexOf("timeline-2.4.x.js");if(i>=0){Timeline.urlPrefix=url.substr(0,i);var q=url.indexOf("?");if(q>0){parseURLParameters(url.substr(q+1))}return}}}throw new Error("Failed to derive URL prefix for Timeline API code files")}})();var includeCssFiles=function(urlPrefix,filenames){SimileAjax.includeCssFiles(document,urlPrefix,filenames)};includeCssFiles(Timeline.urlPrefix,["timeline-2.4.x.css"]);Timeline.serverLocale="en";Timeline.clientLocale="en"}catch(e){alert(e)}};
if(typeof SimileAjax=="undefined"){var SimileAjax={loaded:false,loadingScriptsCount:0,error:null,params:{bundle:"true"}};SimileAjax.Platform={};var getHead=function(b){return b.getElementsByTagName("head")[0]};SimileAjax.findScript=function(b,e){for(var c=b.documentElement.getElementsByTagName("head"),a=0;a<c.length;a++)for(var d=c[a].firstChild;d!=null;){if(d.nodeType==1&&d.tagName.toLowerCase()=="script"){var f=d.src;if(f.indexOf(e)>=0)return f}d=d.nextSibling}return null};SimileAjax.includeJavascriptFile=function(b,e,c,a){c=c||"";if(b.body==null)try{var d="'"+c.replace(/'/g,"&apos")+"'";b.write("<script src='"+e+"' onerror="+d+(a?" charset='"+a+"'":"")+" type='text/javascript'>"+c+"<\/script>");return}catch(f){}d=b.createElement("script");if(c){try{d.innerHTML=c}catch(h){}d.setAttribute("onerror",c)}a&&d.setAttribute("charset",a);d.type="text/javascript";d.language="JavaScript";d.src=e;return getHead(b).appendChild(d)};SimileAjax.includeJavascriptFiles=function(b,e,c){for(var a=0;a<c.length;a++)SimileAjax.includeJavascriptFile(b,e+c[a]);SimileAjax.loadingScriptsCount+=c.length};SimileAjax.includeCssFile=function(b,e){if(b.body==null)try{b.write("<link rel='stylesheet' href='"+e+"' type='text/css'/>");return}catch(c){}var a=b.createElement("link");a.setAttribute("rel","stylesheet");a.setAttribute("type","text/css");a.setAttribute("href",e);getHead(b).appendChild(a)};SimileAjax.includeCssFiles=function(b,e,c){for(var a=0;a<c.length;a++)SimileAjax.includeCssFile(b,e+c[a])};SimileAjax.prefixURLs=function(b,e,c){for(var a=0;a<c.length;a++)b.push(e+c[a])};SimileAjax.parseURLParameters=function(b,e,c){e=e||{};c=c||{};if(typeof b=="undefined")b=location.href;var a=b.indexOf("?");if(a<0)return e;b=(b+"#").slice(a+1,b.indexOf("#"));var d=b.split("&"),f;b={};var h=window.decodeURIComponent||unescape;for(a=0;f=d[a];a++){var i=f.indexOf("="),j=h(f.slice(0,i)),g=b[j];if(typeof g=="undefined")g=[];else g instanceof Array||(g=[g]);b[j]=g.concat(h(f.slice(i+1)))}for(a in b)if(b.hasOwnProperty(a)){d=c[a]||String;f=b[a];f instanceof Array||(f=[f]);e[a]=d===Boolean&&f[0]=="false"?false:d.apply(this,f)}return e};SimileAjax.loaded=true};
!("jQuery"in window)&&!("$"in window)&&function(){function b(a,c){c.src?d.ajax({url:c.src,async:false,dataType:"script"}):d.globalEval(c.text||c.textContent||c.innerHTML||"");c.parentNode&&c.parentNode.removeChild(c)}function e(a,c){return a[0]&&parseInt(d.curCSS(a[0],c,true),10)||0}function g(){return false}function i(){return true}function m(a){var c=RegExp("(^|\\.)"+a.type+"(\\.|$)"),f=true,j=[];d.each(d.data(this,"events").live||[],function(l,o){if(c.test(o.type)){var u=d(a.target).closest(o.data)[0];
u&&j.push({elem:u,fn:o})}});j.sort(function(l,o){return d.data(l.elem,"closest")-d.data(o.elem,"closest")});d.each(j,function(){if(this.fn.call(this.elem,a,this.fn.data)===false)return f=false});return f}function p(a,c){return["live",a,c.replace(/\./g,"`").replace(/ /g,"|")].join(".")}function x(){if(!aa){aa=true;if(document.addEventListener)document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);d.ready()},false);else if(document.attachEvent){document.attachEvent("onreadystatechange",
function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);d.ready()}});document.documentElement.doScroll&&w==w.top&&function(){if(!d.isReady){try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}d.ready()}}()}d.event.add(w,"load",d.ready)}}function y(a,c){var f={};d.each(ba.concat.apply([],ba.slice(0,c)),function(){f[this]=a});return f}var w=this,H=w.jQuery,I=w.$,d=w.jQuery=w.$=function(a,c){return new d.fn.init(a,
c)},F=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,J=/^.[^:#\[\.,]*$/;d.fn=d.prototype={init:function(a,c){a=a||document;if(a.nodeType){this[0]=a;this.length=1;this.context=a;return this}if(typeof a==="string"){var f=F.exec(a);if(f&&(f[1]||!c))if(f[1])a=d.clean([f[1]],c);else{var j=document.getElementById(f[3]);if(j&&j.id!=f[3])return d().find(a);f=d(j||[]);f.context=document;f.selector=a;return f}else return d(c).find(a)}else if(d.isFunction(a))return d(document).ready(a);if(a.selector&&a.context){this.selector=
a.selector;this.context=a.context}return this.setArray(d.isArray(a)?a:d.makeArray(a))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(a){return a===void 0?Array.prototype.slice.call(this):this[a]},pushStack:function(a,c,f){a=d(a);a.prevObject=this;a.context=this.context;if(c==="find")a.selector=this.selector+(this.selector?" ":"")+f;else if(c)a.selector=this.selector+"."+c+"("+f+")";return a},setArray:function(a){this.length=0;Array.prototype.push.apply(this,a);return this},
each:function(a,c){return d.each(this,a,c)},index:function(a){return d.inArray(a&&a.jquery?a[0]:a,this)},attr:function(a,c,f){var j=a;if(typeof a==="string")if(c===void 0)return this[0]&&d[f||"attr"](this[0],a);else{j={};j[a]=c}return this.each(function(l){for(a in j)d.attr(f?this.style:this,a,d.prop(this,j[a],f,l,a))})},css:function(a,c){if((a=="width"||a=="height")&&parseFloat(c)<0)c=void 0;return this.attr(a,c,"curCSS")},text:function(a){if(typeof a!=="object"&&a!=null)return this.empty().append((this[0]&&
this[0].ownerDocument||document).createTextNode(a));var c="";d.each(a||this,function(){d.each(this.childNodes,function(){if(this.nodeType!=8)c+=this.nodeType!=1?this.nodeValue:d.fn.text([this])})});return c},wrapAll:function(a){if(this[0]){a=d(a,this[0].ownerDocument).clone();this[0].parentNode&&a.insertBefore(this[0]);a.map(function(){for(var c=this;c.firstChild;)c=c.firstChild;return c}).append(this)}return this},wrapInner:function(a){return this.each(function(){d(this).contents().wrapAll(a)})},
wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},append:function(){return this.domManip(arguments,true,function(a){this.nodeType==1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){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||d([])},push:[].push,sort:[].sort,splice:[].splice,find:function(a){if(this.length===1){var c=this.pushStack([],"find",a);c.length=0;d.find(a,this[0],c);return c}else return this.pushStack(d.unique(d.map(this,function(f){return d.find(a,f)})),"find",a)},clone:function(a){var c=this.map(function(){if(!d.support.noCloneEvent&&!d.isXMLDoc(this)){var l=this.outerHTML;if(!l){l=this.ownerDocument.createElement("div");l.appendChild(this.cloneNode(true));
l=l.innerHTML}return d.clean([l.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else return this.cloneNode(true)});if(a===true){var f=this.find("*").andSelf(),j=0;c.find("*").andSelf().each(function(){if(this.nodeName===f[j].nodeName){var l=d.data(f[j],"events");for(var o in l)for(var u in l[o])d.event.add(this,o,l[o][u],l[o][u].data);j++}})}return c},filter:function(a){return this.pushStack(d.isFunction(a)&&d.grep(this,function(c,f){return a.call(c,f)})||d.multiFilter(a,d.grep(this,
function(c){return c.nodeType===1})),"filter",a)},closest:function(a){var c=d.expr.match.POS.test(a)?d(a):null,f=0;return this.map(function(){for(var j=this;j&&j.ownerDocument;){if(c?c.index(j)>-1:d(j).is(a)){d.data(j,"closest",f);return j}j=j.parentNode;f++}})},not:function(a){if(typeof a==="string")if(J.test(a))return this.pushStack(d.multiFilter(a,this,true),"not",a);else a=d.multiFilter(a,this);var c=a.length&&a[a.length-1]!==void 0&&!a.nodeType;return this.filter(function(){return c?d.inArray(this,
a)<0:this!=a})},add:function(a){return this.pushStack(d.unique(d.merge(this.get(),typeof a==="string"?d(a):d.makeArray(a))))},is:function(a){return!!a&&d.multiFilter(a,this).length>0},hasClass:function(a){return!!a&&this.is("."+a)},val:function(a){if(a===void 0){var c=this[0];if(c){if(d.nodeName(c,"option"))return(c.attributes.value||{}).specified?c.value:c.text;if(d.nodeName(c,"select")){var f=c.selectedIndex,j=[],l=c.options;c=c.type=="select-one";if(f<0)return null;var o=c?f:0;for(f=c?f+1:l.length;o<
f;o++){var u=l[o];if(u.selected){a=d(u).val();if(c)return a;j.push(a)}}return j}return(c.value||"").replace(/\r/g,"")}}else{if(typeof a==="number")a+="";return this.each(function(){if(this.nodeType==1)if(d.isArray(a)&&/radio|checkbox/.test(this.type))this.checked=d.inArray(this.value,a)>=0||d.inArray(this.name,a)>=0;else if(d.nodeName(this,"select")){var v=d.makeArray(a);d("option",this).each(function(){this.selected=d.inArray(this.value,v)>=0||d.inArray(this.text,v)>=0});if(!v.length)this.selectedIndex=
-1}else this.value=a})}},html:function(a){return a===void 0?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(d.map(this,function(c,f){return a.call(c,f,c)}))},andSelf:function(){return this.add(this.prevObject)},
domManip:function(a,c,f){if(this[0]){var j=(this[0].ownerDocument||this[0]).createDocumentFragment();a=d.clean(a,this[0].ownerDocument||this[0],j);var l=j.firstChild;if(l)for(var o=0,u=this.length;o<u;o++)f.call(c&&d.nodeName(this[o],"table")&&d.nodeName(l,"tr")?this[o].getElementsByTagName("tbody")[0]||this[o].appendChild(this[o].ownerDocument.createElement("tbody")):this[o],this.length>1||o>0?j.cloneNode(true):j);a&&d.each(a,b)}return this}};d.fn.init.prototype=d.fn;d.extend=d.fn.extend=function(){var a=
arguments[0]||{},c=1,f=arguments.length,j=false,l;if(typeof a==="boolean"){j=a;a=arguments[1]||{};c=2}if(typeof a!=="object"&&!d.isFunction(a))a={};if(f==c){a=this;--c}for(;c<f;c++)if((l=arguments[c])!=null)for(var o in l){var u=a[o],v=l[o];if(a!==v)if(j&&v&&typeof v==="object"&&!v.nodeType)a[o]=d.extend(j,u||(v.length!=null?[]:{}),v);else if(v!==void 0)a[o]=v}return a};var K=/z-?index|font-?weight|opacity|zoom|line-?height/i,O=document.defaultView||{},T=Object.prototype.toString;d.extend({noConflict:function(a){w.$=
I;if(a)w.jQuery=H;return d},isFunction:function(a){return T.call(a)==="[object Function]"},isArray:function(a){return T.call(a)==="[object Array]"},isXMLDoc:function(a){return a.nodeType===9&&a.documentElement.nodeName!=="HTML"||!!a.ownerDocument&&d.isXMLDoc(a.ownerDocument)},globalEval:function(a){if(a&&/\S/.test(a)){var c=document.getElementsByTagName("head")[0]||document.documentElement,f=document.createElement("script");f.type="text/javascript";if(d.support.scriptEval)f.appendChild(document.createTextNode(a));
else f.text=a;c.insertBefore(f,c.firstChild);c.removeChild(f)}},nodeName:function(a,c){return a.nodeName&&a.nodeName.toUpperCase()==c.toUpperCase()},each:function(a,c,f){var j,l=0,o=a.length;if(f)if(o===void 0)for(j in a){if(c.apply(a[j],f)===false)break}else for(;l<o;){if(c.apply(a[l++],f)===false)break}else if(o===void 0)for(j in a){if(c.call(a[j],j,a[j])===false)break}else for(f=a[0];l<o&&c.call(f,l,f)!==false;f=a[++l]);return a},prop:function(a,c,f,j,l){if(d.isFunction(c))c=c.call(a,j);return typeof c===
"number"&&f=="curCSS"&&!K.test(l)?c+"px":c},className:{add:function(a,c){d.each((c||"").split(/\s+/),function(f,j){if(a.nodeType==1&&!d.className.has(a.className,j))a.className+=(a.className?" ":"")+j})},remove:function(a,c){if(a.nodeType==1)a.className=c!==void 0?d.grep(a.className.split(/\s+/),function(f){return!d.className.has(c,f)}).join(" "):""},has:function(a,c){return a&&d.inArray(c,(a.className||a).toString().split(/\s+/))>-1}},swap:function(a,c,f){var j={};for(var l in c){j[l]=a.style[l];
a.style[l]=c[l]}f.call(a);for(l in c)a.style[l]=j[l]},css:function(a,c,f,j){if(c=="width"||c=="height"){var l;f={position:"absolute",visibility:"hidden",display:"block"};var o=c=="width"?["Left","Right"]:["Top","Bottom"],u=function(){l=c=="width"?a.offsetWidth:a.offsetHeight;j!=="border"&&d.each(o,function(){j||(l-=parseFloat(d.curCSS(a,"padding"+this,true))||0);if(j==="margin")l+=parseFloat(d.curCSS(a,"margin"+this,true))||0;else l-=parseFloat(d.curCSS(a,"border"+this+"Width",true))||0})};a.offsetWidth!==
0?u():d.swap(a,f,u);return Math.max(0,Math.round(l))}return d.curCSS(a,c,f)},curCSS:function(a,c,f){var j,l=a.style;if(c=="opacity"&&!d.support.opacity){j=d.attr(l,"opacity");return j==""?"1":j}if(c.match(/float/i))c=W;if(!f&&l&&l[c])j=l[c];else if(O.getComputedStyle){if(c.match(/float/i))c="float";c=c.replace(/([A-Z])/g,"-$1").toLowerCase();if(a=O.getComputedStyle(a,null))j=a.getPropertyValue(c);if(c=="opacity"&&j=="")j="1"}else if(a.currentStyle){j=c.replace(/\-(\w)/g,function(o,u){return u.toUpperCase()});
j=a.currentStyle[c]||a.currentStyle[j];if(!/^\d+(px)?$/i.test(j)&&/^\d/.test(j)){c=l.left;f=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;l.left=j||0;j=l.pixelLeft+"px";l.left=c;a.runtimeStyle.left=f}}return j},clean:function(a,c,f){c=c||document;if(typeof c.createElement==="undefined")c=c.ownerDocument||c[0]&&c[0].ownerDocument||document;if(!f&&a.length===1&&typeof a[0]==="string"){var j=/^<(\w+)\s*\/?>$/.exec(a[0]);if(j)return[c.createElement(j[1])]}var l=[];j=[];var o=c.createElement("div");
d.each(a,function(u,v){if(typeof v==="number")v+="";if(v){if(typeof v==="string"){v=v.replace(/(<(\w+)[^>]*?)\/>/g,function(L,P,B){return B.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?L:P+"></"+B+">"});var C=v.replace(/^\s+/,"").substring(0,10).toLowerCase(),D=!C.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!C.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||C.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!C.indexOf("<tr")&&[2,"<table><tbody>",
"</tbody></table>"]||(!C.indexOf("<td")||!C.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!C.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!d.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];for(o.innerHTML=D[1]+v+D[2];D[0]--;)o=o.lastChild;if(!d.support.tbody){var E=/<tbody/i.test(v);C=!C.indexOf("<table")&&!E?o.firstChild&&o.firstChild.childNodes:D[1]=="<table>"&&!E?o.childNodes:[];for(D=C.length-1;D>=0;--D)d.nodeName(C[D],"tbody")&&
!C[D].childNodes.length&&C[D].parentNode.removeChild(C[D])}!d.support.leadingWhitespace&&/^\s/.test(v)&&o.insertBefore(c.createTextNode(v.match(/^\s*/)[0]),o.firstChild);v=d.makeArray(o.childNodes)}if(v.nodeType)l.push(v);else l=d.merge(l,v)}});if(f){for(a=0;l[a];a++)if(d.nodeName(l[a],"script")&&(!l[a].type||l[a].type.toLowerCase()==="text/javascript"))j.push(l[a].parentNode?l[a].parentNode.removeChild(l[a]):l[a]);else{l[a].nodeType===1&&l.splice.apply(l,[a+1,0].concat(d.makeArray(l[a].getElementsByTagName("script"))));
f.appendChild(l[a])}return j}return l},attr:function(a,c,f){if(!(!a||a.nodeType==3||a.nodeType==8)){var j=!d.isXMLDoc(a),l=f!==void 0;c=j&&d.props[c]||c;if(a.tagName){var o=/href|src|style/.test(c);if(c in a&&j&&!o){if(l){if(c=="type"&&d.nodeName(a,"input")&&a.parentNode)throw"type property can't be changed";a[c]=f}if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c=="tabIndex")return(c=a.getAttributeNode("tabIndex"))&&c.specified?c.value:a.nodeName.match(/(button|input|object|select|textarea)/i)?
0:a.nodeName.match(/^(a|area)$/i)&&a.href?0:void 0;return a[c]}if(!d.support.style&&j&&c=="style")return d.attr(a.style,"cssText",f);l&&a.setAttribute(c,""+f);a=!d.support.hrefNormalized&&j&&o?a.getAttribute(c,2):a.getAttribute(c);return a===null?void 0:a}if(!d.support.opacity&&c=="opacity"){if(l){a.zoom=1;a.filter=(a.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(f)+""=="NaN"?"":"alpha(opacity="+f*100+")")}return a.filter&&a.filter.indexOf("opacity=")>=0?parseFloat(a.filter.match(/opacity=([^)]*)/)[1])/
100+"":""}c=c.replace(/-([a-z])/ig,function(u,v){return v.toUpperCase()});if(l)a[c]=f;return a[c]}},trim:function(a){return(a||"").replace(/^\s+|\s+$/g,"")},makeArray:function(a){var c=[];if(a!=null){var f=a.length;if(f==null||typeof a==="string"||d.isFunction(a)||a.setInterval)c[0]=a;else for(;f;)c[--f]=a[f]}return c},inArray:function(a,c){for(var f=0,j=c.length;f<j;f++)if(c[f]===a)return f;return-1},merge:function(a,c){var f=0,j,l=a.length;if(d.support.getAll)for(;(j=c[f++])!=null;)a[l++]=j;else for(;(j=
c[f++])!=null;)if(j.nodeType!=8)a[l++]=j;return a},unique:function(a){var c=[],f={};try{for(var j=0,l=a.length;j<l;j++){var o=d.data(a[j]);if(!f[o]){f[o]=true;c.push(a[j])}}}catch(u){c=a}return c},grep:function(a,c,f){for(var j=[],l=0,o=a.length;l<o;l++)!f!=!c(a[l],l)&&j.push(a[l]);return j},map:function(a,c){for(var f=[],j=0,l=a.length;j<l;j++){var o=c(a[j],j);if(o!=null)f[f.length]=o}return f.concat.apply([],f)}});var N=navigator.userAgent.toLowerCase();d.browser={version:(N.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||
[0,"0"])[1],safari:/webkit/.test(N),opera:/opera/.test(N),msie:/msie/.test(N)&&!/opera/.test(N),mozilla:/mozilla/.test(N)&&!/(compatible|webkit)/.test(N)};d.each({parent:function(a){return a.parentNode},parents:function(a){return d.dir(a,"parentNode")},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},siblings:function(a){return d.sibling(a.parentNode.firstChild,
a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,c){d.fn[a]=function(f){var j=d.map(this,c);if(f&&typeof f=="string")j=d.multiFilter(f,j);return this.pushStack(d.unique(j),a,f)}});d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,c){d.fn[a]=function(f){for(var j=[],l=d(f),o=0,u=l.length;o<
u;o++){var v=(o>0?this.clone(true):this).get();d.fn[c].apply(d(l[o]),v);j=j.concat(v)}return this.pushStack(j,a,f)}});d.each({removeAttr:function(a){d.attr(this,a,"");this.nodeType==1&&this.removeAttribute(a)},addClass:function(a){d.className.add(this,a)},removeClass:function(a){d.className.remove(this,a)},toggleClass:function(a,c){if(typeof c!=="boolean")c=!d.className.has(this,a);d.className[c?"add":"remove"](this,a)},remove:function(a){if(!a||d.filter(a,[this]).length){d("*",this).add([this]).each(function(){d.event.remove(this);
d.removeData(this)});this.parentNode&&this.parentNode.removeChild(this)}},empty:function(){for(d(this).children().remove();this.firstChild;)this.removeChild(this.firstChild)}},function(a,c){d.fn[a]=function(){return this.each(c,arguments)}});var Q="jQuery"+ +new Date,U=0,ca={};d.extend({cache:{},data:function(a,c,f){a=a==w?ca:a;var j=a[Q];j||(j=a[Q]=++U);if(c&&!d.cache[j])d.cache[j]={};if(f!==void 0)d.cache[j][c]=f;return c?d.cache[j][c]:j},removeData:function(a,c){a=a==w?ca:a;var f=a[Q];if(c){if(d.cache[f]){delete d.cache[f][c];
c="";for(c in d.cache[f])break;c||d.removeData(a)}}else{try{delete a[Q]}catch(j){a.removeAttribute&&a.removeAttribute(Q)}delete d.cache[f]}},queue:function(a,c,f){if(a){c=(c||"fx")+"queue";var j=d.data(a,c);if(!j||d.isArray(f))j=d.data(a,c,d.makeArray(f));else f&&j.push(f)}return j},dequeue:function(a,c){var f=d.queue(a,c),j=f.shift();if(!c||c==="fx")j=f[0];j!==void 0&&j.call(a)}});d.fn.extend({data:function(a,c){var f=a.split(".");f[1]=f[1]?"."+f[1]:"";if(c===void 0){var j=this.triggerHandler("getData"+
f[1]+"!",[f[0]]);if(j===void 0&&this.length)j=d.data(this[0],a);return j===void 0&&f[1]?this.data(f[0]):j}else return this.trigger("setData"+f[1]+"!",[f[0],c]).each(function(){d.data(this,a,c)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})},queue:function(a,c){if(typeof a!=="string"){c=a;a="fx"}if(c===void 0)return d.queue(this[0],a);return this.each(function(){var f=d.queue(this,a,c);a=="fx"&&f.length==1&&f[0].call(this)})},dequeue:function(a){return this.each(function(){d.dequeue(this,
a)})}});(function(){function a(h,k,q,r,s,t){s=h=="previousSibling"&&!t;for(var z=0,G=r.length;z<G;z++){var A=r[z];if(A){if(s&&A.nodeType===1){A.sizcache=q;A.sizset=z}A=A[h];for(var M=false;A;){if(A.sizcache===q){M=r[A.sizset];break}if(A.nodeType===1&&!t){A.sizcache=q;A.sizset=z}if(A.nodeName===k){M=A;break}A=A[h]}r[z]=M}}}function c(h,k,q,r,s,t){s=h=="previousSibling"&&!t;for(var z=0,G=r.length;z<G;z++){var A=r[z];if(A){if(s&&A.nodeType===1){A.sizcache=q;A.sizset=z}A=A[h];for(var M=false;A;){if(A.sizcache===
q){M=r[A.sizset];break}if(A.nodeType===1){if(!t){A.sizcache=q;A.sizset=z}if(typeof k!=="string"){if(A===k){M=true;break}}else if(o.filter(k,[A]).length>0){M=A;break}}A=A[h]}r[z]=M}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,j=0,l=Object.prototype.toString,o=function(h,k,q,r){q=q||[];k=k||document;if(k.nodeType!==1&&k.nodeType!==9)return[];if(!h||typeof h!=="string")return q;var s=[],t,z,G,A=true;for(f.lastIndex=0;(t=
f.exec(h))!==null;){s.push(t[1]);if(t[2]){G=RegExp.rightContext;break}}if(s.length>1&&v.exec(h))if(s.length===2&&u.relative[s[0]])t=S(s[0]+s[1],k);else for(t=u.relative[s[0]]?[k]:o(s.shift(),k);s.length;){h=s.shift();if(u.relative[h])h+=s.shift();t=S(h,t)}else{t=r?{expr:s.pop(),set:D(r)}:o.find(s.pop(),s.length===1&&k.parentNode?k.parentNode:k,B(k));t=o.filter(t.expr,t.set);if(s.length>0)z=D(t);else A=false;for(;s.length;){var M=s.pop(),R=M;if(u.relative[M])R=s.pop();else M="";if(R==null)R=k;u.relative[M](z,
R,B(k))}}z||(z=t);if(!z)throw"Syntax error, unrecognized expression: "+(M||h);if(l.call(z)==="[object Array]")if(A)if(k.nodeType===1)for(h=0;z[h]!=null;h++){if(z[h]&&(z[h]===true||z[h].nodeType===1&&P(k,z[h])))q.push(t[h])}else for(h=0;z[h]!=null;h++)z[h]&&z[h].nodeType===1&&q.push(t[h]);else q.push.apply(q,z);else D(z,q);if(G){o(G,k,q,r);if(L){hasDuplicate=false;q.sort(L);if(hasDuplicate)for(h=1;h<q.length;h++)q[h]===q[h-1]&&q.splice(h--,1)}}return q};o.matches=function(h,k){return o(h,null,null,
k)};o.find=function(h,k,q){var r,s;if(!h)return[];for(var t=0,z=u.order.length;t<z;t++){var G=u.order[t];if(s=u.match[G].exec(h)){var A=RegExp.leftContext;if(A.substr(A.length-1)!=="\\"){s[1]=(s[1]||"").replace(/\\/g,"");r=u.find[G](s,k,q);if(r!=null){h=h.replace(u.match[G],"");break}}}}r||(r=k.getElementsByTagName("*"));return{set:r,expr:h}};o.filter=function(h,k,q,r){for(var s=h,t=[],z=k,G,A,M=k&&k[0]&&B(k[0]);h&&k.length;){for(var R in u.filter)if((G=u.match[R].exec(h))!=null){var fa=u.filter[R],
V,X;A=false;if(z==t)t=[];if(u.preFilter[R])if(G=u.preFilter[R](G,z,q,t,r,M)){if(G===true)continue}else A=V=true;if(G)for(var Y=0;(X=z[Y])!=null;Y++)if(X){V=fa(X,G,Y,z);var da=r^!!V;if(q&&V!=null)if(da)A=true;else z[Y]=false;else if(da){t.push(X);A=true}}if(V!==void 0){q||(z=t);h=h.replace(u.match[R],"");if(!A)return[];break}}if(h==s)if(A==null)throw"Syntax error, unrecognized expression: "+h;else break;s=h}return z};var u=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(h){return h.getAttribute("href")}},
relative:{"+":function(h,k,q){var r=typeof k==="string",s=r&&!/\W/.test(k);r=r&&!s;if(s&&!q)k=k.toUpperCase();q=0;s=h.length;for(var t;q<s;q++)if(t=h[q]){for(;(t=t.previousSibling)&&t.nodeType!==1;);h[q]=r||t&&t.nodeName===k?t||false:t===k}r&&o.filter(k,h,true)},">":function(h,k,q){var r=typeof k==="string";if(r&&!/\W/.test(k)){k=q?k:k.toUpperCase();q=0;for(var s=h.length;q<s;q++){var t=h[q];if(t){r=t.parentNode;h[q]=r.nodeName===k?r:false}}}else{q=0;for(s=h.length;q<s;q++)if(t=h[q])h[q]=r?t.parentNode:
t.parentNode===k;r&&o.filter(k,h,true)}},"":function(h,k,q){var r=j++,s=c;if(!k.match(/\W/)){var t=k=q?k:k.toUpperCase();s=a}s("parentNode",k,r,h,t,q)},"~":function(h,k,q){var r=j++,s=c;if(typeof k==="string"&&!k.match(/\W/)){var t=k=q?k:k.toUpperCase();s=a}s("previousSibling",k,r,h,t,q)}},find:{ID:function(h,k,q){if(typeof k.getElementById!=="undefined"&&!q)return(h=k.getElementById(h[1]))?[h]:[]},NAME:function(h,k){if(typeof k.getElementsByName!=="undefined"){for(var q=[],r=k.getElementsByName(h[1]),
s=0,t=r.length;s<t;s++)r[s].getAttribute("name")===h[1]&&q.push(r[s]);return q.length===0?null:q}},TAG:function(h,k){return k.getElementsByTagName(h[1])}},preFilter:{CLASS:function(h,k,q,r,s,t){h=" "+h[1].replace(/\\/g,"")+" ";if(t)return h;t=0;for(var z;(z=k[t])!=null;t++)if(z)if(s^(z.className&&(" "+z.className+" ").indexOf(h)>=0))q||r.push(z);else if(q)k[t]=false;return false},ID:function(h){return h[1].replace(/\\/g,"")},TAG:function(h,k){for(var q=0;k[q]===false;q++);return k[q]&&B(k[q])?h[1]:
h[1].toUpperCase()},CHILD:function(h){if(h[1]=="nth"){var k=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(h[2]=="even"&&"2n"||h[2]=="odd"&&"2n+1"||!/\D/.test(h[2])&&"0n+"+h[2]||h[2]);h[2]=k[1]+(k[2]||1)-0;h[3]=k[3]-0}h[0]=j++;return h},ATTR:function(h,k,q,r,s,t){k=h[1].replace(/\\/g,"");if(!t&&u.attrMap[k])h[1]=u.attrMap[k];if(h[2]==="~=")h[4]=" "+h[4]+" ";return h},PSEUDO:function(h,k,q,r,s){if(h[1]==="not")if(h[3].match(f).length>1||/^\w/.test(h[3]))h[3]=o(h[3],null,null,k);else{h=o.filter(h[3],k,q,true^s);q||
r.push.apply(r,h);return false}else if(u.match.POS.test(h[0])||u.match.CHILD.test(h[0]))return true;return h},POS:function(h){h.unshift(true);return h}},filters:{enabled:function(h){return h.disabled===false&&h.type!=="hidden"},disabled:function(h){return h.disabled===true},checked:function(h){return h.checked===true},selected:function(h){return h.selected===true},parent:function(h){return!!h.firstChild},empty:function(h){return!h.firstChild},has:function(h,k,q){return!!o(q[3],h).length},header:function(h){return/h\d/i.test(h.nodeName)},
text:function(h){return"text"===h.type},radio:function(h){return"radio"===h.type},checkbox:function(h){return"checkbox"===h.type},file:function(h){return"file"===h.type},password:function(h){return"password"===h.type},submit:function(h){return"submit"===h.type},image:function(h){return"image"===h.type},reset:function(h){return"reset"===h.type},button:function(h){return"button"===h.type||h.nodeName.toUpperCase()==="BUTTON"},input:function(h){return/input|select|textarea|button/i.test(h.nodeName)}},
setFilters:{first:function(h,k){return k===0},last:function(h,k,q,r){return k===r.length-1},even:function(h,k){return k%2===0},odd:function(h,k){return k%2===1},lt:function(h,k,q){return k<q[3]-0},gt:function(h,k,q){return k>q[3]-0},nth:function(h,k,q){return q[3]-0==k},eq:function(h,k,q){return q[3]-0==k}},filter:{PSEUDO:function(h,k,q,r){var s=k[1],t=u.filters[s];if(t)return t(h,q,k,r);else if(s==="contains")return(h.textContent||h.innerText||"").indexOf(k[3])>=0;else if(s==="not"){k=k[3];q=0;for(r=
k.length;q<r;q++)if(k[q]===h)return false;return true}},CHILD:function(h,k){var q=k[1],r=h;switch(q){case "only":case "first":for(;r=r.previousSibling;)if(r.nodeType===1)return false;if(q=="first")return true;r=h;case "last":for(;r=r.nextSibling;)if(r.nodeType===1)return false;return true;case "nth":q=k[2];var s=k[3];if(q==1&&s==0)return true;var t=k[0],z=h.parentNode;if(z&&(z.sizcache!==t||!h.nodeIndex)){var G=0;for(r=z.firstChild;r;r=r.nextSibling)if(r.nodeType===1)r.nodeIndex=++G;z.sizcache=t}r=
h.nodeIndex-s;return q==0?r==0:r%q==0&&r/q>=0}},ID:function(h,k){return h.nodeType===1&&h.getAttribute("id")===k},TAG:function(h,k){return k==="*"&&h.nodeType===1||h.nodeName===k},CLASS:function(h,k){return(" "+(h.className||h.getAttribute("class"))+" ").indexOf(k)>-1},ATTR:function(h,k){var q=k[1];q=u.attrHandle[q]?u.attrHandle[q](h):h[q]!=null?h[q]:h.getAttribute(q);var r=q+"",s=k[2],t=k[4];return q==null?s==="!=":s==="="?r===t:s==="*="?r.indexOf(t)>=0:s==="~="?(" "+r+" ").indexOf(t)>=0:!t?r&&q!==
false:s==="!="?r!=t:s==="^="?r.indexOf(t)===0:s==="$="?r.substr(r.length-t.length)===t:s==="|="?r===t||r.substr(0,t.length+1)===t+"-":false},POS:function(h,k,q,r){var s=u.setFilters[k[2]];if(s)return s(h,q,k,r)}}},v=u.match.POS;for(var C in u.match)u.match[C]=RegExp(u.match[C].source+/(?![^\[]*\])(?![^\(]*\))/.source);var D=function(h,k){h=Array.prototype.slice.call(h);if(k){k.push.apply(k,h);return k}return h};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(E){D=function(h,
k){var q=k||[];if(l.call(h)==="[object Array]")Array.prototype.push.apply(q,h);else if(typeof h.length==="number")for(var r=0,s=h.length;r<s;r++)q.push(h[r]);else for(r=0;h[r];r++)q.push(h[r]);return q}}var L;if(document.documentElement.compareDocumentPosition)L=function(h,k){var q=h.compareDocumentPosition(k)&4?-1:h===k?0:1;if(q===0)hasDuplicate=true;return q};else if("sourceIndex"in document.documentElement)L=function(h,k){var q=h.sourceIndex-k.sourceIndex;if(q===0)hasDuplicate=true;return q};else if(document.createRange)L=
function(h,k){var q=h.ownerDocument.createRange(),r=k.ownerDocument.createRange();q.selectNode(h);q.collapse(true);r.selectNode(k);r.collapse(true);q=q.compareBoundaryPoints(Range.START_TO_END,r);if(q===0)hasDuplicate=true;return q};(function(){var h=document.createElement("form"),k="script"+(new Date).getTime();h.innerHTML="<input name='"+k+"'/>";var q=document.documentElement;q.insertBefore(h,q.firstChild);if(document.getElementById(k)){u.find.ID=function(r,s,t){if(typeof s.getElementById!=="undefined"&&
!t)return(s=s.getElementById(r[1]))?s.id===r[1]||typeof s.getAttributeNode!=="undefined"&&s.getAttributeNode("id").nodeValue===r[1]?[s]:void 0:[]};u.filter.ID=function(r,s){var t=typeof r.getAttributeNode!=="undefined"&&r.getAttributeNode("id");return r.nodeType===1&&t&&t.nodeValue===s}}q.removeChild(h)})();(function(){var h=document.createElement("div");h.appendChild(document.createComment(""));if(h.getElementsByTagName("*").length>0)u.find.TAG=function(k,q){var r=q.getElementsByTagName(k[1]);if(k[1]===
"*"){for(var s=[],t=0;r[t];t++)r[t].nodeType===1&&s.push(r[t]);r=s}return r};h.innerHTML="<a href='#'></a>";if(h.firstChild&&typeof h.firstChild.getAttribute!=="undefined"&&h.firstChild.getAttribute("href")!=="#")u.attrHandle.href=function(k){return k.getAttribute("href",2)}})();document.querySelectorAll&&function(){var h=o,k=document.createElement("div");k.innerHTML="<p class='TEST'></p>";if(!(k.querySelectorAll&&k.querySelectorAll(".TEST").length===0)){o=function(q,r,s,t){r=r||document;if(!t&&r.nodeType===
9&&!B(r))try{return D(r.querySelectorAll(q),s)}catch(z){}return h(q,r,s,t)};o.find=h.find;o.filter=h.filter;o.selectors=h.selectors;o.matches=h.matches}}();document.getElementsByClassName&&document.documentElement.getElementsByClassName&&function(){var h=document.createElement("div");h.innerHTML="<div class='test e'></div><div class='test'></div>";if(h.getElementsByClassName("e").length!==0){h.lastChild.className="e";if(h.getElementsByClassName("e").length!==1){u.order.splice(1,0,"CLASS");u.find.CLASS=
function(k,q,r){if(typeof q.getElementsByClassName!=="undefined"&&!r)return q.getElementsByClassName(k[1])}}}}();var P=document.compareDocumentPosition?function(h,k){return h.compareDocumentPosition(k)&16}:function(h,k){return h!==k&&(h.contains?h.contains(k):true)},B=function(h){return h.nodeType===9&&h.documentElement.nodeName!=="HTML"||!!h.ownerDocument&&B(h.ownerDocument)},S=function(h,k){for(var q=[],r="",s,t=k.nodeType?[k]:k;s=u.match.PSEUDO.exec(h);){r+=s[0];h=h.replace(u.match.PSEUDO,"")}h=
u.relative[h]?h+"*":h;s=0;for(var z=t.length;s<z;s++)o(h,t[s],q);return o.filter(r,q)};d.find=o;d.filter=o.filter;d.expr=o.selectors;d.expr[":"]=d.expr.filters;o.selectors.filters.hidden=function(h){return h.offsetWidth===0||h.offsetHeight===0};o.selectors.filters.visible=function(h){return h.offsetWidth>0||h.offsetHeight>0};o.selectors.filters.animated=function(h){return d.grep(d.timers,function(k){return h===k.elem}).length};d.multiFilter=function(h,k,q){if(q)h=":not("+h+")";return o.matches(h,
k)};d.dir=function(h,k){for(var q=[],r=h[k];r&&r!=document;){r.nodeType==1&&q.push(r);r=r[k]}return q};d.nth=function(h,k,q){k=k||1;for(var r=0;h;h=h[q])if(h.nodeType==1&&++r==k)break;return h};d.sibling=function(h,k){for(var q=[];h;h=h.nextSibling)h.nodeType==1&&h!=k&&q.push(h);return q}})();d.event={add:function(a,c,f,j){if(!(a.nodeType==3||a.nodeType==8)){if(a.setInterval&&a!=w)a=w;if(!f.guid)f.guid=this.guid++;if(j!==void 0){f=this.proxy(f);f.data=j}var l=d.data(a,"events")||d.data(a,"events",
{}),o=d.data(a,"handle")||d.data(a,"handle",function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(arguments.callee.elem,arguments):void 0});o.elem=a;d.each(c.split(/\s+/),function(u,v){var C=v.split(".");v=C.shift();f.type=C.slice().sort().join(".");var D=l[v];d.event.specialAll[v]&&d.event.specialAll[v].setup.call(a,j,C);if(!D){D=l[v]={};if(!d.event.special[v]||d.event.special[v].setup.call(a,j,C)===false)if(a.addEventListener)a.addEventListener(v,o,false);else a.attachEvent&&
a.attachEvent("on"+v,o)}D[f.guid]=f;d.event.global[v]=true});a=null}},guid:1,global:{},remove:function(a,c,f){if(!(a.nodeType==3||a.nodeType==8)){var j=d.data(a,"events"),l;if(j){if(c===void 0||typeof c==="string"&&c.charAt(0)==".")for(var o in j)this.remove(a,o+(c||""));else{if(c.type){f=c.handler;c=c.type}d.each(c.split(/\s+/),function(u,v){var C=v.split(".");v=C.shift();var D=RegExp("(^|\\.)"+C.slice().sort().join(".*\\.")+"(\\.|$)");if(j[v]){if(f)delete j[v][f.guid];else for(var E in j[v])D.test(j[v][E].type)&&
delete j[v][E];d.event.specialAll[v]&&d.event.specialAll[v].teardown.call(a,C);for(l in j[v])break;if(!l){if(!d.event.special[v]||d.event.special[v].teardown.call(a,C)===false)if(a.removeEventListener)a.removeEventListener(v,d.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+v,d.data(a,"handle"));l=null;delete j[v]}}})}for(l in j)break;if(!l){if(c=d.data(a,"handle"))c.elem=null;d.removeData(a,"events");d.removeData(a,"handle")}}}},trigger:function(a,c,f,j){var l=a.type||a;if(!j){a=typeof a===
"object"?a[Q]?a:d.extend(d.Event(l),a):d.Event(l);if(l.indexOf("!")>=0){a.type=l=l.slice(0,-1);a.exclusive=true}if(!f){a.stopPropagation();this.global[l]&&d.each(d.cache,function(){this.events&&this.events[l]&&d.event.trigger(a,c,this.handle.elem)})}if(!f||f.nodeType==3||f.nodeType==8)return;a.result=void 0;a.target=f;c=d.makeArray(c);c.unshift(a)}a.currentTarget=f;var o=d.data(f,"handle");o&&o.apply(f,c);if((!f[l]||d.nodeName(f,"a")&&l=="click")&&f["on"+l]&&f["on"+l].apply(f,c)===false)a.result=
false;if(!j&&f[l]&&!a.isDefaultPrevented()&&!(d.nodeName(f,"a")&&l=="click")){this.triggered=true;try{f[l]()}catch(u){}}this.triggered=false;if(!a.isPropagationStopped())(f=f.parentNode||f.ownerDocument)&&d.event.trigger(a,c,f,true)},handle:function(a){var c,f;a=arguments[0]=d.event.fix(a||w.event);a.currentTarget=this;f=a.type.split(".");a.type=f.shift();c=!f.length&&!a.exclusive;var j=RegExp("(^|\\.)"+f.slice().sort().join(".*\\.")+"(\\.|$)");f=(d.data(this,"events")||{})[a.type];for(var l in f){var o=
f[l];if(c||j.test(o.type)){a.handler=o;a.data=o.data;o=o.apply(this,arguments);if(o!==void 0){a.result=o;if(o===false){a.preventDefault();a.stopPropagation()}}if(a.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(a){if(a[Q])return a;var c=a;a=d.Event(c);for(var f=this.props.length,j;f;){j=this.props[--f];a[j]=c[j]}if(!a.target)a.target=a.srcElement||document;if(a.target.nodeType==3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement==a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){c=document.documentElement;f=document.body;a.pageX=a.clientX+(c&&c.scrollLeft||f&&f.scrollLeft||0)-(c.clientLeft||0);a.pageY=a.clientY+(c&&c.scrollTop||
f&&f.scrollTop||0)-(c.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},proxy:function(a,c){c=c||function(){return a.apply(this,arguments)};c.guid=a.guid=a.guid||c.guid||this.guid++;return c},special:{ready:{setup:x,teardown:function(){}}},specialAll:{live:{setup:function(a,c){d.event.add(this,c[0],m)},teardown:function(a){if(a.length){var c=
0,f=RegExp("(^|\\.)"+a[0]+"(\\.|$)");d.each(d.data(this,"events").live||{},function(){f.test(this.type)&&c++});c<1&&d.event.remove(this,a[0],m)}}}}};d.Event=function(a){if(!this.preventDefault)return new d.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=+new Date;this[Q]=true};d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=i;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=
i;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=i;this.stopPropagation()},isDefaultPrevented:g,isPropagationStopped:g,isImmediatePropagationStopped:g};var ea=function(a){for(var c=a.relatedTarget;c&&c!=this;)try{c=c.parentNode}catch(f){c=this}if(c!=this){a.type=a.data;d.event.handle.apply(this,arguments)}};d.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(a,c){d.event.special[c]=
{setup:function(){d.event.add(this,a,ea,c)},teardown:function(){d.event.remove(this,a,ea)}}});d.fn.extend({bind:function(a,c,f){return a=="unload"?this.one(a,c,f):this.each(function(){d.event.add(this,a,f||c,f&&c)})},one:function(a,c,f){var j=d.event.proxy(f||c,function(l){d(this).unbind(l,j);return(f||c).apply(this,arguments)});return this.each(function(){d.event.add(this,a,j,f&&c)})},unbind:function(a,c){return this.each(function(){d.event.remove(this,a,c)})},trigger:function(a,c){return this.each(function(){d.event.trigger(a,
c,this)})},triggerHandler:function(a,c){if(this[0]){var f=d.Event(a);f.preventDefault();f.stopPropagation();d.event.trigger(f,c,this[0]);return f.result}},toggle:function(a){for(var c=arguments,f=1;f<c.length;)d.event.proxy(a,c[f++]);return this.click(d.event.proxy(a,function(j){this.lastToggle=(this.lastToggle||0)%f;j.preventDefault();return c[this.lastToggle++].apply(this,arguments)||false}))},hover:function(a,c){return this.mouseenter(a).mouseleave(c)},ready:function(a){x();d.isReady?a.call(document,
d):d.readyList.push(a);return this},live:function(a,c){var f=d.event.proxy(c);f.guid+=this.selector+a;d(document).bind(p(a,this.selector),this.selector,f);return this},die:function(a,c){d(document).unbind(p(a,this.selector),c?{guid:c.guid+this.selector+a}:null);return this}});d.extend({isReady:false,readyList:[],ready:function(){if(!d.isReady){d.isReady=true;if(d.readyList){d.each(d.readyList,function(){this.call(document,d)});d.readyList=null}d(document).triggerHandler("ready")}}});var aa=false;
d.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,c){d.fn[c]=function(f){return f?this.bind(c,f):this.trigger(c)}});d(w).bind("unload",function(){for(var a in d.cache)a!=1&&d.cache[a].handle&&d.event.remove(d.cache[a].handle.elem)});(function(){d.support={};var a=document.documentElement,c=document.createElement("script"),f=document.createElement("div"),
j="script"+(new Date).getTime();f.style.display="none";f.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 l=f.getElementsByTagName("*"),o=f.getElementsByTagName("a")[0];if(!(!l||!l.length||!o)){d.support={leadingWhitespace:f.firstChild.nodeType==3,tbody:!f.getElementsByTagName("tbody").length,objectAll:!!f.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!f.getElementsByTagName("link").length,
style:/red/.test(o.getAttribute("style")),hrefNormalized:o.getAttribute("href")==="/a",opacity:o.style.opacity==="0.5",cssFloat:!!o.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};c.type="text/javascript";try{c.appendChild(document.createTextNode("window."+j+"=1;"))}catch(u){}a.insertBefore(c,a.firstChild);if(w[j]){d.support.scriptEval=true;delete w[j]}a.removeChild(c);if(f.attachEvent&&f.fireEvent){f.attachEvent("onclick",function(){d.support.noCloneEvent=false;f.detachEvent("onclick",
arguments.callee)});f.cloneNode(true).fireEvent("onclick")}d(function(){var v=document.createElement("div");v.style.width=v.style.paddingLeft="1px";document.body.appendChild(v);d.boxModel=d.support.boxModel=v.offsetWidth===2;document.body.removeChild(v).style.display="none"})}})();var W=d.support.cssFloat?"cssFloat":"styleFloat";d.props={"for":"htmlFor","class":"className","float":W,cssFloat:W,styleFloat:W,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};
d.fn.extend({_load:d.fn.load,load:function(a,c,f){if(typeof a!=="string")return this._load(a);var j=a.indexOf(" ");if(j>=0){var l=a.slice(j,a.length);a=a.slice(0,j)}j="GET";if(c)if(d.isFunction(c)){f=c;c=null}else if(typeof c==="object"){c=d.param(c);j="POST"}var o=this;d.ajax({url:a,type:j,dataType:"html",data:c,complete:function(u,v){if(v=="success"||v=="notmodified")o.html(l?d("<div/>").append(u.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(l):u.responseText);f&&o.each(f,[u.responseText,
v,u])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.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(a,c){var f=d(this).val();return f==null?null:d.isArray(f)?d.map(f,function(j){return{name:c.name,value:j}}):{name:c.name,value:f}}).get()}});
d.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(a,c){d.fn[c]=function(f){return this.bind(c,f)}});var ga=+new Date;d.extend({get:function(a,c,f,j){if(d.isFunction(c)){f=c;c=null}return d.ajax({type:"GET",url:a,data:c,success:f,dataType:j})},getScript:function(a,c){return d.get(a,null,c,"script")},getJSON:function(a,c,f){return d.get(a,c,f,"json")},post:function(a,c,f,j){if(d.isFunction(c)){f=c;c={}}return d.ajax({type:"POST",url:a,data:c,success:f,dataType:j})},
ajaxSetup:function(a){d.extend(d.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(a){function c(){a.success&&
a.success(u,o);a.global&&d.event.trigger("ajaxSuccess",[B,a])}function f(){a.complete&&a.complete(B,o);a.global&&d.event.trigger("ajaxComplete",[B,a]);a.global&&!--d.active&&d.event.trigger("ajaxStop")}a=d.extend(true,a,d.extend(true,{},d.ajaxSettings,a));var j,l=/=\?(&|$)/g,o,u,v=a.type.toUpperCase();if(a.data&&a.processData&&typeof a.data!=="string")a.data=d.param(a.data);if(a.dataType=="jsonp"){if(v=="GET")a.url.match(l)||(a.url+=(a.url.match(/\?/)?"&":"?")+(a.jsonp||"callback")+"=?");else if(!a.data||
!a.data.match(l))a.data=(a.data?a.data+"&":"")+(a.jsonp||"callback")+"=?";a.dataType="json"}if(a.dataType=="json"&&(a.data&&a.data.match(l)||a.url.match(l))){j="jsonp"+ga++;if(a.data)a.data=(a.data+"").replace(l,"="+j+"$1");a.url=a.url.replace(l,"="+j+"$1");a.dataType="script";w[j]=function(r){u=r;c();f();w[j]=void 0;try{delete w[j]}catch(s){}D&&D.removeChild(E)}}if(a.dataType=="script"&&a.cache==null)a.cache=false;if(a.cache===false&&v=="GET"){l=+new Date;var C=a.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+
l+"$2");a.url=C+(C==a.url?(a.url.match(/\?/)?"&":"?")+"_="+l:"")}if(a.data&&v=="GET"){a.url+=(a.url.match(/\?/)?"&":"?")+a.data;a.data=null}a.global&&!d.active++&&d.event.trigger("ajaxStart");l=/^(\w+:)?\/\/([^\/?#]+)/.exec(a.url);if(a.dataType=="script"&&v=="GET"&&l&&(l[1]&&l[1]!=location.protocol||l[2]!=location.host)){var D=document.getElementsByTagName("head")[0],E=document.createElement("script");E.src=a.url;if(a.scriptCharset)E.charset=a.scriptCharset;if(!j){var L=false;E.onload=E.onreadystatechange=
function(){if(!L&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){L=true;c();f();E.onload=E.onreadystatechange=null;D.removeChild(E)}}}D.appendChild(E)}else{var P=false,B=a.xhr();a.username?B.open(v,a.url,a.async,a.username,a.password):B.open(v,a.url,a.async);try{a.data&&B.setRequestHeader("Content-Type",a.contentType);if(a.ifModified)B.setRequestHeader("If-Modified-Since",d.lastModified[a.url]||"Thu, 01 Jan 1970 00:00:00 GMT");B.setRequestHeader("X-Requested-With","XMLHttpRequest");
B.setRequestHeader("Accept",a.dataType&&a.accepts[a.dataType]?a.accepts[a.dataType]+", */*":a.accepts._default)}catch(S){}if(a.beforeSend&&a.beforeSend(B,a)===false){a.global&&!--d.active&&d.event.trigger("ajaxStop");B.abort();return false}a.global&&d.event.trigger("ajaxSend",[B,a]);var h=function(r){if(B.readyState==0){if(k){clearInterval(k);k=null;a.global&&!--d.active&&d.event.trigger("ajaxStop")}}else if(!P&&B&&(B.readyState==4||r=="timeout")){P=true;if(k){clearInterval(k);k=null}o=r=="timeout"?
"timeout":!d.httpSuccess(B)?"error":a.ifModified&&d.httpNotModified(B,a.url)?"notmodified":"success";if(o=="success")try{u=d.httpData(B,a.dataType,a)}catch(s){o="parsererror"}if(o=="success"){var t;try{t=B.getResponseHeader("Last-Modified")}catch(z){}if(a.ifModified&&t)d.lastModified[a.url]=t;j||c()}else d.handleError(a,B,o);f();r&&B.abort();if(a.async)B=null}};if(a.async){var k=setInterval(h,13);a.timeout>0&&setTimeout(function(){B&&!P&&h("timeout")},a.timeout)}try{B.send(a.data)}catch(q){d.handleError(a,
B,null,q)}a.async||h();return B}},handleError:function(a,c,f,j){a.error&&a.error(c,f,j);a.global&&d.event.trigger("ajaxError",[c,a,j])},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(c){}return false},httpNotModified:function(a,c){try{var f=a.getResponseHeader("Last-Modified");return a.status==304||f==d.lastModified[c]}catch(j){}return false},httpData:function(a,c,f){var j=a.getResponseHeader("content-type");
a=(j=c=="xml"||!c&&j&&j.indexOf("xml")>=0)?a.responseXML:a.responseText;if(j&&a.documentElement.tagName=="parsererror")throw"parsererror";if(f&&f.dataFilter)a=f.dataFilter(a,c);if(typeof a==="string"){c=="script"&&d.globalEval(a);if(c=="json")a=w.eval("("+a+")")}return a},param:function(a){function c(l,o){f[f.length]=encodeURIComponent(l)+"="+encodeURIComponent(o)}var f=[];if(d.isArray(a)||a.jquery)d.each(a,function(){c(this.name,this.value)});else for(var j in a)d.isArray(a[j])?d.each(a[j],function(){c(j,
this)}):c(j,d.isFunction(a[j])?a[j]():a[j]);return f.join("&").replace(/%20/g,"+")}});var $={},Z,ba=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,c){if(a)return this.animate(y("show",3),a,c);else{for(var f=0,j=this.length;f<j;f++){var l=d.data(this[f],"olddisplay");this[f].style.display=l||"";if(d.css(this[f],"display")==="none"){l=this[f].tagName;var o;if($[l])o=$[l];
else{var u=d("<"+l+" />").appendTo("body");o=u.css("display");if(o==="none")o="block";u.remove();$[l]=o}d.data(this[f],"olddisplay",o)}}f=0;for(j=this.length;f<j;f++)this[f].style.display=d.data(this[f],"olddisplay")||"";return this}},hide:function(a,c){if(a)return this.animate(y("hide",3),a,c);else{for(var f=0,j=this.length;f<j;f++){var l=d.data(this[f],"olddisplay");!l&&l!=="none"&&d.data(this[f],"olddisplay",d.css(this[f],"display"))}f=0;for(j=this.length;f<j;f++)this[f].style.display="none";return this}},
_toggle:d.fn.toggle,toggle:function(a,c){var f=typeof a==="boolean";return d.isFunction(a)&&d.isFunction(c)?this._toggle.apply(this,arguments):a==null||f?this.each(function(){var j=f?a:d(this).is(":hidden");d(this)[j?"show":"hide"]()}):this.animate(y("toggle",3),a,c)},fadeTo:function(a,c,f){return this.animate({opacity:c},a,f)},animate:function(a,c,f,j){var l=d.speed(c,f,j);return this[l.queue===false?"each":"queue"](function(){var o=d.extend({},l),u,v=this.nodeType==1&&d(this).is(":hidden"),C=this;
for(u in a){if(a[u]=="hide"&&v||a[u]=="show"&&!v)return o.complete.call(this);if((u=="height"||u=="width")&&this.style){o.display=d.css(this,"display");o.overflow=this.style.overflow}}if(o.overflow!=null)this.style.overflow="hidden";o.curAnim=d.extend({},a);d.each(a,function(D,E){var L=new d.fx(C,o,D);if(/toggle|show|hide/.test(E))L[E=="toggle"?v?"show":"hide":E](a);else{var P=E.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),B=L.cur(true)||0;if(P){var S=parseFloat(P[2]),h=P[3]||"px";if(h!="px"){C.style[D]=
(S||1)+h;B=(S||1)/L.cur(true)*B;C.style[D]=B+h}if(P[1])S=(P[1]=="-="?-1:1)*S+B;L.custom(B,S,h)}else L.custom(B,E,"")}});return true})},stop:function(a,c){var f=d.timers;a&&this.queue([]);this.each(function(){for(var j=f.length-1;j>=0;j--)if(f[j].elem==this){c&&f[j](true);f.splice(j,1)}});c||this.dequeue();return this}});d.each({slideDown:y("show",1),slideUp:y("hide",1),slideToggle:y("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,c){d.fn[a]=function(f,j){return this.animate(c,
f,j)}});d.extend({speed:function(a,c,f){var j=typeof a==="object"?a:{complete:f||!f&&c||d.isFunction(a)&&a,duration:a,easing:f&&c||c&&!d.isFunction(c)&&c};j.duration=d.fx.off?0:typeof j.duration==="number"?j.duration:d.fx.speeds[j.duration]||d.fx.speeds._default;j.old=j.complete;j.complete=function(){j.queue!==false&&d(this).dequeue();d.isFunction(j.old)&&j.old.call(this)};return j},easing:{linear:function(a,c,f,j){return f+j*a},swing:function(a,c,f,j){return(-Math.cos(a*Math.PI)/2+0.5)*j+f}},timers:[],
fx:function(a,c,f){this.options=c;this.elem=a;this.prop=f;if(!c.orig)c.orig={}}});d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(d.fx.step[this.prop]||d.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];return(a=parseFloat(d.css(this.elem,this.prop,
a)))&&a>-10000?a:parseFloat(d.curCSS(this.elem,this.prop))||0},custom:function(a,c,f){function j(o){return l.step(o)}this.startTime=+new Date;this.start=a;this.end=c;this.unit=f||this.unit||"px";this.now=this.start;this.pos=this.state=0;var l=this;j.elem=this.elem;if(j()&&d.timers.push(j)&&!Z)Z=setInterval(function(){for(var o=d.timers,u=0;u<o.length;u++)o[u]()||o.splice(u--,1);if(!o.length){clearInterval(Z);Z=void 0}},13)},show:function(){this.options.orig[this.prop]=d.attr(this.elem.style,this.prop);
this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var c=+new Date;if(a||c>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();a=this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)a=false;if(a){if(this.options.display!=
null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(d.css(this.elem,"display")=="none")this.elem.style.display="block"}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var j in this.options.curAnim)d.attr(this.elem.style,j,this.options.orig[j]);this.options.complete.call(this.elem)}return false}else{f=c-this.startTime;this.state=f/this.options.duration;this.pos=d.easing[this.options.easing||(d.easing.swing?"swing":
"linear")](this.state,f,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};d.extend(d.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.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}}});d.fn.offset=document.documentElement.getBoundingClientRect?function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return d.offset.bodyOffset(this[0]);
var a=this[0].getBoundingClientRect(),c=this[0].ownerDocument,f=c.body;c=c.documentElement;return{top:a.top+(self.pageYOffset||d.boxModel&&c.scrollTop||f.scrollTop)-(c.clientTop||f.clientTop||0),left:a.left+(self.pageXOffset||d.boxModel&&c.scrollLeft||f.scrollLeft)-(c.clientLeft||f.clientLeft||0)}}:function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return d.offset.bodyOffset(this[0]);d.offset.initialized||d.offset.initialize();var a=this[0],c=a.offsetParent,f=a.ownerDocument,
j,l=f.documentElement,o=f.body;f=f.defaultView;j=f.getComputedStyle(a,null);for(var u=a.offsetTop,v=a.offsetLeft;(a=a.parentNode)&&a!==o&&a!==l;){j=f.getComputedStyle(a,null);u-=a.scrollTop;v-=a.scrollLeft;if(a===c){u+=a.offsetTop;v+=a.offsetLeft;if(d.offset.doesNotAddBorder&&!(d.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(a.tagName))){u+=parseInt(j.borderTopWidth,10)||0;v+=parseInt(j.borderLeftWidth,10)||0}c=a.offsetParent}if(d.offset.subtractsBorderForOverflowNotVisible&&j.overflow!==
"visible"){u+=parseInt(j.borderTopWidth,10)||0;v+=parseInt(j.borderLeftWidth,10)||0}j=j}if(j.position==="relative"||j.position==="static"){u+=o.offsetTop;v+=o.offsetLeft}if(j.position==="fixed"){u+=Math.max(l.scrollTop,o.scrollTop);v+=Math.max(l.scrollLeft,o.scrollLeft)}return{top:u,left:v}};d.offset={initialize:function(){if(!this.initialized){var a=document.body,c=document.createElement("div"),f,j,l,o=a.style.marginTop;f={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",
visibility:"hidden"};for(j in f)c.style[j]=f[j];c.innerHTML='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';a.insertBefore(c,a.firstChild);f=c.firstChild;j=f.firstChild;l=f.nextSibling.firstChild.firstChild;this.doesNotAddBorder=j.offsetTop!==5;this.doesAddBorderForTableAndCells=
l.offsetTop===5;f.style.overflow="hidden";f.style.position="relative";this.subtractsBorderForOverflowNotVisible=j.offsetTop===-5;a.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=a.offsetTop===0;a.style.marginTop=o;a.removeChild(c);this.initialized=true}},bodyOffset:function(a){d.offset.initialized||d.offset.initialize();var c=a.offsetTop,f=a.offsetLeft;if(d.offset.doesNotIncludeMarginInBodyOffset){c+=parseInt(d.curCSS(a,"marginTop",true),10)||0;f+=parseInt(d.curCSS(a,"marginLeft",true),
10)||0}return{top:c,left:f}}};d.fn.extend({position:function(){var a;if(this[0]){a=this.offsetParent();var c=this.offset(),f=/^body|html$/i.test(a[0].tagName)?{top:0,left:0}:a.offset();c.top-=e(this,"marginTop");c.left-=e(this,"marginLeft");f.top+=e(a,"borderTopWidth");f.left+=e(a,"borderLeftWidth");a={top:c.top-f.top,left:c.left-f.left}}return a},offsetParent:function(){for(var a=this[0].offsetParent||document.body;a&&!/^body|html$/i.test(a.tagName)&&d.css(a,"position")=="static";)a=a.offsetParent;
return d(a)}});d.each(["Left","Top"],function(a,c){var f="scroll"+c;d.fn[f]=function(j){if(!this[0])return null;return j!==void 0?this.each(function(){this==w||this==document?w.scrollTo(!a?j:d(w).scrollLeft(),a?j:d(w).scrollTop()):this[f]=j}):this[0]==w||this[0]==document?self[a?"pageYOffset":"pageXOffset"]||d.boxModel&&document.documentElement[f]||document.body[f]:this[0][f]}});d.each(["Height","Width"],function(a,c){var f=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?d.css(this[0],f,
false,"padding"):null};d.fn["outer"+c]=function(l){return this[0]?d.css(this[0],f,false,l?"margin":"border"):null};var j=c.toLowerCase();d.fn[j]=function(l){return this[0]==w?document.compatMode=="CSS1Compat"&&document.documentElement["client"+c]||document.body["client"+c]:this[0]==document?Math.max(document.documentElement["client"+c],document.body["scroll"+c],document.documentElement["scroll"+c],document.body["offset"+c],document.documentElement["offset"+c]):l===void 0?this.length?d.css(this[0],
j):null:this.css(j,typeof l==="string"?l:l+"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 b=navigator.appName.toLowerCase(),e=navigator.userAgent.toLowerCase();SimileAjax.Platform.os.isMac=e.indexOf("mac")!=-1;SimileAjax.Platform.os.isWin=e.indexOf("win")!=-1;SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(e.indexOf("95")!=-1||e.indexOf("98")!=-1||e.indexOf("nt")!=-1||e.indexOf("win32")!=-1||e.indexOf("32bit")!=-1);SimileAjax.Platform.os.isUnix=e.indexOf("x11")!=-1;SimileAjax.Platform.browser.isIE=b.indexOf("microsoft")!=-1;SimileAjax.Platform.browser.isNetscape=
b.indexOf("netscape")!=-1;SimileAjax.Platform.browser.isMozilla=e.indexOf("mozilla")!=-1;SimileAjax.Platform.browser.isFirefox=e.indexOf("firefox")!=-1;SimileAjax.Platform.browser.isOpera=b.indexOf("opera")!=-1;SimileAjax.Platform.browser.isSafari=b.indexOf("safari")!=-1;b=function(m){m=m.split(".");SimileAjax.Platform.browser.majorVersion=parseInt(m[0]);SimileAjax.Platform.browser.minorVersion=parseInt(m[1])};var g=function(m,p,x){p=m.indexOf(p,x);return p>=0?p:m.length};if(SimileAjax.Platform.browser.isMozilla){var i=
e.indexOf("mozilla/");i>=0&&b(e.substring(i+8,g(e," ",i)))}if(SimileAjax.Platform.browser.isIE){i=e.indexOf("msie ");i>=0&&b(e.substring(i+5,g(e,";",i)))}if(SimileAjax.Platform.browser.isNetscape){i=e.indexOf("rv:");i>=0&&b(e.substring(i+3,g(e,")",i)))}if(SimileAjax.Platform.browser.isFirefox){i=e.indexOf("firefox/");i>=0&&b(e.substring(i+8,g(e," ",i)))}if(!("localeCompare"in String.prototype))String.prototype.localeCompare=function(m){return this<m?-1:this>m?1:0}})();
SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale};SimileAjax.ListenerQueue=function(b){this._listeners=[];this._wildcardHandlerName=b};SimileAjax.ListenerQueue.prototype.add=function(b){this._listeners.push(b)};SimileAjax.ListenerQueue.prototype.remove=function(b){for(var e=this._listeners,g=0;g<e.length;g++)if(e[g]==b){e.splice(g,1);break}};
SimileAjax.ListenerQueue.prototype.fire=function(b,e){for(var g=[].concat(this._listeners),i=0;i<g.length;i++){var m=g[i];if(b in m)try{m[b].apply(m,e)}catch(p){SimileAjax.Debug.exception("Error firing event of name "+b,p)}else if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in m)try{m[this._wildcardHandlerName].apply(m,[b])}catch(x){SimileAjax.Debug.exception("Error firing event of name "+b+" to wildcard handler",x)}}};
SimileAjax.Set=function(b){this._hash={};this._count=0;if(b instanceof Array)for(var e=0;e<b.length;e++)this.add(b[e]);else b instanceof SimileAjax.Set&&this.addSet(b)};SimileAjax.Set.prototype.add=function(b){if(!(b in this._hash)){this._hash[b]=true;this._count++;return true}return false};SimileAjax.Set.prototype.addSet=function(b){for(var e in b._hash)this.add(e)};SimileAjax.Set.prototype.remove=function(b){if(b in this._hash){delete this._hash[b];this._count--;return true}return false};
SimileAjax.Set.prototype.removeSet=function(b){for(var e in b._hash)this.remove(e)};SimileAjax.Set.prototype.retainSet=function(b){for(var e in this._hash)if(!b.contains(e)){delete this._hash[e];this._count--}};SimileAjax.Set.prototype.contains=function(b){return b in this._hash};SimileAjax.Set.prototype.size=function(){return this._count};SimileAjax.Set.prototype.toArray=function(){var b=[];for(var e in this._hash)b.push(e);return b};
SimileAjax.Set.prototype.visit=function(b){for(var e in this._hash)if(b(e)==true)break};SimileAjax.SortedArray=function(b,e){this._a=e instanceof Array?e:[];this._compare=b};SimileAjax.SortedArray.prototype.add=function(b){var e=this,g=this.find(function(i){return e._compare(i,b)});g<this._a.length?this._a.splice(g,0,b):this._a.push(b)};
SimileAjax.SortedArray.prototype.remove=function(b){for(var e=this,g=this.find(function(i){return e._compare(i,b)});g<this._a.length&&this._compare(this._a[g],b)==0;)if(this._a[g]==b){this._a.splice(g,1);return true}else g++;return false};SimileAjax.SortedArray.prototype.removeAll=function(){this._a=[]};SimileAjax.SortedArray.prototype.elementAt=function(b){return this._a[b]};SimileAjax.SortedArray.prototype.length=function(){return this._a.length};
SimileAjax.SortedArray.prototype.find=function(b){for(var e=0,g=this._a.length;e<g;){var i=Math.floor((e+g)/2),m=b(this._a[i]);if(i==e)return m<0?e+1:e;else if(m<0)e=i;else g=i}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 e=this;this._unit=b!=null?b:SimileAjax.NativeDateUnit;this._events=new SimileAjax.SortedArray(function(g,i){return e._unit.compare(g.getStart(),i.getStart())});this._idToEvent={};this._indexed=true};SimileAjax.EventIndex.prototype.getUnit=function(){return this._unit};SimileAjax.EventIndex.prototype.getEvent=function(b){return this._idToEvent[b]};SimileAjax.EventIndex.prototype.add=function(b){this._events.add(b);this._idToEvent[b.getID()]=b;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(b,e){this._indexed||this._index();return new SimileAjax.EventIndex._Iterator(this._events,b,e,this._unit)};
SimileAjax.EventIndex.prototype.getReverseIterator=function(b,e){this._indexed||this._index();return new SimileAjax.EventIndex._ReverseIterator(this._events,b,e,this._unit)};SimileAjax.EventIndex.prototype.getAllIterator=function(){return new SimileAjax.EventIndex._AllIterator(this._events)};SimileAjax.EventIndex.prototype.getEarliestDate=function(){var b=this._events.getFirst();return b==null?null:b.getStart()};
SimileAjax.EventIndex.prototype.getLatestDate=function(){var b=this._events.getLast();if(b==null)return null;this._indexed||this._index();var e=b._earliestOverlapIndex;b=this._events.elementAt(e).getEnd();for(e=e+1;e<this._events.length();e++)b=this._unit.later(b,this._events.elementAt(e).getEnd());return b};
SimileAjax.EventIndex.prototype._index=function(){for(var b=this._events.length(),e=0;e<b;e++){var g=this._events.elementAt(e);g._earliestOverlapIndex=e}var i=1;for(e=0;e<b;e++){g=this._events.elementAt(e);g=g.getEnd();for(i=Math.max(i,e+1);i<b;){var m=this._events.elementAt(i);if(this._unit.compare(m.getStart(),g)<0){m._earliestOverlapIndex=e;i++}else break}}this._indexed=true};
SimileAjax.EventIndex._Iterator=function(b,e,g,i){this._events=b;this._startDate=e;this._endDate=g;this._unit=i;this._currentIndex=b.find(function(m){return i.compare(m.getStart(),e)});if(this._currentIndex-1>=0)this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex;this._currentIndex--;this._maxIndex=b.find(function(m){return i.compare(m.getStart(),g)});this._hasNext=false;this._next=null;this._findNext()};
SimileAjax.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext},next:function(){if(this._hasNext){var b=this._next;this._findNext();return b}else return null},_findNext:function(){for(var b=this._unit;++this._currentIndex<this._maxIndex;){var e=this._events.elementAt(this._currentIndex);if(b.compare(e.getStart(),this._endDate)<0&&b.compare(e.getEnd(),this._startDate)>0){this._next=e;this._hasNext=true;return}}this._next=null;this._hasNext=false}};
SimileAjax.EventIndex._ReverseIterator=function(b,e,g,i){this._events=b;this._startDate=e;this._endDate=g;this._unit=i;this._minIndex=b.find(function(m){return i.compare(m.getStart(),e)});if(this._minIndex-1>=0)this._minIndex=this._events.elementAt(this._minIndex-1)._earliestOverlapIndex;this._currentIndex=this._maxIndex=b.find(function(m){return i.compare(m.getStart(),g)});this._hasNext=false;this._next=null;this._findNext()};
SimileAjax.EventIndex._ReverseIterator.prototype={hasNext:function(){return this._hasNext},next:function(){if(this._hasNext){var b=this._next;this._findNext();return b}else return null},_findNext:function(){for(var b=this._unit;--this._currentIndex>=this._minIndex;){var e=this._events.elementAt(this._currentIndex);if(b.compare(e.getStart(),this._endDate)<0&&b.compare(e.getEnd(),this._startDate)>0){this._next=e;this._hasNext=true;return}}this._next=null;this._hasNext=false}};
SimileAjax.EventIndex._AllIterator=function(b){this._events=b;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.DateTime={};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 b=SimileAjax.DateTime,e=b.gregorianUnitLengths;e[b.MILLISECOND]=1;e[b.SECOND]=1E3;e[b.MINUTE]=e[b.SECOND]*60;e[b.HOUR]=e[b.MINUTE]*60;e[b.DAY]=e[b.HOUR]*24;e[b.WEEK]=e[b.DAY]*7;e[b.MONTH]=e[b.DAY]*31;e[b.YEAR]=e[b.DAY]*365;e[b.DECADE]=e[b.YEAR]*10;e[b.CENTURY]=e[b.YEAR]*100;e[b.MILLENNIUM]=e[b.YEAR]*1E3})();SimileAjax.DateTime._dateRegexp=/^(-?)([0-9]{4})((-?([0-9]{2})(-?([0-9]{2}))?)|(-?([0-9]{3}))|(-?W([0-9]{2})(-?([1-7]))?))?$/;SimileAjax.DateTime._timezoneRegexp=/Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$/;
SimileAjax.DateTime._timeRegexp=/^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$/;
SimileAjax.DateTime.setIso8601Date=function(b,e){var g=e.match(SimileAjax.DateTime._dateRegexp);if(!g)throw Error("Invalid date string: "+e);var i=g[5],m=g[7],p=g[9],x=g[11],y=g[13]?g[13]:1;b.setUTCFullYear((g[1]=="-"?-1:1)*g[2]);if(p){b.setUTCMonth(0);b.setUTCDate(Number(p))}else if(x){b.setUTCMonth(0);b.setUTCDate(1);g=(g=b.getUTCDay())?g:7;x=Number(y)+7*Number(x);g<=4?b.setUTCDate(x+1-g):b.setUTCDate(x+8-g)}else{if(i){b.setUTCDate(1);b.setUTCMonth(i-1)}m&&b.setUTCDate(m)}return b};
SimileAjax.DateTime.setIso8601Time=function(b,e){var g=e.match(SimileAjax.DateTime._timeRegexp);if(!g){SimileAjax.Debug.warn("Invalid time string: "+e);return false}var i=g[1],m=Number(g[3]?g[3]:0),p=g[5]?g[5]:0;g=g[7]?Number("0."+g[7])*1E3:0;b.setUTCHours(i);b.setUTCMinutes(m);b.setUTCSeconds(p);b.setUTCMilliseconds(g);return b};SimileAjax.DateTime.timezoneOffset=(new Date).getTimezoneOffset();
SimileAjax.DateTime.setIso8601=function(b,e){var g=null,i=e.indexOf("T")==-1?e.split(" "):e.split("T");SimileAjax.DateTime.setIso8601Date(b,i[0]);if(i.length==2){var m=i[1].match(SimileAjax.DateTime._timezoneRegexp);if(m){if(m[0]=="Z")g=0;else{g=Number(m[3])*60+Number(m[5]);g*=m[2]=="-"?1:-1}i[1]=i[1].substr(0,i[1].length-m[0].length)}SimileAjax.DateTime.setIso8601Time(b,i[1])}if(g==null)g=b.getTimezoneOffset();b.setTime(b.getTime()+g*6E4);return b};
SimileAjax.DateTime.parseIso8601DateTime=function(b){try{return SimileAjax.DateTime.setIso8601(new Date(0),b)}catch(e){return null}};SimileAjax.DateTime.parseGregorianDateTime=function(b){if(b==null)return null;else if(b instanceof Date)return b;var e=b.toString();if(e.length>0&&e.length<8){var g=e.indexOf(" ");if(g>0){b=parseInt(e.substr(0,g));if(e.substr(g+1).toLowerCase()=="bc")b=1-b}else b=parseInt(e);e=new Date(0);e.setUTCFullYear(b);return e}try{return new Date(Date.parse(e))}catch(i){return null}};
SimileAjax.DateTime.roundDownToInterval=function(b,e,g,i,m){g=g*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];var p=new Date(b.getTime()+g),x=function(w){w.setUTCMilliseconds(0);w.setUTCSeconds(0);w.setUTCMinutes(0);w.setUTCHours(0)},y=function(w){x(w);w.setUTCDate(1);w.setUTCMonth(0)};switch(e){case SimileAjax.DateTime.MILLISECOND:e=p.getUTCMilliseconds();p.setUTCMilliseconds(e-e%i);break;case SimileAjax.DateTime.SECOND:p.setUTCMilliseconds(0);e=p.getUTCSeconds();p.setUTCSeconds(e-
e%i);break;case SimileAjax.DateTime.MINUTE:p.setUTCMilliseconds(0);p.setUTCSeconds(0);e=p.getUTCMinutes();p.setTime(p.getTime()-e%i*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);break;case SimileAjax.DateTime.HOUR:p.setUTCMilliseconds(0);p.setUTCSeconds(0);p.setUTCMinutes(0);e=p.getUTCHours();p.setUTCHours(e-e%i);break;case SimileAjax.DateTime.DAY:x(p);break;case SimileAjax.DateTime.WEEK:x(p);i=(p.getUTCDay()+7-m)%7;p.setTime(p.getTime()-i*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]);
break;case SimileAjax.DateTime.MONTH:x(p);p.setUTCDate(1);e=p.getUTCMonth();p.setUTCMonth(e-e%i);break;case SimileAjax.DateTime.YEAR:y(p);e=p.getUTCFullYear();p.setUTCFullYear(e-e%i);break;case SimileAjax.DateTime.DECADE:y(p);p.setUTCFullYear(Math.floor(p.getUTCFullYear()/10)*10);break;case SimileAjax.DateTime.CENTURY:y(p);p.setUTCFullYear(Math.floor(p.getUTCFullYear()/100)*100);break;case SimileAjax.DateTime.MILLENNIUM:y(p);p.setUTCFullYear(Math.floor(p.getUTCFullYear()/1E3)*1E3);break}b.setTime(p.getTime()-
g)};SimileAjax.DateTime.roundUpToInterval=function(b,e,g,i,m){var p=b.getTime();SimileAjax.DateTime.roundDownToInterval(b,e,g,i,m);b.getTime()<p&&b.setTime(b.getTime()+SimileAjax.DateTime.gregorianUnitLengths[e]*i)};
SimileAjax.DateTime.incrementByInterval=function(b,e,g){g=typeof g=="undefined"?0:g;g=g*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];var i=new Date(b.getTime()+g);switch(e){case SimileAjax.DateTime.MILLISECOND:i.setTime(i.getTime()+1);break;case SimileAjax.DateTime.SECOND:i.setTime(i.getTime()+1E3);break;case SimileAjax.DateTime.MINUTE:i.setTime(i.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);break;case SimileAjax.DateTime.HOUR:i.setTime(i.getTime()+
SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]);break;case SimileAjax.DateTime.DAY:i.setUTCDate(i.getUTCDate()+1);break;case SimileAjax.DateTime.WEEK:i.setUTCDate(i.getUTCDate()+7);break;case SimileAjax.DateTime.MONTH:i.setUTCMonth(i.getUTCMonth()+1);break;case SimileAjax.DateTime.YEAR:i.setUTCFullYear(i.getUTCFullYear()+1);break;case SimileAjax.DateTime.DECADE:i.setUTCFullYear(i.getUTCFullYear()+10);break;case SimileAjax.DateTime.CENTURY:i.setUTCFullYear(i.getUTCFullYear()+100);
break;case SimileAjax.DateTime.MILLENNIUM:i.setUTCFullYear(i.getUTCFullYear()+1E3);break}b.setTime(i.getTime()-g)};SimileAjax.DateTime.removeTimeZoneOffset=function(b,e){return new Date(b.getTime()+e*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR])};SimileAjax.DateTime.getTimezone=function(){return(new Date).getTimezoneOffset()/-60};SimileAjax.Debug={silent:false};
SimileAjax.Debug.log=function(b){var e;e="console"in window&&"log"in window.console?function(g){console.log(g)}:function(g){SimileAjax.Debug.silent||alert(g)};SimileAjax.Debug.log=e;e(b)};SimileAjax.Debug.warn=function(b){var e;e="console"in window&&"warn"in window.console?function(g){console.warn(g)}:function(g){SimileAjax.Debug.silent||alert(g)};SimileAjax.Debug.warn=e;e(b)};
SimileAjax.Debug.exception=function(b,e){var g;g=SimileAjax.parseURLParameters().errors=="throw"||SimileAjax.params.errors=="throw"?function(i){throw i;}:"console"in window&&"error"in window.console?function(i,m){m!=null?console.error(m+" %o",i):console.error(i);throw i;}:function(i,m){SimileAjax.Debug.silent||alert("Caught exception: "+m+"\n\nDetails: "+("description"in i?i.description:i));throw i;};SimileAjax.Debug.exception=g;g(b,e)};
SimileAjax.Debug.objectToString=function(b){return SimileAjax.Debug._objectToString(b,"")};SimileAjax.Debug._objectToString=function(b,e){var g=e+" ";if(typeof b=="object"){var i="{";for(m in b)i+=g+m+": "+SimileAjax.Debug._objectToString(b[m],g)+"\n";i+=e+"}";return i}else if(typeof b=="array"){i="[";for(var m=0;m<b.length;m++)i+=SimileAjax.Debug._objectToString(b[m],g)+"\n";i+=e+"]";return i}else return b};SimileAjax.DOM={};
SimileAjax.DOM.registerEventWithObject=function(b,e,g,i){SimileAjax.DOM.registerEvent(b,e,function(m,p,x){return g[i].call(g,m,p,x)})};SimileAjax.DOM.registerEvent=function(b,e,g){var i=function(m){if(m=m?m:event?event:null){var p=m.target?m.target:m.srcElement?m.srcElement:null;if(p)p=p.nodeType==1||p.nodeType==9?p:p.parentNode;return g(b,m,p)}return true};SimileAjax.Platform.browser.isIE?b.attachEvent("on"+e,i):b.addEventListener(e,i,false)};
SimileAjax.DOM.getPageCoordinates=function(b){var e=0,g=0;if(b.nodeType!=1)b=b.parentNode;for(var i=b;i!=null;){e+=i.offsetLeft;g+=i.offsetTop;i=i.offsetParent}for(i=document.body;b!=null&&b!=i;){if("scrollLeft"in b){e-=b.scrollLeft;g-=b.scrollTop}b=b.parentNode}return{left:e,top:g}};SimileAjax.DOM.getSize=function(b){var e=this.getStyle(b,"width");b=this.getStyle(b,"height");if(e.indexOf("px")>-1)e=e.replace("px","");if(b.indexOf("px")>-1)b=b.replace("px","");return{w:e,h:b}};
SimileAjax.DOM.getStyle=function(b,e){return b.currentStyle?b.currentStyle[e]:window.getComputedStyle?document.defaultView.getComputedStyle(b,null).getPropertyValue(e):""};
SimileAjax.DOM.getEventRelativeCoordinates=function(b,e){if(SimileAjax.Platform.browser.isIE)if(b.type=="mousewheel"){var g=SimileAjax.DOM.getPageCoordinates(e);return{x:b.clientX-g.left,y:b.clientY-g.top}}else return{x:b.offsetX,y:b.offsetY};else{g=SimileAjax.DOM.getPageCoordinates(e);return b.type=="DOMMouseScroll"&&SimileAjax.Platform.browser.isFirefox&&SimileAjax.Platform.browser.majorVersion==2?{x:b.screenX-g.left,y:b.screenY-g.top}:{x:b.pageX-g.left,y:b.pageY-g.top}}};
SimileAjax.DOM.getEventPageCoordinates=function(b){return SimileAjax.Platform.browser.isIE?{x:b.clientX+document.body.scrollLeft,y:b.clientY+document.body.scrollTop}:{x:b.pageX,y:b.pageY}};SimileAjax.DOM.hittest=function(b,e,g){return SimileAjax.DOM._hittest(document.body,b,e,g)};
SimileAjax.DOM._hittest=function(b,e,g,i){var m=b.childNodes,p=0;a:for(;p<m.length;p++){for(var x=m[p],y=0;y<i.length;y++)if(x==i[y])continue a;if(x.offsetWidth==0&&x.offsetHeight==0){y=SimileAjax.DOM._hittest(x,e,g,i);if(y!=x)return y}else{for(var w=y=0,H=x;H;){y+=H.offsetTop;w+=H.offsetLeft;H=H.offsetParent}if(w<=e&&y<=g&&e-w<x.offsetWidth&&g-y<x.offsetHeight)return SimileAjax.DOM._hittest(x,e,g,i);else if(x.nodeType==1&&x.tagName=="TR"){y=SimileAjax.DOM._hittest(x,e,g,i);if(y!=x)return y}}}return b};
SimileAjax.DOM.cancelEvent=function(b){b.returnValue=false;b.cancelBubble=true;"preventDefault"in b&&b.preventDefault()};SimileAjax.DOM.appendClassName=function(b,e){for(var g=b.className.split(" "),i=0;i<g.length;i++)if(g[i]==e)return;g.push(e);b.className=g.join(" ")};SimileAjax.DOM.createInputElement=function(b){var e=document.createElement("div");e.innerHTML="<input type='"+b+"' />";return e.firstChild};
SimileAjax.DOM.createDOMFromTemplate=function(b){var e={};e.elmt=SimileAjax.DOM._createDOMFromTemplate(b,e,null);return e};
SimileAjax.DOM._createDOMFromTemplate=function(b,e,g){if(b==null)return null;else if(typeof b!="object"){b=document.createTextNode(b);g!=null&&g.appendChild(b);return b}else{var i=null;if("tag"in b){var m=b.tag;if(g!=null)if(m=="tr")i=g.insertRow(g.rows.length);else if(m=="td")i=g.insertCell(g.cells.length);if(i==null){i=m=="input"?SimileAjax.DOM.createInputElement(b.type):document.createElement(m);g!=null&&g.appendChild(i)}}else{i=b.elmt;g!=null&&g.appendChild(i)}for(var p in b){g=b[p];if(p=="field")e[g]=
i;else if(p=="className")i.className=g;else if(p=="id")i.id=g;else if(p=="title")i.title=g;else if(!(p=="type"&&i.tagName=="input"))if(p=="style")for(n in g){m=g[n];if(n=="float")n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat";i.style[n]=m}else if(p=="children")for(m=0;m<g.length;m++)SimileAjax.DOM._createDOMFromTemplate(g[m],e,i);else p!="tag"&&p!="elmt"&&i.setAttribute(p,g)}return i}};SimileAjax.DOM._cachedParent=null;
SimileAjax.DOM.createElementFromString=function(b){if(SimileAjax.DOM._cachedParent==null)SimileAjax.DOM._cachedParent=document.createElement("div");SimileAjax.DOM._cachedParent.innerHTML=b;return SimileAjax.DOM._cachedParent.firstChild};SimileAjax.DOM.createDOMFromString=function(b,e,g){b=typeof b=="string"?document.createElement(b):b;b.innerHTML=e;e={elmt:b};SimileAjax.DOM._processDOMChildrenConstructedFromString(e,b,g!=null?g:{});return e};
SimileAjax.DOM._processDOMConstructedFromString=function(b,e,g){var i=e.id;if(i!=null&&i.length>0){e.removeAttribute("id");if(i in g){var m=e.parentNode;m.insertBefore(g[i],e);m.removeChild(e);b[i]=g[i];return}else b[i]=e}e.hasChildNodes()&&SimileAjax.DOM._processDOMChildrenConstructedFromString(b,e,g)};SimileAjax.DOM._processDOMChildrenConstructedFromString=function(b,e,g){for(e=e.firstChild;e!=null;){var i=e.nextSibling;e.nodeType==1&&SimileAjax.DOM._processDOMConstructedFromString(b,e,g);e=i}};
SimileAjax.Graphics={};SimileAjax.Graphics.pngIsTranslucent=!SimileAjax.Platform.browser.isIE||SimileAjax.Platform.browser.majorVersion>6;SimileAjax.Graphics.pngIsTranslucent||SimileAjax.includeCssFile(document,SimileAjax.urlPrefix+"styles/graphics-ie6.css");SimileAjax.Graphics._createTranslucentImage1=function(b,e){var g=document.createElement("img");g.setAttribute("src",b);if(e!=null)g.style.verticalAlign=e;return g};
SimileAjax.Graphics._createTranslucentImage2=function(b,e){var g=document.createElement("img");g.style.width="1px";g.style.height="1px";g.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"', sizingMethod='image')";g.style.verticalAlign=e!=null?e:"middle";return g};SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2;
SimileAjax.Graphics._createTranslucentImageHTML1=function(b,e){return'<img src="'+b+'"'+(e!=null?' style="vertical-align: '+e+';"':"")+" />"};SimileAjax.Graphics._createTranslucentImageHTML2=function(b,e){return"<img src='"+b+"' style=\""+("width: 1px; height: 1px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"', sizingMethod='image');"+(e!=null?" vertical-align: "+e+";":""))+'" />'};
SimileAjax.Graphics.createTranslucentImageHTML=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImageHTML1:SimileAjax.Graphics._createTranslucentImageHTML2;SimileAjax.Graphics.setOpacity=function(b,e){if(SimileAjax.Platform.browser.isIE)b.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+e+")";else{var g=(e/100).toString();b.style.opacity=g;b.style.MozOpacity=g}};
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(b,e,g,i,m,p){if(typeof i!="number")i=300;if(typeof p!="number")p=0;b.style.position="absolute";b.style.left="-5000px";b.style.top="0px";b.style.width=i+"px";document.body.appendChild(b);window.setTimeout(function(){var x=b.scrollWidth+10,y=b.scrollHeight+10,w=0;if(p>0&&y>p){y=p;w=x-25}y=SimileAjax.Graphics.createBubbleForPoint(e,g,x,y,m);document.body.removeChild(b);b.style.position="static";b.style.left="";b.style.top="";if(w>0){x=document.createElement("div");
b.style.width="";x.style.width=w+"px";x.appendChild(b);y.content.appendChild(x)}else{b.style.width=x+"px";y.content.appendChild(b)}},200)};
SimileAjax.Graphics.createBubbleForPoint=function(b,e,g,i,m){g=parseInt(g,10);i=parseInt(i,10);var p=SimileAjax.Graphics.bubbleConfig,x=SimileAjax.Graphics.pngIsTranslucent?"pngTranslucent":"pngNotTranslucent",y=function(J){return J+" "+J+"-"+x},w=document.createElement("div");w.className=y(p.containerCSSClass);w.style.width=g+"px";w.style.height=i+"px";var H=document.createElement("div");H.className=y(p.innerContainerCSSClass);w.appendChild(H);var I={_closed:false},d=SimileAjax.WindowManager.pushLayer(function(){if(!I._closed){document.body.removeChild(I._div);
I._doc=null;I._div=null;I._content=null;I._closed=true}},true,w);I._div=w;I.close=function(){SimileAjax.WindowManager.popLayer(d)};var F=function(J){var K=document.createElement("div");K.className=y(p.borderGraphicCSSClassPrefix+J);H.appendChild(K)};F("top-left");F("top-right");F("bottom-left");F("bottom-right");F("left");F("right");F("top");F("bottom");F=document.createElement("div");F.className=y(p.contentContainerCSSClass);H.appendChild(F);I.content=F;F=document.createElement("div");F.className=
y(p.closeGraphicCSSClass);H.appendChild(F);SimileAjax.WindowManager.registerEventWithObject(F,"click",I,"close");(function(){var J=SimileAjax.Graphics.getWindowDimensions(),K=J.w,O=J.h;J=Math.ceil(p.arrowGraphicWidth/2);var T=function(Q){var U=document.createElement("div");U.className=y(p.arrowGraphicCSSClassPrefix+"point-"+Q);H.appendChild(U);return U};if(b-J-p.borderGraphicSize-p.extraPadding>0&&b+J+p.borderGraphicSize+p.extraPadding<K){var N=b-Math.round(g/2);N=b<K/2?Math.max(N,p.extraPadding+
p.borderGraphicSize):Math.min(N,K-p.extraPadding-p.borderGraphicSize-g);if(m&&m=="top"||!m&&e-p.arrowGraphicTargetOffset-i-p.borderGraphicSize-p.extraPadding>0){O=T("down");O.style.left=b-J-N+"px";w.style.left=N+"px";w.style.top=e-p.arrowGraphicTargetOffset-i+"px";return}else if(m&&m=="bottom"||!m&&e+p.arrowGraphicTargetOffset+i+p.borderGraphicSize+p.extraPadding<O){O=T("up");O.style.left=b-J-N+"px";w.style.left=N+"px";w.style.top=e+p.arrowGraphicTargetOffset+"px";return}}K=e-Math.round(i/2);K=e<
O/2?Math.max(K,p.extraPadding+p.borderGraphicSize):Math.min(K,O-p.extraPadding-p.borderGraphicSize-i);if(m&&m=="left"||!m&&b-p.arrowGraphicTargetOffset-g-p.borderGraphicSize-p.extraPadding>0){O=T("right");O.style.top=e-J-K+"px";w.style.top=K+"px";w.style.left=b-p.arrowGraphicTargetOffset-g+"px"}else{O=T("left");O.style.top=e-J-K+"px";w.style.top=K+"px";w.style.left=b+p.arrowGraphicTargetOffset+"px"}})();document.body.appendChild(w);return I};
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(b){var e=b.createElement("div");if(SimileAjax.Graphics.pngIsTranslucent){var g=b.createElement("div");g.style.height="33px";g.style.background="url("+SimileAjax.urlPrefix+"images/message-top-left.png) top left no-repeat";g.style.paddingLeft="44px";e.appendChild(g);var i=b.createElement("div");i.style.height="33px";i.style.background="url("+SimileAjax.urlPrefix+"images/message-top-right.png) top right no-repeat";g.appendChild(i);g=b.createElement("div");
g.style.background="url("+SimileAjax.urlPrefix+"images/message-left.png) top left repeat-y";g.style.paddingLeft="44px";e.appendChild(g);i=b.createElement("div");i.style.background="url("+SimileAjax.urlPrefix+"images/message-right.png) top right repeat-y";i.style.paddingRight="44px";g.appendChild(i);g=b.createElement("div");i.appendChild(g);i=b.createElement("div");i.style.height="55px";i.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat";i.style.paddingLeft=
"44px";e.appendChild(i);b=b.createElement("div");b.style.height="55px";b.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat";i.appendChild(b)}else{e.style.border="2px solid #7777AA";e.style.padding="20px";e.style.background="white";SimileAjax.Graphics.setOpacity(e,90);g=b.createElement("div");e.appendChild(g)}return{containerDiv:e,contentDiv:g}};
SimileAjax.Graphics.createAnimation=function(b,e,g,i,m){return new SimileAjax.Graphics._Animation(b,e,g,i,m)};SimileAjax.Graphics._Animation=function(b,e,g,i,m){this.f=b;this.cont=typeof m=="function"?m:function(){};this.from=e;this.to=g;this.current=e;this.duration=i;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=(-Math.cos(this.timePassed/this.duration*Math.PI)/2+0.5)*(this.to-this.from)+this.from;try{this.f(b,b-this.current)}catch(e){}this.current=b;if(this.timePassed<this.duration)this.run();else{this.f(this.to,0);this.cont()}};
SimileAjax.Graphics.createStructuredDataCopyButton=function(b,e,g,i){var m=document.createElement("div");m.style.position="relative";m.style.display="inline";m.style.width=e+"px";m.style.height=g+"px";m.style.overflow="hidden";m.style.margin="2px";if(SimileAjax.Graphics.pngIsTranslucent)m.style.background="url("+b+") no-repeat";else m.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"', sizingMethod='image')";m.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+
(SimileAjax.Platform.browser.isIE?"filter:alpha(opacity=0)":"opacity: 0")+"' />";var p=m.firstChild;p.style.width=e+"px";p.style.height=g+"px";p.onmousedown=function(x){x=x?x:event?event:null;if(x.button==2){p.value=i();p.select()}};return m};SimileAjax.Graphics.getWidthHeight=function(b){var e;if(b.getBoundingClientRect==null){e=b.offsetWidth;b=b.offsetHeight}else{b=b.getBoundingClientRect();e=Math.ceil(b.right-b.left);b=Math.ceil(b.bottom-b.top)}return{width:e,height:b}};
SimileAjax.Graphics.getFontRenderingContext=function(b,e){return new SimileAjax.Graphics._FontRenderingContext(b,e)};SimileAjax.Graphics._FontRenderingContext=function(b,e){this._elmt=b;this._elmt.style.visibility="hidden";if(typeof e=="string")this._elmt.style.width=e;else if(typeof e=="number")this._elmt.style.width=e+"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(b,e){var g=this._elmt;g.innerHTML=b;g.className=e===undefined?"":e;var i=SimileAjax.Graphics.getWidthHeight(g);g.className="";return i};SimileAjax.Graphics._FontRenderingContext.prototype.getLineHeight=function(){return this._lineHeight};
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(b){return SimileAjax.History._plainDocumentTitle+" {"+b+"}"};
SimileAjax.History.initialize=function(){if(!SimileAjax.History._initialized){if(SimileAjax.History.enabled){var b=document.createElement("iframe");b.id="simile-ajax-history";b.style.position="absolute";b.style.width="10px";b.style.height="10px";b.style.top="0px";b.style.left="0px";b.style.visibility="hidden";b.src=SimileAjax.History.historyFile+"?0";document.body.appendChild(b);SimileAjax.DOM.registerEvent(b,"load",SimileAjax.History._handleIFrameOnLoad);SimileAjax.History._iframe=b}SimileAjax.History._initialized=
true}};SimileAjax.History.addListener=function(b){SimileAjax.History.initialize();SimileAjax.History._listeners.add(b)};SimileAjax.History.removeListener=function(b){SimileAjax.History.initialize();SimileAjax.History._listeners.remove(b)};
SimileAjax.History.addAction=function(b){SimileAjax.History.initialize();SimileAjax.History._listeners.fire("onBeforePerform",[b]);window.setTimeout(function(){try{b.perform();SimileAjax.History._listeners.fire("onAfterPerform",[b]);if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex);SimileAjax.History._actions.push(b);SimileAjax.History._currentIndex++;var e=SimileAjax.History._actions.length-
SimileAjax.History.maxHistoryLength;if(e>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(e);SimileAjax.History._baseIndex+=e}try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex}catch(g){var i=SimileAjax.History.formatHistoryEntryTitle(b.label);document.title=i}}}catch(m){SimileAjax.Debug.exception(m,"Error adding action {"+b.label+"} to history")}},0)};
SimileAjax.History.addLengthyAction=function(b,e,g){SimileAjax.History.addAction({perform:b,undo:e,label:g,uiLayer:SimileAjax.WindowManager.getBaseLayer(),lengthy:true})};
SimileAjax.History._handleIFrameOnLoad=function(){try{var b=SimileAjax.History._iframe.contentWindow.location.search,e=b.length==0?0:Math.max(0,parseInt(b.substr(1))),g=function(){var x=e-SimileAjax.History._currentIndex;SimileAjax.History._currentIndex+=x;SimileAjax.History._baseIndex+=x;SimileAjax.History._iframe.contentWindow.location.search="?"+e};if(e<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]);window.setTimeout(function(){for(;SimileAjax.History._currentIndex>
e&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex;){SimileAjax.History._currentIndex--;var x=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{x.undo()}catch(y){SimileAjax.Debug.exception(y,"History: Failed to undo action {"+x.label+"}")}}SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]);g()},0)}else if(e>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]);window.setTimeout(function(){for(;SimileAjax.History._currentIndex<
e&&SimileAjax.History._currentIndex-SimileAjax.History._baseIndex<SimileAjax.History._actions.length;){var x=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{x.perform()}catch(y){SimileAjax.Debug.exception(y,"History: Failed to redo action {"+x.label+"}")}SimileAjax.History._currentIndex++}SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]);g()},0)}else{var i=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1,m=i>=0&&i<SimileAjax.History._actions.length?
SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[i].label):SimileAjax.History._plainDocumentTitle;SimileAjax.History._iframe.contentWindow.document.title=m;document.title=m}}catch(p){}};SimileAjax.History.getNextUndoAction=function(){try{return SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1]}catch(b){return null}};
SimileAjax.History.getNextRedoAction=function(){try{return SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex]}catch(b){return null}};SimileAjax.HTML={};SimileAjax.HTML._e2uHash={};
(function(){var b=SimileAjax.HTML._e2uHash;b.nbsp="\u00a0[space]";b.iexcl="\u00a1";b.cent="\u00a2";b.pound="\u00a3";b.curren="\u00a4";b.yen="\u00a5";b.brvbar="\u00a6";b.sect="\u00a7";b.uml="\u00a8";b.copy="\u00a9";b.ordf="\u00aa";b.laquo="\u00ab";b.not="\u00ac";b.shy="\u00ad";b.reg="\u00ae";b.macr="\u00af";b.deg="\u00b0";b.plusmn="\u00b1";b.sup2="\u00b2";b.sup3="\u00b3";b.acute="\u00b4";b.micro="\u00b5";b.para="\u00b6";b.middot="\u00b7";b.cedil="\u00b8";b.sup1="\u00b9";b.ordm="\u00ba";b.raquo="\u00bb";
b.frac14="\u00bc";b.frac12="\u00bd";b.frac34="\u00be";b.iquest="\u00bf";b.Agrave="\u00c0";b.Aacute="\u00c1";b.Acirc="\u00c2";b.Atilde="\u00c3";b.Auml="\u00c4";b.Aring="\u00c5";b.AElig="\u00c6";b.Ccedil="\u00c7";b.Egrave="\u00c8";b.Eacute="\u00c9";b.Ecirc="\u00ca";b.Euml="\u00cb";b.Igrave="\u00cc";b.Iacute="\u00cd";b.Icirc="\u00ce";b.Iuml="\u00cf";b.ETH="\u00d0";b.Ntilde="\u00d1";b.Ograve="\u00d2";b.Oacute="\u00d3";b.Ocirc="\u00d4";b.Otilde="\u00d5";b.Ouml="\u00d6";b.times="\u00d7";b.Oslash="\u00d8";
b.Ugrave="\u00d9";b.Uacute="\u00da";b.Ucirc="\u00db";b.Uuml="\u00dc";b.Yacute="\u00dd";b.THORN="\u00de";b.szlig="\u00df";b.agrave="\u00e0";b.aacute="\u00e1";b.acirc="\u00e2";b.atilde="\u00e3";b.auml="\u00e4";b.aring="\u00e5";b.aelig="\u00e6";b.ccedil="\u00e7";b.egrave="\u00e8";b.eacute="\u00e9";b.ecirc="\u00ea";b.euml="\u00eb";b.igrave="\u00ec";b.iacute="\u00ed";b.icirc="\u00ee";b.iuml="\u00ef";b.eth="\u00f0";b.ntilde="\u00f1";b.ograve="\u00f2";b.oacute="\u00f3";b.ocirc="\u00f4";b.otilde="\u00f5";
b.ouml="\u00f6";b.divide="\u00f7";b.oslash="\u00f8";b.ugrave="\u00f9";b.uacute="\u00fa";b.ucirc="\u00fb";b.uuml="\u00fc";b.yacute="\u00fd";b.thorn="\u00fe";b.yuml="\u00ff";b.quot='"';b.amp="&";b.lt="<";b.gt=">";b.OElig="";b.oelig="\u0153";b.Scaron="\u0160";b.scaron="\u0161";b.Yuml="\u0178";b.circ="\u02c6";b.tilde="\u02dc";b.ensp="\u2002";b.emsp="\u2003";b.thinsp="\u2009";b.zwnj="\u200c";b.zwj="\u200d";b.lrm="\u200e";b.rlm="\u200f";b.ndash="\u2013";b.mdash="\u2014";b.lsquo="\u2018";b.rsquo="\u2019";
b.sbquo="\u201a";b.ldquo="\u201c";b.rdquo="\u201d";b.bdquo="\u201e";b.dagger="\u2020";b.Dagger="\u2021";b.permil="\u2030";b.lsaquo="\u2039";b.rsaquo="\u203a";b.euro="\u20ac";b.fnof="\u0192";b.Alpha="\u0391";b.Beta="\u0392";b.Gamma="\u0393";b.Delta="\u0394";b.Epsilon="\u0395";b.Zeta="\u0396";b.Eta="\u0397";b.Theta="\u0398";b.Iota="\u0399";b.Kappa="\u039a";b.Lambda="\u039b";b.Mu="\u039c";b.Nu="\u039d";b.Xi="\u039e";b.Omicron="\u039f";b.Pi="\u03a0";b.Rho="\u03a1";b.Sigma="\u03a3";b.Tau="\u03a4";b.Upsilon=
"\u03a5";b.Phi="\u03a6";b.Chi="\u03a7";b.Psi="\u03a8";b.Omega="\u03a9";b.alpha="\u03b1";b.beta="\u03b2";b.gamma="\u03b3";b.delta="\u03b4";b.epsilon="\u03b5";b.zeta="\u03b6";b.eta="\u03b7";b.theta="\u03b8";b.iota="\u03b9";b.kappa="\u03ba";b.lambda="\u03bb";b.mu="\u03bc";b.nu="\u03bd";b.xi="\u03be";b.omicron="\u03bf";b.pi="\u03c0";b.rho="\u03c1";b.sigmaf="\u03c2";b.sigma="\u03c3";b.tau="\u03c4";b.upsilon="\u03c5";b.phi="\u03c6";b.chi="\u03c7";b.psi="\u03c8";b.omega="\u03c9";b.thetasym="\u03d1";b.upsih=
"\u03d2";b.piv="\u03d6";b.bull="\u2022";b.hellip="\u2026";b.prime="\u2032";b.Prime="\u2033";b.oline="\u203e";b.frasl="\u2044";b.weierp="\u2118";b.image="\u2111";b.real="\u211c";b.trade="\u2122";b.alefsym="\u2135";b.larr="\u2190";b.uarr="\u2191";b.rarr="\u2192";b.darr="\u2193";b.harr="\u2194";b.crarr="\u21b5";b.lArr="\u21d0";b.uArr="\u21d1";b.rArr="\u21d2";b.dArr="\u21d3";b.hArr="\u21d4";b.forall="\u2200";b.part="\u2202";b.exist="\u2203";b.empty="\u2205";b.nabla="\u2207";b.isin="\u2208";b.notin="\u2209";
b.ni="\u220b";b.prod="\u220f";b.sum="\u2211";b.minus="\u2212";b.lowast="\u2217";b.radic="\u221a";b.prop="\u221d";b.infin="\u221e";b.ang="\u2220";b.and="\u2227";b.or="\u2228";b.cap="\u2229";b.cup="\u222a";b["int"]="\u222b";b.there4="\u2234";b.sim="\u223c";b.cong="\u2245";b.asymp="\u2248";b.ne="\u2260";b.equiv="\u2261";b.le="\u2264";b.ge="\u2265";b.sub="\u2282";b.sup="\u2283";b.nsub="\u2284";b.sube="\u2286";b.supe="\u2287";b.oplus="\u2295";b.otimes="\u2297";b.perp="\u22a5";b.sdot="\u22c5";b.lceil="\u2308";
b.rceil="\u2309";b.lfloor="\u230a";b.rfloor="\u230b";b.lang="\u2329";b.rang="\u232a";b.loz="\u25ca";b.spades="\u2660";b.clubs="\u2663";b.hearts="\u2665";b.diams="\u2666"})();SimileAjax.HTML.deEntify=function(b){for(var e=SimileAjax.HTML._e2uHash,g=/&(\w+?);/;g.test(b);){var i=b.match(g);b=b.replace(g,e[i[1]])}return b};SimileAjax.JSON={};
(function(){var b={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},e={array:function(g){var i=["["],m,p,x,y=g.length,w;for(x=0;x<y;x+=1){w=g[x];if(p=e[typeof w]){w=p(w);if(typeof w=="string"){if(m)i[i.length]=",";i[i.length]=w;m=true}}}i[i.length]="]";return i.join("")},"boolean":function(g){return String(g)},"null":function(){return"null"},number:function(g){return isFinite(g)?String(g):"null"},object:function(g){if(g){if(g instanceof Array)return e.array(g);
var i=["{"],m,p,x,y;for(x in g){y=g[x];if(p=e[typeof y]){y=p(y);if(typeof y=="string"){if(m)i[i.length]=",";i.push(e.string(x),":",y);m=true}}}i[i.length]="}";return i.join("")}return"null"},string:function(g){if(/["\\\x00-\x1f]/.test(g))g=g.replace(/([\x00-\x1f\\"])/g,function(i,m){var p=b[m];if(p)return p;p=m.charCodeAt();return"\\u00"+Math.floor(p/16).toString(16)+(p%16).toString(16)});return'"'+g+'"'}};SimileAjax.JSON.toJSONString=function(g){return g instanceof Object?e.object(g):g instanceof
Array?e.array(g):g.toString()};SimileAjax.JSON.parseJSON=function(){try{return!/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,""))&&eval("("+this+")")}catch(g){return false}}})();String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.startsWith=function(b){return this.length>=b.length&&this.substr(0,b.length)==b};String.prototype.endsWith=function(b){return this.length>=b.length&&this.substr(this.length-b.length)==b};
String.substitute=function(b,e){for(var g="",i=0;i<b.length-1;){var m=b.indexOf("%",i);if(m<0||m==b.length-1)break;else if(m>i&&b.charAt(m-1)=="\\"){g+=b.substring(i,m-1)+"%";i=m+1}else{var p=parseInt(b.charAt(m+1));g+=isNaN(p)||p>=e.length?b.substring(i,m+2):b.substring(i,m)+e[p].toString();i=m+2}}if(i<b.length)g+=b.substring(i);return g};SimileAjax.NativeDateUnit={};SimileAjax.NativeDateUnit.makeDefaultValue=function(){return new Date};SimileAjax.NativeDateUnit.cloneValue=function(b){return new Date(b.getTime())};
SimileAjax.NativeDateUnit.getParser=function(b){if(typeof b=="string")b=b.toLowerCase();return b=="iso8601"||b=="iso 8601"?SimileAjax.DateTime.parseIso8601DateTime:SimileAjax.DateTime.parseGregorianDateTime};SimileAjax.NativeDateUnit.parseFromObject=function(b){return SimileAjax.DateTime.parseGregorianDateTime(b)};SimileAjax.NativeDateUnit.toNumber=function(b){return b.getTime()};SimileAjax.NativeDateUnit.fromNumber=function(b){return new Date(b)};
SimileAjax.NativeDateUnit.compare=function(b,e){var g,i;g=typeof b=="object"?b.getTime():Number(b);i=typeof e=="object"?e.getTime():Number(e);return g-i};SimileAjax.NativeDateUnit.earlier=function(b,e){return SimileAjax.NativeDateUnit.compare(b,e)<0?b:e};SimileAjax.NativeDateUnit.later=function(b,e){return SimileAjax.NativeDateUnit.compare(b,e)>0?b:e};SimileAjax.NativeDateUnit.change=function(b,e){return new Date(b.getTime()+e)};
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){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(b,e,g,i,m){SimileAjax.WindowManager.registerEvent(b,e,function(p,x,y){return g[i].call(g,p,x,y)},m)};
SimileAjax.WindowManager.registerEvent=function(b,e,g,i){if(i==null)i=SimileAjax.WindowManager.getHighestLayer();SimileAjax.DOM.registerEvent(b,e,function(m,p,x){if(SimileAjax.WindowManager._canProcessEventAtLayer(i)){SimileAjax.WindowManager._popToLayer(i.index);try{g(m,p,x)}catch(y){SimileAjax.Debug.exception(y)}}SimileAjax.DOM.cancelEvent(p);return false})};
SimileAjax.WindowManager.pushLayer=function(b,e,g){b={onPop:b,index:SimileAjax.WindowManager._layers.length,ephemeral:e,elmt:g};SimileAjax.WindowManager._layers.push(b);return b};SimileAjax.WindowManager.popLayer=function(b){for(var e=1;e<SimileAjax.WindowManager._layers.length;e++)if(SimileAjax.WindowManager._layers[e]==b){SimileAjax.WindowManager._popToLayer(e-1);break}};SimileAjax.WindowManager.popAllLayers=function(){SimileAjax.WindowManager._popToLayer(0)};
SimileAjax.WindowManager.registerForDragging=function(b,e,g){SimileAjax.WindowManager.registerEvent(b,"mousedown",function(i,m){SimileAjax.WindowManager._handleMouseDown(i,m,e)},g)};SimileAjax.WindowManager._popToLayer=function(b){for(;b+1<SimileAjax.WindowManager._layers.length;)try{var e=SimileAjax.WindowManager._layers.pop();e.onPop!=null&&e.onPop()}catch(g){}};
SimileAjax.WindowManager._canProcessEventAtLayer=function(b){if(b.index==SimileAjax.WindowManager._layers.length-1)return true;for(b=b.index+1;b<SimileAjax.WindowManager._layers.length;b++)if(!SimileAjax.WindowManager._layers[b].ephemeral)return false;return true};
SimileAjax.WindowManager.cancelPopups=function(b){b=b?SimileAjax.DOM.getEventPageCoordinates(b):{x:-1,y:-1};for(var e=SimileAjax.WindowManager._layers.length-1;e>0&&SimileAjax.WindowManager._layers[e].ephemeral;){var g=SimileAjax.WindowManager._layers[e];if(g.elmt!=null){g=g.elmt;var i=SimileAjax.DOM.getPageCoordinates(g);if(b.x>=i.left&&b.x<i.left+g.offsetWidth&&b.y>=i.top&&b.y<i.top+g.offsetHeight)break}e--}SimileAjax.WindowManager._popToLayer(e)};
SimileAjax.WindowManager._onBodyMouseDown=function(b,e){if(!("eventPhase"in e)||e.eventPhase==e.BUBBLING_PHASE)SimileAjax.WindowManager.cancelPopups(e)};SimileAjax.WindowManager._handleMouseDown=function(b,e,g){SimileAjax.WindowManager._draggedElement=b;SimileAjax.WindowManager._draggedElementCallback=g;SimileAjax.WindowManager._lastCoords={x:e.clientX,y:e.clientY};SimileAjax.DOM.cancelEvent(e);return false};
SimileAjax.WindowManager._onBodyKeyDown=function(b,e){if(SimileAjax.WindowManager._dragging)if(e.keyCode==27)SimileAjax.WindowManager._cancelDragging();else if((e.keyCode==17||e.keyCode==16)&&SimileAjax.WindowManager._draggingMode!="copy"){SimileAjax.WindowManager._draggingMode="copy";var g=SimileAjax.Graphics.createTranslucentImage(SimileAjax.urlPrefix+"images/copy.png");g.style.position="absolute";g.style.left=SimileAjax.WindowManager._ghostCoords.left-16+"px";g.style.top=SimileAjax.WindowManager._ghostCoords.top+
"px";document.body.appendChild(g);SimileAjax.WindowManager._draggingModeIndicatorElmt=g}};SimileAjax.WindowManager._onBodyKeyUp=function(b,e){if(SimileAjax.WindowManager._dragging)if(e.keyCode==17||e.keyCode==16){SimileAjax.WindowManager._draggingMode="";if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);SimileAjax.WindowManager._draggingModeIndicatorElmt=null}}};
SimileAjax.WindowManager._onBodyMouseMove=function(b,e,g){if(SimileAjax.WindowManager._draggedElement!=null){b=SimileAjax.WindowManager._draggedElementCallback;var i=SimileAjax.WindowManager._lastCoords,m=e.clientX-i.x;i=e.clientY-i.y;if(SimileAjax.WindowManager._dragging)try{SimileAjax.WindowManager._lastCoords={x:e.clientX,y:e.clientY};"onDragBy"in b&&b.onDragBy(m,i);if("_ghostElmt"in b){d=b._ghostElmt;SimileAjax.WindowManager._ghostCoords.left+=m;SimileAjax.WindowManager._ghostCoords.top+=i;d.style.left=
SimileAjax.WindowManager._ghostCoords.left+"px";d.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){var p=SimileAjax.WindowManager._draggingModeIndicatorElmt;p.style.left=SimileAjax.WindowManager._ghostCoords.left-16+"px";p.style.top=SimileAjax.WindowManager._ghostCoords.top+"px"}if("droppable"in b&&b.droppable){var x=SimileAjax.DOM.getEventPageCoordinates(e);g=SimileAjax.DOM.hittest(x.x,x.y,[SimileAjax.WindowManager._ghostElmt,
SimileAjax.WindowManager._dropTargetHighlightElement]);g=SimileAjax.WindowManager._findDropTarget(g);if(g!=SimileAjax.WindowManager._potentialDropTarget){if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);SimileAjax.WindowManager._dropTargetHighlightElement=null;SimileAjax.WindowManager._potentialDropTarget=null}p=false;if(g!=null)if((!("canDropOn"in b)||b.canDropOn(g))&&(!("canDrop"in g)||g.canDrop(SimileAjax.WindowManager._draggedElement)))p=
true;if(p){var y=SimileAjax.DOM.getPageCoordinates(g),w=document.createElement("div");w.style.border="4px solid yellow";w.style.backgroundColor="yellow";w.style.position="absolute";w.style.left=y.left+"px";w.style.top=y.top+"px";w.style.width=g.offsetWidth-8+"px";w.style.height=g.offsetHeight-8+"px";SimileAjax.Graphics.setOpacity(w,30);document.body.appendChild(w);SimileAjax.WindowManager._potentialDropTarget=g;SimileAjax.WindowManager._dropTargetHighlightElement=w}}}}}catch(H){SimileAjax.Debug.exception("WindowManager: Error handling mouse move",
H);SimileAjax.WindowManager._cancelDragging()}else if(Math.abs(m)>5||Math.abs(i)>5)try{"onDragStart"in b&&b.onDragStart();if("ghost"in b&&b.ghost){var I=SimileAjax.WindowManager._draggedElement;SimileAjax.WindowManager._ghostCoords=SimileAjax.DOM.getPageCoordinates(I);SimileAjax.WindowManager._ghostCoords.left+=m;SimileAjax.WindowManager._ghostCoords.top+=i;var d=I.cloneNode(true);d.style.position="absolute";d.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";d.style.top=SimileAjax.WindowManager._ghostCoords.top+
"px";d.style.zIndex=1E3;SimileAjax.Graphics.setOpacity(d,50);document.body.appendChild(d);b._ghostElmt=d}SimileAjax.WindowManager._dragging=true;SimileAjax.WindowManager._lastCoords={x:e.clientX,y:e.clientY};document.body.focus()}catch(F){SimileAjax.Debug.exception("WindowManager: Error handling mouse down",F);SimileAjax.WindowManager._cancelDragging()}SimileAjax.DOM.cancelEvent(e);return false}};
SimileAjax.WindowManager._onBodyMouseUp=function(b,e,g){if(SimileAjax.WindowManager._draggedElement!=null){try{if(SimileAjax.WindowManager._dragging){var i=SimileAjax.WindowManager._draggedElementCallback;"onDragEnd"in i&&i.onDragEnd();if("droppable"in i&&i.droppable){g=SimileAjax.WindowManager._potentialDropTarget;if(g!=null)if((!("canDropOn"in i)||i.canDropOn(g))&&(!("canDrop"in g)||g.canDrop(SimileAjax.WindowManager._draggedElement))){"onDropOn"in i&&i.onDropOn(g);g.ondrop(SimileAjax.WindowManager._draggedElement,
SimileAjax.WindowManager._draggingMode)}}}}finally{SimileAjax.WindowManager._cancelDragging()}SimileAjax.DOM.cancelEvent(e);return false}};
SimileAjax.WindowManager._cancelDragging=function(){var b=SimileAjax.WindowManager._draggedElementCallback;if("_ghostElmt"in b){document.body.removeChild(b._ghostElmt);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(b){for(;b!=null;){if("ondrop"in b&&typeof b.ondrop=="function")break;b=b.parentNode}return b};SimileAjax.XmlHttp={};SimileAjax.XmlHttp._onReadyStateChange=function(b,e,g){switch(b.readyState){case 4:try{if(b.status==0||b.status==200)g&&g(b);else e&&e(b.statusText,b.status,b)}catch(i){SimileAjax.Debug.exception("XmlHttp: Error handling onReadyStateChange",i)}break}};
SimileAjax.XmlHttp._createRequest=function(){if(SimileAjax.Platform.browser.isIE)for(var b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],e=0;e<b.length;e++)try{var g=b[e],i=function(){return new ActiveXObject(g)},m=i();SimileAjax.XmlHttp._createRequest=i;return m}catch(p){}try{i=function(){return new XMLHttpRequest};m=i();SimileAjax.XmlHttp._createRequest=i;return m}catch(x){throw Error("Failed to create an XMLHttpRequest object");}};
SimileAjax.XmlHttp.get=function(b,e,g){var i=SimileAjax.XmlHttp._createRequest();i.open("GET",b,true);i.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(i,e,g)};i.send(null)};SimileAjax.XmlHttp.post=function(b,e,g,i){var m=SimileAjax.XmlHttp._createRequest();m.open("POST",b,true);m.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(m,g,i)};m.send(e)};
SimileAjax.XmlHttp._forceXML=function(b){try{b.overrideMimeType("text/xml")}catch(e){b.setrequestheader("Content-Type","text/xml")}};loadMe();
Timeline._Band=function(a,b,c){if(a.autoWidth&&typeof b.width=="string")b.width=b.width.indexOf("%")>-1?0:parseInt(b.width);this._timeline=a;this._bandInfo=b;this._index=c;this._locale="locale"in b?b.locale:Timeline.getDefaultLocale();this._timeZone="timeZone"in b?b.timeZone:0;this._labeller="labeller"in b?b.labeller:"createLabeller"in a.getUnit()?a.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone);this._theme=b.theme;this._zoomIndex=
"zoomIndex"in b?b.zoomIndex:0;this._zoomSteps="zoomSteps"in b?b.zoomSteps:null;this._changing=this._dragging=false;this._scrollSpeed=this._originalScrollSpeed=5;this._onScrollListeners=[];this._orthogonalDragging=false;this._viewOrthogonalOffset=0;this._onOrthogonalScrollListeners=[];var d=this;this._syncWithBand=null;this._syncWithBandHandler=function(){d._onHighlightBandScroll()};this._syncWithBandOrthogonalScrollHandler=function(){d._onHighlightBandOrthogonalScroll()};this._selectorListener=function(){d._onHighlightBandScroll()};
var g=this._timeline.getDocument().createElement("div");g.className="timeline-band-input";this._timeline.addDiv(g);this._keyboardInput=document.createElement("input");this._keyboardInput.type="text";g.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,"dblclick",this,"_onDblClick");SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown");SimileAjax.DOM.registerEventWithObject(document.body,"mousemove",this,"_onMouseMove");SimileAjax.DOM.registerEventWithObject(document.body,"mouseup",this,"_onMouseUp");SimileAjax.DOM.registerEventWithObject(document.body,"mouseout",this,"_onMouseOut");g=this._theme!=null?this._theme.mouseWheel:
"scroll";if(g==="zoom"||g==="scroll"||this._zoomSteps)SimileAjax.Platform.browser.isFirefox?SimileAjax.DOM.registerEventWithObject(this._div,"DOMMouseScroll",this,"_onMouseScroll"):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=b.ether;b.ether.initialize(this,a);this._etherPainter=b.etherPainter;b.etherPainter.initialize(this,
a);if(this._eventSource=b.eventSource){this._eventListener={onAddMany:function(){d._onAddMany()},onClear:function(){d._onClear()}};this._eventSource.addListener(this._eventListener)}this._eventPainter=b.eventPainter;this._eventTrackIncrement=this._eventTracksNeeded=0;b.eventPainter.initialize(this,a);this._decorators="decorators"in b?b.decorators:[];for(b=0;b<this._decorators.length;b++)this._decorators[b].initialize(this,a);if(this._supportsOrthogonalScrolling="supportsOrthogonalScrolling"in this._eventPainter&&
this._eventPainter.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>';a=this._scrollBar.firstChild;a.style.cursor=SimileAjax.Platform.browser.isIE?"move":"-moz-grab";SimileAjax.DOM.registerEventWithObject(a,"mousedown",this,"_onScrollBarMouseDown")}};
Timeline._Band.SCROLL_MULTIPLES=5;
Timeline._Band.prototype.dispose=function(){this.closeBubble();if(this._eventSource){this._eventSource.removeListener(this._eventListener);this._eventSource=this._eventListener=null}this._scrollBar=this._keyboardInput=this._innerDiv=this._div=this._selectorListener=this._syncWithBandOrthogonalScrollHandler=this._syncWithBandHandler=this._onScrollListeners=this._decorators=this._eventPainter=this._etherPainter=this._ether=this._labeller=this._bandInfo=this._timeline=null};
Timeline._Band.prototype.addOnScrollListener=function(a){this._onScrollListeners.push(a)};Timeline._Band.prototype.removeOnScrollListener=function(a){for(var b=0;b<this._onScrollListeners.length;b++)if(this._onScrollListeners[b]==a){this._onScrollListeners.splice(b,1);break}};Timeline._Band.prototype.addOnOrthogonalScrollListener=function(a){this._onOrthogonalScrollListeners.push(a)};
Timeline._Band.prototype.removeOnOrthogonalScrollListener=function(a){for(var b=0;b<this._onOrthogonalScrollListeners.length;b++)if(this._onOrthogonalScrollListeners[b]==a){this._onOrthogonalScrollListeners.splice(b,1);break}};
Timeline._Band.prototype.setSyncWithBand=function(a,b){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler);this._syncWithBand.removeOnOrthogonalScrollListener(this._syncWithBandOrthogonalScrollHandler)}this._syncWithBand=a;this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);this._syncWithBand.addOnOrthogonalScrollListener(this._syncWithBandOrthogonalScrollHandler);this._highlight=b;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(a,b){this._eventTrackIncrement=b;if(a>this._eventTracksNeeded)this._eventTracksNeeded=a};
Timeline._Band.prototype.checkAutoWidth=function(){if(this._timeline.autoWidth){var a=this._eventPainter.getType()=="overview",b=Math.ceil((this._eventTracksNeeded+(a?this._theme.event.overviewTrack.autoWidthMargin:this._theme.event.track.autoWidthMargin))*this._eventTrackIncrement);b+=a?this._theme.event.overviewTrack.offset:this._theme.event.track.offset;a=this._bandInfo;if(b!=a.width)a.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,b){var c=this._keyboardInput.parentNode,d=a+Math.floor(b/2);if(this._timeline.isHorizontal()){this._div.style.top=a+"px";this._div.style.height=b+"px";c.style.top=d+"px";c.style.left="-1em"}else{this._div.style.left=a+"px";this._div.style.width=b+"px";c.style.left=d+"px";c.style.top="-1em"}};Timeline._Band.prototype.getViewWidth=function(){return this._timeline.isHorizontal()?this._div.offsetHeight: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){this._changing||this._moveEther(Math.round(-this._ether.dateToPixelOffset(a)))};Timeline._Band.prototype.setMaxVisibleDate=function(a){this._changing||this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(a)))};
Timeline._Band.prototype.setCenterVisibleDate=function(a){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(a,b){var c=this._timeline.getDocument().createElement("div");c.className="timeline-band-layer"+(typeof b=="string"?" "+b:"");c.style.zIndex=a;this._innerDiv.appendChild(c);var d=this._timeline.getDocument().createElement("div");d.className="timeline-band-layer-inner";d.style.cursor=SimileAjax.Platform.browser.isIE?"move":"-moz-grab";c.appendChild(d);return d};Timeline._Band.prototype.removeLayerDiv=function(a){this._innerDiv.removeChild(a.parentNode)};
Timeline._Band.prototype.scrollToCenter=function(a,b){var c=this._ether.dateToPixelOffset(a);if(c<-this._viewLength/2)this.setCenterVisibleDate(this.pixelOffsetToDate(c+this._viewLength));else c>3*this._viewLength/2&&this.setCenterVisibleDate(this.pixelOffsetToDate(c-this._viewLength));this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(a)),b)};
Timeline._Band.prototype.showBubbleForEvent=function(a){var b=this.getEventSource().getEvent(a);if(b){var c=this;this.scrollToCenter(b.getStart(),function(){c._eventPainter.showBubble(b)})}};Timeline._Band.prototype.zoom=function(a,b){if(this._zoomSteps){b+=this._viewOffset;var c=this._ether.pixelOffsetToDate(b);this._etherPainter.zoom(this._ether.zoom(a));this._moveEther(Math.round(-this._ether.dateToPixelOffset(c)));this._moveEther(b)}};
Timeline._Band.prototype._onMouseDown=function(a,b){if(!this._dragging){this.closeBubble();this._dragging=true;this._dragX=b.clientX;this._dragY=b.clientY;return this._cancelEvent(b)}};
Timeline._Band.prototype._onMouseMove=function(a,b){if(this._dragging||this._orthogonalDragging){var c=b.clientX-this._dragX,d=b.clientY-this._dragY;this._dragX=b.clientX;this._dragY=b.clientY}if(this._dragging)this._timeline.isHorizontal()?this._moveEther(c,d):this._moveEther(d,c);else if(this._orthogonalDragging){var g=this.getViewWidth(),e=this._scrollBar.firstChild;this._timeline.isHorizontal()?this._moveEther(0,-d*g/e.offsetHeight):this._moveEther(0,-c*g/e.offsetWidth)}else return;this._positionHighlight();
this._showScrollbar();return this._cancelEvent(b)};Timeline._Band.prototype._onMouseUp=function(a,b){if(this._dragging)this._dragging=false;else if(this._orthogonalDragging)this._orthogonalDragging=false;else return;this._keyboardInput.focus();this._bounceBack();return this._cancelEvent(b)};Timeline._Band.prototype._onMouseOut=function(a,b,c){if(c==document.body){if(this._dragging)this._dragging=false;else if(this._orthogonalDragging)this._orthogonalDragging=false;else return;this._bounceBack();return this._cancelEvent(b)}};
Timeline._Band.prototype._onScrollBarMouseDown=function(a,b){if(!this._orthogonalDragging){this.closeBubble();this._orthogonalDragging=true;this._dragX=b.clientX;this._dragY=b.clientY;return this._cancelEvent(b)}};
Timeline._Band.prototype._onMouseScroll=function(a,b){var c=new Date;c=c.getTime();if(!this._lastScrollTime||c-this._lastScrollTime>50){this._lastScrollTime=c;c=0;if(b.wheelDelta)c=b.wheelDelta/120;else if(b.detail)c=-b.detail/3;var d=this._theme.mouseWheel;if(this._zoomSteps||d==="zoom"){d=SimileAjax.DOM.getEventRelativeCoordinates(b,a);if(c!=0){var g;if(c>0)g=true;if(c<0)g=false;this._timeline.zoom(g,d.x,d.y,a)}}else if(d==="scroll")this._moveEther(50*(c<0?-1:1))}b.stopPropagation&&b.stopPropagation();
b.cancelBubble=true;b.preventDefault&&b.preventDefault();b.returnValue=false};Timeline._Band.prototype._onDblClick=function(a,b){this._autoScroll(-(SimileAjax.DOM.getEventRelativeCoordinates(b,a).x-(this._viewLength/2-this._viewOffset)))};
Timeline._Band.prototype._onKeyDown=function(a,b){if(!this._dragging){switch(b.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(b);return false}return true};
Timeline._Band.prototype._onKeyUp=function(a,b){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed;switch(b.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(b);return false}return true};
Timeline._Band.prototype._autoScroll=function(a,b){var c=this;SimileAjax.Graphics.createAnimation(function(d,g){c._moveEther(g)},0,a,1E3,b).run()};
Timeline._Band.prototype._moveEther=function(a,b){if(b===undefined)b=0;this.closeBubble();if(this._timeline.shiftOK(this._index,a)){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._eventPainter.getOrthogonalExtent()<=this.getViewWidth()?0:this._viewOrthogonalOffset+b;this._viewOffset>-this._viewLength*0.5||this._viewOffset<
-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)?this._recenterDiv():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(){this._syncWithBand&&this._syncWithBand.setCenterVisibleDate(this._ether.pixelOffsetToDate(this.getViewLength()/2))};
Timeline._Band.prototype._onHighlightBandScroll=function(){if(this._syncWithBand){var a=this._ether.dateToPixelOffset(this._syncWithBand.getCenterVisibleDate());this._moveEther(Math.round(this._viewLength/2-a));this._positionHighlight()}};Timeline._Band.prototype._onHighlightBandOrthogonalScroll=function(){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 a=this._syncWithBand.getMinVisibleDate(),b=this._syncWithBand.getMaxVisibleDate();if(this._highlight){var c=0,d=1,g=this._syncWithBand.getEventPainter();if("supportsOrthogonalScrolling"in g&&g.supportsOrthogonalScrolling()){c=g.getOrthogonalExtent();d=this._syncWithBand.getViewWidth();c=Math.max(d,c);d=d/c;c=-this._syncWithBand.getViewOrthogonalOffset()/c}this._etherPainter.setHighlight(a,b,c,d)}}};
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(){if(this._supportsOrthogonalScrolling){var a=0;if(this._viewOrthogonalOffset<0){a=this._eventPainter.getOrthogonalExtent();a=this._viewOrthogonalOffset+a>=this.getViewWidth()?this._viewOrthogonalOffset:Math.min(0,this.getViewWidth()-a)}if(a!=this._viewOrthogonalOffset){var b=this;SimileAjax.Graphics.createAnimation(function(c){b._viewOrthogonalOffset=c;b._eventPainter.softPaint();b._showScrollbar();b._fireOnOrthogonalScroll()},this._viewOrthogonalOffset,
a,300,function(){b._hideScrollbar()}).run()}else this._hideScrollbar()}};
Timeline._Band.prototype._showScrollbar=function(){if(this._supportsOrthogonalScrolling){var a=this._eventPainter.getOrthogonalExtent(),b=this.getViewWidth();a=b/Math.max(b,a);b=Math.round(b*a)+"px";var c=Math.round(-this._viewOrthogonalOffset*a)+"px",d=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="12px";d.style.top=c;d.style.height=
b}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="12px";d.style.left=c;d.style.width=b}this._scrollBar.style.display=a>=1&&this._viewOrthogonalOffset==0?"none":"block"}};Timeline._Band.prototype._hideScrollbar=function(){};Timeline._Band.prototype._cancelEvent=function(a){SimileAjax.DOM.cancelEvent(a);return false};
Timeline.CompactEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._frc=this._highlightMatcher=this._filterMatcher=null;this._eventIdToElmt={}};Timeline.CompactEventPainter.prototype.getType=function(){return"compact"};Timeline.CompactEventPainter.prototype.initialize=function(a,b){this._band=a;this._timeline=b;this._eventIdToElmt=this._highlightLayer=this._lineLayer=this._eventLayer=this._backLayer=null};Timeline.CompactEventPainter.prototype.supportsOrthogonalScrolling=function(){return true};
Timeline.CompactEventPainter.prototype.addOnSelectListener=function(a){this._onSelectListeners.push(a)};Timeline.CompactEventPainter.prototype.removeOnSelectListener=function(a){for(var b=0;b<this._onSelectListeners.length;b++)if(this._onSelectListeners[b]==a){this._onSelectListeners.splice(b,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 a=this._band.getEventSource();if(a!=null){this._eventIdToElmt={};this._prepareForPainting();var b=this._computeMetrics(),c=this._band.getMinDate(),d=this._band.getMaxDate(),g=this._filterMatcher!=null?this._filterMatcher:function(){return true},e=this._highlightMatcher!=null?this._highlightMatcher:function(){return-1};d=a.getEventIterator(c,d);a="stackConcurrentPreciseInstantEvents"in this._params&&typeof this._params.stackConcurrentPreciseInstantEvents==
"object";if("collapseConcurrentPreciseInstantEvents"in this._params&&this._params.collapseConcurrentPreciseInstantEvents||a){c=[];for(var f=null;d.hasNext();){var h=d.next();if(g(h))if(!h.isInstant()||h.isImprecise())this.paintEvent(h,b,this._params.theme,e(h));else if(f!=null&&f.getStart().getTime()==h.getStart().getTime())c[c.length-1].push(h);else{c.push([h]);f=h}}for(g=0;g<c.length;g++){d=c[g];if(d.length==1)this.paintEvent(d[0],b,this._params.theme,e(h));else{f=-1;for(var i=0;f<0&&i<d.length;i++)f=
e(d[i]);a?this.paintStackedPreciseInstantEvents(d,b,this._params.theme,f):this.paintCompositePreciseInstantEvents(d,b,this._params.theme,f)}}}else for(;d.hasNext();){h=d.next();g(h)&&this.paintEvent(h,b,this._params.theme,e(h))}this._highlightLayer.style.display="block";this._lineLayer.style.display="block";this._eventLayer.style.display="block";this._setOrthogonalOffset(b)}};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(){this._highlightLayer.style.top=this._lineLayer.style.top=this._eventLayer.style.top=this._band.getViewOrthogonalOffset()+"px"};
Timeline.CompactEventPainter.prototype._computeMetrics=function(){var a=this._params.theme,b=a.event;a={trackOffset:"trackOffset"in this._params?this._params.trackOffset:10,trackHeight:"trackHeight"in this._params?this._params.trackHeight:10,tapeHeight:a.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:b.instant.icon,defaultIconWidth:b.instant.iconWidth,defaultIconHeight:b.instant.iconHeight,customIconWidth:"iconWidth"in this._params?this._params.iconWidth:b.instant.iconWidth,customIconHeight:"iconHeight"in this._params?this._params.iconHeight:b.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="stackConcurrentPreciseInstantEvents"in this._params&&"icon"in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.icon:a.defaultIcon;a.defaultStackIconWidth="stackConcurrentPreciseInstantEvents"in
this._params&&"iconWidth"in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.iconWidth:a.defaultIconWidth;a.defaultStackIconHeight="stackConcurrentPreciseInstantEvents"in this._params&&"iconHeight"in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.iconHeight:a.defaultIconHeight;return a};
Timeline.CompactEventPainter.prototype._prepareForPainting=function(){var a=this._band;if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");this._backLayer.style.visibility="hidden";var b=document.createElement("span");b.className="timeline-event-label";this._backLayer.appendChild(b);this._frc=SimileAjax.Graphics.getFontRenderingContext(b)}this._frc.update();this._tracks=[];this._highlightLayer!=null&&a.removeLayerDiv(this._highlightLayer);this._highlightLayer=
a.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";this._lineLayer!=null&&a.removeLayerDiv(this._lineLayer);this._lineLayer=a.createLayerDiv(110,"timeline-band-lines");this._lineLayer.style.display="none";this._eventLayer!=null&&a.removeLayerDiv(this._eventLayer);this._eventLayer=a.createLayerDiv(115,"timeline-band-events");this._eventLayer.style.display="none"};
Timeline.CompactEventPainter.prototype.paintEvent=function(a,b,c,d){a.isInstant()?this.paintInstantEvent(a,b,c,d):this.paintDurationEvent(a,b,c,d)};Timeline.CompactEventPainter.prototype.paintInstantEvent=function(a,b,c,d){a.isImprecise()?this.paintImpreciseInstantEvent(a,b,c,d):this.paintPreciseInstantEvent(a,b,c,d)};Timeline.CompactEventPainter.prototype.paintDurationEvent=function(a,b,c,d){a.isImprecise()?this.paintImpreciseDurationEvent(a,b,c,d):this.paintPreciseDurationEvent(a,b,c,d)};
Timeline.CompactEventPainter.prototype.paintPreciseInstantEvent=function(a,b,c,d){var g={tooltip:a.getProperty("tooltip")||a.getText()},e={url:a.getIcon()};if(e.url==null){e.url=b.defaultIcon;e.width=b.defaultIconWidth;e.height=b.defaultIconHeight;e.className="timeline-event-icon-default"}else{e.width=a.getProperty("iconWidth")||b.customIconWidth;e.height=a.getProperty("iconHeight")||b.customIconHeight}var f={text:a.getText(),color:a.getTextColor()||a.getColor(),className:a.getClassName()},h=this.paintTapeIconLabel(a.getStart(),
g,null,e,f,b,c,d),i=this;b=function(j,l){return i._onClickInstantEvent(h.iconElmtData.elmt,l,a)};SimileAjax.DOM.registerEvent(h.iconElmtData.elmt,"mousedown",b);SimileAjax.DOM.registerEvent(h.labelElmtData.elmt,"mousedown",b);this._eventIdToElmt[a.getID()]=h.iconElmtData.elmt};
Timeline.CompactEventPainter.prototype.paintCompositePreciseInstantEvents=function(a,b,c,d){for(var g=a[0],e=[],f=0;f<a.length;f++)e.push(a[f].getProperty("tooltip")||a[f].getText());e={tooltip:e.join("; ")};f={url:b.compositeIcon,width:b.compositeIconWidth,height:b.compositeIconHeight,className:"timeline-event-icon-composite"};var h={text:String.substitute(this._params.compositeEventLabelTemplate,[a.length])},i=this.paintTapeIconLabel(g.getStart(),e,null,f,h,b,c,d),j=this;b=function(l,k){return j._onClickMultiplePreciseInstantEvent(i.iconElmtData.elmt,
k,a)};SimileAjax.DOM.registerEvent(i.iconElmtData.elmt,"mousedown",b);SimileAjax.DOM.registerEvent(i.labelElmtData.elmt,"mousedown",b);for(f=0;f<a.length;f++)this._eventIdToElmt[a[f].getID()]=i.iconElmtData.elmt};
Timeline.CompactEventPainter.prototype.paintStackedPreciseInstantEvents=function(a,b,c){var d="limit"in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.limit:10,g="moreMessageTemplate"in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.moreMessageTemplate:"%0 More Events",e=d<=a.length-2,f=this._band,h=function(t){var q={url:t.getIcon()};if(q.url==null){q.url=b.defaultStackIcon;q.width=b.defaultStackIconWidth;
q.height=b.defaultStackIconHeight;q.className="timeline-event-icon-stack timeline-event-icon-default"}else{q.width=t.getProperty("iconWidth")||b.customIconWidth;q.height=t.getProperty("iconHeight")||b.customIconHeight;q.className="timeline-event-icon-stack"}return q},i=h(a[0]),j=0,l=0,k=0,n=0,p=[],m=0;for(;m<a.length&&(!e||m<d);m++){var o=a[m],r=o.getText();o=h(o);var s=this._frc.computeSize(r);r={text:r,iconData:o,labelSize:s,iconLeft:i.width+m*5-o.width};r.labelLeft=i.width+m*5+b.iconLabelGap;r.top=
k;p.push(r);j=Math.min(j,r.iconLeft);k+=s.height;l=Math.max(l,r.labelLeft+s.width);n=Math.max(n,r.top+o.height)}if(e){var x=String.substitute(g,[a.length-d]),z=this._frc.computeSize(x),F=i.width+(d-1)*5+b.iconLabelGap,H=k;k+=z.height;l=Math.max(l,F+z.width)}l+=b.labelRightMargin;k+=b.labelBottomMargin;n+=b.iconBottomMargin;var A=function(t){return Math.round(f.dateToPixelOffset(t))}(a[0].getStart());g=[];h=Math.ceil(Math.max(n,k)/b.trackHeight);i=i.width+(a.length-1)*5;for(m=0;m<h;m++)g.push({start:j,
end:i});j=Math.ceil(k/b.trackHeight);for(m=0;m<j;m++){k=g[m];k.end=Math.max(k.end,l)}var C=this._fitTracks(A,g)*b.trackHeight+b.trackOffset,v=this._timeline.getDocument().createElement("div");v.className="timeline-event-icon-stack";v.style.position="absolute";v.style.overflow="visible";v.style.left=A+"px";v.style.top=C+"px";v.style.width=i+"px";v.style.height=n+"px";v.innerHTML="<div style='position: relative'></div>";this._eventLayer.appendChild(v);var y=this,G=function(){try{for(var t=parseInt(this.getAttribute("index")),
q=v.firstChild.childNodes,w=0;w<q.length;w++)q[w].style.zIndex=w==t?q.length:q.length-w}catch(u){}};l=function(t){var q=p[t],w=a[t],u=w.getProperty("tooltip")||w.getText(),B=y._paintEventLabel({tooltip:u},{text:q.text},A+q.labelLeft,C+q.top,q.labelSize.width,q.labelSize.height,c);B.elmt.setAttribute("index",t);B.elmt.onmouseover=G;var I=SimileAjax.Graphics.createTranslucentImage(q.iconData.url);u=y._timeline.getDocument().createElement("div");u.className="timeline-event-icon"+("className"in q.iconData?
" "+q.iconData.className:"");u.style.left=q.iconLeft+"px";u.style.top=q.top+"px";u.style.zIndex=p.length-t;u.appendChild(I);u.setAttribute("index",t);u.onmouseover=G;v.firstChild.appendChild(u);t=function(K,J){return y._onClickInstantEvent(B.elmt,J,w)};SimileAjax.DOM.registerEvent(u,"mousedown",t);SimileAjax.DOM.registerEvent(B.elmt,"mousedown",t);y._eventIdToElmt[w.getID()]=u};for(m=0;m<p.length;m++)l(m);if(e){var D=a.slice(d),E=this._paintEventLabel({tooltip:x},{text:x},A+F,C+H,z.width,z.height,
c);SimileAjax.DOM.registerEvent(E.elmt,"mousedown",function(t,q){return y._onClickMultiplePreciseInstantEvent(E.elmt,q,D)});for(m=0;m<D.length;m++)this._eventIdToElmt[D[m].getID()]=E.elmt}};
Timeline.CompactEventPainter.prototype.paintImpreciseInstantEvent=function(a,b,c,d){var g={tooltip:a.getProperty("tooltip")||a.getText()},e={start:a.getStart(),end:a.getEnd(),latestStart:a.getLatestStart(),earliestEnd:a.getEarliestEnd(),color:a.getColor()||a.getTextColor(),isInstant:true},f={url:a.getIcon()};if(f.url==null)f=null;else{f.width=a.getProperty("iconWidth")||b.customIconWidth;f.height=a.getProperty("iconHeight")||b.customIconHeight}var h={text:a.getText(),color:a.getTextColor()||a.getColor(),
className:a.getClassName()},i=this.paintTapeIconLabel(a.getStart(),g,e,f,h,b,c,d),j=this;b=f!=null?function(l,k){return j._onClickInstantEvent(i.iconElmtData.elmt,k,a)}:function(l,k){return j._onClickInstantEvent(i.labelElmtData.elmt,k,a)};SimileAjax.DOM.registerEvent(i.labelElmtData.elmt,"mousedown",b);SimileAjax.DOM.registerEvent(i.impreciseTapeElmtData.elmt,"mousedown",b);if(f!=null){SimileAjax.DOM.registerEvent(i.iconElmtData.elmt,"mousedown",b);this._eventIdToElmt[a.getID()]=i.iconElmtData.elmt}else this._eventIdToElmt[a.getID()]=
i.labelElmtData.elmt};
Timeline.CompactEventPainter.prototype.paintPreciseDurationEvent=function(a,b,c,d){var g={tooltip:a.getProperty("tooltip")||a.getText()},e={start:a.getStart(),end:a.getEnd(),color:a.getColor()||a.getTextColor(),isInstant:false},f={url:a.getIcon()};if(f.url==null)f=null;else{f.width=a.getProperty("iconWidth")||b.customIconWidth;f.height=a.getProperty("iconHeight")||b.customIconHeight}var h={text:a.getText(),color:a.getTextColor()||a.getColor(),className:a.getClassName()},i=this.paintTapeIconLabel(a.getLatestStart(),g,
e,f,h,b,c,d),j=this;b=f!=null?function(l,k){return j._onClickInstantEvent(i.iconElmtData.elmt,k,a)}:function(l,k){return j._onClickInstantEvent(i.labelElmtData.elmt,k,a)};SimileAjax.DOM.registerEvent(i.labelElmtData.elmt,"mousedown",b);SimileAjax.DOM.registerEvent(i.tapeElmtData.elmt,"mousedown",b);if(f!=null){SimileAjax.DOM.registerEvent(i.iconElmtData.elmt,"mousedown",b);this._eventIdToElmt[a.getID()]=i.iconElmtData.elmt}else this._eventIdToElmt[a.getID()]=i.labelElmtData.elmt};
Timeline.CompactEventPainter.prototype.paintImpreciseDurationEvent=function(a,b,c,d){var g={tooltip:a.getProperty("tooltip")||a.getText()},e={start:a.getStart(),end:a.getEnd(),latestStart:a.getLatestStart(),earliestEnd:a.getEarliestEnd(),color:a.getColor()||a.getTextColor(),isInstant:false},f={url:a.getIcon()};if(f.url==null)f=null;else{f.width=a.getProperty("iconWidth")||b.customIconWidth;f.height=a.getProperty("iconHeight")||b.customIconHeight}var h={text:a.getText(),color:a.getTextColor()||a.getColor(),
className:a.getClassName()},i=this.paintTapeIconLabel(a.getLatestStart(),g,e,f,h,b,c,d),j=this;b=f!=null?function(l,k){return j._onClickInstantEvent(i.iconElmtData.elmt,k,a)}:function(l,k){return j._onClickInstantEvent(i.labelElmtData.elmt,k,a)};SimileAjax.DOM.registerEvent(i.labelElmtData.elmt,"mousedown",b);SimileAjax.DOM.registerEvent(i.tapeElmtData.elmt,"mousedown",b);if(f!=null){SimileAjax.DOM.registerEvent(i.iconElmtData.elmt,"mousedown",b);this._eventIdToElmt[a.getID()]=i.iconElmtData.elmt}else this._eventIdToElmt[a.getID()]=
i.labelElmtData.elmt};
Timeline.CompactEventPainter.prototype.paintTapeIconLabel=function(a,b,c,d,g,e,f){var h=this._band,i=function(x){return Math.round(h.dateToPixelOffset(x))};a=i(a);var j=[],l=0,k=0,n=0;if(c!=null){l=e.tapeHeight+e.tapeBottomMargin;k=Math.ceil(e.tapeHeight/e.trackHeight);for(var p=i(c.end)-a,m=i(c.start)-a,o=0;o<k;o++)j.push({start:m,end:p});n=e.trackHeight-l%e.tapeHeight}m=p=0;if(d!=null){if("iconAlign"in d&&d.iconAlign=="center")p=-Math.floor(d.width/2);m=p+d.width+e.iconLabelGap;if(k>0)j[k-1].end=
Math.max(j[k-1].end,m);for(o=d.height+e.iconBottomMargin+n;o>0;){j.push({start:p,end:m});o-=e.trackHeight}}o=this._frc.computeSize(g.text);n=o.height+e.labelBottomMargin+n;var r=m+o.width+e.labelRightMargin;if(k>0)j[k-1].end=Math.max(j[k-1].end,r);for(var s=0;n>0;s++){if(k+s<j.length)j[k+s].end=r;else j.push({start:0,end:r});n-=e.trackHeight}j=this._fitTracks(a,j)*e.trackHeight+e.trackOffset;k={};k.labelElmtData=this._paintEventLabel(b,g,a+m,j+l,o.width,o.height,f);if(c!=null){if("latestStart"in c||
"earliestEnd"in c)k.impreciseTapeElmtData=this._paintEventTape(b,c,e.tapeHeight,j,i(c.start),i(c.end),f.event.duration.impreciseColor,f.event.duration.impreciseOpacity,e,f);if(!c.isInstant&&"start"in c&&"end"in c)k.tapeElmtData=this._paintEventTape(b,c,e.tapeHeight,j,a,i("earliestEnd"in c?c.earliestEnd:c.end),c.color,100,e,f)}if(d!=null)k.iconElmtData=this._paintEventIcon(b,d,j+l,a+p,e,f);return k};
Timeline.CompactEventPainter.prototype._fitTracks=function(a,b){var c;for(c=0;c<this._tracks.length;c++){for(var d=true,g=0;g<b.length&&c+g<this._tracks.length;g++)if(a+b[g].start<this._tracks[c+g]){d=false;break}if(d)break}for(d=0;d<b.length;d++)this._tracks[c+d]=a+b[d].end;return c};
Timeline.CompactEventPainter.prototype._paintEventIcon=function(a,b,c,d,g){var e=SimileAjax.Graphics.createTranslucentImage(b.url),f=this._timeline.getDocument().createElement("div");f.className="timeline-event-icon"+("className"in b?" "+b.className:"");f.style.left=d+"px";f.style.top=c+"px";f.appendChild(e);if("tooltip"in a&&typeof a.tooltip=="string")f.title=a.tooltip;this._eventLayer.appendChild(f);return{left:d,top:c,width:g.iconWidth,height:g.iconHeight,elmt:f}};
Timeline.CompactEventPainter.prototype._paintEventLabel=function(a,b,c,d,g,e){var f=this._timeline.getDocument().createElement("div");f.className="timeline-event-label";f.style.left=c+"px";f.style.width=g+1+"px";f.style.top=d+"px";f.innerHTML=b.text;if("tooltip"in a&&typeof a.tooltip=="string")f.title=a.tooltip;if("color"in b&&typeof b.color=="string")f.style.color=b.color;if("className"in b&&typeof b.className=="string")f.className+=" "+b.className;this._eventLayer.appendChild(f);return{left:c,top:d,
width:g,height:e,elmt:f}};
Timeline.CompactEventPainter.prototype._paintEventTape=function(a,b,c,d,g,e,f,h){e=e-g;var i=this._timeline.getDocument().createElement("div");i.className="timeline-event-tape";i.style.left=g+"px";i.style.top=d+"px";i.style.width=e+"px";i.style.height=c+"px";if("tooltip"in a&&typeof a.tooltip=="string")i.title=a.tooltip;if(f!=null&&typeof b.color=="string")i.style.backgroundColor=f;if("backgroundImage"in b&&typeof b.backgroundImage=="string"){i.style.backgroundImage="url("+backgroundImage+")";i.style.backgroundRepeat=
"backgroundRepeat"in b&&typeof b.backgroundRepeat=="string"?b.backgroundRepeat:"repeat"}SimileAjax.Graphics.setOpacity(i,h);if("className"in b&&typeof b.className=="string")i.className+=" "+b.className;this._eventLayer.appendChild(i);return{left:g,top:d,width:e,height:c,elmt:i}};
Timeline.CompactEventPainter.prototype._createHighlightDiv=function(a,b){if(a>=0){var c=this._timeline.getDocument().createElement("div");c.style.position="absolute";c.style.overflow="hidden";c.style.left=b.left-2+"px";c.style.width=b.width+4+"px";c.style.top=b.top-2+"px";c.style.height=b.height+4+"px";this._highlightLayer.appendChild(c)}};
Timeline.CompactEventPainter.prototype._onClickMultiplePreciseInstantEvent=function(a,b,c){var d=SimileAjax.DOM.getPageCoordinates(a);this._showBubble(d.left+Math.ceil(a.offsetWidth/2),d.top+Math.ceil(a.offsetHeight/2),c);a=[];for(d=0;d<c.length;d++)a.push(c[d].getID());this._fireOnSelect(a);b.cancelBubble=true;SimileAjax.DOM.cancelEvent(b);return false};
Timeline.CompactEventPainter.prototype._onClickInstantEvent=function(a,b,c){var d=SimileAjax.DOM.getPageCoordinates(a);this._showBubble(d.left+Math.ceil(a.offsetWidth/2),d.top+Math.ceil(a.offsetHeight/2),[c]);this._fireOnSelect([c.getID()]);b.cancelBubble=true;SimileAjax.DOM.cancelEvent(b);return false};
Timeline.CompactEventPainter.prototype._onClickDurationEvent=function(a,b,c){if("pageX"in b){a=b.pageX;var d=b.pageY}else{d=SimileAjax.DOM.getPageCoordinates(a);a=b.offsetX+d.left;d=b.offsetY+d.top}this._showBubble(a,d,[c]);this._fireOnSelect([c.getID()]);b.cancelBubble=true;SimileAjax.DOM.cancelEvent(b);return false};
Timeline.CompactEventPainter.prototype.showBubble=function(a){var b=this._eventIdToElmt[a.getID()];if(b){var c=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(c.left+b.offsetWidth/2,c.top+b.offsetHeight/2,[a])}};
Timeline.CompactEventPainter.prototype._showBubble=function(a,b,c){var d=document.createElement("div");c="fillInfoBubble"in c?[c]:c;for(var g=0;g<c.length;g++){var e=document.createElement("div");d.appendChild(e);c[g].fillInfoBubble(e,this._params.theme,this._band.getLabeller())}SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(d,a,b,this._params.theme.event.bubble.width)};Timeline.CompactEventPainter.prototype._fireOnSelect=function(a){for(var b=0;b<this._onSelectListeners.length;b++)this._onSelectListeners[b](a)};
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(a,b){this._band=a;this._timeline=b;this._layerDiv=null};
Timeline.SpanHighlightDecorator.prototype.paint=function(){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 a=this._band.getMinDate(),b=this._band.getMaxDate();if(this._unit.compare(this._startDate,b)<0&&this._unit.compare(this._endDate,a)>0){a=this._unit.later(a,this._startDate);b=this._unit.earlier(b,this._endDate);a=this._band.dateToPixelOffset(a);
b=this._band.dateToPixelOffset(b);var c=this._timeline.getDocument(),d=function(){var h=c.createElement("table");h.insertRow(0).insertCell(0);return h},g=c.createElement("div");g.className="timeline-highlight-decorator";if(this._cssClass)g.className+=" "+this._cssClass;if(this._color!=null)g.style.backgroundColor=this._color;this._opacity<100&&SimileAjax.Graphics.setOpacity(g,this._opacity);this._layerDiv.appendChild(g);var e=d();e.className="timeline-highlight-label timeline-highlight-label-start";
var f=e.rows[0].cells[0];f.innerHTML=this._startLabel;if(this._cssClass)f.className="label_"+this._cssClass;this._layerDiv.appendChild(e);d=d();d.className="timeline-highlight-label timeline-highlight-label-end";f=d.rows[0].cells[0];f.innerHTML=this._endLabel;if(this._cssClass)f.className="label_"+this._cssClass;this._layerDiv.appendChild(d);if(this._timeline.isHorizontal()){g.style.left=a+"px";g.style.width=b-a+"px";e.style.right=this._band.getTotalViewLength()-a+"px";e.style.width=this._startLabel.length+
"em";d.style.left=b+"px";d.style.width=this._endLabel.length+"em"}else{g.style.top=a+"px";g.style.height=b-a+"px";e.style.bottom=a+"px";e.style.height="1.5px";d.style.top=b+"px";d.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(a,b){this._band=a;this._timeline=b;this._layerDiv=null};
Timeline.PointHighlightDecorator.prototype.paint=function(){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 a=this._band.getMinDate();if(this._unit.compare(this._date,this._band.getMaxDate())<0&&this._unit.compare(this._date,a)>0){a=this._band.dateToPixelOffset(this._date)-Math.round(this._width/2);var b=this._timeline.getDocument().createElement("div");
b.className="timeline-highlight-point-decorator";b.className+=" "+this._cssClass;if(this._color!=null)b.style.backgroundColor=this._color;this._opacity<100&&SimileAjax.Graphics.setOpacity(b,this._opacity);this._layerDiv.appendChild(b);if(this._timeline.isHorizontal()){b.style.left=a+"px";b.style.width=this._width+"px"}else{b.style.top=a+"px";b.style.height=this._width+"px"}}this._layerDiv.style.display="block"};Timeline.PointHighlightDecorator.prototype.softPaint=function(){};
Timeline.DetailedEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._frc=this._highlightMatcher=this._filterMatcher=null;this._eventIdToElmt={}};Timeline.DetailedEventPainter.prototype.initialize=function(a,b){this._band=a;this._timeline=b;this._eventIdToElmt=this._highlightLayer=this._lineLayer=this._eventLayer=this._backLayer=null};Timeline.DetailedEventPainter.prototype.getType=function(){return"detailed"};Timeline.DetailedEventPainter.prototype.addOnSelectListener=function(a){this._onSelectListeners.push(a)};
Timeline.DetailedEventPainter.prototype.removeOnSelectListener=function(a){for(var b=0;b<this._onSelectListeners.length;b++)if(this._onSelectListeners[b]==a){this._onSelectListeners.splice(b,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 a=this._band.getEventSource();if(a!=null){this._eventIdToElmt={};this._prepareForPainting();var b=this._params.theme.event,c=Math.max(b.track.height,this._frc.getLineHeight());b={trackOffset:Math.round(this._band.getViewWidth()/2-c/2),trackHeight:c,trackGap:b.track.gap,trackIncrement:c+b.track.gap,icon:b.instant.icon,iconWidth:b.instant.iconWidth,iconHeight:b.instant.iconHeight,labelWidth:b.label.width};var d=this._band.getMinDate(),g=this._band.getMaxDate();
c=this._filterMatcher!=null?this._filterMatcher:function(){return true};var e=this._highlightMatcher!=null?this._highlightMatcher:function(){return-1};for(a=a.getEventReverseIterator(d,g);a.hasNext();){d=a.next();c(d)&&this.paintEvent(d,b,this._params.theme,e(d))}this._highlightLayer.style.display="block";this._lineLayer.style.display="block";this._eventLayer.style.display="block";this._band.updateEventTrackInfo(this._lowerTracks.length+this._upperTracks.length,b.trackIncrement)}};
Timeline.DetailedEventPainter.prototype.softPaint=function(){};
Timeline.DetailedEventPainter.prototype._prepareForPainting=function(){var a=this._band;if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");this._backLayer.style.visibility="hidden";var b=document.createElement("span");b.className="timeline-event-label";this._backLayer.appendChild(b);this._frc=SimileAjax.Graphics.getFontRenderingContext(b)}this._frc.update();this._lowerTracks=[];this._upperTracks=[];this._highlightLayer!=null&&a.removeLayerDiv(this._highlightLayer);
this._highlightLayer=a.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";this._lineLayer!=null&&a.removeLayerDiv(this._lineLayer);this._lineLayer=a.createLayerDiv(110,"timeline-band-lines");this._lineLayer.style.display="none";this._eventLayer!=null&&a.removeLayerDiv(this._eventLayer);this._eventLayer=a.createLayerDiv(110,"timeline-band-events");this._eventLayer.style.display="none"};
Timeline.DetailedEventPainter.prototype.paintEvent=function(a,b,c,d){a.isInstant()?this.paintInstantEvent(a,b,c,d):this.paintDurationEvent(a,b,c,d)};Timeline.DetailedEventPainter.prototype.paintInstantEvent=function(a,b,c,d){a.isImprecise()?this.paintImpreciseInstantEvent(a,b,c,d):this.paintPreciseInstantEvent(a,b,c,d)};Timeline.DetailedEventPainter.prototype.paintDurationEvent=function(a,b,c,d){a.isImprecise()?this.paintImpreciseDurationEvent(a,b,c,d):this.paintPreciseDurationEvent(a,b,c,d)};
Timeline.DetailedEventPainter.prototype.paintPreciseInstantEvent=function(a,b,c,d){this._timeline.getDocument();var g=a.getText(),e=a.getStart(),f=Math.round(this._band.dateToPixelOffset(e)),h=Math.round(f+b.iconWidth/2);e=Math.round(f-b.iconWidth/2);var i=this._frc.computeSize(g),j=this._findFreeTrackForSolid(h,f),l=this._paintEventIcon(a,j,e,b,c);h=h+c.event.label.offsetFromLine;var k=j,n=this._getTrackData(j);if(Math.min(n.solid,n.text)>=h+i.width){n.solid=e;n.text=h}else{n.solid=e;h=f+c.event.label.offsetFromLine;
k=this._findFreeTrackForText(j,h+i.width,function(m){m.line=f-2});this._getTrackData(k).text=e;this._paintEventLine(a,f,j,k,b,c)}b=this._paintEventLabel(a,g,h,Math.round(b.trackOffset+k*b.trackIncrement+b.trackHeight/2-i.height/2),i.width,i.height,c);var p=this;g=function(m,o){return p._onClickInstantEvent(l.elmt,o,a)};SimileAjax.DOM.registerEvent(l.elmt,"mousedown",g);SimileAjax.DOM.registerEvent(b.elmt,"mousedown",g);this._createHighlightDiv(d,l,c);this._eventIdToElmt[a.getID()]=l.elmt};
Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent=function(a,b,c,d){this._timeline.getDocument();var g=a.getText(),e=a.getStart(),f=a.getEnd(),h=Math.round(this._band.dateToPixelOffset(e)),i=Math.round(this._band.dateToPixelOffset(f)),j=Math.round(h+b.iconWidth/2);f=Math.round(h-b.iconWidth/2);var l=this._frc.computeSize(g),k=this._findFreeTrackForSolid(i,h);e=this._paintEventTape(a,k,h,i,c.event.instant.impreciseColor,c.event.instant.impreciseOpacity,b,c);var n=this._paintEventIcon(a,
k,f,b,c);this._getTrackData(k).solid=f;j=j+c.event.label.offsetFromLine;var p=j+l.width;if(p<i)i=k;else{j=h+c.event.label.offsetFromLine;p=j+l.width;i=this._findFreeTrackForText(k,p,function(o){o.line=h-2});this._getTrackData(i).text=f;this._paintEventLine(a,h,k,i,b,c)}b=this._paintEventLabel(a,g,j,Math.round(b.trackOffset+i*b.trackIncrement+b.trackHeight/2-l.height/2),l.width,l.height,c);var m=this;g=function(o,r){return m._onClickInstantEvent(n.elmt,r,a)};SimileAjax.DOM.registerEvent(n.elmt,"mousedown",
g);SimileAjax.DOM.registerEvent(e.elmt,"mousedown",g);SimileAjax.DOM.registerEvent(b.elmt,"mousedown",g);this._createHighlightDiv(d,n,c);this._eventIdToElmt[a.getID()]=n.elmt};
Timeline.DetailedEventPainter.prototype.paintPreciseDurationEvent=function(a,b,c,d){this._timeline.getDocument();var g=a.getText(),e=a.getStart(),f=a.getEnd(),h=Math.round(this._band.dateToPixelOffset(e)),i=Math.round(this._band.dateToPixelOffset(f));e=this._frc.computeSize(g);f=this._findFreeTrackForSolid(i);var j=a.getColor();j=j!=null?j:c.event.duration.color;var l=this._paintEventTape(a,f,h,i,j,100,b,c);this._getTrackData(f).solid=h;i=h+c.event.label.offsetFromLine;j=this._findFreeTrackForText(f,
i+e.width,function(n){n.line=h-2});this._getTrackData(j).text=h-2;this._paintEventLine(a,h,f,j,b,c);b=this._paintEventLabel(a,g,i,Math.round(b.trackOffset+j*b.trackIncrement+b.trackHeight/2-e.height/2),e.width,e.height,c);var k=this;g=function(n,p){return k._onClickDurationEvent(l.elmt,p,a)};SimileAjax.DOM.registerEvent(l.elmt,"mousedown",g);SimileAjax.DOM.registerEvent(b.elmt,"mousedown",g);this._createHighlightDiv(d,l,c);this._eventIdToElmt[a.getID()]=l.elmt};
Timeline.DetailedEventPainter.prototype.paintImpreciseDurationEvent=function(a,b,c,d){this._timeline.getDocument();var g=a.getText(),e=a.getStart(),f=a.getLatestStart(),h=a.getEnd(),i=a.getEarliestEnd();e=Math.round(this._band.dateToPixelOffset(e));var j=Math.round(this._band.dateToPixelOffset(f));h=Math.round(this._band.dateToPixelOffset(h));var l=Math.round(this._band.dateToPixelOffset(i));i=this._frc.computeSize(g);f=this._findFreeTrackForSolid(h);var k=a.getColor();k=k!=null?k:c.event.duration.color;
this._paintEventTape(a,f,e,h,c.event.duration.impreciseColor,c.event.duration.impreciseOpacity,b,c);var n=this._paintEventTape(a,f,j,l,k,100,b,c);this._getTrackData(f).solid=e;e=j+c.event.label.offsetFromLine;h=this._findFreeTrackForText(f,e+i.width,function(m){m.line=j-2});this._getTrackData(h).text=j-2;this._paintEventLine(a,j,f,h,b,c);b=this._paintEventLabel(a,g,e,Math.round(b.trackOffset+h*b.trackIncrement+b.trackHeight/2-i.height/2),i.width,i.height,c);var p=this;g=function(m,o){return p._onClickDurationEvent(n.elmt,
o,a)};SimileAjax.DOM.registerEvent(n.elmt,"mousedown",g);SimileAjax.DOM.registerEvent(b.elmt,"mousedown",g);this._createHighlightDiv(d,n,c);this._eventIdToElmt[a.getID()]=n.elmt};
Timeline.DetailedEventPainter.prototype._findFreeTrackForSolid=function(a,b){for(var c=0;;c++){if(c<this._lowerTracks.length){var d=this._lowerTracks[c];if(Math.min(d.solid,d.text)>a&&(!b||d.line>b))return c}else{this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});return c}if(c<this._upperTracks.length){d=this._upperTracks[c];if(Math.min(d.solid,d.text)>a&&(!b||d.line>b))return-1-c}else{this._upperTracks.push({solid:Number.POSITIVE_INFINITY,
text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});return-1-c}}};
Timeline.DetailedEventPainter.prototype._findFreeTrackForText=function(a,b,c){var d,g;if(a<0){d=true;a=-a;b=this._findFreeUpperTrackForText(a,b);g=-1-b}else if(a>0){d=false;a=a+1;g=b=this._findFreeLowerTrackForText(a,b)}else{g=this._findFreeUpperTrackForText(0,b);b=this._findFreeLowerTrackForText(1,b);if(b-1<=g){d=false;a=1;g=b=b}else{d=true;a=0;b=g;g=-1-b}}if(d){b==this._upperTracks.length&&this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
for(d=a;d<b;d++)c(this._upperTracks[d])}else{b==this._lowerTracks.length&&this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});for(d=a;d<b;d++)c(this._lowerTracks[d])}return g};Timeline.DetailedEventPainter.prototype._findFreeLowerTrackForText=function(a,b){for(;a<this._lowerTracks.length;a++){var c=this._lowerTracks[a];if(Math.min(c.solid,c.text)>=b)break}return a};
Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText=function(a,b){for(;a<this._upperTracks.length;a++){var c=this._upperTracks[a];if(Math.min(c.solid,c.text)>=b)break}return a};Timeline.DetailedEventPainter.prototype._getTrackData=function(a){return a<0?this._upperTracks[-a-1]:this._lowerTracks[a]};
Timeline.DetailedEventPainter.prototype._paintEventLine=function(a,b,c,d,g,e){a=Math.round(g.trackOffset+c*g.trackIncrement+g.trackHeight/2);g=Math.round(Math.abs(d-c)*g.trackIncrement);var f="1px solid "+e.event.label.lineColor,h=this._timeline.getDocument().createElement("div");h.style.position="absolute";h.style.left=b+"px";h.style.width=e.event.label.offsetFromLine+"px";h.style.height=g+"px";if(c>d){h.style.top=a-g+"px";h.style.borderTop=f}else{h.style.top=a+"px";h.style.borderBottom=f}h.style.borderLeft=
f;this._lineLayer.appendChild(h)};
Timeline.DetailedEventPainter.prototype._paintEventIcon=function(a,b,c,d){var g=a.getIcon();g=g!=null?g:d.icon;b=Math.round(d.trackOffset+b*d.trackIncrement+d.trackHeight/2-d.iconHeight/2);g=SimileAjax.Graphics.createTranslucentImage(g);var e=this._timeline.getDocument().createElement("div");e.style.position="absolute";e.style.left=c+"px";e.style.top=b+"px";e.appendChild(g);e.style.cursor="pointer";if(a._title!=null)e.title=a._title;this._eventLayer.appendChild(e);return{left:c,top:b,width:d.iconWidth,
height:d.iconHeight,elmt:e}};
Timeline.DetailedEventPainter.prototype._paintEventLabel=function(a,b,c,d,g,e,f){var h=this._timeline.getDocument(),i=h.createElement("div");i.style.position="absolute";i.style.left=c+"px";i.style.width=g+"px";i.style.top=d+"px";i.style.height=e+"px";i.style.backgroundColor=f.event.label.backgroundColor;SimileAjax.Graphics.setOpacity(i,f.event.label.backgroundOpacity);this._eventLayer.appendChild(i);f=h.createElement("div");f.style.position="absolute";f.style.left=c+"px";f.style.width=g+"px";f.style.top=
d+"px";f.innerHTML=b;f.style.cursor="pointer";if(a._title!=null)f.title=a._title;b=a.getTextColor();if(b==null)b=a.getColor();if(b!=null)f.style.color=b;this._eventLayer.appendChild(f);return{left:c,top:d,width:g,height:e,elmt:f}};
Timeline.DetailedEventPainter.prototype._paintEventTape=function(a,b,c,d,g,e,f,h){d=d-c;h=h.event.tape.height;b=Math.round(f.trackOffset+b*f.trackIncrement+f.trackHeight/2-h/2);f=this._timeline.getDocument().createElement("div");f.style.position="absolute";f.style.left=c+"px";f.style.width=d+"px";f.style.top=b+"px";f.style.height=h+"px";f.style.backgroundColor=g;f.style.overflow="hidden";f.style.cursor="pointer";if(a._title!=null)f.title=a._title;SimileAjax.Graphics.setOpacity(f,e);this._eventLayer.appendChild(f);
return{left:c,top:b,width:d,height:h,elmt:f}};Timeline.DetailedEventPainter.prototype._createHighlightDiv=function(a,b,c){if(a>=0){var d=this._timeline.getDocument();c=c.event;a=c.highlightColors[Math.min(a,c.highlightColors.length-1)];d=d.createElement("div");d.style.position="absolute";d.style.overflow="hidden";d.style.left=b.left-2+"px";d.style.width=b.width+4+"px";d.style.top=b.top-2+"px";d.style.height=b.height+4+"px";d.style.background=a;this._highlightLayer.appendChild(d)}};
Timeline.DetailedEventPainter.prototype._onClickInstantEvent=function(a,b,c){var d=SimileAjax.DOM.getPageCoordinates(a);this._showBubble(d.left+Math.ceil(a.offsetWidth/2),d.top+Math.ceil(a.offsetHeight/2),c);this._fireOnSelect(c.getID());b.cancelBubble=true;SimileAjax.DOM.cancelEvent(b);return false};
Timeline.DetailedEventPainter.prototype._onClickDurationEvent=function(a,b,c){if("pageX"in b){a=b.pageX;var d=b.pageY}else{d=SimileAjax.DOM.getPageCoordinates(a);a=b.offsetX+d.left;d=b.offsetY+d.top}this._showBubble(a,d,c);this._fireOnSelect(c.getID());b.cancelBubble=true;SimileAjax.DOM.cancelEvent(b);return false};
Timeline.DetailedEventPainter.prototype.showBubble=function(a){var b=this._eventIdToElmt[a.getID()];if(b){var c=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(c.left+b.offsetWidth/2,c.top+b.offsetHeight/2,a)}};
Timeline.DetailedEventPainter.prototype._showBubble=function(a,b,c){var d=document.createElement("div"),g=this._params.theme.event.bubble;c.fillInfoBubble(d,this._params.theme,this._band.getLabeller());SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(d,a,b,g.width,null,g.maxHeight)};Timeline.DetailedEventPainter.prototype._fireOnSelect=function(a){for(var b=0;b<this._onSelectListeners.length;b++)this._onSelectListeners[b](a)};
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(a,b){this._band=a;this._timeline=b;this._backgroundLayer=a.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.className="timeline-ether-bg";this._lineLayer=this._markerLayer=null;var c="align"in this._params&&this._params.align!=undefined?this._params.align:this._theme.ether.interval.marker[b.isHorizontal()?"hAlign":"vAlign"];this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,
this._band,this._theme,c,"showLine"in this._params?this._params.showLine:this._theme.ether.interval.line.show);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.GregorianEtherPainter.prototype.setHighlight=function(a,b,c,d){this._highlight.position(a,b,c,d)};
Timeline.GregorianEtherPainter.prototype.paint=function(){this._markerLayer&&this._band.removeLayerDiv(this._markerLayer);this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";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 a=this._band.getMinDate(),b=this._band.getMaxDate(),
c=this._band.getTimeZone(),d=this._band.getLabeller();SimileAjax.DateTime.roundDownToInterval(a,this._unit,c,this._multiple,this._theme.firstDayOfWeek);var g=this;for(c=function(e){for(var f=0;f<g._multiple;f++)SimileAjax.DateTime.incrementByInterval(e,g._unit)};a.getTime()<b.getTime();){this._intervalMarkerLayout.createIntervalMarker(a,d,this._unit,this._markerLayer,this._lineLayer);c(a)}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(a){this._params=a;this._theme=a.theme;this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,unit:a.unit,multiple:1}];for(var b=0;b<a.zones.length;b++)for(var c=a.zones[b],d=SimileAjax.DateTime.parseGregorianDateTime(c.start).getTime(),g=SimileAjax.DateTime.parseGregorianDateTime(c.end).getTime(),e=0;e<this._zones.length&&g>d;e++){var f=this._zones[e];if(d<f.endTime){if(d>f.startTime){this._zones.splice(e,0,{startTime:f.startTime,
endTime:d,unit:f.unit,multiple:f.multiple});e++;f.startTime=d}if(g<f.endTime){this._zones.splice(e,0,{startTime:d,endTime:g,unit:c.unit,multiple:c.multiple?c.multiple:1});e++;d=f.startTime=g}else{f.multiple=c.multiple;f.unit=c.unit;d=f.endTime}}}};
Timeline.HotZoneGregorianEtherPainter.prototype.initialize=function(a,b){this._band=a;this._timeline=b;this._backgroundLayer=a.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.className="timeline-ether-bg";this._lineLayer=this._markerLayer=null;var c="align"in this._params&&this._params.align!=undefined?this._params.align:this._theme.ether.interval.marker[b.isHorizontal()?"hAlign":"vAlign"];this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,
this._band,this._theme,c,"showLine"in this._params?this._params.showLine:this._theme.ether.interval.line.show);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(){this._markerLayer&&this._band.removeLayerDiv(this._markerLayer);this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";this._lineLayer&&this._band.removeLayerDiv(this._lineLayer);this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";for(var a=this._band.getMinDate(),b=
this._band.getMaxDate(),c=this._band.getTimeZone(),d=this._band.getLabeller(),g=function(l,k){for(var n=0;n<k.multiple;n++)SimileAjax.DateTime.incrementByInterval(l,k.unit)},e=0;e<this._zones.length;){if(a.getTime()<this._zones[e].endTime)break;e++}for(var f=this._zones.length-1;f>=0;){if(b.getTime()>this._zones[f].startTime)break;f--}for(e=e;e<=f;e++){var h=this._zones[e],i=new Date(Math.max(a.getTime(),h.startTime)),j=new Date(Math.min(b.getTime(),h.endTime));SimileAjax.DateTime.roundDownToInterval(i,
h.unit,c,h.multiple,this._theme.firstDayOfWeek);for(SimileAjax.DateTime.roundUpToInterval(j,h.unit,c,h.multiple,this._theme.firstDayOfWeek);i.getTime()<j.getTime();){this._intervalMarkerLayout.createIntervalMarker(i,d,h.unit,this._markerLayer,this._lineLayer);g(i,h)}}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.HotZoneGregorianEtherPainter.prototype.softPaint=function(){};
Timeline.HotZoneGregorianEtherPainter.prototype.zoom=function(a){if(a!=0)for(var b=0;b<this._zones.length;++b)if(this._zones[b])this._zones[b].unit+=a};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(a,b){this._band=a;this._timeline=b;this._backgroundLayer=a.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.className="timeline-ether-bg";this._lineLayer=this._markerLayer=null;var c="align"in this._params?this._params.align:this._theme.ether.interval.marker[b.isHorizontal()?"hAlign":"vAlign"];this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,
this._theme,c,"showLine"in this._params?this._params.showLine:this._theme.ether.interval.line.show);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(){this._markerLayer&&this._band.removeLayerDiv(this._markerLayer);this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";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 a=new Date(this._startDate.getTime()),b=
this._band.getMaxDate(),c=this._band.getMinDate().getUTCFullYear()-this._startDate.getUTCFullYear();a.setUTCFullYear(this._band.getMinDate().getUTCFullYear()-c%this._multiple);var d=this;c=function(e){for(var f=0;f<d._multiple;f++)SimileAjax.DateTime.incrementByInterval(e,SimileAjax.DateTime.YEAR)};for(var g={labelInterval:function(e){e=e.getUTCFullYear()-d._startDate.getUTCFullYear();return{text:e,emphasized:e==0}}};a.getTime()<b.getTime();){this._intervalMarkerLayout.createIntervalMarker(a,g,SimileAjax.DateTime.YEAR,
this._markerLayer,this._lineLayer);c(a)}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(a,b){this._band=a;this._timeline=b;this._backgroundLayer=a.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.className="timeline-ether-bg";this._lineLayer=this._markerLayer=null;var c="align"in this._params?this._params.align:this._theme.ether.interval.marker[b.isHorizontal()?"hAlign":"vAlign"];this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,
this._theme,c,"showLine"in this._params?this._params.showLine:this._theme.ether.interval.line.show);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(){this._markerLayer&&this._band.removeLayerDiv(this._markerLayer);this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";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 a=new Date(0),b=this._band.getMaxDate();
a.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(),this._band.getMinDate().getUTCFullYear()));a.setUTCMonth(this._startDate.getUTCMonth());for(var c=this,d={labelInterval:function(g){var e=(4+(g.getUTCMonth()-c._startDate.getUTCMonth())/3)%4;return e!=0?{text:"Q"+(e+1),emphasized:false}:{text:"Y"+(g.getUTCFullYear()-c._startDate.getUTCFullYear()+1),emphasized:true}}};a.getTime()<b.getTime();){this._intervalMarkerLayout.createIntervalMarker(a,d,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);
a.setUTCMonth(a.getUTCMonth()+3)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.QuarterlyEtherPainter.prototype.softPaint=function(){};
Timeline.EtherIntervalMarkerLayout=function(a,b,c,d,g){var e=a.isHorizontal();this.positionDiv=e?d=="Top"?function(j,l){j.style.left=l+"px";j.style.top="0px"}:function(j,l){j.style.left=l+"px";j.style.bottom="0px"}:d=="Left"?function(j,l){j.style.top=l+"px";j.style.left="0px"}:function(j,l){j.style.top=l+"px";j.style.right="0px"};var f=c.ether.interval.line,h=c.ether.interval.weekend,i=SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY];this.createIntervalMarker=function(j,l,k,n,p){var m=
Math.round(b.dateToPixelOffset(j));if(g&&k!=SimileAjax.DateTime.WEEK){var o=a.getDocument().createElement("div");o.className="timeline-ether-lines";f.opacity<100&&SimileAjax.Graphics.setOpacity(o,f.opacity);if(e)o.style.left=m+"px";else o.style.top=m+"px";p.appendChild(o)}if(k==SimileAjax.DateTime.WEEK){o=c.firstDayOfWeek;o=new Date(j.getTime()+(6-o-7)*i);var r=new Date(o.getTime()+2*i);o=Math.round(b.dateToPixelOffset(o));r=Math.round(b.dateToPixelOffset(r));r=Math.max(1,r-o);var s=a.getDocument().createElement("div");
s.className="timeline-ether-weekends";h.opacity<100&&SimileAjax.Graphics.setOpacity(s,h.opacity);if(e){s.style.left=o+"px";s.style.width=r+"px"}else{s.style.top=o+"px";s.style.height=r+"px"}p.appendChild(s)}j=l.labelInterval(j,k);l=a.getDocument().createElement("div");l.innerHTML=j.text;l.className="timeline-date-label";if(j.emphasized)l.className+=" timeline-date-label-em";this.positionDiv(l,m);n.appendChild(l);return l}};
Timeline.EtherHighlight=function(a,b,c,d){var g=a.isHorizontal();this._highlightDiv=null;this._createHighlightDiv=function(){if(this._highlightDiv==null){this._highlightDiv=a.getDocument().createElement("div");this._highlightDiv.setAttribute("name","ether-highlight");this._highlightDiv.className="timeline-ether-highlight";var e=c.ether.highlightOpacity;e<100&&SimileAjax.Graphics.setOpacity(this._highlightDiv,e);d.appendChild(this._highlightDiv)}};this.position=function(e,f,h,i){h=h||0;i=i||1;this._createHighlightDiv();
e=Math.round(b.dateToPixelOffset(e));f=Math.round(b.dateToPixelOffset(f));f=Math.max(f-e,3);var j=b.getViewWidth()-4;if(g){this._highlightDiv.style.left=e+"px";this._highlightDiv.style.width=f+"px";this._highlightDiv.style.top=Math.round(h*j)+"px";this._highlightDiv.style.height=Math.round(i*j)+"px"}else{this._highlightDiv.style.top=e+"px";this._highlightDiv.style.height=f+"px";this._highlightDiv.style.left=Math.round(h*j)+"px";this._highlightDiv.style.width=Math.round(i*j)+"px"}}};
Timeline.LinearEther=function(a){this._params=a;this._interval=a.interval;this._pixelsPerInterval=a.pixelsPerInterval};
Timeline.LinearEther.prototype.initialize=function(a,b){this._band=a;this._timeline=b;this._unit=b.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{this._start="centersOn"in this._params?this._unit.parseFromObject(this._params.centersOn):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(a){this._start=this._unit.change(this._start,this._interval*a/this._pixelsPerInterval)};Timeline.LinearEther.prototype.dateToPixelOffset=function(a){return this._pixelsPerInterval*this._unit.compare(a,this._start)/this._interval};Timeline.LinearEther.prototype.pixelOffsetToDate=function(a){return this._unit.change(this._start,a*this._interval/this._pixelsPerInterval)};
Timeline.LinearEther.prototype.zoom=function(a){var b=0;var c=b=this._band._zoomIndex;if(a&&b>0)c=b-1;if(!a&&b<this._band._zoomSteps.length-1)c=b+1;this._band._zoomIndex=c;this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[c].unit];this._pixelsPerInterval=this._band._zoomSteps[c].pixelsPerInterval;return b=this._band._zoomSteps[c].unit-this._band._zoomSteps[b].unit};
Timeline.HotZoneEther=function(a){this._params=a;this._interval=a.interval;this._pixelsPerInterval=a.pixelsPerInterval;this._theme=a.theme};
Timeline.HotZoneEther.prototype.initialize=function(a,b){this._band=a;this._timeline=b;this._unit=b.getUnit();this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}];for(var c=this._params,d=0;d<c.zones.length;d++)for(var g=c.zones[d],e=this._unit.parseFromObject(g.start),f=this._unit.parseFromObject(g.end),h=0;h<this._zones.length&&this._unit.compare(f,e)>0;h++){var i=this._zones[h];if(this._unit.compare(e,i.endTime)<0){if(this._unit.compare(e,i.startTime)>0){this._zones.splice(h,
0,{startTime:i.startTime,endTime:e,magnify:i.magnify});h++;i.startTime=e}if(this._unit.compare(f,i.endTime)<0){this._zones.splice(h,0,{startTime:e,endTime:f,magnify:g.magnify*i.magnify});h++;e=i.startTime=f}else{i.magnify*=g.magnify;e=i.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{this._start="centersOn"in
this._params?this._unit.parseFromObject(this._params.centersOn):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(a){var b=0;var c=b=this._band._zoomIndex;if(a&&b>0)c=b-1;if(!a&&b<this._band._zoomSteps.length-1)c=b+1;this._band._zoomIndex=c;this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[c].unit];this._pixelsPerInterval=this._band._zoomSteps[c].pixelsPerInterval;return b=this._band._zoomSteps[c].unit-this._band._zoomSteps[b].unit};
Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(a,b){var c=this._getScale(),d=a,g=0;if(this._unit.compare(d,b)<0){for(var e=0;e<this._zones.length;){if(this._unit.compare(d,this._zones[e].endTime)<0)break;e++}for(;this._unit.compare(d,b)<0;){var f=this._zones[e],h=this._unit.earlier(b,f.endTime);g+=this._unit.compare(h,d)/(c/f.magnify);d=h;e++}}else{for(e=this._zones.length-1;e>=0;){if(this._unit.compare(d,this._zones[e].startTime)>0)break;e--}for(;this._unit.compare(d,b)>0;){f=this._zones[e];
h=this._unit.later(b,f.startTime);g+=this._unit.compare(h,d)/(c/f.magnify);d=h;e--}}return g};
Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(a,b){var c=this._getScale(),d=b;if(a>0){for(var g=0;g<this._zones.length;){if(this._unit.compare(d,this._zones[g].endTime)<0)break;g++}for(;a>0;){var e=this._zones[g],f=c/e.magnify;if(e.endTime==Number.POSITIVE_INFINITY){d=this._unit.change(d,a*f);a=0}else{var h=this._unit.compare(e.endTime,d)/f;if(h>a){d=this._unit.change(d,a*f);a=0}else{d=e.endTime;a-=h}}g++}}else{for(g=this._zones.length-1;g>=0;){if(this._unit.compare(d,this._zones[g].startTime)>
0)break;g--}for(a=-a;a>0;){e=this._zones[g];f=c/e.magnify;if(e.startTime==Number.NEGATIVE_INFINITY){d=this._unit.change(d,-a*f);a=0}else{h=this._unit.compare(d,e.startTime)/f;if(h>a){d=this._unit.change(d,-a*f);a=0}else{d=e.startTime;a-=h}}g--}}return d};Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval};Timeline.EventUtils={};
Timeline.EventUtils.getNewEventID=function(){if(this._lastEventID==null)this._lastEventID=0;this._lastEventID+=1;return"e"+this._lastEventID};Timeline.EventUtils.decodeEventElID=function(a){var b=a.split("-");if(b[1]!="tl"){alert("Internal Timeline problem 101, please consult support");return{band:null,evt:null}}a=Timeline.getTimelineFromID(b[2]).getBand(b[3]);b=a.getEventSource.getEvent(b[4]);return{band:a,evt:b}};
Timeline.EventUtils.encodeEventElID=function(a,b,c,d){return c+"-tl-"+a.timelineID+"-"+b.getIndex()+"-"+d.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(a,b){return Timeline.GregorianDateLabeller.monthNames[b][a]};
Timeline.GregorianDateLabeller.prototype.labelInterval=function(a,b){var c=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale];if(c==null)c=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval;return c.call(this,a,b)};Timeline.GregorianDateLabeller.prototype.labelPrecise=function(a){return SimileAjax.DateTime.removeTimeZoneOffset(a,this._timeZone).toUTCString()};
Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(a,b){var c,d=false;a=SimileAjax.DateTime.removeTimeZoneOffset(a,this._timeZone);switch(b){case SimileAjax.DateTime.MILLISECOND:c=a.getUTCMilliseconds();break;case SimileAjax.DateTime.SECOND:c=a.getUTCSeconds();break;case SimileAjax.DateTime.MINUTE:c=a.getUTCMinutes();if(c==0){c=a.getUTCHours()+":00";d=true}else c=c;break;case SimileAjax.DateTime.HOUR:c=a.getUTCHours()+"hr";break;case SimileAjax.DateTime.DAY:c=Timeline.GregorianDateLabeller.getMonthName(a.getUTCMonth(),
this._locale)+" "+a.getUTCDate();break;case SimileAjax.DateTime.WEEK:c=Timeline.GregorianDateLabeller.getMonthName(a.getUTCMonth(),this._locale)+" "+a.getUTCDate();break;case SimileAjax.DateTime.MONTH:c=a.getUTCMonth();if(c!=0){c=Timeline.GregorianDateLabeller.getMonthName(c,this._locale);break}case SimileAjax.DateTime.YEAR:case SimileAjax.DateTime.DECADE:case SimileAjax.DateTime.CENTURY:case SimileAjax.DateTime.MILLENNIUM:d=a.getUTCFullYear();c=d>0?a.getUTCFullYear():1-d+"BC";d=b==SimileAjax.DateTime.MONTH||
b==SimileAjax.DateTime.DECADE&&d%100==0||b==SimileAjax.DateTime.CENTURY&&d%1E3==0;break;default:c=a.toUTCString()}return{text:c,emphasized:d}};Timeline.OriginalEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._eventPaintListeners=[];this._frc=this._highlightMatcher=this._filterMatcher=null;this._eventIdToElmt={}};
Timeline.OriginalEventPainter.prototype.initialize=function(a,b){this._band=a;this._timeline=b;this._eventIdToElmt=this._highlightLayer=this._lineLayer=this._eventLayer=this._backLayer=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(a){for(var b=0;b<this._onSelectListeners.length;b++)if(this._onSelectListeners[b]==a){this._onSelectListeners.splice(b,1);break}};Timeline.OriginalEventPainter.prototype.addEventPaintListener=function(a){this._eventPaintListeners.push(a)};
Timeline.OriginalEventPainter.prototype.removeEventPaintListener=function(a){for(var b=0;b<this._eventPaintListeners.length;b++)if(this._eventPaintListeners[b]==a){this._eventPaintListeners.splice(b,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 a=this._band.getEventSource();if(a!=null){this._eventIdToElmt={};this._fireEventPaintListeners("paintStarting",null,null);this._prepareForPainting();var b=this._computeMetrics(),c=this._band.getMinDate(),d=this._band.getMaxDate(),g=this._filterMatcher!=null?this._filterMatcher:function(){return true},e=this._highlightMatcher!=null?this._highlightMatcher:function(){return-1};for(a=a.getEventReverseIterator(c,d);a.hasNext();){c=a.next();g(c)&&
this.paintEvent(c,b,this._params.theme,e(c))}this._highlightLayer.style.display="block";this._lineLayer.style.display="block";this._eventLayer.style.display="block";this._band.updateEventTrackInfo(this._tracks.length,b.trackIncrement);this._fireEventPaintListeners("paintEnded",null,null);this._setOrthogonalOffset(b)}};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(){this._highlightLayer.style.top=this._lineLayer.style.top=this._eventLayer.style.top=this._band.getViewOrthogonalOffset()+"px"};
Timeline.OriginalEventPainter.prototype._computeMetrics=function(){var a=this._params.theme.event,b=Math.max(a.track.height,a.tape.height+this._frc.getLineHeight());return{trackOffset:a.track.offset,trackHeight:b,trackGap:a.track.gap,trackIncrement:b+a.track.gap,icon:a.instant.icon,iconWidth:a.instant.iconWidth,iconHeight:a.instant.iconHeight,labelWidth:a.label.width,maxLabelChar:a.label.maxLabelChar,impreciseIconMargin:a.instant.impreciseIconMargin}};
Timeline.OriginalEventPainter.prototype._prepareForPainting=function(){var a=this._band;if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");this._backLayer.style.visibility="hidden";var b=document.createElement("span");b.className="timeline-event-label";this._backLayer.appendChild(b);this._frc=SimileAjax.Graphics.getFontRenderingContext(b)}this._frc.update();this._tracks=[];this._highlightLayer!=null&&a.removeLayerDiv(this._highlightLayer);this._highlightLayer=
a.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";this._lineLayer!=null&&a.removeLayerDiv(this._lineLayer);this._lineLayer=a.createLayerDiv(110,"timeline-band-lines");this._lineLayer.style.display="none";this._eventLayer!=null&&a.removeLayerDiv(this._eventLayer);this._eventLayer=a.createLayerDiv(115,"timeline-band-events");this._eventLayer.style.display="none"};
Timeline.OriginalEventPainter.prototype.paintEvent=function(a,b,c,d){a.isInstant()?this.paintInstantEvent(a,b,c,d):this.paintDurationEvent(a,b,c,d)};Timeline.OriginalEventPainter.prototype.paintInstantEvent=function(a,b,c,d){a.isImprecise()?this.paintImpreciseInstantEvent(a,b,c,d):this.paintPreciseInstantEvent(a,b,c,d)};Timeline.OriginalEventPainter.prototype.paintDurationEvent=function(a,b,c,d){a.isImprecise()?this.paintImpreciseDurationEvent(a,b,c,d):this.paintPreciseDurationEvent(a,b,c,d)};
Timeline.OriginalEventPainter.prototype.paintPreciseInstantEvent=function(a,b,c,d){this._timeline.getDocument();var g=a.getText(),e=a.getStart();e=Math.round(this._band.dateToPixelOffset(e));var f=Math.round(e+b.iconWidth/2);e=Math.round(e-b.iconWidth/2);var h=this._getLabelDivClassName(a),i=this._frc.computeSize(g,h),j=f+c.event.label.offsetFromLine;f=this._findFreeTrack(a,j+i.width);var l=Math.round(b.trackOffset+f*b.trackIncrement+b.trackHeight/2-i.height/2),k=this._paintEventIcon(a,f,e,b,c,0);
g=this._paintEventLabel(a,g,j,l,i.width,i.height,c,h,d);b=[k.elmt,g.elmt];var n=this;h=function(p,m){return n._onClickInstantEvent(k.elmt,m,a)};SimileAjax.DOM.registerEvent(k.elmt,"mousedown",h);SimileAjax.DOM.registerEvent(g.elmt,"mousedown",h);c=this._createHighlightDiv(d,k,c,a);c!=null&&b.push(c);this._fireEventPaintListeners("paintedEvent",a,b);this._eventIdToElmt[a.getID()]=k.elmt;this._tracks[f]=e};
Timeline.OriginalEventPainter.prototype.paintImpreciseInstantEvent=function(a,b,c,d){this._timeline.getDocument();var g=a.getText(),e=a.getStart(),f=a.getEnd(),h=Math.round(this._band.dateToPixelOffset(e)),i=Math.round(this._band.dateToPixelOffset(f));e=Math.round(h+b.iconWidth/2);f=Math.round(h-b.iconWidth/2);var j=this._getLabelDivClassName(a),l=this._frc.computeSize(g,j),k=e+c.event.label.offsetFromLine;e=this._findFreeTrack(a,Math.max(k+l.width,i));var n=c.event.tape.height,p=Math.round(b.trackOffset+
e*b.trackIncrement+n),m=this._paintEventIcon(a,e,f,b,c,n);g=this._paintEventLabel(a,g,k,p,l.width,l.height,c,j,d);j=a.getColor();j=j!=null?j:c.event.instant.impreciseColor;h=this._paintEventTape(a,e,h,i,j,c.event.instant.impreciseOpacity,b,c,0);b=[m.elmt,g.elmt,h.elmt];var o=this;i=function(r,s){return o._onClickInstantEvent(m.elmt,s,a)};SimileAjax.DOM.registerEvent(m.elmt,"mousedown",i);SimileAjax.DOM.registerEvent(h.elmt,"mousedown",i);SimileAjax.DOM.registerEvent(g.elmt,"mousedown",i);c=this._createHighlightDiv(d,
m,c,a);c!=null&&b.push(c);this._fireEventPaintListeners("paintedEvent",a,b);this._eventIdToElmt[a.getID()]=m.elmt;this._tracks[e]=f};
Timeline.OriginalEventPainter.prototype.paintPreciseDurationEvent=function(a,b,c,d){this._timeline.getDocument();var g=a.getText(),e=a.getStart(),f=a.getEnd();e=Math.round(this._band.dateToPixelOffset(e));var h=Math.round(this._band.dateToPixelOffset(f)),i=this._getLabelDivClassName(a),j=this._frc.computeSize(g,i);f=this._findFreeTrack(a,Math.max(e+j.width,h));var l=Math.round(b.trackOffset+f*b.trackIncrement+c.event.tape.height),k=a.getColor();k=k!=null?k:c.event.duration.color;var n=this._paintEventTape(a,
f,e,h,k,100,b,c,0);g=this._paintEventLabel(a,g,e,l,j.width,j.height,c,i,d);b=[n.elmt,g.elmt];var p=this;h=function(m,o){return p._onClickDurationEvent(n.elmt,o,a)};SimileAjax.DOM.registerEvent(n.elmt,"mousedown",h);SimileAjax.DOM.registerEvent(g.elmt,"mousedown",h);c=this._createHighlightDiv(d,n,c,a);c!=null&&b.push(c);this._fireEventPaintListeners("paintedEvent",a,b);this._eventIdToElmt[a.getID()]=n.elmt;this._tracks[f]=e};
Timeline.OriginalEventPainter.prototype.paintImpreciseDurationEvent=function(a,b,c,d){this._timeline.getDocument();var g=a.getText(),e=a.getStart(),f=a.getLatestStart(),h=a.getEnd(),i=a.getEarliestEnd();e=Math.round(this._band.dateToPixelOffset(e));f=Math.round(this._band.dateToPixelOffset(f));h=Math.round(this._band.dateToPixelOffset(h));var j=Math.round(this._band.dateToPixelOffset(i)),l=this._getLabelDivClassName(a),k=this._frc.computeSize(g,l);i=this._findFreeTrack(a,Math.max(f+k.width,h));var n=
Math.round(b.trackOffset+i*b.trackIncrement+c.event.tape.height),p=a.getColor();p=p!=null?p:c.event.duration.color;h=this._paintEventTape(a,i,e,h,c.event.duration.impreciseColor,c.event.duration.impreciseOpacity,b,c,0);var m=this._paintEventTape(a,i,f,j,p,100,b,c,1);b=this._paintEventLabel(a,g,f,n,k.width,k.height,c,l,d);g=[h.elmt,m.elmt,b.elmt];var o=this;f=function(r,s){return o._onClickDurationEvent(m.elmt,s,a)};SimileAjax.DOM.registerEvent(m.elmt,"mousedown",f);SimileAjax.DOM.registerEvent(b.elmt,
"mousedown",f);c=this._createHighlightDiv(d,m,c,a);c!=null&&g.push(c);this._fireEventPaintListeners("paintedEvent",a,g);this._eventIdToElmt[a.getID()]=m.elmt;this._tracks[i]=e};Timeline.OriginalEventPainter.prototype._encodeEventElID=function(a,b){return Timeline.EventUtils.encodeEventElID(this._timeline,this._band,a,b)};Timeline.OriginalEventPainter.prototype._findFreeTrack=function(a,b){var c=a.getTrackNum();if(c!=null)return c;for(c=0;c<this._tracks.length;c++)if(this._tracks[c]>b)break;return c};
Timeline.OriginalEventPainter.prototype._paintEventIcon=function(a,b,c,d,g,e){g=a.getIcon();g=g!=null?g:d.icon;b=e>0?d.trackOffset+b*d.trackIncrement+e+d.impreciseIconMargin:Math.round(d.trackOffset+b*d.trackIncrement+d.trackHeight/2-d.iconHeight/2);e=SimileAjax.Graphics.createTranslucentImage(g);g=this._timeline.getDocument().createElement("div");g.className=this._getElClassName("timeline-event-icon",a,"icon");g.id=this._encodeEventElID("icon",a);g.style.left=c+"px";g.style.top=b+"px";g.appendChild(e);
if(a._title!=null)g.title=a._title;this._eventLayer.appendChild(g);return{left:c,top:b,width:d.iconWidth,height:d.iconHeight,elmt:g}};
Timeline.OriginalEventPainter.prototype._paintEventLabel=function(a,b,c,d,g,e,f,h,i){var j=this._timeline.getDocument().createElement("div");j.className=h;j.id=this._encodeEventElID("label",a);j.style.left=c+"px";j.style.width=g+"px";j.style.top=d+"px";j.innerHTML=b;if(a._title!=null)j.title=a._title;b=a.getTextColor();if(b==null)b=a.getColor();if(b!=null)j.style.color=b;if(f.event.highlightLabelBackground&&i>=0)j.style.background=this._getHighlightColor(i,f);this._eventLayer.appendChild(j);return{left:c,
top:d,width:g,height:e,elmt:j}};
Timeline.OriginalEventPainter.prototype._paintEventTape=function(a,b,c,d,g,e,f,h,i){d=d-c;h=h.event.tape.height;b=f.trackOffset+b*f.trackIncrement;f=this._timeline.getDocument().createElement("div");f.className=this._getElClassName("timeline-event-tape",a,"tape");f.id=this._encodeEventElID("tape"+i,a);f.style.left=c+"px";f.style.width=d+"px";f.style.height=h+"px";f.style.top=b+"px";if(a._title!=null)f.title=a._title;if(g!=null)f.style.backgroundColor=g;g=a.getTapeImage();a=a.getTapeRepeat();a=a!=
null?a:"repeat";if(g!=null){f.style.backgroundImage="url("+g+")";f.style.backgroundRepeat=a}SimileAjax.Graphics.setOpacity(f,e);this._eventLayer.appendChild(f);return{left:c,top:b,width:d,height:h,elmt:f}};Timeline.OriginalEventPainter.prototype._getLabelDivClassName=function(a){return this._getElClassName("timeline-event-label",a,"label")};Timeline.OriginalEventPainter.prototype._getElClassName=function(a,b,c){b=b.getClassName();var d=[];if(b){c&&d.push(c+"-"+b+" ");d.push(b+" ")}d.push(a);return d.join("")};
Timeline.OriginalEventPainter.prototype._getHighlightColor=function(a,b){var c=b.event.highlightColors;return c[Math.min(a,c.length-1)]};
Timeline.OriginalEventPainter.prototype._createHighlightDiv=function(a,b,c,d){var g=null;if(a>=0){g=this._timeline.getDocument();a=this._getHighlightColor(a,c);g=g.createElement("div");g.className=this._getElClassName("timeline-event-highlight",d,"highlight");g.id=this._encodeEventElID("highlight0",d);g.style.position="absolute";g.style.overflow="hidden";g.style.left=b.left-2+"px";g.style.width=b.width+4+"px";g.style.top=b.top-2+"px";g.style.height=b.height+4+"px";g.style.background=a;this._highlightLayer.appendChild(g)}return g};
Timeline.OriginalEventPainter.prototype._onClickInstantEvent=function(a,b,c){var d=SimileAjax.DOM.getPageCoordinates(a);this._showBubble(d.left+Math.ceil(a.offsetWidth/2),d.top+Math.ceil(a.offsetHeight/2),c);this._fireOnSelect(c.getID());b.cancelBubble=true;SimileAjax.DOM.cancelEvent(b);return false};
Timeline.OriginalEventPainter.prototype._onClickDurationEvent=function(a,b,c){if("pageX"in b){a=b.pageX;var d=b.pageY}else{d=SimileAjax.DOM.getPageCoordinates(a);a=b.offsetX+d.left;d=b.offsetY+d.top}this._showBubble(a,d,c);this._fireOnSelect(c.getID());b.cancelBubble=true;SimileAjax.DOM.cancelEvent(b);return false};
Timeline.OriginalEventPainter.prototype.showBubble=function(a){var b=this._eventIdToElmt[a.getID()];if(b){var c=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(c.left+b.offsetWidth/2,c.top+b.offsetHeight/2,a)}};
Timeline.OriginalEventPainter.prototype._showBubble=function(a,b,c){var d=document.createElement("div"),g=this._params.theme.event.bubble;c.fillInfoBubble(d,this._params.theme,this._band.getLabeller());SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(d,a,b,g.width,null,g.maxHeight)};Timeline.OriginalEventPainter.prototype._fireOnSelect=function(a){for(var b=0;b<this._onSelectListeners.length;b++)this._onSelectListeners[b](a)};
Timeline.OriginalEventPainter.prototype._fireEventPaintListeners=function(a,b,c){for(var d=0;d<this._eventPaintListeners.length;d++)this._eventPaintListeners[d](this._band,a,b,c)};Timeline.OverviewEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._highlightMatcher=this._filterMatcher=null};Timeline.OverviewEventPainter.prototype.initialize=function(a,b){this._band=a;this._timeline=b;this._highlightLayer=this._eventLayer=null};Timeline.OverviewEventPainter.prototype.getType=function(){return"overview"};
Timeline.OverviewEventPainter.prototype.addOnSelectListener=function(a){this._onSelectListeners.push(a)};Timeline.OverviewEventPainter.prototype.removeOnSelectListener=function(a){for(var b=0;b<this._onSelectListeners.length;b++)if(this._onSelectListeners[b]==a){this._onSelectListeners.splice(b,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 a=this._band.getEventSource();if(a!=null){this._prepareForPainting();var b=this._params.theme.event;b={trackOffset:b.overviewTrack.offset,trackHeight:b.overviewTrack.height,trackGap:b.overviewTrack.gap,trackIncrement:b.overviewTrack.height+b.overviewTrack.gap};var c=this._band.getMinDate(),d=this._band.getMaxDate(),g=this._filterMatcher!=null?this._filterMatcher:function(){return true},e=this._highlightMatcher!=null?this._highlightMatcher:
function(){return-1};for(a=a.getEventReverseIterator(c,d);a.hasNext();){c=a.next();g(c)&&this.paintEvent(c,b,this._params.theme,e(c))}this._highlightLayer.style.display="block";this._eventLayer.style.display="block";this._band.updateEventTrackInfo(this._tracks.length,b.trackIncrement)}};Timeline.OverviewEventPainter.prototype.softPaint=function(){};
Timeline.OverviewEventPainter.prototype._prepareForPainting=function(){var a=this._band;this._tracks=[];this._highlightLayer!=null&&a.removeLayerDiv(this._highlightLayer);this._highlightLayer=a.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";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(a,b,c,d){a.isInstant()?this.paintInstantEvent(a,b,c,d):this.paintDurationEvent(a,b,c,d)};Timeline.OverviewEventPainter.prototype.paintInstantEvent=function(a,b,c,d){var g=a.getStart();g=Math.round(this._band.dateToPixelOffset(g));var e=a.getColor();e=a.getClassName()?null:e!=null?e:c.event.duration.color;a=this._paintEventTick(a,g,e,100,b,c);this._createHighlightDiv(d,a,c)};
Timeline.OverviewEventPainter.prototype.paintDurationEvent=function(a,b,c,d){var g=a.getLatestStart(),e=a.getEarliestEnd();g=Math.round(this._band.dateToPixelOffset(g));e=Math.round(this._band.dateToPixelOffset(e));for(var f=0;f<this._tracks.length;f++)if(e<this._tracks[f])break;this._tracks[f]=e;var h=a.getColor(),i=a.getClassName();h=i?null:h!=null?h:c.event.duration.color;a=this._paintEventTape(a,f,g,e,h,100,b,c,i);this._createHighlightDiv(d,a,c)};
Timeline.OverviewEventPainter.prototype._paintEventTape=function(a,b,c,d,g,e,f,h,i){a=f.trackOffset+b*f.trackIncrement;d=d-c;f=f.trackHeight;b=this._timeline.getDocument().createElement("div");b.className="timeline-small-event-tape";if(i)b.className+=" small-"+i;b.style.left=c+"px";b.style.width=d+"px";b.style.top=a+"px";b.style.height=f+"px";if(g)b.style.backgroundColor=g;e<100&&SimileAjax.Graphics.setOpacity(b,e);this._eventLayer.appendChild(b);return{left:c,top:a,width:d,height:f,elmt:b}};
Timeline.OverviewEventPainter.prototype._paintEventTick=function(a,b,c,d,g,e){c=e.event.overviewTrack.tickHeight;g=g.trackOffset-c;e=this._timeline.getDocument().createElement("div");e.className="timeline-small-event-icon";e.style.left=b+"px";e.style.top=g+"px";if(a=a.getClassName())e.className+=" small-"+a;d<100&&SimileAjax.Graphics.setOpacity(e,d);this._eventLayer.appendChild(e);return{left:b,top:g,width:1,height:c,elmt:e}};
Timeline.OverviewEventPainter.prototype._createHighlightDiv=function(a,b,c){if(a>=0){var d=this._timeline.getDocument();c=c.event;a=c.highlightColors[Math.min(a,c.highlightColors.length-1)];d=d.createElement("div");d.style.position="absolute";d.style.overflow="hidden";d.style.left=b.left-1+"px";d.style.width=b.width+2+"px";d.style.top=b.top-1+"px";d.style.height=b.height+2+"px";d.style.background=a;this._highlightLayer.appendChild(d)}};Timeline.OverviewEventPainter.prototype.showBubble=function(){};
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(a){for(var b=0;b<this._listeners.length;b++)if(this._listeners[b]==a){this._listeners.splice(b,1);break}};
Timeline.DefaultEventSource.prototype.loadXML=function(a,b){var c=this._getBaseURL(b),d=a.documentElement.getAttribute("wiki-url"),g=a.documentElement.getAttribute("wiki-section"),e=a.documentElement.getAttribute("date-time-format");e=this._events.getUnit().getParser(e);for(var f=a.documentElement.firstChild,h=false;f!=null;){if(f.nodeType==1){h="";if(f.firstChild!=null&&f.firstChild.nodeType==3)h=f.firstChild.nodeValue;var i=f.getAttribute("isDuration")===null&&f.getAttribute("durationEvent")===
null||f.getAttribute("isDuration")=="false"||f.getAttribute("durationEvent")=="false";h=new Timeline.DefaultEventSource.Event({id:f.getAttribute("id"),start:e(f.getAttribute("start")),end:e(f.getAttribute("end")),latestStart:e(f.getAttribute("latestStart")),earliestEnd:e(f.getAttribute("earliestEnd")),instant:i,text:f.getAttribute("title"),description:h,image:this._resolveRelativeURL(f.getAttribute("image"),c),link:this._resolveRelativeURL(f.getAttribute("link"),c),icon:this._resolveRelativeURL(f.getAttribute("icon"),
c),color:f.getAttribute("color"),textColor:f.getAttribute("textColor"),hoverText:f.getAttribute("hoverText"),classname:f.getAttribute("classname"),tapeImage:f.getAttribute("tapeImage"),tapeRepeat:f.getAttribute("tapeRepeat"),caption:f.getAttribute("caption"),eventID:f.getAttribute("eventID"),trackNum:f.getAttribute("trackNum")});h._node=f;h.getProperty=function(j){return this._node.getAttribute(j)};h.setWikiInfo(d,g);this._events.add(h);h=true}f=f.nextSibling}h&&this._fire("onAddMany",[])};
Timeline.DefaultEventSource.prototype.loadJSON=function(a,b){var c=this._getBaseURL(b),d=false;if(a&&a.events){var g="wikiURL"in a?a.wikiURL:null,e="wikiSection"in a?a.wikiSection:null,f="dateTimeFormat"in a?a.dateTimeFormat:null;f=this._events.getUnit().getParser(f);for(var h=0;h<a.events.length;h++){d=a.events[h];var i=d.isDuration||"durationEvent"in d&&!d.durationEvent||"de"in d&&!d.de;i=new Timeline.DefaultEventSource.Event({id:"id"in d?d.id:undefined,start:f(d.start||d.s),end:f(d.end||d.e),latestStart:f(d.latestStart||
d.ls),earliestEnd:f(d.earliestEnd||d.ee),instant:i,text:d.title||d.t,description:d.description||d.d,image:this._resolveRelativeURL(d.image,c),link:this._resolveRelativeURL(d.link,c),icon:this._resolveRelativeURL(d.icon,c),color:d.color,textColor:d.textColor,hoverText:d.hoverText,classname:d.classname||d.c,tapeImage:d.tapeImage,tapeRepeat:d.tapeRepeat,caption:d.caption,eventID:d.eventID||d.eid,trackNum:d.trackNum});i._obj=d;i.getProperty=function(j){return this._obj[j]};i.setWikiInfo(g,e);this._events.add(i);
d=true}}d&&this._fire("onAddMany",[])};
Timeline.DefaultEventSource.prototype.loadSPARQL=function(a,b){var c=this._getBaseURL(b),d=this._events.getUnit().getParser("iso8601");if(a!=null){for(var g=a.documentElement.firstChild;g!=null&&(g.nodeType!=1||g.nodeName!="results");)g=g.nextSibling;var e=null,f=null;if(g!=null){e=g.getAttribute("wiki-url");f=g.getAttribute("wiki-section");g=g.firstChild}for(var h=false;g!=null;){if(g.nodeType==1){h={};for(var i=g.firstChild;i!=null;){if(i.nodeType==1&&i.firstChild!=null&&i.firstChild.nodeType==
1&&i.firstChild.firstChild!=null&&i.firstChild.firstChild.nodeType==3)h[i.getAttribute("name")]=i.firstChild.firstChild.nodeValue;i=i.nextSibling}if(h.start==null&&h.date!=null)h.start=h.date;i=h.isDuration===null&&h.durationEvent===null||h.isDuration=="false"||h.durationEvent=="false";i=new Timeline.DefaultEventSource.Event({id:h.id,start:d(h.start),end:d(h.end),latestStart:d(h.latestStart),earliestEnd:d(h.earliestEnd),instant:i,text:h.title,description:h.description,image:this._resolveRelativeURL(h.image,
c),link:this._resolveRelativeURL(h.link,c),icon:this._resolveRelativeURL(h.icon,c),color:h.color,textColor:h.textColor,hoverText:h.hoverText,caption:h.caption,classname:h.classname,tapeImage:h.tapeImage,tapeRepeat:h.tapeRepeat,eventID:h.eventID,trackNum:h.trackNum});i._bindings=h;i.getProperty=function(j){return this._bindings[j]};i.setWikiInfo(e,f);this._events.add(i);h=true}g=g.nextSibling}h&&this._fire("onAddMany",[])}};
Timeline.DefaultEventSource.prototype.add=function(a){this._events.add(a);this._fire("onAddOne",[a])};Timeline.DefaultEventSource.prototype.addMany=function(a){for(var b=0;b<a.length;b++)this._events.add(a[b]);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(a,b){for(var c=0;c<this._listeners.length;c++){var d=this._listeners[c];if(a in d)try{d[a].apply(d,b)}catch(g){SimileAjax.Debug.exception(g)}}};
Timeline.DefaultEventSource.prototype._getBaseURL=function(a){if(a.indexOf("://")<0){var b=this._getBaseURL(document.location.href);a=a.substr(0,1)=="/"?b.substr(0,b.indexOf("/",b.indexOf("://")+3))+a:b+a}b=a.lastIndexOf("/");return b<0?"":a.substr(0,b+1)};Timeline.DefaultEventSource.prototype._resolveRelativeURL=function(a,b){return a==null||a==""?a:a.indexOf("://")>0?a:a.substr(0,1)=="/"?b.substr(0,b.indexOf("/",b.indexOf("://")+3))+a:b+a};
Timeline.DefaultEventSource.Event=function(a){function b(d){return a[d]!=null&&a[d]!=""?a[d]: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;c=[];if(this._start>this._latestStart){this._latestStart=this._start;c.push("start is > latestStart")}if(this._start>
this._earliestEnd){this._earliestEnd=this._latestStart;c.push("start is > earliestEnd")}if(this._start>this._end){this._end=this._earliestEnd;c.push("start is > end")}if(this._latestStart>this._earliestEnd){this._earliestEnd=this._latestStart;c.push("latestStart is > earliestEnd")}if(this._latestStart>this._end){this._end=this._earliestEnd;c.push("latestStart is > end")}if(this._earliestEnd>this._end){this._end=this._earliestEnd;c.push("earliestEnd is > end")}this._eventID=b("eventID");this._text=
a.text!=null?SimileAjax.HTML.deEntify(a.text):"";if(c.length>0)this._text+=" PROBLEM: "+c.join(", ");this._description=SimileAjax.HTML.deEntify(a.description);this._image=b("image");this._link=b("link");this._title=b("hoverText");this._title=b("caption");this._icon=b("icon");this._color=b("color");this._textColor=b("textColor");this._classname=b("classname");this._tapeImage=b("tapeImage");this._tapeRepeat=b("tapeRepeat");this._trackNum=b("trackNum");if(this._trackNum!=null)this._trackNum=parseInt(this._trackNum);
this._wikiSection=this._wikiURL=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(){return null},getWikiURL:function(){return this._wikiURL},getWikiSection:function(){return this._wikiSection},
setWikiInfo:function(a,b){this._wikiURL=a;this._wikiSection=b},fillDescription:function(a){if(this._description)a.innerHTML=this._description},fillWikiInfo:function(a){a.style.display="none";if(!(this._wikiURL==null||this._wikiSection==null)){var b=this.getProperty("wikiID");if(b==null||b.length==0)b=this.getText();if(!(b==null||b.length==0)){a.style.display="inline";b=b.replace(/\s/g,"_");b=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+b;var c=document.createElement("a");c.href=b;c.target=
"new";c.innerHTML=Timeline.strings[Timeline.clientLocale].wikiLinkLabel;a.appendChild(document.createTextNode("["));a.appendChild(c);a.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(a,b,c){var d=a.ownerDocument,g=this.getText(),e=this.getLink(),f=this.getImage();if(f!=null){var h=d.createElement("img");h.src=f;b.event.bubble.imageStyler(h);a.appendChild(h)}f=d.createElement("div");g=d.createTextNode(g);if(e!=null){h=d.createElement("a");h.href=e;h.appendChild(g);f.appendChild(h)}else f.appendChild(g);b.event.bubble.titleStyler(f);a.appendChild(f);e=d.createElement("div");this.fillDescription(e);b.event.bubble.bodyStyler(e);a.appendChild(e);e=d.createElement("div");
this.fillTime(e,c);b.event.bubble.timeStyler(e);a.appendChild(e);c=d.createElement("div");this.fillWikiInfo(c);b.event.bubble.wikiStyler(c);a.appendChild(c)}};Timeline.ClassicTheme={};Timeline.ClassicTheme.implementations=[];Timeline.ClassicTheme.create=function(a){if(a==null)a=Timeline.getDefaultLocale();a=Timeline.ClassicTheme.implementations[a];if(a==null)a=Timeline.ClassicTheme._Impl;return new a};
Timeline.ClassicTheme._Impl=function(){this.firstDayOfWeek=0;this.autoWidth=false;this.autoWidthAnimationTime=500;this.timeline_stop=this.timeline_start=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.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(a,b,c,d){if(Timeline.timelines==null)Timeline.timelines=[];var g=Timeline.timelines.length;Timeline.timelines[g]=null;a=new Timeline._Impl(a,b,c,d,g);return Timeline.timelines[g]=a};
Timeline.createBandInfo=function(a){var b="theme"in a?a.theme:Timeline.getDefaultTheme(),c="decorators"in a?a.decorators:[],d="eventSource"in a?a.eventSource:null,g=new Timeline.LinearEther({centersOn:"date"in a?a.date:new Date,interval:SimileAjax.DateTime.gregorianUnitLengths[a.intervalUnit],pixelsPerInterval:a.intervalPixels,theme:b}),e=new Timeline.GregorianEtherPainter({unit:a.intervalUnit,multiple:"multiple"in a?a.multiple:1,theme:b,align:"align"in a?a.align:undefined}),f={showText:"showEventText"in
a?a.showEventText:true,theme:b};if("eventPainterParams"in a)for(var h in a.eventPainterParams)f[h]=a.eventPainterParams[h];if("trackHeight"in a)f.trackHeight=a.trackHeight;if("trackGap"in a)f.trackGap=a.trackGap;h="overview"in a&&a.overview?"overview":"layout"in a?a.layout:"original";if("eventPainter"in a)f=new a.eventPainter(f);else switch(h){case "overview":f=new Timeline.OverviewEventPainter(f);break;case "detailed":f=new Timeline.DetailedEventPainter(f);break;default:f=new Timeline.OriginalEventPainter(f)}return{width:a.width,
eventSource:d,timeZone:"timeZone"in a?a.timeZone:0,ether:g,etherPainter:e,eventPainter:f,theme:b,decorators:c,zoomIndex:"zoomIndex"in a?a.zoomIndex:0,zoomSteps:"zoomSteps"in a?a.zoomSteps:null}};
Timeline.createHotZoneBandInfo=function(a){var b="theme"in a?a.theme:Timeline.getDefaultTheme(),c="eventSource"in a?a.eventSource:null,d=new Timeline.HotZoneEther({centersOn:"date"in a?a.date:new Date,interval:SimileAjax.DateTime.gregorianUnitLengths[a.intervalUnit],pixelsPerInterval:a.intervalPixels,zones:a.zones,theme:b}),g=new Timeline.HotZoneGregorianEtherPainter({unit:a.intervalUnit,zones:a.zones,theme:b,align:"align"in a?a.align:undefined}),e={showText:"showEventText"in a?a.showEventText:true,
theme:b};if("eventPainterParams"in a)for(var f in a.eventPainterParams)e[f]=a.eventPainterParams[f];if("trackHeight"in a)e.trackHeight=a.trackHeight;if("trackGap"in a)e.trackGap=a.trackGap;f="overview"in a&&a.overview?"overview":"layout"in a?a.layout:"original";if("eventPainter"in a)e=new a.eventPainter(e);else switch(f){case "overview":e=new Timeline.OverviewEventPainter(e);break;case "detailed":e=new Timeline.DetailedEventPainter(e);break;default:e=new Timeline.OriginalEventPainter(e)}return{width:a.width,
eventSource:c,timeZone:"timeZone"in a?a.timeZone:0,ether:d,etherPainter:g,eventPainter:e,theme:b,zoomIndex:"zoomIndex"in a?a.zoomIndex:0,zoomSteps:"zoomSteps"in a?a.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,b){SimileAjax.XmlHttp.get(a,function(c){alert("Failed to load data xml from "+a+"\n"+c)},function(c){var d=c.responseXML;!d.documentElement&&c.responseStream&&d.load(c.responseStream);b(d,a)})};Timeline.loadJSON=function(a,b){SimileAjax.XmlHttp.get(a,function(c){alert("Failed to load json data from "+a+"\n"+c)},function(c){b(eval("("+c.responseText+")"),a)})};Timeline.getTimelineFromID=function(a){return Timeline.timelines[a]};
Timeline.writeVersion=function(a){document.getElementById(a).innerHTML=this.display_version};
Timeline._Impl=function(a,b,c,d,g){SimileAjax.WindowManager.initialize();this._containerDiv=a;this._bandInfos=b;this._orientation=c==null?Timeline.HORIZONTAL:c;this._unit=d!=null?d:SimileAjax.NativeDateUnit;this._starting=true;this._autoResizing=false;this.autoWidth=b&&b[0]&&b[0].theme&&b[0].theme.autoWidth;this.autoWidthAnimationTime=b&&b[0]&&b[0].theme&&b[0].theme.autoWidthAnimationTime;this.timelineID=g;this.timeline_start=b&&b[0]&&b[0].theme&&b[0].theme.timeline_start;this.timeline_stop=b&&b[0]&&
b[0].theme&&b[0].theme.timeline_stop;this.timeline_at_stop=this.timeline_at_start=false;this._initialize()};Timeline._Impl.prototype.dispose=function(){for(var a=0;a<this._bands.length;a++)this._bands[a].dispose();this._bandInfos=this._bands=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(a,b){var c=this,d=function(e){alert("Failed to load data xml from "+a+"\n"+e);c.hideLoadingMessage()},g=function(e){try{var f=e.responseXML;!f.documentElement&&e.responseStream&&f.load(e.responseStream);b(f,a)}finally{c.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(a,d,g)},0)};
Timeline._Impl.prototype.loadJSON=function(a,b){var c=this,d=function(e){alert("Failed to load json data from "+a+"\n"+e);c.hideLoadingMessage()},g=function(e){try{b(eval("("+e.responseText+")"),a)}finally{c.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(a,d,g)},0)};Timeline._Impl.prototype._autoWidthScrollListener=function(a){a.getTimeline()._autoWidthCheck(false)};
Timeline._Impl.prototype._autoWidthCheck=function(a){function b(){var e=c.getWidthStyle();if(d)c._containerDiv.style[e]=g+"px";else{c._autoResizing=true;var f={};f[e]=g+"px";SimileAjax.jQuery(c._containerDiv).animate(f,c.autoWidthAnimationTime,"linear",function(){c._autoResizing=false})}}var c=this,d=c._starting,g=0;c.autoWidth&&function(){var e=0,f=c.getPixelWidth();if(!c._autoResizing){for(var h=0;h<c._bands.length;h++){c._bands[h].checkAutoWidth();e+=c._bandInfos[h].width}if(e>f||a){g=e;b();c._distributeWidths()}}}()};
Timeline._Impl.prototype._initialize=function(){var a=this._containerDiv,b=a.ownerDocument;a.className=a.className.split(" ").concat("timeline-container").join(" ");var c=this.isHorizontal()?"horizontal":"vertical";for(a.className+=" timeline-"+c;a.firstChild;)a.removeChild(a.firstChild);c=SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix+(this.isHorizontal()?"images/copyright-vertical.png":"images/copyright.png"));c.className="timeline-copyright";c.title="SIMILE Timeline - http://www.simile-widgets.org/";
SimileAjax.DOM.registerEvent(c,"click",function(){window.location="http://www.simile-widgets.org/"});a.appendChild(c);this._bands=[];for(c=0;c<this._bandInfos.length;c++)this._bands.push(new Timeline._Band(this,this._bandInfos[c],c));this._distributeWidths();for(c=0;c<this._bandInfos.length;c++){var d=this._bandInfos[c];if("syncWith"in d)this._bands[c].setSyncWithBand(this._bands[d.syncWith],"highlight"in d?d.highlight:false)}if(this.autoWidth)for(c=0;c<this._bands.length;c++)this._bands[c].addOnScrollListener(this._autoWidthScrollListener);
var g=SimileAjax.Graphics.createMessageBubble(b);g.containerDiv.className="timeline-message-container";a.appendChild(g.containerDiv);g.contentDiv.className="timeline-message";g.contentDiv.innerHTML="<img src='"+Timeline.urlPrefix+"images/progress-running.gif' /> Loading...";this.showLoadingMessage=function(){g.containerDiv.style.display="block"};this.hideLoadingMessage=function(){g.containerDiv.style.display="none"}};
Timeline._Impl.prototype._distributeWidths=function(){for(var a=this.getPixelLength(),b=this.getPixelWidth(),c=0,d=0;d<this._bands.length;d++){var g=this._bands[d],e=this._bandInfos[d].width;if(typeof e=="string"){var f=e.indexOf("%");if(f>0){e=parseInt(e.substr(0,f));e=Math.round(e*b/100)}else e=parseInt(e)}else e=e;g.setBandShiftAndWidth(c,e);g.setViewLength(a);c+=e}};
Timeline._Impl.prototype.shiftOK=function(a,b){var c=b>0,d=b<0;if(c&&this.timeline_start==null||d&&this.timeline_stop==null||b==0)return true;for(var g=false,e=0;e<this._bands.length&&!g;e++)g=this._bands[e].busy();if(g)return true;if(c&&this.timeline_at_start||d&&this.timeline_at_stop)return false;d=false;for(e=0;e<this._bands.length&&!d;e++){d=this._bands[e];d=c?(e==a?d.getMinVisibleDateAfterDelta(b):d.getMinVisibleDate())>=this.timeline_start:(e==a?d.getMaxVisibleDateAfterDelta(b):d.getMaxVisibleDate())<=
this.timeline_stop}if(c){this.timeline_at_start=!d;this.timeline_at_stop=false}else{this.timeline_at_stop=!d;this.timeline_at_start=false}return d};Timeline._Impl.prototype.zoom=function(a,b,c,d){var g=null,e=/^timeline-band-([0-9]+)$/.exec(d.id);if(e)g=parseInt(e[1]);g!=null&&this._bands[g].zoom(a,b,c,d);this.paint()};
Timeline.GregorianDateLabeller.monthNames.en=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Timeline.GregorianDateLabeller.dayNames.en=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment