/* mootools.js */

var MooTools={version:'1.12'};function $defined(obj){return(obj!=undefined);};function $type(obj){if(!$defined(obj))return false;if(obj.htmlElement)return'element';var type=typeof obj;if(type=='object'&&obj.nodeName){switch(obj.nodeType){case 1:return'element';case 3:return(/\S/).test(obj.nodeValue)?'textnode':'whitespace';}}
if(type=='object'||type=='function'){switch(obj.constructor){case Array:return'array';case RegExp:return'regexp';case Class:return'class';}
if(typeof obj.length=='number'){if(obj.item)return'collection';if(obj.callee)return'arguments';}}
return type;};function $merge(){var mix={};for(var i=0;i<arguments.length;i++){for(var property in arguments[i]){var ap=arguments[i][property];var mp=mix[property];if(mp&&$type(ap)=='object'&&$type(mp)=='object')mix[property]=$merge(mp,ap);else mix[property]=ap;}}
return mix;};var $extend=function(){var args=arguments;if(!args[1])args=[this,args[0]];for(var property in args[1])args[0][property]=args[1][property];return args[0];};var $native=function(){for(var i=0,l=arguments.length;i<l;i++){arguments[i].extend=function(props){for(var prop in props){if(!this.prototype[prop])this.prototype[prop]=props[prop];if(!this[prop])this[prop]=$native.generic(prop);}};}};$native.generic=function(prop){return function(bind){return this.prototype[prop].apply(bind,Array.prototype.slice.call(arguments,1));};};$native(Function,Array,String,Number);function $chk(obj){return!!(obj||obj===0);};function $pick(obj,picked){return $defined(obj)?obj:picked;};function $random(min,max){return Math.floor(Math.random()*(max-min+1)+min);};function $time(){return new Date().getTime();};function $clear(timer){clearTimeout(timer);clearInterval(timer);return null;};var Abstract=function(obj){obj=obj||{};obj.extend=$extend;return obj;};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName('head')[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject)window.ie=window[window.XMLHttpRequest?'ie7':'ie6']=true;else if(document.childNodes&&!document.all&&!navigator.taintEnabled)window.webkit=window[window.xpath?'webkit420':'webkit419']=true;else if(document.getBoxObjectFor!=null||window.mozInnerScreenX!=null)window.gecko=true;window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=='undefined'){var HTMLElement=function(){};if(window.webkit)document.createElement("iframe");HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{};}
HTMLElement.prototype.htmlElement=function(){};if(window.ie6)try{document.execCommand("BackgroundImageCache",false,true);}catch(e){};var Class=function(properties){var klass=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=='function')?this.initialize.apply(this,arguments):this;};$extend(klass,this);klass.prototype=properties;klass.constructor=Class;return klass;};Class.empty=function(){};Class.prototype={extend:function(properties){var proto=new this(null);for(var property in properties){var pp=proto[property];proto[property]=Class.Merge(pp,properties[property]);}
return new Class(proto);},implement:function(){for(var i=0,l=arguments.length;i<l;i++)$extend(this.prototype,arguments[i]);}};Class.Merge=function(previous,current){if(previous&&previous!=current){var type=$type(current);if(type!=$type(previous))return current;switch(type){case'function':var merged=function(){this.parent=arguments.callee.parent;return current.apply(this,arguments);};merged.parent=previous;return merged;case'object':return $merge(previous,current);}}
return current;};var Chain=new Class({chain:function(fn){this.chains=this.chains||[];this.chains.push(fn);return this;},callChain:function(){if(this.chains&&this.chains.length)this.chains.shift().delay(10,this);},clearChain:function(){this.chains=[];}});var Events=new Class({addEvent:function(type,fn){if(fn!=Class.empty){this.$events=this.$events||{};this.$events[type]=this.$events[type]||[];this.$events[type].include(fn);}
return this;},fireEvent:function(type,args,delay){if(this.$events&&this.$events[type]){this.$events[type].each(function(fn){fn.create({'bind':this,'delay':delay,'arguments':args})();},this);}
return this;},removeEvent:function(type,fn){if(this.$events&&this.$events[type])this.$events[type].remove(fn);return this;}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent){for(var option in this.options){if($type(this.options[option]=='function')&&(/^on[A-Z]/).test(option))this.addEvent(option,this.options[option]);}}
return this;}});Array.extend({forEach:function(fn,bind){for(var i=0,j=this.length;i<j;i++)fn.call(bind,this[i],i,this);},filter:function(fn,bind){var results=[];for(var i=0,j=this.length;i<j;i++){if(fn.call(bind,this[i],i,this))results.push(this[i]);}
return results;},map:function(fn,bind){var results=[];for(var i=0,j=this.length;i<j;i++)results[i]=fn.call(bind,this[i],i,this);return results;},every:function(fn,bind){for(var i=0,j=this.length;i<j;i++){if(!fn.call(bind,this[i],i,this))return false;}
return true;},some:function(fn,bind){for(var i=0,j=this.length;i<j;i++){if(fn.call(bind,this[i],i,this))return true;}
return false;},indexOf:function(item,from){var len=this.length;for(var i=(from<0)?Math.max(0,len+from):from||0;i<len;i++){if(this[i]===item)return i;}
return-1;},copy:function(start,length){start=start||0;if(start<0)start=this.length+start;length=length||(this.length-start);var newArray=[];for(var i=0;i<length;i++)newArray[i]=this[start++];return newArray;},remove:function(item){var i=0;var len=this.length;while(i<len){if(this[i]===item){this.splice(i,1);len--;}else{i++;}}
return this;},contains:function(item,from){return this.indexOf(item,from)!=-1;},associate:function(keys){var obj={},length=Math.min(this.length,keys.length);for(var i=0;i<length;i++)obj[keys[i]]=this[i];return obj;},extend:function(array){for(var i=0,j=array.length;i<j;i++)this.push(array[i]);return this;},merge:function(array){for(var i=0,l=array.length;i<l;i++)this.include(array[i]);return this;},include:function(item){if(!this.contains(item))this.push(item);return this;},getRandom:function(){return this[$random(0,this.length-1)]||null;},getLast:function(){return this[this.length-1]||null;}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(array){return Array.copy(array);};function $each(iterable,fn,bind){if(iterable&&typeof iterable.length=='number'&&$type(iterable)!='object'){Array.forEach(iterable,fn,bind);}else{for(var name in iterable)fn.call(bind||iterable,iterable[name],name);}};Array.prototype.test=Array.prototype.contains;String.extend({test:function(regex,params){return(($type(regex)=='string')?new RegExp(regex,params):regex).test(this);},toInt:function(){return parseInt(this,10);},toFloat:function(){return parseFloat(this);},camelCase:function(){return this.replace(/-\D/g,function(match){return match.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(match){return(match.charAt(0)+'-'+match.charAt(1).toLowerCase());});},capitalize:function(){return this.replace(/\b[a-z]/g,function(match){return match.toUpperCase();});},trim:function(){return this.replace(/^\s+|\s+$/g,'');},clean:function(){return this.replace(/\s{2,}/g,' ').trim();},rgbToHex:function(array){var rgb=this.match(/\d{1,3}/g);return(rgb)?rgb.rgbToHex(array):false;},hexToRgb:function(array){var hex=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(hex)?hex.slice(1).hexToRgb(array):false;},contains:function(string,s){return(s)?(s+this+s).indexOf(s+string+s)>-1:this.indexOf(string)>-1;},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,'\\$1');}});Array.extend({rgbToHex:function(array){if(this.length<3)return false;if(this.length==4&&this[3]==0&&!array)return'transparent';var hex=[];for(var i=0;i<3;i++){var bit=(this[i]-0).toString(16);hex.push((bit.length==1)?'0'+bit:bit);}
return array?hex:'#'+hex.join('');},hexToRgb:function(array){if(this.length!=3)return false;var rgb=[];for(var i=0;i<3;i++){rgb.push(parseInt((this[i].length==1)?this[i]+this[i]:this[i],16));}
return array?rgb:'rgb('+rgb.join(',')+')';}});Function.extend({create:function(options){var fn=this;options=$merge({'bind':fn,'event':false,'arguments':null,'delay':false,'periodical':false,'attempt':false},options);if($chk(options.arguments)&&$type(options.arguments)!='array')options.arguments=[options.arguments];return function(event){var args;if(options.event){event=event||window.event;args=[(options.event===true)?event:new options.event(event)];if(options.arguments)args.extend(options.arguments);}
else args=options.arguments||arguments;var returns=function(){return fn.apply($pick(options.bind,fn),args);};if(options.delay)return setTimeout(returns,options.delay);if(options.periodical)return setInterval(returns,options.periodical);if(options.attempt)try{return returns();}catch(err){return false;};return returns();};},pass:function(args,bind){return this.create({'arguments':args,'bind':bind});},attempt:function(args,bind){return this.create({'arguments':args,'bind':bind,'attempt':true})();},bind:function(bind,args){return this.create({'bind':bind,'arguments':args});},bindAsEventListener:function(bind,args){return this.create({'bind':bind,'event':true,'arguments':args});},delay:function(delay,bind,args){return this.create({'delay':delay,'bind':bind,'arguments':args})();},periodical:function(interval,bind,args){return this.create({'periodical':interval,'bind':bind,'arguments':args})();}});Number.extend({toInt:function(){return parseInt(this);},toFloat:function(){return parseFloat(this);},limit:function(min,max){return Math.min(max,Math.max(min,this));},round:function(precision){precision=Math.pow(10,precision||0);return Math.round(this*precision)/precision;},times:function(fn){for(var i=0;i<this;i++)fn(i);}});var Element=new Class({initialize:function(el,props){if($type(el)=='string'){if(window.ie&&props&&(props.name||props.type)){var name=(props.name)?' name="'+props.name+'"':'';var type=(props.type)?' type="'+props.type+'"':'';delete props.name;delete props.type;el='<'+el+name+type+'>';}
el=document.createElement(el);}
el=$(el);return(!props||!el)?el:el.set(props);}});var Elements=new Class({initialize:function(elements){return(elements)?$extend(elements,this):this;}});Elements.extend=function(props){for(var prop in props){this.prototype[prop]=props[prop];this[prop]=$native.generic(prop);}};function $(el){if(!el)return null;if(el.htmlElement)return Garbage.collect(el);if([window,document].contains(el))return el;var type=$type(el);if(type=='string'){el=document.getElementById(el);type=(el)?'element':false;}
if(type!='element')return null;if(el.htmlElement)return Garbage.collect(el);if(['object','embed'].contains(el.tagName.toLowerCase()))return el;$extend(el,Element.prototype);el.htmlElement=function(){};return Garbage.collect(el);};document.getElementsBySelector=document.getElementsByTagName;function $$(){var elements=[];for(var i=0,j=arguments.length;i<j;i++){var selector=arguments[i];switch($type(selector)){case'element':elements.push(selector);case'boolean':break;case false:break;case'string':selector=document.getElementsBySelector(selector,true);default:elements.extend(selector);}}
return $$.unique(elements);};$$.unique=function(array){var elements=[];for(var i=0,l=array.length;i<l;i++){if(array[i].$included)continue;var element=$(array[i]);if(element&&!element.$included){element.$included=true;elements.push(element);}}
for(var n=0,d=elements.length;n<d;n++)elements[n].$included=null;return new Elements(elements);};Elements.Multi=function(property){return function(){var args=arguments;var items=[];var elements=true;for(var i=0,j=this.length,returns;i<j;i++){returns=this[i][property].apply(this[i],args);if($type(returns)!='element')elements=false;items.push(returns);};return(elements)?$$.unique(items):items;};};Element.extend=function(properties){for(var property in properties){HTMLElement.prototype[property]=properties[property];Element.prototype[property]=properties[property];Element[property]=$native.generic(property);var elementsProperty=(Array.prototype[property])?property+'Elements':property;Elements.prototype[elementsProperty]=Elements.Multi(property);}};Element.extend({set:function(props){for(var prop in props){var val=props[prop];switch(prop){case'styles':this.setStyles(val);break;case'events':if(this.addEvents)this.addEvents(val);break;case'properties':this.setProperties(val);break;default:this.setProperty(prop,val);}}
return this;},inject:function(el,where){el=$(el);switch(where){case'before':el.parentNode.insertBefore(this,el);break;case'after':var next=el.getNext();if(!next)el.parentNode.appendChild(this);else el.parentNode.insertBefore(this,next);break;case'top':var first=el.firstChild;if(first){el.insertBefore(this,first);break;}
default:el.appendChild(this);}
return this;},injectBefore:function(el){return this.inject(el,'before');},injectAfter:function(el){return this.inject(el,'after');},injectInside:function(el){return this.inject(el,'bottom');},injectTop:function(el){return this.inject(el,'top');},adopt:function(){var elements=[];$each(arguments,function(argument){elements=elements.concat(argument);});$$(elements).inject(this);return this;},remove:function(){return this.parentNode.removeChild(this);},clone:function(contents){var el=$(this.cloneNode(contents!==false));if(!el.$events)return el;el.$events={};for(var type in this.$events)el.$events[type]={'keys':$A(this.$events[type].keys),'values':$A(this.$events[type].values)};return el.removeEvents();},replaceWith:function(el){el=$(el);this.parentNode.replaceChild(el,this);return el;},appendText:function(text){this.appendChild(document.createTextNode(text));return this;},hasClass:function(className){return this.className.contains(className,' ');},addClass:function(className){if(!this.hasClass(className))this.className=(this.className+' '+className).clean();return this;},removeClass:function(className){this.className=this.className.replace(new RegExp('(^|\\s)'+className+'(?:\\s|$)'),'$1').clean();return this;},toggleClass:function(className){return this.hasClass(className)?this.removeClass(className):this.addClass(className);},setStyle:function(property,value){switch(property){case'opacity':return this.setOpacity(parseFloat(value));case'float':property=(window.ie)?'styleFloat':'cssFloat';}
property=property.camelCase();switch($type(value)){case'number':if(!['zIndex','zoom'].contains(property))value+='px';break;case'array':value='rgb('+value.join(',')+')';}
this.style[property]=value;return this;},setStyles:function(source){switch($type(source)){case'object':Element.setMany(this,'setStyle',source);break;case'string':this.style.cssText=source;}
return this;},setOpacity:function(opacity){if(opacity==0){if(this.style.visibility!="hidden")this.style.visibility="hidden";}else{if(this.style.visibility!="visible")this.style.visibility="visible";}
if(!this.currentStyle||!this.currentStyle.hasLayout)this.style.zoom=1;if(window.ie)this.style.filter=(opacity==1)?'':"alpha(opacity="+opacity*100+")";this.style.opacity=this.$tmp.opacity=opacity;return this;},getStyle:function(property){property=property.camelCase();var result=this.style[property];if(!$chk(result)){if(property=='opacity')return this.$tmp.opacity;result=[];for(var style in Element.Styles){if(property==style){Element.Styles[style].each(function(s){var style=this.getStyle(s);result.push(parseInt(style)?style:'0px');},this);if(property=='border'){var every=result.every(function(bit){return(bit==result[0]);});return(every)?result[0]:false;}
return result.join(' ');}}
if(property.contains('border')){if(Element.Styles.border.contains(property)){return['Width','Style','Color'].map(function(p){return this.getStyle(property+p);},this).join(' ');}else if(Element.borderShort.contains(property)){return['Top','Right','Bottom','Left'].map(function(p){return this.getStyle('border'+p+property.replace('border',''));},this).join(' ');}}
if(document.defaultView)result=document.defaultView.getComputedStyle(this,null).getPropertyValue(property.hyphenate());else if(this.currentStyle)result=this.currentStyle[property];}
if(window.ie)result=Element.fixStyle(property,result,this);if(result&&property.test(/color/i)&&result.contains('rgb')){return result.split('rgb').splice(1,4).map(function(color){return color.rgbToHex();}).join(' ');}
return result;},getStyles:function(){return Element.getMany(this,'getStyle',arguments);},walk:function(brother,start){brother+='Sibling';var el=(start)?this[start]:this[brother];while(el&&$type(el)!='element')el=el[brother];return $(el);},getPrevious:function(){return this.walk('previous');},getNext:function(){return this.walk('next');},getFirst:function(){return this.walk('next','firstChild');},getLast:function(){return this.walk('previous','lastChild');},getParent:function(){return $(this.parentNode);},getChildren:function(){return $$(this.childNodes);},hasChild:function(el){return!!$A(this.getElementsByTagName('*')).contains(el);},getProperty:function(property){var index=Element.Properties[property];if(index)return this[index];var flag=Element.PropertiesIFlag[property]||0;if(!window.ie||flag)return this.getAttribute(property,flag);var node=this.attributes[property];return(node)?node.nodeValue:null;},removeProperty:function(property){var index=Element.Properties[property];if(index)this[index]='';else this.removeAttribute(property);return this;},getProperties:function(){return Element.getMany(this,'getProperty',arguments);},setProperty:function(property,value){var index=Element.Properties[property];if(index)this[index]=value;else this.setAttribute(property,value);return this;},setProperties:function(source){return Element.setMany(this,'setProperty',source);},setHTML:function(){this.innerHTML=$A(arguments).join('');return this;},setText:function(text){var tag=this.getTag();if(['style','script'].contains(tag)){if(window.ie){if(tag=='style')this.styleSheet.cssText=text;else if(tag=='script')this.setProperty('text',text);return this;}else{this.removeChild(this.firstChild);return this.appendText(text);}}
this[$defined(this.innerText)?'innerText':'textContent']=text;return this;},getText:function(){var tag=this.getTag();if(['style','script'].contains(tag)){if(window.ie){if(tag=='style')return this.styleSheet.cssText;else if(tag=='script')return this.getProperty('text');}else{return this.innerHTML;}}
return($pick(this.innerText,this.textContent));},getTag:function(){return this.tagName.toLowerCase();},empty:function(){Garbage.trash(this.getElementsByTagName('*'));return this.setHTML('');}});Element.fixStyle=function(property,result,element){if($chk(parseInt(result)))return result;if(['height','width'].contains(property)){var values=(property=='width')?['left','right']:['top','bottom'];var size=0;values.each(function(value){size+=element.getStyle('border-'+value+'-width').toInt()+element.getStyle('padding-'+value).toInt();});return element['offset'+property.capitalize()]-size+'px';}else if(property.test(/border(.+)Width|margin|padding/)){return'0px';}
return result;};Element.Styles={'border':[],'padding':[],'margin':[]};['Top','Right','Bottom','Left'].each(function(direction){for(var style in Element.Styles)Element.Styles[style].push(style+direction);});Element.borderShort=['borderWidth','borderStyle','borderColor'];Element.getMany=function(el,method,keys){var result={};$each(keys,function(key){result[key]=el[method](key);});return result;};Element.setMany=function(el,method,pairs){for(var key in pairs)el[method](key,pairs[key]);return el;};Element.Properties=new Abstract({'class':'className','for':'htmlFor','colspan':'colSpan','rowspan':'rowSpan','accesskey':'accessKey','tabindex':'tabIndex','maxlength':'maxLength','readonly':'readOnly','frameborder':'frameBorder','value':'value','disabled':'disabled','checked':'checked','multiple':'multiple','selected':'selected'});Element.PropertiesIFlag={'href':2,'src':2};Element.Methods={Listeners:{addListener:function(type,fn){if(this.addEventListener)this.addEventListener(type,fn,false);else this.attachEvent('on'+type,fn);return this;},removeListener:function(type,fn){if(this.removeEventListener)this.removeEventListener(type,fn,false);else this.detachEvent('on'+type,fn);return this;}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(el){if(!el.$tmp){Garbage.elements.push(el);el.$tmp={'opacity':1};}
return el;},trash:function(elements){for(var i=0,j=elements.length,el;i<j;i++){if(!(el=elements[i])||!el.$tmp)continue;if(el.$events)el.fireEvent('trash').removeEvents();for(var p in el.$tmp)el.$tmp[p]=null;for(var d in Element.prototype)el[d]=null;Garbage.elements[Garbage.elements.indexOf(el)]=null;el.htmlElement=el.$tmp=el=null;}
Garbage.elements.remove(null);},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements);}};window.addListener('beforeunload',function(){window.addListener('unload',Garbage.empty);if(window.ie)window.addListener('unload',CollectGarbage);});var Event=new Class({initialize:function(event){if(event&&event.$extended)return event;this.$extended=true;event=event||window.event;this.event=event;this.type=event.type;this.target=event.target||event.srcElement;if(this.target.nodeType==3)this.target=this.target.parentNode;this.shift=event.shiftKey;this.control=event.ctrlKey;this.alt=event.altKey;this.meta=event.metaKey;if(['DOMMouseScroll','mousewheel'].contains(this.type)){this.wheel=(event.wheelDelta)?event.wheelDelta/120:-(event.detail||0)/3;}else if(this.type.contains('key')){this.code=event.which||event.keyCode;for(var name in Event.keys){if(Event.keys[name]==this.code){this.key=name;break;}}
if(this.type=='keydown'){var fKey=this.code-111;if(fKey>0&&fKey<13)this.key='f'+fKey;}
this.key=this.key||String.fromCharCode(this.code).toLowerCase();}else if(this.type.test(/(click|mouse|menu)/)){this.page={'x':event.pageX||event.clientX+document.documentElement.scrollLeft,'y':event.pageY||event.clientY+document.documentElement.scrollTop};this.client={'x':event.pageX?event.pageX-window.pageXOffset:event.clientX,'y':event.pageY?event.pageY-window.pageYOffset:event.clientY};this.rightClick=(event.which==3)||(event.button==2);switch(this.type){case'mouseover':this.relatedTarget=event.relatedTarget||event.fromElement;break;case'mouseout':this.relatedTarget=event.relatedTarget||event.toElement;}
this.fixRelatedTarget();}
return this;},stop:function(){return this.stopPropagation().preventDefault();},stopPropagation:function(){if(this.event.stopPropagation)this.event.stopPropagation();else this.event.cancelBubble=true;return this;},preventDefault:function(){if(this.event.preventDefault)this.event.preventDefault();else this.event.returnValue=false;return this;}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3)this.relatedTarget=this.relatedTarget.parentNode;},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this);}catch(e){this.relatedTarget=this.target;}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({'enter':13,'up':38,'down':40,'left':37,'right':39,'esc':27,'space':32,'backspace':8,'tab':9,'delete':46});Element.Methods.Events={addEvent:function(type,fn){this.$events=this.$events||{};this.$events[type]=this.$events[type]||{'keys':[],'values':[]};if(this.$events[type].keys.contains(fn))return this;this.$events[type].keys.push(fn);var realType=type;var custom=Element.Events[type];if(custom){if(custom.add)custom.add.call(this,fn);if(custom.map)fn=custom.map;if(custom.type)realType=custom.type;}
if(!this.addEventListener)fn=fn.create({'bind':this,'event':true});this.$events[type].values.push(fn);return(Element.NativeEvents.contains(realType))?this.addListener(realType,fn):this;},removeEvent:function(type,fn){if(!this.$events||!this.$events[type])return this;var pos=this.$events[type].keys.indexOf(fn);if(pos==-1)return this;var key=this.$events[type].keys.splice(pos,1)[0];var value=this.$events[type].values.splice(pos,1)[0];var custom=Element.Events[type];if(custom){if(custom.remove)custom.remove.call(this,fn);if(custom.type)type=custom.type;}
return(Element.NativeEvents.contains(type))?this.removeListener(type,value):this;},addEvents:function(source){return Element.setMany(this,'addEvent',source);},removeEvents:function(type){if(!this.$events)return this;if(!type){for(var evType in this.$events)this.removeEvents(evType);this.$events=null;}else if(this.$events[type]){this.$events[type].keys.each(function(fn){this.removeEvent(type,fn);},this);this.$events[type]=null;}
return this;},fireEvent:function(type,args,delay){if(this.$events&&this.$events[type]){this.$events[type].keys.each(function(fn){fn.create({'bind':this,'delay':delay,'arguments':args})();},this);}
return this;},cloneEvents:function(from,type){if(!from.$events)return this;if(!type){for(var evType in from.$events)this.cloneEvents(from,evType);}else if(from.$events[type]){from.$events[type].keys.each(function(fn){this.addEvent(type,fn);},this);}
return this;}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({'mouseenter':{type:'mouseover',map:function(event){event=new Event(event);if(event.relatedTarget!=this&&!this.hasChild(event.relatedTarget))this.fireEvent('mouseenter',event);}},'mouseleave':{type:'mouseout',map:function(event){event=new Event(event);if(event.relatedTarget!=this&&!this.hasChild(event.relatedTarget))this.fireEvent('mouseleave',event);}},'mousewheel':{type:(window.gecko)?'DOMMouseScroll':'mousewheel'}});Element.NativeEvents=['click','dblclick','mouseup','mousedown','mousewheel','DOMMouseScroll','mouseover','mouseout','mousemove','keydown','keypress','keyup','load','unload','beforeunload','resize','move','focus','blur','change','submit','reset','select','error','abort','contextmenu','scroll'];Function.extend({bindWithEvent:function(bind,args){return this.create({'bind':bind,'arguments':args,'event':Event});}});Elements.extend({filterByTag:function(tag){return new Elements(this.filter(function(el){return(Element.getTag(el)==tag);}));},filterByClass:function(className,nocash){var elements=this.filter(function(el){return(el.className&&el.className.contains(className,' '));});return(nocash)?elements:new Elements(elements);},filterById:function(id,nocash){var elements=this.filter(function(el){return(el.id==id);});return(nocash)?elements:new Elements(elements);},filterByAttribute:function(name,operator,value,nocash){var elements=this.filter(function(el){var current=Element.getProperty(el,name);if(!current)return false;if(!operator)return true;switch(operator){case'=':return(current==value);case'*=':return(current.contains(value));case'^=':return(current.substr(0,value.length)==value);case'$=':return(current.substr(current.length-value.length)==value);case'!=':return(current!=value);case'~=':return current.contains(value,' ');}
return false;});return(nocash)?elements:new Elements(elements);}});function $E(selector,filter){return($(filter)||document).getElement(selector);};function $ES(selector,filter){return($(filter)||document).getElementsBySelector(selector);};$$.shared={'regexp':/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,'xpath':{getParam:function(items,context,param,i){var temp=[context.namespaceURI?'xhtml:':'',param[1]];if(param[2])temp.push('[@id="',param[2],'"]');if(param[3])temp.push('[contains(concat(" ", @class, " "), " ',param[3],' ")]');if(param[4]){if(param[5]&&param[6]){switch(param[5]){case'*=':temp.push('[contains(@',param[4],', "',param[6],'")]');break;case'^=':temp.push('[starts-with(@',param[4],', "',param[6],'")]');break;case'$=':temp.push('[substring(@',param[4],', string-length(@',param[4],') - ',param[6].length,' + 1) = "',param[6],'"]');break;case'=':temp.push('[@',param[4],'="',param[6],'"]');break;case'!=':temp.push('[@',param[4],'!="',param[6],'"]');}}else{temp.push('[@',param[4],']');}}
items.push(temp.join(''));return items;},getItems:function(items,context,nocash){var elements=[];var xpath=document.evaluate('.//'+items.join('//'),context,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,j=xpath.snapshotLength;i<j;i++)elements.push(xpath.snapshotItem(i));return(nocash)?elements:new Elements(elements.map($));}},'normal':{getParam:function(items,context,param,i){if(i==0){if(param[2]){var el=context.getElementById(param[2]);if(!el||((param[1]!='*')&&(Element.getTag(el)!=param[1])))return false;items=[el];}else{items=$A(context.getElementsByTagName(param[1]));}}else{items=$$.shared.getElementsByTagName(items,param[1]);if(param[2])items=Elements.filterById(items,param[2],true);}
if(param[3])items=Elements.filterByClass(items,param[3],true);if(param[4])items=Elements.filterByAttribute(items,param[4],param[5],param[6],true);return items;},getItems:function(items,context,nocash){return(nocash)?items:$$.unique(items);}},resolver:function(prefix){return(prefix=='xhtml')?'http://www.w3.org/1999/xhtml':false;},getElementsByTagName:function(context,tagName){var found=[];for(var i=0,j=context.length;i<j;i++)found.extend(context[i].getElementsByTagName(tagName));return found;}};$$.shared.method=(window.xpath)?'xpath':'normal';Element.Methods.Dom={getElements:function(selector,nocash){var items=[];selector=selector.trim().split(' ');for(var i=0,j=selector.length;i<j;i++){var sel=selector[i];var param=sel.match($$.shared.regexp);if(!param)break;param[1]=param[1]||'*';var temp=$$.shared[$$.shared.method].getParam(items,this,param,i);if(!temp)break;items=temp;}
return $$.shared[$$.shared.method].getItems(items,this,nocash);},getElement:function(selector){return $(this.getElements(selector,true)[0]||false);},getElementsBySelector:function(selector,nocash){var elements=[];selector=selector.split(',');for(var i=0,j=selector.length;i<j;i++)elements=elements.concat(this.getElements(selector[i],true));return(nocash)?elements:$$.unique(elements);}};Element.extend({getElementById:function(id){var el=document.getElementById(id);if(!el)return false;for(var parent=el.parentNode;parent!=this;parent=parent.parentNode){if(!parent)return false;}
return el;},getElementsByClassName:function(className){return this.getElements('.'+className);}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case'select':var values=[];$each(this.options,function(option){if(option.selected)values.push($pick(option.value,option.text));});return(this.multiple)?values:values[0];case'input':if(!(this.checked&&['checkbox','radio'].contains(this.type))&&!['hidden','text','password'].contains(this.type))break;case'textarea':return this.value;}
return false;},getFormElements:function(){return $$(this.getElementsByTagName('input'),this.getElementsByTagName('select'),this.getElementsByTagName('textarea'));},toQueryString:function(){var queryString=[];this.getFormElements().each(function(el){var name=el.name;var value=el.getValue();if(value===false||!name||el.disabled)return;var qs=function(val){queryString.push(name+'='+encodeURIComponent(val));};if($type(value)=='array')value.each(qs);else qs(value);});return queryString.join('&');}});Element.extend({scrollTo:function(x,y){this.scrollLeft=x;this.scrollTop=y;},getSize:function(){return{'scroll':{'x':this.scrollLeft,'y':this.scrollTop},'size':{'x':this.offsetWidth,'y':this.offsetHeight},'scrollSize':{'x':this.scrollWidth,'y':this.scrollHeight}};},getPosition:function(overflown){overflown=overflown||[];var el=this,left=0,top=0;do{left+=el.offsetLeft||0;top+=el.offsetTop||0;el=el.offsetParent;}while(el);overflown.each(function(element){left-=element.scrollLeft||0;top-=element.scrollTop||0;});return{'x':left,'y':top};},getTop:function(overflown){return this.getPosition(overflown).y;},getLeft:function(overflown){return this.getPosition(overflown).x;},getCoordinates:function(overflown){var position=this.getPosition(overflown);var obj={'width':this.offsetWidth,'height':this.offsetHeight,'left':position.x,'top':position.y};obj.right=obj.left+obj.width;obj.bottom=obj.top+obj.height;return obj;}});Element.Events.domready={add:function(fn){if(window.loaded){fn.call(this);return;}
var domReady=function(){if(window.loaded)return;window.loaded=true;window.timer=$clear(window.timer);this.fireEvent('domready');}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(['loaded','complete'].contains(document.readyState))domReady();}.periodical(50);}else if(document.readyState&&window.ie){if(!$('ie_ready')){var src=(window.location.protocol=='https:')?'://0':'javascript:void(0)';document.write('<script id="ie_ready" defer src="'+src+'"><\/script>');$('ie_ready').onreadystatechange=function(){if(this.readyState=='complete')domReady();};}}else{window.addListener("load",domReady);document.addListener("DOMContentLoaded",domReady);}}};window.onDomReady=function(fn){return this.addEvent('domready',fn);};window.extend({getWidth:function(){if(this.webkit419)return this.innerWidth;if(this.opera)return document.body.clientWidth;return document.documentElement.clientWidth;},getHeight:function(){if(this.webkit419)return this.innerHeight;if(this.opera)return document.body.clientHeight;return document.documentElement.clientHeight;},getScrollWidth:function(){if(this.ie)return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth);if(this.webkit)return document.body.scrollWidth;return document.documentElement.scrollWidth;},getScrollHeight:function(){if(this.ie)return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight);if(this.webkit)return document.body.scrollHeight;return document.documentElement.scrollHeight;},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft;},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop;},getSize:function(){return{'size':{'x':this.getWidth(),'y':this.getHeight()},'scrollSize':{'x':this.getScrollWidth(),'y':this.getScrollHeight()},'scroll':{'x':this.getScrollLeft(),'y':this.getScrollTop()}};},getPosition:function(){return{'x':0,'y':0};}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(p){return-(Math.cos(Math.PI*p)-1)/2;},duration:500,unit:'px',wait:true,fps:50},initialize:function(options){this.element=this.element||null;this.setOptions(options);if(this.options.initialize)this.options.initialize.call(this);},step:function(){var time=$time();if(time<this.time+this.options.duration){this.delta=this.options.transition((time-this.time)/this.options.duration);this.setNow();this.increase();}else{this.stop(true);this.set(this.to);this.fireEvent('onComplete',this.element,10);this.callChain();}},set:function(to){this.now=to;this.increase();return this;},setNow:function(){this.now=this.compute(this.from,this.to);},compute:function(from,to){return(to-from)*this.delta+from;},start:function(from,to){if(!this.options.wait)this.stop();else if(this.timer)return this;this.from=from;this.to=to;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);this.fireEvent('onStart',this.element);return this;},stop:function(end){if(!this.timer)return this;this.timer=$clear(this.timer);if(!end)this.fireEvent('onCancel',this.element);return this;},custom:function(from,to){return this.start(from,to);},clearTimer:function(end){return this.stop(end);}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(property,to){if(property.test(/color/i))return this.Color;var type=$type(to);if((type=='array')||(type=='string'&&to.contains(' ')))return this.Multi;return this.Single;},parse:function(el,property,fromTo){if(!fromTo.push)fromTo=[fromTo];var from=fromTo[0],to=fromTo[1];if(!$chk(to)){to=from;from=el.getStyle(property);}
var css=this.select(property,to);return{'from':css.parse(from),'to':css.parse(to),'css':css};}};Fx.CSS.Single={parse:function(value){return parseFloat(value);},getNow:function(from,to,fx){return fx.compute(from,to);},getValue:function(value,unit,property){if(unit=='px'&&property!='opacity')value=Math.round(value);return value+unit;}};Fx.CSS.Multi={parse:function(value){return value.push?value:value.split(' ').map(function(v){return parseFloat(v);});},getNow:function(from,to,fx){var now=[];for(var i=0;i<from.length;i++)now[i]=fx.compute(from[i],to[i]);return now;},getValue:function(value,unit,property){if(unit=='px'&&property!='opacity')value=value.map(Math.round);return value.join(unit+' ')+unit;}};Fx.CSS.Color={parse:function(value){return value.push?value:value.hexToRgb(true);},getNow:function(from,to,fx){var now=[];for(var i=0;i<from.length;i++)now[i]=Math.round(fx.compute(from[i],to[i]));return now;},getValue:function(value){return'rgb('+value.join(',')+')';}};Fx.Style=Fx.Base.extend({initialize:function(el,property,options){this.element=$(el);this.property=property;this.parent(options);},hide:function(){return this.set(0);},setNow:function(){this.now=this.css.getNow(this.from,this.to,this);},set:function(to){this.css=Fx.CSS.select(this.property,to);return this.parent(this.css.parse(to));},start:function(from,to){if(this.timer&&this.options.wait)return this;var parsed=Fx.CSS.parse(this.element,this.property,[from,to]);this.css=parsed.css;return this.parent(parsed.from,parsed.to);},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property));}});Element.extend({effect:function(property,options){return new Fx.Style(this,property,options);}});Fx.Styles=Fx.Base.extend({initialize:function(el,options){this.element=$(el);this.parent(options);},setNow:function(){for(var p in this.from)this.now[p]=this.css[p].getNow(this.from[p],this.to[p],this);},set:function(to){var parsed={};this.css={};for(var p in to){this.css[p]=Fx.CSS.select(p,to[p]);parsed[p]=this.css[p].parse(to[p]);}
return this.parent(parsed);},start:function(obj){if(this.timer&&this.options.wait)return this;this.now={};this.css={};var from={},to={};for(var p in obj){var parsed=Fx.CSS.parse(this.element,p,obj[p]);from[p]=parsed.from;to[p]=parsed.to;this.css[p]=parsed.css;}
return this.parent(from,to);},increase:function(){for(var p in this.now)this.element.setStyle(p,this.css[p].getValue(this.now[p],this.options.unit,p));}});Element.extend({effects:function(options){return new Fx.Styles(this,options);}});Fx.Elements=Fx.Base.extend({initialize:function(elements,options){this.elements=$$(elements);this.parent(options);},setNow:function(){for(var i in this.from){var iFrom=this.from[i],iTo=this.to[i],iCss=this.css[i],iNow=this.now[i]={};for(var p in iFrom)iNow[p]=iCss[p].getNow(iFrom[p],iTo[p],this);}},set:function(to){var parsed={};this.css={};for(var i in to){var iTo=to[i],iCss=this.css[i]={},iParsed=parsed[i]={};for(var p in iTo){iCss[p]=Fx.CSS.select(p,iTo[p]);iParsed[p]=iCss[p].parse(iTo[p]);}}
return this.parent(parsed);},start:function(obj){if(this.timer&&this.options.wait)return this;this.now={};this.css={};var from={},to={};for(var i in obj){var iProps=obj[i],iFrom=from[i]={},iTo=to[i]={},iCss=this.css[i]={};for(var p in iProps){var parsed=Fx.CSS.parse(this.elements[i],p,iProps[p]);iFrom[p]=parsed.from;iTo[p]=parsed.to;iCss[p]=parsed.css;}}
return this.parent(from,to);},increase:function(){for(var i in this.now){var iNow=this.now[i],iCss=this.css[i];for(var p in iNow)this.elements[i].setStyle(p,iCss[p].getValue(iNow[p],this.options.unit,p));}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{'x':0,'y':0},wheelStops:true},initialize:function(element,options){this.now=[];this.element=$(element);this.bound={'stop':this.stop.bind(this,false)};this.parent(options);if(this.options.wheelStops){this.addEvent('onStart',function(){document.addEvent('mousewheel',this.bound.stop);}.bind(this));this.addEvent('onComplete',function(){document.removeEvent('mousewheel',this.bound.stop);}.bind(this));}},setNow:function(){for(var i=0;i<2;i++)this.now[i]=this.compute(this.from[i],this.to[i]);},scrollTo:function(x,y){if(this.timer&&this.options.wait)return this;var el=this.element.getSize();var values={'x':x,'y':y};for(var z in el.size){var max=el.scrollSize[z]-el.size[z];if($chk(values[z]))values[z]=($type(values[z])=='number')?values[z].limit(0,max):max;else values[z]=el.scroll[z];values[z]+=this.options.offset[z];}
return this.start([el.scroll.x,el.scroll.y],[values.x,values.y]);},toTop:function(){return this.scrollTo(false,0);},toBottom:function(){return this.scrollTo(false,'full');},toLeft:function(){return this.scrollTo(0,false);},toRight:function(){return this.scrollTo('full',false);},toElement:function(el){var parent=this.element.getPosition(this.options.overflown);var target=$(el).getPosition(this.options.overflown);return this.scrollTo(target.x-parent.x,target.y-parent.y);},increase:function(){this.element.scrollTo(this.now[0],this.now[1]);}});Fx.Slide=Fx.Base.extend({options:{mode:'vertical'},initialize:function(el,options){this.element=$(el);this.wrapper=new Element('div',{'styles':$extend(this.element.getStyles('margin'),{'overflow':'hidden'})}).injectAfter(this.element).adopt(this.element);this.element.setStyle('margin',0);this.setOptions(options);this.now=[];this.parent(this.options);this.open=true;this.addEvent('onComplete',function(){this.open=(this.now[0]===0);});if(window.webkit419)this.addEvent('onComplete',function(){if(this.open)this.element.remove().inject(this.wrapper);});},setNow:function(){for(var i=0;i<2;i++)this.now[i]=this.compute(this.from[i],this.to[i]);},vertical:function(){this.margin='margin-top';this.layout='height';this.offset=this.element.offsetHeight;},horizontal:function(){this.margin='margin-left';this.layout='width';this.offset=this.element.offsetWidth;},slideIn:function(mode){this[mode||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset]);},slideOut:function(mode){this[mode||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0]);},hide:function(mode){this[mode||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(mode){this[mode||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(mode){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0)return this.slideIn(mode);return this.slideOut(mode);},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit);}});Fx.Transition=function(transition,params){params=params||[];if($type(params)!='array')params=[params];return $extend(transition,{easeIn:function(pos){return transition(pos,params);},easeOut:function(pos){return 1-transition(1-pos,params);},easeInOut:function(pos){return(pos<=0.5)?transition(2*pos,params)/2:(2-transition(2*(1-pos),params))/2;}});};Fx.Transitions=new Abstract({linear:function(p){return p;}});Fx.Transitions.extend=function(transitions){for(var transition in transitions){Fx.Transitions[transition]=new Fx.Transition(transitions[transition]);Fx.Transitions.compat(transition);}};Fx.Transitions.compat=function(transition){['In','Out','InOut'].each(function(easeType){Fx.Transitions[transition.toLowerCase()+easeType]=Fx.Transitions[transition]['ease'+easeType];});};Fx.Transitions.extend({Pow:function(p,x){return Math.pow(p,x[0]||6);},Expo:function(p){return Math.pow(2,8*(p-1));},Circ:function(p){return 1-Math.sin(Math.acos(p));},Sine:function(p){return 1-Math.sin((1-p)*Math.PI/2);},Back:function(p,x){x=x[0]||1.618;return Math.pow(p,2)*((x+1)*p-x);},Bounce:function(p){var value;for(var a=0,b=1;1;a+=b,b/=2){if(p>=(7-4*a)/11){value=-Math.pow((11-6*a-11*p)/4,2)+b*b;break;}}
return value;},Elastic:function(p,x){return Math.pow(2,10*--p)*Math.cos(20*p*Math.PI*(x[0]||1)/3);}});['Quad','Cubic','Quart','Quint'].each(function(transition,i){Fx.Transitions[transition]=new Fx.Transition(function(p){return Math.pow(p,[i+2]);});Fx.Transitions.compat(transition);});var Drag={};Drag.Base=new Class({options:{handle:false,unit:'px',onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:'left',y:'top'},grid:false,snap:6},initialize:function(el,options){this.setOptions(options);this.element=$(el);this.handle=$(this.options.handle)||this.element;this.mouse={'now':{},'pos':{}};this.value={'start':{},'now':{}};this.bound={'start':this.start.bindWithEvent(this),'check':this.check.bindWithEvent(this),'drag':this.drag.bindWithEvent(this),'stop':this.stop.bind(this)};this.attach();if(this.options.initialize)this.options.initialize.call(this);},attach:function(){this.handle.addEvent('mousedown',this.bound.start);return this;},detach:function(){this.handle.removeEvent('mousedown',this.bound.start);return this;},start:function(event){this.fireEvent('onBeforeStart',this.element);this.mouse.start=event.page;var limit=this.options.limit;this.limit={'x':[],'y':[]};for(var z in this.options.modifiers){if(!this.options.modifiers[z])continue;this.value.now[z]=this.element.getStyle(this.options.modifiers[z]).toInt();this.mouse.pos[z]=event.page[z]-this.value.now[z];if(limit&&limit[z]){for(var i=0;i<2;i++){if($chk(limit[z][i]))this.limit[z][i]=($type(limit[z][i])=='function')?limit[z][i]():limit[z][i];}}}
if($type(this.options.grid)=='number')this.options.grid={'x':this.options.grid,'y':this.options.grid};document.addListener('mousemove',this.bound.check);document.addListener('mouseup',this.bound.stop);this.fireEvent('onStart',this.element);event.stop();},check:function(event){var distance=Math.round(Math.sqrt(Math.pow(event.page.x-this.mouse.start.x,2)+Math.pow(event.page.y-this.mouse.start.y,2)));if(distance>this.options.snap){document.removeListener('mousemove',this.bound.check);document.addListener('mousemove',this.bound.drag);this.drag(event);this.fireEvent('onSnap',this.element);}
event.stop();},drag:function(event){this.out=false;this.mouse.now=event.page;for(var z in this.options.modifiers){if(!this.options.modifiers[z])continue;this.value.now[z]=this.mouse.now[z]-this.mouse.pos[z];if(this.limit[z]){if($chk(this.limit[z][1])&&(this.value.now[z]>this.limit[z][1])){this.value.now[z]=this.limit[z][1];this.out=true;}else if($chk(this.limit[z][0])&&(this.value.now[z]<this.limit[z][0])){this.value.now[z]=this.limit[z][0];this.out=true;}}
if(this.options.grid[z])this.value.now[z]-=(this.value.now[z]%this.options.grid[z]);this.element.setStyle(this.options.modifiers[z],this.value.now[z]+this.options.unit);}
this.fireEvent('onDrag',this.element);event.stop();},stop:function(){document.removeListener('mousemove',this.bound.check);document.removeListener('mousemove',this.bound.drag);document.removeListener('mouseup',this.bound.stop);this.fireEvent('onComplete',this.element);}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(options){return new Drag.Base(this,$merge({modifiers:{x:'width',y:'height'}},options));}});Drag.Move=Drag.Base.extend({options:{droppables:[],container:false,overflown:[]},initialize:function(el,options){this.setOptions(options);this.element=$(el);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);this.position={'element':this.element.getStyle('position'),'container':false};if(this.container)this.position.container=this.container.getStyle('position');if(!['relative','absolute','fixed'].contains(this.position.element))this.position.element='absolute';var top=this.element.getStyle('top').toInt();var left=this.element.getStyle('left').toInt();if(this.position.element=='absolute'&&!['relative','absolute','fixed'].contains(this.position.container)){top=$chk(top)?top:this.element.getTop(this.options.overflown);left=$chk(left)?left:this.element.getLeft(this.options.overflown);}else{top=$chk(top)?top:0;left=$chk(left)?left:0;}
this.element.setStyles({'top':top,'left':left,'position':this.position.element});this.parent(this.element);},start:function(event){this.overed=null;if(this.container){var cont=this.container.getCoordinates();var el=this.element.getCoordinates();if(this.position.element=='absolute'&&!['relative','absolute','fixed'].contains(this.position.container)){this.options.limit={'x':[cont.left,cont.right-el.width],'y':[cont.top,cont.bottom-el.height]};}else{this.options.limit={'y':[0,cont.height-el.height],'x':[0,cont.width-el.width]};}}
this.parent(event);},drag:function(event){this.parent(event);var overed=this.out?false:this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=overed){if(this.overed)this.overed.fireEvent('leave',[this.element,this]);this.overed=overed?overed.fireEvent('over',[this.element,this]):null;}
return this;},checkAgainst:function(el){el=el.getCoordinates(this.options.overflown);var now=this.mouse.now;return(now.x>el.left&&now.x<el.right&&now.y<el.bottom&&now.y>el.top);},stop:function(){if(this.overed&&!this.out)this.overed.fireEvent('drop',[this.element,this]);else this.element.fireEvent('emptydrop',this);this.parent();return this;}});Element.extend({makeDraggable:function(options){return new Drag.Move(this,options);}});var XHR=new Class({options:{method:'post',async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:'utf-8',autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject('Microsoft.XMLHTTP'):false);return this;},initialize:function(options){this.setTransport().setOptions(options);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method=='post'){var encoding=(this.options.encoding)?'; charset='+this.options.encoding:'';this.setHeader('Content-type','application/x-www-form-urlencoded'+encoding);}
if(this.options.initialize)this.options.initialize.call(this);},onStateChange:function(){if(this.transport.readyState!=4||!this.running)return;this.running=false;var status=0;try{status=this.transport.status;}catch(e){};if(this.options.isSuccess.call(this,status))this.onSuccess();else this.onFailure();this.transport.onreadystatechange=Class.empty;},isSuccess:function(status){return((status>=200)&&(status<300));},onSuccess:function(){this.response={'text':this.transport.responseText,'xml':this.transport.responseXML};this.fireEvent('onSuccess',[this.response.text,this.response.xml]);this.callChain();},onFailure:function(){this.fireEvent('onFailure',this.transport);},setHeader:function(name,value){this.headers[name]=value;return this;},send:function(url,data){if(this.options.autoCancel)this.cancel();else if(this.running)return this;this.running=true;if(data&&this.options.method=='get'){url=url+(url.contains('?')?'&':'?')+data;data=null;}
this.transport.open(this.options.method.toUpperCase(),url,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=='post')&&this.transport.overrideMimeType)this.setHeader('Connection','close');$extend(this.headers,this.options.headers);for(var type in this.headers)try{this.transport.setRequestHeader(type,this.headers[type]);}catch(e){};this.fireEvent('onRequest');this.transport.send($pick(data,null));return this;},cancel:function(){if(!this.running)return this;this.running=false;this.transport.abort();this.transport.onreadystatechange=Class.empty;this.setTransport();this.fireEvent('onCancel');return this;}});XHR.implement(new Chain,new Events,new Options);var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(url,options){this.addEvent('onSuccess',this.onComplete);this.setOptions(options);this.options.data=this.options.data||this.options.postBody;if(!['post','get'].contains(this.options.method)){this._method='_method='+this.options.method;this.options.method='post';}
this.parent();this.setHeader('X-Requested-With','XMLHttpRequest');this.setHeader('Accept','text/javascript, text/html, application/xml, text/xml, */*');this.url=url;},onComplete:function(){if(this.options.update)$(this.options.update).empty().setHTML(this.response.text);if(this.options.evalScripts||this.options.evalResponse)this.evalScripts();this.fireEvent('onComplete',[this.response.text,this.response.xml],20);},request:function(data){data=data||this.options.data;switch($type(data)){case'element':data=$(data).toQueryString();break;case'object':data=Object.toQueryString(data);}
if(this._method)data=(data)?[this._method,data].join('&'):this._method;return this.send(this.url,data);},evalScripts:function(){var script,scripts;if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader('Content-type')))scripts=this.response.text;else{scripts=[];var regexp=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((script=regexp.exec(this.response.text)))scripts.push(script[1]);scripts=scripts.join('\n');}
if(scripts)(window.execScript)?window.execScript(scripts):window.setTimeout(scripts,0);},getHeader:function(name){try{return this.transport.getResponseHeader(name);}catch(e){};return null;}});Object.toQueryString=function(source){var queryString=[];for(var property in source)queryString.push(encodeURIComponent(property)+'='+encodeURIComponent(source[property]));return queryString.join('&');};Element.extend({send:function(options){return new Ajax(this.getProperty('action'),$merge({data:this.toQueryString()},options,{method:'post'})).request();}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(key,value,options){options=$merge(this.options,options);value=encodeURIComponent(value);if(options.domain)value+='; domain='+options.domain;if(options.path)value+='; path='+options.path;if(options.duration){var date=new Date();date.setTime(date.getTime()+options.duration*24*60*60*1000);value+='; expires='+date.toGMTString();}
if(options.secure)value+='; secure';document.cookie=key+'='+value;return $extend(options,{'key':key,'value':value});},get:function(key){var value=document.cookie.match('(?:^|;)\\s*'+key.escapeRegExp()+'=([^;]*)');return value?decodeURIComponent(value[1]):false;},remove:function(cookie,options){if($type(cookie)=='object')this.set(cookie.key,'',$merge(cookie,{duration:-1}));else this.set(cookie,'',$merge(options,{duration:-1}));}});var Json={toString:function(obj){switch($type(obj)){case'string':return'"'+obj.replace(/(["\\])/g,'\\$1')+'"';case'array':return'['+obj.map(Json.toString).join(',')+']';case'object':var string=[];for(var property in obj)string.push(Json.toString(property)+':'+Json.toString(obj[property]));return'{'+string.join(',')+'}';case'number':if(isFinite(obj))break;case false:return'null';}
return String(obj);},evaluate:function(str,secure){return(($type(str)!='string')||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval('('+str+')');}};Json.Remote=XHR.extend({initialize:function(url,options){this.url=url;this.addEvent('onSuccess',this.onComplete);this.parent(options);this.setHeader('X-Request','JSON');},send:function(obj){return this.parent(this.url,'json='+Json.toString(obj));},onComplete:function(){this.fireEvent('onComplete',[Json.evaluate(this.response.text,this.options.secure)]);}});var Asset=new Abstract({javascript:function(source,properties){properties=$merge({'onload':Class.empty},properties);var script=new Element('script',{'src':source}).addEvents({'load':properties.onload,'readystatechange':function(){if(this.readyState=='complete')this.fireEvent('load');}});delete properties.onload;return script.setProperties(properties).inject(document.head);},css:function(source,properties){return new Element('link',$merge({'rel':'stylesheet','media':'screen','type':'text/css','href':source},properties)).inject(document.head);},image:function(source,properties){properties=$merge({'onload':Class.empty,'onabort':Class.empty,'onerror':Class.empty},properties);var image=new Image();image.src=source;var element=new Element('img',{'src':source});['load','abort','error'].each(function(type){var event=properties['on'+type];delete properties['on'+type];element.addEvent(type,function(){this.removeEvent(type,arguments.callee);event.call(this);});});if(image.width&&image.height)element.fireEvent('load',element,1);return element.setProperties(properties);},images:function(sources,options){options=$merge({onComplete:Class.empty,onProgress:Class.empty},options);if(!sources.push)sources=[sources];var images=[];var counter=0;sources.each(function(source){var img=new Asset.image(source,{'onload':function(){options.onProgress.call(this,counter);counter++;if(counter==sources.length)options.onComplete();}});images.push(img);});return new Elements(images);}});var Hash=new Class({length:0,initialize:function(object){this.obj=object||{};this.setLength();},get:function(key){return(this.hasKey(key))?this.obj[key]:null;},hasKey:function(key){return(key in this.obj);},set:function(key,value){if(!this.hasKey(key))this.length++;this.obj[key]=value;return this;},setLength:function(){this.length=0;for(var p in this.obj)this.length++;return this;},remove:function(key){if(this.hasKey(key)){delete this.obj[key];this.length--;}
return this;},each:function(fn,bind){$each(this.obj,fn,bind);},extend:function(obj){$extend(this.obj,obj);return this.setLength();},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength();},empty:function(){this.obj={};this.length=0;return this;},keys:function(){var keys=[];for(var property in this.obj)keys.push(property);return keys;},values:function(){var values=[];for(var property in this.obj)values.push(this.obj[property]);return values;}});function $H(obj){return new Hash(obj);};Hash.Cookie=Hash.extend({initialize:function(name,options){this.name=name;this.options=$extend({'autoSave':true},options||{});this.load();},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true;}
var str=Json.toString(this.obj);if(str.length>4096)return false;Cookie.set(this.name,str,this.options);return true;},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength();}});Hash.Cookie.Methods={};['extend','set','merge','empty','remove'].each(function(method){Hash.Cookie.Methods[method]=function(){Hash.prototype[method].apply(this,arguments);if(this.options.autoSave)this.save();return this;};});Hash.Cookie.implement(Hash.Cookie.Methods);var Color=new Class({initialize:function(color,type){type=type||(color.push?'rgb':'hex');var rgb,hsb;switch(type){case'rgb':rgb=color;hsb=rgb.rgbToHsb();break;case'hsb':rgb=color.hsbToRgb();hsb=color;break;default:rgb=color.hexToRgb(true);hsb=rgb.rgbToHsb();}
rgb.hsb=hsb;rgb.hex=rgb.rgbToHex();return $extend(rgb,Color.prototype);},mix:function(){var colors=$A(arguments);var alpha=($type(colors[colors.length-1])=='number')?colors.pop():50;var rgb=this.copy();colors.each(function(color){color=new Color(color);for(var i=0;i<3;i++)rgb[i]=Math.round((rgb[i]/100*(100-alpha))+(color[i]/100*alpha));});return new Color(rgb,'rgb');},invert:function(){return new Color(this.map(function(value){return 255-value;}));},setHue:function(value){return new Color([value,this.hsb[1],this.hsb[2]],'hsb');},setSaturation:function(percent){return new Color([this.hsb[0],percent,this.hsb[2]],'hsb');},setBrightness:function(percent){return new Color([this.hsb[0],this.hsb[1],percent],'hsb');}});function $RGB(r,g,b){return new Color([r,g,b],'rgb');};function $HSB(h,s,b){return new Color([h,s,b],'hsb');};Array.extend({rgbToHsb:function(){var red=this[0],green=this[1],blue=this[2];var hue,saturation,brightness;var max=Math.max(red,green,blue),min=Math.min(red,green,blue);var delta=max-min;brightness=max/255;saturation=(max!=0)?delta/max:0;if(saturation==0){hue=0;}else{var rr=(max-red)/delta;var gr=(max-green)/delta;var br=(max-blue)/delta;if(red==max)hue=br-gr;else if(green==max)hue=2+rr-br;else hue=4+gr-rr;hue/=6;if(hue<0)hue++;}
return[Math.round(hue*360),Math.round(saturation*100),Math.round(brightness*100)];},hsbToRgb:function(){var br=Math.round(this[2]/100*255);if(this[1]==0){return[br,br,br];}else{var hue=this[0]%360;var f=hue%60;var p=Math.round((this[2]*(100-this[1]))/10000*255);var q=Math.round((this[2]*(6000-this[1]*f))/600000*255);var t=Math.round((this[2]*(6000-this[1]*(60-f)))/600000*255);switch(Math.floor(hue/60)){case 0:return[br,t,p];case 1:return[q,br,p];case 2:return[p,br,t];case 3:return[p,q,br];case 4:return[t,p,br];case 5:return[br,p,q];}}
return false;}});var Scroller=new Class({options:{area:20,velocity:1,onChange:function(x,y){this.element.scrollTo(x,y);}},initialize:function(element,options){this.setOptions(options);this.element=$(element);this.mousemover=([window,document].contains(element))?$(document.body):this.element;},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener('mousemove',this.coord);},stop:function(){this.mousemover.removeListener('mousemove',this.coord);this.timer=$clear(this.timer);},getCoords:function(event){this.page=(this.element==window)?event.client:event.page;if(!this.timer)this.timer=this.scroll.periodical(50,this);},scroll:function(){var el=this.element.getSize();var pos=this.element.getPosition();var change={'x':0,'y':0};for(var z in this.page){if(this.page[z]<(this.options.area+pos[z])&&el.scroll[z]!=0)
change[z]=(this.page[z]-this.options.area-pos[z])*this.options.velocity;else if(this.page[z]+this.options.area>(el.size[z]+pos[z])&&el.scroll[z]+el.size[z]!=el.scrollSize[z])
change[z]=(this.page[z]-el.size[z]+this.options.area-pos[z])*this.options.velocity;}
if(change.y||change.x)this.fireEvent('onChange',[el.scroll.x+change.x,el.scroll.y+change.y]);}});Scroller.implement(new Events,new Options);var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(pos){this.knob.setStyle(this.p,pos);},mode:'horizontal',steps:100,offset:0},initialize:function(el,knob,options){this.element=$(el);this.knob=$(knob);this.setOptions(options);this.previousChange=-1;this.previousEnd=-1;this.step=-1;this.element.addEvent('mousedown',this.clickedElement.bindWithEvent(this));var mod,offset;switch(this.options.mode){case'horizontal':this.z='x';this.p='left';mod={'x':'left','y':false};offset='offsetWidth';break;case'vertical':this.z='y';this.p='top';mod={'x':false,'y':'top'};offset='offsetHeight';}
this.max=this.element[offset]-this.knob[offset]+(this.options.offset*2);this.half=this.knob[offset]/2;this.getPos=this.element['get'+this.p.capitalize()].bind(this.element);this.knob.setStyle('position','relative').setStyle(this.p,-this.options.offset);var lim={};lim[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:lim,modifiers:mod,snap:0,onStart:function(){this.draggedKnob();}.bind(this),onDrag:function(){this.draggedKnob();}.bind(this),onComplete:function(){this.draggedKnob();this.end();}.bind(this)});if(this.options.initialize)this.options.initialize.call(this);},set:function(step){this.step=step.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent('onTick',this.toPosition(this.step));return this;},clickedElement:function(event){var position=event.page[this.z]-this.getPos()-this.half;position=position.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(position);this.checkStep();this.end();this.fireEvent('onTick',position);},draggedKnob:function(){this.step=this.toStep(this.drag.value.now[this.z]);this.checkStep();},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent('onChange',this.step);}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent('onComplete',this.step+'');}},toStep:function(position){return Math.round((position+this.options.offset)/this.max*this.options.steps);},toPosition:function(step){return this.max*step/this.options.steps;}});Slider.implement(new Events);Slider.implement(new Options);var SmoothScroll=Fx.Scroll.extend({initialize:function(options){this.parent(window,options);this.links=(this.options.links)?$$(this.options.links):$$(document.links);var location=window.location.href.match(/^[^#]*/)[0]+'#';this.links.each(function(link){if(link.href.indexOf(location)!=0)return;var anchor=link.href.substr(location.length);if(anchor&&$(anchor))this.useLink(link,anchor);},this);if(!window.webkit419)this.addEvent('onComplete',function(){window.location.hash=this.anchor;});},useLink:function(link,anchor){link.addEvent('click',function(event){this.anchor=anchor;this.toElement(anchor);event.stop();}.bindWithEvent(this));}});var Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(element,ghost){ghost.setStyle('opacity',0.7);element.setStyle('opacity',0.7);},onDragComplete:function(element,ghost){element.setStyle('opacity',1);ghost.remove();this.trash.remove();}},initialize:function(list,options){this.setOptions(options);this.list=$(list);this.elements=this.list.getChildren();this.handles=(this.options.handles)?$$(this.options.handles):this.elements;this.bound={'start':[],'moveGhost':this.moveGhost.bindWithEvent(this)};for(var i=0,l=this.handles.length;i<l;i++){this.bound.start[i]=this.start.bindWithEvent(this,this.elements[i]);}
this.attach();if(this.options.initialize)this.options.initialize.call(this);this.bound.move=this.move.bindWithEvent(this);this.bound.end=this.end.bind(this);},attach:function(){this.handles.each(function(handle,i){handle.addEvent('mousedown',this.bound.start[i]);},this);},detach:function(){this.handles.each(function(handle,i){handle.removeEvent('mousedown',this.bound.start[i]);},this);},start:function(event,el){this.active=el;this.coordinates=this.list.getCoordinates();if(this.options.ghost){var position=el.getPosition();this.offset=event.page.y-position.y;this.trash=new Element('div').inject(document.body);this.ghost=el.clone().inject(this.trash).setStyles({'position':'absolute','left':position.x,'top':event.page.y-this.offset});document.addListener('mousemove',this.bound.moveGhost);this.fireEvent('onDragStart',[el,this.ghost]);}
document.addListener('mousemove',this.bound.move);document.addListener('mouseup',this.bound.end);this.fireEvent('onStart',el);event.stop();},moveGhost:function(event){var value=event.page.y-this.offset;value=value.limit(this.coordinates.top,this.coordinates.bottom-this.ghost.offsetHeight);this.ghost.setStyle('top',value);event.stop();},move:function(event){var now=event.page.y;this.previous=this.previous||now;var up=((this.previous-now)>0);var prev=this.active.getPrevious();var next=this.active.getNext();if(prev&&up&&now<prev.getCoordinates().bottom)this.active.injectBefore(prev);if(next&&!up&&now>next.getCoordinates().top)this.active.injectAfter(next);this.previous=now;},serialize:function(converter){return this.list.getChildren().map(converter||function(el){return this.elements.indexOf(el);},this);},end:function(){this.previous=null;document.removeListener('mousemove',this.bound.move);document.removeListener('mouseup',this.bound.end);if(this.options.ghost){document.removeListener('mousemove',this.bound.moveGhost);this.fireEvent('onDragComplete',[this.active,this.ghost]);}
this.fireEvent('onComplete',this.active);}});Sortables.implement(new Events,new Options);var Tips=new Class({options:{onShow:function(tip){tip.setStyle('visibility','visible');},onHide:function(tip){tip.setStyle('visibility','hidden');},maxTitleChars:30,showDelay:100,hideDelay:100,className:'tool',offsets:{'x':16,'y':16},fixed:false},initialize:function(elements,options){this.setOptions(options);this.toolTip=new Element('div',{'class':this.options.className+'-tip','styles':{'position':'absolute','top':'0','left':'0','visibility':'hidden'}}).inject(document.body);this.wrapper=new Element('div').inject(this.toolTip);$$(elements).each(this.build,this);if(this.options.initialize)this.options.initialize.call(this);},build:function(el){el.$tmp.myTitle=(el.href&&el.getTag()=='a')?el.href.replace('http://',''):(el.rel||false);if(el.title){var dual=el.title.split('::');if(dual.length>1){el.$tmp.myTitle=dual[0].trim();el.$tmp.myText=dual[1].trim();}else{el.$tmp.myText=el.title;}
el.removeAttribute('title');}else{el.$tmp.myText=false;}
if(el.$tmp.myTitle&&el.$tmp.myTitle.length>this.options.maxTitleChars)el.$tmp.myTitle=el.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;";el.addEvent('mouseenter',function(event){this.start(el);if(!this.options.fixed)this.locate(event);else this.position(el);}.bind(this));if(!this.options.fixed)el.addEvent('mousemove',this.locate.bindWithEvent(this));var end=this.end.bind(this);el.addEvent('mouseleave',end);el.addEvent('trash',end);},start:function(el){this.wrapper.empty();if(el.$tmp.myTitle){this.title=new Element('span').inject(new Element('div',{'class':this.options.className+'-title'}).inject(this.wrapper)).setHTML(el.$tmp.myTitle);}
if(el.$tmp.myText){this.text=new Element('span').inject(new Element('div',{'class':this.options.className+'-text'}).inject(this.wrapper)).setHTML(el.$tmp.myText);}
$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this);},end:function(event){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this);},position:function(element){var pos=element.getPosition();this.toolTip.setStyles({'left':pos.x+this.options.offsets.x,'top':pos.y+this.options.offsets.y});},locate:function(event){var win={'x':window.getWidth(),'y':window.getHeight()};var scroll={'x':window.getScrollLeft(),'y':window.getScrollTop()};var tip={'x':this.toolTip.offsetWidth,'y':this.toolTip.offsetHeight};var prop={'x':'left','y':'top'};for(var z in prop){var pos=event.page[z]+this.options.offsets[z];if((pos+tip[z]-scroll[z])>win[z])pos=event.page[z]-this.options.offsets[z]-tip[z];this.toolTip.setStyle(prop[z],pos);};},show:function(){if(this.options.timeout)this.timer=this.hide.delay(this.options.timeout,this);this.fireEvent('onShow',[this.toolTip]);},hide:function(){this.fireEvent('onHide',[this.toolTip]);}});Tips.implement(new Events,new Options);var Group=new Class({initialize:function(){this.instances=$A(arguments);this.events={};this.checker={};},addEvent:function(type,fn){this.checker[type]=this.checker[type]||{};this.events[type]=this.events[type]||[];if(this.events[type].contains(fn))return false;else this.events[type].push(fn);this.instances.each(function(instance,i){instance.addEvent(type,this.check.bind(this,[type,instance,i]));},this);return this;},check:function(type,instance,i){this.checker[type][i]=true;var every=this.instances.every(function(current,j){return this.checker[type][j]||false;},this);if(!every)return;this.checker[type]={};this.events[type].each(function(event){event.call(this,this.instances,instance);},this);}});var Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var options,togglers,elements,container;$each(arguments,function(argument,i){switch($type(argument)){case'object':options=argument;break;case'element':container=$(argument);break;default:var temp=$$(argument);if(!togglers)togglers=temp;else elements=temp;}});this.togglers=togglers||[];this.elements=elements||[];this.container=$(container);this.setOptions(options);this.previous=-1;if(this.options.alwaysHide)this.options.wait=true;if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}
if(this.options.start){this.options.display=false;this.options.show=false;}
this.effects={};if(this.options.opacity)this.effects.opacity='fullOpacity';if(this.options.width)this.effects.width=this.options.fixedWidth?'fullWidth':'offsetWidth';if(this.options.height)this.effects.height=this.options.fixedHeight?'fullHeight':'scrollHeight';for(var i=0,l=this.togglers.length;i<l;i++)this.addSection(this.togglers[i],this.elements[i]);this.elements.each(function(el,i){if(this.options.show===i){this.fireEvent('onActive',[this.togglers[i],el]);}else{for(var fx in this.effects)el.setStyle(fx,0);}},this);this.parent(this.elements);if($chk(this.options.display))this.display(this.options.display);},addSection:function(toggler,element,pos){toggler=$(toggler);element=$(element);var test=this.togglers.contains(toggler);var len=this.togglers.length;this.togglers.include(toggler);this.elements.include(element);if(len&&(!test||pos)){pos=$pick(pos,len-1);toggler.injectBefore(this.togglers[pos]);element.injectAfter(toggler);}else if(this.container&&!test){toggler.inject(this.container);element.inject(this.container);}
var idx=this.togglers.indexOf(toggler);toggler.addEvent('click',this.display.bind(this,idx));if(this.options.height)element.setStyles({'padding-top':0,'border-top':'none','padding-bottom':0,'border-bottom':'none'});if(this.options.width)element.setStyles({'padding-left':0,'border-left':'none','padding-right':0,'border-right':'none'});element.fullOpacity=1;if(this.options.fixedWidth)element.fullWidth=this.options.fixedWidth;if(this.options.fixedHeight)element.fullHeight=this.options.fixedHeight;element.setStyle('overflow','hidden');if(!test){for(var fx in this.effects)element.setStyle(fx,0);}
return this;},display:function(index){index=($type(index)=='element')?this.elements.indexOf(index):index;if((this.timer&&this.options.wait)||(index===this.previous&&!this.options.alwaysHide))return this;this.previous=index;var obj={};this.elements.each(function(el,i){obj[i]={};var hide=(i!=index)||(this.options.alwaysHide&&(el.offsetHeight>0));this.fireEvent(hide?'onBackground':'onActive',[this.togglers[i],el]);for(var fx in this.effects)obj[i][fx]=hide?0:el[this.effects[fx]];},this);return this.start(obj);},showThisHideOpen:function(index){return this.display(index);}});Fx.Accordion=Accordion;

