(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}})();(function($){$.fn.ajaxSubmit=function(options){if(typeof options=="function"){options={success:options}}options=$.extend({url:this.attr("action")||window.location.toString(),type:this.attr("method")||"GET"},options||{});var veto={};$.event.trigger("form.pre.serialize",[this,options,veto]);if(veto.veto){return this}var a=this.formToArray(options.semantic);if(options.data){for(var n in options.data){a.push({name:n,value:options.data[n]})}}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){return this}$.event.trigger("form.submit.validate",[a,this,options,veto]);if(veto.veto){return this}var q=$.param(a);if(options.type.toUpperCase()=="GET"){options.url+=(options.url.indexOf("?")>=0?"&":"?")+q;options.data=null}else{options.data=q}var $form=this,callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm()})}if(options.clearForm){callbacks.push(function(){$form.clearForm()})}if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){if(this.evalScripts){$(options.target).attr("innerHTML",data).evalScripts().each(oldSuccess,arguments)}else{$(options.target).html(data).each(oldSuccess,arguments)}})}else{if(options.success){callbacks.push(options.success)}}options.success=function(data,status){for(var i=0,max=callbacks.length;i<max;i++){callbacks[i](data,status,$form)}};var files=$("input:file",this).fieldValue();var found=false;for(var j=0;j<files.length;j++){if(files[j]){found=true}}if(options.iframe||found){if($.browser.safari&&options.closeKeepAlive){$.get(options.closeKeepAlive,fileUpload)}else{fileUpload()}}else{$.ajax(options)}$.event.trigger("form.submit.notify",[this,options]);return this;function fileUpload(){var form=$form[0];var opts=$.extend({},$.ajaxSettings,options);var id="jqFormIO"+$.fn.ajaxSubmit.counter++;var $io=$('<iframe id="'+id+'" name="'+id+'" />');var io=$io[0];var op8=$.browser.opera&&window.opera.version()<9;if($.browser.msie||op8){io.src='javascript:false;document.write("");'}$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){}};var g=opts.global;if(g&&!$.active++){$.event.trigger("ajaxStart")}if(g){$.event.trigger("ajaxSend",[xhr,opts])}var cbInvoked=0;var timedOut=0;setTimeout(function(){$io.appendTo("body");io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,false);var encAttr=form.encoding?"encoding":"enctype";var t=$form.attr("target");$form.attr({target:id,method:"POST",action:opts.url});form[encAttr]="multipart/form-data";if(opts.timeout){setTimeout(function(){timedOut=true;cb()},opts.timeout)}form.submit();$form.attr("target",t)},10);function cb(){if(cbInvoked++){return }io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,false);var ok=true;try{if(timedOut){throw"timeout"}var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(opts.dataType=="json"||opts.dataType=="script"){var ta=doc.getElementsByTagName("textarea")[0];data=ta?ta.value:xhr.responseText;if(opts.dataType=="json"){eval("data = "+data)}else{$.globalEval(data)}}else{if(opts.dataType=="xml"){data=xhr.responseXML;if(!data&&xhr.responseText!=null){data=toXml(xhr.responseText)}}else{data=xhr.responseText}}}catch(e){ok=false;$.handleError(opts,xhr,"error",e)}if(ok){opts.success(data,"success");if(g){$.event.trigger("ajaxSuccess",[xhr,opts])}}if(g){$.event.trigger("ajaxComplete",[xhr,opts])}if(g&&!--$.active){$.event.trigger("ajaxStop")}if(opts.complete){opts.complete(xhr,ok?"success":"error")}setTimeout(function(){$io.remove();xhr.responseXML=null},100)}function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s)}else{doc=(new DOMParser()).parseFromString(s,"text/xml")}return(doc&&doc.documentElement&&doc.documentElement.tagName!="parsererror")?doc:null}}};$.fn.ajaxSubmit.counter=0;$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().submit(submitHandler).each(function(){this.formPluginId=$.fn.ajaxForm.counter++;$.fn.ajaxForm.optionHash[this.formPluginId]=options;$(":submit,input:image",this).click(clickHandler)})};$.fn.ajaxForm.counter=1;$.fn.ajaxForm.optionHash={};function clickHandler(e){var $form=this.form;$form.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){$form.clk_x=e.offsetX;$form.clk_y=e.offsetY}else{if(typeof $.fn.offset=="function"){var offset=$(this).offset();$form.clk_x=e.pageX-offset.left;$form.clk_y=e.pageY-offset.top}else{$form.clk_x=e.pageX-this.offsetLeft;$form.clk_y=e.pageY-this.offsetTop}}}setTimeout(function(){$form.clk=$form.clk_x=$form.clk_y=null},10)}function submitHandler(){var id=this.formPluginId;var options=$.fn.ajaxForm.optionHash[id];$(this).ajaxSubmit(options);return false}$.fn.ajaxFormUnbind=function(){this.unbind("submit",submitHandler);return this.each(function(){$(":submit,input:image",this).unbind("click",clickHandler)})};$.fn.formToArray=function(semantic){var a=[];if(this.length==0){return a}var form=this[0];var els=semantic?form.getElementsByTagName("*"):form.elements;if(!els){return a}for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n){continue}if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y})}continue}var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]})}}else{if(v!==null&&typeof v!="undefined"){a.push({name:n,value:v})}}}if(!semantic&&form.clk){var inputs=form.getElementsByTagName("input");for(var i=0,max=inputs.length;i<max;i++){var input=inputs[i];var n=input.name;if(n&&!input.disabled&&input.type=="image"&&form.clk==input){a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y})}}}return a};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic))};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return }var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]})}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v})}}});return $.param(a)};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue}v.constructor==Array?$.merge(val,v):val.push(v)}return val};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful=="undefined"){successful=true}if(successful&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null}if(tag=="select"){var index=el.selectedIndex;if(index<0){return null}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=$.browser.msie&&!(op.attributes.value.specified)?op.text:op.value;if(one){return v}a.push(v)}}return a}return el.value};$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields()})};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=="text"||t=="password"||tag=="textarea"){this.value=""}else{if(t=="checkbox"||t=="radio"){this.checked=false}else{if(tag=="select"){this.selectedIndex=-1}}}})};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(b){if(b==undefined){b=true}return this.each(function(){this.disabled=!b})};$.fn.select=function(select){if(select==undefined){select=true}return this.each(function(){var t=this.type;if(t=="checkbox"||t=="radio"){this.checked=select}else{if(this.tagName.toLowerCase()=="option"){var $sel=$(this).parent("select");if(select&&$sel[0]&&$sel[0].type=="select-one"){$sel.find("option").select(false)}this.selected=select}}})};$.fn.deserialize=function(d,config){var data=d;me=this;if(d===undefined){return me}config=$.extend({isPHPnaming:false,overwrite:true},config);if(d.constructor==Array){data={};for(var i=0;i<d.length;i++){if(typeof data[d[i].name]!="undefined"){if(data[d[i].name].constructor!=Array){data[d[i].name]=[data[d[i].name],d[i].value]}else{data[d[i].name].push(d[i].value)}}else{data[d[i].name]=d[i].value}}}$("input,select,textarea",me).each(function(){var p=this.name;var v=[];if(config.isPHPnaming){p=p.replace(/\[\]$/,"")}if(p&&data[p]!=undefined){v=data[p].constructor==Array?data[p]:[data[p]]}if(config.overwrite===true||data[p]){switch(this.type||this.tagName.toLowerCase()){case"radio":case"checkbox":this.checked=false;for(var i=0;i<v.length;i++){this.checked|=(this.value!=""&&v[i]==this.value)}break;case"select-multiple"||"select":for(i=0;i<this.options.length;i++){this.options[i].selected=false;for(var j=0;j<v.length;j++){this.options[i].selected|=(this.options[i].value!=""&&this.options[i].value==v[j])}}break;case"button":case"submit":this.value=v.length>0?v.join(","):this.value;break;default:this.value=v.join(",")}}});return me}})(jQuery);(function(A){A.ui=A.ui||{};A.extend(A.ui,{plugin:{add:function(C,D,F){var E=A.ui[C].prototype;for(var B in F){E.plugins[B]=E.plugins[B]||[];E.plugins[B].push([D,F[B]])}},call:function(B,C,E){var F=B.plugins[C];if(!F){return }for(var D=0;D<F.length;D++){if(B.options[F[D][0]]){F[D][1].apply(B.element,E)}}}},cssCache:{},css:function(B){if(A.ui.cssCache[B]){return A.ui.cssCache[B]}var C=A('<div class="ui-resizable-gen">').addClass(B).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");A.ui.cssCache[B]=!!(((/^[1-9]/).test(C.css("height"))||(/^[1-9]/).test(C.css("width"))||!(/none/).test(C.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(C.css("backgroundColor"))));try{A("body").get(0).removeChild(C.get(0))}catch(D){}return A.ui.cssCache[B]},disableSelection:function(B){if(!B){return }B.unselectable="on";B.onselectstart=function(){return false};if(B.style){B.style.MozUserSelect="none"}},enableSelection:function(B){if(!B){return }B.unselectable="off";B.onselectstart=function(){return true};if(B.style){B.style.MozUserSelect=""}}});A.fn.extend({mouseInteraction:function(B){return this.each(function(){new A.ui.mouseInteraction(this,B)})},removeMouseInteraction:function(B){return this.each(function(){if(A.data(this,"ui-mouse")){A.data(this,"ui-mouse").destroy()}})}});A.ui.mouseInteraction=function(D,C){var B=this;this.element=D;A.data(this.element,"ui-mouse",this);this.options=A.extend({},C);A(D).bind("mousedown.draggable",function(){return B.click.apply(B,arguments)});if(A.browser.msie){A(D).attr("unselectable","on")}};A.extend(A.ui.mouseInteraction.prototype,{destroy:function(){A(this.element).unbind("mousedown.draggable")},trigger:function(){return this.click.apply(this,arguments)},click:function(D){if(D.which!=1||A.inArray(D.target.nodeName.toLowerCase(),this.options.dragPrevention)!=-1||(this.options.condition&&!this.options.condition.apply(this.options.executor||this,[D,this.element]))){return true}var C=this;var B=function(){C._MP={left:D.pageX,top:D.pageY};A(document).bind("mouseup.draggable",function(){return C.stop.apply(C,arguments)});A(document).bind("mousemove.draggable",function(){return C.drag.apply(C,arguments)})};if(this.options.delay){if(this.timer){clearInterval(this.timer)}this.timer=setTimeout(B,this.options.delay)}else{B()}return false},stop:function(B){var C=this.options;if(!this.initialized){return A(document).unbind("mouseup.draggable").unbind("mousemove.draggable")}if(this.options.stop){this.options.stop.call(this.options.executor||this,B,this.element)}A(document).unbind("mouseup.draggable").unbind("mousemove.draggable");this.initialized=false;return false},drag:function(B){var C=this.options;if(A.browser.msie&&!B.button){return this.stop.apply(this,[B])}if(!this.initialized&&(Math.abs(this._MP.left-B.pageX)>=C.distance||Math.abs(this._MP.top-B.pageY)>=C.distance)){if(this.options.start){this.options.start.call(this.options.executor||this,B,this.element)}this.initialized=true}else{if(!this.initialized){return false}}if(C.drag){C.drag.call(this.options.executor||this,B,this.element)}return false}})})(jQuery);(function(A){A.fn.extend({draggable:function(C){var B=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof C=="string"){var D=A.data(this,"ui-draggable");D[C].apply(D,B)}else{if(!A.data(this,"ui-draggable")){new A.ui.draggable(this,C)}}})}});A.ui.draggable=function(D,C){var B=this;this.element=A(D);A.data(D,"ui-draggable",this);this.element.addClass("ui-draggable");this.options=A.extend({},C);var E=this.options;A.extend(E,{helper:E.ghosting==true?"clone":(E.helper||"original"),handle:E.handle?(A(E.handle,D)[0]?A(E.handle,D):this.element):this.element,appendTo:E.appendTo||"parent"});A(D).bind("setData.draggable",function(G,F,H){B.options[F]=H}).bind("getData.draggable",function(G,F){return B.options[F]});A(E.handle).mouseInteraction({executor:this,delay:E.delay,distance:E.distance||0,dragPrevention:E.prevention?E.prevention.toLowerCase().split(","):["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(F){return !(F.target.className.indexOf("ui-resizable-handle")!=-1||this.disabled)}});if(E.helper=="original"&&(this.element.css("position")=="static"||this.element.css("position")=="")){this.element.css("position","relative")}};A.extend(A.ui.draggable.prototype,{plugins:{},ui:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,instance:this,options:this.options}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this.ui()],this.options[C])},destroy:function(){this.handle.removeMouseInteraction();this.element.removeClass("ui-draggable ui-draggable-disabled").removeData("ui-draggable").unbind(".draggable")},enable:function(){this.element.removeClass("ui-draggable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-draggable-disabled");this.disabled=true},recallOffset:function(D){var C={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};var B=this.helper.css("position")=="relative";this.originalPosition={left:(B?parseInt(this.helper.css("left"),10)||0:C.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(B?parseInt(this.helper.css("top"),10)||0:C.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};this.offset={left:this._pageX-this.originalPosition.left,top:this._pageY-this.originalPosition.top}},start:function(D){var E=this.options;if(E.forceTop0){this.forceTop0=true}if(A.ui.ddmanager){A.ui.ddmanager.current=this}this.helper=typeof E.helper=="function"?A(E.helper.apply(this.element[0],[D])):(E.helper=="clone"?this.element.clone().appendTo((E.appendTo=="parent"?this.element[0].parentNode:E.appendTo)):this.element);if(this.helper[0]!=this.element[0]){this.helper.css("position","absolute")}if(!this.helper.parents("body").length){this.helper.appendTo((E.appendTo=="parent"?this.element[0].parentNode:E.appendTo))}this.offsetParent=(function(F){while(F){if(F.style&&(/(absolute|relative|fixed)/).test(A.css(F,"position"))){return A(F)}F=F.parentNode?F.parentNode:null}return A("body")})(this.helper[0].parentNode);this.elementOffset=this.element.offset();this.offsetParentOffset=this.offsetParent.offset();var C={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};this._pageX=D.pageX;this._pageY=D.pageY;this.clickOffset={left:D.pageX-this.elementOffset.left,top:D.pageY-this.elementOffset.top};var B=this.helper.css("position")=="relative";this.originalPosition={left:(B?parseInt(this.helper.css("left"),10)||0:C.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(B?parseInt(this.helper.css("top"),10)||0:C.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};if(this.element.css("position")=="fixed"){this.originalPosition.top-=this.offsetParent[0]==document.body?A(document).scrollTop():this.offsetParent[0].scrollTop;this.originalPosition.left-=this.offsetParent[0]==document.body?A(document).scrollLeft():this.offsetParent[0].scrollLeft}this.offset={left:D.pageX-this.originalPosition.left,top:D.pageY-this.originalPosition.top};this.propagate("start",D);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};if(A.ui.ddmanager&&!E.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,D)}if(E.cursorAt){if(E.cursorAt.top!=undefined||E.cursorAt.bottom!=undefined){this.offset.top-=this.clickOffset.top-(E.cursorAt.top!=undefined?E.cursorAt.top:(this.helperProportions.height-E.cursorAt.bottom));this.clickOffset.top=(E.cursorAt.top!=undefined?E.cursorAt.top:(this.helperProportions.height-E.cursorAt.bottom))}if(E.cursorAt.left!=undefined||E.cursorAt.right!=undefined){this.offset.left-=this.clickOffset.left-(E.cursorAt.left!=undefined?E.cursorAt.left:(this.helperProportions.width-E.cursorAt.right));this.clickOffset.left=(E.cursorAt.left!=undefined?E.cursorAt.left:(this.helperProportions.width-E.cursorAt.right))}}return false},clear:function(){if(A.ui.ddmanager){A.ui.ddmanager.current=null}this.helper=null},stop:function(B){if(A.ui.ddmanager&&!this.options.dropBehaviour){A.ui.ddmanager.drop(this,B)}this.propagate("stop",B);if(this.cancelHelperRemoval){return false}if(this.options.helper!="original"){this.helper.remove()}this.clear();return false},drag:function(B){this.position={top:B.pageY-this.offset.top,left:B.pageX-this.offset.left};this.positionAbs={left:B.pageX-this.clickOffset.left,top:B.pageY-this.clickOffset.top};this.position=this.propagate("drag",B)||this.position;if(this.forceTop0){this.position.top=0}this.helper.css({left:this.position.left+"px",top:this.position.top+"px"});if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false}})})(jQuery);(function(A){A.ui.plugin.add("draggable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor")}B.css("cursor",C.options.cursor)},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("draggable","zIndex",{start:function(D,C){var B=A(C.helper);if(B.css("zIndex")){C.options._zIndex=B.css("zIndex")}B.css("zIndex",C.options.zIndex)},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex)}}});A.ui.plugin.add("draggable","opacity",{start:function(D,C){var B=A(C.helper);if(B.css("opacity")){C.options._opacity=B.css("opacity")}B.css("opacity",C.options.opacity)},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("draggable","revert",{stop:function(D,C){var B=C.instance;B.cancelHelperRemoval=true;A(C.helper).animate({left:B.originalPosition.left,top:B.originalPosition.top},parseInt(C.options.revert,10)||500,function(){if(C.options.helper!="original"){B.helper.remove()}B.clear()})}});A.ui.plugin.add("draggable","iframeFix",{start:function(D,C){var F=C.options;if(C.instance.slowMode){return }if(F.iframeFix.constructor==Array){for(var B=0;B<F.iframeFix.length;B++){var E=A(F.iframeFix[B]).offset({border:false});A('<div class="DragDropIframeFix"" style="background: #fff;"></div>').css("width",A(F.iframeFix[B])[0].offsetWidth+"px").css("height",A(F.iframeFix[B])[0].offsetHeight+"px").css("position","absolute").css("opacity","0.001").css("z-index","1000").css("top",E.top+"px").css("left",E.left+"px").appendTo("body")}}else{A("iframe").each(function(){var G=A(this).offset({border:false});A('<div class="DragDropIframeFix" style="background: #fff;"></div>').css("width",this.offsetWidth+"px").css("height",this.offsetHeight+"px").css("position","absolute").css("opacity","0.001").css("z-index","1000").css("top",G.top+"px").css("left",G.left+"px").appendTo("body")})}},stop:function(C,B){if(B.options.iframeFix){A("div.DragDropIframeFix").each(function(){this.parentNode.removeChild(this)})}}});A.ui.plugin.add("draggable","containment",{start:function(D,B){var F=B.options;if((F.containment.left!=undefined||F.containment.constructor==Array)&&!F._containment){return }if(!F._containment){F._containment=F.containment}if(F._containment=="parent"){F._containment=this[0].parentNode}if(F._containment=="document"){F.containment=[0,0,A(document).width(),(A(document).height()||document.body.parentNode.scrollHeight)]}else{var C=A(F._containment)[0];var E=A(F._containment).offset();F.containment=[E.left,E.top,E.left+(C.offsetWidth||C.scrollWidth),E.top+(C.offsetHeight||C.scrollHeight)]}},drag:function(E,D){var F=D.options;var C=D.helper;var G=F.containment;var B=D.instance;if(G.constructor==Array){if((D.absolutePosition.left<G[0])){B.position.left=G[0]-(B.offset.left-B.clickOffset.left)}if((D.absolutePosition.top<G[1])){B.position.top=G[1]-(B.offset.top-B.clickOffset.top)}if(D.absolutePosition.left-G[2]+B.helperProportions.width>=0){B.position.left=G[2]-(B.offset.left-B.clickOffset.left)-B.helperProportions.width}if(D.absolutePosition.top-G[3]+B.helperProportions.height>=0){B.position.top=G[3]-(B.offset.top-B.clickOffset.top)-B.helperProportions.height}}else{if((D.position.left<G.left)){B.position.left=G.left}if((D.position.top<G.top)){B.position.top=G.top}if(D.position.left-B.offsetParent.innerWidth()+B.helperProportions.width+G.right+(parseInt(B.offsetParent.css("borderLeftWidth"),10)||0)+(parseInt(B.offsetParent.css("borderRightWidth"),10)||0)>=0){B.position.left=B.offsetParent.innerWidth()-B.helperProportions.width-G.right-(parseInt(B.offsetParent.css("borderLeftWidth"),10)||0)-(parseInt(B.offsetParent.css("borderRightWidth"),10)||0)}if(D.position.top-B.offsetParent.innerHeight()+B.helperProportions.height+G.bottom+(parseInt(B.offsetParent.css("borderTopWidth"),10)||0)+(parseInt(B.offsetParent.css("borderBottomWidth"),10)||0)>=0){B.position.top=B.offsetParent.innerHeight()-B.helperProportions.height-G.bottom-(parseInt(B.offsetParent.css("borderTopWidth"),10)||0)-(parseInt(B.offsetParent.css("borderBottomWidth"),10)||0)}}}});A.ui.plugin.add("draggable","grid",{drag:function(C,B){var D=B.options;B.instance.position.left=B.instance.originalPosition.left+Math.round((C.pageX-B.instance._pageX)/D.grid[0])*D.grid[0];B.instance.position.top=B.instance.originalPosition.top+Math.round((C.pageY-B.instance._pageY)/D.grid[1])*D.grid[1]}});A.ui.plugin.add("draggable","axis",{drag:function(C,B){var D=B.options;if(D.constraint){D.axis=D.constraint}D.axis=="x"?B.instance.position.top=B.instance.originalPosition.top:B.instance.position.left=B.instance.originalPosition.left}});A.ui.plugin.add("draggable","scroll",{start:function(C,B){var D=B.options;D.scrollSensitivity=D.scrollSensitivity||20;D.scrollSpeed=D.scrollSpeed||20;B.instance.overflowY=function(E){do{if(/auto|scroll/.test(E.css("overflow"))||(/auto|scroll/).test(E.css("overflow-y"))){return E}E=E.parent()}while(E[0].parentNode);return A(document)}(this);B.instance.overflowX=function(E){do{if(/auto|scroll/.test(E.css("overflow"))||(/auto|scroll/).test(E.css("overflow-x"))){return E}E=E.parent()}while(E[0].parentNode);return A(document)}(this)},drag:function(D,C){var E=C.options;var B=C.instance;if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if(B.overflowY[0].offsetHeight-(C.position.top-B.overflowY[0].scrollTop+B.clickOffset.top)<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop+E.scrollSpeed}if((C.position.top-B.overflowY[0].scrollTop+B.clickOffset.top)<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop-E.scrollSpeed}}else{if(D.pageY-A(document).scrollTop()<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()-E.scrollSpeed)}if(A(window).height()-(D.pageY-A(document).scrollTop())<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()+E.scrollSpeed)}}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){if(B.overflowX[0].offsetWidth-(C.position.left-B.overflowX[0].scrollLeft+B.clickOffset.left)<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft+E.scrollSpeed}if((C.position.top-B.overflowX[0].scrollLeft+B.clickOffset.left)<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft-E.scrollSpeed}}else{if(D.pageX-A(document).scrollLeft()<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()-E.scrollSpeed)}if(A(window).width()-(D.pageX-A(document).scrollLeft())<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()+E.scrollSpeed)}}C.instance.recallOffset(D)}});A.ui.plugin.add("draggable","snap",{start:function(C,B){B.instance.snapElements=[];A(B.options.snap===true?".ui-draggable":B.options.snap).each(function(){var E=A(this);var D=E.offset();if(this!=B.instance.element[0]){B.instance.snapElements.push({item:this,width:E.outerWidth(),height:E.outerHeight(),top:D.top,left:D.left})}})},drag:function(I,M){var K=M.options.snapTolerance||20;var D=M.absolutePosition.left,C=D+M.instance.helperProportions.width,O=M.absolutePosition.top,N=O+M.instance.helperProportions.height;for(var H=M.instance.snapElements.length-1;H>=0;H--){var E=M.instance.snapElements[H].left,B=E+M.instance.snapElements[H].width,Q=M.instance.snapElements[H].top,L=Q+M.instance.snapElements[H].height;if(!((E-K<D&&D<B+K&&Q-K<O&&O<L+K)||(E-K<D&&D<B+K&&Q-K<N&&N<L+K)||(E-K<C&&C<B+K&&Q-K<O&&O<L+K)||(E-K<C&&C<B+K&&Q-K<N&&N<L+K))){continue}if(M.options.snapMode!="inner"){var J=Math.abs(Q-N)<=20;var P=Math.abs(L-O)<=20;var G=Math.abs(E-C)<=20;var F=Math.abs(B-D)<=20;if(J){M.position.top=Q-M.instance.offset.top+M.instance.clickOffset.top-M.instance.helperProportions.height}if(P){M.position.top=L-M.instance.offset.top+M.instance.clickOffset.top}if(G){M.position.left=E-M.instance.offset.left+M.instance.clickOffset.left-M.instance.helperProportions.width}if(F){M.position.left=B-M.instance.offset.left+M.instance.clickOffset.left}}if(M.options.snapMode!="outer"){var J=Math.abs(Q-O)<=20;var P=Math.abs(L-N)<=20;var G=Math.abs(E-D)<=20;var F=Math.abs(B-C)<=20;if(J){M.position.top=Q-M.instance.offset.top+M.instance.clickOffset.top}if(P){M.position.top=L-M.instance.offset.top+M.instance.clickOffset.top-M.instance.helperProportions.height}if(G){M.position.left=E-M.instance.offset.left+M.instance.clickOffset.left}if(F){M.position.left=B-M.instance.offset.left+M.instance.clickOffset.left-M.instance.helperProportions.width}}}}})})(jQuery);(function(A){A.fn.extend({droppable:function(C){var B=Array.prototype.slice.call(arguments,1);return this.each(function(){if(typeof C=="string"){var D=A.data(this,"ui-droppable");D[C].apply(D,B)}else{if(!A.data(this,"ui-droppable")){new A.ui.droppable(this,C)}}})}});A.ui.droppable=function(D,B){this.element=A(D);A.data(D,"ui-droppable",this);this.element.addClass("ui-droppable");this.options=A.extend({},B);var E=this.options;var C=E.accept;A.extend(E,{accept:E.accept&&E.accept.constructor==Function?E.accept:function(F){return A(F).is(C)},tolerance:E.tolerance||"intersect"});A(D).bind("setData.draggable",function(G,F,H){E[F]=H}).bind("getData.draggable",function(G,F){return E[F]});this.proportions={width:this.element.outerWidth(),height:this.element.outerHeight()};A.ui.ddmanager.droppables.push({item:this,over:0,out:1})};A.extend(A.ui.droppable.prototype,{plugins:{},ui:function(B){return{instance:this,draggable:B.element,helper:B.helper,position:B.position,absolutePosition:B.positionAbs,options:this.options}},destroy:function(){var B=A.ui.ddmanager.droppables;for(var C=0;C<B.length;C++){if(B[C].item==this){B.splice(C,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("ui-droppable").unbind(".droppable")},enable:function(){this.element.removeClass("ui-droppable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-droppable-disabled");this.disabled=true},over:function(C){var B=A.ui.ddmanager.current;if(!B||B.element[0]==this.element[0]){return }if(this.options.accept.call(this.element,B.element)){A.ui.plugin.call(this,"over",[C,this.ui(B)]);this.element.triggerHandler("dropover",[C,this.ui(B)],this.options.over)}},out:function(C){var B=A.ui.ddmanager.current;if(!B||B.element[0]==this.element[0]){return }if(this.options.accept.call(this.element,B.element)){A.ui.plugin.call(this,"out",[C,this.ui(B)]);this.element.triggerHandler("dropout",[C,this.ui(B)],this.options.out)}},drop:function(C){var B=A.ui.ddmanager.current;if(!B||B.element[0]==this.element[0]){return }if(this.options.accept.call(this.element,B.element)){A.ui.plugin.call(this,"drop",[C,this.ui(B)]);this.element.triggerHandler("drop",[C,this.ui(B)],this.options.drop)}},activate:function(C){var B=A.ui.ddmanager.current;A.ui.plugin.call(this,"activate",[C,this.ui(B)]);if(B){this.element.triggerHandler("dropactivate",[C,this.ui(B)],this.options.activate)}},deactivate:function(C){var B=A.ui.ddmanager.current;A.ui.plugin.call(this,"deactivate",[C,this.ui(B)]);if(B){this.element.triggerHandler("dropdeactivate",[C,this.ui(B)],this.options.deactivate)}}});A.ui.intersect=function(L,F,J){if(!F.offset){return false}var D=L.positionAbs.left,C=D+L.helperProportions.width,I=L.positionAbs.top,H=I+L.helperProportions.height;var E=F.offset.left,B=E+F.item.proportions.width,K=F.offset.top,G=K+F.item.proportions.height;switch(J){case"fit":return(E<D&&C<B&&K<I&&H<G);break;case"intersect":return(E<D+(L.helperProportions.width/2)&&C-(L.helperProportions.width/2)<B&&K<I+(L.helperProportions.height/2)&&H-(L.helperProportions.height/2)<G);break;case"pointer":return(E<(L.positionAbs.left+L.clickOffset.left)&&(L.positionAbs.left+L.clickOffset.left)<B&&K<(L.positionAbs.top+L.clickOffset.top)&&(L.positionAbs.top+L.clickOffset.top)<G);break;case"touch":return((E<D&&D<B&&K<I&&I<G)||(E<D&&D<B&&K<H&&H<G)||(E<C&&C<B&&K<I&&I<G)||(E<C&&C<B&&K<H&&H<G));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:[],prepareOffsets:function(D,E){var B=A.ui.ddmanager.droppables;for(var C=0;C<B.length;C++){if(B[C].item.disabled||(D&&!B[C].item.options.accept.call(B[C].item.element,D.element))){continue}B[C].offset=A(B[C].item.element).offset();if(D){B[C].item.activate.call(B[C].item,E)}}},drop:function(B,C){A.each(A.ui.ddmanager.droppables,function(){if(!this.item.disabled&&A.ui.intersect(B,this,this.item.options.tolerance)){this.item.drop.call(this.item,C)}if(!this.item.disabled&&this.item.options.accept.call(this.item.element,B.element)){this.out=1;this.over=0;this.item.deactivate.call(this.item,C)}})},drag:function(B,C){if(B.options.refreshPositions){A.ui.ddmanager.prepareOffsets()}A.each(A.ui.ddmanager.droppables,function(){if(this.item.disabled){return false}var D=A.ui.intersect(B,this,this.item.options.tolerance);var E=!D&&this.over==1?"out":(D&&this.over==0?"over":null);if(!E){return }this[E]=1;this[E=="out"?"over":"out"]=0;this.item[E].call(this.item,C)})}}})(jQuery);(function(A){A.ui.plugin.add("droppable","activeClass",{activate:function(C,B){A(this).addClass(B.options.activeClass)},deactivate:function(C,B){A(this).removeClass(B.options.activeClass)},drop:function(C,B){A(this).removeClass(B.options.activeClass)}});A.ui.plugin.add("droppable","hoverClass",{over:function(C,B){A(this).addClass(B.options.hoverClass)},out:function(C,B){A(this).removeClass(B.options.hoverClass)},drop:function(C,B){A(this).removeClass(B.options.hoverClass)}})})(jQuery);(function(A){A.fn.extend({slider:function(C){var B=Array.prototype.slice.call(arguments,1);if(C=="value"){return A.data(this[0],"ui-slider").value(arguments[1])}return this.each(function(){if(typeof C=="string"){var D=A.data(this,"ui-slider");D[C].apply(D,B)}else{if(!A.data(this,"ui-slider")){new A.ui.slider(this,C)}}})}});A.ui.slider=function(D,C){var B=this;this.element=A(D);A.data(D,"ui-slider",this);this.element.addClass("ui-slider");this.options=A.extend({},C);var E=this.options;A.extend(E,{axis:E.axis||(D.offsetWidth<D.offsetHeight?"vertical":"horizontal"),maxValue:!isNaN(parseInt(E.maxValue,10))?parseInt(E.maxValue,10):100,minValue:parseInt(E.minValue,10)||0,startValue:parseInt(E.startValue,10)||"none"});E.realMaxValue=E.maxValue-E.minValue;E.stepping=parseInt(E.stepping,10)||(E.steps?E.realMaxValue/E.steps:0);A(D).bind("setData.slider",function(G,F,H){B.options[F]=H}).bind("getData.slider",function(G,F){return B.options[F]});this.handle=E.handle?A(E.handle,D):A("> *",D);A(this.handle).mouseInteraction({executor:this,delay:E.delay,distance:E.distance||0,dragPrevention:E.prevention?E.prevention.toLowerCase().split(","):["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(G,F){if(!this.disabled){if(this.currentHandle){this.blur(this.currentHandle)}this.focus(F,1);return !this.disabled}}}).wrap('<a href="javascript:void(0)"></a>').parent().bind("focus",function(F){B.focus(this.firstChild)}).bind("blur",function(F){B.blur(this.firstChild)}).bind("keydown",function(F){if(/(37|39)/.test(F.keyCode)){B.moveTo((F.keyCode==37?"-":"+")+"="+(B.options.stepping?B.options.stepping:(B.options.realMaxValue/B.size)*5),this.firstChild)}});if(E.helper=="original"&&(this.element.css("position")=="static"||this.element.css("position")=="")){this.element.css("position","relative")}if(E.axis=="horizontal"){this.size=this.element.outerWidth();this.properties=["left","width"]}else{this.size=this.element.outerHeight();this.properties=["top","height"]}this.element.bind("click",function(F){B.click.apply(B,[F])});if(!isNaN(E.startValue)){this.moveTo(E.startValue,0)}if(this.handle.length==1){this.previousHandle=this.handle}if(this.handle.length==2&&E.range){this.createRange()}};A.extend(A.ui.slider.prototype,{plugins:{},createRange:function(){this.rangeElement=A("<div></div>").addClass("ui-slider-range").css({position:"absolute"}).css(this.properties[0],parseInt(A(this.handle[0]).css(this.properties[0]),10)+this.handleSize(0)/2).css(this.properties[1],parseInt(A(this.handle[1]).css(this.properties[0]),10)-parseInt(A(this.handle[0]).css(this.properties[0]),10)).appendTo(this.element)},updateRange:function(){this.rangeElement.css(this.properties[0],parseInt(A(this.handle[0]).css(this.properties[0]),10)+this.handleSize(0)/2);this.rangeElement.css(this.properties[1],parseInt(A(this.handle[1]).css(this.properties[0]),10)-parseInt(A(this.handle[0]).css(this.properties[0]),10))},getRange:function(){return this.rangeElement?this.convertValue(parseInt(this.rangeElement.css(this.properties[1]),10)):null},ui:function(B){return{instance:this,options:this.options,handle:this.currentHandle,value:this.value(),range:this.getRange()}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);this.element.triggerHandler(C=="slide"?C:"slide"+C,[B,this.ui()],this.options[C])},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("ul-slider").unbind(".slider");this.handles.removeMouseInteraction()},enable:function(){this.element.removeClass("ui-slider-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-slider-disabled");this.disabled=true},focus:function(B,C){this.currentHandle=A(B).addClass("ui-slider-handle-active");if(C){this.currentHandle.parent()[0].focus()}},blur:function(B){A(B).removeClass("ui-slider-handle-active");if(this.currentHandle&&this.currentHandle[0]==B){this.previousHandle=this.currentHandle;this.currentHandle=null}},value:function(B){if(this.handle.length==1){this.currentHandle=this.handle}return((parseInt(A(B!=undefined?this.handle[B]||B:this.currentHandle).css(this.properties[0]),10)/(this.size-this.handleSize()))*this.options.realMaxValue)+this.options.minValue},convertValue:function(B){return(B/(this.size-this.handleSize()))*this.options.realMaxValue},translateValue:function(B){return((B-this.options.minValue)/this.options.realMaxValue)*(this.size-this.handleSize())},handleSize:function(B){return A(B!=undefined?this.handle[B]:this.currentHandle)["outer"+this.properties[1].substr(0,1).toUpperCase()+this.properties[1].substr(1)]()},click:function(C){var D=[C.pageX,C.pageY];var B=false;this.handle.each(function(){if(this==C.target){B=true}});if(B||this.disabled||!(this.currentHandle||this.previousHandle)){return }if(this.previousHandle){this.focus(this.previousHandle,1)}this.offset=this.element.offset();this.moveTo(this.convertValue(C[this.properties[0]=="top"?"pageY":"pageX"]-this.offset[this.properties[0]]-this.handleSize()/2))},start:function(C,B){var D=this.options;this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:C.pageY-this.handleOffset.top,left:C.pageX-this.handleOffset.left};this.firstValue=this.value();this.propagate("start",C);return false},stop:function(B){this.propagate("stop",B);if(this.firstValue!=this.value()){this.propagate("change",B)}return false},drag:function(F,E){var G=this.options;var C={top:F.pageY-this.offset.top-this.clickOffset.top,left:F.pageX-this.offset.left-this.clickOffset.left};var B=C[this.properties[0]];if(B>=this.size-this.handleSize()){B=this.size-this.handleSize()}if(B<=0){B=0}if(G.stepping){var D=this.convertValue(B);D=Math.round(D/G.stepping)*G.stepping;B=this.translateValue(D)}if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&B>=this.translateValue(this.value(1))){B=this.translateValue(this.value(1))}if(this.currentHandle[0]==this.handle[1]&&B<=this.translateValue(this.value(0))){B=this.translateValue(this.value(0))}}this.currentHandle.css(this.properties[0],B);if(this.rangeElement){this.updateRange()}this.propagate("slide",F);return false},moveTo:function(C,B){var D=this.options;if(B==undefined&&!this.currentHandle&&this.handle.length!=1){return false}if(B==undefined&&!this.currentHandle){B=0}if(B!=undefined){this.currentHandle=this.previousHandle=A(this.handle[B]||B)}if(C.constructor==String){C=/\-\=/.test(C)?this.value()-parseInt(C.replace("-=",""),10):this.value()+parseInt(C.replace("+=",""),10)}if(D.stepping){C=Math.round(C/D.stepping)*D.stepping}C=this.translateValue(C);if(C>=this.size-this.handleSize()){C=this.size-this.handleSize()}if(C<=0){C=0}if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&C>=this.translateValue(this.value(1))){C=this.translateValue(this.value(1))}if(this.currentHandle[0]==this.handle[1]&&C<=this.translateValue(this.value(0))){C=this.translateValue(this.value(0))}}this.currentHandle.css(this.properties[0],C);if(this.rangeElement){this.updateRange()}this.propagate("start",null);this.propagate("stop",null);this.propagate("change",null)}})})(jQuery);(function(A){if(window.Node&&Node.prototype&&!Node.prototype.contains){Node.prototype.contains=function(B){return !!(this.compareDocumentPosition(B)&16)}}A.fn.extend({sortable:function(C){var B=Array.prototype.slice.call(arguments,1);if(C=="serialize"){return A.data(this[0],"ui-sortable").serialize(arguments[1])}return this.each(function(){if(typeof C=="string"){var D=A.data(this,"ui-sortable");D[C].apply(D,B)}else{if(!A.data(this,"ui-sortable")){new A.ui.sortable(this,C)}}})}});A.ui.sortable=function(D,C){var B=this;this.element=A(D);A.data(D,"ui-sortable",this);this.element.addClass("ui-sortable");this.options=A.extend({},C);var E=this.options;A.extend(E,{items:this.options.items||"> *",zIndex:this.options.zIndex||1000,startCondition:function(){return !B.disabled}});A(D).bind("setData.sortable",function(G,F,H){B.options[F]=H}).bind("getData.sortable",function(G,F){return B.options[F]});this.refresh();this.floating=/left|right/.test(this.items[0].item.css("float"));if(!(/(relative|absolute|fixed)/).test(this.element.css("position"))){this.element.css("position","relative")}this.offset=this.element.offset({border:false});this.element.mouseInteraction({executor:this,delay:E.delay,distance:E.distance||0,dragPrevention:E.prevention?E.prevention.toLowerCase().split(","):["input","textarea","button","select","option"],start:this.start,stop:this.stop,drag:this.drag,condition:function(H){if(this.disabled){return false}var G=null,F=A(H.target).parents().andSelf().each(function(){if(A.data(this,"ui-sortable-item")){G=A(this)}});if(G&&(!this.options.handle||A(H.target).parents().andSelf().is(this.options.handle))){this.currentItem=G;return true}else{return false}}})};A.extend(A.ui.sortable.prototype,{plugins:{},ui:function(){return{helper:this.helper,placeholder:this.placeholder||A([]),position:this.position,absolutePosition:this.positionAbs,instance:this,options:this.options}},propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);this.element.triggerHandler(C=="sort"?C:"sort"+C,[B,this.ui()],this.options[C])},serialize:function(D){var B=A(this.options.items,this.element).not(".ui-sortable-helper");var C=[];D=D||{};B.each(function(){var E=(this.getAttribute(D.attribute||"id")||"").match(D.expression||(/(.+)[-=_](.+)/));if(E){C.push((D.key||E[1])+"[]="+(D.key?E[1]:E[2]))}});return C.join("&")},intersectsWith:function(I){var D=this.positionAbs.left,C=D+this.helperProportions.width,H=this.positionAbs.top,G=H+this.helperProportions.height;var E=I.left,B=E+I.width,J=I.top,F=J+I.height;return(E<D+(this.helperProportions.width/2)&&C-(this.helperProportions.width/2)<B&&J<H+(this.helperProportions.height/2)&&G-(this.helperProportions.height/2)<F)},refresh:function(){this.items=[];var B=this.items;var C=[A(this.options.items,this.element)];if(this.options.connectWith){for(var D=this.options.connectWith.length-1;D>=0;D--){var E=A.data(A(this.options.connectWith[D])[0],"ui-sortable");if(E&&!E.disabled){C.push(A(E.options.items,E.element))}}}for(var D=C.length-1;D>=0;D--){C[D].each(function(){A.data(this,"ui-sortable-item",true);B.push({item:A(this),width:0,height:0,left:0,top:0})})}},refreshPositions:function(B){for(var C=this.items.length-1;C>=0;C--){if(!B){this.items[C].width=this.items[C].item.outerWidth()}if(!B){this.items[C].height=this.items[C].item.outerHeight()}var D=this.items[C].item.offset();this.items[C].left=D.left;this.items[C].top=D.top}},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("ui-sortable").unbind(".sortable").removeMouseInteraction();for(var B=this.items.length-1;B>=0;B--){this.items[B].item.removeData("ui-sortable-item")}},enable:function(){this.element.removeClass("ui-sortable-disabled");this.disabled=false},disable:function(){this.element.addClass("ui-sortable-disabled");this.disabled=true},createPlaceholder:function(){this.placeholderElement=this.options.placeholderElement?A(this.options.placeholderElement,this.currentItem):this.currentItem;this.placeholder=A("<div></div>").addClass(this.options.placeholder).appendTo("body").css({position:"absolute"}).css(this.placeholderElement.offset()).css({width:this.placeholderElement.outerWidth(),height:this.placeholderElement.outerHeight()})},recallOffset:function(D){var C={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};var B=this.helper.css("position")=="relative";this.originalPosition={left:(B?parseInt(this.helper.css("left"),10)||0:C.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(B?parseInt(this.helper.css("top"),10)||0:C.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};this.offset={left:this._pageX-this.originalPosition.left+(parseInt(this.currentItem.css("marginLeft"),10)||0),top:this._pageY-this.originalPosition.top+(parseInt(this.currentItem.css("marginTop"),10)||0)}},start:function(D){var E=this.options;this.refresh();this.refreshPositions();this.helper=typeof E.helper=="function"?A(E.helper.apply(this.element[0],[D,this.currentItem])):this.currentItem.clone();this.helper.appendTo(this.currentItem[0].parentNode).css({position:"absolute",clear:"both"}).addClass("ui-sortable-helper");this.offsetParent=(function(F){while(F){if(F.style&&(/(absolute|relative|fixed)/).test(A.css(F,"position"))){return A(F)}F=F.parentNode?F.parentNode:null}return A("body")})(this.helper[0].parentNode);this.elementOffset=this.currentItem.offset();this.offsetParentOffset=this.offsetParent.offset();var C={left:this.elementOffset.left-this.offsetParentOffset.left,top:this.elementOffset.top-this.offsetParentOffset.top};this._pageX=D.pageX;this._pageY=D.pageY;this.clickOffset={left:D.pageX-this.elementOffset.left,top:D.pageY-this.elementOffset.top};var B=this.helper.css("position")=="relative";this.originalPosition={left:(B?parseInt(this.helper.css("left"),10)||0:C.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft)),top:(B?parseInt(this.helper.css("top"),10)||0:C.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop))};this.offset={left:D.pageX-this.originalPosition.left+(parseInt(this.currentItem.css("marginLeft"),10)||0),top:D.pageY-this.originalPosition.top+(parseInt(this.currentItem.css("marginTop"),10)||0)};this.position={top:D.pageY-this.offset.top,left:D.pageX-this.offset.left};this.positionAbs={left:D.pageX-this.clickOffset.left,top:D.pageY-this.clickOffset.top};this.positionDOM=this.currentItem.prev()[0];if(E.placeholder){this.createPlaceholder()}this.propagate("start",D);this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};A(this.currentItem).css("visibility","hidden");return false},stop:function(B){this.propagate("stop",B);if(this.positionDOM!=this.currentItem.prev()[0]){this.propagate("update",B)}if(this.cancelHelperRemoval){return false}A(this.currentItem).css("visibility","");if(this.placeholder){this.placeholder.remove()}this.helper.remove();return false},drag:function(C){this.direction=(this.floating&&this.positionAbs.left>C.pageX-this.clickOffset.left)||(this.positionAbs.top>C.pageY-this.clickOffset.top)?"down":"up";this.position={top:C.pageY-this.offset.top,left:C.pageX-this.offset.left};this.positionAbs={left:C.pageX-this.clickOffset.left,top:C.pageY-this.clickOffset.top};for(var B=this.items.length-1;B>=0;B--){if(this.intersectsWith(this.items[B])&&this.items[B].item[0]!=this.currentItem[0]&&(this.options.tree?!this.currentItem[0].contains(this.items[B].item[0]):true)){this.items[B].item[this.direction=="down"?"before":"after"](this.currentItem);this.refreshPositions(true);if(this.placeholderElement){this.placeholder.css(this.placeholderElement.offset())}this.propagate("change",C);break}}this.propagate("sort",C);this.helper.css({left:this.position.left+"px",top:this.position.top+"px"});return false}})})(jQuery);(function(A){A.ui.plugin.add("sortable","cursor",{start:function(D,C){var B=A("body");if(B.css("cursor")){C.options._cursor=B.css("cursor")}B.css("cursor",C.options.cursor)},stop:function(C,B){if(B.options._cursor){A("body").css("cursor",B.options._cursor)}}});A.ui.plugin.add("sortable","zIndex",{start:function(D,C){var B=C.helper;if(B.css("zIndex")){C.options._zIndex=B.css("zIndex")}B.css("zIndex",C.options.zIndex)},stop:function(C,B){if(B.options._zIndex){A(B.helper).css("zIndex",B.options._zIndex)}}});A.ui.plugin.add("sortable","opacity",{start:function(D,C){var B=C.helper;if(B.css("opacity")){C.options._opacity=B.css("opacity")}B.css("opacity",C.options.opacity)},stop:function(C,B){if(B.options._opacity){A(B.helper).css("opacity",B.options._opacity)}}});A.ui.plugin.add("sortable","revert",{stop:function(D,C){var B=C.instance;B.cancelHelperRemoval=true;var E=B.currentItem.offset();if(C.instance.options.zIndex){C.helper.css("zIndex",C.instance.options.zIndex)}if(C.instance.placeholder){C.instance.placeholder.animate({opacity:"hide"},parseInt(C.options.revert,10)||500)}C.helper.animate({left:E.left-B.offsetParentOffset.left-(parseInt(B.currentItem.css("marginLeft"),10)||0),top:E.top-B.offsetParentOffset.top-(parseInt(B.currentItem.css("marginTop"),10)||0)},parseInt(C.options.revert,10)||500,function(){B.currentItem.css("visibility","visible");window.setTimeout(function(){if(B.placeholder){B.placeholder.remove()}B.helper.remove();if(C.options._zIndex){C.helper.css("zIndex",C.options._zIndex)}},50)})}});A.ui.plugin.add("sortable","containment",{start:function(D,B){var F=B.options;if((F.containment.left!=undefined||F.containment.constructor==Array)&&!F._containment){return }if(!F._containment){F._containment=F.containment}if(F._containment=="parent"){F._containment=this[0].parentNode}if(F._containment=="document"){F.containment=[0,0,A(document).width(),(A(document).height()||document.body.parentNode.scrollHeight)]}else{var C=A(F._containment)[0];var E=A(F._containment).offset();F.containment=[E.left,E.top,E.left+(C.offsetWidth||C.scrollWidth),E.top+(C.offsetHeight||C.scrollHeight)]}},sort:function(E,D){var F=D.options;var C=D.helper;var G=F.containment;var B=D.instance;if(G.constructor==Array){if((D.absolutePosition.left<G[0])){B.position.left=G[0]-(B.offset.left-B.clickOffset.left)}if((D.absolutePosition.top<G[1])){B.position.top=G[1]-(B.offset.top-B.clickOffset.top)}if(D.absolutePosition.left-G[2]+B.helperProportions.width>=0){B.position.left=G[2]-(B.offset.left-B.clickOffset.left)-B.helperProportions.width}if(D.absolutePosition.top-G[3]+B.helperProportions.height>=0){B.position.top=G[3]-(B.offset.top-B.clickOffset.top)-B.helperProportions.height}}else{if((D.position.left<G.left)){B.position.left=G.left}if((D.position.top<G.top)){B.position.top=G.top}if(D.position.left-B.offsetParent.innerWidth()+B.helperProportions.width+G.right+(parseInt(B.offsetParent.css("borderLeftWidth"),10)||0)+(parseInt(B.offsetParent.css("borderRightWidth"),10)||0)>=0){B.position.left=B.offsetParent.innerWidth()-B.helperProportions.width-G.right-(parseInt(B.offsetParent.css("borderLeftWidth"),10)||0)-(parseInt(B.offsetParent.css("borderRightWidth"),10)||0)}if(D.position.top-B.offsetParent.innerHeight()+B.helperProportions.height+G.bottom+(parseInt(B.offsetParent.css("borderTopWidth"),10)||0)+(parseInt(B.offsetParent.css("borderBottomWidth"),10)||0)>=0){B.position.top=B.offsetParent.innerHeight()-B.helperProportions.height-G.bottom-(parseInt(B.offsetParent.css("borderTopWidth"),10)||0)-(parseInt(B.offsetParent.css("borderBottomWidth"),10)||0)}}}});A.ui.plugin.add("sortable","axis",{sort:function(C,B){var D=B.options;if(D.constraint){D.axis=D.constraint}D.axis=="x"?B.instance.position.top=B.instance.originalPosition.top:B.instance.position.left=B.instance.originalPosition.left}});A.ui.plugin.add("sortable","scroll",{start:function(C,B){var D=B.options;D.scrollSensitivity=D.scrollSensitivity||20;D.scrollSpeed=D.scrollSpeed||20;B.instance.overflowY=function(E){do{if((/auto|scroll/).test(E.css("overflow"))||(/auto|scroll/).test(E.css("overflow-y"))){return E}E=E.parent()}while(E[0].parentNode);return A(document)}(this);B.instance.overflowX=function(E){do{if((/auto|scroll/).test(E.css("overflow"))||(/auto|scroll/).test(E.css("overflow-x"))){return E}E=E.parent()}while(E[0].parentNode);return A(document)}(this)},sort:function(D,C){var E=C.options;var B=C.instance;if(B.overflowY[0]!=document&&B.overflowY[0].tagName!="HTML"){if(B.overflowY[0].offsetHeight-(C.position.top-B.overflowY[0].scrollTop+B.clickOffset.top)<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop+E.scrollSpeed}if((C.position.top-B.overflowY[0].scrollTop+B.clickOffset.top)<E.scrollSensitivity){B.overflowY[0].scrollTop=B.overflowY[0].scrollTop-E.scrollSpeed}}else{if(D.pageY-A(document).scrollTop()<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()-E.scrollSpeed)}if(A(window).height()-(D.pageY-A(document).scrollTop())<E.scrollSensitivity){A(document).scrollTop(A(document).scrollTop()+E.scrollSpeed)}}if(B.overflowX[0]!=document&&B.overflowX[0].tagName!="HTML"){if(B.overflowX[0].offsetWidth-(C.position.left-B.overflowX[0].scrollLeft+B.clickOffset.left)<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft+E.scrollSpeed}if((C.position.top-B.overflowX[0].scrollLeft+B.clickOffset.left)<E.scrollSensitivity){B.overflowX[0].scrollLeft=B.overflowX[0].scrollLeft-E.scrollSpeed}}else{if(D.pageX-A(document).scrollLeft()<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()-E.scrollSpeed)}if(A(window).width()-(D.pageX-A(document).scrollLeft())<E.scrollSensitivity){A(document).scrollLeft(A(document).scrollLeft()+E.scrollSpeed)}}C.instance.recallOffset(D)}})})(jQuery);if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(K,B,L,D,H,I,F,E,C,J){if(!document.getElementById){return }this.DETECT_KEY=J?J:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(K){this.setAttribute("swf",K)}if(B){this.setAttribute("id",B)}if(L){this.setAttribute("width",L)}if(D){this.setAttribute("height",D)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(I){this.addParam("bgcolor",I)}var A=F?F:"high";this.addParam("quality",A);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var G=(E)?E:window.location;this.setAttribute("xiRedirectUrl",G);this.setAttribute("redirectUrl","");if(C){this.setAttribute("redirectUrl",C)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(B,A){this.params[B]=A},getParams:function(){return this.params},addVariable:function(B,A){this.variables[B]=A},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var C=new Array();var B;var A=this.getVariables();for(B in A){C[C.length]=B+"="+A[B]}return C},getSWFHTML:function(){var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}B='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';B+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var F=this.getParams();for(var E in F){B+=[E]+'="'+F[E]+'" '}var D=this.getVariablePairs().join("&");if(D.length>0){B+='flashvars="'+D+'"'}B+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}B='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';B+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var E in C){B+='<param name="'+E+'" value="'+C[E]+'" />'}var A=this.getVariablePairs().join("&");if(A.length>0){B+='<param name="flashvars" value="'+A+'" />'}B+="</object>"}return B},write:function(B){if(this.getAttribute("useExpressInstall")){var A=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(A)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof B=="string")?document.getElementById(B):B;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var E=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){E=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=1;var C=3;while(B){try{C++;B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+C);E=new deconcept.PlayerVersion([C,0,0])}catch(D){B=null}}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(D){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");E=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(D){if(E.major==6){return E}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(D){}}if(B!=null){E=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}}return E};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(C){var D=document.location.search||document.location.hash;if(C==null){return D}if(D){var B=D.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==C){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var C=B.length-1;C>=0;C--){B[C].style.display="none";for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;jQuery.fn.corner=function(A){var B={tl:{radius:8},tr:{radius:8},bl:{radius:8},br:{radius:8},antiAlias:true,autoPad:true,validTags:["div"]};if(A&&typeof (A)!="string"){jQuery.extend(B,A)}return this.each(function(){new curvyObject(B,this).applyCorners()})};function curvyObject(){this.box=arguments[1];this.settings=arguments[0];this.topContainer=null;this.bottomContainer=null;this.masterCorners=new Array();this.contentDIV=null;var D=$(this.box).css("height");var C=$(this.box).css("width");var A=$(this.box).css("borderTopWidth");var G=$(this.box).css("backgroundImage");var B=$(this.box).css("position");var H=$(this.box).css("paddingTop");var E=$(this.box).css("paddingBottom");var F=$(this.box).css("paddingLeft");var I=$(this.box).css("paddingRight");this.boxPaddingTop=strip_px(H);this.boxPaddingBottom=strip_px(E);this.boxPaddingLeft=strip_px(F);this.boxPaddingRight=strip_px(I);this.borderColour=format_colour($(this.box).css("borderTopColor"));this.boxColour=format_colour($(this.box).css("backgroundColor"));this.boxHeight=parseInt(((D!=""&&D!="auto"&&D.indexOf("%")==-1)?D.substring(0,D.indexOf("px")):this.box.scrollHeight));this.boxWidth=parseInt(((C!=""&&C!="auto"&&C.indexOf("%")==-1)?C.substring(0,C.indexOf("px")):this.box.scrollWidth));this.borderWidth=parseInt(((A!=""&&A.indexOf("px")!==-1)?A.slice(0,A.indexOf("px")):0));this.borderString=this.borderWidth+"px solid "+this.borderColour;this.bgImage=((G!="none")?G:"");if(this.bgImage=="initial"){this.bgImage=""}this.boxContent=this.box.innerHTML;if(B!="absolute"){$(this.box).css("position","relative")}$(this.box).css("padding","0px !important");if(($.browser.msie&&$.browser.version==6)&&C=="auto"&&D=="auto"){$(this.box).css("width","100%")}if(($.browser.msie)){$(this.box).css("zoom","1");$(this.box+" *").css("zoom","normal")}if(this.settings.autoPad==true&&(this.boxPaddingTop>0||this.boxPaddingBottom>0||this.boxPaddingLeft>0||this.boxPaddingRight>0)){this.box.innerHTML=""}this.applyCorners=function(){for(var d=0;d<2;d++){switch(d){case 0:if(this.settings.tl||this.settings.tr){var X=document.createElement("DIV");var S=Math.max(this.settings.tl?this.settings.tl.radius:0,this.settings.tr?this.settings.tr.radius:0);$(X).css({width:"100%","font-size":"1px",overflow:"hidden",position:"absolute","padding-left":this.borderWidth,"padding-right":this.borderWidth,height:S+"px",top:0-S+"px",left:0-this.borderWidth+"px"});this.topContainer=this.box.appendChild(X)}break;case 1:if(this.settings.bl||this.settings.br){var X=document.createElement("DIV");var Y=Math.max(this.settings.bl?this.settings.bl.radius:0,this.settings.br?this.settings.br.radius:0);$(X).css({width:"100%","font-size":"1px",overflow:"hidden",position:"absolute","padding-left":this.borderWidth,"padding-right":this.borderWidth,height:Y,bottom:0-Y+"px",left:0-this.borderWidth+"px"});this.bottomContainer=this.box.appendChild(X)}break}}if(this.settings.autoPad==true&&(this.boxPaddingTop>0||this.boxPaddingBottom>0||this.boxPaddingLeft>0||this.boxPaddingRight>0)){var e=document.createElement("DIV");$(e).css("position","relative").html(this.boxContent).addClass="autoPadDiv";var r=Math.abs(S-this.boxPaddingTop);var u=Math.abs(Y-this.boxPaddingBottom);if(S<this.boxPaddingTop){$(e).css("padding-top",r)}else{$(e).css("padding-top",this.boxPaddingTop)}if(Y<this.boxPaddingBottom){$(e).css("padding-bottom",u)}else{$(e).css("padding-bottom",this.boxPaddingBottom)}$(e).css({"padding-left":this.boxPaddingLeft,"padding-right":this.boxPaddingRight});this.contentDIV=this.box.appendChild(e)}if(this.topContainer){$(this.box).css("border-top",0)}if(this.bottomContainer){$(this.box).css("border-bottom",0)}var h=["tr","tl","br","bl"];for(var o in h){if(o>-1<4){var g=h[o];if(!this.settings[g]){if(((g=="tr"||g=="tl")&&this.topContainer!=null)||((g=="br"||g=="bl")&&this.bottomContainer!=null)){var W=document.createElement("DIV");$(W).css({position:"relative","font-size":"1px",overflow:"hidden"});if(this.bgImage==""){$(W).css("background-color",this.boxColour)}else{$(W).css("background-image",this.bgImage).css("background-color",this.boxColour)}switch(g){case"tl":$(W).css({height:S-this.borderWidth,"margin-right":this.settings.tr.radius-(this.borderWidth*2),"border-left":this.borderString,"border-top":this.borderString,left:-this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":this.borderWidth+"px 0px"});break;case"tr":$(W).css({height:S-this.borderWidth,"margin-left":this.settings.tl.radius-(this.borderWidth*2),"border-right":this.borderString,"border-top":this.borderString,left:this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"-"+(S+this.borderWidth)+"px 0px"});break;case"bl":if(S>0){$(W).css({height:Y-this.borderWidth,"margin-right":this.settings.br.radius-(this.borderWidth*2),"border-left":this.borderString,"border-bottom":this.borderString,left:-this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"0px -"+($(this.box).height()+S-this.borderWidth+1)+"px"})}else{$(W).css({height:Y-this.borderWidth,"margin-right":this.settings.br.radius-(this.borderWidth*2),"border-left":this.borderString,"border-bottom":this.borderString,left:-this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"0px -"+($(this.box).height())+"px"})}break;case"br":if(S>0){$(W).css({height:Y-this.borderWidth,"margin-left":this.settings.bl.radius-(this.borderWidth*2),"border-right":this.borderString,"border-bottom":this.borderString,left:this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"-"+this.settings.bl.radius+this.borderWidth+"px -"+($(this.box).height()+S-this.borderWidth+1)+"px"})}else{$(W).css({height:Y-this.borderWidth,"margin-left":this.settings.bl.radius-(this.borderWidth*2),"border-right":this.borderString,"border-bottom":this.borderString,left:this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"-"+this.settings.bl.radius+this.borderWidth+"px -"+($(this.box).height())+"px"})}break}}}else{if(this.masterCorners[this.settings[g].radius]){var W=this.masterCorners[this.settings[g].radius].cloneNode(true)}else{var W=document.createElement("DIV");$(W).css({height:this.settings[g].radius,width:this.settings[g].radius,position:"absolute","font-size":"1px",overflow:"hidden"});var N=parseInt(this.settings[g].radius-this.borderWidth);for(var U=0,n=this.settings[g].radius;U<n;U++){if((U+1)>=N){var P=-1}else{var P=(Math.floor(Math.sqrt(Math.pow(N,2)-Math.pow((U+1),2)))-1)}if(N!=n){if((U)>=N){var M=-1}else{var M=Math.ceil(Math.sqrt(Math.pow(N,2)-Math.pow(U,2)))}if((U+1)>=n){var K=-1}else{var K=(Math.floor(Math.sqrt(Math.pow(n,2)-Math.pow((U+1),2)))-1)}}if((U)>=n){var J=-1}else{var J=Math.ceil(Math.sqrt(Math.pow(n,2)-Math.pow(U,2)))}if(P>-1){this.drawPixel(U,0,this.boxColour,100,(P+1),W,-1,this.settings[g].radius)}if(N!=n){for(var T=(P+1);T<M;T++){if(this.settings.antiAlias){if(this.bgImage!=""){var L=(pixelFraction(U,T,N)*100);if(L<30){this.drawPixel(U,T,this.borderColour,100,1,W,0,this.settings[g].radius)}else{this.drawPixel(U,T,this.borderColour,100,1,W,-1,this.settings[g].radius)}}else{var f=BlendColour(this.boxColour,this.borderColour,pixelFraction(U,T,N));this.drawPixel(U,T,f,100,1,W,0,this.settings[g].radius,g)}}}if(this.settings.antiAlias){if(K>=M){if(M==-1){M=0}this.drawPixel(U,M,this.borderColour,100,(K-M+1),W,0,0)}}else{if(K>=P){this.drawPixel(U,(P+1),this.borderColour,100,(K-P),W,0,0)}}var R=this.borderColour}else{var R=this.boxColour;var K=P}if(this.settings.antiAlias){for(var T=(K+1);T<J;T++){this.drawPixel(U,T,R,(pixelFraction(U,T,n)*100),1,W,((this.borderWidth>0)?0:-1),this.settings[g].radius)}}}this.masterCorners[this.settings[g].radius]=W.cloneNode(true)}if(g!="br"){for(var d=0,m=W.childNodes.length;d<m;d++){var V=W.childNodes[d];var l=strip_px($(V).css("top"));var q=strip_px($(V).css("left"));var s=strip_px($(V).css("height"));if(g=="tl"||g=="bl"){$(V).css("left",this.settings[g].radius-q-1+"px")}if(g=="tr"||g=="tl"){$(V).css("top",this.settings[g].radius-s-l+"px")}switch(g){case"tr":$(V).css("background-position","-"+Math.abs((this.boxWidth-this.settings[g].radius+this.borderWidth)+q)+"px -"+Math.abs(this.settings[g].radius-s-l-this.borderWidth)+"px");break;case"tl":$(V).css("background-position","-"+Math.abs((this.settings[g].radius-q-1)-this.borderWidth)+"px -"+Math.abs(this.settings[g].radius-s-l-this.borderWidth)+"px");break;case"bl":if(S>0){$(V).css("background-position","-"+Math.abs((this.settings[g].radius-q-1)-this.borderWidth)+"px -"+Math.abs(($(this.box).height()+S-this.borderWidth+1))+"px")}else{$(V).css("background-position","-"+Math.abs((this.settings[g].radius-q-1)-this.borderWidth)+"px -"+Math.abs(($(this.box).height()))+"px")}break}}}}if(W){switch(g){case"tl":if($(W).css("position")=="absolute"){$(W).css("top","0")}if($(W).css("position")=="absolute"){$(W).css("left","0")}if(this.topContainer){this.topContainer.appendChild(W)}break;case"tr":if($(W).css("position")=="absolute"){$(W).css("top","0")}if($(W).css("position")=="absolute"){$(W).css("right","0")}if(this.topContainer){this.topContainer.appendChild(W)}break;case"bl":if($(W).css("position")=="absolute"){$(W).css("bottom","0")}if(W.style.position=="absolute"){$(W).css("left","0")}if(this.bottomContainer){this.bottomContainer.appendChild(W)}break;case"br":if($(W).css("position")=="absolute"){$(W).css("bottom","0")}if($(W).css("position")=="absolute"){$(W).css("right","0")}if(this.bottomContainer){this.bottomContainer.appendChild(W)}break}}}}var Z=new Array();Z.t=Math.abs(this.settings.tl.radius-this.settings.tr.radius);Z.b=Math.abs(this.settings.bl.radius-this.settings.br.radius);for(z in Z){if(z=="t"||z=="b"){if(Z[z]){var p=((this.settings[z+"l"].radius<this.settings[z+"r"].radius)?z+"l":z+"r");var O=document.createElement("DIV");$(O).css({height:Z[z],width:this.settings[p].radius+"px",position:"absolute","font-size":"1px",overflow:"hidden","background-color":this.boxColour});switch(p){case"tl":$(O).css({bottom:"0",left:"0","border-left":this.borderString});this.topContainer.appendChild(O);break;case"tr":$(O).css({bottom:"0",right:"0","border-right":this.borderString});this.topContainer.appendChild(O);break;case"bl":$(O).css({top:"0",left:"0","border-left":this.borderString});this.bottomContainer.appendChild(O);break;case"br":$(O).css({top:"0",right:"0","border-right":this.borderString});this.bottomContainer.appendChild(O);break}}var Q=document.createElement("DIV");$(Q).css({position:"relative","font-size":"1px",overflow:"hidden","background-color":this.boxColour,"background-image":this.bgImage,"background-repeat":$(this.box).css("background-repeat")});switch(z){case"t":if(this.topContainer){if(this.settings.tl.radius&&this.settings.tr.radius){$(Q).css({height:S-this.borderWidth+"px","margin-left":this.settings.tl.radius-this.borderWidth+"px","margin-right":this.settings.tr.radius-this.borderWidth+"px","border-top":this.borderString});if(this.bgImage!=""){$(Q).css("background-position","-"+(S+this.borderWidth)+"px 0px")}this.topContainer.appendChild(Q)}$(this.box).css("background-position","0px -"+(S-this.borderWidth+1)+"px")}break;case"b":if(this.bottomContainer){if(this.settings.bl.radius&&this.settings.br.radius){$(Q).css({height:Y-this.borderWidth+"px","margin-left":this.settings.bl.radius-this.borderWidth+"px","margin-right":this.settings.br.radius-this.borderWidth+"px","border-bottom":this.borderString});if(this.bgImage!=""&&S>0){$(Q).css("background-position","-"+(this.settings.bl.radius-this.borderWidth)+"px -"+($(this.box).height()+S-this.borderWidth+1)+"px")}else{$(Q).css("background-position","-"+(this.settings.bl.radius-this.borderWidth)+"px -"+($(this.box).height())+"px")}this.bottomContainer.appendChild(Q)}}break}}}};this.drawPixel=function(S,P,J,O,Q,R,L,N){var K=document.createElement("DIV");$(K).css({height:Q,width:"1px",position:"absolute","font-size":"1px",overflow:"hidden"});var M=Math.max(this.settings.tr.radius,this.settings.tl.radius);if(L==-1&&this.bgImage!=""){if(M>0){$(K).css("background-position","-"+((this.boxWidth-N-this.borderWidth)+S)+"px -"+(($(this.box).height()+M-this.borderWidth)-P)+"px")}else{$(K).css("background-position","-"+((this.boxWidth-N-this.borderWidth)+S)+"px -"+(($(this.box).height())-P)+"px")}$(K).css({"background-image":this.bgImage,"background-repeat":$(this.box).css("background-repeat"),"background-color":J,"background-position":"-"+((this.boxWidth-N-this.borderWidth)+S)+"px -"+(($(this.box).height()+M-this.borderWidth)-P)+"px"})}else{$(K).css("background-color",J)}if(O!=100){setOpacity(K,O)}$(K).css({top:P+"px",left:S+"px"});R.appendChild(K)}}function BlendColour(L,J,G){var D=parseInt(L.substr(1,2),16);var K=parseInt(L.substr(3,2),16);var F=parseInt(L.substr(5,2),16);var C=parseInt(J.substr(1,2),16);var I=parseInt(J.substr(3,2),16);var E=parseInt(J.substr(5,2),16);if(G>1||G<0){G=1}var H=Math.round((D*G)+(C*(1-G)));if(H>255){H=255}if(H<0){H=0}var B=Math.round((K*G)+(I*(1-G)));if(B>255){B=255}if(B<0){B=0}var A=Math.round((F*G)+(E*(1-G)));if(A>255){A=255}if(A<0){A=0}return"#"+IntToHex(H)+IntToHex(B)+IntToHex(A)}function IntToHex(A){base=A/16;rem=A%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+""+remS}function MakeHex(A){if((A>=0)&&(A<=9)){return A}else{switch(A){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F"}}}function pixelFraction(H,G,A){var C=0;var B=new Array(1);var F=new Array(1);var I=0;var D="";var E=Math.sqrt((Math.pow(A,2)-Math.pow(H,2)));if((E>=G)&&(E<(G+1))){D="Left";B[I]=0;F[I]=E-G;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(G+1,2)));if((E>=H)&&(E<(H+1))){D=D+"Top";B[I]=E-H;F[I]=1;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(H+1,2)));if((E>=G)&&(E<(G+1))){D=D+"Right";B[I]=1;F[I]=E-G;I=I+1}var E=Math.sqrt((Math.pow(A,2)-Math.pow(G,2)));if((E>=H)&&(E<(H+1))){D=D+"Bottom";B[I]=E-H;F[I]=0}switch(D){case"LeftRight":C=Math.min(F[0],F[1])+((Math.max(F[0],F[1])-Math.min(F[0],F[1]))/2);break;case"TopRight":C=1-(((1-B[0])*(1-F[1]))/2);break;case"TopBottom":C=Math.min(B[0],B[1])+((Math.max(B[0],B[1])-Math.min(B[0],B[1]))/2);break;case"LeftBottom":C=(F[0]*B[1])/2;break;default:C=1}return C}function rgb2Hex(B){try{var C=rgb2Array(B);var G=parseInt(C[0]);var E=parseInt(C[1]);var A=parseInt(C[2]);var D="#"+IntToHex(G)+IntToHex(E)+IntToHex(A)}catch(F){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex")}return D}function rgb2Array(A){var C=A.substring(4,A.indexOf(")"));var B=C.split(", ");return B}function setOpacity(F,C){C=(C==100)?99.999:C;if($.browser.safari&&F.tagName!="IFRAME"){var B=rgb2Array(F.style.backgroundColor);var E=parseInt(B[0]);var D=parseInt(B[1]);var A=parseInt(B[2]);F.style.backgroundColor="rgba("+E+", "+D+", "+A+", "+C/100+")"}else{if(typeof (F.style.opacity)!="undefined"){F.style.opacity=C/100}else{if(typeof (F.style.MozOpacity)!="undefined"){F.style.MozOpacity=C/100}else{if(typeof (F.style.filter)!="undefined"){F.style.filter="alpha(opacity:"+C+")"}else{if(typeof (F.style.KHTMLOpacity)!="undefined"){F.style.KHTMLOpacity=C/100}}}}}}function format_colour(B){var A="#ffffff";if(B!=""&&B!="transparent"){if(B.substr(0,3)=="rgb"){A=rgb2Hex(B)}else{if(B.length==4){A="#"+B.substring(1,2)+B.substring(1,2)+B.substring(2,3)+B.substring(2,3)+B.substring(3,4)+B.substring(3,4)}else{A=B}}}return A}function strip_px(A){return parseInt(((A!=""&&A.indexOf("px")!==-1)?A.slice(0,A.indexOf("px")):0))}var tb_pathToImage="/0/thickbox/loadingAnimation.gif";
/*!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
$(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox");imgLoader=new Image();imgLoader.src=tb_pathToImage});function tb_init(A){$(A).click(function(){var D=this.firstChild.title||this.title||this.name||null;var B=this.href||this.alt;var E=this.rel||false;var C=this.id.substring(3);tb_show(D,B,E,C);this.blur();return false})}function chgImg(B,A){$("#TB_Image").get(0).src=A;if(B=="m"){$("#TB_med").hide();$("#TB_med_gray").show();$("#TB_lrg").show();$("#TB_lrg_gray").hide();$("#TB_org").show();$("#TB_org_gray").hide()}else{if(B=="l"){$("#TB_med").show();$("#TB_med_gray").hide();$("#TB_lrg").hide();$("#TB_lrg_gray").show();$("#TB_org").show();$("#TB_org_gray").hide()}else{if(B=="o"){$("#TB_med").show();$("#TB_med_gray").hide();$("#TB_lrg").show();$("#TB_lrg_gray").hide();$("#TB_org").hide();$("#TB_org_gray").show()}}}}function tb_show(A,C,D,E){var B=null;if(D=="tlimgs"){B=tl_pics[E]}else{B=g_pics[E]}tb_show_pic(A,C,D,E,B)}scrollPos=[0,0];function tb_show_pic(M,A,F,C,G){scrollPos=getScrollXY();setScrollXY(0,0);try{hideSel();if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div><div id='TB_All'><div id='TB_ToolBar'></div><div id='TB_window'></div><div id='TB_Caption'></div><div id='TB_CommentBox'></div></div>");$("#TB_overlay").click(tb_remove);var J=Client.pageSize();$("#TB_overlay").get(0).style.height=J.height+"px"}var K=G.isParticipant?1:0;if(F!="tlimgs"){$("#TB_CommentBox").load("/cmd/Tcomment",{eid:G.eid,ptcp:K,mid:C,tlid:G.timeline_id,type:"media"})}else{$("#TB_CommentBox").hide()}if(M===null){M=""}$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");$("#TB_load").show();var B;if(A.indexOf("?")!==-1){B=A.substr(0,A.indexOf("?"))}else{B=A}var E=/\.jpg|\.jpeg|\.png|\.gif|\.bmp/g;var N=B.toLowerCase().match(E);if(N==".jpg"||N==".jpeg"||N==".png"||N==".gif"||N==".bmp"){$("body").append("");TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_PrevMID="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_NextMID="";TB_imageCount="";TB_FoundURL=false;if(F){TB_TempArray=$("a[@rel="+F+"]").get();for(TB_Counter=0;((TB_Counter<TB_TempArray.length)&&(TB_NextHTML===""));TB_Counter++){var D=TB_TempArray[TB_Counter].href.toLowerCase().match(E);if(!(TB_TempArray[TB_Counter].href==A)){if(TB_FoundURL){TB_NextCaption=TB_TempArray[TB_Counter].firstChild.title;TB_NextURL=TB_TempArray[TB_Counter].href;TB_NextMID=TB_TempArray[TB_Counter].id.substring(3);TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#' class='tlink'>Next &gt;</a></span>"}else{TB_PrevCaption=TB_TempArray[TB_Counter].firstChild.title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevMID=TB_TempArray[TB_Counter].id.substring(3);TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#' class='tlink'>&lt; Prev</a></span>"}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length)}}}if(TB_NextHTML==""){TB_NextHTML="<span style='color:#666'>&nbsp;&nbsp;Next &gt;</span>"}if(TB_PrevHTML==""){TB_PrevHTML="<span style='color:#666'>&lt; Prev</span>"}imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var S=tb_getPageSize();var e=500;var Z=500;var Y=imgPreloader.width;var V=imgPreloader.height;if(Y>e){V=V*(e/Y);Y=e;if(V>Z){Y=Y*(Z/V);V=Z}}else{if(V>Z){Y=Y*(Z/V);V=Z;if(Y>e){V=V*(e/Y);Y=e}}}var P="<span id='TB_med_gray' style='color:#666'>M</span>";var O='<span style="margin:0px 10px">|</span>'+P+"";if(g_pics[C]){var U=g_pics[C];var T="<span style='display:none;' id='TB_med'><a onClick=\"chgImg('m', '"+U.base+U.m+"')\" href='#' class='tlink'>M</a></span>";O+=T;if(g_pics[C].l){var R="<span id='TB_lrg_gray' style='margin-left:10px;display:none;color:#666'>L</span>";var X="<span id='TB_lrg' style='margin-left:10px'><a onClick=\"chgImg('l', '"+U.base+U.l+"')\" href='#' class='tlink'>L</a></span>";O+=R;O+=X}if(g_pics[C].o){var f="<span id='TB_org_gray' style='margin-left:10px;display:none;color:#666'>O</span>";var Q="<span id='TB_org' style='margin-left:10px'><a onClick=\"chgImg('o', '"+U.base+U.o+"')\" href='#' class='tlink'>O</a></span>";O+=f;O+=Q}}TB_WIDTH=Y+30;TB_HEIGHT=V+60;$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+A+"' alt='"+M+"'/></a>");if(M){$("#TB_Caption").append("<div id='TB_cap'>"+M+"</div>")}$("#TB_ToolBar").append("<span>"+TB_imageCount+"</span>"+O+"<span style='margin:0px 10px'>|</span>"+TB_PrevHTML+"<span style='margin:0px 10px'>|</span>"+TB_NextHTML+"<span style='margin:0px 10px'>|</span><span id='TB_closeWindowButton'><a href='#' class='tlink' title='Close'>close</a></span>");$("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function W(){if($(document).unbind("click",W)){$(document).unbind("click",W)}$("#TB_overlay").remove();$("#TB_All").remove();$("#TB_ToolBar").remove();$("#TB_Caption").remove();$("#TB_CommentBox").remove();tb_show(TB_PrevCaption,TB_PrevURL,F,TB_PrevMID);return false}$("#TB_prev").click(W)}if(!(TB_NextHTML==="")){function d(){$("#TB_overlay").remove();$("#TB_All").remove();$("#TB_ToolBar").remove();$("#TB_Caption").remove();$("#TB_CommentBox").remove();tb_show(TB_NextCaption,TB_NextURL,F,TB_NextMID);return false}$("#TB_next").click(d)}tb_position();$("#TB_load").remove();$("#TB_ImageOff").click(tb_remove);$("#TB_window").css({display:"block"})};imgPreloader.src=A}else{}tb_position();$("#TB_closeWindowButton").click(tb_remove);if(A.indexOf("TB_inline")!=-1){$("#TB_ajaxContent").html($("#"+params.inlineId).html());tb_position();$("#TB_load").remove();$("#TB_window").css({display:"block"})}if(!(TB_PrevHTML==="")){function I(){if($(document).unbind("click",I)){$(document).unbind("click",I)}$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption,TB_PrevURL,F,TB_PrevMID);return false}$("#TB_prev").click(I)}if(!(TB_NextHTML==="")){function L(){$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption,TB_NextURL,F,TB_NextMID);return false}$("#TB_next").click(L)}}catch(H){}}function tb_showIframe(){$("#TB_load").remove();$("#TB_window").css({display:"block"})}function tb_remove(){$("#TB_imageOff").unbind("click");$("#TB_overlay").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$("#TB_All,#TB_CommentBox,#TB_ToolBar,#TB_window,#TB_overlay,#TB_HideSelect").remove()});$("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","")}document.onkeydown="";setScrollXY(scrollPos[0],scrollPos[1]);return false}function tb_position(){if(!(jQuery.browser.msie&&typeof XMLHttpRequest=="function")){}}function tb_parseQuery(D){var E={};if(!D){return E}var A=D.split(/[;&]/);for(var C=0;C<A.length;C++){var G=A[C].split("=");if(!G||G.length!=2){continue}var B=unescape(G[0]);var F=unescape(G[1]);F=F.replace(/\+/g," ");E[B]=F}return E}function tb_getPageSize(){var C=document.documentElement;var A=window.innerWidth||self.innerWidth||(C&&C.clientWidth)||document.body.clientWidth;var B=window.innerHeight||self.innerHeight||(C&&C.clientHeight)||document.body.clientHeight;arrayPageSize=[A,B];return arrayPageSize}(function(B){B.dimensions={version:"1.2"};B.each(["Height","Width"],function(D,C){B.fn["inner"+C]=function(){if(!this[0]){return }var F=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+C]:A(this,C.toLowerCase())+A(this,"padding"+F)+A(this,"padding"+E)};B.fn["outer"+C]=function(F){if(!this[0]){return }var H=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";F=B.extend({margin:false},F||{});var G=this.is(":visible")?this[0]["offset"+C]:A(this,C.toLowerCase())+A(this,"border"+H+"Width")+A(this,"border"+E+"Width")+A(this,"padding"+H)+A(this,"padding"+E);return G+(F.margin?(A(this,"margin"+H)+A(this,"margin"+E)):0)}});B.each(["Left","Top"],function(D,C){B.fn["scroll"+C]=function(E){if(!this[0]){return }return E!=undefined?this.each(function(){this==window||this==document?window.scrollTo(C=="Left"?E:B(window)["scrollLeft"](),C=="Top"?E:B(window)["scrollTop"]()):this["scroll"+C]=E}):this[0]==window||this[0]==document?self[(C=="Left"?"pageXOffset":"pageYOffset")]||B.boxModel&&document.documentElement["scroll"+C]||document.body["scroll"+C]:this[0]["scroll"+C]}});B.fn.extend({position:function(){var H=0,G=0,F=this[0],I,C,E,D;if(F){E=this.offsetParent();I=this.offset();C=E.offset();I.top-=A(F,"marginTop");I.left-=A(F,"marginLeft");C.top+=A(E,"borderTopWidth");C.left+=A(E,"borderLeftWidth");D={top:I.top-C.top,left:I.left-C.left}}return D},offsetParent:function(){var C=this[0].offsetParent;while(C&&(!/^body|html$/i.test(C.tagName)&&B.css(C,"position")=="static")){C=C.offsetParent}return B(C)}});function A(C,D){return parseInt(B.curCSS(C.jquery?C[0]:C,D,true))||0}})(jQuery);(function(F){var C=[8,0,0];var I=[0,0,0];var B;var D;var E=function(J){var K=null;if(typeof navigator.plugins!="undefined"&&typeof navigator.plugins["Shockwave Flash"]=="object"){K=navigator.plugins["Shockwave Flash"].description;if(K){K=K.replace(/^.*\s+(\S+\s+\S+$)/,"$1");I[0]=parseInt(K.replace(/^(.*)\..*$/,"$1"),10);I[1]=parseInt(K.replace(/^.*\.(.*)\s.*$/,"$1"),10);if(/r/.test(K)){I[2]=parseInt(K.replace(/^.*r(.*)$/,"$1"),10)}else{I[2]=0}if(I[0]>J[0]||(I[0]==J[0]&&I[1]>J[1])||(I[0]==J[0]&&I[1]==J[1]&&I[2]>=J[2])){return true}else{return false}}}return false};var G=function(){if(typeof window.clipboardData!="undefined"){return true}};var A=function(J){if(D&&typeof console!="undefined"&&typeof console.log=="function"){console.log(J)}};var H=function(){if(F.clipboardReady.done){return false}if(typeof F.clipboardReady.counter=="undefined"){F.clipboardReady.counter=0}F.clipboardReady.counter++;if(F.clipboardReady.counter>599){clearInterval(F.clipboardReady.timer);A("Waited "+F.clipboardReady.counter/10+" seconds for Flash object to load, terminating.");return false}if((F.clipboardReady.counter%100)==0){A("Waited "+F.clipboardReady.counter/10+" seconds for Flash object to load so far...")}var K=F("#jquery_clipboard_swf:first");var L=F(K).get(0);if(typeof L.jqueryClipboardCopy=="function"&&L.jqueryClipboardAvailable){clearInterval(F.clipboardReady.timer);F.clipboardReady.timer=null;F.clipboard.method="flash";for(var J=0;J<F.clipboardReady.ready.length;J++){F.clipboardReady.ready[J]()}F.clipboardReady.ready=null;F.clipboardReady.done=true;A("jQuery.clipboard: OK. Initialized and ready to copy using Flash method.")}};F.clipboardReady=function(L,J){J=jQuery.extend({swfpath:"jquery.clipboard.swf",debug:false},J);B=J.swfpath;D=J.debug;if(G()){F.clipboard.method="ie";A("jQuery.clipboard: OK. Initialized and ready to copy using native IE method.");return L()}if(F.clipboardReady.done){return L()}if(F.clipboardReady.timer){F.clipboardReady.ready.push(L)}else{if(E(C)){F("#jquery_clipboard_swf").remove();F("#jquery_clipboard_div").remove();var M;M=F("<div/>").attr("id","jquery_clipboard_div").css("width","0").css("height","0").appendTo("body").html("");var K;K=F('<embed id="jquery_clipboard_swf" name="jquery_clipboard_swf" src="'+B+'" type="application/x-shockwave-flash"></embed>');F(K).css("width","0").css("height","0").appendTo(M);F.clipboardReady.ready=[L];F.clipboardReady.timer=setInterval(H,100);A("jQuery.clipboard: INFO. Waiting for Flash object to become ready. Detected Flash version: "+I[0]+"."+I[1]+"."+I[2])}else{if(I[0]===0){A("jQuery.clipboard: ERROR. Flash plugin not detected.");return false}else{A("jQuery.clipboard: ERROR. Minimum Flash version: "+C[0]+"."+C[1]+"."+C[2]+" Detected Flash version: "+I[0]+"."+I[1]+"."+I[2]);return false}}}};F.clipboard=function(M){if(arguments.length<1||typeof M!="string"){A("jQuery.clipboard: ERROR. Nothing to copy. You must specify a string as the first parameter.");return false}if(F.clipboard.method=="ie"){try{window.clipboardData.setData("Text",M);A("jQuery.clipboard: OK. Copied "+M.length+" bytes to clipboard using native IE method.");return true}catch(L){A("jQuery.clipboard: ERROR. Tried to copy using native IE method but an unknown error occurred.");return false}}if(F.clipboard.method=="flash"){var J=F("#jquery_clipboard_swf:first");var K=F(J).get(0);if(K.jqueryClipboardCopy(M)){A("jQuery.clipboard: OK. Copied "+M.length+" bytes to clipboard using Flash method.");return true}else{A("jQuery.clipboard: ERROR. Tried to copy using Flash method but an unknown error occurred.");return false}}A("jQuery.clipboard: ERROR. You must use $.clipboardReady() in conjunction with $.clipboard().");return false}})(jQuery);(function(D){var B={},J,L,N,I=D.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),A=false;D.Tooltip={blocked:false,defaults:{delay:200,showURL:true,extraClass:"",top:15,left:15},block:function(){D.Tooltip.blocked=!D.Tooltip.blocked}};D.fn.extend({Tooltip:function(O){O=D.extend({},D.Tooltip.defaults,O);G();return this.each(function(){this.tSettings=O;this.tooltipText=this.title;D(this).removeAttr("title");this.alt=""}).hover(K,E).click(E)},fixPNG:I?function(){return this.each(function(){var O=D(this).css("backgroundImage");if(O.match(/^url\(["']?(.*\.png)["']?\)$/i)){O=RegExp.$1;D(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+O+"')"}).each(function(){var P=D(this).css("position");if(P!="absolute"&&P!="relative"){D(this).css("position","relative")}})}})}:function(){return this},unfixPNG:I?function(){return this.each(function(){D(this).css({filter:"",backgroundImage:""})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){D(this)[D(this).html()?"show":"hide"]()})},url:function(){return this.attr("href")||this.attr("src")}});function G(){if(B.parent){return }B.parent=D('<div id="tooltip"><h3></h3><div class="body"></div><div class="url"></div></div>').hide().appendTo("body");if(D.fn.bgiframe){B.parent.bgiframe()}B.title=D("h3",B.parent);B.body=D("div.body",B.parent);B.url=D("div.url",B.parent)}function F(O){if(this.tSettings.delay){N=setTimeout(M,this.tSettings.delay)}else{M()}A=!!this.tSettings.track;D("body").bind("mousemove",C);C(O)}function K(){if(D.Tooltip.blocked||this==J||!this.tooltipText){return }J=this;L=this.tooltipText;if(this.tSettings.bodyHandler){B.title.hide();B.body.html(this.tSettings.bodyHandler.call(this)).show()}else{if(this.tSettings.showBody){var Q=L.split(this.tSettings.showBody);B.title.html(Q.shift()).show();B.body.empty();for(var P=0,O;O=Q[P];P++){if(P>0){B.body.append("<br/>")}B.body.append(O)}B.body.hideWhenEmpty()}else{B.title.html(L).show();B.body.hide()}}if(this.tSettings.showURL&&D(this).url()){B.url.html(D(this).url().replace("http://","")).show()}else{B.url.hide()}B.parent.addClass(this.tSettings.extraClass);if(this.tSettings.fixPNG){B.parent.fixPNG()}F.apply(this,arguments)}function M(){N=null;B.parent.show();C()}function C(Q){if(D.Tooltip.blocked){return }if(!A&&B.parent.is(":visible")){D("body").unbind("mousemove",C)}if(J==null){D("body").unbind("mousemove",C);return }var S=B.parent[0].offsetLeft;var R=B.parent[0].offsetTop;if(Q){S=Q.pageX+J.tSettings.left;R=Q.pageY+J.tSettings.top;B.parent.css({left:S+"px",top:R+"px"})}var O=H(),P=B.parent[0];if(O.x+O.cx<P.offsetLeft+P.offsetWidth){S-=P.offsetWidth+20+J.tSettings.left;B.parent.css({left:S+"px"})}if(O.y+O.cy<P.offsetTop+P.offsetHeight){R-=P.offsetHeight+20+J.tSettings.top;B.parent.css({top:R+"px"})}}function H(){return{x:D(window).scrollLeft(),y:D(window).scrollTop(),cx:D(window).width(),cy:D(window).height()}}function E(O){if(D.Tooltip.blocked){return }if(N){clearTimeout(N)}J=null;B.parent.hide().removeClass(this.tSettings.extraClass);if(this.tSettings.fixPNG){B.parent.unfixPNG()}}})(jQuery);(function(F){var A,J,C,H,E,B;var D={menuStyle:{listStyle:"none",padding:"1px",margin:"0px",backgroundColor:"#fff",border:"1px solid #999",width:"100px"},itemStyle:{margin:"0px",color:"#000",display:"block",cursor:"default",padding:"3px",border:"1px solid #fff",backgroundColor:"transparent"},itemHoverStyle:{border:"1px solid #0a246a",backgroundColor:"#b6bdd2"},eventPosX:"pageX",eventPosY:"pageY",shadow:true,onContextMenu:null,onShowMenu:null};F.fn.contextMenuDelegation=function(N,M,L){if(!A){A=F('<div id="jqContextMenu"></div>').hide().css({position:"absolute",zIndex:"100000001"}).appendTo("body").bind("click",function(O){O.stopPropagation()})}if(!J){J=F("<div></div>").css({backgroundColor:"#000",position:"absolute",opacity:0.2,zIndex:499}).appendTo("body").hide()}E=E||[];E.push({id:N,menuStyle:F.extend({},D.menuStyle,L.menuStyle||{}),itemStyle:F.extend({},D.itemStyle,L.itemStyle||{}),itemHoverStyle:F.extend({},D.itemHoverStyle,L.itemHoverStyle||{}),bindings:L.bindings||{},shadow:L.shadow||L.shadow===false?L.shadow:D.shadow,onContextMenu:L.onContextMenu||D.onContextMenu,onShowMenu:L.onShowMenu||D.onShowMenu,eventPosX:L.eventPosX||D.eventPosX,eventPosY:L.eventPosY||D.eventPosY});var K=E.length-1;F(this).bind("click",function(O){if(O.target.className==M){I(K,O.target,O,L);O.stopPropagation();O.preventDefault();return false}});return this};F.fn.contextMenu=function(M,L){if(!A){A=F('<div id="jqContextMenu"></div>').hide().css({position:"absolute",zIndex:"100000001"}).appendTo("body").bind("click",function(N){N.stopPropagation()})}if(!J){J=F("<div></div>").css({backgroundColor:"#000",position:"absolute",opacity:0.2,zIndex:499}).appendTo("body").hide()}E=E||[];E.push({id:M,menuStyle:F.extend({},D.menuStyle,L.menuStyle||{}),itemStyle:F.extend({},D.itemStyle,L.itemStyle||{}),itemHoverStyle:F.extend({},D.itemHoverStyle,L.itemHoverStyle||{}),bindings:L.bindings||{},shadow:L.shadow||L.shadow===false?L.shadow:D.shadow,onContextMenu:L.onContextMenu||D.onContextMenu,onShowMenu:L.onShowMenu||D.onShowMenu,eventPosX:L.eventPosX||D.eventPosX,eventPosY:L.eventPosY||D.eventPosY});var K=E.length-1;F(this).bind("click",function(N){I(K,this,N,L);return false});return this};function I(M,L,N,K){var O=E[M];H=F("#"+O.id).find("ul:first").clone(true);H.css(O.menuStyle).find("li").css(O.itemStyle).hover(function(){F(this).css(O.itemHoverStyle)},function(){F(this).css(O.itemStyle)}).find("img").css({verticalAlign:"middle",paddingRight:"2px"});A.html(H);if(!!O.onShowMenu){A=O.onShowMenu(N,A)}F.each(O.bindings,function(Q,P){F("#"+Q,A).bind("click",function(R){G();P(L,B)})});A.css({left:N[O.eventPosX],top:N[O.eventPosY]}).show();if(O.shadow){J.css({width:A.width(),height:A.height(),left:N.pageX+2,top:N.pageY+2}).show()}F(document).one("click",G)}function G(){A.hide();J.hide()}F.contextMenu={defaults:function(K){F.each(K,function(L,M){if(typeof M=="object"&&D[L]){F.extend(D[L],M)}else{D[L]=M}})}}})(jQuery);$(function(){$("div.contextMenu").hide()});function randomString(){var D="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var E=8;var C="";for(var B=0;B<E;B++){var A=Math.floor(Math.random()*D.length);C+=D.substring(A,A+1)}return C}function createWindow(H,D,C,E,K,F){var J="-"+randomString();var G=Client.viewportOffset().top+10;var A="windowContent"+J;var I=Builder.node("div",{style:"left:10px;top:"+G+"px","class":"jqDnR",id:"window"+J},[Builder.node("div",{"class":"jqHandle jqDrag",id:"winDragHandle"+J},[Builder.node("div",{"class":"winCloser",id:"windowClose"+J}," "),Builder.node("span",{"class":"winTitle"},H)]),c=Builder.node("div",{"class":"winContent",id:A}),Builder.node("div",{"class":"winComment",id:"winComment"+J},"test"),Builder.node("div",{"class":"jqResize",id:"winResizeHandle"+J})]);jQuery(document.body).append(I);var B=new SWFObject("http://www.youtube.com/v/"+D+"&autoplay=1","ytvid"+J,"425","350","7");B.addParam("wmode","transparent");B.write(A);$("#windowClose"+J).click(function(){document.body.removeChild($("#window"+J).get(0))});$("#window"+J).css({height:"380px",width:"665px",position:"absolute"});$("#winComment"+J).load("/cmd/Tcomment",{css:"vid",ptcp:F,eid:K,mid:C,tlid:E,type:"media"});$("#window"+J).draggable({handle:"#winDragHandle"+J})}function escapeHTML(B){var C=document.createElement("div");var A=document.createTextNode(B);C.appendChild(A);return C.innerHTML}function each(B,C){for(var A=0;A<B.length;A++){C(B[A])}}function inject(B,A,C){each(B,function(E,D){A=C(A,E,D)});return A}function flatten(A){return inject(A,[],function(C,B){return C.concat(B&&B.constructor==Array?B.flatten():[B])})}var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(A){A=A.toUpperCase();var F=this.NODEMAP[A]||"div";var B=document.createElement(F);try{B.innerHTML="<"+A+"></"+A+">"}catch(E){}var D=B.firstChild||null;if(D&&(D.tagName!=A)){D=D.getElementsByTagName(A)[0]}if(!D){D=document.createElement(A)}if(!D){return }if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)){this._children(D,arguments[1])}else{var C=this._attributes(arguments[1]);if(C.length){try{B.innerHTML="<"+A+" "+C+"></"+A+">"}catch(E){}D=B.firstChild||null;if(!D){D=document.createElement(A);for(attr in arguments[1]){D[attr=="class"?"className":attr]=arguments[1][attr]}}if(D.tagName!=A){D=B.getElementsByTagName(A)[0]}}}}if(arguments[2]){this._children(D,arguments[2])}return D},_text:function(A){return document.createTextNode(A)},_attributes:function(A){var B=[];for(attribute in A){B.push((attribute=="className"?"class":attribute)+'="'+escapeHTML(A[attribute].toString())+'"')}return B.join(" ")},_children:function(B,A){if(typeof A=="object"){each(flatten(A),function(C){if(typeof C=="object"){B.appendChild(C)}else{if(Builder._isStringOrNumber(C)){B.appendChild(Builder._text(C))}}})}else{if(Builder._isStringOrNumber(A)){B.appendChild(Builder._text(A))}}},_isStringOrNumber:function(A){return(typeof A=="string"||typeof A=="number")},dump:function(B){if(typeof B!="object"&&typeof B!="function"){B=window}var A=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);A.each(function(C){B[C]=function(){return Builder.node.apply(Builder,[C].concat($A(arguments)))}})}};var humanMsg={setup:function(B,A,C){humanMsg.msgID="humanMsg";humanMsg.logID="humanMsgLog";if(B==undefined){B="body"}if(A==undefined){A="Message Log"}humanMsg.msgOpacity=0.8;if(C!=undefined){humanMsg.msgOpacity=parseFloat(C)}jQuery(B).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><div class="round"></div><p></p><div class="round"></div></div> <div id="'+humanMsg.logID+'"><p>'+A+"</p><ul></ul></div>");jQuery("#"+humanMsg.logID+" p").click(function(){jQuery(this).siblings("ul").slideToggle()})},displayMsg:function(A){if(A==""){return }clearTimeout(humanMsg.t2);jQuery("#"+humanMsg.msgID+" p").html(A);jQuery("#"+humanMsg.msgID+"").show().animate({opacity:humanMsg.msgOpacity},200,function(){jQuery("#"+humanMsg.logID).show().children("ul").prepend("<li>"+A+"</li>").children("li:first").slideDown(200);if(jQuery("#"+humanMsg.logID+" ul").css("display")=="none"){jQuery("#"+humanMsg.logID+" p").animate({bottom:40},200,"linear",function(){jQuery(this).animate({bottom:0},300,"easeOutBounce",function(){jQuery(this).css({bottom:0})})})}});humanMsg.t1=setTimeout("humanMsg.bindEvents()",700);humanMsg.t2=setTimeout("humanMsg.removeMsg()",5000)},bindEvents:function(){jQuery(window).mousemove(humanMsg.removeMsg).click(humanMsg.removeMsg).keypress(humanMsg.removeMsg)},removeMsg:function(){jQuery(window).unbind("mousemove",humanMsg.removeMsg).unbind("click",humanMsg.removeMsg).unbind("keypress",humanMsg.removeMsg);if(jQuery("#"+humanMsg.msgID).css("opacity")==humanMsg.msgOpacity){jQuery("#"+humanMsg.msgID).animate({opacity:0},500,function(){jQuery(this).hide()})}}};jQuery(document).ready(function(){});(function(A){A.fn.bgIframe=A.fn.bgiframe=function(C){if(A.browser.msie&&parseInt(A.browser.version)<=6){C=A.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},C||{});var D=function(E){return E&&E.constructor==Number?E+"px":E},B='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+C.src+'"style="display:block;position:absolute;z-index:-1;'+(C.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(C.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":D(C.top))+";left:"+(C.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":D(C.left))+";width:"+(C.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":D(C.width))+";height:"+(C.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":D(C.height))+';"/>';return this.each(function(){if(A("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(B),this.firstChild)}})}return this};if(!A.browser.version){A.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1]}})(jQuery);(function(A){A.fn.extend({autocomplete:function(B,C){var D=typeof B=="string";C=A.extend({},A.Autocompleter.defaults,{url:D?B:null,data:D?null:B,delay:D?A.Autocompleter.defaults.delay:10,max:C&&!C.scroll?10:150},C);C.highlight=C.highlight||function(E){return E};return this.each(function(){new A.Autocompleter(this,C)})},result:function(B){return this.bind("result",B)},search:function(B){return this.trigger("search",[B])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(B){return this.trigger("setOptions",[B])},unautocomplete:function(){return this.trigger("unautocomplete")}});A.Autocompleter=function(L,G){var C={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34};var B=A(L).attr("autocomplete","off").addClass(G.inputClass);var J;var P="";var M=A.Autocompleter.Cache(G);var E=0;var U;var W={mouseDownOnSelect:false};var R=A.Autocompleter.Select(G,L,D,W);B.keydown(function(X){U=X.keyCode;switch(X.keyCode){case C.UP:X.preventDefault();if(R.visible()){R.prev()}else{T(0,true)}break;case C.DOWN:X.preventDefault();if(R.visible()){R.next()}else{T(0,true)}break;case C.PAGEUP:X.preventDefault();if(R.visible()){R.pageUp()}else{T(0,true)}break;case C.PAGEDOWN:X.preventDefault();if(R.visible()){R.pageDown()}else{T(0,true)}break;case G.multiple&&A.trim(G.multipleSeparator)==","&&C.COMMA:case C.TAB:case C.RETURN:if(D()){if(!G.multiple){B.blur()}X.preventDefault()}break;case C.ESC:R.hide();break;default:clearTimeout(J);J=setTimeout(T,G.delay);break}}).keypress(function(){}).focus(function(){E++}).blur(function(){E=0;if(!W.mouseDownOnSelect){S()}}).click(function(){if(!R.visible()){T(0,true)}}).bind("search",function(){var X=(arguments.length>1)?arguments[1]:null;function Y(f,e){var Z;if(e&&e.length){for(var d=0;d<e.length;d++){if(e[d].result.toLowerCase()==f.toLowerCase()){Z=e[d];break}}}if(typeof X=="function"){X(Z)}else{B.trigger("result",Z&&[Z.data,Z.value])}}A.each(H(B.val()),function(Z,d){F(d,Y,Y)})}).bind("flushCache",function(){M.flush()}).bind("setOptions",function(){A.extend(G,arguments[1]);if("data" in arguments[1]){M.populate()}}).bind("unautocomplete",function(){R.unbind();B.unbind()});function D(){var Y=R.selected();if(!Y){return false}var X=Y.result;P=X;if(G.multiple){var Z=H(B.val());if(Z.length>1){X=Z.slice(0,Z.length-1).join(G.multipleSeparator)+G.multipleSeparator+X}X+=G.multipleSeparator}B.val(X);V();B.trigger("result",[Y.data,Y.value]);return true}function T(Z,Y){if(U==C.DEL){R.hide();return }var X=B.val();if(!Y&&X==P){return }P=X;X=I(X);if(X.length>=G.minChars){B.addClass(G.loadingClass);if(!G.matchCase){X=X.toLowerCase()}F(X,K,V)}else{N();R.hide()}}function H(Y){if(!Y){return[""]}var Z=Y.split(A.trim(G.multipleSeparator));var X=[];A.each(Z,function(d,e){if(A.trim(e)){X[d]=A.trim(e)}});return X}function I(X){if(!G.multiple){return X}var Y=H(X);return Y[Y.length-1]}function Q(X,Y){if(G.autoFill&&(I(B.val()).toLowerCase()==X.toLowerCase())&&U!=8){B.val(B.val()+Y.substring(I(P).length));A.Autocompleter.Selection(L,P.length,P.length+Y.length)}}function S(){clearTimeout(J);J=setTimeout(V,200)}function V(){R.hide();clearTimeout(J);N();if(G.mustMatch){B.search(function(X){if(!X){B.val("")}})}}function K(Y,X){if(X&&X.length&&E){N();R.display(X,Y);Q(Y,X[0].value);R.show()}else{V()}}function F(Y,d,X){if(!G.matchCase){Y=Y.toLowerCase()}var Z=M.load(Y);if(Z&&Z.length){d(Y,Z)}else{if((typeof G.url=="string")&&(G.url.length>0)){var e={};A.each(G.extraParams,function(f,g){e[f]=typeof g=="function"?g():g});A.ajax({mode:"abort",port:"autocomplete"+L.name,dataType:G.dataType,url:G.url,data:A.extend({q:I(Y),limit:G.max},e),success:function(g){var f=G.parse&&G.parse(g)||O(g);M.add(Y,f);d(Y,f)}})}else{X(Y)}}}function O(d){var X=[];var Z=d.split("\n");for(var Y=0;Y<Z.length;Y++){var e=A.trim(Z[Y]);if(e){e=e.split("|");X[X.length]={data:e,value:e[0],result:G.formatResult&&G.formatResult(e,e[0])||e[0]}}}return X}function N(){B.removeClass(G.loadingClass)}};A.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(B){return B[0]},autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(C,B){return C.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+B.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180,attachTo:"body"};A.Autocompleter.Cache=function(C){var F={};var D=0;function H(K,J){if(!C.matchCase){K=K.toLowerCase()}var I=K.indexOf(J);if(I==-1){return false}return I==0||C.matchContains}function G(J,I){if(D>C.cacheLength){B()}if(!F[J]){D++}F[J]=I}function E(){if(!C.data){return false}var J={},I=0;if(!C.url){C.cacheLength=1}J[""]=[];for(var L=0,K=C.data.length;L<K;L++){var O=C.data[L];O=(typeof O=="string")?[O]:O;var N=C.formatItem(O,L+1,C.data.length);if(N===false){continue}var M=N.charAt(0).toLowerCase();if(!J[M]){J[M]=[]}var P={value:N,data:O,result:C.formatResult&&C.formatResult(O)||N};J[M].push(P);if(I++<C.max){J[""].push(P)}}A.each(J,function(Q,R){C.cacheLength++;G(Q,R)})}setTimeout(E,25);function B(){F={};D=0}return{flush:B,add:G,populate:E,load:function(L){if(!C.cacheLength||!D){return null}if(!C.url&&C.matchContains){var K=[];for(var I in F){if(I.length>0){var M=F[I];A.each(M,function(O,N){if(H(N.value,L)){K.push(N)}})}}return K}else{if(F[L]){return F[L]}else{if(C.matchSubset){for(var J=L.length-1;J>=C.minChars;J--){var M=F[L.substr(0,J)];if(M){var K=[];A.each(M,function(O,N){if(H(N.value,L)){K[K.length]=N}});return K}}}}}return null}}};A.Autocompleter.Select=function(E,J,L,P){var I={ACTIVE:"ac_over"};var K,F=-1,R,M="",S=true,C,O;function N(){if(!S){return }C=A("<div/>").hide().addClass(E.resultsClass).css("position","absolute").appendTo(E.attachTo);O=A("<ul>").appendTo(C).mouseover(function(T){if(Q(T).nodeName&&Q(T).nodeName.toUpperCase()=="LI"){F=A("li",O).removeClass(I.ACTIVE).index(Q(T));A(Q(T)).addClass(I.ACTIVE)}}).click(function(T){A(Q(T)).addClass(I.ACTIVE);L();J.focus();return false}).mousedown(function(){P.mouseDownOnSelect=true}).mouseup(function(){P.mouseDownOnSelect=false});if(E.width>0){C.css("width",E.width)}S=false}function Q(U){var T=U.target;while(T&&T.tagName!="LI"){T=T.parentNode}if(!T){return[]}return T}function H(T){K.slice(F,F+1).removeClass();G(T);var V=K.slice(F,F+1).addClass(I.ACTIVE);if(E.scroll){var U=0;K.slice(0,F).each(function(){U+=this.offsetHeight});if((U+V[0].offsetHeight-O.scrollTop())>O[0].clientHeight){O.scrollTop(U+V[0].offsetHeight-O.innerHeight())}else{if(U<O.scrollTop()){O.scrollTop(U)}}}}function G(T){F+=T;if(F<0){F=K.size()-1}else{if(F>=K.size()){F=0}}}function B(T){return E.max&&E.max<T?E.max:T}function D(){O.empty();var U=B(R.length);for(var V=0;V<U;V++){if(!R[V]){continue}var W=E.formatItem(R[V].data,V+1,U,R[V].value,M);if(W===false){continue}var T=A("<li>").html(E.highlight(W,M)).addClass(V%2==0?"ac_event":"ac_odd").appendTo(O)[0];A.data(T,"ac_data",R[V])}K=O.find("li");if(E.selectFirst){K.slice(0,1).addClass(I.ACTIVE);F=0}O.bgiframe()}return{display:function(U,T){N();R=U;M=T;D()},next:function(){H(1)},prev:function(){H(-1)},pageUp:function(){if(F!=0&&F-8<0){H(-F)}else{H(-8)}},pageDown:function(){if(F!=K.size()-1&&F+8>K.size()){H(K.size()-1-F)}else{H(8)}},hide:function(){C&&C.hide();F=-1},visible:function(){return C&&C.is(":visible")},current:function(){return this.visible()&&(K.filter("."+I.ACTIVE)[0]||E.selectFirst&&K[0])},show:function(){var V=A(J).offset();C.css({width:typeof E.width=="string"||E.width>0?E.width:A(J).width(),top:V.top+J.offsetHeight,left:V.left}).show();if(E.scroll){O.scrollTop(0);O.css({maxHeight:E.scrollHeight,overflow:"auto"});if(A.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var T=0;K.each(function(){T+=this.offsetHeight});var U=T>E.scrollHeight;O.css("height",U?E.scrollHeight:T);if(!U){K.width(O.width()-parseInt(K.css("padding-left"))-parseInt(K.css("padding-right")))}}}},selected:function(){var T=K&&K.filter("."+I.ACTIVE).removeClass(I.ACTIVE);return T&&T.length&&A.data(T[0],"ac_data")},unbind:function(){C&&C.remove()}}};A.Autocompleter.Selection=function(D,E,C){if(D.createTextRange){var B=D.createTextRange();B.collapse(true);B.moveStart("character",E);B.moveEnd("character",C);B.select()}else{if(D.setSelectionRange){D.setSelectionRange(E,C)}else{if(D.selectionStart){D.selectionStart=E;D.selectionEnd=C}}}D.focus()}})(jQuery);(function($){function Datepicker(){this.debug=false;this._nextId=0;this._inst=[];this._curInst=null;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this.regional=[];this.regional[""]={clearText:"Clear",clearStatus:"Erase the current date",closeText:"Close",closeStatus:"Close without change",prevText:"&#x3c;Prev",prevStatus:"Show the previous month",nextText:"Next&#x3e;",nextStatus:"Show the next month",currentText:"Today",currentStatus:"Show the current month",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthStatus:"Show a different month",yearStatus:"Show a different year",weekHeader:"Wk",weekStatus:"Week of the year",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayStatus:"Set DD as first week day",dateStatus:"Select DD, M d",dateFormat:"mm/dd/yy",firstDay:0,initStatus:"Select a date",isRTL:false};this._defaults={showOn:"focus",showAnim:"show",defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,closeAtTop:true,mandatory:false,hideIfNoPrevNext:false,changeMonth:true,changeYear:true,yearRange:"-10:+10",changeFirstDay:true,showOtherMonths:false,showWeeks:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",showStatus:false,statusForDate:this.dateStatus,minDate:null,maxDate:null,speed:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onClose:null,numberOfMonths:1,stepMonths:1,rangeSelect:false,rangeSeparator:" - "};$.extend(this._defaults,this.regional[""]);this._datepickerDiv=$('<div id="datepicker_div"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id},_getInst:function(id){return this._inst[id]||id},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){var instSettings=(inlineSettings?$.extend($.extend({},settings||{}),inlineSettings||{}):settings);var inst=(inst&&!inlineSettings?inst:new DatepickerInstance(instSettings,false));this._connectDatepicker(target,inst)}else{if(nodeName=="div"||nodeName=="span"){var instSettings=$.extend($.extend({},settings||{}),inlineSettings||{});var inst=new DatepickerInstance(instSettings,true);this._inlineDatepicker(target,inst)}}},_destroyDatepicker:function(target){var $target=$(target);var nodeName=target.nodeName.toLowerCase();var calId=target._calId;target._calId=null;if(nodeName=="input"){$target.siblings(".datepicker_append").replaceWith("");$target.siblings(".datepicker_trigger").replaceWith("");$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress);var wrapper=$target.parents(".datepicker_wrap");if(wrapper){wrapper.replaceWith(wrapper.html())}}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}if($("input[_calId="+calId+"]").length==0){this._inst[calId]=null}},_enableDatepicker:function(target){target.disabled=false;$(target).siblings("button.datepicker_trigger").each(function(){this.disabled=false});$(target).siblings("img.datepicker_trigger").css({opacity:"1.0",cursor:""});var $target=target;this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==$target?null:value)})},_disableDatepicker:function(target){target.disabled=true;$(target).siblings("button.datepicker_trigger").each(function(){this.disabled=true});$(target).siblings("img.datepicker_trigger").css({opacity:"0.5",cursor:"default"});var $target=target;this._disabledInputs=$.map($.datepicker._disabledInputs,function(value){return(value==$target?null:value)});this._disabledInputs[$.datepicker._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_changeDatepicker:function(target,name,value){var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}var inst=this._getInst(target._calId);if(inst){extendRemove(inst._settings,settings);this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target._calId);if(inst){inst._setDate(date,endDate);this._updateDatepicker(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target._calId);return(inst?inst._getDate():null)},_doKeyDown:function(e){var inst=$.datepicker._getInst(this._calId);if($.datepicker._datepickerShowing){switch(e.keyCode){case 9:$.datepicker.hideDatepicker("");break;case 13:$.datepicker._selectDay(inst,inst._selectedMonth,inst._selectedYear,$("td.datepicker_daysCellOver",inst._datepickerDiv)[0]);return false;break;case 27:$.datepicker.hideDatepicker(inst._get("speed"));break;case 33:$.datepicker._adjustDate(inst,(e.ctrlKey?-1:-inst._get("stepMonths")),(e.ctrlKey?"Y":"M"));break;case 34:$.datepicker._adjustDate(inst,(e.ctrlKey?+1:+inst._get("stepMonths")),(e.ctrlKey?"Y":"M"));break;case 35:if(e.ctrlKey){$.datepicker._clearDate(inst)}break;case 36:if(e.ctrlKey){$.datepicker._gotoToday(inst)}break;case 37:if(e.ctrlKey){$.datepicker._adjustDate(inst,-1,"D")}break;case 38:if(e.ctrlKey){$.datepicker._adjustDate(inst,-7,"D")}break;case 39:if(e.ctrlKey){$.datepicker._adjustDate(inst,+1,"D")}break;case 40:if(e.ctrlKey){$.datepicker._adjustDate(inst,+7,"D")}break}}else{if(e.keyCode==36&&e.ctrlKey){$.datepicker._showDatepicker(this)}}},_doKeyPress:function(e){var inst=$.datepicker._getInst(this._calId);var chars=$.datepicker._possibleChars(inst._get("dateFormat"));var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)},_connectDatepicker:function(target,inst){var input=$(target);if(input.is("."+this.markerClassName)){return }var appendText=inst._get("appendText");var isRTL=inst._get("isRTL");if(appendText){if(isRTL){input.before('<span class="datepicker_append">'+appendText+"</span>")}else{input.after('<span class="datepicker_append">'+appendText+"</span>")}}var showOn=inst._get("showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=inst._get("buttonText");var buttonImage=inst._get("buttonImage");var trigger=$(inst._get("buttonImageOnly")?'<img class="datepicker_trigger" src="'+buttonImage+'" alt="'+buttonText+'" title="'+buttonText+'"/>':'<button type="button" class="datepicker_trigger">'+(buttonImage!=""?'<img src="'+buttonImage+'" alt="'+buttonText+'" title="'+buttonText+'"/>':buttonText)+"</button>");input.wrap('<span class="datepicker_wrap"></span>');if(isRTL){input.before(trigger)}else{input.after(trigger)}trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker.hideDatepicker()}else{$.datepicker._showDatepicker(target)}})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress);input.bind("setData.datepicker",function(event,key,value){inst._settings[key]=value}).bind("getData.datepicker",function(event,key){return inst._get(key)});input[0]._calId=inst._id},_inlineDatepicker:function(target,inst){var input=$(target);if(input.is("."+this.markerClassName)){return }input.addClass(this.markerClassName).append(inst._datepickerDiv);input.bind("setData.datepicker",function(event,key,value){inst._settings[key]=value}).bind("getData.datepicker",function(event,key){return inst._get(key)});input[0]._calId=inst._id;this._updateDatepicker(inst)},_inlineShow:function(inst){var numMonths=inst._getNumberOfMonths();inst._datepickerDiv.width(numMonths[1]*$(".datepicker",inst._datepickerDiv[0]).width())},dialogDatepicker:function(dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){inst=this._dialogInst=new DatepickerInstance({},false);this._dialogInput=$('<input type="text" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);this._dialogInput[0]._calId=inst._id}extendRemove(inst._settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst._settings.onSelect=onSelect;this._inDialog=true;this._datepickerDiv.addClass("datepicker_dialog");this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this._datepickerDiv)}return this},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._lastInput==input){return }if($.datepicker._isDisabledDatepicker(input)){return }var inst=$.datepicker._getInst(input._calId);var beforeShow=inst._get("beforeShow");extendRemove(inst._settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker.hideDatepicker("");$.datepicker._lastInput=input;inst._setDateFromField(input);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed"});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}inst._datepickerDiv.css("position",($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute"))).css("left",$.datepicker._pos[0]+"px").css("top",$.datepicker._pos[1]+"px");$.datepicker._pos=null;inst._rangeStart=null;$.datepicker._updateDatepicker(inst);if(!inst._inline){var speed=inst._get("speed");var postProcess=function(){$.datepicker._datepickerShowing=true;$.datepicker._afterShow(inst)};var showAnim=inst._get("showAnim")||"show";inst._datepickerDiv[showAnim](speed,postProcess);if(speed==""){postProcess()}if(inst._input[0].type!="hidden"){inst._input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){inst._datepickerDiv.empty().append(inst._generateDatepicker());var numMonths=inst._getNumberOfMonths();if(numMonths[0]!=1||numMonths[1]!=1){inst._datepickerDiv.addClass("datepicker_multi")}else{inst._datepickerDiv.removeClass("datepicker_multi")}if(inst._get("isRTL")){inst._datepickerDiv.addClass("datepicker_rtl")}else{inst._datepickerDiv.removeClass("datepicker_rtl")}if(inst._input&&inst._input[0].type!="hidden"){inst._input[0].focus()}},_afterShow:function(inst){var numMonths=inst._getNumberOfMonths();inst._datepickerDiv.width(numMonths[1]*$(".datepicker",inst._datepickerDiv[0])[0].offsetWidth);if($.browser.msie&&parseInt($.browser.version)<7){$("#datepicker_cover").css({width:inst._datepickerDiv.width()+4,height:inst._datepickerDiv.height()+4})}var isFixed=inst._datepickerDiv.css("position")=="fixed";var pos=inst._input?$.datepicker._findPos(inst._input[0]):null;var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=(isFixed?0:document.documentElement.scrollLeft||document.body.scrollLeft);var scrollY=(isFixed?0:document.documentElement.scrollTop||document.body.scrollTop);if((inst._datepickerDiv.offset().left+inst._datepickerDiv.width()-(isFixed&&$.browser.msie?document.documentElement.scrollLeft:0))>(browserWidth+scrollX)){inst._datepickerDiv.css("left",Math.max(scrollX,pos[0]+(inst._input?$(inst._input[0]).width():null)-inst._datepickerDiv.width()-(isFixed&&$.browser.opera?document.documentElement.scrollLeft:0))+"px")}if((inst._datepickerDiv.offset().top+inst._datepickerDiv.height()-(isFixed&&$.browser.msie?document.documentElement.scrollTop:0))>(browserHeight+scrollY)){inst._datepickerDiv.css("top",Math.max(scrollY,pos[1]-(this._inDialog?0:inst._datepickerDiv.height())-(isFixed&&$.browser.opera?document.documentElement.scrollTop:0))+"px")}},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var curleft=curtop=0;if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop}while(obj=obj.offsetParent)}return[curleft,curtop]},hideDatepicker:function(speed){var inst=this._curInst;if(!inst){return }var rangeSelect=inst._get("rangeSelect");if(rangeSelect&&this._stayOpen){this._selectDate(inst,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear))}this._stayOpen=false;if(this._datepickerShowing){speed=(speed!=null?speed:inst._get("speed"));var showAnim=inst._get("showAnim");inst._datepickerDiv[(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide"))](speed,function(){$.datepicker._tidyDialog(inst)});if(speed==""){this._tidyDialog(inst)}var onClose=inst._get("onClose");if(onClose){onClose.apply((inst._input?inst._input[0]:null),[inst._getDate(),inst])}this._datepickerShowing=false;this._lastInput=null;inst._settings.prompt=null;if(this._inDialog){this._dialogInput.css("position","absolute").css("left","0px").css("top","-100px");if($.blockUI){$.unblockUI();$("body").append(this._datepickerDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst._datepickerDiv.removeClass("datepicker_dialog").unbind(".datepicker");$(".datepicker_prompt",inst._datepickerDiv).remove()},_checkExternalClick:function(event){if(!$.datepicker._curInst){return }var target=$(event.target);if((target.parents("#datepicker_div").length==0)&&(target.attr("class")!="datepicker_trigger")&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker.hideDatepicker("")}},_adjustDate:function(id,offset,period){var inst=this._getInst(id);inst._adjustDate(offset,period);this._updateDatepicker(inst)},_gotoToday:function(id){var date=new Date();var inst=this._getInst(id);inst._selectedDay=date.getDate();inst._drawMonth=inst._selectedMonth=date.getMonth();inst._drawYear=inst._selectedYear=date.getFullYear();this._adjustDate(inst)},_selectMonthYear:function(id,select,period){var inst=this._getInst(id);inst._selectingMonthYear=false;inst[period=="M"?"_drawMonth":"_drawYear"]=select.options[select.selectedIndex].value-0;this._adjustDate(inst)},_clickMonthYear:function(id){var inst=this._getInst(id);if(inst._input&&inst._selectingMonthYear&&!$.browser.msie){inst._input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_changeFirstDay:function(id,day){var inst=this._getInst(id);inst._settings.firstDay=day;this._updateDatepicker(inst)},_selectDay:function(id,month,year,td){if($(td).is(".datepicker_unselectable")){return }var inst=this._getInst(id);var rangeSelect=inst._get("rangeSelect");if(rangeSelect){if(!this._stayOpen){$(".datepicker td").removeClass("datepicker_currentDay");$(td).addClass("datepicker_currentDay")}this._stayOpen=!this._stayOpen}inst._selectedDay=inst._currentDay=$("a",td).html();inst._selectedMonth=inst._currentMonth=month;inst._selectedYear=inst._currentYear=year;this._selectDate(id,inst._formatDate(inst._currentDay,inst._currentMonth,inst._currentYear));if(this._stayOpen){inst._endDay=inst._endMonth=inst._endYear=null;inst._rangeStart=new Date(inst._currentYear,inst._currentMonth,inst._currentDay);this._updateDatepicker(inst)}else{if(rangeSelect){inst._endDay=inst._currentDay;inst._endMonth=inst._currentMonth;inst._endYear=inst._currentYear;inst._selectedDay=inst._currentDay=inst._rangeStart.getDate();inst._selectedMonth=inst._currentMonth=inst._rangeStart.getMonth();inst._selectedYear=inst._currentYear=inst._rangeStart.getFullYear();inst._rangeStart=null;if(inst._inline){this._updateDatepicker(inst)}}}},_clearDate:function(id){var inst=this._getInst(id);this._stayOpen=false;inst._endDay=inst._endMonth=inst._endYear=inst._rangeStart=null;this._selectDate(inst,"")},_selectDate:function(id,dateStr){var inst=this._getInst(id);dateStr=(dateStr!=null?dateStr:inst._formatDate());if(inst._rangeStart){dateStr=inst._formatDate(inst._rangeStart)+inst._get("rangeSeparator")+dateStr}if(inst._input){inst._input.val(dateStr)}var onSelect=inst._get("onSelect");if(onSelect){onSelect.apply((inst._input?inst._input[0]:null),[dateStr,inst])}else{if(inst._input){inst._input.trigger("change")}}if(inst._inline){this._updateDatepicker(inst)}else{if(!this._stayOpen){this.hideDatepicker(inst._get("speed"));this._lastInput=inst._input[0];if(typeof (inst._input[0])!="object"){inst._input[0].focus()}this._lastInput=null}}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){checkDate.setDate(checkDate.getDate()+3);return $.datepicker.iso8601Week(checkDate)}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},dateStatus:function(date,inst){return $.datepicker.formatDate(inst._get("dateStatus"),date,inst._getFormatConfig())},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var size=(match=="y"?4:2);var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+(value.charAt(iValue++)-0);size--}if(size==(match=="y"?4:2)){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}var date=new Date(year,month-1,day);if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value){return(lookAhead(match)&&value<10?"0":"")+value};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate());break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"m":output+=formatNumber("m",date.getMonth()+1);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars}});function DatepickerInstance(settings,inline){this._id=$.datepicker._register(this);this._selectedDay=0;this._selectedMonth=0;this._selectedYear=0;this._drawMonth=0;this._drawYear=0;this._input=null;this._inline=inline;this._datepickerDiv=(!inline?$.datepicker._datepickerDiv:$('<div id="datepicker_div_'+this._id+'" class="datepicker_inline"></div>'));this._settings=extendRemove({},settings||{});if(inline){this._setDate(this._getDefaultDate())}}$.extend(DatepickerInstance.prototype,{_get:function(name){return(this._settings[name]!=null?this._settings[name]:$.datepicker._defaults[name])},_setDateFromField:function(input){this._input=$(input);var dateFormat=this._get("dateFormat");var dates=this._input?this._input.val().split(this._get("rangeSeparator")):null;this._endDay=this._endMonth=this._endYear=null;var date=defaultDate=this._getDefaultDate();if(dates.length>0){var settings=this._getFormatConfig();if(dates.length>1){date=$.datepicker.parseDate(dateFormat,dates[1],settings)||defaultDate;this._endDay=date.getDate();this._endMonth=date.getMonth();this._endYear=date.getFullYear()}try{date=$.datepicker.parseDate(dateFormat,dates[0],settings)||defaultDate}catch(e){$.datepicker.log(e);date=defaultDate}}this._selectedDay=date.getDate();this._drawMonth=this._selectedMonth=date.getMonth();this._drawYear=this._selectedYear=date.getFullYear();this._currentDay=(dates[0]?date.getDate():0);this._currentMonth=(dates[0]?date.getMonth():0);this._currentYear=(dates[0]?date.getFullYear():0);this._adjustDate()},_getDefaultDate:function(){var date=this._determineDate("defaultDate",new Date());var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(name,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var matches=/^([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?$/.exec(offset);if(matches){var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();switch(matches[2]||"d"){case"d":case"D":day+=(matches[1]-0);break;case"w":case"W":day+=(matches[1]*7);break;case"m":case"M":month+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=(matches[1]-0);day=Math.min(day,getDaysInMonth(year,month));break}date=new Date(year,month,day)}return date};var date=this._get(name);return(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?offsetNumeric(date):date)))},_setDate:function(date,endDate){this._selectedDay=this._currentDay=date.getDate();this._drawMonth=this._selectedMonth=this._currentMonth=date.getMonth();this._drawYear=this._selectedYear=this._currentYear=date.getFullYear();if(this._get("rangeSelect")){if(endDate){this._endDay=endDate.getDate();this._endMonth=endDate.getMonth();this._endYear=endDate.getFullYear()}else{this._endDay=this._currentDay;this._endMonth=this._currentMonth;this._endYear=this._currentYear}}this._adjustDate()},_getDate:function(){var startDate=(!this._currentYear||(this._input&&this._input.val()=="")?null:new Date(this._currentYear,this._currentMonth,this._currentDay));if(this._get("rangeSelect")){return[startDate,(!this._endYear?null:new Date(this._endYear,this._endMonth,this._endDay))]}else{return startDate}},_generateDatepicker:function(){var today=new Date();today=new Date(today.getFullYear(),today.getMonth(),today.getDate());var showStatus=this._get("showStatus");var isRTL=this._get("isRTL");var clear=(this._get("mandatory")?"":'<div class="datepicker_clear"><a onclick="jQuery.datepicker._clearDate('+this._id+');"'+(showStatus?this._addStatus(this._get("clearStatus")||"&#xa0;"):"")+">"+this._get("clearText")+"</a></div>");var controls='<div class="datepicker_control">'+(isRTL?"":clear)+'<div class="datepicker_close"><a onclick="jQuery.datepicker.hideDatepicker();"'+(showStatus?this._addStatus(this._get("closeStatus")||"&#xa0;"):"")+">"+this._get("closeText")+"</a></div>"+(isRTL?clear:"")+"</div>";var prompt=this._get("prompt");var closeAtTop=this._get("closeAtTop");var hideIfNoPrevNext=this._get("hideIfNoPrevNext");var numMonths=this._getNumberOfMonths();var stepMonths=this._get("stepMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");var drawMonth=this._drawMonth;var drawYear=this._drawYear;if(maxDate){var maxDraw=new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate());maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(new Date(drawYear,drawMonth,1)>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}var prev='<div class="datepicker_prev">'+(this._canAdjustMonth(-1,drawYear,drawMonth)?'<a onclick="jQuery.datepicker._adjustDate('+this._id+", -"+stepMonths+", 'M');\""+(showStatus?this._addStatus(this._get("prevStatus")||"&#xa0;"):"")+">"+this._get("prevText")+"</a>":(hideIfNoPrevNext?"":"<label>"+this._get("prevText")+"</label>"))+"</div>";var next='<div class="datepicker_next">'+(this._canAdjustMonth(+1,drawYear,drawMonth)?'<a onclick="jQuery.datepicker._adjustDate('+this._id+", +"+stepMonths+", 'M');\""+(showStatus?this._addStatus(this._get("nextStatus")||"&#xa0;"):"")+">"+this._get("nextText")+"</a>":(hideIfNoPrevNext?">":"<label>"+this._get("nextText")+"</label>"))+"</div>";var html=(prompt?'<div class="datepicker_prompt">'+prompt+"</div>":"")+(closeAtTop&&!this._inline?controls:"")+'<div class="datepicker_links">'+(isRTL?next:prev)+(this._isInRange(today)?'<div class="datepicker_current"><a onclick="jQuery.datepicker._gotoToday('+this._id+');"'+(showStatus?this._addStatus(this._get("currentStatus")||"&#xa0;"):"")+">"+this._get("currentText")+"</a></div>":"")+(isRTL?prev:next)+"</div>";var showWeeks=this._get("showWeeks");for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){var selectedDate=new Date(drawYear,drawMonth,this._selectedDay);html+='<div class="datepicker_oneMonth'+(col==0?" datepicker_newRow":"")+'">'+this._generateMonthYearHeader(drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0)+'<table class="datepicker" cellpadding="0" cellspacing="0"><thead><tr class="datepicker_titleRow">'+(showWeeks?"<td>"+this._get("weekHeader")+"</td>":"");var firstDay=this._get("firstDay");var changeFirstDay=this._get("changeFirstDay");var dayNames=this._get("dayNames");var dayNamesShort=this._get("dayNamesShort");var dayNamesMin=this._get("dayNamesMin");for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;var status=this._get("dayStatus")||"&#xa0;";status=(status.indexOf("DD")>-1?status.replace(/DD/,dayNames[day]):status.replace(/D/,dayNamesShort[day]));html+="<td"+((dow+firstDay+6)%7>=5?' class="datepicker_weekEndCell"':"")+">"+(!changeFirstDay?"<span":'<a onclick="jQuery.datepicker._changeFirstDay('+this._id+", "+day+');"')+(showStatus?this._addStatus(status):"")+' title="'+dayNames[day]+'">'+dayNamesMin[day]+(changeFirstDay?"</a>":"</span>")+"</td>"}html+="</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==this._selectedYear&&drawMonth==this._selectedMonth){this._selectedDay=Math.min(this._selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var currentDate=(!this._currentDay?new Date(9999,9,9):new Date(this._currentYear,this._currentMonth,this._currentDay));var endDate=this._endDay?new Date(this._endYear,this._endMonth,this._endDay):currentDate;var printDate=new Date(drawYear,drawMonth,1-leadDays);var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var beforeShowDay=this._get("beforeShowDay");var showOtherMonths=this._get("showOtherMonths");var calculateWeek=this._get("calculateWeek")||$.datepicker.iso8601Week;var dateStatus=this._get("statusForDate")||$.datepicker.dateStatus;for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="datepicker_daysRow">'+(showWeeks?'<td class="datepicker_weekCol">'+calculateWeek(printDate)+"</td>":"");for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((this._input?this._input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);html+='<td class="datepicker_daysCell'+((dow+firstDay+6)%7>=5?" datepicker_weekEndCell":"")+(otherMonth?" datepicker_otherMonth":"")+(printDate.getTime()==selectedDate.getTime()&&drawMonth==this._selectedMonth?" datepicker_daysCellOver":"")+(unselectable?" datepicker_unselectable":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" datepicker_currentDay":"")+(printDate.getTime()==today.getTime()?" datepicker_today":""))+'"'+(unselectable?"":" onmouseover=\"jQuery(this).addClass('datepicker_daysCellOver');"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#datepicker_status_"+this._id+"').html('"+(dateStatus.apply((this._input?this._input[0]:null),[printDate,this])||"&#xa0;")+"');")+"\" onmouseout=\"jQuery(this).removeClass('datepicker_daysCellOver');"+(!showStatus||(otherMonth&&!showOtherMonths)?"":"jQuery('#datepicker_status_"+this._id+"').html('&#xa0;');")+'" onclick="jQuery.datepicker._selectDay('+this._id+","+drawMonth+","+drawYear+', this);"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():"&#xa0;"):(unselectable?printDate.getDate():"<a>"+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1)}html+="</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}html+="</tbody></table></div>"}}html+=(showStatus?'<div id="datepicker_status_'+this._id+'" class="datepicker_status">'+(this._get("initStatus")||"&#xa0;")+"</div>":"")+(!closeAtTop&&!this._inline?controls:"")+'<div style="clear: both;"></div>'+($.browser.msie&&parseInt($.browser.version)<7&&!this._inline?'<iframe src="javascript:false;" class="datepicker_cover"></iframe>':"");return html},_generateMonthYearHeader:function(drawMonth,drawYear,minDate,maxDate,selectedDate,secondary){minDate=(this._rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var showStatus=this._get("showStatus");var html='<div class="datepicker_header">';var monthNames=this._get("monthNames");if(secondary||!this._get("changeMonth")){html+=monthNames[drawMonth]+"&#xa0;"}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);html+='<select class="datepicker_newMonth" onchange="jQuery.datepicker._selectMonthYear('+this._id+", this, 'M');\" onclick=\"jQuery.datepicker._clickMonthYear("+this._id+');"'+(showStatus?this._addStatus(this._get("monthStatus")||"&#xa0;"):"")+">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){html+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNames[month]+"</option>"}}html+="</select>"}if(secondary||!this._get("changeYear")){html+=drawYear}else{var years=this._get("yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="datepicker_newYear" onchange="jQuery.datepicker._selectMonthYear('+this._id+", this, 'Y');\" onclick=\"jQuery.datepicker._clickMonthYear("+this._id+');"'+(showStatus?this._addStatus(this._get("yearStatus")||"&#xa0;"):"")+">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}html+="</div>";return html},_addStatus:function(text){return" onmouseover=\"jQuery('#datepicker_status_"+this._id+"').html('"+text+"');\" onmouseout=\"jQuery('#datepicker_status_"+this._id+"').html('&#xa0;');\""},_adjustDate:function(offset,period){var year=this._drawYear+(period=="Y"?offset:0);var month=this._drawMonth+(period=="M"?offset:0);var day=Math.min(this._selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=new Date(year,month,day);var minDate=this._getMinMaxDate("min",true);var maxDate=this._getMinMaxDate("max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);this._selectedDay=this._currentDay=date.getDate();this._drawMonth=this._currentMonth=this._selectedMonth=date.getMonth();this._drawYear=this._currentYear=this._selectedYear=date.getFullYear()},_getNumberOfMonths:function(){var numMonths=this._get("numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(minMax,checkRange){var date=this._determineDate(minMax+"Date",null);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return date||(checkRange?this._rangeStart:null)},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(offset,curYear,curMonth){var numMonths=this._getNumberOfMonths();var date=new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(date)},_isInRange:function(date){var newMinDate=(!this._rangeStart?null:new Date(this._selectedYear,this._selectedMonth,this._selectedDay));newMinDate=(newMinDate&&this._rangeStart<newMinDate?this._rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate("min");var maxDate=this._getMinMaxDate("max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(){var shortYearCutoff=this._get("shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get("dayNamesShort"),dayNames:this._get("dayNames"),monthNamesShort:this._get("monthNamesShort"),monthNames:this._get("monthNames")}},_formatDate:function(day,month,year){if(!day){this._currentDay=this._selectedDay;this._currentMonth=this._selectedMonth;this._currentYear=this._selectedYear}var date=(day?(typeof day=="object"?day:new Date(year,month,day)):new Date(this._currentYear,this._currentMonth,this._currentDay));return $.datepicker.formatDate(this._get("dateFormat"),date,this._getFormatConfig())}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=null}}return target}$.fn.datepicker=function(options){var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$(document).ready(function(){$.datepicker=new Datepicker();$(document.body).append($.datepicker._datepickerDiv).mousedown($.datepicker._checkExternalClick)})})(jQuery);var ColorUtils=function(){var A={hexbase:"0123456789ABCDEF",contrast:function(C){C=parseInt(C.substr(1),16);C=(C>>16)*0.3+(C>>8&255)*0.5+(C&255)*0.2;C+=C<100?100:-100;C=Math.round(C);var B=(A.toHex(C)+A.toHex(C)+A.toHex(C)).toUpperCase();return B},toHex:function(B){B=parseInt(B).toString(16);return B.length<2?"0"+B:B},inverseColor:function(B){a=B.slice(0,2);b=B.slice(2,4);c=B.slice(4,6);a1=16*A.giveHex(a.slice(0,1));a2=A.giveHex(a.slice(1,2));a=a1+a2;b1=16*A.giveHex(b.slice(0,1));b2=A.giveHex(b.slice(1,2));b=b1+b2;c1=16*A.giveHex(c.slice(0,1));c2=A.giveHex(c.slice(1,2));c=c1+c2;newColor=A.DecToHex(255-a)+""+A.DecToHex(255-b)+""+A.DecToHex(255-c);return newColor},DecToHex:function(B){return A.hexbase.charAt((B>>4)&15)+A.hexbase.charAt(B&15)},giveHex:function(B){B=B.toUpperCase();return parseInt(B,16)},getTextColor:function(C){var B=A.difference(C,"ffffff");var D=A.difference(C,"000000");return B>D?"ffffff":"000000"},difference:function(C,B){var F=rgb(C);var D=rgb(B);var E=(Math.max(F.r,D.r)-Math.min(F.r,D.r))+(Math.max(F.g,D.g)-Math.min(F.g,D.g))+(Math.max(F.b,D.b)-Math.min(F.b,D.b));return Math.abs(Math.round(E))},rgb:function(C){var C=C.replace("#","");var B={r:parseInt(C[0]+C[1],16),g:parseInt(C[2]+C[3],16),b:parseInt(C[4]+C[5],16)};return B}};return A}();var HomeJS=function(){var _private={editingEID:-1,formData:new Object(),editingCaption:"",deleteEvent:function(id,cbFunc,cbParam){tl.closeBubble();var answer=confirm("Are you sure you want to delete this event?");if(answer){var postData="tid="+timeline_id+"&eid="+id;$.ajax({type:"POST",url:"/cmd/Event/del",dataType:"json",data:postData,success:function(res){if(res.success==1){if(cbFunc){cbFunc(cbParam)}tl.removeEvent(res.result)}}})}},avatarAdded:function(insertid,thumburl,caption,ultype){$D("uploadbox").style.display="none";$D("avatarimage").src=thumburl;$("#avatarholder").empty();$D("avatarholder").appendChild(Builder.node("img",{src:thumburl}))},showCaptionEdit:function(mid,x,y){_private.editingCaptionMID=mid;$.post("/cmd/Edit/getCaption",{tlid:timeline_id,mid:mid},function(data){var json=tojs(data);var menu=$D("captionmenu");$D("mediamanagercover").style.display="block";menu.style.display="block";menu.style.top=y+"px";menu.style.left=x+"px";$("#captiontext").val(json.caption).focus()})},getImageOrder:function(){var ids="";var holder=$D("pictureholder");var children=holder.childNodes;for(var i=0;i<children.length;i++){if(i>0){ids+=","}var nodeid=children[i].id;var pid=nodeid.after("_");ids+=pid}return ids},parseDate2:function(date){var split=date.split(" ");var length=split.length;var dateSplit=split[0].split("/");var ampm=split[2];var timeSplit=split[1].split(":");var res=new Object();res.month=dateSplit[0]-0;res.day=dateSplit[1]-0;res.year=dateSplit[2]-0;res.hour=timeSplit[0]-0;res.minute=timeSplit[1]-0;res.ampm=ampm;return res},initPanel:function(tar){$(".configPanel").hide();$("#tab-lifebox").get(0).className="buttontab";$("#tab-colors").get(0).className="buttontab";$("#tab-privacy").get(0).className="buttontab";$("#tab-embed").get(0).className="buttontab";if(tar=="t"){var err=$D("nameanddescerror");if(err){err.style.display="none"}$("#tab-lifebox").get(0).className="buttontabactive";$("#tlConfigMainForm").show();_private.formData.nameDesc=$("#formNameDesc").formToArray()}else{if(tar=="c"){$("#tab-colors").get(0).className="buttontabactive";$("#tlConfigColorsForm").show();_private.formData.categories=$("#formCategories").formToArray();_private.formData.categoriesExtra=new Object();_private.formData.categoriesExtra.bgimgthumb=$("#bgImgPreview")[0].src;_private.formData.categoriesExtra.bgimgid=$("#bgImgId").val()}else{if(tar=="p"){$("#tab-privacy").get(0).className="buttontabactive";$("#tlConfigPrivacyForm").show();_private.formData.privacy=$("#formPrivacy").formToArray()}else{if(tar=="e"){$("#tab-embed").get(0).className="buttontabactive";$("#tlConfigEmbedForm").show();_private.formData.embed=$("#formEmbed").formToArray()}}}}},setContentText:function(data){try{$("#description").val(data)}catch(e){}},getContentText:function(data){return $("#description").val()},populateEditEventContent:function(eid,tid,cb,cbParam,isSubEvt){_private.removeAllPictures();_private.editingEID=eid;_private.editingSubeventContent=isSubEvt;if(!isSubEvt){_public.subEvtGoBack();_private.editMainEvt=eid}if(window.frames.uploadframe&&window.frames.uploadframe.setParams){window.frames.uploadframe.setParams(eid)}$.post("/cmd/Edit/getEditContent",{tlid:timeline_id,eid:eid,p:_private.isParticipant},function(data){var res=eval("("+data+")");if(res.rcode==1){var epane=$D("contenteditor");$D("contenterror").style.display="none";_private.activeEventPanel="c";var imgOrder=res.event.imageOrder;var imgOrderArray=imgOrder.split(",");$D("sources").value=res.event.sources;_private.setContentText(res.event.description);var d=res.event.description;var s=res.event.sources;var i=imgOrder;_private.formData.content=new Array(_private.editingEID,d==undefined?"":d,s==undefined?"":s,i==undefined?"":i);var pics=res.pictures;imgOrderArray.reverse();function sortByImgOrder(a,b){var x=imgOrderArray.indexOf(a.id);var y=imgOrderArray.indexOf(b.id);return((x<y)?1:((x>y)?-1:0))}pics.sort(sortByImgOrder);for(var i=0;i<pics.length;i++){var pic=pics[i];_public.addPicture(pic.id,pic.thumburl)}if(!isSubEvt){_public.subevents=res.subevents;var edate=res.event.end;if(res.event.type=="o"){var now=new Date();now.setUTCHours(now.getHours(),now.getMinutes(),0,0);edate=now.format("yyyy-mm-dd HH:MM:ss")}createMiniTimeline(505,res.event.type,(res.event.use_time=="1"),res.event.start,edate,res.subevents,$("#subeholder"))}if(cb){cb(cbParam)}}});return false},currentShares:null,loadShares:function(shares){_private.currentShares=shares;var par=$D("peopleholder");while(par.hasChildNodes()){par.removeChild(par.firstChild)}_private.formData.shared=new Array();for(var i=0;i<shares.length;i++){var share=shares[i];_private.formData.shared.push(share.personid+"-"+share.permission);var node=_private.createShareNode(share);par.appendChild(node)}if(_private.formData.shared.length>0){_private.formData.shared.sort()}},createShareNode:function(share){var node=Builder.node("div",{"class":"node",id:share.personid},[Builder.node("div",{style:"float:left",id:share.personid},share.name),delBut=Builder.node("div",{"class":"nodedel"})]);if(share.state==0){node.style.backgroundColor="#003F87";node.style.color="#fff"}else{if(share.state==1){node.style.backgroundColor="#006633";node.style.color="#fff"}}jQuery(node).click(function(event){var target=$(event.target)[0];if(target.className=="nodedel"){editingShare=target.parentNode.id;var x=event.pageX;var y=event.pageY;var menu=$D("sharemenu");menu.style.visibility="visible";menu.style.top=y+"px";menu.style.left=x+"px";$D("sharemenuro").firstChild.checked=false;if(share.permission==1){$D("sharemenuro").firstChild.checked=true}$D("sharecover").style.visibility="visible"}else{}});return node},populateEditEventShare:function(eid,tid,cb,cbParam){_private.editingEID=eid;var params={tlid:timeline_id,eid:eid};$.post("/cmd/Edit/getShares",params,function(data){var res=eval("("+data+")");if(res.success==1){_private.loadShares(res.shares);if(cb){cb(cbParam)}}else{if(res.success==0){alert("An error occurred: "+res.error)}}})},parseDate:function(date){date=date.trim();var time=null;var spaceIndex=date.indexOf(" ");if(spaceIndex!=-1){date=date.substring(0,spaceIndex).trim();time=date.substring(spaceIndex).trim()}var dateParts=null;var dateString="";if(date.indexOf("/")!=-1){dateParts=date.split("/")}else{if(date.indexOf("-")!=-1){dateParts=date.split("-")}}if(dateParts==null){dateString="01/01/"+date}else{if(dateParts.length==2){dateString=dateParts[0]+"/01/"+dateParts[1]}else{if(dateParts.length==3){dateString=dateParts[0]+"/"+dateParts[1]+"/"+dateParts[2]}}}return dateString+" 12:00 PM"},removeAllPictures:function(){var holder=$D("pictureholder");while(holder.firstChild){holder.removeChild(holder.firstChild)}},del_picture:function(mid){$.post("/cmd/Edit/delPicture",{tlid:timeline_id,mid:mid,eid:_private.editingEID,p:_private.isParticipant},function(res){var data=tojs(res);if(data.rcode==1){$("#photo_"+mid).remove()}})},buildColorEditor:function(categories){if(nil(categories)){return }var editorHolder=document.getElementById("cateditortable");for(var i=0;i<categories.length;i++){var node=Builder.node("div",{},[catNode=Builder.node("div",{style:"width:250px;float:left"}),Builder.node("div",{style:"float:left"},[Builder.node("input",{size:"6",readonly:true,value:categories[i].color,type:"text",id:"cf_"+categories[i].id,name:"clrBox_"+categories[i].id})]),Builder.node("div",{style:"clear:both"})]);catNode.innerHTML=categories[i].category+":";editorHolder.appendChild(node);_private.initForColorPicker("cf_"+categories[i].id)}},setType:function(type){if(type=="i"){$D("startdatelabel").innerHTML="Date:";$D("inlineFrom").style.marginLeft="100px";$D("timetoggle").style.marginLeft="100px";$D("tmchosr").style.paddingLeft="100px";$D("enddate").style.display="none";$D("endtimeh").style.display="none";$D("enddatetext").style.display="none"}else{if(type=="d"){$D("startdatelabel").innerHTML="Start Date:";$D("inlineFrom").style.marginLeft="0px";$D("tmchosr").style.paddingLeft="0px";$D("timetoggle").style.marginLeft="0px";$D("enddate").style.display="";$D("endtimeh").style.display="block";$D("inlineTo").style.display="block";$D("enddatetext").style.display="none"}else{if(type=="o"){$D("startdatelabel").innerHTML="Start Date:";$D("inlineFrom").style.marginLeft="0px";$D("tmchosr").style.paddingLeft="0px";$D("timetoggle").style.marginLeft="0px";$D("inlineTo").style.display="none";$D("enddate").style.display="block";$D("endtimeh").style.display="none";$D("enddatetext").style.display="block"}}}},showEditEventPanel:function(type){$(".editEventPanel").hide();$("#editEventPanel").css({width:_private.panelWidth[type]+"px"});$("#eventheader").css({width:""});$("#editEventPanel"+type).show();$("#editEventTabEvent").get(0).className="buttontab";$("#editEventTabContent").get(0).className="buttontab";$("#editEventTabDelete").get(0).className="buttontab";$("#editEventTab"+type).get(0).className="buttontabactive";showOverlay();$("#eventEditMainPanel").show()},initForColorPicker:function(id){$D(id).style.backgroundColor="#"+$D(id).value;$D(id).style.color="#"+ColorUtils.contrast($D(id).value);$("#"+id).click(function(e){currentlyEditing=e.target;var x=e.pageX+currentlyEditing.offsetWidth;var y=e.pageY;$D("colorPickerContainer").style.visibility="visible";$D("colorPickerContainer").style.top=y+"px";$D("colorPickerContainer").style.left=x+"px";setHexColor(currentlyEditing.value)})},panelWidth:{Content:600,Event:444,Share:480},activeEventPanel:"",chgEvtPan:function(tar){if(_private.activeEventPanel==tar){return }var cbParam=new Object();cbParam.tar=tar;cbParam.eid=_private.editMainEvt;if(tar=="d"){_private.deleteEvent(_private.editingEID,_private.showEvtPan,cbParam);return }if(_private.activeEventPanel=="e"){_public.saveEvent(true,false,_private.showEvtPan,cbParam,false)}else{if(_private.activeEventPanel=="c"){_public.saveEventContent(true,false,_private.showEvtPan,cbParam)}else{if(_private.activeEventPanel=="s"){_public.saveEventShare(true,false,_private.showEvtPan,cbParam)}}}},showEvtPan:function(obj){if(obj.tar=="e"){_private.populateEditEvent(obj.eid,_private.showEditEventPanel,"Event",false)}else{if(obj.tar=="c"){_public.subEvtGoBack();_private.populateEditEventContent(obj.eid,obj.tid,_private.showEditEventPanel,"Content",false)}else{if(obj.tar=="s"){_private.populateEditEventShare(obj.eid,obj.tid,_private.showEditEventPanel,"Share")}else{if(obj.tar=="d"){_public.closeEvtConfig()}}}}_private.activeEventPanel=obj.tar},populateEditEvent:function(id,cb,cbParam,isSubEvent){var url=isSubEvent?"/cmd/Event/getSub":"/cmd/Event/get";$.post(url,{tid:timeline_id,eid:id},function(data){var res=eval("("+data+")");if(res.success==1){var evt=res.result;_private.editingEID=evt.id;$D("title").value=evt.title;$D("category").value=evt.category;var startD=_private.parseDate2(evt.start);var d=new Date(startD.year,parseInt(startD.month)-1,startD.day);$("#inlineFrom").datepicker("setDate",d);var tmpDate=new Date();var hour=startD.hour;if(hour==12){hour=0}if(startD.ampm=="PM"){hour+=12}tmpDate.setUTCHours(hour,startD.minute,0,0);timeChooserSetTime("#starttime",tmpDate);if(evt.use_time==1){$("#useTimeCheckbox")[0].checked=true;timeChooserSetEnabled(".timeentry",true)}else{$("#useTimeCheckbox")[0].checked=false;timeChooserSetEnabled(".timeentry",false)}var type=evt.type;if(type=="o"){$D("ongoing").checked=true;_private.setType("o")}if(type=="i"){$D("instant").checked=true;_private.setType("i")}if(type=="d"){var endD=_private.parseDate2(evt.end);$D("duration").checked=true;_private.setType("d");$("#inlineTo").datepicker("setDate",new Date(endD.year,parseInt(endD.month)-1,endD.day));var tmpDate=new Date();var hour=endD.hour;if(hour==12){hour=0}if(endD.ampm=="PM"){hour+=12}tmpDate.setUTCHours(hour,endD.minute,0,0);timeChooserSetTime("#endtime",tmpDate)}var initSDate=$("#inlineFrom").datepicker("getDate");var initEDate=$("#inlineTo").datepicker("getDate");var isUsingTime=false;if(($("#useTimeCheckbox")[0]).checked){var startTimeDate=timeChooserGetTime("#starttime");initSDate.setUTCHours(startTimeDate.getUTCHours(),startTimeDate.getUTCMinutes(),0,0);if(evt.type=="d"){var endTimeDate=timeChooserGetTime("#endtime");initEDate.setUTCHours(endTimeDate.getUTCHours(),endTimeDate.getUTCMinutes(),0,0)}}else{initSDate.setUTCHours(0,0,0,0);initEDate.setUTCHours(0,0,0,0)}_private.formData.eventHeader=new Array(evt.id,evt.use_time,evt.type,evt.title,evt.category,initSDate.toLocaleString(),(evt.type=="d"?initEDate.toLocaleString():""));cb(cbParam)}});return false},createDateString:function(thedate){var month=thedate.getUTCMonth()+1;var date=thedate.getUTCDate();var year=thedate.getUTCFullYear();var hour=thedate.getUTCHours();var minute=thedate.getUTCMinutes();return month+"/"+date+"/"+year+" "+hour+":"+minute},isParticipant:0};var _public={typeChanged:function(){if($D("instant").checked){_private.setType("i")}else{if($D("duration").checked){_private.setType("d")}else{if($D("ongoing").checked){_private.setType("o")}}}},subEvtGoBack:function(){$("#addSubBtn").show();$("#subectrls").hide();$(".subicosel").removeClass("subicosel");$(".sublabelsel").removeClass("sublabelsel")},delSubEvt:function(){$.post("/cmd/Edit/rmSub",{tlid:timeline_id,seid:_private.editingEID,p:_private.isParticipant},function(data){var res=eval("("+data+")");if(res.rcode==1){var eid=res.eid;var idx=-1;for(var i=0;i<_public.subevents.length;i++){if(_public.subevents[i].id==eid){idx=i;break}}if(idx>=0){_public.subevents.splice(idx,1)}createMiniTimeline(505,null,null,null,null,_public.subevents,$("#subeholder"))}_public.showGoBack()})},populatedSubEvt:function(){$("#editEventPanel").block();var edPan=$("#editEventPanelEvent").show().get(0);$("#evtcategory").hide();$("#evtcontrols").hide();$("#subevtcontrols").show();$("#subevtedit").append(edPan);$("#subevtedit").show()},editSubEvt:function(){_private.editingSEID=_private.editingEID;_private.populateEditEvent(_private.editingEID,_public.populatedSubEvt,"ok",true)},doGoBack:function(cbParam){_private.populateEditEventContent(_private.editMainEvt,timeline_id,_public.subEvtGoBack,"Content",true)},showGoBack:function(){var cbParam=new Object();_public.saveEventContent(true,false,_public.doGoBack,cbParam)},showAddSubEvent:function(){_private.editingSEID=-1;$D("title").value="";$D("category").value="";$D("instant").checked=true;$("#useTimeCheckbox")[0].checked=false;timeChooserSetEnabled(".timeentry",false);var edPan=$("#editEventPanelEvent").show().get(0);$("#evtcategory").hide();$("#evtcontrols").hide();$("#subevtcontrols").show();$("#subevtedit").append(edPan);_public.typeChanged();$("#subevtedit").show();$("#editEventPanel").block()},saveSubEvent:function(){_public.saveEvent(false,false,null,null,true);var edPan=$("#editEventPanelEvent").hide().get(0);$("#evtcategory").show();$("#evtcontrols").show();$("#subevtcontrols").hide();$("#editEventPanel").append(edPan);$("#subevtedit").hide();$("#editEventPanel").unblock()},closeSubEvt:function(){var edPan=$("#editEventPanelEvent").hide().get(0);$("#evtcategory").show();$("#evtcontrols").show();$("#subevtcontrols").hide();$("#editEventPanel").append(edPan);$("#subevtedit").hide();$("#editEventPanel").unblock()},closeEvtConfig:function(){$("#eventEditMainPanel").hide();hideOverlay()},chgEvtPan:function(tar){_private.chgEvtPan(tar)},saveEventContent:function(prompt,closeIt,cbFunc,cbParam){var d=_private.getContentText();var s=$D("sources").value;var eid=_private.editingEID;var i=_private.getImageOrder();var isSubContent=_private.editingSubeventContent;var contents=d;var sources=s;var imageOrder=i;var data=new Array(eid,d==undefined?"":d,s==undefined?"":s,i==undefined?"":i);if(_private.formData.content.compareArrays(data)){if(cbFunc){cbParam.res="nochg";cbFunc(cbParam)}if(closeIt){_public.closeEvtConfig()}return }var yesFunc=function(){var params={tlid:timeline_id,sources:sources,p:_private.isParticipant,imageOrder:imageOrder,eid:eid,desc:contents};$.post("/cmd/Edit/saveDesc",params,function(data){var res=eval("("+data+")");if(res.rcode==1){if(cbFunc){cbParam.res="saved";cbFunc(cbParam)}if(closeIt){_public.closeEvtConfig()}}else{if(res.rcode==0){$D("contenterror").style.display="block";$D("contenterror").innerHTML=res.errors}}})};if(prompt){yesNoCancel($("#editEventPanel"),{yes:function(){yesFunc()},no:function(){if(cbFunc){cbParam.res="nosav";cbFunc(cbParam)}if(closeIt){_public.closeEvtConfig()}return },cancel:function(){}})}else{yesFunc()}},cancelContent:function(){delete _private.formData.content;delete _private.formData.sortOrder;$("#eventEditMainPanel").hide();hideOverlay()},loadCategoriesJSON:function(categories){if(!categories){return }for(var i=0;i<categories.length;i++){if(!theme.event.taggedColors[categories[i].timeline_id]){theme.event.taggedColors[categories[i].timeline_id]=new Object();theme.event.taggedColors[categories[i].timeline_id][categories[i].id]=new Object()}if(!theme.event.taggedColors[categories[i].timeline_id][categories[i].id]){theme.event.taggedColors[categories[i].timeline_id][categories[i].id]=new Object()}theme.event.taggedColors[categories[i].timeline_id][categories[i].id].color="#"+categories[i].color;theme.event.taggedColors[categories[i].timeline_id][categories[i].id].isVisible=true}_private.buildColorEditor(categories)},hideNoEventTip:function(){$("#addeventtip").remove()},showNoEventTip:function(){var d=Builder.node("div",{id:"addeventtip",style:"z-index:1009;position:absolute;width:222px;height:100px;"},[Builder.node("div",{"class":"arrbox"},""),ct=Builder.node("div",{"class":"arrct"},[Builder.node("div",{style:"margin:10px"},"Click here to start adding events to your lifebox.")])]);document.body.appendChild(d);var elem=$("#addeventbutton");var pos=elem.position();var x=pos.left+(elem.get(0).offsetWidth);var y=pos.top+(elem.get(0).offsetHeight/2);d.style.left=x+"px";d.style.top=(y-15-20)+"px";jQuery(ct).corner()},addColorChooser:function(category,catid,color){var editorHolder=document.getElementById("cateditortable");var node=Builder.node("div",{},[catNode=Builder.node("div",{style:"width:250px;float:left"},category),Builder.node("div",{style:"float:left"},[Builder.node("input",{size:"6",readonly:true,name:"clrBox_"+catid,value:color,type:"text",id:"cf_"+catid})]),Builder.node("div",{style:"clear:both"})]);catNode.innerHTML=category+":";editorHolder.appendChild(node);_private.initForColorPicker("cf_"+catid)},createCategory:function(timeline_id,category,catid,color){if(!theme.event.taggedColors[timeline_id]){theme.event.taggedColors[timeline_id]=new Object()}if(!theme.event.taggedColors[timeline_id][catid]){theme.event.taggedColors[timeline_id][catid]=new Object();theme.event.taggedColors[timeline_id][catid].color="#"+color;theme.event.taggedColors[timeline_id][catid].isVisible=true;_public.addColorChooser(category,catid,color)}},tlAddEvent:function(data){_public.createCategory(data.timeline_id,data.category,data.category_id,"0066CC");var evt=tl.getBand(0).getEventSource().loadOneJSON(data);tl.getBand(0).ensureEventVisible(evt)},delClicked:function(mid){var answer=confirm("Are you sure you want to delete this image?");if(answer){_private.del_picture(mid)}},leaveEvent:function(eid){var params={tlid:timeline_id,eid:eid};$.post("/cmd/Edit/leaveShare",params,function(data){var res=eval("("+data+")");if(res.success==1){tl.removeEvent(eid)}else{if(res.success==0){alert("An error occurred: "+res.error)}}})},cancelURLImageImport:function(){$D("urlimageimportbox").style.display="none";$D("mediamanagercover").style.display="none"},showURLImageImport:function(){$D("urlimageimportbox").style.display="block";$D("mediamanagercover").style.display="block";$("#urlimageimportfield").focus().val("")},submitURLImageImport:function(){var fid=0;var actv=$(".mediafolder_active");if(actv.length>0){fid=actv.get(0).id.after("_")}var url=$D("urlimageimportfield").value;var postData="tlid="+timeline_id+"&imgurl="+encodeURIComponent(url)+"&fid="+fid;$.ajax({type:"POST",url:"/cmd/Edit/pbImport",data:postData,dataType:"json",success:function(js){if(js.rcode==1){var img=js.img;imageUploaded(img);_public.cancelURLImageImport();gMsg("Image imported")}else{_public.cancelURLImageImport();gMsg(js.err)}}})},submitYouTube:function(){var fid=0;var actv=$(".mediafolder_active");if(actv.length>0){fid=actv.get(0).id.after("_")}var youtubeurl=$D("youtubeURL2").value;var postData="tlid="+timeline_id+"&type=1&url="+encodeURIComponent(youtubeurl)+"&thumburl=&fid="+fid;$.ajax({type:"POST",url:"/cmd/Edit/addMedia",data:postData,dataType:"json",success:function(res){if(res.rcode==1){var obj=new Object();obj.id=res.id;obj.thumburl=res.thumburl;obj.type=res.type;_public.addMedia(obj);_public.cancelYouTube();$D("youtubeURL2").value="";gMsg('<strong>Success:</strong> <span class="indent">YouTube video added</span>')}}})},initPB:false,showPBBox:function(){$D("pbbox").style.display="block";$D("mediamanagercover").style.display="block";if(!_public.initPB){_public.initPB=true;var seedurl="http://lifebox.net/0/photobuckcb.html";nurl=escape(seedurl);document.getElementById("jwidget").src="http://photobucket.com/svc/jwidget.php?width=320&height=650&largeThumb=true&pbaffsite=272&bg=%23FFFFFF&border=true&bordercolor=%23000000&url=http://&linkType=url&textcolor=%23000000&linkcolor=%230000FF&media=image&btntxt=Import&searchenabled=true&searchlinkcolor=&searchbgcolor=&url="+nurl}},getCurrentFolder:function(){var actv=$(".mediafolder_active");var fid=0;if(actv.length>0){fid=actv.get(0).id.after("_")}return fid},cancelPBBox:function(){$D("pbbox").style.display="none";$D("mediamanagercover").style.display="none"},showYouTubeUpload:function(){$D("youtubeuploadbox2").style.display="block";$D("mediamanagercover").style.display="block";$("#youtubeURL2").focus().val("")},cancelYouTube:function(){$D("youtubeuploadbox2").style.display="none";$D("mediamanagercover").style.display="none"},editEventContent:function(eid,tid,isParticipant){$("#eventtabs").show();$("#eventheader").css({height:"5px"});$("#eventheader").get(0).innerHTML="";if(isParticipant){$("#editEventTabEvent").hide()}else{$("#editEventTabEvent").show()}_private.isParticipant=isParticipant;_private.populateEditEventContent(eid,tid,_private.showEditEventPanel,"Content",false)},saveTLConfig:function(prompt,closeIt,cbFunc,cbParam){if($.param(_private.formData.nameDesc)==$("#formNameDesc").formSerialize()){if(cbFunc){cbParam.res="nochg";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}return }var yesFunc=function(){var name=$D("nameinput").value;var urlkey=$D("urlkeyinput").value;var tags=$D("tagsinput").value;var defaultZoom=$("input[@name='defaultzoom']:checked").val();var description=$D("descriptioninput").value;var tlid=timeline_id;if(!name||name.trim().length==0){var err=$D("nameanddescerror");err.style.display="block";err.innerHTML="Provide a name for your lifebox";return }if(!urlkey||urlkey.trim().length==0){var err=$D("nameanddescerror");err.style.display="block";err.innerHTML="Provide a URL for your lifebox";return }var params={name:name,urlkey:urlkey,timelineid:tlid,tags:tags,defaultzoom:defaultZoom,description:description};$.post("/cmd/EditTimeline/saveTL",params,function(data){var res=eval("("+data+")");if(res.success==1){$D("title_box").innerHTML=name.escapeHTML().wordWrap(25,"<wbr>",true);$D("oneline_box").innerHTML=description.escapeHTML();$D("url_box").value="http://lifebox.net/"+urlkey.escapeHTML();if(cbFunc){cbParam.res="saved";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}}else{if(res.success==0){var err=$D("nameanddescerror");err.style.display="block";err.innerHTML=res.error}}})};if(prompt){yesNoCancel($("#tlconfigpanel"),{yes:function(){yesFunc()},no:function(){if(cbFunc){cbParam.res="nosav";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}},cancel:function(){}})}else{yesFunc()}},saveEmbed:function(prompt,closeIt,cbFunc,cbParam){if($.param(_private.formData.embed)==$("#formEmbed").formSerialize()){if(cbFunc){cbParam.res="nochg";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}return }var yesFunc=function(){var embedcode=$("#embedcode").val();var params={tlid:timeline_id,embedcode:embedcode};$.post("/cmd/Edit/saveEmbed",params,function(data){var res=eval("("+data+")");if(res.rcode==1){if(cbFunc){cbParam.res="saved";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}}else{if(res.rcode==0){$("#embederror").show();$("#embederror").html(res.errors)}}})};if(prompt){yesNoCancel($("#tlconfigpanel"),{yes:function(){yesFunc()},no:function(){if(cbFunc){cbParam.res="nosav";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}},cancel:function(){}})}else{yesFunc()}},savePrivacy:function(prompt,closeIt,cbFunc,cbParam){if($.param(_private.formData.privacy)==$("#formPrivacy").formSerialize()){if(cbFunc){cbParam.res="nochg";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}return }var yesFunc=function(){var mainPrivacy=$("input[@name='mainprivacy']:checked").val();var cmtapproval=$("input[@name='cmtapproval']:checked").val();var searchable=$("input[@name='searchable']:checked").val();var tlid=timeline_id;var params={permission:mainPrivacy,fpermission:1,cmtapproval:cmtapproval,timelineid:tlid,searchable:searchable};$.post("/cmd/EditTimeline/savePrivacy",params,function(data){var res=eval("("+data+")");if(res.success==1){if(cbFunc){cbParam.res="saved";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}}else{if(res.success==0){alert("An error occurred: "+res.error)}}})};if(prompt){yesNoCancel($("#tlconfigpanel"),{no:function(){if(cbFunc){cbParam.res="nosav";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}},yes:function(){yesFunc()},cancel:function(){}})}else{yesFunc()}},setBGImg:function(bgimgid,bgimgstyle){if(bgimgid==0){$("#my-bg-layer")[0].style.background="";$("#my-bg-layer").empty()}else{$.post("/cmd/Edit/getBigImg",{tlid:timeline_id,mid:bgimgid},function(res){var data=tojs(res);if(data.rcode==1){$("#my-bg-layer").empty();if(bgimgstyle==0){$("#my-bg-layer").append('<img src="'+data.url+'" style="width:100%;height:100%"></img>')}else{if(bgimgstyle==1){$("#my-bg-layer")[0].style.backgroundImage="url('"+data.url+"')";$("#my-bg-layer")[0].style.backgroundRepeat="no-repeat";$("#my-bg-layer")[0].style.backgroundPosition="center center"}else{if(bgimgstyle==2){$("#my-bg-layer")[0].style.backgroundImage="url('"+data.url+"')";$("#my-bg-layer")[0].style.backgroundRepeat="repeat"}}}}})}},saveColors:function(prompt,closeIt,cbFunc,cbParam){if($.param(_private.formData.categories)==$("#formCategories").formSerialize()){if(cbFunc){cbParam.res="nochg";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}return }var yesFunc=function(){var bgColor=$D("color_background").value;tl.setBackgroundColor("#"+bgColor);var dateColor=blackOrWhite("#"+bgColor);theme.ether.interval.marker.color=dateColor;theme.event.label.outsideColor=dateColor;tl.setDateTextColor(dateColor);var borderColor=$D("color_timelineborder").value;$D("tl").style.borderColor="#"+borderColor;var borderWidth=$D("border_width").value;$D("tl").style.borderWidth=borderWidth+"px 0px";var pageTheme=$D("theme_chooser").value;setActiveStyleSheet(pageTheme);var editorHolder=$D("cateditortable");var colorNodes=editorHolder.childNodes;var colors="";var bgimgid=$D("bgImgId").value;var bgimgstyle=$("input[@name='bgstyle']:checked").val();_public.setBGImg(bgimgid,bgimgstyle);for(var i=0;i<colorNodes.length;i++){var node=colorNodes[i].childNodes;var catid=node[1].firstChild.id.after("_");var clr=node[1].firstChild.value;if(i>0){colors+="|"}colors+=catid+","+clr;if(theme.event.taggedColors[timeline_id][catid]){theme.event.taggedColors[timeline_id][catid].color="#"+clr}}tl.repaint();$.post("/cmd/Event/saveCats",{tid:timeline_id,colors:colors,bgcolor:bgColor,bordercolor:borderColor,borderwidth:borderWidth,theme:pageTheme,bgimgid:bgimgid,bgimgstyle:bgimgstyle},function(data){var res=eval("("+data+")");if(res.success==1){if(cbFunc){cbParam.res="saved";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}}})};if(prompt){yesNoCancel($("#tlconfigpanel"),{yes:function(){yesFunc()},no:function(){if(cbFunc){cbParam.res="nosav";cbFunc(cbParam)}if(closeIt){hideCenterDiv("tlconfigbox")}},cancel:function(){}})}else{yesFunc()}},showAddEvent:function(isediting){_public.hideNoEventTip();$("#addeventerror")[0].style.display="none";showOverlay();$("#eventEditMainPanel").show();_private.showEditEventPanel("Event");if(!isediting){$("#eventtabs").hide();$("#eventheader").css({height:""});$("#eventheader").get(0).innerHTML="Add an Event";delete _private.formData.eventHeader}else{$("#eventtabs").show();$("#eventheader").css({height:"5px"});$("#eventheader").get(0).innerHTML=""}if(!isediting){delete _private.editMainEvt;delete _private.editingSEID;$D("title").value="";$D("category").value="";$D("instant").checked=true;$("#useTimeCheckbox")[0].checked=false;var tmpDate=new Date();tmpDate.setUTCHours(0,0);timeChooserSetEnabled(".timeentry",false);timeChooserSetTime("#starttime",tmpDate);timeChooserSetTime("#endtime",tmpDate);_private.editingEID=-1;_public.typeChanged()}},tlConfigPanel:"",showCategories:function(){showCenterDiv("tlconfigbox");_public.tlConfigPanel="c";_private.initPanel("c")},addPicture:function(insertid,thumburl){try{var peid="photo_"+insertid;var n=Builder.node("div",{"class":"groupItem",style:"text-align:center;cursor:move",id:peid},[delButton=Builder.node("div",{style:"margin-right:2px;font-size:11px;float:right"},[Builder.node("span",{},"["),Builder.node("a",{href:"#",onclick:"HomeJS.delClicked("+insertid+");return false;"},"X"),Builder.node("span",{},"]"),]),Builder.node("div",{style:"clear:both;margin:0px auto 5px auto;text-align:center"},[Builder.node("img",{id:insertid,src:thumburl,style:"height:50px;width:auto"})])]);$("#pictureholder").append(n);$(".groupWrapper").sortable("refresh")}catch(e){}},cancelCategories:function(){$("#formCategories").deserialize(_private.formData.categories);if(_private.formData.categoriesExtra.bgimgid==0){$("#bgPanNotSet").show();$("#bgPanSet").hide()}else{$("#bgPanNotSet").hide();$("#bgPanSet").show()}$("#bgImgPreview")[0].src=_private.formData.categoriesExtra.bgimgthumb;delete _private.formData.categoriesExtra;delete _private.formData.categories;$("#formCategories input[name*='clrBox']").each(function(){this.style.backgroundColor="#"+this.value;this.style.color="#"+ColorUtils.contrast(this.value)});hideCenterDiv("tlconfigbox")},hideColorChooser:function(){$D("colorPickerContainer").style.visibility="hidden"},showEmbed:function(){$("#embederror").hide();showCenterDiv("tlconfigbox");_public.tlConfigPanel="e";_private.initPanel("e")},showPrivacy:function(){showCenterDiv("tlconfigbox");_public.tlConfigPanel="p";_private.initPanel("p")},hideMedia:function(){$("#mediamanager").hide()},isMediaInit:false,showMedia:function(canSelectVid,cb){_private.mediaCanSelectVid=canSelectVid;_private.mediaCallback=cb;$("#mediamanager").show();if(!_public.isMediaInit){_public.addFolder(0,"Default");$.post("/cmd/Edit/getFolders",{tlid:timeline_id},function(data){var res=eval("("+data+")");if(res.success=="1"){for(var i=0;i<res.folders.length;i++){var folder=res.folders[i];_public.addFolder(folder.id,folder.name)}_public.initDroppable(".mediafolder_inactive");_public.isMediaInit=true}})}},initDroppable:function(id){$(id).droppable({accept:".imgthumb",activeClass:"folderactive",hoverClass:"folderhover",drop:function(ev,ui){if(this.className=="mediafolder_active"){return }var drag=ui.draggable[0];var imgid=drag.id.after("_");var fid=this.id.after("_");$.post("/cmd/Edit/moveMedia",{tlid:timeline_id,mid:imgid,fid:fid},function(data){var res=eval("("+data+")");if(res.success=="1"){jQuery(drag).remove();_public.checkFolderIsEmpty()}})}})},showCreateFolder:function(){$D("createfolderbox").style.display="block";$D("mediamanagercover").style.display="block";$("#folderField").focus().val("")},showRenameFolder:function(){$D("renamefolderbox").style.display="block";$D("mediamanagercover").style.display="block";$("#renameFolderField").focus().val($(".mediafolder_active").html().unescapeHTML())},delFolder:function(id){$.post("/cmd/Edit/delFolder",{tlid:timeline_id,id:id},function(data){var res=eval("("+data+")");if(res.rcode==1){$("#folder_"+id).remove();$("#mediapanel").empty()}})},checkFolderIsEmpty:function(){var actv=$(".mediafolder_active");var fid=0;if(actv.length>0){fid=actv.get(0).id.after("_")}if(fid!="0"&&!$("#mediapanel")[0].hasChildNodes()){$("#mediapanel").append('<div id="folderisempty" style="padding:10px"><p>Folder is empty</p><div><input type="button" value="Delete" onclick="HomeJS.delFolder('+fid+')"/></div></div>')}},clickFolder:function(id){$.post("/cmd/Edit/getMedia",{tlid:timeline_id,id:id},function(data){var res=eval("("+data+")");if(res.success=="1"){$("#mediapanel").empty();$(".mediafolder_active").attr("class","mediafolder_inactive");$("#folder_"+id).attr("class","mediafolder_active");if(id=="0"){$("#renameButton")[0].disabled=true}else{$("#renameButton")[0].disabled=false}if(res.media.length==0){_public.checkFolderIsEmpty()}else{for(var i=0;i<res.media.length;i++){var media=res.media[i];_public.addMedia(media)}_public.initMediaThumb(".imgthumb")}}})},initMediaThumb:function(id){$(id).draggable({handle:".movmenu",opacity:0.8,revert:false,zIndex:100000001,appendTo:"body",helper:"clone"})},addMedia:function(media){if(media.type==1){$("#mediapanel").append('<div class="imgthumb" id="img_'+media.id+'"><div><div class="mediadropdown" id="downdown_'+media.id+'"></div><div class="movmenu"></div></div><div class="thumbinner" style="text-align:center;clear:both"><img class="realimgthumb" src="'+media.thumburl+'"></img></div></div>')}else{$("#mediapanel").append('<div class="imgthumb" id="img_'+media.id+'"><div><div class="mediadropdown" id="downdown_'+media.id+'"></div><div class="imgmenu"></div></div><div class="thumbinner" style="text-align:center;clear:both"><img src="'+media.thumburl+'" class="realimgthumb"></img></div></div>')}_public.initMediaThumb("#img_"+media.id);$("#folderisempty").remove()},cancelCreateFolder:function(){$D("createfolderbox").style.display="none";$D("mediamanagercover").style.display="none"},cancelRenameFolder:function(){$D("renamefolderbox").style.display="none";$D("mediamanagercover").style.display="none"},addFolder:function(id,name){$("#folderholder").append("<div onClick=\"HomeJS.clickFolder('"+id+'\')" class="mediafolder_inactive" id="folder_'+id+'">'+name+"</div>");_public.initDroppable("#folder_"+id)},renameFolder:function(){var mainid=$(".mediafolder_active")[0].id;var id=mainid.after("_");var name=$("#renameFolderField").val();$.post("/cmd/Edit/renameFolder",{name:name,id:id,tlid:timeline_id},function(data){var res=eval("("+data+")");if(res.rcode==1){$("#"+mainid).html(res.name);_public.cancelRenameFolder()}})},submitFolder:function(){var name=$("#folderField").val();$.post("/cmd/Edit/createFolder",{name:name,tlid:timeline_id},function(data){var res=eval("("+data+")");if(res.rcode==1){_public.addFolder(res.id,res.name);_public.cancelCreateFolder()}})},cancelEmbed:function(){$("#formEmbed").deserialize(_private.formData.embed);delete _private.formData.embed;hideCenterDiv("tlconfigbox")},cancelPrivacy:function(){$("#formPrivacy").deserialize(_private.formData.privacy);delete _private.formData.privacy;hideCenterDiv("tlconfigbox")},submitForReview:function(){var answer=confirm("Are you sure you want to submit this lifebox for review?");if(answer){$.post("/cmd/Edit/submitForReview",{tlid:timeline_id},function(data){if(data.rcode==1){$("#submitforrev").hide();alert("Lifebox added to review queue")}else{alert("Error: "+data.msg)}},"json")}},showNameAndDescInput:function(){showCenterDiv("tlconfigbox");_public.tlConfigPanel="t";_private.initPanel("t")},cancelNameAndDescInput:function(reset){$("#formNameDesc").deserialize(_private.formData.nameDesc);delete _private.formData.nameDesc;hideCenterDiv("tlconfigbox")},showPan:function(param){var tar=param.tar;var res=param.res;$("#tlConfigMainForm").hide();$("#tlConfigColorsForm").hide();$("#tlConfigPrivacyForm").hide();$("#tlConfigEmbedForm").hide();if(_public.tlConfigPanel=="t"){$("#tab-lifebox").get(0).className="buttontab";if(res=="nosav"){$("#formNameDesc").deserialize(_private.formData.nameDesc);delete _private.formData.nameDesc}}else{if(_public.tlConfigPanel=="c"){$("#tab-colors").get(0).className="buttontab";if(res=="nosav"){$("#formCategories").deserialize(_private.formData.categories);if(_private.formData.categoriesExtra.bgimgid==0){$("#bgPanNotSet").show();$("#bgPanSet").hide()}else{$("#bgPanNotSet").hide();$("#bgPanSet").show()}$("#bgImgPreview")[0].src=_private.formData.categoriesExtra.bgimgthumb;delete _private.formData.categoriesExtra;delete _private.formData.categories;$("#formCategories input[name*='clrBox']").each(function(){this.style.backgroundColor="#"+this.value;this.style.color="#"+ColorUtils.contrast(this.value)})}}else{if(_public.tlConfigPanel=="p"){$("#tab-privacy").get(0).className="buttontab";if(res=="nosav"){$("#formPrivacy").deserialize(_private.formData.privacy);delete _private.formData.privacy}}else{if(_public.tlConfigPanel=="e"){$("#tab-embed").get(0).className="buttontab";if(res=="nosav"){$("#formEmbed").deserialize(_private.formData.embed);delete _private.formData.embed}}}}}if(tar=="t"){$("#tab-lifebox").get(0).className="buttontabactive";$("#tlConfigMainForm").show();_private.formData.nameDesc=$("#formNameDesc").formToArray()}else{if(tar=="c"){$("#tab-colors").get(0).className="buttontabactive";$("#tlConfigColorsForm").show();_private.formData.categories=$("#formCategories").formToArray();_private.formData.categoriesExtra=new Object();_private.formData.categoriesExtra.bgimgthumb=$("#bgImgPreview")[0].src;_private.formData.categoriesExtra.bgimgid=$("#bgImgId").val()}else{if(tar=="p"){$("#tab-privacy").get(0).className="buttontabactive";$("#tlConfigPrivacyForm").show();_private.formData.privacy=$("#formPrivacy").formToArray()}else{if(tar=="e"){$("#embederror").hide();$("#tab-embed").get(0).className="buttontabactive";$("#tlConfigEmbedForm").show();_private.formData.embed=$("#formEmbed").formToArray()}}}}_public.tlConfigPanel=tar},chgPan:function(tar){if(_public.tlConfigPanel==tar){return }var cbParam=new Object();cbParam.tar=tar;if(_public.tlConfigPanel=="t"){_public.saveTLConfig(true,false,_public.showPan,cbParam)}else{if(_public.tlConfigPanel=="c"){_public.saveColors(true,false,_public.showPan,cbParam)}else{if(_public.tlConfigPanel=="p"){_public.savePrivacy(true,false,_public.showPan,cbParam)}else{if(_public.tlConfigPanel=="e"){_public.saveEmbed(true,false,_public.showPan,cbParam)}}}}},saveEventShare:function(prompt,closeIt,cbFunc,cbParam){var str="";var count=0;var tmpArray=new Array();for(var i=0;i<_private.currentShares.length;i++){count++;var share=_private.currentShares[i];if(i>0){str+="|"}str+=share.personid+"-"+share.permission;tmpArray.push(share.personid+"-"+share.permission)}if(tmpArray.length>0){tmpArray.sort()}if(tmpArray.compareArrays(_private.formData.shared)){if(cbFunc){cbParam.res="nochg";cbFunc(cbParam)}if(closeIt){_public.closeEvtConfig()}return }var yesFunc=function(){var params={tlid:timeline_id,count:count,shares:str,eventid:_private.editingEID};$.post("/cmd/EditTimeline/shareEvent",params,function(data){var res=eval("("+data+")");if(res.success==1){if(cbFunc){cbParam.res="saved";cbFunc(cbParam)}if(closeIt){_public.closeEvtConfig()}}else{if(res.success==0){alert("An error occurred: "+res.error)}}})};if(prompt){yesNoCancel($("#editEventPanel"),{yes:function(){yesFunc()},no:function(){if(cbFunc){cbParam.res="nosav";cbFunc(cbParam)}if(closeIt){_public.closeEvtConfig()}},cancel:function(){}})}else{yesFunc()}},cancelUpload2Form:function(){$D("imageuploadbox2").style.display="none";$D("mediamanagercover").style.display="none"},cancelUploadForm:function(){$D("uploadbox").style.display="none";$D("imageuploadbox").style.display="none";$D("contenteditcover").style.display="none"},showUpload:function(){$D("imageuploadbox").style.display="block";$D("contenteditcover").style.display="block"},showUpload2:function(fid){var fid=0;var actv=$(".mediafolder_active");if(actv.length>0){fid=actv.get(0).id.after("_")}$D("imageuploadbox2").style.display="block";$D("mediamanagercover").style.display="block";$D("uploadframe2").src="/cmd/Upload2?folder="+fid+"&tlid="+timeline_id},getChildIds:function(par){var ids=new Array();var children=par.childNodes;for(var i=0;i<children.length;i++){if(children[i].tagName=="DIV"){ids.push(children[i].id)}}return ids},getPeopleIds:function(){var par=$D("peopleholder");return getChildIds(par)},hasContact:function(id){return getChildWithId($D("peopleholder"),id)!=null},getContact:function(id){return getChildWithId($D("peopleholder"),id)},getShare:function(id){for(var i=0;i<_private.currentShares.length;i++){var share=_private.currentShares[i];if(share.personid==id){return share}}return null},getShareIndex:function(id){for(var i=0;i<_private.currentShares.length;i++){var share=_private.currentShares[i];if(share.personid==id){return i}}return null},removeRelated:function(tlid){$.post("/cmd/Edit/removeRelated",{tlid:tlid},function(data){var json=tojs(data);if(json.rcode==1){$("#related"+tlid).remove()}else{}});return false},submitRelated:function(){var lifebox=$("#relatedlifebox").val();var relation=$("#relatedrelation").val();if(relation&&lifebox){$.post("/cmd/Edit/submitRelated",{tlid:timeline_id,lifebox:lifebox,relation:relation},function(data){var json=tojs(data);if(json.rcode==1){gMsg("Related Lifebox Added");$("#relatedlifebox").val("");$("#relatedrelation").val("");var section=Builder.node("div",{id:"related"+json.tlid,"class":"relatedbox"},[Builder.node("div",{style:"text-align:center;padding: 5px; width: 110px; float: left"},[Builder.node("a",{href:"/"+lifebox},[Builder.node("img",{src:json.thumburl})]),Builder.node("a",{href:"/"+lifebox},[Builder.node("span",{},json.name)])]),Builder.node("div",{style:"padding: 5px 5px 5px 0px; float: left; width: 300px"},[Builder.node("span",{},relation)]),Builder.node("div",{style:"clear: both;text-align:right"},[Builder.node("a",{href:"#",onclick:"return HomeJS.removeRelated('"+json.tlid+"')"},"Remove")])]);$("#relatedholder").append(section)}else{gMsg("Unable to Add Related Lifebox")}})}},okShare:function(){var share=_public.getShare(editingShare);if($D("sharemenuro").firstChild.checked){share.permission=1}else{share.permission=0}var menu=$D("sharemenu");menu.style.visibility="hidden";$D("sharecover").style.visibility="hidden"},removeShare:function(){var answer=confirm("Are you sure you want to remove this share?");if(answer){var ui=_public.getContact(editingShare);ui.parentNode.removeChild(ui);var idx=_public.getShareIndex(editingShare);_private.currentShares.splice(idx,1);var menu=$D("sharemenu");menu.style.visibility="hidden";$D("sharecover").style.visibility="hidden"}},saveEvent:function(prompt,closeIt,cbFunc,cbParam,isSubEvt){var startdate="";var enddate="";var type="";var rawEndDate="";sDate=$("#inlineFrom").datepicker("getDate");var isUsingTime=false;if(($("#useTimeCheckbox")[0]).checked){var startTimeDate=timeChooserGetTime("#starttime");isUsingTime=true;sDate.setUTCHours(startTimeDate.getUTCHours(),startTimeDate.getUTCMinutes(),0,0)}else{sDate.setUTCHours(0,0,0,0)}if($D("instant").checked){type="i"}else{if($D("duration").checked){rawEndDate=$("#inlineTo").datepicker("getDate");if(isUsingTime){var endTimeDate=timeChooserGetTime("#endtime");rawEndDate.setUTCHours(endTimeDate.getUTCHours(),endTimeDate.getUTCMinutes(),0,0)}else{rawEndDate.setUTCHours(0,0,0,0)}enddate=_private.createDateString(rawEndDate);type="d";if(sDate>=rawEndDate){var err=$D("addeventerror");err.style.display="block";err.innerHTML="Start date must be before end date";return }}else{if($D("ongoing").checked){type="o";rawEndDate=new Date();rawEndDate.setUTCHours(rawEndDate.getHours(),rawEndDate.getMinutes(),0,0);if(sDate>=rawEndDate){var err=$D("addeventerror");err.style.display="block";err.innerHTML="Start date must be before now";return }}}}startdate=_private.createDateString(sDate);var title=$D("title").value;var category=$D("category").value;var data=new Array(_private.editingEID,(isUsingTime?1:0),type,title,category,sDate.toLocaleString(),(type=="d"?rawEndDate.toLocaleString():""));if(_private.formData.eventHeader&&data.compareArrays(_private.formData.eventHeader)){if(cbFunc){cbParam.res="nochg";cbFunc(cbParam)}if(closeIt){_public.closeEvtConfig()}return }var saveAction=function(){if(!title||title.trim().length==0){var err=$D("addeventerror");err.style.display="block";err.innerHTML="Title is a required field";return }var use_time=(isUsingTime?1:0);var postUrl=isSubEvt?"/cmd/Event/addSub":"/cmd/Event/add";var seid=isSubEvt?_private.editingSEID:-1;var tlid=timeline_id;$.post(postUrl,{subeventid:seid,timelineid:tlid,title:title,use_time:use_time,startdate:startdate,type:type,category:category,enddate:enddate,eventid:_private.editMainEvt},function(data){var res=eval("("+data+")");if(res.success==1){($("#addeventerror")[0]).style.display="none";if(cbFunc){cbParam.res="saved";cbFunc(cbParam)}if(isSubEvt){if(seid!=-1){for(var i=0;i<_public.subevents.length;i++){if(_public.subevents[i].id==seid){_public.subevents[i]=res.event;break}}}else{_public.subevents.push(res.event)}createMiniTimeline(505,null,null,null,null,_public.subevents,$("#subeholder"));$("#"+_private.selectedSubCont).addClass("subicosel")}if(!isSubEvt){_public.tlAddEvent(res.result);if(closeIt&&_private.editingEID>0){_public.closeEvtConfig()}if(_private.editingEID>0){}else{$("#eventtabs").show();$("#eventheader").css({height:"5px"});$("#eventheader").get(0).innerHTML="";_private.populateEditEventContent(res.result.id,res.result.timeline_id,_private.showEditEventPanel,"Content",false)}}}})};if(prompt){yesNoCancel($("#editEventPanel"),{yes:function(){saveAction()},no:function(){if(cbFunc){cbParam.res="nosav";cbFunc(cbParam)}if(closeIt){_public.closeEvtConfig()}},cancel:function(){}})}else{saveAction()}},cancelCaption:function(){$D("captionmenu").style.display="none";$D("mediamanagercover").style.display="none"},okCaption:function(){var mid=_private.editingCaptionMID;var val=$("#captiontext").val();$.post("/cmd/Edit/saveCaption",{tlid:timeline_id,mid:mid,caption:val},function(data){var json=tojs(data);if(json.rcode==1){gMsg("Caption Saved");_public.cancelCaption()}else{gMsg("Unable to Save Caption")}})},stopEvent:function(e){if(!e){e=window.event}if(e.stopPropagation){e.stopPropagation()}else{e.cancelBubble=true}},avatarChosen:function(media){var mid=media.id;$.post("/cmd/Edit/setAvatar",{tlid:timeline_id,mid:mid},function(res){var data=tojs(res);if(data.rcode==1){$D("avatarimage").src=data.media.thumburl;$("#avatarholder").empty();$D("avatarholder").appendChild(Builder.node("img",{src:data.media.thumburl}))}})},clearBGImg:function(){$("#bgImgId").val(0);$("#bgPanNotSet").show();$("#bgPanSet").hide();$("input[@name='bgstyle']:nth(0)").attr("checked","checked")},bgImgChosen:function(media){var mid=media.id;$("#bgPanNotSet").hide();$("#bgPanSet").show();$("#bgImgPreview")[0].src=media.thumburl;$("#bgImgId").val(mid)},changeAvatar:function(){_public.showMediaImg(_public.avatarChosen)},evtMediaChosen:function(media){$.post("/cmd/Edit/addEvtMedia",{tlid:timeline_id,eid:_private.editingEID,mid:media.id,p:_private.isParticipant},function(res){var data=tojs(res);if(data.rcode==1){_public.addPicture(media.id,media.thumburl)}})},showAddEventMedia:function(){_public.showMediaAll(_public.evtMediaChosen)},changeBGImg:function(){_public.showMediaImg(_public.bgImgChosen)},clearAvatar:function(){$.getJSON("/cmd/Edit/clearAvatar?tlid="+timeline_id,function(data){if(data.rcode==1){$D("avatarimage").src=data.imgurl;$("#avatarholder").empty();$D("avatarholder").appendChild(Builder.node("img",{src:data.imgurl}))}})},getConfirmation:function(text,callback){$.prompt(text,{callback:callback,buttons:{Delete:1,Cancel:2},prefix:"colsJqi",show:"slideDown"})},categories:new Array(),initialize:function(){_public.categories.push("Life");_public.categories.push("Love");_public.categories.push("School");_public.categories.push("Vacation");_public.categories.push("Work");if(!nil(categories)){for(var i=0;i<categories.length;i++){if(!_public.categories.contains(categories[i].category)){_public.categories.push(categories[i].category)}}}var eventSource=new Timeline.DefaultEventSource();theme=Timeline.ClassicTheme.create();theme.event.label.width=250;theme.event.bubble.width=250;theme.event.bubble.height=200;var date="Sat Oct 11 1980 13:00:00 GMT-0600";var bandInfos=[Timeline.createBandInfo({width:"100%",intervalUnit:Timeline.DateTime.YEAR,intervalPixels:40,eventSource:eventSource,date:date,timeZone:0,showEventText:true,trackHeight:1.5,trackGap:0.2,theme:theme,maxDetail:1})];theme.ether.interval.marker.color="#"+timeline.dateColor;var bgColor="3B4D92";if(timeline.bgColor){bgColor=timeline.bgColor}theme.ether.background="#"+bgColor;var dateColor=blackOrWhite("#"+bgColor);theme.ether.interval.marker.color=dateColor;theme.event.label.outsideColor=dateColor;if(events.events.length==0){_public.showNoEventTip()}for(var i=0;i<bandInfos.length;i++){bandInfos[i].decorators=[]}_public.loadCategoriesJSON(categories);tl=Timeline.create(document.getElementById("tl"),bandInfos,Timeline.HORIZONTAL,Timeline.EDIT_MODE);eventSource.loadJSON(events,"");tl.getBand(0).setCenterVisibleDate(new Date());$("#tl").prepend('<div id="my-bg-layer" style="width:100%;height:100%;position:absolute"></div>');tl.setDateTextColor(dateColor);tl.setBackgroundColor("#"+bgColor);tl.setToStart();$D("tl").style.borderColor="#"+timeline.borderColor;$D("tl").style.borderWidth=timeline.borderWidth+"px 0px";if(timeline.theme){setActiveStyleSheet(timeline.theme)}doOnce("initPriv",function(){$("input[@name='mainprivacy']:nth("+mainpermission+")").attr("checked",true);$("input[@name='cmtapproval']:nth("+cmtapproval+")").attr("checked",true);$("input[@name='searchable']:nth("+searchable+")").attr("checked",true)});$D("tagsinput").value=timeline.tags;$D("embedcode").value=timeline.embedcode;$D("descriptioninput").value=timeline.description.unescapeHTML();$D("avatarimage").src=timeline.thumburl;$("input[@name='defaultzoom']:nth("+(defaultzoom+1)+")").attr("checked","checked");$D("color_background").value=bgColor;$D("color_timelineborder").value=timeline.borderColor;$D("border_width").value=timeline.borderWidth;$D("theme_chooser").value=timeline.theme;timeChooserEnable("#starttime");timeChooserEnable("#endtime");var tmpDate=new Date();tmpDate.setUTCHours(0,0,0,0);timeChooserSetTime("#starttime",tmpDate);timeChooserSetTime("#endtime",tmpDate);timeChooserSetEnabled(".timeentry",false);$("#useTimeCheckbox").click(function(evt){if(this.checked){timeChooserSetEnabled(".timeentry",true)}else{timeChooserSetEnabled(".timeentry",false)}});var imgid=timeline.bgimgid;var imgstyle=timeline.bgimgstyle;if(imgid==0){$("#bgPanSet").hide();$("#bgPanNotSet").show()}else{$("#bgPanSet").show();$("#bgPanNotSet").hide();($("#bgImgPreview")[0]).src=timeline.bgimg.thumburl;setTLBGImg(timeline.bgimg.largeurl,imgstyle)}$("#bgImgId").val(imgid);$("input[@name='bgstyle']:nth("+imgstyle+")").attr("checked",true);_private.initForColorPicker("color_background");_private.initForColorPicker("color_timelineborder");createMiniTLListener(associateObjWithEvent2(this,"subEvtClicked"),$("#subeholder"));_public.initialize2()},subEvtLoaded:function(){$(".subicosel").removeClass("subicosel");$(".sublabelsel").removeClass("sublabelsel");$("#addSubBtn").hide();$("#subectrls").show();_private.selectedSubCont=_private.lastTrgt[0].id;$(_private.lastTrgt[0]).addClass("subicosel");$(_private.lastTrgt[1]).addClass("sublabelsel")},doSubEvtClicked:function(cbParam){_private.lastTrgt=cbParam.trgt;_private.populateEditEventContent(cbParam.id,timeline_id,_public.subEvtLoaded,"Content",true)},subEvtClicked:function(id,trgt){var cbParam=new Object();cbParam.id=id;cbParam.trgt=trgt;_public.saveEventContent(true,false,_public.doSubEvtClicked,cbParam)},disableTimes:function(){},showMediaAll:function(callback){$(".imgthumbsel").removeClass("imgthumbsel");$("#mediaokbutton").show();$("#mediacancelbutton").val("Cancel");_public.showMedia(true,callback)},showMediaImg:function(callback){$(".imgthumbsel").removeClass("imgthumbsel");$("#mediaokbutton").show();$("#mediacancelbutton").val("Cancel");_public.showMedia(false,callback)},mediaSelect:function(){var mid=$(".imgthumbsel")[0].id.after("_");var obj=new Object();obj.id=mid;obj.thumburl=$(".imgthumbsel").children().get(1).firstChild.src;_private.mediaCallback(obj);_public.hideMedia()},showMediaNone:function(){$("#mediaokbutton").hide();$("#mediacancelbutton").val("Done");_public.showMedia(true,null)},invite:function(){if($("#inviteframe").length>0){return }jQuery(document.body).append('<iframe id="inviteframe" style="top:20px;left:20px;position:absolute;background-color:#fff;border:1px solid #000" frameborder="no" width="740" height="640" src="/cmd/Invite"></iframe>')},initialize2:function(){$("#mediapanel").click(function(e){var tar=$(e.target);if(tar.is(".thumbinner")){tar=tar.parent()}else{if(tar.is(".realimgthumb")){tar=tar.parent().parent()}}if(tar.is(".imgthumb")){var par=tar;if(!par.is(".imgthumbsel")){if(_private.mediaCanSelectVid==false&&jQuery(par.children()[0]).is(".movmenu")){return }$(".imgthumbsel").removeClass("imgthumbsel");par.addClass("imgthumbsel")}}});$("#mediapanel").contextMenuDelegation("mediaMenu","mediadropdown",{bindings:{remove:function(t){var mid=t.id.after("_");var answer=confirm("Are you sure you want to remove this item?");if(answer){$.post("/cmd/Edit/deleteMedia",{tlid:timeline_id,mid:mid},function(data){var res=eval("("+data+")");if(res.rcode==1){var tid="#img_"+res.mid;gMsg('<strong>Success:</strong> <span class="indent">Media Removed</span>');$(tid).remove();$(tid).draggable("destroy");_public.checkFolderIsEmpty()}})}},caption:function(t){var mid=t.id.after("_");var pos=$(t).position();_private.showCaptionEdit(mid,pos.left,pos.top)}}});$("#captiontext").keypress(function(e){if(e.which==13){_public.okCaption()}});jQuery("input#input_box").result(function(event,d,formatted){var data=d[0];$D("input_box").value="";var id=afterLast(data,"|");if(_public.hasContact(id)){return }var share=new Object();share.name=formatted;share.personid=id;share.eventid=_private.editingEID;share.permission=1;share.state=0;_private.currentShares.push(share);var node=_private.createShareNode(share);$D("peopleholder").appendChild(node);$D("input_box").focus()});$("#category").autocomplete(_public.categories,{max:100,scroll:false,minChars:0});$("#input_box").autocomplete(friends,{scroll:false,max:100,minChars:0,formatItem:function(r,pos,list){var row=r[0];var idx=row.lastIndexOf("|");var str=row.substring(0,idx);return str}})}};return _public}();function initCorners(){$("#tlinfoholder").corner({antiAlias:false});$("#dashboardholder").corner({antiAlias:false});$("#friendbox").corner({antiAlias:false});$("#commentbox").corner({antiAlias:false})}function initOthers(){$(".groupWrapper").sortable({opacity:50,axis:"y"});$(".calendarInline").datepicker({mandatory:true,yearRange:"1800:2090"})}function addPicture(B,C,A,D){HomeJS.addPicture(B,C,A,D)}function imageUploaded(A){HomeJS.addMedia(A)}function cancelUpload2Form(){HomeJS.cancelUpload2Form()}function uploadSuccessful2(){HomeJS.cancelUpload2Form();gMsg('<strong>Success:</strong> <span class="indent">Image uploaded successfully</span>')}function cancelUploadForm(){HomeJS.cancelUploadForm()}function uploadSuccessful(){HomeJS.cancelUploadForm();gMsg('<strong>Success:</strong> <span class="indent">Image uploaded successfully</span>')}currentlyEditing=null;function rgbChanged(A){if(currentlyEditing){currentlyEditing.style.backgroundColor="#"+A;currentlyEditing.style.color="#"+ColorUtils.contrast(A);currentlyEditing.value=A}}disableSlideActions=false;disableSetGradient=false;onColorSlideFunc=function(D,C){if(!disableSlideActions){var B=Math.round(100*(C.position.left/181));var A=Math.round(100*(C.position.top/181));lastValues=[parseInt(B*255/100),parseInt(A*255/100)];if(!disableSetGradient){setGradientColor()}}};onHueSlideFunc=function(B,A){if(!disableSlideActions){setVertColor(parseInt(A.value*255/100));if(!disableSetGradient){setGradientColor()}}};var baseColor={r:255,g:0,b:0};var currentColor={r:255,g:255,b:255};var lastValues=[0,0];$(document).ready(function(){$("#color").mousedown(function(B){if(typeof B.layerX=="undefined"){B.layerX=B.offsetX}if(typeof B.layerY=="undefined"){B.layerY=B.offsetY}var A=B.layerX-6;var C=B.layerY-6;if(A<0){A=0}if(C<0){C=0}if(A>181){A=181}if(C>181){C=181}$("#colorIndic").css("left",A);$("#colorIndic").css("top",C);onColorSlideFunc(null,{position:{left:A,top:C}})});$("#colorIndic").draggable({containment:"parent",drag:onColorSlideFunc});$("#hue").slider({handle:"#hueIndic",slide:onHueSlideFunc,change:function(B,A){document.getElementById("oldColor").style.backgroundColor="rgb("+currentColor.r+","+currentColor.g+","+currentColor.b+")";onHueSlideFunc(B,A)}})});$("#hex").change(function(B){var A=document.getElementById("hex");A.value=filterHexColor(A.value);setHexColor(A.value)});String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};function filterHexColor(E){if(E==null||E==undefined){return currentColor.hex}E=E.trim();E=E.toUpperCase();if(E==""){return currentColor.hex}var A="";var C=0;var D=E.length;if(D>6){D=6}else{if(D<6){C=6-D}}for(var B=0;B<D;B++){if(HCHARS.indexOf(E.charAt(B))==-1){return currentColor.hex}else{A+=E.charAt(B)}}for(var B=0;B<C;B++){A+="0"}return A}function setHexColor(B){var A=hex2rgb(B);setRGBColor(A);document.getElementById("colorCurrent").style.backgroundColor="#"+B;document.getElementById("oldColor").style.backgroundColor="#"+B;document.getElementById("hex").value=B.toUpperCase()}function setRGBColor(B){var A=rgb2hsv(B[0],B[1],B[2]);var C=Math.ceil(179-(179*A[0]/360));var D=(C/179)*100;disableSlideActions=true;hs=A[1],hv=A[2];hs=Math.round(hs*181);hv=Math.round(181-(hv*181));$("#colorIndic").css("left",hs);$("#colorIndic").css("top",hv);disableSlideActions=false;disableSetGradient=true;$("#hue").slider("moveTo",D);onHueSlideFunc(null,{value:D});disableSetGradient=false}function setHueSliderPosition(A){}function setVertColor(F){var E=256/6,A=256/E,B=F,D=B%E;baseColor={r:parseInt(B<E?255:B<E*2?255-D*A:B<E*4?0:B<E*5?D*A:255),g:parseInt(B<E*2?0:B<E*3?D*A:B<E*5?255:255-D*A),b:parseInt(B<E?D*A:B<E*3?255:B<E*4?255-D*A:0)};document.getElementById("color").style.backgroundColor="rgb("+baseColor.r+","+baseColor.g+","+baseColor.b+")"}function hex2rgb(A){var B=hex2dec;return[B(A.substr(0,2)),B(A.substr(2,2)),B(A.substr(4,2))]}var HCHARS="0123456789ABCDEF";function rgb2hsv(A,E,F){A=A/255;E=E/255;F=F/255;var B,G,I,D,J,H;B=Math.min(Math.min(A,E),F);G=Math.max(Math.max(A,E),F);I=G-B;switch(G){case B:D=0;break;case A:D=60*(E-F)/I;if(E<F){D+=360}break;case E:D=(60*(F-A)/I)+120;break;case F:D=(60*(A-E)/I)+240;break}J=(G===0)?0:1-(B/G);var C=[Math.round(D),J,G];return C}function hex2dec(C){var B=function(D){return HCHARS.indexOf(D.toUpperCase())};var A=C.split("");return((B(A[0])*16)+B(A[1]))}function setGradientColor(){var C=Math.round((1-(1-(baseColor.r/255))*(lastValues[0]/255))*(255-lastValues[1]));var B=Math.round((1-(1-(baseColor.g/255))*(lastValues[0]/255))*(255-lastValues[1]));var A=Math.round((1-(1-(baseColor.b/255))*(lastValues[0]/255))*(255-lastValues[1]));document.getElementById("colorCurrent").style.backgroundColor="rgb("+C+","+B+","+A+")";var D=(toHex(C)+toHex(B)+toHex(A)).toUpperCase();document.getElementById("hex").value=D;rgbChanged(D);currentColor={r:C,g:B,b:A,hex:D}}function toHex(A){A=parseInt(A).toString(16);return A.length<2?"0"+A:A}function getTimelineIDIndex(A){for(var B=0;B<g_timelines.length;B++){if(g_timelines[B].id==A){return B}}return -1}function editEventContent(A,C,B){HomeJS.editEventContent(A,C,B)}function tojs(data){return eval("("+data+")")}function nil(A){return(typeof (A)=="undefined")||(A==null)}function isEmpty(A){return A==undefined||A==""}function isdefined(A){return(typeof (window[A])=="undefined")?false:true}function trunc(B,A){if(B.length>A){B=B.substring(0,A-3)+"..."}return B}function ensureInt(B){var A=(B.which!=null)?B.which:event.keyCode;return(A<32||(A>=48&&A<=57))}function getElementsByClassName(H,I,G){var B=new RegExp("(^|\\s)"+H+"(\\s|$)");var I=I||"*";var G=G||document;var A=(I=="*"&&G.all)?G.all:G.getElementsByTagName(I);var D=[];var F;var C=A.length;for(var E=0;E<C;E++){F=A[E];if(B.test(F.className)){D.push(F)}}return D}function removeEmbeds(C){if(C.hasChildNodes()){var B=C.childNodes;for(var A=0;A<B.length;A++){var D=B[A];removeEmbeds(D)}}if(C.tagName=="EMBED"){C.parentNode.removeChild(C)}}function $D(A){return $("#"+A)[0]}String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.ltrim=function(){return this.replace(/^\s+/g,"")};String.prototype.rtrim=function(){return this.replace(/\s+$/g,"")};String.prototype.stripHTML=function(){var A=/<(?:.|\s)*?>/g;return this.replace(A,"")};Array.prototype.indexOf=function(C,A,E){for(var D=+A||0,B=this.length;D<B;D++){if(this[D]===C||E&&this[D]==C){return D}}return -1};function after(B){var A=this.indexOf(B);return this.substring(A+1,this.length)}function before(B){var A=this.indexOf(B);return this.substring(0,A)}String.prototype.after=after;String.prototype.before=before;function hex2rgb(C){var D=new RegExp("^#?([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$");var B=C.toLowerCase().match(D);if(B){var A=new Array(parseInt(B[1],16),parseInt(B[2],16),parseInt(B[3],16));return(A)}else{return(null)}}function blackOrWhite(C){var B=hex2rgb(C);var A=(((B[0]*299)+(B[1]*587)+(B[2]*114)))/1000;if(A<127){return"#ffffff"}else{return"#000000"}}var Contrast=function(){var B={min:{brightness:125,difference:500},brightness:function(F,E){var D=((F.r*299)+(F.g*587)+(F.b*114))/1000;var C=((E.r*299)+(E.g*587)+(E.b*114))/1000;return Math.abs(Math.round(D-C))},difference:function(E,C){var D=(Math.max(E.r,C.r)-Math.min(E.r,C.r))+(Math.max(E.g,C.g)-Math.min(E.g,C.g))+(Math.max(E.b,C.b)-Math.min(E.b,C.b));return Math.abs(Math.round(D))},rgb:function(D){D=D.replace("#","");var C={r:parseInt(D[0]+D[1],16),g:parseInt(D[2]+D[3],16),b:parseInt(D[4]+D[5],16)};return C}};var A={test:function(D,C){var G=B.rgb(D);var E=B.rgb(C);var F=B.brightness(G,E);var H=B.difference(G,E);return(F>=B.min.brightness&&H>=B.min.difference?((F-B.min.brightness)+(H-B.min.difference)):false)},match:function(D,C){var H,F,E;if(typeof D=="string"){D=[D]}if(typeof C=="string"){C=[C]}var G={score:0,hex1:null,hex2:null};if(C==null){for(F=0;F<D.length;F++){for(E=0;E<D.length;E++){H=A.test(D[F],D[E]);if(H>G.score){G.score=H;G.hex1=D[F];G.hex2=D[E]}}}}else{for(F=0;F<D.length;F++){for(E=0;E<C.length;E++){H=A.test(D[F],C[E]);if(H>G.score){G.score=H;G.hex1=D[F];G.hex2=C[E]}}}}return(G.score>0?[G.hex1,G.hex2]:false)}};return A}();function associateObjWithEvent2(B,A){return(function(D,C){return B[A](D,C)})}function hideSel(){if(typeof document.body.style.maxHeight==="undefined"){if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'></iframe>")}}}function showSel(){$("#TB_HideSelect").remove()}function showOverlay(){if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});$("html").css("overflow","hidden");if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div>")}}else{if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div>")}var A=Client.pageSize();$("#TB_overlay").get(0).style.height=A.height+"px"}}function hideOverlay(){$("#TB_overlay,#TB_HideSelect").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","")}}function hideCenterDiv(A){$("#TB_overlay,#TB_invisible,#TB_HideSelect").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"})}if(A){$("#"+A)[0].style.display="none"}}function showCenterDiv(C){if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div>")}}else{if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div>")}}if($("#TB_invisible").length==0){}var A=$D(C);var B=Client.pageSize();$("#TB_overlay").get(0).style.height=B.height+"px";A.style.display="block"}doOnceData=new Object();function doOnce(B,A){if(nil(doOnceData[B])){doOnceData[B]=1;A()}}var Client={pageSize:function(){var A;var B;if(window.innerHeight&&window.scrollMaxY){A=window.innerWidth+window.scrollMaxX;B=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){A=document.body.scrollWidth;B=document.body.scrollHeight}else{A=document.body.offsetWidth+document.body.offsetLeft;B=document.body.offsetHeight+document.body.offsetTop}}return{width:A,height:B}},viewportWidth:function(){return self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth)},viewportHeight:function(){return self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight)},viewportSize:function(){return{width:this.viewportWidth(),height:this.viewportHeight()}},viewportOffset:function(){var C=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var A=document.all?C.scrollLeft:pageXOffset;var B=document.all?C.scrollTop:pageYOffset;return{left:A,top:B}},viewable:function(){var A=this.viewportSize();var B=this.viewportOffset();return{left:B.left,top:B.top,right:B.left+A.width,bottom:B.top+A.height}}};function findPos(A){var B=curtop=0;if(A.offsetParent){B=A.offsetLeft;curtop=A.offsetTop;while(A=A.offsetParent){B+=A.offsetLeft;curtop+=A.offsetTop}}return[B,curtop]}function showAddFriendBox(B){var A=$("#afmsgbox").get(0);if(!A){jQuery(document.body).append(Builder.node("div",{id:"afoutMsgBox",style:"top:0px;z-index:1005;position:absolute;width:100%;display:none"},[A=Builder.node("div",{id:"afmsgbox",style:"background-color:#fff;margin:50px auto;height:345px;width:500px"})]))}showCenterDiv("afoutMsgBox");jQuery(A).load("/cmd/MinAddFriend",{r:B});return false}function showMsgBox(B){var A=$("#msgbox").get(0);if(!A){jQuery(document.body).append(Builder.node("div",{id:"outMsgBox",style:"top:0px;z-index:1005;position:absolute;width:100%;display:none"},[A=Builder.node("div",{id:"msgbox",style:"background-color:#fff;margin:50px auto;height:345px;width:500px"})]))}showCenterDiv("outMsgBox");jQuery(A).load("/cmd/MinSendMsg",{r:B});return false}String.prototype.wordWrap=function(B,A,G){var D,C,E,F=this.split("\n");if(B>0){for(D in F){for(E=F[D],F[D]="";E.length>B;C=G?B:(C=E.substr(0,B).match(/\S*$/)).input.length-C[0].length||B,F[D]+=E.substr(0,C)+((E=E.substr(C)).length?A:"")){}F[D]+=E}}return F.join("\n")};String.prototype.escapeStr=function(){return(this.replace(/'/g,"\\'"))};String.prototype.escapeHTML=function(){return(this.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;"))};function entity(D,C){D=(D)?D:"";C=(C)?C:"string";var B=document.createElement("div");B.innerHTML=D;if(C=="numeric"){return"&#"+B.innerHTML.charCodeAt(0)+";"}else{if(C=="utf16"){var A=B.innerHTML.charCodeAt(0).toString(16);while(A.length<4){A="0"+A}return"\\u"+A}else{return B.innerHTML}}}String.prototype.unescapeHTML=function(){if(this==""){return this}var A=document.createElement("DIV");A.innerHTML=this;if(A.innerText){return A.innerText}return A.textContent};Array.prototype.compareArrays=function(A){if(this.length!=A.length){return false}for(var B=0;B<A.length;B++){if(this[B].compareArrays){if(!this[B].compareArrays(A[B])){return false}else{continue}}if(this[B]!=A[B]){return false}}return true};Array.prototype.contains=function(B){for(var A=0;A<this.length;A++){if(this[A]==B){return true}}return true};function setActiveStyleSheet(D){var C,B,A;for(C=0;(B=document.getElementsByTagName("link")[C]);C++){if(B.getAttribute("rel").indexOf("style")!=-1&&B.getAttribute("title")){B.disabled=true;if(B.getAttribute("title")==D){B.disabled=false}}}}function gMsg(A){growl.displayMsg(A)}function afterLast(C,B){var A=C.lastIndexOf(B)+1;return C.substr(A)}function getChildWithId(C,D){var B=C.childNodes;for(var A=0;A<B.length;A++){if(B[A].id==D){return B[A]}}return null}function replaceAll(C,B){for(i=0;i<B.length;i++){var A=C.indexOf(B[i][0]);while(A>-1){C=C.replace(B[i][0],B[i][1]);A=C.indexOf(B[i][0])}}return C}function setTLBGImg(A,B){if(A==null){$("#my-bg-layer")[0].style.background="";$("#my-bg-layer").empty()}else{$("#my-bg-layer").empty();if(B==0){$("#my-bg-layer").append('<img src="'+A+'" style="width:100%;height:100%"></img>')}else{if(B==1){($("#my-bg-layer")[0]).style.backgroundImage="url('"+A+"')";($("#my-bg-layer")[0]).style.backgroundRepeat="no-repeat";($("#my-bg-layer")[0]).style.backgroundPosition="center center"}else{if(B==2){($("#my-bg-layer")[0]).style.backgroundImage="url('"+A+"')";($("#my-bg-layer")[0]).style.backgroundRepeat="repeat"}}}}}function CheckMaxLength(B,A){if(B.value.length>A){B.value=B.value.substring(0,A)}}function timeChooserEnable(G){var F=$(G)[0];var E=Builder.node("select",{"class":"timeselect"},[Builder.node("option",{value:"12"},"12")]);for(var D=1;D<=11;D++){E.appendChild(Builder.node("option",{value:D},D))}var A=Builder.node("select",{"class":"timeselect"});for(var D=0;D<=59;D++){var C=(D<10)?"0"+D:D;A.appendChild(Builder.node("option",{value:D},C))}var B=Builder.node("select",{"class":"timeselect"},[Builder.node("option",{value:"a"},"AM"),Builder.node("option",{value:"p"},"PM")]);F.appendChild(E);F.appendChild(Builder.node("span",{style:"font-weight:bold"}));F.appendChild(A);F.appendChild(B)}function timeChooserSetEnabled(B,A){$(B).children("select").attr("disabled",!A)}function timeChooserSetTime(F,E){var B=$(F).children("select");var D=E.getUTCHours();var C=(D>11)?"p":"a";var A=E.getUTCMinutes();if(D==0){D=12}else{if(D>12){D-=12}}D=D+"";A=A+"";(B[0]).value=D;(B[1]).value=A;(B[2]).value=C}function timeChooserGetTime(F){var B=$(F).children("select");var D=parseInt(B.get(0).value);var A=parseInt(B.get(1).value);var C=B.get(2).value;if(D==12){D=0}if(C=="p"){D+=12}var E=new Date();E.setUTCHours(D,A,0,0);return E}function getScrollXY(){var A=0,B=0;if(typeof (window.pageYOffset)=="number"){A=window.pageXOffset;B=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){A=document.body.scrollLeft;B=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){A=document.documentElement.scrollLeft;B=document.documentElement.scrollTop}}}return[A,B]}function setScrollXY(A,B){window.scrollTo(A,B)}Date.prototype.format=function(A){return dateFormat(this,A)};function createMiniTLListener(A,B){B.click(function(D){var C=$(D.target);var E=C[0];if(E.className=="subico"){var F=E.id.after("_");A(F,[E,C.next().get(0)])}})}startTimeSubTL=null;endTimeSubTL=null;typeTL=null;useTimeTL=null;function createMiniTimeline(B,F,D,E,H,I,G){var A=Timeline.DateTime.parseIso8601DateTime(E);var C=Timeline.DateTime.parseIso8601DateTime(H);createMiniTimelineWithDate(B,F,D,A,C,I,G)}function createMiniTimelineWithDate(U,E,N,I,F,g,R){if(g==null||g.length==0){$("#subeventtimeline").hide()}else{$("#subeventtimeline").show()}mainWidth=U;try{if(I==null){I=startTimeSubTL}else{startTimeSubTL=I}if(F==null){F=endTimeSubTL}else{endTimeSubTL=F}if(E==null){E=typeTL}else{typeTL=E}if(N==null){N=useTimeTL}else{useTimeTL=N}var h=false;var B="m/dd/yy"+(N?" h:MMtt":"");if(E=="d"){$("#leftdate").html(I.format(B));$("#rightdate").html(F.format(B));$("#middate").html("")}else{if(E=="o"){$("#leftdate").html(I.format(B));$("#rightdate").html("Now");$("#middate").html("")}else{if(E=="i"){h=true;$("#leftdate").html("");$("#rightdate").html("");$("#middate").html(I.format(B));var L=I.getTime();I=new Date(L-(2*31556926000));F=new Date(L+(2*31556926000))}}}var K=F.getTime()-I.getTime();var M=K/U;R.empty();var S=4;var T=new Array(0);for(var W=0;W<g.length;W++){var O=g[W];var N=O.use_time=="1";var Y=Timeline.DateTime.parseIso8601DateTime(O.start);if(!N){Y.setUTCHours(0,0,0,0)}var Q=Y.getTime()-I.getTime();var D=Q*(1/M);var U=0;if(O.type=="d"&&O.end){var H=Timeline.DateTime.parseIso8601DateTime(O.end);if(!N){H.setUTCHours(0,0,0,0)}var Z=H.getTime()-Y.getTime();U=Z*(1/M);var C=D+U;if(D<-5){D=-13;if(C<-5){C=-8}}if(C>mainWidth+5){C=mainWidth+13;if(D>mainWidth+5){D=mainWidth+5}}U=C-D}else{if(O.type=="o"){var H=new Date();var Z=H.getTime()-Y.getTime();U=Z*(1/M);if(U<1){U=8}var C=D+U;if(D<-5){D=-13;if(C<-5){C=-8}}if(C>mainWidth+5){C=mainWidth+13;if(D>mainWidth+5){D=mainWidth+5}}U=C-D}else{D-=4;if(D<-5){D=-13}else{if(D>mainWidth+5){D=mainWidth+5}}U=8}}var S=-1;var A=-1;for(var V=0;V<T.length;V++){var f=T[V];if(f<D){S=4+(V*10);A=V;break}}if(S==-1){T.push(0);S=4+((T.length-1)*10);A=(T.length-1)}var P=Builder.node("div",{id:"subevt_"+O.id,"class":"subico",style:"top:"+S+"px;position:absolute;left:"+D+"px;width:"+U+"px;height:8px"});R[0].appendChild(P);var G=D+U+2;var k=trunc(O.title,20);var J=Builder.node("div",{"class":"sublabel",style:"top:"+S+"px;font-size:8px;position:absolute;left:"+G+"px;height:8px"},k);R[0].appendChild(J);var d=parseInt(J.style.left)+J.offsetWidth;T[A]=d}R[0].style.height=(6+(T.length*10))+"px"}catch(X){alert(X)}R[0].appendChild(Builder.node("div",{style:"clear:both"}))}function yesNoCancel(C,A){var D=Builder.node;var B=Builder.node("div",{id:"yesNoCancel",style:"display:none;cursor:default"},[Builder.node("div",{style:"padding:10px"},"Would you like to save your changes?"),Builder.node("input",{type:"button",id:"yesBtn",value:"Yes"}),Builder.node("input",{type:"button",id:"noBtn",value:"No",style:"margin-left:10px"}),Builder.node("input",{type:"button",id:"cancelBtn",value:"Cancel",style:"margin-left:10px"})]);document.body.appendChild(B);$("#cancelBtn").click(function(){C.unblock()});$("#yesBtn").click(function(){A.yes();C.unblock()});$("#noBtn").click(function(){A.no();C.unblock()});$(C).block(B,{border:"3px solid #517693"})}function clone(C){if(typeof (C)!="object"){return C}if(C==null){return C}var B=new Object();for(var A in C){B[A]=clone(C[A])}return B}var dateFormat=function(){var A=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloZ]|"[^"]*"|'[^']*'/g,B=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,D=/[^-+\dA-Z]/g,C=function(F,E){F=String(F);E=parseInt(E)||2;while(F.length<E){F="0"+F}return F};return function(J,T){if(arguments.length==1&&(typeof J=="string"||J instanceof String)&&!/\d/.test(J)){T=J;J=undefined}J=J?new Date(J):new Date();if(isNaN(J)){throw"invalid date"}var G=dateFormat;T=String(G.masks[T]||T||G.masks["default"]);var O=J.getDate(),E=J.getUTCDay(),K=J.getUTCMonth(),Q=J.getUTCFullYear(),R=J.getUTCHours(),N=J.getUTCMinutes(),S=J.getUTCSeconds(),P=J.getMilliseconds(),F=J.getTimezoneOffset(),I={d:O,dd:C(O),ddd:G.i18n.dayNames[E],dddd:G.i18n.dayNames[E+7],m:K+1,mm:C(K+1),mmm:G.i18n.monthNames[K],mmmm:G.i18n.monthNames[K+12],yy:String(Q).slice(2),yyyy:Q,h:R%12||12,hh:C(R%12||12),H:R,HH:C(R),M:N,MM:C(N),s:S,ss:C(S),t:R<12?"a":"p",tt:R<12?"am":"pm",T:R<12?"A":"P",TT:R<12?"AM":"PM"};return T.replace(A,function(H){return(H in I)?I[H]:H.slice(1,H.length-1)})}}();dateFormat.masks={"default":"ddd mmm d yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoFullDateTime:"yyyy-mm-dd'T'HH:MM:ss.lo"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thr","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};var ViewJS=function(){var A={tl:null,clkCat:function(F){var E=$(F);var D=F.id.split("|");var G=false;var C=theme.event.taggedColors[D[0]][D[1]];if(!E.hasClass("disabledcat")){E.addClass("disabledcat");E.css("background-color","#000");E.css("color","#ddd");E.css("text-decoration","underline");G=false}else{E.css("background-color",C.color);E.css("color",C.textColor);E.css("text-decoration","none");E.removeClass("disabledcat");G=true}C.isVisible=G;A.tl.relayout();return false},loadCategoriesJSON:function(){for(var F=0;F<A.timelines.length;F++){if(A.timelines[F].noPerm){continue}var C=A.timelines[F].categories;if(!C){return }for(var E=0;E<C.length;E++){var G=C[E];var D=G.id;if(!theme.event.taggedColors[G.timeline_id]){theme.event.taggedColors[G.timeline_id]=new Object();theme.event.taggedColors[G.timeline_id][D]=new Object()}if(!theme.event.taggedColors[G.timeline_id][D]){theme.event.taggedColors[G.timeline_id][D]=new Object()}theme.event.taggedColors[G.timeline_id][D].color="#"+G.color;theme.event.taggedColors[G.timeline_id][D].textColor="#"+ColorUtils.contrast(G.color);theme.event.taggedColors[G.timeline_id][D].isVisible=true}}tb_init("a.thumbthickbox")},timelines:null,initialize:function(I,N,F,C,K,Q){A.timelines=K;var G=new Timeline.DefaultEventSource();theme=Timeline.ClassicTheme.create();theme.event.label.width=250;theme.event.bubble.width=450;theme.event.bubble.height=400;theme.ether.background=N;if(!N){N="#3B4D92"}var M=blackOrWhite(N);theme.ether.interval.marker.color=M;theme.event.label.outsideColor=M;var E="Sat Oct 11 1900 13:00:00 GMT-0600";var P=[Timeline.createBandInfo({width:"100%",intervalUnit:Timeline.DateTime.YEAR,intervalPixels:40,eventSource:G,date:E,timeZone:0,showEventText:true,trackHeight:1.5,trackGap:0.2,theme:theme,maxDetail:1})];tl_pics=new Array();tl_pics[A.timelines[0].avatar_id]=A.timelines[0].avatar;if(A.timelines[1]){tl_pics[A.timelines[1].avatar_id]=A.timelines[1].avatar}A.loadTimelinesJSON();A.loadCategoriesJSON();var D=$("#tl")[0];A.tl=Timeline.create(D,P,Timeline.HORIZONTAL,Timeline.VIEW_MODE);A.zoomTo(Q);A.tl.setPaintDividers();G.loadJSON(events,"");A.tl.getBand(0).setCenterVisibleDate(new Date());A.tl.setToStart();A.tl.setDateTextColor(M);A.tl.setBackgroundColor(N);D.style.borderColor=F;D.style.borderWidth=C;if(I){A.bubbleEvent(I)}var O=23;var H=0;var L=$D("leftarrow");do{var J=Builder.node("div",{style:"margin-top:"+H+"px;float:right;width:1px;height:"+O+"px"});J.className="arrcomp";$D("leftarrow").appendChild(J);O-=2;H++}while(O>=0);var J=Builder.node("div",{style:"font-size: 0;margin-top:"+H+"px;float:right;width:1px;height:1px;background-color:#aaa"});$D("leftarrow").appendChild(J);var O=23;var H=0;var L=$D("rightarrow");do{var J=Builder.node("div",{style:"margin-top:"+H+"px;float:left;width:1px;height:"+O+"px"});J.className="arrcomp";$D("rightarrow").appendChild(J);O-=2;H++}while(O>=0);var J=Builder.node("div",{style:"font-size: 0;margin-top:"+H+"px;float:left;width:1px;height:1px;background-color:#aaa"});$("#rightarrow").append(J)},loadTimelinesJSON:function(){var E=A.timelines.length;var F="";var G="";for(var D=0;D<A.timelines.length;D++){var C=A.timelines[D];if(C.noPerm){continue}if(D!=0){F+=", "}F+=C.name;timelineNames[C.id]=C.name;timelineArray.push(C.name);timelineAvatars[C.id]=new Object();timelineAvatars[C.id].imageurl=C.imageurl;timelineAvatars[C.id].thumburl=C.thumburl;timelineAvatars[C.id].description=C.description;timelineAvatars[C.id].name=C.name;timelineAvatars[C.id].urlkey=C.urlkey}},showCompare:function(){$("#compareCandidatesText").load("/cmd/ListInclude",{});$D("compareCandidates").style.visibility="hidden";$D("compareCandidates").style.display="block";$D("compareCandidates").style.visibility="visible";$D("comparetitle").innerHTML="Select a lifebox for comparision...";var E=$("#timelinecontrols").position();var D=E.top+$("#timelinecontrols").height()+10;var C=E.left+$("#timelinecontrols").width()-620;$D("compareCandidates").style.top=D+"px";$D("compareCandidates").style.right="10px"},zoomTo:function(C){$("#zOutButton").attr("disabled",false);$("#zNoneButton").attr("disabled",false);$("#zInButton").attr("disabled",false);if(C==-1){ViewJS.zoomTo(20,Timeline.DateTime.BIDECADE);$("#zOutButton")[0].disabled=true}else{if(C==0){ViewJS.zoomTo(40,Timeline.DateTime.YEAR);$("#zNoneButton")[0].disabled=true}else{if(C==1){ViewJS.zoomTo(500,Timeline.DateTime.MONTH);$("#zInButton")[0].disabled=true}else{if(C==2){}}}}}};var B={clickIURL:function(C){showOverlay();$("#myIURLHolder").show();$("#myIURLIFrame").get(0).src=C},closeIURL:function(C){hideOverlay();$("#myIURLHolder").hide()},clickMap:function(C){showOverlay();$("#myMapHolder").show();GetMap()},closeMap:function(C){hideOverlay();$("#myMapHolder").hide()},bubbleEvent:function(C,E,D){A.tl.bubbleEvent(C,E,D)},clkCat:function(C){return A.clkCat(C)},initialize:function(C,G,H,D,E,F){A.initialize(C,G,H,D,E,F)},zoomIn:function(){A.tl.changeZoom(0.01)},zoomOut:function(){A.tl.changeZoom(-0.01)},scrollFirst:function(){A.tl.bubbleFirst()},scrollLast:function(){A.tl.bubbleLast()},zoomLevel:function(C){A.zoomTo(C)},zoomTo:function(C,D){A.tl.setZoomParams(C,D)},setAgeMode:function(){A.tl.startAt0()},setDateMode:function(){A.tl.startAtNormal()},showCompare:function(){A.showCompare()},closeCandidateBox:function(){$D("compareCandidates").style.display="none"},compareToLeft:function(C){location.href="/"+A.timelines[0].urlkey+"/"+C},bubbleNext:function(){A.tl.showNextEvent()},bubblePrev:function(){A.tl.showPrevEvent()},getChrono:function(){return A.tl._bands[0].getEventSource().getChronoEvents()}};return B}();var growl={setup:function(){jQuery("body").append("<div id='growlContainer'></div>")},id:0,displayMsg:function(E){if(E==""){return }var C="growlMsgId"+(growl.id++);jQuery("#growlContainer").prepend("<div id='"+C+"' class='growlMsg'>"+E+"</div>");var B=$("#"+C);var A=E.length;var D=2000+(A*30);B.corner().fadeIn("slow").animate({opacity:0.9},D).fadeOut("slow",function(){B.remove()})}};jQuery(document).ready(function(){growl.setup()});(function(A){A.fn.gradient=function(C){C=A.extend({from:"000000",to:"ffffff",direction:"horizontal",position:"top",length:null},C||{});var B=function(J,I,K){var H=[],G=1,K=(K<100)?K:100;do{H[H.length]=F(E(J),G,E(I));G-=((100/K)*0.01)}while(G>0);return H},F=function(J,I,K){var G=[];for(var H=0;H<J.length;H++){G[H]=Math.round(J[H]*I)+Math.round(K[H]*(1-I))}return G},E=function(G){return new Array(D(G.substring(0,2)),D(G.substring(2,4)),D(G.substring(4,6)))},D=function(G){return parseInt(G,16)};return this.each(function(){var M=A(this),G=M.innerWidth(),R=M.innerHeight(),O=0,N=0,P=1,K=1,L=[],H=C.length||(C.direction=="vertical"?G:R),J=(C.position=="bottom"?"bottom:0;":"top:0;")+(C.position=="right"?"right:0;":"left:0;"),Q=B(C.from,C.to,H);if(C.direction=="horizontal"){K=Math.round(H/Q.length)||1;P=G}else{P=Math.round(H/Q.length)||1;K=R}L.push('<div class="gradient" style="position: absolute; '+J+" width: "+(C.direction=="vertical"?H+"px":"100%")+"; height: "+(C.direction=="vertical"?"100%":H+"px")+"; overflow: hidden; z-index: 0; background-color: #"+(C.position.indexOf("bottom")!=-1?C.from:C.to)+'">');for(var I=0;I<Q.length;I++){L.push('<div style="position:absolute;z-index:1;top:'+N+"px;left:"+O+"px;height:"+(C.direction=="vertical"?"100%":K+"px")+";width:"+(C.direction=="vertical"?P+"px":"100%")+";background-color:rgb("+Q[I][0]+","+Q[I][1]+","+Q[I][2]+');"></div>');C.direction=="vertical"?O+=P:N+=K;if(N>=R||O>=G){break}}L.push("</div>");if(M.css("position")=="static"){M.css("position","relative")}M.html('<div style="display:'+M.css("display")+'; position: relative; z-index: 2;">'+this.innerHTML+"</div>").prepend(L.join(""))})}})(jQuery);(function(A){A.blockUI=function(D,B,C){A.blockUI.impl.install(window,D,B,C)};A.blockUI.version=1.33;A.unblockUI=function(B){A.blockUI.impl.remove(window,B)};A.fn.block=function(D,B,C){return this.each(function(){if(!this.$pos_checked){if(A.css(this,"position")=="static"){this.style.position="relative"}if(A.browser.msie){this.style.zoom=1}this.$pos_checked=1}A.blockUI.impl.install(this,D,B,C)})};A.fn.unblock=function(B){return this.each(function(){A.blockUI.impl.remove(this,B)})};A.fn.displayBox=function(K,L,I){var E=this[0];if(!E){return }var N=A(E);K=K||{};var M=N.width()||N.attr("width")||K.width||A.blockUI.defaults.displayBoxCSS.width;var J=N.height()||N.attr("height")||K.height||A.blockUI.defaults.displayBoxCSS.height;if(M[M.length-1]=="%"){var H=document.documentElement.clientWidth||document.body.clientWidth;M=parseInt(M)||100;M=(M*H)/100}if(J[J.length-1]=="%"){var F=document.documentElement.clientHeight||document.body.clientHeight;J=parseInt(J)||100;J=(J*F)/100}var G="-"+parseInt(M)/2+"px";var C="-"+parseInt(J)/2+"px";var D=navigator.userAgent.toLowerCase();var B={displayMode:L||1,noalpha:I&&/mac/.test(D)&&/firefox/.test(D)};A.blockUI.impl.install(window,E,{width:M,height:J,marginTop:C,marginLeft:G},B)};A.blockUI.defaults={pageMessage:"<h1>Please wait...</h1>",elementMessage:"",overlayCSS:{backgroundColor:"#fff",opacity:"0.5"},pageMessageCSS:{width:"250px",margin:"-50px 0 0 -125px",top:"50%",left:"50%",textAlign:"center",color:"#000",backgroundColor:"#fff",border:"3px solid #aaa"},elementMessageCSS:{width:"250px",padding:"10px",textAlign:"center",backgroundColor:"#fff"},displayBoxCSS:{width:"400px",height:"400px",top:"50%",left:"50%"},ie6Stretch:1,allowTabToLeave:0,closeMessage:"Click to close",fadeOut:1,fadeTime:400};A.blockUI.impl={box:null,boxCallback:null,pageBlock:null,pageBlockEls:[],op8:window.opera&&window.opera.version()<9,ie6:A.browser.msie&&/MSIE 6.0/.test(navigator.userAgent),install:function(D,E,H,B){B=B||{};this.boxCallback=typeof B.displayMode=="function"?B.displayMode:null;this.box=B.displayMode?E:null;var J=(D==window);var O=this.op8||A.browser.mozilla&&/Linux/.test(navigator.platform);if(typeof B.alphaOverride!="undefined"){O=B.alphaOverride==0?1:0}if(J&&this.pageBlock){this.remove(window,{fadeOut:0})}if(E&&typeof E=="object"&&!E.jquery&&!E.nodeType){H=E;E=null}E=E?(E.nodeType?A(E):E):J?A.blockUI.defaults.pageMessage:A.blockUI.defaults.elementMessage;if(B.displayMode){var P=jQuery.extend({},A.blockUI.defaults.displayBoxCSS)}else{var P=jQuery.extend({},J?A.blockUI.defaults.pageMessageCSS:A.blockUI.defaults.elementMessageCSS)}H=jQuery.extend(P,H||{});var I=(A.browser.msie)?A('<iframe class="blockUI" style="z-index:1000;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>'):A('<div class="blockUI" style="display:none"></div>');var M=A('<div class="blockUI" style="z-index:1001;cursor:wait;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var F=J?A('<div class="blockUI blockMsg" style="z-index:1002;cursor:wait;padding:0;position:fixed"></div>'):A('<div class="blockUI" style="display:none;z-index:1002;cursor:wait;position:absolute"></div>');M.css("position",J?"fixed":"absolute");if(E){F.css(H)}if(!O){M.css(A.blockUI.defaults.overlayCSS)}if(this.op8){M.css({width:""+D.clientWidth,height:""+D.clientHeight})}if(A.browser.msie){I.css("opacity","0.0")}A([I[0],M[0],F[0]]).appendTo(J?"body":D);var L=A.browser.msie&&(!A.boxModel||A("object,embed",J?null:D).length>0);if(this.ie6||L){if(J&&A.blockUI.defaults.ie6Stretch&&A.boxModel){A("html,body").css("height","100%")}if((this.ie6||!A.boxModel)&&!J){var N=this.sz(D,"borderTopWidth"),G=this.sz(D,"borderLeftWidth");var K=N?"(0 - "+N+")":0;var C=G?"(0 - "+G+")":0}A.each([I,M,F],function(Q,S){var R=S[0].style;R.position="absolute";if(Q<2){J?R.setExpression("height",'document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"'):R.setExpression("height",'this.parentNode.offsetHeight + "px"');J?R.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):R.setExpression("width",'this.parentNode.offsetWidth + "px"');if(C){R.setExpression("left",C)}if(K){R.setExpression("top",K)}}else{if(J){R.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}R.marginTop=0}})}if(B.displayMode){M.css("cursor","default").attr("title",A.blockUI.defaults.closeMessage);F.css("cursor","default");A([I[0],M[0],F[0]]).removeClass("blockUI").addClass("displayBox");A().click(A.blockUI.impl.boxHandler).bind("keypress",A.blockUI.impl.boxHandler)}else{this.bind(1,D)}F.append(E).show();if(E.jquery){E.show()}if(B.displayMode){return }if(J){this.pageBlock=F[0];this.pageBlockEls=A(":input:enabled:visible",this.pageBlock);setTimeout(this.focus,20)}else{this.center(F[0])}},remove:function(D,E){var F=A.extend({},A.blockUI.defaults,E);this.bind(0,D);var C=D==window;var B=C?A("body").children().filter(".blockUI"):A(".blockUI",D);if(C){this.pageBlock=this.pageBlockEls=null}if(F.fadeOut){B.fadeOut(F.fadeTime,function(){if(this.parentNode){this.parentNode.removeChild(this)}})}else{B.remove()}},boxRemove:function(B){A().unbind("click",A.blockUI.impl.boxHandler).unbind("keypress",A.blockUI.impl.boxHandler);if(this.boxCallback){this.boxCallback(this.box)}A("body .displayBox").hide().remove()},handler:function(E){if(E.keyCode&&E.keyCode==9){if(A.blockUI.impl.pageBlock&&!A.blockUI.defaults.allowTabToLeave){var D=A.blockUI.impl.pageBlockEls;var C=!E.shiftKey&&E.target==D[D.length-1];var B=E.shiftKey&&E.target==D[0];if(C||B){setTimeout(function(){A.blockUI.impl.focus(B)},10);return false}}}if(A(E.target).parents("div.blockMsg").length>0){return true}return A(E.target).parents().children().filter("div.blockUI").length==0},boxHandler:function(B){if((B.keyCode&&B.keyCode==27)||(B.type=="click"&&A(B.target).parents("div.blockMsg").length==0)){A.blockUI.impl.boxRemove()}return true},bind:function(B,E){var D=E==window;if(!B&&(D&&!this.pageBlock||!D&&!E.$blocked)){return }if(!D){E.$blocked=B}var C=A(E).find("a,:input");A.each(["mousedown","mouseup","keydown","keypress","click"],function(F,G){C[B?"bind":"unbind"](G,A.blockUI.impl.handler)})},focus:function(B){if(!A.blockUI.impl.pageBlockEls){return }var C=A.blockUI.impl.pageBlockEls[B===true?A.blockUI.impl.pageBlockEls.length-1:0];if(C){C.focus()}},center:function(E){var F=E.parentNode,D=E.style;var B=((F.offsetWidth-E.offsetWidth)/2)-this.sz(F,"borderLeftWidth");var C=((F.offsetHeight-E.offsetHeight)/2)-this.sz(F,"borderTopWidth");D.left=B>0?(B+"px"):"0";D.top=C>0?(C+"px"):"0"},sz:function(B,C){return parseInt(A.css(B,C))||0}}})(jQuery);$(function(){$("ul.jd_menu").jdMenu()});(function(D){D.jdMenu={settings:[],getSettings:function(E){var F=D(E).parents("ul.jd_menu:eq(0)")[0];return this.settings[F&&F.$jdSettings?F.$jdSettings:0]}};function C(F){var F=D(F);var E=F.parent();F.trigger("jdMenuShow").positionBy({target:E[0],targetPos:(E.parent().is(".jd_menu")?3:1),elementPos:0});E.addClass("jdm_active").siblings("li").find("ul:eq(0):visible").each(function(){B(this)})}function B(E){D(E).filter(":not(.jd_menu)").find("> li ul:eq(0):visible").each(function(){B(this)}).end().hide().trigger("jdMenuHide").parents("li:eq(0)").removeClass("jdm_active jdm_hover").end().find("> li").removeClass("jdm_active jdm_hover")}function A(E){return D.data(D(E).is(".jd_menu")?E:D(E).parents("ul.jd_menu")[0],"jdMenuSettings")}D.fn.jdMenu=function(E){var E=D.extend({activateDelay:500,showDelay:450,hideDelay:1000},E);return this.filter("ul.jd_menu").each(function(){D.data(this,"jdMenuSettings",E);D("li",this).bind("mouseenter.jdmenu",function(){D(this).addClass("jdm_hover");var G=D("ul:eq(0)",this);if(G.length==1){var F=this;clearTimeout(this.$jdTimer);this.$jdTimer=setTimeout(function(){C(G)},A(this).showDelay)}}).bind("mouseleave.jdmenu",function(){D(this).removeClass("jdm_hover");var G=D("ul:eq(0)",this);if(G.length==1){var F=D.jdMenu.getSettings(this);var H=this;clearTimeout(this.$jdTimer);this.$jdTimer=setTimeout(function(){B(G)},A(this).hideDelay)}}).bind("click.jdmenu",function(F){var I=D("> ul",this);if(I.length==1){C(I);return false}if(F.target==this){var H=D("> a",F.target).not(".accessible");if(H.length>0){var G=H[0];if(!G.onclick){window.open(G.href,G.target||"_self")}else{D(G).trigger("click")}}}D(this).parent().jdMenuHide();F.stopPropagation()}).bind("keydown.jdmenu",function(F){if(F.which==27){if(!D(this).parent().is(".jd_menu")){B(D(this).parent()[0])}D(this).parents("li:eq(0)").find("a:eq(0)").trigger("focus");return false}}).find("> a").bind("focus.jdmenu",function(){D(this).parents("li:eq(0)").addClass("jdm_hover")}).bind("blur.jdmenu",function(){D(this).parents("li:eq(0)").removeClass("jdm_hover")}).filter(".accessible").bind("click.jdmenu",function(F){F.preventDefault()})})};D.fn.jdMenuUnbind=function(){D("li",this).unbind("mouseenter.jdmenu mouseleave.jdmenu click.jdmenu keydown.jdmenu").find("> a").unbind("focus.jdmenu blur.jdmenu click.jdmenu");return this};D.fn.jdMenuHide=function(){return this.filter("ul").each(function(){B(this)})};D(window).bind("click.jdmenu",function(){D("ul.jd_menu ul:visible").jdMenuHide()})})(jQuery);(function(C){var B=function(D,A,F,E){this.x1=D;this.x2=F;this.y1=A;this.y2=E};B.prototype.contains=function(A){return(this.x1<=A.x1&&A.x2<=this.x2)&&(this.y1<=A.y1&&A.y2<=this.y2)};B.prototype.transform=function(A,D){return new B(this.x1+A,this.y1+D,this.x2+A,this.y2+D)};C.fn.positionBy=function(D){var A=new Date();if(this.length==0){return this}var D=C.extend({target:null,targetPos:null,elementPos:null,x:null,y:null,positions:null,addClass:false,force:false,container:window},D);if(D.x!=null){var L=D.x;var K=D.y;var J=0;var I=0}else{var H=C(C(D.target)[0]);var J=H.outerWidth();var I=H.outerHeight();var G=H.offset();var L=G.left;var K=G.top}var F=L+J;var E=K+I;return this.each(function(){var Z=C(this);if(!Z.is(":visible")){Z.css({left:-3000,top:-3000}).show()}var Y=Z.outerWidth();var X=Z.outerHeight();var W=[];var V=[];W[0]=new B(F,K,F+Y,K+X);V[0]=[1,7,4];W[1]=new B(F,E-X,F+Y,E);V[1]=[0,6,4];W[2]=new B(F,E,F+Y,E+X);V[2]=[1,3,10];W[3]=new B(F-Y,E,F,E+X);V[3]=[1,6,10];W[4]=new B(L,E,L+Y,E+X);V[4]=[1,6,9];W[5]=new B(L-Y,E,L,E+X);V[5]=[6,4,9];W[6]=new B(L-Y,E-X,L,E);V[6]=[7,1,4];W[7]=new B(L-Y,K,L,K+X);V[7]=[6,0,4];W[8]=new B(L-Y,K-X,L,K);V[8]=[7,9,4];W[9]=new B(L,K-X,L+Y,K);V[9]=[0,7,4];W[10]=new B(F-Y,K-X,F,K);V[10]=[0,7,3];W[11]=new B(F,K-X,F+Y,K);V[11]=[0,10,3];W[12]=new B(F-Y,K,F,K+X);V[12]=[13,7,10];W[13]=new B(F-Y,E-X,F,E);V[13]=[12,6,3];W[14]=new B(L,E-X,L+Y,E);V[14]=[15,1,4];W[15]=new B(L,K,L+Y,K+X);V[15]=[14,0,9];if(D.positions!==null){var U=D.positions[0]}else{if(D.targetPos!=null&&D.elementPos!=null){var U=[];U[0]=[];U[0][0]=15;U[0][1]=7;U[0][2]=8;U[0][3]=9;U[1]=[];U[1][0]=0;U[1][1]=12;U[1][2]=10;U[1][3]=11;U[2]=[];U[2][0]=2;U[2][1]=3;U[2][2]=13;U[2][3]=1;U[3]=[];U[3][0]=4;U[3][1]=5;U[3][2]=6;U[3][3]=14;var U=U[D.targetPos][D.elementPos]}}var T=W[U];var S=U;if(!D.force){$window=C(window);var R=$window.scrollLeft();var Q=$window.scrollTop();var P=new B(R,Q,R+$window.width(),Q+$window.height());var O;if(D.positions){O=D.positions}else{O=[U]}var N=[];while(O.length>0){var M=O.shift();if(N[M]){continue}N[M]=true;if(!P.contains(W[M])){if(D.positions===null){O=jQuery.merge(O,V[M])}}else{T=W[M];break}}}Z.parents().each(function(){var e=C(this);if(e.css("position")!="static"){var d=e.offset();T=T.transform(-d.left,-d.top);return false}});Z.css({left:T.x1,top:T.y1});if(D.addClass){Z.removeClass("positionBy0 positionBy1 positionBy2 positionBy3 positionBy4 positionBy5 positionBy6 positionBy7 positionBy8 positionBy9 positionBy10 positionBy11 positionBy12 positionBy13 positionBy14 positionBy15").addClass("positionBy"+M)}})}})(jQuery);(function(A){A.fn.hoverIntent=function(I,H){var J={sensitivity:7,interval:100,timeout:0};J=A.extend(J,H?{over:I,out:H}:I);var L,K,F,D;var E=function(M){L=M.pageX;K=M.pageY};var C=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);if((Math.abs(F-L)+Math.abs(D-K))<J.sensitivity){A(M).unbind("mousemove",E);M.hoverIntent_s=1;return J.over.apply(M,[N])}else{F=L;D=K;M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}};var G=function(N,M){M.hoverIntent_t=clearTimeout(M.hoverIntent_t);M.hoverIntent_s=0;return J.out.apply(M,[N])};var B=function(P){var O=(P.type=="mouseover"?P.fromElement:P.toElement)||P.relatedTarget;while(O&&O!=this){try{O=O.parentNode}catch(P){O=this}}if(O==this){return false}var N=jQuery.extend({},P);var M=this;if(M.hoverIntent_t){M.hoverIntent_t=clearTimeout(M.hoverIntent_t)}if(P.type=="mouseover"){F=N.pageX;D=N.pageY;A(M).bind("mousemove",E);if(M.hoverIntent_s!=1){M.hoverIntent_t=setTimeout(function(){C(N,M)},J.interval)}}else{A(M).unbind("mousemove",E);if(M.hoverIntent_s==1){M.hoverIntent_t=setTimeout(function(){G(N,M)},J.timeout)}}};return this.mouseover(B).mouseout(B)}})(jQuery);var Timeline=new Object();Timeline.Platform=new Object();Timeline.Platform.serverLocale="en";Timeline.Platform.clientLocale="en";Timeline.startZeroMode=false;Timeline.strings={};Timeline.create=function(C,B,A,E,D){return new Timeline._Impl(C,B,A,E,D)};Timeline.HORIZONTAL=0;Timeline.VERTICAL=1;Timeline.EDIT_MODE=0;Timeline.VIEW_MODE=1;Timeline._defaultTheme=null;Timeline.createBandInfo=function(H){var G=("theme" in H)?H.theme:Timeline.getDefaultTheme();var F=("eventSource" in H)?H.eventSource:null;var E=new Timeline.LinearEther({centersOn:("date" in H)?H.date:new Date(),interval:Timeline.DateTime.gregorianUnitLengths[H.intervalUnit],pixelsPerInterval:H.intervalPixels});var C=new Timeline.GregorianEtherPainter({unit:H.intervalUnit,multiple:("multiple" in H)?H.multiple:1,theme:G,align:("align" in H)?H.align:undefined});var D=new Timeline.StaticTrackBasedLayout({eventSource:F,ether:E,showText:("showEventText" in H)?H.showEventText:true,theme:G});var A={showText:("showEventText" in H)?H.showEventText:true,layout:D,theme:G};if("trackHeight" in H){A.trackHeight=H.trackHeight}if("trackGap" in H){A.trackGap=H.trackGap}var B=new Timeline.DurationEventPainter(A);return{width:H.width,eventSource:F,timeZone:("timeZone" in H)?H.timeZone:0,ether:E,etherPainter:C,eventPainter:B}};Timeline.createHotZoneBandInfo=function(H){var G=("theme" in H)?H.theme:Timeline.getDefaultTheme();var F=("eventSource" in H)?H.eventSource:null;var E=new Timeline.HotZoneEther({centersOn:("date" in H)?H.date:new Date(),interval:Timeline.DateTime.gregorianUnitLengths[H.intervalUnit],pixelsPerInterval:H.intervalPixels,zones:H.zones});var C=new Timeline.HotZoneGregorianEtherPainter({unit:H.intervalUnit,zones:H.zones,theme:G,align:("align" in H)?H.align:undefined});var D=new Timeline.StaticTrackBasedLayout({eventSource:F,ether:E,theme:G,maxDetail:H.maxDetail});var A={showText:("showEventText" in H)?H.showEventText:true,layout:D,maxDetail:H.maxDetail,theme:G};if("trackHeight" in H){A.trackHeight=H.trackHeight}if("trackGap" in H){A.trackGap=H.trackGap}var B=new Timeline.DurationEventPainter(A);return{width:H.width,eventSource:F,timeZone:("timeZone" in H)?H.timeZone:0,ether:E,etherPainter:C,eventPainter:B}};Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.Platform.getDefaultLocale())}return Timeline._defaultTheme};Timeline.setDefaultTheme=function(A){Timeline._defaultTheme=A};Timeline.loadXML=function(A,C){var D=function(G,E,F){alert("Failed to load data xml from "+A+"\n"+G)};var B=function(F){var E=F.responseXML;if(!E.documentElement&&F.responseStream){E.load(F.responseStream)}C(E,A)};Timeline.XmlHttp.get(A,D,B)};Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText)};var fDone=function(xmlhttp){f(eval("("+xmlhttp.responseText+")"),url)};Timeline.XmlHttp.get(url,fError,fDone)};Timeline._Impl=function(C,B,A,E,D){this._containerDiv=C;this._mode=E==null?Timeline.VIEW_MODE:E;this._bandInfos=B;this._orientation=A==null?Timeline.HORIZONTAL:A;this._unit=(D!=null)?D:Timeline.NativeDateUnit;this._initialize()};Timeline._Impl.prototype.isEditMode=function(){return this._mode==Timeline.EDIT_MODE};Timeline._Impl.prototype.dispose=function(){for(var A=0;A<this._bands.length;A++){this._bands[A].dispose()}this._bands=null;this._bandInfos=null;this._containerDiv.innerHTML=""};Timeline._Impl.prototype.bubbleEvent=function(A,E,D){var C=this._bands[0].getEventSource();var B=C.getEvent(A);this._bands[0].ensureEventVisible(B);this._bands[0]._eventPainter.showBubble(B,E,D)};Timeline._Impl.prototype.setBubbledEvent=function(A){if(!this._chronoEvents){this._chronoEvents=this._bands[0].getEventSource().getChronoEvents()}this.bubbledEvent=A;this.currentIndex=this._chronoEvents.indexOf(this.bubbledEvent)};Timeline._Impl.prototype.firstEventInfo=function(){};Timeline._Impl.prototype.setToStart=function(){var A=this._bands[0].getEventSource().getEarliestEventDate();if(A){this._bands[0].setMinVisibleDatePlusPixels(A,10)}};Timeline._Impl.prototype.bubbleFirst=function(){if(!this._chronoEvents){this._chronoEvents=this._bands[0].getEventSource().getChronoEvents()}this._bands[0].scrollToLeft(this._chronoEvents.getFirst().getStart())};Timeline._Impl.prototype.showPrevEvent=function(){if(!this._chronoEvents){this._chronoEvents=this._bands[0].getEventSource().getChronoEvents()}var D=this._chronoEvents.length();var A=this._chronoEvents.indexOfEvt(bubbledEventID);for(var C=A-1;C>=0;C--){var B=this._chronoEvents.elementAt(C);if(B.getHasContent()){this._bands[0].ensureEventVisible(B);this._bands[0]._eventPainter.showBubble(B);A=C;return }}};Timeline._Impl.prototype.showNextEvent=function(){if(!this._chronoEvents){this._chronoEvents=this._bands[0].getEventSource().getChronoEvents()}var D=this._chronoEvents.length();var A=-1;if(bubbledEventID==-1){A=-1}else{A=this._chronoEvents.indexOfEvt(bubbledEventID)}for(var C=A+1;C<D;C++){var B=this._chronoEvents.elementAt(C);if(B.getHasContent()){this._bands[0].ensureEventVisible(B);this._bands[0]._eventPainter.showBubble(B);A=C;return }}};Timeline._Impl.prototype.startAt0=function(){Timeline.startZeroMode=true;var A=new Date();A.setFullYear(1900,0,1);this._bands[0].setMinVisibleDatePlusPixels(A,10);this.relayout();this._bands[0]._bandInfo.etherPainter.paint()};Timeline._Impl.prototype.startAtNormal=function(){Timeline.startZeroMode=false;this.setToStart();this.relayout();this._bands[0]._bandInfo.etherPainter.paint()};Timeline._Impl.prototype.bubbleNext=function(){if(!this._chronoEvents){this._chronoEvents=this._bands[0].getEventSource().getChronoEvents()}this.currentIndex++;this._bands[0].ensureEventVisible(this._chronoEvents.elementAt(this.currentIndex));this._bands[0]._eventPainter.showBubble(this._chronoEvents.elementAt(this.currentIndex))};Timeline._Impl.prototype.bubblePrev=function(){if(!this._chronoEvents){this._chronoEvents=this._bands[0].getEventSource().getChronoEvents()}this.currentIndex--;this._bands[0].ensureEventVisible(this._chronoEvents.elementAt(this.currentIndex));this._bands[0]._eventPainter.showBubble(this._chronoEvents.elementAt(this.currentIndex))};Timeline._Impl.prototype.bubbleLast=function(){if(!this._chronoEvents){this._chronoEvents=this._bands[0].getEventSource().getChronoEvents()}this._bands[0].scrollToRight(this._chronoEvents.getLast().getStart())};Timeline._Impl.prototype.removeEvent=function(C){var B=this._bands[0].getEventSource();var A=B.getEvent(C);B.remove(A)};Timeline._Impl.prototype.setPaintDividers=function(){this._bands[0].setPaintDividers()};Timeline._Impl.prototype.closeBubble=function(){this._bands[0].closeBubble()};Timeline._Impl.prototype.repaint=function(){this._bands[0]._repaint()};Timeline._Impl.prototype.relayout=function(){this._bands[0]._relayout();this._bands[0]._repaint()};Timeline._Impl.prototype.setDateTextColor=function(A){this._bands[0]._bandInfo.etherPainter._markerLayer.style.color=A};Timeline._Impl.prototype.setBackgroundColor=function(A){this._bands[0]._bandInfo.etherPainter._backgroundLayer.style.background=A};Timeline._Impl.prototype.setZoomParams=function(C,B){var A=this._bands[0].getCenterVisibleDate();this._bandInfos[0].ether._pixelsPerInterval=C;this._bandInfos[0].etherPainter._unit=B;this._bands[0]._bandInfo.ether._pixelsPerInterval=C;this._bands[0]._bandInfo.etherPainter._unit=B;this.relayout();this._bands[0]._bandInfo.etherPainter.paint();this._bands[0].setCenterVisibleDate(A)};Timeline._Impl.prototype.changeZoom=function(A){this._bands[0]._bandInfo.ether._zones[1].magnify=this._bands[0]._bandInfo.ether._zones[1].magnify+A;this._bands[0]._bandInfo.etherPainter._zones[1].magnify=this._bands[0]._bandInfo.etherPainter._zones[1].magnify+A;this.relayout();this._bands[0]._bandInfo.etherPainter.paint()};Timeline._Impl.prototype.getBandCount=function(){return this._bands.length};Timeline._Impl.prototype.getBand=function(A){return this._bands[A]};Timeline._Impl.prototype.layout=function(){this._distributeWidths()};Timeline._Impl.prototype.paint=function(){for(var A=0;A<this._bands.length;A++){this._bands[A].paint()}};Timeline._Impl.prototype.getDocument=function(){return this._containerDiv.ownerDocument};Timeline._Impl.prototype.getContainerDiv=function(){return this._containerDiv};Timeline._Impl.prototype.addDiv=function(A){this._containerDiv.appendChild(A)};Timeline._Impl.prototype.removeDiv=function(A){this._containerDiv.removeChild(A)};Timeline._Impl.prototype.isHorizontal=function(){return this._orientation==Timeline.HORIZONTAL};Timeline._Impl.prototype.isVertical=function(){return this._orientation==Timeline.VERTICAL};Timeline._Impl.prototype.getPixelLength=function(){return this._orientation==Timeline.HORIZONTAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight};Timeline._Impl.prototype.getPixelWidth=function(){return this._orientation==Timeline.VERTICAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight};Timeline._Impl.prototype.getUnit=function(){return this._unit};Timeline._Impl.prototype.loadXML=function(B,D){var A=this;var E=function(H,F,G){alert("Failed to load data xml from "+B+"\n"+H);A.hideLoadingMessage()};var C=function(G){try{var F=G.responseXML;if(!F.documentElement&&G.responseStream){F.load(G.responseStream)}D(F,B)}finally{A.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){Timeline.XmlHttp.get(B,E,C)},0)};Timeline._Impl.prototype.loadJSON=function(url,f){var tl=this;var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);tl.hideLoadingMessage()};var fDone=function(xmlhttp){try{f(eval("("+xmlhttp.responseText+")"),url)}finally{tl.hideLoadingMessage()}};this.showLoadingMessage();window.setTimeout(function(){Timeline.XmlHttp.get(url,fError,fDone)},0)};Timeline._Impl.prototype._initialize=function(){var F=this._containerDiv;var C=F.ownerDocument;F.className=F.className.split(" ").concat("timeline-container").join(" ");while(F.firstChild){F.removeChild(F.firstChild)}this._bands=[];for(var A=0;A<this._bandInfos.length;A++){var E=new Timeline._Band(this,this._bandInfos[A],A);this._bands.push(E)}this._distributeWidths();for(var A=0;A<this._bandInfos.length;A++){var D=this._bandInfos[A];if("syncWith" in D){this._bands[A].setSyncWithBand(this._bands[D.syncWith],("highlight" in D)?D.highlight:false)}}var B=Timeline.Graphics.createMessageBubble(C);B.containerDiv.className="timeline-message-container";F.appendChild(B.containerDiv);B.contentDiv.className="timeline-message";B.contentDiv.innerHTML="<img src='"+Timeline.urlPrefix+"images/progress-running.gif' /> Loading...";this.showLoadingMessage=function(){B.containerDiv.style.display="block"};this.hideLoadingMessage=function(){B.containerDiv.style.display="none"}};Timeline._Impl.prototype._distributeWidths=function(){var B=this.getPixelLength();var A=this.getPixelWidth();var D=0;for(var E=0;E<this._bands.length;E++){var I=this._bands[E];var J=this._bandInfos[E];var F=J.width;var H=F.indexOf("%");if(H>0){var G=parseInt(F.substr(0,H));var C=G*A/100}else{var C=parseInt(F)}I.setBandShiftAndWidth(D,C);I.setViewLength(B);D+=C}};Timeline._Band=function(E,F,B){this._timeline=E;this._bandInfo=F;this._index=B;this._locale=("locale" in F)?F.locale:Timeline.Platform.getDefaultLocale();this._timeZone=("timeZone" in F)?F.timeZone:0;this._labeller=("labeller" in F)?F.labeller:E.getUnit().createLabeller(this._locale,this._timeZone);this._dragging=false;this._changing=false;this._originalScrollSpeed=5;this._scrollSpeed=this._originalScrollSpeed;this._onScrollListeners=[];var A=this;this._syncWithBand=null;this._syncWithBandHandler=function(G){A._onHighlightBandScroll()};this._selectorListener=function(G){A._onHighlightBandScroll()};var D=this._timeline.getDocument().createElement("div");D.className="timeline-band-input";this._timeline.addDiv(D);this._keyboardInput=document.createElement("input");this._keyboardInput.type="text";D.appendChild(this._keyboardInput);Timeline.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,this._onKeyDown);Timeline.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,this._onKeyUp);this._div=this._timeline.getDocument().createElement("div");this._div.className="timeline-band";this._timeline.addDiv(this._div);$(this._div).draggable({forceTop0:true,axis:"x",stop:associateObjWithEvent2(this,"_onTLDragStop"),drag:associateObjWithEvent2(this,"_onTLDragged"),start:associateObjWithEvent2(this,"_onTLDragStart")});Timeline.DOM.registerEventWithObject(this._div,"mousedown",this,this._onMouseDown);Timeline.DOM.registerEventWithObject(this._div,"dblclick",this,this._onDblClick);this._innerDiv=this._timeline.getDocument().createElement("div");this._innerDiv.className="timeline-band-inner";this._div.appendChild(this._innerDiv);this._ether=F.ether;F.ether.initialize(E);this._etherPainter=F.etherPainter;F.etherPainter.initialize(this,E);this._eventSource=F.eventSource;if(this._eventSource){this._eventListener={onAddMany:function(){A._onAddMany()},onAddOne:function(){A._onAddOne()},onRemoveOne:function(){A._onRemoveOne()},onClear:function(){A._onClear()}};this._eventSource.addListener(this._eventListener)}this._eventPainter=F.eventPainter;F.eventPainter.initialize(this,E);this._decorators=("decorators" in F)?F.decorators:[];for(var C=0;C<this._decorators.length;C++){this._decorators[C].initialize(this,E)}this._bubble=null};Timeline._Band.SCROLL_MULTIPLES=5;Timeline._Band.prototype._onTLDragStart=function(B,A){this.dragStartX=A.instance.originalPosition.left};Timeline._Band.prototype._onTLDragStop=function(B,A){this._checkNeedResize()};Timeline._Band.prototype._onTLDragged=function(C,A){var D=A.position.left;var B=D-this.dragStartX;this.dragStartX=D;this._moveEtherNoMove(B)};Timeline._Band.prototype.ensureEventVisible=function(B){var E=this.dateToPixelOffset(B.getStart());var D=-1*this._viewOffset;var A=$("#tl").get(0).offsetWidth;var C=D+A;if(E-100<D){this._moveEther(Math.round((D-E+200)))}else{if(E>C-100){this._moveEther(-1*Math.round((E-C+200)))}}};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;this._bubble=null};Timeline._Band.prototype.addOnScrollListener=function(A){this._onScrollListeners.push(A)};Timeline._Band.prototype.removeOnScrollListener=function(B){for(var A=0;A<this._onScrollListeners.length;A++){if(this._onScrollListeners[A]==B){this._onScrollListeners.splice(A,1);break}}};Timeline._Band.prototype.setSyncWithBand=function(B,A){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler)}this._syncWithBand=B;this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);this._highlight=A;this._positionHighlight()};Timeline._Band.prototype.getLocale=function(){return this._locale};Timeline._Band.prototype.getTimeZone=function(){return this._timeZone};Timeline._Band.prototype.getLabeller=function(){return this._labeller};Timeline._Band.prototype.getIndex=function(){return this._index};Timeline._Band.prototype.getEther=function(){return this._ether};Timeline._Band.prototype.getEtherPainter=function(){return this._etherPainter};Timeline._Band.prototype.getEventSource=function(){return this._eventSource};Timeline._Band.prototype.getEventPainter=function(){return this._eventPainter};Timeline._Band.prototype.layout=function(){this.paint()};Timeline._Band.prototype.paint=function(){this._etherPainter.paint();this._paintDecorators();this._paintEvents()};Timeline._Band.prototype.softLayout=function(){this.softPaint()};Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint();this._softPaintDecorators();this._softPaintEvents()};Timeline._Band.prototype.setBandShiftAndWidth=function(A,D){var C=this._keyboardInput.parentNode;var B=A+Math.floor(D/2);if(this._timeline.isHorizontal()){this._div.style.top=A+"px";this._div.style.height=D+"px";C.style.top=B+"px";C.style.left="-1em"}else{this._div.style.left=A+"px";this._div.style.width=D+"px";C.style.left=B+"px";C.style.top="-1em"}};Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetWidth}else{return this._div.offsetHeight}};Timeline._Band.prototype.setViewLength=function(A){this._viewLength=A;this._recenterDiv();this._onChanging()};Timeline._Band.prototype.getViewLength=function(){return this._viewLength};Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength};Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset};Timeline._Band.prototype.getMinDate=function(){if(typeof (window.tlMinYear)!="undefined"){if(Timeline.startZeroMode){var A=new Date();A.setFullYear(1895,0,1);return A}else{var A=new Date();A.setFullYear(tlMinYear,0,1);return A}}return this._ether.pixelOffsetToDate(this._viewOffset)};Timeline._Band.prototype.getMaxDate=function(){if(typeof (window.tlMaxYear)!="undefined"){if(Timeline.startZeroMode){var A=tlMaxYear-tlMinYear-10;var B=new Date();B.setFullYear(1905+A,0,1);return B}else{var B=new Date();B.setFullYear(tlMaxYear,0,1);return B}}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.setMinVisibleDatePlusPixels=function(A,B){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(A))+B)}};Timeline._Band.prototype.setMinVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(A)))}};Timeline._Band.prototype.setMaxVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(A)))}};Timeline._Band.prototype.setCenterVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(A)))}};Timeline._Band.prototype.dateToPixelOffset=function(A){return this._ether.dateToPixelOffset(A)-this._viewOffset};Timeline._Band.prototype.pixelOffsetToDate=function(A){return this._ether.pixelOffsetToDate(A+this._viewOffset)};Timeline._Band.prototype.createLayerDiv=function(C){var B=this._timeline.getDocument().createElement("div");B.className="timeline-band-layer";B.style.zIndex=C;this._innerDiv.appendChild(B);var A=this._timeline.getDocument().createElement("div");A.className="timeline-band-layer-inner";if(Timeline.Platform.browser.isIE){A.style.cursor="move";A.unselectable="on"}else{A.style.cursor="-moz-grab"}B.appendChild(A);return A};Timeline._Band.prototype.removeLayerDiv=function(A){this._innerDiv.removeChild(A.parentNode)};bubbledEventID=-1;Timeline._Band.prototype.closeBubble=function(){if(this._bubble!=null){bubbledEventID=-1;this._bubble.close();this._bubble=null}};Timeline._Band.prototype.openBubbleForPoint=function(E,C,D,A,B){if(!D){D=300}this.closeBubble();B.getLabel().style.visibility="hidden";this._bubble=Timeline.Graphics.createBubbleForPoint(this._timeline.getDocument(),E,C,D,A,B);bubbledEventID=B.getID();return this._bubble.content};Timeline._Band.prototype.scrollToLeft=function(B){var A=this._ether.dateToPixelOffset(B);this._autoScroll(Math.round(this._viewLength/8-A))};Timeline._Band.prototype.scrollToRight=function(B){var A=this._ether.dateToPixelOffset(B);var C=this._viewLength*0.875;this._autoScroll(Math.round(C-A))};Timeline._Band.prototype.scrollToCenter=function(B){var A=this._ether.dateToPixelOffset(B);if(A<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(A+this._viewLength))}else{if(A>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(A-this._viewLength))}}this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(B)))};Timeline._Band.prototype._onMouseDown=function(B,A,C){this.closeBubble()};Timeline._Band.prototype._onMouseMove=function(D,A,E){if(this._dragging){var C=A.clientX-this._dragX;var B=A.clientY-this._dragY;this._dragX=A.clientX;this._dragY=A.clientY;this._moveEther(this._timeline.isHorizontal()?C:B);this._positionHighlight()}};Timeline._Band.prototype._onMouseUp=function(B,A,C){this._dragging=false};Timeline._Band.prototype._onMouseOut=function(B,A,D){var C=Timeline.DOM.getEventRelativeCoordinates(A,B);C.x+=this._viewOffset;if(C.x<0||C.x>B.offsetWidth||C.y<0||C.y>B.offsetHeight){this._dragging=false}};Timeline._Band.prototype._onDblClick=function(B,A,D){var C=Timeline.DOM.getEventRelativeCoordinates(A,B);var E=C.x-(this._viewLength/2-this._viewOffset);this._autoScroll(-E)};Timeline._Band.prototype._onKeyDown=function(B,A,C){if(!this._dragging){switch(A.keyCode){case 27:break;case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;default:return true}this.closeBubble();Timeline.DOM.cancelEvent(A);return false}return true};Timeline._Band.prototype._onKeyUp=function(B,A,C){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed;switch(A.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate());break;case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate());break;case 33:this._autoScroll(this._timeline.getPixelLength());break;case 34:this._autoScroll(-this._timeline.getPixelLength());break;default:return true}this.closeBubble();Timeline.DOM.cancelEvent(A);return false}return true};Timeline._Band.prototype._autoScroll=function(C){var A=this;var B=Timeline.Graphics.createAnimation(function(D,E){A._moveEther(E)},0,C,1000);B.run()};Timeline._Band.prototype._moveEther=function(A){if(isNaN(A)){return }this.closeBubble();this._viewOffset+=A;this._ether.shiftPixels(-A);if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px"}else{this._div.style.top=this._viewOffset+"px"}if(this._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._checkNeedResize=function(){this._viewOffset=parseInt(this._div.style.left);this._div.style.top="0px";if(this._viewOffset>-this._viewLength||this._viewOffset<(-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)+this._viewLength)){this._recenterDiv()}else{this.softLayout()}this._onChanging()};Timeline._Band.prototype._moveEtherNoMove=function(A){if(isNaN(A)){return }this.closeBubble();this._viewOffset=parseInt(this._div.style.left);this._ether.shiftPixels(-A);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 A=0;A<this._onScrollListeners.length;A++){this._onScrollListeners[A](this)}};Timeline._Band.prototype._setSyncWithBandDate=function(){if(this._syncWithBand){var A=this._ether.pixelOffsetToDate(this.getViewLength()/2);this._syncWithBand.setCenterVisibleDate(A)}};Timeline._Band.prototype._onHighlightBandScroll=function(){if(this._syncWithBand){var A=this._syncWithBand.getCenterVisibleDate();var B=this._ether.dateToPixelOffset(A);this._moveEther(Math.round(this._viewLength/2-B));if(this._highlight){this._etherPainter.setHighlight(this._syncWithBand.getMinVisibleDate(),this._syncWithBand.getMaxVisibleDate())}}};Timeline._Band.prototype._onAddOne=function(){this._eventPainter.getLayout()._layout();this._paintEvents()};Timeline._Band.prototype._repaint=function(){this._paintEvents()};Timeline._Band.prototype._onAddMany=function(){this._paintEvents()};Timeline._Band.prototype._onClear=function(){this._paintEvents()};Timeline._Band.prototype._onRemoveOne=function(){this._eventPainter.getLayout()._layout();this._paintEvents()};Timeline._Band.prototype._positionHighlight=function(){if(this._syncWithBand){var A=this._syncWithBand.getMinVisibleDate();var B=this._syncWithBand.getMaxVisibleDate();if(this._highlight){this._etherPainter.setHighlight(A,B)}}};Timeline._Band.prototype._recenterDiv=function(){this._viewOffset=-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1)/2;if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";this._div.style.width=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px"}else{this._div.style.top=this._viewOffset+"px";this._div.style.height=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px"}this.layout()};Timeline._Band.prototype.setPaintDividers=function(){this.isMultipleTimeline=true};Timeline._Band.prototype._paintEvents=function(){this._eventPainter.paint();if(this.isMultipleTimeline){this._eventPainter.paintDividers(this._timeline.getContainerDiv())}};Timeline._Band.prototype._softPaintEvents=function(){this._eventPainter.softPaint()};Timeline._Band.prototype._paintDecorators=function(){for(var A=0;A<this._decorators.length;A++){this._decorators[A].paint()}};Timeline._Band.prototype._softPaintDecorators=function(){for(var A=0;A<this._decorators.length;A++){this._decorators[A].softPaint()}};Timeline._Band.prototype._relayout=function(){this._eventPainter.getLayout()._layout()};Timeline.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};Timeline.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};(function(){var C=navigator.appName.toLowerCase();var A=navigator.userAgent.toLowerCase();Timeline.Platform.os.isMac=(A.indexOf("mac")!=-1);Timeline.Platform.os.isWin=(A.indexOf("win")!=-1);Timeline.Platform.os.isWin32=Timeline.Platform.isWin&&(A.indexOf("95")!=-1||A.indexOf("98")!=-1||A.indexOf("nt")!=-1||A.indexOf("win32")!=-1||A.indexOf("32bit")!=-1);Timeline.Platform.os.isUnix=(A.indexOf("x11")!=-1);Timeline.Platform.browser.isIE=(C.indexOf("microsoft")!=-1);Timeline.Platform.browser.isNetscape=(C.indexOf("netscape")!=-1);Timeline.Platform.browser.isMozilla=(A.indexOf("mozilla")!=-1);Timeline.Platform.browser.isFirefox=(A.indexOf("firefox")!=-1);Timeline.Platform.browser.isOpera=(C.indexOf("opera")!=-1);var E=function(G){var F=G.split(".");Timeline.Platform.browser.majorVersion=parseInt(F[0]);Timeline.Platform.browser.minorVersion=parseInt(F[1])};var B=function(H,G,I){var F=H.indexOf(G,I);return F>=0?F:H.length};if(Timeline.Platform.browser.isMozilla){var D=A.indexOf("mozilla/");if(D>=0){E(A.substring(D+8,B(A," ",D)))}}if(Timeline.Platform.browser.isIE){var D=A.indexOf("msie ");if(D>=0){E(A.substring(D+5,B(A,";",D)))}}if(Timeline.Platform.browser.isNetscape){var D=A.indexOf("rv:");if(D>=0){E(A.substring(D+3,B(A,")",D)))}}if(Timeline.Platform.browser.isFirefox){var D=A.indexOf("firefox/");if(D>=0){E(A.substring(D+8,B(A," ",D)))}}})();Timeline.Platform.getDefaultLocale=function(){return Timeline.Platform.clientLocale};Timeline.Debug=new Object();Timeline.Debug.log=function(A){};Timeline.Debug.exception=function(A){alert("Caught exception: "+(Timeline.Platform.isIE?A.message:A))};Timeline.XmlHttp=new Object();Timeline.XmlHttp._onReadyStateChange=function(A,D,B){switch(A.readyState){case 4:try{if(A.status==0||A.status==200){if(B){B(A)}}else{if(D){D(A.statusText,A.status,A)}}}catch(C){Timeline.Debug.exception(C)}break}};Timeline.XmlHttp._createRequest=function(){if(Timeline.Platform.browser.isIE){var A=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];for(var B=0;B<A.length;B++){try{var C=A[B];var D=function(){return new ActiveXObject(C)};var F=D();Timeline.XmlHttp._createRequest=D;return F}catch(E){}}throw new Error("Failed to create an XMLHttpRequest object")}else{try{var D=function(){return new XMLHttpRequest()};var F=D();Timeline.XmlHttp._createRequest=D;return F}catch(E){throw new Error("Failed to create an XMLHttpRequest object")}}};Timeline.XmlHttp.get=function(A,D,C){var B=Timeline.XmlHttp._createRequest();B.open("GET",A,true);B.onreadystatechange=function(){Timeline.XmlHttp._onReadyStateChange(B,D,C)};B.send(null)};Timeline.XmlHttp.post=function(B,A,E,D){var C=Timeline.XmlHttp._createRequest();C.open("POST",B,true);C.onreadystatechange=function(){Timeline.XmlHttp._onReadyStateChange(C,E,D)};C.send(A)};Timeline.XmlHttp._forceXML=function(A){try{A.overrideMimeType("text/xml")}catch(B){A.setrequestheader("Content-Type","text/xml")}};Timeline.DOM=new Object();Timeline.DOM.registerEventWithObject=function(B,A,D,C){Timeline.DOM.registerEvent(B,A,function(F,E,G){return C.call(D,F,E,G)})};Timeline.DOM.registerEvent=function(C,B,D){var A=function(E){E=(E)?E:((event)?event:null);if(E){var F=(E.target)?E.target:((E.srcElement)?E.srcElement:null);if(F){F=(F.nodeType==1||F.nodeType==9)?F:F.parentNode}return D(C,E,F)}return true};if(Timeline.Platform.browser.isIE){C.attachEvent("on"+B,A)}else{C.addEventListener(B,A,false)}};Timeline.DOM.getPageCoordinates=function(A){var C=0;var B=0;if(A.nodeType!=1){A=A.parentNode}while(A!=null){C+=A.offsetLeft;B+=A.offsetTop;A=A.offsetParent}return{left:C,top:B}};Timeline.DOM.getEventRelativeCoordinates=function(A,B){if(Timeline.Platform.browser.isIE){return{x:A.offsetX,y:A.offsetY}}else{var C=Timeline.DOM.getPageCoordinates(B);return{x:A.pageX-C.left,y:A.pageY-C.top}}};Timeline.DOM.cancelEvent=function(A){A.returnValue=false;A.cancelBubble=true;if("preventDefault" in A){A.preventDefault()}};Timeline.Graphics=new Object();Timeline.Graphics.pngIsTranslucent=(!Timeline.Platform.browser.isIE)||(Timeline.Platform.browser.majorVersion>6);Timeline.Graphics.createTranslucentImage=function(C,A,D){var B;if(Timeline.Graphics.pngIsTranslucent){B=C.createElement("img");B.setAttribute("src",A)}else{B=C.createElement("img");B.style.display="inline";B.style.width="1px";B.style.height="1px";B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+A+"', sizingMethod='image')"}B.style.verticalAlign=(D!=null)?D:"middle";return B};Timeline.Graphics.setOpacity=function(B,A){if(Timeline.Platform.browser.isIE){B.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+A+")"}else{var C=(A/100).toString();B.style.opacity=C;B.style.MozOpacity=C}};Timeline.Graphics._bubbleMargins={top:15,bottom:15,left:15,right:15};Timeline.Graphics._arrowOffsets={top:0,bottom:0,left:0,right:0};Timeline.Graphics._bubblePadding=15;Timeline.Graphics._bubblePointOffset=6;Timeline.Graphics._halfArrowWidth=18;Timeline.Graphics.createBubbleForPoint=function(V,C,B,M,Q,K){if(M==0){M=300}function S(){if(typeof window.innerWidth=="number"){return{w:window.innerWidth,h:window.innerHeight}}else{if(document.documentElement&&document.documentElement.clientWidth){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight}}else{if(document.body&&document.body.clientWidth){return{w:document.body.clientWidth,h:document.body.clientHeight}}}}}var L={_event:K,_closed:false,_doc:V,close:function(){if(!this._closed){g_isBubbleShowing=false;$D("leftarrow").style.visibility="hidden";$D("rightarrow").style.visibility="hidden";this._event.getLabel().style.visibility="visible";this._div.style.visibility="hidden";this._div.style.display="none";removeEmbeds(this._div);this._doc.body.removeChild(this._div);bubbledEventID=-1;this._doc=null;this._div=null;this._content=null;this._closed=true;this._event=null}}};var N=S();var G=N.w;var F=N.h;var D=Timeline.Graphics._bubbleMargins;M=parseInt(M,10);Q=parseInt(Q,10);var O=D.left+M+D.right;var T=D.top+Q+D.bottom;var P=Timeline.Graphics.pngIsTranslucent;var I=Timeline.urlPrefix;var A=function(Y,X,Z,W){Y.style.position="absolute";Y.style.width=Z+"px";Y.style.height=W+"px";if(P){Y.style.background="url("+X+")"}else{Y.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+X+"', sizingMethod='crop')"}};var J=V.createElement("div");J.style.width=O+"px";J.style.position="absolute";J.style.zIndex=1000;L._div=J;var H=V.createElement("div");H.style.padding="15px";J.appendChild(H);var R=function(Y,e,d,Z,X){var W=V.createElement("div");W.style.left=e+"px";W.style.top=d+"px";A(W,Y,Z,X);H.appendChild(W)};var U=V.createElement("div");A(U,"/0/images/close.gif",13,13);U.id="bubcloser";U.style.cursor="pointer";U.style.top="5px";Timeline.DOM.registerEventWithObject(U,"click",L,L.close);H.appendChild(U);var E=V.createElement("div");E.style.left=D.left+"px";E.style.top=D.top+"px";E.style.width=M+"px";H.appendChild(E);L.content=E;V.body.appendChild(J);return L};Timeline.Graphics.createMessageBubble=function(H){var G=H.createElement("div");if(Timeline.Graphics.pngIsTranslucent){var I=H.createElement("div");I.style.height="33px";I.style.background="url("+Timeline.urlPrefix+"images/message-top-left.png) top left no-repeat";I.style.paddingLeft="44px";G.appendChild(I);var C=H.createElement("div");C.style.height="33px";C.style.background="url("+Timeline.urlPrefix+"images/message-top-right.png) top right no-repeat";I.appendChild(C);var F=H.createElement("div");F.style.background="url("+Timeline.urlPrefix+"images/message-left.png) top left repeat-y";F.style.paddingLeft="44px";G.appendChild(F);var A=H.createElement("div");A.style.background="url("+Timeline.urlPrefix+"images/message-right.png) top right repeat-y";A.style.paddingRight="44px";F.appendChild(A);var D=H.createElement("div");A.appendChild(D);var B=H.createElement("div");B.style.height="55px";B.style.background="url("+Timeline.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat";B.style.paddingLeft="44px";G.appendChild(B);var E=H.createElement("div");E.style.height="55px";E.style.background="url("+Timeline.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat";B.appendChild(E)}else{G.style.border="2px solid #7777AA";G.style.padding="20px";G.style.background="white";Timeline.Graphics.setOpacity(G,90);var D=H.createElement("div");G.appendChild(D)}return{containerDiv:G,contentDiv:D}};Timeline.Graphics.createAnimation=function(A,D,C,B){return new Timeline.Graphics._Animation(A,D,C,B)};Timeline.Graphics._Animation=function(A,D,C,B){this.f=A;this.from=D;this.to=C;this.current=D;this.duration=B;this.start=new Date().getTime();this.timePassed=0};Timeline.Graphics._Animation.prototype.run=function(){var A=this;window.setTimeout(function(){A.step()},100)};Timeline.Graphics._Animation.prototype.step=function(){this.timePassed+=100;var B=this.timePassed/this.duration;var A=-Math.cos(B*Math.PI)/2+0.5;var D=A*(this.to-this.from)+this.from;try{this.f(D,D-this.current)}catch(C){}this.current=D;if(this.timePassed<this.duration){this.run()}};Timeline.DateTime=new Object();Timeline.DateTime.MILLISECOND=0;Timeline.DateTime.SECOND=1;Timeline.DateTime.MINUTE=2;Timeline.DateTime.HOUR=3;Timeline.DateTime.DAY=4;Timeline.DateTime.WEEK=5;Timeline.DateTime.MONTH=6;Timeline.DateTime.YEAR=7;Timeline.DateTime.DECADE=8;Timeline.DateTime.CENTURY=9;Timeline.DateTime.MILLENNIUM=10;Timeline.DateTime.BIDECADE=11;Timeline.DateTime.EPOCH=-1;Timeline.DateTime.ERA=-2;Timeline.DateTime.gregorianUnitLengths=[];(function(){var B=Timeline.DateTime;var A=B.gregorianUnitLengths;A[B.MILLISECOND]=1;A[B.SECOND]=1000;A[B.MINUTE]=A[B.SECOND]*60;A[B.HOUR]=A[B.MINUTE]*60;A[B.DAY]=A[B.HOUR]*24;A[B.WEEK]=A[B.DAY]*7;A[B.MONTH]=A[B.DAY]*31;A[B.YEAR]=A[B.DAY]*365;A[B.DECADE]=A[B.YEAR]*10;A[B.BIDECADE]=A[B.YEAR]*5;A[B.CENTURY]=A[B.YEAR]*100;A[B.MILLENNIUM]=A[B.YEAR]*1000})();Timeline.DateTime.parseGregorianDateTime=function(G){if(G==null){return null}else{if(G instanceof Date){return G}}var B=G.toString();if(B.length>0&&B.length<8){var C=B.indexOf(" ");if(C>0){var A=parseInt(B.substr(0,C));var E=B.substr(C+1);if(E.toLowerCase()=="bc"){A=1-A}}else{var A=parseInt(B)}var F=new Date(0);F.setUTCFullYear(A);return F}try{return new Date(Date.parse(B))}catch(D){return null}};Timeline.DateTime._iso8601DateRegExp="^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$";Timeline.DateTime.setIso8601Date=function(H,F){var J=Timeline.DateTime._iso8601DateRegExp;var I=F.match(new RegExp(J));if(!I){throw new Error("Invalid date string: "+F)}var B=(I[1]=="-")?-1:1;var K=B*I[2];var G=I[5];var C=I[7];var E=I[9];var A=I[11];var N=(I[13])?I[13]:1;H.setUTCFullYear(K);if(E){H.setUTCMonth(0);H.setUTCDate(Number(E))}else{if(A){H.setUTCMonth(0);H.setUTCDate(1);var M=H.getUTCDay();var L=(M)?M:7;var D=Number(N)+(7*Number(A));if(L<=4){H.setUTCDate(D+1-L)}else{H.setUTCDate(D+8-L)}}else{if(G){H.setUTCDate(1);H.setUTCMonth(G-1)}if(C){H.setUTCDate(C)}}}return H};Timeline.DateTime.setIso8601Timeff=function(G,E){var F="Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$";var H=E.match(new RegExp(F));var C=0;if(H){if(H[0]!="Z"){C=(Number(H[3])*60)+Number(H[5]);C*=((H[2]=="-")?1:-1)}E=E.substr(0,E.length-H[0].length)}var I="^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$";var H=E.match(new RegExp(I));if(!H){dojo.debug("invalid time string: "+E);return false}var J=H[1];var B=Number((H[3])?H[3]:0);var D=(H[5])?H[5]:0;var A=H[7]?(Number("0."+H[7])*1000):0;G.setUTCHours(J);G.setUTCMinutes(B);G.setUTCSeconds(D);G.setUTCMilliseconds(A);return G};Timeline.DateTime.setIso8601Time=function(B,A){var C=A.split(":");B.setUTCHours(C[0]);B.setUTCMinutes(C[1]);B.setUTCSeconds(0);B.setUTCMilliseconds(0);return B};Timeline.DateTime.setIso8601=function(B,A){var C=(A.indexOf("T")==-1)?A.split(" "):A.split("T");B=Timeline.DateTime.setIso8601Date(B,C[0]);if(C.length==2){Timeline.DateTime.setIso8601Time(B,C[1])}return B};Timeline.DateTime.parseIso8601DateTime=function(A){if(A==null||!A){return null}try{return Timeline.DateTime.setIso8601(new Date(0),A)}catch(B){return null}};Timeline.DateTime.roundDownToInterval=function(B,G,J,K,A){var D=J*Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.HOUR];var I=new Date(B.getTime()+D);var E=function(L){L.setUTCMilliseconds(0);L.setUTCSeconds(0);L.setUTCMinutes(0);L.setUTCHours(0)};var C=function(L){E(L);L.setUTCDate(1);L.setUTCMonth(0)};switch(G){case Timeline.DateTime.MILLISECOND:var H=I.getUTCMilliseconds();I.setUTCMilliseconds(H-(H%K));break;case Timeline.DateTime.SECOND:I.setUTCMilliseconds(0);var H=I.getUTCSeconds();I.setUTCSeconds(H-(H%K));break;case Timeline.DateTime.MINUTE:I.setUTCMilliseconds(0);I.setUTCSeconds(0);var H=I.getUTCMinutes();I.setTime(I.getTime()-(H%K)*Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.MINUTE]);break;case Timeline.DateTime.HOUR:I.setUTCMilliseconds(0);I.setUTCSeconds(0);I.setUTCMinutes(0);var H=I.getUTCHours();I.setUTCHours(H-(H%K));break;case Timeline.DateTime.DAY:E(I);break;case Timeline.DateTime.WEEK:E(I);var F=(I.getUTCDay()+7-A)%7;I.setTime(I.getTime()-F*Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.DAY]);break;case Timeline.DateTime.MONTH:E(I);I.setUTCDate(1);var H=I.getUTCMonth();I.setUTCMonth(H-(H%K));break;case Timeline.DateTime.YEAR:C(I);var H=I.getUTCFullYear();I.setUTCFullYear(H-(H%K));break;case Timeline.DateTime.DECADE:C(I);I.setUTCFullYear(Math.floor(I.getUTCFullYear()/10)*10);break;case Timeline.DateTime.BIDECADE:C(I);I.setUTCFullYear(Math.floor(I.getUTCFullYear()/5)*5);break;case Timeline.DateTime.CENTURY:C(I);I.setUTCFullYear(Math.floor(I.getUTCFullYear()/100)*100);break;case Timeline.DateTime.MILLENNIUM:C(I);I.setUTCFullYear(Math.floor(I.getUTCFullYear()/1000)*1000);break}B.setTime(I.getTime()-D)};Timeline.DateTime.roundUpToInterval=function(D,F,C,A,B){var E=D.getTime();Timeline.DateTime.roundDownToInterval(D,F,C,A,B);if(D.getTime()<E){D.setTime(D.getTime()+Timeline.DateTime.gregorianUnitLengths[F]*A)}};Timeline.DateTime.incrementByInterval=function(A,B){switch(B){case Timeline.DateTime.MILLISECOND:A.setTime(A.getTime()+1);break;case Timeline.DateTime.SECOND:A.setTime(A.getTime()+1000);break;case Timeline.DateTime.MINUTE:A.setTime(A.getTime()+Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.MINUTE]);break;case Timeline.DateTime.HOUR:A.setTime(A.getTime()+Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.HOUR]);break;case Timeline.DateTime.DAY:A.setUTCDate(A.getUTCDate()+1);break;case Timeline.DateTime.WEEK:A.setUTCDate(A.getUTCDate()+7);break;case Timeline.DateTime.MONTH:A.setUTCMonth(A.getUTCMonth()+1);break;case Timeline.DateTime.YEAR:A.setUTCFullYear(A.getUTCFullYear()+1);break;case Timeline.DateTime.DECADE:A.setUTCFullYear(A.getUTCFullYear()+10);break;case Timeline.DateTime.BIDECADE:A.setUTCFullYear(A.getUTCFullYear()+5);break;case Timeline.DateTime.CENTURY:A.setUTCFullYear(A.getUTCFullYear()+100);break;case Timeline.DateTime.MILLENNIUM:A.setUTCFullYear(A.getUTCFullYear()+1000);break}};Timeline.DateTime.removeTimeZoneOffset=function(B,A){return new Date(B.getTime()+A*Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.HOUR])};Timeline.SortedArray=function(B,A){this._a=(A instanceof Array)?A:[];this._compare=B};Timeline.SortedArray.prototype.add=function(C){var A=this;var B=this.find(function(D){return A._compare(D,C)});if(B<this._a.length){this._a.splice(B,0,C)}else{this._a.push(C)}};Timeline.SortedArray.prototype.remove=function(C){var A=this;var B=this.find(function(D){return A._compare(D,C)});while(B<this._a.length&&this._compare(this._a[B],C)==0){if(this._a[B]==C){this._a.splice(B,1);return true}else{B++}}return false};Timeline.SortedArray.prototype.removeAll=function(){this._a=[]};Timeline.SortedArray.prototype.indexOfEvt=function(A){for(var B=0;B<this._a.length;B++){if(this._a[B].getID()==A){return B}}return -1};Timeline.SortedArray.prototype.indexOf=function(B){for(var A=0;A<this._a.length;A++){if(this._a[A]==B){return A}}return -1};Timeline.SortedArray.prototype.elementAt=function(A){return this._a[A]};Timeline.SortedArray.prototype.length=function(){return this._a.length};Timeline.SortedArray.prototype.find=function(D){var B=0;var A=this._a.length;while(B<A){var C=Math.floor((B+A)/2);var E=D(this._a[C]);if(C==B){return E<0?B+1:B}else{if(E<0){B=C}else{A=C}}}return B};Timeline.SortedArray.prototype.getFirst=function(){return(this._a.length>0)?this._a[0]:null};Timeline.SortedArray.prototype.getLast=function(){return(this._a.length>0)?this._a[this._a.length-1]:null};Timeline.EventIndex=function(B){var A=this;this._unit=(B!=null)?B:Timeline.NativeDateUnit;this._events=new Timeline.SortedArray(function(F,E){var D=getTimelineIDIndex(F.getTimelineID());var C=getTimelineIDIndex(E.getTimelineID());if(D>C){return 1}if(D<C){return -1}if(F.getCategoryID()>E.getCategoryID()){return -1}else{if(F.getCategoryID()<E.getCategoryID()){return 1}}return A._unit.compare(F.getStart(),E.getStart())});this._chronoEvents=new Timeline.SortedArray(function(D,C){return A._unit.compare(D.getStart(),C.getStart())});this._indexed=true};Timeline.EventIndex.prototype.getUnit=function(){return this._unit};Timeline.EventIndex.prototype.remove=function(A){this._events.remove(A);this._chronoEvents.remove(A);this._indexed=false};Timeline.EventIndex.prototype.add=function(A){this._events.add(A);this._chronoEvents.add(A);this._indexed=false};Timeline.EventIndex.prototype.removeAll=function(){this._events.removeAll();this._chronoEvents.removeAll();this._indexed=false};Timeline.EventIndex.prototype.getCount=function(){return this._events.length()};Timeline.EventIndex.prototype.getIterator=function(A,B){if(!this._indexed){this._index()}return new Timeline.EventIndex._Iterator(this._events,A,B,this._unit)};Timeline.EventIndex.prototype.getChronoAllIterator=function(){return new Timeline.EventIndex._AllIterator(this._chronoEvents)};Timeline.EventIndex.prototype.getChronoEvents=function(){return this._chronoEvents};Timeline.EventIndex.prototype.getAllIterator=function(){return new Timeline.EventIndex._AllIterator(this._events)};Timeline.EventIndex.prototype.getEarliestDate=function(){var A=this._events.getFirst();return(A==null)?null:A.getStart()};Timeline.EventIndex.prototype.getLatestDate=function(){var A=this._events.getLast();if(A==null){return null}if(!this._indexed){this._index()}var C=A._earliestOverlapIndex;var B=this._events.elementAt(C).getEnd();for(var D=C+1;D<this._events.length();D++){B=this._unit.later(B,this._events.elementAt(D).getEnd())}return B};Timeline.EventIndex.prototype._index=function(){var D=this._events.length();for(var E=0;E<D;E++){var C=this._events.elementAt(E);C._earliestOverlapIndex=E}var G=1;for(var E=0;E<D;E++){var C=this._events.elementAt(E);var B=C.getEnd();G=Math.max(G,E+1);while(G<D){var A=this._events.elementAt(G);var F=A.getStart();if(this._unit.compare(F,B)<0){A._earliestOverlapIndex=E;G++}else{break}}}this._indexed=true};Timeline.EventIndex._Iterator=function(B,A,D,C){this._events=B;this._startDate=A;this._endDate=D;this._unit=C;this._currentIndex=B.find(function(E){return C.compare(E.getStart(),A)});if(this._currentIndex-1>=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex}this._currentIndex--;this._maxIndex=B.find(function(E){return C.compare(E.getStart(),D)});this._hasNext=false;this._next=null;this._findNext()};Timeline.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext},next:function(){if(this._hasNext){var A=this._next;this._findNext();return A}else{return null}},_findNext:function(){var B=this._unit;while((++this._currentIndex)<this._maxIndex){var A=this._events.elementAt(this._currentIndex);if(B.compare(A.getStart(),this._endDate)<0&&B.compare(A.getEnd(),this._startDate)>0){this._next=A;this._hasNext=true;return }}this._next=null;this._hasNext=false}};Timeline.EventIndex._AllIterator=function(A){this._events=A;this._index=0};Timeline.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}};Timeline.HTML=new Object();Timeline.HTML._e2uHash={};(function(){e2uHash=Timeline.HTML._e2uHash;e2uHash.nbsp="\u00A0[space]";e2uHash.iexcl="\u00A1";e2uHash.cent="\u00A2";e2uHash.pound="\u00A3";e2uHash.curren="\u00A4";e2uHash.yen="\u00A5";e2uHash.brvbar="\u00A6";e2uHash.sect="\u00A7";e2uHash.uml="\u00A8";e2uHash.copy="\u00A9";e2uHash.ordf="\u00AA";e2uHash.laquo="\u00AB";e2uHash.not="\u00AC";e2uHash.shy="\u00AD";e2uHash.reg="\u00AE";e2uHash.macr="\u00AF";e2uHash.deg="\u00B0";e2uHash.plusmn="\u00B1";e2uHash.sup2="\u00B2";e2uHash.sup3="\u00B3";e2uHash.acute="\u00B4";e2uHash.micro="\u00B5";e2uHash.para="\u00B6";e2uHash.middot="\u00B7";e2uHash.cedil="\u00B8";e2uHash.sup1="\u00B9";e2uHash.ordm="\u00BA";e2uHash.raquo="\u00BB";e2uHash.frac14="\u00BC";e2uHash.frac12="\u00BD";e2uHash.frac34="\u00BE";e2uHash.iquest="\u00BF";e2uHash.Agrave="\u00C0";e2uHash.Aacute="\u00C1";e2uHash.Acirc="\u00C2";e2uHash.Atilde="\u00C3";e2uHash.Auml="\u00C4";e2uHash.Aring="\u00C5";e2uHash.AElig="\u00C6";e2uHash.Ccedil="\u00C7";e2uHash.Egrave="\u00C8";e2uHash.Eacute="\u00C9";e2uHash.Ecirc="\u00CA";e2uHash.Euml="\u00CB";e2uHash.Igrave="\u00CC";e2uHash.Iacute="\u00CD";e2uHash.Icirc="\u00CE";e2uHash.Iuml="\u00CF";e2uHash.ETH="\u00D0";e2uHash.Ntilde="\u00D1";e2uHash.Ograve="\u00D2";e2uHash.Oacute="\u00D3";e2uHash.Ocirc="\u00D4";e2uHash.Otilde="\u00D5";e2uHash.Ouml="\u00D6";e2uHash.times="\u00D7";e2uHash.Oslash="\u00D8";e2uHash.Ugrave="\u00D9";e2uHash.Uacute="\u00DA";e2uHash.Ucirc="\u00DB";e2uHash.Uuml="\u00DC";e2uHash.Yacute="\u00DD";e2uHash.THORN="\u00DE";e2uHash.szlig="\u00DF";e2uHash.agrave="\u00E0";e2uHash.aacute="\u00E1";e2uHash.acirc="\u00E2";e2uHash.atilde="\u00E3";e2uHash.auml="\u00E4";e2uHash.aring="\u00E5";e2uHash.aelig="\u00E6";e2uHash.ccedil="\u00E7";e2uHash.egrave="\u00E8";e2uHash.eacute="\u00E9";e2uHash.ecirc="\u00EA";e2uHash.euml="\u00EB";e2uHash.igrave="\u00EC";e2uHash.iacute="\u00ED";e2uHash.icirc="\u00EE";e2uHash.iuml="\u00EF";e2uHash.eth="\u00F0";e2uHash.ntilde="\u00F1";e2uHash.ograve="\u00F2";e2uHash.oacute="\u00F3";e2uHash.ocirc="\u00F4";e2uHash.otilde="\u00F5";e2uHash.ouml="\u00F6";e2uHash.divide="\u00F7";e2uHash.oslash="\u00F8";e2uHash.ugrave="\u00F9";e2uHash.uacute="\u00FA";e2uHash.ucirc="\u00FB";e2uHash.uuml="\u00FC";e2uHash.yacute="\u00FD";e2uHash.thorn="\u00FE";e2uHash.yuml="\u00FF";e2uHash.quot="\u0022";e2uHash.amp="\u0026";e2uHash.lt="\u003C";e2uHash.gt="\u003E";e2uHash.OElig="";e2uHash.oelig="\u0153";e2uHash.Scaron="\u0160";e2uHash.scaron="\u0161";e2uHash.Yuml="\u0178";e2uHash.circ="\u02C6";e2uHash.tilde="\u02DC";e2uHash.ensp="\u2002";e2uHash.emsp="\u2003";e2uHash.thinsp="\u2009";e2uHash.zwnj="\u200C";e2uHash.zwj="\u200D";e2uHash.lrm="\u200E";e2uHash.rlm="\u200F";e2uHash.ndash="\u2013";e2uHash.mdash="\u2014";e2uHash.lsquo="\u2018";e2uHash.rsquo="\u2019";e2uHash.sbquo="\u201A";e2uHash.ldquo="\u201C";e2uHash.rdquo="\u201D";e2uHash.bdquo="\u201E";e2uHash.dagger="\u2020";e2uHash.Dagger="\u2021";e2uHash.permil="\u2030";e2uHash.lsaquo="\u2039";e2uHash.rsaquo="\u203A";e2uHash.euro="\u20AC";e2uHash.fnof="\u0192";e2uHash.Alpha="\u0391";e2uHash.Beta="\u0392";e2uHash.Gamma="\u0393";e2uHash.Delta="\u0394";e2uHash.Epsilon="\u0395";e2uHash.Zeta="\u0396";e2uHash.Eta="\u0397";e2uHash.Theta="\u0398";e2uHash.Iota="\u0399";e2uHash.Kappa="\u039A";e2uHash.Lambda="\u039B";e2uHash.Mu="\u039C";e2uHash.Nu="\u039D";e2uHash.Xi="\u039E";e2uHash.Omicron="\u039F";e2uHash.Pi="\u03A0";e2uHash.Rho="\u03A1";e2uHash.Sigma="\u03A3";e2uHash.Tau="\u03A4";e2uHash.Upsilon="\u03A5";e2uHash.Phi="\u03A6";e2uHash.Chi="\u03A7";e2uHash.Psi="\u03A8";e2uHash.Omega="\u03A9";e2uHash.alpha="\u03B1";e2uHash.beta="\u03B2";e2uHash.gamma="\u03B3";e2uHash.delta="\u03B4";e2uHash.epsilon="\u03B5";e2uHash.zeta="\u03B6";e2uHash.eta="\u03B7";e2uHash.theta="\u03B8";e2uHash.iota="\u03B9";e2uHash.kappa="\u03BA";e2uHash.lambda="\u03BB";e2uHash.mu="\u03BC";e2uHash.nu="\u03BD";e2uHash.xi="\u03BE";e2uHash.omicron="\u03BF";e2uHash.pi="\u03C0";e2uHash.rho="\u03C1";e2uHash.sigmaf="\u03C2";e2uHash.sigma="\u03C3";e2uHash.tau="\u03C4";e2uHash.upsilon="\u03C5";e2uHash.phi="\u03C6";e2uHash.chi="\u03C7";e2uHash.psi="\u03C8";e2uHash.omega="\u03C9";e2uHash.thetasym="\u03D1";e2uHash.upsih="\u03D2";e2uHash.piv="\u03D6";e2uHash.bull="\u2022";e2uHash.hellip="\u2026";e2uHash.prime="\u2032";e2uHash.Prime="\u2033";e2uHash.oline="\u203E";e2uHash.frasl="\u2044";e2uHash.weierp="\u2118";e2uHash.image="\u2111";e2uHash.real="\u211C";e2uHash.trade="\u2122";e2uHash.alefsym="\u2135";e2uHash.larr="\u2190";e2uHash.uarr="\u2191";e2uHash.rarr="\u2192";e2uHash.darr="\u2193";e2uHash.harr="\u2194";e2uHash.crarr="\u21B5";e2uHash.lArr="\u21D0";e2uHash.uArr="\u21D1";e2uHash.rArr="\u21D2";e2uHash.dArr="\u21D3";e2uHash.hArr="\u21D4";e2uHash.forall="\u2200";e2uHash.part="\u2202";e2uHash.exist="\u2203";e2uHash.empty="\u2205";e2uHash.nabla="\u2207";e2uHash.isin="\u2208";e2uHash.notin="\u2209";e2uHash.ni="\u220B";e2uHash.prod="\u220F";e2uHash.sum="\u2211";e2uHash.minus="\u2212";e2uHash.lowast="\u2217";e2uHash.radic="\u221A";e2uHash.prop="\u221D";e2uHash.infin="\u221E";e2uHash.ang="\u2220";e2uHash.and="\u2227";e2uHash.or="\u2228";e2uHash.cap="\u2229";e2uHash.cup="\u222A";e2uHash["int"]="\u222B";e2uHash.there4="\u2234";e2uHash.sim="\u223C";e2uHash.cong="\u2245";e2uHash.asymp="\u2248";e2uHash.ne="\u2260";e2uHash.equiv="\u2261";e2uHash.le="\u2264";e2uHash.ge="\u2265";e2uHash.sub="\u2282";e2uHash.sup="\u2283";e2uHash.nsub="\u2284";e2uHash.sube="\u2286";e2uHash.supe="\u2287";e2uHash.oplus="\u2295";e2uHash.otimes="\u2297";e2uHash.perp="\u22A5";e2uHash.sdot="\u22C5";e2uHash.lceil="\u2308";e2uHash.rceil="\u2309";e2uHash.lfloor="\u230A";e2uHash.rfloor="\u230B";e2uHash.lang="\u2329";e2uHash.rang="\u232A";e2uHash.loz="\u25CA";e2uHash.spades="\u2660";e2uHash.clubs="\u2663";e2uHash.hearts="\u2665";e2uHash.diams="\u2666"})();Timeline.HTML.deEntify=function(C){e2uHash=Timeline.HTML._e2uHash;var B=/&(\w+?);/;while(B.test(C)){var A=C.match(B);C=C.replace(B,e2uHash[A[1]])}return C};Timeline.NativeDateUnit=new Object();Timeline.NativeDateUnit.createLabeller=function(A,B){return new Timeline.GregorianDateLabeller(A,B)};Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date()};Timeline.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime())};Timeline.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase()}return(A=="iso8601"||A=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime};Timeline.NativeDateUnit.parseFromObject=function(A){return Timeline.DateTime.parseGregorianDateTime(A)};Timeline.NativeDateUnit.toNumber=function(A){return A.getTime()};Timeline.NativeDateUnit.fromNumber=function(A){return new Date(A)};Timeline.NativeDateUnit.compare=function(D,C){var B,A;if(typeof D=="object"){B=D.getTime()}else{B=Number(D)}if(typeof C=="object"){A=C.getTime()}else{A=Number(C)}return B-A};Timeline.NativeDateUnit.earlier=function(B,A){return Timeline.NativeDateUnit.compare(B,A)<0?B:A};Timeline.NativeDateUnit.later=function(B,A){return Timeline.NativeDateUnit.compare(B,A)>0?B:A};Timeline.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B)};Timeline.ClassicTheme=new Object();Timeline.ClassicTheme.implementations=[];Timeline.ClassicTheme.create=function(A){if(A==null){A=Timeline.Platform.getDefaultLocale()}var B=Timeline.ClassicTheme.implementations[A];if(B==null){B=Timeline.ClassicTheme._Impl}return new B()};Timeline.ClassicTheme._Impl=function(){this.firstDayOfWeek=0;this.ether={backgroundColors:["darkblue"],dateColor:"yellow",highlightColor:"white",highlightOpacity:50,interval:{line:{show:true,color:"#aaa",opacity:25},weekend:{color:"#FFFFE0",opacity:30},marker:{hAlign:"Top",hBottomStyler:function(A){A.className="timeline-ether-marker-bottom"},hBottomEmphasizedStyler:function(A){A.className="timeline-ether-marker-bottom-emphasized"},hTopStyler:function(A){A.className="timeline-ether-marker-top"},hTopEmphasizedStyler:function(A){A.className="timeline-ether-marker-top-emphasized"},vAlign:"Right",vRightStyler:function(A){A.className="timeline-ether-marker-right"},vRightEmphasizedStyler:function(A){A.className="timeline-ether-marker-right-emphasized"},vLeftStyler:function(A){A.className="timeline-ether-marker-left"},vLeftEmphasizedStyler:function(A){A.className="timeline-ether-marker-left-emphasized"}}}};this.event={track:{offset:1.5,height:1.5,gap:0.5},instant:{icon:Timeline.urlPrefix+"images/dull-blue-circle.png",lineColor:"#58A0DC",impreciseColor:"#58A0DC",impreciseOpacity:20,showLineForNoText:true},defaultTagColor:"#ffffcc",defaultTagTextColor:"#000",taggedColors:new Object(),duration:{color:"#58A0DC",opacity:100,impreciseColor:"#58A0DC",impreciseOpacity:20},label:{insideColor:"black",outsideColor:"#fff",width:200},highlightColors:["#FFFF00","#FFC000","#FF0000","#0000FF"],bubble:{width:250,height:125,titleStyler:function(A){A.className="timeline-event-bubble-title"},bodyStyler:function(A){A.className="timeline-event-bubble-body"},imageStyler:function(A){A.className="timeline-event-bubble-image"},wikiStyler:function(A){A.className="timeline-event-bubble-wiki"},timeStyler:function(A){A.className="timeline-event-bubble-time"}}}};Timeline.LinearEther=function(A){this._params=A;this._interval=A.interval;this._pixelsPerInterval=A.pixelsPerInterval};Timeline.LinearEther.prototype.initialize=function(A){this._timeline=A;this._unit=A.getUnit();if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn)}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);this.shiftPixels(-this._timeline.getPixelLength())}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);this.shiftPixels(-this._timeline.getPixelLength()/2)}else{this._start=this._unit.makeDefaultValue();this.shiftPixels(-this._timeline.getPixelLength()/2)}}}};Timeline.LinearEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A)};Timeline.LinearEther.prototype.shiftPixels=function(B){var A=this._interval*B/this._pixelsPerInterval;this._start=this._unit.change(this._start,A)};Timeline.LinearEther.prototype.dateToPixelOffset=function(A){var B=this._unit.compare(A,this._start);return this._pixelsPerInterval*B/this._interval};Timeline.LinearEther.prototype.pixelOffsetToDate=function(B){var A=B*this._interval/this._pixelsPerInterval;return this._unit.change(this._start,A)};Timeline.HotZoneEther=function(A){this._params=A;this._interval=A.interval;this._pixelsPerInterval=A.pixelsPerInterval};Timeline.HotZoneEther.prototype.initialize=function(G){this._timeline=G;this._unit=G.getUnit();this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}];var H=this._params;for(var E=0;E<H.zones.length;E++){var B=H.zones[E];var D=this._unit.parseFromObject(B.start);var F=this._unit.parseFromObject(B.end);for(var C=0;C<this._zones.length&&this._unit.compare(F,D)>0;C++){var A=this._zones[C];if(this._unit.compare(D,A.endTime)<0){if(this._unit.compare(D,A.startTime)>0){this._zones.splice(C,0,{startTime:A.startTime,endTime:D,magnify:A.magnify});C++;A.startTime=D}if(this._unit.compare(F,A.endTime)<0){this._zones.splice(C,0,{startTime:D,endTime:F,magnify:B.magnify*A.magnify});C++;A.startTime=F;D=F}else{A.magnify*=B.magnify;D=A.endTime}}}}if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn)}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);this.shiftPixels(-this._timeline.getPixelLength())}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);this.shiftPixels(-this._timeline.getPixelLength()/2)}else{this._start=this._unit.makeDefaultValue();this.shiftPixels(-this._timeline.getPixelLength()/2)}}}};Timeline.HotZoneEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A)};Timeline.HotZoneEther.prototype.shiftPixels=function(A){this._start=this.pixelOffsetToDate(A)};Timeline.HotZoneEther.prototype.dateToPixelOffset=function(A){return this._dateDiffToPixelOffset(this._start,A)};Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(A){return this._pixelOffsetToDate(A,this._start)};Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(I,D){var B=this._getScale();var H=I;var C=D;var A=0;if(this._unit.compare(H,C)<0){var G=0;while(G<this._zones.length){if(this._unit.compare(H,this._zones[G].endTime)<0){break}G++}while(this._unit.compare(H,C)<0){var E=this._zones[G];var F=this._unit.earlier(C,E.endTime);A+=(this._unit.compare(F,H)/(B/E.magnify));H=F;G++}}else{var G=this._zones.length-1;while(G>=0){if(this._unit.compare(H,this._zones[G].startTime)>0){break}G--}while(this._unit.compare(H,C)>0){var E=this._zones[G];var F=this._unit.later(C,E.startTime);A+=(this._unit.compare(F,H)/(B/E.magnify));H=F;G--}}return A};Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(H,C){var G=this._getScale();var E=C;if(H>0){var F=0;while(F<this._zones.length){if(this._unit.compare(E,this._zones[F].endTime)<0){break}F++}while(H>0){var A=this._zones[F];var D=G/A.magnify;if(A.endTime==Number.POSITIVE_INFINITY){E=this._unit.change(E,H*D);H=0}else{var B=this._unit.compare(A.endTime,E)/D;if(B>H){E=this._unit.change(E,H*D);H=0}else{E=A.endTime;H-=B}}F++}}else{var F=this._zones.length-1;while(F>=0){if(this._unit.compare(E,this._zones[F].startTime)>0){break}F--}H=-H;while(H>0){var A=this._zones[F];var D=G/A.magnify;if(A.startTime==Number.NEGATIVE_INFINITY){E=this._unit.change(E,-H*D);H=0}else{var B=this._unit.compare(E,A.startTime)/D;if(B>H){E=this._unit.change(E,-H*D);H=0}else{E=A.startTime;H-=B}}F--}}return E};Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval};Timeline.GregorianEtherPainter=function(A){this._params=A;this._theme=A.theme;this._unit=A.unit;this._multiple=("multiple" in A)?A.multiple:1};Timeline.GregorianEtherPainter.prototype.initialize=function(C,B){this._band=C;this._timeline=B;this._backgroundLayer=C.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[C.getIndex()];this._markerLayer=null;this._lineLayer=null;var D=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.GregorianEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B)};Timeline.GregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.color=this._theme.ether.interval.marker.color;this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var C=this._band.getMinDate();var F=this._band.getMaxDate();var B=this._band.getTimeZone();var E=this._band.getLabeller();Timeline.DateTime.roundDownToInterval(C,this._unit,B,1,this._theme.firstDayOfWeek);var D=this;var A=function(G){for(var H=0;H<D._multiple;H++){Timeline.DateTime.incrementByInterval(G,D._unit)}};while(C.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(C,E,this._unit,this._markerLayer,this._lineLayer);A(C)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.GregorianEtherPainter.prototype.softPaint=function(){};Timeline.YearCountEtherPainter=function(A){this._params=A;this._theme=A.theme;this._startDate=Timeline.DateTime.parseGregorianDateTime(A.startDate);this._multiple=("multiple" in A)?A.multiple:1};Timeline.YearCountEtherPainter.prototype.initialize=function(C,B){this._band=C;this._timeline=B;this._backgroundLayer=C.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[C.getIndex()];this._markerLayer=null;this._lineLayer=null;var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.YearCountEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B)};Timeline.YearCountEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.style.color="red";this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var B=new Date(this._startDate.getTime());var F=this._band.getMaxDate();var E=this._band.getMinDate().getUTCFullYear()-this._startDate.getUTCFullYear();B.setUTCFullYear(this._band.getMinDate().getUTCFullYear()-E%this._multiple);var C=this;var A=function(G){for(var H=0;H<C._multiple;H++){Timeline.DateTime.incrementByInterval(G,Timeline.DateTime.YEAR)}};var D={labelInterval:function(G,I){var H=G.getUTCFullYear()-C._startDate.getUTCFullYear();H=1;return{text:1,emphasized:H==0}}};while(B.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,Timeline.DateTime.YEAR,this._markerLayer,this._lineLayer);A(B)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.YearCountEtherPainter.prototype.softPaint=function(){};Timeline.QuarterlyEtherPainter=function(A){this._params=A;this._theme=A.theme;this._startDate=Timeline.DateTime.parseGregorianDateTime(A.startDate)};Timeline.QuarterlyEtherPainter.prototype.initialize=function(C,B){this._band=C;this._timeline=B;this._backgroundLayer=C.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.style.background=this._theme.ether.backgroundColors[C.getIndex()];this._markerLayer=null;this._lineLayer=null;var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.QuarterlyEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B)};Timeline.QuarterlyEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.color="red";this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var B=new Date(0);var E=this._band.getMaxDate();B.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(),this._band.getMinDate().getUTCFullYear()));B.setUTCMonth(this._startDate.getUTCMonth());var C=this;var A=function(F){F.setUTCMonth(F.getUTCMonth()+3)};var D={labelInterval:function(F,H){var G=(4+(F.getUTCMonth()-C._startDate.getUTCMonth())/3)%4;if(G!=0){return{text:"Q"+(G+1),emphasized:false}}else{return{text:"Y"+(F.getUTCFullYear()-C._startDate.getUTCFullYear()+1),emphasized:true}}}};while(B.getTime()<E.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,Timeline.DateTime.YEAR,this._markerLayer,this._lineLayer);A(B)}this._markerLayer.style.display="block";this._lineLayer.style.display="block"};Timeline.QuarterlyEtherPainter.prototype.softPaint=function(){};Timeline.EtherIntervalMarkerLayout=function(M,L,C,E,H){var A=M.isHorizontal();if(A){if(E=="Top"){this.positionDiv=function(O,N){O.style.left=N+"px";O.style.top="0px"}}else{this.positionDiv=function(O,N){O.style.left=N+"px";O.style.bottom="0px"}}}else{if(E=="Left"){this.positionDiv=function(O,N){O.style.top=N+"px";O.style.left="0px"}}else{this.positionDiv=function(O,N){O.style.top=N+"px";O.style.right="0px"}}}var D=C.ether.interval.marker;var I=C.ether.interval.line;var B=C.ether.interval.weekend;var K=(A?"h":"v")+E;var G=D[K+"Styler"];var J=D[K+"EmphasizedStyler"];var F=Timeline.DateTime.gregorianUnitLengths[Timeline.DateTime.DAY];this.createIntervalMarker=function(T,d,e,f,Q){var U=Math.round(L.dateToPixelOffset(T));if(H&&e!=Timeline.DateTime.WEEK){var V=M.getDocument().createElement("div");V.style.position="absolute";if(I.opacity<100){Timeline.Graphics.setOpacity(V,I.opacity)}if(A){V.style.borderLeft="1px solid "+I.color;V.style.left=U+"px";V.style.width="1px";V.style.top="0px";V.style.height="100%"}else{V.style.borderTop="1px solid "+I.color;V.style.top=U+"px";V.style.height="1px";V.style.left="0px";V.style.width="100%"}Q.appendChild(V)}if(e==Timeline.DateTime.WEEK){var N=C.firstDayOfWeek;var W=new Date(T.getTime()+(6-N-7)*F);var Z=new Date(W.getTime()+2*F);var X=Math.round(L.dateToPixelOffset(W));var S=Math.round(L.dateToPixelOffset(Z));var R=Math.max(1,S-X);var P=M.getDocument().createElement("div");P.style.position="absolute";P.style.background=B.color;if(B.opacity<100){Timeline.Graphics.setOpacity(P,B.opacity)}if(A){P.style.left=X+"px";P.style.width=R+"px";P.style.top="0px";P.style.height="100%"}else{P.style.top=X+"px";P.style.height=R+"px";P.style.left="0px";P.style.width="100%"}Q.appendChild(P)}var Y=d.labelInterval(T,e);var O=M.getDocument().createElement("div");O.innerHTML=Y.text;O.style.position="absolute";(Y.emphasized?J:G)(O);this.positionDiv(O,U);f.appendChild(O);return O}};Timeline.EtherHighlight=function(C,E,D,B){var A=C.isHorizontal();this._highlightDiv=null;this._createHighlightDiv=function(){if(this._highlightDiv==null){this._highlightDiv=C.getDocument().createElement("div");this._highlightDiv.setAttribute("name","ether-highlight");this._highlightDiv.style.position="absolute";this._highlightDiv.style.background=D.ether.highlightColor;var F=D.ether.highlightOpacity;if(F<100){Timeline.Graphics.setOpacity(this._highlightDiv,F)}B.appendChild(this._highlightDiv)}};this.position=function(F,I){this._createHighlightDiv();var J=Math.round(E.dateToPixelOffset(F));var H=Math.round(E.dateToPixelOffset(I));var G=Math.max(H-J,3);if(A){this._highlightDiv.style.left=J+"px";this._highlightDiv.style.width=G+"px";this._highlightDiv.style.top="2px";this._highlightDiv.style.height=(E.getViewWidth()-4)+"px"}else{this._highlightDiv.style.top=J+"px";this._highlightDiv.style.height=G+"px";this._highlightDiv.style.left="2px";this._highlightDiv.style.width=(E.getViewWidth()-4)+"px"}}};Timeline.GregorianDateLabeller=function(A,B){this._locale=A;this._timeZone=B};Timeline.GregorianDateLabeller.monthNames=[];Timeline.GregorianDateLabeller.dayNames=[];Timeline.GregorianDateLabeller.labelIntervalFunctions=[];Timeline.GregorianDateLabeller.getMonthName=function(B,A){return Timeline.GregorianDateLabeller.monthNames[A][B]};Timeline.GregorianDateLabeller.prototype.labelInterval=function(A,C){var B=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale];if(B==null){B=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval}return B.call(this,A,C)};function twoDigitNum(A){A=A+"";return(A.length==1?"0":"")+A}Timeline.GregorianDateLabeller.prototype.labelPrecise=function(E,F){var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var G=["Sun","Mon","Tue","Wed","Thur","Fri","Sat"];var D=A[E.getUTCMonth()]+" "+E.getUTCDate()+", "+E.getUTCFullYear();if(F){var B=E.getUTCHours();var C=B>=12?"pm":"am";if(B>12){B-=12}if(B==0){B=12}D+=" "+B+":"+twoDigitNum(E.getUTCMinutes())+C}return D;return Timeline.DateTime.removeTimeZoneOffset(E,this._timeZone).toUTCString()};Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(B,F){var C;var E=false;B=Timeline.DateTime.removeTimeZoneOffset(B,this._timeZone);switch(F){case Timeline.DateTime.MILLISECOND:C=B.getUTCMilliseconds();break;case Timeline.DateTime.SECOND:C=B.getUTCSeconds();break;case Timeline.DateTime.MINUTE:var A=B.getUTCMinutes();if(A==0){C=B.getUTCHours()+":00";E=true}else{C=A}break;case Timeline.DateTime.HOUR:C=B.getUTCHours()+"hr";break;case Timeline.DateTime.DAY:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate();break;case Timeline.DateTime.WEEK:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate();break;case Timeline.DateTime.MONTH:var A=B.getUTCMonth();if(A!=0){C=Timeline.GregorianDateLabeller.getMonthName(A,this._locale);break}else{E=true}case Timeline.DateTime.YEAR:case Timeline.DateTime.DECADE:case Timeline.DateTime.BIDECADE:case Timeline.DateTime.CENTURY:case Timeline.DateTime.MILLENNIUM:var D=B.getUTCFullYear();if(D>0){C=B.getUTCFullYear()}else{C=(1-D)+"BC"}E=(F==Timeline.DateTime.MONTH)||((F==Timeline.DateTime.DECADE||F==Timeline.DateTime.BIDECADE)&&D%100==0)||(F==Timeline.DateTime.CENTURY&&D%1000==0);break;default:C=B.toUTCString()}if(Timeline.startZeroMode){C-=1900}return{text:C,emphasized:E}};g_isBubbleShowing=false;function associateObjWithEvent(B,A){return(function(C){C=C||window.event;return B[A](C,this)})}function go(A){document.location="/"+A}g_pics="";cachedEvents=new Object();data="";function associateObjWithEvent(B,A){return(function(C){return B[A](C)})}Timeline.DefaultEventSource=function(A){this._events=(A instanceof Object)?A:new Timeline.EventIndex();this._listeners=[]};Timeline.DefaultEventSource.prototype.addListener=function(A){this._listeners.push(A)};Timeline.DefaultEventSource.prototype.removeListener=function(B){for(var A=0;A<this._listeners.length;A++){if(this._listeners[A]==B){this._listeners.splice(A,1);break}}};Timeline.DefaultEventSource.prototype.loadOneJSON=function(D){var C=this.getEvent(D.id);if(C!=null){this.remove(C)}var B=this._events.getUnit().getParser("iso8601");var E=B(D.end);if(D.type=="o"){E=new Date()}var A=new Timeline.DefaultEventSource.Event(D.imagecount,D.videocount,D.hasText,D.id,D.timeline_id,B(D.start),E,B(D.latestStart),B(D.earliestEnd),D.type=="i",D.title,D.description,D.image,D.link,D.icon,D.color,D.textColor,D.type,D.use_time,D.category,D.category_id,D.isSharing,D.isParticipating,D.participants,B(D.zstart),B(D.zend));A._obj=D;A.getProperty=function(F){return this._obj[F]};A.setWikiInfo(null,null);this._events.add(A);this._fire("onAddOne",[A]);return A};Timeline.DefaultEventSource.prototype.getEarliestEventDate=function(){return this.earliestEventDate};Timeline.DefaultEventSource.prototype.loadJSON=function(G,B){var C=this._getBaseURL(B);var L=false;if(G&&G.events){var K=("wikiURL" in G)?G.wikiURL:null;var N=("wikiSection" in G)?G.wikiSection:null;var E=("dateTimeFormat" in G)?G.dateTimeFormat:null;var H=this._events.getUnit().getParser(E);for(var F=0;F<G.events.length;F++){var A=G.events[F];var I=H(A.end);var D=H(A.start);var J=H(A.zend);if(!this.earliestEventDate||D<this.earliestEventDate){this.earliestEventDate=D}if(A.type=="o"){I=new Date()}var M=new Timeline.DefaultEventSource.Event(A.imagecount,A.videocount,A.hasText,A.id,A.timeline_id,D,I,H(A.latestStart),H(A.earliestEnd),A.type!="d"&&A.type!="o",A.title,A.description,this._resolveRelativeURL(A.image,C),this._resolveRelativeURL(A.link,C),this._resolveRelativeURL(A.icon,C),A.color,A.textColor,A.type,A.use_time,A.category,A.category_id,A.isSharing,A.isParticipating,A.participants,H(A.zstart),J);M._obj=A;M.getProperty=function(O){return this._obj[O]};M.setWikiInfo(K,N);this._events.add(M);L=true}}if(L){this._fire("onAddMany",[])}};Timeline.DefaultEventSource.prototype.getEvent=function(B){var C=this.getAllEventIterator();while(C.hasNext()){var A=C.next();if(A.getID()==B){return A}}return null};Timeline.DefaultEventSource.prototype.remove=function(A){this._events.remove(A);this._fire("onRemoveOne",[A])};Timeline.DefaultEventSource.prototype.add=function(A){this._events.add(A);this._fire("onAddOne",[A])};Timeline.DefaultEventSource.prototype.addMany=function(B){for(var A=0;A<B.length;A++){this._events.add(B[A])}this._fire("onAddMany",[])};Timeline.DefaultEventSource.prototype.clear=function(){this._events.removeAll();this._fire("onClear",[])};Timeline.DefaultEventSource.prototype.getEventIterator=function(A,B){return this._events.getIterator(A,B)};Timeline.DefaultEventSource.prototype.getChronoAllEventIterator=function(){return this._events.getChronoAllIterator()};Timeline.DefaultEventSource.prototype.getChronoEvents=function(){return this._events.getChronoEvents()};Timeline.DefaultEventSource.prototype.getAllEventIterator=function(){return this._events.getAllIterator()};Timeline.DefaultEventSource.prototype.getCount=function(){return this._events.getCount()};Timeline.DefaultEventSource.prototype.getEarliestDate=function(){return this._events.getEarliestDate()};Timeline.DefaultEventSource.prototype.getLatestDate=function(){return this._events.getLatestDate()};Timeline.DefaultEventSource.prototype._fire=function(B,A){for(var C=0;C<this._listeners.length;C++){var D=this._listeners[C];if(B in D){try{D[B].apply(D,A)}catch(E){Timeline.Debug.exception(E)}}}};Timeline.DefaultEventSource.prototype._getBaseURL=function(A){if(A.indexOf("://")<0){var C=this._getBaseURL(document.location.href);if(A.substr(0,1)=="/"){A=C.substr(0,C.indexOf("/",C.indexOf("://")+3))+A}else{A=C+A}}var B=A.lastIndexOf("/");if(B<0){return""}else{return A.substr(0,B+1)}};Timeline.DefaultEventSource.prototype._resolveRelativeURL=function(A,B){if(A==null||A==""){return A}else{if(A.indexOf("://")>0){return A}else{if(A.substr(0,1)=="/"){return B.substr(0,B.indexOf("/",B.indexOf("://")+3))+A}else{return B+A}}}};Timeline.DefaultEventSource.Event=function(V,N,J,R,O,F,D,Y,P,A,L,T,M,I,W,S,E,C,U,Q,H,Z,X,B,G,K){this._imageCount=V;this._videoCount=N;this._hasText=J;this._id=R;this._tlid=O;this._catid=H;this._instant=A;this._start=F;if(this._instant){this._end=(D!=null)?D:F}else{this._end=(D!=null)?D:new Date()}this._category=Q;this._latestStart=(Y!=null)?Y:(A?this._end:this._start);this._earliestEnd=(P!=null)?P:(A?this._start:this._end);this._use_time=U;this._text=Timeline.HTML.deEntify(L);this._description=Timeline.HTML.deEntify(T);this._image=(M!=null&&M!="")?M:null;this._link=(I!=null&&I!="")?I:null;this._icon=(W!=null&&W!="")?W:null;this._color=(S!=null&&S!="")?S:null;this._textColor=(E!=null&&E!="")?E:null;this._type=(C!=null&&C!="")?C:null;this._wikiURL=null;this._wikiSection=null;this._isSharing=Z;this._isParticipating=X;this._participants=B;this._zstart=G;this._zend=K;if(this._instant){this._zend=(K!=null)?K:G}else{this._zend=(K!=null)?K:new Date()}};Timeline.DefaultEventSource.Event.prototype={getIsSharing:function(){return this._isSharing},getIsParticipating:function(){return this._isParticipating},getParticipants:function(){return this._participants},getImageCount:function(){return this._imageCount},getVideoCount:function(){return this._videoCount},getHasText:function(){return this._hasText},getID:function(){return this._id},getUID:function(){return this._tlid+"-"+this._id},getTimelineID:function(){return this._tlid},getUseTime:function(){return this._use_time==1},getHasContent:function(){return this.getHasText()||this.getImageCount()>0||this.getVideoCount()>0},isInstant:function(){return this._instant},isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd},getCategory:function(){return this._category},getCategoryID:function(){return this._catid},getStart:function(){if(Timeline.startZeroMode){return this._zstart}return this._start},getEnd:function(){if(Timeline.startZeroMode){return this._zend}return this._end},getLatestStart:function(){return this._latestStart},getEarliestEnd:function(){return this._earliestEnd},getText:function(){return this._text},getType:function(){return this._type},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},getLabel:function(){return this._label},setLabel:function(A){this._label=A},getZStart:function(){return this._zstart},setZend:function(A){this._zend=A},getZEnd:function(){return this._zend},setZStart:function(A){this._zstart=A},getUIElement:function(){return this._uiElement},setUIElement:function(A){this._uiElement=A},getProperty:function(A){return null},getWikiURL:function(){return this._wikiURL},getWikiSection:function(){return this._wikiSection},setWikiInfo:function(B,A){this._wikiURL=B;this._wikiSection=A},fillDescription:function(C){var A="tid="+this._tlid+"&eid="+this._id;var D=function(E){alert(E.statusText)};var B=function(E){C.innerHTML=E.responseText};new Ajax.Request("/cmd/Content",{method:"post",postBody:A,onSuccess:B,onFailure:D})},fillTime:function(A,B){if(this._instant){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start,this._use_time==1)))}else{if(this.getType()=="d"){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start,this._use_time==1)));A.appendChild(A.ownerDocument.createTextNode(" - "));A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end,this._use_time==1)))}else{if(this.getType()=="o"){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start,this._use_time==1)));A.appendChild(A.ownerDocument.createTextNode(" - Now"))}}}},formatDate:function(G,E,H,B){var D=Timeline.DateTime.parseIso8601DateTime;var F=D(H);var C=D(B);var A="m/dd/yy"+(E=="1"?" h:MMtt":"");if(G=="i"){return F.format(A)}else{if(G=="d"){return F.format(A)+" - "+C.format(A)}else{if(G=="o"){return F.format(A)+" - Now"}}}},createInfoBubble:function(H,G,L,C,J,K,A,D,I){var F={x:H,y:G,band:L,theme:C,labeller:J,evt:K,isEdit:A,cbFunc:D,cbArg:I};data=F;if(cachedEvents[this._id]){this.handleEvent(cachedEvents[this._id])}else{if(typeof (window.tlMinYear)!="undefined"){var E=new Object();E.rcode=1;for(var B=0;B<events.events.length;B++){K=events.events[B];if(K.id==data.evt.getID()){E.event=[K]}}this.handleEvent(E)}else{$.post("/cmd/Content/get",{tid:this._tlid,eid:data.evt.getID(),p:data.evt.getIsParticipating()},associateObjWithEvent(this,"responseSuccess"))}}},waitForLoad:function(){if(this.eventRes.imgCount>this.eventRes.imgLoaded){setTimeout(associateObjWithEvent(this,"waitForLoad"),500);return }this.handleEvent(this.eventRes)},responseSuccess:function(data){var res=eval("("+data+")");if(res.rcode==1){var pics=res.event[0].pics;res.imgCount=pics.length;res.imgLoaded=0;for(var i=0;i<pics.length;i++){var pic=pics[i];pic.loaded=false;pic.error=false;pic.img=new Image();pic.img.src=pic.thumburl;if(pic.img.complete){res.imgLoaded++}else{pic.img.onload=function(){res.imgLoaded++};pic.img.onerror=function(){res.imgLoaded++}}}cachedEvents[res.event[0].id]=res;this.eventRes=res;this.waitForLoad()}},handleEvent:function(n){if(n.event[0].subevts){for(var q=0;q<n.event[0].subevts.length;q++){var AF=n.event[0].subevts[q];n.event.push(AF)}}var AR=Client.viewportHeight();var Y=data.x;var X=data.y;var K=data.band;var s=data.theme;var AT=data.labeller;var D=data.evt;var AS=data.cbFunc;var AY=data.cbArg;bubbledEvent=D.getID();var AQ=data.isEdit;if(n.rcode==1){var AX=400;var e=200;var r=200;var Ah=K.openBubbleForPoint(Y,X,AX,r,D);Ah.parentNode.id="bubContent";var C=Builder.node("div",{style:"float:left",id:"innerContent"});Ah.appendChild(C);var AE=Ah;Ah=C;var AG=Builder.node("div",{style:"border:1px solid #333;overflow:auto;float:left;display:none;margin-left:10px;height:350px;width:248px;background-color:#000",id:"cmtHolder"});AE.appendChild(AG);g_pics=new Object();var j="#333";if(s.ether.background=="#000"||s.ether.background=="#000000"){j="#191919"}var S=Ah.ownerDocument;var N=this.getText();var J=this.getLink();var AU=this.getImage();if(AU!=null){var t=S.createElement("img");t.src=AU;s.event.bubble.imageStyler(t);Ah.appendChild(t)}var AC=S.createElement("div");var g=S.createTextNode(entity(N));if(J!=null){var v=S.createElement("a");v.href=J;v.appendChild(g);AC.appendChild(v)}else{AC.appendChild(g)}s.event.bubble.titleStyler(AC);AE.insertBefore(AC,AE.firstChild);var A=S.createElement("div");this.fillTime(A,AT);s.event.bubble.timeStyler(A);var P=Builder.node("div",{});jQuery(P).append("<div style='float:right;font-size:11px;cursor:pointer'><span id='FullEventMode2'>&nbsp;&nbsp;<span class='postcommentlink' id='hideCommentsText'>[Add/Show Comments]</span></span></div>");P.appendChild(A);AE.insertBefore(P,AE.firstChild.nextSibling);if(n.event.length>1){var Q=Builder.node("div",{id:"subeventtimeline",style:"position:relative;width:500px"},[Builder.node("div",{id:"rightdate",style:"float:right;color:#fff;font-size:11px"}),Builder.node("div",{id:"leftdate",style:"float:left;color:#fff;font-size:11px"}),Builder.node("div",{id:"middate",style:"text-align:center;color:#fff;font-size:11px"}),subEHld=Builder.node("div",{id:"subeholder",style:"background-color:"+j+";position:relative;clear:both;margin:15px auto;margin-top:5px;width:440px"})]);Ah.appendChild(Q)}for(var o=0;o<n.event.length;o++){var m=n.event[o];var Ak=Ah;if(o>0){var u=this.formatDate(m.type,m.use_time,m.start,m.end);Ak=Builder.node("div",{style:"background-color:"+j+";margin-top:10px;padding:5px;clear:both;border:0px solid #ddd"},[Builder.node("div",{"class":"sub-evt-time"},u),Builder.node("div",{"class":"sub-evt-title"},m.title),subBod=Builder.node("div",{"class":"sub-evt-body"})]);subBod.innerHTML=m.description;Ah.appendChild(Ak)}else{var AP=S.createElement("div");AP.innerHTML=m.description;s.event.bubble.bodyStyler(AP);Ak.appendChild(AP)}var Af=S.createElement("div");Af.className="eventPictures";var Ai=m.pics;if(AK){var AK=m.imageOrder;var AI=AK.split(",");AI.reverse();function Aa(k,h){var d=AI.indexOf(k.id);var p=AI.indexOf(h.id);return((d<p)?1:((d>p)?-1:0))}Ai.sort(Aa)}for(var q=0;q<Ai.length;q++){var Ae=Ai[q];Ae.isParticipant=D.getIsParticipating();Ae.timeline_id=D.getTimelineID();if(Ae.type==0){var AL=null;g_pics[Ae.id]=Ae;var t=Builder.node("div",{"class":"imthumb",style:"float:left;margin-right:5px"},[J=Builder.node("a",{id:"mid"+Ae.id,rel:"test",href:Ae.url,"class":"thickbox"},[AL=Builder.node("img",{"class":"imgchild",style:"margin:4px",src:Ae.thumburl,title:Ae.caption,alt:""})])]);Af.appendChild(t)}else{g_pics[Ae.id]=Ae;var AL=null;var t=Builder.node("div",{"class":"ytthumb",style:"float:left;margin-right:5px",id:Ae.id},[Builder.node("img",{src:"/0/images/filmstrip3.png"}),AL=Builder.node("img",{"class":"imgchildyt",src:Ae.thumburl,title:Ae.caption,alt:""}),Builder.node("img",{src:"/0/images/filmstrip3.png"})]);jQuery(t).click(function(){var d=this.id;var h=g_pics[d];createWindow(h.caption,h.url,h.id,D.getTimelineID(),bubbledEvent,h.isParticipant)});Af.appendChild(t)}}Ak.appendChild(Af);Ak.appendChild(Builder.node("div",{style:"height:10px;clear:both"}));if(m.sources){Ak.appendChild(Builder.node("div",{"class":"sourcesDiv"},"Sources: "+m.sources))}}if(D.getIsParticipating()||D.getIsSharing()){var Ad=Builder.node("div",{style:"margin-top:10px;clear:both;background-color:#A9A9A9;color:#000;padding:5px"},[Builder.node("span",{},"People sharing event"),Builder.node("br")]);var I=Builder.node("div",{style:"margin-top:3px"});var Ag=D.getParticipants();for(var q=0;q<Ag.length;q++){var l=Ag[q]+"";var Aj=memberBag[l];var t=Builder.node("div",{style:"float:left;padding-left:5px",id:Aj.urlkey},[AL=Builder.node("img",{title:Aj.name,style:"cursor:pointer;width:auto;height:40px",src:Aj.thumburl,alt:""})]);AL.setAttribute("onclick","go('"+Aj.urlkey.escapeStr()+"')");jQuery(AL).Tooltip({delay:0,track:true,event:"click",showURL:false});I.appendChild(t)}I.appendChild(Builder.node("div",{style:"height:10px;clear:both"}));Ad.appendChild(I);Ah.appendChild(Ad)}}var AN=ViewJS.getChrono();var AZ=AN.indexOfEvt(D.getID());var H=AN.length();var f=false;var AO=false;for(var q=AZ-1;q>=0;q--){var D=AN.elementAt(q);if(D.getHasContent()){f=true;break}}for(var q=AZ+1;q<H;q++){var D=AN.elementAt(q);if(D.getHasContent()){AO=true;break}}if(AO||f){var V=Builder.node("div",{style:"margin-top:10px;clear:both;text-align:right;color:#fff;padding:5px"});if(f){var AD=Builder.node("span",{"class":"prevnextbtn"},"< Prev");$(AD).click(function(d){ViewJS.bubblePrev()});V.appendChild(AD)}if(AO){var AD=Builder.node("span",{"class":"prevnextbtn"},"Next >");$(AD).click(function(d){ViewJS.bubbleNext()});V.appendChild(AD)}Ah.appendChild(V)}var M=X+Ah.offsetHeight+30;if(M>AR){var R=M-AR;X-=R;if(X<0){X=0}}var Ac=Ah.parentNode.parentNode.parentNode;Ac.style.visibility="hidden";Ac.style.zIndex="100";Ac.id="topbubble";Ac.style.color="#fff";AC.style.fontSize="14px";var AM=Client.viewportHeight();Ac.firstChild.style.position="absolute";var AH=Builder.node("div",{"class":"popupBubble",id:"bubbleCover"});Ac.firstChild.style.height=Ac.style.height;Ac.firstChild.style.zIndex=101;if(!AX||AX==0){AX=500}AH.style.width=Ac.style.width;AH.style.position="absolute";AH.style.border="1px solid #aaa";if(s.ether.background=="#000"||s.ether.background=="#000000"){AH.style.backgroundColor="#333";$("div.arrcomp").css("background-color","#333")}Ac.appendChild(AH);jQuery(AH).corner();var D=this;var AJ=D.getUIElement();var Ab=findPos(AJ);var E=Client.viewable();Ac.style.top=(Ab[1]-10)+"px";var L=jQuery(AJ).offset();var AX=jQuery(AJ).width();var O=jQuery(AJ).height();var G=$(window).width()/2;var AW=L.left;var W=AW>G;var T=0;var F=0;var AB=parseInt(L.top+(O/2)-12);if(W){$D("rightarrow").style.top=AB+"px";T=Ab[0]-14;$D("rightarrow").style.left=T+"px";$D("rightarrow").style.visibility="visible";var AG=$("#cmtHolder").get(0);AG.style.marginRight="10px";AG.style.marginLeft="0px";var U=$("#innerContent").get(0);var AV=AG.parentNode;AV.insertBefore(AG,U)}else{$D("leftarrow").style.top=AB+"px";T=(Ab[0]+AX+3);if(T<E.left){F=E.left-T+3;T+=F}$D("leftarrow").style.left=T+"px";$D("leftarrow").style.visibility="visible"}var Al=D.getID();var AA=D.getIsParticipating();$("#FullEventMode2").click(function(d){if(AG.style.display=="none"){AG.style.display="block";$D("hideCommentsText").innerHTML="[Hide Comments]";var k=parseInt($D("bubbleCover").style.width)+270;$D("bubbleCover").style.width=k+"px";AE.style.width=(parseInt(AE.style.width)+270)+"px";($("#bubcloser")[0]).style.left=(k-20)+"px";if(W){var h=$D("topbubble");h.style.left=(parseInt(h.style.left)-270)+"px"}$("#cmtHolder").load("/cmd/Tcomment",{ptcp:AA,type:"event",tlid:D.getTimelineID(),eid:Al});B()}else{if(AG.style.display=="block"){AG.style.display="none";$D("hideCommentsText").innerHTML="[Add/Show Comments]";var k=parseInt($D("bubbleCover").style.width)-270;$D("bubbleCover").style.width=k+"px";AE.style.width=(parseInt(AE.style.width)-270)+"px";($("#bubcloser")[0]).style.left=(k-20)+"px";if(W){var h=$D("topbubble");h.style.left=(parseInt(h.style.left)+270)+"px"}}}});function B(){var d=parseInt(Ac.firstChild.offsetWidth);var An=parseInt(Ac.firstChild.offsetHeight);var Am=Client.viewable();var Ap=new Object();Ap.top=parseInt(Ac.style.top);Ap.left=parseInt(Ac.style.left);Ap.bottom=Ap.top+parseInt(An);Ap.right=Ap.left+parseInt(d);if(Am.left>Ap.left||Am.right<Ap.right){var p=parseInt(AH.style.width);var y=Am.left;var Ao=Am.right;var h=Am.right-Am.left;var k=Math.round(h/2);var x=Math.round(p/2);var w=y+k-x;if(w<Am.left){w=Am.left+10}Ac.style.left=w+"px";$("#rightarrow")[0].style.visibility="hidden";$("#leftarrow")[0].style.visibility="hidden"}}function Z(){var An=document.getElementById("bubContent");var d=parseInt(Ac.firstChild.offsetWidth);var Aq=parseInt(Ac.firstChild.offsetHeight);if(Aq>500){Ac.firstChild.lastChild.style.width="600px";Ac.lastChild.style.width="630px";d=parseInt(Ac.firstChild.offsetWidth)}var k=n.event.slice(1);if(k.length>0){var Ar=d-30;Q.style.width=Ar+"px";subEHld.style.width=(Ar-60)+"px";createMiniTimelineWithDate(Ar-60,D.getType(),D.getUseTime(),D.getStart(),D.getEnd(),k,$(subEHld))}Ah.style.width=(d-25)+"px";var Aq=An.offsetHeight-10;if(Aq<250){Aq=250}AH.style.height=Aq+"px";var x=(Aq-60);AG.style.height=x+"px";($("#bubcloser")[0]).style.left=(d-20)+"px";var Am=jQuery(Ac).offset();var Ao=Am.top;var p=Ao+parseInt(Ac.firstChild.offsetHeight);var w=0;var y=Ao+parseInt(AH.style.height);if(y>E.bottom-40){w=y-E.bottom+40;var h=y-w;var Ap=h-AB;if(Ap<22){w=y-(AB+22)}}(function(){var A2=Ao-w;var A0=(A2)+"px";var Aw=0;if(W){Aw=(L.left-d-15)+"px";jQuery("#TB_CommentBox").css({top:A2+"px",left:(parseInt(Aw)-300)+"px"})}else{Aw=(L.left+AX+15+F)+"px"}Ac.style.top=A0;Ac.style.left=Aw;var Ay=Client.viewable();var A3=new Object();A3.top=parseInt(A0);A3.left=parseInt(Aw);A3.bottom=A3.top+parseInt(Aq);A3.right=A3.left+parseInt(d);if(Ay.top>A3.top){var Az=Ay.top+10;if(Az>AB){Az=AB}Ac.style.top=Az+"px"}if(Ay.left>A3.left||Ay.right<A3.right){var Au=parseInt(AH.style.width);var Ax=Ay.left;var A1=Ay.right;var As=Ay.right-Ay.left;var At=Math.round(As/2);var Av=Math.round(Au/2);var Aw=Ax+At-Av;if(Aw<Ay.left){Aw=Ay.left+10}Ac.style.left=Aw+"px";$("#rightarrow")[0].style.visibility="hidden";$("#leftarrow")[0].style.visibility="hidden"}})();Ac.style.visibility="visible"}Z();tb_init("a.thickbox");if(AS!=null){AS(AY)}},fillInfoBubble:function(A,E,J,M){var K=A.ownerDocument;var I=this.getText();var G=this.getLink();var C=this.getImage();if(C!=null){var D=K.createElement("img");D.src=C;E.event.bubble.imageStyler(D);A.appendChild(D)}var L=K.createElement("div");var B=K.createTextNode(entity(I));if(G!=null){var H=K.createElement("a");H.href=G;H.appendChild(B);L.appendChild(H)}else{L.appendChild(B)}E.event.bubble.titleStyler(L);A.appendChild(L);var F=K.createElement("div");this.fillTime(F,J);E.event.bubble.timeStyler(F);A.appendChild(F);var N=K.createElement("div");this.fillDescription(N);E.event.bubble.bodyStyler(N);A.appendChild(N)},positionBubble:function(H,I){var A=I.parentNode.parentNode;A.style.color="#fff";var B=Client.viewportHeight();A.firstChild.style.position="absolute";var V=Builder.node("div",{"class":"popupBubble"});A.firstChild.style.height=A.style.height;A.firstChild.style.zIndex=1002;P=500;V.style.width=A.style.width;V.style.position="absolute";V.style.border="1px solid #aaa";V.style.backgroundColor="#333";$("div.arrcomp").css("background-color","#333");A.appendChild(V);jQuery(V).corner();var L=this;var W=$(".timeline-container").offset();var K=W.top+5;var J=W.top+$(".timeline-container").height()-5;var T=jQuery(A).offset().top;var Q=T+parseInt(A.firstChild.offsetHeight);var U=0;if(Q>J){U=Q-J}var S=parseInt(A.firstChild.offsetHeight);var R=$("#subeventtimeline").get(0).offsetHeight;S+=parseInt(tls);V.style.height=S+"px";var N=parseInt(A.firstChild.offsetWidth);var F=jQuery(H).offset();var P=jQuery(H).width();var M=jQuery(H).height();var C=$(window).width()/2;var G=F.left;var D=G>C;(function(){var d=F.top-16;var Z=(d)+"px";var Y=(F.left+P+15)+"px";if(D){Y=(F.left-N-15)+"px"}A.style.top=Z;A.style.left=Y})();var X=F.top+(M/2)-12;if(D){var O=jQuery(A).offset().left;var P=jQuery(A).width();var E=O+P;$D("rightarrow").style.top=X+"px";$D("rightarrow").style.left=(E+1)+"px";$D("rightarrow").style.visibility="visible"}else{var O=jQuery(A).offset().left;var P=jQuery(A).width();var E=O-45;$D("leftarrow").style.top=X+"px";$D("leftarrow").style.left=(E+1)+"px";$D("leftarrow").style.visibility="visible"}}};Timeline.StaticTrackBasedLayout=function(B){this._eventSource=B.eventSource;this._ether=B.ether;this._theme=B.theme;this._maxDetail=B.maxDetail;this._showText=("showText" in B)?B.showText:true;this._laidout=false;this._tracks=[];var A=this;if(this._eventSource!=null){this._eventSource.addListener({onAddMany:function(){A._laidout=false}})}};Timeline.StaticTrackBasedLayout.prototype.initialize=function(A){this._timeline=A};Timeline.StaticTrackBasedLayout.prototype.getDividers=function(){return this._dividers};Timeline.StaticTrackBasedLayout.prototype.getTrack=function(A){if(!this._laidout){this._tracks=[];this._dividers=new Array();this._layout();this._laidout=true}return this._tracks[A.getUID()]};Timeline.StaticTrackBasedLayout.prototype.getTrackCount=function(){if(!this._laidout){this._tracks=[];this._layout();this._dividers=new Array();this._laidout=true}return this._trackCount};Timeline.StaticTrackBasedLayout.prototype._layout=function(){if(this._eventSource==null){return }this._dividers=new Array();var N=[Number.NEGATIVE_INFINITY];var B=[Number.NEGATIVE_INFINITY];var H=this;var I=this._showText;var E=this._theme;var M=E.event;var G=this._maxDetail;var C=function(O,S,Q,R){var P=S-1;if(O.isImprecise()){P=Q}if(I){P=Math.max(P,S+M.label.width)}return P};var A=function(X,U,O,R){if(X.isImprecise()){var Q=X.getStart();var W=X.getEnd();var T=Math.round(H._ether.dateToPixelOffset(Q));var V=Math.round(H._ether.dateToPixelOffset(W))}else{var T=U;var V=O}var S=V;var P=Math.max(V-T,1);if(I){if(P<M.label.width){S=V+M.label.width}}return S};var J=function(P){var O=P.getStart();var T=P.getEnd();var V=Math.round(H._ether.dateToPixelOffset(O));var Q=Math.round(H._ether.dateToPixelOffset(T));var U=0;for(;U<N.length;U++){if(N[U]!=-1&&(N[U]<V&&(B[U]==Number.NEGATIVE_INFINITY||B[U]==P.getTimelineID()))){break}else{}}if(U>=N.length){N.push(Number.NEGATIVE_INFINITY);B.push(Number.NEGATIVE_INFINITY)}var S=(M.track.offset+U*(M.track.height+M.track.gap))+"em";B[U]=P.getTimelineID();if(U>0&&B[U]!=B[U-1]){var R=new Object();R.tid=P.getTimelineID();R.track=U;R.offset=S;H._dividers.push(R);N[U]=-1;B[U]=P.getTimelineID();U++;B[U]=P.getTimelineID()}H._tracks[P.getUID()]=U;if(P.isInstant()){N[U]=C(P,V,Q,S)}else{N[U]=A(P,V,Q,S)}};var F=this._eventSource.getAllEventIterator();var L;while(F.hasNext()){var K=F.next();if(!M.taggedColors[K.getTimelineID()][K.getCategoryID()].isVisible){continue}L=K;J(K)}this._trackCount=N.length;if(K){var D=new Object();D.tid=K.getTimelineID();D.track=this._trackCount;H._dividers.push(D)}};g_isBubbleShowing=false;function makeTall(){}function makeShort(){}Timeline.DurationEventPainter=function(A){this._params=A;this._theme=A.theme;this._layout=A.layout;this._showText=A.showText;this._maxDetail=A.maxDetail;this._showLineForNoText=("showLineForNoText" in A)?A.showLineForNoText:A.theme.event.instant.showLineForNoText;this._filterMatcher=null;this._highlightMatcher=null};Timeline.DurationEventPainter.prototype.initialize=function(B,A){this._band=B;this._timeline=A;this._layout.initialize(B,A);this._eventLayer=null;this._highlightLayer=null};Timeline.DurationEventPainter.prototype.getLayout=function(){return this._layout};Timeline.DurationEventPainter.prototype.setLayout=function(A){this._layout=A};Timeline.DurationEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher};Timeline.DurationEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A};Timeline.DurationEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher};Timeline.DurationEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A};Timeline.DurationEventPainter.prototype.paintDividers=function(I){var E=this._params.theme;var M=E.event;var B=M.track.offset;var L=("trackHeight" in this._params)?this._params.trackHeight:M.track.height;var A=("trackGap" in this._params)?this._params.trackGap:M.track.gap;var G=getElementsByClassName("seperator_box");for(var F=0;F<G.length;F++){G[F].parentNode.removeChild(G[F])}var G=getElementsByClassName("timeline_label");for(var F=0;F<G.length;F++){G[F].parentNode.removeChild(G[F])}var D=this._layout.getDividers();if(!D){return }if(D.length==1){return }var K="0em";for(var F=0;F<D.length;F++){var C=(B+(D[F].track+1)*(L+A))-((L)/2)+"em";var H=document.createElement("div");H.className="seperator_box";H.style.top=C;if(timelineArray.length>1){var J=document.createElement("div");J.className="timeline_label";J.style.top=parseFloat(K)+"em";I.appendChild(J)}I.appendChild(H);K=C}};Timeline.DurationEventPainter.prototype.hideCrossHair=function(){$D("topLeftDate").style.visibility="hidden";$D("topRightDate").style.visibility="hidden";$D("bottomLeftDate").style.visibility="hidden";$D("bottomRightDate").style.visibility="hidden";$D("crosshair1").style.visibility="hidden";$D("crosshair2").style.visibility="hidden"};function formatdate(B){var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return A[B.getUTCMonth()]+" "+B.getUTCDate()+", "+B.getUTCFullYear()}Timeline.DurationEventPainter.prototype.paint=function(){var V=this._band.getEventSource();if(V==null){return }if(this._highlightLayer!=null){this._band.removeLayerDiv(this._highlightLayer)}if(this._eventLayer!=null){this._band.removeLayerDiv(this._eventLayer)}this._eventLayer=this._band.createLayerDiv(110);this._eventLayer.setAttribute("name","events");this._eventLayer.style.display="none";var E=document.createElement("div");E.style.position="absolute";E.style.overflow="hidden";E.style.top="0px";E.style.height="100%";E.style.left=10+"px";E.style.width=1+"px";E.style.borderLeft="1px dotted #aaa";E.style.visibility="hidden";E.style.zIndex=10000;E.id="crosshair1";this._eventLayer.appendChild(E);var D=document.createElement("div");D.style.position="absolute";D.style.overflow="hidden";D.style.top="0px";D.style.height="100%";D.style.left=10+"px";D.style.width=1+"px";D.style.borderRight="1px dotted #aaa";D.style.visibility="hidden";D.style.zIndex=10000;D.id="crosshair2";this._eventLayer.appendChild(D);jQuery(this._eventLayer).mouseout(function(h){var g=h.target;if(g.className=="durationEvent"||g.className=="durationLabel"||g.className=="instantEvent"){E.style.visibility="hidden";D.style.visibility="hidden";$D("topLeftDate").style.visibility="hidden";$D("topRightDate").style.visibility="hidden";$D("bottomLeftDate").style.visibility="hidden";$D("bottomRightDate").style.visibility="hidden"}});jQuery(this._eventLayer).mouseover(function(AB){showIt=false;var AC=AB.target;var AE=g_isBubbleShowing!="undefined"&&!g_isBubbleShowing;if(AE&&(AC.className=="durationEvent"||AC.className=="durationLabel")){var v=V.getEvent(AC.id);var n=v.getStart();var k=Math.round(P._band.dateToPixelOffset(n));var AA=v.getEnd();var h=Math.round(P._band.dateToPixelOffset(AA));E.style.left=k+"px";D.style.left=h+"px";if(Timeline.startZeroMode==false){var g=v.getStart();var j=formatdate(g);var q=v.getEnd();var t=formatdate(q);$D("topLeftDate").innerHTML=j;$D("topRightDate").innerHTML=t;$D("bottomLeftDate").innerHTML=j;$D("bottomRightDate").innerHTML=t}else{$D("topLeftDate").innerHTML="";$D("topRightDate").innerHTML="";$D("bottomLeftDate").innerHTML="";$D("bottomRightDate").innerHTML=""}var s=parseInt($D("topLeftDate").offsetWidth)/2;$D("topLeftDate").style.left=(jQuery(E).offset().left-s)+"px";$D("topRightDate").style.left=(jQuery(D).offset().left-s)+"px";$D("bottomLeftDate").style.left=(jQuery(E).offset().left-s)+"px";$D("bottomRightDate").style.left=(jQuery(D).offset().left-s)+"px";var p=jQuery($D("topLeftDate")).offset();var y=p.left+$D("topLeftDate").offsetWidth;var w=jQuery($D("topRightDate")).offset().left;var u=w-y;if(u<20){var m=(20-u)/2;$D("topLeftDate").style.left=(p.left-m)+"px";$D("topRightDate").style.left=(w+m)+"px";$D("bottomLeftDate").style.left=(p.left-m)+"px";$D("bottomRightDate").style.left=(w+m)+"px"}showIt=true;E.style.visibility="visible";D.style.visibility="visible";$D("topLeftDate").style.visibility="visible";$D("bottomLeftDate").style.visibility="visible";$D("topRightDate").style.visibility="visible";$D("bottomRightDate").style.visibility="visible"}else{if(AE&&AC.className=="instantEvent"){var v=V.getEvent(AC.id);var n=v.getStart();var k=Math.round(P._band.dateToPixelOffset(n));var o=k;E.style.left=o+"px";if(Timeline.startZeroMode==false){var AD=v.getStart();var x=formatdate(AD);$D("topLeftDate").innerHTML=x;$D("bottomLeftDate").innerHTML=x}else{$D("topLeftDate").innerHTML="";$D("bottomLeftDate").innerHTML=""}var s=parseInt($D("topLeftDate").offsetWidth)/2;$D("topLeftDate").style.left=(jQuery(E).offset().left-s)+"px";$D("bottomLeftDate").style.left=(jQuery(E).offset().left-s)+"px";E.style.visibility="visible";D.style.visibility="hidden";$D("topRightDate").style.visibility="hidden";$D("bottomRightDate").style.visibility="hidden";$D("topLeftDate").style.visibility="visible";$D("bottomLeftDate").style.visibility="visible"}else{E.style.visibility="hidden";D.style.visibility="hidden";$D("topLeftDate").style.visibility="hidden";$D("topRightDate").style.visibility="hidden";$D("bottomLeftDate").style.visibility="hidden";$D("bottomRightDate").style.visibility="hidden"}}});var I=this._band.getMinDate();var J=this._band.getMaxDate();var f=this._timeline.getDocument();var P=this;var Y=this._eventLayer;var R=0;var N=this._band;var B=this._showText;var d=this._maxDetail;var Z=this._params.theme;var U=Z.event;var T=U.track.offset;var C=("trackHeight" in this._params)?this._params.trackHeight:U.track.height;var X=("trackGap" in this._params)?this._params.trackGap:U.track.gap;var F=function(g,l){var j=U.taggedColors[g.getTimelineID()][g.getCategoryID()].color;var k=U.taggedColors[g.getTimelineID()][g.getCategoryID()].textColor;if(!j){j=U.defaultTagColor;k=U.defaultTagTextColor}var h=f.createElement("img");h.style.background=j;h.style.border="1px solid #000";h.className="instantEvent";h.id=g.getID();h.src="/0/images/instant.gif";l.appendChild(h);l.className="instantEvent";l.id=g.getID();g.setUIElement(h);if(g.getHasContent()||g_isEditMode){l.style.cursor="pointer";$(l).click(function(){P._onClickInstantEvent(h,l,g)})}};var W=function(g,m,l,k,j){if(g>=0){var h=U.highlightColors[Math.min(g,U.highlightColors.length-1)];var n=f.createElement("div");n.style.position="absolute";n.style.overflow="hidden";n.style.left=(m-3)+"px";n.style.width=(l+6)+"px";n.style.top=k+"em";n.style.height=j+"em";n.style.background=h;highlightLayer.appendChild(n)}};var H=function(g,j){if(g.getImageCount()>0){var h=document.createElement("img");h.src="/0/images/picture.gif";h.className="imgIcon";j.appendChild(h)}if(g.getVideoCount()>0){var h=document.createElement("img");h.src="/0/images/video.gif";h.className="imgIcon";j.appendChild(h)}if(g.getIsParticipating()||g.getIsSharing()){var h=document.createElement("img");h.src="/0/images/share.gif";h.className="imgIcon";j.appendChild(h)}};var Q=function(t,p,g,m,l,s,r){var j=f.createElement("div");j.style.position="absolute";j.style.overflow="hidden";Y.appendChild(j);var q=t.getTextColor();var h=t.getColor();var o=-4;var k=16;if(B){j.style.color=U.label.outsideColor;F(t,j);var n=f.createElement("span");n.className="instantEvent";n.id=t.getID();n.setAttribute("style","");var u=document.createElement("span");u.className="instantEvent";u.id=t.getID();if(t.getHasContent()){u.setAttribute("style","text-decoration:underline")}n.style.marginLeft="3px";u.appendChild(document.createTextNode(entity(t.getText())));n.appendChild(u);H(t,n);t.setLabel(n);j.appendChild(n)}else{if(P._showLineForNoText){j.style.width="1px";j.style.borderLeft="1px solid "+(h!=null?h:U.instant.lineColor);o=0;k=1}else{F(t,j)}}j.style.top=m;j.style.height=C+"em";j.style.left=(p+o)+"px";W(l,(p+o),k,s,r)};var K=function(p,k,g,n,r,u,j){var v=function(AA){AA.style.cursor="pointer";AA.style.textDecoration="underline";AA.style.fontWeight="bold";$(AA).click(function(){P._onClickDurationEvent(new Object(),p,AA)})};var l=Math.max(g-k,1);var o=k;var y=g;var h=p.getTextColor();var x=true;if(o<=y){l=Math.max(y-o,1);x=!(l>U.label.width);div=f.createElement("div");div.style.position="absolute";div.style.overflow="hidden";div.className="durationEvent";div.id=p.getID();div.style.top=n;div.style.height=C+"em";div.style.left=o+"px";div.style.width=l+"px";var t=p.getColor();var q=U.taggedColors[p.getTimelineID()][p.getCategoryID()].color;var m=blackOrWhite(q);if(!q){q=U.defaultTagColor;m=U.defaultTagTextColor}div.style.background=q;div.style.color=m;if(U.duration.opacity<100){Timeline.Graphics.setOpacity(div,U.duration.opacity)}Y.appendChild(div)}else{var w=o;o=y;y=w}p.setUIElement(div);if(p.getHasContent()||g_isEditMode){v(div)}if(B){var s=f.createElement("div");s.style.position="absolute";s.className="durationLabel";s.id=p.getID();s.style.top=n;s.style.height=C+"em";s.style.left=((l>U.label.width)?o:y)+"px";if(!x){s.style.color=m}else{s.style.color=U.label.outsideColor}s.style.overflow="hidden";s.appendChild(document.createTextNode(entity(p.getText())));p.setLabel(s);H(p,s);Y.appendChild(s);if(p.getHasContent()||g_isEditMode){v(s)}}W(r,k,g-k,u,j)};var S=function(j,h){var g=j.getStart();var m=j.getEnd();var n=Math.round(P._band.dateToPixelOffset(g));var k=Math.round(P._band.dateToPixelOffset(m));var l=(T+P._layout.getTrack(j,N.getIndex())*(C+X));if(j.isInstant()){Q(j,n,k,l+"em",h,l-X,C+2*X)}else{K(j,n,k,l+"em",h,l-X,C+2*X)}if(l+C>R){R=l+C}};var e=(this._filterMatcher!=null)?this._filterMatcher:function(g){return true};var M=(this._highlightMatcher!=null)?this._highlightMatcher:function(g){return -1};var O=V.getAllEventIterator();var A=100000;var G=-100000;while(O.hasNext()){var L=O.next();if(!U.taggedColors[L.getTimelineID()][L.getCategoryID()].isVisible){continue}if(e(L)){S(L,M(L))}}R+=10;if(R<40){R=40}setHeight(R);this._eventLayer.style.display="block"};g_isBubbleShowing=false;Timeline.DurationEventPainter.prototype.softPaint=function(){};Timeline.DurationEventPainter.prototype.showBubble=function(A,E,D){this.hideCrossHair();var B=A.getUIElement();var C=Timeline.DOM.getPageCoordinates(B);this._showBubble(C.left+Math.ceil(B.offsetWidth/2),C.top+Math.ceil(B.offsetHeight/2),A,E,D)};Timeline.DurationEventPainter.prototype._onClickInstantEvent=function(B,C,A){C.cancelBubble=true;var D=Timeline.DOM.getPageCoordinates(B);this._showBubble(D.left+Math.ceil(B.offsetWidth/2),D.top+Math.ceil(B.offsetHeight/2),A)};Timeline.DurationEventPainter.prototype._onClickDurationEvent=function(C,B,D){C.cancelBubble=true;if("pageX" in C){var A=C.pageX;var F=C.pageY}else{var E=Timeline.DOM.getPageCoordinates(D);var A=C.offsetX+E.left;var F=C.offsetY+E.top}this._showBubble(A,F,B)};Timeline.DurationEventPainter.prototype._showBubble=function(A,E,B,D,C){g_isBubbleShowing=true;this.hideCrossHair();if(this._timeline.isEditMode()){if(B.getIsParticipating()){$(".eventButton").css({display:"none"});$(".shareButton").css({display:"none"})}else{$(".eventButton").css({display:""});$(".shareButton").css({display:""})}editEventContent(B.getID(),B.getTimelineID(),B.getIsParticipating())}else{B.createInfoBubble(A,E,this._band,this._theme,this._band.getLabeller(),B,this._timeline.isEditMode(),D,C)}};Timeline.SpanHighlightDecorator=function(A){this._unit=("unit" in A)?A.unit:Timeline.NativeDateUnit;this._startDate=(typeof A.startDate=="string")?this._unit.parseFromObject(A.startDate):A.startDate;this._endDate=(typeof A.endDate=="string")?this._unit.parseFromObject(A.endDate):A.endDate;this._startLabel=A.startLabel;this._endLabel=A.endLabel;this._color=A.color;this._opacity=("opacity" in A)?A.opacity:100};Timeline.SpanHighlightDecorator.prototype.initialize=function(B,A){this._band=B;this._timeline=A;this._layerDiv=null};Timeline.SpanHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv)}this._layerDiv=this._band.createLayerDiv(10);this._layerDiv.setAttribute("name","span-highlight-decorator");this._layerDiv.style.display="none";var E=this._band.getMinDate();var C=this._band.getMaxDate();if(this._unit.compare(this._startDate,C)<0&&this._unit.compare(this._endDate,E)>0){E=this._unit.later(E,this._startDate);C=this._unit.earlier(C,this._endDate);var D=this._band.dateToPixelOffset(E);var I=this._band.dateToPixelOffset(C);var G=this._timeline.getDocument();var F=function(){var J=G.createElement("table");J.insertRow(0).insertCell(0);return J};var B=G.createElement("div");B.style.position="absolute";B.style.overflow="hidden";B.style.background=this._color;if(this._opacity<100){Timeline.Graphics.setOpacity(B,this._opacity)}this._layerDiv.appendChild(B);var H=F();H.style.position="absolute";H.style.overflow="hidden";H.style.fontSize="300%";H.style.fontWeight="bold";H.style.color=this._color;H.rows[0].cells[0].innerHTML=this._startLabel;this._layerDiv.appendChild(H);var A=F();A.style.position="absolute";A.style.overflow="hidden";A.style.fontSize="300%";A.style.fontWeight="bold";A.style.color=this._color;A.rows[0].cells[0].innerHTML=this._endLabel;this._layerDiv.appendChild(A);if(this._timeline.isHorizontal()){B.style.left=D+"px";B.style.width=(I-D)+"px";B.style.top="0px";B.style.height="100%";H.style.right=(this._band.getTotalViewLength()-D)+"px";H.style.width=(this._startLabel.length)+"em";H.style.top="0px";H.style.height="100%";H.style.textAlign="right";A.style.left=I+"px";A.style.width=(this._endLabel.length)+"em";A.style.top="0px";A.style.height="100%"}else{B.style.top=D+"px";B.style.height=(I-D)+"px";B.style.left="0px";B.style.width="100%";H.style.bottom=D+"px";H.style.height="1.5px";H.style.left="0px";H.style.width="100%";A.style.top=I+"px";A.style.height="1.5px";A.style.left="0px";A.style.width="100%"}}this._layerDiv.style.display="block"};Timeline.SpanHighlightDecorator.prototype.softPaint=function(){};Timeline.PointHighlightDecorator=function(A){this._unit=("unit" in A)?A.unit:Timeline.NativeDateUnit;this._date=(typeof A.date=="string")?this._unit.parseFromObject(A.date):A.date;this._width=("width" in A)?A.width:10;this._color=A.color;this._opacity=("opacity" in A)?A.opacity:100};Timeline.PointHighlightDecorator.prototype.initialize=function(B,A){this._band=B;this._timeline=A;this._layerDiv=null};Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv)}this._layerDiv=this._band.createLayerDiv(10);this._layerDiv.setAttribute("name","span-highlight-decorator");this._layerDiv.style.display="none";var C=this._band.getMinDate();var E=this._band.getMaxDate();if(this._unit.compare(this._date,E)<0&&this._unit.compare(this._date,C)>0){var B=this._band.dateToPixelOffset(this._date);var A=B-Math.round(this._width/2);var D=this._timeline.getDocument();var F=D.createElement("div");F.style.position="absolute";F.style.overflow="hidden";F.style.background=this._color;if(this._opacity<100){Timeline.Graphics.setOpacity(F,this._opacity)}this._layerDiv.appendChild(F);if(this._timeline.isHorizontal()){F.style.left=A+"px";F.style.width=this._width+"px";F.style.top="0px";F.style.height="100%"}else{F.style.top=A+"px";F.style.height=this._width+"px";F.style.left="0px";F.style.width="100%"}}this._layerDiv.style.display="block"};Timeline.PointHighlightDecorator.prototype.softPaint=function(){};Timeline.LabelDecorator=function(A){this._unit=("unit" in A)?A.unit:Timeline.NativeDateUnit;this._date=(typeof A.date=="string")?this._unit.parseFromObject(A.date):A.date;this._width=("width" in A)?A.width:10;this._color=A.color;this._opacity=("opacity" in A)?A.opacity:100};Timeline.LabelDecorator.prototype.initialize=function(B,A){this._band=B;this._timeline=A;this._layerDiv=null};Timeline.LabelDecorator.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="display";this._layerDiv.style.border="1px solid black";this._layerDiv.style.height="200px";this._layerDiv.style.width="100%";this._layerDiv.innerHTML="AAAA"};Timeline.LabelDecorator.prototype.softPaint=function(){};Timeline.strings.en={wikiLinkLabel:"Discuss"};Timeline.GregorianDateLabeller.monthNames.en=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];