var SimileAjax={loaded:true,loadingScriptsCount:0,error:null,params:{bundle:"true"}};SimileAjax.Platform=new Object();SimileAjax.urlPrefix="/";(function(){if(window.jQuery){var _jQuery=window.jQuery}var jQuery=window.jQuery=function(selector,context){return new jQuery.prototype.init(selector,context)};if(window.$){var _$=window.$}window.$=jQuery;var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/;var isSimple=/^.[^:#\[\.]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this}else{if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context)}else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3]){return jQuery().find(selector)}else{this[0]=elem;this.length=1;return this}}else{selector=[]}}}else{return new jQuery(context).find(selector)}}else{if(jQuery.isFunction(selector)){return new jQuery(document)[jQuery.fn.ready?"ready":"load"](selector)}}}return this.setArray(selector.constructor==Array&&selector||(selector.jquery||selector.length&&selector!=window&&!selector.nodeType&&selector[0]!=undefined&&selector[0].nodeType)&&jQuery.makeArray(selector)||[selector])},jquery:"1.2.3",size:function(){return this.length},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num]},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this},each:function(callback,args){return jQuery.each(this,callback,args)},index:function(elem){var ret=-1;this.each(function(i){if(this==elem){ret=i}});return ret},attr:function(name,value,type){var options=name;if(name.constructor==String){if(value==undefined){return this.length&&jQuery[type||"attr"](this[0],name)||undefined}else{options={};options[name]=value}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))}})},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined}return this.attr(key,value,"curCSS")},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])}})});return ret},wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild)}})},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})},end:function(){return this.prevObject||jQuery([])},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem)});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems)},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0]}else{return this.cloneNode(true)}});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null}});if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return }var events=jQuery.data(this,"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data)}}})}return ret},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)})||jQuery.multiFilter(selector,this))},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true))}else{selector=jQuery.multiFilter(selector,this)}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector})},add:function(selector){return !selector?this:this.pushStack(jQuery.merge(this.get(),selector.constructor==String?jQuery(selector).get():selector.length!=undefined&&(!selector.nodeName||jQuery.nodeName(selector,"form"))?selector:[selector]))},is:function(selector){return selector?jQuery.multiFilter(selector,this).length>0:false},hasClass:function(selector){return this.is("."+selector)},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one){return value}values.push(value)}}return values}else{return(this[0].value||"").replace(/\r/g,"")}}return undefined}return this.each(function(){if(this.nodeType!=1){return }if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0)}else{if(jQuery.nodeName(this,"select")){var values=value.constructor==Array?value:[value];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)});if(!values.length){this.selectedIndex=-1}}else{this.value=value}}})},html:function(value){return value==undefined?(this.length?this[0].innerHTML:null):this.empty().append(value)},replaceWith:function(value){return this.after(value).remove()},eq:function(i){return this.slice(i,i+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},andSelf:function(){return this.add(this.prevObject)},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value==null){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data==undefined&&this.length){data=jQuery.data(this[0],key)}return data==null&&parts[1]?this.data(parts[0]):data}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)})}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse){elems.reverse()}}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"))}var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem)}else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove())}callback.call(obj,elem)}});scripts.each(evalScript)})}};jQuery.prototype.init.prototype=jQuery.prototype;function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}if(elem.parentNode){elem.parentNode.removeChild(elem)}}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2}if(typeof target!="object"&&typeof target!="function"){target={}}if(length==1){target=this;i=0}for(;i<length;i++){if((options=arguments[i])!=null){for(var name in options){if(target===options[name]){continue}if(deep&&options[name]&&typeof options[name]=="object"&&target[name]&&!options[name].nodeType){target[name]=jQuery.extend(target[name],options[name])}else{if(options[name]!=undefined){target[name]=options[name]}}}}}return target};var expando="jQuery"+(new Date()).getTime(),uuid=0,windowData={};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery}return jQuery},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"")},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie){script.text=data}else{script.appendChild(document.createTextNode(data))}head.appendChild(script);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id){id=elem[expando]=++uuid}if(name&&!jQuery.cache[id]){jQuery.cache[id]={}}if(data!=undefined){jQuery.cache[id][name]=data}return name?jQuery.cache[id][name]:id},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id]){break}if(!name){jQuery.removeData(elem)}}}else{try{delete elem[expando]}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando)}}delete jQuery.cache[id]}},each:function(object,callback,args){if(args){if(object.length==undefined){for(var name in object){if(callback.apply(object[name],args)===false){break}}}else{for(var i=0,length=object.length;i<length;i++){if(callback.apply(object[i],args)===false){break}}}}else{if(object.length==undefined){for(var name in object){if(callback.call(object[name],name,object[name])===false){break}}}else{for(var i=0,length=object.length,value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i)}return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value},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}})},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)}).join(" "):""}},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(var name in options){elem.style[name]=old[name]}},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"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0});val-=Math.round(padding+border)}if(jQuery(elem).is(":visible")){getWH()}else{jQuery.swap(elem,props,getWH)}return Math.max(0,val)}return jQuery.curCSS(elem,name,force)},curCSS:function(elem,name,force){var ret;function color(elem){if(!jQuery.browser.safari){return false}var ret=document.defaultView.getComputedStyle(elem,null);return !ret||ret.getPropertyValue("color")==""}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(elem.style,"opacity");return ret==""?"1":ret}if(jQuery.browser.opera&&name=="display"){var save=elem.style.outline;elem.style.outline="0 solid black";elem.style.outline=save}if(name.match(/float/i)){name=styleFloat}if(!force&&elem.style&&elem.style[name]){ret=elem.style[name]}else{if(document.defaultView&&document.defaultView.getComputedStyle){if(name.match(/float/i)){name="float"}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var getComputedStyle=document.defaultView.getComputedStyle(elem,null);if(getComputedStyle&&!color(elem)){ret=getComputedStyle.getPropertyValue(name)}else{var swap=[],stack=[];for(var a=elem;a&&color(a);a=a.parentNode){stack.unshift(a)}for(var i=0;i<stack.length;i++){if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block"}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(getComputedStyle&&getComputedStyle.getPropertyValue(name))||"";for(var i=0;i<swap.length;i++){if(swap[i]!=null){stack[i].style.display=swap[i]}}}if(name=="opacity"&&ret==""){ret="1"}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left,runtimeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle}}}}return ret},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}jQuery.each(elems,function(i,elem){if(!elem){return }if(elem.constructor==Number){elem=elem.toString()}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+">"});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");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,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--){div=div.lastChild}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:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild)}}elem=jQuery.makeArray(div.childNodes)}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return }if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem)}else{ret=jQuery.merge(ret,elem)}});return ret},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined}var fix=jQuery.isXMLDoc(elem)?{}:jQuery.props;if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex}if(fix[name]){if(value!=undefined){elem[fix[name]]=value}return elem[fix[name]]}else{if(jQuery.browser.msie&&name=="style"){return jQuery.attr(elem.style,"cssText",value)}else{if(value==undefined&&jQuery.browser.msie&&jQuery.nodeName(elem,"form")&&(name=="action"||name=="method")){return elem.getAttributeNode(name).nodeValue}else{if(elem.tagName){if(value!=undefined){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed"}elem.setAttribute(name,""+value)}if(jQuery.browser.msie&&/href|src/.test(name)&&!jQuery.isXMLDoc(elem)){return elem.getAttribute(name,2)}return elem.getAttribute(name)}else{if(name=="opacity"&&jQuery.browser.msie){if(value!=undefined){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseFloat(value).toString()=="NaN"?"":"alpha(opacity="+value*100+")")}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100).toString():""}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()});if(value!=undefined){elem[name]=value}return elem[name]}}}}},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")},makeArray:function(array){var ret=[];if(typeof array!="array"){for(var i=0,length=array.length;i<length;i++){ret.push(array[i])}}else{ret=array.slice(0)}return ret},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++){if(array[i]==elem){return i}}return -1},merge:function(first,second){if(jQuery.browser.msie){for(var i=0;second[i];i++){if(second[i].nodeType!=8){first.push(second[i])}}}else{for(var i=0;second[i];i++){first.push(second[i])}}return first},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i])}}}catch(e){ret=array}return ret},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv&&callback(elems[i],i)||inv&&!callback(elems[i],i)){ret.push(elems[i])}}return ret},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!==null&&value!=undefined){if(value.constructor!=Array){value=[value]}ret=ret.concat(value)}}return ret}});var userAgent=navigator.userAgent.toLowerCase();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)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,innerHTML:"innerHTML",className:"className",value:"value",disabled:"disabled",checked:"checked",readonly:"readOnly",selected:"selected",maxlength:"maxLength",selectedIndex:"selectedIndex",defaultValue:"defaultValue",tagName:"tagName",nodeName:"nodeName"}});jQuery.each({parent:function(elem){return elem.parentNode},parents:function(elem){return jQuery.dir(elem,"parentNode")},next:function(elem){return jQuery.nth(elem,2,"nextSibling")},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret)}return this.pushStack(jQuery.unique(ret))}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++){jQuery(args[i])[original](this)}})}});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1){this.removeAttribute(name)}},addClass:function(classNames){jQuery.className.add(this,classNames)},removeClass:function(classNames){jQuery.className.remove(this,classNames)},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames)},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){jQuery(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)}});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();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")}});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+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2])},"#":function(a,i,m){return a.getAttribute("id")==m[2]},":":{lt:function(a,i,m){return i<m[3]-0},gt:function(a,i,m){return i>m[3]-0},nth:function(a,i,m){return m[3]-0==i},eq:function(a,i,m){return m[3]-0==i},first:function(a,i){return i==0},last:function(a,i,m,r){return i==r.length-1},even:function(a,i){return i%2==0},odd:function(a,i){return i%2},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a},"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling")},parent:function(a){return a.firstChild},empty:function(a){return !a.firstChild},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"},enabled:function(a){return !a.disabled},disabled:function(a){return a.disabled},checked:function(a){return a.checked},selected:function(a){return a.selected||jQuery.attr(a,"selected")},text:function(a){return"text"==a.type},radio:function(a){return"radio"==a.type},checkbox:function(a){return"checkbox"==a.type},file:function(a){return"file"==a.type},password:function(a){return"password"==a.type},submit:function(a){return"submit"==a.type},image:function(a){return"image"==a.type},reset:function(a){return"reset"==a.type},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button")},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},has:function(a,i,m){return jQuery.find(m[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem}).length}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r)}return cur},find:function(t,context){if(typeof t!="string"){return[t]}if(context&&context.nodeType!=1&&context.nodeType!=9){return[]}context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false;var re=quickChild;var m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++){for(var c=ret[i].firstChild;c;c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c)}}}ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0){continue}foundToken=true}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id]){break}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true}r.push(n)}if(m=="+"){break}}}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length)}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]]}else{re2=quickClass;m=re2.exec(t)}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0]}ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[]}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param"}r=jQuery.merge(r,ret[i].getElementsByTagName(tag))}if(m[1]=="."){r=jQuery.classFilter(r,m[2])}if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break}}r=tmp}ret=r}t=t.replace(re2,"")}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t)}}if(t){ret=[]}if(ret&&context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);return done},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass){tmp.push(r[i])}}return tmp},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break}}if(!m){break}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3])}else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not)}else{if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||""}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)}}r=tmp}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;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++}}merge[id]=true}var add=false;if(first==0){if(node.nodeIndex==last){add=true}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true}}if(add^not){tmp.push(node)}}r=tmp}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object"){fn=fn[m[2]]}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}")}r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r)},not)}}}}}return{r:r,t:t}},dir:function(elem,dir){var matched=[];var cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur)}cur=cur[dir]}return matched},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType==1&&++num==result){break}}return cur},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&(!elem||n!=elem)){r.push(n)}}return r}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return }if(jQuery.browser.msie&&elem.setInterval!=undefined){elem=window}if(!handler.guid){handler.guid=this.guid++}if(data!=undefined){var fn=handler;handler=function(){return fn.apply(this,arguments)};handler.data=data;handler.guid=fn.guid}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){var val;if(typeof jQuery=="undefined"||jQuery.event.triggered){return val}val=jQuery.event.handle.apply(arguments.callee.elem,arguments);return val});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)}}}}handlers[handler.guid]=handler;jQuery.event.global[type]=true});elem=null},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return }var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""))}}else{if(types.type){handler=types.handler;types=types.type}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler){delete events[type][handler.guid]}else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler]}}}for(ret in events[type]){break}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)}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))}}}ret=null;delete events[type]}}})}for(ret in events){break}if(!ret){var handle=jQuery.data(elem,"handle");if(handle){handle.elem=null}jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle")}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data||[]);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true}if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data)}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined}var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift(this.fix({type:type,target:elem}))}data[0].type=type;if(exclusive){data[0].exclusive=true}if(jQuery.isFunction(jQuery.data(elem,"handle"))){val=jQuery.data(elem,"handle").apply(elem,data)}if(!fn&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false}if(event){data.shift()}if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined){val=ret}}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;try{elem[type]()}catch(e){}}this.triggered=false}return val},handle:function(event){var val;event=jQuery.event.fix(event||window.event||{});var parts=event.type.split(".");event.type=parts[0];var handlers=jQuery.data(this,"events")&&jQuery.data(this,"events")[event.type],args=Array.prototype.slice.call(arguments,1);args.unshift(event);for(var j in handlers){var handler=handlers[j];args[0].handler=handler;args[0].data=handler.data;if(!parts[1]&&!event.exclusive||handler.type==parts[1]){var ret=handler.apply(this,args);if(val!==false){val=ret}if(ret===false){event.preventDefault();event.stopPropagation()}}}if(jQuery.browser.msie){event.target=event.preventDefault=event.stopPropagation=event.handler=event.data=null}return val},fix:function(event){var originalEvent=event;event=jQuery.extend({},originalEvent);event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault()}originalEvent.returnValue=false};event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation()}originalEvent.cancelBubble=true};if(!event.target){event.target=event.srcElement||document}if(event.target.nodeType==3){event.target=originalEvent.target.parentNode}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}return event},special:{ready:{setup:function(){bindReady();return },teardown:function(){return }},mouseenter:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true},handler:function(event){if(withinElement(event,this)){return true}arguments[0].type="mouseenter";return jQuery.event.handle.apply(this,arguments)}},mouseleave:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true},handler:function(event){if(withinElement(event,this)){return true}arguments[0].type="mouseleave";return jQuery.event.handle.apply(this,arguments)}}}};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)})},one:function(type,data,fn){return this.each(function(){jQuery.event.add(this,type,function(event){jQuery(this).unbind(event);return(fn||data).apply(this,arguments)},fn&&data)})},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)})},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn)})},triggerHandler:function(type,data,fn){if(this[0]){return jQuery.event.trigger(type,data,this[0],false,fn)}return undefined},toggle:function(){var args=arguments;return this.click(function(event){this.lastToggle=0==this.lastToggle?1:0;event.preventDefault();return args[this.lastToggle].apply(this,arguments)||false})},hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut)},ready:function(fn){bindReady();if(jQuery.isReady){fn.call(document,jQuery)}else{jQuery.readyList.push(function(){return fn.call(this,jQuery)})}return this}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.apply(document)});jQuery.readyList=null}jQuery(document).triggerHandler("ready")}}});var readyBound=false;function bindReady(){if(readyBound){return }readyBound=true;if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false)}if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return }try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return }jQuery.ready()})()}if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return }for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return }}jQuery.ready()},false)}if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady){return }if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return }if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length}if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return }jQuery.ready()})()}jQuery.event.add(window,"load",jQuery.ready)}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)}});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem){try{parent=parent.parentNode}catch(error){parent=elem}}return parent==elem};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind()});jQuery.fn.extend({load:function(url,params,callback){if(jQuery.isFunction(url)){return this.bind("load",url)}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off)}callback=callback||function(){};var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else{params=jQuery.param(params);type="POST"}}var self=this;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)}self.each(callback,[res.responseText,status,res])}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});var jsc=(new Date).getTime();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{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){var jsonp,jsre=/=\?(&|$)/g,status,data;s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data)}if(s.dataType=="jsonp"){if(s.type.toLowerCase()=="get"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}}s.dataType="json"}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}if(head){head.removeChild(script)}}}if(s.dataType=="script"&&s.cache==null){s.cache=false}if(s.cache===false&&s.type.toLowerCase()=="get"){var ts=(new Date()).getTime();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")}if(s.data&&s.type.toLowerCase()=="get"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}if((!s.url.indexOf("http")||!s.url.indexOf("//"))&&s.dataType=="script"&&s.type.toLowerCase()=="get"){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script)}}}head.appendChild(script);return undefined}var requestDone=false;var xml=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();xml.open(s.type,s.url,s.async,s.username,s.password);try{if(s.data){xml.setRequestHeader("Content-Type",s.contentType)}if(s.ifModified){xml.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}xml.setRequestHeader("X-Requested-With","XMLHttpRequest");xml.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend){s.beforeSend(xml)}if(s.global){jQuery.event.trigger("ajaxSend",[xml,s])}var onreadystatechange=function(isTimeout){if(!requestDone&&xml&&(xml.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xml)&&"error"||s.ifModified&&jQuery.httpNotModified(xml,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xml,s.dataType)}catch(e){status="parsererror"}}if(status=="success"){var modRes;try{modRes=xml.getResponseHeader("Last-Modified")}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes}if(!jsonp){success()}}else{jQuery.handleError(s,xml,status)}complete();if(s.async){xml=null}}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0){setTimeout(function(){if(xml){xml.abort();if(!requestDone){onreadystatechange("timeout")}}},s.timeout)}}try{xml.send(s.data)}catch(e){jQuery.handleError(s,xml,null,e)}if(!s.async){onreadystatechange()}function success(){if(s.success){s.success(data,status)}if(s.global){jQuery.event.trigger("ajaxSuccess",[xml,s])}}function complete(){if(s.complete){s.complete(xml,status)}if(s.global){jQuery.event.trigger("ajaxComplete",[xml,s])}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}return xml},handleError:function(s,xml,status,e){if(s.error){s.error(xml,status,e)}if(s.global){jQuery.event.trigger("ajaxError",[xml,s,e])}},active:0,httpSuccess:function(r){try{return !r.status&&location.protocol=="file:"||(r.status>=200&&r.status<300)||r.status==304||r.status==1223||jQuery.browser.safari&&r.status==undefined}catch(e){}return false},httpNotModified:function(xml,url){try{var xmlRes=xml.getResponseHeader("Last-Modified");return xml.status==304||xmlRes==jQuery.lastModified[url]||jQuery.browser.safari&&xml.status==undefined}catch(e){}return false},httpData:function(r,type){var ct=r.getResponseHeader("content-type");var xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0;var data=xml?r.responseXML:r.responseText;if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror"}if(type=="script"){jQuery.globalEval(data)}if(type=="json"){data=eval("("+data+")")}return data},param:function(a){var s=[];if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value))})}else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this))})}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(a[j]))}}}return s.join("&").replace(/%20/g,"+")}});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||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none"){this.style.display="block"}elem.remove()}}).end()},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");this.style.display="none"}).end()},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle(fn,fn2):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]()})},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback)},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback)},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback)},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback)},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback)},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false}var opt=jQuery.extend({},optall);var hidden=jQuery(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return jQuery.isFunction(opt.complete)&&opt.complete.apply(this)}if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}}if(opt.overflow!=null){this.style.overflow="hidden"}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop)}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start}e.custom(start,end,unit)}else{e.custom(start,val,"")}}});return true})},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx"}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type)}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn)}else{queue(this,type).push(fn);if(queue(this,type).length==1){fn.apply(this)}}})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true)}timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}return this}});var queue=function(elem,type,array){if(!elem){return undefined}type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array){q=jQuery.data(elem,type+"queue",array?jQuery.makeArray(array):[])}return q};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length){q[0].apply(this)}})};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};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()}if(jQuery.isFunction(opt.old)){opt.old.apply(this)}};return opt},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.apply(this.elem,[this.now,this])}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block"}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop]}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px"}jQuery(this.elem).show()},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(gotoEnd){var t=(new Date()).getTime();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){this.elem.style.display="none"}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p])}}}if(done&&jQuery.isFunction(this.options.complete)){this.options.complete.apply(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now},scrollTop:function(fx){fx.elem.scrollTop=fx.now},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit}};jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;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),fixed=jQuery.css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop)}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent)}if(!fixed&&jQuery.css(offsetParent,"position")=="fixed"){fixed=true}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(jQuery.css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop)}if(mozilla&&jQuery.css(parent,"overflow")!="visible"){border(parent)}parent=parent.parentNode}if((safari2&&(fixed||jQuery.css(offsetChild,"position")=="absolute"))||(mozilla&&jQuery.css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop)}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop))}}results={top:top,left:left}}}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true))}function add(l,t){left+=parseInt(l)||0;top+=parseInt(t)||0}return results}})();SimileAjax.jQuery=jQuery.noConflict(true);if(typeof window["$"]=="undefined"){window.$=SimileAjax.jQuery}SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};(function(){var I=navigator.appName.toLowerCase();var F=navigator.userAgent.toLowerCase();SimileAjax.Platform.os.isMac=(F.indexOf("mac")!=-1);SimileAjax.Platform.os.isWin=(F.indexOf("win")!=-1);SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(F.indexOf("95")!=-1||F.indexOf("98")!=-1||F.indexOf("nt")!=-1||F.indexOf("win32")!=-1||F.indexOf("32bit")!=-1);SimileAjax.Platform.os.isUnix=(F.indexOf("x11")!=-1);SimileAjax.Platform.browser.isIE=(I.indexOf("microsoft")!=-1);SimileAjax.Platform.browser.isNetscape=(I.indexOf("netscape")!=-1);SimileAjax.Platform.browser.isMozilla=(F.indexOf("mozilla")!=-1);SimileAjax.Platform.browser.isFirefox=(F.indexOf("firefox")!=-1);SimileAjax.Platform.browser.isOpera=(I.indexOf("opera")!=-1);SimileAjax.Platform.browser.isSafari=(I.indexOf("safari")!=-1);var G=function(A){var B=A.split(".");SimileAjax.Platform.browser.majorVersion=parseInt(B[0]);SimileAjax.Platform.browser.minorVersion=parseInt(B[1])};var J=function(B,C,A){var D=B.indexOf(C,A);return D>=0?D:B.length};if(SimileAjax.Platform.browser.isMozilla){var H=F.indexOf("mozilla/");if(H>=0){G(F.substring(H+8,J(F," ",H)))}}if(SimileAjax.Platform.browser.isIE){var H=F.indexOf("msie ");if(H>=0){G(F.substring(H+5,J(F,";",H)))}}if(SimileAjax.Platform.browser.isNetscape){var H=F.indexOf("rv:");if(H>=0){G(F.substring(H+3,J(F,")",H)))}}if(SimileAjax.Platform.browser.isFirefox){var H=F.indexOf("firefox/");if(H>=0){G(F.substring(H+8,J(F," ",H)))}}if(!("localeCompare" in String.prototype)){String.prototype.localeCompare=function(A){if(this<A){return -1}else{if(this>A){return 1}else{return 0}}}}})();SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale};SimileAjax.ListenerQueue=function(B){this._listeners=[];this._wildcardHandlerName=B};SimileAjax.ListenerQueue.prototype.add=function(B){this._listeners.push(B)};SimileAjax.ListenerQueue.prototype.remove=function(E){var F=this._listeners;for(var D=0;D<F.length;D++){if(F[D]==E){F.splice(D,1);break}}};SimileAjax.ListenerQueue.prototype.fire=function(L,G){var J=[].concat(this._listeners);for(var K=0;K<J.length;K++){var I=J[K];if(L in I){try{I[L].apply(I,G)}catch(H){SimileAjax.Debug.exception("Error firing event of name "+L,H)}}else{if(this._wildcardHandlerName!=null&&this._wildcardHandlerName in I){try{I[this._wildcardHandlerName].apply(I,[L])}catch(H){SimileAjax.Debug.exception("Error firing event of name "+L+" to wildcard handler",H)}}}}};SimileAjax.Set=function(C){this._hash={};this._count=0;if(C instanceof Array){for(var D=0;D<C.length;D++){this.add(C[D])}}else{if(C instanceof SimileAjax.Set){this.addSet(C)}}};SimileAjax.Set.prototype.add=function(B){if(!(B in this._hash)){this._hash[B]=true;this._count++;return true}return false};SimileAjax.Set.prototype.addSet=function(D){for(var C in D._hash){this.add(C)}};SimileAjax.Set.prototype.remove=function(B){if(B in this._hash){delete this._hash[B];this._count--;return true}return false};SimileAjax.Set.prototype.removeSet=function(D){for(var C in D._hash){this.remove(C)}};SimileAjax.Set.prototype.retainSet=function(D){for(var C in this._hash){if(!D.contains(C)){delete this._hash[C];this._count--}}};SimileAjax.Set.prototype.contains=function(B){return(B in this._hash)};SimileAjax.Set.prototype.size=function(){return this._count};SimileAjax.Set.prototype.toArray=function(){var C=[];for(var D in this._hash){C.push(D)}return C};SimileAjax.Set.prototype.visit=function(C){for(var D in this._hash){if(C(D)==true){break}}};SimileAjax.SortedArray=function(D,C){this._a=(C instanceof Array)?C:[];this._compare=D};SimileAjax.SortedArray.prototype.add=function(E){var D=this;var F=this.find(function(A){return D._compare(A,E)});if(F<this._a.length){this._a.splice(F,0,E)}else{this._a.push(E)}};SimileAjax.SortedArray.prototype.remove=function(E){var D=this;var F=this.find(function(A){return D._compare(A,E)});while(F<this._a.length&&this._compare(this._a[F],E)==0){if(this._a[F]==E){this._a.splice(F,1);return true}else{F++}}return false};SimileAjax.SortedArray.prototype.removeAll=function(){this._a=[]};SimileAjax.SortedArray.prototype.elementAt=function(B){return this._a[B]};SimileAjax.SortedArray.prototype.length=function(){return this._a.length};SimileAjax.SortedArray.prototype.find=function(H){var J=0;var F=this._a.length;while(J<F){var I=Math.floor((J+F)/2);var G=H(this._a[I]);if(I==J){return G<0?J+1:J}else{if(G<0){J=I}else{F=I}}}return J};SimileAjax.SortedArray.prototype.getFirst=function(){return(this._a.length>0)?this._a[0]:null};SimileAjax.SortedArray.prototype.getLast=function(){return(this._a.length>0)?this._a[this._a.length-1]:null};SimileAjax.EventIndex=function(D){var C=this;this._unit=(D!=null)?D:SimileAjax.NativeDateUnit;this._events=new SimileAjax.SortedArray(function(A,B){return C._unit.compare(A.getStart(),B.getStart())});this._idToEvent={};this._indexed=true};SimileAjax.EventIndex.prototype.getUnit=function(){return this._unit};SimileAjax.EventIndex.prototype.getEvent=function(B){return this._idToEvent[B]};SimileAjax.EventIndex.prototype.add=function(B){this._events.add(B);this._idToEvent[B.getID()]=B;this._indexed=false};SimileAjax.EventIndex.prototype.removeAll=function(){this._events.removeAll();this._idToEvent={};this._indexed=false};SimileAjax.EventIndex.prototype.getCount=function(){return this._events.length()};SimileAjax.EventIndex.prototype.getIterator=function(C,D){if(!this._indexed){this._index()}return new SimileAjax.EventIndex._Iterator(this._events,C,D,this._unit)};SimileAjax.EventIndex.prototype.getReverseIterator=function(C,D){if(!this._indexed){this._index()}return new SimileAjax.EventIndex._ReverseIterator(this._events,C,D,this._unit)};SimileAjax.EventIndex.prototype.getAllIterator=function(){return new SimileAjax.EventIndex._AllIterator(this._events)};SimileAjax.EventIndex.prototype.getEarliestDate=function(){var B=this._events.getFirst();return(B==null)?null:B.getStart()};SimileAjax.EventIndex.prototype.getLatestDate=function(){var E=this._events.getLast();if(E==null){return null}if(!this._indexed){this._index()}var G=E._earliestOverlapIndex;var H=this._events.elementAt(G).getEnd();for(var F=G+1;F<this._events.length();F++){H=this._unit.later(H,this._events.elementAt(F).getEnd())}return H};SimileAjax.EventIndex.prototype._index=function(){var L=this._events.length();for(var K=0;K<L;K++){var M=this._events.elementAt(K);M._earliestOverlapIndex=K}var I=1;for(var K=0;K<L;K++){var M=this._events.elementAt(K);var N=M.getEnd();I=Math.max(I,K+1);while(I<L){var H=this._events.elementAt(I);var J=H.getStart();if(this._unit.compare(J,N)<0){H._earliestOverlapIndex=K;I++}else{break}}}this._indexed=true};SimileAjax.EventIndex._Iterator=function(H,E,F,G){this._events=H;this._startDate=E;this._endDate=F;this._unit=G;this._currentIndex=H.find(function(A){return G.compare(A.getStart(),E)});if(this._currentIndex-1>=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex}this._currentIndex--;this._maxIndex=H.find(function(A){return G.compare(A.getStart(),F)});this._hasNext=false;this._next=null;this._findNext()};SimileAjax.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext},next:function(){if(this._hasNext){var B=this._next;this._findNext();return B}else{return null}},_findNext:function(){var D=this._unit;while((++this._currentIndex)<this._maxIndex){var C=this._events.elementAt(this._currentIndex);if(D.compare(C.getStart(),this._endDate)<0&&D.compare(C.getEnd(),this._startDate)>0){this._next=C;this._hasNext=true;return }}this._next=null;this._hasNext=false}};SimileAjax.EventIndex._ReverseIterator=function(H,E,F,G){this._events=H;this._startDate=E;this._endDate=F;this._unit=G;this._minIndex=H.find(function(A){return G.compare(A.getStart(),E)});if(this._minIndex-1>=0){this._minIndex=this._events.elementAt(this._minIndex-1)._earliestOverlapIndex}this._maxIndex=H.find(function(A){return G.compare(A.getStart(),F)});this._currentIndex=this._maxIndex;this._hasNext=false;this._next=null;this._findNext()};SimileAjax.EventIndex._ReverseIterator.prototype={hasNext:function(){return this._hasNext},next:function(){if(this._hasNext){var B=this._next;this._findNext();return B}else{return null}},_findNext:function(){var D=this._unit;while((--this._currentIndex)>=this._minIndex){var C=this._events.elementAt(this._currentIndex);if(D.compare(C.getStart(),this._endDate)<0&&D.compare(C.getEnd(),this._startDate)>0){this._next=C;this._hasNext=true;return }}this._next=null;this._hasNext=false}};SimileAjax.EventIndex._AllIterator=function(B){this._events=B;this._index=0};SimileAjax.EventIndex._AllIterator.prototype={hasNext:function(){return this._index<this._events.length()},next:function(){return this._index<this._events.length()?this._events.elementAt(this._index++):null}};SimileAjax.DateTime=new Object();SimileAjax.DateTime.MILLISECOND=0;SimileAjax.DateTime.SECOND=1;SimileAjax.DateTime.MINUTE=2;SimileAjax.DateTime.HOUR=3;SimileAjax.DateTime.DAY=4;SimileAjax.DateTime.WEEK=5;SimileAjax.DateTime.MONTH=6;SimileAjax.DateTime.YEAR=7;SimileAjax.DateTime.DECADE=8;SimileAjax.DateTime.CENTURY=9;SimileAjax.DateTime.MILLENNIUM=10;SimileAjax.DateTime.EPOCH=-1;SimileAjax.DateTime.ERA=-2;SimileAjax.DateTime.gregorianUnitLengths=[];(function(){var D=SimileAjax.DateTime;var C=D.gregorianUnitLengths;C[D.MILLISECOND]=1;C[D.SECOND]=1000;C[D.MINUTE]=C[D.SECOND]*60;C[D.HOUR]=C[D.MINUTE]*60;C[D.DAY]=C[D.HOUR]*24;C[D.WEEK]=C[D.DAY]*7;C[D.MONTH]=C[D.DAY]*31;C[D.YEAR]=C[D.DAY]*365;C[D.DECADE]=C[D.YEAR]*10;C[D.CENTURY]=C[D.YEAR]*100;C[D.MILLENNIUM]=C[D.YEAR]*1000})();SimileAjax.DateTime._dateRegexp=new RegExp("^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$");SimileAjax.DateTime._timezoneRegexp=new RegExp("Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$");SimileAjax.DateTime._timeRegexp=new RegExp("^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$");SimileAjax.DateTime.setIso8601Date=function(W,Y){var V=Y.match(SimileAjax.DateTime._dateRegexp);if(!V){throw new Error("Invalid date string: "+Y)}var P=(V[1]=="-")?-1:1;var U=P*V[2];var X=V[5];var O=V[7];var Z=V[9];var Q=V[11];var R=(V[13])?V[13]:1;W.setUTCFullYear(U);if(Z){W.setUTCMonth(0);W.setUTCDate(Number(Z))}else{if(Q){W.setUTCMonth(0);W.setUTCDate(1);var S=W.getUTCDay();var T=(S)?S:7;var N=Number(R)+(7*Number(Q));if(T<=4){W.setUTCDate(N+1-T)}else{W.setUTCDate(N+8-T)}}else{if(X){W.setUTCDate(1);W.setUTCMonth(X-1)}if(O){W.setUTCDate(O)}}}return W};SimileAjax.DateTime.setIso8601Time=function(J,M){var I=M.match(SimileAjax.DateTime._timeRegexp);if(!I){SimileAjax.Debug.warn("Invalid time string: "+M);return false}var H=I[1];var K=Number((I[3])?I[3]:0);var L=(I[5])?I[5]:0;var N=I[7]?(Number("0."+I[7])*1000):0;J.setUTCHours(H);J.setUTCMinutes(K);J.setUTCSeconds(L);J.setUTCMilliseconds(N);return J};SimileAjax.DateTime.timezoneOffset=new Date().getTimezoneOffset();SimileAjax.DateTime.setIso8601=function(J,F){var H=null;var G=(F.indexOf("T")==-1)?F.split(" "):F.split("T");SimileAjax.DateTime.setIso8601Date(J,G[0]);if(G.length==2){var I=G[1].match(SimileAjax.DateTime._timezoneRegexp);if(I){if(I[0]=="Z"){H=0}else{H=(Number(I[3])*60)+Number(I[5]);H*=((I[2]=="-")?1:-1)}G[1]=G[1].substr(0,G[1].length-I[0].length)}SimileAjax.DateTime.setIso8601Time(J,G[1])}if(H==null){H=J.getTimezoneOffset()}J.setTime(J.getTime()+H*60000);return J};SimileAjax.DateTime.parseIso8601DateTime=function(C){try{return SimileAjax.DateTime.setIso8601(new Date(0),C)}catch(D){return null}};SimileAjax.DateTime.parseGregorianDateTime=function(I){if(I==null){return null}else{if(I instanceof Date){return I}}var N=I.toString();if(N.length>0&&N.length<8){var M=N.indexOf(" ");if(M>0){var H=parseInt(N.substr(0,M));var K=N.substr(M+1);if(K.toLowerCase()=="bc"){H=1-H}}else{var H=parseInt(N)}var J=new Date(0);J.setUTCFullYear(H);return J}try{return new Date(Date.parse(N))}catch(L){return null}};SimileAjax.DateTime.roundDownToInterval=function(N,T,Q,P,O){var L=Q*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];var R=new Date(N.getTime()+L);var V=function(A){A.setUTCMilliseconds(0);A.setUTCSeconds(0);A.setUTCMinutes(0);A.setUTCHours(0)};var M=function(A){V(A);A.setUTCDate(1);A.setUTCMonth(0)};switch(T){case SimileAjax.DateTime.MILLISECOND:var S=R.getUTCMilliseconds();R.setUTCMilliseconds(S-(S%P));break;case SimileAjax.DateTime.SECOND:R.setUTCMilliseconds(0);var S=R.getUTCSeconds();R.setUTCSeconds(S-(S%P));break;case SimileAjax.DateTime.MINUTE:R.setUTCMilliseconds(0);R.setUTCSeconds(0);var S=R.getUTCMinutes();R.setTime(R.getTime()-(S%P)*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);break;case SimileAjax.DateTime.HOUR:R.setUTCMilliseconds(0);R.setUTCSeconds(0);R.setUTCMinutes(0);var S=R.getUTCHours();R.setUTCHours(S-(S%P));break;case SimileAjax.DateTime.DAY:V(R);break;case SimileAjax.DateTime.WEEK:V(R);var U=(R.getUTCDay()+7-O)%7;R.setTime(R.getTime()-U*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]);break;case SimileAjax.DateTime.MONTH:V(R);R.setUTCDate(1);var S=R.getUTCMonth();R.setUTCMonth(S-(S%P));break;case SimileAjax.DateTime.YEAR:M(R);var S=R.getUTCFullYear();R.setUTCFullYear(S-(S%P));break;case SimileAjax.DateTime.DECADE:M(R);R.setUTCFullYear(Math.floor(R.getUTCFullYear()/10)*10);break;case SimileAjax.DateTime.CENTURY:M(R);R.setUTCFullYear(Math.floor(R.getUTCFullYear()/100)*100);break;case SimileAjax.DateTime.MILLENNIUM:M(R);R.setUTCFullYear(Math.floor(R.getUTCFullYear()/1000)*1000);break}N.setTime(R.getTime()-L)};SimileAjax.DateTime.roundUpToInterval=function(J,H,K,G,L){var I=J.getTime();SimileAjax.DateTime.roundDownToInterval(J,H,K,G,L);if(J.getTime()<I){J.setTime(J.getTime()+SimileAjax.DateTime.gregorianUnitLengths[H]*G)}};SimileAjax.DateTime.incrementByInterval=function(J,G,F){F=(typeof F=="undefined")?0:F;var H=F*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];var I=new Date(J.getTime()+H);switch(G){case SimileAjax.DateTime.MILLISECOND:I.setTime(I.getTime()+1);break;case SimileAjax.DateTime.SECOND:I.setTime(I.getTime()+1000);break;case SimileAjax.DateTime.MINUTE:I.setTime(I.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);break;case SimileAjax.DateTime.HOUR:I.setTime(I.getTime()+SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]);break;case SimileAjax.DateTime.DAY:I.setUTCDate(I.getUTCDate()+1);break;case SimileAjax.DateTime.WEEK:I.setUTCDate(I.getUTCDate()+7);break;case SimileAjax.DateTime.MONTH:I.setUTCMonth(I.getUTCMonth()+1);break;case SimileAjax.DateTime.YEAR:I.setUTCFullYear(I.getUTCFullYear()+1);break;case SimileAjax.DateTime.DECADE:I.setUTCFullYear(I.getUTCFullYear()+10);break;case SimileAjax.DateTime.CENTURY:I.setUTCFullYear(I.getUTCFullYear()+100);break;case SimileAjax.DateTime.MILLENNIUM:I.setUTCFullYear(I.getUTCFullYear()+1000);break}J.setTime(I.getTime()-H)};SimileAjax.DateTime.removeTimeZoneOffset=function(D,C){return new Date(D.getTime()+C*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR])};SimileAjax.DateTime.getTimezone=function(){var B=new Date().getTimezoneOffset();return B/-60};SimileAjax.Debug={silent:false};SimileAjax.Debug.log=function(D){var C;if("console" in window&&"log" in window.console){C=function(A){console.log(A)}}else{C=function(A){if(!SimileAjax.Debug.silent){alert(A)}}}SimileAjax.Debug.log=C;C(D)};SimileAjax.Debug.warn=function(D){var C;if("console" in window&&"warn" in window.console){C=function(A){console.warn(A)}}else{C=function(A){if(!SimileAjax.Debug.silent){alert(A)}}}SimileAjax.Debug.warn=C;C(D)};SimileAjax.Debug.exception=function(H,F){var E,G=SimileAjax.parseURLParameters();if(G.errors=="throw"||SimileAjax.params.errors=="throw"){E=function(A,B){throw (A)}}else{if("console" in window&&"error" in window.console){E=function(A,B){if(B!=null){console.error(B+" %o",A)}else{console.error(A)}throw (A)}}else{E=function(A,B){if(!SimileAjax.Debug.silent){alert("Caught exception: "+B+"\n\nDetails: "+("description" in A?A.description:A))}throw (A)}}}SimileAjax.Debug.exception=E;E(H,F)};SimileAjax.Debug.objectToString=function(B){return SimileAjax.Debug._objectToString(B,"")};SimileAjax.Debug._objectToString=function(H,F){var I=F+" ";if(typeof H=="object"){var J="{";for(G in H){J+=I+G+": "+SimileAjax.Debug._objectToString(H[G],I)+"\n"}J+=F+"}";return J}else{if(typeof H=="array"){var J="[";for(var G=0;G<H.length;G++){J+=SimileAjax.Debug._objectToString(H[G],I)+"\n"}J+=F+"]";return J}else{return H}}};SimileAjax.DOM=new Object();SimileAjax.DOM.registerEventWithObject=function(G,E,F,H){SimileAjax.DOM.registerEvent(G,E,function(B,C,A){return F[H].call(F,B,C,A)})};SimileAjax.DOM.registerEvent=function(G,H,F){var E=function(B){B=(B)?B:((event)?event:null);if(B){var A=(B.target)?B.target:((B.srcElement)?B.srcElement:null);if(A){A=(A.nodeType==1||A.nodeType==9)?A:A.parentNode}return F(G,B,A)}return true};if(SimileAjax.Platform.browser.isIE){G.attachEvent("on"+H,E)}else{G.addEventListener(H,E,false)}};SimileAjax.DOM.getPageCoordinates=function(J){var G=0;var H=0;if(J.nodeType!=1){J=J.parentNode}var I=J;while(I!=null){G+=I.offsetLeft;H+=I.offsetTop;I=I.offsetParent}var F=document.body;while(J!=null&&J!=F){if("scrollLeft" in J){G-=J.scrollLeft;H-=J.scrollTop}J=J.parentNode}return{left:G,top:H}};SimileAjax.DOM.getSize=function(F){var D=this.getStyle(F,"width");var E=this.getStyle(F,"height");if(D.indexOf("px")>-1){D=D.replace("px","")}if(E.indexOf("px")>-1){E=E.replace("px","")}return{w:D,h:E}};SimileAjax.DOM.getStyle=function(F,D){if(F.currentStyle){var E=F.currentStyle[D]}else{if(window.getComputedStyle){var E=document.defaultView.getComputedStyle(F,null).getPropertyValue(D)}else{var E=""}}return E};SimileAjax.DOM.getEventRelativeCoordinates=function(D,F){if(SimileAjax.Platform.browser.isIE){return{x:D.offsetX,y:D.offsetY}}else{var E=SimileAjax.DOM.getPageCoordinates(F);return{x:D.pageX-E.left,y:D.pageY-E.top}}};SimileAjax.DOM.getEventPageCoordinates=function(B){if(SimileAjax.Platform.browser.isIE){return{x:B.clientX+document.body.scrollLeft,y:B.clientY+document.body.scrollTop}}else{return{x:B.pageX,y:B.pageY}}};SimileAjax.DOM.hittest=function(D,E,F){return SimileAjax.DOM._hittest(document.body,D,E,F)};SimileAjax.DOM._hittest=function(O,S,T,W){var R=O.childNodes;outer:for(var X=0;X<R.length;X++){var Q=R[X];for(var Y=0;Y<W.length;Y++){if(Q==W[Y]){continue outer}}if(Q.offsetWidth==0&&Q.offsetHeight==0){var P=SimileAjax.DOM._hittest(Q,S,T,W);if(P!=Q){return P}}else{var U=0;var Z=0;var N=Q;while(N){U+=N.offsetTop;Z+=N.offsetLeft;N=N.offsetParent}if(Z<=S&&U<=T&&(S-Z)<Q.offsetWidth&&(T-U)<Q.offsetHeight){return SimileAjax.DOM._hittest(Q,S,T,W)}else{if(Q.nodeType==1&&Q.tagName=="TR"){var V=SimileAjax.DOM._hittest(Q,S,T,W);if(V!=Q){return V}}}}}return O};SimileAjax.DOM.cancelEvent=function(B){B.returnValue=false;B.cancelBubble=true;if("preventDefault" in B){B.preventDefault()}};SimileAjax.DOM.appendClassName=function(G,F){var H=G.className.split(" ");for(var E=0;E<H.length;E++){if(H[E]==F){return }}H.push(F);G.className=H.join(" ")};SimileAjax.DOM.createInputElement=function(C){var D=document.createElement("div");D.innerHTML="<input type='"+C+"' />";return D.firstChild};SimileAjax.DOM.createDOMFromTemplate=function(D){var C={};C.elmt=SimileAjax.DOM._createDOMFromTemplate(D,C,null);return C};SimileAjax.DOM._createDOMFromTemplate=function(N,P,T){if(N==null){return null}else{if(typeof N!="object"){var K=document.createTextNode(N);if(T!=null){T.appendChild(K)}return K}else{var L=null;if("tag" in N){var O=N.tag;if(T!=null){if(O=="tr"){L=T.insertRow(T.rows.length)}else{if(O=="td"){L=T.insertCell(T.cells.length)}}}if(L==null){L=O=="input"?SimileAjax.DOM.createInputElement(N.type):document.createElement(O);if(T!=null){T.appendChild(L)}}}else{L=N.elmt;if(T!=null){T.appendChild(L)}}for(var M in N){var R=N[M];if(M=="field"){P[R]=L}else{if(M=="className"){L.className=R}else{if(M=="id"){L.id=R}else{if(M=="title"){L.title=R}else{if(M=="type"&&L.tagName=="input"){}else{if(M=="style"){for(n in R){var Q=R[n];if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat"}L.style[n]=Q}}else{if(M=="children"){for(var S=0;S<R.length;S++){SimileAjax.DOM._createDOMFromTemplate(R[S],P,L)}}else{if(M!="tag"&&M!="elmt"){L.setAttribute(M,R)}}}}}}}}}return L}}};SimileAjax.DOM._cachedParent=null;SimileAjax.DOM.createElementFromString=function(B){if(SimileAjax.DOM._cachedParent==null){SimileAjax.DOM._cachedParent=document.createElement("div")}SimileAjax.DOM._cachedParent.innerHTML=B;return SimileAjax.DOM._cachedParent.firstChild};SimileAjax.DOM.createDOMFromString=function(F,I,H){var J=typeof F=="string"?document.createElement(F):F;J.innerHTML=I;var G={elmt:J};SimileAjax.DOM._processDOMChildrenConstructedFromString(G,J,H!=null?H:{});return G};SimileAjax.DOM._processDOMConstructedFromString=function(H,F,J){var G=F.id;if(G!=null&&G.length>0){F.removeAttribute("id");if(G in J){var I=F.parentNode;I.insertBefore(J[G],F);I.removeChild(F);H[G]=J[G];return }else{H[G]=F}}if(F.hasChildNodes()){SimileAjax.DOM._processDOMChildrenConstructedFromString(H,F,J)}};SimileAjax.DOM._processDOMChildrenConstructedFromString=function(G,J,H){var I=J.firstChild;while(I!=null){var F=I.nextSibling;if(I.nodeType==1){SimileAjax.DOM._processDOMConstructedFromString(G,I,H)}I=F}};SimileAjax.Graphics=new Object();SimileAjax.Graphics.pngIsTranslucent=(!SimileAjax.Platform.browser.isIE)||(SimileAjax.Platform.browser.majorVersion>6);SimileAjax.Graphics._createTranslucentImage1=function(D,E){var F=document.createElement("img");F.setAttribute("src",D);if(E!=null){F.style.verticalAlign=E}return F};SimileAjax.Graphics._createTranslucentImage2=function(D,E){var F=document.createElement("img");F.style.width="1px";F.style.height="1px";F.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+D+"', sizingMethod='image')";F.style.verticalAlign=(E!=null)?E:"middle";return F};SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2;SimileAjax.Graphics._createTranslucentImageHTML1=function(C,D){return'<img src="'+C+'"'+(D!=null?' style="vertical-align: '+D+';"':"")+" />"};SimileAjax.Graphics._createTranslucentImageHTML2=function(D,E){var F="width: 1px; height: 1px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+D+"', sizingMethod='image');"+(E!=null?" vertical-align: "+E+";":"");return"<img src='"+D+"' style=\""+F+'" />'};SimileAjax.Graphics.createTranslucentImageHTML=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImageHTML1:SimileAjax.Graphics._createTranslucentImageHTML2;SimileAjax.Graphics.setOpacity=function(F,D){if(SimileAjax.Platform.browser.isIE){F.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+D+")"}else{var E=(D/100).toString();F.style.opacity=E;F.style.MozOpacity=E}};SimileAjax.Graphics._bubbleMargins={top:33,bottom:42,left:33,right:40};SimileAjax.Graphics._arrowOffsets={top:0,bottom:9,left:1,right:8};SimileAjax.Graphics._bubblePadding=15;SimileAjax.Graphics._bubblePointOffset=6;SimileAjax.Graphics._halfArrowWidth=18;SimileAjax.Graphics.createBubbleForContentAndPoint=function(G,H,I,F,J){if(typeof F!="number"){F=300}G.style.position="absolute";G.style.left="-5000px";G.style.top="0px";G.style.width=F+"px";document.body.appendChild(G);window.setTimeout(function(){var A=G.scrollWidth+10;var C=G.scrollHeight+10;var B=SimileAjax.Graphics.createBubbleForPoint(H,I,A,C,J);document.body.removeChild(G);G.style.position="static";G.style.left="";G.style.top="";G.style.width=A+"px";B.content.appendChild(G)},200)};SimileAjax.Graphics.createBubbleForPoint=function(u,v,i,c,r){function a(){if(typeof window.innerHeight=="number"){return{w:window.innerWidth,h:window.innerHeight}}else{if(document.documentElement&&document.documentElement.clientHeight){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight}}else{if(document.body&&document.body.clientHeight){return{w:document.body.clientWidth,h:document.body.clientHeight}}}}}var k=function(){if(!j._closed){document.body.removeChild(j._div);j._doc=null;j._div=null;j._content=null;j._closed=true}};var j={_closed:false};var g=a();var p=g.w;var q=g.h;var t=SimileAjax.Graphics._bubbleMargins;i=parseInt(i,10);c=parseInt(c,10);var f=t.left+i+t.right;var Z=t.top+c+t.bottom;var e=SimileAjax.Graphics.pngIsTranslucent;var m=SimileAjax.urlPrefix;var w=function(B,C,A,D){B.style.position="absolute";B.style.width=A+"px";B.style.height=D+"px";if(e){B.style.background="url("+C+")"}else{B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+C+"', sizingMethod='crop')"}};var l=document.createElement("div");l.style.width=f+"px";l.style.height=Z+"px";l.style.position="absolute";l.style.zIndex=1000;var X=SimileAjax.WindowManager.pushLayer(k,true,l);j._div=l;j.close=function(){SimileAjax.WindowManager.popLayer(X)};var o=document.createElement("div");o.style.width="100%";o.style.height="100%";o.style.position="relative";l.appendChild(o);var b=function(C,F,A,B,D){var E=document.createElement("div");E.style.left=F+"px";E.style.top=A+"px";w(E,C,B,D);o.appendChild(E)};b(m+"images/bubble-top-left.png",0,0,t.left,t.top);b(m+"images/bubble-top.png",t.left,0,i,t.top);b(m+"images/bubble-top-right.png",t.left+i,0,t.right,t.top);b(m+"images/bubble-left.png",0,t.top,t.left,c);b(m+"images/bubble-right.png",t.left+i,t.top,t.right,c);b(m+"images/bubble-bottom-left.png",0,t.top+c,t.left,t.bottom);b(m+"images/bubble-bottom.png",t.left,t.top+c,i,t.bottom);b(m+"images/bubble-bottom-right.png",t.left+i,t.top+c,t.right,t.bottom);var Y=document.createElement("div");Y.style.left=(f-t.right+SimileAjax.Graphics._bubblePadding-16-2)+"px";Y.style.top=(t.top-SimileAjax.Graphics._bubblePadding+1)+"px";Y.style.cursor="pointer";w(Y,m+"images/close-button.png",16,16);SimileAjax.WindowManager.registerEventWithObject(Y,"click",j,"close");o.appendChild(Y);var s=document.createElement("div");s.style.position="absolute";s.style.left=t.left+"px";s.style.top=t.top+"px";s.style.width=i+"px";s.style.height=c+"px";s.style.overflow="auto";s.style.background="white";o.appendChild(s);j.content=s;(function(){if(u-SimileAjax.Graphics._halfArrowWidth-SimileAjax.Graphics._bubblePadding>0&&u+SimileAjax.Graphics._halfArrowWidth+SimileAjax.Graphics._bubblePadding<p){var A=u-Math.round(i/2)-t.left;A=u<(p/2)?Math.max(A,-(t.left-SimileAjax.Graphics._bubblePadding)):Math.min(A,p+(t.right-SimileAjax.Graphics._bubblePadding)-f);if((r&&r=="top")||(!r&&(v-SimileAjax.Graphics._bubblePointOffset-Z>0))){var C=document.createElement("div");C.style.left=(u-SimileAjax.Graphics._halfArrowWidth-A)+"px";C.style.top=(t.top+c)+"px";w(C,m+"images/bubble-bottom-arrow.png",37,t.bottom);o.appendChild(C);l.style.left=A+"px";l.style.top=(v-SimileAjax.Graphics._bubblePointOffset-Z+SimileAjax.Graphics._arrowOffsets.bottom)+"px";return }else{if((r&&r=="bottom")||(!r&&(v+SimileAjax.Graphics._bubblePointOffset+Z<q))){var C=document.createElement("div");C.style.left=(u-SimileAjax.Graphics._halfArrowWidth-A)+"px";C.style.top="0px";w(C,m+"images/bubble-top-arrow.png",37,t.top);o.appendChild(C);l.style.left=A+"px";l.style.top=(v+SimileAjax.Graphics._bubblePointOffset-SimileAjax.Graphics._arrowOffsets.top)+"px";return }}}var B=v-Math.round(c/2)-t.top;B=v<(q/2)?Math.max(B,-(t.top-SimileAjax.Graphics._bubblePadding)):Math.min(B,q+(t.bottom-SimileAjax.Graphics._bubblePadding)-Z);if((r&&r=="left")||(!r&&(u-SimileAjax.Graphics._bubblePointOffset-f>0))){var C=document.createElement("div");C.style.left=(t.left+i)+"px";C.style.top=(v-SimileAjax.Graphics._halfArrowWidth-B)+"px";w(C,m+"images/bubble-right-arrow.png",t.right,37);o.appendChild(C);l.style.left=(u-SimileAjax.Graphics._bubblePointOffset-f+SimileAjax.Graphics._arrowOffsets.right)+"px";l.style.top=B+"px"}else{if((r&&r=="right")||(!r&&(u-SimileAjax.Graphics._bubblePointOffset-f<p))){var C=document.createElement("div");C.style.left="0px";C.style.top=(v-SimileAjax.Graphics._halfArrowWidth-B)+"px";w(C,m+"images/bubble-left-arrow.png",t.left,37);o.appendChild(C);l.style.left=(u+SimileAjax.Graphics._bubblePointOffset-SimileAjax.Graphics._arrowOffsets.left)+"px";l.style.top=B+"px"}}})();document.body.appendChild(l);return j};SimileAjax.Graphics.createMessageBubble=function(O){var P=O.createElement("div");if(SimileAjax.Graphics.pngIsTranslucent){var N=O.createElement("div");N.style.height="33px";N.style.background="url("+SimileAjax.urlPrefix+"images/message-top-left.png) top left no-repeat";N.style.paddingLeft="44px";P.appendChild(N);var K=O.createElement("div");K.style.height="33px";K.style.background="url("+SimileAjax.urlPrefix+"images/message-top-right.png) top right no-repeat";N.appendChild(K);var Q=O.createElement("div");Q.style.background="url("+SimileAjax.urlPrefix+"images/message-left.png) top left repeat-y";Q.style.paddingLeft="44px";P.appendChild(Q);var M=O.createElement("div");M.style.background="url("+SimileAjax.urlPrefix+"images/message-right.png) top right repeat-y";M.style.paddingRight="44px";Q.appendChild(M);var J=O.createElement("div");M.appendChild(J);var L=O.createElement("div");L.style.height="55px";L.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat";L.style.paddingLeft="44px";P.appendChild(L);var R=O.createElement("div");R.style.height="55px";R.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat";L.appendChild(R)}else{P.style.border="2px solid #7777AA";P.style.padding="20px";P.style.background="white";SimileAjax.Graphics.setOpacity(P,90);var J=O.createElement("div");P.appendChild(J)}return{containerDiv:P,contentDiv:J}};SimileAjax.Graphics.createAnimation=function(J,G,H,I,F){return new SimileAjax.Graphics._Animation(J,G,H,I,F)};SimileAjax.Graphics._Animation=function(J,G,H,I,F){this.f=J;this.cont=(typeof F=="function")?F:function(){};this.from=G;this.to=H;this.current=G;this.duration=I;this.start=new Date().getTime();this.timePassed=0};SimileAjax.Graphics._Animation.prototype.run=function(){var B=this;window.setTimeout(function(){B.step()},50)};SimileAjax.Graphics._Animation.prototype.step=function(){this.timePassed+=50;var H=this.timePassed/this.duration;var E=-Math.cos(H*Math.PI)/2+0.5;var F=E*(this.to-this.from)+this.from;try{this.f(F,F-this.current)}catch(G){}this.current=F;if(this.timePassed<this.duration){this.run()}else{this.f(this.to,0);this["cont"]()}};SimileAjax.Graphics.createStructuredDataCopyButton=function(J,L,H,K){var I=document.createElement("div");I.style.position="relative";I.style.display="inline";I.style.width=L+"px";I.style.height=H+"px";I.style.overflow="hidden";I.style.margin="2px";if(SimileAjax.Graphics.pngIsTranslucent){I.style.background="url("+J+") no-repeat"}else{I.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+J+"', sizingMethod='image')"}var M;if(SimileAjax.Platform.browser.isIE){M="filter:alpha(opacity=0)"}else{M="opacity: 0"}I.innerHTML="<textarea rows='1' autocomplete='off' value='none' style='"+M+"' />";var N=I.firstChild;N.style.width=L+"px";N.style.height=H+"px";N.onmousedown=function(A){A=(A)?A:((event)?event:null);if(A.button==2){N.value=K();N.select()}};return I};SimileAjax.Graphics.getFontRenderingContext=function(C,D){return new SimileAjax.Graphics._FontRenderingContext(C,D)};SimileAjax.Graphics._FontRenderingContext=function(C,D){this._elmt=C;this._elmt.style.visibility="hidden";if(typeof D=="string"){this._elmt.style.width=D}else{if(typeof D=="number"){this._elmt.style.width=D+"px"}}};SimileAjax.Graphics._FontRenderingContext.prototype.dispose=function(){this._elmt=null};SimileAjax.Graphics._FontRenderingContext.prototype.update=function(){this._elmt.innerHTML="A";this._lineHeight=this._elmt.offsetHeight};SimileAjax.Graphics._FontRenderingContext.prototype.computeSize=function(B){this._elmt.innerHTML=B;return{width:this._elmt.offsetWidth,height:this._elmt.offsetHeight}};SimileAjax.Graphics._FontRenderingContext.prototype.getLineHeight=function(){return this._lineHeight};SimileAjax.History={maxHistoryLength:10,historyFile:"__history__.html",enabled:true,_initialized:false,_listeners:new SimileAjax.ListenerQueue(),_actions:[],_baseIndex:0,_currentIndex:0,_plainDocumentTitle:document.title};SimileAjax.History.formatHistoryEntryTitle=function(B){return SimileAjax.History._plainDocumentTitle+" {"+B+"}"};SimileAjax.History.initialize=function(){if(SimileAjax.History._initialized){return }if(SimileAjax.History.enabled){var B=document.createElement("iframe");B.id="simile-ajax-history";B.style.position="absolute";B.style.width="10px";B.style.height="10px";B.style.top="0px";B.style.left="0px";B.style.visibility="hidden";B.src=SimileAjax.History.historyFile+"?0";document.body.appendChild(B);SimileAjax.DOM.registerEvent(B,"load",SimileAjax.History._handleIFrameOnLoad);SimileAjax.History._iframe=B}SimileAjax.History._initialized=true};SimileAjax.History.addListener=function(B){SimileAjax.History.initialize();SimileAjax.History._listeners.add(B)};SimileAjax.History.removeListener=function(B){SimileAjax.History.initialize();SimileAjax.History._listeners.remove(B)};SimileAjax.History.addAction=function(B){SimileAjax.History.initialize();SimileAjax.History._listeners.fire("onBeforePerform",[B]);window.setTimeout(function(){try{B.perform();SimileAjax.History._listeners.fire("onAfterPerform",[B]);if(SimileAjax.History.enabled){SimileAjax.History._actions=SimileAjax.History._actions.slice(0,SimileAjax.History._currentIndex-SimileAjax.History._baseIndex);SimileAjax.History._actions.push(B);SimileAjax.History._currentIndex++;var E=SimileAjax.History._actions.length-SimileAjax.History.maxHistoryLength;if(E>0){SimileAjax.History._actions=SimileAjax.History._actions.slice(E);SimileAjax.History._baseIndex+=E}try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex}catch(F){var A=SimileAjax.History.formatHistoryEntryTitle(B.label);document.title=A}}}catch(F){SimileAjax.Debug.exception(F,"Error adding action {"+B.label+"} to history")}},0)};SimileAjax.History.addLengthyAction=function(E,D,F){SimileAjax.History.addAction({perform:E,undo:D,label:F,uiLayer:SimileAjax.WindowManager.getBaseLayer(),lengthy:true})};SimileAjax.History._handleIFrameOnLoad=function(){try{var L=SimileAjax.History._iframe.contentWindow.location.search;var H=(L.length==0)?0:Math.max(0,parseInt(L.substr(1)));var I=function(){var A=H-SimileAjax.History._currentIndex;SimileAjax.History._currentIndex+=A;SimileAjax.History._baseIndex+=A;SimileAjax.History._iframe.contentWindow.location.search="?"+H};if(H<SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeUndoSeveral",[]);window.setTimeout(function(){while(SimileAjax.History._currentIndex>H&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--;var B=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{B.undo()}catch(A){SimileAjax.Debug.exception(A,"History: Failed to undo action {"+B.label+"}")}}SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]);I()},0)}else{if(H>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]);window.setTimeout(function(){while(SimileAjax.History._currentIndex<H&&SimileAjax.History._currentIndex-SimileAjax.History._baseIndex<SimileAjax.History._actions.length){var B=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{B.perform()}catch(A){SimileAjax.Debug.exception(A,"History: Failed to redo action {"+B.label+"}")}SimileAjax.History._currentIndex++}SimileAjax.History._listeners.fire("onAfterRedoSeveral",[]);I()},0)}else{var G=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;var J=(G>=0&&G<SimileAjax.History._actions.length)?SimileAjax.History.formatHistoryEntryTitle(SimileAjax.History._actions[G].label):SimileAjax.History._plainDocumentTitle;SimileAjax.History._iframe.contentWindow.document.title=J;document.title=J}}}catch(K){}};SimileAjax.History.getNextUndoAction=function(){try{var C=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex-1;return SimileAjax.History._actions[C]}catch(D){return null}};SimileAjax.History.getNextRedoAction=function(){try{var C=SimileAjax.History._currentIndex-SimileAjax.History._baseIndex;return SimileAjax.History._actions[C]}catch(D){return null}};SimileAjax.HTML=new Object();SimileAjax.HTML._e2uHash={};(function(){var B=SimileAjax.HTML._e2uHash;B.nbsp="\u00A0[space]";B.iexcl="\u00A1";B.cent="\u00A2";B.pound="\u00A3";B.curren="\u00A4";B.yen="\u00A5";B.brvbar="\u00A6";B.sect="\u00A7";B.uml="\u00A8";B.copy="\u00A9";B.ordf="\u00AA";B.laquo="\u00AB";B.not="\u00AC";B.shy="\u00AD";B.reg="\u00AE";B.macr="\u00AF";B.deg="\u00B0";B.plusmn="\u00B1";B.sup2="\u00B2";B.sup3="\u00B3";B.acute="\u00B4";B.micro="\u00B5";B.para="\u00B6";B.middot="\u00B7";B.cedil="\u00B8";B.sup1="\u00B9";B.ordm="\u00BA";B.raquo="\u00BB";B.frac14="\u00BC";B.frac12="\u00BD";B.frac34="\u00BE";B.iquest="\u00BF";B.Agrave="\u00C0";B.Aacute="\u00C1";B.Acirc="\u00C2";B.Atilde="\u00C3";B.Auml="\u00C4";B.Aring="\u00C5";B.AElig="\u00C6";B.Ccedil="\u00C7";B.Egrave="\u00C8";B.Eacute="\u00C9";B.Ecirc="\u00CA";B.Euml="\u00CB";B.Igrave="\u00CC";B.Iacute="\u00CD";B.Icirc="\u00CE";B.Iuml="\u00CF";B.ETH="\u00D0";B.Ntilde="\u00D1";B.Ograve="\u00D2";B.Oacute="\u00D3";B.Ocirc="\u00D4";B.Otilde="\u00D5";B.Ouml="\u00D6";B.times="\u00D7";B.Oslash="\u00D8";B.Ugrave="\u00D9";B.Uacute="\u00DA";B.Ucirc="\u00DB";B.Uuml="\u00DC";B.Yacute="\u00DD";B.THORN="\u00DE";B.szlig="\u00DF";B.agrave="\u00E0";B.aacute="\u00E1";B.acirc="\u00E2";B.atilde="\u00E3";B.auml="\u00E4";B.aring="\u00E5";B.aelig="\u00E6";B.ccedil="\u00E7";B.egrave="\u00E8";B.eacute="\u00E9";B.ecirc="\u00EA";B.euml="\u00EB";B.igrave="\u00EC";B.iacute="\u00ED";B.icirc="\u00EE";B.iuml="\u00EF";B.eth="\u00F0";B.ntilde="\u00F1";B.ograve="\u00F2";B.oacute="\u00F3";B.ocirc="\u00F4";B.otilde="\u00F5";B.ouml="\u00F6";B.divide="\u00F7";B.oslash="\u00F8";B.ugrave="\u00F9";B.uacute="\u00FA";B.ucirc="\u00FB";B.uuml="\u00FC";B.yacute="\u00FD";B.thorn="\u00FE";B.yuml="\u00FF";B.quot="\u0022";B.amp="\u0026";B.lt="\u003C";B.gt="\u003E";B.OElig="";B.oelig="\u0153";B.Scaron="\u0160";B.scaron="\u0161";B.Yuml="\u0178";B.circ="\u02C6";B.tilde="\u02DC";B.ensp="\u2002";B.emsp="\u2003";B.thinsp="\u2009";B.zwnj="\u200C";B.zwj="\u200D";B.lrm="\u200E";B.rlm="\u200F";B.ndash="\u2013";B.mdash="\u2014";B.lsquo="\u2018";B.rsquo="\u2019";B.sbquo="\u201A";B.ldquo="\u201C";B.rdquo="\u201D";B.bdquo="\u201E";B.dagger="\u2020";B.Dagger="\u2021";B.permil="\u2030";B.lsaquo="\u2039";B.rsaquo="\u203A";B.euro="\u20AC";B.fnof="\u0192";B.Alpha="\u0391";B.Beta="\u0392";B.Gamma="\u0393";B.Delta="\u0394";B.Epsilon="\u0395";B.Zeta="\u0396";B.Eta="\u0397";B.Theta="\u0398";B.Iota="\u0399";B.Kappa="\u039A";B.Lambda="\u039B";B.Mu="\u039C";B.Nu="\u039D";B.Xi="\u039E";B.Omicron="\u039F";B.Pi="\u03A0";B.Rho="\u03A1";B.Sigma="\u03A3";B.Tau="\u03A4";B.Upsilon="\u03A5";B.Phi="\u03A6";B.Chi="\u03A7";B.Psi="\u03A8";B.Omega="\u03A9";B.alpha="\u03B1";B.beta="\u03B2";B.gamma="\u03B3";B.delta="\u03B4";B.epsilon="\u03B5";B.zeta="\u03B6";B.eta="\u03B7";B.theta="\u03B8";B.iota="\u03B9";B.kappa="\u03BA";B.lambda="\u03BB";B.mu="\u03BC";B.nu="\u03BD";B.xi="\u03BE";B.omicron="\u03BF";B.pi="\u03C0";B.rho="\u03C1";B.sigmaf="\u03C2";B.sigma="\u03C3";B.tau="\u03C4";B.upsilon="\u03C5";B.phi="\u03C6";B.chi="\u03C7";B.psi="\u03C8";B.omega="\u03C9";B.thetasym="\u03D1";B.upsih="\u03D2";B.piv="\u03D6";B.bull="\u2022";B.hellip="\u2026";B.prime="\u2032";B.Prime="\u2033";B.oline="\u203E";B.frasl="\u2044";B.weierp="\u2118";B.image="\u2111";B.real="\u211C";B.trade="\u2122";B.alefsym="\u2135";B.larr="\u2190";B.uarr="\u2191";B.rarr="\u2192";B.darr="\u2193";B.harr="\u2194";B.crarr="\u21B5";B.lArr="\u21D0";B.uArr="\u21D1";B.rArr="\u21D2";B.dArr="\u21D3";B.hArr="\u21D4";B.forall="\u2200";B.part="\u2202";B.exist="\u2203";B.empty="\u2205";B.nabla="\u2207";B.isin="\u2208";B.notin="\u2209";B.ni="\u220B";B.prod="\u220F";B.sum="\u2211";B.minus="\u2212";B.lowast="\u2217";B.radic="\u221A";B.prop="\u221D";B.infin="\u221E";B.ang="\u2220";B.and="\u2227";B.or="\u2228";B.cap="\u2229";B.cup="\u222A";B["int"]="\u222B";B.there4="\u2234";B.sim="\u223C";B.cong="\u2245";B.asymp="\u2248";B.ne="\u2260";B.equiv="\u2261";B.le="\u2264";B.ge="\u2265";B.sub="\u2282";B.sup="\u2283";B.nsub="\u2284";B.sube="\u2286";B.supe="\u2287";B.oplus="\u2295";B.otimes="\u2297";B.perp="\u22A5";B.sdot="\u22C5";B.lceil="\u2308";B.rceil="\u2309";B.lfloor="\u230A";B.rfloor="\u230B";B.lang="\u2329";B.rang="\u232A";B.loz="\u25CA";B.spades="\u2660";B.clubs="\u2663";B.hearts="\u2665";B.diams="\u2666"})();SimileAjax.HTML.deEntify=function(G){var F=SimileAjax.HTML._e2uHash;var H=/&(\w+?);/;while(H.test(G)){var E=G.match(H);G=G.replace(H,F[E[1]])}return G};SimileAjax.JSON=new Object();(function(){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var s={array:function(x){var a=["["],b,f,i,l=x.length,v;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=","}a[a.length]=v;b=true}}}a[a.length]="]";return a.join("")},"boolean":function(x){return String(x)},"null":function(x){return"null"},number:function(x){return isFinite(x)?String(x):"null"},object:function(x){if(x){if(x instanceof Array){return s.array(x)}var a=["{"],b,f,i,v;for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=","}a.push(s.string(i),":",v);b=true}}}a[a.length]="}";return a.join("")}return"null"},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})}return'"'+x+'"'}};SimileAjax.JSON.toJSONString=function(o){if(o instanceof Object){return s.object(o)}else{if(o instanceof Array){return s.array(o)}else{return o.toString()}}};SimileAjax.JSON.parseJSON=function(){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+this+")")}catch(e){return false}}})();String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.startsWith=function(B){return this.length>=B.length&&this.substr(0,B.length)==B};String.prototype.endsWith=function(B){return this.length>=B.length&&this.substr(this.length-B.length)==B};String.substitute=function(L,J){var G="";var H=0;while(H<L.length-1){var K=L.indexOf("%",H);if(K<0||K==L.length-1){break}else{if(K>H&&L.charAt(K-1)=="\\"){G+=L.substring(H,K-1)+"%";H=K+1}else{var I=parseInt(L.charAt(K+1));if(isNaN(I)||I>=J.length){G+=L.substring(H,K+2)}else{G+=L.substring(H,K)+J[I].toString()}H=K+2}}}if(H<L.length){G+=L.substring(H)}return G};SimileAjax.NativeDateUnit=new Object();SimileAjax.NativeDateUnit.makeDefaultValue=function(){return new Date()};SimileAjax.NativeDateUnit.cloneValue=function(B){return new Date(B.getTime())};SimileAjax.NativeDateUnit.getParser=function(B){if(typeof B=="string"){B=B.toLowerCase()}return(B=="iso8601"||B=="iso 8601")?SimileAjax.DateTime.parseIso8601DateTime:SimileAjax.DateTime.parseGregorianDateTime};SimileAjax.NativeDateUnit.parseFromObject=function(B){return SimileAjax.DateTime.parseGregorianDateTime(B)};SimileAjax.NativeDateUnit.toNumber=function(B){return B.getTime()};SimileAjax.NativeDateUnit.fromNumber=function(B){return new Date(B)};SimileAjax.NativeDateUnit.compare=function(F,G){var H,E;if(typeof F=="object"){H=F.getTime()}else{H=Number(F)}if(typeof G=="object"){E=G.getTime()}else{E=Number(G)}return H-E};SimileAjax.NativeDateUnit.earlier=function(D,C){return SimileAjax.NativeDateUnit.compare(D,C)<0?D:C};SimileAjax.NativeDateUnit.later=function(D,C){return SimileAjax.NativeDateUnit.compare(D,C)>0?D:C};SimileAjax.NativeDateUnit.change=function(C,D){return new Date(C.getTime()+D)};SimileAjax.WindowManager={_initialized:false,_listeners:[],_draggedElement:null,_draggedElementCallback:null,_dropTargetHighlightElement:null,_lastCoords:null,_ghostCoords:null,_draggingMode:"",_dragging:false,_layers:[]};SimileAjax.WindowManager.initialize=function(){if(SimileAjax.WindowManager._initialized){return }SimileAjax.DOM.registerEvent(document.body,"mousedown",SimileAjax.WindowManager._onBodyMouseDown);SimileAjax.DOM.registerEvent(document.body,"mousemove",SimileAjax.WindowManager._onBodyMouseMove);SimileAjax.DOM.registerEvent(document.body,"mouseup",SimileAjax.WindowManager._onBodyMouseUp);SimileAjax.DOM.registerEvent(document,"keydown",SimileAjax.WindowManager._onBodyKeyDown);SimileAjax.DOM.registerEvent(document,"keyup",SimileAjax.WindowManager._onBodyKeyUp);SimileAjax.WindowManager._layers.push({index:0});SimileAjax.WindowManager._historyListener={onBeforeUndoSeveral:function(){},onAfterUndoSeveral:function(){},onBeforeUndo:function(){},onAfterUndo:function(){},onBeforeRedoSeveral:function(){},onAfterRedoSeveral:function(){},onBeforeRedo:function(){},onAfterRedo:function(){}};SimileAjax.History.addListener(SimileAjax.WindowManager._historyListener);SimileAjax.WindowManager._initialized=true};SimileAjax.WindowManager.getBaseLayer=function(){SimileAjax.WindowManager.initialize();return SimileAjax.WindowManager._layers[0]};SimileAjax.WindowManager.getHighestLayer=function(){SimileAjax.WindowManager.initialize();return SimileAjax.WindowManager._layers[SimileAjax.WindowManager._layers.length-1]};SimileAjax.WindowManager.registerEventWithObject=function(H,F,G,J,I){SimileAjax.WindowManager.registerEvent(H,F,function(B,C,A){return G[J].call(G,B,C,A)},I)};SimileAjax.WindowManager.registerEvent=function(H,J,G,I){if(I==null){I=SimileAjax.WindowManager.getHighestLayer()}var F=function(C,D,A){if(SimileAjax.WindowManager._canProcessEventAtLayer(I)){SimileAjax.WindowManager._popToLayer(I.index);try{G(C,D,A)}catch(B){SimileAjax.Debug.exception(B)}}SimileAjax.DOM.cancelEvent(D);return false};SimileAjax.DOM.registerEvent(H,J,F)};SimileAjax.WindowManager.pushLayer=function(G,F,H){var E={onPop:G,index:SimileAjax.WindowManager._layers.length,ephemeral:(F),elmt:H};SimileAjax.WindowManager._layers.push(E);return E};SimileAjax.WindowManager.popLayer=function(D){for(var C=1;C<SimileAjax.WindowManager._layers.length;C++){if(SimileAjax.WindowManager._layers[C]==D){SimileAjax.WindowManager._popToLayer(C-1);break}}};SimileAjax.WindowManager.popAllLayers=function(){SimileAjax.WindowManager._popToLayer(0)};SimileAjax.WindowManager.registerForDragging=function(F,E,D){SimileAjax.WindowManager.registerEvent(F,"mousedown",function(B,C,A){SimileAjax.WindowManager._handleMouseDown(B,C,E)},D)};SimileAjax.WindowManager._popToLayer=function(E){while(E+1<SimileAjax.WindowManager._layers.length){try{var D=SimileAjax.WindowManager._layers.pop();if(D.onPop!=null){D.onPop()}}catch(F){}}};SimileAjax.WindowManager._canProcessEventAtLayer=function(D){if(D.index==(SimileAjax.WindowManager._layers.length-1)){return true}for(var C=D.index+1;C<SimileAjax.WindowManager._layers.length;C++){if(!SimileAjax.WindowManager._layers[C].ephemeral){return false}}return true};SimileAjax.WindowManager.cancelPopups=function(G){var H=(G)?SimileAjax.DOM.getEventPageCoordinates(G):{x:-1,y:-1};var I=SimileAjax.WindowManager._layers.length-1;while(I>0&&SimileAjax.WindowManager._layers[I].ephemeral){var J=SimileAjax.WindowManager._layers[I];if(J.elmt!=null){var K=J.elmt;var L=SimileAjax.DOM.getPageCoordinates(K);if(H.x>=L.left&&H.x<(L.left+K.offsetWidth)&&H.y>=L.top&&H.y<(L.top+K.offsetHeight)){break}}I--}SimileAjax.WindowManager._popToLayer(I)};SimileAjax.WindowManager._onBodyMouseDown=function(F,D,E){if(!("eventPhase" in D)||D.eventPhase==D.BUBBLING_PHASE){SimileAjax.WindowManager.cancelPopups(D)}};SimileAjax.WindowManager._handleMouseDown=function(F,D,E){SimileAjax.WindowManager._draggedElement=F;SimileAjax.WindowManager._draggedElementCallback=E;SimileAjax.WindowManager._lastCoords={x:D.clientX,y:D.clientY};SimileAjax.DOM.cancelEvent(D);return false};SimileAjax.WindowManager._onBodyKeyDown=function(G,E,F){if(SimileAjax.WindowManager._dragging){if(E.keyCode==27){SimileAjax.WindowManager._cancelDragging()}else{if((E.keyCode==17||E.keyCode==16)&&SimileAjax.WindowManager._draggingMode!="copy"){SimileAjax.WindowManager._draggingMode="copy";var H=SimileAjax.Graphics.createTranslucentImage(SimileAjax.urlPrefix+"images/copy.png");H.style.position="absolute";H.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";H.style.top=(SimileAjax.WindowManager._ghostCoords.top)+"px";document.body.appendChild(H);SimileAjax.WindowManager._draggingModeIndicatorElmt=H}}}};SimileAjax.WindowManager._onBodyKeyUp=function(F,D,E){if(SimileAjax.WindowManager._dragging){if(D.keyCode==17||D.keyCode==16){SimileAjax.WindowManager._draggingMode="";if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);SimileAjax.WindowManager._draggingModeIndicatorElmt=null}}}};SimileAjax.WindowManager._onBodyMouseMove=function(T,W,c){if(SimileAjax.WindowManager._draggedElement!=null){var U=SimileAjax.WindowManager._draggedElementCallback;var g=SimileAjax.WindowManager._lastCoords;var X=W.clientX-g.x;var a=W.clientY-g.y;if(!SimileAjax.WindowManager._dragging){if(Math.abs(X)>5||Math.abs(a)>5){try{if("onDragStart" in U){U.onDragStart()}if("ghost" in U&&U.ghost){var Z=SimileAjax.WindowManager._draggedElement;SimileAjax.WindowManager._ghostCoords=SimileAjax.DOM.getPageCoordinates(Z);SimileAjax.WindowManager._ghostCoords.left+=X;SimileAjax.WindowManager._ghostCoords.top+=a;var V=Z.cloneNode(true);V.style.position="absolute";V.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";V.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";V.style.zIndex=1000;SimileAjax.Graphics.setOpacity(V,50);document.body.appendChild(V);U._ghostElmt=V}SimileAjax.WindowManager._dragging=true;SimileAjax.WindowManager._lastCoords={x:W.clientX,y:W.clientY};document.body.focus()}catch(e){SimileAjax.Debug.exception("WindowManager: Error handling mouse down",e);SimileAjax.WindowManager._cancelDragging()}}}else{try{SimileAjax.WindowManager._lastCoords={x:W.clientX,y:W.clientY};if("onDragBy" in U){U.onDragBy(X,a)}if("_ghostElmt" in U){var V=U._ghostElmt;SimileAjax.WindowManager._ghostCoords.left+=X;SimileAjax.WindowManager._ghostCoords.top+=a;V.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";V.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){var b=SimileAjax.WindowManager._draggingModeIndicatorElmt;b.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";b.style.top=SimileAjax.WindowManager._ghostCoords.top+"px"}if("droppable" in U&&U.droppable){var Y=SimileAjax.DOM.getEventPageCoordinates(W);var c=SimileAjax.DOM.hittest(Y.x,Y.y,[SimileAjax.WindowManager._ghostElmt,SimileAjax.WindowManager._dropTargetHighlightElement]);c=SimileAjax.WindowManager._findDropTarget(c);if(c!=SimileAjax.WindowManager._potentialDropTarget){if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);SimileAjax.WindowManager._dropTargetHighlightElement=null;SimileAjax.WindowManager._potentialDropTarget=null}var f=false;if(c!=null){if((!("canDropOn" in U)||U.canDropOn(c))&&(!("canDrop" in c)||c.canDrop(SimileAjax.WindowManager._draggedElement))){f=true}}if(f){var R=4;var Q=SimileAjax.DOM.getPageCoordinates(c);var S=document.createElement("div");S.style.border=R+"px solid yellow";S.style.backgroundColor="yellow";S.style.position="absolute";S.style.left=Q.left+"px";S.style.top=Q.top+"px";S.style.width=(c.offsetWidth-R*2)+"px";S.style.height=(c.offsetHeight-R*2)+"px";SimileAjax.Graphics.setOpacity(S,30);document.body.appendChild(S);SimileAjax.WindowManager._potentialDropTarget=c;SimileAjax.WindowManager._dropTargetHighlightElement=S}}}}}catch(e){SimileAjax.Debug.exception("WindowManager: Error handling mouse move",e);SimileAjax.WindowManager._cancelDragging()}}SimileAjax.DOM.cancelEvent(W);return false}};SimileAjax.WindowManager._onBodyMouseUp=function(J,F,I){if(SimileAjax.WindowManager._draggedElement!=null){try{if(SimileAjax.WindowManager._dragging){var G=SimileAjax.WindowManager._draggedElementCallback;if("onDragEnd" in G){G.onDragEnd()}if("droppable" in G&&G.droppable){var H=false;var I=SimileAjax.WindowManager._potentialDropTarget;if(I!=null){if((!("canDropOn" in G)||G.canDropOn(I))&&(!("canDrop" in I)||I.canDrop(SimileAjax.WindowManager._draggedElement))){if("onDropOn" in G){G.onDropOn(I)}I.ondrop(SimileAjax.WindowManager._draggedElement,SimileAjax.WindowManager._draggingMode);H=true}}if(!H){}}}}finally{SimileAjax.WindowManager._cancelDragging()}SimileAjax.DOM.cancelEvent(F);return false}};SimileAjax.WindowManager._cancelDragging=function(){var D=SimileAjax.WindowManager._draggedElementCallback;if("_ghostElmt" in D){var C=D._ghostElmt;document.body.removeChild(C);delete D._ghostElmt}if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);SimileAjax.WindowManager._dropTargetHighlightElement=null}if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);SimileAjax.WindowManager._draggingModeIndicatorElmt=null}SimileAjax.WindowManager._draggedElement=null;SimileAjax.WindowManager._draggedElementCallback=null;SimileAjax.WindowManager._potentialDropTarget=null;SimileAjax.WindowManager._dropTargetHighlightElement=null;SimileAjax.WindowManager._lastCoords=null;SimileAjax.WindowManager._ghostCoords=null;SimileAjax.WindowManager._draggingMode="";SimileAjax.WindowManager._dragging=false};SimileAjax.WindowManager._findDropTarget=function(B){while(B!=null){if("ondrop" in B&&(typeof B.ondrop)=="function"){break}B=B.parentNode}return B};SimileAjax.XmlHttp=new Object();SimileAjax.XmlHttp._onReadyStateChange=function(E,F,H){switch(E.readyState){case 4:try{if(E.status==0||E.status==200){if(H){H(E)}}else{if(F){F(E.statusText,E.status,E)}}}catch(G){SimileAjax.Debug.exception("XmlHttp: Error handling onReadyStateChange",G)}break}};SimileAjax.XmlHttp._createRequest=function(){if(SimileAjax.Platform.browser.isIE){var G=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];for(var L=0;L<G.length;L++){try{var K=G[L];var J=function(){return new ActiveXObject(K)};var H=J();SimileAjax.XmlHttp._createRequest=J;return H}catch(I){}}}try{var J=function(){return new XMLHttpRequest()};var H=J();SimileAjax.XmlHttp._createRequest=J;return H}catch(I){throw new Error("Failed to create an XMLHttpRequest object")}};SimileAjax.XmlHttp.get=function(E,F,G){var H=SimileAjax.XmlHttp._createRequest();H.open("GET",E,true);H.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(H,F,G)};H.send(null)};SimileAjax.XmlHttp.post=function(J,F,G,H){var I=SimileAjax.XmlHttp._createRequest();I.open("POST",J,true);I.onreadystatechange=function(){SimileAjax.XmlHttp._onReadyStateChange(I,G,H)};I.send(F)};SimileAjax.XmlHttp._forceXML=function(C){try{C.overrideMimeType("text/xml")}catch(D){C.setrequestheader("Content-Type","text/xml")}};if(!window.CanvasRenderingContext2D){(function(){var N=Math;var O=N.round;var L=N.sin;var U=N.cos;var A=10;var I=A/2;var G={init:function(W){var X=W||document;if(/MSIE/.test(navigator.userAgent)&&!window.opera){var V=this;X.attachEvent("onreadystatechange",function(){V.init_(X)})}},init_:function(Y){if(Y.readyState=="complete"){if(!Y.namespaces.g_vml_){Y.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml")}var X=Y.createStyleSheet();X.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}";var W=Y.getElementsByTagName("canvas");for(var V=0;V<W.length;V++){if(!W[V].getContext){this.initElement(W[V])}}}},fixElement_:function(X){var Z=X.outerHTML;var Y=X.ownerDocument.createElement(Z);if(Z.slice(-2)!="/>"){var V="/"+X.tagName;var W;while((W=X.nextSibling)&&W.tagName!=V){W.removeNode()}if(W){W.removeNode()}}X.parentNode.replaceChild(Y,X);return Y},initElement:function(W){W=this.fixElement_(W);W.getContext=function(){if(this.context_){return this.context_}return this.context_=new J(this)};W.attachEvent("onpropertychange",T);W.attachEvent("onresize",B);var V=W.attributes;if(V.width&&V.width.specified){W.style.width=V.width.nodeValue+"px"}else{W.width=W.clientWidth}if(V.height&&V.height.specified){W.style.height=V.height.nodeValue+"px"}else{W.height=W.clientHeight}return W}};function T(W){var V=W.srcElement;switch(W.propertyName){case"width":V.style.width=V.attributes.width.nodeValue+"px";V.getContext().clearRect();break;case"height":V.style.height=V.attributes.height.nodeValue+"px";V.getContext().clearRect();break}}function B(W){var V=W.srcElement;if(V.firstChild){V.firstChild.style.width=V.clientWidth+"px";V.firstChild.style.height=V.clientHeight+"px"}}G.init();var D=[];for(var R=0;R<16;R++){for(var Q=0;Q<16;Q++){D[R*16+Q]=R.toString(16)+Q.toString(16)}}function K(){return[[1,0,0],[0,1,0],[0,0,1]]}function E(Y,X){var W=K();for(var V=0;V<3;V++){for(var b=0;b<3;b++){var Z=0;for(var a=0;a<3;a++){Z+=Y[V][a]*X[a][b]}W[V][b]=Z}}return W}function P(W,V){V.fillStyle=W.fillStyle;V.lineCap=W.lineCap;V.lineJoin=W.lineJoin;V.lineWidth=W.lineWidth;V.miterLimit=W.miterLimit;V.shadowBlur=W.shadowBlur;V.shadowColor=W.shadowColor;V.shadowOffsetX=W.shadowOffsetX;V.shadowOffsetY=W.shadowOffsetY;V.strokeStyle=W.strokeStyle;V.arcScaleX_=W.arcScaleX_;V.arcScaleY_=W.arcScaleY_}function C(W){var Z,Y=1;W=String(W);if(W.substring(0,3)=="rgb"){var b=W.indexOf("(",3);var V=W.indexOf(")",b+1);var a=W.substring(b+1,V).split(",");Z="#";for(var X=0;X<3;X++){Z+=D[Number(a[X])]}if((a.length==4)&&(W.substr(3,1)=="a")){Y=a[3]}}else{Z=W}return[Z,Y]}function M(V){switch(V){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function J(W){this.m_=K();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=A*1;this.globalAlpha=1;this.canvas=W;var V=W.ownerDocument.createElement("div");V.style.width=W.clientWidth+"px";V.style.height=W.clientHeight+"px";V.style.overflow="hidden";V.style.position="absolute";W.appendChild(V);this.element_=V;this.arcScaleX_=1;this.arcScaleY_=1}var H=J.prototype;H.clearRect=function(){this.element_.innerHTML="";this.currentPath_=[]};H.beginPath=function(){this.currentPath_=[]};H.moveTo=function(W,V){this.currentPath_.push({type:"moveTo",x:W,y:V});this.currentX_=W;this.currentY_=V};H.lineTo=function(W,V){this.currentPath_.push({type:"lineTo",x:W,y:V});this.currentX_=W;this.currentY_=V};H.bezierCurveTo=function(X,V,a,Z,Y,W){this.currentPath_.push({type:"bezierCurveTo",cp1x:X,cp1y:V,cp2x:a,cp2y:Z,x:Y,y:W});this.currentX_=Y;this.currentY_=W};H.quadraticCurveTo=function(c,b,a,Z){var W=this.currentX_+2/3*(c-this.currentX_);var V=this.currentY_+2/3*(b-this.currentY_);var Y=W+(a-this.currentX_)/3;var X=V+(Z-this.currentY_)/3;this.bezierCurveTo(W,V,Y,X,a,Z)};H.arc=function(b,Z,a,Y,W,X){a*=A;var g=X?"at":"wa";var c=b+(U(Y)*a)-I;var f=Z+(L(Y)*a)-I;var V=b+(U(W)*a)-I;var e=Z+(L(W)*a)-I;if(c==V&&!X){c+=0.125}this.currentPath_.push({type:g,x:b,y:Z,radius:a,xStart:c,yStart:f,xEnd:V,yEnd:e})};H.rect=function(X,W,V,Y){this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath()};H.strokeRect=function(X,W,V,Y){this.beginPath();this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath();this.stroke()};H.fillRect=function(X,W,V,Y){this.beginPath();this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath();this.fill()};H.createLinearGradient=function(W,Y,V,X){var Z=new S("gradient");return Z};H.createRadialGradient=function(Y,a,X,W,Z,V){var b=new S("gradientradial");b.radius1_=X;b.radius2_=V;b.focus_.x=Y;b.focus_.y=a;return b};H.drawImage=function(o,Y){var f,c,i,v,l,j,q,y;var g=o.runtimeStyle.width;var m=o.runtimeStyle.height;o.runtimeStyle.width="auto";o.runtimeStyle.height="auto";var e=o.width;var t=o.height;o.runtimeStyle.width=g;o.runtimeStyle.height=m;if(arguments.length==3){f=arguments[1];c=arguments[2];l=j=0;q=i=e;y=v=t}else{if(arguments.length==5){f=arguments[1];c=arguments[2];i=arguments[3];v=arguments[4];l=j=0;q=e;y=t}else{if(arguments.length==9){l=arguments[1];j=arguments[2];q=arguments[3];y=arguments[4];f=arguments[5];c=arguments[6];i=arguments[7];v=arguments[8]}else{throw"Invalid number of arguments"}}}var x=this.getCoords_(f,c);var Z=q/2;var X=y/2;var u=[];var V=10;var b=10;u.push(" <g_vml_:group",' coordsize="',A*V,",",A*b,'"',' coordorigin="0,0"',' style="width:',V,";height:",b,";position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var a=[];a.push("M11='",this.m_[0][0],"',","M12='",this.m_[1][0],"',","M21='",this.m_[0][1],"',","M22='",this.m_[1][1],"',","Dx='",O(x.x/A),"',","Dy='",O(x.y/A),"'");var s=x;var r=this.getCoords_(f+i,c);var p=this.getCoords_(f,c+v);var k=this.getCoords_(f+i,c+v);s.x=Math.max(s.x,r.x,p.x,k.x);s.y=Math.max(s.y,r.y,p.y,k.y);u.push("padding:0 ",O(s.x/A),"px ",O(s.y/A),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",a.join(""),", sizingmethod='clip');")}else{u.push("top:",O(x.y/A),"px;left:",O(x.x/A),"px;")}u.push(' ">','<g_vml_:image src="',o.src,'"',' style="width:',A*i,";"," height:",A*v,';"',' cropleft="',l/e,'"',' croptop="',j/t,'"',' cropright="',(e-l-q)/e,'"',' cropbottom="',(t-j-y)/t,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",u.join(""))};H.stroke=function(AB){var f=[];var e=false;var AE=C(AB?this.fillStyle:this.strokeStyle);var x=AE[0];var Y=AE[1]*this.globalAlpha;var X=10;var l=10;f.push("<g_vml_:shape",' fillcolor="',x,'"',' filled="',Boolean(AB),'"',' style="position:absolute;width:',X,";height:",l,';"',' coordorigin="0 0" coordsize="',A*X," ",A*l,'"',' stroked="',!AB,'"',' strokeweight="',this.lineWidth,'"',' strokecolor="',x,'"',' path="');var k=false;var w={x:null,y:null};var y={x:null,y:null};for(var z=0;z<this.currentPath_.length;z++){var s=this.currentPath_[z];if(s.type=="moveTo"){f.push(" m ");var AD=this.getCoords_(s.x,s.y);f.push(O(AD.x),",",O(AD.y))}else{if(s.type=="lineTo"){f.push(" l ");var AD=this.getCoords_(s.x,s.y);f.push(O(AD.x),",",O(AD.y))}else{if(s.type=="close"){f.push(" x ")}else{if(s.type=="bezierCurveTo"){f.push(" c ");var AD=this.getCoords_(s.x,s.y);var v=this.getCoords_(s.cp1x,s.cp1y);var t=this.getCoords_(s.cp2x,s.cp2y);f.push(O(v.x),",",O(v.y),",",O(t.x),",",O(t.y),",",O(AD.x),",",O(AD.y))}else{if(s.type=="at"||s.type=="wa"){f.push(" ",s.type," ");var AD=this.getCoords_(s.x,s.y);var m=this.getCoords_(s.xStart,s.yStart);var b=this.getCoords_(s.xEnd,s.yEnd);f.push(O(AD.x-this.arcScaleX_*s.radius),",",O(AD.y-this.arcScaleY_*s.radius)," ",O(AD.x+this.arcScaleX_*s.radius),",",O(AD.y+this.arcScaleY_*s.radius)," ",O(m.x),",",O(m.y)," ",O(b.x),",",O(b.y))}}}}}if(AD){if(w.x==null||AD.x<w.x){w.x=AD.x}if(y.x==null||AD.x>y.x){y.x=AD.x}if(w.y==null||AD.y<w.y){w.y=AD.y}if(y.y==null||AD.y>y.y){y.y=AD.y}}}f.push(' ">');if(typeof this.fillStyle=="object"){var r={x:"50%",y:"50%"};var u=(y.x-w.x);var o=(y.y-w.y);var AC=(u>o)?u:o;r.x=O((this.fillStyle.focus_.x/u)*100+50)+"%";r.y=O((this.fillStyle.focus_.y/o)*100+50)+"%";var j=[];if(this.fillStyle.type_=="gradientradial"){var AA=(this.fillStyle.radius1_/AC*100);var q=(this.fillStyle.radius2_/AC*100)-AA}else{var AA=0;var q=100}var V={offset:null,color:null};var Z={offset:null,color:null};this.fillStyle.colors_.sort(function(a,W){return a.offset-W.offset});for(var z=0;z<this.fillStyle.colors_.length;z++){var g=this.fillStyle.colors_[z];j.push((g.offset*q)+AA,"% ",g.color,",");if(g.offset>V.offset||V.offset==null){V.offset=g.offset;V.color=g.color}if(g.offset<Z.offset||Z.offset==null){Z.offset=g.offset;Z.color=g.color}}j.pop();f.push("<g_vml_:fill",' color="',Z.color,'"',' color2="',V.color,'"',' type="',this.fillStyle.type_,'"',' focusposition="',r.x,", ",r.y,'"',' colors="',j.join(""),'"',' opacity="',Y,'" />')}else{if(AB){f.push('<g_vml_:fill color="',x,'" opacity="',Y,'" />')}else{f.push("<g_vml_:stroke",' opacity="',Y,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',M(this.lineCap),'"',' weight="',this.lineWidth,'px"',' color="',x,'" />')}}f.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",f.join(""));this.currentPath_=[]};H.fill=function(){this.stroke(true)};H.closePath=function(){this.currentPath_.push({type:"close"})};H.getCoords_=function(W,V){return{x:A*(W*this.m_[0][0]+V*this.m_[1][0]+this.m_[2][0])-I,y:A*(W*this.m_[0][1]+V*this.m_[1][1]+this.m_[2][1])-I}};H.save=function(){var V={};P(this,V);this.aStack_.push(V);this.mStack_.push(this.m_);this.m_=E(K(),this.m_)};H.restore=function(){P(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};H.translate=function(X,W){var V=[[1,0,0],[0,1,0],[X,W,1]];this.m_=E(V,this.m_)};H.rotate=function(W){var Y=U(W);var X=L(W);var V=[[Y,X,0],[-X,Y,0],[0,0,1]];this.m_=E(V,this.m_)};H.scale=function(X,W){this.arcScaleX_*=X;this.arcScaleY_*=W;var V=[[X,0,0],[0,W,0],[0,0,1]];this.m_=E(V,this.m_)};H.clip=function(){};H.arcTo=function(){};H.createPattern=function(){return new F};function S(V){this.type_=V;this.radius1_=0;this.radius2_=0;this.colors_=[];this.focus_={x:0,y:0}}S.prototype.addColorStop=function(W,V){V=C(V);this.colors_.push({offset:1-W,color:V})};function F(){}G_vmlCanvasManager=G;CanvasRenderingContext2D=J;CanvasGradient=S;CanvasPattern=F})()}window.Timeline=new Object();window.Timeline.DateTime=window.SimileAjax.DateTime;Timeline.serverLocale="en";Timeline.clientLocale="en";Timeline.urlPrefix="/";Timeline.SpanHighlightDecorator=function(B){this._unit=("unit" in B)?B.unit:SimileAjax.NativeDateUnit;this._startDate=(typeof B.startDate=="string")?this._unit.parseFromObject(B.startDate):B.startDate;this._endDate=(typeof B.endDate=="string")?this._unit.parseFromObject(B.endDate):B.endDate;this._startLabel=B.startLabel;this._endLabel=B.endLabel;this._color=B.color;this._opacity=("opacity" in B)?B.opacity:100};Timeline.SpanHighlightDecorator.prototype.initialize=function(D,C){this._band=D;this._timeline=C;this._layerDiv=null};Timeline.SpanHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv)}this._layerDiv=this._band.createLayerDiv(10);this._layerDiv.setAttribute("name","span-highlight-decorator");this._layerDiv.style.display="none";var R=this._band.getMinDate();var K=this._band.getMaxDate();if(this._unit.compare(this._startDate,K)<0&&this._unit.compare(this._endDate,R)>0){R=this._unit.later(R,this._startDate);K=this._unit.earlier(K,this._endDate);var J=this._band.dateToPixelOffset(R);var N=this._band.dateToPixelOffset(K);var P=this._timeline.getDocument();var Q=function(){var A=P.createElement("table");A.insertRow(0).insertCell(0);return A};var L=P.createElement("div");L.style.position="absolute";L.style.overflow="hidden";L.style.background=this._color;if(this._opacity<100){SimileAjax.Graphics.setOpacity(L,this._opacity)}this._layerDiv.appendChild(L);var O=Q();O.style.position="absolute";O.style.overflow="hidden";O.style.fontSize="200%";O.style.fontWeight="bold";O.style.color=this._color;O.rows[0].cells[0].innerHTML=this._startLabel;this._layerDiv.appendChild(O);var M=Q();M.style.position="absolute";M.style.overflow="hidden";M.style.fontSize="200%";M.style.fontWeight="bold";M.style.color=this._color;M.rows[0].cells[0].innerHTML=this._endLabel;this._layerDiv.appendChild(M);if(this._timeline.isHorizontal()){L.style.left=J+"px";L.style.width=(N-J)+"px";L.style.top="0px";L.style.height="100%";O.style.right=(this._band.getTotalViewLength()-J)+"px";O.style.width=(this._startLabel.length)+"em";O.style.top="0px";O.style.height="100%";O.style.textAlign="right";O.rows[0].style.verticalAlign="top";M.style.left=N+"px";M.style.width=(this._endLabel.length)+"em";M.style.top="0px";M.style.height="100%";M.rows[0].style.verticalAlign="top"}else{L.style.top=J+"px";L.style.height=(N-J)+"px";L.style.left="0px";L.style.width="100%";O.style.bottom=J+"px";O.style.height="1.5px";O.style.left="0px";O.style.width="100%";M.style.top=N+"px";M.style.height="1.5px";M.style.left="0px";M.style.width="100%"}}this._layerDiv.style.display="block"};Timeline.SpanHighlightDecorator.prototype.softPaint=function(){};Timeline.PointHighlightDecorator=function(B){this._unit=("unit" in B)?B.unit:SimileAjax.NativeDateUnit;this._date=(typeof B.date=="string")?this._unit.parseFromObject(B.date):B.date;this._width=("width" in B)?B.width:10;this._color=B.color;this._opacity=("opacity" in B)?B.opacity:100};Timeline.PointHighlightDecorator.prototype.initialize=function(D,C){this._band=D;this._timeline=C;this._layerDiv=null};Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv)}this._layerDiv=this._band.createLayerDiv(10);this._layerDiv.setAttribute("name","span-highlight-decorator");this._layerDiv.style.display="none";var K=this._band.getMinDate();var I=this._band.getMaxDate();if(this._unit.compare(this._date,I)<0&&this._unit.compare(this._date,K)>0){var L=this._band.dateToPixelOffset(this._date);var G=L-Math.round(this._width/2);var J=this._timeline.getDocument();var H=J.createElement("div");H.style.position="absolute";H.style.overflow="hidden";H.style.background=this._color;if(this._opacity<100){SimileAjax.Graphics.setOpacity(H,this._opacity)}this._layerDiv.appendChild(H);if(this._timeline.isHorizontal()){H.style.left=G+"px";H.style.width=this._width+"px";H.style.top="0px";H.style.height="100%"}else{H.style.top=G+"px";H.style.height=this._width+"px";H.style.left="0px";H.style.width="100%"}}this._layerDiv.style.display="block"};Timeline.PointHighlightDecorator.prototype.softPaint=function(){};Timeline.DetailedEventPainter=function(B){this._params=B;this._onSelectListeners=[];this._filterMatcher=null;this._highlightMatcher=null;this._frc=null;this._eventIdToElmt={}};Timeline.DetailedEventPainter.prototype.initialize=function(D,C){this._band=D;this._timeline=C;this._backLayer=null;this._eventLayer=null;this._lineLayer=null;this._highlightLayer=null;this._eventIdToElmt=null};Timeline.DetailedEventPainter.prototype.addOnSelectListener=function(B){this._onSelectListeners.push(B)};Timeline.DetailedEventPainter.prototype.removeOnSelectListener=function(D){for(var C=0;C<this._onSelectListeners.length;C++){if(this._onSelectListeners[C]==D){this._onSelectListeners.splice(C,1);break}}};Timeline.DetailedEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher};Timeline.DetailedEventPainter.prototype.setFilterMatcher=function(B){this._filterMatcher=B};Timeline.DetailedEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher};Timeline.DetailedEventPainter.prototype.setHighlightMatcher=function(B){this._highlightMatcher=B};Timeline.DetailedEventPainter.prototype.paint=function(){var M=this._band.getEventSource();if(M==null){return }this._eventIdToElmt={};this._prepareForPainting();var P=this._params.theme.event;var R=Math.max(P.track.height,this._frc.getLineHeight());var S={trackOffset:Math.round(this._band.getViewWidth()/2-R/2),trackHeight:R,trackGap:P.track.gap,trackIncrement:R+P.track.gap,icon:P.instant.icon,iconWidth:P.instant.iconWidth,iconHeight:P.instant.iconHeight,labelWidth:P.label.width};var L=this._band.getMinDate();var N=this._band.getMaxDate();var O=(this._filterMatcher!=null)?this._filterMatcher:function(A){return true};var T=(this._highlightMatcher!=null)?this._highlightMatcher:function(A){return -1};var K=M.getEventReverseIterator(L,N);while(K.hasNext()){var Q=K.next();if(O(Q)){this.paintEvent(Q,S,this._params.theme,T(Q))}}this._highlightLayer.style.display="block";this._lineLayer.style.display="block";this._eventLayer.style.display="block"};Timeline.DetailedEventPainter.prototype.softPaint=function(){};Timeline.DetailedEventPainter.prototype._prepareForPainting=function(){var D=this._band;if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");this._backLayer.style.visibility="hidden";var C=document.createElement("span");C.className="timeline-event-label";this._backLayer.appendChild(C);this._frc=SimileAjax.Graphics.getFontRenderingContext(C)}this._frc.update();this._lowerTracks=[];this._upperTracks=[];if(this._highlightLayer!=null){D.removeLayerDiv(this._highlightLayer)}this._highlightLayer=D.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";if(this._lineLayer!=null){D.removeLayerDiv(this._lineLayer)}this._lineLayer=D.createLayerDiv(110,"timeline-band-lines");this._lineLayer.style.display="none";if(this._eventLayer!=null){D.removeLayerDiv(this._eventLayer)}this._eventLayer=D.createLayerDiv(110,"timeline-band-events");this._eventLayer.style.display="none"};Timeline.DetailedEventPainter.prototype.paintEvent=function(H,G,F,E){if(H.isInstant()){this.paintInstantEvent(H,G,F,E)}else{this.paintDurationEvent(H,G,F,E)}};Timeline.DetailedEventPainter.prototype.paintInstantEvent=function(H,G,F,E){if(H.isImprecise()){this.paintImpreciseInstantEvent(H,G,F,E)}else{this.paintPreciseInstantEvent(H,G,F,E)}};Timeline.DetailedEventPainter.prototype.paintDurationEvent=function(H,G,F,E){if(H.isImprecise()){this.paintImpreciseDurationEvent(H,G,F,E)}else{this.paintPreciseDurationEvent(H,G,F,E)}};Timeline.DetailedEventPainter.prototype.paintPreciseInstantEvent=function(e,a,X,Z){var V=this._timeline.getDocument();var f=e.getText();var l=e.getStart();var o=Math.round(this._band.dateToPixelOffset(l));var q=Math.round(o+a.iconWidth/2);var g=Math.round(o-a.iconWidth/2);var j=this._frc.computeSize(f);var m=this._findFreeTrackForSolid(q,o);var p=this._paintEventIcon(e,m,g,a,X);var U=q+X.event.label.offsetFromLine;var Y=m;var k=this._getTrackData(m);if(Math.min(k.solid,k.text)>=U+j.width){k.solid=g;k.text=U}else{k.solid=g;U=o+X.event.label.offsetFromLine;Y=this._findFreeTrackForText(m,U+j.width,function(A){A.line=o-2});this._getTrackData(Y).text=g;this._paintEventLine(e,o,m,Y,a,X)}var W=Math.round(a.trackOffset+Y*a.trackIncrement+a.trackHeight/2-j.height/2);var b=this._paintEventLabel(e,f,U,W,j.width,j.height,X);var c=this;var i=function(C,B,A){return c._onClickInstantEvent(p.elmt,B,e)};SimileAjax.DOM.registerEvent(p.elmt,"mousedown",i);SimileAjax.DOM.registerEvent(b.elmt,"mousedown",i);this._createHighlightDiv(Z,p,X);this._eventIdToElmt[e.getID()]=p.elmt};Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent=function(k,g,a,f){var Y=this._timeline.getDocument();var l=k.getText();var r=k.getStart();var e=k.getEnd();var u=Math.round(this._band.dateToPixelOffset(r));var x=Math.round(this._band.dateToPixelOffset(e));var y=Math.round(u+g.iconWidth/2);var m=Math.round(u-g.iconWidth/2);var p=this._frc.computeSize(l);var t=this._findFreeTrackForSolid(x,u);var s=this._paintEventTape(k,t,u,x,a.event.instant.impreciseColor,a.event.instant.impreciseOpacity,g,a);var w=this._paintEventIcon(k,t,m,g,a);var q=this._getTrackData(t);q.solid=m;var Z=y+a.event.label.offsetFromLine;var v=Z+p.width;var c;if(v<x){c=t}else{Z=u+a.event.label.offsetFromLine;v=Z+p.width;c=this._findFreeTrackForText(t,v,function(A){A.line=u-2});this._getTrackData(c).text=m;this._paintEventLine(k,u,t,c,g,a)}var b=Math.round(g.trackOffset+c*g.trackIncrement+g.trackHeight/2-p.height/2);var i=this._paintEventLabel(k,l,Z,b,p.width,p.height,a);var j=this;var o=function(C,B,A){return j._onClickInstantEvent(w.elmt,B,k)};SimileAjax.DOM.registerEvent(w.elmt,"mousedown",o);SimileAjax.DOM.registerEvent(s.elmt,"mousedown",o);SimileAjax.DOM.registerEvent(i.elmt,"mousedown",o);this._createHighlightDiv(f,w,a);this._eventIdToElmt[k.getID()]=w.elmt};Timeline.DetailedEventPainter.prototype.paintPreciseDurationEvent=function(i,e,X,b){var W=this._timeline.getDocument();var j=i.getText();var p=i.getStart();var a=i.getEnd();var r=Math.round(this._band.dateToPixelOffset(p));var s=Math.round(this._band.dateToPixelOffset(a));var m=this._frc.computeSize(j);var o=this._findFreeTrackForSolid(s);var c=i.getColor();c=c!=null?c:X.event.duration.color;var q=this._paintEventTape(i,o,r,s,c,100,e,X);var k=this._getTrackData(o);k.solid=r;var V=r+X.event.label.offsetFromLine;var Z=this._findFreeTrackForText(o,V+m.width,function(A){A.line=r-2});this._getTrackData(Z).text=r-2;this._paintEventLine(i,r,o,Z,e,X);var Y=Math.round(e.trackOffset+Z*e.trackIncrement+e.trackHeight/2-m.height/2);var f=this._paintEventLabel(i,j,V,Y,m.width,m.height,X);var g=this;var l=function(B,A,C){return g._onClickDurationEvent(q.elmt,A,i)};SimileAjax.DOM.registerEvent(q.elmt,"mousedown",l);SimileAjax.DOM.registerEvent(f.elmt,"mousedown",l);this._createHighlightDiv(b,q,X);this._eventIdToElmt[i.getID()]=q.elmt};Timeline.DetailedEventPainter.prototype.paintImpreciseDurationEvent=function(r,m,e,j){var a=this._timeline.getDocument();var s=r.getText();var z=r.getStart();var l=r.getLatestStart();var i=r.getEnd();var c=r.getEarliestEnd();var AB=Math.round(this._band.dateToPixelOffset(z));var x=Math.round(this._band.dateToPixelOffset(l));var AC=Math.round(this._band.dateToPixelOffset(i));var w=Math.round(this._band.dateToPixelOffset(c));var v=this._frc.computeSize(s);var y=this._findFreeTrackForSolid(AC);var k=r.getColor();k=k!=null?k:e.event.duration.color;var o=this._paintEventTape(r,y,AB,AC,e.event.duration.impreciseColor,e.event.duration.impreciseOpacity,m,e);var AA=this._paintEventTape(r,y,x,w,k,100,m,e);var t=this._getTrackData(y);t.solid=AB;var b=x+e.event.label.offsetFromLine;var g=this._findFreeTrackForText(y,b+v.width,function(A){A.line=x-2});this._getTrackData(g).text=x-2;this._paintEventLine(r,x,y,g,m,e);var f=Math.round(m.trackOffset+g*m.trackIncrement+m.trackHeight/2-v.height/2);var p=this._paintEventLabel(r,s,b,f,v.width,v.height,e);var q=this;var u=function(B,A,C){return q._onClickDurationEvent(AA.elmt,A,r)};SimileAjax.DOM.registerEvent(AA.elmt,"mousedown",u);SimileAjax.DOM.registerEvent(p.elmt,"mousedown",u);this._createHighlightDiv(j,AA,e);this._eventIdToElmt[r.getID()]=AA.elmt};Timeline.DetailedEventPainter.prototype._findFreeTrackForSolid=function(H,E){for(var F=0;true;F++){if(F<this._lowerTracks.length){var G=this._lowerTracks[F];if(Math.min(G.solid,G.text)>H&&(!(E)||G.line>E)){return F}}else{this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});return F}if(F<this._upperTracks.length){var G=this._upperTracks[F];if(Math.min(G.solid,G.text)>H&&(!(E)||G.line>E)){return -1-F}}else{this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});return -1-F}}};Timeline.DetailedEventPainter.prototype._findFreeTrackForText=function(K,L,Q){var S;var R;var M;var O;if(K<0){S=true;M=-K;R=this._findFreeUpperTrackForText(M,L);O=-1-R}else{if(K>0){S=false;M=K+1;R=this._findFreeLowerTrackForText(M,L);O=R}else{var N=this._findFreeUpperTrackForText(0,L);var P=this._findFreeLowerTrackForText(1,L);if(P-1<=N){S=false;M=1;R=P;O=R}else{S=true;M=0;R=N;O=-1-R}}}if(S){if(R==this._upperTracks.length){this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY})}for(var T=M;T<R;T++){Q(this._upperTracks[T])}}else{if(R==this._lowerTracks.length){this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY})}for(var T=M;T<R;T++){Q(this._lowerTracks[T])}}return O};Timeline.DetailedEventPainter.prototype._findFreeLowerTrackForText=function(D,E){for(;D<this._lowerTracks.length;D++){var F=this._lowerTracks[D];if(Math.min(F.solid,F.text)>=E){break}}return D};Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText=function(D,E){for(;D<this._upperTracks.length;D++){var F=this._upperTracks[D];if(Math.min(F.solid,F.text)>=E){break}}return D};Timeline.DetailedEventPainter.prototype._getTrackData=function(B){return(B<0)?this._upperTracks[-B-1]:this._lowerTracks[B]};Timeline.DetailedEventPainter.prototype._paintEventLine=function(P,L,S,N,R,K){var Q=Math.round(R.trackOffset+S*R.trackIncrement+R.trackHeight/2);var O=Math.round(Math.abs(N-S)*R.trackIncrement);var T="1px solid "+K.event.label.lineColor;var M=this._timeline.getDocument().createElement("div");M.style.position="absolute";M.style.left=L+"px";M.style.width=K.event.label.offsetFromLine+"px";M.style.height=O+"px";if(S>N){M.style.top=(Q-O)+"px";M.style.borderTop=T}else{M.style.top=Q+"px";M.style.borderBottom=T}M.style.borderLeft=T;this._lineLayer.appendChild(M)};Timeline.DetailedEventPainter.prototype._paintEventIcon=function(P,T,M,S,K){var Q=P.getIcon();Q=Q!=null?Q:S.icon;var O=S.trackOffset+T*S.trackIncrement+S.trackHeight/2;var R=Math.round(O-S.iconHeight/2);var L=SimileAjax.Graphics.createTranslucentImage(Q);var N=this._timeline.getDocument().createElement("div");N.style.position="absolute";N.style.left=M+"px";N.style.top=R+"px";N.appendChild(L);N.style.cursor="pointer";this._eventLayer.appendChild(N);return{left:M,top:R,width:S.iconWidth,height:S.iconHeight,elmt:N}};Timeline.DetailedEventPainter.prototype._paintEventLabel=function(S,R,N,U,O,Q,L){var T=this._timeline.getDocument();var P=T.createElement("div");P.style.position="absolute";P.style.left=N+"px";P.style.width=O+"px";P.style.top=U+"px";P.style.height=Q+"px";P.style.backgroundColor=L.event.label.backgroundColor;SimileAjax.Graphics.setOpacity(P,L.event.label.backgroundOpacity);this._eventLayer.appendChild(P);var V=T.createElement("div");V.style.position="absolute";V.style.left=N+"px";V.style.width=O+"px";V.style.top=U+"px";V.innerHTML=R;V.style.cursor="pointer";var M=S.getTextColor();if(M==null){M=S.getColor()}if(M!=null){V.style.color=M}this._eventLayer.appendChild(V);return{left:N,top:U,width:O,height:Q,elmt:V}};Timeline.DetailedEventPainter.prototype._paintEventTape=function(S,W,Z,Q,O,X,V,Y){var P=Q-Z;var N=Y.event.tape.height;var R=V.trackOffset+W*V.trackIncrement+V.trackHeight/2;var U=Math.round(R-N/2);var T=this._timeline.getDocument().createElement("div");T.style.position="absolute";T.style.left=Z+"px";T.style.width=P+"px";T.style.top=U+"px";T.style.height=N+"px";T.style.backgroundColor=O;T.style.overflow="hidden";T.style.cursor="pointer";SimileAjax.Graphics.setOpacity(T,X);this._eventLayer.appendChild(T);return{left:Z,top:U,width:P,height:N,elmt:T}};Timeline.DetailedEventPainter.prototype._createHighlightDiv=function(H,M,K){if(H>=0){var L=this._timeline.getDocument();var I=K.event;var N=I.highlightColors[Math.min(H,I.highlightColors.length-1)];var J=L.createElement("div");J.style.position="absolute";J.style.overflow="hidden";J.style.left=(M.left-2)+"px";J.style.width=(M.width+4)+"px";J.style.top=(M.top-2)+"px";J.style.height=(M.height+4)+"px";J.style.background=N;this._highlightLayer.appendChild(J)}};Timeline.DetailedEventPainter.prototype._onClickInstantEvent=function(H,G,E){var F=SimileAjax.DOM.getPageCoordinates(H);this._showBubble(F.left+Math.ceil(H.offsetWidth/2),F.top+Math.ceil(H.offsetHeight/2),E);this._fireOnSelect(E.getID());G.cancelBubble=true;SimileAjax.DOM.cancelEvent(G);return false};Timeline.DetailedEventPainter.prototype._onClickDurationEvent=function(J,K,L){if("pageX" in K){var G=K.pageX;var H=K.pageY}else{var I=SimileAjax.DOM.getPageCoordinates(J);var G=K.offsetX+I.left;var H=K.offsetY+I.top}this._showBubble(G,H,L);this._fireOnSelect(L.getID());K.cancelBubble=true;SimileAjax.DOM.cancelEvent(K);return false};Timeline.DetailedEventPainter.prototype.showBubble=function(D){var F=this._eventIdToElmt[D.getID()];if(F){var E=SimileAjax.DOM.getPageCoordinates(F);this._showBubble(E.left+F.offsetWidth/2,E.top+F.offsetHeight/2,D)}};Timeline.DetailedEventPainter.prototype._showBubble=function(E,F,H){var G=document.createElement("div");H.fillInfoBubble(G,this._params.theme,this._band.getLabeller());SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(G,E,F,this._params.theme.event.bubble.width)};Timeline.DetailedEventPainter.prototype._fireOnSelect=function(D){for(var C=0;C<this._onSelectListeners.length;C++){this._onSelectListeners[C](D)}};Timeline.GregorianEtherPainter=function(B){this._params=B;this._theme=B.theme;this._unit=B.unit;this._multiple=("multiple" in B)?B.multiple:1};Timeline.GregorianEtherPainter.prototype.initialize=function(G,H){this._band=G;this._timeline=H;this._backgroundLayer=G.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[G.getIndex()];this._markerLayer=null;this._lineLayer=null;var F=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[H.isHorizontal()?"hAlign":"vAlign"];var E=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,F,E);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.GregorianEtherPainter.prototype.setHighlight=function(C,D){this._highlight.position(C,D)};Timeline.GregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var K=this._band.getMinDate();var H=this._band.getMaxDate();var L=this._band.getTimeZone();var I=this._band.getLabeller();SimileAjax.DateTime.roundDownToInterval(K,this._unit,L,this._multiple,this._theme.firstDayOfWeek);var J=this;var G=function(B){for(var A=0;A<J._multiple;A++){SimileAjax.DateTime.incrementByInterval(B,J._unit)}};while(K.getTime()<H.getTime()){this._intervalMarkerLayout.createIntervalMarker(K,I,this._unit,this._markerLayer,this._lineLayer);G(K)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.GregorianEtherPainter.prototype.softPaint=function(){};Timeline.HotZoneGregorianEtherPainter=function(I){this._params=I;this._theme=I.theme;this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,unit:I.unit,multiple:1}];for(var K=0;K<I.zones.length;K++){var N=I.zones[K];var L=SimileAjax.DateTime.parseGregorianDateTime(N.start).getTime();var J=SimileAjax.DateTime.parseGregorianDateTime(N.end).getTime();for(var M=0;M<this._zones.length&&J>L;M++){var H=this._zones[M];if(L<H.endTime){if(L>H.startTime){this._zones.splice(M,0,{startTime:H.startTime,endTime:L,unit:H.unit,multiple:H.multiple});M++;H.startTime=L}if(J<H.endTime){this._zones.splice(M,0,{startTime:L,endTime:J,unit:N.unit,multiple:(N.multiple)?N.multiple:1});M++;H.startTime=J;L=J}else{H.multiple=N.multiple;H.unit=N.unit;L=H.endTime}}}}};Timeline.HotZoneGregorianEtherPainter.prototype.initialize=function(G,H){this._band=G;this._timeline=H;this._backgroundLayer=G.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[G.getIndex()];this._markerLayer=null;this._lineLayer=null;var F=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[H.isHorizontal()?"hAlign":"vAlign"];var E=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,F,E);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.HotZoneGregorianEtherPainter.prototype.setHighlight=function(C,D){this._highlight.position(C,D)};Timeline.HotZoneGregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var M=this._band.getMinDate();var P=this._band.getMaxDate();var R=this._band.getTimeZone();var T=this._band.getLabeller();var O=this;var Q=function(B,C){for(var A=0;A<C.multiple;A++){SimileAjax.DateTime.incrementByInterval(B,C.unit)}};var N=0;while(N<this._zones.length){if(M.getTime()<this._zones[N].endTime){break}N++}var X=this._zones.length-1;while(X>=0){if(P.getTime()>this._zones[X].startTime){break}X--}for(var U=N;U<=X;U++){var V=this._zones[U];var S=new Date(Math.max(M.getTime(),V.startTime));var W=new Date(Math.min(P.getTime(),V.endTime));SimileAjax.DateTime.roundDownToInterval(S,V.unit,R,V.multiple,this._theme.firstDayOfWeek);SimileAjax.DateTime.roundUpToInterval(W,V.unit,R,V.multiple,this._theme.firstDayOfWeek);while(S.getTime()<W.getTime()){this._intervalMarkerLayout.createIntervalMarker(S,T,V.unit,this._markerLayer,this._lineLayer);Q(S,V)}}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.HotZoneGregorianEtherPainter.prototype.softPaint=function(){};Timeline.YearCountEtherPainter=function(B){this._params=B;this._theme=B.theme;this._startDate=SimileAjax.DateTime.parseGregorianDateTime(B.startDate);this._multiple=("multiple" in B)?B.multiple:1};Timeline.YearCountEtherPainter.prototype.initialize=function(G,H){this._band=G;this._timeline=H;this._backgroundLayer=G.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[G.getIndex()];this._markerLayer=null;this._lineLayer=null;var F=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[H.isHorizontal()?"hAlign":"vAlign"];var E=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,F,E);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.YearCountEtherPainter.prototype.setHighlight=function(C,D){this._highlight.position(C,D)};Timeline.YearCountEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var L=new Date(this._startDate.getTime());var H=this._band.getMaxDate();var I=this._band.getMinDate().getUTCFullYear()-this._startDate.getUTCFullYear();L.setUTCFullYear(this._band.getMinDate().getUTCFullYear()-I%this._multiple);var K=this;var G=function(B){for(var A=0;A<K._multiple;A++){SimileAjax.DateTime.incrementByInterval(B,SimileAjax.DateTime.YEAR)}};var J={labelInterval:function(C,A){var B=C.getUTCFullYear()-K._startDate.getUTCFullYear();return{text:B,emphasized:B==0}}};while(L.getTime()<H.getTime()){this._intervalMarkerLayout.createIntervalMarker(L,J,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);G(L)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.YearCountEtherPainter.prototype.softPaint=function(){};Timeline.QuarterlyEtherPainter=function(B){this._params=B;this._theme=B.theme;this._startDate=SimileAjax.DateTime.parseGregorianDateTime(B.startDate)};Timeline.QuarterlyEtherPainter.prototype.initialize=function(G,H){this._band=G;this._timeline=H;this._backgroundLayer=G.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[G.getIndex()];this._markerLayer=null;this._lineLayer=null;var F=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[H.isHorizontal()?"hAlign":"vAlign"];var E=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,F,E);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.QuarterlyEtherPainter.prototype.setHighlight=function(C,D){this._highlight.position(C,D)};Timeline.QuarterlyEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var J=new Date(0);var G=this._band.getMaxDate();J.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(),this._band.getMinDate().getUTCFullYear()));J.setUTCMonth(this._startDate.getUTCMonth());var I=this;var F=function(A){A.setUTCMonth(A.getUTCMonth()+3)};var H={labelInterval:function(C,A){var B=(4+(C.getUTCMonth()-I._startDate.getUTCMonth())/3)%4;if(B!=0){return{text:"Q"+(B+1),emphasized:false}}else{return{text:"Y"+(C.getUTCFullYear()-I._startDate.getUTCFullYear()+1),emphasized:true}}}};while(J.getTime()<G.getTime()){this._intervalMarkerLayout.createIntervalMarker(J,H,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);F(J)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.QuarterlyEtherPainter.prototype.softPaint=function(){};Timeline.EtherIntervalMarkerLayout=function(R,S,O,Z,W){var Q=R.isHorizontal();if(Q){if(Z=="Top"){this.positionDiv=function(A,B){A.style.left=B+"px";A.style.top="0px"}}else{this.positionDiv=function(A,B){A.style.left=B+"px";A.style.bottom="0px"}}}else{if(Z=="Left"){this.positionDiv=function(A,B){A.style.top=B+"px";A.style.left="0px"}}else{this.positionDiv=function(A,B){A.style.top=B+"px";A.style.right="0px"}}}var N=O.ether.interval.marker;var V=O.ether.interval.line;var P=O.ether.interval.weekend;var T=(Q?"h":"v")+Z;var X=N[T+"Styler"];var U=N[T+"EmphasizedStyler"];var Y=SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY];this.createIntervalMarker=function(G,g,f,e,J){var F=Math.round(S.dateToPixelOffset(G));if(W&&f!=SimileAjax.DateTime.WEEK){var E=R.getDocument().createElement("div");E.style.position="absolute";if(V.opacity<100){SimileAjax.Graphics.setOpacity(E,V.opacity)}if(Q){E.style.borderLeft="1px solid "+V.color;E.style.left=F+"px";E.style.width="1px";E.style.top="0px";E.style.height="100%"}else{E.style.borderTop="1px solid "+V.color;E.style.top=F+"px";E.style.height="1px";E.style.left="0px";E.style.width="100%"}J.appendChild(E)}if(f==SimileAjax.DateTime.WEEK){var M=O.firstDayOfWeek;var D=new Date(G.getTime()+(6-M-7)*Y);var A=new Date(D.getTime()+2*Y);var C=Math.round(S.dateToPixelOffset(D));var H=Math.round(S.dateToPixelOffset(A));var I=Math.max(1,H-C);var K=R.getDocument().createElement("div");K.style.position="absolute";K.style.background=P.color;if(P.opacity<100){SimileAjax.Graphics.setOpacity(K,P.opacity)}if(Q){K.style.left=C+"px";K.style.width=I+"px";K.style.top="0px";K.style.height="100%"}else{K.style.top=C+"px";K.style.height=I+"px";K.style.left="0px";K.style.width="100%"}J.appendChild(K)}var B=g.labelInterval(G,f);var L=R.getDocument().createElement("div");L.innerHTML=B.text;L.style.position="absolute";(B.emphasized?U:X)(L);this.positionDiv(L,F);e.appendChild(L);return L}};Timeline.EtherHighlight=function(I,G,H,J){var F=I.isHorizontal();this._highlightDiv=null;this._createHighlightDiv=function(){if(this._highlightDiv==null){this._highlightDiv=I.getDocument().createElement("div");this._highlightDiv.setAttribute("name","ether-highlight");this._highlightDiv.style.position="absolute";this._highlightDiv.style.background=H.ether.highlightColor;var A=H.ether.highlightOpacity;if(A<100){SimileAjax.Graphics.setOpacity(this._highlightDiv,A)}J.appendChild(this._highlightDiv)}};this.position=function(E,B){this._createHighlightDiv();var A=Math.round(G.dateToPixelOffset(E));var C=Math.round(G.dateToPixelOffset(B));var D=Math.max(C-A,3);if(F){this._highlightDiv.style.left=A+"px";this._highlightDiv.style.width=D+"px";this._highlightDiv.style.top="2px";this._highlightDiv.style.height=(G.getViewWidth()-4)+"px"}else{this._highlightDiv.style.top=A+"px";this._highlightDiv.style.height=D+"px";this._highlightDiv.style.left="2px";this._highlightDiv.style.width=(G.getViewWidth()-4)+"px"}}};Timeline.LinearEther=function(B){this._params=B;this._interval=B.interval;this._pixelsPerInterval=B.pixelsPerInterval};Timeline.LinearEther.prototype.initialize=function(B){this._timeline=B;this._unit=B.getUnit();if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn)}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);this.shiftPixels(-this._timeline.getPixelLength())}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);this.shiftPixels(-this._timeline.getPixelLength()/2)}else{this._start=this._unit.makeDefaultValue();this.shiftPixels(-this._timeline.getPixelLength()/2)}}}};Timeline.LinearEther.prototype.setDate=function(B){this._start=this._unit.cloneValue(B)};Timeline.LinearEther.prototype.shiftPixels=function(D){var C=this._interval*D/this._pixelsPerInterval;this._start=this._unit.change(this._start,C)};Timeline.LinearEther.prototype.dateToPixelOffset=function(C){var D=this._unit.compare(C,this._start);return this._pixelsPerInterval*D/this._interval};Timeline.LinearEther.prototype.pixelOffsetToDate=function(D){var C=D*this._interval/this._pixelsPerInterval;return this._unit.change(this._start,C)};Timeline.HotZoneEther=function(B){this._params=B;this._interval=B.interval;this._pixelsPerInterval=B.pixelsPerInterval};Timeline.HotZoneEther.prototype.initialize=function(K){this._timeline=K;this._unit=K.getUnit();this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}];var J=this._params;for(var M=0;M<J.zones.length;M++){var P=J.zones[M];var N=this._unit.parseFromObject(P.start);var L=this._unit.parseFromObject(P.end);for(var O=0;O<this._zones.length&&this._unit.compare(L,N)>0;O++){var I=this._zones[O];if(this._unit.compare(N,I.endTime)<0){if(this._unit.compare(N,I.startTime)>0){this._zones.splice(O,0,{startTime:I.startTime,endTime:N,magnify:I.magnify});O++;I.startTime=N}if(this._unit.compare(L,I.endTime)<0){this._zones.splice(O,0,{startTime:N,endTime:L,magnify:P.magnify*I.magnify});O++;I.startTime=L;N=L}else{I.magnify*=P.magnify;N=I.endTime}}}}if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn)}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);this.shiftPixels(-this._timeline.getPixelLength())}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);this.shiftPixels(-this._timeline.getPixelLength()/2)}else{this._start=this._unit.makeDefaultValue();this.shiftPixels(-this._timeline.getPixelLength()/2)}}}};Timeline.HotZoneEther.prototype.setDate=function(B){this._start=this._unit.cloneValue(B)};Timeline.HotZoneEther.prototype.shiftPixels=function(B){this._start=this.pixelOffsetToDate(B)};Timeline.HotZoneEther.prototype.dateToPixelOffset=function(B){return this._dateDiffToPixelOffset(this._start,B)};Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(B){return this._pixelOffsetToDate(B,this._start)};Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(N,J){var L=this._getScale();var O=N;var K=J;var M=0;if(this._unit.compare(O,K)<0){var P=0;while(P<this._zones.length){if(this._unit.compare(O,this._zones[P].endTime)<0){break}P++}while(this._unit.compare(O,K)<0){var R=this._zones[P];var Q=this._unit.earlier(K,R.endTime);M+=(this._unit.compare(Q,O)/(L/R.magnify));O=Q;P++}}else{var P=this._zones.length-1;while(P>=0){if(this._unit.compare(O,this._zones[P].startTime)>0){break}P--}while(this._unit.compare(O,K)>0){var R=this._zones[P];var Q=this._unit.later(K,R.startTime);M+=(this._unit.compare(Q,O)/(L/R.magnify));O=Q;P--}}return M};Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(J,O){var K=this._getScale();var M=O;if(J>0){var L=0;while(L<this._zones.length){if(this._unit.compare(M,this._zones[L].endTime)<0){break}L++}while(J>0){var I=this._zones[L];var N=K/I.magnify;if(I.endTime==Number.POSITIVE_INFINITY){M=this._unit.change(M,J*N);J=0}else{var P=this._unit.compare(I.endTime,M)/N;if(P>J){M=this._unit.change(M,J*N);J=0}else{M=I.endTime;J-=P}}L++}}else{var L=this._zones.length-1;while(L>=0){if(this._unit.compare(M,this._zones[L].startTime)>0){break}L--}J=-J;while(J>0){var I=this._zones[L];var N=K/I.magnify;if(I.startTime==Number.NEGATIVE_INFINITY){M=this._unit.change(M,-J*N);J=0}else{var P=this._unit.compare(M,I.startTime)/N;if(P>J){M=this._unit.change(M,-J*N);J=0}else{M=I.startTime;J-=P}}L--}}return M};Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval};Timeline.GregorianDateLabeller=function(C,D){this._locale=C;this._timeZone=D};Timeline.GregorianDateLabeller.monthNames=[];Timeline.GregorianDateLabeller.dayNames=[];Timeline.GregorianDateLabeller.labelIntervalFunctions=[];Timeline.GregorianDateLabeller.getMonthName=function(D,C){return Timeline.GregorianDateLabeller.monthNames[C][D]};Timeline.GregorianDateLabeller.prototype.labelInterval=function(D,E){var F=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale];if(F==null){F=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval}return F.call(this,D,E)};Timeline.GregorianDateLabeller.prototype.labelPrecise=function(B){return SimileAjax.DateTime.removeTimeZoneOffset(B,this._timeZone).toUTCString()};Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(L,H){var K;var I=false;L=SimileAjax.DateTime.removeTimeZoneOffset(L,this._timeZone);switch(H){case SimileAjax.DateTime.MILLISECOND:K=L.getUTCMilliseconds();break;case SimileAjax.DateTime.SECOND:K=L.getUTCSeconds();break;case SimileAjax.DateTime.MINUTE:var G=L.getUTCMinutes();if(G==0){K=L.getUTCHours()+":00";I=true}else{K=G}break;case SimileAjax.DateTime.HOUR:K=L.getUTCHours()+"hr";break;case SimileAjax.DateTime.DAY:K=Timeline.GregorianDateLabeller.getMonthName(L.getUTCMonth(),this._locale)+" "+L.getUTCDate();break;case SimileAjax.DateTime.WEEK:K=Timeline.GregorianDateLabeller.getMonthName(L.getUTCMonth(),this._locale)+" "+L.getUTCDate();break;case SimileAjax.DateTime.MONTH:var G=L.getUTCMonth();if(G!=0){K=Timeline.GregorianDateLabeller.getMonthName(G,this._locale);break}case SimileAjax.DateTime.YEAR:case SimileAjax.DateTime.DECADE:case SimileAjax.DateTime.CENTURY:case SimileAjax.DateTime.MILLENNIUM:var J=L.getUTCFullYear();if(J>0){K=L.getUTCFullYear()}else{K=(1-J)+"BC"}I=(H==SimileAjax.DateTime.MONTH)||(H==SimileAjax.DateTime.DECADE&&J%100==0)||(H==SimileAjax.DateTime.CENTURY&&J%1000==0);break;default:K=L.toUTCString()}return{text:K,emphasized:I}};Timeline.OriginalEventPainter=function(B){this._params=B;this._onSelectListeners=[];this._filterMatcher=null;this._highlightMatcher=null;this._frc=null;this._eventIdToElmt={}};Timeline.OriginalEventPainter.prototype.initialize=function(D,C){this._band=D;this._timeline=C;this._backLayer=null;this._eventLayer=null;this._lineLayer=null;this._highlightLayer=null;this._eventIdToElmt=null};Timeline.OriginalEventPainter.prototype.addOnSelectListener=function(B){this._onSelectListeners.push(B)};Timeline.OriginalEventPainter.prototype.removeOnSelectListener=function(D){for(var C=0;C<this._onSelectListeners.length;C++){if(this._onSelectListeners[C]==D){this._onSelectListeners.splice(C,1);break}}};Timeline.OriginalEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher};Timeline.OriginalEventPainter.prototype.setFilterMatcher=function(B){this._filterMatcher=B};Timeline.OriginalEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher};Timeline.OriginalEventPainter.prototype.setHighlightMatcher=function(B){this._highlightMatcher=B};Timeline.OriginalEventPainter.prototype.paint=function(){var M=this._band.getEventSource();if(M==null){return }this._eventIdToElmt={};this._prepareForPainting();var P=this._params.theme.event;var R=Math.max(P.track.height,P.tape.height+this._frc.getLineHeight());var S={trackOffset:P.track.gap,trackHeight:R,trackGap:P.track.gap,trackIncrement:R+P.track.gap,icon:P.instant.icon,iconWidth:P.instant.iconWidth,iconHeight:P.instant.iconHeight,labelWidth:P.label.width};var L=this._band.getMinDate();var N=this._band.getMaxDate();var O=(this._filterMatcher!=null)?this._filterMatcher:function(A){return true};var T=(this._highlightMatcher!=null)?this._highlightMatcher:function(A){return -1};var K=M.getEventReverseIterator(L,N);while(K.hasNext()){var Q=K.next();if(O(Q)){this.paintEvent(Q,S,this._params.theme,T(Q))}}this._highlightLayer.style.display="block";this._lineLayer.style.display="block";this._eventLayer.style.display="block"};Timeline.OriginalEventPainter.prototype.softPaint=function(){};Timeline.OriginalEventPainter.prototype._prepareForPainting=function(){var D=this._band;if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");this._backLayer.style.visibility="hidden";var C=document.createElement("span");C.className="timeline-event-label";this._backLayer.appendChild(C);this._frc=SimileAjax.Graphics.getFontRenderingContext(C)}this._frc.update();this._tracks=[];if(this._highlightLayer!=null){D.removeLayerDiv(this._highlightLayer)}this._highlightLayer=D.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";if(this._lineLayer!=null){D.removeLayerDiv(this._lineLayer)}this._lineLayer=D.createLayerDiv(110,"timeline-band-lines");this._lineLayer.style.display="none";if(this._eventLayer!=null){D.removeLayerDiv(this._eventLayer)}this._eventLayer=D.createLayerDiv(115,"timeline-band-events");this._eventLayer.style.display="none"};Timeline.OriginalEventPainter.prototype.paintEvent=function(H,G,F,E){if(H.isInstant()){this.paintInstantEvent(H,G,F,E)}else{this.paintDurationEvent(H,G,F,E)}};Timeline.OriginalEventPainter.prototype.paintInstantEvent=function(H,G,F,E){if(H.isImprecise()){this.paintImpreciseInstantEvent(H,G,F,E)}else{this.paintPreciseInstantEvent(H,G,F,E)}};Timeline.OriginalEventPainter.prototype.paintDurationEvent=function(H,G,F,E){if(H.isImprecise()){this.paintImpreciseDurationEvent(H,G,F,E)}else{this.paintPreciseDurationEvent(H,G,F,E)}};Timeline.OriginalEventPainter.prototype.paintPreciseInstantEvent=function(f,a,Y,Z){var V=this._timeline.getDocument();var g=f.getText();var l=f.getStart();var o=Math.round(this._band.dateToPixelOffset(l));var q=Math.round(o+a.iconWidth/2);var i=Math.round(o-a.iconWidth/2);var k=this._frc.computeSize(g);var U=q+Y.event.label.offsetFromLine;var m=U+k.width;var W=m;var c=this._findFreeTrack(W);var X=Math.round(a.trackOffset+c*a.trackIncrement+a.trackHeight/2-k.height/2);var p=this._paintEventIcon(f,c,i,a,Y);var b=this._paintEventLabel(f,g,U,X,k.width,k.height,Y);var e=this;var j=function(C,B,A){return e._onClickInstantEvent(p.elmt,B,f)};SimileAjax.DOM.registerEvent(p.elmt,"mousedown",j);SimileAjax.DOM.registerEvent(b.elmt,"mousedown",j);this._createHighlightDiv(Z,p,Y);this._eventIdToElmt[f.getID()]=p.elmt;this._tracks[c]=i};Timeline.OriginalEventPainter.prototype.paintImpreciseInstantEvent=function(k,f,a,e){var Y=this._timeline.getDocument();var l=k.getText();var q=k.getStart();var c=k.getEnd();var t=Math.round(this._band.dateToPixelOffset(q));var v=Math.round(this._band.dateToPixelOffset(c));var w=Math.round(t+f.iconWidth/2);var m=Math.round(t-f.iconWidth/2);var p=this._frc.computeSize(l);var X=w+a.event.label.offsetFromLine;var s=X+p.width;var Z=Math.max(s,v);var i=this._findFreeTrack(Z);var b=Math.round(f.trackOffset+i*f.trackIncrement+f.trackHeight/2-p.height/2);var u=this._paintEventIcon(k,i,m,f,a);var g=this._paintEventLabel(k,l,X,b,p.width,p.height,a);var r=this._paintEventTape(k,i,t,v,a.event.instant.impreciseColor,a.event.instant.impreciseOpacity,f,a);var j=this;var o=function(C,B,A){return j._onClickInstantEvent(u.elmt,B,k)};SimileAjax.DOM.registerEvent(u.elmt,"mousedown",o);SimileAjax.DOM.registerEvent(r.elmt,"mousedown",o);SimileAjax.DOM.registerEvent(g.elmt,"mousedown",o);this._createHighlightDiv(e,u,a);this._eventIdToElmt[k.getID()]=u.elmt;this._tracks[i]=m};Timeline.OriginalEventPainter.prototype.paintPreciseDurationEvent=function(j,e,Z,b){var W=this._timeline.getDocument();var k=j.getText();var o=j.getStart();var a=j.getEnd();var r=Math.round(this._band.dateToPixelOffset(o));var s=Math.round(this._band.dateToPixelOffset(a));var m=this._frc.computeSize(k);var V=r;var q=V+m.width;var X=Math.max(q,s);var g=this._findFreeTrack(X);var Y=Math.round(e.trackOffset+g*e.trackIncrement+Z.event.tape.height);var c=j.getColor();c=c!=null?c:Z.event.duration.color;var p=this._paintEventTape(j,g,r,s,c,100,e,Z);var f=this._paintEventLabel(j,k,V,Y,m.width,m.height,Z);var i=this;var l=function(B,A,C){return i._onClickDurationEvent(p.elmt,A,j)};SimileAjax.DOM.registerEvent(p.elmt,"mousedown",l);SimileAjax.DOM.registerEvent(f.elmt,"mousedown",l);this._createHighlightDiv(b,p,Z);this._eventIdToElmt[j.getID()]=p.elmt;this._tracks[g]=r};Timeline.OriginalEventPainter.prototype.paintImpreciseDurationEvent=function(s,m,f,j){var b=this._timeline.getDocument();var t=s.getText();var y=s.getStart();var l=s.getLatestStart();var i=s.getEnd();var c=s.getEarliestEnd();var AB=Math.round(this._band.dateToPixelOffset(y));var x=Math.round(this._band.dateToPixelOffset(l));var AC=Math.round(this._band.dateToPixelOffset(i));var w=Math.round(this._band.dateToPixelOffset(c));var v=this._frc.computeSize(t);var a=x;var AA=a+v.width;var e=Math.max(AA,AC);var q=this._findFreeTrack(e);var g=Math.round(m.trackOffset+q*m.trackIncrement+f.event.tape.height);var k=s.getColor();k=k!=null?k:f.event.duration.color;var o=this._paintEventTape(s,q,AB,AC,f.event.duration.impreciseColor,f.event.duration.impreciseOpacity,m,f);var z=this._paintEventTape(s,q,x,w,k,100,m,f);var p=this._paintEventLabel(s,t,a,g,v.width,v.height,f);var r=this;var u=function(B,A,C){return r._onClickDurationEvent(z.elmt,A,s)};SimileAjax.DOM.registerEvent(z.elmt,"mousedown",u);SimileAjax.DOM.registerEvent(p.elmt,"mousedown",u);this._createHighlightDiv(j,z,f);this._eventIdToElmt[s.getID()]=z.elmt;this._tracks[q]=AB};Timeline.OriginalEventPainter.prototype._findFreeTrack=function(D){for(var E=0;E<this._tracks.length;E++){var F=this._tracks[E];if(F>D){break}}return E};Timeline.OriginalEventPainter.prototype._paintEventIcon=function(P,T,M,S,K){var Q=P.getIcon();Q=Q!=null?Q:S.icon;var O=S.trackOffset+T*S.trackIncrement+S.trackHeight/2;var R=Math.round(O-S.iconHeight/2);var L=SimileAjax.Graphics.createTranslucentImage(Q);var N=this._timeline.getDocument().createElement("div");N.style.position="absolute";N.style.left=M+"px";N.style.top=R+"px";N.appendChild(L);N.style.cursor="pointer";this._eventLayer.appendChild(N);return{left:M,top:R,width:S.iconWidth,height:S.iconHeight,elmt:N}};Timeline.OriginalEventPainter.prototype._paintEventLabel=function(Q,P,M,S,N,O,K){var R=this._timeline.getDocument();var T=R.createElement("div");T.style.position="absolute";T.style.left=M+"px";T.style.width=N+"px";T.style.top=S+"px";T.innerHTML=P;T.style.cursor="pointer";var L=Q.getTextColor();if(L==null){L=Q.getColor()}if(L!=null){T.style.color=L}this._eventLayer.appendChild(T);return{left:M,top:S,width:N,height:O,elmt:T}};Timeline.OriginalEventPainter.prototype._paintEventTape=function(Q,U,X,P,N,V,T,W){var O=P-X;var M=W.event.tape.height;var S=T.trackOffset+U*T.trackIncrement;var R=this._timeline.getDocument().createElement("div");R.style.position="absolute";R.style.left=X+"px";R.style.width=O+"px";R.style.top=S+"px";R.style.height=M+"px";R.style.backgroundColor=N;R.style.overflow="hidden";R.style.cursor="pointer";SimileAjax.Graphics.setOpacity(R,V);this._eventLayer.appendChild(R);return{left:X,top:S,width:O,height:M,elmt:R}};Timeline.OriginalEventPainter.prototype._createHighlightDiv=function(H,M,K){if(H>=0){var L=this._timeline.getDocument();var I=K.event;var N=I.highlightColors[Math.min(H,I.highlightColors.length-1)];var J=L.createElement("div");J.style.position="absolute";J.style.overflow="hidden";J.style.left=(M.left-2)+"px";J.style.width=(M.width+4)+"px";J.style.top=(M.top-2)+"px";J.style.height=(M.height+4)+"px";J.style.background=N;this._highlightLayer.appendChild(J)}};Timeline.OriginalEventPainter.prototype._onClickInstantEvent=function(H,G,E){var F=SimileAjax.DOM.getPageCoordinates(H);this._showBubble(F.left+Math.ceil(H.offsetWidth/2),F.top+Math.ceil(H.offsetHeight/2),E);this._fireOnSelect(E.getID());G.cancelBubble=true;SimileAjax.DOM.cancelEvent(G);return false};Timeline.OriginalEventPainter.prototype._onClickDurationEvent=function(J,K,L){if("pageX" in K){var G=K.pageX;var H=K.pageY}else{var I=SimileAjax.DOM.getPageCoordinates(J);var G=K.offsetX+I.left;var H=K.offsetY+I.top}this._showBubble(G,H,L);this._fireOnSelect(L.getID());K.cancelBubble=true;SimileAjax.DOM.cancelEvent(K);return false};Timeline.OriginalEventPainter.prototype.showBubble=function(D){var F=this._eventIdToElmt[D.getID()];if(F){var E=SimileAjax.DOM.getPageCoordinates(F);this._showBubble(E.left+F.offsetWidth/2,E.top+F.offsetHeight/2,D)}};Timeline.OriginalEventPainter.prototype._showBubble=function(E,F,H){var G=document.createElement("div");H.fillInfoBubble(G,this._params.theme,this._band.getLabeller());SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(G,E,F,this._params.theme.event.bubble.width)};Timeline.OriginalEventPainter.prototype._fireOnSelect=function(D){for(var C=0;C<this._onSelectListeners.length;C++){this._onSelectListeners[C](D)}};Timeline.OverviewEventPainter=function(B){this._params=B;this._onSelectListeners=[];this._filterMatcher=null;this._highlightMatcher=null};Timeline.OverviewEventPainter.prototype.initialize=function(D,C){this._band=D;this._timeline=C;this._eventLayer=null;this._highlightLayer=null};Timeline.OverviewEventPainter.prototype.addOnSelectListener=function(B){this._onSelectListeners.push(B)};Timeline.OverviewEventPainter.prototype.removeOnSelectListener=function(D){for(var C=0;C<this._onSelectListeners.length;C++){if(this._onSelectListeners[C]==D){this._onSelectListeners.splice(C,1);break}}};Timeline.OverviewEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher};Timeline.OverviewEventPainter.prototype.setFilterMatcher=function(B){this._filterMatcher=B};Timeline.OverviewEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher};Timeline.OverviewEventPainter.prototype.setHighlightMatcher=function(B){this._highlightMatcher=B};Timeline.OverviewEventPainter.prototype.paint=function(){var L=this._band.getEventSource();if(L==null){return }this._prepareForPainting();var O=this._params.theme.event;var Q={trackOffset:O.overviewTrack.offset,trackHeight:O.overviewTrack.height,trackGap:O.overviewTrack.gap,trackIncrement:O.overviewTrack.height+O.overviewTrack.gap};var K=this._band.getMinDate();var M=this._band.getMaxDate();var N=(this._filterMatcher!=null)?this._filterMatcher:function(A){return true};var R=(this._highlightMatcher!=null)?this._highlightMatcher:function(A){return -1};var J=L.getEventReverseIterator(K,M);while(J.hasNext()){var P=J.next();if(N(P)){this.paintEvent(P,Q,this._params.theme,R(P))}}this._highlightLayer.style.display="block";this._eventLayer.style.display="block"};Timeline.OverviewEventPainter.prototype.softPaint=function(){};Timeline.OverviewEventPainter.prototype._prepareForPainting=function(){var B=this._band;this._tracks=[];if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer)}this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");this._highlightLayer.style.display="none";if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer)}this._eventLayer=B.createLayerDiv(110,"timeline-band-events");this._eventLayer.style.display="none"};Timeline.OverviewEventPainter.prototype.paintEvent=function(H,G,F,E){if(H.isInstant()){this.paintInstantEvent(H,G,F,E)}else{this.paintDurationEvent(H,G,F,E)}};Timeline.OverviewEventPainter.prototype.paintInstantEvent=function(O,L,K,P){var I=O.getStart();var J=Math.round(this._band.dateToPixelOffset(I));var N=O.getColor();N=N!=null?N:K.event.duration.color;var M=this._paintEventTick(O,J,N,100,L,K);this._createHighlightDiv(P,M,K)};Timeline.OverviewEventPainter.prototype.paintDurationEvent=function(P,Q,R,L){var O=P.getLatestStart();var M=P.getEarliestEnd();var N=Math.round(this._band.dateToPixelOffset(O));var V=Math.round(this._band.dateToPixelOffset(M));var S=0;for(;S<this._tracks.length;S++){if(V<this._tracks[S]){break}}this._tracks[S]=V;var T=P.getColor();T=T!=null?T:R.event.duration.color;var U=this._paintEventTape(P,S,N,V,T,100,Q,R);this._createHighlightDiv(L,U,R)};Timeline.OverviewEventPainter.prototype._paintEventTape=function(R,O,N,S,M,W,V,X){var U=V.trackOffset+O*V.trackIncrement;var P=S-N;var Q=V.trackHeight;var T=this._timeline.getDocument().createElement("div");T.style.position="absolute";T.style.left=N+"px";T.style.width=P+"px";T.style.top=U+"px";T.style.height=Q+"px";T.style.backgroundColor=M;T.style.overflow="hidden";SimileAjax.Graphics.setOpacity(T,W);this._eventLayer.appendChild(T);return{left:N,top:U,width:P,height:Q,elmt:T}};Timeline.OverviewEventPainter.prototype._paintEventTick=function(P,M,L,T,S,K){var O=K.event.overviewTrack.tickHeight;var R=S.trackOffset-O;var N=1;var Q=this._timeline.getDocument().createElement("div");Q.style.position="absolute";Q.style.left=M+"px";Q.style.width=N+"px";Q.style.top=R+"px";Q.style.height=O+"px";Q.style.backgroundColor=L;Q.style.overflow="hidden";SimileAjax.Graphics.setOpacity(Q,T);this._eventLayer.appendChild(Q);return{left:M,top:R,width:N,height:O,elmt:Q}};Timeline.OverviewEventPainter.prototype._createHighlightDiv=function(H,M,K){if(H>=0){var L=this._timeline.getDocument();var I=K.event;var N=I.highlightColors[Math.min(H,I.highlightColors.length-1)];var J=L.createElement("div");J.style.position="absolute";J.style.overflow="hidden";J.style.left=(M.left-1)+"px";J.style.width=(M.width+2)+"px";J.style.top=(M.top-1)+"px";J.style.height=(M.height+2)+"px";J.style.background=N;this._highlightLayer.appendChild(J)}};Timeline.OverviewEventPainter.prototype.showBubble=function(B){};Timeline.DefaultEventSource=function(B){this._events=(B instanceof Object)?B:new SimileAjax.EventIndex();this._listeners=[]};Timeline.DefaultEventSource.prototype.addListener=function(B){this._listeners.push(B)};Timeline.DefaultEventSource.prototype.removeListener=function(D){for(var C=0;C<this._listeners.length;C++){if(this._listeners[C]==D){this._listeners.splice(C,1);break}}};Timeline.DefaultEventSource.prototype.loadXML=function(U,O){var N=this._getBaseURL(O);var T=U.documentElement.getAttribute("wiki-url");var P=U.documentElement.getAttribute("wiki-section");var L=U.documentElement.getAttribute("date-time-format");var V=this._events.getUnit().getParser(L);var M=U.documentElement.firstChild;var S=false;while(M!=null){if(M.nodeType==1){var Q="";if(M.firstChild!=null&&M.firstChild.nodeType==3){Q=M.firstChild.nodeValue}var R=new Timeline.DefaultEventSource.Event(M.getAttribute("id"),V(M.getAttribute("start")),V(M.getAttribute("end")),V(M.getAttribute("latestStart")),V(M.getAttribute("earliestEnd")),M.getAttribute("isDuration")!="true",M.getAttribute("title"),Q,this._resolveRelativeURL(M.getAttribute("image"),N),this._resolveRelativeURL(M.getAttribute("link"),N),this._resolveRelativeURL(M.getAttribute("icon"),N),M.getAttribute("color"),M.getAttribute("textColor"));R._node=M;R.getProperty=function(A){return this._node.getAttribute(A)};R.setWikiInfo(T,P);this._events.add(R);S=true}M=M.nextSibling}if(S){this._fire("onAddMany",[])}};Timeline.DefaultEventSource.prototype.loadJSON=function(U,N){var M=this._getBaseURL(N);var R=false;if(U&&U.events){var S=("wikiURL" in U)?U.wikiURL:null;var P=("wikiSection" in U)?U.wikiSection:null;var L=("dateTimeFormat" in U)?U.dateTimeFormat:null;var T=this._events.getUnit().getParser(L);for(var V=0;V<U.events.length;V++){var O=U.events[V];var Q=new Timeline.DefaultEventSource.Event(("id" in O)?O.id:undefined,T(O.start),T(O.end),T(O.latestStart),T(O.earliestEnd),O.isDuration||false,O.title,O.description,this._resolveRelativeURL(O.image,M),this._resolveRelativeURL(O.link,M),this._resolveRelativeURL(O.icon,M),O.color,O.textColor);Q._obj=O;Q.getProperty=function(A){return this._obj[A]};Q.setWikiInfo(S,P);this._events.add(Q);R=true}}if(R){this._fire("onAddMany",[])}};Timeline.DefaultEventSource.prototype.loadSPARQL=function(V,P){var N=this._getBaseURL(P);var X="iso8601";var W=this._events.getUnit().getParser(X);if(V==null){return }var M=V.documentElement.firstChild;while(M!=null&&(M.nodeType!=1||M.nodeName!="results")){M=M.nextSibling}var T=null;var Q=null;if(M!=null){T=M.getAttribute("wiki-url");Q=M.getAttribute("wiki-section");M=M.firstChild}var S=false;while(M!=null){if(M.nodeType==1){var O={};var U=M.firstChild;while(U!=null){if(U.nodeType==1&&U.firstChild!=null&&U.firstChild.nodeType==1&&U.firstChild.firstChild!=null&&U.firstChild.firstChild.nodeType==3){O[U.getAttribute("name")]=U.firstChild.firstChild.nodeValue}U=U.nextSibling}if(O.start==null&&O.date!=null){O.start=O.date}var R=new Timeline.DefaultEventSource.Event(O.id,W(O.start),W(O.end),W(O.latestStart),W(O.earliestEnd),O.isDuration!="true",O.title,O.description,this._resolveRelativeURL(O.image,N),this._resolveRelativeURL(O.link,N),this._resolveRelativeURL(O.icon,N),O.color,O.textColor);R._bindings=O;R.getProperty=function(A){return this._bindings[A]};R.setWikiInfo(T,Q);this._events.add(R);S=true}M=M.nextSibling}if(S){this._fire("onAddMany",[])}};Timeline.DefaultEventSource.prototype.add=function(B){this._events.add(B);this._fire("onAddOne",[B])};Timeline.DefaultEventSource.prototype.addMany=function(D){for(var C=0;C<D.length;C++){this._events.add(D[C])}this._fire("onAddMany",[])};Timeline.DefaultEventSource.prototype.clear=function(){this._events.removeAll();this._fire("onClear",[])};Timeline.DefaultEventSource.prototype.getEvent=function(B){return this._events.getEvent(B)};Timeline.DefaultEventSource.prototype.getEventIterator=function(C,D){return this._events.getIterator(C,D)};Timeline.DefaultEventSource.prototype.getEventReverseIterator=function(C,D){return this._events.getReverseIterator(C,D)};Timeline.DefaultEventSource.prototype.getAllEventIterator=function(){return this._events.getAllIterator()};Timeline.DefaultEventSource.prototype.getCount=function(){return this._events.getCount()};Timeline.DefaultEventSource.prototype.getEarliestDate=function(){return this._events.getEarliestDate()};Timeline.DefaultEventSource.prototype.getLatestDate=function(){return this._events.getLatestDate()};Timeline.DefaultEventSource.prototype._fire=function(J,F){for(var I=0;I<this._listeners.length;I++){var H=this._listeners[I];if(J in H){try{H[J].apply(H,F)}catch(G){SimileAjax.Debug.exception(G)}}}};Timeline.DefaultEventSource.prototype._getBaseURL=function(D){if(D.indexOf("://")<0){var E=this._getBaseURL(document.location.href);if(D.substr(0,1)=="/"){D=E.substr(0,E.indexOf("/",E.indexOf("://")+3))+D}else{D=E+D}}var F=D.lastIndexOf("/");if(F<0){return""}else{return D.substr(0,F+1)}};Timeline.DefaultEventSource.prototype._resolveRelativeURL=function(C,D){if(C==null||C==""){return C}else{if(C.indexOf("://")>0){return C}else{if(C.substr(0,1)=="/"){return D.substr(0,D.indexOf("/",D.indexOf("://")+3))+C}else{return D+C}}}};Timeline.DefaultEventSource.Event=function(Q,P,Y,W,X,O,R,S,N,U,V,Z,T){Q=(Q)?Q.trim():"";this._id=Q.length>0?Q:("e"+Math.floor(Math.random()*1000000));this._instant=O||(Y==null);this._start=P;this._end=(Y!=null)?Y:P;this._latestStart=(W!=null)?W:(O?this._end:this._start);this._earliestEnd=(X!=null)?X:(O?this._start:this._end);this._text=SimileAjax.HTML.deEntify(R);this._description=SimileAjax.HTML.deEntify(S);this._image=(N!=null&&N!="")?N:null;this._link=(U!=null&&U!="")?U:null;this._icon=(V!=null&&V!="")?V:null;this._color=(Z!=null&&Z!="")?Z:null;this._textColor=(T!=null&&T!="")?T:null;this._wikiURL=null;this._wikiSection=null};Timeline.DefaultEventSource.Event.prototype={getID:function(){return this._id},isInstant:function(){return this._instant},isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd},getStart:function(){return this._start},getEnd:function(){return this._end},getLatestStart:function(){return this._latestStart},getEarliestEnd:function(){return this._earliestEnd},getText:function(){return this._text},getDescription:function(){return this._description},getImage:function(){return this._image},getLink:function(){return this._link},getIcon:function(){return this._icon},getColor:function(){return this._color},getTextColor:function(){return this._textColor},getProperty:function(B){return null},getWikiURL:function(){return this._wikiURL},getWikiSection:function(){return this._wikiSection},setWikiInfo:function(D,C){this._wikiURL=D;this._wikiSection=C},fillDescription:function(B){B.innerHTML=this._description},fillWikiInfo:function(F){if(this._wikiURL!=null&&this._wikiSection!=null){var G=this.getProperty("wikiID");if(G==null||G.length==0){G=this.getText()}G=G.replace(/\s/g,"_");var H=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+G;var E=document.createElement("a");E.href=H;E.target="new";E.innerHTML=Timeline.strings[Timeline.clientLocale].wikiLinkLabel;F.appendChild(document.createTextNode("["));F.appendChild(E);F.appendChild(document.createTextNode("]"))}else{F.style.display="none"}},fillTime:function(C,D){if(this._instant){if(this.isImprecise()){C.appendChild(C.ownerDocument.createTextNode(D.labelPrecise(this._start)));C.appendChild(C.ownerDocument.createElement("br"));C.appendChild(C.ownerDocument.createTextNode(D.labelPrecise(this._end)))}else{C.appendChild(C.ownerDocument.createTextNode(D.labelPrecise(this._start)))}}else{if(this.isImprecise()){C.appendChild(C.ownerDocument.createTextNode(D.labelPrecise(this._start)+" ~ "+D.labelPrecise(this._latestStart)));C.appendChild(C.ownerDocument.createElement("br"));C.appendChild(C.ownerDocument.createTextNode(D.labelPrecise(this._earliestEnd)+" ~ "+D.labelPrecise(this._end)))}else{C.appendChild(C.ownerDocument.createTextNode(D.labelPrecise(this._start)));C.appendChild(C.ownerDocument.createElement("br"));C.appendChild(C.ownerDocument.createTextNode(D.labelPrecise(this._end)))}}},fillInfoBubble:function(R,O,V){var U=R.ownerDocument;var W=this.getText();var Y=this.getLink();var P=this.getImage();if(P!=null){var b=U.createElement("img");b.src=P;O.event.bubble.imageStyler(b);R.appendChild(b)}var T=U.createElement("div");var Q=U.createTextNode(W);if(Y!=null){var X=U.createElement("a");X.href=Y;X.appendChild(Q);T.appendChild(X)}else{T.appendChild(Q)}O.event.bubble.titleStyler(T);R.appendChild(T);var S=U.createElement("div");this.fillDescription(S);O.event.bubble.bodyStyler(S);R.appendChild(S);var Z=U.createElement("div");this.fillTime(Z,V);O.event.bubble.timeStyler(Z);R.appendChild(Z);var a=U.createElement("div");this.fillWikiInfo(a);O.event.bubble.wikiStyler(a);R.appendChild(a)}};Timeline.ClassicTheme=new Object();Timeline.ClassicTheme.implementations=[];Timeline.ClassicTheme.create=function(C){if(C==null){C=Timeline.getDefaultLocale()}var D=Timeline.ClassicTheme.implementations[C];if(D==null){D=Timeline.ClassicTheme._Impl}return new D()};Timeline.ClassicTheme._Impl=function(){this.firstDayOfWeek=0;this.ether={backgroundColors:["#EEE","#DDD","#CCC","#AAA"],highlightColor:"white",highlightOpacity:50,interval:{line:{show:true,color:"#aaa",opacity:25},weekend:{color:"#FFFFE0",opacity:30},marker:{hAlign:"Bottom",hBottomStyler:function(B){B.className="timeline-ether-marker-bottom"},hBottomEmphasizedStyler:function(B){B.className="timeline-ether-marker-bottom-emphasized"},hTopStyler:function(B){B.className="timeline-ether-marker-top"},hTopEmphasizedStyler:function(B){B.className="timeline-ether-marker-top-emphasized"},vAlign:"Right",vRightStyler:function(B){B.className="timeline-ether-marker-right"},vRightEmphasizedStyler:function(B){B.className="timeline-ether-marker-right-emphasized"},vLeftStyler:function(B){B.className="timeline-ether-marker-left"},vLeftEmphasizedStyler:function(B){B.className="timeline-ether-marker-left-emphasized"}}}};this.event={track:{height:10,gap:2},overviewTrack:{offset:20,tickHeight:6,height:2,gap:1},tape:{height:4},instant:{icon:Timeline.urlPrefix+"images/dull-blue-circle.png",iconWidth:10,iconHeight:10,color:"#58A0DC",impreciseColor:"#58A0DC",impreciseOpacity:20},duration:{color:"#58A0DC",impreciseColor:"#58A0DC",impreciseOpacity:20},label:{backgroundColor:"white",backgroundOpacity:50,lineColor:"#58A0DC",offsetFromLine:3},highlightColors:["#FFFF00","#FFC000","#FF0000","#0000FF"],bubble:{width:250,height:125,titleStyler:function(B){B.className="timeline-event-bubble-title"},bodyStyler:function(B){B.className="timeline-event-bubble-body"},imageStyler:function(B){B.className="timeline-event-bubble-image"},wikiStyler:function(B){B.className="timeline-event-bubble-wiki"},timeStyler:function(B){B.className="timeline-event-bubble-time"}}}};Timeline.strings={};Timeline.getDefaultLocale=function(){return Timeline.clientLocale};Timeline.create=function(G,H,E,F){return new Timeline._Impl(G,H,E,F)};Timeline.HORIZONTAL=0;Timeline.VERTICAL=1;Timeline._defaultTheme=null;Timeline.createBandInfo=function(J){var K=("theme" in J)?J.theme:Timeline.getDefaultTheme();var L=("eventSource" in J)?J.eventSource:null;var M=new Timeline.LinearEther({centersOn:("date" in J)?J.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[J.intervalUnit],pixelsPerInterval:J.intervalPixels});var O=new Timeline.GregorianEtherPainter({unit:J.intervalUnit,multiple:("multiple" in J)?J.multiple:1,theme:K,align:("align" in J)?J.align:undefined});var I={showText:("showEventText" in J)?J.showEventText:true,theme:K};if("trackHeight" in J){I.trackHeight=J.trackHeight}if("trackGap" in J){I.trackGap=J.trackGap}var N=("overview" in J&&J.overview)?"overview":("layout" in J?J.layout:"original");var P;switch(N){case"overview":P=new Timeline.OverviewEventPainter(I);break;case"detailed":P=new Timeline.DetailedEventPainter(I);break;default:P=new Timeline.OriginalEventPainter(I)}return{width:J.width,eventSource:L,timeZone:("timeZone" in J)?J.timeZone:0,ether:M,etherPainter:O,eventPainter:P}};Timeline.createHotZoneBandInfo=function(J){var K=("theme" in J)?J.theme:Timeline.getDefaultTheme();var L=("eventSource" in J)?J.eventSource:null;var M=new Timeline.HotZoneEther({centersOn:("date" in J)?J.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[J.intervalUnit],pixelsPerInterval:J.intervalPixels,zones:J.zones});var O=new Timeline.HotZoneGregorianEtherPainter({unit:J.intervalUnit,zones:J.zones,theme:K,align:("align" in J)?J.align:undefined});var I={showText:("showEventText" in J)?J.showEventText:true,theme:K};if("trackHeight" in J){I.trackHeight=J.trackHeight}if("trackGap" in J){I.trackGap=J.trackGap}var N=("overview" in J&&J.overview)?"overview":("layout" in J?J.layout:"original");var P;switch(N){case"overview":P=new Timeline.OverviewEventPainter(I);break;case"detailed":P=new Timeline.DetailedEventPainter(I);break;default:P=new Timeline.OriginalEventPainter(I)}return{width:J.width,eventSource:L,timeZone:("timeZone" in J)?J.timeZone:0,ether:M,etherPainter:O,eventPainter:P}};Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.getDefaultLocale())}return Timeline._defaultTheme};Timeline.setDefaultTheme=function(B){Timeline._defaultTheme=B};Timeline.loadXML=function(E,G){var F=function(A,C,B){alert("Failed to load data xml from "+E+"\n"+A)};var H=function(A){var B=A.responseXML;if(!B.documentElement&&A.responseStream){B.load(A.responseStream)}G(B,E)};SimileAjax.XmlHttp.get(E,F,H)};Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText)};var fDone=function(xmlhttp){f(eval("("+xmlhttp.responseText+")"),url)};SimileAjax.XmlHttp.get(url,fError,fDone)};Timeline._Impl=function(G,H,E,F){SimileAjax.WindowManager.initialize();this._containerDiv=G;this._bandInfos=H;this._orientation=E==null?Timeline.HORIZONTAL:E;this._unit=(F!=null)?F:SimileAjax.NativeDateUnit;this._initialize()};Timeline._Impl.prototype.dispose=function(){for(var B=0;B<this._bands.length;B++){this._bands[B].dispose()}this._bands=null;this._bandInfos=null;this._containerDiv.innerHTML=""};Timeline._Impl.prototype.getBandCount=function(){return this._bands.length};Timeline._Impl.prototype.getBand=function(B){return this._bands[B]};Timeline._Impl.prototype.layout=function(){this._distributeWidths()};Timeline._Impl.prototype.paint=function(){for(var B=0;B<this._bands.length;B++){this._bands[B].paint()}};Timeline._Impl.prototype.getDocument=function(){return this._containerDiv.ownerDocument};Timeline._Impl.prototype.addDiv=function(B){this._containerDiv.appendChild(B)};Timeline._Impl.prototype.removeDiv=function(B){this._containerDiv.removeChild(B)};Timeline._Impl.prototype.isHorizontal=function(){return this._orientation==Timeline.HORIZONTAL};Timeline._Impl.prototype.isVertical=function(){return this._orientation==Timeline.VERTICAL};Timeline._Impl.prototype.getPixelLength=function(){return this._orientation==Timeline.HORIZONTAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight};Timeline._Impl.prototype.getPixelWidth=function(){return this._orientation==Timeline.VERTICAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight};Timeline._Impl.prototype.getUnit=function(){return this._unit};Timeline._Impl.prototype.loadXML=function(J,H){var F=this;var G=function(A,C,B){alert("Failed to load data xml from "+J+"\n"+A);F.hideLoadingMessage()};var I=function(A){try{var B=A.responseXML;if(!B.documentElement&&A.responseStream){B.load(A.responseStream)}H(B,J)}finally{F.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(J,G,I)},0)};Timeline._Impl.prototype.loadJSON=function(url,f){var tl=this;var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);tl.hideLoadingMessage()};var fDone=function(xmlhttp){try{f(eval("("+xmlhttp.responseText+")"),url)}finally{tl.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(url,fError,fDone)},0)};Timeline._Impl.prototype._initialize=function(){var I=this._containerDiv;var L=I.ownerDocument;I.className=I.className.split(" ").concat("timeline-container").join(" ");while(I.firstChild){I.removeChild(I.firstChild)}var H=SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix+(this.isHorizontal()?"images/copyright-vertical.png":"images/copyright.png"));H.className="timeline-copyright";H.title="Timeline (c) SIMILE - http://simile.mit.edu/timeline/";SimileAjax.DOM.registerEvent(H,"click",function(){window.location="http://simile.mit.edu/timeline/"});I.appendChild(H);this._bands=[];for(var N=0;N<this._bandInfos.length;N++){var J=new Timeline._Band(this,this._bandInfos[N],N);this._bands.push(J)}this._distributeWidths();for(var N=0;N<this._bandInfos.length;N++){var K=this._bandInfos[N];if("syncWith" in K){this._bands[N].setSyncWithBand(this._bands[K.syncWith],("highlight" in K)?K.highlight:false)}}var M=SimileAjax.Graphics.createMessageBubble(L);M.containerDiv.className="timeline-message-container";I.appendChild(M.containerDiv);M.contentDiv.className="timeline-message";M.contentDiv.innerHTML="<img src='"+Timeline.urlPrefix+"images/progress-running.gif' /> Loading...";this.showLoadingMessage=function(){M.containerDiv.style.display="block"};this.hideLoadingMessage=function(){M.containerDiv.style.display="none"}};Timeline._Impl.prototype._distributeWidths=function(){var M=this.getPixelLength();var N=this.getPixelWidth();var K=0;for(var T=0;T<this._bands.length;T++){var P=this._bands[T];var O=this._bandInfos[T];var S=O.width;var Q=S.indexOf("%");if(Q>0){var R=parseInt(S.substr(0,Q));var L=R*N/100}else{var L=parseInt(S)}P.setBandShiftAndWidth(K,L);P.setViewLength(M);K+=L}};Timeline._Band=function(I,H,L){this._timeline=I;this._bandInfo=H;this._index=L;this._locale=("locale" in H)?H.locale:Timeline.getDefaultLocale();this._timeZone=("timeZone" in H)?H.timeZone:0;this._labeller=("labeller" in H)?H.labeller:(("createLabeller" in I.getUnit())?I.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone));this._dragging=false;this._changing=false;this._originalScrollSpeed=5;this._scrollSpeed=this._originalScrollSpeed;this._onScrollListeners=[];var G=this;this._syncWithBand=null;this._syncWithBandHandler=function(A){G._onHighlightBandScroll()};this._selectorListener=function(A){G._onHighlightBandScroll()};var J=this._timeline.getDocument().createElement("div");J.className="timeline-band-input";this._timeline.addDiv(J);this._keyboardInput=document.createElement("input");this._keyboardInput.type="text";J.appendChild(this._keyboardInput);SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,"_onKeyDown");SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,"_onKeyUp");this._div=this._timeline.getDocument().createElement("div");this._div.className="timeline-band timeline-band-"+L;this._timeline.addDiv(this._div);SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown");SimileAjax.DOM.registerEventWithObject(this._div,"mousemove",this,"_onMouseMove");SimileAjax.DOM.registerEventWithObject(this._div,"mouseup",this,"_onMouseUp");SimileAjax.DOM.registerEventWithObject(this._div,"mouseout",this,"_onMouseOut");SimileAjax.DOM.registerEventWithObject(this._div,"dblclick",this,"_onDblClick");this._innerDiv=this._timeline.getDocument().createElement("div");this._innerDiv.className="timeline-band-inner";this._div.appendChild(this._innerDiv);this._ether=H.ether;H.ether.initialize(I);this._etherPainter=H.etherPainter;H.etherPainter.initialize(this,I);this._eventSource=H.eventSource;if(this._eventSource){this._eventListener={onAddMany:function(){G._onAddMany()},onClear:function(){G._onClear()}};this._eventSource.addListener(this._eventListener)}this._eventPainter=H.eventPainter;H.eventPainter.initialize(this,I);this._decorators=("decorators" in H)?H.decorators:[];for(var K=0;K<this._decorators.length;K++){this._decorators[K].initialize(this,I)}};Timeline._Band.SCROLL_MULTIPLES=5;Timeline._Band.prototype.dispose=function(){this.closeBubble();if(this._eventSource){this._eventSource.removeListener(this._eventListener);this._eventListener=null;this._eventSource=null}this._timeline=null;this._bandInfo=null;this._labeller=null;this._ether=null;this._etherPainter=null;this._eventPainter=null;this._decorators=null;this._onScrollListeners=null;this._syncWithBandHandler=null;this._selectorListener=null;this._div=null;this._innerDiv=null;this._keyboardInput=null};Timeline._Band.prototype.addOnScrollListener=function(B){this._onScrollListeners.push(B)};Timeline._Band.prototype.removeOnScrollListener=function(D){for(var C=0;C<this._onScrollListeners.length;C++){if(this._onScrollListeners[C]==D){this._onScrollListeners.splice(C,1);break}}};Timeline._Band.prototype.setSyncWithBand=function(D,C){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler)}this._syncWithBand=D;this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);this._highlight=C;this._positionHighlight()};Timeline._Band.prototype.getLocale=function(){return this._locale};Timeline._Band.prototype.getTimeZone=function(){return this._timeZone};Timeline._Band.prototype.getLabeller=function(){return this._labeller};Timeline._Band.prototype.getIndex=function(){return this._index};Timeline._Band.prototype.getEther=function(){return this._ether};Timeline._Band.prototype.getEtherPainter=function(){return this._etherPainter};Timeline._Band.prototype.getEventSource=function(){return this._eventSource};Timeline._Band.prototype.getEventPainter=function(){return this._eventPainter};Timeline._Band.prototype.layout=function(){this.paint()};Timeline._Band.prototype.paint=function(){this._etherPainter.paint();this._paintDecorators();this._paintEvents()};Timeline._Band.prototype.softLayout=function(){this.softPaint()};Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint();this._softPaintDecorators();this._softPaintEvents()};Timeline._Band.prototype.setBandShiftAndWidth=function(E,F){var G=this._keyboardInput.parentNode;var H=E+Math.floor(F/2);if(this._timeline.isHorizontal()){this._div.style.top=E+"px";this._div.style.height=F+"px";G.style.top=H+"px";G.style.left="-1em"}else{this._div.style.left=E+"px";this._div.style.width=F+"px";G.style.left=H+"px";G.style.top="-1em"}};Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetHeight}else{return this._div.offsetWidth}};Timeline._Band.prototype.setViewLength=function(B){this._viewLength=B;this._recenterDiv();this._onChanging()};Timeline._Band.prototype.getViewLength=function(){return this._viewLength};Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength};Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset};Timeline._Band.prototype.getMinDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset)};Timeline._Band.prototype.getMaxDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset+Timeline._Band.SCROLL_MULTIPLES*this._viewLength)};Timeline._Band.prototype.getMinVisibleDate=function(){return this._ether.pixelOffsetToDate(0)};Timeline._Band.prototype.getMaxVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength)};Timeline._Band.prototype.getCenterVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength/2)};Timeline._Band.prototype.setMinVisibleDate=function(B){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(B)))}};Timeline._Band.prototype.setMaxVisibleDate=function(B){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(B)))}};Timeline._Band.prototype.setCenterVisibleDate=function(B){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(B)))}};Timeline._Band.prototype.dateToPixelOffset=function(B){return this._ether.dateToPixelOffset(B)-this._viewOffset};Timeline._Band.prototype.pixelOffsetToDate=function(B){return this._ether.pixelOffsetToDate(B+this._viewOffset)};Timeline._Band.prototype.createLayerDiv=function(F,H){var G=this._timeline.getDocument().createElement("div");G.className="timeline-band-layer"+(typeof H=="string"?(" "+H):"");G.style.zIndex=F;this._innerDiv.appendChild(G);var E=this._timeline.getDocument().createElement("div");E.className="timeline-band-layer-inner";if(SimileAjax.Platform.browser.isIE){E.style.cursor="move"}else{E.style.cursor="-moz-grab"}G.appendChild(E);return E};Timeline._Band.prototype.removeLayerDiv=function(B){this._innerDiv.removeChild(B.parentNode)};Timeline._Band.prototype.scrollToCenter=function(F,E){var D=this._ether.dateToPixelOffset(F);if(D<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(D+this._viewLength))}else{if(D>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(D-this._viewLength))}}this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(F)),E)};Timeline._Band.prototype.showBubbleForEvent=function(E){var D=this.getEventSource().getEvent(E);if(D){var F=this;this.scrollToCenter(D.getStart(),function(){F._eventPainter.showBubble(D)})}};Timeline._Band.prototype._onMouseDown=function(F,D,E){this.closeBubble();this._dragging=true;this._dragX=D.clientX;this._dragY=D.clientY};Timeline._Band.prototype._onMouseMove=function(H,F,G){if(this._dragging){var I=F.clientX-this._dragX;var J=F.clientY-this._dragY;this._dragX=F.clientX;this._dragY=F.clientY;this._moveEther(this._timeline.isHorizontal()?I:J);this._positionHighlight()}};Timeline._Band.prototype._onMouseUp=function(F,D,E){this._dragging=false;this._keyboardInput.focus()};Timeline._Band.prototype._onMouseOut=function(H,E,F){var G=SimileAjax.DOM.getEventRelativeCoordinates(E,H);G.x+=this._viewOffset;if(G.x<0||G.x>H.offsetWidth||G.y<0||G.y>H.offsetHeight){this._dragging=false}};Timeline._Band.prototype._onDblClick=function(J,F,H){var I=SimileAjax.DOM.getEventRelativeCoordinates(F,J);var G=I.x-(this._viewLength/2-this._viewOffset);this._autoScroll(-G)};Timeline._Band.prototype._onKeyDown=function(F,D,E){if(!this._dragging){switch(D.keyCode){case 27:break;case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;default:return true}this.closeBubble();SimileAjax.DOM.cancelEvent(D);return false}return true};Timeline._Band.prototype._onKeyUp=function(F,D,E){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed;switch(D.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate());break;case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate());break;case 33:this._autoScroll(this._timeline.getPixelLength());break;case 34:this._autoScroll(-this._timeline.getPixelLength());break;default:return true}this.closeBubble();SimileAjax.DOM.cancelEvent(D);return false}return true};Timeline._Band.prototype._autoScroll=function(F,G){var E=this;var H=SimileAjax.Graphics.createAnimation(function(B,A){E._moveEther(A)},0,F,1000,G);H.run()};Timeline._Band.prototype._moveEther=function(B){this.closeBubble();this._viewOffset+=B;this._ether.shiftPixels(-B);if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px"}else{this._div.style.top=this._viewOffset+"px"}if(this._viewOffset>-this._viewLength*0.5||this._viewOffset<-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)){this._recenterDiv()}else{this.softLayout()}this._onChanging()};Timeline._Band.prototype._onChanging=function(){this._changing=true;this._fireOnScroll();this._setSyncWithBandDate();this._changing=false};Timeline._Band.prototype._fireOnScroll=function(){for(var B=0;B<this._onScrollListeners.length;B++){this._onScrollListeners[B](this)}};Timeline._Band.prototype._setSyncWithBandDate=function(){if(this._syncWithBand){var B=this._ether.pixelOffsetToDate(this.getViewLength()/2);this._syncWithBand.setCenterVisibleDate(B)}};Timeline._Band.prototype._onHighlightBandScroll=function(){if(this._syncWithBand){var C=this._syncWithBand.getCenterVisibleDate();var D=this._ether.dateToPixelOffset(C);this._moveEther(Math.round(this._viewLength/2-D));if(this._highlight){this._etherPainter.setHighlight(this._syncWithBand.getMinVisibleDate(),this._syncWithBand.getMaxVisibleDate())}}};Timeline._Band.prototype._onAddMany=function(){this._paintEvents()};Timeline._Band.prototype._onClear=function(){this._paintEvents()};Timeline._Band.prototype._positionHighlight=function(){if(this._syncWithBand){var C=this._syncWithBand.getMinVisibleDate();var D=this._syncWithBand.getMaxVisibleDate();if(this._highlight){this._etherPainter.setHighlight(C,D)}}};Timeline._Band.prototype._recenterDiv=function(){this._viewOffset=-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1)/2;if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";this._div.style.width=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px"}else{this._div.style.top=this._viewOffset+"px";this._div.style.height=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px"}this.layout()};Timeline._Band.prototype._paintEvents=function(){this._eventPainter.paint()};Timeline._Band.prototype._softPaintEvents=function(){this._eventPainter.softPaint()};Timeline._Band.prototype._paintDecorators=function(){for(var B=0;B<this._decorators.length;B++){this._decorators[B].paint()}};Timeline._Band.prototype._softPaintDecorators=function(){for(var B=0;B<this._decorators.length;B++){this._decorators[B].softPaint()}};Timeline._Band.prototype.closeBubble=function(){SimileAjax.WindowManager.cancelPopups()};Timeline.NativeDateUnit=new Object();Timeline.NativeDateUnit.createLabeller=function(C,D){return new Timeline.GregorianDateLabeller(C,D)};Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date()};Timeline.NativeDateUnit.cloneValue=function(B){return new Date(B.getTime())};Timeline.NativeDateUnit.getParser=function(B){if(typeof B=="string"){B=B.toLowerCase()}return(B=="iso8601"||B=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime};Timeline.NativeDateUnit.parseFromObject=function(B){return Timeline.DateTime.parseGregorianDateTime(B)};Timeline.NativeDateUnit.toNumber=function(B){return B.getTime()};Timeline.NativeDateUnit.fromNumber=function(B){return new Date(B)};Timeline.NativeDateUnit.compare=function(F,G){var H,E;if(typeof F=="object"){H=F.getTime()}else{H=Number(F)}if(typeof G=="object"){E=G.getTime()}else{E=Number(G)}return H-E};Timeline.NativeDateUnit.earlier=function(D,C){return Timeline.NativeDateUnit.compare(D,C)<0?D:C};Timeline.NativeDateUnit.later=function(D,C){return Timeline.NativeDateUnit.compare(D,C)>0?D:C};Timeline.NativeDateUnit.change=function(C,D){return new Date(C.getTime()+D)};Timeline.GregorianDateLabeller.monthNames.en=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Timeline.strings.en={wikiLinkLabel:"Discuss"};window.Timeplot={loaded:true,params:{bundle:true,autoCreate:true},namespace:"http://simile.mit.edu/2007/06/timeplot#",importers:{}};Timeplot.loaded=true;Timeplot.urlPrefix="/";Timeline.Debug=SimileAjax.Debug;var log=SimileAjax.Debug.log;Object.extend=function(A,C){for(var B in C){A[B]=C[B]}return A};Timeplot.create=function(A,B){return new Timeplot._Impl(A,B)};Timeplot.createPlotInfo=function(A){return{id:("id" in A)?A.id:"p"+Math.round(Math.random()*1000000),dataSource:("dataSource" in A)?A.dataSource:null,eventSource:("eventSource" in A)?A.eventSource:null,timeGeometry:("timeGeometry" in A)?A.timeGeometry:new Timeplot.DefaultTimeGeometry(),valueGeometry:("valueGeometry" in A)?A.valueGeometry:new Timeplot.DefaultValueGeometry(),timeZone:("timeZone" in A)?A.timeZone:0,fillColor:("fillColor" in A)?((A.fillColor=="string")?new Timeplot.Color(A.fillColor):A.fillColor):null,fillGradient:("fillGradient" in A)?A.fillGradient:true,fillFrom:("fillFrom" in A)?A.fillFrom:Number.NEGATIVE_INFINITY,lineColor:("lineColor" in A)?((A.lineColor=="string")?new Timeplot.Color(A.lineColor):A.lineColor):new Timeplot.Color("#606060"),lineWidth:("lineWidth" in A)?A.lineWidth:1,dotRadius:("dotRadius" in A)?A.dotRadius:2,dotColor:("dotColor" in A)?A.dotColor:null,eventLineWidth:("eventLineWidth" in A)?A.eventLineWidth:1,showValues:("showValues" in A)?A.showValues:false,roundValues:("roundValues" in A)?A.roundValues:true,valuesOpacity:("valuesOpacity" in A)?A.valuesOpacity:75,bubbleWidth:("bubbleWidth" in A)?A.bubbleWidth:300,bubbleHeight:("bubbleHeight" in A)?A.bubbleHeight:200}};Timeplot._Impl=function(A,B){this._id="t"+Math.round(Math.random()*1000000);this._containerDiv=A;this._plotInfos=B;this._painters={background:[],foreground:[]};this._painter=null;this._active=false;this._upright=false;this._initialize()};Timeplot._Impl.prototype={dispose:function(){for(var A=0;A<this._plots.length;A++){this._plots[A].dispose()}this._plots=null;this._plotsInfos=null;this._containerDiv.innerHTML=""},getElement:function(){return this._containerDiv},getDocument:function(){return this._containerDiv.ownerDocument},add:function(A){this._containerDiv.appendChild(A)},remove:function(A){this._containerDiv.removeChild(A)},addPainter:function(B,A){var D=this._painters[B];if(D){for(var C=0;C<D.length;C++){if(D[C].context._id==A.context._id){return }}D.push(A)}},removePainter:function(B,A){var D=this._painters[B];if(D){for(var C=0;C<D.length;C++){if(D[C].context._id==A.context._id){D.splice(C,1);break}}}},getWidth:function(){return this._containerDiv.clientWidth},getHeight:function(){return this._containerDiv.clientHeight},getCanvas:function(){return this._canvas},loadText:function(A,G,D,C,F){if(this._active){var H=this;var E=function(K,I,J){alert("Failed to load data xml from "+A+"\n"+K);H.hideLoadingMessage()};var B=function(I){try{D.loadText(I.responseText,G,A,C,F)}catch(J){SimileAjax.Debug.exception(J)}finally{H.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(A,E,B)},0)}},loadXML:function(B,D){if(this._active){var A=this;var E=function(H,F,G){alert("Failed to load data xml from "+B+"\n"+H);A.hideLoadingMessage()};var C=function(G){try{var F=G.responseXML;if(!F.documentElement&&G.responseStream){F.load(G.responseStream)}D.loadXML(F,B)}finally{A.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){SimileAjax.XmlHttp.get(B,E,C)},0)}},putText:function(E,C,A,B){var D=this.putDiv(E,"timeplot-div "+A,B);D.innerHTML=C;return D},putDiv:function(F,B,C){var D=this._id+"-"+F;var E=document.getElementById(D);if(!E){var A=this._containerDiv.firstChild;E=document.createElement("div");E.setAttribute("id",D);A.appendChild(E)}E.setAttribute("class","timeplot-div "+B);E.setAttribute("className","timeplot-div "+B);this.placeDiv(E,C);return E},placeDiv:function(B,A){if(A){for(style in A){if(style=="left"){A[style]+=this._paddingX;A[style]+="px"}else{if(style=="right"){A[style]+=this._paddingX;A[style]+="px"}else{if(style=="top"){A[style]+=this._paddingY;A[style]+="px"}else{if(style=="bottom"){A[style]+=this._paddingY;A[style]+="px"}else{if(style=="width"){if(A[style]<0){A[style]=0}A[style]+="px"}else{if(style=="height"){if(A[style]<0){A[style]=0}A[style]+="px"}}}}}}B.style[style]=A[style]}}},locate:function(A){return{x:A.offsetLeft-this._paddingX,y:A.offsetTop-this._paddingY}},update:function(){if(this._active){for(var B=0;B<this._plots.length;B++){var C=this._plots[B];var D=C.getDataSource();if(D){var A=D.getRange();if(A){C._valueGeometry.setRange(A);C._timeGeometry.setRange(A)}}C.hideValues()}this.paint()}},repaint:function(){if(this._active){this._prepareCanvas();for(var A=0;A<this._plots.length;A++){var B=this._plots[A];if(B._timeGeometry){B._timeGeometry.reset()}if(B._valueGeometry){B._valueGeometry.reset()}}this.paint()}},paint:function(){if(this._active&&this._painter==null){var A=this;this._painter=window.setTimeout(function(){A._clearCanvas();var E=function(G,F){try{if(F.setTimeplot){F.setTimeplot(A)}G.apply(F,[])}catch(H){SimileAjax.Debug.exception(H)}};var C=A._painters.background;for(var B=0;B<C.length;B++){E(C[B].action,C[B].context)}var D=A._painters.foreground;for(var B=0;B<D.length;B++){E(D[B].action,D[B].context)}A._painter=null},20)}},_clearCanvas:function(){var B=this.getCanvas();var A=B.getContext("2d");A.clearRect(0,0,B.width,B.height)},_clearLabels:function(){var A=this._containerDiv.firstChild;if(A){this._containerDiv.removeChild(A)}A=document.createElement("div");this._containerDiv.appendChild(A)},_prepareCanvas:function(){var C=this.getCanvas();var B=SimileAjax.jQuery(this._containerDiv);this._paddingX=(parseInt(B.css("paddingLeft"))+parseInt(B.css("paddingRight")))/2;this._paddingY=(parseInt(B.css("paddingTop"))+parseInt(B.css("paddingBottom")))/2;C.width=this.getWidth()-(this._paddingX*2);C.height=this.getHeight()-(this._paddingY*2);var A=C.getContext("2d");this._setUpright(A,C);A.globalCompositeOperation="source-over"},_setUpright:function(A,B){if(!SimileAjax.Platform.browser.isIE){this._upright=false}if(!this._upright){this._upright=true;A.translate(0,B.height);A.scale(1,-1)}},_isBrowserSupported:function(B){var A=SimileAjax.Platform.browser;if((B.getContext&&window.getComputedStyle)||(A.isIE&&A.majorVersion>=6)){return true}else{return false}},_initialize:function(){SimileAjax.WindowManager.initialize();var G=this._containerDiv;var I=G.ownerDocument;G.className="timeplot-container "+G.className;while(G.firstChild){G.removeChild(G.firstChild)}var B=I.createElement("canvas");if(this._isBrowserSupported(B)){this._clearLabels();this._canvas=B;B.className="timeplot-canvas";G.appendChild(B);if(!B.getContext&&G_vmlCanvasManager){B=G_vmlCanvasManager.initElement(this._canvas);this._canvas=B}this._prepareCanvas();var C=SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix+"images/copyright.png");C.className="timeplot-copyright";C.title="Timeplot (c) SIMILE - http://simile.mit.edu/timeplot/";SimileAjax.DOM.registerEvent(C,"click",function(){window.location="http://simile.mit.edu/timeplot/"});G.appendChild(C);var E=this;var H={onAddMany:function(){E.update()},onClear:function(){E.update()}};this._plots=[];if(this._plotInfos){for(var D=0;D<this._plotInfos.length;D++){var F=new Timeplot.Plot(this,this._plotInfos[D]);var A=F.getDataSource();if(A){A.addListener(H)}this.addPainter("background",{context:F.getTimeGeometry(),action:F.getTimeGeometry().paint});this.addPainter("background",{context:F.getValueGeometry(),action:F.getValueGeometry().paint});this.addPainter("foreground",{context:F,action:F.paint});this._plots.push(F);F.initialize()}}var J=SimileAjax.Graphics.createMessageBubble(I);J.containerDiv.className="timeplot-message-container";G.appendChild(J.containerDiv);J.contentDiv.className="timeplot-message";J.contentDiv.innerHTML="<img src='"+Timeplot.urlPrefix+"images/progress-running.gif' /> Loading...";this.showLoadingMessage=function(){J.containerDiv.style.display="block"};this.hideLoadingMessage=function(){J.containerDiv.style.display="none"};this._active=true}else{this._message=SimileAjax.Graphics.createMessageBubble(I);this._message.containerDiv.className="timeplot-message-container";this._message.containerDiv.style.top="15%";this._message.containerDiv.style.left="20%";this._message.containerDiv.style.right="20%";this._message.containerDiv.style.minWidth="20em";this._message.contentDiv.className="timeplot-message";this._message.contentDiv.innerHTML="We're terribly sorry, but your browser is not currently supported by <a href='http://simile.mit.edu/timeplot/'>Timeplot</a>.<br><br> We are working on supporting it in the near future but, for now, see the <a href='http://simile.mit.edu/wiki/Timeplot_Limitations'>list of currently supported browsers</a>.";this._message.containerDiv.style.display="block";G.appendChild(this._message.containerDiv)}}};Timeplot.Plot=function(A,B){this._timeplot=A;this._canvas=A.getCanvas();this._plotInfo=B;this._id=B.id;this._timeGeometry=B.timeGeometry;this._valueGeometry=B.valueGeometry;this._theme=new Timeline.getDefaultTheme();this._dataSource=B.dataSource;this._eventSource=B.eventSource;this._bubble=null};Timeplot.Plot.prototype={initialize:function(){if(this._dataSource&&this._dataSource.getValue){this._timeFlag=this._timeplot.putDiv("timeflag","timeplot-timeflag");this._valueFlag=this._timeplot.putDiv(this._id+"valueflag","timeplot-valueflag");this._valueFlagLineLeft=this._timeplot.putDiv(this._id+"valueflagLineLeft","timeplot-valueflag-line");this._valueFlagLineRight=this._timeplot.putDiv(this._id+"valueflagLineRight","timeplot-valueflag-line");if(!this._valueFlagLineLeft.firstChild){this._valueFlagLineLeft.appendChild(SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix+"images/line_left.png"));this._valueFlagLineRight.appendChild(SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix+"images/line_right.png"))}this._valueFlagPole=this._timeplot.putDiv(this._id+"valuepole","timeplot-valueflag-pole");var D=this._plotInfo.valuesOpacity;SimileAjax.Graphics.setOpacity(this._timeFlag,D);SimileAjax.Graphics.setOpacity(this._valueFlag,D);SimileAjax.Graphics.setOpacity(this._valueFlagLineLeft,D);SimileAjax.Graphics.setOpacity(this._valueFlagLineRight,D);SimileAjax.Graphics.setOpacity(this._valueFlagPole,D);var F=this;var G=function(I,H,J){if(F._plotInfo.showValues){F._valueFlag.style.display="block";A(I,H,J)}};var B=24*60*60*1000;var E=30*B;var A=function(J,V,O){if(typeof SimileAjax!="undefined"&&F._plotInfo.showValues){var Q=F._canvas;var T=Math.round(SimileAjax.DOM.getEventRelativeCoordinates(V,F._canvas).x);if(T>Q.width){T=Q.width}if(isNaN(T)||T<0){T=0}var W=F._timeGeometry.fromScreen(T);if(W==0){F._valueFlag.style.display="none";return }var U=F._dataSource.getValue(W);if(F._plotInfo.roundValues){U=Math.round(U)}F._valueFlag.innerHTML=new String(U);var P=new Date(W);var I=F._timeGeometry.getPeriod();if(I<B){F._timeFlag.innerHTML=P.toLocaleTimeString()}else{if(I>E){F._timeFlag.innerHTML=P.toLocaleDateString()}else{F._timeFlag.innerHTML=P.formatDate("MM/dd/yy hh:mmt")}}var N=F._timeFlag.clientWidth;var H=F._timeFlag.clientHeight;var K=Math.round(N/2);var S=F._valueFlag.clientWidth;var M=F._valueFlag.clientHeight;var R=F._valueGeometry.toScreen(U);if(T+K>Q.width){var L=Q.width-K}else{if(T-K<0){var L=K}else{var L=T}}if(F._timeGeometry._timeValuePosition=="top"){F._timeplot.placeDiv(F._valueFlagPole,{left:T,top:H-5,height:Q.height-R-H+6,display:"block"});F._timeplot.placeDiv(F._timeFlag,{left:L-K,top:-6,display:"block"})}else{F._timeplot.placeDiv(F._valueFlagPole,{left:T,bottom:H-5,height:R-H+6,display:"block"});F._timeplot.placeDiv(F._timeFlag,{left:L-K,bottom:-6,display:"block"})}if(T+S+14>Q.width&&R+M+4>Q.height){F._valueFlagLineLeft.style.display="none";F._timeplot.placeDiv(F._valueFlagLineRight,{left:T-14,bottom:R-14,display:"block"});F._timeplot.placeDiv(F._valueFlag,{left:T-S-13,bottom:R-M-13,display:"block"})}else{if(T+S+14>Q.width&&R+M+4<Q.height){F._valueFlagLineRight.style.display="none";F._timeplot.placeDiv(F._valueFlagLineLeft,{left:T-14,bottom:R,display:"block"});F._timeplot.placeDiv(F._valueFlag,{left:T-S-13,bottom:R+13,display:"block"})}else{if(T+S+14<Q.width&&R+M+4>Q.height){F._valueFlagLineRight.style.display="none";F._timeplot.placeDiv(F._valueFlagLineLeft,{left:T,bottom:R-13,display:"block"});F._timeplot.placeDiv(F._valueFlag,{left:T+13,bottom:R-13,display:"block"})}else{F._valueFlagLineLeft.style.display="none";F._timeplot.placeDiv(F._valueFlagLineRight,{left:T,bottom:R,display:"block"});F._timeplot.placeDiv(F._valueFlag,{left:T+13,bottom:R+13,display:"block"})}}}}};var C=this._timeplot.getElement();SimileAjax.DOM.registerEvent(C,"mouseover",G);SimileAjax.DOM.registerEvent(C,"mousemove",A)}},dispose:function(){if(this._dataSource){this._dataSource.removeListener(this._paintingListener);this._paintingListener=null;this._dataSource.dispose();this._dataSource=null}},hideValues:function(){if(this._valueFlag){this._valueFlag.style.display="none"}if(this._timeFlag){this._timeFlag.style.display="none"}if(this._valueFlagLineLeft){this._valueFlagLineLeft.style.display="none"}if(this._valueFlagLineRight){this._valueFlagLineRight.style.display="none"}if(this._valueFlagPole){this._valueFlagPole.style.display="none"}},getDataSource:function(){return(this._dataSource)?this._dataSource:this._eventSource},getTimeGeometry:function(){return this._timeGeometry},getValueGeometry:function(){return this._valueGeometry},paint:function(){var M=this._canvas.getContext("2d");M.lineWidth=this._plotInfo.lineWidth;M.lineJoin="miter";if(this._dataSource){if(this._plotInfo.fillColor){if(this._plotInfo.fillGradient){var A=M.createLinearGradient(0,this._canvas.height,0,0);A.addColorStop(0,this._plotInfo.fillColor.toString());A.addColorStop(0.5,this._plotInfo.fillColor.toString());A.addColorStop(1,"rgba(255,255,255,0)");M.fillStyle=A}else{M.fillStyle=this._plotInfo.fillColor.toString()}M.beginPath();M.moveTo(0,0);this._plot(function(T,U){M.lineTo(T,U)});if(this._plotInfo.fillFrom==Number.NEGATIVE_INFINITY){M.lineTo(this._canvas.width,0)}else{if(this._plotInfo.fillFrom==Number.POSITIVE_INFINITY){M.lineTo(this._canvas.width,this._canvas.height);M.lineTo(0,this._canvas.height)}else{M.lineTo(this._canvas.width,this._valueGeometry.toScreen(this._plotInfo.fillFrom));M.lineTo(0,this._valueGeometry.toScreen(this._plotInfo.fillFrom))}}M.fill()}if(this._plotInfo.lineColor){M.strokeStyle=this._plotInfo.lineColor.toString();M.beginPath();var F=true;this._plot(function(T,U){if(F){F=false;M.moveTo(T,U)}M.lineTo(T,U)});M.stroke()}if(this._plotInfo.dotColor){M.fillStyle=this._plotInfo.dotColor.toString();var K=this._plotInfo.dotRadius;this._plot(function(T,U){M.beginPath();M.arc(T,U,K,0,2*Math.PI,true);M.fill()})}}if(this._eventSource){var A=M.createLinearGradient(0,0,0,this._canvas.height);A.addColorStop(1,"rgba(255,255,255,0)");M.strokeStyle=A;M.fillStyle=A;M.lineWidth=this._plotInfo.eventLineWidth;M.lineJoin="miter";var Q=this._eventSource.getAllEventIterator();while(Q.hasNext()){var P=Q.next();var N=P.getColor();N=(N)?new Timeplot.Color(N):this._plotInfo.lineColor;var B=P.getStart().getTime();var R=P.getEnd().getTime();if(B==R){var S=N.toString();A.addColorStop(0,S);var E=this._timeGeometry.toScreen(B);E=Math.floor(E)+0.5;var C=E;M.beginPath();M.moveTo(E,0);M.lineTo(E,this._canvas.height);M.stroke();var G=E-4;var I=7}else{var S=N.toString(0.5);A.addColorStop(0,S);var E=this._timeGeometry.toScreen(B);E=Math.floor(E)+0.5;var C=this._timeGeometry.toScreen(R);C=Math.floor(C)+0.5;M.fillRect(E,0,C-E,this._canvas.height);var G=E;var I=C-E-1}var J=this._timeplot.putDiv(P.getID(),"timeplot-event-box",{left:Math.round(G),width:Math.round(I),top:0,height:this._canvas.height-1});var O=this;var H=function(T){return function(W,U,Z){var Y=O._timeplot.getDocument();O._closeBubble();var X=SimileAjax.DOM.getEventPageCoordinates(U);var V=SimileAjax.DOM.getPageCoordinates(W);O._bubble=SimileAjax.Graphics.createBubbleForPoint(X.x,V.top+O._canvas.height,O._plotInfo.bubbleWidth,O._plotInfo.bubbleHeight,"bottom");T.fillInfoBubble(O._bubble.content,O._theme,O._timeGeometry.getLabeler())}};var D=function(U,T,V){U.oldClass=U.className;U.className=U.className+" timeplot-event-box-highlight"};var L=function(U,T,V){U.className=U.oldClass;U.oldClass=null};if(!J.instrumented){SimileAjax.DOM.registerEvent(J,"click",H(P));SimileAjax.DOM.registerEvent(J,"mouseover",D);SimileAjax.DOM.registerEvent(J,"mouseout",L);J.instrumented=true}}}},_plot:function(F){var E=this._dataSource.getData();if(E){var G=E.times;var B=E.values;var C=G.length;for(var D=0;D<C;D++){var A=this._timeGeometry.toScreen(G[D]);var H=this._valueGeometry.toScreen(B[D]);F(A,H)}}},_closeBubble:function(){if(this._bubble!=null){this._bubble.close();this._bubble=null}}};Timeplot.DefaultEventSource=function(A){Timeline.DefaultEventSource.apply(this,arguments)};Object.extend(Timeplot.DefaultEventSource.prototype,Timeline.DefaultEventSource.prototype);Timeplot.DefaultEventSource.prototype.loadText=function(M,I,A,C,K){if(M==null){return }this._events.maxValues=new Array();var B=this._getBaseURL(A);if(!K){K="iso8601"}var H=this._events.getUnit().getParser(K);var G=this._parseText(M,I);var J=false;if(C){G=C(G)}if(G){for(var F=0;F<G.length;F++){var N=G[F];if(N.length>1){var E=SimileAjax.jQuery.trim(N[0]);var D=H(E);if(D){var L=new Timeplot.DefaultEventSource.NumericEvent(D,N.slice(1));this._events.add(L);J=true}}}}if(J){this._fire("onAddMany",[])}};Timeplot.DefaultEventSource.prototype._parseText=function(H,C){H=H.replace(/\r\n?/g,"\n");var F=0;var E=H.length;var I=[];while(F<E){var J=[];if(H.charAt(F)!="#"){while(F<E){if(H.charAt(F)=='"'){var A=H.indexOf('"',F+1);while(A<E&&A>-1){if(H.charAt(A+1)!='"'){break}A=H.indexOf('"',A+2)}if(A<0){}else{if(H.charAt(A+1)==C){var B=H.substr(F+1,A-F-1);B=B.replace(/""/g,'"');J[J.length]=B;F=A+2;continue}else{if(H.charAt(A+1)=="\n"||E==A+1){var B=H.substr(F+1,A-F-1);B=B.replace(/""/g,'"');J[J.length]=B;F=A+2;break}else{}}}}var G=H.indexOf(C,F);var D=H.indexOf("\n",F);if(D<0){D=E}if(G>-1&&G<D){J[J.length]=H.substr(F,G-F);F=G+1}else{J[J.length]=H.substr(F,D-F);F=D+1;break}}}else{var D=H.indexOf("\n",F);F=(D>-1)?D+1:cur}if(J.length>0){I[I.length]=J}}if(I.length<0){return }return I};Timeplot.DefaultEventSource.prototype.getRange=function(){var A=this.getEarliestDate();var B=this.getLatestDate();return{earliestDate:(A)?A:null,latestDate:(B)?B:null,min:0,max:0}};Timeplot.DefaultEventSource.NumericEvent=function(B,A){this._id="e"+Math.round(Math.random()*1000000);this._time=B;this._values=A};Timeplot.DefaultEventSource.NumericEvent.prototype={getID:function(){return this._id},getTime:function(){return this._time},getValues:function(){return this._values},getStart:function(){return this._time},getEnd:function(){return this._time}};Timeplot.DataSource=function(B){this._eventSource=B;var A=this;this._processingListener={onAddMany:function(){A._process()},onClear:function(){A._clear()}};this.addListener(this._processingListener);this._listeners=[];this._data=null;this._range=null};Timeplot.DataSource.prototype={_clear:function(){this._data=null;this._range=null},_process:function(){this._data={times:new Array(),values:new Array()};this._range={earliestDate:null,latestDate:null,min:0,max:0}},getRange:function(){return this._range},getData:function(){return this._data},getValue:function(C){if(this._data){for(var B=0;B<this._data.times.length;B++){var A=this._data.times[B];if(A>=C){return this._data.values[B]}}}return 0},addListener:function(A){this._eventSource.addListener(A)},removeListener:function(A){this._eventSource.removeListener(A)},replaceListener:function(A,B){this.removeListener(A);this.addListener(B)}};Timeplot.ColumnSource=function(B,A){Timeplot.DataSource.apply(this,arguments);this._column=A-1};Object.extend(Timeplot.ColumnSource.prototype,Timeplot.DataSource.prototype);Timeplot.ColumnSource.prototype.dispose=function(){this.removeListener(this._processingListener);this._clear()};Timeplot.ColumnSource.prototype._process=function(){var G=this._eventSource.getCount();var A=new Array(G);var J=new Array(G);var D=Number.MAX_VALUE;var H=Number.MIN_VALUE;var E=0;var F=this._eventSource.getAllEventIterator();while(F.hasNext()){var B=F.next();var C=B.getTime();A[E]=C;var I=this._getValue(B);if(!isNaN(I)){if(I<D){D=I}if(I>H){H=I}J[E]=I}E++}this._data={times:A,values:J};if(H==Number.MIN_VALUE){H=1}this._range={earliestDate:this._eventSource.getEarliestDate(),latestDate:this._eventSource.getLatestDate(),min:D,max:H}};Timeplot.ColumnSource.prototype._getValue=function(A){return parseFloat(A.getValues()[this._column])};Timeplot.ColumnDiffSource=function(C,B,A){Timeplot.ColumnSource.apply(this,arguments);this._column2=A-1};Object.extend(Timeplot.ColumnDiffSource.prototype,Timeplot.ColumnSource.prototype);Timeplot.ColumnDiffSource.prototype._getValue=function(C){var B=parseFloat(C.getValues()[this._column]);var A=parseFloat(C.getValues()[this._column2]);return B-A};Timeplot.DefaultValueGeometry=function(A){if(!A){A={}}this._id=("id" in A)?A.id:"g"+Math.round(Math.random()*1000000);this._axisColor=("axisColor" in A)?((typeof A.axisColor=="string")?new Timeplot.Color(A.axisColor):A.axisColor):new Timeplot.Color("#606060"),this._gridColor=("gridColor" in A)?((typeof A.gridColor=="string")?new Timeplot.Color(A.gridColor):A.gridColor):null,this._gridLineWidth=("gridLineWidth" in A)?A.gridLineWidth:0.5;this._axisLabelsPlacement=("axisLabelsPlacement" in A)?A.axisLabelsPlacement:"right";this._gridSpacing=("gridSpacing" in A)?A.gridStep:50;this._gridType=("gridType" in A)?A.gridType:"short";this._gridShortSize=("gridShortSize" in A)?A.gridShortSize:10;this._minValue=("min" in A)?A.min:null;this._maxValue=("max" in A)?A.max:null;this._linMap={direct:function(B){return B},inverse:function(B){return B}};this._map=this._linMap;this._labels=[];this._grid=[]};Timeplot.DefaultValueGeometry.prototype={setTimeplot:function(A){this._timeplot=A;this._canvas=A.getCanvas();this.reset()},setRange:function(C){var B=(C.max-C.min)*0.1;var A=(C.min>0&&C.min-B<0)?0:C.min-B;var D=C.max+B;if((this._minValue==null)||((this._minValue!=null)&&(A<this._minValue))){this._minValue=A}if((this._maxValue==null)||((this._maxValue!=null)&&(D>this._maxValue))){this._maxValue=D}this._updateMappedValues();if(!(this._minValue==0&&this._maxValue==0)){this._grid=this._calculateGrid()}},reset:function(){this._clearLabels();this._updateMappedValues();this._grid=this._calculateGrid()},toScreen:function(B){if(this._canvas&&this._maxValue){var A=B-this._minValue;return this._canvas.height*(this._map.direct(A))/this._mappedRange}else{return -50}},fromScreen:function(A){if(this._canvas){return this._map.inverse(this._mappedRange*A/this._canvas.height)+this._minValue}else{return 0}},paint:function(){if(this._timeplot){var B=this._canvas.getContext("2d");B.lineJoin="miter";if(this._gridColor){var E=B.createLinearGradient(0,0,0,this._canvas.height);E.addColorStop(0,this._gridColor.toHexString());E.addColorStop(0.3,this._gridColor.toHexString());E.addColorStop(1,"rgba(255,255,255,0.5)");B.lineWidth=this._gridLineWidth;B.strokeStyle=E;for(var D=0;D<this._grid.length;D++){var C=this._grid[D];var G=Math.floor(C.y)+0.5;if(typeof C.label!="undefined"){if(this._axisLabelsPlacement=="left"){var F=this._timeplot.putText(this._id+"-"+D,C.label,"timeplot-grid-label",{left:4,bottom:G+2,color:this._gridColor.toHexString(),visibility:"hidden"})}else{if(this._axisLabelsPlacement=="right"){var F=this._timeplot.putText(this._id+"-"+D,C.label,"timeplot-grid-label",{right:4,bottom:G+2,color:this._gridColor.toHexString(),visibility:"hidden"})}}if(G+F.clientHeight<this._canvas.height+10){F.style.visibility="visible"}}B.beginPath();if(this._gridType=="long"||C.label==0){B.moveTo(0,G);B.lineTo(this._canvas.width,G)}else{if(this._gridType=="short"){if(this._axisLabelsPlacement=="left"){B.moveTo(0,G);B.lineTo(this._gridShortSize,G)}else{if(this._axisLabelsPlacement=="right"){B.moveTo(this._canvas.width,G);B.lineTo(this._canvas.width-this._gridShortSize,G)}}}}B.stroke()}}var A=B.createLinearGradient(0,0,0,this._canvas.height);A.addColorStop(0,this._axisColor.toString());A.addColorStop(0.5,this._axisColor.toString());A.addColorStop(1,"rgba(255,255,255,0.5)");B.lineWidth=1;B.strokeStyle=A;B.beginPath();B.moveTo(0,this._canvas.height);B.lineTo(0,0);B.stroke();B.beginPath();B.moveTo(this._canvas.width,0);B.lineTo(this._canvas.width,this._canvas.height);B.stroke()}},_clearLabels:function(){for(var B=0;B<this._labels.length;B++){var A=this._labels[B];var C=A.parentNode;if(C){C.removeChild(A)}}},_round:function(A,D){if(D>0){var C=Math.pow(10,D);var B=Math.round(A*C)/C;if(Math.abs(B)>0){return B}}return A},_calculateGrid:function(){var C=[];if(!this._canvas||this._valueRange==0){return C}var D=0;if(this._valueRange>1){while(Math.pow(10,D)<this._valueRange){D++}D--}else{while(Math.pow(10,D)>this._valueRange){D--}}var E=Math.pow(10,D);var F=E;while(true){var A=this.toScreen(this._minValue+F);while(A<this._gridSpacing){F+=E;A=this.toScreen(this._minValue+F)}if(A>2*this._gridSpacing){E/=10;F=E}else{break}}var B=0;var G=this.toScreen(B);if(this._minValue>=0){while(G<this._canvas.height){if(G>0){C.push({y:G,label:B})}B+=F;B=this._round(B,3);G=this.toScreen(B)}}else{if(this._maxValue<=0){while(G>0){if(G<this._canvas.height){C.push({y:G,label:B})}B-=F;G=this.toScreen(B)}}else{while(G<this._canvas.height){if(G>0){C.push({y:G,label:B})}B+=F;G=this.toScreen(B)}B=-F;G=this.toScreen(B);while(G>0){if(G<this._canvas.height){C.push({y:G,label:B})}B-=F;G=this.toScreen(B)}}}return C},_updateMappedValues:function(){this._valueRange=Math.abs(this._maxValue-this._minValue);this._mappedRange=this._map.direct(this._valueRange)}};Timeplot.LogarithmicValueGeometry=function(A){Timeplot.DefaultValueGeometry.apply(this,arguments);this._logMap={direct:function(B){return Math.log(B+1)/Math.log(10)},inverse:function(B){return Math.exp(Math.log(10)*B)-1}};this._mode="log";this._map=this._logMap;this._calculateGrid=this._logarithmicCalculateGrid};Timeplot.LogarithmicValueGeometry.prototype._linearCalculateGrid=Timeplot.DefaultValueGeometry.prototype._calculateGrid;Object.extend(Timeplot.LogarithmicValueGeometry.prototype,Timeplot.DefaultValueGeometry.prototype);Timeplot.LogarithmicValueGeometry.prototype._logarithmicCalculateGrid=function(){var B=[];if(!this._canvas||this._valueRange==0){return B}var A=1;var C=this.toScreen(A);while(C<this._canvas.height||isNaN(C)){if(C>0){B.push({y:C,label:A})}A*=10;C=this.toScreen(A)}return B};Timeplot.LogarithmicValueGeometry.prototype.actLinear=function(){this._mode="lin";this._map=this._linMap;this._calculateGrid=this._linearCalculateGrid;this.reset()};Timeplot.LogarithmicValueGeometry.prototype.actLogarithmic=function(){this._mode="log";this._map=this._logMap;this._calculateGrid=this._logarithmicCalculateGrid;this.reset()};Timeplot.LogarithmicValueGeometry.prototype.toggle=function(){if(this._mode=="log"){this.actLinear()}else{this.actLogarithmic()}};Timeplot.DefaultTimeGeometry=function(B){if(!B){B={}}this._id=("id" in B)?B.id:"g"+Math.round(Math.random()*1000000);this._locale=("locale" in B)?B.locale:"en";this._timeZone=("timeZone" in B)?B.timeZone:SimileAjax.DateTime.getTimezone();this._labeller=("labeller" in B)?B.labeller:null;this._axisColor=("axisColor" in B)?((B.axisColor=="string")?new Timeplot.Color(B.axisColor):B.axisColor):new Timeplot.Color("#606060"),this._gridColor=("gridColor" in B)?((B.gridColor=="string")?new Timeplot.Color(B.gridColor):B.gridColor):null,this._gridLineWidth=("gridLineWidth" in B)?B.gridLineWidth:0.5;this._axisLabelsPlacement=("axisLabelsPlacement" in B)?B.axisLabelsPlacement:"bottom";this._gridStep=("gridStep" in B)?B.gridStep:100;this._gridStepRange=("gridStepRange" in B)?B.gridStepRange:20;this._min=("min" in B)?B.min:null;this._max=("max" in B)?B.max:null;this._timeValuePosition=("timeValuePosition" in B)?B.timeValuePosition:"bottom";this._unit=("unit" in B)?B.unit:Timeline.NativeDateUnit;this._linMap={direct:function(C){return C},inverse:function(C){return C}};this._map=this._linMap;this._labeler=this._unit.createLabeller(this._locale,this._timeZone);var A=this._unit.getParser("iso8601");if(this._min&&!this._min.getTime){this._min=A(this._min)}if(this._max&&!this._max.getTime){this._max=A(this._max)}this._grid=[]};Timeplot.DefaultTimeGeometry.prototype={setTimeplot:function(A){this._timeplot=A;this._canvas=A.getCanvas();this.reset()},setRange:function(A){if(this._min){this._earliestDate=this._min}else{if(A.earliestDate&&((this._earliestDate==null)||((this._earliestDate!=null)&&(A.earliestDate.getTime()<this._earliestDate.getTime())))){this._earliestDate=A.earliestDate}}if(this._max){this._latestDate=this._max}else{if(A.latestDate&&((this._latestDate==null)||((this._latestDate!=null)&&(A.latestDate.getTime()>this._latestDate.getTime())))){this._latestDate=A.latestDate}}if(!this._earliestDate&&!this._latestDate){this._grid=[]}else{this.reset()}},reset:function(){this._updateMappedValues();if(this._canvas){this._grid=this._calculateGrid()}},toScreen:function(B){if(this._canvas&&this._latestDate){var A=B-this._earliestDate.getTime();return this._canvas.width*this._map.direct(A)/this._mappedPeriod}else{return -50}},fromScreen:function(A){if(this._canvas){return this._map.inverse(this._mappedPeriod*A/this._canvas.width)+this._earliestDate.getTime()}else{return 0}},getPeriod:function(){return this._period},getLabeler:function(){return this._labeler},getUnit:function(){return this._unit},paint:function(){if(this._canvas){var E=this._unit;var B=this._canvas.getContext("2d");var F=B.createLinearGradient(0,0,0,this._canvas.height);B.strokeStyle=F;B.lineWidth=this._gridLineWidth;B.lineJoin="miter";if(this._gridColor){F.addColorStop(0,this._gridColor.toString());F.addColorStop(1,"rgba(255,255,255,0.9)");for(var D=0;D<this._grid.length;D++){var C=this._grid[D];var A=Math.floor(C.x)+0.5;if(this._axisLabelsPlacement=="top"){var G=this._timeplot.putText(this._id+"-"+D,C.label,"timeplot-grid-label",{left:A+4,top:2,visibility:"hidden"})}else{if(this._axisLabelsPlacement=="bottom"){var G=this._timeplot.putText(this._id+"-"+D,C.label,"timeplot-grid-label",{left:A+4,bottom:2,visibility:"hidden"})}}if(A+G.clientWidth<this._canvas.width+10){G.style.visibility="visible"}B.beginPath();B.moveTo(A,0);B.lineTo(A,this._canvas.height);B.stroke()}}F.addColorStop(0,this._axisColor.toString());F.addColorStop(1,"rgba(255,255,255,0.5)");B.lineWidth=1;F.addColorStop(0,this._axisColor.toString());B.beginPath();B.moveTo(0,0);B.lineTo(this._canvas.width,0);B.stroke()}},_calculateGrid:function(){var A=[];var D=SimileAjax.DateTime;var H=this._unit;var B=this._period;if(B==0){return A}if(B>D.gregorianUnitLengths[D.MILLENNIUM]){G=D.MILLENNIUM}else{for(var G=D.MILLENNIUM;G>0;G--){if(D.gregorianUnitLengths[G-1]<=B&&B<D.gregorianUnitLengths[G]){G--;break}}}var I=H.cloneValue(this._earliestDate);do{D.roundDownToInterval(I,G,this._timeZone,1,0);var F=this.toScreen(H.toNumber(I));switch(G){case D.SECOND:var E=I.toLocaleTimeString();break;case D.MINUTE:var C=I.getMinutes();var E=I.getHours()+":"+((C<10)?"0":"")+C;break;case D.HOUR:var E=I.getHours()+":00";break;case D.DAY:case D.WEEK:case D.MONTH:var E=I.formatDate("MM/dd/yy");break;case D.YEAR:case D.DECADE:case D.CENTURY:case D.MILLENNIUM:var E=I.getUTCFullYear();break}if(F>0){A.push({x:F,label:E})}D.incrementByInterval(I,G,this._timeZone)}while(I.getTime()<this._latestDate.getTime());return A},_updateMappedValues:function(){if(this._latestDate&&this._earliestDate){this._period=this._latestDate.getTime()-this._earliestDate.getTime();this._mappedPeriod=this._map.direct(this._period)}else{this._period=0;this._mappedPeriod=0}}};Timeplot.MagnifyingTimeGeometry=function(B){Timeplot.DefaultTimeGeometry.apply(this,arguments);var A=this;this._MagnifyingMap={direct:function(D){if(D<A._leftTimeMargin){var C=D*A._leftRate}else{if(A._leftTimeMargin<D&&D<A._rightTimeMargin){var C=D*A._expandedRate+A._expandedTimeTranslation}else{var C=D*A._rightRate+A._rightTimeTranslation}}return C},inverse:function(C){if(C<A._leftScreenMargin){var D=C/A._leftRate}else{if(A._leftScreenMargin<C&&C<A._rightScreenMargin){var D=C/A._expandedRate+A._expandedScreenTranslation}else{var D=C/A._rightRate+A._rightScreenTranslation}}return D}};this._mode="lin";this._map=this._linMap};Object.extend(Timeplot.MagnifyingTimeGeometry.prototype,Timeplot.DefaultTimeGeometry.prototype);Timeplot.MagnifyingTimeGeometry.prototype.initialize=function(F){Timeplot.DefaultTimeGeometry.prototype.initialize.apply(this,arguments);if(!this._lens){this._lens=this._timeplot.putDiv("lens","timeplot-lens")}var G=1000*60*60*24*30;var H=this;var B=function(K){var M=K.clientWidth;var L=H._timeplot.locate(K);H.setMagnifyingParams(L.x+M/2,M,G);H.actMagnifying();H._timeplot.paint()};var J=function(L,K,M){H._canvas.startCoords=SimileAjax.DOM.getEventRelativeCoordinates(K,L);H._canvas.pressed=true};var I=function(L,K,N){H._canvas.pressed=false;var M=SimileAjax.DOM.getEventRelativeCoordinates(K,L);if(Timeplot.Math.isClose(M,H._canvas.startCoords,5)){H._lens.style.display="none";H.actLinear();H._timeplot.paint()}else{H._lens.style.cursor="move";B(H._lens)}};var D=function(L,K,N){if(H._canvas.pressed){var M=SimileAjax.DOM.getEventRelativeCoordinates(K,L);if(M.x<0){M.x=0}if(M.x>H._canvas.width){M.x=H._canvas.width}H._timeplot.placeDiv(H._lens,{left:H._canvas.startCoords.x,width:M.x-H._canvas.startCoords.x,bottom:0,height:H._canvas.height,display:"block"})}};var A=function(L,K,M){H._lens.startCoords=SimileAjax.DOM.getEventRelativeCoordinates(K,L);H._lens.pressed=true};var C=function(L,K,M){H._lens.pressed=false};var E=function(M,K,P){if(H._lens.pressed){var N=SimileAjax.DOM.getEventRelativeCoordinates(K,M);var L=H._lens;var O=L.offsetLeft+N.x-L.startCoords.x;if(O<H._timeplot._paddingX){O=H._timeplot._paddingX}if(O+L.clientWidth>H._canvas.width-H._timeplot._paddingX){O=H._canvas.width-L.clientWidth+H._timeplot._paddingX}L.style.left=O;B(L)}};if(!this._canvas.instrumented){SimileAjax.DOM.registerEvent(this._canvas,"mousedown",J);SimileAjax.DOM.registerEvent(this._canvas,"mousemove",D);SimileAjax.DOM.registerEvent(this._canvas,"mouseup",I);SimileAjax.DOM.registerEvent(this._canvas,"mouseup",C);this._canvas.instrumented=true}if(!this._lens.instrumented){SimileAjax.DOM.registerEvent(this._lens,"mousedown",A);SimileAjax.DOM.registerEvent(this._lens,"mousemove",E);SimileAjax.DOM.registerEvent(this._lens,"mouseup",C);SimileAjax.DOM.registerEvent(this._lens,"mouseup",I);this._lens.instrumented=true}};Timeplot.MagnifyingTimeGeometry.prototype.setMagnifyingParams=function(F,C,A){C=C/2;A=A/2;var B=this._canvas.width;var E=this._period;if(F<0){F=0}if(F>B){F=B}if(F-C<0){C=F}if(F+C>B){C=B-F}var D=this.fromScreen(F)-this._earliestDate.getTime();if(D-A<0){A=D}if(D+A>E){A=E-D}this._centerX=F;this._centerTime=D;this._aperture=C;this._aperturePeriod=A;this._leftScreenMargin=this._centerX-this._aperture;this._rightScreenMargin=this._centerX+this._aperture;this._leftTimeMargin=this._centerTime-this._aperturePeriod;this._rightTimeMargin=this._centerTime+this._aperturePeriod;this._leftRate=(F-C)/(D-A);this._expandedRate=C/A;this._rightRate=(B-F-C)/(E-D-A);this._expandedTimeTranslation=this._centerX-this._centerTime*this._expandedRate;this._expandedScreenTranslation=this._centerTime-this._centerX/this._expandedRate;this._rightTimeTranslation=(F+C)-(D+A)*this._rightRate;this._rightScreenTranslation=(D+A)-(F+C)/this._rightRate;this._updateMappedValues()};Timeplot.MagnifyingTimeGeometry.prototype.actLinear=function(){this._mode="lin";this._map=this._linMap;this.reset()};Timeplot.MagnifyingTimeGeometry.prototype.actMagnifying=function(){this._mode="Magnifying";this._map=this._MagnifyingMap;this.reset()};Timeplot.MagnifyingTimeGeometry.prototype.toggle=function(){if(this._mode=="Magnifying"){this.actLinear()}else{this.actMagnifying()}};Timeplot.Color=function(A){this._fromHex(A)};Timeplot.Color.prototype={set:function(D,C,A,B){this.r=D;this.g=C;this.b=A;this.a=(B)?B:1;return this.check()},transparency:function(A){this.a=A;return this.check()},lighten:function(B){var A=new Timeplot.Color();return A.set(this.r+=parseInt(B,10),this.g+=parseInt(B,10),this.b+=parseInt(B,10))},darken:function(B){var A=new Timeplot.Color();return A.set(this.r-=parseInt(B,10),this.g-=parseInt(B,10),this.b-=parseInt(B,10))},check:function(){if(this.r>255){this.r=255}else{if(this.r<0){this.r=0}}if(this.g>255){this.g=255}else{if(this.g<0){this.g=0}}if(this.b>255){this.b=255}else{if(this.b<0){this.b=0}}if(this.a>1){this.a=1}else{if(this.a<0){this.a=0}}return this},toString:function(B){var A=(B)?B:((this.a)?this.a:1);return"rgba("+this.r+","+this.g+","+this.b+","+A+")"},toHexString:function(){return"#"+this._toHex(this.r)+this._toHex(this.g)+this._toHex(this.b)},_fromHex:function(A){if(/^#?([\da-f]{3}|[\da-f]{6})$/i.test(A)){A=A.replace(/^#/,"").replace(/^([\da-f])([\da-f])([\da-f])$/i,"$1$1$2$2$3$3");this.r=parseInt(A.substr(0,2),16);this.g=parseInt(A.substr(2,2),16);this.b=parseInt(A.substr(4,2),16)}else{if(/^rgb *\( *\d{0,3} *, *\d{0,3} *, *\d{0,3} *\)$/i.test(A)){A=A.match(/^rgb *\( *(\d{0,3}) *, *(\d{0,3}) *, *(\d{0,3}) *\)$/i);this.r=parseInt(A[1],10);this.g=parseInt(A[2],10);this.b=parseInt(A[3],10)}}this.a=1;return this.check()},_toHex:function(D){var C="0123456789ABCDEF";if(D<0){return"00"}if(D>255){return"FF"}var B=Math.floor(D/16);var A=D%16;return C.charAt(B)+C.charAt(A)}};Timeplot.Math={range:function(G){var D=G.length;var C=Number.MAX_VALUE;var A=Number.MIN_VALUE;for(var B=0;B<D;B++){var E=G[B];if(E<C){C=E}if(E>A){A=E}}return{min:C,max:A}},movingAverage:function(H,C){var E=H.length;var D=new Array(E);for(var I=0;I<E;I++){var G=0;for(var A=I-C;A<I+C;A++){if(A<0){var B=H[0]}else{if(A>=E){var B=D[I-1]}else{var B=H[A]}}G+=B}D[I]=G/(2*C)}return D},integral:function(E){var D=E.length;var C=new Array(D);var B=0;for(var A=0;A<D;A++){B+=E[A];C[A]=B}return C},normalize:function(D){var C=D.length;var B=0;for(var A=0;A<C;A++){B+=D[A]}for(var A=0;A<C;A++){D[A]/=B}return D},convolution:function(H,E){var M=H.length;var L=E.length;var I=new Array(M);for(var C=0;C<M;C++){var A=0;var D=(C+L<M)?C+L:M;for(var B=C;B<D;B++){var K=H[B-L];var J=E[B-C];A+=K*J}I[C]=A}return I},heavyside:function(B){var D=new Array(B);var C=1/B;for(var A=0;A<B;A++){D[A]=C}return D},gaussian:function(size,threshold){with(Math){var radius=size/2;var variance=radius*radius/log(threshold);var g=new Array(size);for(var t=0;t<size;t++){var l=t-radius;g[t]=exp(-variance*l*l)}}return this.normalize(g)},round:function(x,n){with(Math){if(abs(x)>1){var l=floor(log(x)/log(10));var d=round(exp((l-n+1)*log(10)));var y=round(round(x/d)*d);return y}else{log("FIXME(SM): still to implement for 0 < abs(x) < 1");return x}}},tanh:function(A){if(A>5){return 1}else{if(A<5){return -1}else{var B=Math.exp(2*A);return(B-1)/(B+1)}}},isClose:function(B,A,C){return(B&&A&&Math.abs(B.x-A.x)<C&&Math.abs(B.y-A.y)<C)}};Timeplot.Operator={sum:function(A,B){return Timeplot.Math.integral(A.values)},average:function(C,D){var B=("size" in D)?D.size:30;var A=Timeplot.Math.movingAverage(C.values,B);return A}};Timeplot.Processor=function(D,A,C){this._dataSource=D;this._operator=A;this._params=C;this._data={times:new Array(),values:new Array()};this._range={earliestDate:null,latestDate:null,min:0,max:0};var B=this;this._processingListener={onAddMany:function(){B._process()},onClear:function(){B._clear()}};this.addListener(this._processingListener)};Timeplot.Processor.prototype={_clear:function(){this.removeListener(this._processingListener);this._dataSource._clear()},_process:function(){var D=this._dataSource.getData();var A=this._dataSource.getRange();var B=this._operator(D,this._params);var C=Timeplot.Math.range(B);this._data={times:D.times,values:B};this._range={earliestDate:A.earliestDate,latestDate:A.latestDate,min:C.min,max:C.max}},getRange:function(){return this._range},getData:function(){return this._data},getValue:Timeplot.DataSource.prototype.getValue,addListener:function(A){this._dataSource.addListener(A)},removeListener:function(A){this._dataSource.removeListener(A)}};djConfig={parseOnLoad:false,isDebug:false};(function(){var sMap=null;if((sMap||(typeof djConfig!="undefined"&&djConfig.scopeMap))&&(typeof window!="undefined")){var scopeDef="",scopePrefix="",scopeSuffix="",scopeMap={},scopeMapRev={};sMap=sMap||djConfig.scopeMap;for(var i=0;i<sMap.length;i++){var newScope=sMap[i];scopeDef+="var "+newScope[0]+" = {}; "+newScope[1]+" = "+newScope[0]+";"+newScope[1]+"._scopeName = '"+newScope[1]+"';";scopePrefix+=(i==0?"":",")+newScope[0];scopeSuffix+=(i==0?"":",")+newScope[1];scopeMap[newScope[0]]=newScope[1];scopeMapRev[newScope[1]]=newScope[0]}eval(scopeDef+"dojo._scopeArgs = ["+scopeSuffix+"];");dojo._scopePrefixArgs=scopePrefix;dojo._scopePrefix="(function("+scopePrefix+"){";dojo._scopeSuffix="})("+scopeSuffix+")";dojo._scopeMap=scopeMap;dojo._scopeMapRev=scopeMapRev}(function(){if(!this["console"]){this.console={log:function(){}}}var cn=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"];var i=0,tn;while((tn=cn[i++])){if(!console[tn]){(function(){var tcn=tn+"";console[tcn]=function(){var a=Array.apply({},arguments);a.unshift(tcn+":");console.log(a.join(" "))}})()}}if(typeof dojo=="undefined"){this.dojo={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}}}var d=dojo;if(typeof dijit=="undefined"){this.dijit={_scopeName:"dijit"}}if(typeof dojox=="undefined"){this.dojox={_scopeName:"dojox"}}if(!d._scopeArgs){d._scopeArgs=[dojo,dijit,dojox]}d.global=this;d.config={isDebug:false,debugAtAllCosts:false};if(typeof djConfig!="undefined"){for(var opt in djConfig){d.config[opt]=djConfig[opt]}}var _platforms=["Browser","Rhino","Spidermonkey","Mobile"];var t;while((t=_platforms.shift())){d["is"+t]=false}dojo.locale=d.config.locale;var rev="$Rev: 13707 $".match(/\d+/);dojo.version={major:1,minor:1,patch:1,flag:"",revision:rev?+rev[0]:999999,toString:function(){with(d.version){return major+"."+minor+"."+patch+flag+" ("+revision+")"}}};if(typeof OpenAjax!="undefined"){OpenAjax.hub.registerLibrary(dojo._scopeName,"http://dojotoolkit.org",d.version.toString())}dojo._mixin=function(obj,props){var tobj={};for(var x in props){if(tobj[x]===undefined||tobj[x]!=props[x]){obj[x]=props[x]}}if(d.isIE&&props){var p=props.toString;if(typeof p=="function"&&p!=obj.toString&&p!=tobj.toString&&p!="\nfunction toString() {\n    [native code]\n}\n"){obj.toString=props.toString}}return obj};dojo.mixin=function(obj,props){for(var i=1,l=arguments.length;i<l;i++){d._mixin(obj,arguments[i])}return obj};dojo._getProp=function(parts,create,context){var obj=context||d.global;for(var i=0,p;obj&&(p=parts[i]);i++){if(i==0&&this._scopeMap[p]){p=this._scopeMap[p]}obj=(p in obj?obj[p]:(create?obj[p]={}:undefined))}return obj};dojo.setObject=function(name,value,context){var parts=name.split("."),p=parts.pop(),obj=d._getProp(parts,true,context);return obj&&p?(obj[p]=value):undefined};dojo.getObject=function(name,create,context){return d._getProp(name.split("."),create,context)};dojo.exists=function(name,obj){return !!d.getObject(name,false,obj)};dojo["eval"]=function(scriptFragment){return d.global.eval?d.global.eval(scriptFragment):eval(scriptFragment)};d.deprecated=d.experimental=function(){}})();(function(){var d=dojo;d.mixin(d,{_loadedModules:{},_inFlightCount:0,_hasResource:{},_modulePrefixes:{dojo:{name:"dojo",value:"."},doh:{name:"doh",value:"../util/doh"},tests:{name:"tests",value:"tests"}},_moduleHasPrefix:function(module){var mp=this._modulePrefixes;return !!(mp[module]&&mp[module].value)},_getModulePrefix:function(module){var mp=this._modulePrefixes;if(this._moduleHasPrefix(module)){return mp[module].value}return module},_loadedUrls:[],_postLoad:false,_loaders:[],_unloaders:[],_loadNotifying:false});dojo._loadPath=function(relpath,module,cb){var uri=((relpath.charAt(0)=="/"||relpath.match(/^\w+:/))?"":this.baseUrl)+relpath;try{return !module?this._loadUri(uri,cb):this._loadUriAndCheck(uri,module,cb)}catch(e){console.error(e);return false}};dojo._loadUri=function(uri,cb){if(this._loadedUrls[uri]){return true}var contents=this._getText(uri,true);if(!contents){return false}this._loadedUrls[uri]=true;this._loadedUrls.push(uri);if(cb){contents="("+contents+")"}else{contents=this._scopePrefix+contents+this._scopeSuffix}if(d.isMoz){contents+="\r\n//@ sourceURL="+uri}var value=d["eval"](contents);if(cb){cb(value)}return true};dojo._loadUriAndCheck=function(uri,moduleName,cb){var ok=false;try{ok=this._loadUri(uri,cb)}catch(e){console.error("failed loading "+uri+" with error: "+e)}return !!(ok&&this._loadedModules[moduleName])};dojo.loaded=function(){this._loadNotifying=true;this._postLoad=true;var mll=d._loaders;this._loaders=[];for(var x=0;x<mll.length;x++){try{mll[x]()}catch(e){throw e;console.error("dojo.addOnLoad callback failed: "+e,e)}}this._loadNotifying=false;if(d._postLoad&&d._inFlightCount==0&&mll.length){d._callLoaded()}};dojo.unloaded=function(){var mll=this._unloaders;while(mll.length){(mll.pop())()}};var onto=function(arr,obj,fn){if(!fn){arr.push(obj)}else{if(fn){var func=(typeof fn=="string")?obj[fn]:fn;arr.push(function(){func.call(obj)})}}};dojo.addOnLoad=function(obj,functionName){onto(d._loaders,obj,functionName);if(d._postLoad&&d._inFlightCount==0&&!d._loadNotifying){d._callLoaded()}};dojo.addOnUnload=function(obj,functionName){onto(d._unloaders,obj,functionName)};dojo._modulesLoaded=function(){if(d._postLoad){return }if(d._inFlightCount>0){console.warn("files still in flight!");return }d._callLoaded()};dojo._callLoaded=function(){if(typeof setTimeout=="object"||(dojo.config.useXDomain&&d.isOpera)){if(dojo.isAIR){setTimeout(function(){dojo.loaded()},0)}else{setTimeout(dojo._scopeName+".loaded();",0)}}else{d.loaded()}};dojo._getModuleSymbols=function(modulename){var syms=modulename.split(".");for(var i=syms.length;i>0;i--){var parentModule=syms.slice(0,i).join(".");if((i==1)&&!this._moduleHasPrefix(parentModule)){syms[0]="../"+syms[0]}else{var parentModulePath=this._getModulePrefix(parentModule);if(parentModulePath!=parentModule){syms.splice(0,i,parentModulePath);break}}}return syms};dojo._global_omit_module_check=false;dojo._loadModule=dojo.require=function(moduleName,omitModuleCheck){omitModuleCheck=this._global_omit_module_check||omitModuleCheck;var module=this._loadedModules[moduleName];if(module){return module}var relpath=this._getModuleSymbols(moduleName).join("/")+".js";var modArg=(!omitModuleCheck)?moduleName:null;var ok=this._loadPath(relpath,modArg);if(!ok&&!omitModuleCheck){throw new Error("Could not load '"+moduleName+"'; last tried '"+relpath+"'")}if(!omitModuleCheck&&!this._isXDomain){module=this._loadedModules[moduleName];if(!module){throw new Error("symbol '"+moduleName+"' is not defined after loading '"+relpath+"'")}}return module};dojo.provide=function(resourceName){resourceName=resourceName+"";return(d._loadedModules[resourceName]=d.getObject(resourceName,true))};dojo.platformRequire=function(modMap){var common=modMap.common||[];var result=common.concat(modMap[d._name]||modMap["default"]||[]);for(var x=0;x<result.length;x++){var curr=result[x];if(curr.constructor==Array){d._loadModule.apply(d,curr)}else{d._loadModule(curr)}}};dojo.requireIf=function(condition,resourceName){if(condition===true){var args=[];for(var i=1;i<arguments.length;i++){args.push(arguments[i])}d.require.apply(d,args)}};dojo.requireAfterIf=d.requireIf;dojo.registerModulePath=function(module,prefix){d._modulePrefixes[module]={name:module,value:prefix}};dojo.requireLocalization=function(moduleName,bundleName,locale,availableFlatLocales){d.require("dojo.i18n");d.i18n._requireLocalization.apply(d.hostenv,arguments)};var ore=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$");var ire=new RegExp("^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$");dojo._Url=function(){var n=null;var _a=arguments;var uri=[_a[0]];for(var i=1;i<_a.length;i++){if(!_a[i]){continue}var relobj=new d._Url(_a[i]+"");var uriobj=new d._Url(uri[0]+"");if(relobj.path==""&&!relobj.scheme&&!relobj.authority&&!relobj.query){if(relobj.fragment!=n){uriobj.fragment=relobj.fragment}relobj=uriobj}else{if(!relobj.scheme){relobj.scheme=uriobj.scheme;if(!relobj.authority){relobj.authority=uriobj.authority;if(relobj.path.charAt(0)!="/"){var path=uriobj.path.substring(0,uriobj.path.lastIndexOf("/")+1)+relobj.path;var segs=path.split("/");for(var j=0;j<segs.length;j++){if(segs[j]=="."){if(j==segs.length-1){segs[j]=""}else{segs.splice(j,1);j--}}else{if(j>0&&!(j==1&&segs[0]=="")&&segs[j]==".."&&segs[j-1]!=".."){if(j==(segs.length-1)){segs.splice(j,1);segs[j-1]=""}else{segs.splice(j-1,2);j-=2}}}}relobj.path=segs.join("/")}}}}uri=[];if(relobj.scheme){uri.push(relobj.scheme,":")}if(relobj.authority){uri.push("//",relobj.authority)}uri.push(relobj.path);if(relobj.query){uri.push("?",relobj.query)}if(relobj.fragment){uri.push("#",relobj.fragment)}}this.uri=uri.join("");var r=this.uri.match(ore);this.scheme=r[2]||(r[1]?"":n);this.authority=r[4]||(r[3]?"":n);this.path=r[5];this.query=r[7]||(r[6]?"":n);this.fragment=r[9]||(r[8]?"":n);if(this.authority!=n){r=this.authority.match(ire);this.user=r[3]||n;this.password=r[4]||n;this.host=r[5];this.port=r[7]||n}};dojo._Url.prototype.toString=function(){return this.uri};dojo.moduleUrl=function(module,url){var loc=d._getModuleSymbols(module).join("/");if(!loc){return null}if(loc.lastIndexOf("/")!=loc.length-1){loc+="/"}var colonIndex=loc.indexOf(":");if(loc.charAt(0)!="/"&&(colonIndex==-1||colonIndex>loc.indexOf("/"))){loc=d.baseUrl+loc}return new d._Url(loc,url)}})();if(typeof window!="undefined"){dojo.isBrowser=true;dojo._name="browser";(function(){var d=dojo;if(document&&document.getElementsByTagName){var scripts=document.getElementsByTagName("script");var rePkg=/dojo(\.xd)?\.js(\W|$)/i;for(var i=0;i<scripts.length;i++){var src=scripts[i].getAttribute("src");if(!src){continue}var m=src.match(rePkg);if(m){if(!d.config.baseUrl){d.config.baseUrl=src.substring(0,m.index)}var cfg=scripts[i].getAttribute("djConfig");if(cfg){var cfgo=eval("({ "+cfg+" })");for(var x in cfgo){dojo.config[x]=cfgo[x]}}break}}}d.baseUrl=d.config.baseUrl;var n=navigator;var dua=n.userAgent;var dav=n.appVersion;var tv=parseFloat(dav);d.isOpera=(dua.indexOf("Opera")>=0)?tv:0;var idx=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(idx){d.isSafari=parseFloat(dav.split("Version/")[1])||((parseFloat(dav.substr(idx+7))>=419.3)?3:2)||2}d.isAIR=(dua.indexOf("AdobeAIR")>=0)?1:0;d.isKhtml=(dav.indexOf("Konqueror")>=0||d.isSafari)?tv:0;d.isMozilla=d.isMoz=(dua.indexOf("Gecko")>=0&&!d.isKhtml)?tv:0;d.isFF=d.isIE=0;if(d.isMoz){d.isFF=parseFloat(dua.split("Firefox/")[1])||0}if(document.all&&!d.isOpera){d.isIE=parseFloat(dav.split("MSIE ")[1])||0}if(dojo.isIE&&window.location.protocol==="file:"){dojo.config.ieForceActiveXXhr=true}var cm=document.compatMode;d.isQuirks=cm=="BackCompat"||cm=="QuirksMode"||d.isIE<6;d.locale=dojo.config.locale||(d.isIE?n.userLanguage:n.language).toLowerCase();d._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];d._xhrObj=function(){var http=null;var last_e=null;if(!dojo.isIE||!dojo.config.ieForceActiveXXhr){try{http=new XMLHttpRequest()}catch(e){}}if(!http){for(var i=0;i<3;++i){var progid=d._XMLHTTP_PROGIDS[i];try{http=new ActiveXObject(progid)}catch(e){last_e=e}if(http){d._XMLHTTP_PROGIDS=[progid];break}}}if(!http){throw new Error("XMLHTTP not available: "+last_e)}return http};d._isDocumentOk=function(http){var stat=http.status||0;return(stat>=200&&stat<300)||stat==304||stat==1223||(!stat&&(location.protocol=="file:"||location.protocol=="chrome:"))};var owloc=window.location+"";var base=document.getElementsByTagName("base");var hasBase=(base&&base.length>0);d._getText=function(uri,fail_ok){var http=this._xhrObj();if(!hasBase&&dojo._Url){uri=(new dojo._Url(owloc,uri)).toString()}if(d.config.cacheBust){uri+=(uri.indexOf("?")==-1?"?":"&")+String(d.config.cacheBust).replace(/\W+/g,"")}http.open("GET",uri,false);try{http.send(null);if(!d._isDocumentOk(http)){var err=Error("Unable to load "+uri+" status:"+http.status);err.status=http.status;err.responseText=http.responseText;throw err}}catch(e){if(fail_ok){return null}throw e}return http.responseText}})();dojo._initFired=false;dojo._loadInit=function(e){dojo._initFired=true;var type=(e&&e.type)?e.type.toLowerCase():"load";if(arguments.callee.initialized||(type!="domcontentloaded"&&type!="load")){return }arguments.callee.initialized=true;if("_khtmlTimer" in dojo){clearInterval(dojo._khtmlTimer);delete dojo._khtmlTimer}if(dojo._inFlightCount==0){dojo._modulesLoaded()}};dojo._fakeLoadInit=function(){dojo._loadInit({type:"load"})};if(!dojo.config.afterOnLoad){if(document.addEventListener){if(dojo.isOpera||dojo.isFF>=3||(dojo.isMoz&&dojo.config.enableMozDomContentLoaded===true)){document.addEventListener("DOMContentLoaded",dojo._loadInit,null)}window.addEventListener("load",dojo._loadInit,null)}if(dojo.isAIR){window.addEventListener("load",dojo._loadInit,null)}else{if(/(WebKit|khtml)/i.test(navigator.userAgent)){dojo._khtmlTimer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){dojo._loadInit()}},10)}}}(function(){var _w=window;var _handleNodeEvent=function(evtName,fp){var oldHandler=_w[evtName]||function(){};_w[evtName]=function(){fp.apply(_w,arguments);oldHandler.apply(_w,arguments)}};if(dojo.isIE){if(!dojo.config.afterOnLoad){document.write('<script defer src="//:" onreadystatechange="if(this.readyState==\'complete\'){'+dojo._scopeName+'._loadInit();}"><\/script>')}var _unloading=true;_handleNodeEvent("onbeforeunload",function(){_w.setTimeout(function(){_unloading=false},0)});_handleNodeEvent("onunload",function(){if(_unloading){dojo.unloaded()}});try{document.namespaces.add("v","urn:schemas-microsoft-com:vml");document.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML)")}catch(e){}}else{_handleNodeEvent("onbeforeunload",function(){dojo.unloaded()})}})()}(function(){var mp=dojo.config.modulePaths;if(mp){for(var param in mp){dojo.registerModulePath(param,mp[param])}}})();if(dojo.config.isDebug){dojo.require("dojo._firebug.firebug")}if(dojo.config.debugAtAllCosts){dojo.config.useXDomain=true;dojo.require("dojo._base._loader.loader_xd");dojo.require("dojo._base._loader.loader_debug");dojo.require("dojo.i18n")}if(!dojo._hasResource["dojo._base.lang"]){dojo._hasResource["dojo._base.lang"]=true;dojo.provide("dojo._base.lang");dojo.isString=function(it){return !!arguments.length&&it!=null&&(typeof it=="string"||it instanceof String)};dojo.isArray=function(it){return it&&(it instanceof Array||typeof it=="array")};dojo.isFunction=(function(){var _isFunction=function(it){return it&&(typeof it=="function"||it instanceof Function)};return dojo.isSafari?function(it){if(typeof it=="function"&&it=="[object NodeList]"){return false}return _isFunction(it)}:_isFunction})();dojo.isObject=function(it){return it!==undefined&&(it===null||typeof it=="object"||dojo.isArray(it)||dojo.isFunction(it))};dojo.isArrayLike=function(it){var d=dojo;return it&&it!==undefined&&!d.isString(it)&&!d.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()=="form")&&(d.isArray(it)||isFinite(it.length))};dojo.isAlien=function(it){return it&&!dojo.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it))};dojo.extend=function(constructor,props){for(var i=1,l=arguments.length;i<l;i++){dojo._mixin(constructor.prototype,arguments[i])}return constructor};dojo._hitchArgs=function(scope,method){var pre=dojo._toArray(arguments,2);var named=dojo.isString(method);return function(){var args=dojo._toArray(arguments);var f=named?(scope||dojo.global)[method]:method;return f&&f.apply(scope||this,pre.concat(args))}};dojo.hitch=function(scope,method){if(arguments.length>2){return dojo._hitchArgs.apply(dojo,arguments)}if(!method){method=scope;scope=null}if(dojo.isString(method)){scope=scope||dojo.global;if(!scope[method]){throw (['dojo.hitch: scope["',method,'"] is null (scope="',scope,'")'].join(""))}return function(){return scope[method].apply(scope,arguments||[])}}return !scope?method:function(){return method.apply(scope,arguments||[])}};dojo.delegate=dojo._delegate=function(obj,props){function TMP(){}TMP.prototype=obj;var tmp=new TMP();if(props){dojo.mixin(tmp,props)}return tmp};dojo.partial=function(method){var arr=[null];return dojo.hitch.apply(dojo,arr.concat(dojo._toArray(arguments)))};dojo._toArray=function(obj,offset,startWith){var arr=startWith||[];for(var x=offset||0;x<obj.length;x++){arr.push(obj[x])}return arr};dojo.clone=function(o){if(!o){return o}if(dojo.isArray(o)){var r=[];for(var i=0;i<o.length;++i){r.push(dojo.clone(o[i]))}return r}if(!dojo.isObject(o)){return o}if(o.nodeType&&o.cloneNode){return o.cloneNode(true)}if(o instanceof Date){return new Date(o.getTime())}var r=new o.constructor();for(var i in o){if(!(i in r)||r[i]!=o[i]){r[i]=dojo.clone(o[i])}}return r};dojo.trim=function(str){return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}if(!dojo._hasResource["dojo._base.declare"]){dojo._hasResource["dojo._base.declare"]=true;dojo.provide("dojo._base.declare");dojo.declare=function(className,superclass,props){var dd=arguments.callee,mixins;if(dojo.isArray(superclass)){mixins=superclass;superclass=mixins.shift()}if(mixins){dojo.forEach(mixins,function(m){if(!m){throw (className+": mixin #"+i+" is null")}superclass=dd._delegate(superclass,m)})}var init=(props||0).constructor,ctor=dd._delegate(superclass),fn;for(var i in props){if(dojo.isFunction(fn=props[i])&&!0[i]){fn.nom=i}}dojo.extend(ctor,{declaredClass:className,_constructor:init,preamble:null},props||0);ctor.prototype.constructor=ctor;return dojo.setObject(className,ctor)};dojo.mixin(dojo.declare,{_delegate:function(base,mixin){var bp=(base||0).prototype,mp=(mixin||0).prototype;var ctor=dojo.declare._makeCtor();dojo.mixin(ctor,{superclass:bp,mixin:mp,extend:dojo.declare._extend});if(base){ctor.prototype=dojo._delegate(bp)}dojo.extend(ctor,dojo.declare._core,mp||0,{_constructor:null,preamble:null});ctor.prototype.constructor=ctor;ctor.prototype.declaredClass=(bp||0).declaredClass+"_"+(mp||0).declaredClass;return ctor},_extend:function(props){for(var i in props){if(dojo.isFunction(fn=props[i])&&!0[i]){fn.nom=i}}dojo.extend(this,props)},_makeCtor:function(){return function(){this._construct(arguments)}},_core:{_construct:function(args){var c=args.callee,s=c.superclass,ct=s&&s.constructor,m=c.mixin,mct=m&&m.constructor,a=args,ii,fn;if(a[0]){if(((fn=a[0].preamble))){a=fn.apply(this,a)||a}}if((fn=c.prototype.preamble)){a=fn.apply(this,a)||a}if(ct&&ct.apply){ct.apply(this,a)}if(mct&&mct.apply){mct.apply(this,a)}if((ii=c.prototype._constructor)){ii.apply(this,args)}if(this.constructor.prototype==c.prototype&&(ct=this.postscript)){ct.apply(this,args)}},_findMixin:function(mixin){var c=this.constructor,p,m;while(c){p=c.superclass;m=c.mixin;if(m==mixin||(m instanceof mixin.constructor)){return p}if(m&&(m=m._findMixin(mixin))){return m}c=p&&p.constructor}},_findMethod:function(name,method,ptype,has){var p=ptype,c,m,f;do{c=p.constructor;m=c.mixin;if(m&&(m=this._findMethod(name,method,m,has))){return m}if((f=p[name])&&(has==(f==method))){return p}p=c.superclass}while(p);return !has&&(p=this._findMixin(ptype))&&this._findMethod(name,method,p,has)},inherited:function(name,args,newArgs){var a=arguments;if(!dojo.isString(a[0])){newArgs=args;args=name;name=args.callee.nom}a=newArgs||args;var c=args.callee,p=this.constructor.prototype,fn,mp;if(this[name]!=c||p[name]==c){mp=this._findMethod(name,c,p,true);if(!mp){throw (this.declaredClass+': inherited method "'+name+'" mismatch')}p=this._findMethod(name,c,mp,false)}fn=p&&p[name];if(!fn){throw (mp.declaredClass+': inherited method "'+name+'" not found')}return fn.apply(this,a)}}})}if(!dojo._hasResource["dojo._base.connect"]){dojo._hasResource["dojo._base.connect"]=true;dojo.provide("dojo._base.connect");dojo._listener={getDispatcher:function(){return function(){var ap=Array.prototype,c=arguments.callee,ls=c._listeners,t=c.target;var r=t&&t.apply(this,arguments);for(var i in ls){if(!(i in ap)){ls[i].apply(this,arguments)}}return r}},add:function(source,method,listener){source=source||dojo.global;var f=source[method];if(!f||!f._listeners){var d=dojo._listener.getDispatcher();d.target=f;d._listeners=[];f=source[method]=d}return f._listeners.push(listener)},remove:function(source,method,handle){var f=(source||dojo.global)[method];if(f&&f._listeners&&handle--){delete f._listeners[handle]}}};dojo.connect=function(obj,event,context,method,dontFix){var a=arguments,args=[],i=0;args.push(dojo.isString(a[0])?null:a[i++],a[i++]);var a1=a[i+1];args.push(dojo.isString(a1)||dojo.isFunction(a1)?a[i++]:null,a[i++]);for(var l=a.length;i<l;i++){args.push(a[i])}return dojo._connect.apply(this,args)};dojo._connect=function(obj,event,context,method){var l=dojo._listener,h=l.add(obj,event,dojo.hitch(context,method));return[obj,event,h,l]};dojo.disconnect=function(handle){if(handle&&handle[0]!==undefined){dojo._disconnect.apply(this,handle);delete handle[0]}};dojo._disconnect=function(obj,event,handle,listener){listener.remove(obj,event,handle)};dojo._topics={};dojo.subscribe=function(topic,context,method){return[topic,dojo._listener.add(dojo._topics,topic,dojo.hitch(context,method))]};dojo.unsubscribe=function(handle){if(handle){dojo._listener.remove(dojo._topics,handle[0],handle[1])}};dojo.publish=function(topic,args){var f=dojo._topics[topic];if(f){f.apply(this,args||[])}};dojo.connectPublisher=function(topic,obj,event){var pf=function(){dojo.publish(topic,arguments)};return(event)?dojo.connect(obj,event,pf):dojo.connect(obj,pf)}}if(!dojo._hasResource["dojo._base.Deferred"]){dojo._hasResource["dojo._base.Deferred"]=true;dojo.provide("dojo._base.Deferred");dojo.Deferred=function(canceller){this.chain=[];this.id=this._nextId();this.fired=-1;this.paused=0;this.results=[null,null];this.canceller=canceller;this.silentlyCancelled=false};dojo.extend(dojo.Deferred,{_nextId:(function(){var n=1;return function(){return n++}})(),cancel:function(){var err;if(this.fired==-1){if(this.canceller){err=this.canceller(this)}else{this.silentlyCancelled=true}if(this.fired==-1){if(!(err instanceof Error)){var res=err;err=new Error("Deferred Cancelled");err.dojoType="cancel";err.cancelResult=res}this.errback(err)}}else{if((this.fired==0)&&(this.results[0] instanceof dojo.Deferred)){this.results[0].cancel()}}},_resback:function(res){this.fired=((res instanceof Error)?1:0);this.results[this.fired]=res;this._fire()},_check:function(){if(this.fired!=-1){if(!this.silentlyCancelled){throw new Error("already called!")}this.silentlyCancelled=false;return }},callback:function(res){this._check();this._resback(res)},errback:function(res){this._check();if(!(res instanceof Error)){res=new Error(res)}this._resback(res)},addBoth:function(cb,cbfn){var enclosed=dojo.hitch.apply(dojo,arguments);return this.addCallbacks(enclosed,enclosed)},addCallback:function(cb,cbfn){return this.addCallbacks(dojo.hitch.apply(dojo,arguments))},addErrback:function(cb,cbfn){return this.addCallbacks(null,dojo.hitch.apply(dojo,arguments))},addCallbacks:function(cb,eb){this.chain.push([cb,eb]);if(this.fired>=0){this._fire()}return this},_fire:function(){var chain=this.chain;var fired=this.fired;var res=this.results[fired];var self=this;var cb=null;while((chain.length>0)&&(this.paused==0)){var f=chain.shift()[fired];if(!f){continue}try{res=f(res);fired=((res instanceof Error)?1:0);if(res instanceof dojo.Deferred){cb=function(res){self._resback(res);self.paused--;if((self.paused==0)&&(self.fired>=0)){self._fire()}};this.paused++}}catch(err){console.debug(err);fired=1;res=err}}this.fired=fired;this.results[fired]=res;if((cb)&&(this.paused)){res.addBoth(cb)}}})}if(!dojo._hasResource["dojo._base.json"]){dojo._hasResource["dojo._base.json"]=true;dojo.provide("dojo._base.json");dojo.fromJson=function(json){return eval("("+json+")")};dojo._escapeString=function(str){return('"'+str.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};dojo.toJsonIndentStr="\t";dojo.toJson=function(it,prettyPrint,_indentStr){if(it===undefined){return"undefined"}var objtype=typeof it;if(objtype=="number"||objtype=="boolean"){return it+""}if(it===null){return"null"}if(dojo.isString(it)){return dojo._escapeString(it)}if(it.nodeType&&it.cloneNode){return""}var recurse=arguments.callee;var newObj;_indentStr=_indentStr||"";var nextIndent=prettyPrint?_indentStr+dojo.toJsonIndentStr:"";if(typeof it.__json__=="function"){newObj=it.__json__();if(it!==newObj){return recurse(newObj,prettyPrint,nextIndent)}}if(typeof it.json=="function"){newObj=it.json();if(it!==newObj){return recurse(newObj,prettyPrint,nextIndent)}}var sep=prettyPrint?" ":"";var newLine=prettyPrint?"\n":"";if(dojo.isArray(it)){var res=dojo.map(it,function(obj){var val=recurse(obj,prettyPrint,nextIndent);if(typeof val!="string"){val="undefined"}return newLine+nextIndent+val});return"["+res.join(","+sep)+newLine+_indentStr+"]"}if(objtype=="function"){return null}var output=[];for(var key in it){var keyStr;if(typeof key=="number"){keyStr='"'+key+'"'}else{if(typeof key=="string"){keyStr=dojo._escapeString(key)}else{continue}}val=recurse(it[key],prettyPrint,nextIndent);if(typeof val!="string"){continue}output.push(newLine+nextIndent+keyStr+":"+sep+val)}return"{"+output.join(","+sep)+newLine+_indentStr+"}"}}if(!dojo._hasResource["dojo._base.array"]){dojo._hasResource["dojo._base.array"]=true;dojo.provide("dojo._base.array");(function(){var _getParts=function(arr,obj,cb){return[dojo.isString(arr)?arr.split(""):arr,obj||dojo.global,dojo.isString(cb)?new Function("item","index","array",cb):cb]};dojo.mixin(dojo,{indexOf:function(array,value,fromIndex,findLast){var step=1,end=array.length||0,i=0;if(findLast){i=end-1;step=end=-1}if(fromIndex!=undefined){i=fromIndex}if((findLast&&i>end)||i<end){for(;i!=end;i+=step){if(array[i]==value){return i}}}return -1},lastIndexOf:function(array,value,fromIndex){return dojo.indexOf(array,value,fromIndex,true)},forEach:function(arr,callback,thisObject){if(!arr||!arr.length){return }var _p=_getParts(arr,thisObject,callback);arr=_p[0];for(var i=0,l=_p[0].length;i<l;i++){_p[2].call(_p[1],arr[i],i,arr)}},_everyOrSome:function(every,arr,callback,thisObject){var _p=_getParts(arr,thisObject,callback);arr=_p[0];for(var i=0,l=arr.length;i<l;i++){var result=!!_p[2].call(_p[1],arr[i],i,arr);if(every^result){return result}}return every},every:function(arr,callback,thisObject){return this._everyOrSome(true,arr,callback,thisObject)},some:function(arr,callback,thisObject){return this._everyOrSome(false,arr,callback,thisObject)},map:function(arr,callback,thisObject){var _p=_getParts(arr,thisObject,callback);arr=_p[0];var outArr=(arguments[3]?(new arguments[3]()):[]);for(var i=0;i<arr.length;++i){outArr.push(_p[2].call(_p[1],arr[i],i,arr))}return outArr},filter:function(arr,callback,thisObject){var _p=_getParts(arr,thisObject,callback);arr=_p[0];var outArr=[];for(var i=0;i<arr.length;i++){if(_p[2].call(_p[1],arr[i],i,arr)){outArr.push(arr[i])}}return outArr}})})()}if(!dojo._hasResource["dojo._base.Color"]){dojo._hasResource["dojo._base.Color"]=true;dojo.provide("dojo._base.Color");dojo.Color=function(color){if(color){this.setColor(color)}};dojo.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255]};dojo.extend(dojo.Color,{r:255,g:255,b:255,a:1,_set:function(r,g,b,a){var t=this;t.r=r;t.g=g;t.b=b;t.a=a},setColor:function(color){var d=dojo;if(d.isString(color)){d.colorFromString(color,this)}else{if(d.isArray(color)){d.colorFromArray(color,this)}else{this._set(color.r,color.g,color.b,color.a);if(!(color instanceof d.Color)){this.sanitize()}}}return this},sanitize:function(){return this},toRgb:function(){var t=this;return[t.r,t.g,t.b]},toRgba:function(){var t=this;return[t.r,t.g,t.b,t.a]},toHex:function(){var arr=dojo.map(["r","g","b"],function(x){var s=this[x].toString(16);return s.length<2?"0"+s:s},this);return"#"+arr.join("")},toCss:function(includeAlpha){var t=this,rgb=t.r+", "+t.g+", "+t.b;return(includeAlpha?"rgba("+rgb+", "+t.a:"rgb("+rgb)+")"},toString:function(){return this.toCss(true)}});dojo.blendColors=function(start,end,weight,obj){var d=dojo,t=obj||new dojo.Color();d.forEach(["r","g","b","a"],function(x){t[x]=start[x]+(end[x]-start[x])*weight;if(x!="a"){t[x]=Math.round(t[x])}});return t.sanitize()};dojo.colorFromRgb=function(color,obj){var m=color.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return m&&dojo.colorFromArray(m[1].split(/\s*,\s*/),obj)};dojo.colorFromHex=function(color,obj){var d=dojo,t=obj||new d.Color(),bits=(color.length==4)?4:8,mask=(1<<bits)-1;color=Number("0x"+color.substr(1));if(isNaN(color)){return null}d.forEach(["b","g","r"],function(x){var c=color&mask;color>>=bits;t[x]=bits==4?17*c:c});t.a=1;return t};dojo.colorFromArray=function(a,obj){var t=obj||new dojo.Color();t._set(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]));if(isNaN(t.a)){t.a=1}return t.sanitize()};dojo.colorFromString=function(str,obj){var a=dojo.Color.named[str];return a&&dojo.colorFromArray(a,obj)||dojo.colorFromRgb(str,obj)||dojo.colorFromHex(str,obj)}}if(!dojo._hasResource["dojo._base"]){dojo._hasResource["dojo._base"]=true;dojo.provide("dojo._base")}if(!dojo._hasResource["dojo._base.window"]){dojo._hasResource["dojo._base.window"]=true;dojo.provide("dojo._base.window");dojo._gearsObject=function(){var factory;var results;var gearsObj=dojo.getObject("google.gears");if(gearsObj){return gearsObj}if(typeof GearsFactory!="undefined"){factory=new GearsFactory()}else{if(dojo.isIE){try{factory=new ActiveXObject("Gears.Factory")}catch(e){}}else{if(navigator.mimeTypes["application/x-googlegears"]){factory=document.createElement("object");factory.setAttribute("type","application/x-googlegears");factory.setAttribute("width",0);factory.setAttribute("height",0);factory.style.display="none";document.documentElement.appendChild(factory)}}}if(!factory){return null}dojo.setObject("google.gears.factory",factory);return dojo.getObject("google.gears")};dojo.isGears=(!!dojo._gearsObject())||0;dojo.doc=window.document||null;dojo.body=function(){return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0]};dojo.setContext=function(globalObject,globalDocument){dojo.global=globalObject;dojo.doc=globalDocument};dojo._fireCallback=function(callback,context,cbArguments){if(context&&dojo.isString(callback)){callback=context[callback]}return callback.apply(context,cbArguments||[])};dojo.withGlobal=function(globalObject,callback,thisObject,cbArguments){var rval;var oldGlob=dojo.global;var oldDoc=dojo.doc;try{dojo.setContext(globalObject,globalObject.document);rval=dojo._fireCallback(callback,thisObject,cbArguments)}finally{dojo.setContext(oldGlob,oldDoc)}return rval};dojo.withDoc=function(documentObject,callback,thisObject,cbArguments){var rval;var oldDoc=dojo.doc;try{dojo.doc=documentObject;rval=dojo._fireCallback(callback,thisObject,cbArguments)}finally{dojo.doc=oldDoc}return rval}}if(!dojo._hasResource["dojo._base.event"]){dojo._hasResource["dojo._base.event"]=true;dojo.provide("dojo._base.event");(function(){var del=(dojo._event_listener={add:function(node,name,fp){if(!node){return }name=del._normalizeEventName(name);fp=del._fixCallback(name,fp);var oname=name;if(!dojo.isIE&&(name=="mouseenter"||name=="mouseleave")){var ofp=fp;name=(name=="mouseenter")?"mouseover":"mouseout";fp=function(e){if(!dojo.isDescendant(e.relatedTarget,node)){return ofp.call(this,e)}}}node.addEventListener(name,fp,false);return fp},remove:function(node,event,handle){if(node){node.removeEventListener(del._normalizeEventName(event),handle,false)}},_normalizeEventName:function(name){return name.slice(0,2)=="on"?name.slice(2):name},_fixCallback:function(name,fp){return name!="keypress"?fp:function(e){return fp.call(this,del._fixEvent(e,this))}},_fixEvent:function(evt,sender){switch(evt.type){case"keypress":del._setKeyChar(evt);break}return evt},_setKeyChar:function(evt){evt.keyChar=evt.charCode?String.fromCharCode(evt.charCode):""}});dojo.fixEvent=function(evt,sender){return del._fixEvent(evt,sender)};dojo.stopEvent=function(evt){evt.preventDefault();evt.stopPropagation()};var node_listener=dojo._listener;dojo._connect=function(obj,event,context,method,dontFix){var isNode=obj&&(obj.nodeType||obj.attachEvent||obj.addEventListener);var lid=!isNode?0:(!dontFix?1:2),l=[dojo._listener,del,node_listener][lid];var h=l.add(obj,event,dojo.hitch(context,method));return[obj,event,h,lid]};dojo._disconnect=function(obj,event,handle,listener){([dojo._listener,del,node_listener][listener]).remove(obj,event,handle)};dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145};if(dojo.isIE){var _trySetKeyCode=function(e,code){try{return(e.keyCode=code)}catch(e){return 0}};var iel=dojo._listener;if(!dojo.config._allow_leaks){node_listener=iel=dojo._ie_listener={handlers:[],add:function(source,method,listener){source=source||dojo.global;var f=source[method];if(!f||!f._listeners){var d=dojo._getIeDispatcher();d.target=f&&(ieh.push(f)-1);d._listeners=[];f=source[method]=d}return f._listeners.push(ieh.push(listener)-1)},remove:function(source,method,handle){var f=(source||dojo.global)[method],l=f&&f._listeners;if(f&&l&&handle--){delete ieh[l[handle]];delete l[handle]}}};var ieh=iel.handlers}dojo.mixin(del,{add:function(node,event,fp){if(!node){return }event=del._normalizeEventName(event);if(event=="onkeypress"){var kd=node.onkeydown;if(!kd||!kd._listeners||!kd._stealthKeydownHandle){var h=del.add(node,"onkeydown",del._stealthKeyDown);kd=node.onkeydown;kd._stealthKeydownHandle=h;kd._stealthKeydownRefs=1}else{kd._stealthKeydownRefs++}}return iel.add(node,event,del._fixCallback(fp))},remove:function(node,event,handle){event=del._normalizeEventName(event);iel.remove(node,event,handle);if(event=="onkeypress"){var kd=node.onkeydown;if(--kd._stealthKeydownRefs<=0){iel.remove(node,"onkeydown",kd._stealthKeydownHandle);delete kd._stealthKeydownHandle}}},_normalizeEventName:function(eventName){return eventName.slice(0,2)!="on"?"on"+eventName:eventName},_nop:function(){},_fixEvent:function(evt,sender){if(!evt){var w=sender&&(sender.ownerDocument||sender.document||sender).parentWindow||window;evt=w.event}if(!evt){return(evt)}evt.target=evt.srcElement;evt.currentTarget=(sender||evt.srcElement);evt.layerX=evt.offsetX;evt.layerY=evt.offsetY;var se=evt.srcElement,doc=(se&&se.ownerDocument)||document;var docBody=((dojo.isIE<6)||(doc.compatMode=="BackCompat"))?doc.body:doc.documentElement;var offset=dojo._getIeDocumentElementOffset();evt.pageX=evt.clientX+dojo._fixIeBiDiScrollLeft(docBody.scrollLeft||0)-offset.x;evt.pageY=evt.clientY+(docBody.scrollTop||0)-offset.y;if(evt.type=="mouseover"){evt.relatedTarget=evt.fromElement}if(evt.type=="mouseout"){evt.relatedTarget=evt.toElement}evt.stopPropagation=del._stopPropagation;evt.preventDefault=del._preventDefault;return del._fixKeys(evt)},_fixKeys:function(evt){switch(evt.type){case"keypress":var c=("charCode" in evt?evt.charCode:evt.keyCode);if(c==10){c=0;evt.keyCode=13}else{if(c==13||c==27){c=0}else{if(c==3){c=99}}}evt.charCode=c;del._setKeyChar(evt);break}return evt},_punctMap:{106:42,111:47,186:59,187:43,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39},_stealthKeyDown:function(evt){var kp=evt.currentTarget.onkeypress;if(!kp||!kp._listeners){return }var k=evt.keyCode;var unprintable=(k!=13)&&(k!=32)&&(k!=27)&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222);if(unprintable||evt.ctrlKey){var c=unprintable?0:k;if(evt.ctrlKey){if(k==3||k==13){return }else{if(c>95&&c<106){c-=48}else{if((!evt.shiftKey)&&(c>=65&&c<=90)){c+=32}else{c=del._punctMap[c]||c}}}}var faux=del._synthesizeEvent(evt,{type:"keypress",faux:true,charCode:c});kp.call(evt.currentTarget,faux);evt.cancelBubble=faux.cancelBubble;evt.returnValue=faux.returnValue;_trySetKeyCode(evt,faux.keyCode)}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;if(this.ctrlKey){_trySetKeyCode(this,0)}this.returnValue=false}});dojo.stopEvent=function(evt){evt=evt||window.event;del._stopPropagation.call(evt);del._preventDefault.call(evt)}}del._synthesizeEvent=function(evt,props){var faux=dojo.mixin({},evt,props);del._setKeyChar(faux);faux.preventDefault=function(){evt.preventDefault()};faux.stopPropagation=function(){evt.stopPropagation()};return faux};if(dojo.isOpera){dojo.mixin(del,{_fixEvent:function(evt,sender){switch(evt.type){case"keypress":var c=evt.which;if(c==3){c=99}c=((c<41)&&(!evt.shiftKey)?0:c);if((evt.ctrlKey)&&(!evt.shiftKey)&&(c>=65)&&(c<=90)){c+=32}return del._synthesizeEvent(evt,{charCode:c})}return evt}})}if(dojo.isSafari){dojo.mixin(del,{_fixEvent:function(evt,sender){switch(evt.type){case"keypress":var c=evt.charCode,s=evt.shiftKey,k=evt.keyCode;k=k||identifierMap[evt.keyIdentifier]||0;if(evt.keyIdentifier=="Enter"){c=0}else{if((evt.ctrlKey)&&(c>0)&&(c<27)){c+=96}else{if(c==dojo.keys.SHIFT_TAB){c=dojo.keys.TAB;s=true}else{c=(c>=32&&c<63232?c:0)}}}return del._synthesizeEvent(evt,{charCode:c,shiftKey:s,keyCode:k})}return evt}});dojo.mixin(dojo.keys,{SHIFT_TAB:25,UP_ARROW:63232,DOWN_ARROW:63233,LEFT_ARROW:63234,RIGHT_ARROW:63235,F1:63236,F2:63237,F3:63238,F4:63239,F5:63240,F6:63241,F7:63242,F8:63243,F9:63244,F10:63245,F11:63246,F12:63247,PAUSE:63250,DELETE:63272,HOME:63273,END:63275,PAGE_UP:63276,PAGE_DOWN:63277,INSERT:63302,PRINT_SCREEN:63248,SCROLL_LOCK:63249,NUM_LOCK:63289});var dk=dojo.keys,identifierMap={Up:dk.UP_ARROW,Down:dk.DOWN_ARROW,Left:dk.LEFT_ARROW,Right:dk.RIGHT_ARROW,PageUp:dk.PAGE_UP,PageDown:dk.PAGE_DOWN}}})();if(dojo.isIE){dojo._ieDispatcher=function(args,sender){var ap=Array.prototype,h=dojo._ie_listener.handlers,c=args.callee,ls=c._listeners,t=h[c.target];var r=t&&t.apply(sender,args);for(var i in ls){if(!(i in ap)){h[ls[i]].apply(sender,args)}}return r};dojo._getIeDispatcher=function(){return new Function(dojo._scopeName+"._ieDispatcher(arguments, this)")};dojo._event_listener._fixCallback=function(fp){var f=dojo._event_listener._fixEvent;return function(e){return fp.call(this,f(e,this))}}}}if(!dojo._hasResource["dojo._base.html"]){dojo._hasResource["dojo._base.html"]=true;dojo.provide("dojo._base.html");try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}if(dojo.isIE||dojo.isOpera){dojo.byId=function(id,doc){if(dojo.isString(id)){var _d=doc||dojo.doc;var te=_d.getElementById(id);if(te&&te.attributes.id.value==id){return te}else{var eles=_d.all[id];if(!eles||!eles.length){return eles}var i=0;while((te=eles[i++])){if(te.attributes.id.value==id){return te}}}}else{return id}}}else{dojo.byId=function(id,doc){return dojo.isString(id)?(doc||dojo.doc).getElementById(id):id}}(function(){var d=dojo;var _destroyContainer=null;dojo.addOnUnload(function(){_destroyContainer=null});dojo._destroyElement=function(node){node=d.byId(node);try{if(!_destroyContainer){_destroyContainer=document.createElement("div")}_destroyContainer.appendChild(node.parentNode?node.parentNode.removeChild(node):node);_destroyContainer.innerHTML=""}catch(e){}};dojo.isDescendant=function(node,ancestor){try{node=d.byId(node);ancestor=d.byId(ancestor);while(node){if(node===ancestor){return true}node=node.parentNode}}catch(e){}return false};dojo.setSelectable=function(node,selectable){node=d.byId(node);if(d.isMozilla){node.style.MozUserSelect=selectable?"":"none"}else{if(d.isKhtml){node.style.KhtmlUserSelect=selectable?"auto":"none"}else{if(d.isIE){node.unselectable=selectable?"":"on";d.query("*",node).forEach(function(descendant){descendant.unselectable=selectable?"":"on"})}}}};var _insertBefore=function(node,ref){ref.parentNode.insertBefore(node,ref);return true};var _insertAfter=function(node,ref){var pn=ref.parentNode;if(ref==pn.lastChild){pn.appendChild(node)}else{return _insertBefore(node,ref.nextSibling)}return true};dojo.place=function(node,refNode,position){if(!node||!refNode||position===undefined){return false}node=d.byId(node);refNode=d.byId(refNode);if(typeof position=="number"){var cn=refNode.childNodes;if((position==0&&cn.length==0)||cn.length==position){refNode.appendChild(node);return true}if(position==0){return _insertBefore(node,refNode.firstChild)}return _insertAfter(node,cn[position-1])}switch(position.toLowerCase()){case"before":return _insertBefore(node,refNode);case"after":return _insertAfter(node,refNode);case"first":if(refNode.firstChild){return _insertBefore(node,refNode.firstChild)}default:refNode.appendChild(node);return true}};dojo.boxModel="content-box";if(d.isIE){var _dcm=document.compatMode;d.boxModel=_dcm=="BackCompat"||_dcm=="QuirksMode"||d.isIE<6?"border-box":"content-box"}var gcs,dv=document.defaultView;if(d.isSafari){gcs=function(node){var s=dv.getComputedStyle(node,null);if(!s&&node.style){node.style.display="";s=dv.getComputedStyle(node,null)}return s||{}}}else{if(d.isIE){gcs=function(node){return node.currentStyle}}else{gcs=function(node){return dv.getComputedStyle(node,null)}}}dojo.getComputedStyle=gcs;if(!d.isIE){dojo._toPixelValue=function(element,value){return parseFloat(value)||0}}else{dojo._toPixelValue=function(element,avalue){if(!avalue){return 0}if(avalue=="medium"){return 4}if(avalue.slice&&(avalue.slice(-2)=="px")){return parseFloat(avalue)}with(element){var sLeft=style.left;var rsLeft=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=avalue;avalue=style.pixelLeft}catch(e){avalue=0}style.left=sLeft;runtimeStyle.left=rsLeft}return avalue}}var px=d._toPixelValue;dojo._getOpacity=d.isIE?function(node){try{return node.filters.alpha.opacity/100}catch(e){return 1}}:function(node){return gcs(node).opacity};dojo._setOpacity=d.isIE?function(node,opacity){if(opacity==1){var filterRE=/FILTER:[^;]*;?/i;node.style.cssText=node.style.cssText.replace(filterRE,"");if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){i.style.cssText=i.style.cssText.replace(filterRE,"")})}}else{var o="Alpha(Opacity="+opacity*100+")";node.style.filter=o}if(node.nodeName.toLowerCase()=="tr"){d.query("> td",node).forEach(function(i){i.style.filter=o})}return opacity}:function(node,opacity){return node.style.opacity=opacity};var _pixelNamesCache={left:true,top:true};var _pixelRegExp=/margin|padding|width|height|max|min|offset/;var _toStyleValue=function(node,type,value){type=type.toLowerCase();if(d.isIE&&value=="auto"){if(type=="height"){return node.offsetHeight}if(type=="width"){return node.offsetWidth}}if(!(type in _pixelNamesCache)){_pixelNamesCache[type]=_pixelRegExp.test(type)}return _pixelNamesCache[type]?px(node,value):value};var _floatStyle=d.isIE?"styleFloat":"cssFloat";var _floatAliases={cssFloat:_floatStyle,styleFloat:_floatStyle,"float":_floatStyle};dojo.style=function(node,style,value){var n=d.byId(node),args=arguments.length,op=(style=="opacity");style=_floatAliases[style]||style;if(args==3){return op?d._setOpacity(n,value):n.style[style]=value}if(args==2&&op){return d._getOpacity(n)}var s=gcs(n);if(args==2&&!d.isString(style)){for(var x in style){d.style(node,x,style[x])}return s}return(args==1)?s:_toStyleValue(n,style,s[style])};dojo._getPadExtents=function(n,computedStyle){var s=computedStyle||gcs(n),l=px(n,s.paddingLeft),t=px(n,s.paddingTop);return{l:l,t:t,w:l+px(n,s.paddingRight),h:t+px(n,s.paddingBottom)}};dojo._getBorderExtents=function(n,computedStyle){var ne="none",s=computedStyle||gcs(n),bl=(s.borderLeftStyle!=ne?px(n,s.borderLeftWidth):0),bt=(s.borderTopStyle!=ne?px(n,s.borderTopWidth):0);return{l:bl,t:bt,w:bl+(s.borderRightStyle!=ne?px(n,s.borderRightWidth):0),h:bt+(s.borderBottomStyle!=ne?px(n,s.borderBottomWidth):0)}};dojo._getPadBorderExtents=function(n,computedStyle){var s=computedStyle||gcs(n),p=d._getPadExtents(n,s),b=d._getBorderExtents(n,s);return{l:p.l+b.l,t:p.t+b.t,w:p.w+b.w,h:p.h+b.h}};dojo._getMarginExtents=function(n,computedStyle){var s=computedStyle||gcs(n),l=px(n,s.marginLeft),t=px(n,s.marginTop),r=px(n,s.marginRight),b=px(n,s.marginBottom);if(d.isSafari&&(s.position!="absolute")){r=l}return{l:l,t:t,w:l+r,h:t+b}};dojo._getMarginBox=function(node,computedStyle){var s=computedStyle||gcs(node),me=d._getMarginExtents(node,s);var l=node.offsetLeft-me.l,t=node.offsetTop-me.t;if(d.isMoz){var sl=parseFloat(s.left),st=parseFloat(s.top);if(!isNaN(sl)&&!isNaN(st)){l=sl,t=st}else{var p=node.parentNode;if(p&&p.style){var pcs=gcs(p);if(pcs.overflow!="visible"){var be=d._getBorderExtents(p,pcs);l+=be.l,t+=be.t}}}}else{if(d.isOpera){var p=node.parentNode;if(p){var be=d._getBorderExtents(p);l-=be.l,t-=be.t}}}return{l:l,t:t,w:node.offsetWidth+me.w,h:node.offsetHeight+me.h}};dojo._getContentBox=function(node,computedStyle){var s=computedStyle||gcs(node),pe=d._getPadExtents(node,s),be=d._getBorderExtents(node,s),w=node.clientWidth,h;if(!w){w=node.offsetWidth,h=node.offsetHeight}else{h=node.clientHeight,be.w=be.h=0}if(d.isOpera){pe.l+=be.l;pe.t+=be.t}return{l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h}};dojo._getBorderBox=function(node,computedStyle){var s=computedStyle||gcs(node),pe=d._getPadExtents(node,s),cb=d._getContentBox(node,s);return{l:cb.l-pe.l,t:cb.t-pe.t,w:cb.w+pe.w,h:cb.h+pe.h}};dojo._setBox=function(node,l,t,w,h,u){u=u||"px";var s=node.style;if(!isNaN(l)){s.left=l+u}if(!isNaN(t)){s.top=t+u}if(w>=0){s.width=w+u}if(h>=0){s.height=h+u}};dojo._usesBorderBox=function(node){var n=node.tagName;return d.boxModel=="border-box"||n=="TABLE"||n=="BUTTON"};dojo._setContentSize=function(node,widthPx,heightPx,computedStyle){if(d._usesBorderBox(node)){var pb=d._getPadBorderExtents(node,computedStyle);if(widthPx>=0){widthPx+=pb.w}if(heightPx>=0){heightPx+=pb.h}}d._setBox(node,NaN,NaN,widthPx,heightPx)};dojo._setMarginBox=function(node,leftPx,topPx,widthPx,heightPx,computedStyle){var s=computedStyle||gcs(node);var bb=d._usesBorderBox(node),pb=bb?_nilExtents:d._getPadBorderExtents(node,s),mb=d._getMarginExtents(node,s);if(widthPx>=0){widthPx=Math.max(widthPx-pb.w-mb.w,0)}if(heightPx>=0){heightPx=Math.max(heightPx-pb.h-mb.h,0)}d._setBox(node,leftPx,topPx,widthPx,heightPx)};var _nilExtents={l:0,t:0,w:0,h:0};dojo.marginBox=function(node,box){var n=d.byId(node),s=gcs(n),b=box;return !b?d._getMarginBox(n,s):d._setMarginBox(n,b.l,b.t,b.w,b.h,s)};dojo.contentBox=function(node,box){var n=dojo.byId(node),s=gcs(n),b=box;return !b?d._getContentBox(n,s):d._setContentSize(n,b.w,b.h,s)};var _sumAncestorProperties=function(node,prop){if(!(node=(node||0).parentNode)){return 0}var val,retVal=0,_b=d.body();while(node&&node.style){if(gcs(node).position=="fixed"){return 0}val=node[prop];if(val){retVal+=val-0;if(node==_b){break}}node=node.parentNode}return retVal};dojo._docScroll=function(){var _b=d.body(),_w=d.global,de=d.doc.documentElement;return{y:(_w.pageYOffset||de.scrollTop||_b.scrollTop||0),x:(_w.pageXOffset||d._fixIeBiDiScrollLeft(de.scrollLeft)||_b.scrollLeft||0)}};dojo._isBodyLtr=function(){return !("_bodyLtr" in d)?d._bodyLtr=gcs(d.body()).direction=="ltr":d._bodyLtr};dojo._getIeDocumentElementOffset=function(){var de=d.doc.documentElement;return(d.isIE>=7)?{x:de.getBoundingClientRect().left,y:de.getBoundingClientRect().top}:{x:d._isBodyLtr()||window.parent==window?de.clientLeft:de.offsetWidth-de.clientWidth-de.clientLeft,y:de.clientTop}};dojo._fixIeBiDiScrollLeft=function(scrollLeft){var dd=d.doc;if(d.isIE&&!dojo._isBodyLtr()){var de=dd.compatMode=="BackCompat"?dd.body:dd.documentElement;return scrollLeft+de.clientWidth-de.scrollWidth}return scrollLeft};dojo._abs=function(node,includeScroll){var ownerDocument=node.ownerDocument;var ret={x:0,y:0};var db=d.body();if(d.isIE||(d.isFF>=3)){var client=node.getBoundingClientRect();var offset=(d.isIE)?d._getIeDocumentElementOffset():{x:0,y:0};ret.x=client.left-offset.x;ret.y=client.top-offset.y}else{if(ownerDocument.getBoxObjectFor){var bo=ownerDocument.getBoxObjectFor(node),b=d._getBorderExtents(node);ret.x=bo.x-b.l-_sumAncestorProperties(node,"scrollLeft");ret.y=bo.y-b.t-_sumAncestorProperties(node,"scrollTop")}else{if(node.offsetParent){var endNode;if(d.isSafari&&(gcs(node).position=="absolute")&&(node.parentNode==db)){endNode=db}else{endNode=db.parentNode}if(node.parentNode!=db){var nd=node;if(d.isOpera){nd=db}ret.x-=_sumAncestorProperties(nd,"scrollLeft");ret.y-=_sumAncestorProperties(nd,"scrollTop")}var curnode=node;do{var n=curnode.offsetLeft;if(!d.isOpera||n>0){ret.x+=isNaN(n)?0:n}var t=curnode.offsetTop;ret.y+=isNaN(t)?0:t;if(d.isSafari&&curnode!=node){var cs=gcs(curnode);ret.x+=px(curnode,cs.borderLeftWidth);ret.y+=px(curnode,cs.borderTopWidth)}curnode=curnode.offsetParent}while((curnode!=endNode)&&curnode)}else{if(node.x&&node.y){ret.x+=isNaN(node.x)?0:node.x;ret.y+=isNaN(node.y)?0:node.y}}}}if(includeScroll){var scroll=d._docScroll();ret.y+=scroll.y;ret.x+=scroll.x}return ret};dojo.coords=function(node,includeScroll){var n=d.byId(node),s=gcs(n),mb=d._getMarginBox(n,s);var abs=d._abs(n,includeScroll);mb.x=abs.x;mb.y=abs.y;return mb};var _fixAttrName=function(name){switch(name.toLowerCase()){case"tabindex":return(d.isIE&&d.isIE<8)?"tabIndex":"tabindex";default:return name}};var _attrProps={colspan:"colSpan",enctype:"enctype",frameborder:"frameborder",method:"method",rowspan:"rowSpan",scrolling:"scrolling",shape:"shape",span:"span",type:"type",valuetype:"valueType"};dojo.hasAttr=function(node,name){var attr=d.byId(node).getAttributeNode(_fixAttrName(name));return attr?attr.specified:false};var _evtHdlrMap={};var _ctr=0;var _attrId=dojo._scopeName+"attrid";dojo.attr=function(node,name,value){var args=arguments.length;if(args==2&&!d.isString(name)){for(var x in name){d.attr(node,x,name[x])}return }node=d.byId(node);name=_fixAttrName(name);if(args==3){if(d.isFunction(value)){var attrId=d.attr(node,_attrId);if(!attrId){attrId=_ctr++;d.attr(node,_attrId,attrId)}if(!_evtHdlrMap[attrId]){_evtHdlrMap[attrId]={}}var h=_evtHdlrMap[attrId][name];if(h){d.disconnect(h)}else{try{delete node[name]}catch(e){}}_evtHdlrMap[attrId][name]=d.connect(node,name,value)}else{if(typeof value=="boolean"){node[name]=value}else{node.setAttribute(name,value)}}return }else{var prop=_attrProps[name.toLowerCase()];if(prop){return node[prop]}else{var value=node[name];return(typeof value=="boolean"||typeof value=="function")?value:(d.hasAttr(node,name)?node.getAttribute(name):null)}}};dojo.removeAttr=function(node,name){d.byId(node).removeAttribute(_fixAttrName(name))}})();dojo.hasClass=function(node,classStr){return((" "+dojo.byId(node).className+" ").indexOf(" "+classStr+" ")>=0)};dojo.addClass=function(node,classStr){node=dojo.byId(node);var cls=node.className;if((" "+cls+" ").indexOf(" "+classStr+" ")<0){node.className=cls+(cls?" ":"")+classStr}};dojo.removeClass=function(node,classStr){node=dojo.byId(node);var t=dojo.trim((" "+node.className+" ").replace(" "+classStr+" "," "));if(node.className!=t){node.className=t}};dojo.toggleClass=function(node,classStr,condition){if(condition===undefined){condition=!dojo.hasClass(node,classStr)}dojo[condition?"addClass":"removeClass"](node,classStr)}}if(!dojo._hasResource["dojo._base.NodeList"]){dojo._hasResource["dojo._base.NodeList"]=true;dojo.provide("dojo._base.NodeList");(function(){var d=dojo;var tnl=function(arr){arr.constructor=dojo.NodeList;dojo._mixin(arr,dojo.NodeList.prototype);return arr};var _mapIntoDojo=function(func,alwaysThis){return function(){var _a=arguments;var aa=d._toArray(_a,0,[null]);var s=this.map(function(i){aa[0]=i;return d[func].apply(d,aa)});return(alwaysThis||((_a.length>1)||!d.isString(_a[0])))?this:s}};dojo.NodeList=function(){return tnl(Array.apply(null,arguments))};dojo.NodeList._wrap=tnl;dojo.extend(dojo.NodeList,{slice:function(){var a=dojo._toArray(arguments);return tnl(a.slice.apply(this,a))},splice:function(){var a=dojo._toArray(arguments);return tnl(a.splice.apply(this,a))},concat:function(){var a=dojo._toArray(arguments,0,[this]);return tnl(a.concat.apply([],a))},indexOf:function(value,fromIndex){return d.indexOf(this,value,fromIndex)},lastIndexOf:function(){return d.lastIndexOf.apply(d,d._toArray(arguments,0,[this]))},every:function(callback,thisObject){return d.every(this,callback,thisObject)},some:function(callback,thisObject){return d.some(this,callback,thisObject)},map:function(func,obj){return d.map(this,func,obj,d.NodeList)},forEach:function(callback,thisObj){d.forEach(this,callback,thisObj);return this},coords:function(){return d.map(this,d.coords)},attr:_mapIntoDojo("attr"),style:_mapIntoDojo("style"),addClass:_mapIntoDojo("addClass",true),removeClass:_mapIntoDojo("removeClass",true),toggleClass:_mapIntoDojo("toggleClass",true),connect:_mapIntoDojo("connect",true),place:function(queryOrNode,position){var item=d.query(queryOrNode)[0];return this.forEach(function(i){d.place(i,item,(position||"last"))})},orphan:function(simpleFilter){var orphans=simpleFilter?d._filterQueryResult(this,simpleFilter):this;orphans.forEach(function(item){if(item.parentNode){item.parentNode.removeChild(item)}});return orphans},adopt:function(queryOrListOrNode,position){var item=this[0];return d.query(queryOrListOrNode).forEach(function(ai){d.place(ai,item,position||"last")})},query:function(queryStr){if(!queryStr){return this}var ret=d.NodeList();this.forEach(function(item){d.query(queryStr,item).forEach(function(subItem){if(subItem!==undefined){ret.push(subItem)}})});return ret},filter:function(simpleQuery){var items=this;var _a=arguments;var r=d.NodeList();var rp=function(t){if(t!==undefined){r.push(t)}};if(d.isString(simpleQuery)){items=d._filterQueryResult(this,_a[0]);if(_a.length==1){return items}_a.shift()}d.forEach(d.filter(items,_a[0],_a[1]),rp);return r},addContent:function(content,position){var ta=d.doc.createElement("span");if(d.isString(content)){ta.innerHTML=content}else{ta.appendChild(content)}if(position===undefined){position="last"}var ct=(position=="first"||position=="after")?"lastChild":"firstChild";this.forEach(function(item){var tn=ta.cloneNode(true);while(tn[ct]){d.place(tn[ct],item,position)}});return this},empty:function(){return this.forEach("item.innerHTML='';")},instantiate:function(declaredClass,properties){var c=d.isFunction(declaredClass)?declaredClass:d.getObject(declaredClass);return this.forEach(function(i){new c(properties||{},i)})}});d.forEach(["blur","focus","click","keydown","keypress","keyup","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup"],function(evt){var _oe="on"+evt;dojo.NodeList.prototype[_oe]=function(a,b){return this.connect(_oe,a,b)}})})()}if(!dojo._hasResource["dojo._base.query"]){dojo._hasResource["dojo._base.query"]=true;dojo.provide("dojo._base.query");(function(){var d=dojo;var childNodesName=dojo.isIE?"children":"childNodes";var caseSensitive=false;var getQueryParts=function(query){if(">~+".indexOf(query.charAt(query.length-1))>=0){query+=" *"}query+=" ";var ts=function(s,e){return d.trim(query.slice(s,e))};var qparts=[];var inBrackets=-1;var inParens=-1;var inMatchFor=-1;var inPseudo=-1;var inClass=-1;var inId=-1;var inTag=-1;var lc="";var cc="";var pStart;var x=0;var ql=query.length;var currentPart=null;var _cp=null;var endTag=function(){if(inTag>=0){var tv=(inTag==x)?null:ts(inTag,x).toLowerCase();currentPart[(">~+".indexOf(tv)<0)?"tag":"oper"]=tv;inTag=-1}};var endId=function(){if(inId>=0){currentPart.id=ts(inId,x).replace(/\\/g,"");inId=-1}};var endClass=function(){if(inClass>=0){currentPart.classes.push(ts(inClass+1,x).replace(/\\/g,""));inClass=-1}};var endAll=function(){endId();endTag();endClass()};for(;lc=cc,cc=query.charAt(x),x<ql;x++){if(lc=="\\"){continue}if(!currentPart){pStart=x;currentPart={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null};inTag=x}if(inBrackets>=0){if(cc=="]"){if(!_cp.attr){_cp.attr=ts(inBrackets+1,x)}else{_cp.matchFor=ts((inMatchFor||inBrackets+1),x)}var cmf=_cp.matchFor;if(cmf){if((cmf.charAt(0)=='"')||(cmf.charAt(0)=="'")){_cp.matchFor=cmf.substring(1,cmf.length-1)}}currentPart.attrs.push(_cp);_cp=null;inBrackets=inMatchFor=-1}else{if(cc=="="){var addToCc=("|~^$*".indexOf(lc)>=0)?lc:"";_cp.type=addToCc+cc;_cp.attr=ts(inBrackets+1,x-addToCc.length);inMatchFor=x+1}}}else{if(inParens>=0){if(cc==")"){if(inPseudo>=0){_cp.value=ts(inParens+1,x)}inPseudo=inParens=-1}}else{if(cc=="#"){endAll();inId=x+1}else{if(cc=="."){endAll();inClass=x}else{if(cc==":"){endAll();inPseudo=x}else{if(cc=="["){endAll();inBrackets=x;_cp={}}else{if(cc=="("){if(inPseudo>=0){_cp={name:ts(inPseudo+1,x),value:null};currentPart.pseudos.push(_cp)}inParens=x}else{if(cc==" "&&lc!=cc){endAll();if(inPseudo>=0){currentPart.pseudos.push({name:ts(inPseudo+1,x)})}currentPart.hasLoops=(currentPart.pseudos.length||currentPart.attrs.length||currentPart.classes.length);currentPart.query=ts(pStart,x);currentPart.tag=(currentPart.oper)?null:(currentPart.tag||"*");qparts.push(currentPart);currentPart=null}}}}}}}}}return qparts};var xPathAttrs={"*=":function(attr,value){return"[contains(@"+attr+", '"+value+"')]"},"^=":function(attr,value){return"[starts-with(@"+attr+", '"+value+"')]"},"$=":function(attr,value){return"[substring(@"+attr+", string-length(@"+attr+")-"+(value.length-1)+")='"+value+"']"},"~=":function(attr,value){return"[contains(concat(' ',@"+attr+",' '), ' "+value+" ')]"},"|=":function(attr,value){return"[contains(concat(' ',@"+attr+",' '), ' "+value+"-')]"},"=":function(attr,value){return"[@"+attr+"='"+value+"']"}};var handleAttrs=function(attrList,query,getDefault,handleMatch){d.forEach(query.attrs,function(attr){var matcher;if(attr.type&&attrList[attr.type]){matcher=attrList[attr.type](attr.attr,attr.matchFor)}else{if(attr.attr.length){matcher=getDefault(attr.attr)}}if(matcher){handleMatch(matcher)}})};var buildPath=function(query){var xpath=".";var qparts=getQueryParts(d.trim(query));while(qparts.length){var tqp=qparts.shift();var prefix;var postfix="";if(tqp.oper==">"){prefix="/";tqp=qparts.shift()}else{if(tqp.oper=="~"){prefix="/following-sibling::";tqp=qparts.shift()}else{if(tqp.oper=="+"){prefix="/following-sibling::";postfix="[position()=1]";tqp=qparts.shift()}else{prefix="//"}}}xpath+=prefix+tqp.tag+postfix;if(tqp.id){xpath+="[@id='"+tqp.id+"'][1]"}d.forEach(tqp.classes,function(cn){var cnl=cn.length;var padding=" ";if(cn.charAt(cnl-1)=="*"){padding="";cn=cn.substr(0,cnl-1)}xpath+="[contains(concat(' ',@class,' '), ' "+cn+padding+"')]"});handleAttrs(xPathAttrs,tqp,function(condition){return"[@"+condition+"]"},function(matcher){xpath+=matcher})}return xpath};var _xpathFuncCache={};var getXPathFunc=function(path){if(_xpathFuncCache[path]){return _xpathFuncCache[path]}var doc=d.doc;var xpath=buildPath(path);var tf=function(parent){var ret=[];var xpathResult;try{xpathResult=doc.evaluate(xpath,parent,null,XPathResult.ANY_TYPE,null)}catch(e){console.debug("failure in exprssion:",xpath,"under:",parent);console.debug(e)}var result=xpathResult.iterateNext();while(result){ret.push(result);result=xpathResult.iterateNext()}return ret};return _xpathFuncCache[path]=tf};var _filtersCache={};var _simpleFiltersCache={};var agree=function(first,second){if(!first){return second}if(!second){return first}return function(){return first.apply(window,arguments)&&second.apply(window,arguments)}};var _childElements=function(root){var ret=[];var te,x=0,tret=root[childNodesName];while(te=tret[x++]){if(te.nodeType==1){ret.push(te)}}return ret};var _nextSiblings=function(root,single){var ret=[];var te=root;while(te=te.nextSibling){if(te.nodeType==1){ret.push(te);if(single){break}}}return ret};var _filterDown=function(element,queryParts,matchArr,idx){var nidx=idx+1;var isFinal=(queryParts.length==nidx);var tqp=queryParts[idx];if(tqp.oper){var ecn=(tqp.oper==">")?_childElements(element):_nextSiblings(element,(tqp.oper=="+"));if(!ecn||!ecn.length){return }nidx++;isFinal=(queryParts.length==nidx);var tf=getFilterFunc(queryParts[idx+1]);for(var x=0,ecnl=ecn.length,te;x<ecnl,te=ecn[x];x++){if(tf(te)){if(isFinal){matchArr.push(te)}else{_filterDown(te,queryParts,matchArr,nidx)}}}}var candidates=getElementsFunc(tqp)(element);if(isFinal){while(candidates.length){matchArr.push(candidates.shift())}}else{while(candidates.length){_filterDown(candidates.shift(),queryParts,matchArr,nidx)}}};var filterDown=function(elements,queryParts){var ret=[];var x=elements.length-1,te;while(te=elements[x--]){_filterDown(te,queryParts,ret,0)}return ret};var getFilterFunc=function(q){if(_filtersCache[q.query]){return _filtersCache[q.query]}var ff=null;if(q.tag){if(q.tag=="*"){ff=agree(ff,function(elem){return(elem.nodeType==1)})}else{ff=agree(ff,function(elem){return((elem.nodeType==1)&&(q.tag==elem.tagName.toLowerCase()))})}}if(q.id){ff=agree(ff,function(elem){return((elem.nodeType==1)&&(elem.id==q.id))})}if(q.hasLoops){ff=agree(ff,getSimpleFilterFunc(q))}return _filtersCache[q.query]=ff};var getNodeIndex=function(node){var pn=node.parentNode;var pnc=pn.childNodes;var nidx=-1;var child=pn.firstChild;if(!child){return nidx}var ci=node.__cachedIndex;var cl=pn.__cachedLength;if(((typeof cl=="number")&&(cl!=pnc.length))||(typeof ci!="number")){pn.__cachedLength=pnc.length;var idx=1;do{if(child===node){nidx=idx}if(child.nodeType==1){child.__cachedIndex=idx;idx++}child=child.nextSibling}while(child)}else{nidx=ci}return nidx};var firedCount=0;var blank="";var _getAttr=function(elem,attr){if(attr=="class"){return elem.className||blank}if(attr=="for"){return elem.htmlFor||blank}return elem.getAttribute(attr,2)||blank};var attrs={"*=":function(attr,value){return function(elem){return(_getAttr(elem,attr).indexOf(value)>=0)}},"^=":function(attr,value){return function(elem){return(_getAttr(elem,attr).indexOf(value)==0)}},"$=":function(attr,value){var tval=" "+value;return function(elem){var ea=" "+_getAttr(elem,attr);return(ea.lastIndexOf(value)==(ea.length-value.length))}},"~=":function(attr,value){var tval=" "+value+" ";return function(elem){var ea=" "+_getAttr(elem,attr)+" ";return(ea.indexOf(tval)>=0)}},"|=":function(attr,value){var valueDash=" "+value+"-";return function(elem){var ea=" "+(elem.getAttribute(attr,2)||"");return((ea==value)||(ea.indexOf(valueDash)==0))}},"=":function(attr,value){return function(elem){return(_getAttr(elem,attr)==value)}}};var pseudos={"first-child":function(name,condition){return function(elem){if(elem.nodeType!=1){return false}var fc=elem.previousSibling;while(fc&&(fc.nodeType!=1)){fc=fc.previousSibling}return(!fc)}},"last-child":function(name,condition){return function(elem){if(elem.nodeType!=1){return false}var nc=elem.nextSibling;while(nc&&(nc.nodeType!=1)){nc=nc.nextSibling}return(!nc)}},empty:function(name,condition){return function(elem){var cn=elem.childNodes;var cnl=elem.childNodes.length;for(var x=cnl-1;x>=0;x--){var nt=cn[x].nodeType;if((nt==1)||(nt==3)){return false}}return true}},contains:function(name,condition){return function(elem){return(elem.innerHTML.indexOf(condition)>=0)}},not:function(name,condition){var ntf=getFilterFunc(getQueryParts(condition)[0]);return function(elem){return(!ntf(elem))}},"nth-child":function(name,condition){var pi=parseInt;if(condition=="odd"){return function(elem){return(((getNodeIndex(elem))%2)==1)}}else{if((condition=="2n")||(condition=="even")){return function(elem){return((getNodeIndex(elem)%2)==0)}}else{if(condition.indexOf("0n+")==0){var ncount=pi(condition.substr(3));return function(elem){return(elem.parentNode[childNodesName][ncount-1]===elem)}}else{if((condition.indexOf("n+")>0)&&(condition.length>3)){var tparts=condition.split("n+",2);var pred=pi(tparts[0]);var idx=pi(tparts[1]);return function(elem){return((getNodeIndex(elem)%pred)==idx)}}else{if(condition.indexOf("n")==-1){var ncount=pi(condition);return function(elem){return(getNodeIndex(elem)==ncount)}}}}}}}};var defaultGetter=(d.isIE)?function(cond){var clc=cond.toLowerCase();return function(elem){return elem[cond]||elem[clc]}}:function(cond){return function(elem){return(elem&&elem.getAttribute&&elem.hasAttribute(cond))}};var getSimpleFilterFunc=function(query){var fcHit=(_simpleFiltersCache[query.query]||_filtersCache[query.query]);if(fcHit){return fcHit}var ff=null;if(query.id){if(query.tag!="*"){ff=agree(ff,function(elem){return(elem.tagName.toLowerCase()==query.tag)})}}d.forEach(query.classes,function(cname,idx,arr){var isWildcard=cname.charAt(cname.length-1)=="*";if(isWildcard){cname=cname.substr(0,cname.length-1)}var re=new RegExp("(?:^|\\s)"+cname+(isWildcard?".*":"")+"(?:\\s|$)");ff=agree(ff,function(elem){return re.test(elem.className)});ff.count=idx});d.forEach(query.pseudos,function(pseudo){if(pseudos[pseudo.name]){ff=agree(ff,pseudos[pseudo.name](pseudo.name,pseudo.value))}});handleAttrs(attrs,query,defaultGetter,function(tmatcher){ff=agree(ff,tmatcher)});if(!ff){ff=function(){return true}}return _simpleFiltersCache[query.query]=ff};var _getElementsFuncCache={};var getElementsFunc=function(query,root){var fHit=_getElementsFuncCache[query.query];if(fHit){return fHit}if(query.id&&!query.hasLoops&&!query.tag){return _getElementsFuncCache[query.query]=function(root){return[d.byId(query.id)]}}var filterFunc=getSimpleFilterFunc(query);var retFunc;if(query.tag&&query.id&&!query.hasLoops){retFunc=function(root){var te=d.byId(query.id);if(filterFunc(te)){return[te]}}}else{var tret;if(!query.hasLoops){retFunc=function(root){var ret=[];var te,x=0,tret=root.getElementsByTagName(query.tag);while(te=tret[x++]){ret.push(te)}return ret}}else{retFunc=function(root){var ret=[];var te,x=0,tret=root.getElementsByTagName(query.tag);while(te=tret[x++]){if(filterFunc(te)){ret.push(te)}}return ret}}}return _getElementsFuncCache[query.query]=retFunc};var _partsCache={};var _queryFuncCache={"*":d.isIE?function(root){return root.all}:function(root){return root.getElementsByTagName("*")},"~":_nextSiblings,"+":function(root){return _nextSiblings(root,true)},">":_childElements};var getStepQueryFunc=function(query){var qparts=getQueryParts(d.trim(query));if(qparts.length==1){var tt=getElementsFunc(qparts[0]);tt.nozip=true;return tt}var sqf=function(root){var localQueryParts=qparts.slice(0);var candidates;if(localQueryParts[0].oper==">"){candidates=[root]}else{candidates=getElementsFunc(localQueryParts.shift())(root)}return filterDown(candidates,localQueryParts)};return sqf};var _getQueryFunc=((document.evaluate&&!d.isSafari)?function(query){var qparts=query.split(" ");if((document.evaluate)&&(query.indexOf(":")==-1)&&(query.indexOf("+")==-1)){if(((qparts.length>2)&&(query.indexOf(">")==-1))||(qparts.length>3)||(query.indexOf("[")>=0)||((1==qparts.length)&&(0<=query.indexOf(".")))){return getXPathFunc(query)}}return getStepQueryFunc(query)}:getStepQueryFunc);var getQueryFunc=function(query){var qcz=query.charAt(0);if(d.doc.querySelectorAll&&((!d.isSafari)||(d.isSafari>3.1))&&(">+~".indexOf(qcz)==-1)){return function(root){var r=root.querySelectorAll(query);r.nozip=true;return r}}if(_queryFuncCache[query]){return _queryFuncCache[query]}if(0>query.indexOf(",")){return _queryFuncCache[query]=_getQueryFunc(query)}else{var parts=query.split(/\s*,\s*/);var tf=function(root){var pindex=0;var ret=[];var tp;while(tp=parts[pindex++]){ret=ret.concat(_getQueryFunc(tp,tp.indexOf(" "))(root))}return ret};return _queryFuncCache[query]=tf}};var _zipIdx=0;var _zip=function(arr){if(arr&&arr.nozip){return d.NodeList._wrap(arr)}var ret=new d.NodeList();if(!arr){return ret}if(arr[0]){ret.push(arr[0])}if(arr.length<2){return ret}_zipIdx++;arr[0]["_zipIdx"]=_zipIdx;for(var x=1,te;te=arr[x];x++){if(arr[x]["_zipIdx"]!=_zipIdx){ret.push(te)}te._zipIdx=_zipIdx}return ret};d.query=function(query,root){if(query.constructor==d.NodeList){return query}if(!d.isString(query)){return new d.NodeList(query)}if(d.isString(root)){root=d.byId(root)}return _zip(getQueryFunc(query)(root||d.doc))};d.query.pseudos=pseudos;d._filterQueryResult=function(nodeList,simpleFilter){var tnl=new d.NodeList();var ff=(simpleFilter)?getFilterFunc(getQueryParts(simpleFilter)[0]):function(){return true};for(var x=0,te;te=nodeList[x];x++){if(ff(te)){tnl.push(te)}}return tnl}})()}if(!dojo._hasResource["dojo._base.xhr"]){dojo._hasResource["dojo._base.xhr"]=true;dojo.provide("dojo._base.xhr");(function(){var _d=dojo;function setValue(obj,name,value){var val=obj[name];if(_d.isString(val)){obj[name]=[val,value]}else{if(_d.isArray(val)){val.push(value)}else{obj[name]=value}}}dojo.formToObject=function(formNode){var ret={};var iq="input:not([type=file]):not([type=submit]):not([type=image]):not([type=reset]):not([type=button]), select, textarea";_d.query(iq,formNode).filter(function(node){return !node.disabled&&node.name}).forEach(function(item){var _in=item.name;var type=(item.type||"").toLowerCase();if(type=="radio"||type=="checkbox"){if(item.checked){setValue(ret,_in,item.value)}}else{if(item.multiple){ret[_in]=[];_d.query("option",item).forEach(function(opt){if(opt.selected){setValue(ret,_in,opt.value)}})}else{setValue(ret,_in,item.value);if(type=="image"){ret[_in+".x"]=ret[_in+".y"]=ret[_in].x=ret[_in].y=0}}}});return ret};dojo.objectToQuery=function(map){var enc=encodeURIComponent;var pairs=[];var backstop={};for(var name in map){var value=map[name];if(value!=backstop[name]){var assign=enc(name)+"=";if(_d.isArray(value)){for(var i=0;i<value.length;i++){pairs.push(assign+enc(value[i]))}}else{pairs.push(assign+enc(value))}}}return pairs.join("&")};dojo.formToQuery=function(formNode){return _d.objectToQuery(_d.formToObject(formNode))};dojo.formToJson=function(formNode,prettyPrint){return _d.toJson(_d.formToObject(formNode),prettyPrint)};dojo.queryToObject=function(str){var ret={};var qp=str.split("&");var dec=decodeURIComponent;_d.forEach(qp,function(item){if(item.length){var parts=item.split("=");var name=dec(parts.shift());var val=dec(parts.join("="));if(_d.isString(ret[name])){ret[name]=[ret[name]]}if(_d.isArray(ret[name])){ret[name].push(val)}else{ret[name]=val}}});return ret};dojo._blockAsync=false;dojo._contentHandlers={text:function(xhr){return xhr.responseText},json:function(xhr){if(!dojo.config.usePlainJson){console.warn("Consider using mimetype:text/json-comment-filtered to avoid potential security issues with JSON endpoints (use djConfig.usePlainJson=true to turn off this message)")}return(xhr.status==204)?undefined:_d.fromJson(xhr.responseText)},"json-comment-filtered":function(xhr){var value=xhr.responseText;var cStartIdx=value.indexOf("/*");var cEndIdx=value.lastIndexOf("*/");if(cStartIdx==-1||cEndIdx==-1){throw new Error("JSON was not comment filtered")}return(xhr.status==204)?undefined:_d.fromJson(value.substring(cStartIdx+2,cEndIdx))},javascript:function(xhr){return _d.eval(xhr.responseText)},xml:function(xhr){var result=xhr.responseXML;if(_d.isIE&&(!result||window.location.protocol=="file:")){_d.forEach(["MSXML2","Microsoft","MSXML","MSXML3"],function(prefix){try{var dom=new ActiveXObject(prefix+".XMLDOM");dom.async=false;dom.loadXML(xhr.responseText);result=dom}catch(e){}})}return result}};dojo._contentHandlers["json-comment-optional"]=function(xhr){var handlers=_d._contentHandlers;try{return handlers["json-comment-filtered"](xhr)}catch(e){return handlers.json(xhr)}};dojo._ioSetArgs=function(args,canceller,okHandler,errHandler){var ioArgs={args:args,url:args.url};var formObject=null;if(args.form){var form=_d.byId(args.form);var actnNode=form.getAttributeNode("action");ioArgs.url=ioArgs.url||(actnNode?actnNode.value:null);formObject=_d.formToObject(form)}var miArgs=[{}];if(formObject){miArgs.push(formObject)}if(args.content){miArgs.push(args.content)}if(args.preventCache){miArgs.push({"dojo.preventCache":new Date().valueOf()})}ioArgs.query=_d.objectToQuery(_d.mixin.apply(null,miArgs));ioArgs.handleAs=args.handleAs||"text";var d=new _d.Deferred(canceller);d.addCallbacks(okHandler,function(error){return errHandler(error,d)});var ld=args.load;if(ld&&_d.isFunction(ld)){d.addCallback(function(value){return ld.call(args,value,ioArgs)})}var err=args.error;if(err&&_d.isFunction(err)){d.addErrback(function(value){return err.call(args,value,ioArgs)})}var handle=args.handle;if(handle&&_d.isFunction(handle)){d.addBoth(function(value){return handle.call(args,value,ioArgs)})}d.ioArgs=ioArgs;return d};var _deferredCancel=function(dfd){dfd.canceled=true;var xhr=dfd.ioArgs.xhr;var _at=typeof xhr.abort;if(_at=="function"||_at=="unknown"){xhr.abort()}var err=new Error("xhr cancelled");err.dojoType="cancel";return err};var _deferredOk=function(dfd){return _d._contentHandlers[dfd.ioArgs.handleAs](dfd.ioArgs.xhr)};var _deferError=function(error,dfd){console.debug(error);return error};var _makeXhrDeferred=function(args){var dfd=_d._ioSetArgs(args,_deferredCancel,_deferredOk,_deferError);dfd.ioArgs.xhr=_d._xhrObj(dfd.ioArgs.args);return dfd};var _inFlightIntvl=null;var _inFlight=[];var _watchInFlight=function(){var now=(new Date()).getTime();if(!_d._blockAsync){for(var i=0,tif;i<_inFlight.length&&(tif=_inFlight[i]);i++){var dfd=tif.dfd;try{if(!dfd||dfd.canceled||!tif.validCheck(dfd)){_inFlight.splice(i--,1)}else{if(tif.ioCheck(dfd)){_inFlight.splice(i--,1);tif.resHandle(dfd)}else{if(dfd.startTime){if(dfd.startTime+(dfd.ioArgs.args.timeout||0)<now){_inFlight.splice(i--,1);var err=new Error("timeout exceeded");err.dojoType="timeout";dfd.errback(err);dfd.cancel()}}}}}catch(e){console.debug(e);dfd.errback(new Error("_watchInFlightError!"))}}}if(!_inFlight.length){clearInterval(_inFlightIntvl);_inFlightIntvl=null;return }};dojo._ioCancelAll=function(){try{_d.forEach(_inFlight,function(i){i.dfd.cancel()})}catch(e){}};if(_d.isIE){_d.addOnUnload(_d._ioCancelAll)}_d._ioWatch=function(dfd,validCheck,ioCheck,resHandle){if(dfd.ioArgs.args.timeout){dfd.startTime=(new Date()).getTime()}_inFlight.push({dfd:dfd,validCheck:validCheck,ioCheck:ioCheck,resHandle:resHandle});if(!_inFlightIntvl){_inFlightIntvl=setInterval(_watchInFlight,50)}_watchInFlight()};var _defaultContentType="application/x-www-form-urlencoded";var _validCheck=function(dfd){return dfd.ioArgs.xhr.readyState};var _ioCheck=function(dfd){return 4==dfd.ioArgs.xhr.readyState};var _resHandle=function(dfd){var xhr=dfd.ioArgs.xhr;if(_d._isDocumentOk(xhr)){dfd.callback(dfd)}else{var err=new Error("Unable to load "+dfd.ioArgs.url+" status:"+xhr.status);err.status=xhr.status;err.responseText=xhr.responseText;dfd.errback(err)}};var _doIt=function(type,dfd){var ioArgs=dfd.ioArgs;var args=ioArgs.args;var xhr=ioArgs.xhr;xhr.open(type,ioArgs.url,args.sync!==true,args.user||undefined,args.password||undefined);if(args.headers){for(var hdr in args.headers){if(hdr.toLowerCase()==="content-type"&&!args.contentType){args.contentType=args.headers[hdr]}else{xhr.setRequestHeader(hdr,args.headers[hdr])}}}xhr.setRequestHeader("Content-Type",args.contentType||_defaultContentType);if(!args.headers||!args.headers["X-Requested-With"]){xhr.setRequestHeader("X-Requested-With","XMLHttpRequest")}try{xhr.send(ioArgs.query)}catch(e){dfd.cancel()}_d._ioWatch(dfd,_validCheck,_ioCheck,_resHandle);xhr=null;return dfd};dojo._ioAddQueryToUrl=function(ioArgs){if(ioArgs.query.length){ioArgs.url+=(ioArgs.url.indexOf("?")==-1?"?":"&")+ioArgs.query;ioArgs.query=null}};dojo.xhr=function(method,args,hasBody){var dfd=_makeXhrDeferred(args);if(!hasBody){_d._ioAddQueryToUrl(dfd.ioArgs)}return _doIt(method,dfd)};dojo.xhrGet=function(args){return _d.xhr("GET",args)};dojo.xhrPost=function(args){return _d.xhr("POST",args,true)};dojo.rawXhrPost=function(args){var dfd=_makeXhrDeferred(args);dfd.ioArgs.query=args.postData;return _doIt("POST",dfd)};dojo.xhrPut=function(args){return _d.xhr("PUT",args,true)};dojo.rawXhrPut=function(args){var dfd=_makeXhrDeferred(args);var ioArgs=dfd.ioArgs;if(args.putData){ioArgs.query=args.putData;args.putData=null}return _doIt("PUT",dfd)};dojo.xhrDelete=function(args){return _d.xhr("DELETE",args)}})()}if(!dojo._hasResource["dojo._base.fx"]){dojo._hasResource["dojo._base.fx"]=true;dojo.provide("dojo._base.fx");(function(){var d=dojo;dojo._Line=function(start,end){this.start=start;this.end=end;this.getValue=function(n){return((this.end-this.start)*n)+this.start}};d.declare("dojo._Animation",null,{constructor:function(args){d.mixin(this,args);if(d.isArray(this.curve)){this.curve=new d._Line(this.curve[0],this.curve[1])}},duration:350,repeat:0,rate:10,_percent:0,_startRepeatCount:0,_fire:function(evt,args){try{if(this[evt]){this[evt].apply(this,args||[])}}catch(e){console.error("exception in animation handler for:",evt);console.error(e)}return this},play:function(delay,gotoStart){var _t=this;if(gotoStart){_t._stopTimer();_t._active=_t._paused=false;_t._percent=0}else{if(_t._active&&!_t._paused){return _t}}_t._fire("beforeBegin");var de=delay||_t.delay;var _p=dojo.hitch(_t,"_play",gotoStart);if(de>0){setTimeout(_p,de);return _t}_p();return _t},_play:function(gotoStart){var _t=this;_t._startTime=new Date().valueOf();if(_t._paused){_t._startTime-=_t.duration*_t._percent}_t._endTime=_t._startTime+_t.duration;_t._active=true;_t._paused=false;var value=_t.curve.getValue(_t._percent);if(!_t._percent){if(!_t._startRepeatCount){_t._startRepeatCount=_t.repeat}_t._fire("onBegin",[value])}_t._fire("onPlay",[value]);_t._cycle();return _t},pause:function(){this._stopTimer();if(!this._active){return this}this._paused=true;this._fire("onPause",[this.curve.getValue(this._percent)]);return this},gotoPercent:function(percent,andPlay){this._stopTimer();this._active=this._paused=true;this._percent=percent;if(andPlay){this.play()}return this},stop:function(gotoEnd){if(!this._timer){return this}this._stopTimer();if(gotoEnd){this._percent=1}this._fire("onStop",[this.curve.getValue(this._percent)]);this._active=this._paused=false;return this},status:function(){if(this._active){return this._paused?"paused":"playing"}return"stopped"},_cycle:function(){var _t=this;if(_t._active){var curr=new Date().valueOf();var step=(curr-_t._startTime)/(_t._endTime-_t._startTime);if(step>=1){step=1}_t._percent=step;if(_t.easing){step=_t.easing(step)}_t._fire("onAnimate",[_t.curve.getValue(step)]);if(_t._percent<1){_t._startTimer()}else{_t._active=false;if(_t.repeat>0){_t.repeat--;_t.play(null,true)}else{if(_t.repeat==-1){_t.play(null,true)}else{if(_t._startRepeatCount){_t.repeat=_t._startRepeatCount;_t._startRepeatCount=0}}}_t._percent=0;_t._fire("onEnd");_t._stopTimer()}}return _t}});var ctr=0;var _globalTimerList=[];var runner={run:function(){}};var timer=null;dojo._Animation.prototype._startTimer=function(){if(!this._timer){this._timer=d.connect(runner,"run",this,"_cycle");ctr++}if(!timer){timer=setInterval(d.hitch(runner,"run"),this.rate)}};dojo._Animation.prototype._stopTimer=function(){if(this._timer){d.disconnect(this._timer);this._timer=null;ctr--}if(ctr<=0){clearInterval(timer);timer=null;ctr=0}};var _makeFadeable=(d.isIE)?function(node){var ns=node.style;if(!ns.zoom.length&&d.style(node,"zoom")=="normal"){ns.zoom="1"}if(!ns.width.length&&d.style(node,"width")=="auto"){ns.width="auto"}}:function(){};dojo._fade=function(args){args.node=d.byId(args.node);var fArgs=d.mixin({properties:{}},args);var props=(fArgs.properties.opacity={});props.start=!("start" in fArgs)?function(){return Number(d.style(fArgs.node,"opacity"))}:fArgs.start;props.end=fArgs.end;var anim=d.animateProperty(fArgs);d.connect(anim,"beforeBegin",d.partial(_makeFadeable,fArgs.node));return anim};dojo.fadeIn=function(args){return d._fade(d.mixin({end:1},args))};dojo.fadeOut=function(args){return d._fade(d.mixin({end:0},args))};dojo._defaultEasing=function(n){return 0.5+((Math.sin((n+1.5)*Math.PI))/2)};var PropLine=function(properties){this._properties=properties;for(var p in properties){var prop=properties[p];if(prop.start instanceof d.Color){prop.tempColor=new d.Color()}}this.getValue=function(r){var ret={};for(var p in this._properties){var prop=this._properties[p];var start=prop.start;if(start instanceof d.Color){ret[p]=d.blendColors(start,prop.end,r,prop.tempColor).toCss()}else{if(!d.isArray(start)){ret[p]=((prop.end-start)*r)+start+(p!="opacity"?prop.units||"px":"")}}}return ret}};dojo.animateProperty=function(args){args.node=d.byId(args.node);if(!args.easing){args.easing=d._defaultEasing}var anim=new d._Animation(args);d.connect(anim,"beforeBegin",anim,function(){var pm={};for(var p in this.properties){if(p=="width"||p=="height"){this.node.display="block"}var prop=this.properties[p];prop=pm[p]=d.mixin({},(d.isObject(prop)?prop:{end:prop}));if(d.isFunction(prop.start)){prop.start=prop.start()}if(d.isFunction(prop.end)){prop.end=prop.end()}var isColor=(p.toLowerCase().indexOf("color")>=0);function getStyle(node,p){var v=({height:node.offsetHeight,width:node.offsetWidth})[p];if(v!==undefined){return v}v=d.style(node,p);return(p=="opacity")?Number(v):(isColor?v:parseFloat(v))}if(!("end" in prop)){prop.end=getStyle(this.node,p)}else{if(!("start" in prop)){prop.start=getStyle(this.node,p)}}if(isColor){prop.start=new d.Color(prop.start);prop.end=new d.Color(prop.end)}else{prop.start=(p=="opacity")?Number(prop.start):parseFloat(prop.start)}}this.curve=new PropLine(pm)});d.connect(anim,"onAnimate",anim,function(propValues){for(var s in propValues){d.style(this.node,s,propValues[s])}});return anim};dojo.anim=function(node,properties,duration,easing,onEnd,delay){return d.animateProperty({node:node,duration:duration||d._Animation.prototype.duration,properties:properties,easing:easing,onEnd:onEnd}).play(delay||0)}})()}if(!dojo._hasResource["dojo._base.browser"]){dojo._hasResource["dojo._base.browser"]=true;dojo.provide("dojo._base.browser");if(!dojo._hasResource["dojo.io.iframe"]){dojo._hasResource["dojo.io.iframe"]=true;dojo.provide("dojo.io.iframe");dojo.io.iframe={create:function(fname,onloadstr,uri){if(window[fname]){return window[fname]}if(window.frames[fname]){return window.frames[fname]}var cframe=null;var turi=uri;if(!turi){if(dojo.config.useXDomain&&!dojo.config.dojoBlankHtmlUrl){console.debug("dojo.io.iframe.create: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html")}turi=(dojo.config.dojoBlankHtmlUrl||dojo.moduleUrl("dojo","resources/blank.html"))}var ifrstr=dojo.isIE?'<iframe name="'+fname+'" src="'+turi+'" onload="'+onloadstr+'">':"iframe";cframe=dojo.doc.createElement(ifrstr);with(cframe){name=fname;setAttribute("name",fname);id=fname}dojo.body().appendChild(cframe);window[fname]=cframe;with(cframe.style){if(dojo.isSafari<3){position="absolute"}left=top="1px";height=width="1px";visibility="hidden"}if(!dojo.isIE){this.setSrc(cframe,turi,true);cframe.onload=new Function(onloadstr)}return cframe},setSrc:function(iframe,src,replace){try{if(!replace){if(dojo.isSafari){iframe.location=src}else{frames[iframe.name].location=src}}else{var idoc;if(dojo.isIE||dojo.isSafari>2){idoc=iframe.contentWindow.document}else{if(dojo.isSafari){idoc=iframe.document}else{idoc=iframe.contentWindow}}if(!idoc){iframe.location=src;return }else{idoc.location.replace(src)}}}catch(e){console.debug("dojo.io.iframe.setSrc: ",e)}},doc:function(iframeNode){var doc=iframeNode.contentDocument||(((iframeNode.name)&&(iframeNode.document)&&(document.getElementsByTagName("iframe")[iframeNode.name].contentWindow)&&(document.getElementsByTagName("iframe")[iframeNode.name].contentWindow.document)))||((iframeNode.name)&&(document.frames[iframeNode.name])&&(document.frames[iframeNode.name].document))||null;return doc},send:function(args){if(!this["_frame"]){this._frame=this.create(this._iframeName,dojo._scopeName+".io.iframe._iframeOnload();")}var dfd=dojo._ioSetArgs(args,function(dfd){dfd.canceled=true;dfd.ioArgs._callNext()},function(dfd){var value=null;try{var ioArgs=dfd.ioArgs;var dii=dojo.io.iframe;var ifd=dii.doc(dii._frame);var handleAs=ioArgs.handleAs;value=ifd;if(handleAs!=""){value=ifd.getElementsByTagName("textarea")[0].value;if(handleAs=="json"){value=dojo.fromJson(value)}else{if(handleAs=="javascript"){value=dojo.eval(value)}}}}catch(e){value=e}finally{ioArgs._callNext()}return value},function(error,dfd){dfd.ioArgs._hasError=true;dfd.ioArgs._callNext();return error});dfd.ioArgs._callNext=function(){if(!this["_calledNext"]){this._calledNext=true;dojo.io.iframe._currentDfd=null;dojo.io.iframe._fireNextRequest()}};this._dfdQueue.push(dfd);this._fireNextRequest();dojo._ioWatch(dfd,function(dfd){return !dfd.ioArgs._hasError},function(dfd){return(!!dfd.ioArgs._finished)},function(dfd){if(dfd.ioArgs._finished){dfd.callback(dfd)}else{dfd.errback(new Error("Invalid dojo.io.iframe request state"))}});return dfd},_currentDfd:null,_dfdQueue:[],_iframeName:dojo._scopeName+"IoIframe",_fireNextRequest:function(){try{if((this._currentDfd)||(this._dfdQueue.length==0)){return }var dfd=this._currentDfd=this._dfdQueue.shift();var ioArgs=dfd.ioArgs;var args=ioArgs.args;ioArgs._contentToClean=[];var fn=dojo.byId(args.form);var content=args.content||{};if(fn){if(content){for(var x in content){if(!fn[x]){var tn;if(dojo.isIE){tn=dojo.doc.createElement("<input type='hidden' name='"+x+"'>")}else{tn=dojo.doc.createElement("input");tn.type="hidden";tn.name=x}tn.value=content[x];fn.appendChild(tn);ioArgs._contentToClean.push(x)}else{fn[x].value=content[x]}}}var actnNode=fn.getAttributeNode("action");var mthdNode=fn.getAttributeNode("method");var trgtNode=fn.getAttributeNode("target");if(args.url){ioArgs._originalAction=actnNode?actnNode.value:null;if(actnNode){actnNode.value=args.url}else{fn.setAttribute("action",args.url)}}if(!mthdNode||!mthdNode.value){if(mthdNode){mthdNode.value=(args.method)?args.method:"post"}else{fn.setAttribute("method",(args.method)?args.method:"post")}}ioArgs._originalTarget=trgtNode?trgtNode.value:null;if(trgtNode){trgtNode.value=this._iframeName}else{fn.setAttribute("target",this._iframeName)}fn.target=this._iframeName;fn.submit()}else{var tmpUrl=args.url+(args.url.indexOf("?")>-1?"&":"?")+ioArgs.query;this.setSrc(this._frame,tmpUrl,true)}}catch(e){dfd.errback(e)}},_iframeOnload:function(){var dfd=this._currentDfd;if(!dfd){this._fireNextRequest();return }var ioArgs=dfd.ioArgs;var args=ioArgs.args;var fNode=dojo.byId(args.form);if(fNode){var toClean=ioArgs._contentToClean;for(var i=0;i<toClean.length;i++){var key=toClean[i];if(dojo.isSafari<3){for(var j=0;j<fNode.childNodes.length;j++){var chNode=fNode.childNodes[j];if(chNode.name==key){dojo._destroyElement(chNode);break}}}else{dojo._destroyElement(fNode[key]);fNode[key]=null}}if(ioArgs._originalAction){fNode.setAttribute("action",ioArgs._originalAction)}if(ioArgs._originalTarget){fNode.setAttribute("target",ioArgs._originalTarget);fNode.target=ioArgs._originalTarget}}ioArgs._finished=true}}}if(!dojo._hasResource["dojo.date"]){dojo._hasResource["dojo.date"]=true;dojo.provide("dojo.date");dojo.date.getDaysInMonth=function(dateObject){var month=dateObject.getMonth();var days=[31,28,31,30,31,30,31,31,30,31,30,31];if(month==1&&dojo.date.isLeapYear(dateObject)){return 29}return days[month]};dojo.date.isLeapYear=function(dateObject){var year=dateObject.getFullYear();return !(year%400)||(!(year%4)&&!!(year%100))};dojo.date.getTimezoneName=function(dateObject){var str=dateObject.toString();var tz="";var match;var pos=str.indexOf("(");if(pos>-1){tz=str.substring(++pos,str.indexOf(")"));var split=tz.split(" ");if(split.length>1){tz="";for(var i=0;i<split.length;i++){tz+=split[i][0]}tz=tz.toUpperCase()}}else{var pat=/([A-Z\/]+) \d{4}$/;if((match=str.match(pat))){tz=match[1]}else{str=dateObject.toLocaleString();pat=/ ([A-Z\/]+)$/;if((match=str.match(pat))){tz=match[1]}}}return(tz=="AM"||tz=="PM")?"":tz};dojo.date.compare=function(date1,date2,portion){date1=new Date(Number(date1));date2=new Date(Number(date2||new Date()));if(portion!=="undefined"){if(portion=="date"){date1.setHours(0,0,0,0);date2.setHours(0,0,0,0)}else{if(portion=="time"){date1.setFullYear(0,0,0);date2.setFullYear(0,0,0)}}}if(date1>date2){return 1}if(date1<date2){return -1}return 0};dojo.date.add=function(date,interval,amount){var sum=new Date(Number(date));var fixOvershoot=false;var property="Date";switch(interval){case"day":break;case"weekday":var days,weeks;var mod=amount%5;if(!mod){days=(amount>0)?5:-5;weeks=(amount>0)?((amount-5)/5):((amount+5)/5)}else{days=mod;weeks=parseInt(amount/5)}var strt=date.getDay();var adj=0;if(strt==6&&amount>0){adj=1}else{if(strt==0&&amount<0){adj=-1}}var trgt=strt+days;if(trgt==0||trgt==6){adj=(amount>0)?2:-2}amount=(7*weeks)+days+adj;break;case"year":property="FullYear";fixOvershoot=true;break;case"week":amount*=7;break;case"quarter":amount*=3;case"month":fixOvershoot=true;property="Month";break;case"hour":case"minute":case"second":case"millisecond":property="UTC"+interval.charAt(0).toUpperCase()+interval.substring(1)+"s"}if(property){sum["set"+property](sum["get"+property]()+amount)}if(fixOvershoot&&(sum.getDate()<date.getDate())){sum.setDate(0)}return sum};dojo.date.difference=function(date1,date2,interval){date2=date2||new Date();interval=interval||"day";var yearDiff=date2.getFullYear()-date1.getFullYear();var delta=1;switch(interval){case"quarter":var m1=date1.getMonth();var m2=date2.getMonth();var q1=Math.floor(m1/3)+1;var q2=Math.floor(m2/3)+1;q2+=(yearDiff*4);delta=q2-q1;break;case"weekday":var days=Math.round(dojo.date.difference(date1,date2,"day"));var weeks=parseInt(dojo.date.difference(date1,date2,"week"));var mod=days%7;if(mod==0){days=weeks*5}else{var adj=0;var aDay=date1.getDay();var bDay=date2.getDay();weeks=parseInt(days/7);mod=days%7;var dtMark=new Date(date1);dtMark.setDate(dtMark.getDate()+(weeks*7));var dayMark=dtMark.getDay();if(days>0){switch(true){case aDay==6:adj=-1;break;case aDay==0:adj=0;break;case bDay==6:adj=-1;break;case bDay==0:adj=-2;break;case (dayMark+mod)>5:adj=-2}}else{if(days<0){switch(true){case aDay==6:adj=0;break;case aDay==0:adj=1;break;case bDay==6:adj=2;break;case bDay==0:adj=1;break;case (dayMark+mod)<0:adj=2}}}days+=adj;days-=(weeks*2)}delta=days;break;case"year":delta=yearDiff;break;case"month":delta=(date2.getMonth()-date1.getMonth())+(yearDiff*12);break;case"week":delta=parseInt(dojo.date.difference(date1,date2,"day")/7);break;case"day":delta/=24;case"hour":delta/=60;case"minute":delta/=60;case"second":delta/=1000;case"millisecond":delta*=date2.getTime()-date1.getTime()}return Math.round(delta)}}if(dojo.config.require){dojo.forEach(dojo.config.require,"dojo['require'](item);")}}if(dojo.config.afterOnLoad&&dojo.isBrowser){window.setTimeout(dojo._fakeLoadInit,1000)}})();var hyperic={};hyperic.widget={};hyperic.help={};var h=hyperic;var d=document;var refInt=90;var id1=149;var objIdx=-1;var objs=[];var cprop={expires:1};function buildPage(G){for(C=0;C<objs.length;C++){objs[C].cleanup();objs[C]=null}objs=[];objIdx=-1;hyperic.widget.tooltip.cleanup();dojo.byId("overallSummary").innerHTML="";var E=hyperic.widget.tempNode;for(var B in G.page.dashboard.providers){if(typeof (G.page.dashboard.providers[B])!=="function"){tmp_id="overall_"+G.page.dashboard.providers[B].code.toLowerCase()+"_summary";E.innerHTML='<div id="'+tmp_id+'"><h1 class="title" onclick="changeTabs(\''+G.page.dashboard.providers[B].code.toLowerCase()+"')\">"+G.page.dashboard.providers[B].longName+"</h1></div>";dojo.byId("overallSummary").appendChild(E.firstChild);for(var C in G.page.dashboard.providers[B].strips){if(typeof (G.page.dashboard.providers[B].strips[C])!=="function"){if(G.page.dashboard.providers[B].strips[C].stripType=="health"){objs[++objIdx]=new hyperic.widget.Health(tmp_id,G.page.dashboard.providers[B].strips[C],true)}else{charts_container_id=(++id1)+"_charts";E.innerHTML='<div id="'+charts_container_id+'"></div>';dojo.byId(tmp_id).appendChild(E.firstChild);for(chart in G.page.dashboard.providers[B].strips[C].charts){if(typeof (G.page.dashboard.providers[B].strips[C].charts[chart])!=="function"){objs[++objIdx]=new hyperic.widget.Chart(charts_container_id,G.page.dashboard.providers[B].strips[C].charts[chart],"cso",chart+"_"+B+"_"+C,"dashboard");if(activeTab.id=="cso"){objs[objIdx].showChart("cso")}}}E.innerHTML='<div style="clear: both;"></div>';dojo.byId(charts_container_id).appendChild(E.firstChild);delete charts_container_id}}}tmp_id=null}}delete E;for(var B in G.page.svcSummaryTab){if(typeof (G.page.svcSummaryTab[B])!=="function"){dojo.byId(B.toLowerCase()+"_summary").innerHTML="";for(var C in G.page.svcSummaryTab[B]){if(typeof (G.page.svcSummaryTab[B][C])!=="function"){objs[++objIdx]=new hyperic.widget.Health(B.toLowerCase()+"_summary",G.page.svcSummaryTab[B][C],true)}}}}data=G.page.detailedDataTab;for(C in data){if(!0[C]){if(data[C].health){dojo.byId(C.toLowerCase()+"_health").innerHTML="";objs[++objIdx]=new hyperic.widget.Health(C.toLowerCase()+"_health",data[C].health,false)}else{dojo.byId(C.toLowerCase()+"_health_section").style.display="none"}var D=data[C].charts.length<6?data[C].charts.length:6;if(D>0){dojo.byId(C.toLowerCase()+"_chartCont").innerHTML="";for(var B=0;B<D;B++){var F=null;if(data[C].charts[B].style!==undefined&&data[C].charts[B].style=="skinny"){F="skinny"}else{if(D==1||(B==D-1&&D%2)){F="single"}else{F="double"}}objs[++objIdx]=new hyperic.widget.Chart(C.toLowerCase()+"_chartCont",data[C].charts[B],C.toLowerCase(),B+1,F)}}else{dojo.byId(C.toLowerCase()+"_performance_section").style.display="none"}if(data[C].table.length>0){dojo.byId(C.toLowerCase()+"_table").innerHTML="";for(var A=0;A<data[C].table.length;A++){objs[++objIdx]=new hyperic.widget.Table(C.toLowerCase()+"_table",data[C].table[A])}}else{dojo.byId(C.toLowerCase()+"_metrics_section").style.display="none"}}}if(activeTab.id=="cso"){return }dojo.byId("cso").className="tab";dojo.byId("cso_tab").style.display="none";dojo.byId(activeTab.id).className="activeTab";dojo.byId(activeTab.id+"_tab").style.display="";dojo.publish("tabchange",[activeTab.id])}function loadData(){d.status.startUpdate();dojo.xhrGet({url:"data/data.json?"+new Date().getTime(),handleAs:"json-comment-filtered",load:function(A){buildPage(A);d.status.endUpdate();hyperic.widget.tooltip.init({tipElements:["div"],document:false,baseNodeId:"tt"})}})}dojo.addOnLoad(function(){window.activeTab=hyperic.cookie("tab");if(window.activeTab){window.activeTab=dojo.byId(window.activeTab);if(window.activeTab==null){window.activeTab="cso";hyperic.cookie("tab",window.activeTab,cprop);window.activeTab=dojo.byId(window.activeTab)}}else{window.activeTab="cso";hyperic.cookie("tab",window.activeTab,cprop);window.activeTab=dojo.byId(window.activeTab)}d.status=hyperic.widget.StatusElement("ct","nt","status","update",refInt);loadData();setInterval(loadData,refInt*1000)});function changeTabs(B){if(typeof B==="string"){B=dojo.byId(B)}if(B==activeTab){return }activeTab.className="tab";var A=activeTab.id+"_tab";dojo.byId(A).style.display="none";activeTab=B;activeTab.className="activeTab";A=activeTab.id+"_tab";dojo.byId(A).style.display="block";hyperic.cookie("tab",activeTab.id,cprop);dojo.publish("tabchange",[activeTab.id])}var init1="\x2D\x2D\x2D\x2D\x2D\x20\x43\x6C\x6F\x75\x64\x53\x74\x61\x74\x75\x73\x20\x44\x65\x76\x20\x54\x65\x61\x6D\x20\x2D\x2D\x2D\x2D\x2D\x0a\x0d\x45\x6C\x20\x4A\x65\x66\x65\x20\x2D\x20\x43\x68\x61\x72\x6C\x65\x73\x20\x4C\x65\x65\x0a\x0d\x55\x73\x65\x72\x20\x49\x6E\x74\x65\x72\x66\x61\x63\x65\x20\x2D\x20\x52\x69\x63\x68\x61\x72\x64\x20\x50\x61\x63\x6B\x0a\x0d\x50\x6C\x75\x67\x69\x6E\x73\x20\x26\x20\x50\x72\x6F\x74\x6F\x74\x79\x70\x65\x20\x2D\x20\x44\x6F\x75\x67\x20\x4D\x61\x63\x45\x61\x63\x68\x65\x72\x6E\x0a\x0d\x45\x43\x32\x20\x50\x6C\x75\x67\x69\x6E\x20\x26\x20\x50\x72\x6F\x74\x6F\x74\x79\x70\x65\x20\x2D\x20\x4A\x6F\x68\x6E\x20\x54\x72\x61\x76\x69\x73\x0a\x0d\x46\x50\x53\x20\x50\x6C\x75\x67\x69\x6E\x20\x2D\x20\x52\x79\x61\x6E\x20\x4D\x6F\x72\x67\x61\x6E\x0a\x0d\x53\x33\x20\x20\x50\x6C\x75\x67\x69\x6E\x2D\x20\x47\x65\x72\x61\x72\x64\x6F\x20\x56\x69\x65\x64\x6D\x61\x0a\x0d\x47\x6C\x75\x65\x2C\x20\x53\x44\x42\x20\x50\x6C\x75\x67\x69\x6E\x20\x2D\x20\x53\x63\x6F\x74\x74\x20\x46\x65\x6C\x64\x73\x74\x65\x69\x6E\x0a\x0d\x53\x51\x53\x20\x50\x6C\x75\x67\x69\x6E\x20\x2D\x20\x54\x6F\x6D\x20\x4B\x65\x65\x6E\x65\x79\x0a\x0d\x51\x41\x20\x2D\x20\x4B\x61\x73\x68\x79\x61\x70\x20\x50\x61\x72\x69\x6B\x68\x0a\x0d\x51\x41\x20\x2D\x20\x4E\x69\x70\x75\x6E\x61\x20\x42\x68\x61\x79\x61\x6E\x69\x0a\x0d\x51\x41\x20\x26\x20\x50\x65\x72\x66\x6F\x72\x6D\x61\x6E\x63\x65\x20\x2D\x20\x4D\x69\x6B\x65\x20\x4D\x65\x6E\x6E\x69\x73\x0a\x0d\x44\x6F\x63\x73\x20\x2D\x20\x4D\x61\x72\x69\x65\x20\x4D\x63\x47\x61\x72\x72\x79\x0a\x0d\x4E\x69\x67\x68\x74\x20\x61\x6E\x64\x20\x57\x65\x65\x6B\x65\x6E\x64\x20\x4D\x6F\x74\x69\x76\x61\x74\x69\x6F\x6E\x20\x2D\x20\x50\x61\x75\x6C\x20\x4D\x65\x6C\x6D\x6F\x6E";h.widget.tempNode=dojo.byId("z");hyperic.widget.Health=function(B,C,A){var D=this;D.parendNodeId=B;D.id=++id1;D.isDetail=A;D.connects=[];D.title=C.n;D.legend="";D.data=C.d;D.statusMsg=C.sm;D.shortname=C.sn.toLowerCase();var E=new Date(C.startMillis);var F=new Date(C.endMillis);D.template='<div class="rle-box" id="'+D.id+'_health"><div class="roll-title"> <span class="left" id="'+D.id+'_roll_title">'+C.n+'</span><span class="rle-cs">'+C.nm+'</span></div><div class="both"></div><div class="rle-cont"><div class="rle-data" id="'+D.id+'_data"></div><div class="rle-now '+C.cs+'Avail" id="ec2_now">&nbsp;</div><div class="rle-rule"></div><div class="rle-legend" id="'+D.id+'_legend"><span class="ll">'+E.formatDate("M/d HH:mm z")+'</span><span class="rl">'+F.formatDate("M/d HH:mm z")+'</span></div></div><div style="clear:both"></div><div class="rle-more" id="'+D.id+'_more" style="display:none"><a href="javascript:void(0)" onclick="changeTabs(\''+D.shortname+'\');">more detail</a></div><div class="rle-status" id="'+D.id+'_status"></div><div style="clear:both"></div></div></div>';D.create=function(){var G=hyperic.widget.tempNode;G.innerHTML=D.template;D.appendNode=dojo.byId(B);D.titleNode=dojo.byId(D.id+"_roll_title");D.legendNode=dojo.byId(D.id+"_legend");D.node=dojo.byId(D.id+"_health");D.moreNode=dojo.byId(D.id+"_more");dojo.byId(D.id+"_data").innerHTML=D.createHealthData(D.data);dojo.byId(D.id+"_status").innerHTML=D.createStatus(D.statusMsg);D.connects[0]=dojo.connect(D.node,"onmouseenter",D,"onMouseOver");D.connects[1]=dojo.connect(D.node,"onmouseleave",D,"onMouseOut");dojo.byId(B).appendChild(G.firstChild)};D.createStatus=function(J){var I="";var H="";if(J){I="<ul>";for(var G=0;G<J.length;G++){console.log(J[G]);H=new Date(J[G].timeMillis).formatDate("M/d HH:mm z");I+="<li>"+H+" : ";if(J[G].url){I+='<a href="'+J[G].url+'">'+J[G].msg+"</a>"}else{I+=J[G].msg}H="";I+="</li>"}I+="</ul>"}return I};D.createHealthData=function(K){var J=new Date(K[0].startMillis);var H=i_range_end=null;var I='<div class="bg '+K[0].s+'Left" style="width:4px" title="'+J.formatDate("M/d HH:mm z")+'"></div>';for(var G=0;G<K.length;G++){H=new Date(K[G].startMillis);i_range_end=new Date(K[G].endMillis);I+='<div class="bg '+K[G].s+'" style="width:'+(K[G].w*0.98)+'%" title="'+H.formatDate("M/d HH:mm")+" &#8594; "+i_range_end.formatDate("M/d HH:mm z")+'"></div>';H=i_range_end=null}var L=new Date(K[K.length-1].endMillis);I+='<div class="bg '+K[K.length-1].s+'Right" style="width:4px" title="'+L.formatDate("M/d HH:mm z")+'"></div>';delete J;delete L;return I};D.onMouseOver=function(){if(dojo.isIE===6){D.node.className+=" rle-over"}if(D.isDetail){D.moreNode.style.display="block"}};D.onMouseOut=function(){if(dojo.isIE===6){D.node.className="rle-box"}if(D.isDetail){D.moreNode.style.display="none"}};D.cleanup=function(){D.node=null;D.titleNode=null;D.legendNode=null;D.moreNode=null;D.appendNode=null;dojo.disconnect(D.connects[0]);dojo.disconnect(D.connects[1])};this.create()};hyperic.widget.Table=function(E,B){var D='<div><div class="tTitle">'+B.label+'</div><table id="aws_table"><thead><tr><td class="tRight"></td>';var C="</tr></thead><tbody>";var A="</tbody></table><div>";this.create=function(H,G){this.node=dojo.byId(H);var F=D+this.createHeader(G.header)+C+this.createBody(G.data)+A;var I=hyperic.widget.tempNode;I.innerHTML=F;this.node.appendChild(I.firstChild);I.innerHTML="";I=null};this.createHeader=function(H){var F="";for(var G=0;G<H.length;G++){F+="<td>"+H[G]+"</td>"}return F};this.createBody=function(I){var G="";for(var H=0;H<I.length;H++){G+=H%2!==0?"<tr>":'<tr class="alternate">';for(var F=0;F<I[H].length;F++){if(F===0){G+='<td class="tRight">'+I[H][F]+"</td>"}else{G+="<td>"+I[H][F]+"</td>"}}G+="</td>"}return G};this.cleanup=function(){this.node=null};this.create(E,B)};hyperic.widget.Chart=function(E,B,A,F,C){var D=this;D.subscriptions=[];D.create=function(J,H,G,M){var L="";if(C){switch(C){case"single":L="chartW";break;case"dashboard":L="chartS";break;case"skinny":L="chartT";break;default:L="chart";break}}var I='<div class="chartCont"> <div class="cTitle">'+H.chartName+'</div><div id="'+G+"_chart"+M+'" class="'+L+'"></div><div class="xlegend"></div></div>';D.template=I;D.tabid=G;var K=dojo.byId("z");D.chartName=H.chartName;K.innerHTML=I;dojo.byId(J).appendChild(K.firstChild);D.url=H.url;D.chartPos=M;D.node=dojo.byId(G);D.subscriptions[0]=dojo.subscribe("tabchange",D,"showChart");K=null};D.showChart=function(G){if(G==D.tabid){if(!D.isShowing){var J=new Timeplot.DefaultEventSource();var I=null;if(C=="dashboard"){I=[Timeplot.createPlotInfo({id:"plot1",dataSource:new Timeplot.ColumnSource(J,1),valueGeometry:new Timeplot.DefaultValueGeometry({axisLabelsPlacement:"left"}),timeGeometry:new Timeplot.DefaultTimeGeometry({axisLabelsPlacement:"bottom"}),showValues:false,lineColor:"#00EB08",roundValues:false,fillColor:"#D0FFD2"})]}else{I=[Timeplot.createPlotInfo({id:"plot1",dataSource:new Timeplot.ColumnSource(J,1),valueGeometry:new Timeplot.DefaultValueGeometry({gridColor:"#000000",axisLabelsPlacement:"left"}),timeGeometry:new Timeplot.DefaultTimeGeometry({gridColor:new Timeplot.Color("#DDDDDD"),axisLabelsPlacement:"bottom"}),showValues:true,lineColor:"#00EB08",roundValues:false,fillColor:"#D0FFD2"})]}var H=Timeplot.create(dojo.byId(G+"_chart"+D.chartPos),I);H.loadText(D.url,",",J);D.isShowing=true;H=null}}};this.cleanup=function(){dojo.unsubscribe(D.subscriptions[0]);D.node=null};D.isShowing=false;this.create(E,B,A,F)};hyperic.widget.StatusElement=function(D,C,A,F,B){var E=this;E.ctNode=dojo.byId(D);E.ntNode=dojo.byId(C);E.sNode=dojo.byId(A);E.uNode=dojo.byId(F);E.interval=null;E.time=B;E.refInterval=B;E.startUpdate=function(){E.uNode.style.display="block";E.sNode.style.display="none";E.isUpdating=!E.isUpdating};E.endUpdate=function(){E.uNode.style.display="none";E.sNode.style.display="block";E.time=E.refInterval;E.startClock();E.ctNode.innerHTML=new Date().formatDate("HH:mm:ss z")};E.startClock=function(){E.ntNode.innerHTML=E.time+"";clearInterval(E.interval);E.interval=window.setInterval(E.updateClock,1000)};E.updateClock=function(){E.ntNode.innerHTML=E.time+"";--E.time};E.cleanup=function(){};return E};hyperic.widget.tooltip={tipElements:[],obj:{},tip:{},xPos:0,yPos:0,active:0,connections:[],conIdx:-1,init:function(D){if(dojo.isIE==6){return }if(D.tipElements){this.tipElements=D.tipElements}if(!document.getElementById||!document.createElement||!document.getElementsByTagName){return }var C,B;if(!dojo.byId("toolTip")){this.tip=document.createElement("div");this.tip.id="toolTip";document.getElementsByTagName("body")[0].appendChild(this.tip)}else{this.tip=dojo.byId("toolTip")}this.tip.style.top="0";this.tip.style.display="none";var A=this.tipElements.length;for(C=0;C<A;C++){var F={};if(D.document){F=document.getElementsByTagName(this.tipElements[C])}else{F=dojo.byId(D.baseNodeId).getElementsByTagName(this.tipElements[C])}var E=F.length;for(B=0;B<E;B++){if(F[B].getAttribute("title")){this.connections[++this.conIdx]=dojo.connect(F[B],"mouseover",hyperic.widget.tooltip,"tipOver");this.connections[++this.conIdx]=dojo.connect(F[B],"mouseout",hyperic.widget.tooltip,"tipOut");F[B].setAttribute("tip",F[B].getAttribute("title"));F[B].removeAttribute("title")}}}},updateXY:function(A){if(document.captureEvents){hyperic.widget.tooltip.xPos=A.pageX;hyperic.widget.tooltip.yPos=A.pageY}else{if(window.event.clientX){hyperic.widget.tooltip.xPos=window.event.clientX+document.documentElement.scrollLeft;hyperic.widget.tooltip.yPos=window.event.clientY+document.documentElement.scrollTop}}},tipOut:function(){if(window.tID){clearTimeout(window.tID)}if(window.opacityID){clearTimeout(window.opacityID)}hyperic.widget.tooltip.tip.style.display="none"},checkNode:function(){var A=this.obj;if(inArray(this.tipElements,A.nodeName.toLowerCase())){return A}else{return A.parentNode}},tipOver:function(A){hyperic.widget.tooltip.obj=A.target;window.tID=window.setTimeout("hyperic.widget.tooltip.tipShow()",10);hyperic.widget.tooltip.updateXY(A)},tipShow:function(){var F=Number(this.xPos);var D=Number(this.yPos);var G=parseInt(D+15);var C=parseInt(F+10);var B=this.checkNode();var E="";var A="";if(B.nodeName.toLowerCase()=="a"){E=(B.href.length>25?B.href.toString().substring(0,25)+"...":B.href);var A=(B.accessKey?" <span>["+B.accessKey+"]</span> ":"")}else{}this.tip.innerHTML="<p>"+B.getAttribute("tip")+"<em>"+A+E+"</em></p>";if(parseInt(document.documentElement.clientWidth+document.documentElement.scrollLeft)<parseInt(this.tip.offsetWidth+C)){this.tip.style.left=parseInt(C-(this.tip.offsetWidth+10))+"px"}else{this.tip.style.left=C+"px"}if(parseInt(document.documentElement.clientHeight+document.documentElement.scrollTop)<parseInt(this.tip.offsetHeight+G)){this.tip.style.top=parseInt(G-(this.tip.offsetHeight+10))+"px"}else{this.tip.style.top=G+"px"}this.tip.style.display="block";this.tip.style.opacity=".1";this.tipFade(10)},tipFade:function(B){var C=parseInt(B);var A=parseInt(C+10);if(A<80){this.tip.style.opacity="."+A;this.tip.style.filter="alpha(opacity:"+A+")";window.opacityID=window.setTimeout("hyperic.widget.tooltip.tipFade('"+A+"')",20)}else{this.tip.style.opacity=".80";this.tip.style.filter="alpha(opacity:80)"}},cleanup:function(){for(var A=0;A<this.connections.length;A++){dojo.disconnect(this.connections[A])}this.conIdx=-1}};if(console){h.who=function(){console.debug(init)}}hyperic.cookie=function(A,I,H){var G=document.cookie;if(arguments.length===1){var E=G.match(new RegExp("(?:^|; )"+A+"=([^;]*)"));return E?decodeURIComponent(E[1]):undefined}else{H=H||{};var D=H.expires;if(typeof D==="number"){var F=new Date();F.setTime(F.getTime()+D*24*60*60*1000);D=H.expires=F}if(D&&D.toUTCString){H.expires=D.toUTCString()}I=encodeURIComponent(I);var B=A+"="+I;for(propName in H){B+="; "+propName;var C=H[propName];if(C!==true){B+="="+C}}document.cookie=B}};var inArray=function(C,B){var A;for(A=0;A<C.length;A++){if(C[A]===B){return true}}return false};var form={submit:function(){var A=document.getElementsByTagName("form")[0];if(this.validateForm(A)){dojo.io.iframe.send({url:"http://www.loopfuse.net/webrecorder/post",method:"post",handleAs:"html",form:A,handle:function(C,B){dojo.byId("dojoIoIframe").src=""}});dojo.byId("form").style.display="none";dojo.byId("thankyou").style.display="block"}else{dojo.byId("err").style.display="block"}},close:function(){dojo.byId("err").style.display="none";dojo.byId("form").style.display="none";dojo.byId("updates").style.display="block"},validateForm:function(A){if(A.firstName.value==""||A.lastName.value==""||A.company.value==""||A.email.value==""||(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(A.email.value)))){return false}else{return true}}};String.repeat=function(B,C){var D="";for(var A=0;A<C;A++){D+=B}return D};String.prototype.padL=function(A,C){if(!A||A<1){return this}if(!C){C=" "}var B=A-this.length;if(B<1){return this.substr(0,A)}return(String.repeat(C,B)+this).substr(0,A)};String.prototype.padR=function(A,C){if(!A||A<1){return this}if(!C){C=" "}var B=A-this.length;if(B<1){this.substr(0,A)}return(this+String.repeat(C,B)).substr(0,A)};Date.prototype.formatDate=function(G){var D=this;var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var A=["January","February","March","April","May","June","July","August","September","October","November","December"];if(!G){G="MM/dd/yyyy"}var F=D.getMonth()+1;var E=D.getFullYear();G=G.replace("MM",F.toString().padL(2,"0"));G=G.replace("M",F.toString());if(G.indexOf("yyyy")>-1){G=G.replace("yyyy",E.toString())}else{if(G.indexOf("yy")>-1){G=G.replace("yy",E.toString().substr(2,2))}}G=G.replace("dd",D.getDate().toString().padL(2,"0"));G=G.replace("d",D.getDate().toString());G=G.replace("b",C[D.getMonth()]);G=G.replace("B",A[D.getMonth()]);G=G.replace("z",dojo.date.getTimezoneName(D));var B=D.getHours();if(G.indexOf("t")>-1){if(B>11){G=G.replace("t","pm")}else{G=G.replace("t","am")}}if(G.indexOf("HH")>-1){G=G.replace("HH",B.toString().padL(2,"0"))}if(G.indexOf("hh")>-1){if(B>12){B-=12}if(B==0){B=12}G=G.replace("hh",B.toString().padL(2,"0"))}if(G.indexOf("mm")>-1){G=G.replace("mm",D.getMinutes().toString().padL(2,"0"))}if(G.indexOf("ss")>-1){G=G.replace("ss",D.getSeconds().toString().padL(2,"0"))}return G};