/* core.js */

function switchFontSize(ckname,val){var bd=document.getElementsByTagName('body');if(!bd||!bd.length)return;bd=bd[0];var oldclass='fs'+CurrentFontSize;switch(val){case'inc':if(CurrentFontSize+1<7){CurrentFontSize++;}
break;case'dec':if(CurrentFontSize-1>0){CurrentFontSize--;}
break;case'reset':default:CurrentFontSize=DefaultFontSize;}
var newclass='fs'+CurrentFontSize;bd.className=bd.className.replace(new RegExp('fs.?','g'),'');bd.className=trim(bd.className);bd.className+=(bd.className?' ':'')+newclass;createCookie(ckname,CurrentFontSize,365);}
function switchTool(ckname,val){createCookie(ckname,val,365);window.location.reload();}
function cpanel_reset(){var matches=document.cookie.match('(?:^|;)\\s*'+tmpl_name.escapeRegExp()+'_([^=]*)=([^;]*)','g');if(!matches)return;for(i=0;i<matches.length;i++){var ck=matches[i].match('(?:^|;)\\s*'+tmpl_name.escapeRegExp()+'_([^=]*)=([^;]*)');if(ck){createCookie(tmpl_name+'_'+ck[1],'',-1);}}
if(window.location.href.indexOf('?')>-1)window.location.href=window.location.href.substr(0,window.location.href.indexOf('?'));else window.location.reload();}
function cpanel_apply(){var elems=document.getElementById('ja-cpanel-main').getElementsByTagName('*');var usersetting={};for(i=0;i<elems.length;i++){var el=elems[i];if(el.name&&(match=el.name.match(/^user_(.*)$/))){var name=match[1];var value='';if(el.tagName.toLowerCase()=='input'&&(el.type.toLowerCase()=='radio'||el.type.toLowerCase()=='checkbox')){if(el.checked)value=el.value;}else{value=el.value;}
if(usersetting[name]){if(value)usersetting[name]=value+','+usersetting[name];}else{usersetting[name]=value;}}}
for(var k in usersetting){name=tmpl_name+'_'+k;value=usersetting[k];createCookie(name,value,365);}
if(window.location.href.indexOf('?')>-1)window.location.href=window.location.href.substr(0,window.location.href.indexOf('?'));else window.location.reload();}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else expires="";document.cookie=name+"="+value+expires+"; path=/";}
function trim(str,chars){return ltrim(rtrim(str,chars),chars);}
function ltrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("^["+chars+"]+","g"),"");}
function rtrim(str,chars){chars=chars||"\\s";return str.replace(new RegExp("["+chars+"]+$","g"),"");}
function getScreenWidth(){var x=0;if(self.innerHeight){x=self.innerWidth;}else if(document.documentElement&&document.documentElement.clientHeight){x=document.documentElement.clientWidth;}else if(document.body){x=document.body.clientWidth;}
return x;}
function equalHeight(els){els=$$_(els);if(!els||els.length<2)return;var maxh=0;var els_=[];els.each(function(el,i){if(!el)return;els_[i]=el;var ch=els_[i].getCoordinates().height;maxh=(maxh<ch)?ch:maxh;},this);els_.each(function(el,i){if(!el)return;if(maxh-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt()>0)el.setStyle('min-height',maxh-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt());},this);}
function getDeepestWrapper(el){while(el.getChildren().length==1)
{el=el.getChildren()[0];}
return el;}
function fixHeight(els,group1,group2){els=$$_(els);group1=$$_(group1);group2=$$_(group2);if(!els||!group1)return;var height=0;group1.each(function(el){if(!el)return;height+=el.getCoordinates().height;});if(group2){group2.each(function(el){if(!el)return;height-=el.getCoordinates().height;});}
els.each(function(el,i){if(!el)return;if(height-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt()>0)el.setStyle('min-height',height-el.getStyle('padding-top').toInt()-el.getStyle('padding-bottom').toInt());});}
function addFirstLastItem(el){el=$(el);if(!el||!el.getChildren()||!el.getChildren().length)return;el.getChildren()[0].addClass('first-item');el.getChildren()[el.getChildren().length-1].addClass('last-item');}
function $$_(els){if($type(els)=='string')return $$(els);var els_=[];els.each(function(el){el=$(el);if(el)els_.push(el);});return els_;}

