web/data/cubicweb.timeline-bundle.js
changeset 0 b97547f5f1fa
child 67 60a291fe7965
equal deleted inserted replaced
-1:000000000000 0:b97547f5f1fa
       
     1 
       
     2 var SimileAjax = {
       
     3     loaded:                 false,
       
     4     loadingScriptsCount:    0,
       
     5     error:                  null,
       
     6     params:                 { bundle:"true" }
       
     7 };
       
     8 
       
     9 
       
    10 /**
       
    11  * Parse out the query parameters from a URL
       
    12  * @param {String} url    the url to parse, or location.href if undefined
       
    13  * @param {Object} to     optional object to extend with the parameters
       
    14  * @param {Object} types  optional object mapping keys to value types
       
    15  *        (String, Number, Boolean or Array, String by default)
       
    16  * @return a key/value Object whose keys are the query parameter names
       
    17  * @type Object
       
    18  */
       
    19 SimileAjax.parseURLParameters = function(url, to, types) {
       
    20     to = to || {};
       
    21     types = types || {};
       
    22 
       
    23     if (typeof url == "undefined") {
       
    24         url = location.href;
       
    25     }
       
    26     var q = url.indexOf("?");
       
    27     if (q < 0) {
       
    28         return to;
       
    29     }
       
    30     url = (url+"#").slice(q+1, url.indexOf("#")); // toss the URL fragment
       
    31 
       
    32     var params = url.split("&"), param, parsed = {};
       
    33     var decode = window.decodeURIComponent || unescape;
       
    34     for (var i = 0; param = params[i]; i++) {
       
    35         var eq = param.indexOf("=");
       
    36         var name = decode(param.slice(0,eq));
       
    37         var old = parsed[name];
       
    38         if (typeof old == "undefined") {
       
    39             old = [];
       
    40         } else if (!(old instanceof Array)) {
       
    41             old = [old];
       
    42         }
       
    43         parsed[name] = old.concat(decode(param.slice(eq+1)));
       
    44     }
       
    45     for (var i in parsed) {
       
    46         if (!parsed.hasOwnProperty(i)) continue;
       
    47         var type = types[i] || String;
       
    48         var data = parsed[i];
       
    49         if (!(data instanceof Array)) {
       
    50             data = [data];
       
    51         }
       
    52         if (type === Boolean && data[0] == "false") {
       
    53             to[i] = false; // because Boolean("false") === true
       
    54         } else {
       
    55             to[i] = type.apply(this, data);
       
    56         }
       
    57     }
       
    58     return to;
       
    59 };
       
    60 
       
    61 
       
    62 SimileAjax.Platform = new Object();
       
    63 
       
    64 SimileAjax.urlPrefix = baseuri();
       
    65 
       
    66 /* jquery-1.2.6.js */
       
    67 (function(){var _jQuery=window.jQuery,_$=window.$;
       
    68 var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);
       
    69 };
       
    70 var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;
       
    71 jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;
       
    72 if(selector.nodeType){this[0]=selector;
       
    73 this.length=1;
       
    74 return this;
       
    75 }if(typeof selector=="string"){var match=quickExpr.exec(selector);
       
    76 if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context);
       
    77 }else{var elem=document.getElementById(match[3]);
       
    78 if(elem){if(elem.id!=match[3]){return jQuery().find(selector);
       
    79 }return jQuery(elem);
       
    80 }selector=[];
       
    81 }}else{return jQuery(context).find(selector);
       
    82 }}else{if(jQuery.isFunction(selector)){return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);
       
    83 }}return this.setArray(jQuery.makeArray(selector));
       
    84 },jquery:"1.2.6",size:function(){return this.length;
       
    85 },length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];
       
    86 },pushStack:function(elems){var ret=jQuery(elems);
       
    87 ret.prevObject=this;
       
    88 return ret;
       
    89 },setArray:function(elems){this.length=0;
       
    90 Array.prototype.push.apply(this,elems);
       
    91 return this;
       
    92 },each:function(callback,args){return jQuery.each(this,callback,args);
       
    93 },index:function(elem){var ret=-1;
       
    94 return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);
       
    95 },attr:function(name,value,type){var options=name;
       
    96 if(name.constructor==String){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name);
       
    97 }else{options={};
       
    98 options[name]=value;
       
    99 }}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));
       
   100 }});
       
   101 },css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined;
       
   102 }return this.attr(key,value,"curCSS");
       
   103 },text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));
       
   104 }var ret="";
       
   105 jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);
       
   106 }});
       
   107 });
       
   108 return ret;
       
   109 },wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;
       
   110 while(elem.firstChild){elem=elem.firstChild;
       
   111 }return elem;
       
   112 }).append(this);
       
   113 }return this;
       
   114 },wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);
       
   115 });
       
   116 },wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);
       
   117 });
       
   118 },append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem);
       
   119 }});
       
   120 },prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild);
       
   121 }});
       
   122 },before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);
       
   123 });
       
   124 },after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);
       
   125 });
       
   126 },end:function(){return this.prevObject||jQuery([]);
       
   127 },find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);
       
   128 });
       
   129 return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);
       
   130 },clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");
       
   131 container.appendChild(clone);
       
   132 return jQuery.clean([container.innerHTML])[0];
       
   133 }else{return this.cloneNode(true);
       
   134 }});
       
   135 var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null;
       
   136 }});
       
   137 if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return ;
       
   138 }var events=jQuery.data(this,"events");
       
   139 for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);
       
   140 }}});
       
   141 }return ret;
       
   142 },filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);
       
   143 })||jQuery.multiFilter(selector,this));
       
   144 },not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true));
       
   145 }else{selector=jQuery.multiFilter(selector,this);
       
   146 }}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;
       
   147 return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;
       
   148 });
       
   149 },add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=="string"?jQuery(selector):jQuery.makeArray(selector))));
       
   150 },is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0;
       
   151 },hasClass:function(selector){return this.is("."+selector);
       
   152 },val:function(value){if(value==undefined){if(this.length){var elem=this[0];
       
   153 if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";
       
   154 if(index<0){return null;
       
   155 }for(var i=one?index:0,max=one?index+1:options.length;
       
   156 i<max;
       
   157 i++){var option=options[i];
       
   158 if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;
       
   159 if(one){return value;
       
   160 }values.push(value);
       
   161 }}return values;
       
   162 }else{return(this[0].value||"").replace(/\r/g,"");
       
   163 }}return undefined;
       
   164 }if(value.constructor==Number){value+="";
       
   165 }return this.each(function(){if(this.nodeType!=1){return ;
       
   166 }if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);
       
   167 }else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);
       
   168 jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);
       
   169 });
       
   170 if(!values.length){this.selectedIndex=-1;
       
   171 }}else{this.value=value;
       
   172 }}});
       
   173 },html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);
       
   174 },replaceWith:function(value){return this.after(value).remove();
       
   175 },eq:function(i){return this.slice(i,i+1);
       
   176 },slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));
       
   177 },map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);
       
   178 }));
       
   179 },andSelf:function(){return this.add(this.prevObject);
       
   180 },data:function(key,value){var parts=key.split(".");
       
   181 parts[1]=parts[1]?"."+parts[1]:"";
       
   182 if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);
       
   183 if(data===undefined&&this.length){data=jQuery.data(this[0],key);
       
   184 }return data===undefined&&parts[1]?this.data(parts[0]):data;
       
   185 }else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);
       
   186 });
       
   187 }},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);
       
   188 });
       
   189 },domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;
       
   190 return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);
       
   191 if(reverse){elems.reverse();
       
   192 }}var obj=this;
       
   193 if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));
       
   194 }var scripts=jQuery([]);
       
   195 jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;
       
   196 if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);
       
   197 }else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove());
       
   198 }callback.call(obj,elem);
       
   199 }});
       
   200 scripts.each(evalScript);
       
   201 });
       
   202 }};
       
   203 jQuery.fn.init.prototype=jQuery.fn;
       
   204 function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"});
       
   205 }else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");
       
   206 }if(elem.parentNode){elem.parentNode.removeChild(elem);
       
   207 }}function now(){return +new Date;
       
   208 }jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;
       
   209 if(target.constructor==Boolean){deep=target;
       
   210 target=arguments[1]||{};
       
   211 i=2;
       
   212 }if(typeof target!="object"&&typeof target!="function"){target={};
       
   213 }if(length==i){target=this;
       
   214 --i;
       
   215 }for(;
       
   216 i<length;
       
   217 i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];
       
   218 if(target===copy){continue;
       
   219 }if(deep&&copy&&typeof copy=="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);
       
   220 }else{if(copy!==undefined){target[name]=copy;
       
   221 }}}}}return target;
       
   222 };
       
   223 var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};
       
   224 jQuery.extend({noConflict:function(deep){window.$=_$;
       
   225 if(deep){window.jQuery=_jQuery;
       
   226 }return jQuery;
       
   227 },isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");
       
   228 },isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;
       
   229 },globalEval:function(data){data=jQuery.trim(data);
       
   230 if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");
       
   231 script.type="text/javascript";
       
   232 if(jQuery.browser.msie){script.text=data;
       
   233 }else{script.appendChild(document.createTextNode(data));
       
   234 }head.insertBefore(script,head.firstChild);
       
   235 head.removeChild(script);
       
   236 }},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();
       
   237 },cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;
       
   238 var id=elem[expando];
       
   239 if(!id){id=elem[expando]=++uuid;
       
   240 }if(name&&!jQuery.cache[id]){jQuery.cache[id]={};
       
   241 }if(data!==undefined){jQuery.cache[id][name]=data;
       
   242 }return name?jQuery.cache[id][name]:id;
       
   243 },removeData:function(elem,name){elem=elem==window?windowData:elem;
       
   244 var id=elem[expando];
       
   245 if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];
       
   246 name="";
       
   247 for(name in jQuery.cache[id]){break;
       
   248 }if(!name){jQuery.removeData(elem);
       
   249 }}}else{try{delete elem[expando];
       
   250 }catch(e){if(elem.removeAttribute){elem.removeAttribute(expando);
       
   251 }}delete jQuery.cache[id];
       
   252 }},each:function(object,callback,args){var name,i=0,length=object.length;
       
   253 if(args){if(length==undefined){for(name in object){if(callback.apply(object[name],args)===false){break;
       
   254 }}}else{for(;
       
   255 i<length;
       
   256 ){if(callback.apply(object[i++],args)===false){break;
       
   257 }}}}else{if(length==undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break;
       
   258 }}}else{for(var value=object[0];
       
   259 i<length&&callback.call(value,i,value)!==false;
       
   260 value=object[++i]){}}}return object;
       
   261 },prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i);
       
   262 }return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;
       
   263 },className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className;
       
   264 }});
       
   265 },remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className);
       
   266 }).join(" "):"";
       
   267 }},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;
       
   268 }},swap:function(elem,options,callback){var old={};
       
   269 for(var name in options){old[name]=elem.style[name];
       
   270 elem.style[name]=options[name];
       
   271 }callback.call(elem);
       
   272 for(var name in options){elem.style[name]=old[name];
       
   273 }},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];
       
   274 function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;
       
   275 var padding=0,border=0;
       
   276 jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;
       
   277 border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;
       
   278 });
       
   279 val-=Math.round(padding+border);
       
   280 }if(jQuery(elem).is(":visible")){getWH();
       
   281 }else{jQuery.swap(elem,props,getWH);
       
   282 }return Math.max(0,val);
       
   283 }return jQuery.curCSS(elem,name,force);
       
   284 },curCSS:function(elem,name,force){var ret,style=elem.style;
       
   285 function color(elem){if(!jQuery.browser.safari){return false;
       
   286 }var ret=defaultView.getComputedStyle(elem,null);
       
   287 return !ret||ret.getPropertyValue("color")=="";
       
   288 }if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");
       
   289 return ret==""?"1":ret;
       
   290 }if(jQuery.browser.opera&&name=="display"){var save=style.outline;
       
   291 style.outline="0 solid black";
       
   292 style.outline=save;
       
   293 }if(name.match(/float/i)){name=styleFloat;
       
   294 }if(!force&&style&&style[name]){ret=style[name];
       
   295 }else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float";
       
   296 }name=name.replace(/([A-Z])/g,"-$1").toLowerCase();
       
   297 var computedStyle=defaultView.getComputedStyle(elem,null);
       
   298 if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name);
       
   299 }else{var swap=[],stack=[],a=elem,i=0;
       
   300 for(;
       
   301 a&&color(a);
       
   302 a=a.parentNode){stack.unshift(a);
       
   303 }for(;
       
   304 i<stack.length;
       
   305 i++){if(color(stack[i])){swap[i]=stack[i].style.display;
       
   306 stack[i].style.display="block";
       
   307 }}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";
       
   308 for(i=0;
       
   309 i<swap.length;
       
   310 i++){if(swap[i]!=null){stack[i].style.display=swap[i];
       
   311 }}}if(name=="opacity"&&ret==""){ret="1";
       
   312 }}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();
       
   313 });
       
   314 ret=elem.currentStyle[name]||elem.currentStyle[camelCase];
       
   315 if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;
       
   316 elem.runtimeStyle.left=elem.currentStyle.left;
       
   317 style.left=ret||0;
       
   318 ret=style.pixelLeft+"px";
       
   319 style.left=left;
       
   320 elem.runtimeStyle.left=rsLeft;
       
   321 }}}}return ret;
       
   322 },clean:function(elems,context){var ret=[];
       
   323 context=context||document;
       
   324 if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;
       
   325 }jQuery.each(elems,function(i,elem){if(!elem){return ;
       
   326 }if(elem.constructor==Number){elem+="";
       
   327 }if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";
       
   328 });
       
   329 var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");
       
   330 var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];
       
   331 div.innerHTML=wrap[1]+elem+wrap[2];
       
   332 while(wrap[0]--){div=div.lastChild;
       
   333 }if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];
       
   334 for(var j=tbody.length-1;
       
   335 j>=0;
       
   336 --j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);
       
   337 }}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);
       
   338 }}elem=jQuery.makeArray(div.childNodes);
       
   339 }if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return ;
       
   340 }if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem);
       
   341 }else{ret=jQuery.merge(ret,elem);
       
   342 }});
       
   343 return ret;
       
   344 },attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined;
       
   345 }var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;
       
   346 name=notxml&&jQuery.props[name]||name;
       
   347 if(elem.tagName){var special=/href|src|style/.test(name);
       
   348 if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex;
       
   349 }if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed";
       
   350 }elem[name]=value;
       
   351 }if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue;
       
   352 }return elem[name];
       
   353 }if(msie&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value);
       
   354 }if(set){elem.setAttribute(name,""+value);
       
   355 }var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);
       
   356 return attr===null?undefined:attr;
       
   357 }if(msie&&name=="opacity"){if(set){elem.zoom=1;
       
   358 elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")");
       
   359 }return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":"";
       
   360 }name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();
       
   361 });
       
   362 if(set){elem[name]=value;
       
   363 }return elem[name];
       
   364 },trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");
       
   365 },makeArray:function(array){var ret=[];
       
   366 if(array!=null){var i=array.length;
       
   367 if(i==null||array.split||array.setInterval||array.call){ret[0]=array;
       
   368 }else{while(i){ret[--i]=array[i];
       
   369 }}}return ret;
       
   370 },inArray:function(elem,array){for(var i=0,length=array.length;
       
   371 i<length;
       
   372 i++){if(array[i]===elem){return i;
       
   373 }}return -1;
       
   374 },merge:function(first,second){var i=0,elem,pos=first.length;
       
   375 if(jQuery.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem;
       
   376 }}}else{while(elem=second[i++]){first[pos++]=elem;
       
   377 }}return first;
       
   378 },unique:function(array){var ret=[],done={};
       
   379 try{for(var i=0,length=array.length;
       
   380 i<length;
       
   381 i++){var id=jQuery.data(array[i]);
       
   382 if(!done[id]){done[id]=true;
       
   383 ret.push(array[i]);
       
   384 }}}catch(e){ret=array;
       
   385 }return ret;
       
   386 },grep:function(elems,callback,inv){var ret=[];
       
   387 for(var i=0,length=elems.length;
       
   388 i<length;
       
   389 i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i]);
       
   390 }}return ret;
       
   391 },map:function(elems,callback){var ret=[];
       
   392 for(var i=0,length=elems.length;
       
   393 i<length;
       
   394 i++){var value=callback(elems[i],i);
       
   395 if(value!=null){ret[ret.length]=value;
       
   396 }}return ret.concat.apply([],ret);
       
   397 }});
       
   398 var userAgent=navigator.userAgent.toLowerCase();
       
   399 jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};
       
   400 var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";
       
   401 jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});
       
   402 jQuery.each({parent:function(elem){return elem.parentNode;
       
   403 },parents:function(elem){return jQuery.dir(elem,"parentNode");
       
   404 },next:function(elem){return jQuery.nth(elem,2,"nextSibling");
       
   405 },prev:function(elem){return jQuery.nth(elem,2,"previousSibling");
       
   406 },nextAll:function(elem){return jQuery.dir(elem,"nextSibling");
       
   407 },prevAll:function(elem){return jQuery.dir(elem,"previousSibling");
       
   408 },siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);
       
   409 },children:function(elem){return jQuery.sibling(elem.firstChild);
       
   410 },contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);
       
   411 }},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);
       
   412 if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret);
       
   413 }return this.pushStack(jQuery.unique(ret));
       
   414 };
       
   415 });
       
   416 jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;
       
   417 return this.each(function(){for(var i=0,length=args.length;
       
   418 i<length;
       
   419 i++){jQuery(args[i])[original](this);
       
   420 }});
       
   421 };
       
   422 });
       
   423 jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");
       
   424 if(this.nodeType==1){this.removeAttribute(name);
       
   425 }},addClass:function(classNames){jQuery.className.add(this,classNames);
       
   426 },removeClass:function(classNames){jQuery.className.remove(this,classNames);
       
   427 },toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);
       
   428 },remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);
       
   429 jQuery.removeData(this);
       
   430 });
       
   431 if(this.parentNode){this.parentNode.removeChild(this);
       
   432 }}},empty:function(){jQuery(">*",this).remove();
       
   433 while(this.firstChild){this.removeChild(this.firstChild);
       
   434 }}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);
       
   435 };
       
   436 });
       
   437 jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();
       
   438 jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");
       
   439 };
       
   440 });
       
   441 function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;
       
   442 }var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");
       
   443 jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);
       
   444 },"#":function(a,i,m){return a.getAttribute("id")==m[2];
       
   445 },":":{lt:function(a,i,m){return i<m[3]-0;
       
   446 },gt:function(a,i,m){return i>m[3]-0;
       
   447 },nth:function(a,i,m){return m[3]-0==i;
       
   448 },eq:function(a,i,m){return m[3]-0==i;
       
   449 },first:function(a,i){return i==0;
       
   450 },last:function(a,i,m,r){return i==r.length-1;
       
   451 },even:function(a,i){return i%2==0;
       
   452 },odd:function(a,i){return i%2;
       
   453 },"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;
       
   454 },"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;
       
   455 },"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");
       
   456 },parent:function(a){return a.firstChild;
       
   457 },empty:function(a){return !a.firstChild;
       
   458 },contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;
       
   459 },visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";
       
   460 },hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";
       
   461 },enabled:function(a){return !a.disabled;
       
   462 },disabled:function(a){return a.disabled;
       
   463 },checked:function(a){return a.checked;
       
   464 },selected:function(a){return a.selected||jQuery.attr(a,"selected");
       
   465 },text:function(a){return"text"==a.type;
       
   466 },radio:function(a){return"radio"==a.type;
       
   467 },checkbox:function(a){return"checkbox"==a.type;
       
   468 },file:function(a){return"file"==a.type;
       
   469 },password:function(a){return"password"==a.type;
       
   470 },submit:function(a){return"submit"==a.type;
       
   471 },image:function(a){return"image"==a.type;
       
   472 },reset:function(a){return"reset"==a.type;
       
   473 },button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");
       
   474 },input:function(a){return/input|select|textarea|button/i.test(a.nodeName);
       
   475 },has:function(a,i,m){return jQuery.find(m[3],a).length;
       
   476 },header:function(a){return/h\d/i.test(a.nodeName);
       
   477 },animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;
       
   478 }).length;
       
   479 }}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];
       
   480 while(expr&&expr!=old){old=expr;
       
   481 var f=jQuery.filter(expr,elems,not);
       
   482 expr=f.t.replace(/^\s*,\s*/,"");
       
   483 cur=not?elems=f.r:jQuery.merge(cur,f.r);
       
   484 }return cur;
       
   485 },find:function(t,context){if(typeof t!="string"){return[t];
       
   486 }if(context&&context.nodeType!=1&&context.nodeType!=9){return[];
       
   487 }context=context||document;
       
   488 var ret=[context],done=[],last,nodeName;
       
   489 while(t&&last!=t){var r=[];
       
   490 last=t;
       
   491 t=jQuery.trim(t);
       
   492 var foundToken=false,re=quickChild,m=re.exec(t);
       
   493 if(m){nodeName=m[1].toUpperCase();
       
   494 for(var i=0;
       
   495 ret[i];
       
   496 i++){for(var c=ret[i].firstChild;
       
   497 c;
       
   498 c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c);
       
   499 }}}ret=r;
       
   500 t=t.replace(re,"");
       
   501 if(t.indexOf(" ")==0){continue;
       
   502 }foundToken=true;
       
   503 }else{re=/^([>+~])\s*(\w*)/i;
       
   504 if((m=re.exec(t))!=null){r=[];
       
   505 var merge={};
       
   506 nodeName=m[2].toUpperCase();
       
   507 m=m[1];
       
   508 for(var j=0,rl=ret.length;
       
   509 j<rl;
       
   510 j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;
       
   511 for(;
       
   512 n;
       
   513 n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n);
       
   514 if(m=="~"&&merge[id]){break;
       
   515 }if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true;
       
   516 }r.push(n);
       
   517 }if(m=="+"){break;
       
   518 }}}}ret=r;
       
   519 t=jQuery.trim(t.replace(re,""));
       
   520 foundToken=true;
       
   521 }}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift();
       
   522 }done=jQuery.merge(done,ret);
       
   523 r=ret=[context];
       
   524 t=" "+t.substr(1,t.length);
       
   525 }else{var re2=quickID;
       
   526 var m=re2.exec(t);
       
   527 if(m){m=[0,m[2],m[3],m[1]];
       
   528 }else{re2=quickClass;
       
   529 m=re2.exec(t);
       
   530 }m[2]=m[2].replace(/\\/g,"");
       
   531 var elem=ret[ret.length-1];
       
   532 if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);
       
   533 if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0];
       
   534 }ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];
       
   535 }else{for(var i=0;
       
   536 ret[i];
       
   537 i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];
       
   538 if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param";
       
   539 }r=jQuery.merge(r,ret[i].getElementsByTagName(tag));
       
   540 }if(m[1]=="."){r=jQuery.classFilter(r,m[2]);
       
   541 }if(m[1]=="#"){var tmp=[];
       
   542 for(var i=0;
       
   543 r[i];
       
   544 i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];
       
   545 break;
       
   546 }}r=tmp;
       
   547 }ret=r;
       
   548 }t=t.replace(re2,"");
       
   549 }}if(t){var val=jQuery.filter(t,r);
       
   550 ret=r=val.r;
       
   551 t=jQuery.trim(val.t);
       
   552 }}if(t){ret=[];
       
   553 }if(ret&&context==ret[0]){ret.shift();
       
   554 }done=jQuery.merge(done,ret);
       
   555 return done;
       
   556 },classFilter:function(r,m,not){m=" "+m+" ";
       
   557 var tmp=[];
       
   558 for(var i=0;
       
   559 r[i];
       
   560 i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;
       
   561 if(!not&&pass||not&&!pass){tmp.push(r[i]);
       
   562 }}return tmp;
       
   563 },filter:function(t,r,not){var last;
       
   564 while(t&&t!=last){last=t;
       
   565 var p=jQuery.parse,m;
       
   566 for(var i=0;
       
   567 p[i];
       
   568 i++){m=p[i].exec(t);
       
   569 if(m){t=t.substring(m[0].length);
       
   570 m[2]=m[2].replace(/\\/g,"");
       
   571 break;
       
   572 }}if(!m){break;
       
   573 }if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);
       
   574 }else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not);
       
   575 }else{if(m[1]=="["){var tmp=[],type=m[3];
       
   576 for(var i=0,rl=r.length;
       
   577 i<rl;
       
   578 i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];
       
   579 if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||"";
       
   580 }if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a);
       
   581 }}r=tmp;
       
   582 }else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;
       
   583 for(var i=0,rl=r.length;
       
   584 i<rl;
       
   585 i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);
       
   586 if(!merge[id]){var c=1;
       
   587 for(var n=parentNode.firstChild;
       
   588 n;
       
   589 n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++;
       
   590 }}merge[id]=true;
       
   591 }var add=false;
       
   592 if(first==0){if(node.nodeIndex==last){add=true;
       
   593 }}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true;
       
   594 }}if(add^not){tmp.push(node);
       
   595 }}r=tmp;
       
   596 }else{var fn=jQuery.expr[m[1]];
       
   597 if(typeof fn=="object"){fn=fn[m[2]];
       
   598 }if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}");
       
   599 }r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);
       
   600 },not);
       
   601 }}}}}return{r:r,t:t};
       
   602 },dir:function(elem,dir){var matched=[],cur=elem[dir];
       
   603 while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur);
       
   604 }cur=cur[dir];
       
   605 }return matched;
       
   606 },nth:function(cur,result,dir,elem){result=result||1;
       
   607 var num=0;
       
   608 for(;
       
   609 cur;
       
   610 cur=cur[dir]){if(cur.nodeType==1&&++num==result){break;
       
   611 }}return cur;
       
   612 },sibling:function(n,elem){var r=[];
       
   613 for(;
       
   614 n;
       
   615 n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n);
       
   616 }}return r;
       
   617 }});
       
   618 jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return ;
       
   619 }if(jQuery.browser.msie&&elem.setInterval){elem=window;
       
   620 }if(!handler.guid){handler.guid=this.guid++;
       
   621 }if(data!=undefined){var fn=handler;
       
   622 handler=this.proxy(fn,function(){return fn.apply(this,arguments);
       
   623 });
       
   624 handler.data=data;
       
   625 }var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered){return jQuery.event.handle.apply(arguments.callee.elem,arguments);
       
   626 }});
       
   627 handle.elem=elem;
       
   628 jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");
       
   629 type=parts[0];
       
   630 handler.type=parts[1];
       
   631 var handlers=events[type];
       
   632 if(!handlers){handlers=events[type]={};
       
   633 if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false);
       
   634 }else{if(elem.attachEvent){elem.attachEvent("on"+type,handle);
       
   635 }}}}handlers[handler.guid]=handler;
       
   636 jQuery.event.global[type]=true;
       
   637 });
       
   638 elem=null;
       
   639 },guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return ;
       
   640 }var events=jQuery.data(elem,"events"),ret,index;
       
   641 if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""));
       
   642 }}else{if(types.type){handler=types.handler;
       
   643 types=types.type;
       
   644 }jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");
       
   645 type=parts[0];
       
   646 if(events[type]){if(handler){delete events[type][handler.guid];
       
   647 }else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler];
       
   648 }}}for(ret in events[type]){break;
       
   649 }if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false);
       
   650 }else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"));
       
   651 }}}ret=null;
       
   652 delete events[type];
       
   653 }}});
       
   654 }for(ret in events){break;
       
   655 }if(!ret){var handle=jQuery.data(elem,"handle");
       
   656 if(handle){handle.elem=null;
       
   657 }jQuery.removeData(elem,"events");
       
   658 jQuery.removeData(elem,"handle");
       
   659 }}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);
       
   660 if(type.indexOf("!")>=0){type=type.slice(0,-1);
       
   661 var exclusive=true;
       
   662 }if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data);
       
   663 }}else{if(elem.nodeType==3||elem.nodeType==8){return undefined;
       
   664 }var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;
       
   665 if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});
       
   666 data[0][expando]=true;
       
   667 }data[0].type=type;
       
   668 if(exclusive){data[0].exclusive=true;
       
   669 }var handle=jQuery.data(elem,"handle");
       
   670 if(handle){val=handle.apply(elem,data);
       
   671 }if((!fn||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false;
       
   672 }if(event){data.shift();
       
   673 }if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));
       
   674 if(ret!==undefined){val=ret;
       
   675 }}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;
       
   676 try{elem[type]();
       
   677 }catch(e){}}this.triggered=false;
       
   678 }return val;
       
   679 },handle:function(event){var val,ret,namespace,all,handlers;
       
   680 event=arguments[0]=jQuery.event.fix(event||window.event);
       
   681 namespace=event.type.split(".");
       
   682 event.type=namespace[0];
       
   683 namespace=namespace[1];
       
   684 all=!namespace&&!event.exclusive;
       
   685 handlers=(jQuery.data(this,"events")||{})[event.type];
       
   686 for(var j in handlers){var handler=handlers[j];
       
   687 if(all||handler.type==namespace){event.handler=handler;
       
   688 event.data=handler.data;
       
   689 ret=handler.apply(this,arguments);
       
   690 if(val!==false){val=ret;
       
   691 }if(ret===false){event.preventDefault();
       
   692 event.stopPropagation();
       
   693 }}}return val;
       
   694 },fix:function(event){if(event[expando]==true){return event;
       
   695 }var originalEvent=event;
       
   696 event={originalEvent:originalEvent};
       
   697 var 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 timeStamp toElement type view wheelDelta which".split(" ");
       
   698 for(var i=props.length;
       
   699 i;
       
   700 i--){event[props[i]]=originalEvent[props[i]];
       
   701 }event[expando]=true;
       
   702 event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault();
       
   703 }originalEvent.returnValue=false;
       
   704 };
       
   705 event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation();
       
   706 }originalEvent.cancelBubble=true;
       
   707 };
       
   708 event.timeStamp=event.timeStamp||now();
       
   709 if(!event.target){event.target=event.srcElement||document;
       
   710 }if(event.target.nodeType==3){event.target=event.target.parentNode;
       
   711 }if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;
       
   712 }if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;
       
   713 event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);
       
   714 event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);
       
   715 }if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode;
       
   716 }if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey;
       
   717 }if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));
       
   718 }return event;
       
   719 },proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;
       
   720 return proxy;
       
   721 },special:{ready:{setup:function(){bindReady();
       
   722 return ;
       
   723 },teardown:function(){return ;
       
   724 }},mouseenter:{setup:function(){if(jQuery.browser.msie){return false;
       
   725 }jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);
       
   726 return true;
       
   727 },teardown:function(){if(jQuery.browser.msie){return false;
       
   728 }jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);
       
   729 return true;
       
   730 },handler:function(event){if(withinElement(event,this)){return true;
       
   731 }event.type="mouseenter";
       
   732 return jQuery.event.handle.apply(this,arguments);
       
   733 }},mouseleave:{setup:function(){if(jQuery.browser.msie){return false;
       
   734 }jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);
       
   735 return true;
       
   736 },teardown:function(){if(jQuery.browser.msie){return false;
       
   737 }jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);
       
   738 return true;
       
   739 },handler:function(event){if(withinElement(event,this)){return true;
       
   740 }event.type="mouseleave";
       
   741 return jQuery.event.handle.apply(this,arguments);
       
   742 }}}};
       
   743 jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);
       
   744 });
       
   745 },one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);
       
   746 return(fn||data).apply(this,arguments);
       
   747 });
       
   748 return this.each(function(){jQuery.event.add(this,type,one,fn&&data);
       
   749 });
       
   750 },unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);
       
   751 });
       
   752 },trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);
       
   753 });
       
   754 },triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);
       
   755 },toggle:function(fn){var args=arguments,i=1;
       
   756 while(i<args.length){jQuery.event.proxy(fn,args[i++]);
       
   757 }return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;
       
   758 event.preventDefault();
       
   759 return args[this.lastToggle++].apply(this,arguments)||false;
       
   760 }));
       
   761 },hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut);
       
   762 },ready:function(fn){bindReady();
       
   763 if(jQuery.isReady){fn.call(document,jQuery);
       
   764 }else{jQuery.readyList.push(function(){return fn.call(this,jQuery);
       
   765 });
       
   766 }return this;
       
   767 }});
       
   768 jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;
       
   769 if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);
       
   770 });
       
   771 jQuery.readyList=null;
       
   772 }jQuery(document).triggerHandler("ready");
       
   773 }}});
       
   774 var readyBound=false;
       
   775 function bindReady(){if(readyBound){return ;
       
   776 }readyBound=true;
       
   777 if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false);
       
   778 }if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return ;
       
   779 }try{document.documentElement.doScroll("left");
       
   780 }catch(error){setTimeout(arguments.callee,0);
       
   781 return ;
       
   782 }jQuery.ready();
       
   783 })();
       
   784 }if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return ;
       
   785 }for(var i=0;
       
   786 i<document.styleSheets.length;
       
   787 i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);
       
   788 return ;
       
   789 }}jQuery.ready();
       
   790 },false);
       
   791 }if(jQuery.browser.safari){var numStyles;
       
   792 (function(){if(jQuery.isReady){return ;
       
   793 }if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);
       
   794 return ;
       
   795 }if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length;
       
   796 }if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);
       
   797 return ;
       
   798 }jQuery.ready();
       
   799 })();
       
   800 }jQuery.event.add(window,"load",jQuery.ready);
       
   801 }jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);
       
   802 };
       
   803 });
       
   804 var withinElement=function(event,elem){var parent=event.relatedTarget;
       
   805 while(parent&&parent!=elem){try{parent=parent.parentNode;
       
   806 }catch(error){parent=elem;
       
   807 }}return parent==elem;
       
   808 };
       
   809 jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();
       
   810 });
       
   811 jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!="string"){return this._load(url);
       
   812 }var off=url.indexOf(" ");
       
   813 if(off>=0){var selector=url.slice(off,url.length);
       
   814 url=url.slice(0,off);
       
   815 }callback=callback||function(){};
       
   816 var type="GET";
       
   817 if(params){if(jQuery.isFunction(params)){callback=params;
       
   818 params=null;
       
   819 }else{params=jQuery.param(params);
       
   820 type="POST";
       
   821 }}var self=this;
       
   822 jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);
       
   823 }self.each(callback,[res.responseText,status,res]);
       
   824 }});
       
   825 return this;
       
   826 },serialize:function(){return jQuery.param(this.serializeArray());
       
   827 },serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;
       
   828 }).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));
       
   829 }).map(function(i,elem){var val=jQuery(this).val();
       
   830 return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};
       
   831 }):{name:elem.name,value:val};
       
   832 }).get();
       
   833 }});
       
   834 jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);
       
   835 };
       
   836 });
       
   837 var jsc=now();
       
   838 jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
       
   839 data=null;
       
   840 }return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});
       
   841 },getScript:function(url,callback){return jQuery.get(url,null,callback,"script");
       
   842 },getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");
       
   843 },post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
       
   844 data={};
       
   845 }return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});
       
   846 },ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);
       
   847 },ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,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(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));
       
   848 var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();
       
   849 if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data);
       
   850 }if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";
       
   851 }}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";
       
   852 }}s.dataType="json";
       
   853 }if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;
       
   854 if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");
       
   855 }s.url=s.url.replace(jsre,"="+jsonp+"$1");
       
   856 s.dataType="script";
       
   857 window[jsonp]=function(tmp){data=tmp;
       
   858 success();
       
   859 complete();
       
   860 window[jsonp]=undefined;
       
   861 try{delete window[jsonp];
       
   862 }catch(e){}if(head){head.removeChild(script);
       
   863 }};
       
   864 }if(s.dataType=="script"&&s.cache==null){s.cache=false;
       
   865 }if(s.cache===false&&type=="GET"){var ts=now();
       
   866 var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");
       
   867 s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");
       
   868 }if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;
       
   869 s.data=null;
       
   870 }if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart");
       
   871 }var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;
       
   872 if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];
       
   873 var script=document.createElement("script");
       
   874 script.src=s.url;
       
   875 if(s.scriptCharset){script.charset=s.scriptCharset;
       
   876 }if(!jsonp){var done=false;
       
   877 script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;
       
   878 success();
       
   879 complete();
       
   880 head.removeChild(script);
       
   881 }};
       
   882 }head.appendChild(script);
       
   883 return undefined;
       
   884 }var requestDone=false;
       
   885 var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
       
   886 if(s.username){xhr.open(type,s.url,s.async,s.username,s.password);
       
   887 }else{xhr.open(type,s.url,s.async);
       
   888 }try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType);
       
   889 }if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");
       
   890 }xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");
       
   891 xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);
       
   892 }catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;
       
   893 xhr.abort();
       
   894 return false;
       
   895 }if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s]);
       
   896 }var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;
       
   897 if(ival){clearInterval(ival);
       
   898 ival=null;
       
   899 }status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";
       
   900 if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);
       
   901 }catch(e){status="parsererror";
       
   902 }}if(status=="success"){var modRes;
       
   903 try{modRes=xhr.getResponseHeader("Last-Modified");
       
   904 }catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes;
       
   905 }if(!jsonp){success();
       
   906 }}else{jQuery.handleError(s,xhr,status);
       
   907 }complete();
       
   908 if(s.async){xhr=null;
       
   909 }}};
       
   910 if(s.async){var ival=setInterval(onreadystatechange,13);
       
   911 if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort();
       
   912 if(!requestDone){onreadystatechange("timeout");
       
   913 }}},s.timeout);
       
   914 }}try{xhr.send(s.data);
       
   915 }catch(e){jQuery.handleError(s,xhr,null,e);
       
   916 }if(!s.async){onreadystatechange();
       
   917 }function success(){if(s.success){s.success(data,status);
       
   918 }if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s]);
       
   919 }}function complete(){if(s.complete){s.complete(xhr,status);
       
   920 }if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s]);
       
   921 }if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");
       
   922 }}return xhr;
       
   923 },handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e);
       
   924 }if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e]);
       
   925 }},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;
       
   926 }catch(e){}return false;
       
   927 },httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");
       
   928 return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;
       
   929 }catch(e){}return false;
       
   930 },httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;
       
   931 if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror";
       
   932 }if(filter){data=filter(data,type);
       
   933 }if(type=="script"){jQuery.globalEval(data);
       
   934 }if(type=="json"){data=eval("("+data+")");
       
   935 }return data;
       
   936 },param:function(a){var s=[];
       
   937 if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));
       
   938 });
       
   939 }else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));
       
   940 });
       
   941 }else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));
       
   942 }}}return s.join("&").replace(/%20/g,"+");
       
   943 }});
       
   944 jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";
       
   945 if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");
       
   946 this.style.display=elem.css("display");
       
   947 if(this.style.display=="none"){this.style.display="block";
       
   948 }elem.remove();
       
   949 }}).end();
       
   950 },hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");
       
   951 this.style.display="none";
       
   952 }).end();
       
   953 },_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();
       
   954 });
       
   955 },slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);
       
   956 },slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);
       
   957 },slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);
       
   958 },fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);
       
   959 },fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);
       
   960 },fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);
       
   961 },animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);
       
   962 return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false;
       
   963 }var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;
       
   964 for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this);
       
   965 }if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");
       
   966 opt.overflow=this.style.overflow;
       
   967 }}if(opt.overflow!=null){this.style.overflow="hidden";
       
   968 }opt.curAnim=jQuery.extend({},prop);
       
   969 jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);
       
   970 if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop);
       
   971 }else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;
       
   972 if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";
       
   973 if(unit!="px"){self.style[name]=(end||1)+unit;
       
   974 start=((end||1)/e.cur(true))*start;
       
   975 self.style[name]=start+unit;
       
   976 }if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start;
       
   977 }e.custom(start,end,unit);
       
   978 }else{e.custom(start,val,"");
       
   979 }}});
       
   980 return true;
       
   981 });
       
   982 },queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;
       
   983 type="fx";
       
   984 }if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type);
       
   985 }return this.each(function(){if(fn.constructor==Array){queue(this,type,fn);
       
   986 }else{queue(this,type).push(fn);
       
   987 if(queue(this,type).length==1){fn.call(this);
       
   988 }}});
       
   989 },stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;
       
   990 if(clearQueue){this.queue([]);
       
   991 }this.each(function(){for(var i=timers.length-1;
       
   992 i>=0;
       
   993 i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true);
       
   994 }timers.splice(i,1);
       
   995 }}});
       
   996 if(!gotoEnd){this.dequeue();
       
   997 }return this;
       
   998 }});
       
   999 var queue=function(elem,type,array){if(elem){type=type||"fx";
       
  1000 var q=jQuery.data(elem,type+"queue");
       
  1001 if(!q||array){q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));
       
  1002 }}return q;
       
  1003 };
       
  1004 jQuery.fn.dequeue=function(type){type=type||"fx";
       
  1005 return this.each(function(){var q=queue(this,type);
       
  1006 q.shift();
       
  1007 if(q.length){q[0].call(this);
       
  1008 }});
       
  1009 };
       
  1010 jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};
       
  1011 opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;
       
  1012 opt.old=opt.complete;
       
  1013 opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue();
       
  1014 }if(jQuery.isFunction(opt.old)){opt.old.call(this);
       
  1015 }};
       
  1016 return opt;
       
  1017 },easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;
       
  1018 },swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;
       
  1019 }},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;
       
  1020 this.elem=elem;
       
  1021 this.prop=prop;
       
  1022 if(!options.orig){options.orig={};
       
  1023 }}});
       
  1024 jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);
       
  1025 }(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);
       
  1026 if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block";
       
  1027 }},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop];
       
  1028 }var r=parseFloat(jQuery.css(this.elem,this.prop,force));
       
  1029 return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;
       
  1030 },custom:function(from,to,unit){this.startTime=now();
       
  1031 this.start=from;
       
  1032 this.end=to;
       
  1033 this.unit=unit||this.unit||"px";
       
  1034 this.now=this.start;
       
  1035 this.pos=this.state=0;
       
  1036 this.update();
       
  1037 var self=this;
       
  1038 function t(gotoEnd){return self.step(gotoEnd);
       
  1039 }t.elem=this.elem;
       
  1040 jQuery.timers.push(t);
       
  1041 if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;
       
  1042 for(var i=0;
       
  1043 i<timers.length;
       
  1044 i++){if(!timers[i]()){timers.splice(i--,1);
       
  1045 }}if(!timers.length){clearInterval(jQuery.timerId);
       
  1046 jQuery.timerId=null;
       
  1047 }},13);
       
  1048 }},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
       
  1049 this.options.show=true;
       
  1050 this.custom(0,this.cur());
       
  1051 if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px";
       
  1052 }jQuery(this.elem).show();
       
  1053 },hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
       
  1054 this.options.hide=true;
       
  1055 this.custom(this.cur(),0);
       
  1056 },step:function(gotoEnd){var t=now();
       
  1057 if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;
       
  1058 this.pos=this.state=1;
       
  1059 this.update();
       
  1060 this.options.curAnim[this.prop]=true;
       
  1061 var done=true;
       
  1062 for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false;
       
  1063 }}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;
       
  1064 this.elem.style.display=this.options.display;
       
  1065 if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block";
       
  1066 }}if(this.options.hide){this.elem.style.display="none";
       
  1067 }if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p]);
       
  1068 }}}if(done){this.options.complete.call(this.elem);
       
  1069 }return false;
       
  1070 }else{var n=t-this.startTime;
       
  1071 this.state=n/this.options.duration;
       
  1072 this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);
       
  1073 this.now=this.start+((this.end-this.start)*this.pos);
       
  1074 this.update();
       
  1075 }return true;
       
  1076 }};
       
  1077 jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;
       
  1078 },scrollTop:function(fx){fx.elem.scrollTop=fx.now;
       
  1079 },opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);
       
  1080 },_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;
       
  1081 }}});
       
  1082 jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;
       
  1083 if(elem){with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";
       
  1084 if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();
       
  1085 add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));
       
  1086 add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);
       
  1087 }else{add(elem.offsetLeft,elem.offsetTop);
       
  1088 while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);
       
  1089 if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent);
       
  1090 }if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true;
       
  1091 }offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;
       
  1092 offsetParent=offsetParent.offsetParent;
       
  1093 }while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop);
       
  1094 }if(mozilla&&css(parent,"overflow")!="visible"){border(parent);
       
  1095 }parent=parent.parentNode;
       
  1096 }if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop);
       
  1097 }if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));
       
  1098 }}results={top:top,left:left};
       
  1099 }}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));
       
  1100 }function add(l,t){left+=parseInt(l,10)||0;
       
  1101 top+=parseInt(t,10)||0;
       
  1102 }return results;
       
  1103 };
       
  1104 jQuery.fn.extend({position:function(){var left=0,top=0,results;
       
  1105 if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();
       
  1106 offset.top-=num(this,"marginTop");
       
  1107 offset.left-=num(this,"marginLeft");
       
  1108 parentOffset.top+=num(offsetParent,"borderTopWidth");
       
  1109 parentOffset.left+=num(offsetParent,"borderLeftWidth");
       
  1110 results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};
       
  1111 }return results;
       
  1112 },offsetParent:function(){var offsetParent=this[0].offsetParent;
       
  1113 while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent;
       
  1114 }return jQuery(offsetParent);
       
  1115 }});
       
  1116 jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;
       
  1117 jQuery.fn[method]=function(val){if(!this[0]){return ;
       
  1118 }return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;
       
  1119 }):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];
       
  1120 };
       
  1121 });
       
  1122 jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";
       
  1123 jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);
       
  1124 };
       
  1125 jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);
       
  1126 };
       
  1127 });
       
  1128 })();
       
  1129 
       
  1130 
       
  1131 /* platform.js */
       
  1132 SimileAjax.jQuery=jQuery.noConflict(true);
       
  1133 if(typeof window["$"]=="undefined"){window.$=SimileAjax.jQuery;
       
  1134 }SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};
       
  1135 SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};
       
  1136 (function(){var C=navigator.appName.toLowerCase();
       
  1137 var A=navigator.userAgent.toLowerCase();
       
  1138 SimileAjax.Platform.os.isMac=(A.indexOf("mac")!=-1);
       
  1139 SimileAjax.Platform.os.isWin=(A.indexOf("win")!=-1);
       
  1140 SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(A.indexOf("95")!=-1||A.indexOf("98")!=-1||A.indexOf("nt")!=-1||A.indexOf("win32")!=-1||A.indexOf("32bit")!=-1);
       
  1141 SimileAjax.Platform.os.isUnix=(A.indexOf("x11")!=-1);
       
  1142 SimileAjax.Platform.browser.isIE=(C.indexOf("microsoft")!=-1);
       
  1143 SimileAjax.Platform.browser.isNetscape=(C.indexOf("netscape")!=-1);
       
  1144 SimileAjax.Platform.browser.isMozilla=(A.indexOf("mozilla")!=-1);
       
  1145 SimileAjax.Platform.browser.isFirefox=(A.indexOf("firefox")!=-1);
       
  1146 SimileAjax.Platform.browser.isOpera=(C.indexOf("opera")!=-1);
       
  1147 SimileAjax.Platform.browser.isSafari=(C.indexOf("safari")!=-1);
       
  1148 var E=function(G){var F=G.split(".");
       
  1149 SimileAjax.Platform.browser.majorVersion=parseInt(F[0]);
       
  1150 SimileAjax.Platform.browser.minorVersion=parseInt(F[1]);
       
  1151 };
       
  1152 var B=function(H,G,I){var F=H.indexOf(G,I);
       
  1153 return F>=0?F:H.length;
       
  1154 };
       
  1155 if(SimileAjax.Platform.browser.isMozilla){var D=A.indexOf("mozilla/");
       
  1156 if(D>=0){E(A.substring(D+8,B(A," ",D)));
       
  1157 }}if(SimileAjax.Platform.browser.isIE){var D=A.indexOf("msie ");
       
  1158 if(D>=0){E(A.substring(D+5,B(A,";",D)));
       
  1159 }}if(SimileAjax.Platform.browser.isNetscape){var D=A.indexOf("rv:");
       
  1160 if(D>=0){E(A.substring(D+3,B(A,")",D)));
       
  1161 }}if(SimileAjax.Platform.browser.isFirefox){var D=A.indexOf("firefox/");
       
  1162 if(D>=0){E(A.substring(D+8,B(A," ",D)));
       
  1163 }}if(!("localeCompare" in String.prototype)){String.prototype.localeCompare=function(F){if(this<F){return -1;
       
  1164 }else{if(this>F){return 1;
       
  1165 }else{return 0;
       
  1166 }}};
       
  1167 }})();
       
  1168 SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale;
       
  1169 };
       
  1170 
       
  1171 
       
  1172 /* ajax.js */
       
  1173 SimileAjax.ListenerQueue=function(A){this._listeners=[];
       
  1174 this._wildcardHandlerName=A;
       
  1175 };
       
  1176 SimileAjax.ListenerQueue.prototype.add=function(A){this._listeners.push(A);
       
  1177 };
       
  1178 SimileAjax.ListenerQueue.prototype.remove=function(C){var B=this._listeners;
       
  1179 for(var A=0;
       
  1180 A<B.length;
       
  1181 A++){if(B[A]==C){B.splice(A,1);
       
  1182 break;
       
  1183 }}};
       
  1184 SimileAjax.ListenerQueue.prototype.fire=function(B,A){var D=[].concat(this._listeners);
       
  1185 for(var C=0;
       
  1186 C<D.length;
       
  1187 C++){var E=D[C];
       
  1188 if(B in E){try{E[B].apply(E,A);
       
  1189 }catch(F){SimileAjax.Debug.exception("Error firing event of name "+B,F);
       
  1190 }}else{if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in E){try{E[this._wildcardHandlerName].apply(E,[B]);
       
  1191 }catch(F){SimileAjax.Debug.exception("Error firing event of name "+B+" to wildcard handler",F);
       
  1192 }}}}};
       
  1193 
       
  1194 
       
  1195 /* data-structure.js */
       
  1196 SimileAjax.Set=function(A){this._hash={};
       
  1197 this._count=0;
       
  1198 if(A instanceof Array){for(var B=0;
       
  1199 B<A.length;
       
  1200 B++){this.add(A[B]);
       
  1201 }}else{if(A instanceof SimileAjax.Set){this.addSet(A);
       
  1202 }}};
       
  1203 SimileAjax.Set.prototype.add=function(A){if(!(A in this._hash)){this._hash[A]=true;
       
  1204 this._count++;
       
  1205 return true;
       
  1206 }return false;
       
  1207 };
       
  1208 SimileAjax.Set.prototype.addSet=function(B){for(var A in B._hash){this.add(A);
       
  1209 }};
       
  1210 SimileAjax.Set.prototype.remove=function(A){if(A in this._hash){delete this._hash[A];
       
  1211 this._count--;
       
  1212 return true;
       
  1213 }return false;
       
  1214 };
       
  1215 SimileAjax.Set.prototype.removeSet=function(B){for(var A in B._hash){this.remove(A);
       
  1216 }};
       
  1217 SimileAjax.Set.prototype.retainSet=function(B){for(var A in this._hash){if(!B.contains(A)){delete this._hash[A];
       
  1218 this._count--;
       
  1219 }}};
       
  1220 SimileAjax.Set.prototype.contains=function(A){return(A in this._hash);
       
  1221 };
       
  1222 SimileAjax.Set.prototype.size=function(){return this._count;
       
  1223 };
       
  1224 SimileAjax.Set.prototype.toArray=function(){var A=[];
       
  1225 for(var B in this._hash){A.push(B);
       
  1226 }return A;
       
  1227 };
       
  1228 SimileAjax.Set.prototype.visit=function(A){for(var B in this._hash){if(A(B)==true){break;
       
  1229 }}};
       
  1230 SimileAjax.SortedArray=function(B,A){this._a=(A instanceof Array)?A:[];
       
  1231 this._compare=B;
       
  1232 };
       
  1233 SimileAjax.SortedArray.prototype.add=function(C){var A=this;
       
  1234 var B=this.find(function(D){return A._compare(D,C);
       
  1235 });
       
  1236 if(B<this._a.length){this._a.splice(B,0,C);
       
  1237 }else{this._a.push(C);
       
  1238 }};
       
  1239 SimileAjax.SortedArray.prototype.remove=function(C){var A=this;
       
  1240 var B=this.find(function(D){return A._compare(D,C);
       
  1241 });
       
  1242 while(B<this._a.length&&this._compare(this._a[B],C)==0){if(this._a[B]==C){this._a.splice(B,1);
       
  1243 return true;
       
  1244 }else{B++;
       
  1245 }}return false;
       
  1246 };
       
  1247 SimileAjax.SortedArray.prototype.removeAll=function(){this._a=[];
       
  1248 };
       
  1249 SimileAjax.SortedArray.prototype.elementAt=function(A){return this._a[A];
       
  1250 };
       
  1251 SimileAjax.SortedArray.prototype.length=function(){return this._a.length;
       
  1252 };
       
  1253 SimileAjax.SortedArray.prototype.find=function(D){var B=0;
       
  1254 var A=this._a.length;
       
  1255 while(B<A){var C=Math.floor((B+A)/2);
       
  1256 var E=D(this._a[C]);
       
  1257 if(C==B){return E<0?B+1:B;
       
  1258 }else{if(E<0){B=C;
       
  1259 }else{A=C;
       
  1260 }}}return B;
       
  1261 };
       
  1262 SimileAjax.SortedArray.prototype.getFirst=function(){return(this._a.length>0)?this._a[0]:null;
       
  1263 };
       
  1264 SimileAjax.SortedArray.prototype.getLast=function(){return(this._a.length>0)?this._a[this._a.length-1]:null;
       
  1265 };
       
  1266 SimileAjax.EventIndex=function(B){var A=this;
       
  1267 this._unit=(B!=null)?B:SimileAjax.NativeDateUnit;
       
  1268 this._events=new SimileAjax.SortedArray(function(D,C){return A._unit.compare(D.getStart(),C.getStart());
       
  1269 });
       
  1270 this._idToEvent={};
       
  1271 this._indexed=true;
       
  1272 };
       
  1273 SimileAjax.EventIndex.prototype.getUnit=function(){return this._unit;
       
  1274 };
       
  1275 SimileAjax.EventIndex.prototype.getEvent=function(A){return this._idToEvent[A];
       
  1276 };
       
  1277 SimileAjax.EventIndex.prototype.add=function(A){this._events.add(A);
       
  1278 this._idToEvent[A.getID()]=A;
       
  1279 this._indexed=false;
       
  1280 };
       
  1281 SimileAjax.EventIndex.prototype.removeAll=function(){this._events.removeAll();
       
  1282 this._idToEvent={};
       
  1283 this._indexed=false;
       
  1284 };
       
  1285 SimileAjax.EventIndex.prototype.getCount=function(){return this._events.length();
       
  1286 };
       
  1287 SimileAjax.EventIndex.prototype.getIterator=function(A,B){if(!this._indexed){this._index();
       
  1288 }return new SimileAjax.EventIndex._Iterator(this._events,A,B,this._unit);
       
  1289 };
       
  1290 SimileAjax.EventIndex.prototype.getReverseIterator=function(A,B){if(!this._indexed){this._index();
       
  1291 }return new SimileAjax.EventIndex._ReverseIterator(this._events,A,B,this._unit);
       
  1292 };
       
  1293 SimileAjax.EventIndex.prototype.getAllIterator=function(){return new SimileAjax.EventIndex._AllIterator(this._events);
       
  1294 };
       
  1295 SimileAjax.EventIndex.prototype.getEarliestDate=function(){var A=this._events.getFirst();
       
  1296 return(A==null)?null:A.getStart();
       
  1297 };
       
  1298 SimileAjax.EventIndex.prototype.getLatestDate=function(){var A=this._events.getLast();
       
  1299 if(A==null){return null;
       
  1300 }if(!this._indexed){this._index();
       
  1301 }var C=A._earliestOverlapIndex;
       
  1302 var B=this._events.elementAt(C).getEnd();
       
  1303 for(var D=C+1;
       
  1304 D<this._events.length();
       
  1305 D++){B=this._unit.later(B,this._events.elementAt(D).getEnd());
       
  1306 }return B;
       
  1307 };
       
  1308 SimileAjax.EventIndex.prototype._index=function(){var D=this._events.length();
       
  1309 for(var E=0;
       
  1310 E<D;
       
  1311 E++){var C=this._events.elementAt(E);
       
  1312 C._earliestOverlapIndex=E;
       
  1313 }var G=1;
       
  1314 for(var E=0;
       
  1315 E<D;
       
  1316 E++){var C=this._events.elementAt(E);
       
  1317 var B=C.getEnd();
       
  1318 G=Math.max(G,E+1);
       
  1319 while(G<D){var A=this._events.elementAt(G);
       
  1320 var F=A.getStart();
       
  1321 if(this._unit.compare(F,B)<0){A._earliestOverlapIndex=E;
       
  1322 G++;
       
  1323 }else{break;
       
  1324 }}}this._indexed=true;
       
  1325 };
       
  1326 SimileAjax.EventIndex._Iterator=function(B,A,D,C){this._events=B;
       
  1327 this._startDate=A;
       
  1328 this._endDate=D;
       
  1329 this._unit=C;
       
  1330 this._currentIndex=B.find(function(E){return C.compare(E.getStart(),A);
       
  1331 });
       
  1332 if(this._currentIndex-1>=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex;
       
  1333 }this._currentIndex--;
       
  1334 this._maxIndex=B.find(function(E){return C.compare(E.getStart(),D);
       
  1335 });
       
  1336 this._hasNext=false;
       
  1337 this._next=null;
       
  1338 this._findNext();
       
  1339 };
       
  1340 SimileAjax.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext;
       
  1341 },next:function(){if(this._hasNext){var A=this._next;
       
  1342 this._findNext();
       
  1343 return A;
       
  1344 }else{return null;
       
  1345 }},_findNext:function(){var B=this._unit;
       
  1346 while((++this._currentIndex)<this._maxIndex){var A=this._events.elementAt(this._currentIndex);
       
  1347 if(B.compare(A.getStart(),this._endDate)<0&&B.compare(A.getEnd(),this._startDate)>0){this._next=A;
       
  1348 this._hasNext=true;
       
  1349 return ;
       
  1350 }}this._next=null;
       
  1351 this._hasNext=false;
       
  1352 }};
       
  1353 SimileAjax.EventIndex._ReverseIterator=function(B,A,D,C){this._events=B;
       
  1354 this._startDate=A;
       
  1355 this._endDate=D;
       
  1356 this._unit=C;
       
  1357 this._minIndex=B.find(function(E){return C.compare(E.getStart(),A);
       
  1358 });
       
  1359 if(this._minIndex-1>=0){this._minIndex=this._events.elementAt(this._minIndex-1)._earliestOverlapIndex;
       
  1360 }this._maxIndex=B.find(function(E){return C.compare(E.getStart(),D);
       
  1361 });
       
  1362 this._currentIndex=this._maxIndex;
       
  1363 this._hasNext=false;
       
  1364 this._next=null;
       
  1365 this._findNext();
       
  1366 };
       
  1367 SimileAjax.EventIndex._ReverseIterator.prototype={hasNext:function(){return this._hasNext;
       
  1368 },next:function(){if(this._hasNext){var A=this._next;
       
  1369 this._findNext();
       
  1370 return A;
       
  1371 }else{return null;
       
  1372 }},_findNext:function(){var B=this._unit;
       
  1373 while((--this._currentIndex)>=this._minIndex){var A=this._events.elementAt(this._currentIndex);
       
  1374 if(B.compare(A.getStart(),this._endDate)<0&&B.compare(A.getEnd(),this._startDate)>0){this._next=A;
       
  1375 this._hasNext=true;
       
  1376 return ;
       
  1377 }}this._next=null;
       
  1378 this._hasNext=false;
       
  1379 }};
       
  1380 SimileAjax.EventIndex._AllIterator=function(A){this._events=A;
       
  1381 this._index=0;
       
  1382 };
       
  1383 SimileAjax.EventIndex._AllIterator.prototype={hasNext:function(){return this._index<this._events.length();
       
  1384 },next:function(){return this._index<this._events.length()?this._events.elementAt(this._index++):null;
       
  1385 }};
       
  1386 
       
  1387 
       
  1388 /* date-time.js */
       
  1389 SimileAjax.DateTime=new Object();
       
  1390 SimileAjax.DateTime.MILLISECOND=0;
       
  1391 SimileAjax.DateTime.SECOND=1;
       
  1392 SimileAjax.DateTime.MINUTE=2;
       
  1393 SimileAjax.DateTime.HOUR=3;
       
  1394 SimileAjax.DateTime.DAY=4;
       
  1395 SimileAjax.DateTime.WEEK=5;
       
  1396 SimileAjax.DateTime.MONTH=6;
       
  1397 SimileAjax.DateTime.YEAR=7;
       
  1398 SimileAjax.DateTime.DECADE=8;
       
  1399 SimileAjax.DateTime.CENTURY=9;
       
  1400 SimileAjax.DateTime.MILLENNIUM=10;
       
  1401 SimileAjax.DateTime.EPOCH=-1;
       
  1402 SimileAjax.DateTime.ERA=-2;
       
  1403 SimileAjax.DateTime.gregorianUnitLengths=[];
       
  1404 (function(){var B=SimileAjax.DateTime;
       
  1405 var A=B.gregorianUnitLengths;
       
  1406 A[B.MILLISECOND]=1;
       
  1407 A[B.SECOND]=1000;
       
  1408 A[B.MINUTE]=A[B.SECOND]*60;
       
  1409 A[B.HOUR]=A[B.MINUTE]*60;
       
  1410 A[B.DAY]=A[B.HOUR]*24;
       
  1411 A[B.WEEK]=A[B.DAY]*7;
       
  1412 A[B.MONTH]=A[B.DAY]*31;
       
  1413 A[B.YEAR]=A[B.DAY]*365;
       
  1414 A[B.DECADE]=A[B.YEAR]*10;
       
  1415 A[B.CENTURY]=A[B.YEAR]*100;
       
  1416 A[B.MILLENNIUM]=A[B.YEAR]*1000;
       
  1417 })();
       
  1418 SimileAjax.DateTime._dateRegexp=new RegExp("^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$");
       
  1419 SimileAjax.DateTime._timezoneRegexp=new RegExp("Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$");
       
  1420 SimileAjax.DateTime._timeRegexp=new RegExp("^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$");
       
  1421 SimileAjax.DateTime.setIso8601Date=function(H,F){var I=F.match(SimileAjax.DateTime._dateRegexp);
       
  1422 if(!I){throw new Error("Invalid date string: "+F);
       
  1423 }var B=(I[1]=="-")?-1:1;
       
  1424 var J=B*I[2];
       
  1425 var G=I[5];
       
  1426 var C=I[7];
       
  1427 var E=I[9];
       
  1428 var A=I[11];
       
  1429 var M=(I[13])?I[13]:1;
       
  1430 H.setUTCFullYear(J);
       
  1431 if(E){H.setUTCMonth(0);
       
  1432 H.setUTCDate(Number(E));
       
  1433 }else{if(A){H.setUTCMonth(0);
       
  1434 H.setUTCDate(1);
       
  1435 var L=H.getUTCDay();
       
  1436 var K=(L)?L:7;
       
  1437 var D=Number(M)+(7*Number(A));
       
  1438 if(K<=4){H.setUTCDate(D+1-K);
       
  1439 }else{H.setUTCDate(D+8-K);
       
  1440 }}else{if(G){H.setUTCDate(1);
       
  1441 H.setUTCMonth(G-1);
       
  1442 }if(C){H.setUTCDate(C);
       
  1443 }}}return H;
       
  1444 };
       
  1445 SimileAjax.DateTime.setIso8601Time=function(F,C){var G=C.match(SimileAjax.DateTime._timeRegexp);
       
  1446 if(!G){SimileAjax.Debug.warn("Invalid time string: "+C);
       
  1447 return false;
       
  1448 }var A=G[1];
       
  1449 var E=Number((G[3])?G[3]:0);
       
  1450 var D=(G[5])?G[5]:0;
       
  1451 var B=G[7]?(Number("0."+G[7])*1000):0;
       
  1452 F.setUTCHours(A);
       
  1453 F.setUTCMinutes(E);
       
  1454 F.setUTCSeconds(D);
       
  1455 F.setUTCMilliseconds(B);
       
  1456 return F;
       
  1457 };
       
  1458 SimileAjax.DateTime.timezoneOffset=new Date().getTimezoneOffset();
       
  1459 SimileAjax.DateTime.setIso8601=function(B,A){var D=null;
       
  1460 var E=(A.indexOf("T")==-1)?A.split(" "):A.split("T");
       
  1461 SimileAjax.DateTime.setIso8601Date(B,E[0]);
       
  1462 if(E.length==2){var C=E[1].match(SimileAjax.DateTime._timezoneRegexp);
       
  1463 if(C){if(C[0]=="Z"){D=0;
       
  1464 }else{D=(Number(C[3])*60)+Number(C[5]);
       
  1465 D*=((C[2]=="-")?1:-1);
       
  1466 }E[1]=E[1].substr(0,E[1].length-C[0].length);
       
  1467 }SimileAjax.DateTime.setIso8601Time(B,E[1]);
       
  1468 }if(D==null){D=B.getTimezoneOffset();
       
  1469 }B.setTime(B.getTime()+D*60000);
       
  1470 return B;
       
  1471 };
       
  1472 SimileAjax.DateTime.parseIso8601DateTime=function(A){try{return SimileAjax.DateTime.setIso8601(new Date(0),A);
       
  1473 }catch(B){return null;
       
  1474 }};
       
  1475 SimileAjax.DateTime.parseGregorianDateTime=function(G){if(G==null){return null;
       
  1476 }else{if(G instanceof Date){return G;
       
  1477 }}var B=G.toString();
       
  1478 if(B.length>0&&B.length<8){var C=B.indexOf(" ");
       
  1479 if(C>0){var A=parseInt(B.substr(0,C));
       
  1480 var E=B.substr(C+1);
       
  1481 if(E.toLowerCase()=="bc"){A=1-A;
       
  1482 }}else{var A=parseInt(B);
       
  1483 }var F=new Date(0);
       
  1484 F.setUTCFullYear(A);
       
  1485 return F;
       
  1486 }try{return new Date(Date.parse(B));
       
  1487 }catch(D){return null;
       
  1488 }};
       
  1489 SimileAjax.DateTime.roundDownToInterval=function(B,G,J,K,A){var D=J*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];
       
  1490 var I=new Date(B.getTime()+D);
       
  1491 var E=function(L){L.setUTCMilliseconds(0);
       
  1492 L.setUTCSeconds(0);
       
  1493 L.setUTCMinutes(0);
       
  1494 L.setUTCHours(0);
       
  1495 };
       
  1496 var C=function(L){E(L);
       
  1497 L.setUTCDate(1);
       
  1498 L.setUTCMonth(0);
       
  1499 };
       
  1500 switch(G){case SimileAjax.DateTime.MILLISECOND:var H=I.getUTCMilliseconds();
       
  1501 I.setUTCMilliseconds(H-(H%K));
       
  1502 break;
       
  1503 case SimileAjax.DateTime.SECOND:I.setUTCMilliseconds(0);
       
  1504 var H=I.getUTCSeconds();
       
  1505 I.setUTCSeconds(H-(H%K));
       
  1506 break;
       
  1507 case SimileAjax.DateTime.MINUTE:I.setUTCMilliseconds(0);
       
  1508 I.setUTCSeconds(0);
       
  1509 var H=I.getUTCMinutes();
       
  1510 I.setTime(I.getTime()-(H%K)*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);
       
  1511 break;
       
  1512 case SimileAjax.DateTime.HOUR:I.setUTCMilliseconds(0);
       
  1513 I.setUTCSeconds(0);
       
  1514 I.setUTCMinutes(0);
       
  1515 var H=I.getUTCHours();
       
  1516 I.setUTCHours(H-(H%K));
       
  1517 break;
       
  1518 case SimileAjax.DateTime.DAY:E(I);
       
  1519 break;
       
  1520 case SimileAjax.DateTime.WEEK:E(I);
       
  1521 var F=(I.getUTCDay()+7-A)%7;
       
  1522 I.setTime(I.getTime()-F*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]);
       
  1523 break;
       
  1524 case SimileAjax.DateTime.MONTH:E(I);
       
  1525 I.setUTCDate(1);
       
  1526 var H=I.getUTCMonth();
       
  1527 I.setUTCMonth(H-(H%K));
       
  1528 break;
       
  1529 case SimileAjax.DateTime.YEAR:C(I);
       
  1530 var H=I.getUTCFullYear();
       
  1531 I.setUTCFullYear(H-(H%K));
       
  1532 break;
       
  1533 case SimileAjax.DateTime.DECADE:C(I);
       
  1534 I.setUTCFullYear(Math.floor(I.getUTCFullYear()/10)*10);
       
  1535 break;
       
  1536 case SimileAjax.DateTime.CENTURY:C(I);
       
  1537 I.setUTCFullYear(Math.floor(I.getUTCFullYear()/100)*100);
       
  1538 break;
       
  1539 case SimileAjax.DateTime.MILLENNIUM:C(I);
       
  1540 I.setUTCFullYear(Math.floor(I.getUTCFullYear()/1000)*1000);
       
  1541 break;
       
  1542 }B.setTime(I.getTime()-D);
       
  1543 };
       
  1544 SimileAjax.DateTime.roundUpToInterval=function(D,F,C,A,B){var E=D.getTime();
       
  1545 SimileAjax.DateTime.roundDownToInterval(D,F,C,A,B);
       
  1546 if(D.getTime()<E){D.setTime(D.getTime()+SimileAjax.DateTime.gregorianUnitLengths[F]*A);
       
  1547 }};
       
  1548 SimileAjax.DateTime.incrementByInterval=function(B,E,A){A=(typeof A=="undefined")?0:A;
       
  1549 var D=A*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];
       
  1550 var C=new Date(B.getTime()+D);
       
  1551 switch(E){case SimileAjax.DateTime.MILLISECOND:C.setTime(C.getTime()+1);
       
  1552 break;
       
  1553 case SimileAjax.DateTime.SECOND:C.setTime(C.getTime()+1000);
       
  1554 break;
       
  1555 case SimileAjax.DateTime.MINUTE:C.setTime(C.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);
       
  1556 break;
       
  1557 case SimileAjax.DateTime.HOUR:C.setTime(C.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]);
       
  1558 break;
       
  1559 case SimileAjax.DateTime.DAY:C.setUTCDate(C.getUTCDate()+1);
       
  1560 break;
       
  1561 case SimileAjax.DateTime.WEEK:C.setUTCDate(C.getUTCDate()+7);
       
  1562 break;
       
  1563 case SimileAjax.DateTime.MONTH:C.setUTCMonth(C.getUTCMonth()+1);
       
  1564 break;
       
  1565 case SimileAjax.DateTime.YEAR:C.setUTCFullYear(C.getUTCFullYear()+1);
       
  1566 break;
       
  1567 case SimileAjax.DateTime.DECADE:C.setUTCFullYear(C.getUTCFullYear()+10);
       
  1568 break;
       
  1569 case SimileAjax.DateTime.CENTURY:C.setUTCFullYear(C.getUTCFullYear()+100);
       
  1570 break;
       
  1571 case SimileAjax.DateTime.MILLENNIUM:C.setUTCFullYear(C.getUTCFullYear()+1000);
       
  1572 break;
       
  1573 }B.setTime(C.getTime()-D);
       
  1574 };
       
  1575 SimileAjax.DateTime.removeTimeZoneOffset=function(B,A){return new Date(B.getTime()+A*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]);
       
  1576 };
       
  1577 SimileAjax.DateTime.getTimezone=function(){var A=new Date().getTimezoneOffset();
       
  1578 return A/-60;
       
  1579 };
       
  1580 
       
  1581 
       
  1582 /* debug.js */
       
  1583 SimileAjax.Debug={silent:false};
       
  1584 SimileAjax.Debug.log=function(B){var A;
       
  1585 if("console" in window&&"log" in window.console){A=function(C){console.log(C);
       
  1586 };
       
  1587 }else{A=function(C){if(!SimileAjax.Debug.silent){alert(C);
       
  1588 }};
       
  1589 }SimileAjax.Debug.log=A;
       
  1590 A(B);
       
  1591 };
       
  1592 SimileAjax.Debug.warn=function(B){var A;
       
  1593 if("console" in window&&"warn" in window.console){A=function(C){console.warn(C);
       
  1594 };
       
  1595 }else{A=function(C){if(!SimileAjax.Debug.silent){alert(C);
       
  1596 }};
       
  1597 }SimileAjax.Debug.warn=A;
       
  1598 A(B);
       
  1599 };
       
  1600 SimileAjax.Debug.exception=function(B,D){var A,C=SimileAjax.parseURLParameters();
       
  1601 if(C.errors=="throw"||SimileAjax.params.errors=="throw"){A=function(F,E){throw (F);
       
  1602 };
       
  1603 }else{if("console" in window&&"error" in window.console){A=function(F,E){if(E!=null){console.error(E+" %o",F);
       
  1604 }else{console.error(F);
       
  1605 }throw (F);
       
  1606 };
       
  1607 }else{A=function(F,E){if(!SimileAjax.Debug.silent){alert("Caught exception: "+E+"\n\nDetails: "+("description" in F?F.description:F));
       
  1608 }throw (F);
       
  1609 };
       
  1610 }}SimileAjax.Debug.exception=A;
       
  1611 A(B,D);
       
  1612 };
       
  1613 SimileAjax.Debug.objectToString=function(A){return SimileAjax.Debug._objectToString(A,"");
       
  1614 };
       
  1615 SimileAjax.Debug._objectToString=function(D,A){var C=A+" ";
       
  1616 if(typeof D=="object"){var B="{";
       
  1617 for(E in D){B+=C+E+": "+SimileAjax.Debug._objectToString(D[E],C)+"\n";
       
  1618 }B+=A+"}";
       
  1619 return B;
       
  1620 }else{if(typeof D=="array"){var B="[";
       
  1621 for(var E=0;
       
  1622 E<D.length;
       
  1623 E++){B+=SimileAjax.Debug._objectToString(D[E],C)+"\n";
       
  1624 }B+=A+"]";
       
  1625 return B;
       
  1626 }else{return D;
       
  1627 }}};
       
  1628 
       
  1629 
       
  1630 /* dom.js */
       
  1631 SimileAjax.DOM=new Object();
       
  1632 SimileAjax.DOM.registerEventWithObject=function(C,A,D,B){SimileAjax.DOM.registerEvent(C,A,function(F,E,G){return D[B].call(D,F,E,G);
       
  1633 });
       
  1634 };
       
  1635 SimileAjax.DOM.registerEvent=function(C,B,D){var A=function(E){E=(E)?E:((event)?event:null);
       
  1636 if(E){var F=(E.target)?E.target:((E.srcElement)?E.srcElement:null);
       
  1637 if(F){F=(F.nodeType==1||F.nodeType==9)?F:F.parentNode;
       
  1638 }return D(C,E,F);
       
  1639 }return true;
       
  1640 };
       
  1641 if(SimileAjax.Platform.browser.isIE){C.attachEvent("on"+B,A);
       
  1642 }else{C.addEventListener(B,A,false);
       
  1643 }};
       
  1644 SimileAjax.DOM.getPageCoordinates=function(B){var E=0;
       
  1645 var D=0;
       
  1646 if(B.nodeType!=1){B=B.parentNode;
       
  1647 }var C=B;
       
  1648 while(C!=null){E+=C.offsetLeft;
       
  1649 D+=C.offsetTop;
       
  1650 C=C.offsetParent;
       
  1651 }var A=document.body;
       
  1652 while(B!=null&&B!=A){if("scrollLeft" in B){E-=B.scrollLeft;
       
  1653 D-=B.scrollTop;
       
  1654 }B=B.parentNode;
       
  1655 }return{left:E,top:D};
       
  1656 };
       
  1657 SimileAjax.DOM.getSize=function(B){var A=this.getStyle(B,"width");
       
  1658 var C=this.getStyle(B,"height");
       
  1659 if(A.indexOf("px")>-1){A=A.replace("px","");
       
  1660 }if(C.indexOf("px")>-1){C=C.replace("px","");
       
  1661 }return{w:A,h:C};
       
  1662 };
       
  1663 SimileAjax.DOM.getStyle=function(B,A){if(B.currentStyle){var C=B.currentStyle[A];
       
  1664 }else{if(window.getComputedStyle){var C=document.defaultView.getComputedStyle(B,null).getPropertyValue(A);
       
  1665 }else{var C="";
       
  1666 }}return C;
       
  1667 };
       
  1668 SimileAjax.DOM.getEventRelativeCoordinates=function(A,B){if(SimileAjax.Platform.browser.isIE){if(A.type=="mousewheel"){var C=SimileAjax.DOM.getPageCoordinates(B);
       
  1669 return{x:A.clientX-C.left,y:A.clientY-C.top};
       
  1670 }else{return{x:A.offsetX,y:A.offsetY};
       
  1671 }}else{var C=SimileAjax.DOM.getPageCoordinates(B);
       
  1672 if((A.type=="DOMMouseScroll")&&SimileAjax.Platform.browser.isFirefox&&(SimileAjax.Platform.browser.majorVersion==2)){return{x:A.screenX-C.left,y:A.screenY-C.top};
       
  1673 }else{return{x:A.pageX-C.left,y:A.pageY-C.top};
       
  1674 }}};
       
  1675 SimileAjax.DOM.getEventPageCoordinates=function(A){if(SimileAjax.Platform.browser.isIE){return{x:A.clientX+document.body.scrollLeft,y:A.clientY+document.body.scrollTop};
       
  1676 }else{return{x:A.pageX,y:A.pageY};
       
  1677 }};
       
  1678 SimileAjax.DOM.hittest=function(A,C,B){return SimileAjax.DOM._hittest(document.body,A,C,B);
       
  1679 };
       
  1680 SimileAjax.DOM._hittest=function(C,L,K,H){var M=C.childNodes;
       
  1681 outer:for(var G=0;
       
  1682 G<M.length;
       
  1683 G++){var A=M[G];
       
  1684 for(var F=0;
       
  1685 F<H.length;
       
  1686 F++){if(A==H[F]){continue outer;
       
  1687 }}if(A.offsetWidth==0&&A.offsetHeight==0){var B=SimileAjax.DOM._hittest(A,L,K,H);
       
  1688 if(B!=A){return B;
       
  1689 }}else{var J=0;
       
  1690 var E=0;
       
  1691 var D=A;
       
  1692 while(D){J+=D.offsetTop;
       
  1693 E+=D.offsetLeft;
       
  1694 D=D.offsetParent;
       
  1695 }if(E<=L&&J<=K&&(L-E)<A.offsetWidth&&(K-J)<A.offsetHeight){return SimileAjax.DOM._hittest(A,L,K,H);
       
  1696 }else{if(A.nodeType==1&&A.tagName=="TR"){var I=SimileAjax.DOM._hittest(A,L,K,H);
       
  1697 if(I!=A){return I;
       
  1698 }}}}}return C;
       
  1699 };
       
  1700 SimileAjax.DOM.cancelEvent=function(A){A.returnValue=false;
       
  1701 A.cancelBubble=true;
       
  1702 if("preventDefault" in A){A.preventDefault();
       
  1703 }};
       
  1704 SimileAjax.DOM.appendClassName=function(C,D){var B=C.className.split(" ");
       
  1705 for(var A=0;
       
  1706 A<B.length;
       
  1707 A++){if(B[A]==D){return ;
       
  1708 }}B.push(D);
       
  1709 C.className=B.join(" ");
       
  1710 };
       
  1711 SimileAjax.DOM.createInputElement=function(A){var B=document.createElement("div");
       
  1712 B.innerHTML="<input type='"+A+"' />";
       
  1713 return B.firstChild;
       
  1714 };
       
  1715 SimileAjax.DOM.createDOMFromTemplate=function(B){var A={};
       
  1716 A.elmt=SimileAjax.DOM._createDOMFromTemplate(B,A,null);
       
  1717 return A;
       
  1718 };
       
  1719 SimileAjax.DOM._createDOMFromTemplate=function(A,I,E){if(A==null){return null;
       
  1720 }else{if(typeof A!="object"){var D=document.createTextNode(A);
       
  1721 if(E!=null){E.appendChild(D);
       
  1722 }return D;
       
  1723 }else{var C=null;
       
  1724 if("tag" in A){var J=A.tag;
       
  1725 if(E!=null){if(J=="tr"){C=E.insertRow(E.rows.length);
       
  1726 }else{if(J=="td"){C=E.insertCell(E.cells.length);
       
  1727 }}}if(C==null){C=J=="input"?SimileAjax.DOM.createInputElement(A.type):document.createElement(J);
       
  1728 if(E!=null){E.appendChild(C);
       
  1729 }}}else{C=A.elmt;
       
  1730 if(E!=null){E.appendChild(C);
       
  1731 }}for(var B in A){var G=A[B];
       
  1732 if(B=="field"){I[G]=C;
       
  1733 }else{if(B=="className"){C.className=G;
       
  1734 }else{if(B=="id"){C.id=G;
       
  1735 }else{if(B=="title"){C.title=G;
       
  1736 }else{if(B=="type"&&C.tagName=="input"){}else{if(B=="style"){for(n in G){var H=G[n];
       
  1737 if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat";
       
  1738 }C.style[n]=H;
       
  1739 }}else{if(B=="children"){for(var F=0;
       
  1740 F<G.length;
       
  1741 F++){SimileAjax.DOM._createDOMFromTemplate(G[F],I,C);
       
  1742 }}else{if(B!="tag"&&B!="elmt"){C.setAttribute(B,G);
       
  1743 }}}}}}}}}return C;
       
  1744 }}};
       
  1745 SimileAjax.DOM._cachedParent=null;
       
  1746 SimileAjax.DOM.createElementFromString=function(A){if(SimileAjax.DOM._cachedParent==null){SimileAjax.DOM._cachedParent=document.createElement("div");
       
  1747 }SimileAjax.DOM._cachedParent.innerHTML=A;
       
  1748 return SimileAjax.DOM._cachedParent.firstChild;
       
  1749 };
       
  1750 SimileAjax.DOM.createDOMFromString=function(A,C,D){var B=typeof A=="string"?document.createElement(A):A;
       
  1751 B.innerHTML=C;
       
  1752 var E={elmt:B};
       
  1753 SimileAjax.DOM._processDOMChildrenConstructedFromString(E,B,D!=null?D:{});
       
  1754 return E;
       
  1755 };
       
  1756 SimileAjax.DOM._processDOMConstructedFromString=function(D,A,B){var E=A.id;
       
  1757 if(E!=null&&E.length>0){A.removeAttribute("id");
       
  1758 if(E in B){var C=A.parentNode;
       
  1759 C.insertBefore(B[E],A);
       
  1760 C.removeChild(A);
       
  1761 D[E]=B[E];
       
  1762 return ;
       
  1763 }else{D[E]=A;
       
  1764 }}if(A.hasChildNodes()){SimileAjax.DOM._processDOMChildrenConstructedFromString(D,A,B);
       
  1765 }};
       
  1766 SimileAjax.DOM._processDOMChildrenConstructedFromString=function(E,B,D){var C=B.firstChild;
       
  1767 while(C!=null){var A=C.nextSibling;
       
  1768 if(C.nodeType==1){SimileAjax.DOM._processDOMConstructedFromString(E,C,D);
       
  1769 }C=A;
       
  1770 }};
       
  1771 
       
  1772 
       
  1773 /* graphics.js */
       
  1774 SimileAjax.Graphics=new Object();
       
  1775 SimileAjax.Graphics.pngIsTranslucent=(!SimileAjax.Platform.browser.isIE)||(SimileAjax.Platform.browser.majorVersion>6);
       
  1776 SimileAjax.Graphics._createTranslucentImage1=function(A,C){var B=document.createElement("img");
       
  1777 B.setAttribute("src",A);
       
  1778 if(C!=null){B.style.verticalAlign=C;
       
  1779 }return B;
       
  1780 };
       
  1781 SimileAjax.Graphics._createTranslucentImage2=function(A,C){var B=document.createElement("img");
       
  1782 B.style.width="1px";
       
  1783 B.style.height="1px";
       
  1784 B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='image')";
       
  1785 B.style.verticalAlign=(C!=null)?C:"middle";
       
  1786 return B;
       
  1787 };
       
  1788 SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2;
       
  1789 SimileAjax.Graphics._createTranslucentImageHTML1=function(A,B){return'<img src="'+A+'"'+(B!=null?' style="vertical-align: '+B+';"':"")+" />";
       
  1790 };
       
  1791 SimileAjax.Graphics._createTranslucentImageHTML2=function(A,C){var B="width: 1px; height: 1px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='image');"+(C!=null?" vertical-align: "+C+";":"");
       
  1792 return"<img src='"+A+"' style=\""+B+'" />';
       
  1793 };
       
  1794 SimileAjax.Graphics.createTranslucentImageHTML=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImageHTML1:SimileAjax.Graphics._createTranslucentImageHTML2;
       
  1795 SimileAjax.Graphics.setOpacity=function(B,A){if(SimileAjax.Platform.browser.isIE){B.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+A+")";
       
  1796 }else{var C=(A/100).toString();
       
  1797 B.style.opacity=C;
       
  1798 B.style.MozOpacity=C;
       
  1799 }};
       
  1800 SimileAjax.Graphics._bubbleMargins={top:33,bottom:42,left:33,right:40};
       
  1801 SimileAjax.Graphics._arrowOffsets={top:0,bottom:9,left:1,right:8};
       
  1802 SimileAjax.Graphics._bubblePadding=15;
       
  1803 SimileAjax.Graphics._bubblePointOffset=6;
       
  1804 SimileAjax.Graphics._halfArrowWidth=18;
       
  1805 SimileAjax.Graphics.createBubbleForContentAndPoint=function(E,D,C,A,B){if(typeof A!="number"){A=300;
       
  1806 }E.style.position="absolute";
       
  1807 E.style.left="-5000px";
       
  1808 E.style.top="0px";
       
  1809 E.style.width=A+"px";
       
  1810 document.body.appendChild(E);
       
  1811 window.setTimeout(function(){var H=E.scrollWidth+10;
       
  1812 var F=E.scrollHeight+10;
       
  1813 var G=SimileAjax.Graphics.createBubbleForPoint(D,C,H,F,B);
       
  1814 document.body.removeChild(E);
       
  1815 E.style.position="static";
       
  1816 E.style.left="";
       
  1817 E.style.top="";
       
  1818 E.style.width=H+"px";
       
  1819 G.content.appendChild(E);
       
  1820 },200);
       
  1821 };
       
  1822 SimileAjax.Graphics.createBubbleForPoint=function(C,B,N,R,F){function T(){if(typeof window.innerHeight=="number"){return{w:window.innerWidth,h:window.innerHeight};
       
  1823 }else{if(document.documentElement&&document.documentElement.clientHeight){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight};
       
  1824 }else{if(document.body&&document.body.clientHeight){return{w:document.body.clientWidth,h:document.body.clientHeight};
       
  1825 }}}}var L=function(){if(!M._closed){document.body.removeChild(M._div);
       
  1826 M._doc=null;
       
  1827 M._div=null;
       
  1828 M._content=null;
       
  1829 M._closed=true;
       
  1830 }};
       
  1831 var M={_closed:false};
       
  1832 var O=T();
       
  1833 var H=O.w;
       
  1834 var G=O.h;
       
  1835 var D=SimileAjax.Graphics._bubbleMargins;
       
  1836 N=parseInt(N,10);
       
  1837 R=parseInt(R,10);
       
  1838 var P=D.left+N+D.right;
       
  1839 var U=D.top+R+D.bottom;
       
  1840 var Q=SimileAjax.Graphics.pngIsTranslucent;
       
  1841 var J=SimileAjax.urlPrefix;
       
  1842 var A=function(Z,Y,a,X){Z.style.position="absolute";
       
  1843 Z.style.width=a+"px";
       
  1844 Z.style.height=X+"px";
       
  1845 if(Q){Z.style.background="url("+Y+")";
       
  1846 }else{Z.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+Y+"', sizingMethod='crop')";
       
  1847 }};
       
  1848 var K=document.createElement("div");
       
  1849 K.style.width=P+"px";
       
  1850 K.style.height=U+"px";
       
  1851 K.style.position="absolute";
       
  1852 K.style.zIndex=1000;
       
  1853 var W=SimileAjax.WindowManager.pushLayer(L,true,K);
       
  1854 M._div=K;
       
  1855 M.close=function(){SimileAjax.WindowManager.popLayer(W);
       
  1856 };
       
  1857 var I=document.createElement("div");
       
  1858 I.style.width="100%";
       
  1859 I.style.height="100%";
       
  1860 I.style.position="relative";
       
  1861 K.appendChild(I);
       
  1862 var S=function(Z,c,b,a,Y){var X=document.createElement("div");
       
  1863 X.style.left=c+"px";
       
  1864 X.style.top=b+"px";
       
  1865 A(X,Z,a,Y);
       
  1866 I.appendChild(X);
       
  1867 };
       
  1868 S(J+"data/timeline/bubble-top-left.png",0,0,D.left,D.top);
       
  1869 S(J+"data/timeline/bubble-top.png",D.left,0,N,D.top);
       
  1870 S(J+"data/timeline/bubble-top-right.png",D.left+N,0,D.right,D.top);
       
  1871 S(J+"data/timeline/bubble-left.png",0,D.top,D.left,R);
       
  1872 S(J+"data/timeline/bubble-right.png",D.left+N,D.top,D.right,R);
       
  1873 S(J+"data/timeline/bubble-bottom-left.png",0,D.top+R,D.left,D.bottom);
       
  1874 S(J+"data/timeline/bubble-bottom.png",D.left,D.top+R,N,D.bottom);
       
  1875 S(J+"data/timeline/bubble-bottom-right.png",D.left+N,D.top+R,D.right,D.bottom);
       
  1876 var V=document.createElement("div");
       
  1877 V.style.left=(P-D.right+SimileAjax.Graphics._bubblePadding-16-2)+"px";
       
  1878 V.style.top=(D.top-SimileAjax.Graphics._bubblePadding+1)+"px";
       
  1879 V.style.cursor="pointer";
       
  1880 A(V,J+"data/timeline/close-button.png",16,16);
       
  1881 SimileAjax.WindowManager.registerEventWithObject(V,"click",M,"close");
       
  1882 I.appendChild(V);
       
  1883 var E=document.createElement("div");
       
  1884 E.style.position="absolute";
       
  1885 E.style.left=D.left+"px";
       
  1886 E.style.top=D.top+"px";
       
  1887 E.style.width=N+"px";
       
  1888 E.style.height=R+"px";
       
  1889 E.style.overflow="auto";
       
  1890 E.style.background="white";
       
  1891 I.appendChild(E);
       
  1892 M.content=E;
       
  1893 (function(){if(C-SimileAjax.Graphics._halfArrowWidth-SimileAjax.Graphics._bubblePadding>0&&C+SimileAjax.Graphics._halfArrowWidth+SimileAjax.Graphics._bubblePadding<H){var Z=C-Math.round(N/2)-D.left;
       
  1894 Z=C<(H/2)?Math.max(Z,-(D.left-SimileAjax.Graphics._bubblePadding)):Math.min(Z,H+(D.right-SimileAjax.Graphics._bubblePadding)-P);
       
  1895 if((F&&F=="top")||(!F&&(B-SimileAjax.Graphics._bubblePointOffset-U>0))){var X=document.createElement("div");
       
  1896 X.style.left=(C-SimileAjax.Graphics._halfArrowWidth-Z)+"px";
       
  1897 X.style.top=(D.top+R)+"px";
       
  1898 A(X,J+"data/timeline/bubble-bottom-arrow.png",37,D.bottom);
       
  1899 I.appendChild(X);
       
  1900 K.style.left=Z+"px";
       
  1901 K.style.top=(B-SimileAjax.Graphics._bubblePointOffset-U+SimileAjax.Graphics._arrowOffsets.bottom)+"px";
       
  1902 return ;
       
  1903 }else{if((F&&F=="bottom")||(!F&&(B+SimileAjax.Graphics._bubblePointOffset+U<G))){var X=document.createElement("div");
       
  1904 X.style.left=(C-SimileAjax.Graphics._halfArrowWidth-Z)+"px";
       
  1905 X.style.top="0px";
       
  1906 A(X,J+"data/timeline/bubble-top-arrow.png",37,D.top);
       
  1907 I.appendChild(X);
       
  1908 K.style.left=Z+"px";
       
  1909 K.style.top=(B+SimileAjax.Graphics._bubblePointOffset-SimileAjax.Graphics._arrowOffsets.top)+"px";
       
  1910 return ;
       
  1911 }}}var Y=B-Math.round(R/2)-D.top;
       
  1912 Y=B<(G/2)?Math.max(Y,-(D.top-SimileAjax.Graphics._bubblePadding)):Math.min(Y,G+(D.bottom-SimileAjax.Graphics._bubblePadding)-U);
       
  1913 if((F&&F=="left")||(!F&&(C-SimileAjax.Graphics._bubblePointOffset-P>0))){var X=document.createElement("div");
       
  1914 X.style.left=(D.left+N)+"px";
       
  1915 X.style.top=(B-SimileAjax.Graphics._halfArrowWidth-Y)+"px";
       
  1916 A(X,J+"data/timeline/bubble-right-arrow.png",D.right,37);
       
  1917 I.appendChild(X);
       
  1918 K.style.left=(C-SimileAjax.Graphics._bubblePointOffset-P+SimileAjax.Graphics._arrowOffsets.right)+"px";
       
  1919 K.style.top=Y+"px";
       
  1920 }else{if((F&&F=="right")||(!F&&(C-SimileAjax.Graphics._bubblePointOffset-P<H))){var X=document.createElement("div");
       
  1921 X.style.left="0px";
       
  1922 X.style.top=(B-SimileAjax.Graphics._halfArrowWidth-Y)+"px";
       
  1923 A(X,J+"data/timeline/bubble-left-arrow.png",D.left,37);
       
  1924 I.appendChild(X);
       
  1925 K.style.left=(C+SimileAjax.Graphics._bubblePointOffset-SimileAjax.Graphics._arrowOffsets.left)+"px";
       
  1926 K.style.top=Y+"px";
       
  1927 }}})();
       
  1928 document.body.appendChild(K);
       
  1929 return M;
       
  1930 };
       
  1931 SimileAjax.Graphics.createMessageBubble=function(H){var G=H.createElement("div");
       
  1932 if(SimileAjax.Graphics.pngIsTranslucent){var I=H.createElement("div");
       
  1933 I.style.height="33px";
       
  1934 I.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-top-left.png) top left no-repeat";
       
  1935 I.style.paddingLeft="44px";
       
  1936 G.appendChild(I);
       
  1937 var C=H.createElement("div");
       
  1938 C.style.height="33px";
       
  1939 C.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-top-right.png) top right no-repeat";
       
  1940 I.appendChild(C);
       
  1941 var F=H.createElement("div");
       
  1942 F.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-left.png) top left repeat-y";
       
  1943 F.style.paddingLeft="44px";
       
  1944 G.appendChild(F);
       
  1945 var A=H.createElement("div");
       
  1946 A.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-right.png) top right repeat-y";
       
  1947 A.style.paddingRight="44px";
       
  1948 F.appendChild(A);
       
  1949 var D=H.createElement("div");
       
  1950 A.appendChild(D);
       
  1951 var B=H.createElement("div");
       
  1952 B.style.height="55px";
       
  1953 B.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-bottom-left.png) bottom left no-repeat";
       
  1954 B.style.paddingLeft="44px";
       
  1955 G.appendChild(B);
       
  1956 var E=H.createElement("div");
       
  1957 E.style.height="55px";
       
  1958 E.style.background="url("+SimileAjax.urlPrefix+"data/timeline/message-bottom-right.png) bottom right no-repeat";
       
  1959 B.appendChild(E);
       
  1960 }else{G.style.border="2px solid #7777AA";
       
  1961 G.style.padding="20px";
       
  1962 G.style.background="white";
       
  1963 SimileAjax.Graphics.setOpacity(G,90);
       
  1964 var D=H.createElement("div");
       
  1965 G.appendChild(D);
       
  1966 }return{containerDiv:G,contentDiv:D};
       
  1967 };
       
  1968 SimileAjax.Graphics.createAnimation=function(B,E,D,C,A){return new SimileAjax.Graphics._Animation(B,E,D,C,A);
       
  1969 };
       
  1970 SimileAjax.Graphics._Animation=function(B,E,D,C,A){this.f=B;
       
  1971 this.cont=(typeof A=="function")?A:function(){};
       
  1972 this.from=E;
       
  1973 this.to=D;
       
  1974 this.current=E;
       
  1975 this.duration=C;
       
  1976 this.start=new Date().getTime();
       
  1977 this.timePassed=0;
       
  1978 };
       
  1979 SimileAjax.Graphics._Animation.prototype.run=function(){var A=this;
       
  1980 window.setTimeout(function(){A.step();
       
  1981 },50);
       
  1982 };
       
  1983 SimileAjax.Graphics._Animation.prototype.step=function(){this.timePassed+=50;
       
  1984 var B=this.timePassed/this.duration;
       
  1985 var A=-Math.cos(B*Math.PI)/2+0.5;
       
  1986 var D=A*(this.to-this.from)+this.from;
       
  1987 try{this.f(D,D-this.current);
       
  1988 }catch(C){}this.current=D;
       
  1989 if(this.timePassed<this.duration){this.run();
       
  1990 }else{this.f(this.to,0);
       
  1991 this["cont"]();
       
  1992 }};
       
  1993 SimileAjax.Graphics.createStructuredDataCopyButton=function(F,D,A,E){var G=document.createElement("div");
       
  1994 G.style.position="relative";
       
  1995 G.style.display="inline";
       
  1996 G.style.width=D+"px";
       
  1997 G.style.height=A+"px";
       
  1998 G.style.overflow="hidden";
       
  1999 G.style.margin="2px";
       
  2000 if(SimileAjax.Graphics.pngIsTranslucent){G.style.background="url("+F+") no-repeat";
       
  2001 }else{G.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+F+"', sizingMethod='image')";
       
  2002 }var C;
       
  2003 if(SimileAjax.Platform.browser.isIE){C="filter:alpha(opacity=0)";
       
  2004 }else{C="opacity: 0";
       
  2005 }G.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+C+"' />";
       
  2006 var B=G.firstChild;
       
  2007 B.style.width=D+"px";
       
  2008 B.style.height=A+"px";
       
  2009 B.onmousedown=function(H){H=(H)?H:((event)?event:null);
       
  2010 if(H.button==2){B.value=E();
       
  2011 B.select();
       
  2012 }};
       
  2013 return G;
       
  2014 };
       
  2015 SimileAjax.Graphics.getFontRenderingContext=function(A,B){return new SimileAjax.Graphics._FontRenderingContext(A,B);
       
  2016 };
       
  2017 SimileAjax.Graphics._FontRenderingContext=function(A,B){this._elmt=A;
       
  2018 this._elmt.style.visibility="hidden";
       
  2019 if(typeof B=="string"){this._elmt.style.width=B;
       
  2020 }else{if(typeof B=="number"){this._elmt.style.width=B+"px";
       
  2021 }}};
       
  2022 SimileAjax.Graphics._FontRenderingContext.prototype.dispose=function(){this._elmt=null;
       
  2023 };
       
  2024 SimileAjax.Graphics._FontRenderingContext.prototype.update=function(){this._elmt.innerHTML="A";
       
  2025 this._lineHeight=this._elmt.offsetHeight;
       
  2026 };
       
  2027 SimileAjax.Graphics._FontRenderingContext.prototype.computeSize=function(A){this._elmt.innerHTML=A;
       
  2028 return{width:this._elmt.offsetWidth,height:this._elmt.offsetHeight};
       
  2029 };
       
  2030 SimileAjax.Graphics._FontRenderingContext.prototype.getLineHeight=function(){return this._lineHeight;
       
  2031 };
       
  2032 
       
  2033 
       
  2034 /* history.js */
       
  2035 SimileAjax.History={maxHistoryLength:10,historyFile:"__history__.html",enabled:true,_initialized:false,_listeners:new SimileAjax.ListenerQueue(),_actions:[],_baseIndex:0,_currentIndex:0,_plainDocumentTitle:document.title};
       
  2036 SimileAjax.History.formatHistoryEntryTitle=function(A){return SimileAjax.History._plainDocumentTitle+" {"+A+"}";
       
  2037 };
       
  2038 SimileAjax.History.initialize=function(){if(SimileAjax.History._initialized){return ;
       
  2039 }if(SimileAjax.History.enabled){var A=document.createElement("iframe");
       
  2040 A.id="simile-ajax-history";
       
  2041 A.style.position="absolute";
       
  2042 A.style.width="10px";
       
  2043 A.style.height="10px";
       
  2044 A.style.top="0px";
       
  2045 A.style.left="0px";
       
  2046 A.style.visibility="hidden";
       
  2047 A.src=SimileAjax.History.historyFile+"?0";
       
  2048 document.body.appendChild(A);
       
  2049 SimileAjax.DOM.registerEvent(A,"load",SimileAjax.History._handleIFrameOnLoad);
       
  2050 SimileAjax.History._iframe=A;
       
  2051 }SimileAjax.History._initialized=true;
       
  2052 };
       
  2053 SimileAjax.History.addListener=function(A){SimileAjax.History.initialize();
       
  2054 SimileAjax.History._listeners.add(A);
       
  2055 };
       
  2056 SimileAjax.History.removeListener=function(A){SimileAjax.History.initialize();
       
  2057 SimileAjax.History._listeners.remove(A);
       
  2058 };
       
  2059 SimileAjax.History.addAction=function(A){SimileAjax.History.initialize();
       
  2060 SimileAjax.History._listeners.fire("onBeforePerform",[A]);
       
  2061 window.setTimeout(function(){try{A.perform();
       
  2062 SimileAjax.History._listeners.fire("onAfterPerform",[A]);
       
  2063 if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex);
       
  2064 SimileAjax.History._actions.push(A);
       
  2065 SimileAjax.History._currentIndex++;
       
  2066 var C=SimileAjax.History._actions.length-SimileAjax.History.maxHistoryLength;
       
  2067 if(C>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(C);
       
  2068 SimileAjax.History._baseIndex+=C;
       
  2069 }try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex;
       
  2070 }catch(B){var D=SimileAjax.History.formatHistoryEntryTitle(A.label);
       
  2071 document.title=D;
       
  2072 }}}catch(B){SimileAjax.Debug.exception(B,"Error adding action {"+A.label+"} to history");
       
  2073 }},0);
       
  2074 };
       
  2075 SimileAjax.History.addLengthyAction=function(C,A,B){SimileAjax.History.addAction({perform:C,undo:A,label:B,uiLayer:SimileAjax.WindowManager.getBaseLayer(),lengthy:true});
       
  2076 };
       
  2077 SimileAjax.History._handleIFrameOnLoad=function(){try{var B=SimileAjax.History._iframe.contentWindow.location.search;
       
  2078 var F=(B.length==0)?0:Math.max(0,parseInt(B.substr(1)));
       
  2079 var E=function(){var G=F-SimileAjax.History._currentIndex;
       
  2080 SimileAjax.History._currentIndex+=G;
       
  2081 SimileAjax.History._baseIndex+=G;
       
  2082 SimileAjax.History._iframe.contentWindow.location.search="?"+F;
       
  2083 };
       
  2084 if(F<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]);
       
  2085 window.setTimeout(function(){while(SimileAjax.History._currentIndex>F&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--;
       
  2086 var G=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];
       
  2087 try{G.undo();
       
  2088 }catch(H){SimileAjax.Debug.exception(H,"History: Failed to undo action {"+G.label+"}");
       
  2089 }}SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]);
       
  2090 E();
       
  2091 },0);
       
  2092 }else{if(F>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]);
       
  2093 window.setTimeout(function(){while(SimileAjax.History._currentIndex<F&&SimileAjax.History._currentIndex-SimileAjax.History._baseIndex<SimileAjax.History._actions.length){var G=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];
       
  2094 try{G.perform();
       
  2095 }catch(H){SimileAjax.Debug.exception(H,"History: Failed to redo action {"+G.label+"}");
       
  2096 }SimileAjax.History._currentIndex++;
       
  2097 }SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]);
       
  2098 E();
       
  2099 },0);
       
  2100 }else{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;
       
  2101 var D=(A>=0&&A<SimileAjax.History._actions.length)?SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[A].label):SimileAjax.History._plainDocumentTitle;
       
  2102 SimileAjax.History._iframe.contentWindow.document.title=D;
       
  2103 document.title=D;
       
  2104 }}}catch(C){}};
       
  2105 SimileAjax.History.getNextUndoAction=function(){try{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;
       
  2106 return SimileAjax.History._actions[A];
       
  2107 }catch(B){return null;
       
  2108 }};
       
  2109 SimileAjax.History.getNextRedoAction=function(){try{var A=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex;
       
  2110 return SimileAjax.History._actions[A];
       
  2111 }catch(B){return null;
       
  2112 }};
       
  2113 
       
  2114 
       
  2115 /* html.js */
       
  2116 SimileAjax.HTML=new Object();
       
  2117 SimileAjax.HTML._e2uHash={};
       
  2118 (function(){var A=SimileAjax.HTML._e2uHash;
       
  2119 A["nbsp"]="\u00A0[space]";
       
  2120 A["iexcl"]="\u00A1";
       
  2121 A["cent"]="\u00A2";
       
  2122 A["pound"]="\u00A3";
       
  2123 A["curren"]="\u00A4";
       
  2124 A["yen"]="\u00A5";
       
  2125 A["brvbar"]="\u00A6";
       
  2126 A["sect"]="\u00A7";
       
  2127 A["uml"]="\u00A8";
       
  2128 A["copy"]="\u00A9";
       
  2129 A["ordf"]="\u00AA";
       
  2130 A["laquo"]="\u00AB";
       
  2131 A["not"]="\u00AC";
       
  2132 A["shy"]="\u00AD";
       
  2133 A["reg"]="\u00AE";
       
  2134 A["macr"]="\u00AF";
       
  2135 A["deg"]="\u00B0";
       
  2136 A["plusmn"]="\u00B1";
       
  2137 A["sup2"]="\u00B2";
       
  2138 A["sup3"]="\u00B3";
       
  2139 A["acute"]="\u00B4";
       
  2140 A["micro"]="\u00B5";
       
  2141 A["para"]="\u00B6";
       
  2142 A["middot"]="\u00B7";
       
  2143 A["cedil"]="\u00B8";
       
  2144 A["sup1"]="\u00B9";
       
  2145 A["ordm"]="\u00BA";
       
  2146 A["raquo"]="\u00BB";
       
  2147 A["frac14"]="\u00BC";
       
  2148 A["frac12"]="\u00BD";
       
  2149 A["frac34"]="\u00BE";
       
  2150 A["iquest"]="\u00BF";
       
  2151 A["Agrave"]="\u00C0";
       
  2152 A["Aacute"]="\u00C1";
       
  2153 A["Acirc"]="\u00C2";
       
  2154 A["Atilde"]="\u00C3";
       
  2155 A["Auml"]="\u00C4";
       
  2156 A["Aring"]="\u00C5";
       
  2157 A["AElig"]="\u00C6";
       
  2158 A["Ccedil"]="\u00C7";
       
  2159 A["Egrave"]="\u00C8";
       
  2160 A["Eacute"]="\u00C9";
       
  2161 A["Ecirc"]="\u00CA";
       
  2162 A["Euml"]="\u00CB";
       
  2163 A["Igrave"]="\u00CC";
       
  2164 A["Iacute"]="\u00CD";
       
  2165 A["Icirc"]="\u00CE";
       
  2166 A["Iuml"]="\u00CF";
       
  2167 A["ETH"]="\u00D0";
       
  2168 A["Ntilde"]="\u00D1";
       
  2169 A["Ograve"]="\u00D2";
       
  2170 A["Oacute"]="\u00D3";
       
  2171 A["Ocirc"]="\u00D4";
       
  2172 A["Otilde"]="\u00D5";
       
  2173 A["Ouml"]="\u00D6";
       
  2174 A["times"]="\u00D7";
       
  2175 A["Oslash"]="\u00D8";
       
  2176 A["Ugrave"]="\u00D9";
       
  2177 A["Uacute"]="\u00DA";
       
  2178 A["Ucirc"]="\u00DB";
       
  2179 A["Uuml"]="\u00DC";
       
  2180 A["Yacute"]="\u00DD";
       
  2181 A["THORN"]="\u00DE";
       
  2182 A["szlig"]="\u00DF";
       
  2183 A["agrave"]="\u00E0";
       
  2184 A["aacute"]="\u00E1";
       
  2185 A["acirc"]="\u00E2";
       
  2186 A["atilde"]="\u00E3";
       
  2187 A["auml"]="\u00E4";
       
  2188 A["aring"]="\u00E5";
       
  2189 A["aelig"]="\u00E6";
       
  2190 A["ccedil"]="\u00E7";
       
  2191 A["egrave"]="\u00E8";
       
  2192 A["eacute"]="\u00E9";
       
  2193 A["ecirc"]="\u00EA";
       
  2194 A["euml"]="\u00EB";
       
  2195 A["igrave"]="\u00EC";
       
  2196 A["iacute"]="\u00ED";
       
  2197 A["icirc"]="\u00EE";
       
  2198 A["iuml"]="\u00EF";
       
  2199 A["eth"]="\u00F0";
       
  2200 A["ntilde"]="\u00F1";
       
  2201 A["ograve"]="\u00F2";
       
  2202 A["oacute"]="\u00F3";
       
  2203 A["ocirc"]="\u00F4";
       
  2204 A["otilde"]="\u00F5";
       
  2205 A["ouml"]="\u00F6";
       
  2206 A["divide"]="\u00F7";
       
  2207 A["oslash"]="\u00F8";
       
  2208 A["ugrave"]="\u00F9";
       
  2209 A["uacute"]="\u00FA";
       
  2210 A["ucirc"]="\u00FB";
       
  2211 A["uuml"]="\u00FC";
       
  2212 A["yacute"]="\u00FD";
       
  2213 A["thorn"]="\u00FE";
       
  2214 A["yuml"]="\u00FF";
       
  2215 A["quot"]="\u0022";
       
  2216 A["amp"]="\u0026";
       
  2217 A["lt"]="\u003C";
       
  2218 A["gt"]="\u003E";
       
  2219 A["OElig"]="";
       
  2220 A["oelig"]="\u0153";
       
  2221 A["Scaron"]="\u0160";
       
  2222 A["scaron"]="\u0161";
       
  2223 A["Yuml"]="\u0178";
       
  2224 A["circ"]="\u02C6";
       
  2225 A["tilde"]="\u02DC";
       
  2226 A["ensp"]="\u2002";
       
  2227 A["emsp"]="\u2003";
       
  2228 A["thinsp"]="\u2009";
       
  2229 A["zwnj"]="\u200C";
       
  2230 A["zwj"]="\u200D";
       
  2231 A["lrm"]="\u200E";
       
  2232 A["rlm"]="\u200F";
       
  2233 A["ndash"]="\u2013";
       
  2234 A["mdash"]="\u2014";
       
  2235 A["lsquo"]="\u2018";
       
  2236 A["rsquo"]="\u2019";
       
  2237 A["sbquo"]="\u201A";
       
  2238 A["ldquo"]="\u201C";
       
  2239 A["rdquo"]="\u201D";
       
  2240 A["bdquo"]="\u201E";
       
  2241 A["dagger"]="\u2020";
       
  2242 A["Dagger"]="\u2021";
       
  2243 A["permil"]="\u2030";
       
  2244 A["lsaquo"]="\u2039";
       
  2245 A["rsaquo"]="\u203A";
       
  2246 A["euro"]="\u20AC";
       
  2247 A["fnof"]="\u0192";
       
  2248 A["Alpha"]="\u0391";
       
  2249 A["Beta"]="\u0392";
       
  2250 A["Gamma"]="\u0393";
       
  2251 A["Delta"]="\u0394";
       
  2252 A["Epsilon"]="\u0395";
       
  2253 A["Zeta"]="\u0396";
       
  2254 A["Eta"]="\u0397";
       
  2255 A["Theta"]="\u0398";
       
  2256 A["Iota"]="\u0399";
       
  2257 A["Kappa"]="\u039A";
       
  2258 A["Lambda"]="\u039B";
       
  2259 A["Mu"]="\u039C";
       
  2260 A["Nu"]="\u039D";
       
  2261 A["Xi"]="\u039E";
       
  2262 A["Omicron"]="\u039F";
       
  2263 A["Pi"]="\u03A0";
       
  2264 A["Rho"]="\u03A1";
       
  2265 A["Sigma"]="\u03A3";
       
  2266 A["Tau"]="\u03A4";
       
  2267 A["Upsilon"]="\u03A5";
       
  2268 A["Phi"]="\u03A6";
       
  2269 A["Chi"]="\u03A7";
       
  2270 A["Psi"]="\u03A8";
       
  2271 A["Omega"]="\u03A9";
       
  2272 A["alpha"]="\u03B1";
       
  2273 A["beta"]="\u03B2";
       
  2274 A["gamma"]="\u03B3";
       
  2275 A["delta"]="\u03B4";
       
  2276 A["epsilon"]="\u03B5";
       
  2277 A["zeta"]="\u03B6";
       
  2278 A["eta"]="\u03B7";
       
  2279 A["theta"]="\u03B8";
       
  2280 A["iota"]="\u03B9";
       
  2281 A["kappa"]="\u03BA";
       
  2282 A["lambda"]="\u03BB";
       
  2283 A["mu"]="\u03BC";
       
  2284 A["nu"]="\u03BD";
       
  2285 A["xi"]="\u03BE";
       
  2286 A["omicron"]="\u03BF";
       
  2287 A["pi"]="\u03C0";
       
  2288 A["rho"]="\u03C1";
       
  2289 A["sigmaf"]="\u03C2";
       
  2290 A["sigma"]="\u03C3";
       
  2291 A["tau"]="\u03C4";
       
  2292 A["upsilon"]="\u03C5";
       
  2293 A["phi"]="\u03C6";
       
  2294 A["chi"]="\u03C7";
       
  2295 A["psi"]="\u03C8";
       
  2296 A["omega"]="\u03C9";
       
  2297 A["thetasym"]="\u03D1";
       
  2298 A["upsih"]="\u03D2";
       
  2299 A["piv"]="\u03D6";
       
  2300 A["bull"]="\u2022";
       
  2301 A["hellip"]="\u2026";
       
  2302 A["prime"]="\u2032";
       
  2303 A["Prime"]="\u2033";
       
  2304 A["oline"]="\u203E";
       
  2305 A["frasl"]="\u2044";
       
  2306 A["weierp"]="\u2118";
       
  2307 A["image"]="\u2111";
       
  2308 A["real"]="\u211C";
       
  2309 A["trade"]="\u2122";
       
  2310 A["alefsym"]="\u2135";
       
  2311 A["larr"]="\u2190";
       
  2312 A["uarr"]="\u2191";
       
  2313 A["rarr"]="\u2192";
       
  2314 A["darr"]="\u2193";
       
  2315 A["harr"]="\u2194";
       
  2316 A["crarr"]="\u21B5";
       
  2317 A["lArr"]="\u21D0";
       
  2318 A["uArr"]="\u21D1";
       
  2319 A["rArr"]="\u21D2";
       
  2320 A["dArr"]="\u21D3";
       
  2321 A["hArr"]="\u21D4";
       
  2322 A["forall"]="\u2200";
       
  2323 A["part"]="\u2202";
       
  2324 A["exist"]="\u2203";
       
  2325 A["empty"]="\u2205";
       
  2326 A["nabla"]="\u2207";
       
  2327 A["isin"]="\u2208";
       
  2328 A["notin"]="\u2209";
       
  2329 A["ni"]="\u220B";
       
  2330 A["prod"]="\u220F";
       
  2331 A["sum"]="\u2211";
       
  2332 A["minus"]="\u2212";
       
  2333 A["lowast"]="\u2217";
       
  2334 A["radic"]="\u221A";
       
  2335 A["prop"]="\u221D";
       
  2336 A["infin"]="\u221E";
       
  2337 A["ang"]="\u2220";
       
  2338 A["and"]="\u2227";
       
  2339 A["or"]="\u2228";
       
  2340 A["cap"]="\u2229";
       
  2341 A["cup"]="\u222A";
       
  2342 A["int"]="\u222B";
       
  2343 A["there4"]="\u2234";
       
  2344 A["sim"]="\u223C";
       
  2345 A["cong"]="\u2245";
       
  2346 A["asymp"]="\u2248";
       
  2347 A["ne"]="\u2260";
       
  2348 A["equiv"]="\u2261";
       
  2349 A["le"]="\u2264";
       
  2350 A["ge"]="\u2265";
       
  2351 A["sub"]="\u2282";
       
  2352 A["sup"]="\u2283";
       
  2353 A["nsub"]="\u2284";
       
  2354 A["sube"]="\u2286";
       
  2355 A["supe"]="\u2287";
       
  2356 A["oplus"]="\u2295";
       
  2357 A["otimes"]="\u2297";
       
  2358 A["perp"]="\u22A5";
       
  2359 A["sdot"]="\u22C5";
       
  2360 A["lceil"]="\u2308";
       
  2361 A["rceil"]="\u2309";
       
  2362 A["lfloor"]="\u230A";
       
  2363 A["rfloor"]="\u230B";
       
  2364 A["lang"]="\u2329";
       
  2365 A["rang"]="\u232A";
       
  2366 A["loz"]="\u25CA";
       
  2367 A["spades"]="\u2660";
       
  2368 A["clubs"]="\u2663";
       
  2369 A["hearts"]="\u2665";
       
  2370 A["diams"]="\u2666";
       
  2371 })();
       
  2372 SimileAjax.HTML.deEntify=function(C){var D=SimileAjax.HTML._e2uHash;
       
  2373 var B=/&(\w+?);/;
       
  2374 while(B.test(C)){var A=C.match(B);
       
  2375 C=C.replace(B,D[A[1]]);
       
  2376 }return C;
       
  2377 };
       
  2378 
       
  2379 
       
  2380 /* json.js */
       
  2381 SimileAjax.JSON=new Object();
       
  2382 (function(){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
       
  2383 var s={array:function(x){var a=["["],b,f,i,l=x.length,v;
       
  2384 for(i=0;
       
  2385 i<l;
       
  2386 i+=1){v=x[i];
       
  2387 f=s[typeof v];
       
  2388 if(f){v=f(v);
       
  2389 if(typeof v=="string"){if(b){a[a.length]=",";
       
  2390 }a[a.length]=v;
       
  2391 b=true;
       
  2392 }}}a[a.length]="]";
       
  2393 return a.join("");
       
  2394 },"boolean":function(x){return String(x);
       
  2395 },"null":function(x){return"null";
       
  2396 },number:function(x){return isFinite(x)?String(x):"null";
       
  2397 },object:function(x){if(x){if(x instanceof Array){return s.array(x);
       
  2398 }var a=["{"],b,f,i,v;
       
  2399 for(i in x){v=x[i];
       
  2400 f=s[typeof v];
       
  2401 if(f){v=f(v);
       
  2402 if(typeof v=="string"){if(b){a[a.length]=",";
       
  2403 }a.push(s.string(i),":",v);
       
  2404 b=true;
       
  2405 }}}a[a.length]="}";
       
  2406 return a.join("");
       
  2407 }return"null";
       
  2408 },string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];
       
  2409 if(c){return c;
       
  2410 }c=b.charCodeAt();
       
  2411 return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
       
  2412 });
       
  2413 }return'"'+x+'"';
       
  2414 }};
       
  2415 SimileAjax.JSON.toJSONString=function(o){if(o instanceof Object){return s.object(o);
       
  2416 }else{if(o instanceof Array){return s.array(o);
       
  2417 }else{return o.toString();
       
  2418 }}};
       
  2419 SimileAjax.JSON.parseJSON=function(){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+this+")");
       
  2420 }catch(e){return false;
       
  2421 }};
       
  2422 })();
       
  2423 
       
  2424 
       
  2425 /* string.js */
       
  2426 String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");
       
  2427 };
       
  2428 String.prototype.startsWith=function(A){return this.length>=A.length&&this.substr(0,A.length)==A;
       
  2429 };
       
  2430 String.prototype.endsWith=function(A){return this.length>=A.length&&this.substr(this.length-A.length)==A;
       
  2431 };
       
  2432 String.substitute=function(B,D){var A="";
       
  2433 var F=0;
       
  2434 while(F<B.length-1){var C=B.indexOf("%",F);
       
  2435 if(C<0||C==B.length-1){break;
       
  2436 }else{if(C>F&&B.charAt(C-1)=="\\"){A+=B.substring(F,C-1)+"%";
       
  2437 F=C+1;
       
  2438 }else{var E=parseInt(B.charAt(C+1));
       
  2439 if(isNaN(E)||E>=D.length){A+=B.substring(F,C+2);
       
  2440 }else{A+=B.substring(F,C)+D[E].toString();
       
  2441 }F=C+2;
       
  2442 }}}if(F<B.length){A+=B.substring(F);
       
  2443 }return A;
       
  2444 };
       
  2445 
       
  2446 
       
  2447 /* units.js */
       
  2448 SimileAjax.NativeDateUnit=new Object();
       
  2449 SimileAjax.NativeDateUnit.makeDefaultValue=function(){return new Date();
       
  2450 };
       
  2451 SimileAjax.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime());
       
  2452 };
       
  2453 SimileAjax.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase();
       
  2454 }return(A=="iso8601"||A=="iso 8601")?SimileAjax.DateTime.parseIso8601DateTime:SimileAjax.DateTime.parseGregorianDateTime;
       
  2455 };
       
  2456 SimileAjax.NativeDateUnit.parseFromObject=function(A){return SimileAjax.DateTime.parseGregorianDateTime(A);
       
  2457 };
       
  2458 SimileAjax.NativeDateUnit.toNumber=function(A){return A.getTime();
       
  2459 };
       
  2460 SimileAjax.NativeDateUnit.fromNumber=function(A){return new Date(A);
       
  2461 };
       
  2462 SimileAjax.NativeDateUnit.compare=function(D,C){var B,A;
       
  2463 if(typeof D=="object"){B=D.getTime();
       
  2464 }else{B=Number(D);
       
  2465 }if(typeof C=="object"){A=C.getTime();
       
  2466 }else{A=Number(C);
       
  2467 }return B-A;
       
  2468 };
       
  2469 SimileAjax.NativeDateUnit.earlier=function(B,A){return SimileAjax.NativeDateUnit.compare(B,A)<0?B:A;
       
  2470 };
       
  2471 SimileAjax.NativeDateUnit.later=function(B,A){return SimileAjax.NativeDateUnit.compare(B,A)>0?B:A;
       
  2472 };
       
  2473 SimileAjax.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B);
       
  2474 };
       
  2475 
       
  2476 
       
  2477 /* window-manager.js */
       
  2478 SimileAjax.WindowManager={_initialized:false,_listeners:[],_draggedElement:null,_draggedElementCallback:null,_dropTargetHighlightElement:null,_lastCoords:null,_ghostCoords:null,_draggingMode:"",_dragging:false,_layers:[]};
       
  2479 SimileAjax.WindowManager.initialize=function(){if(SimileAjax.WindowManager._initialized){return ;
       
  2480 }SimileAjax.DOM.registerEvent(document.body,"mousedown",SimileAjax.WindowManager._onBodyMouseDown);
       
  2481 SimileAjax.DOM.registerEvent(document.body,"mousemove",SimileAjax.WindowManager._onBodyMouseMove);
       
  2482 SimileAjax.DOM.registerEvent(document.body,"mouseup",SimileAjax.WindowManager._onBodyMouseUp);
       
  2483 SimileAjax.DOM.registerEvent(document,"keydown",SimileAjax.WindowManager._onBodyKeyDown);
       
  2484 SimileAjax.DOM.registerEvent(document,"keyup",SimileAjax.WindowManager._onBodyKeyUp);
       
  2485 SimileAjax.WindowManager._layers.push({index:0});
       
  2486 SimileAjax.WindowManager._historyListener={onBeforeUndoSeveral:function(){},onAfterUndoSeveral:function(){},onBeforeUndo:function(){},onAfterUndo:function(){},onBeforeRedoSeveral:function(){},onAfterRedoSeveral:function(){},onBeforeRedo:function(){},onAfterRedo:function(){}};
       
  2487 SimileAjax.History.addListener(SimileAjax.WindowManager._historyListener);
       
  2488 SimileAjax.WindowManager._initialized=true;
       
  2489 };
       
  2490 SimileAjax.WindowManager.getBaseLayer=function(){SimileAjax.WindowManager.initialize();
       
  2491 return SimileAjax.WindowManager._layers[0];
       
  2492 };
       
  2493 SimileAjax.WindowManager.getHighestLayer=function(){SimileAjax.WindowManager.initialize();
       
  2494 return SimileAjax.WindowManager._layers[SimileAjax.WindowManager._layers.length-1];
       
  2495 };
       
  2496 SimileAjax.WindowManager.registerEventWithObject=function(D,A,E,B,C){SimileAjax.WindowManager.registerEvent(D,A,function(G,F,H){return E[B].call(E,G,F,H);
       
  2497 },C);
       
  2498 };
       
  2499 SimileAjax.WindowManager.registerEvent=function(D,B,E,C){if(C==null){C=SimileAjax.WindowManager.getHighestLayer();
       
  2500 }var A=function(G,F,I){if(SimileAjax.WindowManager._canProcessEventAtLayer(C)){SimileAjax.WindowManager._popToLayer(C.index);
       
  2501 try{E(G,F,I);
       
  2502 }catch(H){SimileAjax.Debug.exception(H);
       
  2503 }}SimileAjax.DOM.cancelEvent(F);
       
  2504 return false;
       
  2505 };
       
  2506 SimileAjax.DOM.registerEvent(D,B,A);
       
  2507 };
       
  2508 SimileAjax.WindowManager.pushLayer=function(C,D,B){var A={onPop:C,index:SimileAjax.WindowManager._layers.length,ephemeral:(D),elmt:B};
       
  2509 SimileAjax.WindowManager._layers.push(A);
       
  2510 return A;
       
  2511 };
       
  2512 SimileAjax.WindowManager.popLayer=function(B){for(var A=1;
       
  2513 A<SimileAjax.WindowManager._layers.length;
       
  2514 A++){if(SimileAjax.WindowManager._layers[A]==B){SimileAjax.WindowManager._popToLayer(A-1);
       
  2515 break;
       
  2516 }}};
       
  2517 SimileAjax.WindowManager.popAllLayers=function(){SimileAjax.WindowManager._popToLayer(0);
       
  2518 };
       
  2519 SimileAjax.WindowManager.registerForDragging=function(B,C,A){SimileAjax.WindowManager.registerEvent(B,"mousedown",function(E,D,F){SimileAjax.WindowManager._handleMouseDown(E,D,C);
       
  2520 },A);
       
  2521 };
       
  2522 SimileAjax.WindowManager._popToLayer=function(C){while(C+1<SimileAjax.WindowManager._layers.length){try{var A=SimileAjax.WindowManager._layers.pop();
       
  2523 if(A.onPop!=null){A.onPop();
       
  2524 }}catch(B){}}};
       
  2525 SimileAjax.WindowManager._canProcessEventAtLayer=function(B){if(B.index==(SimileAjax.WindowManager._layers.length-1)){return true;
       
  2526 }for(var A=B.index+1;
       
  2527 A<SimileAjax.WindowManager._layers.length;
       
  2528 A++){if(!SimileAjax.WindowManager._layers[A].ephemeral){return false;
       
  2529 }}return true;
       
  2530 };
       
  2531 SimileAjax.WindowManager.cancelPopups=function(A){var F=(A)?SimileAjax.DOM.getEventPageCoordinates(A):{x:-1,y:-1};
       
  2532 var E=SimileAjax.WindowManager._layers.length-1;
       
  2533 while(E>0&&SimileAjax.WindowManager._layers[E].ephemeral){var D=SimileAjax.WindowManager._layers[E];
       
  2534 if(D.elmt!=null){var C=D.elmt;
       
  2535 var B=SimileAjax.DOM.getPageCoordinates(C);
       
  2536 if(F.x>=B.left&&F.x<(B.left+C.offsetWidth)&&F.y>=B.top&&F.y<(B.top+C.offsetHeight)){break;
       
  2537 }}E--;
       
  2538 }SimileAjax.WindowManager._popToLayer(E);
       
  2539 };
       
  2540 SimileAjax.WindowManager._onBodyMouseDown=function(B,A,C){if(!("eventPhase" in A)||A.eventPhase==A.BUBBLING_PHASE){SimileAjax.WindowManager.cancelPopups(A);
       
  2541 }};
       
  2542 SimileAjax.WindowManager._handleMouseDown=function(B,A,C){SimileAjax.WindowManager._draggedElement=B;
       
  2543 SimileAjax.WindowManager._draggedElementCallback=C;
       
  2544 SimileAjax.WindowManager._lastCoords={x:A.clientX,y:A.clientY};
       
  2545 SimileAjax.DOM.cancelEvent(A);
       
  2546 return false;
       
  2547 };
       
  2548 SimileAjax.WindowManager._onBodyKeyDown=function(C,A,D){if(SimileAjax.WindowManager._dragging){if(A.keyCode==27){SimileAjax.WindowManager._cancelDragging();
       
  2549 }else{if((A.keyCode==17||A.keyCode==16)&&SimileAjax.WindowManager._draggingMode!="copy"){SimileAjax.WindowManager._draggingMode="copy";
       
  2550 var B=SimileAjax.Graphics.createTranslucentImage(SimileAjax.urlPrefix+"data/timeline/copy.png");
       
  2551 B.style.position="absolute";
       
  2552 B.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";
       
  2553 B.style.top=(SimileAjax.WindowManager._ghostCoords.top)+"px";
       
  2554 document.body.appendChild(B);
       
  2555 SimileAjax.WindowManager._draggingModeIndicatorElmt=B;
       
  2556 }}}};
       
  2557 SimileAjax.WindowManager._onBodyKeyUp=function(B,A,C){if(SimileAjax.WindowManager._dragging){if(A.keyCode==17||A.keyCode==16){SimileAjax.WindowManager._draggingMode="";
       
  2558 if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);
       
  2559 SimileAjax.WindowManager._draggingModeIndicatorElmt=null;
       
  2560 }}}};
       
  2561 SimileAjax.WindowManager._onBodyMouseMove=function(A,N,H){if(SimileAjax.WindowManager._draggedElement!=null){var P=SimileAjax.WindowManager._draggedElementCallback;
       
  2562 var E=SimileAjax.WindowManager._lastCoords;
       
  2563 var M=N.clientX-E.x;
       
  2564 var J=N.clientY-E.y;
       
  2565 if(!SimileAjax.WindowManager._dragging){if(Math.abs(M)>5||Math.abs(J)>5){try{if("onDragStart" in P){P.onDragStart();
       
  2566 }if("ghost" in P&&P.ghost){var K=SimileAjax.WindowManager._draggedElement;
       
  2567 SimileAjax.WindowManager._ghostCoords=SimileAjax.DOM.getPageCoordinates(K);
       
  2568 SimileAjax.WindowManager._ghostCoords.left+=M;
       
  2569 SimileAjax.WindowManager._ghostCoords.top+=J;
       
  2570 var O=K.cloneNode(true);
       
  2571 O.style.position="absolute";
       
  2572 O.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";
       
  2573 O.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";
       
  2574 O.style.zIndex=1000;
       
  2575 SimileAjax.Graphics.setOpacity(O,50);
       
  2576 document.body.appendChild(O);
       
  2577 P._ghostElmt=O;
       
  2578 }SimileAjax.WindowManager._dragging=true;
       
  2579 SimileAjax.WindowManager._lastCoords={x:N.clientX,y:N.clientY};
       
  2580 document.body.focus();
       
  2581 }catch(G){SimileAjax.Debug.exception("WindowManager: Error handling mouse down",G);
       
  2582 SimileAjax.WindowManager._cancelDragging();
       
  2583 }}}else{try{SimileAjax.WindowManager._lastCoords={x:N.clientX,y:N.clientY};
       
  2584 if("onDragBy" in P){P.onDragBy(M,J);
       
  2585 }if("_ghostElmt" in P){var O=P._ghostElmt;
       
  2586 SimileAjax.WindowManager._ghostCoords.left+=M;
       
  2587 SimileAjax.WindowManager._ghostCoords.top+=J;
       
  2588 O.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";
       
  2589 O.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";
       
  2590 if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){var I=SimileAjax.WindowManager._draggingModeIndicatorElmt;
       
  2591 I.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";
       
  2592 I.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";
       
  2593 }if("droppable" in P&&P.droppable){var L=SimileAjax.DOM.getEventPageCoordinates(N);
       
  2594 var H=SimileAjax.DOM.hittest(L.x,L.y,[SimileAjax.WindowManager._ghostElmt,SimileAjax.WindowManager._dropTargetHighlightElement]);
       
  2595 H=SimileAjax.WindowManager._findDropTarget(H);
       
  2596 if(H!=SimileAjax.WindowManager._potentialDropTarget){if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);
       
  2597 SimileAjax.WindowManager._dropTargetHighlightElement=null;
       
  2598 SimileAjax.WindowManager._potentialDropTarget=null;
       
  2599 }var F=false;
       
  2600 if(H!=null){if((!("canDropOn" in P)||P.canDropOn(H))&&(!("canDrop" in H)||H.canDrop(SimileAjax.WindowManager._draggedElement))){F=true;
       
  2601 }}if(F){var C=4;
       
  2602 var D=SimileAjax.DOM.getPageCoordinates(H);
       
  2603 var B=document.createElement("div");
       
  2604 B.style.border=C+"px solid yellow";
       
  2605 B.style.backgroundColor="yellow";
       
  2606 B.style.position="absolute";
       
  2607 B.style.left=D.left+"px";
       
  2608 B.style.top=D.top+"px";
       
  2609 B.style.width=(H.offsetWidth-C*2)+"px";
       
  2610 B.style.height=(H.offsetHeight-C*2)+"px";
       
  2611 SimileAjax.Graphics.setOpacity(B,30);
       
  2612 document.body.appendChild(B);
       
  2613 SimileAjax.WindowManager._potentialDropTarget=H;
       
  2614 SimileAjax.WindowManager._dropTargetHighlightElement=B;
       
  2615 }}}}}catch(G){SimileAjax.Debug.exception("WindowManager: Error handling mouse move",G);
       
  2616 SimileAjax.WindowManager._cancelDragging();
       
  2617 }}SimileAjax.DOM.cancelEvent(N);
       
  2618 return false;
       
  2619 }};
       
  2620 SimileAjax.WindowManager._onBodyMouseUp=function(B,A,C){if(SimileAjax.WindowManager._draggedElement!=null){try{if(SimileAjax.WindowManager._dragging){var E=SimileAjax.WindowManager._draggedElementCallback;
       
  2621 if("onDragEnd" in E){E.onDragEnd();
       
  2622 }if("droppable" in E&&E.droppable){var D=false;
       
  2623 var C=SimileAjax.WindowManager._potentialDropTarget;
       
  2624 if(C!=null){if((!("canDropOn" in E)||E.canDropOn(C))&&(!("canDrop" in C)||C.canDrop(SimileAjax.WindowManager._draggedElement))){if("onDropOn" in E){E.onDropOn(C);
       
  2625 }C.ondrop(SimileAjax.WindowManager._draggedElement,SimileAjax.WindowManager._draggingMode);
       
  2626 D=true;
       
  2627 }}if(!D){}}}}finally{SimileAjax.WindowManager._cancelDragging();
       
  2628 }SimileAjax.DOM.cancelEvent(A);
       
  2629 return false;
       
  2630 }};
       
  2631 SimileAjax.WindowManager._cancelDragging=function(){var B=SimileAjax.WindowManager._draggedElementCallback;
       
  2632 if("_ghostElmt" in B){var A=B._ghostElmt;
       
  2633 document.body.removeChild(A);
       
  2634 delete B._ghostElmt;
       
  2635 }if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);
       
  2636 SimileAjax.WindowManager._dropTargetHighlightElement=null;
       
  2637 }if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);
       
  2638 SimileAjax.WindowManager._draggingModeIndicatorElmt=null;
       
  2639 }SimileAjax.WindowManager._draggedElement=null;
       
  2640 SimileAjax.WindowManager._draggedElementCallback=null;
       
  2641 SimileAjax.WindowManager._potentialDropTarget=null;
       
  2642 SimileAjax.WindowManager._dropTargetHighlightElement=null;
       
  2643 SimileAjax.WindowManager._lastCoords=null;
       
  2644 SimileAjax.WindowManager._ghostCoords=null;
       
  2645 SimileAjax.WindowManager._draggingMode="";
       
  2646 SimileAjax.WindowManager._dragging=false;
       
  2647 };
       
  2648 SimileAjax.WindowManager._findDropTarget=function(A){while(A!=null){if("ondrop" in A&&(typeof A.ondrop)=="function"){break;
       
  2649 }A=A.parentNode;
       
  2650 }return A;
       
  2651 };
       
  2652 
       
  2653 
       
  2654 /* xmlhttp.js */
       
  2655 SimileAjax.XmlHttp=new Object();
       
  2656 SimileAjax.XmlHttp._onReadyStateChange=function(A,D,B){switch(A.readyState){case 4:try{if(A.status==0||A.status==200){if(B){B(A);
       
  2657 }}else{if(D){D(A.statusText,A.status,A);
       
  2658 }}}catch(C){SimileAjax.Debug.exception("XmlHttp: Error handling onReadyStateChange",C);
       
  2659 }break;
       
  2660 }};
       
  2661 SimileAjax.XmlHttp._createRequest=function(){if(SimileAjax.Platform.browser.isIE){var A=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];
       
  2662 for(var B=0;
       
  2663 B<A.length;
       
  2664 B++){try{var C=A[B];
       
  2665 var D=function(){return new ActiveXObject(C);
       
  2666 };
       
  2667 var F=D();
       
  2668 SimileAjax.XmlHttp._createRequest=D;
       
  2669 return F;
       
  2670 }catch(E){}}}try{var D=function(){return new XMLHttpRequest();
       
  2671 };
       
  2672 var F=D();
       
  2673 SimileAjax.XmlHttp._createRequest=D;
       
  2674 return F;
       
  2675 }catch(E){throw new Error("Failed to create an XMLHttpRequest object");
       
  2676 }};
       
  2677 SimileAjax.XmlHttp.get=function(A,D,C){var B=SimileAjax.XmlHttp._createRequest();
       
  2678 B.open("GET",A,true);
       
  2679 B.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(B,D,C);
       
  2680 };
       
  2681 B.send(null);
       
  2682 };
       
  2683 SimileAjax.XmlHttp.post=function(B,A,E,D){var C=SimileAjax.XmlHttp._createRequest();
       
  2684 C.open("POST",B,true);
       
  2685 C.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(C,E,D);
       
  2686 };
       
  2687 C.send(A);
       
  2688 };
       
  2689 SimileAjax.XmlHttp._forceXML=function(A){try{A.overrideMimeType("text/xml");
       
  2690 }catch(B){A.setrequestheader("Content-Type","text/xml");
       
  2691 }};
       
  2692 
       
  2693 
       
  2694 window.Timeline = new Object();
       
  2695 Timeline.urlPrefix = baseuri();
       
  2696 window.Timeline.DateTime = window.SimileAjax.DateTime; // for backward compatibility
       
  2697 
       
  2698 /* decorators.js */
       
  2699 Timeline.SpanHighlightDecorator=function(A){this._unit=("unit" in A)?A.unit:SimileAjax.NativeDateUnit;
       
  2700 this._startDate=(typeof A.startDate=="string")?this._unit.parseFromObject(A.startDate):A.startDate;
       
  2701 this._endDate=(typeof A.endDate=="string")?this._unit.parseFromObject(A.endDate):A.endDate;
       
  2702 this._startLabel=A.startLabel;
       
  2703 this._endLabel=A.endLabel;
       
  2704 this._color=A.color;
       
  2705 this._cssClass=("cssClass" in A)?A.cssClass:null;
       
  2706 this._opacity=("opacity" in A)?A.opacity:100;
       
  2707 };
       
  2708 Timeline.SpanHighlightDecorator.prototype.initialize=function(B,A){this._band=B;
       
  2709 this._timeline=A;
       
  2710 this._layerDiv=null;
       
  2711 };
       
  2712 Timeline.SpanHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);
       
  2713 }this._layerDiv=this._band.createLayerDiv(10);
       
  2714 this._layerDiv.setAttribute("name","span-highlight-decorator");
       
  2715 this._layerDiv.style.display="none";
       
  2716 var F=this._band.getMinDate();
       
  2717 var C=this._band.getMaxDate();
       
  2718 if(this._unit.compare(this._startDate,C)<0&&this._unit.compare(this._endDate,F)>0){F=this._unit.later(F,this._startDate);
       
  2719 C=this._unit.earlier(C,this._endDate);
       
  2720 var D=this._band.dateToPixelOffset(F);
       
  2721 var K=this._band.dateToPixelOffset(C);
       
  2722 var I=this._timeline.getDocument();
       
  2723 var H=function(){var L=I.createElement("table");
       
  2724 L.insertRow(0).insertCell(0);
       
  2725 return L;
       
  2726 };
       
  2727 var B=I.createElement("div");
       
  2728 B.className="timeline-highlight-decorator";
       
  2729 if(this._cssClass){B.className+=" "+this._cssClass;
       
  2730 }if(this._opacity<100){SimileAjax.Graphics.setOpacity(B,this._opacity);
       
  2731 }this._layerDiv.appendChild(B);
       
  2732 var J=H();
       
  2733 J.className="timeline-highlight-label timeline-highlight-label-start";
       
  2734 var G=J.rows[0].cells[0];
       
  2735 G.innerHTML=this._startLabel;
       
  2736 if(this._cssClass){G.className="label_"+this._cssClass;
       
  2737 }this._layerDiv.appendChild(J);
       
  2738 var A=H();
       
  2739 A.className="timeline-highlight-label timeline-highlight-label-end";
       
  2740 var E=A.rows[0].cells[0];
       
  2741 E.innerHTML=this._endLabel;
       
  2742 if(this._cssClass){E.className="label_"+this._cssClass;
       
  2743 }this._layerDiv.appendChild(A);
       
  2744 if(this._timeline.isHorizontal()){B.style.left=D+"px";
       
  2745 B.style.width=(K-D)+"px";
       
  2746 J.style.right=(this._band.getTotalViewLength()-D)+"px";
       
  2747 J.style.width=(this._startLabel.length)+"em";
       
  2748 A.style.left=K+"px";
       
  2749 A.style.width=(this._endLabel.length)+"em";
       
  2750 }else{B.style.top=D+"px";
       
  2751 B.style.height=(K-D)+"px";
       
  2752 J.style.bottom=D+"px";
       
  2753 J.style.height="1.5px";
       
  2754 A.style.top=K+"px";
       
  2755 A.style.height="1.5px";
       
  2756 }}this._layerDiv.style.display="block";
       
  2757 };
       
  2758 Timeline.SpanHighlightDecorator.prototype.softPaint=function(){};
       
  2759 Timeline.PointHighlightDecorator=function(A){this._unit=("unit" in A)?A.unit:SimileAjax.NativeDateUnit;
       
  2760 this._date=(typeof A.date=="string")?this._unit.parseFromObject(A.date):A.date;
       
  2761 this._width=("width" in A)?A.width:10;
       
  2762 this._color=A.color;
       
  2763 this._cssClass=("cssClass" in A)?A.cssClass:"";
       
  2764 this._opacity=("opacity" in A)?A.opacity:100;
       
  2765 };
       
  2766 Timeline.PointHighlightDecorator.prototype.initialize=function(B,A){this._band=B;
       
  2767 this._timeline=A;
       
  2768 this._layerDiv=null;
       
  2769 };
       
  2770 Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);
       
  2771 }this._layerDiv=this._band.createLayerDiv(10);
       
  2772 this._layerDiv.setAttribute("name","span-highlight-decorator");
       
  2773 this._layerDiv.style.display="none";
       
  2774 var C=this._band.getMinDate();
       
  2775 var E=this._band.getMaxDate();
       
  2776 if(this._unit.compare(this._date,E)<0&&this._unit.compare(this._date,C)>0){var B=this._band.dateToPixelOffset(this._date);
       
  2777 var A=B-Math.round(this._width/2);
       
  2778 var D=this._timeline.getDocument();
       
  2779 var F=D.createElement("div");
       
  2780 F.className="timeline-highlight-point-decorator";
       
  2781 F.className+=" "+this._cssClass;
       
  2782 if(this._opacity<100){SimileAjax.Graphics.setOpacity(F,this._opacity);
       
  2783 }this._layerDiv.appendChild(F);
       
  2784 if(this._timeline.isHorizontal()){F.style.left=A+"px";
       
  2785 }else{F.style.top=A+"px";
       
  2786 }}this._layerDiv.style.display="block";
       
  2787 };
       
  2788 Timeline.PointHighlightDecorator.prototype.softPaint=function(){};
       
  2789 
       
  2790 
       
  2791 /* detailed-painter.js */
       
  2792 Timeline.DetailedEventPainter=function(A){this._params=A;
       
  2793 this._onSelectListeners=[];
       
  2794 this._filterMatcher=null;
       
  2795 this._highlightMatcher=null;
       
  2796 this._frc=null;
       
  2797 this._eventIdToElmt={};
       
  2798 };
       
  2799 Timeline.DetailedEventPainter.prototype.initialize=function(B,A){this._band=B;
       
  2800 this._timeline=A;
       
  2801 this._backLayer=null;
       
  2802 this._eventLayer=null;
       
  2803 this._lineLayer=null;
       
  2804 this._highlightLayer=null;
       
  2805 this._eventIdToElmt=null;
       
  2806 };
       
  2807 Timeline.DetailedEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
       
  2808 };
       
  2809 Timeline.DetailedEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
       
  2810 A<this._onSelectListeners.length;
       
  2811 A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
       
  2812 break;
       
  2813 }}};
       
  2814 Timeline.DetailedEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
       
  2815 };
       
  2816 Timeline.DetailedEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
       
  2817 };
       
  2818 Timeline.DetailedEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
       
  2819 };
       
  2820 Timeline.DetailedEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
       
  2821 };
       
  2822 Timeline.DetailedEventPainter.prototype.paint=function(){var B=this._band.getEventSource();
       
  2823 if(B==null){return ;
       
  2824 }this._eventIdToElmt={};
       
  2825 this._prepareForPainting();
       
  2826 var I=this._params.theme.event;
       
  2827 var G=Math.max(I.track.height,this._frc.getLineHeight());
       
  2828 var F={trackOffset:Math.round(this._band.getViewWidth()/2-G/2),trackHeight:G,trackGap:I.track.gap,trackIncrement:G+I.track.gap,icon:I.instant.icon,iconWidth:I.instant.iconWidth,iconHeight:I.instant.iconHeight,labelWidth:I.label.width};
       
  2829 var C=this._band.getMinDate();
       
  2830 var A=this._band.getMaxDate();
       
  2831 var J=(this._filterMatcher!=null)?this._filterMatcher:function(K){return true;
       
  2832 };
       
  2833 var E=(this._highlightMatcher!=null)?this._highlightMatcher:function(K){return -1;
       
  2834 };
       
  2835 var D=B.getEventReverseIterator(C,A);
       
  2836 while(D.hasNext()){var H=D.next();
       
  2837 if(J(H)){this.paintEvent(H,F,this._params.theme,E(H));
       
  2838 }}this._highlightLayer.style.display="block";
       
  2839 this._lineLayer.style.display="block";
       
  2840 this._eventLayer.style.display="block";
       
  2841 };
       
  2842 Timeline.DetailedEventPainter.prototype.softPaint=function(){};
       
  2843 Timeline.DetailedEventPainter.prototype._prepareForPainting=function(){var B=this._band;
       
  2844 if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");
       
  2845 this._backLayer.style.visibility="hidden";
       
  2846 var A=document.createElement("span");
       
  2847 A.className="timeline-event-label";
       
  2848 this._backLayer.appendChild(A);
       
  2849 this._frc=SimileAjax.Graphics.getFontRenderingContext(A);
       
  2850 }this._frc.update();
       
  2851 this._lowerTracks=[];
       
  2852 this._upperTracks=[];
       
  2853 if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer);
       
  2854 }this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");
       
  2855 this._highlightLayer.style.display="none";
       
  2856 if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer);
       
  2857 }this._lineLayer=B.createLayerDiv(110,"timeline-band-lines");
       
  2858 this._lineLayer.style.display="none";
       
  2859 if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer);
       
  2860 }this._eventLayer=B.createLayerDiv(110,"timeline-band-events");
       
  2861 this._eventLayer.style.display="none";
       
  2862 };
       
  2863 Timeline.DetailedEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
       
  2864 }else{this.paintDurationEvent(B,C,D,A);
       
  2865 }};
       
  2866 Timeline.DetailedEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A);
       
  2867 }else{this.paintPreciseInstantEvent(B,C,D,A);
       
  2868 }};
       
  2869 Timeline.DetailedEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A);
       
  2870 }else{this.paintPreciseDurationEvent(B,C,D,A);
       
  2871 }};
       
  2872 Timeline.DetailedEventPainter.prototype.paintPreciseInstantEvent=function(K,N,Q,O){var S=this._timeline.getDocument();
       
  2873 var J=K.getText();
       
  2874 var E=K.getStart();
       
  2875 var C=Math.round(this._band.dateToPixelOffset(E));
       
  2876 var A=Math.round(C+N.iconWidth/2);
       
  2877 var I=Math.round(C-N.iconWidth/2);
       
  2878 var G=this._frc.computeSize(J);
       
  2879 var D=this._findFreeTrackForSolid(A,C);
       
  2880 var B=this._paintEventIcon(K,D,I,N,Q);
       
  2881 var T=A+Q.event.label.offsetFromLine;
       
  2882 var P=D;
       
  2883 var F=this._getTrackData(D);
       
  2884 if(Math.min(F.solid,F.text)>=T+G.width){F.solid=I;
       
  2885 F.text=T;
       
  2886 }else{F.solid=I;
       
  2887 T=C+Q.event.label.offsetFromLine;
       
  2888 P=this._findFreeTrackForText(D,T+G.width,function(U){U.line=C-2;
       
  2889 });
       
  2890 this._getTrackData(P).text=I;
       
  2891 this._paintEventLine(K,C,D,P,N,Q);
       
  2892 }var R=Math.round(N.trackOffset+P*N.trackIncrement+N.trackHeight/2-G.height/2);
       
  2893 var M=this._paintEventLabel(K,J,T,R,G.width,G.height,Q);
       
  2894 var L=this;
       
  2895 var H=function(U,V,W){return L._onClickInstantEvent(B.elmt,V,K);
       
  2896 };
       
  2897 SimileAjax.DOM.registerEvent(B.elmt,"mousedown",H);
       
  2898 SimileAjax.DOM.registerEvent(M.elmt,"mousedown",H);
       
  2899 this._createHighlightDiv(O,B,Q);
       
  2900 this._eventIdToElmt[K.getID()]=B.elmt;
       
  2901 };
       
  2902 Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent=function(N,Q,V,R){var X=this._timeline.getDocument();
       
  2903 var M=N.getText();
       
  2904 var H=N.getStart();
       
  2905 var S=N.getEnd();
       
  2906 var E=Math.round(this._band.dateToPixelOffset(H));
       
  2907 var B=Math.round(this._band.dateToPixelOffset(S));
       
  2908 var A=Math.round(E+Q.iconWidth/2);
       
  2909 var L=Math.round(E-Q.iconWidth/2);
       
  2910 var J=this._frc.computeSize(M);
       
  2911 var F=this._findFreeTrackForSolid(B,E);
       
  2912 var G=this._paintEventTape(N,F,E,B,V.event.instant.impreciseColor,V.event.instant.impreciseOpacity,Q,V);
       
  2913 var C=this._paintEventIcon(N,F,L,Q,V);
       
  2914 var I=this._getTrackData(F);
       
  2915 I.solid=L;
       
  2916 var W=A+V.event.label.offsetFromLine;
       
  2917 var D=W+J.width;
       
  2918 var T;
       
  2919 if(D<B){T=F;
       
  2920 }else{W=E+V.event.label.offsetFromLine;
       
  2921 D=W+J.width;
       
  2922 T=this._findFreeTrackForText(F,D,function(Y){Y.line=E-2;
       
  2923 });
       
  2924 this._getTrackData(T).text=L;
       
  2925 this._paintEventLine(N,E,F,T,Q,V);
       
  2926 }var U=Math.round(Q.trackOffset+T*Q.trackIncrement+Q.trackHeight/2-J.height/2);
       
  2927 var P=this._paintEventLabel(N,M,W,U,J.width,J.height,V);
       
  2928 var O=this;
       
  2929 var K=function(Y,Z,a){return O._onClickInstantEvent(C.elmt,Z,N);
       
  2930 };
       
  2931 SimileAjax.DOM.registerEvent(C.elmt,"mousedown",K);
       
  2932 SimileAjax.DOM.registerEvent(G.elmt,"mousedown",K);
       
  2933 SimileAjax.DOM.registerEvent(P.elmt,"mousedown",K);
       
  2934 this._createHighlightDiv(R,C,V);
       
  2935 this._eventIdToElmt[N.getID()]=C.elmt;
       
  2936 };
       
  2937 Timeline.DetailedEventPainter.prototype.paintPreciseDurationEvent=function(J,M,S,O){var T=this._timeline.getDocument();
       
  2938 var I=J.getText();
       
  2939 var D=J.getStart();
       
  2940 var P=J.getEnd();
       
  2941 var B=Math.round(this._band.dateToPixelOffset(D));
       
  2942 var A=Math.round(this._band.dateToPixelOffset(P));
       
  2943 var F=this._frc.computeSize(I);
       
  2944 var E=this._findFreeTrackForSolid(A);
       
  2945 var N=J.getColor();
       
  2946 N=N!=null?N:S.event.duration.color;
       
  2947 var C=this._paintEventTape(J,E,B,A,N,100,M,S);
       
  2948 var H=this._getTrackData(E);
       
  2949 H.solid=B;
       
  2950 var U=B+S.event.label.offsetFromLine;
       
  2951 var Q=this._findFreeTrackForText(E,U+F.width,function(V){V.line=B-2;
       
  2952 });
       
  2953 this._getTrackData(Q).text=B-2;
       
  2954 this._paintEventLine(J,B,E,Q,M,S);
       
  2955 var R=Math.round(M.trackOffset+Q*M.trackIncrement+M.trackHeight/2-F.height/2);
       
  2956 var L=this._paintEventLabel(J,I,U,R,F.width,F.height,S);
       
  2957 var K=this;
       
  2958 var G=function(V,W,X){return K._onClickDurationEvent(C.elmt,W,J);
       
  2959 };
       
  2960 SimileAjax.DOM.registerEvent(C.elmt,"mousedown",G);
       
  2961 SimileAjax.DOM.registerEvent(L.elmt,"mousedown",G);
       
  2962 this._createHighlightDiv(O,C,S);
       
  2963 this._eventIdToElmt[J.getID()]=C.elmt;
       
  2964 };
       
  2965 Timeline.DetailedEventPainter.prototype.paintImpreciseDurationEvent=function(L,P,W,S){var Z=this._timeline.getDocument();
       
  2966 var K=L.getText();
       
  2967 var D=L.getStart();
       
  2968 var Q=L.getLatestStart();
       
  2969 var T=L.getEnd();
       
  2970 var X=L.getEarliestEnd();
       
  2971 var B=Math.round(this._band.dateToPixelOffset(D));
       
  2972 var F=Math.round(this._band.dateToPixelOffset(Q));
       
  2973 var A=Math.round(this._band.dateToPixelOffset(T));
       
  2974 var G=Math.round(this._band.dateToPixelOffset(X));
       
  2975 var H=this._frc.computeSize(K);
       
  2976 var E=this._findFreeTrackForSolid(A);
       
  2977 var R=L.getColor();
       
  2978 R=R!=null?R:W.event.duration.color;
       
  2979 var O=this._paintEventTape(L,E,B,A,W.event.duration.impreciseColor,W.event.duration.impreciseOpacity,P,W);
       
  2980 var C=this._paintEventTape(L,E,F,G,R,100,P,W);
       
  2981 var J=this._getTrackData(E);
       
  2982 J.solid=B;
       
  2983 var Y=F+W.event.label.offsetFromLine;
       
  2984 var U=this._findFreeTrackForText(E,Y+H.width,function(a){a.line=F-2;
       
  2985 });
       
  2986 this._getTrackData(U).text=F-2;
       
  2987 this._paintEventLine(L,F,E,U,P,W);
       
  2988 var V=Math.round(P.trackOffset+U*P.trackIncrement+P.trackHeight/2-H.height/2);
       
  2989 var N=this._paintEventLabel(L,K,Y,V,H.width,H.height,W);
       
  2990 var M=this;
       
  2991 var I=function(a,b,c){return M._onClickDurationEvent(C.elmt,b,L);
       
  2992 };
       
  2993 SimileAjax.DOM.registerEvent(C.elmt,"mousedown",I);
       
  2994 SimileAjax.DOM.registerEvent(N.elmt,"mousedown",I);
       
  2995 this._createHighlightDiv(S,C,W);
       
  2996 this._eventIdToElmt[L.getID()]=C.elmt;
       
  2997 };
       
  2998 Timeline.DetailedEventPainter.prototype._findFreeTrackForSolid=function(B,A){for(var D=0;
       
  2999 true;
       
  3000 D++){if(D<this._lowerTracks.length){var C=this._lowerTracks[D];
       
  3001 if(Math.min(C.solid,C.text)>B&&(!(A)||C.line>A)){return D;
       
  3002 }}else{this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
       
  3003 return D;
       
  3004 }if(D<this._upperTracks.length){var C=this._upperTracks[D];
       
  3005 if(Math.min(C.solid,C.text)>B&&(!(A)||C.line>A)){return -1-D;
       
  3006 }}else{this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
       
  3007 return -1-D;
       
  3008 }}};
       
  3009 Timeline.DetailedEventPainter.prototype._findFreeTrackForText=function(D,C,H){var F;
       
  3010 var G;
       
  3011 var B;
       
  3012 var J;
       
  3013 if(D<0){F=true;
       
  3014 B=-D;
       
  3015 G=this._findFreeUpperTrackForText(B,C);
       
  3016 J=-1-G;
       
  3017 }else{if(D>0){F=false;
       
  3018 B=D+1;
       
  3019 G=this._findFreeLowerTrackForText(B,C);
       
  3020 J=G;
       
  3021 }else{var A=this._findFreeUpperTrackForText(0,C);
       
  3022 var I=this._findFreeLowerTrackForText(1,C);
       
  3023 if(I-1<=A){F=false;
       
  3024 B=1;
       
  3025 G=I;
       
  3026 J=G;
       
  3027 }else{F=true;
       
  3028 B=0;
       
  3029 G=A;
       
  3030 J=-1-G;
       
  3031 }}}if(F){if(G==this._upperTracks.length){this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
       
  3032 }for(var E=B;
       
  3033 E<G;
       
  3034 E++){H(this._upperTracks[E]);
       
  3035 }}else{if(G==this._lowerTracks.length){this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
       
  3036 }for(var E=B;
       
  3037 E<G;
       
  3038 E++){H(this._lowerTracks[E]);
       
  3039 }}return J;
       
  3040 };
       
  3041 Timeline.DetailedEventPainter.prototype._findFreeLowerTrackForText=function(A,C){for(;
       
  3042 A<this._lowerTracks.length;
       
  3043 A++){var B=this._lowerTracks[A];
       
  3044 if(Math.min(B.solid,B.text)>=C){break;
       
  3045 }}return A;
       
  3046 };
       
  3047 Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText=function(A,C){for(;
       
  3048 A<this._upperTracks.length;
       
  3049 A++){var B=this._upperTracks[A];
       
  3050 if(Math.min(B.solid,B.text)>=C){break;
       
  3051 }}return A;
       
  3052 };
       
  3053 Timeline.DetailedEventPainter.prototype._getTrackData=function(A){return(A<0)?this._upperTracks[-A-1]:this._lowerTracks[A];
       
  3054 };
       
  3055 Timeline.DetailedEventPainter.prototype._paintEventLine=function(I,C,F,A,G,D){var H=Math.round(G.trackOffset+F*G.trackIncrement+G.trackHeight/2);
       
  3056 var J=Math.round(Math.abs(A-F)*G.trackIncrement);
       
  3057 var E="1px solid "+D.event.label.lineColor;
       
  3058 var B=this._timeline.getDocument().createElement("div");
       
  3059 B.style.position="absolute";
       
  3060 B.style.left=C+"px";
       
  3061 B.style.width=D.event.label.offsetFromLine+"px";
       
  3062 B.style.height=J+"px";
       
  3063 if(F>A){B.style.top=(H-J)+"px";
       
  3064 B.style.borderTop=E;
       
  3065 }else{B.style.top=H+"px";
       
  3066 B.style.borderBottom=E;
       
  3067 }B.style.borderLeft=E;
       
  3068 this._lineLayer.appendChild(B);
       
  3069 };
       
  3070 Timeline.DetailedEventPainter.prototype._paintEventIcon=function(I,E,B,F,D){var H=I.getIcon();
       
  3071 H=H!=null?H:F.icon;
       
  3072 var J=F.trackOffset+E*F.trackIncrement+F.trackHeight/2;
       
  3073 var G=Math.round(J-F.iconHeight/2);
       
  3074 var C=SimileAjax.Graphics.createTranslucentImage(H);
       
  3075 var A=this._timeline.getDocument().createElement("div");
       
  3076 A.style.position="absolute";
       
  3077 A.style.left=B+"px";
       
  3078 A.style.top=G+"px";
       
  3079 A.appendChild(C);
       
  3080 A.style.cursor="pointer";
       
  3081 if(I._title!=null){A.title=I._title;
       
  3082 }this._eventLayer.appendChild(A);
       
  3083 return{left:B,top:G,width:F.iconWidth,height:F.iconHeight,elmt:A};
       
  3084 };
       
  3085 Timeline.DetailedEventPainter.prototype._paintEventLabel=function(H,I,B,F,A,J,D){var G=this._timeline.getDocument();
       
  3086 var K=G.createElement("div");
       
  3087 K.style.position="absolute";
       
  3088 K.style.left=B+"px";
       
  3089 K.style.width=A+"px";
       
  3090 K.style.top=F+"px";
       
  3091 K.style.height=J+"px";
       
  3092 K.style.backgroundColor=D.event.label.backgroundColor;
       
  3093 SimileAjax.Graphics.setOpacity(K,D.event.label.backgroundOpacity);
       
  3094 this._eventLayer.appendChild(K);
       
  3095 var E=G.createElement("div");
       
  3096 E.style.position="absolute";
       
  3097 E.style.left=B+"px";
       
  3098 E.style.width=A+"px";
       
  3099 E.style.top=F+"px";
       
  3100 E.innerHTML=I;
       
  3101 E.style.cursor="pointer";
       
  3102 if(H._title!=null){E.title=H._title;
       
  3103 }var C=H.getTextColor();
       
  3104 if(C==null){C=H.getColor();
       
  3105 }if(C!=null){E.style.color=C;
       
  3106 }this._eventLayer.appendChild(E);
       
  3107 return{left:B,top:F,width:A,height:J,elmt:E};
       
  3108 };
       
  3109 Timeline.DetailedEventPainter.prototype._paintEventTape=function(L,H,E,A,C,G,I,F){var B=A-E;
       
  3110 var D=F.event.tape.height;
       
  3111 var M=I.trackOffset+H*I.trackIncrement+I.trackHeight/2;
       
  3112 var J=Math.round(M-D/2);
       
  3113 var K=this._timeline.getDocument().createElement("div");
       
  3114 K.style.position="absolute";
       
  3115 K.style.left=E+"px";
       
  3116 K.style.width=B+"px";
       
  3117 K.style.top=J+"px";
       
  3118 K.style.height=D+"px";
       
  3119 K.style.backgroundColor=C;
       
  3120 K.style.overflow="hidden";
       
  3121 K.style.cursor="pointer";
       
  3122 if(L._title!=null){K.title=L._title;
       
  3123 }SimileAjax.Graphics.setOpacity(K,G);
       
  3124 this._eventLayer.appendChild(K);
       
  3125 return{left:E,top:J,width:B,height:D,elmt:K};
       
  3126 };
       
  3127 Timeline.DetailedEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument();
       
  3128 var G=E.event;
       
  3129 var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)];
       
  3130 var F=D.createElement("div");
       
  3131 F.style.position="absolute";
       
  3132 F.style.overflow="hidden";
       
  3133 F.style.left=(C.left-2)+"px";
       
  3134 F.style.width=(C.width+4)+"px";
       
  3135 F.style.top=(C.top-2)+"px";
       
  3136 F.style.height=(C.height+4)+"px";
       
  3137 F.style.background=B;
       
  3138 this._highlightLayer.appendChild(F);
       
  3139 }};
       
  3140 Timeline.DetailedEventPainter.prototype._onClickInstantEvent=function(B,C,A){var D=SimileAjax.DOM.getPageCoordinates(B);
       
  3141 this._showBubble(D.left+Math.ceil(B.offsetWidth/2),D.top+Math.ceil(B.offsetHeight/2),A);
       
  3142 this._fireOnSelect(A.getID());
       
  3143 C.cancelBubble=true;
       
  3144 SimileAjax.DOM.cancelEvent(C);
       
  3145 return false;
       
  3146 };
       
  3147 Timeline.DetailedEventPainter.prototype._onClickDurationEvent=function(D,C,B){if("pageX" in C){var A=C.pageX;
       
  3148 var F=C.pageY;
       
  3149 }else{var E=SimileAjax.DOM.getPageCoordinates(D);
       
  3150 var A=C.offsetX+E.left;
       
  3151 var F=C.offsetY+E.top;
       
  3152 }this._showBubble(A,F,B);
       
  3153 this._fireOnSelect(B.getID());
       
  3154 C.cancelBubble=true;
       
  3155 SimileAjax.DOM.cancelEvent(C);
       
  3156 return false;
       
  3157 };
       
  3158 Timeline.DetailedEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()];
       
  3159 if(B){var C=SimileAjax.DOM.getPageCoordinates(B);
       
  3160 this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A);
       
  3161 }};
       
  3162 Timeline.DetailedEventPainter.prototype._showBubble=function(A,D,B){var C=document.createElement("div");
       
  3163 B.fillInfoBubble(C,this._params.theme,this._band.getLabeller());
       
  3164 SimileAjax.WindowManager.cancelPopups();
       
  3165 SimileAjax.Graphics.createBubbleForContentAndPoint(C,A,D,this._params.theme.event.bubble.width);
       
  3166 };
       
  3167 Timeline.DetailedEventPainter.prototype._fireOnSelect=function(B){for(var A=0;
       
  3168 A<this._onSelectListeners.length;
       
  3169 A++){this._onSelectListeners[A](B);
       
  3170 }};
       
  3171 
       
  3172 
       
  3173 /* ether-painters.js */
       
  3174 Timeline.GregorianEtherPainter=function(A){this._params=A;
       
  3175 this._theme=A.theme;
       
  3176 this._unit=A.unit;
       
  3177 this._multiple=("multiple" in A)?A.multiple:1;
       
  3178 };
       
  3179 Timeline.GregorianEtherPainter.prototype.initialize=function(C,B){this._band=C;
       
  3180 this._timeline=B;
       
  3181 this._backgroundLayer=C.createLayerDiv(0);
       
  3182 this._backgroundLayer.setAttribute("name","ether-background");
       
  3183 this._backgroundLayer.className="timeline-ether-bg";
       
  3184 this._markerLayer=null;
       
  3185 this._lineLayer=null;
       
  3186 var D=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
       
  3187 var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
       
  3188 this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
       
  3189 this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
       
  3190 };
       
  3191 Timeline.GregorianEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
       
  3192 };
       
  3193 Timeline.GregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
       
  3194 }this._markerLayer=this._band.createLayerDiv(100);
       
  3195 this._markerLayer.setAttribute("name","ether-markers");
       
  3196 this._markerLayer.style.display="none";
       
  3197 if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
       
  3198 }this._lineLayer=this._band.createLayerDiv(1);
       
  3199 this._lineLayer.setAttribute("name","ether-lines");
       
  3200 this._lineLayer.style.display="none";
       
  3201 var C=this._band.getMinDate();
       
  3202 var F=this._band.getMaxDate();
       
  3203 var B=this._band.getTimeZone();
       
  3204 var E=this._band.getLabeller();
       
  3205 SimileAjax.DateTime.roundDownToInterval(C,this._unit,B,this._multiple,this._theme.firstDayOfWeek);
       
  3206 var D=this;
       
  3207 var A=function(G){for(var H=0;
       
  3208 H<D._multiple;
       
  3209 H++){SimileAjax.DateTime.incrementByInterval(G,D._unit);
       
  3210 }};
       
  3211 while(C.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(C,E,this._unit,this._markerLayer,this._lineLayer);
       
  3212 A(C);
       
  3213 }this._markerLayer.style.display="block";
       
  3214 this._lineLayer.style.display="block";
       
  3215 };
       
  3216 Timeline.GregorianEtherPainter.prototype.softPaint=function(){};
       
  3217 Timeline.GregorianEtherPainter.prototype.zoom=function(A){if(A!=0){this._unit+=A;
       
  3218 }};
       
  3219 Timeline.HotZoneGregorianEtherPainter=function(G){this._params=G;
       
  3220 this._theme=G.theme;
       
  3221 this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,unit:G.unit,multiple:1}];
       
  3222 for(var E=0;
       
  3223 E<G.zones.length;
       
  3224 E++){var B=G.zones[E];
       
  3225 var D=SimileAjax.DateTime.parseGregorianDateTime(B.start).getTime();
       
  3226 var F=SimileAjax.DateTime.parseGregorianDateTime(B.end).getTime();
       
  3227 for(var C=0;
       
  3228 C<this._zones.length&&F>D;
       
  3229 C++){var A=this._zones[C];
       
  3230 if(D<A.endTime){if(D>A.startTime){this._zones.splice(C,0,{startTime:A.startTime,endTime:D,unit:A.unit,multiple:A.multiple});
       
  3231 C++;
       
  3232 A.startTime=D;
       
  3233 }if(F<A.endTime){this._zones.splice(C,0,{startTime:D,endTime:F,unit:B.unit,multiple:(B.multiple)?B.multiple:1});
       
  3234 C++;
       
  3235 A.startTime=F;
       
  3236 D=F;
       
  3237 }else{A.multiple=B.multiple;
       
  3238 A.unit=B.unit;
       
  3239 D=A.endTime;
       
  3240 }}}}};
       
  3241 Timeline.HotZoneGregorianEtherPainter.prototype.initialize=function(C,B){this._band=C;
       
  3242 this._timeline=B;
       
  3243 this._backgroundLayer=C.createLayerDiv(0);
       
  3244 this._backgroundLayer.setAttribute("name","ether-background");
       
  3245 this._backgroundLayer.className="timeline-ether-bg";
       
  3246 this._markerLayer=null;
       
  3247 this._lineLayer=null;
       
  3248 var D=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
       
  3249 var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
       
  3250 this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
       
  3251 this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
       
  3252 };
       
  3253 Timeline.HotZoneGregorianEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
       
  3254 };
       
  3255 Timeline.HotZoneGregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
       
  3256 }this._markerLayer=this._band.createLayerDiv(100);
       
  3257 this._markerLayer.setAttribute("name","ether-markers");
       
  3258 this._markerLayer.style.display="none";
       
  3259 if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
       
  3260 }this._lineLayer=this._band.createLayerDiv(1);
       
  3261 this._lineLayer.setAttribute("name","ether-lines");
       
  3262 this._lineLayer.style.display="none";
       
  3263 var D=this._band.getMinDate();
       
  3264 var A=this._band.getMaxDate();
       
  3265 var K=this._band.getTimeZone();
       
  3266 var I=this._band.getLabeller();
       
  3267 var B=this;
       
  3268 var L=function(N,M){for(var O=0;
       
  3269 O<M.multiple;
       
  3270 O++){SimileAjax.DateTime.incrementByInterval(N,M.unit);
       
  3271 }};
       
  3272 var C=0;
       
  3273 while(C<this._zones.length){if(D.getTime()<this._zones[C].endTime){break;
       
  3274 }C++;
       
  3275 }var E=this._zones.length-1;
       
  3276 while(E>=0){if(A.getTime()>this._zones[E].startTime){break;
       
  3277 }E--;
       
  3278 }for(var H=C;
       
  3279 H<=E;
       
  3280 H++){var G=this._zones[H];
       
  3281 var J=new Date(Math.max(D.getTime(),G.startTime));
       
  3282 var F=new Date(Math.min(A.getTime(),G.endTime));
       
  3283 SimileAjax.DateTime.roundDownToInterval(J,G.unit,K,G.multiple,this._theme.firstDayOfWeek);
       
  3284 SimileAjax.DateTime.roundUpToInterval(F,G.unit,K,G.multiple,this._theme.firstDayOfWeek);
       
  3285 while(J.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(J,I,G.unit,this._markerLayer,this._lineLayer);
       
  3286 L(J,G);
       
  3287 }}this._markerLayer.style.display="block";
       
  3288 this._lineLayer.style.display="block";
       
  3289 };
       
  3290 Timeline.HotZoneGregorianEtherPainter.prototype.softPaint=function(){};
       
  3291 Timeline.HotZoneGregorianEtherPainter.prototype.zoom=function(B){if(B!=0){for(var A=0;
       
  3292 A<this._zones.length;
       
  3293 ++A){if(this._zones[A]){this._zones[A].unit+=B;
       
  3294 }}}};
       
  3295 Timeline.YearCountEtherPainter=function(A){this._params=A;
       
  3296 this._theme=A.theme;
       
  3297 this._startDate=SimileAjax.DateTime.parseGregorianDateTime(A.startDate);
       
  3298 this._multiple=("multiple" in A)?A.multiple:1;
       
  3299 };
       
  3300 Timeline.YearCountEtherPainter.prototype.initialize=function(C,B){this._band=C;
       
  3301 this._timeline=B;
       
  3302 this._backgroundLayer=C.createLayerDiv(0);
       
  3303 this._backgroundLayer.setAttribute("name","ether-background");
       
  3304 this._backgroundLayer.className="timeline-ether-bg";
       
  3305 this._markerLayer=null;
       
  3306 this._lineLayer=null;
       
  3307 var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
       
  3308 var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
       
  3309 this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
       
  3310 this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
       
  3311 };
       
  3312 Timeline.YearCountEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
       
  3313 };
       
  3314 Timeline.YearCountEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
       
  3315 }this._markerLayer=this._band.createLayerDiv(100);
       
  3316 this._markerLayer.setAttribute("name","ether-markers");
       
  3317 this._markerLayer.style.display="none";
       
  3318 if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
       
  3319 }this._lineLayer=this._band.createLayerDiv(1);
       
  3320 this._lineLayer.setAttribute("name","ether-lines");
       
  3321 this._lineLayer.style.display="none";
       
  3322 var B=new Date(this._startDate.getTime());
       
  3323 var F=this._band.getMaxDate();
       
  3324 var E=this._band.getMinDate().getUTCFullYear()-this._startDate.getUTCFullYear();
       
  3325 B.setUTCFullYear(this._band.getMinDate().getUTCFullYear()-E%this._multiple);
       
  3326 var C=this;
       
  3327 var A=function(G){for(var H=0;
       
  3328 H<C._multiple;
       
  3329 H++){SimileAjax.DateTime.incrementByInterval(G,SimileAjax.DateTime.YEAR);
       
  3330 }};
       
  3331 var D={labelInterval:function(G,I){var H=G.getUTCFullYear()-C._startDate.getUTCFullYear();
       
  3332 return{text:H,emphasized:H==0};
       
  3333 }};
       
  3334 while(B.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);
       
  3335 A(B);
       
  3336 }this._markerLayer.style.display="block";
       
  3337 this._lineLayer.style.display="block";
       
  3338 };
       
  3339 Timeline.YearCountEtherPainter.prototype.softPaint=function(){};
       
  3340 Timeline.QuarterlyEtherPainter=function(A){this._params=A;
       
  3341 this._theme=A.theme;
       
  3342 this._startDate=SimileAjax.DateTime.parseGregorianDateTime(A.startDate);
       
  3343 };
       
  3344 Timeline.QuarterlyEtherPainter.prototype.initialize=function(C,B){this._band=C;
       
  3345 this._timeline=B;
       
  3346 this._backgroundLayer=C.createLayerDiv(0);
       
  3347 this._backgroundLayer.setAttribute("name","ether-background");
       
  3348 this._backgroundLayer.className="timeline-ether-bg";
       
  3349 this._markerLayer=null;
       
  3350 this._lineLayer=null;
       
  3351 var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
       
  3352 var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
       
  3353 this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
       
  3354 this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
       
  3355 };
       
  3356 Timeline.QuarterlyEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
       
  3357 };
       
  3358 Timeline.QuarterlyEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
       
  3359 }this._markerLayer=this._band.createLayerDiv(100);
       
  3360 this._markerLayer.setAttribute("name","ether-markers");
       
  3361 this._markerLayer.style.display="none";
       
  3362 if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
       
  3363 }this._lineLayer=this._band.createLayerDiv(1);
       
  3364 this._lineLayer.setAttribute("name","ether-lines");
       
  3365 this._lineLayer.style.display="none";
       
  3366 var B=new Date(0);
       
  3367 var E=this._band.getMaxDate();
       
  3368 B.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(),this._band.getMinDate().getUTCFullYear()));
       
  3369 B.setUTCMonth(this._startDate.getUTCMonth());
       
  3370 var C=this;
       
  3371 var A=function(F){F.setUTCMonth(F.getUTCMonth()+3);
       
  3372 };
       
  3373 var D={labelInterval:function(F,H){var G=(4+(F.getUTCMonth()-C._startDate.getUTCMonth())/3)%4;
       
  3374 if(G!=0){return{text:"Q"+(G+1),emphasized:false};
       
  3375 }else{return{text:"Y"+(F.getUTCFullYear()-C._startDate.getUTCFullYear()+1),emphasized:true};
       
  3376 }}};
       
  3377 while(B.getTime()<E.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);
       
  3378 A(B);
       
  3379 }this._markerLayer.style.display="block";
       
  3380 this._lineLayer.style.display="block";
       
  3381 };
       
  3382 Timeline.QuarterlyEtherPainter.prototype.softPaint=function(){};
       
  3383 Timeline.EtherIntervalMarkerLayout=function(M,L,C,E,H){var A=M.isHorizontal();
       
  3384 if(A){if(E=="Top"){this.positionDiv=function(O,N){O.style.left=N+"px";
       
  3385 O.style.top="0px";
       
  3386 };
       
  3387 }else{this.positionDiv=function(O,N){O.style.left=N+"px";
       
  3388 O.style.bottom="0px";
       
  3389 };
       
  3390 }}else{if(E=="Left"){this.positionDiv=function(O,N){O.style.top=N+"px";
       
  3391 O.style.left="0px";
       
  3392 };
       
  3393 }else{this.positionDiv=function(O,N){O.style.top=N+"px";
       
  3394 O.style.right="0px";
       
  3395 };
       
  3396 }}var D=C.ether.interval.marker;
       
  3397 var I=C.ether.interval.line;
       
  3398 var B=C.ether.interval.weekend;
       
  3399 var K=(A?"h":"v")+E;
       
  3400 var G=D[K+"Styler"];
       
  3401 var J=D[K+"EmphasizedStyler"];
       
  3402 var F=SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY];
       
  3403 this.createIntervalMarker=function(T,a,b,c,Q){var U=Math.round(L.dateToPixelOffset(T));
       
  3404 if(H&&b!=SimileAjax.DateTime.WEEK){var V=M.getDocument().createElement("div");
       
  3405 V.className="timeline-ether-lines";
       
  3406 if(I.opacity<100){SimileAjax.Graphics.setOpacity(V,I.opacity);
       
  3407 }if(A){V.style.left=U+"px";
       
  3408 }else{V.style.top=U+"px";
       
  3409 }Q.appendChild(V);
       
  3410 }if(b==SimileAjax.DateTime.WEEK){var N=C.firstDayOfWeek;
       
  3411 var W=new Date(T.getTime()+(6-N-7)*F);
       
  3412 var Z=new Date(W.getTime()+2*F);
       
  3413 var X=Math.round(L.dateToPixelOffset(W));
       
  3414 var S=Math.round(L.dateToPixelOffset(Z));
       
  3415 var R=Math.max(1,S-X);
       
  3416 var P=M.getDocument().createElement("div");
       
  3417 P.className="timeline-ether-weekends";
       
  3418 if(B.opacity<100){SimileAjax.Graphics.setOpacity(P,B.opacity);
       
  3419 }if(A){P.style.left=X+"px";
       
  3420 P.style.width=R+"px";
       
  3421 }else{P.style.top=X+"px";
       
  3422 P.style.height=R+"px";
       
  3423 }Q.appendChild(P);
       
  3424 }var Y=a.labelInterval(T,b);
       
  3425 var O=M.getDocument().createElement("div");
       
  3426 O.innerHTML=Y.text;
       
  3427 O.className="timeline-date-label";
       
  3428 if(Y.emphasized){O.className+=" timeline-date-label-em";
       
  3429 }this.positionDiv(O,U);
       
  3430 c.appendChild(O);
       
  3431 return O;
       
  3432 };
       
  3433 };
       
  3434 Timeline.EtherHighlight=function(C,E,D,B){var A=C.isHorizontal();
       
  3435 this._highlightDiv=null;
       
  3436 this._createHighlightDiv=function(){if(this._highlightDiv==null){this._highlightDiv=C.getDocument().createElement("div");
       
  3437 this._highlightDiv.setAttribute("name","ether-highlight");
       
  3438 this._highlightDiv.className="timeline-ether-highlight";
       
  3439 var F=D.ether.highlightOpacity;
       
  3440 if(F<100){SimileAjax.Graphics.setOpacity(this._highlightDiv,F);
       
  3441 }B.appendChild(this._highlightDiv);
       
  3442 }};
       
  3443 this.position=function(F,I){this._createHighlightDiv();
       
  3444 var J=Math.round(E.dateToPixelOffset(F));
       
  3445 var H=Math.round(E.dateToPixelOffset(I));
       
  3446 var G=Math.max(H-J,3);
       
  3447 if(A){this._highlightDiv.style.left=J+"px";
       
  3448 this._highlightDiv.style.width=G+"px";
       
  3449 this._highlightDiv.style.height=(E.getViewWidth()-4)+"px";
       
  3450 }else{this._highlightDiv.style.top=J+"px";
       
  3451 this._highlightDiv.style.height=G+"px";
       
  3452 this._highlightDiv.style.width=(E.getViewWidth()-4)+"px";
       
  3453 }};
       
  3454 };
       
  3455 
       
  3456 
       
  3457 /* ethers.js */
       
  3458 Timeline.LinearEther=function(A){this._params=A;
       
  3459 this._interval=A.interval;
       
  3460 this._pixelsPerInterval=A.pixelsPerInterval;
       
  3461 };
       
  3462 Timeline.LinearEther.prototype.initialize=function(B,A){this._band=B;
       
  3463 this._timeline=A;
       
  3464 this._unit=A.getUnit();
       
  3465 if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn);
       
  3466 }else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);
       
  3467 this.shiftPixels(-this._timeline.getPixelLength());
       
  3468 }else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);
       
  3469 this.shiftPixels(-this._timeline.getPixelLength()/2);
       
  3470 }else{this._start=this._unit.makeDefaultValue();
       
  3471 this.shiftPixels(-this._timeline.getPixelLength()/2);
       
  3472 }}}};
       
  3473 Timeline.LinearEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A);
       
  3474 };
       
  3475 Timeline.LinearEther.prototype.shiftPixels=function(B){var A=this._interval*B/this._pixelsPerInterval;
       
  3476 this._start=this._unit.change(this._start,A);
       
  3477 };
       
  3478 Timeline.LinearEther.prototype.dateToPixelOffset=function(A){var B=this._unit.compare(A,this._start);
       
  3479 return this._pixelsPerInterval*B/this._interval;
       
  3480 };
       
  3481 Timeline.LinearEther.prototype.pixelOffsetToDate=function(B){var A=B*this._interval/this._pixelsPerInterval;
       
  3482 return this._unit.change(this._start,A);
       
  3483 };
       
  3484 Timeline.LinearEther.prototype.zoom=function(D){var B=0;
       
  3485 var A=this._band._zoomIndex;
       
  3486 var C=A;
       
  3487 if(D&&(A>0)){C=A-1;
       
  3488 }if(!D&&(A<(this._band._zoomSteps.length-1))){C=A+1;
       
  3489 }this._band._zoomIndex=C;
       
  3490 this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit];
       
  3491 this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval;
       
  3492 B=this._band._zoomSteps[C].unit-this._band._zoomSteps[A].unit;
       
  3493 return B;
       
  3494 };
       
  3495 Timeline.HotZoneEther=function(A){this._params=A;
       
  3496 this._interval=A.interval;
       
  3497 this._pixelsPerInterval=A.pixelsPerInterval;
       
  3498 this._theme=A.theme;
       
  3499 };
       
  3500 Timeline.HotZoneEther.prototype.initialize=function(H,I){this._band=H;
       
  3501 this._timeline=I;
       
  3502 this._unit=I.getUnit();
       
  3503 this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}];
       
  3504 var B=this._params;
       
  3505 for(var D=0;
       
  3506 D<B.zones.length;
       
  3507 D++){var G=B.zones[D];
       
  3508 var E=this._unit.parseFromObject(G.start);
       
  3509 var F=this._unit.parseFromObject(G.end);
       
  3510 for(var C=0;
       
  3511 C<this._zones.length&&this._unit.compare(F,E)>0;
       
  3512 C++){var A=this._zones[C];
       
  3513 if(this._unit.compare(E,A.endTime)<0){if(this._unit.compare(E,A.startTime)>0){this._zones.splice(C,0,{startTime:A.startTime,endTime:E,magnify:A.magnify});
       
  3514 C++;
       
  3515 A.startTime=E;
       
  3516 }if(this._unit.compare(F,A.endTime)<0){this._zones.splice(C,0,{startTime:E,endTime:F,magnify:G.magnify*A.magnify});
       
  3517 C++;
       
  3518 A.startTime=F;
       
  3519 E=F;
       
  3520 }else{A.magnify*=G.magnify;
       
  3521 E=A.endTime;
       
  3522 }}}}if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn);
       
  3523 }else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);
       
  3524 this.shiftPixels(-this._timeline.getPixelLength());
       
  3525 }else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);
       
  3526 this.shiftPixels(-this._timeline.getPixelLength()/2);
       
  3527 }else{this._start=this._unit.makeDefaultValue();
       
  3528 this.shiftPixels(-this._timeline.getPixelLength()/2);
       
  3529 }}}};
       
  3530 Timeline.HotZoneEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A);
       
  3531 };
       
  3532 Timeline.HotZoneEther.prototype.shiftPixels=function(A){this._start=this.pixelOffsetToDate(A);
       
  3533 };
       
  3534 Timeline.HotZoneEther.prototype.dateToPixelOffset=function(A){return this._dateDiffToPixelOffset(this._start,A);
       
  3535 };
       
  3536 Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(A){return this._pixelOffsetToDate(A,this._start);
       
  3537 };
       
  3538 Timeline.HotZoneEther.prototype.zoom=function(D){var B=0;
       
  3539 var A=this._band._zoomIndex;
       
  3540 var C=A;
       
  3541 if(D&&(A>0)){C=A-1;
       
  3542 }if(!D&&(A<(this._band._zoomSteps.length-1))){C=A+1;
       
  3543 }this._band._zoomIndex=C;
       
  3544 this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit];
       
  3545 this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval;
       
  3546 B=this._band._zoomSteps[C].unit-this._band._zoomSteps[A].unit;
       
  3547 return B;
       
  3548 };
       
  3549 Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(I,D){var B=this._getScale();
       
  3550 var H=I;
       
  3551 var C=D;
       
  3552 var A=0;
       
  3553 if(this._unit.compare(H,C)<0){var G=0;
       
  3554 while(G<this._zones.length){if(this._unit.compare(H,this._zones[G].endTime)<0){break;
       
  3555 }G++;
       
  3556 }while(this._unit.compare(H,C)<0){var E=this._zones[G];
       
  3557 var F=this._unit.earlier(C,E.endTime);
       
  3558 A+=(this._unit.compare(F,H)/(B/E.magnify));
       
  3559 H=F;
       
  3560 G++;
       
  3561 }}else{var G=this._zones.length-1;
       
  3562 while(G>=0){if(this._unit.compare(H,this._zones[G].startTime)>0){break;
       
  3563 }G--;
       
  3564 }while(this._unit.compare(H,C)>0){var E=this._zones[G];
       
  3565 var F=this._unit.later(C,E.startTime);
       
  3566 A+=(this._unit.compare(F,H)/(B/E.magnify));
       
  3567 H=F;
       
  3568 G--;
       
  3569 }}return A;
       
  3570 };
       
  3571 Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(H,C){var G=this._getScale();
       
  3572 var E=C;
       
  3573 if(H>0){var F=0;
       
  3574 while(F<this._zones.length){if(this._unit.compare(E,this._zones[F].endTime)<0){break;
       
  3575 }F++;
       
  3576 }while(H>0){var A=this._zones[F];
       
  3577 var D=G/A.magnify;
       
  3578 if(A.endTime==Number.POSITIVE_INFINITY){E=this._unit.change(E,H*D);
       
  3579 H=0;
       
  3580 }else{var B=this._unit.compare(A.endTime,E)/D;
       
  3581 if(B>H){E=this._unit.change(E,H*D);
       
  3582 H=0;
       
  3583 }else{E=A.endTime;
       
  3584 H-=B;
       
  3585 }}F++;
       
  3586 }}else{var F=this._zones.length-1;
       
  3587 while(F>=0){if(this._unit.compare(E,this._zones[F].startTime)>0){break;
       
  3588 }F--;
       
  3589 }H=-H;
       
  3590 while(H>0){var A=this._zones[F];
       
  3591 var D=G/A.magnify;
       
  3592 if(A.startTime==Number.NEGATIVE_INFINITY){E=this._unit.change(E,-H*D);
       
  3593 H=0;
       
  3594 }else{var B=this._unit.compare(E,A.startTime)/D;
       
  3595 if(B>H){E=this._unit.change(E,-H*D);
       
  3596 H=0;
       
  3597 }else{E=A.startTime;
       
  3598 H-=B;
       
  3599 }}F--;
       
  3600 }}return E;
       
  3601 };
       
  3602 Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval;
       
  3603 };
       
  3604 
       
  3605 
       
  3606 /* labellers.js */
       
  3607 Timeline.GregorianDateLabeller=function(A,B){this._locale=A;
       
  3608 this._timeZone=B;
       
  3609 };
       
  3610 Timeline.GregorianDateLabeller.monthNames=[];
       
  3611 Timeline.GregorianDateLabeller.dayNames=[];
       
  3612 Timeline.GregorianDateLabeller.labelIntervalFunctions=[];
       
  3613 Timeline.GregorianDateLabeller.getMonthName=function(B,A){return Timeline.GregorianDateLabeller.monthNames[A][B];
       
  3614 };
       
  3615 Timeline.GregorianDateLabeller.prototype.labelInterval=function(A,C){var B=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale];
       
  3616 if(B==null){B=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval;
       
  3617 }return B.call(this,A,C);
       
  3618 };
       
  3619 Timeline.GregorianDateLabeller.prototype.labelPrecise=function(A){return SimileAjax.DateTime.removeTimeZoneOffset(A,this._timeZone).toUTCString();
       
  3620 };
       
  3621 Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(B,F){var C;
       
  3622 var E=false;
       
  3623 B=SimileAjax.DateTime.removeTimeZoneOffset(B,this._timeZone);
       
  3624 switch(F){case SimileAjax.DateTime.MILLISECOND:C=B.getUTCMilliseconds();
       
  3625 break;
       
  3626 case SimileAjax.DateTime.SECOND:C=B.getUTCSeconds();
       
  3627 break;
       
  3628 case SimileAjax.DateTime.MINUTE:var A=B.getUTCMinutes();
       
  3629 if(A==0){C=B.getUTCHours()+":00";
       
  3630 E=true;
       
  3631 }else{C=A;
       
  3632 }break;
       
  3633 case SimileAjax.DateTime.HOUR:C=B.getUTCHours()+"hr";
       
  3634 break;
       
  3635 case SimileAjax.DateTime.DAY:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate();
       
  3636 break;
       
  3637 case SimileAjax.DateTime.WEEK:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate();
       
  3638 break;
       
  3639 case SimileAjax.DateTime.MONTH:var A=B.getUTCMonth();
       
  3640 if(A!=0){C=Timeline.GregorianDateLabeller.getMonthName(A,this._locale);
       
  3641 break;
       
  3642 }case SimileAjax.DateTime.YEAR:case SimileAjax.DateTime.DECADE:case SimileAjax.DateTime.CENTURY:case SimileAjax.DateTime.MILLENNIUM:var D=B.getUTCFullYear();
       
  3643 if(D>0){C=B.getUTCFullYear();
       
  3644 }else{C=(1-D)+"BC";
       
  3645 }E=(F==SimileAjax.DateTime.MONTH)||(F==SimileAjax.DateTime.DECADE&&D%100==0)||(F==SimileAjax.DateTime.CENTURY&&D%1000==0);
       
  3646 break;
       
  3647 default:C=B.toUTCString();
       
  3648 }return{text:C,emphasized:E};
       
  3649 };
       
  3650 
       
  3651 
       
  3652 /* original-painter.js */
       
  3653 Timeline.OriginalEventPainter=function(A){this._params=A;
       
  3654 this._onSelectListeners=[];
       
  3655 this._filterMatcher=null;
       
  3656 this._highlightMatcher=null;
       
  3657 this._frc=null;
       
  3658 this._eventIdToElmt={};
       
  3659 };
       
  3660 Timeline.OriginalEventPainter.prototype.initialize=function(B,A){this._band=B;
       
  3661 this._timeline=A;
       
  3662 this._backLayer=null;
       
  3663 this._eventLayer=null;
       
  3664 this._lineLayer=null;
       
  3665 this._highlightLayer=null;
       
  3666 this._eventIdToElmt=null;
       
  3667 };
       
  3668 Timeline.OriginalEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
       
  3669 };
       
  3670 Timeline.OriginalEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
       
  3671 A<this._onSelectListeners.length;
       
  3672 A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
       
  3673 break;
       
  3674 }}};
       
  3675 Timeline.OriginalEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
       
  3676 };
       
  3677 Timeline.OriginalEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
       
  3678 };
       
  3679 Timeline.OriginalEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
       
  3680 };
       
  3681 Timeline.OriginalEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
       
  3682 };
       
  3683 Timeline.OriginalEventPainter.prototype.paint=function(){var B=this._band.getEventSource();
       
  3684 if(B==null){return ;
       
  3685 }this._eventIdToElmt={};
       
  3686 this._prepareForPainting();
       
  3687 var I=this._params.theme.event;
       
  3688 var G=Math.max(I.track.height,I.tape.height+this._frc.getLineHeight());
       
  3689 var F={trackOffset:I.track.gap,trackHeight:G,trackGap:I.track.gap,trackIncrement:G+I.track.gap,icon:I.instant.icon,iconWidth:I.instant.iconWidth,iconHeight:I.instant.iconHeight,labelWidth:I.label.width};
       
  3690 var C=this._band.getMinDate();
       
  3691 var A=this._band.getMaxDate();
       
  3692 var J=(this._filterMatcher!=null)?this._filterMatcher:function(K){return true;
       
  3693 };
       
  3694 var E=(this._highlightMatcher!=null)?this._highlightMatcher:function(K){return -1;
       
  3695 };
       
  3696 var D=B.getEventReverseIterator(C,A);
       
  3697 while(D.hasNext()){var H=D.next();
       
  3698 if(J(H)){this.paintEvent(H,F,this._params.theme,E(H));
       
  3699 }}this._highlightLayer.style.display="block";
       
  3700 this._lineLayer.style.display="block";
       
  3701 this._eventLayer.style.display="block";
       
  3702 };
       
  3703 Timeline.OriginalEventPainter.prototype.softPaint=function(){};
       
  3704 Timeline.OriginalEventPainter.prototype._prepareForPainting=function(){var B=this._band;
       
  3705 if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");
       
  3706 this._backLayer.style.visibility="hidden";
       
  3707 var A=document.createElement("span");
       
  3708 A.className="timeline-event-label";
       
  3709 this._backLayer.appendChild(A);
       
  3710 this._frc=SimileAjax.Graphics.getFontRenderingContext(A);
       
  3711 }this._frc.update();
       
  3712 this._tracks=[];
       
  3713 if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer);
       
  3714 }this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");
       
  3715 this._highlightLayer.style.display="none";
       
  3716 if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer);
       
  3717 }this._lineLayer=B.createLayerDiv(110,"timeline-band-lines");
       
  3718 this._lineLayer.style.display="none";
       
  3719 if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer);
       
  3720 }this._eventLayer=B.createLayerDiv(115,"timeline-band-events");
       
  3721 this._eventLayer.style.display="none";
       
  3722 };
       
  3723 Timeline.OriginalEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
       
  3724 }else{this.paintDurationEvent(B,C,D,A);
       
  3725 }};
       
  3726 Timeline.OriginalEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A);
       
  3727 }else{this.paintPreciseInstantEvent(B,C,D,A);
       
  3728 }};
       
  3729 Timeline.OriginalEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A);
       
  3730 }else{this.paintPreciseDurationEvent(B,C,D,A);
       
  3731 }};
       
  3732 Timeline.OriginalEventPainter.prototype.paintPreciseInstantEvent=function(J,N,P,O){var S=this._timeline.getDocument();
       
  3733 var I=J.getText();
       
  3734 var E=J.getStart();
       
  3735 var C=Math.round(this._band.dateToPixelOffset(E));
       
  3736 var A=Math.round(C+N.iconWidth/2);
       
  3737 var H=Math.round(C-N.iconWidth/2);
       
  3738 var F=this._frc.computeSize(I);
       
  3739 var T=A+P.event.label.offsetFromLine;
       
  3740 var D=T+F.width;
       
  3741 var R=D;
       
  3742 var L=this._findFreeTrack(R);
       
  3743 var Q=Math.round(N.trackOffset+L*N.trackIncrement+N.trackHeight/2-F.height/2);
       
  3744 var B=this._paintEventIcon(J,L,H,N,P);
       
  3745 var M=this._paintEventLabel(J,I,T,Q,F.width,F.height,P);
       
  3746 var K=this;
       
  3747 var G=function(U,V,W){return K._onClickInstantEvent(B.elmt,V,J);
       
  3748 };
       
  3749 SimileAjax.DOM.registerEvent(B.elmt,"mousedown",G);
       
  3750 SimileAjax.DOM.registerEvent(M.elmt,"mousedown",G);
       
  3751 this._createHighlightDiv(O,B,P);
       
  3752 this._eventIdToElmt[J.getID()]=B.elmt;
       
  3753 this._tracks[L]=H;
       
  3754 };
       
  3755 Timeline.OriginalEventPainter.prototype.paintImpreciseInstantEvent=function(L,P,U,R){var W=this._timeline.getDocument();
       
  3756 var K=L.getText();
       
  3757 var G=L.getStart();
       
  3758 var S=L.getEnd();
       
  3759 var D=Math.round(this._band.dateToPixelOffset(G));
       
  3760 var B=Math.round(this._band.dateToPixelOffset(S));
       
  3761 var A=Math.round(D+P.iconWidth/2);
       
  3762 var J=Math.round(D-P.iconWidth/2);
       
  3763 var H=this._frc.computeSize(K);
       
  3764 var X=A+U.event.label.offsetFromLine;
       
  3765 var E=X+H.width;
       
  3766 var V=Math.max(E,B);
       
  3767 var N=this._findFreeTrack(V);
       
  3768 var T=Math.round(P.trackOffset+N*P.trackIncrement+P.trackHeight/2-H.height/2);
       
  3769 var C=this._paintEventIcon(L,N,J,P,U);
       
  3770 var O=this._paintEventLabel(L,K,X,T,H.width,H.height,U);
       
  3771 var Q=L.getColor();
       
  3772 Q=Q!=null?Q:U.event.instant.impreciseColor;
       
  3773 var F=this._paintEventTape(L,N,D,B,Q,U.event.instant.impreciseOpacity,P,U);
       
  3774 var M=this;
       
  3775 var I=function(Y,Z,a){return M._onClickInstantEvent(C.elmt,Z,L);
       
  3776 };
       
  3777 SimileAjax.DOM.registerEvent(C.elmt,"mousedown",I);
       
  3778 SimileAjax.DOM.registerEvent(F.elmt,"mousedown",I);
       
  3779 SimileAjax.DOM.registerEvent(O.elmt,"mousedown",I);
       
  3780 this._createHighlightDiv(R,C,U);
       
  3781 this._eventIdToElmt[L.getID()]=C.elmt;
       
  3782 this._tracks[N]=J;
       
  3783 };
       
  3784 Timeline.OriginalEventPainter.prototype.paintPreciseDurationEvent=function(I,M,Q,O){var T=this._timeline.getDocument();
       
  3785 var H=I.getText();
       
  3786 var E=I.getStart();
       
  3787 var P=I.getEnd();
       
  3788 var B=Math.round(this._band.dateToPixelOffset(E));
       
  3789 var A=Math.round(this._band.dateToPixelOffset(P));
       
  3790 var F=this._frc.computeSize(H);
       
  3791 var U=B;
       
  3792 var C=U+F.width;
       
  3793 var S=Math.max(C,A);
       
  3794 var K=this._findFreeTrack(S);
       
  3795 var R=Math.round(M.trackOffset+K*M.trackIncrement+Q.event.tape.height);
       
  3796 var N=I.getColor();
       
  3797 N=N!=null?N:Q.event.duration.color;
       
  3798 var D=this._paintEventTape(I,K,B,A,N,100,M,Q);
       
  3799 var L=this._paintEventLabel(I,H,U,R,F.width,F.height,Q);
       
  3800 var J=this;
       
  3801 var G=function(V,W,X){return J._onClickDurationEvent(D.elmt,W,I);
       
  3802 };
       
  3803 SimileAjax.DOM.registerEvent(D.elmt,"mousedown",G);
       
  3804 SimileAjax.DOM.registerEvent(L.elmt,"mousedown",G);
       
  3805 this._createHighlightDiv(O,D,Q);
       
  3806 this._eventIdToElmt[I.getID()]=D.elmt;
       
  3807 this._tracks[K]=B;
       
  3808 };
       
  3809 Timeline.OriginalEventPainter.prototype.paintImpreciseDurationEvent=function(K,P,V,S){var Y=this._timeline.getDocument();
       
  3810 var J=K.getText();
       
  3811 var E=K.getStart();
       
  3812 var Q=K.getLatestStart();
       
  3813 var T=K.getEnd();
       
  3814 var X=K.getEarliestEnd();
       
  3815 var B=Math.round(this._band.dateToPixelOffset(E));
       
  3816 var F=Math.round(this._band.dateToPixelOffset(Q));
       
  3817 var A=Math.round(this._band.dateToPixelOffset(T));
       
  3818 var G=Math.round(this._band.dateToPixelOffset(X));
       
  3819 var H=this._frc.computeSize(J);
       
  3820 var Z=F;
       
  3821 var C=Z+H.width;
       
  3822 var W=Math.max(C,A);
       
  3823 var M=this._findFreeTrack(W);
       
  3824 var U=Math.round(P.trackOffset+M*P.trackIncrement+V.event.tape.height);
       
  3825 var R=K.getColor();
       
  3826 R=R!=null?R:V.event.duration.color;
       
  3827 var O=this._paintEventTape(K,M,B,A,V.event.duration.impreciseColor,V.event.duration.impreciseOpacity,P,V);
       
  3828 var D=this._paintEventTape(K,M,F,G,R,100,P,V);
       
  3829 var N=this._paintEventLabel(K,J,Z,U,H.width,H.height,V);
       
  3830 var L=this;
       
  3831 var I=function(a,b,c){return L._onClickDurationEvent(D.elmt,b,K);
       
  3832 };
       
  3833 SimileAjax.DOM.registerEvent(D.elmt,"mousedown",I);
       
  3834 SimileAjax.DOM.registerEvent(N.elmt,"mousedown",I);
       
  3835 this._createHighlightDiv(S,D,V);
       
  3836 this._eventIdToElmt[K.getID()]=D.elmt;
       
  3837 this._tracks[M]=B;
       
  3838 };
       
  3839 Timeline.OriginalEventPainter.prototype._findFreeTrack=function(A){for(var C=0;
       
  3840 C<this._tracks.length;
       
  3841 C++){var B=this._tracks[C];
       
  3842 if(B>A){break;
       
  3843 }}return C;
       
  3844 };
       
  3845 Timeline.OriginalEventPainter.prototype._paintEventIcon=function(I,E,B,F,D){var H=I.getIcon();
       
  3846 H=H!=null?H:F.icon;
       
  3847 var J=F.trackOffset+E*F.trackIncrement+F.trackHeight/2;
       
  3848 var G=Math.round(J-F.iconHeight/2);
       
  3849 var C=SimileAjax.Graphics.createTranslucentImage(H);
       
  3850 var A=this._timeline.getDocument().createElement("div");
       
  3851 A.className="timeline-event-icon";
       
  3852 A.style.left=B+"px";
       
  3853 A.style.top=G+"px";
       
  3854 A.appendChild(C);
       
  3855 if(I._title!=null){A.title=I._title;
       
  3856 }this._eventLayer.appendChild(A);
       
  3857 return{left:B,top:G,width:F.iconWidth,height:F.iconHeight,elmt:A};
       
  3858 };
       
  3859 Timeline.OriginalEventPainter.prototype._paintEventLabel=function(I,J,B,G,A,K,E){var H=this._timeline.getDocument();
       
  3860 var F=H.createElement("div");
       
  3861 F.className="timeline-event-label";
       
  3862 F.style.left=B+"px";
       
  3863 F.style.width=A+"px";
       
  3864 F.style.top=G+"px";
       
  3865 F.innerHTML=J;
       
  3866 if(I._title!=null){F.title=I._title;
       
  3867 }var D=I.getTextColor();
       
  3868 if(D==null){D=I.getColor();
       
  3869 }if(D!=null){F.style.color=D;
       
  3870 }var C=I.getClassName();
       
  3871 if(C!=null){F.className+=" "+C;
       
  3872 }this._eventLayer.appendChild(F);
       
  3873 return{left:B,top:G,width:A,height:K,elmt:F};
       
  3874 };
       
  3875 Timeline.OriginalEventPainter.prototype._paintEventTape=function(O,J,G,A,D,I,K,H){var C=A-G;
       
  3876 var F=H.event.tape.height;
       
  3877 var L=K.trackOffset+J*K.trackIncrement;
       
  3878 var N=this._timeline.getDocument().createElement("div");
       
  3879 N.className="timeline-event-tape";
       
  3880 N.style.left=G+"px";
       
  3881 N.style.width=C+"px";
       
  3882 N.style.height=F+"px";
       
  3883 N.style.top=L+"px";
       
  3884 if(O._title!=null){N.title=O._title;
       
  3885 }if(D!=null){N.style.backgroundColor=D;
       
  3886 }var M=O.getTapeImage();
       
  3887 var E=O.getTapeRepeat();
       
  3888 E=E!=null?E:"repeat";
       
  3889 if(M!=null){N.style.backgroundImage="url("+M+")";
       
  3890 N.style.backgroundRepeat=E;
       
  3891 }SimileAjax.Graphics.setOpacity(N,I);
       
  3892 var B=O.getClassName();
       
  3893 if(B!=null){N.className+=" "+B;
       
  3894 }this._eventLayer.appendChild(N);
       
  3895 return{left:G,top:L,width:C,height:F,elmt:N};
       
  3896 };
       
  3897 Timeline.OriginalEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument();
       
  3898 var G=E.event;
       
  3899 var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)];
       
  3900 var F=D.createElement("div");
       
  3901 F.style.position="absolute";
       
  3902 F.style.overflow="hidden";
       
  3903 F.style.left=(C.left-2)+"px";
       
  3904 F.style.width=(C.width+4)+"px";
       
  3905 F.style.top=(C.top-2)+"px";
       
  3906 F.style.height=(C.height+4)+"px";
       
  3907 this._highlightLayer.appendChild(F);
       
  3908 }};
       
  3909 Timeline.OriginalEventPainter.prototype._onClickInstantEvent=function(B,C,A){var D=SimileAjax.DOM.getPageCoordinates(B);
       
  3910 this._showBubble(D.left+Math.ceil(B.offsetWidth/2),D.top+Math.ceil(B.offsetHeight/2),A);
       
  3911 this._fireOnSelect(A.getID());
       
  3912 C.cancelBubble=true;
       
  3913 SimileAjax.DOM.cancelEvent(C);
       
  3914 return false;
       
  3915 };
       
  3916 Timeline.OriginalEventPainter.prototype._onClickDurationEvent=function(D,C,B){if("pageX" in C){var A=C.pageX;
       
  3917 var F=C.pageY;
       
  3918 }else{var E=SimileAjax.DOM.getPageCoordinates(D);
       
  3919 var A=C.offsetX+E.left;
       
  3920 var F=C.offsetY+E.top;
       
  3921 }this._showBubble(A,F,B);
       
  3922 this._fireOnSelect(B.getID());
       
  3923 C.cancelBubble=true;
       
  3924 SimileAjax.DOM.cancelEvent(C);
       
  3925 return false;
       
  3926 };
       
  3927 Timeline.OriginalEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()];
       
  3928 if(B){var C=SimileAjax.DOM.getPageCoordinates(B);
       
  3929 this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A);
       
  3930 }};
       
  3931 Timeline.OriginalEventPainter.prototype._showBubble=function(A,D,B){var C=document.createElement("div");
       
  3932 B.fillInfoBubble(C,this._params.theme,this._band.getLabeller());
       
  3933 SimileAjax.WindowManager.cancelPopups();
       
  3934 SimileAjax.Graphics.createBubbleForContentAndPoint(C,A,D,this._params.theme.event.bubble.width);
       
  3935 };
       
  3936 Timeline.OriginalEventPainter.prototype._fireOnSelect=function(B){for(var A=0;
       
  3937 A<this._onSelectListeners.length;
       
  3938 A++){this._onSelectListeners[A](B);
       
  3939 }};
       
  3940 
       
  3941 
       
  3942 /* overview-painter.js */
       
  3943 Timeline.OverviewEventPainter=function(A){this._params=A;
       
  3944 this._onSelectListeners=[];
       
  3945 this._filterMatcher=null;
       
  3946 this._highlightMatcher=null;
       
  3947 };
       
  3948 Timeline.OverviewEventPainter.prototype.initialize=function(B,A){this._band=B;
       
  3949 this._timeline=A;
       
  3950 this._eventLayer=null;
       
  3951 this._highlightLayer=null;
       
  3952 };
       
  3953 Timeline.OverviewEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
       
  3954 };
       
  3955 Timeline.OverviewEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
       
  3956 A<this._onSelectListeners.length;
       
  3957 A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
       
  3958 break;
       
  3959 }}};
       
  3960 Timeline.OverviewEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
       
  3961 };
       
  3962 Timeline.OverviewEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
       
  3963 };
       
  3964 Timeline.OverviewEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
       
  3965 };
       
  3966 Timeline.OverviewEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
       
  3967 };
       
  3968 Timeline.OverviewEventPainter.prototype.paint=function(){var B=this._band.getEventSource();
       
  3969 if(B==null){return ;
       
  3970 }this._prepareForPainting();
       
  3971 var H=this._params.theme.event;
       
  3972 var F={trackOffset:H.overviewTrack.offset,trackHeight:H.overviewTrack.height,trackGap:H.overviewTrack.gap,trackIncrement:H.overviewTrack.height+H.overviewTrack.gap};
       
  3973 var C=this._band.getMinDate();
       
  3974 var A=this._band.getMaxDate();
       
  3975 var I=(this._filterMatcher!=null)?this._filterMatcher:function(J){return true;
       
  3976 };
       
  3977 var E=(this._highlightMatcher!=null)?this._highlightMatcher:function(J){return -1;
       
  3978 };
       
  3979 var D=B.getEventReverseIterator(C,A);
       
  3980 while(D.hasNext()){var G=D.next();
       
  3981 if(I(G)){this.paintEvent(G,F,this._params.theme,E(G));
       
  3982 }}this._highlightLayer.style.display="block";
       
  3983 this._eventLayer.style.display="block";
       
  3984 };
       
  3985 Timeline.OverviewEventPainter.prototype.softPaint=function(){};
       
  3986 Timeline.OverviewEventPainter.prototype._prepareForPainting=function(){var A=this._band;
       
  3987 this._tracks=[];
       
  3988 if(this._highlightLayer!=null){A.removeLayerDiv(this._highlightLayer);
       
  3989 }this._highlightLayer=A.createLayerDiv(105,"timeline-band-highlights");
       
  3990 this._highlightLayer.style.display="none";
       
  3991 if(this._eventLayer!=null){A.removeLayerDiv(this._eventLayer);
       
  3992 }this._eventLayer=A.createLayerDiv(110,"timeline-band-events");
       
  3993 this._eventLayer.style.display="none";
       
  3994 };
       
  3995 Timeline.OverviewEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
       
  3996 }else{this.paintDurationEvent(B,C,D,A);
       
  3997 }};
       
  3998 Timeline.OverviewEventPainter.prototype.paintInstantEvent=function(C,F,G,B){var A=C.getStart();
       
  3999 var H=Math.round(this._band.dateToPixelOffset(A));
       
  4000 var D=C.getColor();
       
  4001 D=D!=null?D:G.event.duration.color;
       
  4002 var E=this._paintEventTick(C,H,D,100,F,G);
       
  4003 this._createHighlightDiv(B,E,G);
       
  4004 };
       
  4005 Timeline.OverviewEventPainter.prototype.paintDurationEvent=function(K,J,I,D){var A=K.getLatestStart();
       
  4006 var C=K.getEarliestEnd();
       
  4007 var B=Math.round(this._band.dateToPixelOffset(A));
       
  4008 var E=Math.round(this._band.dateToPixelOffset(C));
       
  4009 var H=0;
       
  4010 for(;
       
  4011 H<this._tracks.length;
       
  4012 H++){if(E<this._tracks[H]){break;
       
  4013 }}this._tracks[H]=E;
       
  4014 var G=K.getColor();
       
  4015 G=G!=null?G:I.event.duration.color;
       
  4016 var F=this._paintEventTape(K,H,B,E,G,100,J,I);
       
  4017 this._createHighlightDiv(D,F,I);
       
  4018 };
       
  4019 Timeline.OverviewEventPainter.prototype._paintEventTape=function(K,B,C,J,D,F,G,E){var H=G.trackOffset+B*G.trackIncrement;
       
  4020 var A=J-C;
       
  4021 var L=G.trackHeight;
       
  4022 var I=this._timeline.getDocument().createElement("div");
       
  4023 I.className="timeline-small-event-tape";
       
  4024 I.style.left=C+"px";
       
  4025 I.style.width=A+"px";
       
  4026 I.style.top=H+"px";
       
  4027 if(F<100){SimileAjax.Graphics.setOpacity(I,F);
       
  4028 }this._eventLayer.appendChild(I);
       
  4029 return{left:C,top:H,width:A,height:L,elmt:I};
       
  4030 };
       
  4031 Timeline.OverviewEventPainter.prototype._paintEventTick=function(J,B,D,F,G,E){var K=E.event.overviewTrack.tickHeight;
       
  4032 var H=G.trackOffset-K;
       
  4033 var A=1;
       
  4034 var I=this._timeline.getDocument().createElement("div");
       
  4035 I.className="timeline-small-event-icon";
       
  4036 I.style.left=B+"px";
       
  4037 I.style.top=H+"px";
       
  4038 var C=J.getClassName();
       
  4039 if(C){I.className+=" small-"+C;
       
  4040 }if(F<100){SimileAjax.Graphics.setOpacity(I,F);
       
  4041 }this._eventLayer.appendChild(I);
       
  4042 return{left:B,top:H,width:A,height:K,elmt:I};
       
  4043 };
       
  4044 Timeline.OverviewEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument();
       
  4045 var G=E.event;
       
  4046 var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)];
       
  4047 var F=D.createElement("div");
       
  4048 F.style.position="absolute";
       
  4049 F.style.overflow="hidden";
       
  4050 F.style.left=(C.left-1)+"px";
       
  4051 F.style.width=(C.width+2)+"px";
       
  4052 F.style.top=(C.top-1)+"px";
       
  4053 F.style.height=(C.height+2)+"px";
       
  4054 F.style.background=B;
       
  4055 this._highlightLayer.appendChild(F);
       
  4056 }};
       
  4057 Timeline.OverviewEventPainter.prototype.showBubble=function(A){};
       
  4058 
       
  4059 
       
  4060 /* sources.js */
       
  4061 Timeline.DefaultEventSource=function(A){
       
  4062     this._events=(A instanceof Object)?A:new SimileAjax.EventIndex();
       
  4063     this._listeners=[];
       
  4064 };
       
  4065 Timeline.DefaultEventSource.prototype.addListener=function(A){this._listeners.push(A);
       
  4066 };
       
  4067 Timeline.DefaultEventSource.prototype.removeListener=function(B){for(var A=0;
       
  4068 A<this._listeners.length;
       
  4069 A++){if(this._listeners[A]==B){this._listeners.splice(A,1);
       
  4070 break;
       
  4071 }}};
       
  4072 Timeline.DefaultEventSource.prototype.loadXML=function(F,A){var B=this._getBaseURL(A);
       
  4073 var G=F.documentElement.getAttribute("wiki-url");
       
  4074 var K=F.documentElement.getAttribute("wiki-section");
       
  4075 var D=F.documentElement.getAttribute("date-time-format");
       
  4076 var E=this._events.getUnit().getParser(D);
       
  4077 var C=F.documentElement.firstChild;
       
  4078 var H=false;
       
  4079 while(C!=null){if(C.nodeType==1){var J="";
       
  4080 if(C.firstChild!=null&&C.firstChild.nodeType==3){J=C.firstChild.nodeValue;
       
  4081 }var I=new Timeline.DefaultEventSource.Event({id:C.getAttribute("id"),start:E(C.getAttribute("start")),end:E(C.getAttribute("end")),latestStart:E(C.getAttribute("latestStart")),earliestEnd:E(C.getAttribute("earliestEnd")),instant:C.getAttribute("isDuration")!="true",text:C.getAttribute("title"),description:J,image:this._resolveRelativeURL(C.getAttribute("image"),B),link:this._resolveRelativeURL(C.getAttribute("link"),B),icon:this._resolveRelativeURL(C.getAttribute("icon"),B),color:C.getAttribute("color"),textColor:C.getAttribute("textColor"),hoverText:C.getAttribute("hoverText"),classname:C.getAttribute("classname"),tapeImage:C.getAttribute("tapeImage"),tapeRepeat:C.getAttribute("tapeRepeat"),caption:C.getAttribute("caption"),eventID:C.getAttribute("eventID")});
       
  4082 I._node=C;
       
  4083 I.getProperty=function(L){return this._node.getAttribute(L);
       
  4084 };
       
  4085 I.setWikiInfo(G,K);
       
  4086 this._events.add(I);
       
  4087 H=true;
       
  4088 }C=C.nextSibling;
       
  4089 }if(H){this._fire("onAddMany",[]);
       
  4090 }};
       
  4091 Timeline.DefaultEventSource.prototype.loadJSON=function(F,B){var C=this._getBaseURL(B);
       
  4092 var I=false;
       
  4093 if(F&&F.events){var H=("wikiURL" in F)?F.wikiURL:null;
       
  4094 var K=("wikiSection" in F)?F.wikiSection:null;
       
  4095 var D=("dateTimeFormat" in F)?F.dateTimeFormat:null;
       
  4096 var G=this._events.getUnit().getParser(D);
       
  4097 for(var E=0;
       
  4098 E<F.events.length;
       
  4099 E++){var A=F.events[E];
       
  4100 var J=new Timeline.DefaultEventSource.Event({id:("id" in A)?A.id:undefined,start:G(A.start),end:G(A.end),latestStart:G(A.latestStart),earliestEnd:G(A.earliestEnd),instant:A.isDuration||false,text:A.title,description:A.description,image:this._resolveRelativeURL(A.image,C),link:this._resolveRelativeURL(A.link,C),icon:this._resolveRelativeURL(A.icon,C),color:A.color,textColor:A.textColor,hoverText:A.hoverText,classname:A.classname,tapeImage:A.tapeImage,tapeRepeat:A.tapeRepeat,caption:A.caption,eventID:A.eventID});
       
  4101 J._obj=A;
       
  4102 J.getProperty=function(L){return this._obj[L];
       
  4103 };
       
  4104 J.setWikiInfo(H,K);
       
  4105 this._events.add(J);
       
  4106 I=true;
       
  4107 }}if(I){this._fire("onAddMany",[]);
       
  4108 }};
       
  4109 Timeline.DefaultEventSource.prototype.loadSPARQL=function(G,A){var C=this._getBaseURL(A);
       
  4110 var E="iso8601";
       
  4111 var F=this._events.getUnit().getParser(E);
       
  4112 if(G==null){return ;
       
  4113 }var D=G.documentElement.firstChild;
       
  4114 while(D!=null&&(D.nodeType!=1||D.nodeName!="results")){D=D.nextSibling;
       
  4115 }var I=null;
       
  4116 var L=null;
       
  4117 if(D!=null){I=D.getAttribute("wiki-url");
       
  4118 L=D.getAttribute("wiki-section");
       
  4119 D=D.firstChild;
       
  4120 }var J=false;
       
  4121 while(D!=null){if(D.nodeType==1){var B={};
       
  4122 var H=D.firstChild;
       
  4123 while(H!=null){if(H.nodeType==1&&H.firstChild!=null&&H.firstChild.nodeType==1&&H.firstChild.firstChild!=null&&H.firstChild.firstChild.nodeType==3){B[H.getAttribute("name")]=H.firstChild.firstChild.nodeValue;
       
  4124 }H=H.nextSibling;
       
  4125 }if(B["start"]==null&&B["date"]!=null){B["start"]=B["date"];
       
  4126 }var K=new Timeline.DefaultEventSource.Event({id:B["id"],start:F(B["start"]),end:F(B["end"]),latestStart:F(B["latestStart"]),earliestEnd:F(B["earliestEnd"]),instant:B["isDuration"]!="true",text:B["title"],description:B["description"],image:this._resolveRelativeURL(B["image"],C),link:this._resolveRelativeURL(B["link"],C),icon:this._resolveRelativeURL(B["icon"],C),color:B["color"],textColor:B["textColor"],hoverText:B["hoverText"],caption:B["caption"],classname:B["classname"],tapeImage:B["tapeImage"],tapeRepeat:B["tapeRepeat"],eventID:B["eventID"]});
       
  4127 K._bindings=B;
       
  4128 K.getProperty=function(M){return this._bindings[M];
       
  4129 };
       
  4130 K.setWikiInfo(I,L);
       
  4131 this._events.add(K);
       
  4132 J=true;
       
  4133 }D=D.nextSibling;
       
  4134 }if(J){this._fire("onAddMany",[]);
       
  4135 }};
       
  4136 Timeline.DefaultEventSource.prototype.add=function(A){this._events.add(A);
       
  4137 this._fire("onAddOne",[A]);
       
  4138 };
       
  4139 Timeline.DefaultEventSource.prototype.addMany=function(B){for(var A=0;
       
  4140 A<B.length;
       
  4141 A++){this._events.add(B[A]);
       
  4142 }this._fire("onAddMany",[]);
       
  4143 };
       
  4144 Timeline.DefaultEventSource.prototype.clear=function(){this._events.removeAll();
       
  4145 this._fire("onClear",[]);
       
  4146 };
       
  4147 Timeline.DefaultEventSource.prototype.getEvent=function(A){return this._events.getEvent(A);
       
  4148 };
       
  4149 Timeline.DefaultEventSource.prototype.getEventIterator=function(A,B){return this._events.getIterator(A,B);
       
  4150 };
       
  4151 Timeline.DefaultEventSource.prototype.getEventReverseIterator=function(A,B){return this._events.getReverseIterator(A,B);
       
  4152 };
       
  4153 Timeline.DefaultEventSource.prototype.getAllEventIterator=function(){return this._events.getAllIterator();
       
  4154 };
       
  4155 Timeline.DefaultEventSource.prototype.getCount=function(){return this._events.getCount();
       
  4156 };
       
  4157 Timeline.DefaultEventSource.prototype.getEarliestDate=function(){return this._events.getEarliestDate();
       
  4158 };
       
  4159 Timeline.DefaultEventSource.prototype.getLatestDate=function(){return this._events.getLatestDate();
       
  4160 };
       
  4161 Timeline.DefaultEventSource.prototype._fire=function(B,A){for(var C=0;
       
  4162 C<this._listeners.length;
       
  4163 C++){var D=this._listeners[C];
       
  4164 if(B in D){try{D[B].apply(D,A);
       
  4165 }catch(E){SimileAjax.Debug.exception(E);
       
  4166 }}}};
       
  4167 Timeline.DefaultEventSource.prototype._getBaseURL=function(A){if(A.indexOf("://")<0){var C=this._getBaseURL(document.location.href);
       
  4168 if(A.substr(0,1)=="/"){A=C.substr(0,C.indexOf("/",C.indexOf("://")+3))+A;
       
  4169 }else{A=C+A;
       
  4170 }}var B=A.lastIndexOf("/");
       
  4171 if(B<0){return"";
       
  4172 }else{return A.substr(0,B+1);
       
  4173 }};
       
  4174 Timeline.DefaultEventSource.prototype._resolveRelativeURL=function(A,B){if(A==null||A==""){return A;
       
  4175 }else{if(A.indexOf("://")>0){return A;
       
  4176 }else{if(A.substr(0,1)=="/"){return B.substr(0,B.indexOf("/",B.indexOf("://")+3))+A;
       
  4177 }else{return B+A;
       
  4178 }}}};
       
  4179 Timeline.DefaultEventSource.Event=function(A){function C(D){return(A[D]!=null&&A[D]!="")?A[D]:null;
       
  4180 }var B=(A.id)?A.id.trim():"";
       
  4181 this._id=B.length>0?B:("e"+Math.floor(Math.random()*1000000));
       
  4182 this._instant=A.instant||(A.end==null);
       
  4183 this._start=A.start;
       
  4184 this._end=(A.end!=null)?A.end:A.start;
       
  4185 this._latestStart=(A.latestStart!=null)?A.latestStart:(A.instant?this._end:this._start);
       
  4186 this._earliestEnd=(A.earliestEnd!=null)?A.earliestEnd:(A.instant?this._start:this._end);
       
  4187 this._eventID=C("eventID");
       
  4188 this._text=(A.text!=null)?SimileAjax.HTML.deEntify(A.text):"";
       
  4189 this._description=SimileAjax.HTML.deEntify(A.description);
       
  4190 this._image=C("image");
       
  4191 this._link=C("link");
       
  4192 this._title=C("hoverText");
       
  4193 this._title=C("caption");
       
  4194 this._icon=C("icon");
       
  4195 this._color=C("color");
       
  4196 this._textColor=C("textColor");
       
  4197 this._classname=C("classname");
       
  4198 this._tapeImage=C("tapeImage");
       
  4199 this._tapeRepeat=C("tapeRepeat");
       
  4200 this._wikiURL=null;
       
  4201 this._wikiSection=null;
       
  4202 };
       
  4203 Timeline.DefaultEventSource.Event.prototype={getID:function(){return this._id;
       
  4204 },isInstant:function(){return this._instant;
       
  4205 },isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd;
       
  4206 },getStart:function(){return this._start;
       
  4207 },getEnd:function(){return this._end;
       
  4208 },getLatestStart:function(){return this._latestStart;
       
  4209 },getEarliestEnd:function(){return this._earliestEnd;
       
  4210 },getEventID:function(){return this._eventID;
       
  4211 },getText:function(){return this._text;
       
  4212 },getDescription:function(){return this._description;
       
  4213 },getImage:function(){return this._image;
       
  4214 },getLink:function(){return this._link;
       
  4215 },getIcon:function(){return this._icon;
       
  4216 },getColor:function(){return this._color;
       
  4217 },getTextColor:function(){return this._textColor;
       
  4218 },getClassName:function(){return this._classname;
       
  4219 },getTapeImage:function(){return this._tapeImage;
       
  4220 },getTapeRepeat:function(){return this._tapeRepeat;
       
  4221 },getProperty:function(A){return null;
       
  4222 },getWikiURL:function(){return this._wikiURL;
       
  4223 },getWikiSection:function(){return this._wikiSection;
       
  4224 },setWikiInfo:function(B,A){this._wikiURL=B;
       
  4225 this._wikiSection=A;
       
  4226 },fillDescription:function(A){A.innerHTML=this._description;
       
  4227 },fillWikiInfo:function(D){D.style.display="none";
       
  4228 if(this._wikiURL==null||this._wikiSection==null){return ;
       
  4229 }var C=this.getProperty("wikiID");
       
  4230 if(C==null||C.length==0){C=this.getText();
       
  4231 }if(C==null||C.length==0){return ;
       
  4232 }D.style.display="inline";
       
  4233 C=C.replace(/\s/g,"_");
       
  4234 var B=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+C;
       
  4235 var A=document.createElement("a");
       
  4236 A.href=B;
       
  4237 A.target="new";
       
  4238 A.innerHTML=Timeline.strings[Timeline.clientLocale].wikiLinkLabel;
       
  4239 D.appendChild(document.createTextNode("["));
       
  4240 D.appendChild(A);
       
  4241 D.appendChild(document.createTextNode("]"));
       
  4242 },fillTime:function(A,B){if(this._instant){if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)));
       
  4243 A.appendChild(A.ownerDocument.createElement("br"));
       
  4244 A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end)));
       
  4245 }else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)));
       
  4246 }}else{if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)+" ~ "+B.labelPrecise(this._latestStart)));
       
  4247 A.appendChild(A.ownerDocument.createElement("br"));
       
  4248 A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._earliestEnd)+" ~ "+B.labelPrecise(this._end)));
       
  4249 }else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)));
       
  4250 A.appendChild(A.ownerDocument.createElement("br"));
       
  4251 A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end)));
       
  4252 }}},fillInfoBubble:function(A,D,K){var L=A.ownerDocument;
       
  4253 var J=this.getText();
       
  4254 var H=this.getLink();
       
  4255 var C=this.getImage();
       
  4256 if(C!=null){var E=L.createElement("img");
       
  4257 E.src=C;
       
  4258 D.event.bubble.imageStyler(E);
       
  4259 A.appendChild(E);
       
  4260 }var M=L.createElement("div");
       
  4261 var B=L.createTextNode(J);
       
  4262 if(H!=null){var I=L.createElement("a");
       
  4263 I.href=H;
       
  4264 I.appendChild(B);
       
  4265 M.appendChild(I);
       
  4266 }else{M.appendChild(B);
       
  4267 }D.event.bubble.titleStyler(M);
       
  4268 A.appendChild(M);
       
  4269 var N=L.createElement("div");
       
  4270 this.fillDescription(N);
       
  4271 D.event.bubble.bodyStyler(N);
       
  4272 A.appendChild(N);
       
  4273 var G=L.createElement("div");
       
  4274 this.fillTime(G,K);
       
  4275 D.event.bubble.timeStyler(G);
       
  4276 A.appendChild(G);
       
  4277 var F=L.createElement("div");
       
  4278 this.fillWikiInfo(F);
       
  4279 D.event.bubble.wikiStyler(F);
       
  4280 A.appendChild(F);
       
  4281 }};
       
  4282 
       
  4283 
       
  4284 /* themes.js */
       
  4285 Timeline.ClassicTheme=new Object();
       
  4286 Timeline.ClassicTheme.implementations=[];
       
  4287 Timeline.ClassicTheme.create=function(A){if(A==null){A=Timeline.getDefaultLocale();
       
  4288 }var B=Timeline.ClassicTheme.implementations[A];
       
  4289 if(B==null){B=Timeline.ClassicTheme._Impl;
       
  4290 }return new B();
       
  4291 };
       
  4292 Timeline.ClassicTheme._Impl=function(){this.firstDayOfWeek=0;
       
  4293 this.ether={backgroundColors:[],highlightOpacity:50,interval:{line:{show:true,opacity:25},weekend:{opacity:30},marker:{hAlign:"Bottom",vAlign:"Right"}}};
       
  4294 this.event={track:{height:10,gap:2},overviewTrack:{offset:20,tickHeight:6,height:2,gap:1},tape:{height:4},instant:{icon:Timeline.urlPrefix+"data/timeline/dull-blue-circle.png",iconWidth:10,iconHeight:10,impreciseOpacity:20},duration:{impreciseOpacity:20},label:{backgroundOpacity:50,offsetFromLine:3},highlightColors:[],bubble:{width:250,height:125,titleStyler:function(A){A.className="timeline-event-bubble-title";
       
  4295 },bodyStyler:function(A){A.className="timeline-event-bubble-body";
       
  4296 },imageStyler:function(A){A.className="timeline-event-bubble-image";
       
  4297 },wikiStyler:function(A){A.className="timeline-event-bubble-wiki";
       
  4298 },timeStyler:function(A){A.className="timeline-event-bubble-time";
       
  4299 }}};
       
  4300 this.mouseWheel="scroll";
       
  4301 };
       
  4302 
       
  4303 
       
  4304 /* timeline.js */
       
  4305 Timeline.strings={};
       
  4306 Timeline.getDefaultLocale=function(){return Timeline.clientLocale;
       
  4307 };
       
  4308 Timeline.create=function(C,B,A,D){return new Timeline._Impl(C,B,A,D);
       
  4309 };
       
  4310 Timeline.HORIZONTAL=0;
       
  4311 Timeline.VERTICAL=1;
       
  4312 Timeline._defaultTheme=null;
       
  4313 Timeline.createBandInfo=function(D){var E=("theme" in D)?D.theme:Timeline.getDefaultTheme();
       
  4314 var B=("eventSource" in D)?D.eventSource:null;
       
  4315 var F={interval:SimileAjax.DateTime.gregorianUnitLengths[D.intervalUnit],pixelsPerInterval:D.intervalPixels};
       
  4316 if("startsOn" in D||"endsOn" in D){if("startsOn" in D){F.startsOn=D.startsOn;
       
  4317 }if("endsOn" in D){F.endsOn=D.endsOn;
       
  4318 }}else{if("date" in D){F.centersOn=D.date;
       
  4319 }else{F.centersOn=new Date();
       
  4320 }}var G=new Timeline.LinearEther(F);
       
  4321 var H=new Timeline.GregorianEtherPainter({unit:D.intervalUnit,multiple:("multiple" in D)?D.multiple:1,theme:E,align:("align" in D)?D.align:undefined});
       
  4322 var J={showText:("showEventText" in D)?D.showEventText:true,theme:E};
       
  4323 if("eventPainterParams" in D){for(var A in D.eventPainterParams){J[A]=D.eventPainterParams[A];
       
  4324 }}if("trackHeight" in D){J.trackHeight=D.trackHeight;
       
  4325 }if("trackGap" in D){J.trackGap=D.trackGap;
       
  4326 }var I=("overview" in D&&D.overview)?"overview":("layout" in D?D.layout:"original");
       
  4327 var C;
       
  4328 if("eventPainter" in D){C=new D.eventPainter(J);
       
  4329 }else{switch(I){case"overview":C=new Timeline.OverviewEventPainter(J);
       
  4330 break;
       
  4331 case"detailed":C=new Timeline.DetailedEventPainter(J);
       
  4332 break;
       
  4333 default:C=new Timeline.OriginalEventPainter(J);
       
  4334 }}return{width:D.width,eventSource:B,timeZone:("timeZone" in D)?D.timeZone:0,ether:G,etherPainter:H,eventPainter:C,theme:E,zoomIndex:("zoomIndex" in D)?D.zoomIndex:0,zoomSteps:("zoomSteps" in D)?D.zoomSteps:null};
       
  4335 };
       
  4336 Timeline.createHotZoneBandInfo=function(D){var E=("theme" in D)?D.theme:Timeline.getDefaultTheme();
       
  4337 var B=("eventSource" in D)?D.eventSource:null;
       
  4338 var F=new Timeline.HotZoneEther({centersOn:("date" in D)?D.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[D.intervalUnit],pixelsPerInterval:D.intervalPixels,zones:D.zones,theme:E});
       
  4339 var G=new Timeline.HotZoneGregorianEtherPainter({unit:D.intervalUnit,zones:D.zones,theme:E,align:("align" in D)?D.align:undefined});
       
  4340 var I={showText:("showEventText" in D)?D.showEventText:true,theme:E};
       
  4341 if("eventPainterParams" in D){for(var A in D.eventPainterParams){I[A]=D.eventPainterParams[A];
       
  4342 }}if("trackHeight" in D){I.trackHeight=D.trackHeight;
       
  4343 }if("trackGap" in D){I.trackGap=D.trackGap;
       
  4344 }var H=("overview" in D&&D.overview)?"overview":("layout" in D?D.layout:"original");
       
  4345 var C;
       
  4346 if("eventPainter" in D){C=new D.eventPainter(I);
       
  4347 }else{switch(H){case"overview":C=new Timeline.OverviewEventPainter(I);
       
  4348 break;
       
  4349 case"detailed":C=new Timeline.DetailedEventPainter(I);
       
  4350 break;
       
  4351 default:C=new Timeline.OriginalEventPainter(I);
       
  4352 }}return{width:D.width,eventSource:B,timeZone:("timeZone" in D)?D.timeZone:0,ether:F,etherPainter:G,eventPainter:C,theme:E,zoomIndex:("zoomIndex" in D)?D.zoomIndex:0,zoomSteps:("zoomSteps" in D)?D.zoomSteps:null};
       
  4353 };
       
  4354 Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.getDefaultLocale());
       
  4355 }return Timeline._defaultTheme;
       
  4356 };
       
  4357 Timeline.setDefaultTheme=function(A){Timeline._defaultTheme=A;
       
  4358 };
       
  4359 Timeline.loadXML=function(A,C){var D=function(G,E,F){alert("Failed to load data xml from "+A+"\n"+G);
       
  4360 };
       
  4361 var B=function(F){var E=F.responseXML;
       
  4362 if(!E.documentElement&&F.responseStream){E.load(F.responseStream);
       
  4363 }C(E,A);
       
  4364 };
       
  4365 SimileAjax.XmlHttp.get(A,D,B);
       
  4366 };
       
  4367 Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);
       
  4368 };
       
  4369 var fDone=function(xmlhttp){f(eval("("+xmlhttp.responseText+")"),url);
       
  4370 };
       
  4371 SimileAjax.XmlHttp.get(url,fError,fDone);
       
  4372 };
       
  4373 Timeline._Impl=function(C,B,A,D){SimileAjax.WindowManager.initialize();
       
  4374 this._containerDiv=C;
       
  4375 this._bandInfos=B;
       
  4376 this._orientation=A==null?Timeline.HORIZONTAL:A;
       
  4377 this._unit=(D!=null)?D:SimileAjax.NativeDateUnit;
       
  4378 this._initialize();
       
  4379 };
       
  4380 Timeline._Impl.prototype.dispose=function(){for(var A=0;
       
  4381 A<this._bands.length;
       
  4382 A++){this._bands[A].dispose();
       
  4383 }this._bands=null;
       
  4384 this._bandInfos=null;
       
  4385 this._containerDiv.innerHTML="";
       
  4386 };
       
  4387 Timeline._Impl.prototype.getBandCount=function(){return this._bands.length;
       
  4388 };
       
  4389 Timeline._Impl.prototype.getBand=function(A){return this._bands[A];
       
  4390 };
       
  4391 Timeline._Impl.prototype.layout=function(){this._distributeWidths();
       
  4392 };
       
  4393 Timeline._Impl.prototype.paint=function(){for(var A=0;
       
  4394 A<this._bands.length;
       
  4395 A++){this._bands[A].paint();
       
  4396 }};
       
  4397 Timeline._Impl.prototype.getDocument=function(){return this._containerDiv.ownerDocument;
       
  4398 };
       
  4399 Timeline._Impl.prototype.addDiv=function(A){this._containerDiv.appendChild(A);
       
  4400 };
       
  4401 Timeline._Impl.prototype.removeDiv=function(A){this._containerDiv.removeChild(A);
       
  4402 };
       
  4403 Timeline._Impl.prototype.isHorizontal=function(){return this._orientation==Timeline.HORIZONTAL;
       
  4404 };
       
  4405 Timeline._Impl.prototype.isVertical=function(){return this._orientation==Timeline.VERTICAL;
       
  4406 };
       
  4407 Timeline._Impl.prototype.getPixelLength=function(){return this._orientation==Timeline.HORIZONTAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight;
       
  4408 };
       
  4409 Timeline._Impl.prototype.getPixelWidth=function(){return this._orientation==Timeline.VERTICAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight;
       
  4410 };
       
  4411 Timeline._Impl.prototype.getUnit=function(){return this._unit;
       
  4412 };
       
  4413 Timeline._Impl.prototype.loadXML=function(B,D){var A=this;
       
  4414 var E=function(H,F,G){alert("Failed to load data xml from "+B+"\n"+H);
       
  4415 A.hideLoadingMessage();
       
  4416 };
       
  4417 var C=function(G){try{var F=G.responseXML;
       
  4418 if(!F.documentElement&&G.responseStream){F.load(G.responseStream);
       
  4419 }D(F,B);
       
  4420 }finally{A.hideLoadingMessage();
       
  4421 }};
       
  4422 this.showLoadingMessage();
       
  4423 window.setTimeout(function(){SimileAjax.XmlHttp.get(B,E,C);
       
  4424 },0);
       
  4425 };
       
  4426 Timeline._Impl.prototype.loadJSON=function(url,f){var tl=this;
       
  4427 var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);
       
  4428 tl.hideLoadingMessage();
       
  4429 };
       
  4430 var fDone=function(xmlhttp){try{f(eval("("+xmlhttp.responseText+")"),url);
       
  4431 }finally{tl.hideLoadingMessage();
       
  4432 }};
       
  4433 this.showLoadingMessage();
       
  4434 window.setTimeout(function(){SimileAjax.XmlHttp.get(url,fError,fDone);
       
  4435 },0);
       
  4436 };
       
  4437 Timeline._Impl.prototype._initialize=function(){var E=this._containerDiv;
       
  4438 var G=E.ownerDocument;
       
  4439 E.className=E.className.split(" ").concat("timeline-container").join(" ");
       
  4440 var A=(this.isHorizontal())?"horizontal":"vertical";
       
  4441 E.className+=" timeline-"+A;
       
  4442 while(E.firstChild){E.removeChild(E.firstChild);
       
  4443 }var B=SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix+(this.isHorizontal()?"data/timeline/copyright-vertical.png":"data/timeline/copyright.png"));
       
  4444 B.className="timeline-copyright";
       
  4445 B.title="Timeline (c) SIMILE - http://simile.mit.edu/timeline/";
       
  4446 SimileAjax.DOM.registerEvent(B,"click",function(){window.location="http://simile.mit.edu/timeline/";
       
  4447 });
       
  4448 E.appendChild(B);
       
  4449 this._bands=[];
       
  4450 for(var C=0;
       
  4451 C<this._bandInfos.length;
       
  4452 C++){var F=this._bandInfos[C];
       
  4453 var D=F.bandClass||Timeline._Band;
       
  4454 var H=new D(this,F,C);
       
  4455 this._bands.push(H);
       
  4456 }this._distributeWidths();
       
  4457 for(var C=0;
       
  4458 C<this._bandInfos.length;
       
  4459 C++){var F=this._bandInfos[C];
       
  4460 if("syncWith" in F){this._bands[C].setSyncWithBand(this._bands[F.syncWith],("highlight" in F)?F.highlight:false);
       
  4461 }}var I=SimileAjax.Graphics.createMessageBubble(G);
       
  4462 I.containerDiv.className="timeline-message-container";
       
  4463 E.appendChild(I.containerDiv);
       
  4464 I.contentDiv.className="timeline-message";
       
  4465 I.contentDiv.innerHTML="<img src='"+Timeline.urlPrefix+"data/timeline/progress-running.gif' /> Loading...";
       
  4466 this.showLoadingMessage=function(){I.containerDiv.style.display="block";
       
  4467 };
       
  4468 this.hideLoadingMessage=function(){I.containerDiv.style.display="none";
       
  4469 };
       
  4470 };
       
  4471 Timeline._Impl.prototype._distributeWidths=function(){var B=this.getPixelLength();
       
  4472 var A=this.getPixelWidth();
       
  4473 var D=0;
       
  4474 for(var E=0;
       
  4475 E<this._bands.length;
       
  4476 E++){var I=this._bands[E];
       
  4477 var J=this._bandInfos[E];
       
  4478 var F=J.width;
       
  4479 var H=F.indexOf("%");
       
  4480 if(H>0){var G=parseInt(F.substr(0,H));
       
  4481 var C=G*A/100;
       
  4482 }else{var C=parseInt(F);
       
  4483 }I.setBandShiftAndWidth(D,C);
       
  4484 I.setViewLength(B);
       
  4485 D+=C;
       
  4486 }};
       
  4487 Timeline._Impl.prototype.zoom=function(G,B,F,D){var C=new RegExp("^timeline-band-([0-9]+)$");
       
  4488 var E=null;
       
  4489 var A=C.exec(D.id);
       
  4490 if(A){E=parseInt(A[1]);
       
  4491 }if(E!=null){this._bands[E].zoom(G,B,F,D);
       
  4492 }this.paint();
       
  4493 };
       
  4494 Timeline._Band=function(B,C,A){if(B!==undefined){this.initialize(B,C,A);
       
  4495 }};
       
  4496 Timeline._Band.prototype.initialize=function(F,G,B){this._timeline=F;
       
  4497 this._bandInfo=G;
       
  4498 this._index=B;
       
  4499 this._locale=("locale" in G)?G.locale:Timeline.getDefaultLocale();
       
  4500 this._timeZone=("timeZone" in G)?G.timeZone:0;
       
  4501 this._labeller=("labeller" in G)?G.labeller:(("createLabeller" in F.getUnit())?F.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone));
       
  4502 this._theme=G.theme;
       
  4503 this._zoomIndex=("zoomIndex" in G)?G.zoomIndex:0;
       
  4504 this._zoomSteps=("zoomSteps" in G)?G.zoomSteps:null;
       
  4505 this._dragging=false;
       
  4506 this._changing=false;
       
  4507 this._originalScrollSpeed=5;
       
  4508 this._scrollSpeed=this._originalScrollSpeed;
       
  4509 this._onScrollListeners=[];
       
  4510 var A=this;
       
  4511 this._syncWithBand=null;
       
  4512 this._syncWithBandHandler=function(H){A._onHighlightBandScroll();
       
  4513 };
       
  4514 this._selectorListener=function(H){A._onHighlightBandScroll();
       
  4515 };
       
  4516 var D=this._timeline.getDocument().createElement("div");
       
  4517 D.className="timeline-band-input";
       
  4518 this._timeline.addDiv(D);
       
  4519 this._keyboardInput=document.createElement("input");
       
  4520 this._keyboardInput.type="text";
       
  4521 D.appendChild(this._keyboardInput);
       
  4522 SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,"_onKeyDown");
       
  4523 SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,"_onKeyUp");
       
  4524 this._div=this._timeline.getDocument().createElement("div");
       
  4525 this._div.id="timeline-band-"+B;
       
  4526 this._div.className="timeline-band timeline-band-"+B;
       
  4527 this._timeline.addDiv(this._div);
       
  4528 SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown");
       
  4529 SimileAjax.DOM.registerEventWithObject(this._div,"mousemove",this,"_onMouseMove");
       
  4530 SimileAjax.DOM.registerEventWithObject(this._div,"mouseup",this,"_onMouseUp");
       
  4531 SimileAjax.DOM.registerEventWithObject(this._div,"mouseout",this,"_onMouseOut");
       
  4532 SimileAjax.DOM.registerEventWithObject(this._div,"dblclick",this,"_onDblClick");
       
  4533 var E=this._theme!=null?this._theme.mouseWheel:"scroll";
       
  4534 if(E==="zoom"||E==="scroll"||this._zoomSteps){if(SimileAjax.Platform.browser.isFirefox){SimileAjax.DOM.registerEventWithObject(this._div,"DOMMouseScroll",this,"_onMouseScroll");
       
  4535 }else{SimileAjax.DOM.registerEventWithObject(this._div,"mousewheel",this,"_onMouseScroll");
       
  4536 }}this._innerDiv=this._timeline.getDocument().createElement("div");
       
  4537 this._innerDiv.className="timeline-band-inner";
       
  4538 this._div.appendChild(this._innerDiv);
       
  4539 this._ether=G.ether;
       
  4540 G.ether.initialize(this,F);
       
  4541 this._etherPainter=G.etherPainter;
       
  4542 G.etherPainter.initialize(this,F);
       
  4543 this._eventSource=G.eventSource;
       
  4544 if(this._eventSource){this._eventListener={onAddMany:function(){A._onAddMany();
       
  4545 },onClear:function(){A._onClear();
       
  4546 }};
       
  4547 this._eventSource.addListener(this._eventListener);
       
  4548 }this._eventPainter=G.eventPainter;
       
  4549 G.eventPainter.initialize(this,F);
       
  4550 this._decorators=("decorators" in G)?G.decorators:[];
       
  4551 for(var C=0;
       
  4552 C<this._decorators.length;
       
  4553 C++){this._decorators[C].initialize(this,F);
       
  4554 }};
       
  4555 Timeline._Band.SCROLL_MULTIPLES=5;
       
  4556 Timeline._Band.prototype.dispose=function(){this.closeBubble();
       
  4557 if(this._eventSource){this._eventSource.removeListener(this._eventListener);
       
  4558 this._eventListener=null;
       
  4559 this._eventSource=null;
       
  4560 }this._timeline=null;
       
  4561 this._bandInfo=null;
       
  4562 this._labeller=null;
       
  4563 this._ether=null;
       
  4564 this._etherPainter=null;
       
  4565 this._eventPainter=null;
       
  4566 this._decorators=null;
       
  4567 this._onScrollListeners=null;
       
  4568 this._syncWithBandHandler=null;
       
  4569 this._selectorListener=null;
       
  4570 this._div=null;
       
  4571 this._innerDiv=null;
       
  4572 this._keyboardInput=null;
       
  4573 };
       
  4574 Timeline._Band.prototype.addOnScrollListener=function(A){this._onScrollListeners.push(A);
       
  4575 };
       
  4576 Timeline._Band.prototype.removeOnScrollListener=function(B){for(var A=0;
       
  4577 A<this._onScrollListeners.length;
       
  4578 A++){if(this._onScrollListeners[A]==B){this._onScrollListeners.splice(A,1);
       
  4579 break;
       
  4580 }}};
       
  4581 Timeline._Band.prototype.setSyncWithBand=function(B,A){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler);
       
  4582 }this._syncWithBand=B;
       
  4583 this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);
       
  4584 this._highlight=A;
       
  4585 this._positionHighlight();
       
  4586 };
       
  4587 Timeline._Band.prototype.getLocale=function(){return this._locale;
       
  4588 };
       
  4589 Timeline._Band.prototype.getTimeZone=function(){return this._timeZone;
       
  4590 };
       
  4591 Timeline._Band.prototype.getLabeller=function(){return this._labeller;
       
  4592 };
       
  4593 Timeline._Band.prototype.getIndex=function(){return this._index;
       
  4594 };
       
  4595 Timeline._Band.prototype.getEther=function(){return this._ether;
       
  4596 };
       
  4597 Timeline._Band.prototype.getEtherPainter=function(){return this._etherPainter;
       
  4598 };
       
  4599 Timeline._Band.prototype.getEventSource=function(){return this._eventSource;
       
  4600 };
       
  4601 Timeline._Band.prototype.getEventPainter=function(){return this._eventPainter;
       
  4602 };
       
  4603 Timeline._Band.prototype.layout=function(){this.paint();
       
  4604 };
       
  4605 Timeline._Band.prototype.paint=function(){this._etherPainter.paint();
       
  4606 this._paintDecorators();
       
  4607 this._paintEvents();
       
  4608 };
       
  4609 Timeline._Band.prototype.softLayout=function(){this.softPaint();
       
  4610 };
       
  4611 Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint();
       
  4612 this._softPaintDecorators();
       
  4613 this._softPaintEvents();
       
  4614 };
       
  4615 Timeline._Band.prototype.setBandShiftAndWidth=function(A,D){var C=this._keyboardInput.parentNode;
       
  4616 var B=A+Math.floor(D/2);
       
  4617 if(this._timeline.isHorizontal()){this._div.style.top=A+"px";
       
  4618 this._div.style.height=D+"px";
       
  4619 C.style.top=B+"px";
       
  4620 C.style.left="-1em";
       
  4621 }else{this._div.style.left=A+"px";
       
  4622 this._div.style.width=D+"px";
       
  4623 C.style.left=B+"px";
       
  4624 C.style.top="-1em";
       
  4625 }};
       
  4626 Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetHeight;
       
  4627 }else{return this._div.offsetWidth;
       
  4628 }};
       
  4629 Timeline._Band.prototype.setViewLength=function(A){this._viewLength=A;
       
  4630 this._recenterDiv();
       
  4631 this._onChanging();
       
  4632 };
       
  4633 Timeline._Band.prototype.getViewLength=function(){return this._viewLength;
       
  4634 };
       
  4635 Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength;
       
  4636 };
       
  4637 Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset;
       
  4638 };
       
  4639 Timeline._Band.prototype.getMinDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset);
       
  4640 };
       
  4641 Timeline._Band.prototype.getMaxDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset+Timeline._Band.SCROLL_MULTIPLES*this._viewLength);
       
  4642 };
       
  4643 Timeline._Band.prototype.getMinVisibleDate=function(){return this._ether.pixelOffsetToDate(0);
       
  4644 };
       
  4645 Timeline._Band.prototype.getMaxVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength);
       
  4646 };
       
  4647 Timeline._Band.prototype.getCenterVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength/2);
       
  4648 };
       
  4649 Timeline._Band.prototype.setMinVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(A)));
       
  4650 }};
       
  4651 Timeline._Band.prototype.setMaxVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(A)));
       
  4652 }};
       
  4653 Timeline._Band.prototype.setCenterVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(A)));
       
  4654 }};
       
  4655 Timeline._Band.prototype.dateToPixelOffset=function(A){return this._ether.dateToPixelOffset(A)-this._viewOffset;
       
  4656 };
       
  4657 Timeline._Band.prototype.pixelOffsetToDate=function(A){return this._ether.pixelOffsetToDate(A+this._viewOffset);
       
  4658 };
       
  4659 Timeline._Band.prototype.createLayerDiv=function(D,B){var C=this._timeline.getDocument().createElement("div");
       
  4660 C.className="timeline-band-layer"+(typeof B=="string"?(" "+B):"");
       
  4661 C.style.zIndex=D;
       
  4662 this._innerDiv.appendChild(C);
       
  4663 var A=this._timeline.getDocument().createElement("div");
       
  4664 A.className="timeline-band-layer-inner";
       
  4665 if(SimileAjax.Platform.browser.isIE){A.style.cursor="move";
       
  4666 }else{A.style.cursor="-moz-grab";
       
  4667 }C.appendChild(A);
       
  4668 return A;
       
  4669 };
       
  4670 Timeline._Band.prototype.removeLayerDiv=function(A){this._innerDiv.removeChild(A.parentNode);
       
  4671 };
       
  4672 Timeline._Band.prototype.scrollToCenter=function(B,C){var A=this._ether.dateToPixelOffset(B);
       
  4673 if(A<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(A+this._viewLength));
       
  4674 }else{if(A>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(A-this._viewLength));
       
  4675 }}this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(B)),C);
       
  4676 };
       
  4677 Timeline._Band.prototype.showBubbleForEvent=function(C){var A=this.getEventSource().getEvent(C);
       
  4678 if(A){var B=this;
       
  4679 this.scrollToCenter(A.getStart(),function(){B._eventPainter.showBubble(A);
       
  4680 });
       
  4681 }};
       
  4682 Timeline._Band.prototype.zoom=function(F,A,E,C){if(!this._zoomSteps){return ;
       
  4683 }A+=this._viewOffset;
       
  4684 var D=this._ether.pixelOffsetToDate(A);
       
  4685 var B=this._ether.zoom(F);
       
  4686 this._etherPainter.zoom(B);
       
  4687 this._moveEther(Math.round(-this._ether.dateToPixelOffset(D)));
       
  4688 this._moveEther(A);
       
  4689 };
       
  4690 Timeline._Band.prototype._onMouseDown=function(B,A,C){this.closeBubble();
       
  4691 this._dragging=true;
       
  4692 this._dragX=A.clientX;
       
  4693 this._dragY=A.clientY;
       
  4694 };
       
  4695 Timeline._Band.prototype._onMouseMove=function(D,A,E){if(this._dragging){var C=A.clientX-this._dragX;
       
  4696 var B=A.clientY-this._dragY;
       
  4697 this._dragX=A.clientX;
       
  4698 this._dragY=A.clientY;
       
  4699 this._moveEther(this._timeline.isHorizontal()?C:B);
       
  4700 this._positionHighlight();
       
  4701 }};
       
  4702 Timeline._Band.prototype._onMouseUp=function(B,A,C){this._dragging=false;
       
  4703 this._keyboardInput.focus();
       
  4704 };
       
  4705 Timeline._Band.prototype._onMouseOut=function(B,A,D){var C=SimileAjax.DOM.getEventRelativeCoordinates(A,B);
       
  4706 C.x+=this._viewOffset;
       
  4707 if(C.x<0||C.x>B.offsetWidth||C.y<0||C.y>B.offsetHeight){this._dragging=false;
       
  4708 }};
       
  4709 Timeline._Band.prototype._onMouseScroll=function(G,I,E){var A=new Date();
       
  4710 A=A.getTime();
       
  4711 if(!this._lastScrollTime||((A-this._lastScrollTime)>50)){this._lastScrollTime=A;
       
  4712 var H=0;
       
  4713 if(I.wheelDelta){H=I.wheelDelta/120;
       
  4714 }else{if(I.detail){H=-I.detail/3;
       
  4715 }}var F=this._theme.mouseWheel;
       
  4716 if(this._zoomSteps||F==="zoom"){var D=SimileAjax.DOM.getEventRelativeCoordinates(I,G);
       
  4717 if(H!=0){var C;
       
  4718 if(H>0){C=true;
       
  4719 }if(H<0){C=false;
       
  4720 }this._timeline.zoom(C,D.x,D.y,G);
       
  4721 }}else{if(F==="scroll"){var B=50*(H<0?-1:1);
       
  4722 this._moveEther(B);
       
  4723 }}}if(I.stopPropagation){I.stopPropagation();
       
  4724 }I.cancelBubble=true;
       
  4725 if(I.preventDefault){I.preventDefault();
       
  4726 }I.returnValue=false;
       
  4727 };
       
  4728 Timeline._Band.prototype._onDblClick=function(B,A,D){var C=SimileAjax.DOM.getEventRelativeCoordinates(A,B);
       
  4729 var E=C.x-(this._viewLength/2-this._viewOffset);
       
  4730 this._autoScroll(-E);
       
  4731 };
       
  4732 Timeline._Band.prototype._onKeyDown=function(B,A,C){if(!this._dragging){switch(A.keyCode){case 27:break;
       
  4733 case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05));
       
  4734 this._moveEther(this._scrollSpeed);
       
  4735 break;
       
  4736 case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05));
       
  4737 this._moveEther(this._scrollSpeed);
       
  4738 break;
       
  4739 default:return true;
       
  4740 }this.closeBubble();
       
  4741 SimileAjax.DOM.cancelEvent(A);
       
  4742 return false;
       
  4743 }return true;
       
  4744 };
       
  4745 Timeline._Band.prototype._onKeyUp=function(B,A,C){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed;
       
  4746 switch(A.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate());
       
  4747 break;
       
  4748 case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate());
       
  4749 break;
       
  4750 case 33:this._autoScroll(this._timeline.getPixelLength());
       
  4751 break;
       
  4752 case 34:this._autoScroll(-this._timeline.getPixelLength());
       
  4753 break;
       
  4754 default:return true;
       
  4755 }this.closeBubble();
       
  4756 SimileAjax.DOM.cancelEvent(A);
       
  4757 return false;
       
  4758 }return true;
       
  4759 };
       
  4760 Timeline._Band.prototype._autoScroll=function(D,C){var A=this;
       
  4761 var B=SimileAjax.Graphics.createAnimation(function(E,F){A._moveEther(F);
       
  4762 },0,D,1000,C);
       
  4763 B.run();
       
  4764 };
       
  4765 Timeline._Band.prototype._moveEther=function(A){this.closeBubble();
       
  4766 this._viewOffset+=A;
       
  4767 this._ether.shiftPixels(-A);
       
  4768 if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";
       
  4769 }else{this._div.style.top=this._viewOffset+"px";
       
  4770 }if(this._viewOffset>-this._viewLength*0.5||this._viewOffset<-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)){this._recenterDiv();
       
  4771 }else{this.softLayout();
       
  4772 }this._onChanging();
       
  4773 };
       
  4774 Timeline._Band.prototype._onChanging=function(){this._changing=true;
       
  4775 this._fireOnScroll();
       
  4776 this._setSyncWithBandDate();
       
  4777 this._changing=false;
       
  4778 };
       
  4779 Timeline._Band.prototype._fireOnScroll=function(){for(var A=0;
       
  4780 A<this._onScrollListeners.length;
       
  4781 A++){this._onScrollListeners[A](this);
       
  4782 }};
       
  4783 Timeline._Band.prototype._setSyncWithBandDate=function(){if(this._syncWithBand){var A=this._ether.pixelOffsetToDate(this.getViewLength()/2);
       
  4784 this._syncWithBand.setCenterVisibleDate(A);
       
  4785 }};
       
  4786 Timeline._Band.prototype._onHighlightBandScroll=function(){if(this._syncWithBand){var A=this._syncWithBand.getCenterVisibleDate();
       
  4787 var B=this._ether.dateToPixelOffset(A);
       
  4788 this._moveEther(Math.round(this._viewLength/2-B));
       
  4789 if(this._highlight){this._etherPainter.setHighlight(this._syncWithBand.getMinVisibleDate(),this._syncWithBand.getMaxVisibleDate());
       
  4790 }}};
       
  4791 Timeline._Band.prototype._onAddMany=function(){this._paintEvents();
       
  4792 };
       
  4793 Timeline._Band.prototype._onClear=function(){this._paintEvents();
       
  4794 };
       
  4795 Timeline._Band.prototype._positionHighlight=function(){if(this._syncWithBand){var A=this._syncWithBand.getMinVisibleDate();
       
  4796 var B=this._syncWithBand.getMaxVisibleDate();
       
  4797 if(this._highlight){this._etherPainter.setHighlight(A,B);
       
  4798 }}};
       
  4799 Timeline._Band.prototype._recenterDiv=function(){this._viewOffset=-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1)/2;
       
  4800 if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";
       
  4801 this._div.style.width=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px";
       
  4802 }else{this._div.style.top=this._viewOffset+"px";
       
  4803 this._div.style.height=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px";
       
  4804 }this.layout();
       
  4805 };
       
  4806 Timeline._Band.prototype._paintEvents=function(){this._eventPainter.paint();
       
  4807 };
       
  4808 Timeline._Band.prototype._softPaintEvents=function(){this._eventPainter.softPaint();
       
  4809 };
       
  4810 Timeline._Band.prototype._paintDecorators=function(){for(var A=0;
       
  4811 A<this._decorators.length;
       
  4812 A++){this._decorators[A].paint();
       
  4813 }};
       
  4814 Timeline._Band.prototype._softPaintDecorators=function(){for(var A=0;
       
  4815 A<this._decorators.length;
       
  4816 A++){this._decorators[A].softPaint();
       
  4817 }};
       
  4818 Timeline._Band.prototype.closeBubble=function(){SimileAjax.WindowManager.cancelPopups();
       
  4819 };
       
  4820 
       
  4821 
       
  4822 /* units.js */
       
  4823 Timeline.NativeDateUnit=new Object();
       
  4824 Timeline.NativeDateUnit.createLabeller=function(A,B){return new Timeline.GregorianDateLabeller(A,B);
       
  4825 };
       
  4826 Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date();
       
  4827 };
       
  4828 Timeline.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime());
       
  4829 };
       
  4830 Timeline.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase();
       
  4831 }return(A=="iso8601"||A=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime;
       
  4832 };
       
  4833 Timeline.NativeDateUnit.parseFromObject=function(A){return Timeline.DateTime.parseGregorianDateTime(A);
       
  4834 };
       
  4835 Timeline.NativeDateUnit.toNumber=function(A){return A.getTime();
       
  4836 };
       
  4837 Timeline.NativeDateUnit.fromNumber=function(A){return new Date(A);
       
  4838 };
       
  4839 Timeline.NativeDateUnit.compare=function(D,C){var B,A;
       
  4840 if(typeof D=="object"){B=D.getTime();
       
  4841 }else{B=Number(D);
       
  4842 }if(typeof C=="object"){A=C.getTime();
       
  4843 }else{A=Number(C);
       
  4844 }return B-A;
       
  4845 };
       
  4846 Timeline.NativeDateUnit.earlier=function(B,A){return Timeline.NativeDateUnit.compare(B,A)<0?B:A;
       
  4847 };
       
  4848 Timeline.NativeDateUnit.later=function(B,A){return Timeline.NativeDateUnit.compare(B,A)>0?B:A;
       
  4849 };
       
  4850 Timeline.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B);
       
  4851 };
       
  4852 /*==================================================
       
  4853  *  Timeline
       
  4854  *==================================================
       
  4855  */
       
  4856 
       
  4857 Timeline.strings = {}; // localization string tables
       
  4858 
       
  4859 Timeline.getDefaultLocale = function() {
       
  4860     return Timeline.clientLocale;
       
  4861 };
       
  4862 
       
  4863 Timeline.create = function(elmt, bandInfos, orientation, unit) {
       
  4864     return new Timeline._Impl(elmt, bandInfos, orientation, unit);
       
  4865 };
       
  4866 
       
  4867 Timeline.HORIZONTAL = 0;
       
  4868 Timeline.VERTICAL = 1;
       
  4869 
       
  4870 Timeline._defaultTheme = null;
       
  4871 
       
  4872 Timeline.createBandInfo = function(params) {
       
  4873     var theme = ("theme" in params) ? params.theme : Timeline.getDefaultTheme();
       
  4874 
       
  4875     var eventSource = ("eventSource" in params) ? params.eventSource : null;
       
  4876 
       
  4877     var etherParams = {
       
  4878         interval:           SimileAjax.DateTime.gregorianUnitLengths[params.intervalUnit],
       
  4879         pixelsPerInterval:  params.intervalPixels
       
  4880     };
       
  4881     if ('startsOn' in params || 'endsOn' in params) {
       
  4882       if ('startsOn' in params) {
       
  4883 	etherParams.startsOn = params.startsOn;
       
  4884       }
       
  4885       if ('endsOn' in params) {
       
  4886 	etherParams.endsOn = params.endsOn;
       
  4887       }
       
  4888     } else {
       
  4889       if ('date' in params) {
       
  4890 	etherParams.centersOn = params.date;
       
  4891       } else {
       
  4892 	etherParams.centersOn = new Date();
       
  4893       }
       
  4894     }
       
  4895     var ether = new Timeline.LinearEther(etherParams);
       
  4896 
       
  4897     var etherPainter = new Timeline.GregorianEtherPainter({
       
  4898         unit:       params.intervalUnit,
       
  4899         multiple:   ("multiple" in params) ? params.multiple : 1,
       
  4900         theme:      theme,
       
  4901         align:      ("align" in params) ? params.align : undefined
       
  4902     });
       
  4903 
       
  4904     var eventPainterParams = {
       
  4905         showText:   ("showEventText" in params) ? params.showEventText : true,
       
  4906         theme:      theme
       
  4907     };
       
  4908     // pass in custom parameters for the event painter
       
  4909     if ("eventPainterParams" in params) {
       
  4910         for (var prop in params.eventPainterParams) {
       
  4911             eventPainterParams[prop] = params.eventPainterParams[prop];
       
  4912         }
       
  4913     }
       
  4914 
       
  4915     if ("trackHeight" in params) {
       
  4916         eventPainterParams.trackHeight = params.trackHeight;
       
  4917     }
       
  4918     if ("trackGap" in params) {
       
  4919         eventPainterParams.trackGap = params.trackGap;
       
  4920     }
       
  4921 
       
  4922     var layout = ("overview" in params && params.overview) ? "overview" : ("layout" in params ? params.layout : "original");
       
  4923     var eventPainter;
       
  4924     if ("eventPainter" in params) {
       
  4925         eventPainter = new params.eventPainter(eventPainterParams);
       
  4926     } else {
       
  4927         switch (layout) {
       
  4928             case "overview" :
       
  4929                 eventPainter = new Timeline.OverviewEventPainter(eventPainterParams);
       
  4930                 break;
       
  4931             case "detailed" :
       
  4932                 eventPainter = new Timeline.DetailedEventPainter(eventPainterParams);
       
  4933                 break;
       
  4934             default:
       
  4935                 eventPainter = new Timeline.OriginalEventPainter(eventPainterParams);
       
  4936         }
       
  4937     }
       
  4938 
       
  4939     return {
       
  4940         width:          params.width,
       
  4941         eventSource:    eventSource,
       
  4942         timeZone:       ("timeZone" in params) ? params.timeZone : 0,
       
  4943         ether:          ether,
       
  4944         etherPainter:   etherPainter,
       
  4945         eventPainter:   eventPainter,
       
  4946         theme:          theme,
       
  4947         zoomIndex:      ("zoomIndex" in params) ? params.zoomIndex : 0,
       
  4948         zoomSteps:      ("zoomSteps" in params) ? params.zoomSteps : null
       
  4949     };
       
  4950 };
       
  4951 
       
  4952 Timeline.createHotZoneBandInfo = function(params) {
       
  4953     var theme = ("theme" in params) ? params.theme : Timeline.getDefaultTheme();
       
  4954 
       
  4955     var eventSource = ("eventSource" in params) ? params.eventSource : null;
       
  4956 
       
  4957     var ether = new Timeline.HotZoneEther({
       
  4958         centersOn:          ("date" in params) ? params.date : new Date(),
       
  4959         interval:           SimileAjax.DateTime.gregorianUnitLengths[params.intervalUnit],
       
  4960         pixelsPerInterval:  params.intervalPixels,
       
  4961         zones:              params.zones,
       
  4962         theme:              theme
       
  4963     });
       
  4964 
       
  4965     var etherPainter = new Timeline.HotZoneGregorianEtherPainter({
       
  4966         unit:       params.intervalUnit,
       
  4967         zones:      params.zones,
       
  4968         theme:      theme,
       
  4969         align:      ("align" in params) ? params.align : undefined
       
  4970     });
       
  4971 
       
  4972     var eventPainterParams = {
       
  4973         showText:   ("showEventText" in params) ? params.showEventText : true,
       
  4974         theme:      theme
       
  4975     };
       
  4976     // pass in custom parameters for the event painter
       
  4977     if ("eventPainterParams" in params) {
       
  4978         for (var prop in params.eventPainterParams) {
       
  4979             eventPainterParams[prop] = params.eventPainterParams[prop];
       
  4980         }
       
  4981     }
       
  4982     if ("trackHeight" in params) {
       
  4983         eventPainterParams.trackHeight = params.trackHeight;
       
  4984     }
       
  4985     if ("trackGap" in params) {
       
  4986         eventPainterParams.trackGap = params.trackGap;
       
  4987     }
       
  4988 
       
  4989     var layout = ("overview" in params && params.overview) ? "overview" : ("layout" in params ? params.layout : "original");
       
  4990     var eventPainter;
       
  4991     if ("eventPainter" in params) {
       
  4992         eventPainter = new params.eventPainter(eventPainterParams);
       
  4993     } else {
       
  4994         switch (layout) {
       
  4995             case "overview" :
       
  4996                 eventPainter = new Timeline.OverviewEventPainter(eventPainterParams);
       
  4997                 break;
       
  4998             case "detailed" :
       
  4999                 eventPainter = new Timeline.DetailedEventPainter(eventPainterParams);
       
  5000                 break;
       
  5001             default:
       
  5002                 eventPainter = new Timeline.OriginalEventPainter(eventPainterParams);
       
  5003         }
       
  5004     }
       
  5005     return {
       
  5006         width:          params.width,
       
  5007         eventSource:    eventSource,
       
  5008         timeZone:       ("timeZone" in params) ? params.timeZone : 0,
       
  5009         ether:          ether,
       
  5010         etherPainter:   etherPainter,
       
  5011         eventPainter:   eventPainter,
       
  5012         theme:          theme,
       
  5013         zoomIndex:      ("zoomIndex" in params) ? params.zoomIndex : 0,
       
  5014         zoomSteps:      ("zoomSteps" in params) ? params.zoomSteps : null
       
  5015     };
       
  5016 };
       
  5017 
       
  5018 Timeline.getDefaultTheme = function() {
       
  5019     if (Timeline._defaultTheme == null) {
       
  5020         Timeline._defaultTheme = Timeline.ClassicTheme.create(Timeline.getDefaultLocale());
       
  5021     }
       
  5022     return Timeline._defaultTheme;
       
  5023 };
       
  5024 
       
  5025 Timeline.setDefaultTheme = function(theme) {
       
  5026     Timeline._defaultTheme = theme;
       
  5027 };
       
  5028 
       
  5029 Timeline.loadXML = function(url, f) {
       
  5030     var fError = function(statusText, status, xmlhttp) {
       
  5031         alert("Failed to load data xml from " + url + "\n" + statusText);
       
  5032     };
       
  5033     var fDone = function(xmlhttp) {
       
  5034         var xml = xmlhttp.responseXML;
       
  5035         if (!xml.documentElement && xmlhttp.responseStream) {
       
  5036             xml.load(xmlhttp.responseStream);
       
  5037         }
       
  5038         f(xml, url);
       
  5039     };
       
  5040     SimileAjax.XmlHttp.get(url, fError, fDone);
       
  5041 };
       
  5042 
       
  5043 
       
  5044 Timeline.loadJSON = function(url, f) {
       
  5045     var fError = function(statusText, status, xmlhttp) {
       
  5046         alert("Failed to load json data from " + url + "\n" + statusText);
       
  5047     };
       
  5048     var fDone = function(xmlhttp) {
       
  5049         f(eval('(' + xmlhttp.responseText + ')'), url);
       
  5050     };
       
  5051     SimileAjax.XmlHttp.get(url, fError, fDone);
       
  5052 };
       
  5053 
       
  5054 
       
  5055 Timeline._Impl = function(elmt, bandInfos, orientation, unit) {
       
  5056     SimileAjax.WindowManager.initialize();
       
  5057 
       
  5058     this._containerDiv = elmt;
       
  5059 
       
  5060     this._bandInfos = bandInfos;
       
  5061     this._orientation = orientation == null ? Timeline.HORIZONTAL : orientation;
       
  5062     this._unit = (unit != null) ? unit : SimileAjax.NativeDateUnit;
       
  5063 
       
  5064     this._initialize();
       
  5065 };
       
  5066 
       
  5067 Timeline._Impl.prototype.dispose = function() {
       
  5068     for (var i = 0; i < this._bands.length; i++) {
       
  5069         this._bands[i].dispose();
       
  5070     }
       
  5071     this._bands = null;
       
  5072     this._bandInfos = null;
       
  5073     this._containerDiv.innerHTML = "";
       
  5074 };
       
  5075 
       
  5076 Timeline._Impl.prototype.getBandCount = function() {
       
  5077     return this._bands.length;
       
  5078 };
       
  5079 
       
  5080 Timeline._Impl.prototype.getBand = function(index) {
       
  5081     return this._bands[index];
       
  5082 };
       
  5083 
       
  5084 Timeline._Impl.prototype.layout = function() {
       
  5085     this._distributeWidths();
       
  5086 };
       
  5087 
       
  5088 Timeline._Impl.prototype.paint = function() {
       
  5089     for (var i = 0; i < this._bands.length; i++) {
       
  5090         this._bands[i].paint();
       
  5091     }
       
  5092 };
       
  5093 
       
  5094 Timeline._Impl.prototype.getDocument = function() {
       
  5095     return this._containerDiv.ownerDocument;
       
  5096 };
       
  5097 
       
  5098 Timeline._Impl.prototype.addDiv = function(div) {
       
  5099     this._containerDiv.appendChild(div);
       
  5100 };
       
  5101 
       
  5102 Timeline._Impl.prototype.removeDiv = function(div) {
       
  5103     this._containerDiv.removeChild(div);
       
  5104 };
       
  5105 
       
  5106 Timeline._Impl.prototype.isHorizontal = function() {
       
  5107     return this._orientation == Timeline.HORIZONTAL;
       
  5108 };
       
  5109 
       
  5110 Timeline._Impl.prototype.isVertical = function() {
       
  5111     return this._orientation == Timeline.VERTICAL;
       
  5112 };
       
  5113 
       
  5114 Timeline._Impl.prototype.getPixelLength = function() {
       
  5115     return this._orientation == Timeline.HORIZONTAL ?
       
  5116         this._containerDiv.offsetWidth : this._containerDiv.offsetHeight;
       
  5117 };
       
  5118 
       
  5119 Timeline._Impl.prototype.getPixelWidth = function() {
       
  5120     return this._orientation == Timeline.VERTICAL ?
       
  5121         this._containerDiv.offsetWidth : this._containerDiv.offsetHeight;
       
  5122 };
       
  5123 
       
  5124 Timeline._Impl.prototype.getUnit = function() {
       
  5125     return this._unit;
       
  5126 };
       
  5127 
       
  5128 Timeline._Impl.prototype.loadXML = function(url, f) {
       
  5129     var tl = this;
       
  5130 
       
  5131 
       
  5132     var fError = function(statusText, status, xmlhttp) {
       
  5133         alert("Failed to load data xml from " + url + "\n" + statusText);
       
  5134         tl.hideLoadingMessage();
       
  5135     };
       
  5136     var fDone = function(xmlhttp) {
       
  5137         try {
       
  5138             var xml = xmlhttp.responseXML;
       
  5139             if (!xml.documentElement && xmlhttp.responseStream) {
       
  5140                 xml.load(xmlhttp.responseStream);
       
  5141             }
       
  5142             f(xml, url);
       
  5143         } finally {
       
  5144             tl.hideLoadingMessage();
       
  5145         }
       
  5146     };
       
  5147 
       
  5148     this.showLoadingMessage();
       
  5149     window.setTimeout(function() { SimileAjax.XmlHttp.get(url, fError, fDone); }, 0);
       
  5150 };
       
  5151 
       
  5152 Timeline._Impl.prototype.loadJSON = function(url, f) {
       
  5153     var tl = this;
       
  5154 
       
  5155 
       
  5156     var fError = function(statusText, status, xmlhttp) {
       
  5157         alert("Failed to load json data from " + url + "\n" + statusText);
       
  5158         tl.hideLoadingMessage();
       
  5159     };
       
  5160     var fDone = function(xmlhttp) {
       
  5161         try {
       
  5162             f(eval('(' + xmlhttp.responseText + ')'), url);
       
  5163         } finally {
       
  5164             tl.hideLoadingMessage();
       
  5165         }
       
  5166     };
       
  5167 
       
  5168     this.showLoadingMessage();
       
  5169     window.setTimeout(function() { SimileAjax.XmlHttp.get(url, fError, fDone); }, 0);
       
  5170 };
       
  5171 
       
  5172 Timeline._Impl.prototype._initialize = function() {
       
  5173     var containerDiv = this._containerDiv;
       
  5174     var doc = containerDiv.ownerDocument;
       
  5175 
       
  5176     containerDiv.className =
       
  5177         containerDiv.className.split(" ").concat("timeline-container").join(" ");
       
  5178 
       
  5179 	/*
       
  5180 	 * Set css-class on container div that will define orientation
       
  5181 	 */
       
  5182 	var orientation = (this.isHorizontal()) ? 'horizontal' : 'vertical'
       
  5183 	containerDiv.className +=' timeline-'+orientation;
       
  5184 
       
  5185 
       
  5186     while (containerDiv.firstChild) {
       
  5187         containerDiv.removeChild(containerDiv.firstChild);
       
  5188     }
       
  5189 
       
  5190     /*
       
  5191      *  inserting copyright and link to simile
       
  5192      */
       
  5193     var elmtCopyright = SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix + (this.isHorizontal() ? "data/timeline/copyright-vertical.png" : "data/timeline/copyright.png"));
       
  5194     elmtCopyright.className = "timeline-copyright";
       
  5195     elmtCopyright.title = "Timeline (c) SIMILE - http://simile.mit.edu/timeline/";
       
  5196     SimileAjax.DOM.registerEvent(elmtCopyright, "click", function() { window.location = "http://simile.mit.edu/timeline/"; });
       
  5197     containerDiv.appendChild(elmtCopyright);
       
  5198 
       
  5199     /*
       
  5200      *  creating bands
       
  5201      */
       
  5202     this._bands = [];
       
  5203     for (var i = 0; i < this._bandInfos.length; i++) {
       
  5204         var bandInfo = this._bandInfos[i];
       
  5205         var bandClass = bandInfo.bandClass || Timeline._Band;
       
  5206         var band = new bandClass(this, bandInfo, i);
       
  5207         this._bands.push(band);
       
  5208     }
       
  5209     this._distributeWidths();
       
  5210 
       
  5211     /*
       
  5212      *  sync'ing bands
       
  5213      */
       
  5214     for (var i = 0; i < this._bandInfos.length; i++) {
       
  5215         var bandInfo = this._bandInfos[i];
       
  5216         if ("syncWith" in bandInfo) {
       
  5217             this._bands[i].setSyncWithBand(
       
  5218                 this._bands[bandInfo.syncWith],
       
  5219                 ("highlight" in bandInfo) ? bandInfo.highlight : false
       
  5220             );
       
  5221         }
       
  5222     }
       
  5223 
       
  5224     /*
       
  5225      *  creating loading UI
       
  5226      */
       
  5227     var message = SimileAjax.Graphics.createMessageBubble(doc);
       
  5228     message.containerDiv.className = "timeline-message-container";
       
  5229     containerDiv.appendChild(message.containerDiv);
       
  5230 
       
  5231     message.contentDiv.className = "timeline-message";
       
  5232     message.contentDiv.innerHTML = "<img src='" + Timeline.urlPrefix + "data/timeline/progress-running.gif' /> Loading...";
       
  5233 
       
  5234     this.showLoadingMessage = function() { message.containerDiv.style.display = "block"; };
       
  5235     this.hideLoadingMessage = function() { message.containerDiv.style.display = "none"; };
       
  5236 };
       
  5237 
       
  5238 Timeline._Impl.prototype._distributeWidths = function() {
       
  5239     var length = this.getPixelLength();
       
  5240     var width = this.getPixelWidth();
       
  5241     var cumulativeWidth = 0;
       
  5242 
       
  5243     for (var i = 0; i < this._bands.length; i++) {
       
  5244         var band = this._bands[i];
       
  5245         var bandInfos = this._bandInfos[i];
       
  5246         var widthString = bandInfos.width;
       
  5247 
       
  5248         var x = widthString.indexOf("%");
       
  5249         if (x > 0) {
       
  5250             var percent = parseInt(widthString.substr(0, x));
       
  5251             var bandWidth = percent * width / 100;
       
  5252         } else {
       
  5253             var bandWidth = parseInt(widthString);
       
  5254         }
       
  5255 
       
  5256         band.setBandShiftAndWidth(cumulativeWidth, bandWidth);
       
  5257         band.setViewLength(length);
       
  5258 
       
  5259         cumulativeWidth += bandWidth;
       
  5260     }
       
  5261 };
       
  5262 
       
  5263 Timeline._Impl.prototype.zoom = function (zoomIn, x, y, target) {
       
  5264   var matcher = new RegExp("^timeline-band-([0-9]+)$");
       
  5265   var bandIndex = null;
       
  5266 
       
  5267   var result = matcher.exec(target.id);
       
  5268   if (result) {
       
  5269     bandIndex = parseInt(result[1]);
       
  5270   }
       
  5271 
       
  5272   if (bandIndex != null) {
       
  5273     this._bands[bandIndex].zoom(zoomIn, x, y, target);
       
  5274   }
       
  5275 
       
  5276   this.paint();
       
  5277 };
       
  5278 
       
  5279 /*==================================================
       
  5280  *  Band
       
  5281  *==================================================
       
  5282  */
       
  5283 Timeline._Band = function(timeline, bandInfo, index) {
       
  5284     // hack for easier subclassing
       
  5285     if (timeline !== undefined) {
       
  5286         this.initialize(timeline, bandInfo, index);
       
  5287     }
       
  5288 };
       
  5289 
       
  5290 Timeline._Band.prototype.initialize = function(timeline, bandInfo, index) {
       
  5291     this._timeline = timeline;
       
  5292     this._bandInfo = bandInfo;
       
  5293     this._index = index;
       
  5294 
       
  5295     this._locale = ("locale" in bandInfo) ? bandInfo.locale : Timeline.getDefaultLocale();
       
  5296     this._timeZone = ("timeZone" in bandInfo) ? bandInfo.timeZone : 0;
       
  5297     this._labeller = ("labeller" in bandInfo) ? bandInfo.labeller :
       
  5298         (("createLabeller" in timeline.getUnit()) ?
       
  5299             timeline.getUnit().createLabeller(this._locale, this._timeZone) :
       
  5300             new Timeline.GregorianDateLabeller(this._locale, this._timeZone));
       
  5301     this._theme = bandInfo.theme;
       
  5302     this._zoomIndex = ("zoomIndex" in bandInfo) ? bandInfo.zoomIndex : 0;
       
  5303     this._zoomSteps = ("zoomSteps" in bandInfo) ? bandInfo.zoomSteps : null;
       
  5304 
       
  5305     this._dragging = false;
       
  5306     this._changing = false;
       
  5307     this._originalScrollSpeed = 5; // pixels
       
  5308     this._scrollSpeed = this._originalScrollSpeed;
       
  5309     this._onScrollListeners = [];
       
  5310 
       
  5311     var b = this;
       
  5312     this._syncWithBand = null;
       
  5313     this._syncWithBandHandler = function(band) {
       
  5314         b._onHighlightBandScroll();
       
  5315     };
       
  5316     this._selectorListener = function(band) {
       
  5317         b._onHighlightBandScroll();
       
  5318     };
       
  5319 
       
  5320     /*
       
  5321      *  Install a textbox to capture keyboard events
       
  5322      */
       
  5323     var inputDiv = this._timeline.getDocument().createElement("div");
       
  5324     inputDiv.className = "timeline-band-input";
       
  5325     this._timeline.addDiv(inputDiv);
       
  5326 
       
  5327     this._keyboardInput = document.createElement("input");
       
  5328     this._keyboardInput.type = "text";
       
  5329     inputDiv.appendChild(this._keyboardInput);
       
  5330     SimileAjax.DOM.registerEventWithObject(this._keyboardInput, "keydown", this, "_onKeyDown");
       
  5331     SimileAjax.DOM.registerEventWithObject(this._keyboardInput, "keyup", this, "_onKeyUp");
       
  5332 
       
  5333     /*
       
  5334      *  The band's outer most div that slides with respect to the timeline's div
       
  5335      */
       
  5336     this._div = this._timeline.getDocument().createElement("div");
       
  5337     this._div.id = "timeline-band-" + index;
       
  5338     this._div.className = "timeline-band timeline-band-" + index;
       
  5339     this._timeline.addDiv(this._div);
       
  5340 
       
  5341     SimileAjax.DOM.registerEventWithObject(this._div, "mousedown", this, "_onMouseDown");
       
  5342     SimileAjax.DOM.registerEventWithObject(this._div, "mousemove", this, "_onMouseMove");
       
  5343     SimileAjax.DOM.registerEventWithObject(this._div, "mouseup", this, "_onMouseUp");
       
  5344     SimileAjax.DOM.registerEventWithObject(this._div, "mouseout", this, "_onMouseOut");
       
  5345     SimileAjax.DOM.registerEventWithObject(this._div, "dblclick", this, "_onDblClick");
       
  5346 
       
  5347     var mouseWheel = this._theme!= null ? this._theme.mouseWheel : 'scroll'; // theme is not always defined
       
  5348     if (mouseWheel === 'zoom' || mouseWheel === 'scroll' || this._zoomSteps) {
       
  5349     	// capture mouse scroll
       
  5350       if (SimileAjax.Platform.browser.isFirefox) {
       
  5351         SimileAjax.DOM.registerEventWithObject(this._div, "DOMMouseScroll", this, "_onMouseScroll");
       
  5352       } else {
       
  5353         SimileAjax.DOM.registerEventWithObject(this._div, "mousewheel", this, "_onMouseScroll");
       
  5354       }
       
  5355     }
       
  5356 
       
  5357     /*
       
  5358      *  The inner div that contains layers
       
  5359      */
       
  5360     this._innerDiv = this._timeline.getDocument().createElement("div");
       
  5361     this._innerDiv.className = "timeline-band-inner";
       
  5362     this._div.appendChild(this._innerDiv);
       
  5363 
       
  5364     /*
       
  5365      *  Initialize parts of the band
       
  5366      */
       
  5367     this._ether = bandInfo.ether;
       
  5368     bandInfo.ether.initialize(this, timeline);
       
  5369 
       
  5370     this._etherPainter = bandInfo.etherPainter;
       
  5371     bandInfo.etherPainter.initialize(this, timeline);
       
  5372 
       
  5373     this._eventSource = bandInfo.eventSource;
       
  5374     if (this._eventSource) {
       
  5375         this._eventListener = {
       
  5376             onAddMany: function() { b._onAddMany(); },
       
  5377             onClear:   function() { b._onClear(); }
       
  5378         }
       
  5379         this._eventSource.addListener(this._eventListener);
       
  5380     }
       
  5381 
       
  5382     this._eventPainter = bandInfo.eventPainter;
       
  5383     bandInfo.eventPainter.initialize(this, timeline);
       
  5384 
       
  5385     this._decorators = ("decorators" in bandInfo) ? bandInfo.decorators : [];
       
  5386     for (var i = 0; i < this._decorators.length; i++) {
       
  5387         this._decorators[i].initialize(this, timeline);
       
  5388     }
       
  5389 };
       
  5390 
       
  5391 Timeline._Band.SCROLL_MULTIPLES = 5;
       
  5392 
       
  5393 Timeline._Band.prototype.dispose = function() {
       
  5394     this.closeBubble();
       
  5395 
       
  5396     if (this._eventSource) {
       
  5397         this._eventSource.removeListener(this._eventListener);
       
  5398         this._eventListener = null;
       
  5399         this._eventSource = null;
       
  5400     }
       
  5401 
       
  5402     this._timeline = null;
       
  5403     this._bandInfo = null;
       
  5404 
       
  5405     this._labeller = null;
       
  5406     this._ether = null;
       
  5407     this._etherPainter = null;
       
  5408     this._eventPainter = null;
       
  5409     this._decorators = null;
       
  5410 
       
  5411     this._onScrollListeners = null;
       
  5412     this._syncWithBandHandler = null;
       
  5413     this._selectorListener = null;
       
  5414 
       
  5415     this._div = null;
       
  5416     this._innerDiv = null;
       
  5417     this._keyboardInput = null;
       
  5418 };
       
  5419 
       
  5420 Timeline._Band.prototype.addOnScrollListener = function(listener) {
       
  5421     this._onScrollListeners.push(listener);
       
  5422 };
       
  5423 
       
  5424 Timeline._Band.prototype.removeOnScrollListener = function(listener) {
       
  5425     for (var i = 0; i < this._onScrollListeners.length; i++) {
       
  5426         if (this._onScrollListeners[i] == listener) {
       
  5427             this._onScrollListeners.splice(i, 1);
       
  5428             break;
       
  5429         }
       
  5430     }
       
  5431 };
       
  5432 
       
  5433 Timeline._Band.prototype.setSyncWithBand = function(band, highlight) {
       
  5434     if (this._syncWithBand) {
       
  5435         this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler);
       
  5436     }
       
  5437 
       
  5438     this._syncWithBand = band;
       
  5439     this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);
       
  5440     this._highlight = highlight;
       
  5441     this._positionHighlight();
       
  5442 };
       
  5443 
       
  5444 Timeline._Band.prototype.getLocale = function() {
       
  5445     return this._locale;
       
  5446 };
       
  5447 
       
  5448 Timeline._Band.prototype.getTimeZone = function() {
       
  5449     return this._timeZone;
       
  5450 };
       
  5451 
       
  5452 Timeline._Band.prototype.getLabeller = function() {
       
  5453     return this._labeller;
       
  5454 };
       
  5455 
       
  5456 Timeline._Band.prototype.getIndex = function() {
       
  5457     return this._index;
       
  5458 };
       
  5459 
       
  5460 Timeline._Band.prototype.getEther = function() {
       
  5461     return this._ether;
       
  5462 };
       
  5463 
       
  5464 Timeline._Band.prototype.getEtherPainter = function() {
       
  5465     return this._etherPainter;
       
  5466 };
       
  5467 
       
  5468 Timeline._Band.prototype.getEventSource = function() {
       
  5469     return this._eventSource;
       
  5470 };
       
  5471 
       
  5472 Timeline._Band.prototype.getEventPainter = function() {
       
  5473     return this._eventPainter;
       
  5474 };
       
  5475 
       
  5476 Timeline._Band.prototype.layout = function() {
       
  5477     this.paint();
       
  5478 };
       
  5479 
       
  5480 Timeline._Band.prototype.paint = function() {
       
  5481     this._etherPainter.paint();
       
  5482     this._paintDecorators();
       
  5483     this._paintEvents();
       
  5484 };
       
  5485 
       
  5486 Timeline._Band.prototype.softLayout = function() {
       
  5487     this.softPaint();
       
  5488 };
       
  5489 
       
  5490 Timeline._Band.prototype.softPaint = function() {
       
  5491     this._etherPainter.softPaint();
       
  5492     this._softPaintDecorators();
       
  5493     this._softPaintEvents();
       
  5494 };
       
  5495 
       
  5496 Timeline._Band.prototype.setBandShiftAndWidth = function(shift, width) {
       
  5497     var inputDiv = this._keyboardInput.parentNode;
       
  5498     var middle = shift + Math.floor(width / 2);
       
  5499     if (this._timeline.isHorizontal()) {
       
  5500         this._div.style.top = shift + "px";
       
  5501         this._div.style.height = width + "px";
       
  5502 
       
  5503         inputDiv.style.top = middle + "px";
       
  5504         inputDiv.style.left = "-1em";
       
  5505     } else {
       
  5506         this._div.style.left = shift + "px";
       
  5507         this._div.style.width = width + "px";
       
  5508 
       
  5509         inputDiv.style.left = middle + "px";
       
  5510         inputDiv.style.top = "-1em";
       
  5511     }
       
  5512 };
       
  5513 
       
  5514 Timeline._Band.prototype.getViewWidth = function() {
       
  5515     if (this._timeline.isHorizontal()) {
       
  5516         return this._div.offsetHeight;
       
  5517     } else {
       
  5518         return this._div.offsetWidth;
       
  5519     }
       
  5520 };
       
  5521 
       
  5522 Timeline._Band.prototype.setViewLength = function(length) {
       
  5523     this._viewLength = length;
       
  5524     this._recenterDiv();
       
  5525     this._onChanging();
       
  5526 };
       
  5527 
       
  5528 Timeline._Band.prototype.getViewLength = function() {
       
  5529     return this._viewLength;
       
  5530 };
       
  5531 
       
  5532 Timeline._Band.prototype.getTotalViewLength = function() {
       
  5533     return Timeline._Band.SCROLL_MULTIPLES * this._viewLength;
       
  5534 };
       
  5535 
       
  5536 Timeline._Band.prototype.getViewOffset = function() {
       
  5537     return this._viewOffset;
       
  5538 };
       
  5539 
       
  5540 Timeline._Band.prototype.getMinDate = function() {
       
  5541     return this._ether.pixelOffsetToDate(this._viewOffset);
       
  5542 };
       
  5543 
       
  5544 Timeline._Band.prototype.getMaxDate = function() {
       
  5545     return this._ether.pixelOffsetToDate(this._viewOffset + Timeline._Band.SCROLL_MULTIPLES * this._viewLength);
       
  5546 };
       
  5547 
       
  5548 Timeline._Band.prototype.getMinVisibleDate = function() {
       
  5549     return this._ether.pixelOffsetToDate(0);
       
  5550 };
       
  5551 
       
  5552 Timeline._Band.prototype.getMaxVisibleDate = function() {
       
  5553     return this._ether.pixelOffsetToDate(this._viewLength);
       
  5554 };
       
  5555 
       
  5556 Timeline._Band.prototype.getCenterVisibleDate = function() {
       
  5557     return this._ether.pixelOffsetToDate(this._viewLength / 2);
       
  5558 };
       
  5559 
       
  5560 Timeline._Band.prototype.setMinVisibleDate = function(date) {
       
  5561     if (!this._changing) {
       
  5562         this._moveEther(Math.round(-this._ether.dateToPixelOffset(date)));
       
  5563     }
       
  5564 };
       
  5565 
       
  5566 Timeline._Band.prototype.setMaxVisibleDate = function(date) {
       
  5567     if (!this._changing) {
       
  5568         this._moveEther(Math.round(this._viewLength - this._ether.dateToPixelOffset(date)));
       
  5569     }
       
  5570 };
       
  5571 
       
  5572 Timeline._Band.prototype.setCenterVisibleDate = function(date) {
       
  5573     if (!this._changing) {
       
  5574         this._moveEther(Math.round(this._viewLength / 2 - this._ether.dateToPixelOffset(date)));
       
  5575     }
       
  5576 };
       
  5577 
       
  5578 Timeline._Band.prototype.dateToPixelOffset = function(date) {
       
  5579     return this._ether.dateToPixelOffset(date) - this._viewOffset;
       
  5580 };
       
  5581 
       
  5582 Timeline._Band.prototype.pixelOffsetToDate = function(pixels) {
       
  5583     return this._ether.pixelOffsetToDate(pixels + this._viewOffset);
       
  5584 };
       
  5585 
       
  5586 Timeline._Band.prototype.createLayerDiv = function(zIndex, className) {
       
  5587     var div = this._timeline.getDocument().createElement("div");
       
  5588     div.className = "timeline-band-layer" + (typeof className == "string" ? (" " + className) : "");
       
  5589     div.style.zIndex = zIndex;
       
  5590     this._innerDiv.appendChild(div);
       
  5591 
       
  5592     var innerDiv = this._timeline.getDocument().createElement("div");
       
  5593     innerDiv.className = "timeline-band-layer-inner";
       
  5594     if (SimileAjax.Platform.browser.isIE) {
       
  5595         innerDiv.style.cursor = "move";
       
  5596     } else {
       
  5597         innerDiv.style.cursor = "-moz-grab";
       
  5598     }
       
  5599     div.appendChild(innerDiv);
       
  5600 
       
  5601     return innerDiv;
       
  5602 };
       
  5603 
       
  5604 Timeline._Band.prototype.removeLayerDiv = function(div) {
       
  5605     this._innerDiv.removeChild(div.parentNode);
       
  5606 };
       
  5607 
       
  5608 Timeline._Band.prototype.scrollToCenter = function(date, f) {
       
  5609     var pixelOffset = this._ether.dateToPixelOffset(date);
       
  5610     if (pixelOffset < -this._viewLength / 2) {
       
  5611         this.setCenterVisibleDate(this.pixelOffsetToDate(pixelOffset + this._viewLength));
       
  5612     } else if (pixelOffset > 3 * this._viewLength / 2) {
       
  5613         this.setCenterVisibleDate(this.pixelOffsetToDate(pixelOffset - this._viewLength));
       
  5614     }
       
  5615     this._autoScroll(Math.round(this._viewLength / 2 - this._ether.dateToPixelOffset(date)), f);
       
  5616 };
       
  5617 
       
  5618 Timeline._Band.prototype.showBubbleForEvent = function(eventID) {
       
  5619     var evt = this.getEventSource().getEvent(eventID);
       
  5620     if (evt) {
       
  5621         var self = this;
       
  5622         this.scrollToCenter(evt.getStart(), function() {
       
  5623             self._eventPainter.showBubble(evt);
       
  5624         });
       
  5625     }
       
  5626 };
       
  5627 
       
  5628 Timeline._Band.prototype.zoom = function(zoomIn, x, y, target) {
       
  5629   if (!this._zoomSteps) {
       
  5630     // zoom disabled
       
  5631     return;
       
  5632   }
       
  5633 
       
  5634   // shift the x value by our offset
       
  5635   x += this._viewOffset;
       
  5636 
       
  5637   var zoomDate = this._ether.pixelOffsetToDate(x);
       
  5638   var netIntervalChange = this._ether.zoom(zoomIn);
       
  5639   this._etherPainter.zoom(netIntervalChange);
       
  5640 
       
  5641   // shift our zoom date to the far left
       
  5642   this._moveEther(Math.round(-this._ether.dateToPixelOffset(zoomDate)));
       
  5643   // then shift it back to where the mouse was
       
  5644   this._moveEther(x);
       
  5645 };
       
  5646 
       
  5647 Timeline._Band.prototype._onMouseDown = function(innerFrame, evt, target) {
       
  5648     this.closeBubble();
       
  5649 
       
  5650     this._dragging = true;
       
  5651     this._dragX = evt.clientX;
       
  5652     this._dragY = evt.clientY;
       
  5653 };
       
  5654 
       
  5655 Timeline._Band.prototype._onMouseMove = function(innerFrame, evt, target) {
       
  5656     if (this._dragging) {
       
  5657         var diffX = evt.clientX - this._dragX;
       
  5658         var diffY = evt.clientY - this._dragY;
       
  5659 
       
  5660         this._dragX = evt.clientX;
       
  5661         this._dragY = evt.clientY;
       
  5662 
       
  5663         this._moveEther(this._timeline.isHorizontal() ? diffX : diffY);
       
  5664         this._positionHighlight();
       
  5665     }
       
  5666 };
       
  5667 
       
  5668 Timeline._Band.prototype._onMouseUp = function(innerFrame, evt, target) {
       
  5669     this._dragging = false;
       
  5670     this._keyboardInput.focus();
       
  5671 };
       
  5672 
       
  5673 Timeline._Band.prototype._onMouseOut = function(innerFrame, evt, target) {
       
  5674     var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt, innerFrame);
       
  5675     coords.x += this._viewOffset;
       
  5676     if (coords.x < 0 || coords.x > innerFrame.offsetWidth ||
       
  5677         coords.y < 0 || coords.y > innerFrame.offsetHeight) {
       
  5678         this._dragging = false;
       
  5679     }
       
  5680 };
       
  5681 
       
  5682 Timeline._Band.prototype._onMouseScroll = function(innerFrame, evt, target) {
       
  5683   var now = new Date();
       
  5684   now = now.getTime();
       
  5685 
       
  5686   if (!this._lastScrollTime || ((now - this._lastScrollTime) > 50)) {
       
  5687     // limit 1 scroll per 200ms due to FF3 sending multiple events back to back
       
  5688     this._lastScrollTime = now;
       
  5689 
       
  5690     var delta = 0;
       
  5691     if (evt.wheelDelta) {
       
  5692       delta = evt.wheelDelta/120;
       
  5693     } else if (evt.detail) {
       
  5694       delta = -evt.detail/3;
       
  5695     }
       
  5696 
       
  5697     // either scroll or zoom
       
  5698     var mouseWheel = this._theme.mouseWheel;
       
  5699 
       
  5700     if (this._zoomSteps || mouseWheel === 'zoom') {
       
  5701       var loc = SimileAjax.DOM.getEventRelativeCoordinates(evt, innerFrame);
       
  5702       if (delta != 0) {
       
  5703         var zoomIn;
       
  5704         if (delta > 0)
       
  5705           zoomIn = true;
       
  5706         if (delta < 0)
       
  5707           zoomIn = false;
       
  5708         // call zoom on the timeline so we could zoom multiple bands if desired
       
  5709         this._timeline.zoom(zoomIn, loc.x, loc.y, innerFrame);
       
  5710       }
       
  5711     }
       
  5712     else if (mouseWheel === 'scroll') {
       
  5713     	var move_amt = 50 * (delta < 0 ? -1 : 1);
       
  5714       this._moveEther(move_amt);
       
  5715     }
       
  5716   }
       
  5717 
       
  5718   // prevent bubble
       
  5719   if (evt.stopPropagation) {
       
  5720     evt.stopPropagation();
       
  5721   }
       
  5722   evt.cancelBubble = true;
       
  5723 
       
  5724   // prevent the default action
       
  5725   if (evt.preventDefault) {
       
  5726     evt.preventDefault();
       
  5727   }
       
  5728   evt.returnValue = false;
       
  5729 };
       
  5730 
       
  5731 Timeline._Band.prototype._onDblClick = function(innerFrame, evt, target) {
       
  5732     var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt, innerFrame);
       
  5733     var distance = coords.x - (this._viewLength / 2 - this._viewOffset);
       
  5734 
       
  5735     this._autoScroll(-distance);
       
  5736 };
       
  5737 
       
  5738 Timeline._Band.prototype._onKeyDown = function(keyboardInput, evt, target) {
       
  5739     if (!this._dragging) {
       
  5740         switch (evt.keyCode) {
       
  5741         case 27: // ESC
       
  5742             break;
       
  5743         case 37: // left arrow
       
  5744         case 38: // up arrow
       
  5745             this._scrollSpeed = Math.min(50, Math.abs(this._scrollSpeed * 1.05));
       
  5746             this._moveEther(this._scrollSpeed);
       
  5747             break;
       
  5748         case 39: // right arrow
       
  5749         case 40: // down arrow
       
  5750             this._scrollSpeed = -Math.min(50, Math.abs(this._scrollSpeed * 1.05));
       
  5751             this._moveEther(this._scrollSpeed);
       
  5752             break;
       
  5753         default:
       
  5754             return true;
       
  5755         }
       
  5756         this.closeBubble();
       
  5757 
       
  5758         SimileAjax.DOM.cancelEvent(evt);
       
  5759         return false;
       
  5760     }
       
  5761     return true;
       
  5762 };
       
  5763 
       
  5764 Timeline._Band.prototype._onKeyUp = function(keyboardInput, evt, target) {
       
  5765     if (!this._dragging) {
       
  5766         this._scrollSpeed = this._originalScrollSpeed;
       
  5767 
       
  5768         switch (evt.keyCode) {
       
  5769         case 35: // end
       
  5770             this.setCenterVisibleDate(this._eventSource.getLatestDate());
       
  5771             break;
       
  5772         case 36: // home
       
  5773             this.setCenterVisibleDate(this._eventSource.getEarliestDate());
       
  5774             break;
       
  5775         case 33: // page up
       
  5776             this._autoScroll(this._timeline.getPixelLength());
       
  5777             break;
       
  5778         case 34: // page down
       
  5779             this._autoScroll(-this._timeline.getPixelLength());
       
  5780             break;
       
  5781         default:
       
  5782             return true;
       
  5783         }
       
  5784 
       
  5785         this.closeBubble();
       
  5786 
       
  5787         SimileAjax.DOM.cancelEvent(evt);
       
  5788         return false;
       
  5789     }
       
  5790     return true;
       
  5791 };
       
  5792 
       
  5793 Timeline._Band.prototype._autoScroll = function(distance, f) {
       
  5794     var b = this;
       
  5795     var a = SimileAjax.Graphics.createAnimation(
       
  5796         function(abs, diff) {
       
  5797             b._moveEther(diff);
       
  5798         },
       
  5799         0,
       
  5800         distance,
       
  5801         1000,
       
  5802         f
       
  5803     );
       
  5804     a.run();
       
  5805 };
       
  5806 
       
  5807 Timeline._Band.prototype._moveEther = function(shift) {
       
  5808     this.closeBubble();
       
  5809 
       
  5810     this._viewOffset += shift;
       
  5811     this._ether.shiftPixels(-shift);
       
  5812     if (this._timeline.isHorizontal()) {
       
  5813         this._div.style.left = this._viewOffset + "px";
       
  5814     } else {
       
  5815         this._div.style.top = this._viewOffset + "px";
       
  5816     }
       
  5817 
       
  5818     if (this._viewOffset > -this._viewLength * 0.5 ||
       
  5819         this._viewOffset < -this._viewLength * (Timeline._Band.SCROLL_MULTIPLES - 1.5)) {
       
  5820 
       
  5821         this._recenterDiv();
       
  5822     } else {
       
  5823         this.softLayout();
       
  5824     }
       
  5825 
       
  5826     this._onChanging();
       
  5827 }
       
  5828 
       
  5829 Timeline._Band.prototype._onChanging = function() {
       
  5830     this._changing = true;
       
  5831 
       
  5832     this._fireOnScroll();
       
  5833     this._setSyncWithBandDate();
       
  5834 
       
  5835     this._changing = false;
       
  5836 };
       
  5837 
       
  5838 Timeline._Band.prototype._fireOnScroll = function() {
       
  5839     for (var i = 0; i < this._onScrollListeners.length; i++) {
       
  5840         this._onScrollListeners[i](this);
       
  5841     }
       
  5842 };
       
  5843 
       
  5844 Timeline._Band.prototype._setSyncWithBandDate = function() {
       
  5845     if (this._syncWithBand) {
       
  5846         var centerDate = this._ether.pixelOffsetToDate(this.getViewLength() / 2);
       
  5847         this._syncWithBand.setCenterVisibleDate(centerDate);
       
  5848     }
       
  5849 };
       
  5850 
       
  5851 Timeline._Band.prototype._onHighlightBandScroll = function() {
       
  5852     if (this._syncWithBand) {
       
  5853         var centerDate = this._syncWithBand.getCenterVisibleDate();
       
  5854         var centerPixelOffset = this._ether.dateToPixelOffset(centerDate);
       
  5855 
       
  5856         this._moveEther(Math.round(this._viewLength / 2 - centerPixelOffset));
       
  5857 
       
  5858         if (this._highlight) {
       
  5859             this._etherPainter.setHighlight(
       
  5860                 this._syncWithBand.getMinVisibleDate(),
       
  5861                 this._syncWithBand.getMaxVisibleDate());
       
  5862         }
       
  5863     }
       
  5864 };
       
  5865 
       
  5866 Timeline._Band.prototype._onAddMany = function() {
       
  5867     this._paintEvents();
       
  5868 };
       
  5869 
       
  5870 Timeline._Band.prototype._onClear = function() {
       
  5871     this._paintEvents();
       
  5872 };
       
  5873 
       
  5874 Timeline._Band.prototype._positionHighlight = function() {
       
  5875     if (this._syncWithBand) {
       
  5876         var startDate = this._syncWithBand.getMinVisibleDate();
       
  5877         var endDate = this._syncWithBand.getMaxVisibleDate();
       
  5878 
       
  5879         if (this._highlight) {
       
  5880             this._etherPainter.setHighlight(startDate, endDate);
       
  5881         }
       
  5882     }
       
  5883 };
       
  5884 
       
  5885 Timeline._Band.prototype._recenterDiv = function() {
       
  5886     this._viewOffset = -this._viewLength * (Timeline._Band.SCROLL_MULTIPLES - 1) / 2;
       
  5887     if (this._timeline.isHorizontal()) {
       
  5888         this._div.style.left = this._viewOffset + "px";
       
  5889         this._div.style.width = (Timeline._Band.SCROLL_MULTIPLES * this._viewLength) + "px";
       
  5890     } else {
       
  5891         this._div.style.top = this._viewOffset + "px";
       
  5892         this._div.style.height = (Timeline._Band.SCROLL_MULTIPLES * this._viewLength) + "px";
       
  5893     }
       
  5894     this.layout();
       
  5895 };
       
  5896 
       
  5897 Timeline._Band.prototype._paintEvents = function() {
       
  5898     this._eventPainter.paint();
       
  5899 };
       
  5900 
       
  5901 Timeline._Band.prototype._softPaintEvents = function() {
       
  5902     this._eventPainter.softPaint();
       
  5903 };
       
  5904 
       
  5905 Timeline._Band.prototype._paintDecorators = function() {
       
  5906     for (var i = 0; i < this._decorators.length; i++) {
       
  5907         this._decorators[i].paint();
       
  5908     }
       
  5909 };
       
  5910 
       
  5911 Timeline._Band.prototype._softPaintDecorators = function() {
       
  5912     for (var i = 0; i < this._decorators.length; i++) {
       
  5913         this._decorators[i].softPaint();
       
  5914     }
       
  5915 };
       
  5916 
       
  5917 Timeline._Band.prototype.closeBubble = function() {
       
  5918     SimileAjax.WindowManager.cancelPopups();
       
  5919 };