(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.4",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(deep,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(array.constructor!=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};jQuery.each(["Height","Width"],function(i,name){var tl=name=="Height"?"Top":"Left",br=name=="Height"?"Bottom":"Right";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br)};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(!!margin?num(this,"margin"+tl)+num(this,"margin"+br):0)}});function num(elem,prop){elem=elem.jquery?elem[0]:elem;return elem&&parseInt(jQuery.curCSS(elem,prop,true))||0}})();JS={extend:function(B,A){A=A||{};for(var C in A){if(B[C]===A[C]){continue}B[C]=A[C]}return B},makeFunction:function(){return function(){return this.initialize?(this.initialize.apply(this,arguments)||this):this}},makeBridge:function(B){var A=function(){};A.prototype=B.prototype;return new A},delegate:function(B,A){return function(){return this[B][A].apply(this[B],arguments)}},bind:function(){var B=JS.array(arguments),A=B.shift(),C=B.shift()||null;return function(){return A.apply(C,B.concat(JS.array(arguments)))}},callsSuper:function(A){return A.SUPER===undefined?A.SUPER=/\bcallSuper\b/.test(A.toString()):A.SUPER},mask:function(B){var A=B.toString().replace(/callSuper/g,"super");B.toString=function(){return A};return B},array:function(B){if(!B){return[]}if(B.toArray){return B.toArray()}var A=B.length,C=[];while(A--){C[A]=B[A]}return C},indexOf:function(B,A){for(var D=0,C=B.length;D<C;D++){if(B[D]===A){return D}}return -1},isFn:function(A){return A instanceof Function},ignore:function(B,A){return/^(include|extend)$/.test(B)&&typeof A==="object"}};JS.Module=JS.makeFunction();JS.extend(JS.Module.prototype,{initialize:function(B,A){A=A||{};this.__mod__=this;this.__inc__=[];this.__fns__={};this.__dep__=[];this.__res__=A._1||null;this.include(B||{})},define:function(B,A,D){D=D||{};this.__fns__[B]=A;if(JS.Module._0&&D._0&&JS.isFn(A)){JS.Module._0(B,D._0)}var C=this.__dep__.length;while(C--){this.__dep__[C].resolve()}},instanceMethod:function(B){var A=this.lookup(B).pop();return JS.isFn(A)?A:null},include:function(J,I,H){if(!J){return H&&this.resolve()}I=I||{};var G=J.include,E=J.extend,F,D,A,B,C=I._4||this;if(J.__inc__&&J.__fns__){this.__inc__.push(J);J.__dep__.push(this);if(I._2){J.extended&&J.extended(I._2)}else{J.included&&J.included(C)}}else{if(I._5){for(B in J){if(JS.ignore(B,J[B])){continue}this.define(B,J[B],{_0:C||I._2||this})}}else{if(typeof G==="object"){F=[].concat(G);for(D=0,A=F.length;D<A;D++){C.include(F[D],I)}}if(typeof E==="object"){F=[].concat(E);for(D=0,A=F.length;D<A;D++){C.extend(F[D],false)}C.extend()}I._5=true;return C.include(J,I,H)}}H&&this.resolve()},includes:function(B){if(Object===B||this===B||this.__res__===B.prototype){return true}var A=this.__inc__.length;while(A--){if(this.__inc__[A].includes(B)){return true}}return false},ancestors:function(B){B=B||[];for(var A=0,E=this.__inc__.length;A<E;A++){this.__inc__[A].ancestors(B)}var D=(this.__res__||{}).klass,C=(D&&this.__res__===D.prototype)?D:this;if(JS.indexOf(B,C)===-1){B.push(C)}return B},lookup:function(B){var A=this.ancestors(),F=[],E,C,D;for(E=0,C=A.length;E<C;E++){D=A[E].__mod__.__fns__[B];if(D){F.push(D)}}return F},make:function(B,A){if(!JS.isFn(A)||!JS.callsSuper(A)){return A}var C=this;return function(){return C.chain(this,B,arguments)}},chain:JS.mask(function(H,G,E){var F=this.lookup(G),D=F.length,A=H.callSuper,B=JS.array(E),C;H.callSuper=function(){var J=arguments.length;while(J--){B[J]=arguments[J]}D-=1;var I=F[D].apply(H,B);D+=1;return I};C=H.callSuper();A?H.callSuper=A:delete H.callSuper;return C}),resolve:function(B){var B=B||this,A=B.__res__,F,E,C,D;if(B===this){F=this.__dep__.length;while(F--){this.__dep__[F].resolve()}}if(!A){return }for(F=0,E=this.__inc__.length;F<E;F++){this.__inc__[F].resolve(B)}for(C in this.__fns__){D=B.make(C,this.__fns__[C]);if(A[C]!==D){A[C]=D}}}});JS.ObjectMethods=new JS.Module({__eigen__:function(){if(this.__meta__){return this.__meta__}var A=this.__meta__=new JS.Module({},{_1:this});A.include(this.klass.__mod__);return A},extend:function(B,A){return this.__eigen__().include(B,{_2:this},A!==false)},isA:function(A){return this.__eigen__().includes(A)},method:function(B){var A=this,C=A.__mcache__=A.__mcache__||{};if((C[B]||{}).fn===A[B]){return C[B].bd}return(C[B]={fn:A[B],bd:JS.bind(A[B],A)}).bd}});JS.Class=JS.makeFunction();JS.extend(JS.Class.prototype=JS.makeBridge(JS.Module),{initialize:function(B,A){var C=JS.extend(JS.makeFunction(),this);C.klass=C.constructor=this.klass;if(!JS.isFn(B)){A=B;B=Object}C.inherit(B);C.include(A,null,false);C.resolve();do{B.inherited&&B.inherited(C)}while(B=B.superclass);return C},inherit:function(B){this.superclass=B;if(this.__eigen__){this.__eigen__().include(B.__eigen__?B.__eigen__():new JS.Module(B.prototype));this.__meta__.resolve()}this.subclasses=[];(B.subclasses||[]).push(this);var A=this.prototype=JS.makeBridge(B);A.klass=A.constructor=this;this.__mod__=new JS.Module({},{_1:this.prototype});this.include(JS.ObjectMethods,null,false);if(B!==Object){this.include(B.__mod__||new JS.Module(B.prototype,{_1:B.prototype}),null,false)}},include:function(B,A,D){if(!B){return }var C=this.__mod__,A=A||{};A._4=this;return C.include(B,A,D!==false)},extend:function(B){if(!this.callSuper){return }this.callSuper();var A=this.subclasses.length;while(A--){this.subclasses[A].extend()}},define:function(){var A=this.__mod__;A.define.apply(A,arguments);A.resolve()},includes:JS.delegate("__mod__","includes"),ancestors:JS.delegate("__mod__","ancestors"),resolve:JS.delegate("__mod__","resolve")});JS.Module=JS.extend(new JS.Class(JS.Module.prototype),JS.ObjectMethods.__fns__);JS.Module.include(JS.ObjectMethods);JS.Class=JS.extend(new JS.Class(JS.Module,JS.Class.prototype),JS.ObjectMethods.__fns__);JS.Module.klass=JS.Module.constructor=JS.Class.klass=JS.Class.constructor=JS.Class;JS.Module.extend({_3:[],methodAdded:function(B,A){this._3.push([B,A])},_0:function(B,A){var D=this._3,C=D.length;while(C--){D[C][0].call(D[C][1]||null,B,A)}}});JS.extend(JS,{Interface:new JS.Class({initialize:function(A){this.test=function(C,B){var D=A.length;while(D--){if(!JS.isFn(C[A[D]])){return B?A[D]:false}}return true}},extend:{ensure:function(){var B=JS.array(arguments),A=B.shift(),D,C;while(D=B.shift()){C=D.test(A,true);if(C!==true){throw new Error("object does not implement "+C+"()")}}}}}),Singleton:new JS.Class({initialize:function(B,A){return new (new JS.Class(B,A))}})});if(!window.CanvasRenderingContext2D){(function(){var N=Math;var O=N.round;var L=N.sin;var U=N.cos;var A=10;var I=A/2;var G={init:function(W){var X=W||document;if(/MSIE/.test(navigator.userAgent)&&!window.opera){var V=this;X.attachEvent("onreadystatechange",function(){V.init_(X)})}},init_:function(Y){if(Y.readyState=="complete"){if(!Y.namespaces.g_vml_){Y.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml")}var X=Y.createStyleSheet();X.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}";var W=Y.getElementsByTagName("canvas");for(var V=0;V<W.length;V++){if(!W[V].getContext){this.initElement(W[V])}}}},fixElement_:function(X){var Z=X.outerHTML;var Y=X.ownerDocument.createElement(Z);if(Z.slice(-2)!="/>"){var V="/"+X.tagName;var W;while((W=X.nextSibling)&&W.tagName!=V){W.removeNode()}if(W){W.removeNode()}}X.parentNode.replaceChild(Y,X);return Y},initElement:function(W){W=this.fixElement_(W);W.getContext=function(){if(this.context_){return this.context_}return this.context_=new J(this)};W.attachEvent("onpropertychange",T);W.attachEvent("onresize",B);var V=W.attributes;if(V.width&&V.width.specified){W.style.width=V.width.nodeValue+"px"}else{W.width=W.clientWidth}if(V.height&&V.height.specified){W.style.height=V.height.nodeValue+"px"}else{W.height=W.clientHeight}return W}};function T(W){var V=W.srcElement;switch(W.propertyName){case"width":V.style.width=V.attributes.width.nodeValue+"px";V.getContext().clearRect();break;case"height":V.style.height=V.attributes.height.nodeValue+"px";V.getContext().clearRect();break}}function B(W){var V=W.srcElement;if(V.firstChild){V.firstChild.style.width=V.clientWidth+"px";V.firstChild.style.height=V.clientHeight+"px"}}G.init();var D=[];for(var R=0;R<16;R++){for(var Q=0;Q<16;Q++){D[R*16+Q]=R.toString(16)+Q.toString(16)}}function K(){return[[1,0,0],[0,1,0],[0,0,1]]}function E(Y,X){var W=K();for(var V=0;V<3;V++){for(var b=0;b<3;b++){var Z=0;for(var a=0;a<3;a++){Z+=Y[V][a]*X[a][b]}W[V][b]=Z}}return W}function P(W,V){V.fillStyle=W.fillStyle;V.lineCap=W.lineCap;V.lineJoin=W.lineJoin;V.lineWidth=W.lineWidth;V.miterLimit=W.miterLimit;V.shadowBlur=W.shadowBlur;V.shadowColor=W.shadowColor;V.shadowOffsetX=W.shadowOffsetX;V.shadowOffsetY=W.shadowOffsetY;V.strokeStyle=W.strokeStyle;V.arcScaleX_=W.arcScaleX_;V.arcScaleY_=W.arcScaleY_}function C(W){var Z,Y=1;W=String(W);if(W.substring(0,3)=="rgb"){var b=W.indexOf("(",3);var V=W.indexOf(")",b+1);var a=W.substring(b+1,V).split(",");Z="#";for(var X=0;X<3;X++){Z+=D[Number(a[X])]}if((a.length==4)&&(W.substr(3,1)=="a")){Y=a[3]}}else{Z=W}return[Z,Y]}function M(V){switch(V){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function J(W){this.m_=K();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=A*1;this.globalAlpha=1;this.canvas=W;var V=W.ownerDocument.createElement("div");V.style.width=W.clientWidth+"px";V.style.height=W.clientHeight+"px";V.style.overflow="hidden";V.style.position="absolute";W.appendChild(V);this.element_=V;this.arcScaleX_=1;this.arcScaleY_=1}var H=J.prototype;H.clearRect=function(){this.element_.innerHTML="";this.currentPath_=[]};H.beginPath=function(){this.currentPath_=[]};H.moveTo=function(W,V){this.currentPath_.push({type:"moveTo",x:W,y:V});this.currentX_=W;this.currentY_=V};H.lineTo=function(W,V){this.currentPath_.push({type:"lineTo",x:W,y:V});this.currentX_=W;this.currentY_=V};H.bezierCurveTo=function(X,V,a,Z,Y,W){this.currentPath_.push({type:"bezierCurveTo",cp1x:X,cp1y:V,cp2x:a,cp2y:Z,x:Y,y:W});this.currentX_=Y;this.currentY_=W};H.quadraticCurveTo=function(c,b,a,Z){var W=this.currentX_+2/3*(c-this.currentX_);var V=this.currentY_+2/3*(b-this.currentY_);var Y=W+(a-this.currentX_)/3;var X=V+(Z-this.currentY_)/3;this.bezierCurveTo(W,V,Y,X,a,Z)};H.arc=function(b,Z,a,Y,W,X){a*=A;var f=X?"at":"wa";var c=b+(U(Y)*a)-I;var e=Z+(L(Y)*a)-I;var V=b+(U(W)*a)-I;var d=Z+(L(W)*a)-I;if(c==V&&!X){c+=0.125}this.currentPath_.push({type:f,x:b,y:Z,radius:a,xStart:c,yStart:e,xEnd:V,yEnd:d})};H.rect=function(X,W,V,Y){this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath()};H.strokeRect=function(X,W,V,Y){this.beginPath();this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath();this.stroke()};H.fillRect=function(X,W,V,Y){this.beginPath();this.moveTo(X,W);this.lineTo(X+V,W);this.lineTo(X+V,W+Y);this.lineTo(X,W+Y);this.closePath();this.fill()};H.createLinearGradient=function(W,Y,V,X){var Z=new S("gradient");return Z};H.createRadialGradient=function(Y,a,X,W,Z,V){var b=new S("gradientradial");b.radius1_=X;b.radius2_=V;b.focus_.x=Y;b.focus_.y=a;return b};H.drawImage=function(n,Y){var f,c,i,u,l,j,p,x;var g=n.runtimeStyle.width;var m=n.runtimeStyle.height;n.runtimeStyle.width="auto";n.runtimeStyle.height="auto";var e=n.width;var s=n.height;n.runtimeStyle.width=g;n.runtimeStyle.height=m;if(arguments.length==3){f=arguments[1];c=arguments[2];l=j=0;p=i=e;x=u=s}else{if(arguments.length==5){f=arguments[1];c=arguments[2];i=arguments[3];u=arguments[4];l=j=0;p=e;x=s}else{if(arguments.length==9){l=arguments[1];j=arguments[2];p=arguments[3];x=arguments[4];f=arguments[5];c=arguments[6];i=arguments[7];u=arguments[8]}else{throw"Invalid number of arguments"}}}var v=this.getCoords_(f,c);var Z=p/2;var X=x/2;var t=[];var V=10;var b=10;t.push(" <g_vml_:group",' coordsize="',A*V,",",A*b,'"',' coordorigin="0,0"',' style="width:',V,";height:",b,";position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var a=[];a.push("M11='",this.m_[0][0],"',","M12='",this.m_[1][0],"',","M21='",this.m_[0][1],"',","M22='",this.m_[1][1],"',","Dx='",O(v.x/A),"',","Dy='",O(v.y/A),"'");var r=v;var q=this.getCoords_(f+i,c);var o=this.getCoords_(f,c+u);var k=this.getCoords_(f+i,c+u);r.x=Math.max(r.x,q.x,o.x,k.x);r.y=Math.max(r.y,q.y,o.y,k.y);t.push("padding:0 ",O(r.x/A),"px ",O(r.y/A),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",a.join(""),", sizingmethod='clip');")}else{t.push("top:",O(v.y/A),"px;left:",O(v.x/A),"px;")}t.push(' ">','<g_vml_:image src="',n.src,'"',' style="width:',A*i,";"," height:",A*u,';"',' cropleft="',l/e,'"',' croptop="',j/s,'"',' cropright="',(e-l-p)/e,'"',' cropbottom="',(s-j-x)/s,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",t.join(""))};H.stroke=function(y){var e=[];var d=false;var AB=C(y?this.fillStyle:this.strokeStyle);var u=AB[0];var Y=AB[1]*this.globalAlpha;var X=10;var j=10;e.push("<g_vml_:shape",' fillcolor="',u,'"',' filled="',Boolean(y),'"',' style="position:absolute;width:',X,";height:",j,';"',' coordorigin="0 0" coordsize="',A*X," ",A*j,'"',' stroked="',!y,'"',' strokeweight="',this.lineWidth,'"',' strokecolor="',u,'"',' path="');var h=false;var t={x:null,y:null};var v={x:null,y:null};for(var w=0;w<this.currentPath_.length;w++){var o=this.currentPath_[w];if(o.type=="moveTo"){e.push(" m ");var AA=this.getCoords_(o.x,o.y);e.push(O(AA.x),",",O(AA.y))}else{if(o.type=="lineTo"){e.push(" l ");var AA=this.getCoords_(o.x,o.y);e.push(O(AA.x),",",O(AA.y))}else{if(o.type=="close"){e.push(" x ")}else{if(o.type=="bezierCurveTo"){e.push(" c ");var AA=this.getCoords_(o.x,o.y);var s=this.getCoords_(o.cp1x,o.cp1y);var q=this.getCoords_(o.cp2x,o.cp2y);e.push(O(s.x),",",O(s.y),",",O(q.x),",",O(q.y),",",O(AA.x),",",O(AA.y))}else{if(o.type=="at"||o.type=="wa"){e.push(" ",o.type," ");var AA=this.getCoords_(o.x,o.y);var k=this.getCoords_(o.xStart,o.yStart);var b=this.getCoords_(o.xEnd,o.yEnd);e.push(O(AA.x-this.arcScaleX_*o.radius),",",O(AA.y-this.arcScaleY_*o.radius)," ",O(AA.x+this.arcScaleX_*o.radius),",",O(AA.y+this.arcScaleY_*o.radius)," ",O(k.x),",",O(k.y)," ",O(b.x),",",O(b.y))}}}}}if(AA){if(t.x==null||AA.x<t.x){t.x=AA.x}if(v.x==null||AA.x>v.x){v.x=AA.x}if(t.y==null||AA.y<t.y){t.y=AA.y}if(v.y==null||AA.y>v.y){v.y=AA.y}}}e.push(' ">');if(typeof this.fillStyle=="object"){var n={x:"50%",y:"50%"};var r=(v.x-t.x);var l=(v.y-t.y);var z=(r>l)?r:l;n.x=O((this.fillStyle.focus_.x/r)*100+50)+"%";n.y=O((this.fillStyle.focus_.y/l)*100+50)+"%";var g=[];if(this.fillStyle.type_=="gradientradial"){var x=(this.fillStyle.radius1_/z*100);var m=(this.fillStyle.radius2_/z*100)-x}else{var x=0;var m=100}var V={offset:null,color:null};var Z={offset:null,color:null};this.fillStyle.colors_.sort(function(a,W){return a.offset-W.offset});for(var w=0;w<this.fillStyle.colors_.length;w++){var f=this.fillStyle.colors_[w];g.push((f.offset*m)+x,"% ",f.color,",");if(f.offset>V.offset||V.offset==null){V.offset=f.offset;V.color=f.color}if(f.offset<Z.offset||Z.offset==null){Z.offset=f.offset;Z.color=f.color}}g.pop();e.push("<g_vml_:fill",' color="',Z.color,'"',' color2="',V.color,'"',' type="',this.fillStyle.type_,'"',' focusposition="',n.x,", ",n.y,'"',' colors="',g.join(""),'"',' opacity="',Y,'" />')}else{if(y){e.push('<g_vml_:fill color="',u,'" opacity="',Y,'" />')}else{e.push("<g_vml_:stroke",' opacity="',Y,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',M(this.lineCap),'"',' weight="',this.lineWidth,'px"',' color="',u,'" />')}}e.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",e.join(""));this.currentPath_=[]};H.fill=function(){this.stroke(true)};H.closePath=function(){this.currentPath_.push({type:"close"})};H.getCoords_=function(W,V){return{x:A*(W*this.m_[0][0]+V*this.m_[1][0]+this.m_[2][0])-I,y:A*(W*this.m_[0][1]+V*this.m_[1][1]+this.m_[2][1])-I}};H.save=function(){var V={};P(this,V);this.aStack_.push(V);this.mStack_.push(this.m_);this.m_=E(K(),this.m_)};H.restore=function(){P(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};H.translate=function(X,W){var V=[[1,0,0],[0,1,0],[X,W,1]];this.m_=E(V,this.m_)};H.rotate=function(W){var Y=U(W);var X=L(W);var V=[[Y,X,0],[-X,Y,0],[0,0,1]];this.m_=E(V,this.m_)};H.scale=function(X,W){this.arcScaleX_*=X;this.arcScaleY_*=W;var V=[[X,0,0],[0,W,0],[0,0,1]];this.m_=E(V,this.m_)};H.clip=function(){};H.arcTo=function(){};H.createPattern=function(){return new F};function S(V){this.type_=V;this.radius1_=0;this.radius2_=0;this.colors_=[];this.focus_={x:0,y:0}}S.prototype.addColorStop=function(W,V){V=C(V);this.colors_.push({offset:1-W,color:V})};function F(){}G_vmlCanvasManager=G;CanvasRenderingContext2D=J;CanvasGradient=S;CanvasPattern=F})()}Bluff={VERSION:"0.3.4",array:function(C){if(C.length===undefined){return[C]}var B=[],A=C.length;while(A--){B[A]=C[A]}return B},each:function(C,D,B){for(var A=0,E=C.length;A<E;A++){D.call(B||null,C[A],A)}},reverse_each:function(C,D,B){var A=C.length;while(A--){D.call(B||null,C[A],A)}},sum:function(C){var B=0,A=C.length;while(A--){B+=C[A]}return B},Mini:{}};Bluff.Base=new JS.Class({extend:{DEBUG:false,DATA_LABEL_INDEX:0,DATA_VALUES_INDEX:1,DATA_COLOR_INDEX:2,LEGEND_MARGIN:10,TITLE_MARGIN:10,LABEL_MARGIN:10,DEFAULT_TARGET_WIDTH:800},top_margin:null,bottom_margin:null,right_margin:null,left_margin:null,labels:null,center_labels_over_point:null,has_left_labels:null,x_axis_label:null,y_axis_label:null,y_axis_increment:null,colors:null,title:null,font:null,font_color:null,hide_line_markers:null,hide_legend:null,hide_title:null,hide_line_numbers:null,no_data_message:null,title_font_size:null,legend_font_size:null,marker_font_size:null,marker_color:null,marker_count:null,minimum_value:null,maximum_value:null,sort:null,additional_line_values:null,stacked:null,legend_box_size:null,initialize:function(B,A){this._d=new Bluff.Renderer(B);A=A||this.klass.DEFAULT_TARGET_WIDTH;this.top_margin=this.bottom_margin=this.left_margin=this.right_margin=20;var C;if(typeof A!="number"){C=A.split("x");this._columns=parseFloat(C[0]);this._rows=parseFloat(C[1])}else{this._columns=parseFloat(A);this._rows=this._columns*0.75}this.initialize_ivars();this._reset_themes();this.theme_keynote()},initialize_ivars:function(){this._raw_columns=800;this._raw_rows=800*(this._rows/this._columns);this._column_count=0;this.marker_count=null;this.maximum_value=this.minimum_value=null;this._has_data=false;this._data=[];this.labels={};this._labels_seen={};this.sort=true;this.title=null;this._scale=this._columns/this._raw_columns;this.marker_font_size=21;this.legend_font_size=20;this.title_font_size=36;this.legend_box_size=20;this.no_data_message="No Data";this.hide_line_markers=this.hide_legend=this.hide_title=this.hide_line_numbers=false;this.center_labels_over_point=true;this.has_left_labels=false;this.additional_line_values=[];this._additional_line_colors=[];this._theme_options={};this.x_axis_label=this.y_axis_label=null;this.y_axis_increment=null;this.stacked=null;this._norm_data=null},set_margins:function(A){this.top_margin=this.left_margin=this.right_margin=this.bottom_margin=A},set_font:function(A){this.font=A;this._d.font=this.font},add_color:function(A){this.colors.push(A)},replace_colors:function(A){this.colors=A||[]},set_theme:function(A){this._reset_themes();this._theme_options={colors:["black","white"],additional_line_colors:[],marker_color:"white",font_color:"black",background_colors:null,background_image:null};for(var B in A){this._theme_options[B]=A[B]}this.colors=this._theme_options.colors;this.marker_color=this._theme_options.marker_color;this.font_color=this._theme_options.font_color||this.marker_color;this._additional_line_colors=this._theme_options.additional_line_colors;this._render_background()},theme_keynote:function(){this._blue="#6886B4";this._yellow="#FDD84E";this._green="#72AE6E";this._red="#D1695E";this._purple="#8A6EAF";this._orange="#EFAA43";this._white="white";this.colors=[this._yellow,this._blue,this._green,this._red,this._purple,this._orange,this._white];this.set_theme({colors:this.colors,marker_color:"white",font_color:"white",background_colors:["black","#4a465a"]})},theme_37signals:function(){this._green="#339933";this._purple="#cc99cc";this._blue="#336699";this._yellow="#FFF804";this._red="#ff0000";this._orange="#cf5910";this._black="black";this.colors=[this._yellow,this._blue,this._green,this._red,this._purple,this._orange,this._black];this.set_theme({colors:this.colors,marker_color:"black",font_color:"black",background_colors:["#d1edf5","white"]})},theme_rails_keynote:function(){this._green="#00ff00";this._grey="#333333";this._orange="#ff5d00";this._red="#f61100";this._white="white";this._light_grey="#999999";this._black="black";this.colors=[this._green,this._grey,this._orange,this._red,this._white,this._light_grey,this._black];this.set_theme({colors:this.colors,marker_color:"white",font_color:"white",background_colors:["#0083a3","#0083a3"]})},theme_odeo:function(){this._grey="#202020";this._white="white";this._dark_pink="#a21764";this._green="#8ab438";this._light_grey="#999999";this._dark_blue="#3a5b87";this._black="black";this.colors=[this._grey,this._white,this._dark_blue,this._dark_pink,this._green,this._light_grey,this._black];this.set_theme({colors:this.colors,marker_color:"white",font_color:"white",background_colors:["#ff47a4","#ff1f81"]})},theme_pastel:function(){this.colors=["#a9dada","#aedaa9","#daaea9","#dadaa9","#a9a9da","#daaeda","#dadada"];this.set_theme({colors:this.colors,marker_color:"#aea9a9",font_color:"black",background_colors:"white"})},theme_greyscale:function(){this.colors=["#282828","#383838","#686868","#989898","#c8c8c8","#e8e8e8"];this.set_theme({colors:this.colors,marker_color:"#aea9a9",font_color:"black",background_colors:"white"})},data:function(B,C,A){C=(C===undefined)?[]:C;A=A||null;C=Bluff.array(C);this._data.push([B,C,(A||this._increment_color())]);this._column_count=(C.length>this._column_count)?C.length:this._column_count;Bluff.each(C,function(E,D){if(!E){return }if(this.maximum_value===null&&this.minimum_value===null){this.maximum_value=this.minimum_value=E}this.maximum_value=this._larger_than_max(E)?E:this.maximum_value;if(this.maximum_value>0){this._has_data=true}this.minimum_value=this._less_than_min(E)?E:this.minimum_value;if(this.minimum_value<0){this._has_data=true}},this)},draw:function(){if(this.stacked){this._make_stacked()}this._setup_drawing();this._debug(function(){this._d.rectangle(this.left_margin,this.top_margin,this._raw_columns-this.right_margin,this._raw_rows-this.bottom_margin);this._d.rectangle(this._graph_left,this._graph_top,this._graph_right,this._graph_bottom)})},clear:function(){this._render_background()},_setup_drawing:function(){if(!this._has_data){return this._draw_no_data()}this._normalize();this._setup_graph_measurements();if(this.sort){this._sort_norm_data()}this._draw_legend();this._draw_line_markers();this._draw_axis_labels();this._draw_title()},_normalize:function(A){if(this._norm_data===null||A===true){this._norm_data=[];if(!this._has_data){return }this._calculate_spread();Bluff.each(this._data,function(C){var B=[];Bluff.each(C[this.klass.DATA_VALUES_INDEX],function(D){if(D===null||D===undefined){B.push(null)}else{B.push((D-this.minimum_value)/this._spread)}},this);this._norm_data.push([C[this.klass.DATA_LABEL_INDEX],B,C[this.klass.DATA_COLOR_INDEX]])},this)}},_calculate_spread:function(){this._spread=this.maximum_value-this.minimum_value;this._spread=this._spread>0?this._spread:1},_setup_graph_measurements:function(){this._marker_caps_height=this.hide_line_markers?0:this._calculate_caps_height(this.marker_font_size);this._title_caps_height=this.hide_title?0:this._calculate_caps_height(this.title_font_size);this._legend_caps_height=this.hide_legend?0:this._calculate_caps_height(this.legend_font_size);var A,C,B,G,F,E,D;if(this.hide_line_markers){this._graph_left=this.left_margin;this._graph_right_margin=this.right_margin;this._graph_bottom_margin=this.bottom_margin}else{C=0;if(this.has_left_labels){A="";for(D in this.labels){A=A.length>this.labels[D].length?A:this.labels[D]}C=this._calculate_width(this.marker_font_size,A)*1.25}else{C=this._calculate_width(this.marker_font_size,this._label(this.maximum_value))}B=this.hide_line_numbers&&!this.has_left_labels?0:C+this.klass.LABEL_MARGIN*2;this._graph_left=this.left_margin+B+(this.y_axis_label===null?0:this._marker_caps_height+this.klass.LABEL_MARGIN*2);G=-Infinity;for(D in this.labels){G=G>Number(D)?G:Number(D)}G=Math.round(G);F=(G>=(this._column_count-1)&&this.center_labels_over_point)?this._calculate_width(this.marker_font_size,this.labels[G])/2:0;this._graph_right_margin=this.right_margin+F;this._graph_bottom_margin=this.bottom_margin+this._marker_caps_height+this.klass.LABEL_MARGIN}this._graph_right=this._raw_columns-this._graph_right_margin;this._graph_width=this._raw_columns-this._graph_left-this._graph_right_margin;this._graph_top=this.top_margin+(this.hide_title?this.klass.TITLE_MARGIN:this._title_caps_height+this.klass.TITLE_MARGIN*2)+(this.hide_legend?this.klass.LEGEND_MARGIN:this._legend_caps_height+this.klass.LEGEND_MARGIN*2);E=(this.x_axis_label===null)?0:this._marker_caps_height+this.klass.LABEL_MARGIN;this._graph_bottom=this._raw_rows-this._graph_bottom_margin-E;this._graph_height=this._graph_bottom-this._graph_top},_draw_axis_labels:function(){if(this.x_axis_label){var A=this._graph_bottom+this.klass.LABEL_MARGIN*2+this._marker_caps_height;this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.stroke="transparent";this._d.pointsize=this._scale_fontsize(this.marker_font_size);this._d.gravity="north";this._d.annotate_scaled(this._raw_columns,1,0,A,this.x_axis_label,this._scale);this._debug(function(){this._d.line(0,A,this._raw_columns,A)})}},_draw_line_markers:function(){if(this.hide_line_markers){return }if(this.y_axis_increment===null){if(this.marker_count===null){Bluff.each([3,4,5,6,7],function(E){if(!this.marker_count&&this._spread%E==0){this.marker_count=E}},this);this.marker_count=this.marker_count||4}this._increment=(this._spread>0)?this._significant(this._spread/this.marker_count):1}else{this.maximum_value=Math.max(Math.ceil(this.maximum_value),this.y_axis_increment);this.minimum_value=Math.floor(this.minimum_value);this._calculate_spread();this._normalize(true);this.marker_count=Math.round(this._spread/this.y_axis_increment);this._increment=this.y_axis_increment}this._increment_scaled=this._graph_height/(this._spread/this._increment);var A,D,C,B;for(A=0,D=this.marker_count;A<=D;A++){C=this._graph_top+this._graph_height-A*this._increment_scaled;this._d.stroke=this.marker_color;this._d.stroke_width=1;this._d.line(this._graph_left,C,this._graph_right,C);B=A*this._increment+this.minimum_value;if(!this.hide_line_numbers){this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.stroke="transparent";this._d.pointsize=this._scale_fontsize(this.marker_font_size);this._d.gravity="east";this._d.annotate_scaled(this._graph_left-this.klass.LABEL_MARGIN,1,0,C,this._label(B),this._scale)}}},_center:function(A){return(this._raw_columns-A)/2},_draw_legend:function(){if(this.hide_legend){return }this._legend_labels=[];for(var D=0,F=this._data.length;D<F;D++){this._legend_labels.push(this._data[D][this.klass.DATA_LABEL_INDEX])}var E=this.legend_box_size;if(this.font){this._d.font=this.font}this._d.pointsize=this.legend_font_size;var A=[[]];Bluff.each(this._legend_labels,function(H){var J=A.length-1;var I=this._d.get_type_metrics(H);var G=I.width+E*2.7;A[J].push(G);if(Bluff.sum(A[J])>(this._raw_columns*0.9)){A.push([A[J].pop()])}},this);var C=this._center(Bluff.sum(A[0]));var B=this.hide_title?this.top_margin+this.klass.LEGEND_MARGIN:this.top_margin+this.klass.TITLE_MARGIN+this._title_caps_height+this.klass.LEGEND_MARGIN;this._debug(function(){this._d.stroke_width=1;this._d.line(0,B,this._raw_columns,B)});Bluff.each(this._legend_labels,function(G,H){this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.pointsize=this._scale_fontsize(this.legend_font_size);this._d.stroke="transparent";this._d.font_weight="normal";this._d.gravity="west";this._d.annotate_scaled(this._raw_columns,1,C+(E*1.7),B,G,this._scale);this._d.stroke="transparent";this._d.fill=this._data[H][this.klass.DATA_COLOR_INDEX];this._d.rectangle(C,B-E/2,C+E,B+E/2);this._d.pointsize=this.legend_font_size;var I=this._d.get_type_metrics(G);var K=I.width+(E*2.7),J;A[0].shift();if(A[0].length==0){this._debug(function(){this._d.line(0,B,this._raw_columns,B)});A.shift();if(A.length>0){C=this._center(Bluff.sum(A[0]))}J=Math.max(this._legend_caps_height,E)+this.klass.LEGEND_MARGIN;if(A.length>0){B+=J;this._graph_top+=J;this._graph_height=this._graph_bottom-this._graph_top}}else{C+=K}},this);this._color_index=0},_draw_title:function(){if(this.hide_title||!this.title){return }this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.pointsize=this._scale_fontsize(this.title_font_size);this._d.font_weight="bold";this._d.gravity="north";this._d.annotate_scaled(this._raw_columns,1,0,this.top_margin,this.title,this._scale)},_draw_label:function(B,C){if(this.hide_line_markers){return }var A;if(this.labels[C]&&!this._labels_seen[C]){A=this._graph_bottom+this.klass.LABEL_MARGIN;this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.stroke="transparent";this._d.font_weight="normal";this._d.pointsize=this._scale_fontsize(this.marker_font_size);this._d.gravity="north";this._d.annotate_scaled(1,1,B,A,this.labels[C],this._scale);this._labels_seen[C]=true;this._debug(function(){this._d.stroke_width=1;this._d.line(0,A,this._raw_columns,A)})}},_draw_no_data:function(){this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.stroke="transparent";this._d.font_weight="normal";this._d.pointsize=this._scale_fontsize(80);this._d.gravity="center";this._d.annotate_scaled(this._raw_columns,this._raw_rows/2,0,10,this.no_data_message,this._scale)},_render_background:function(){var A=this._theme_options.background_colors;switch(true){case A instanceof Array:this._render_gradiated_background.apply(this,A);break;case typeof A=="string":this._render_solid_background(A);break;default:this._render_image_background(this._theme_options.background_image);break}},_render_solid_background:function(A){this._d.render_solid_background(this._columns,this._rows,A)},_render_gradiated_background:function(A,B){this._d.render_gradiated_background(this._columns,this._rows,A,B)},_render_image_background:function(A){},_reset_themes:function(){this._color_index=0;this._labels_seen={};this._theme_options={};this._d.scale(this._scale,this._scale)},_scale_value:function(A){return this._scale*A},_scale_fontsize:function(B){var A=B*this._scale;return A},_clip_value_if_greater_than:function(A,B){return(A>B)?B:A},_larger_than_max:function(B,A){return B>this.maximum_value},_less_than_min:function(B,A){return B<this.minimum_value},_max:function(B,A){return B},_min:function(B,A){return B},_significant:function(B){if(B==0){return 1}var A=1;while(B<10){B*=10;A/=10}while(B>100){B/=10;A*=10}return Math.floor(B)*A},_sort_norm_data:function(){var B=this._sums,A=this.klass.DATA_VALUES_INDEX;this._norm_data.sort(function(D,C){return B(C[A])-B(D[A])})},_sums:function(A){var B=0;Bluff.each(A,function(C){B+=C});return B},_make_stacked:function(){var A=[],B=this._column_count;while(B--){A[B]=0}Bluff.each(this._data,function(C){Bluff.each(C[this.klass.DATA_VALUES_INDEX],function(E,D){A[D]+=E},this);C[this.klass.DATA_VALUES_INDEX]=Bluff.array(A)},this)},_debug:function(A){if(this.klass.DEBUG){this._d.fill="transparent";this._d.stroke="turquoise";A.call(this)}},_increment_color:function(){if(this._color_index==0){this._color_index+=1;return this.colors[0]}else{if(this._color_index<this.colors.length){this._color_index+=1;return this.colors[this._color_index-1]}else{this._color_index=0;return this.colors[this.colors.length-1]}}},_label:function(A){if(this._spread%this.marker_count==0||this.y_axis_increment!==null){return String(Math.round(A))}if(this._spread>10){return String(Math.floor(A))}else{if(this._spread>=3){return String(Math.floor(A*100)/100)}else{return String(A)}}},_calculate_caps_height:function(A){return this._d.caps_height(A)},_calculate_width:function(A,B){return this._d.text_width(A,B)}});Bluff.Area=new JS.Class(Bluff.Base,{draw:function(){this.callSuper();if(!this._has_data){return }this._x_increment=this._graph_width/(this._column_count-1);this._d.stroke="transparent";Bluff.each(this._norm_data,function(D){var B=[];var A=0,C=0;Bluff.each(D[this.klass.DATA_VALUES_INDEX],function(H,E){var G=this._graph_left+(this._x_increment*E);var F=this._graph_top+(this._graph_height-H*this._graph_height);if(A>0&&C>0){B.push(G);B.push(F)}else{B.push(this._graph_left);B.push(this._graph_bottom-1);B.push(G);B.push(F)}this._draw_label(G,E);A=G;C=F},this);B.push(this._graph_right);B.push(this._graph_bottom-1);B.push(this._graph_left);B.push(this._graph_bottom-1);this._d.fill=D[this.klass.DATA_COLOR_INDEX];this._d.polyline(B)},this)}});Bluff.BarConversion=new JS.Class({mode:null,zero:null,graph_top:null,graph_height:null,minimum_value:null,spread:null,getLeftYRightYscaled:function(C,A){var B;switch(this.mode){case 1:A[0]=this.graph_top+this.graph_height*(1-C)+1;A[1]=this.graph_top+this.graph_height-1;break;case 2:A[0]=this.graph_top+1;A[1]=this.graph_top+this.graph_height*(1-C)-1;break;case 3:B=C-this.minimum_value/this.spread;if(C>=this.zero){A[0]=this.graph_top+this.graph_height*(1-(B-this.zero))+1;A[1]=this.graph_top+this.graph_height*(1-this.zero)-1}else{A[0]=this.graph_top+this.graph_height*(1-(B-this.zero))+1;A[1]=this.graph_top+this.graph_height*(1-this.zero)-1}break;default:A[0]=0;A[1]=0}}});Bluff.Bar=new JS.Class(Bluff.Base,{draw:function(){var B=0,A;for(A in this.labels){B+=1}this.center_labels_over_point=(B>this._column_count);this.callSuper();if(!this._has_data){return }this._draw_bars()},_draw_bars:function(){var A=0.9;this._bar_width=this._graph_width/(this._column_count*this._data.length);var C=(this._bar_width*(1-A))/2;this._d.stroke_opacity=0;var B=new Bluff.BarConversion();B.graph_height=this._graph_height;B.graph_top=this._graph_top;if(this.minimum_value>=0){B.mode=1}else{if(this.maximum_value<=0){B.mode=2}else{B.mode=3;B.spread=this._spread;B.minimum_value=this.minimum_value;B.zero=-this.minimum_value/this._spread}}Bluff.each(this._norm_data,function(E,D){Bluff.each(E[this.klass.DATA_VALUES_INDEX],function(K,G){var H=this._graph_left+(this._bar_width*(D+G+((this._data.length-1)*G)))+C;var J=H+this._bar_width*A;var I=[];B.getLeftYRightYscaled(K,I);this._d.fill=E[this.klass.DATA_COLOR_INDEX];this._d.stroke="transparent";this._d.rectangle(H,I[0],J,I[1]);var F=this._graph_left+(this._data.length*this._bar_width*G)+(this._data.length*this._bar_width/2)+C;this._draw_label(F-(this.center_labels_over_point?this._bar_width/2:0),G)},this)},this);if(this.center_labels_over_point){this._draw_label(this._graph_right,this._column_count)}}});Bluff.Line=new JS.Class(Bluff.Base,{baseline_value:null,baseline_color:null,hide_dots:null,hide_lines:null,initialize:function(A){if(arguments.length>3){throw"Wrong number of arguments"}if(arguments.length==1||(typeof arguments[1]!="number"&&typeof arguments[1]!="string")){this.callSuper(A,null)}else{this.callSuper()}this.hide_dots=this.hide_lines=false;this.baseline_color="red";this.baseline_value=null},draw:function(){this.callSuper();if(!this._has_data){return }this.x_increment=(this._column_count>1)?(this._graph_width/(this._column_count-1)):this._graph_width;var A;if(this._norm_baseline!==undefined){A=this._graph_top+(this._graph_height-this._norm_baseline*this._graph_height);this._d.push();this._d.stroke=this.baseline_color;this._d.stroke_width=3;this._d.line(this._graph_left,A,this._graph_left+this._graph_width,A);this._d.pop()}Bluff.each(this._norm_data,function(D){var B=null,C=null;Bluff.each(D[this.klass.DATA_VALUES_INDEX],function(I,F){var H=this._graph_left+(this.x_increment*F);if(I===undefined){return }this._draw_label(H,F);var G=this._graph_top+(this._graph_height-I*this._graph_height);this._d.stroke=D[this.klass.DATA_COLOR_INDEX];this._d.fill=D[this.klass.DATA_COLOR_INDEX];this._d.stroke_opacity=1;this._d.stroke_width=this._clip_value_if_greater_than(this._columns/(this._norm_data[0][1].length*6),3);if(!this.hide_lines&&B!==null&&C!==null){this._d.line(B,C,H,G)}var E=this._clip_value_if_greater_than(this._columns/(this._norm_data[0][1].length*2),7);if(!this.hide_dots){this._d.circle(H,G,H-E,G)}B=H;C=G},this)},this)},_normalize:function(){this.maximum_value=Math.max(this.maximum_value,this.baseline_value);this.callSuper();if(this.baseline_value!==null){this._norm_baseline=this.baseline_value/this.maximum_value}}});Bluff.Net=new JS.Class(Bluff.Base,{hide_dots:null,initialize:function(){this.callSuper();this.hide_dots=false},draw:function(){this.callSuper();if(!this._has_data){return }this._radius=this._graph_height/2;this._center_x=this._graph_left+(this._graph_width/2);this._center_y=this._graph_top+(this._graph_height/2)-10;this._x_increment=this._graph_width/(this._column_count-1);var A=this._clip_value_if_greater_than(this._columns/(this._norm_data[0][this.klass.DATA_VALUES_INDEX].length*2.5),7);this._d.stroke_opacity=1;this._d.stroke_width=this._clip_value_if_greater_than(this._columns/(this._norm_data[0][this.klass.DATA_VALUES_INDEX].length*4),3);var B;if(this._norm_baseline!==undefined){B=this._graph_top+(this._graph_height-this._norm_baseline*this._graph_height);this._d.push();this._d.stroke_color=this.baseline_color;this._d.fill_opacity=0;this._d.stroke_width=5;this._d.line(this._graph_left,B,this._graph_left+this._graph_width,B);this._d.pop()}Bluff.each(this._norm_data,function(E){var C=null,D=null;Bluff.each(E[this.klass.DATA_VALUES_INDEX],function(H,G){if(H===undefined){return }var L=G*Math.PI*2/this._column_count,K=H*this._radius,M=this._center_x+Math.sin(L)*K,I=this._center_y-Math.cos(L)*K,O=(G+1<E[this.klass.DATA_VALUES_INDEX].length)?G+1:0,F=O*Math.PI*2/this._column_count,J=E[this.klass.DATA_VALUES_INDEX][O]*this._radius,P=this._center_x+Math.sin(F)*J,N=this._center_y-Math.cos(F)*J;this._d.stroke=E[this.klass.DATA_COLOR_INDEX];this._d.fill=E[this.klass.DATA_COLOR_INDEX];this._d.line(M,I,P,N);if(!this.hide_dots){this._d.circle(M,I,M-A,I)}},this)},this)},_draw_line_markers:function(){if(this.hide_line_markers){return }this._radius=this._graph_height/2;this._center_x=this._graph_left+(this._graph_width/2);this._center_y=this._graph_top+(this._graph_height/2)-10;var A,C;for(var B=0,D=this._column_count;B<D;B++){A=B*Math.PI*2/this._column_count;this._d.stroke=this.marker_color;this._d.stroke_width=1;this._d.line(this._center_x,this._center_y,this._center_x+Math.sin(A)*this._radius,this._center_y-Math.cos(A)*this._radius);C=labels[B]?labels[B]:"000";this._draw_label(this._center_x,this._center_y,A*360/(2*Math.PI),this._radius,C)}},_draw_label:function(J,I,B,F,C){var E=1.1,D=J,A=I,K=B*Math.PI/180,H=D+(F*E*Math.sin(K)),G=A-(F*E*Math.cos(K));this._d.fill=this.marker_color;if(this.font){this._d.font=this.font}this._d.pointsize=this._scale_fontsize(20);this._d.stroke="transparent";this._d.font_weight="bold";var L=K/(2*Math.PI);switch(true){case L>=0.96||L<0.04:this._d.gravity="south";break;case L>=0.04&&L<0.21:this._d.gravity="west";break;case L>=0.21&&L<0.29:this._d.gravity="west";break;case L>=0.29&&L<0.46:this._d.gravity="west";break;case L>=0.46&&L<0.54:this._d.gravity="north";break;case L>=0.54&&L<0.71:this._d.gravity="east";break;case L>=0.71&&L<0.79:this._d.gravity="east";break;case L>=0.79&&L<0.96:this._d.gravity="east";break}this._d.annotate_scaled(0,0,H,G,C,this._scale)}});Bluff.Pie=new JS.Class(Bluff.Base,{extend:{TEXT_OFFSET_PERCENTAGE:0.15},zero_degreee:null,initialize_ivars:function(){this.callSuper();this.zero_degree=0},draw:function(){this.hide_line_markers=true;this.callSuper();if(!this._has_data){return }var F=this._graph_height,A=(Math.min(this._graph_width,this._graph_height)/2)*0.8,H=this._graph_left+(this._graph_width-F)/2,E=this._graph_left+(this._graph_width/2),C=this._graph_top+(this._graph_height/2)-10,G=this._sums_for_pie(),B=this.zero_degree,D=this.klass.DATA_VALUES_INDEX;if(this.sort){this._data.sort(function(J,I){return J[D][0]-I[D][0]})}Bluff.each(this._data,function(M,J){if(M[this.klass.DATA_VALUES_INDEX][0]>0){this._d.fill=M[this.klass.DATA_COLOR_INDEX];var I=(M[this.klass.DATA_VALUES_INDEX][0]/G)*360;this._d.circle(E,C,E+A,C,B,B+I+0.5);var K=B+((B+I)-B)/2;var L=Math.round((M[this.klass.DATA_VALUES_INDEX][0]/G)*100)+"%";this._draw_label(E,C,K,A+(A*this.klass.TEXT_OFFSET_PERCENTAGE),L);B+=I}},this)},_draw_label:function(L,K,C,H,D){var F=20,E=L,A=K,B=H+F,G=B*0.15,J=E+((B+G)*Math.cos(C*Math.PI/180)),I=A+(B*Math.sin(C*Math.PI/180));this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.pointsize=this._scale_fontsize(this.marker_font_size);this._d.font_weight="bold";this._d.gravity="center";this._d.annotate_scaled(0,0,J,I,D,this._scale)},_sums_for_pie:function(){var A=0;Bluff.each(this._data,function(B){A+=B[this.klass.DATA_VALUES_INDEX][0]},this);return A}});Bluff.SideBar=new JS.Class(Bluff.Base,{draw:function(){this.has_left_labels=true;this.callSuper();if(!this._has_data){return }var B=0.9;this._bars_width=this._graph_height/this._column_count;this._bar_width=this._bars_width*B/this._norm_data.length;this._d.stroke_opacity=0;var A=[],D=this._column_count;while(D--){A[D]=0}var E=[],C=this._column_count;while(C--){E[C]=this._graph_left}var F=(this._bars_width*(1-B))/2;Bluff.each(this._norm_data,function(H,G){Bluff.each(H[this.klass.DATA_VALUES_INDEX],function(P,N){var J=this._graph_left+(this._graph_width-P*this._graph_width-A[N]),I=this._graph_left+this._graph_width-A[N],K=I-J,O=E[N]-1,M=this._graph_top+(this._bars_width*N)+(this._bar_width*G)+F,R=O+K,Q=M+this._bar_width;A[N]+=(P*this._graph_width);this._d.stroke="transparent";this._d.fill=H[this.klass.DATA_COLOR_INDEX];this._d.rectangle(O,M,R,Q);var L=this._graph_top+(this._bars_width*N+this._bars_width/2)+F;this._draw_label(L,N)},this)},this)},_draw_line_markers:function(){if(this.hide_line_markers){return }this._d.stroke_width=1;var E=5;var B=this._significant(this.maximum_value/E),D,A,G,F;for(var C=0;C<=E;C++){D=(this._graph_right-this._graph_left)/E;A=this._graph_right-(D*C)-1;G=C-E;F=Math.abs(G)*B;this._d.stroke=this.marker_color;this._d.line(A,this._graph_bottom,A,this._graph_top);if(!this.hide_line_numbers){this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.stroke="transparent";this._d.pointsize=this._scale_fontsize(this.marker_font_size);this._d.gravity="center";this._d.annotate_scaled(0,0,A,this._graph_bottom+(this.klass.LABEL_MARGIN*2),F,this._scale)}}},_draw_label:function(A,B){if(this.labels[B]&&!this._labels_seen[B]){this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.stroke="transparent";this._d.font_weight="normal";this._d.pointsize=this._scale_fontsize(this.marker_font_size);this._d.gravity="east";this._d.annotate_scaled(1,1,this._graph_left-this.klass.LABEL_MARGIN*2,A,this.labels[B],this._scale);this._labels_seen[B]=true}}});Bluff.Spider=new JS.Class(Bluff.Base,{hide_text:null,hide_axes:null,transparent_background:null,initialize:function(B,C,A){this.callSuper(B,A);this._max_value=C;this.hide_legend=true},draw:function(){this.hide_line_markers=true;this.callSuper();if(!this._has_data){return }var I=this._graph_height,E=this._graph_height/2,A=this._graph_left+(this._graph_width-I)/2,H=this._graph_left+(this._graph_width/2),G=this._graph_top+(this._graph_height/2)-25;this._unit_length=E/this._max_value;var C=this._sums_for_spider(),B=0,D=(2*Math.PI)/this._data.length,F=0;if(!this.hide_axes){this._draw_axes(H,G,E,D)}this._draw_polygon(H,G,D)},_normalize_points:function(A){return A*this._unit_length},_draw_label:function(J,I,B,F,C){var E=50,D=J,A=I+0,H=D+((F+E)*Math.cos(B)),G=A+((F+E)*Math.sin(B));this._d.fill=this.marker_color;if(this.font){this._d.font=this.font}this._d.pointsize=this._scale_fontsize(this.legend_font_size);this._d.stroke="transparent";this._d.font_weight="bold";this._d.gravity="center";this._d.annotate_scaled(0,0,H,G,C,this._scale)},_draw_axes:function(C,B,A,F,E){if(this.hide_axes){return }var D=0;Bluff.each(this._data,function(I){this._d.stroke=E||I[this.klass.DATA_COLOR_INDEX];this._d.stroke_width=5;var H=A*Math.cos(D);var G=A*Math.sin(D);this._d.line(C,B,C+H,B+G);if(!this.hide_text){this._draw_label(C,B,D,A,I[this.klass.DATA_LABEL_INDEX])}D+=F},this)},_draw_polygon:function(C,B,F,A){var E=[],D=0;Bluff.each(this._data,function(G){E.push(C+this._normalize_points(G[this.klass.DATA_VALUES_INDEX][0])*Math.cos(D));E.push(B+this._normalize_points(G[this.klass.DATA_VALUES_INDEX][0])*Math.sin(D));D+=F},this);this._d.stroke_width=1;this._d.stroke=A||this.marker_color;this._d.fill=A||this.marker_color;this._d.fill_opacity=0.4;this._d.polyline(E)},_sums_for_spider:function(){var A=0;Bluff.each(this._data,function(B){A+=B[this.klass.DATA_VALUES_INDEX][0]},this);return A}});Bluff.Base.StackedMixin=new JS.Module({_get_maximum_by_stack:function(){var A={};Bluff.each(this._data,function(C){Bluff.each(C[this.klass.DATA_VALUES_INDEX],function(E,D){if(!A[D]){A[D]=0}A[D]+=E},this)},this);for(var B in A){if(A[B]>this.maximum_value){this.maximum_value=A[B]}}this.minimum_value=0}});Bluff.StackedArea=new JS.Class(Bluff.Base,{include:Bluff.Base.StackedMixin,last_series_goes_on_bottom:null,draw:function(){this._get_maximum_by_stack();this.callSuper();if(!this._has_data){return }this._x_increment=this._graph_width/(this._column_count-1);this._d.stroke="transparent";var A=[],B=this._column_count;while(B--){A.push(0)}var D=null;var C=this.last_series_goes_on_bottom?"reverse_each":"each";Bluff[C](this._norm_data,function(I){var H=D;D=[];Bluff.each(I[this.klass.DATA_VALUES_INDEX],function(M,J){var L=this._graph_left+(this._x_increment*J);var K=this._graph_top+(this._graph_height-M*this._graph_height-A[J]);A[J]+=(M*this._graph_height);D.push(L);D.push(K);this._draw_label(L,J)},this);var E,F,G;if(H){E=Bluff.array(D);for(F=H.length/2-1;F>=0;F--){E.push(H[2*F]);E.push(H[2*F+1])}E.push(D[0]);E.push(D[1])}else{E=Bluff.array(D);E.push(this._graph_right);E.push(this._graph_bottom-1);E.push(this._graph_left);E.push(this._graph_bottom-1);E.push(D[0]);E.push(D[1])}this._d.fill=I[this.klass.DATA_COLOR_INDEX];this._d.polyline(E)},this)}});Bluff.StackedBar=new JS.Class(Bluff.Base,{include:Bluff.Base.StackedMixin,draw:function(){this._get_maximum_by_stack();this.callSuper();if(!this._has_data){return }var B=0.9;this._bar_width=this._graph_width/this._column_count;var D=(this._bar_width*(1-B))/2;var A=[],C=this._column_count;while(C--){A.push(0)}Bluff.each(this._norm_data,function(F,E){Bluff.each(F[this.klass.DATA_VALUES_INDEX],function(M,H){var G=this._graph_left+(this._bar_width*H)+(this._bar_width*B/2)+D;this._draw_label(G,H);if(M==0){return }var K=this._graph_left+(this._bar_width*H)+D;var I=this._graph_top+(this._graph_height-M*this._graph_height-A[H])+1;var L=K+this._bar_width*B;var J=this._graph_top+this._graph_height-A[H]-1;A[H]+=(M*this._graph_height);this._d.fill=F[this.klass.DATA_COLOR_INDEX];this._d.rectangle(K,I,L,J)},this)},this)}});Bluff.AccumulatorBar=new JS.Class(Bluff.StackedBar,{draw:function(){if(this._data.length!=1){throw"Incorrect number of datasets exception"}var B=[];var C=0;var A=[];Bluff.each(this._data[0][this.klass.DATA_VALUES_INDEX],function(E){var D=-Infinity;Bluff.each(A,function(F){D=Math.max(D,F)});A.push((C>0)?(E+D):E);B.push(A[C]-E);C+=1},this);this.data("Accumulator",B);this.callSuper()}});Bluff.SideStackedBar=new JS.Class(Bluff.SideBar,{include:Bluff.Base.StackedMixin,draw:function(){this.has_left_labels=true;this._get_maximum_by_stack();this.callSuper();if(!this._has_data){return }var B=0.9;this._bar_width=this._graph_height/this._column_count;var A=[],D=this._column_count,E=[],C=this._column_count,F=(this._bar_width*(1-B))/2;while(D--){A.push(0)}while(C--){E.push(this._graph_left)}Bluff.each(this._norm_data,function(H,G){this._d.fill=H[this.klass.DATA_COLOR_INDEX];Bluff.each(H[this.klass.DATA_VALUES_INDEX],function(P,N){var J=this._graph_left+(this._graph_width-P*this._graph_width-A[N])+1;var I=this._graph_left+this._graph_width-A[N]-1;var K=I-J;var O=E[N],M=this._graph_top+(this._bar_width*N)+F,R=O+K,Q=M+this._bar_width*B;E[N]+=K;A[N]+=(P*this._graph_width-2);this._d.rectangle(O,M,R,Q);var L=this._graph_top+(this._bar_width*N)+(this._bar_width*B/2)+F;this._draw_label(L,N)},this)},this)},_larger_than_max:function(B,A){A=A||0;return this._max(B,A)>this.maximum_value},_max:function(C,A){var B=0;Bluff.each(this._data,function(D){B+=D[this.klass.DATA_VALUES_INDEX][A]},this);return B}});Bluff.Mini.Legend=new JS.Module({_expand_canvas_for_vertical_legend:function(){this._original_rows=this._raw_rows;this._rows+=this._data.length*this._calculate_caps_height(this._scale_fontsize(this.legend_font_size))*1.7;this._render_background()},_draw_vertical_legend:function(){this._legend_labels=[];Bluff.each(this._data,function(G){this._legend_labels.push(G[this.klass.DATA_LABEL_INDEX])},this);var F=40,C=10,D=100,E=40;if(this.font){this._d.font=this.font}this._d.pointsize=this.legend_font_size;var B=D,A=this._original_rows+E;this._debug(function(){this._d.line(0,A,this._raw_columns,A)});Bluff.each(this._legend_labels,function(G,H){this._d.fill=this.font_color;if(this.font){this._d.font=this.font}this._d.pointsize=this._scale_fontsize(this.legend_font_size);this._d.stroke="transparent";this._d.font_weight="normal";this._d.gravity="west";this._d.annotate_scaled(this._raw_columns,1,B+(F*1.7),A,this._truncate_legend_label(G),this._scale);this._d.stroke="transparent";this._d.fill=this._data[H][this.klass.DATA_COLOR_INDEX];this._d.rectangle(B,A-F/2,B+F,A+F/2);A+=this._calculate_caps_height(this.legend_font_size)*1.7},this);this._color_index=0},_truncate_legend_label:function(A){var B=String(A);while(this._calculate_width(this._scale_fontsize(this.legend_font_size),B)>(this._columns-this.legend_left_margin-this.right_margin)&&(B.length>1)){B=B.substr(0,B.length-1)}return B+(B.length<String(A).length?"…":"")}});Bluff.Mini.Bar=new JS.Class(Bluff.Bar,{include:Bluff.Mini.Legend,draw:function(){this.hide_legend=true;this.hide_title=true;this.hide_line_numbers=true;this.marker_font_size=50;this.minimum_value=0;this.legend_font_size=60;this._expand_canvas_for_vertical_legend();this.callSuper();this._draw_vertical_legend()}});Bluff.Mini.Pie=new JS.Class(Bluff.Pie,{include:Bluff.Mini.Legend,initialize_ivars:function(){this.callSuper();this.hide_legend=true;this.hide_title=true;this.hide_line_numbers=true;this.marker_font_size=60;this.legend_font_size=60},draw:function(){this._expand_canvas_for_vertical_legend();this.callSuper();this._draw_vertical_legend()}});Bluff.Mini.SideBar=new JS.Class(Bluff.SideBar,{include:Bluff.Mini.Legend,initialize_ivars:function(){this.callSuper();this.hide_legend=true;this.hide_title=true;this.hide_line_numbers=true;this.marker_font_size=50;this.legend_font_size=50},draw:function(){this._expand_canvas_for_vertical_legend();this.callSuper();this._draw_vertical_legend()}});Bluff.Renderer=new JS.Class({extend:{WRAPPER_CLASS:"bluff-wrapper",TEXT_CLASS:"bluff-text"},font:"Arial, Helvetica, Verdana, sans-serif",gravity:"north",initialize:function(A){this._canvas=document.getElementById(A);this._ctx=this._canvas.getContext("2d")},scale:function(B,A){this._sx=B;this._sy=A||B},caps_height:function(B){var C=this._sized_text(B,"X"),A=this._element_size(C).height;this._remove_text_node(C);return A},text_width:function(A,D){var B=this._sized_text(A,D);var C=this._element_size(B).width;this._remove_text_node(B);return C},get_type_metrics:function(C){var B=this._sized_text(this.pointsize,C);var A=this._element_size(B);this._remove_text_node(B);return A},clear:function(D,A){this._canvas.width=D;this._canvas.height=A;this._ctx.clearRect(0,0,D,A);var E=this._text_container(),C=E.childNodes,B=C.length;E.style.width=D+"px";E.style.height=A+"px";while(B--){if(C[B]&&C[B].className==this.klass.TEXT_CLASS){this._remove_text_node(C[B])}}},push:function(){this._ctx.save()},pop:function(){this._ctx.restore()},render_gradiated_background:function(B,A,C,D){this.clear(B,A);var E=this._ctx.createLinearGradient(0,0,0,A);E.addColorStop(0,C);E.addColorStop(1,D);this._ctx.fillStyle=E;this._ctx.fillRect(0,0,B,A)},render_solid_background:function(C,A,B){this.clear(C,A);this._ctx.fillStyle=B;this._ctx.fillRect(0,0,C,A)},annotate_scaled:function(C,B,A,H,G,F){var E=(C*F)>=1?(C*F):1;var D=(B*F)>=1?(B*F):1;var G=this._sized_text(this.pointsize,G);G.style.color=this.fill;G.style.fontWeight=this.font_weight;G.style.textAlign="center";G.style.left=(this._sx*A+this._left_adjustment(G,E))+"px";G.style.top=(this._sy*H+this._top_adjustment(G,D))+"px"},circle:function(C,A,I,G,E,D){var F=Math.sqrt(Math.pow(I-C,2)+Math.pow(G-A,2));this._ctx.fillStyle=this.fill;this._ctx.beginPath();var B=(E||0)*Math.PI/180;var H=(D||360)*Math.PI/180;if(E!==undefined&&D!==undefined){this._ctx.moveTo(this._sx*(C+F*Math.cos(H)),this._sy*(A+F*Math.sin(H)));this._ctx.lineTo(this._sx*C,this._sy*A);this._ctx.lineTo(this._sx*(C+F*Math.cos(B)),this._sy*(A+F*Math.sin(B)))}this._ctx.arc(this._sx*C,this._sy*A,this._sx*F,B,H,false);this._ctx.fill()},line:function(D,C,B,A){this._ctx.strokeStyle=this.stroke;this._ctx.lineWidth=this.stroke_width;this._ctx.beginPath();this._ctx.moveTo(this._sx*D,this._sy*C);this._ctx.lineTo(this._sx*B,this._sy*A);this._ctx.stroke()},polyline:function(B){this._ctx.fillStyle=this.fill;this._ctx.globalAlpha=this.fill_opacity||1;try{this._ctx.strokeStyle=this.stroke}catch(C){}var A=B.shift(),D=B.shift();this._ctx.beginPath();this._ctx.moveTo(this._sx*A,this._sy*D);while(B.length>0){A=B.shift();D=B.shift();this._ctx.lineTo(this._sx*A,this._sy*D)}this._ctx.fill()},rectangle:function(C,B,F,E){var A;if(C>F){A=C;C=F;F=A}if(B>E){A=B;B=E;E=A}try{this._ctx.fillStyle=this.fill;this._ctx.fillRect(this._sx*C,this._sy*B,this._sx*(F-C),this._sy*(E-B))}catch(D){}try{this._ctx.strokeStyle=this.stroke;if(this.stroke!="transparent"){this._ctx.strokeRect(this._sx*C,this._sy*B,this._sx*(F-C),this._sy*(E-B))}}catch(D){}},_left_adjustment:function(C,B){var A=this._element_size(C).width;switch(this.gravity){case"west":return 0;case"east":return B-A;case"north":case"south":case"center":return(B-A)/2}},_top_adjustment:function(C,A){var B=this._element_size(C).height;switch(this.gravity){case"north":return 0;case"south":return A-B;case"west":case"east":case"center":return(A-B)/2}},_text_container:function(){var A=this._canvas.parentNode;if(A.className==this.klass.WRAPPER_CLASS){return A}A=document.createElement("div");A.className=this.klass.WRAPPER_CLASS;A.style.position="relative";A.style.border="none";A.style.padding="0 0 0 0";this._canvas.parentNode.insertBefore(A,this._canvas);A.appendChild(this._canvas);return A},_sized_text:function(A,B){var C=this._text_node(B);C.style.fontFamily=this.font;C.style.fontSize=(typeof A=="number")?A+"px":A;return C},_text_node:function(A){var B=document.createElement("div");B.className=this.klass.TEXT_CLASS;B.style.position="absolute";B.appendChild(document.createTextNode(A));this._text_container().appendChild(B);return B},_remove_text_node:function(A){A.parentNode.removeChild(A)},_element_size:function(A){var B=A.style.display;return(B&&B!="none")?{width:A.offsetWidth,height:A.offsetHeight}:{width:A.clientWidth,height:A.clientHeight}}});Bluff.TableReader=new JS.Class({NUMBER_FORMAT:/\-?(0|[1-9]\d*)(\.\d+)?(e[\+\-]?\d+)?/i,initialize:function(B,A){this._table=(typeof B=="string")?document.getElementById(B):B;this._swap=!!A},get_data:function(){if(!this._data){this._read()}return this._data},get_labels:function(){if(!this._labels){this._read()}return this._labels},get_title:function(){return this._title},get_series:function(A){if(this._data[A]){return this._data[A]}return this._data[A]={points:[]}},_read:function(){this._row=this._col=0;this._row_offset=this._col_offset=0;this._data=[];this._labels={};this._row_headings=[];this._col_headings=[];this._walk(this._table);if((this._row_headings.length>1&&this._col_headings.length==1)||this._row_headings.length<this._col_headings.length){if(!this._swap){this._transpose()}}else{if(this._swap){this._transpose()}}Bluff.each(this._col_headings,function(B,A){this.get_series(A-this._col_offset).name=B},this);Bluff.each(this._row_headings,function(B,A){this._labels[A-this._row_offset]=B},this)},_walk:function(C){this._visit(C);var B,A=C.childNodes,D=A.length;for(B=0;B<D;B++){this._walk(A[B])}},_visit:function(C){if(!C.tagName){return }var B=this._strip_tags(C.innerHTML),A,D;switch(C.tagName.toUpperCase()){case"TR":if(!this._has_data){this._row_offset=this._row}this._row+=1;this._col=0;break;case"TD":if(!this._has_data){this._col_offset=this._col}this._col+=1;B=parseFloat(B.match(this.NUMBER_FORMAT)[0]);if(typeof B=="number"){this._has_data=true;A=this._col-this._col_offset-1;D=this._row-this._row_offset-1;this.get_series(A).points[D]=parseFloat(B)}break;case"TH":this._col+=1;if(this._col==1&&this._row==1){this._row_headings[0]=this._col_headings[0]=B}else{if(C.scope=="row"||this._col==1){this._row_headings[this._row-1]=B}else{this._col_headings[this._col-1]=B}}break;case"CAPTION":this._title=B;break}},_transpose:function(){var B=this._data,A;this._data=[];Bluff.each(B,function(D,C){Bluff.each(D.points,function(E,F){this.get_series(F).points[C]=E},this)},this);A=this._row_headings;this._row_headings=this._col_headings;this._col_headings=A;A=this._row_offset;this._row_offset=this._col_offset;this._col_offset=A},_strip_tags:function(A){return A.replace(/<\/?[^>]+>/gi,"")},extend:{Mixin:new JS.Module({data_from_table:function(D,C){var B=new Bluff.TableReader(D,C),A=B.get_data();Bluff.each(A,function(E){this.data(E.name,E.points)},this);this.labels=B.get_labels();this.title=B.get_title()||this.title}})}});Bluff.Base.include(Bluff.TableReader.Mixin);holmz={VERSION:"09.06.16",array_equal:function(D,C){if(!D[0]||!C[0]){return false}if(D.length!=C.length){return false}var B=new Array();for(var E=0;E<D.length;E++){if(typeof (D[E])!="object"){if((typeof (C[E])=="object")||(D[E]!==C[E])){return false}}else{B.push(E)}}for(var E in B){for(var A in D[E]){if(!A in C[E]){return false}else{if(D[E][A]!=C[E][A]){return false}}}for(var A in C[E]){if(!A in D[E]){return false}else{if(D[E][A]!=C[E][A]){return false}}}}return true},decimate_with_padding:function(D,B){var A=new Array();for(var C=0;C<D.length;C=C+B){A[C]=D[C]}return A}};holmz.hQuerier=new JS.Class({QUERY_URL:"http://www.holmz.org/api/query",initialize:function(A){this.api_key=A},issue_query:function(B,C){var A=this.QUERY_URL+"?api_token="+this.api_key+"&query="+encodeURIComponent(B)+"&callback=?";$.getJSON(A,function(D){C(new holmz.qResult(D.result))})}});holmz.qResult=new JS.Class({initialize:function(A){this.result=A},clone:function(){return new holmz.qResult(this.result.concat())},getResult:function(){return this.result},getNumberData:function(){return this.result.length},getLabels:function(){var B=new Array();for(var A=0;A<this.result.length;A=A+1){$.each(this.result[A],function(C){if($.inArray(C,B)==-1){B.push(C)}})}return B},sortByLabel:function(A){var B=this.result.concat();B.sort(function(D,C){return D[A]-C[A]});return new holmz.qResult(B)},reverseSortByLabel:function(A){var B=this.result.concat();B.sort(function(D,C){return C[A]-D[A]});return new holmz.qResult(B)},renameLabel:function(B,C){var A=this.result.concat();for(var D=0;D<A.length;D=D+1){if(B in A[D]){A[D][C]=A[D][B];delete A[D][B]}}return new holmz.qResult(A)},toString:function(B,A){return($.map(this.result,B)).join(A)},toArray:function(A){return $.map(this.result,function(B){return B[A]})},extractLabels:function(E){var B=new Array();for(var D=0;D<this.result.length;D=D+1){var A=false;var C={};$.each(this.result[D],function(F,G){if($.inArray(F,E)!=-1){C[F]=G;A=true}});if(A){B.push(C)}}return new holmz.qResult(B)}});holmz.qResults=new JS.Class({initialize:function(A){this.results=new Array();this.number_results=0;for(var B in A){this.add(B,A[B])}},add:function(A,B){this.results[A]=B.clone();this.number_results++},get:function(A){return this.results[A]},getAll:function(){return this.results},getNumberResults:function(){return this.number_results},getLabels:function(){var D=new Array();for(var A in this.results){var C=this.results[A].getLabels();for(var B=0;B<C.length;B++){if($.inArray(C[B],D)==-1){D.push(C[B])}}}return D},renameLabels:function(B,D){var A={};for(var C in this.results){A[C]=this.results[C].renameLabel(B,D)}return new holmz.qResults(A)},extractLabel:function(B){var D=this.normalize(B);var C=D.getAll();for(var A in C){return C[A].toArray(B)}},normalize:function(M){var G=this.getLabels();var E=new Array();var H=new Array();var I=new Array();var N=new Array();for(var A in this.results){E[A]=0;H[A]={};for(var K=0;K<G.length;K++){H[A][G[K]]=0}I[A]=this.results[A].sortByLabel(M).getResult();N[A]=new Array()}while(true){var D=true;var J="";for(var A in E){var L=E[A];if(L<I[A].length){if(J==""){J=A}D=false;if(I[A][L][M]<I[J][E[J]][M]){J=A}}}if(D){break}var C=I[J][E[J]][M];for(var A in I){var B={};B[M]=C;if(E[A]>=I[A].length){for(var K=0;K<G.length;K++){if(G[K]!=M){B[G[K]]=H[A][G[K]]}}N[A].push(B)}else{if(I[A][E[A]][M]==C){for(var K=0;K<G.length;K++){if(G[K]!=M){if(G[K] in I[A][E[A]]){B[G[K]]=I[A][E[A]][G[K]]}else{B[G[K]]=H[A][G[K]]}}}N[A].push(B);H[A]=B;E[A]=E[A]+1}else{for(var K=0;K<G.length;K++){if(G[K]!=M){B[G[K]]=H[A][G[K]]}}N[A].push(B)}}}}var F=new holmz.qResults();for(var A in N){F.add(A,new holmz.qResult(N[A]))}return F}});