/* mega.js */

var jaMegaMenuMoo=new Class({initialize:function(menu,options){this.options=$extend({slide:true,duration:300,fading:false,bgopacity:0.9,delayHide:500,direction:'down',action:'mouseenter',hidestyle:'normal'},options||{});if(!this.options.slide&&!this.options.fading)this.options.delayHide=10;this.menu=menu;this.childopen=new Array();this.imageloaded=false;this.loaded=false;this.start();},start:function(){if(this.loaded)return;this.menu=$(this.menu);var images=this.menu.getElements('img');if(images&&images.length&&!this.imageloaded){var imgs=[];images.each(function(image){imgs.push(image.src)});if(imgs.length){new Asset.images(imgs,{onComplete:function(){this.start();}.bind(this)});this.imageloaded=true;this.start.delay(3000,this);return;}}
this.loaded=true;p=this.menu;while(p=p.getParent()){if(p.hasClass('main')||p.hasClass('wrap')){this.wrapper=p;break;}}
this.items=this.menu.getElements('li.mega');this.items.each(function(li){if((a=li.getElement('a.mega'))&&this.isChild(a,li))li.a=a;else li.a=null;li._parent=this.getParent(li);if((childcontent=li.getElement('.childcontent'))&&this.isChild(childcontent,li)){li.childcontent=childcontent;li.childcontent_inner=li.childcontent.getElement('.childcontent-inner-wrap');var coor=li.childcontent_inner.getCoordinates();li._w=li.getElement('.childcontent-inner').offsetWidth;li._h=li.getElement('.childcontent-inner').offsetHeight;li.level0=li.getParent().hasClass('level0');li.childcontent.setStyles({'width':li._w+10,'height':li._h});li.childcontent_inner.setStyles({'width':li._w});li.childcontent_inner1=li.childcontent.getElement('.childcontent-inner');li.childcontent_inner1.ol=false;if(li.childcontent_inner1.getStyle('overflow')=='auto'||li.childcontent_inner1.getStyle('overflow')=='scroll'){li.childcontent_inner1.ol=true;if(window.ie6||window.ie7){li.childcontent_inner1.setStyle('position','relative');}
if(window.ie6){li.childcontent_inner1.setStyle('height',li.childcontent_inner1.getStyle('max-height')||400);}}
if(this.options.direction=='up'){if(li.level0){li.childcontent.setStyle('top',-li.childcontent.offsetHeight);}else{li.childcontent.setStyle('bottom',0);}}}
else li.childcontent=null;if(li.childcontent&&this.options.bgopacity){var bg=new Element('div',{'class':'childcontent-bg'});bg.injectTop(li.childcontent_inner);bg.setStyles({'width':'100%','height':li._h,'opacity':this.options.bgopacity,'position':'absolute','top':0,'left':0,'z-index':1});if(li.childcontent.getStyle('background'))bg.setStyle('background',li.childcontent.getStyle('background'));if(li.childcontent.getStyle('background-image'))bg.setStyle('background-image',li.childcontent.getStyle('background-image'));if(li.childcontent.getStyle('background-repeat'))bg.setStyle('background-repeat',li.childcontent.getStyle('background-repeat'));if(li.childcontent.getStyle('background-color'))bg.setStyle('background-color',li.childcontent.getStyle('background-color'));li.childcontent.setStyle('background','none');li.childcontent_inner.setStyles({'position':'relative','z-index':2});}
if(li.childcontent&&(this.options.slide||this.options.fading)){li.childcontent.setStyles({'left':'auto'});if(li.childcontent.hasClass('right'))li.childcontent.setStyle('right',0);if(this.options.slide){li.childcontent.setStyles({'left':'auto','overflow':'hidden'});if(li.level0){if(this.options.direction=='up'){li.childcontent_inner.setStyle('bottom',-li._h-20);}else{li.childcontent_inner.setStyle('margin-top',-li._h-20);}}else{li.childcontent_inner.setStyle('margin-left',-li._w-20);}}
if(this.options.fading){li.childcontent_inner.setStyle('opacity',0);}
li.fx=new Fx.Styles(li.childcontent_inner,{duration:this.options.duration,transition:Fx.Transitions.linear,onComplete:this.itemAnimDone.bind(this,li)});li.eff_on={};li.eff_off={};if(this.options.slide){if(li.level0){if(this.options.direction=='up'){li.eff_on['bottom']=0;li.eff_off['bottom']=-li._h;}else{li.eff_on['margin-top']=0;li.eff_off['margin-top']=-li._h;}}else{li.eff_on['margin-left']=0;li.eff_off['margin-left']=-li._w;}}
if(this.options.fading){li.eff_on['opacity']=1;li.eff_off['opacity']=0;}}
if(this.options.action=='click'&&li.childcontent){li.addEvent('click',function(e){var event=new Event(e);if(li.hasClass('group'))return;if(li.childcontent){if(li.status=='open'){if(this.cursorIn(li,event)){this.itemHide(li);}else{this.itemHideOthers(li);}}else{this.itemShow(li);}}else{if(li.a)location.href=li.a.href;}
event.stop();}.bind(this));this.windowClickFn=function(e){this.itemHideOthers(null);}.bind(this);}
if(this.options.action=='mouseover'||this.options.action=='mouseenter'){li.addEvent('mouseenter',function(e){if(li.hasClass('group'))return;$clear(li.timer);this.itemShow(li);e.stop();}.bind(this));li.addEvent('mouseleave',function(e){if(li.hasClass('group'))return;$clear(li.timer);if(li.childcontent)li.timer=this.itemHide.delay(this.options.delayHide,this,[li,e]);else this.itemHide(li,e);e.stop();}.bind(this));if(li.a&&li.childcontent){li.clickable=false;li.a.addEvent('click',function(e){if(!li.clickable){new Event(e).stop();}}.bind(this));}}
if(li.a&&!li.childcontent){li.a.addEvent('click',function(e){this.itemHideOthers(null);this.menu.getElements('.active').removeClass('active');var p=li;while(p){p.addClass('active');p.a.addClass('active');p=p._parent;}}.bind(this));}
if(li.childcontent)this.positionSubmenu(li);},this);if(this.options.slide||this.options.fading){this.menu.getElements('.childcontent').setStyle('display','none');}},getParent:function(li){var p=li;while((p=p.getParent())){if(this.items.contains(p)&&!p.hasClass('group'))return p;if(!p||p==this.menu)return null;}},cursorIn:function(el,event){if(!el||!event)return false;var pos=$merge(el.getPosition(),{'w':el.offsetWidth,'h':el.offsetHeight});;var cursor={'x':event.page.x,'y':event.page.y};if(cursor.x>pos.x&&cursor.x<pos.x+el.offsetWidth&&cursor.y>pos.y&&cursor.y<pos.y+el.offsetHeight)return true;return false;},isChild:function(child,parent){return!!parent.getChildren().contains(child);},itemOver:function(li){if(li.hasClass('haschild'))
li.removeClass('haschild').addClass('haschild-over');li.addClass('over');if(li.a){li.a.addClass('over');}},itemOut:function(li){if(li.hasClass('haschild-over'))
li.removeClass('haschild-over').addClass('haschild');li.removeClass('over');if(li.a){li.a.removeClass('over');}},itemShow:function(li){clearTimeout(li.timer);if(li.status=='open')return;this.itemOver(li);li.status='open';this.enableclick.delay(100,this,li);this.childopen.push(li);this.itemHideOthers(li);if(li.childcontent){if(this.options.action=='click'&&this.childopen.length&&!this.windowClickEventAdded){$(document.body).addEvent('click',this.windowClickFn);this.windowClickEventAdded=true;}
this.positionSubmenu(li);}
if(!$defined(li.fx)||!$defined(li.childcontent))return;li.childcontent.setStyle('display','block');li.childcontent.setStyles({'overflow':'hidden'});if(li.childcontent_inner1.ol)li.childcontent_inner1.setStyles({'overflow':'hidden'});li.fx.stop();li.fx.start(li.eff_on);},itemHide:function(li,e){if(e&&e.page){if(this.cursorIn(li,e)||this.cursorIn(li.childcontent,e)){return;}
var p=li._parent;if(p&&!this.cursorIn(p,e)&&!this.cursorIn(p.childcontent,e)){p.fireEvent('mouseleave',e);}}
clearTimeout(li.timer);this.itemOut(li);li.status='close';this.childopen.remove(li);if(li.childcontent){if(this.options.action=='click'&&!this.childopen.length&&this.windowClickEventAdded){$(document.body).removeEvent('click',this.windowClickFn);this.windowClickEventAdded=false;}}
if(!$defined(li.fx)||!$defined(li.childcontent))return;if(li.childcontent.getStyle('opacity')==0)return;li.childcontent.setStyles({'overflow':'hidden'});if(li.childcontent_inner1.ol)li.childcontent_inner1.setStyles({'overflow':'hidden'});li.fx.stop();switch(this.options.hidestyle){case'fast':li.fx.options.duration=100;li.fx.start($merge(li.eff_off,{'opacity':0}));break;case'fastwhenshow':if(!e){li.fx.start($merge(li.eff_off,{'opacity':0}));}else{li.fx.start(li.eff_off);}
break;case'normal':default:li.fx.start(li.eff_off);break;}},itemAnimDone:function(li){if(li.status=='close'){if(this.options.hidestyle.test(/fast/)){li.fx.options.duration=this.options.duration;if(!this.options.fading)li.childcontent_inner.setStyle('opacity',1);}
li.childcontent.setStyles({'display':'none'});this.disableclick.delay(100,this,li);}
if(li.status=='open'){li.childcontent.setStyles({'overflow':''});if(li.childcontent_inner1.ol)li.childcontent_inner1.setStyles({'overflow-y':'auto'});li.childcontent_inner.setStyle('opacity',1);li.childcontent.setStyles({'display':'block'});}},itemHideOthers:function(el){var fakeevent=null
if(el&&!el.childcontent)fakeevent={};var curopen=this.childopen.copy();curopen.each(function(li){if(li&&typeof(li.status)!='undefined'&&(!el||(li!=el&&!li.hasChild(el)))){this.itemHide(li,fakeevent);}},this);},enableclick:function(li){if(li.a&&li.childcontent)li.clickable=true;},disableclick:function(li){if(li.a&&li.childcontent)li.clickable=false;},positionSubmenu:function(li){if(li.level0){if(!window.isRTL){var lcor=li.getCoordinates();var ccor=li.childcontent.getCoordinates();if(!ccor.width)
{li.childcontent.setStyle('display','block');ccor=li.childcontent.getCoordinates();li.childcontent.setStyle('display','none');}
var ml=0;var l=lcor.left;var r=l+ccor.width;if(this.wrapper){var wcor=this.wrapper.getCoordinates();l=l-wcor.left;r=wcor.right-r+10;}else{r=window.getWidth()-r+10;}
if(l<0||l+r<0){ml=-l;}else if(r<0){ml=r;}
if(ml!=0)li.childcontent.setStyle('margin-left',ml);}else{var lcor=li.getCoordinates();var ccor=li.childcontent.getCoordinates();if(!ccor.width)
{li.childcontent.setStyle('display','block');ccor=li.childcontent.getCoordinates();li.childcontent.setStyle('display','none');}
var mr=0;var r=lcor.right;var l=r-ccor.width;if(this.wrapper){var wcor=this.wrapper.getCoordinates();l=l-wcor.left;r=wcor.right-r+10;}else{r=window.getWidth()-r+10;}
if(r<0||l+r<0){mr=-r;}else if(l<0){mr=l;}
if(mr!=0)li.childcontent.setStyle('margin-right',mr);}}else{var lcor=li.getCoordinates();var ccor=li.childcontent.getCoordinates();if(!ccor.width)
{li.childcontent.setStyle('display','block');ccor=li.childcontent.getCoordinates();li.childcontent.setStyle('display','none');}
var ml=0;var l=ccor.left;var r=l+ccor.width;if(this.wrapper){var wcor=this.wrapper.getCoordinates();l=l-wcor.left;r=wcor.right-r+10;}else{r=window.getWidth()-r+10;}
if(r<0){li.childcontent.setStyle('margin-left',-ccor.width+20);li.eff_on['margin-left']=0;li.eff_off['margin-left']=li._w+20;li.childcontent_inner.setStyle('margin-left',li.eff_off['margin-left']);}}}});

/* jcomments-v2.1.js */

function JCommentsEvents(){}
function JCommentsInput(){}
function JCommentsIndicator(){this.init();}
function JCommentsForm(id,editor){this.init(id,editor);}
function JCommentsEditor(textarea,resizable){this.init(textarea,resizable);}
function JComments(oi,og,r){this.init(oi,og,r);}
JCommentsEvents.prototype={add:function(o,e,f){if(o.addEventListener){o.addEventListener(e,f,false);return true;}else if(o.attachEvent){return o.attachEvent("on"+e,f);}else{return false;}},remove:function(o,e,f){if(o.removeEventListener){o.removeEventListener(e,f,false);}else if(o.detachEvent){o.detachEvent("on"+e,o[e+f]);o[e+f]=null;o["e"+e+f]=null;}},cancel:function(e){if(e.stopPropagation){e.cancelBubble=true;e.preventDefault();e.stopPropagation();}e.returnValue=false;return false;},target:function(e){var t;if(!e)e=window.event;if(e.target)t=e.target;else if(e.srcElement)t=e.srcElement;if(t.nodeType==3)t=t.parentNode;return t;}};JCommentsInput.prototype={register:function(el){if(el){var th=this,events=new JCommentsEvents();events.add(el,'focus',function(e){return th.onFocus(e);});events.add(el,'blur',function(e){return th.onBlur(e);});}},unregister:function(el){if(el){var th=this,events=new JCommentsEvents();events.remove(el,'focus',function(e){return th.onFocus(e);});events.remove(el,'blur',function(e){return th.onBlur(e);});}},onFocus:function(e){var t=JCommentsEvents.prototype.target(e);if(t!=null){t.className=t.className.replace('error','')+' selected';}},onBlur:function(e){var t=JCommentsEvents.prototype.target(e);if(t!=null){var c=t.className.replace('error','');c=c.replace('error','');c=c.replace('selected','');t.className=c.replace(/^\s+/g,"");}}};JCommentsEditor.prototype={ta:null,l10n:{},tags:{},smiles:{},events:null,counter:null,focused:false,resizable:true,init:function(textareaID,r){this.ta=JComments.prototype.$(textareaID);this.panelElements={};this.l10n={counterPre:'',counterPost:' symbols left',enterValue:'Enter value'};this.resizable=r;this.events=new JCommentsEvents();this.defaultHeight=this.ta.clientHeight;this.defaultRows=this.ta.rows;if(this.resizable){this.addGrippie();}
this.isWebkit=/webkit/.test(navigator.userAgent.toLowerCase());var th=this;this.events.add(document,!window.opera&&document.all?'keydown':'keypress',function(e){return th.onKeyPress(e);});this.events.add(this.ta,'click',function(e){th.closeSmiles();return th.storeCaret(this.ta);});this.events.add(this.ta,'select',function(e){return th.storeCaret(this.ta);});this.events.add(this.ta,'change',function(e){th.onChange();return th.storeCaret(this.ta);});this.events.add(this.ta,'keyup',function(e){return th.onChange();});this.events.add(this.ta,'focus',function(e){th.closeSmiles();return th.focused=true;});this.events.add(this.ta,'blur',function(e){return th.focused=false;});},onKeyPress:function(e){if(!this.focused){return;}
var r=false,k=String.fromCharCode(e.keyCode?e.keyCode:e.charCode),t=null;for(var id in this.tags){t=this.tags[id];if(!t.key||k.toUpperCase()!=t.key.toUpperCase())continue;if(t.ctrl&&!e[t.ctrl+"Key"])continue;this.insertTag(id);return this.events.cancel(e);}
return e.returnValue;},defined:function(v){return(typeof(v)!="undefined");},clear:function(){this.ta.value='';if(this.defaultHeight){this.ta.style.height=this.defaultHeight+'px';}this.updateCounter();},focus:function(){this.ta.focus();},storeCaret:function(){var ta=this.ta;if(ta.createTextRange)ta.caretPos=document.selection.createRange().duplicate();},getElementPos:function(e){var p={left:0,top:0,right:0,bottom:0};while(e!=null){p.left+=e.offsetLeft;p.top+=e.offsetTop;e=e.offsetParent;}p.right+=p.left;p.bottom+=p.top;return p;},getSelection:function(){var ta=this.ta,s='';if(document.selection&&document.selection.createRange){s=document.selection.createRange().text;}else{s=ta.value.substr(ta.selectionStart,ta.selectionEnd-ta.selectionStart);}return s;},insertText:function(text){var ta=this.ta;if(this.defined(ta.caretPos)&&ta.createTextRange){ta.focus();var sel=document.selection.createRange();sel.text=sel.text+text;ta.focus();}
else if(this.defined(ta.selectionStart)){var ss=ta.value.substr(0,ta.selectionStart);var se=ta.value.substr(ta.selectionEnd),sp=ta.scrollTop;ta.value=ss+text+se;if(ta.setSelectionRange){ta.focus();ta.setSelectionRange(ss.length+text.length,ss.length+text.length);}
ta.scrollTop=sp;}else{ta.value+=text;ta.focus(ta.value.length-1);}},surroundText:function(t1,t2){var ta=this.ta;if(this.defined(ta.caretPos)&&ta.createTextRange){var cp=ta.caretPos,tl=cp.text.length;cp.text=cp.text.charAt(cp.text.length-1)==' '?t1+cp.text+t2+' ':t1+cp.text+t2;if(tl==0){cp.moveStart("character",-t2.length);cp.moveEnd("character",-t2.length);cp.select();}
else{ta.focus(cp);}}else if(this.defined(ta.selectionStart)){var ss=ta.value.substr(0,ta.selectionStart),se=ta.value.substr(ta.selectionEnd);var sl=ta.value.substr(ta.selectionStart,ta.selectionEnd-ta.selectionStart);var nc=ta.selectionStart,sp=ta.scrollTop;ta.value=ss+t1+sl+t2+se;if(ta.setSelectionRange){if(sl.length==0){ta.setSelectionRange(nc+t1.length,nc+t1.length);}
else{ta.setSelectionRange(nc,nc+t1.length+sl.length+t2.length);}
ta.focus();}
ta.scrollTop=sp;}else{ta.value+=t1+t2;ta.focus(ta.value.length-1);}},insertTag:function(id){var tag=this.tags[id],ta=this.ta,s='';if(!tag)return;s=this.getSelection();if(s.length>0){this.surroundText(tag.open,tag.close);}},initTags:function(){if(this.bbc==null||this.bbc.length==0){this.bbc={};this.bbc['b']={id:'bbcode-b',open:'[b]',close:'[/b]',key:'B',ctrl:'ctrl',hint:'Bold'};this.bbc['i']={id:'bbcode-i',open:'[i]',close:'[/i]',key:'I',ctrl:'ctrl',hint:'Italic'};this.bbc['u']={id:'bbcode-u',open:'[u]',close:'[/u]',key:'u',ctrl:'ctrl',hint:'Underline'};this.bbc['s']={id:'bbcode-s',open:'[s]',close:'[/s]',key:null,ctrl:null,hint:'Strikeout'};this.bbc['img']={id:'bbcode-img',open:'[img]',close:'[/img]',key:null,ctrl:null,hint:'Image'};this.bbc['url']={id:'bbcode-url',open:'[url]',close:'[/url]',key:null,ctrl:null,hint:'Link'};this.bbc['hide']={id:'bbcode-hide',open:'[hide]',close:'[/hide]',key:null,ctrl:null,hint:'Hidden'};this.bbc['quote']={id:'bbcode-quote',open:'[quote]',close:'[/quote]',key:'Q',ctrl:'ctrl',hint:'Quote'};this.bbc['list']={id:'bbcode-list',open:'[list][*]',close:'[/list]',key:'L',ctrl:'ctrl',hint:'List'};}},createButton:function(i,t,c,f,img){var e;if(img==null||img==""){e=document.createElement('a');e.style.display='block';e.setAttribute('href','#');}
else{e=document.createElement('img');if(t){e.setAttribute('alt',t);}e.setAttribute('src',img);if(!c){c='custombbcode'};}
if(i){e.setAttribute('id',i);}if(t){e.setAttribute('title',t);}if(c){e.className=c;}
var ee=e;e.onclick=(f!=null?function(){f(ee);return false;}:function(){return false;});return e;},addButton:function(id,h,p,ot,ct,css,img){if(this.ta){this.initTags();var tag=this.bbc[id],th=this;if(!tag){if(ot&&ct){this.bbc[id]={id:id,open:ot,close:ct,key:null,ctrl:null,hint:h};tag=this.bbc[id];}else{return;}}
if(this.bbcPanel==null){this.bbcPanel=document.createElement('span');this.bbcPanel.className='bbcode';this.bbcPanel.style.display='block';this.ta.parentNode.insertBefore(this.bbcPanel,this.ta);}
var f=function(){var s=th.getSelection();if(s.length>0){th.surroundText(tag.open,tag.close);}else{var v=prompt(p,'');if(null!=v&&''!=v){th.insertText(tag.open+v+tag.close);}}return false;};tag.e=this.createButton(tag.id,(h!=null?h:tag.hint),(css?css:tag.id),f,img);this.bbcPanel.appendChild(tag.e);this.tags[tag.id]=tag;}},initSmiles:function(p){this.smilesPath=p;if(this.ta){this.smilesPanel=document.createElement('div');if(this.bbcPanel){document.body.appendChild(this.smilesPanel);this.smilesPanel.id='comments-form-smilespanel';this.smilesPanel.setAttribute('style','display:none;top:0;left:0;position:absolute;');this.smilesPanel.onclick=function(){this.style.display='none';};var jc=this,f=function(e){var sp=jc.smilesPanel,p=jc.getElementPos(e);if(sp){var sps=sp.style;sps.display=(sps.display=='none'||sps.display==''?'block':'none');sps.left=p.left+"px";sps.top=p.bottom+e.offsetHeight+"px";sps.zIndex=99;}
return false;};this.bbcPanel.appendChild(this.createButton(null,null,'bbcode-smile',f));}else{this.smilesPanel.className='smiles';this.ta.parentNode.insertBefore(this.smilesPanel,this.ta);}}},closeSmiles:function(){if(this.smilesPanel&&this.bbcPanel){this.smilesPanel.style.display='none';}},addSmile:function(code,image){if(this.ta){if(!this.smilesPath||!this.smilesPanel){return;}
var th=this,e=document.createElement('img');e.setAttribute('src',this.smilesPath+'/'+image);e.setAttribute('alt',code);e.className='smile';e.onclick=function(){th.insertText(' '+code+' ');};this.smilesPanel.appendChild(e);}},addCounter:function(m,pre,post,className){if(this.ta){if(pre!=null){this.l10n.counterPre=pre;}if(post!=null){this.l10n.counterPost=post;}
var ch=document.createElement('span');ch.className=className!=null?className:'';var t1=document.createTextNode(this.l10n.counterPre+' '),t2=document.createTextNode(' '+this.l10n.counterPost);var c=document.createElement('span');ch.appendChild(t1);ch.appendChild(c);ch.appendChild(t2);if(this.resizable){if(this.grippie!=null){this.grippie.appendChild(ch);}}
else{var d=document.createElement('div');d.className='counterpanel';this.ta.parentNode.insertBefore(d,this.ta.nextSibling);d.appendChild(ch);}
this.counter={e:c,max:m};this.updateCounter();}},addGrippie:function(){this.offset=null;this.dragging=false;this.grippie=document.createElement('div');this.grippie.className='grippie';this.ta.parentNode.insertBefore(this.grippie,this.ta.nextSibling);var th=this;this.events.add(this.grippie,'mousedown',function(e){return th.onMouseDown(e);});},updateCounter:function(){if(this.counter!=null){var ta=this.ta,e=this.counter.e;try{var n=document.createElement(e.tagName),v=this.counter.max-ta.value.length;n.innerHTML=(v>=0)?v:0;e.parentNode.replaceChild(n,e);this.counter.e=n;}catch(ex){}}},mousePosition:function(e){var px=0,py=0;if(!e){e=window.event;}if(e.pageX||e.pageY){px=e.pageX;py=e.pageY;}else if(e.clientX||e.clientY){px=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;py=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}return{x:px,y:py};},onChange:function(){this.updateCounter();if(this.ta&&!this.isWebkit){var l=this.ta.value.split('\n');this.ta.rows=(l.length<this.defaultRows)?this.defaultRows:l.length+1;}return false;},onMouseDown:function(e){this.offset=this.mousePosition(e).y;this.height=this.ta.clientHeight;this.dragging=true;var th=this;this.events.add(document,'mousemove',function(e){return th.onMouseMove(e);});this.events.add(document,'mouseup',function(e){return th.onMouseUp(e);});return false;},onMouseUp:function(e){this.dragging=false;},onMouseMove:function(e){if(this.dragging)this.ta.style.height=Math.max(this.defaultHeight,this.height+this.mousePosition(e).y-this.offset)+'px';return false;}};JCommentsForm.prototype={id:null,form:null,events:null,editor:null,elements:{},store:new Array('name','email','homepage'),fadeTimer:null,init:function(id,editor){var f=this;this.id=id;this.form=this.$(id);this.editor=editor;this.events=new JCommentsEvents();this.setElements(new Array('name','email','homepage','title','comment'));this.restoreValues();this.clear('captcha');this.setCaptcha();},setCaptcha:function(){this.captchaImage=this.$(this.id+'-captcha-image');this.register('captcha');},setEditor:function(e){this.editor=e;},setElements:function(e){for(i=0;i<e.length;i++){try{this.register(e[i]);}catch(e){}}},$:function(e){return JComments.prototype.$(e);},register:function(n){var f=this,e=this.$(this.id+'-'+n);if(e){this.elements[n]=e;JCommentsInput.prototype.register(e);this.events.add(e,!window.opera&&document.all?'keydown':'keypress',function(e){return f.keypress(e);});}},error:function(m,n){var e=this.elements[n];if(e){e.focus();e.className='error';}},clear:function(n){if(n==null){if(this.form!=null){this.form.reset();}return;}
switch(n){case'comment':if(this.editor!=null){this.editor.clear();}break;case'captcha':var cim=this.captchaImage,cin=this.elements['captcha'];if(cim){cim.src=cim.src.replace(/&ac=\d+/g,'&ac='+new String(Math.floor(Math.random()*100000)));}if(cin){cin.value='';}break;default:var e=this.elements[n];if(e){e.value='';}break;}},focus:function(n){var e;if(n==null){for(var nm in this.elements){e=this.elements[nm];if(e){e.focus();break;}}}else{e=this.elements[n];if(e){e.focus();}}},keypress:function(e){if(e.ctrlKey&&(e.keyCode==13||(e.type=='keypress'&&e.keyCode==10))){this.submit();e.returnValue=false;return this.events.cancel(e);}return this.keypressed(e);},add:function(n,i,v){if(this.form!=null){var e=document.createElement('input');e.setAttribute('type','hidden');e.setAttribute('name',n);e.setAttribute('id',i);e.setAttribute('value',v);this.form.appendChild(e);}},remove:function(i){var e=this.$(i);if(e){e.value=0;e.parentNode.removeChild(e);}},setText:function(n,t){if(n=='comment'){if(this.editor!=null){this.editor.clear();this.editor.insertText(t);}}else{var e=this.elements[n];if(e){e.value=t;}}},insertText:function(n,t){if(n=='comment'){if(this.editor!=null){this.editor.insertText(t);}}else{var e=this.elements[n];if(e){e.value+=t;}}},storeValues:function(){for(var i=0;i<this.store.length;i++){try{var el=JComments.prototype.$(this.id+'-'+this.store[i]);if(el){JComments.prototype.setCookie(this.store[i],encodeURIComponent(el.value),14);}}catch(e){}}},restoreValues:function(){for(var i=0;i<this.store.length;i++){try{var el=JComments.prototype.$(this.id+'-'+this.store[i]);if(el){if(el.type&&el.type=='hidden'){return;}else{el.value=decodeURIComponent(JComments.prototype.getCookie(this.store[i]));}}}catch(e){}}},submit:function(){},keypressed:function(e){}};JCommentsIndicator.prototype={e:null,init:function(){if(this.e==null){this.e=document.createElement('div');this.e.className='busy';}},move:function(p,b){if(p){if(this.e.parentNode){this.e.parentNode.removeChild(this.e);}if(b){p.insertBefore(this.e,b);}else{p.appendChild(this.e);}}},show:function(){this.e.style.display='block';},hide:function(){this.e.style.display='none';},start:function(p,b){this.move(p,b);this.show();},stop:function(){this.hide();}};JComments.prototype={oi:null,og:null,debug:false,requestURI:'',oldRequestURI:'',busy:null,form:null,cache:{},mode:'add',readyList:[],isReady:false,init:function(oi,og,r){var ua=navigator.userAgent.toLowerCase();this.browser={safari:/webkit/.test(ua),opera:/opera/.test(ua),msie:/msie/.test(ua)&&!(/opera/.test(ua)),mozilla:/mozilla/.test(ua)&&!(/(compatible|webkit)/.test(ua))};this.oi=oi;this.og=og;this.busy=new JCommentsIndicator();this.requestURI=r;var th=this;jtajax.startLoading=function(){th.busy.show();};jtajax.finishLoading=function(){th.busy.hide();};},reinit:function(oi,og){this.oi=oi;this.og=og;var foi=this.$('object_id');if(foi){foi.value=oi;};var fog=this.$('object_group');if(fog){fog.value=og;}this.showPage(oi,og,0);},setForm:function(f){this.form=f;this.form_id=f.id;this.setMode('add',null);var jc=this;this.form.submit=function(){jc.saveComment();};this.form.keypressed=function(e){if(e.keyCode==27&&jc.mode=='reply'){jc.restoreForm(false);}};this.formLoaded();},setList:function(l){this.list_id=l;},setMode:function(m,i){var b=this.$('comments-form-cancel'),jc=this;if(b!=null){b.style.display=(m!='add')?'':'none';b.onclick=(m=='edit'?function(){jc.cancelEdit(i);}:(m=='reply'?function(){jc.cancelReply();}:null));}this.mode=m;},$:function(id){if(!id){return null;}var e=document.getElementById(id);if(!e&&document.all){e=document.all[id];}return e;},ajax:function(f,a,fid){var r,prevURI;try{prevURI=jtajax.options.url;jtajax.setup({url:this.requestURI});r=jtajax.call(f,a,'post',fid);jtajax.options.url=prevURI;}catch(e){jtajax.options.url=prevURI;}return r;},initOnReady:function(){if(this.isReadyInited)return;this.isReadyInited=1;var jc=this;if(this.browser.mozilla||this.browser.opera){JCommentsEvents.prototype.add(document,'DOMContentLoaded',jc.ready);}
else if(this.browser.msie){(function(){try{document.documentElement.doScroll('left');}catch(e){setTimeout(arguments.callee,50);return;}jc.ready();})();}
else if(this.browser.safari){(function(){if(jc.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}jc.ready();})();}
JCommentsEvents.prototype.add(window,'load',function(){jc.ready(jc);});},onReady:function(f){if(this.isReady){f();}else{var jc=this;jc.readyList.push(f);jc.initOnReady();}},ready:function(){var jc=window.jcomments;if(jc.isReady||jc.readyList==null)return;jc.isReady=1;for(var i=0,len=jc.readyList.length;i<len;i++){try{jc.readyList[i]();}catch(e){}}jc.readyList=null;},setAntiCache:function(c,p,f){this.aca=c;this.acp=p;this.acf=f;this.onReady(this.loadComments);},loadComments:function(){var jc=window.jcomments;var l=document.location.href,lc=true,i=l.lastIndexOf('#comment-');jc.clear('captcha');if(jc.aca){if(i!=0){var c=l.substring(i+9,l.length);if(!isNaN(c)){lc=false;jc.showComment(c);}}}if(jc.acp){if(lc){jc.showPage(jc.oi,jc.og,0);}}if(jc.acf){if(l.lastIndexOf('#addcomment')!=-1){jc.showForm(jc.oi,jc.og,'comments-form-link');}}},setCookie:function(n,v,d){var e='';if(d){var dt=new Date();dt.setTime(dt.getTime()+(d*24*60*60*1000));e="; expires="+dt.toGMTString();}document.cookie="jc_"+n+"="+v+e+"; path=/";},getCookie:function(n){var re=new RegExp("(\;|^)[^;]*("+"jc_"+n+")\=([^;]*)(;|$)");var r=re.exec(document.cookie);return r!=null?r[3]:'';},removeCookie:function(n){this.setCookie(n,"",-1);},scrollTo:function(n){if(n!=null){var e=this.$(n),t=0;if(e){t=e.offsetTop;for(var p=e.offsetParent;p;p=p.offsetParent){t+=p.offsetTop;}scrollTo(0,t);}}},scrollToList:function(){this.scrollTo(this.list_id);},scrollToForm:function(id){this.scrollTo(this.form_id);},scrollToComment:function(id){this.scrollTo('comment-'+id);},moveElement:function(e,p,b){if(e){if(p){if(e.parentNode){e.parentNode.removeChild(e);}if(b){p.insertBefore(e,b);}else{p.appendChild(e);}}}},createElement:function(t,i,c){var e=document.createElement(t);if(i){e.setAttribute('id',i);}if(c){e.className=c;}return e;},fade:function(id,s,e,m){var speed=Math.round(m/100),timer=0;if(s>e){for(i=s;i>=e;i--){setTimeout("JComments.prototype.setOpacity('"+id+"',"+i+")",(timer*speed));timer++;}var o=JComments.prototype.$(id);if(o){setTimeout(function(){o.style.display='none';},((s-e)*speed));}}else if(s<e){for(i=s;i<=e;i++){setTimeout("JComments.prototype.setOpacity('"+id+"',"+i+")",(timer*speed));timer++;}}},setOpacity:function(id,opacity){var e=this.$(id);if(e){var s=e.style;s.opacity=(opacity/100);s.MozOpacity=(opacity/100);s.KhtmlOpacity=(opacity/100);s.filter="alpha(opacity="+opacity+")";}},clear:function(n){if(this.form!=null){this.form.clear(n);}},insertText:function(t){if(this.form!=null){this.form.insertText('comment',t);}else{var jc=this;window.setTimeout(function(){jc.insertText(t);},500);}},busyList:function(){if(this.list_id){var l=this.$(this.list_id);if(l){this.busy.move(l.parentNode,l);}}},busyForm:function(){if(this.form_id){var f=this.$(this.form_id);if(f){this.busy.move(f.parentNode,f);}}},busyComment:function(i){this.busy.move(this.$('comment-item-'+i),null);},saveComment:function(i){var f='';if(this.mode!='edit'){f='JCommentsAddComment';this.busyForm();if(this.form){this.form.storeValues();}this.busy.show();}else{f='JCommentsSaveComment';this.busy.show();}return this.ajax(f,null,this.form_id);},editComment:function(i){this.busyComment(i);var a=arguments;if(this.form==null){a=new Array(i,1);}return this.ajax('JCommentsEditComment',a);},cancelEdit:function(i){if((!this.cache[i])||(this.cache[i]=='')){this.$('comment-body-'+i).innerHTML=this.cache[i];this.cache[i]='';}if(this.form){this.form.remove('comment-id-hidden-'+i);this.restoreForm(true);}var t=this.$('comment-toolbar-'+i);if(t){t.style.display='';}return this.ajax('JCommentsCancelComment',arguments);},cancelReply:function(){if(this.form){this.form.remove('comment-parent-id-hidden');this.restoreForm(false);}},quoteComment:function(i){var a=arguments;if(this.form==null){a=new Array(i,1);}return this.ajax('JCommentsQuoteComment',a);},publishComment:function(i){if(this.form){this.restoreForm();}this.busyComment(i);return this.ajax('JCommentsPublishComment',arguments);},deleteComment:function(i){this.busyComment(i);return this.ajax('JCommentsDeleteComment',arguments);},jump2email:function(i){return this.ajax('JCommentsJump2email',arguments);},updateList:function(t,m){if(this.list_id){var l=this.$(this.list_id);if(!l){l=this.$('comments');m='a';}switch(m){case'a':l.innerHTML=l.innerHTML+t;break;case'p':l.innerHTML=t+l.innerHTML;break;case'r':l.parentNode.innerHTML=t;break;}}},updateTree:function(t,r){var l;if(r==null){l=this.$('comments');if(l){l.innerHTML=t;}return;}l=this.$('comments-list-'+r);if(!l){var p=this.$('comment-item-'+r);if(p){this.busyComment(r);l=this.createElement('div','comments-list-'+r,'comments-list');l.innerHTML=t;p.parentNode.insertBefore(l,p.nextSibling);}}else{l.innerHTML=l.innerHTML+t;}this.restoreForm(true);},updateComment:function(id,t){if(t==''){var c=this.$('comment-item-'+id);c.parentNode.removeChild(c);var l=this.$('comments-list-'+id);if(l){l.parentNode.removeChild(l);}return;}this.$('comment-body-'+id).innerHTML=t;var te=this.$('comment-toolbar-'+id);if(te){te.style.display='';}if(this.form){this.form.remove('comment-id-hidden-'+id);this.restoreForm(true);}},voteComment:function(i){var v=this.$('comment-vote-holder-'+i);if(v){v.innerHTML='';this.busy.start(v,null);}return this.ajax('JCommentsVoteComment',arguments);},updateVote:function(i,t){this.busy.stop();var c=this.$('comment-vote-holder-'+i);if(c){c.innerHTML=t;}},showComment:function(id){return this.ajax('JCommentsShowComment',arguments);},showPage:function(i,g,p){if(this.form){this.restoreForm();}var l=this.$(this.list_id);if(!l){l=this.$(this.list_id+'-0');if(l){this.list_id=this.list_id+'-0';}}this.busyList();return this.ajax('JCommentsShowPage',arguments);},showForm:function(i,g,t){if(this.form){this.moveElement(this.form.form,this.$(t));return;}this.busyForm();return this.ajax('JCommentsShowForm',arguments);},showEdit:function(id,n,e,h,t,txt){var jc=this;if(this.form==null){window.setTimeout(function(){jc.showEdit(id,n,e,h,t,txt);},500);return;}
if((!this.cache[id])||(this.cache[id]=='')){this.cache[id]=this.$('comment-body-'+id).innerHTML;}
this.busy.stop();var f=this.form,ff=this.form.form,c=this.$('comment-item-'+id);if(ff!=null&&c!=null){f.add('id','comment-id-hidden-'+id,id);f.setText('name',n);f.setText('email',e);f.setText('homepage',h);f.setText('title',t);f.setText('comment',txt);var d=this.$('comments-inline-edit');if(d){d.parentNode.removeChild(d);}else{d=this.createElement('div','comments-inline-edit','comments-inline-edit');}c.appendChild(d);this.moveElement(ff,d);this.setMode('edit',id);var te=this.$('comment-toolbar-'+id);if(te){te.style.display='none';}
this.scrollTo('comments-inline-edit');this.form.focus('comment');}},showReply:function(id,q){this.busyComment(id);this.cancelReport();var jc=this,c=this.$('comment-item-'+id),d=this.$('comments-inline-edit');if(d){d.parentNode.removeChild(d);}else{d=this.createElement('div','comments-inline-edit','comments-inline-edit');}c.appendChild(d);if(!this.form){var t='comments-inline-edit',h=this.$('comments-form-link');if(h){t='comments-form-link';}
this.showForm(this.oi,this.og,t);var pid=id;this.formLoaded=function(){var f=jc.form;if(f!=null){f.add('parent','comment-parent-id-hidden',pid);}jc.setMode('reply',pid);jc.moveElement(jc.form.form,jc.$('comments-inline-edit'));jc.form.focus();if(q){jc.quoteComment(id);}};}else{var f=this.form,ff=this.form.form,p=this.$('comment-parent-id-hidden');if(ff!=null&&c!=null){if(!p){f.add('parent','comment-parent-id-hidden',id);}else{p.value=id;}this.moveElement(ff,d);this.setMode('reply',id);this.form.focus();if(q){this.quoteComment(id);}}}},formLoaded:function(){},restoreForm:function(c){var f=this.form;if(f!=null){var ff=this.form.form,jc=this;this.busy.stop();if(ff!=null){if(c){f.clear(null);}f.restoreValues();var a=this.$('addcomments'),p=this.$('comment-parent-id-hidden');if(p){p.value=0;}
this.moveElement(ff,a.parentNode,a);var d=this.$('comments-inline-edit');if(d){d.parentNode.removeChild(d);}this.setMode('add',null);}}},reportComment:function(id){this.busyComment(id);this.cancelReply();var jc=this,c=this.$('comment-item-'+id),d=this.$('comments-inline-report');if(d){d.parentNode.removeChild(d);}else{d=this.createElement('div','comments-inline-report','comments-inline-report');}c.appendChild(d);var a=new Array(id,'comments-inline-report');return this.ajax('JCommentsShowReportForm',a);},saveReport:function(i){this.ajax('JCommentsReportComment',null,'comments-report-form');return true;},cancelReport:function(){var d=this.$('comments-inline-report');if(d){d.innerHTML='';}},closeReport:function(m){this.cancelReport();this.showMessage(m,'info','comments-inline-report');},error:function(m,t,n){if(this.form!=null){this.form.error(n);}if(!t||t==''){t=this.form_id;}this.showMessage(m,'error',t);},message:function(m,t){if(!t||t==''){t=this.form_id;}this.showMessage(m,'info',t);},showMessage:function(m,c,t){clearTimeout(this.fadeTimer);var fe=this.$('comments-form-message');var af=this.$(t);if(fe){fe.parentNode.removeChild(fe);}fe=JComments.prototype.createElement('div','comments-form-message','');if(af){JComments.prototype.moveElement(fe,af,af.firstChild);}else{alert(m);return;}
if(!c){c='info';}fe.className='comments-form-message-'+c;fe.innerHTML=m;fe.style.display='block';JComments.prototype.setOpacity(fe.id,100);this.fadeTimer=setTimeout(function(){JComments.prototype.fade('comments-form-message',100,0,1000);},6000);},subscribe:function(o,g){return this.ajax('JCommentsSubscribe',arguments);},unsubscribe:function(o,g){return this.ajax('JCommentsUnsubscribe',arguments);},updateSubscription:function(m,t){var e=this.$('comments-subscription');if(e){var jc=this;e.innerHTML=t;e.onclick=m?function(){jc.unsubscribe(jc.oi,jc.og);return false;}:function(){jc.subscribe(jc.oi,jc.og);return false;};e.blur();}},go:function(l){window.open(l);return false;}};

/* ajax.js */

if(!window.jtajax){function jtAJAX()
{this.options={url:'',type:'post',nocache:true,data:''};this.$=function(id){if(!id){return null;}var o=document.getElementById(id);if(!o&&document.all){o=document.all[id];}return o;};this.extend=function(o,e){for(var k in(e||{}))o[k]=e[k];return o;};this.encode=function(t){return encodeURIComponent(t);};this.setup=function(options){this.options=this.extend(this.options,options);};this.xhr=function()
{var xhr=null;if('undefined'!=typeof XMLHttpRequest)xhr=new XMLHttpRequest();if(!xhr&&'undefined'!=typeof ActiveXObject){var msxmlhttp=new Array('Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP');for(var i=0;i<msxmlhttp.length;i++){try{xhr=new ActiveXObject(msxmlhttp[i]);}catch(e){xhr=null;}}}
return xhr;};this.form2query=function(sId)
{var frm=this.$(sId);if(frm&&frm.tagName.toUpperCase()=='FORM'){var e=frm.elements,query=[];for(var i=0;i<e.length;i++){var name=e[i].name,value;if(!name)continue;if(e[i].type&&('radio'==e[i].type||'checkbox'==e[i].type)&&false===e[i].checked)continue;if('select-multiple'==e[i].type){for(var j=0;j<e[i].length;j++){if(true===e[i].options[j].selected)
query.push(name+"="+this.encode(e[i].options[j].value));}}else{query.push(name+"="+this.encode(e[i].value));}}
return query.join('&');}
return'';};this.startLoading=function(){};this.finishLoading=function(){};this.ajax=function(options)
{var xhr=this.xhr();if(!xhr)return false;var o=this.extend(this.options,options);var url=o.url,jtx=this;var r=url;var h=location.hostname,d,i1,i2;i1=r.indexOf('://');if(i1!=-1){i2=r.indexOf('/',i1+3);if(i2!=-1){d=r.substring(i1+3,i2);if(d!=h){if(location.port!=''){h=h+':'+location.port;}r=r.replace(d,h);url=r;}}}
if('get'==o.type){if(true===o.nocache){var ts=new Date().getTime();url+=(url.indexOf("?")==-1?'?':'&')+'_jtxr_'+ts;}
if(o.data){url+=(url.indexOf("?")==-1?'?':'&')+o.data;o.data=null;}}
xhr.open(o.type.toUpperCase(),url,true);if('post'==o.type)
try{xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");}catch(e){}
if(true===o.nocache)
xhr.setRequestHeader('If-Modified-Since','Thu, 01 Jan 1970 00:00:00 GMT');xhr.onreadystatechange=function(){if(xhr.readyState!=4)return;jtx.finishLoading();if(xhr.status==200){jtx.processResponse(xhr.responseText);}
delete xhr;xhr=null;};try{jtx.startLoading();xhr.send(o.data);}catch(e){jtx.finishLoading();}
delete jtx;delete xhr;delete o;return true;};this.call=function(sFunction,aArgs,sType,sForm)
{var params='jtxf='+this.encode(sFunction);if(aArgs){for(var i=0;i<aArgs.length;i++){params+='&jtxa[]='+this.encode(aArgs[i]);}}else if(sForm){params+='&'+this.form2query(sForm);}
this.ajax({type:sType,data:params});return true;};this.processResponse=function(sText)
{if(sText==='')return false;if(sText.substring(0,3)!='[ {'){var idx=sText.indexOf('[ {');sText=sText.substr(idx);}
var result;try{result=eval(sText);}catch(e){}
if('undefined'==typeof result){return false;}
var cmd,id,property,data,obj=null;for(var i=0;i<result.length;i++){cmd=result[i]['n'];id=result[i]['t'];property=result[i]['p'];data=result[i]['d'];obj=this.$(id);switch(cmd){case'as':if(obj){eval("obj."+property+"=data;");}break;case'al':if(data){alert(data);}break;case'js':if(data){eval(data);}break;default:this.error('Unknown command: '+cmd);break;}}
delete result;delete cmd;delete id;delete property;delete data;delete obj;return true;};this.error=function(){};}
var jtajax=new jtAJAX();}

/* caption.js */

var JCaption=new Class({initialize:function(selector)
{this.selector=selector;var images=$$(selector);images.each(function(image){this.createCaption(image);},this);},createCaption:function(element)
{var caption=document.createTextNode(element.title);var container=document.createElement("div");var text=document.createElement("p");var width=element.getAttribute("width");var align=element.getAttribute("align");if(!width){width=element.width;}
if(!align)
align=element.getStyle("float");if(!align)
align=element.style.styleFloat;if(align==""){align="none";}
text.appendChild(caption);text.className=this.selector.replace('.','_');element.parentNode.insertBefore(container,element);container.appendChild(element);if(element.title!=""){container.appendChild(text);}
container.className=this.selector.replace('.','_');container.className=container.className+" "+align;container.setAttribute("style","float:"+align);container.style.width=width+"px";}});document.caption=null;window.addEvent('load',function(){var caption=new JCaption('img.caption')
document.caption=caption});

/* rokstories.js */

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('s 2o=j 3z({3y:1.8,7:{2p:0,1F:3t,2s:3r,1n:0.3,1T:1c,1J:3n,1V:3l,2B:H.3i.3h.3g,2H:\'K\',9:\'3c\',2M:p,2N:p,29:1c,19:1c,2e:\'35\',27:\'2f\',2S:{x:0,y:0},2T:{x:0,y:0}},2b:6(b,c){2.2Z(c);2.h=$(b)||1q;2.9=2.7.9;4(!2.h)1z;2.X=1q;2.v=2.7.2p;2.q=2.h.N(\'.1s-w\')[0];4(2.9==\'D\')2.q=2.h.N(\'.1s-w\');2.w=2I[\'B-\'+2.7.28];2.o=2.h.N(\'.1s-o 2E\');2.1e=2.h.N(\'.2V-21 .3k\');4(2.9==\'1D\'||2.9==\'Q\'||2.9==\'D\')2.1d=2.h.N(\'.1d-1N .F-2v-1N\');4(!2.w.g||!2.o.g||!2.1e.g)1z;2.1h=2I[\'B-\'+2.7.28];2.15=[];4(2.9==\'1D\'||2.9==\'Q\'){2.Z=[];2.11=2.h.P(\'.F-1R-l\');2.13=2.h.P(\'.F-1R-r\');4(2.11&&2.13)2.1Z();(2.1d.g).2d(6(i){2.Z.1a(j H.V(2.1d[i],{I:p,G:T}).C({\'k\':0}))}.1m(2));4(2.9==\'Q\'){2.u=2.h.N(\'.F-1p-1v\');4(2.u.g==2.o.g)2.1w();E 26 j 25(\'24 23\\\'t 22 2g 1p 20 1h\');}}E 4(2.9==\'2m\'||2.9==\'1E\'){2.o.O(\'1l\',\'1H\');2.h.P(\'.2V-21\').U(2.q).3B({\'3v\':\'3u\',\'z-3s\':5});4(2.9==\'1E\')2.h.P(\'.F-3o\').U(2.q);2.u=2.h.N(\'.F-u-1v\');4(2.9==\'1E\')2.u=2.h.N(\'.F-1p-1v\');4(2.u.g==2.o.g)2.1w();E 26 j 25(\'24 23\\\'t 22 2g 1p 20 1h\');}E 4(2.9==\'D\'){1j.1U(\'1K\',6(){2.2y=1c;2.1I.1k().O(\'A\',2.14[2.v].1X().1Y.y);2.14.O(\'1l\',\'2v\')}.1m(2));2.u=2.h.N(\'.F-u-1v\');4(2.u.g){4(2.u.g==2.o.g)2.1w();E 26 j 25(\'24 23\\\'t 22 2g 1p 20 1h\');}2.o.O(\'1l\',\'1H\');2.14=2.h.N(\'.F-3m\');2.Z=[];2.11=2.h.P(\'.F-1R-l\');2.13=2.h.P(\'.F-1R-r\');4(2.11&&2.13){2.11.2C(\'1N\',\'1B\');2.13.2C(\'1N\',\'1B\');2.1Z()}(2.1d.g).2d(6(i){2.Z.1a(j H.V(2.1d[i],{I:p,G:T}).C({\'k\':0}))}.1m(2))}(2.1h.g).2d(6(i){2.15.1a(1q)}.1m(2));2.10=[];2.17=[];4(2.w.g!=2.o.g&&2.w.g!=2.1e.g)1z;2.g=2.w.g;4(2.9!=\'D\'){2.2h=2.o[0].1k();2.1x=2.1e[0].1k();2.q.L(\'B-S\');2.1x.L(\'B-S\');2.o.O(\'k\',2.7.1n);2.2L=j H.V(2.1x,{I:p,G:T}).C({A:0});2.1b=j H.V(2.q,{I:p,G:T}).C({A:0});4(!1j.36&&!1j.34)2.1b.C({\'J\':(1j.2Y)?\'2X%\':2.7.1F});2.1b.m({A:2.7.2s})}E{2.q[2.v].L(\'B-S\');2.1I=2.h.P(\'.F-21\');2.2c=j H.30(2.1I.1k(),{31:p,G:2.7.1V,1M:2.7.2B});2.2c.C(0,0);2.1b=[];2.q.W(6(a,i){2.1b.1a(j H.V(a,{I:p,G:T}));4(i!=2.v)2.14[i].O(\'1l\',\'1H\')},2)}2.19=2.h.P(\'.1s-19\');4(!2.7.19&&2.19)2.19.O(\'1l\',\'1H\');2.2Q();2.1P=1c},2P:6(){s d=2;2.o.W(6(c,i){d.10.1a(j H.V(c,{I:p,G:T}).C({\'k\':d.7.1n}));c.1G({\'K\':6(){$1u(d.X);4(d.9!=\'D\')d.q.L(\'B-S\');E d.q[i].L(\'B-S\');4(d.9!=\'D\'){d.15.W(6(a){4(a)a.m({\'k\':0})});4(d.7.9==\'2m\'||d.7.9==\'1E\'||d.7.9==\'Q\')d.1y(i)}E{d.2c.R().37(d.14[i]);4(d.u.g)d.1y(i);4(d.2y){s b=d.14[i].1X().1Y.y;d.1I.1k().38(\'A\',{G:d.7.1V}).m(b)}}d.1K(i)},\'1r\':6(){4(d.7.2H==\'1r\')c.16(\'K\');4(i!=d.v)d.10[i].m({\'k\':1})},\'1A\':6(){4(i!=d.v)d.10[i].m({\'k\':d.7.1n})}})})},1w:6(){2.u.W(6(a,i){a.1U(\'K\',6(){2.o[i].16(\'K\');2.1y(i)}.1m(2))},2)},1y:6(i){4(2.u){2.u.M(\'2A\');2.u[i].L(\'2A\')}},1Z:6(){s c=2.11,Y=2.13,n=2;c.1G({\'1r\':6(){c.L(\'1f-1Q\')},\'1A\':6(){c.M(\'1f-1Q\').M(\'1f-12\')},\'2w\':6(){c.L(\'1f-12\')},\'2u\':6(){c.M(\'1f-12\')},\'K\':6(){n.2t();4(n.1L){n.1L.2r();n.1L.16(\'1C\')}}});Y.1G({\'1r\':6(){Y.L(\'1i-1Q\')},\'1A\':6(){Y.M(\'1i-1Q\').M(\'1i-12\')},\'2w\':6(){Y.L(\'1i-12\')},\'2u\':6(){Y.M(\'1i-12\')},\'K\':6(){n.1g();4(n.1S){n.1S.2r();n.1S.16(\'1C\')}}});4(2.7.2N){2.1L=j 2n(c,{2x:\'B\',2F:n.7.29,2O:n.7.2S,2b:6(){2.1O=j 2U(\'2R\',{\'2G\':\'1B-2z\'}).U(2.1t);2.18=j H.2l(2.1t,\'k\',{G:2j,I:p}).C(0)},1C:6(a){s b=n.v-1;4(b<0)b=n.o.g-1;n.o[b].2i().U(2.1O.2D());2.18.m(1)},2k:6(a){2.18.m(0)}});2.1S=j 2n(Y,{2x:\'B\',2F:n.7.29,2O:n.7.2T,2b:6(){2.1O=j 2U(\'2R\',{\'2G\':\'1B-2z\'}).U(2.1t);2.18=j H.2l(2.1t,\'k\',{G:2j,I:p}).C(0)},1C:6(a){s b=n.v+1;4(b>n.o.g-1)b=0;n.o[b].2i().U(2.1O.2D());2.18.m(1)},2k:6(a){2.18.m(0)}})}},1K:6(a){s b=2;4($3q(2.w[a])!=\'3p\'){b.1M(a,2.w[a]);b.1P=p}E{j 3j.1s(2.w[a],{3f:6(){$1u(b.X);4(b.9==\'D\'&&b.q[a].P(\'2E\')){b.1M(a,b.w[a]);b.1P=p;1z}4(b.9!=\'D\')b.w[a]=2.U(b.q);E b.w[a]=2.U(b.q[a]);4(b.7.2M){2.O(\'3e\',\'3d\').1U(\'K\',6(){1j.3b=3a[\'B-\'+b.7.28][a].39(/&33;/32,"&")})};4(b.9!=\'D\'){b.15[a]=j H.V(b.w[a],{I:p,G:T}).C({\'k\':0});b.2a.1J(2W,b)}b.1K(a);b.1P=p}})}},1M:6(b,c){s d=2;4(2.9!=\'D\'){2.1b.R().C({\'J\':c.J}).m({A:c.A})}4(2.9==\'Q\'){s e=(2.7.2e==\'2f\')?[2.1o,0]:[-2.1o,0];s f=(2.7.27==\'2f\')?[2.1o,0]:[-2.1o,0]}4(d.9!=\'D\')d.q.M(\'B-S\');E d.q[d.v].M(\'B-S\');d.17.W(6(a){a.m({\'k\':0})});d.10.W(6(a){a.m({\'k\':d.7.1n})});4(d.9==\'1D\'||d.9==\'Q\')d.Z.W(6(a){a.m({\'k\':0})});4(d.9!=\'D\'){4(d.7.27==\'2K\'||d.7.9!=\'Q\')d.15[b].R().m({\'k\':1});E d.15[b].R().m({\'k\':1,\'2J\':f});4((d.9==\'1D\'||d.9==\'Q\')&&d.Z.g)d.Z[b].R().m({\'k\':1});4(d.7.2e==\'2K\'||d.7.9!=\'Q\')d.17[b].R().m({\'k\':1});E d.17[b].R().m({\'k\':1,\'2J\':e});d.10[b].R().m({\'k\':1})}d.v=b;4(d.7.1T&&!d.1W)d.X=d.1g.2q(d.7.1J,d)},2Q:6(){s a=2;4(2.9!=\'D\')2.2a();2.2P();4(2.7.1T){2.h.1G({\'1r\':6(){$1u(a.X);a.1W=1c},\'1A\':6(){$1u(a.X);a.1W=p;a.X=a.1g.2q(a.7.1J,a)}})};2.1g(2.v)},2a:6(){s c={J:0,A:0};2.2h.O(\'J\',(2.7.1F==\'3w\')?2.q.3x(\'J\'):2.7.1F);2.1e.W(6(a){4(2.17.g<2.g)2.17.1a(j H.V(a,{I:p,G:T}).C({\'k\':0}));s b=a.1X().1Y;4(b.x>c.J)c.J=b.x;4(b.y>c.A)c.A=b.y},2);2.2L.R().C(\'J\',c.J).m({A:c.A});2.1o=c.A;2.1x.M(\'B-S\')},1g:6(a){s b=(a!=1q)?a:2.v+1;4(b>2.g-1)b=0;2.v=b;2.o[b].16(\'K\')},2t:6(a){s b=(a!=1q)?a:2.v-1;4(b<0)b=2.g-1;2.v=b;2.o[b].16(\'K\')}});2o.3A(j 3C);',62,225,'||this||if||function|options||layout|||||||length|element||new|opacity||start|self|small|false|fullParent||var||circles|current|full||||height|rokstories|set|layout6|else|feature|duration|Fx|wait|width|click|addClass|removeClass|getElements|setStyle|getElement|layout5|stop|spinner|400|inject|Styles|each|timer|right|labelsFx|smallFx|arrowLeft|down|arrowRight|stories|fullFx|fireEvent|descsFx|fx|mask|push|fullParentFx|true|labels|descs|arrowleft|next|images|arrowright|window|getParent|display|bind|thumbsOpacity|descsHeight|number|null|mouseenter|image|toolTip|clear|sub|circlesEvents|descsParent|circleSwitch|return|mouseleave|tip|onShow|layout2|layout4|startWidth|addEvents|none|featureContainer|delay|load|tipsLeft|transition|title|rokTip|loading|hover|arrow|tipsRight|autorun|addEvent|scrollerDuration|pause|getSize|size|arrowsEvents|of|container|match|don|Circles|Error|throw|imgsAnim|id|fixedThumb|setDescSizes|initialize|scroller|times|descsAnim|bottomup|the|smallParent|clone|300|onHide|Style|layout3|Tips|RokStories|startElement|periodical|hide|startHeight|previous|mouseup|block|mousedown|className|loaded|wrapper|active|scrollerTransition|setProperty|empty|img|fixed|class|mousetype|RokStoriesImage|top|fade|descsParentFx|linkedImgs|showThumbs|offsets|addThumbsEvents|setSizes|div|thumbLeftOffsets|thumbRightOffsets|Element|desc|70|100|ie|setOptions|Scroll|wheelStops|gi|amp|gecko|topdown|webkit|toElement|effect|replace|RokStoriesLinks|location|layout1|pointer|cursor|onload|easeInOut|Expo|Transitions|Asset|description|1000|story|3000|numbers|string|type|200|index|410|absolute|position|auto|getStyle|version|Class|implement|setStyles|Options'.split('|'),0,{}))

/* rokajaxsearch.js */

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('N 4u=P 5T({5S:"1.8",R:{\'1i\':19,\'1K\':19,\'4l\':1T,\'3V\':1T,\'3U\':1T,\'5K\':1T,\'3S\':\'5I\',\'3N\':\'5G\',\'1n\':19,\'33\':19,\'34\':19,\'35\':19,\'3L\':19,\'37\':19,\'1f\':19,\'3x\':19,\'3g\':19,\'2a\':19,\'1k\':19,\'3j\':19,\'2b\':19,\'3z\':1J,\'2m\':19,\'3l\':19,\'2q\':19,\'3q\':19,\'3s\':1J,\'3t\':1J,\'3i\':1J,\'3f\':1J,\'2i\':1J},5i:U(b){6.5e(b);6.2e=19;6.1M=[\'5c\',\'5b\'];6.3e=6.R.2b;6.1a=$(\'58\').1m(\'56\',\'55\');N c=6.1a.2w();6.1i=$(\'1N\').27({\'3c\':\'3B\',\'1H\':c.1H+c.1R,\'Y\':6.2g()}).S(2H.3Q);6.26=P 30.3W(6.1i,\'2K\').4a(0);6.1o=0;N d=6;2h.1z(\'4H\',U(){d.1i.1l(\'Y\',d.2g())});6.15=\'1F\';N e=6.R.1k;O(6.R.4l||6.R.3V||6.R.3U){$$(\'#23 .4B 2P[15=4z]\').1x(U(a){a.1z(\'1s\',U(){6.15=a.1L;O(6.15==\'2O\'||6.15==\'2C\'||6.15==\'2R\'||6.15==\'2B\'){6.R.1k=4;O(6.15==\'2O\')6.Z=P Z.1n.4D();11 O(6.15==\'2C\')6.Z=P Z.1n.4E();11 O(6.15==\'2R\'){6.R.1k=3;6.Z=P Z.1n.2U();6.Z.4j(Z.1n.2U.4F,Z.1n.2U[\'4G\'+6.R.3S])}11 O(6.15==\'2B\'){6.R.1k=3;6.Z=P Z.1n.4I()}O(6.15!=\'2C\'&&6.15!=\'2B\')6.Z.4j(Z.1n.2V.4J,Z.1n.2V[\'4K\'+6.R.3N]);6.Z.4L(Z.1n.2V.4M);6.Z.4N();6.Z.4O(6,6.48)}11 6.R.1k=e}.1v(6))},6)};6.29();6.45()},2g:U(){N a=6.1a.2w(),x=$(\'1N\').2W().2X.x;N b=$(2h).2W().2X,Y;O(b.x/2<a.Y+a.1u){Y=a.Y+a.1u-x}11{Y=a.Y}O(Y<0)Y=a.Y;1C Y},3Y:U(){O(!6.1a.2d(\'1E\'))6.1a.13(\'1E\');6.Z.4Q(6.1a.1L)},48:U(){N n=6.Z.1i;N o=$(\'2x\');N p=P Q(\'3O\',{\'T\':\'3M\'}).S(o);O(6.15==\'2O\'){n.1x(U(a){N b=P Q(\'25\');N c=P Q(\'a\',{\'1c\':a.4T}).1m(\'1A\',\'1B\').12(a.2v);N d=P Q(\'2u\').S(b).2t(c);N e=P Q(\'p\').12(\'<1G><a 1c="\'+a.2L+\'" 1A="1B">\'+a.3A+\'</a></1G>\').S(b);N f=a.3d;f=f.1S(\'<b>\',\'<1d T="2f">\').1S(\'</b>\',\'</1d>\');N g=P Q(\'V\',{\'T\':\'2r\'}).12(f).S(b);b.S(p)})}11 O(6.15==\'2C\'){n.1x(U(a){N b=P Q(\'25\');N c=P Q(\'a\',{\'1c\':a.5n}).1m(\'1A\',\'1B\').12(a.2v);N d=P Q(\'2u\').S(b).2t(c);N e=P Q(\'p\').12(\'<1G>3k \'+a.5o+\' - <a 1c="\'+a.3p+\'" 1A="1B">\'+a.3p+\'</a></1G>\').S(b);N f=a.3d;f=f.1S(\'<b>\',\'<1d T="2f">\').1S(\'</b>\',\'</1d>\');N g=P Q(\'V\',{\'T\':\'2r\'}).12(f).S(b);b.S(p)})}11 O(6.15==\'2R\'){n.1x(U(b){N c=P Q(\'25\');N d=P Q(\'a\',{\'1c\':b.2L}).1m(\'1A\',\'1B\').12(b.2v);N e=P Q(\'2u\').S(c).2t(d);N f=P Q(\'p\').12(\'<1G><a 1c="\'+b.5q+\'" 1A="1B">\'+b.3A+\'</a></1G>\').S(c);N g=b.3d;g=g.1S(\'<b>\',\'<1d T="2f">\').1S(\'</b>\',\'</1d>\');N h=P Q(\'V\',{\'T\':\'2r\'}).12(g).S(c);N i=P Q(\'V\',{\'T\':\'Z-3o-2p 1E\'}).S(h);i.27({\'1u\':b.2o.1q(),\'1R\':b.2n.1q()});N a=P Q(\'a\',{\'1c\':b.2L,\'1A\':\'1B\'}).S(i);N j=P Q(\'2p\',{1u:b.2o.1q(),1R:b.2n.1q(),3v:b.3w}).S(a);c.S(p)})}11 O(6.15==\'2B\'){n.1x(U(b){N c=P Q(\'25\');N d=P Q(\'a\',{\'1c\':b.5z}).1m(\'1A\',\'1B\').12(b.2v);N e=P Q(\'2u\').S(c).2t(d);N f=b.3y.1q();N g=\'5A:\'+((f<10)?\'0\'+f:f);O(f>=2j){N m=f/2j;N s=f-(m*2j);m=m.1q();s=s.1q();O(m<10)m=\'0\'+m;O(s<10)s=\'0\'+s;g=m+\':\'+s;O(m>=2j){N h=m/2j;h=h.1q();O(h<10)h=\'0\'+h;g=h+g}}N i=P Q(\'p\').12(\'<1d T="\'+b.3K.5B()+\'">5C: \'+(5D(b.5E)).5F(2)+\' | 5H: \'+g+\' <1G>\'+b.3K+\'</1G></1d>\').S(c);N j=P Q(\'V\',{\'T\':\'2r\'}).12(\'\').S(c);N k=P Q(\'V\',{\'T\':\'Z-3o-2p 1E\'}).S(j);k.27({\'1u\':b.2o.1q(),\'1R\':b.2n.1q(),\'5J-5L\':\'5M\'});N a=P Q(\'a\',{\'1c\':b.2L,\'1A\':\'1B\'}).S(k);N l=P Q(\'2p\',{3v:b.3w,1u:b.2o.1q(),1R:b.2n.1q()}).S(a);c.S(p)})}6.1i.1W().14(\'1N\').1l(\'1I\',\'1Y\');6.1g=19;6.1j=19;6.X=-1;6.1t=[];6.2Q();o.1W().1l(\'1I\',\'1Y\');6.1a.14(\'1E\');N q=6.1a.2w(),2J=6;6.1i.27({\'1H\':q.1H+q.1R,\'Y\':2J.2g()});6.26.2l(1);6.1p(\'3b\')},29:U(){6.1a.29({\'1s\':U(){O(6.1a.4v()==6.R.1n)6.1a.1L=\'\'}.1v(6),\'5V\':U(){O(6.1a.4v()==\'\')6.1a.1L=6.R.1n}.1v(6),\'5Q\':U(e){e=P 1U(e);$4s(6.2e);O(e.1h==\'24\')e.1X()},\'20\':U(e){e=P 1U(e);O(e.2S==17||e.2S==18||e.2S==5N||e.4f||e.43||e.42)1C 1T;O(e.4f||e.43||e.42||e.1h==\'2Y\'||e.1h==\'31\'||e.1h==\'39\'||e.1h==\'Y\'||e.1h==\'1e\')1C 1J;O(e.1h==\'24\')e.1X();O(e.1h==\'24\'&&6.X!=-1){O(6.X||6.X==0)3D.1c=6.1t[6.X].2M(\'a\');1C 1T};$4s(6.2e);N j=6.R.3L.2k("?")[0];j=j.1S(6.R.3g,\'\');j=(j)?j:"3n.5y";N k=6.R.3g+j;O(6.1a.1L==\'\'){N l=6.R.2m.2k(" ");6.1i.1W().14(\'1N\').1l(\'1I\',\'3h\');O(l.16>0&&l!=\'\')l.1x(U(a){$(a).1l(\'1I\',\'1Y\')})}11{O(6.15==\'1F\'){N m=6.1a.1L.2k(\'"\');O(m.16>=3){6.R.2b=\'5w\'}11{6.R.2b=6.3e}N n=P 5v(k,{5u:\'5t\',3m:5m,5l:{\'15\':\'5k\',\'5j\':\'5f\',\'5a\':\'1n\',\'3e\':6.R.2b,\'3j\':6.R.3j,\'2a\':6.R.2a,\'50\':6.1a.1L.1S(/\\"/g,\'\'),\'4Z\':\'4Y\',\'r\':$4X()},4W:U(){6.1a.13(\'1E\')}.1v(6),4V:U(d,b,c){N e=P Q(\'V\',{\'3G\':{\'3H\':\'4U\'}}).12(d);N f=$(\'2x\');N g=e.22(\'.38\');O(g){e.1V().1x(U(a){O(a.36(\'T\')==\'38\'&&a.32!=\'1f\'){f.12(a.28)}})}11{O(2h.3P)e.S(2H.3Q);g=e.22(\'#1f\');O(2h.3P)e.4S();O(g){N h=g.22(\'.1i\');f.12((h)?h.28:\'\')}}6.1i.1W().14(\'1N\').1l(\'1I\',\'1Y\');6.1g=19;6.1j=19;6.X=-1;6.1t=[];O(e.22(\'.38\'))6.3R();11 6.2Q();f.1W().1l(\'1I\',\'1Y\');6.1a.14(\'1E\');N i=6.1a.2w(),2J=6;6.1i.27({\'1H\':i.1H+i.1R,\'Y\':2J.2g()});6.26.2l(1);6.1p(\'3b\')}.1v(6)});6.2e=n.4R.3m(3T,n)}11 O(6.15!=\'1F\'){6.2e=6.3Y.3m(3T,6)}}1C 1J}.1v(6)});1C 6},45:U(){N b={\'20\':U(e){e=P 1U(e);O(e.1h==\'Y\'||e.1h==\'1e\'||e.1h==\'31\'||e.1h==\'39\'||e.1h==\'24\'||e.1h==\'2Y\'){e.1X();N a=1T;O(e.1h==\'Y\'&&6.1g)6.1g.1p(\'1s\');11 O(e.1h==\'1e\'&&6.1j)6.1j.1p(\'1s\');11 O(e.1h==\'2Y\'&&6.1K)6.1K.1p(\'1s\',e);11 O(e.1h==\'39\'){a=6.X;O(6.X==-1)6.X=(6.R.1k)*6.1o;11 O(6.X+1<6.1t.16)6.X++;11 1C;O(a!=-1)6.1t[a].1p(\'1P\');O((6.X/6.R.1k).1q()>6.1o)6.1j.1p(\'1s\',1J);O(6.X||6.X==0)6.1t[6.X].1p(\'2y\')}11 O(e.1h==\'31\'){a=6.X;O(6.X==-1)6.X=(6.R.1k)*6.1o;11 O(6.X-1>=0)6.X--;11 1C;O(a!=-1)6.1t[a].1p(\'1P\');O((6.X/6.R.1k).1q()<6.1o)6.1g.1p(\'1s\',1J);O(6.X||6.X==0)6.1t[6.X].1p(\'2y\')}11 O(e.1h==\'24\'){O(6.X||6.X==0)2h.3D=6.1t[6.X].22(\'a\')}}}.1v(6)};O(6.R.3z){6.1z(\'3b\',U(){2H.1z(\'20\',b.20)});6.1z(\'2Z\',U(){2H.4P(\'20\',b.20)})}},3R:U(){N r=6;N s=P Q(\'V\',{\'T\':\'3X\'}).S(6.1i);N t=P Q(\'V\',{\'T\':\'3Z\'}).S(s);N u=P Q(\'V\',{\'T\':\'40\'}).S(t);N v=P Q(\'V\',{\'T\':\'41\'}).S(u);N w=P Q(\'V\',{\'T\':\'44 1r\'}).12(6.R.1i).1w(v);6.1K=P Q(\'a\',{\'32\':\'46\',\'T\':\'1r\'}).1m(\'1c\',\'#\').12(6.R.1K).47(w);N x=6.R.2m.2k(" ");6.1K.1z(\'1s\',U(e){6.1p(\'2Z\');P 1U(e).1X();6.1a.1L=6.R.1n;N b=6;6.26.2l(0).4w(U(){b.1i.1W().14(\'1N\')});O(x.16>0&&x!=\'\')x.1x(U(a){$(a).1l(\'1I\',\'1Y\')})}.1v(6));O(x.16>0&&x!=\'\')x.1x(U(a){$(a).1l(\'1I\',\'3h\')});6.1i.13(\'1N\');N y=$$(\'#2x 4C\');O(y.16>0){N z=P Q(\'V\',{\'T\':\'1Z-4r\'}).S(v);N A=P Q(\'V\',{\'T\':\'1Z-2c\'}).S(z);y.1x(U(p,i){N q=\'\';q=p.1V();O(q.16>0){q.1x(U(a,j){O(a.4A()=="V"){O(a.1V().16>2&&!a.4x()){N b=a.2M().2T().36(\'1c\');N c=P Q(\'V\',{\'T\':6.1M[i%2]+\' 1r\'});N d=P Q(\'a\').1m(\'1c\',b).1w(c);N e=P Q(\'2D\').12(a.2M().2T().2N()).1w(d);6.1t.2E(c);c.29({\'2y\':U(){6.13(r.1M[i%2]+\'-2F\');r.X=i},\'1P\':U(){6.14(r.1M[i%2]+\'-2F\');O(r.X==i)r.X=-1}});N f=\'\';O(6.R.2i)f=a.2T().28;N g=P Q(\'1d\').12(f).1D(d);O(6.R.3i){N h=P Q(\'1d\',{\'T\':\'1G\'}).12(a.1V().4y().2N()).1D(d);N k=P Q(\'2G\').1D(h)}O(6.R.3f){d=P Q(\'a\',{\'T\':\'4q\'}).1m(\'1c\',b).12(6.R.33).1D(g);O(6.R.2i)k=P Q(\'2G\').1D(g)}N l=P Q(\'V\',{\'T\':\'4p 1r\'}).S(A);N m=P Q(\'V\',{\'T\':\'4o 1r\'}).S(l);N n=P Q(\'V\',{\'T\':\'4m 1r\'}).S(m);N o=P Q(\'V\',{\'T\':\'4i 1r\'}).S(n);c.S(o)}}},6)}},6);N B=A.1V();N C=1Q.4h(6.R.1k,B.16);N D=1Q.4g(6.R.1k,B.16);N E=6.R.1k;6.1f=[];(1Q.4e(C/D)).4d(U(i){O(B[i])6.1f.2E(P Q(\'V\',{\'T\':\'1f 1f-\'+i}).S(A).1l(\'1u\',A.2I(\'1u\')));4c(j=0,l=E;j<l;j++){O(B[i*E+j])B[i*E+j].S(6.1f[i])}}.1v(6));A.1l(\'1u\',z.2I(\'1u\').1q()*1Q.4b(C/D)+49)}O(!y.16){N F=P Q(\'V\',{\'T\':6.1M[0]});N G=P Q(\'2D\').12(6.R.34).1w(F);N H=P Q(\'a\').1m(\'1c\',6.R.37).1D(G);G=P Q(\'1d\').12(6.R.35).1w(H);F.S(v)}11{O(6.R.3l){N I=$$(\'#23 2P[3J=2a]\')[0];6.1O=P Q(\'V\',{\'T\':"3I 1r"});N J=P Q(\'a\').1m(\'1c\',"#").1w(6.1O);G=P Q(\'1d\').12(6.R.2q).1w(J);J.1z(\'1s\',U(e){P 1U(e).1X();$(\'23\').3F()});6.1O.S(v);O(B.16>6.R.1k){6.21=P Q(\'V\',{\'T\':\'1Z-3E\'}).S(6.1O,\'1H\');6.1g=P Q(\'V\',{\'T\':\'W-Y-1b\'}).S(6.21);6.1j=P Q(\'V\',{\'T\':\'W-1e\'}).S(6.21);6.3a(z)}}}},2Q:U(){N p=6;N q=P Q(\'V\',{\'T\':\'3X\'}).S(6.1i);N r=P Q(\'V\',{\'T\':\'3Z\'}).S(q);N s=P Q(\'V\',{\'T\':\'40\'}).S(r);N t=P Q(\'V\',{\'T\':\'41\'}).S(s);N u=P Q(\'V\',{\'T\':\'44 1r\'}).12(6.R.1i).1w(t);O(6.15!=\'1F\'){t.13(\'Z-1n\').13(\'Z-1n-\'+6.15);N v=\'<1d T="3C-3k-Z">(3C 3k <a 1c="51://Z.52" 1A="1B">53</a>)</1d>\';u.12(6.R.1i+v)};6.1K=P Q(\'a\',{\'32\':\'46\',\'T\':\'1r\'}).1m(\'1c\',\'#\').12(6.R.1K).47(u);N w=6.R.2m.2k(" ");6.1K.1z(\'1s\',U(e){6.1p(\'2Z\');P 1U(e).1X();6.1a.1L=6.R.1n;N b=6;6.26.2l(0).4w(U(){b.1i.1W().14(\'1N\')});O(w.16>0&&w!=\'\')w.1x(U(a){$(a).1l(\'1I\',\'1Y\')})}.1v(6));O(w.16>0&&w!=\'\')w.1x(U(a){$(a).1l(\'1I\',\'3h\')});6.1i.13(\'1N\');N x=$$(\'#2x 3O.3M 25\');O(x.16>0){N y=P Q(\'V\',{\'T\':\'1Z-4r\'}).S(t);N z=P Q(\'V\',{\'T\':\'1Z-2c\'}).S(y);x.1x(U(a,i){N b=\'\';b=a.1V();O(b.16>0){N c=a.22(\'a\').36(\'1c\');N d=P Q(\'V\',{\'T\':6.1M[i%2]+\' 1r\'});N e=P Q(\'a\').1m(\'1c\',c).1w(d);O(6.15!=\'1F\')e.1m(\'1A\',\'1B\');N f=P Q(\'2D\').12(b[0].2N()).1w(e);6.1t.2E(d);d.29({\'2y\':U(){6.13(p.1M[i%2]+\'-2F\');p.X=i},\'1P\':U(){6.14(p.1M[i%2]+\'-2F\');O(p.X==i)p.X=-1}});N g=\'\';O(6.R.2i)g=b[2].28;N h=P Q(\'1d\').12(g).1D(e);O(6.R.3i){N j=P Q(\'1d\',{\'T\':\'1G\'}).12(b[1].28).1D(e);N k=P Q(\'2G\').1D(j)}O(6.R.3f){e=P Q(\'a\',{\'T\':\'4q\'}).1m(\'1c\',c).12(6.R.33).1D(h);O(6.15!=\'1F\')e.1m(\'1A\',\'1B\');O(6.R.2i)k=P Q(\'2G\').1D(h)}N l=P Q(\'V\',{\'T\':\'4p 1r\'}).S(z);N m=P Q(\'V\',{\'T\':\'4o 1r\'}).S(l);N n=P Q(\'V\',{\'T\':\'4m 1r\'}).S(m);N o=P Q(\'V\',{\'T\':\'4i 1r\'}).S(n);d.S(o)}},6);N A=z.1V();N B=1Q.4h(6.R.1k,A.16);N C=1Q.4g(6.R.1k,A.16);N D=6.R.1k;6.1f=[];(1Q.4e(B/C)).4d(U(i){O(A[i])6.1f.2E(P Q(\'V\',{\'T\':\'1f 1f-\'+i}).S(z).1l(\'1u\',z.2I(\'1u\')));4c(j=0,l=D;j<l;j++){O(A[i*D+j])A[i*D+j].S(6.1f[i])}}.1v(6));O(6.15!=\'1F\'){N E=6.1f[0].2W().2X;6.1f[0].1l(\'3c\',\'54\');6.2s=P Q(\'V\',{\'T\':\'23-57\',\'3G\':{\'1u\':E.x,\'1R\':E.y,\'3c\':\'3B\',\'Y\':0,\'1H\':0,\'3H\':\'59\',\'z-3n\':5}}).S(6.1f[0],\'1H\');N F=P 30.3W(6.2s,\'2K\',{3y:5d}).4a(0.9)}z.1l(\'1u\',y.2I(\'1u\').1q()*1Q.4b(B/C)+49)}O(!x.16){N G=P Q(\'V\',{\'T\':6.1M[0]});N H=P Q(\'2D\').12(6.R.34).1w(G);N I=P Q(\'a\').1m(\'1c\',6.R.37).1D(H);H=P Q(\'1d\').12(6.R.35).1w(I);G.S(t)}11{O(6.R.3l){N J=$$(\'#23 2P[3J=2a]\')[0];6.1O=P Q(\'V\',{\'T\':"3I 1r"});N K=P Q(\'a\',{\'T\':\'2q\'}).1m(\'1c\',"#").1w(6.1O);H=P Q(\'1d\').12(6.R.2q).1w(K);O(6.15!=\'1F\'){K.5g({\'1c\':6.Z.1y.5h,\'1A\':\'1B\'});O(6.R.3s)N L=P Q(\'1d\',{\'T\':\'5p\'}).5r(\'(\'+6.Z.1y.5s+\' \'+6.R.3q+\')\').S(K,\'3r\');O(6.R.3t){6.3u=P Q(\'V\',{\'T\':\'5x\'}).S(L||K,\'3r\');6.3u.12(6.R.1f+\' \'+\'<1d T="2f">\'+(6.Z.1y.2z+1)+\'</1d>\'+\' \'+6.R.3x+\' \'+\'<1d T="2f">\'+6.Z.1y.2A.16+\'</1d>\')}}11{K.1z(\'1s\',U(e){P 1U(e).1X();$(\'23\').3F()})}6.1O.S(t);O(A.16>6.R.1k||((6.15!=\'1F\')&&6.Z.1y.2A.16>1)){6.21=P Q(\'V\',{\'T\':\'1Z-3E\'}).S(6.1O,\'1H\');6.1g=P Q(\'V\',{\'T\':\'W-Y-1b\'}).S(6.21);6.1j=P Q(\'V\',{\'T\':\'W-1e\'}).S(6.21);O(6.15!=\'1F\'){O(6.Z.1y){N M=6.Z.1y.2z;O(M>0)6.1g.14(\'W-Y-1b\').13(\'W-Y\');O(M==7)6.1j.14(\'W-1e\').13(\'W-1e-1b\')}6.4k(y);F.2l(0)}11 6.3a(y)}}}},4k:U(c){6.1g.1z(\'1s\',U(a){O(!a&&6.X>=0)6.1t[6.X].1p(\'1P\');O(!a)6.X=-1;N b=(6.Z.1y)?6.Z.1y.2z:19;O(b-1<=0){6.1g.14(\'W-Y\').13(\'W-Y-1b\');6.1j.14(\'W-1e-1b\').13(\'W-1e\')}11{6.1g.14(\'W-Y-1b\').13(\'W-Y\');6.1j.14(\'W-1e-1b\').13(\'W-1e\')}O(!b)1C;11{O(!6.1a.2d(\'1E\'))6.1a.13(\'1E\');6.2s.1l(\'2K\',0.9);6.Z.4n(b-1)}}.1v(6));6.1j.1z(\'1s\',U(a){O(!a&&6.X>=0)6.1t[6.X].1p(\'1P\');O(!a)6.X=-1;N b=(6.Z.1y)?6.Z.1y.2z:19;O(b+1>=6.Z.1y.2A.16){6.1g.14(\'W-Y-1b\').13(\'W-Y\');6.1j.14(\'W-1e\').13(\'W-1e-1b\')}11{6.1g.14(\'W-Y\').13(\'W-Y-1b\');6.1j.14(\'W-1e-1b\').13(\'W-1e\')}O(b>=6.Z.1y.2A.16-1)1C;11{O(6.1g.2d(\'W-Y-1b\'))6.1g.14(\'W-Y-1b\').13(\'W-Y\');O(!6.1a.2d(\'1E\'))6.1a.13(\'1E\');6.2s.1l(\'2K\',0.9);6.Z.4n(b+1)}}.1v(6))},3a:U(b){6.2c=P 30.5O(b,{5P:1T});6.1g.1z(\'1s\',U(a){O(!a&&6.X>=0)6.1t[6.X].1p(\'1P\');O(!a)6.X=-1;O(6.1o-1<=0){6.1g.14(\'W-Y\').13(\'W-Y-1b\');6.1j.14(\'W-1e-1b\').13(\'W-1e\')}11{6.1g.14(\'W-Y-1b\').13(\'W-Y\');6.1j.14(\'W-1e-1b\').13(\'W-1e\')}O(!6.1o)1C;11{O(6.1o<0)6.1o=0;11 6.1o-=1;6.2c.4t(6.1f[6.1o])}}.1v(6));6.1j.1z(\'1s\',U(a){O(!a&&6.X>=0)6.1t[6.X].1p(\'1P\');O(!a)6.X=-1;O(6.1o+1>=6.1f.16-1){6.1g.14(\'W-Y-1b\').13(\'W-Y\');6.1j.14(\'W-1e\').13(\'W-1e-1b\')}11{6.1g.14(\'W-Y\').13(\'W-Y-1b\');6.1j.14(\'W-1e-1b\').13(\'W-1e\')}O(6.1o>=6.1f.16)1C;11{O(6.1g.2d(\'W-Y-1b\'))6.1g.14(\'W-Y-1b\').13(\'W-Y\');O(6.1o>=6.1f.16-1)6.1o=6.1f.16-1;11 6.1o+=1;6.2c.4t(6.1f[6.1o])}}.1v(6))}});4u.5R(P 5U,P 5W);',62,369,'||||||this|||||||||||||||||||||||||||||||||||||||||||var|if|new|Element|options|inject|class|function|div|arrow|selectedEl|left|google||else|setHTML|addClass|removeClass|type|length|||null|inputBox|disabled|href|span|right|page|arrowleft|key|results|arrowright|perpage|setStyle|setProperty|search|current|fireEvent|toInt|png|click|els|width|bind|injectInside|each|cursor|addEvent|target|_blank|return|injectAfter|loading|local|small|top|visibility|true|close|value|rows|roksearch_results|bottombar|mouseleave|Math|height|replace|false|Event|getChildren|empty|stop|visible|container|keyup|arrowDiv|getElement|rokajaxsearch|enter|li|fx|setStyles|innerHTML|addEvents|limit|phrase|scroller|hasClass|timer|highlight|getLeft|window|showdescription|60|split|start|hidedivs|tbHeight|tbWidth|image|viewall|description|layer|adopt|h4|title|getCoordinates|rokajaxsearch_tmp|mouseenter|currentPageIndex|pages|videos|blog|h3|push|hover|br|document|getStyle|self|opacity|url|getFirst|getText|web|input|outputTableless|images|code|getNext|ImageSearch|Search|getSize|size|esc|unloaded|Fx|up|id|readmore|noresults|advsearch|getProperty|advsearchlink|contentpaneopen|down|arrowsInit|loaded|position|content|searchphrase|showreadmore|uribase|hidden|showcategory|ordering|by|includelink|delay|index|thumb|blogUrl|estimated|after|showestimated|showpagination|pagination|src|tbUrl|page_of|duration|keyevents|visibleUrl|absolute|powered|location|arrows|submit|styles|display|roksearch_row_btm|name|videoType|searchlink|list|safesearch|ol|ie|body|outputTable|imagesize|500|imagesearch|blogsearch|Style|roksearch_wrapper1|googleStart|roksearch_wrapper2|roksearch_wrapper3|roksearch_wrapper4|meta|control|roksearch_header|keyEvents|roksearch_link|injectBefore|googleComplete|1000|set|round|for|times|abs|alt|min|max|roksearch_result_wrapper4|setRestriction|arrowsGoogleInit|websearch|roksearch_result_wrapper3|gotoPage|roksearch_result_wrapper2|roksearch_result_wrapper1|clr|wrapper|clear|toElement|RokAjaxSearch|getValue|chain|getPrevious|getLast|radio|getTag|search_options|fieldset|WebSearch|BlogSearch|RESTRICT_IMAGESIZE|IMAGESIZE_|resize|VideoSearch|RESTRICT_SAFESEARCH|SAFESEARCH_|setResultSetSize|SMALL_RESULTSET|setNoHtmlGeneration|setSearchCompleteCallback|removeEvent|execute|request|remove|unescapedUrl|none|onComplete|onRequest|time|component|tmpl|searchword|http|com|Google|relative|off|autocomplete|overlay|roksearch_search_str|block|view|roksearch_even|roksearch_odd|300|setOptions|com_search|setProperties|moreResultsUrl|initialize|option|raw|data|200|postUrl|author|estimated_res|originalContextUrl|setText|estimatedResultCount|get|method|Ajax|exact|pagination_res|php|playUrl|00|toLowerCase|Rating|parseFloat|rating|toFixed|MODERATE|Duration|MEDIUM|text|videosearch|align|center|224|Scroll|wait|keydown|implement|version|Class|Options|blur|Events'.split('|'),0,{}))


