﻿AJS.fx={_shades:{0:"ffffff",1:"ffffee",2:"ffffdd",3:"ffffcc",4:"ffffbb",5:"ffffaa",6:"ffff99"},highlight:function(b,c){var a=new AJS.fx.Base;a.elm=AJS.$(b);a.setOptions(c);a.options.duration=600;AJS.update(a,{increase:function(){if(this.now==7)b.style.backgroundColor="transparent";else b.style.backgroundColor="#"+AJS.fx._shades[Math.floor(this.now)]}});return a.custom(6,0)},fadeIn:function(b,a){a=a||{};if(!a.from){a.from=0;AJS.setOpacity(b,0)}if(!a.to)a.to=1;var c=new AJS.fx.Style(b,"opacity",a);return c.custom(a.from,a.to)},fadeOut:function(b,a){a=a||{};if(!a.from)a.from=1;if(!a.to)a.to=0;a.duration=300;var c=new AJS.fx.Style(b,"opacity",a);return c.custom(a.from,a.to)},setWidth:function(b,a){var c=new AJS.fx.Style(b,"width",a);return c.custom(a.from,a.to)},setHeight:function(b,a){var c=new AJS.fx.Style(b,"height",a);return c.custom(a.from,a.to)}};AJS.fx.Base=new AJS.Class({init:function(){AJS.bindMethods(this)},setOptions:function(a){this.options=AJS.update({onStart:function(){},onComplete:function(){},transition:AJS.fx.Transitions.sineInOut,duration:500,wait:true,fps:50},a||{})},step:function(){var a=(new Date).getTime();if(a<this.time+this.options.duration){this.cTime=a-this.time;this.setNow()}else{setTimeout(AJS.$b(this.options.onComplete,this,[this.elm]),10);this.clearTimer();this.now=this.to}this.increase()},setNow:function(){this.now=this.compute(this.from,this.to)},compute:function(a,c){var b=c-a;return this.options.transition(this.cTime,a,b,this.options.duration)},clearTimer:function(){clearInterval(this.timer);this.timer=null;return this},_start:function(a,b){if(!this.options.wait)this.clearTimer();if(this.timer)return;setTimeout(AJS.$p(this.options.onStart,this.elm),10);this.from=a;this.to=b;this.time=(new Date).getTime();this.timer=setInterval(this.step,Math.round(1e3/this.options.fps));return this},custom:function(a,b){return this._start(a,b)},"set":function(a){this.now=a;this.increase();return this},setStyle:function(a,c,b){if(this.property=="opacity")AJS.setOpacity(a,b);else AJS.setStyle(a,c,b)}});AJS.fx.Style=AJS.fx.Base.extend({init:function(a,b,c){this.parent();this.elm=a;this.setOptions(c);this.property=b},increase:function(){this.setStyle(this.elm,this.property,this.now)}});AJS.fx.Styles=AJS.fx.Base.extend({init:function(a,b){this.parent();this.elm=AJS.$(a);this.setOptions(b);this.now={}},setNow:function(){for(p in this.from)this.now[p]=this.compute(this.from[p],this.to[p])},custom:function(a){if(this.timer&&this.options.wait)return;var b={},c={};for(p in a){b[p]=a[p][0];c[p]=a[p][1]}return this._start(b,c)},increase:function(){for(var a in this.now)this.setStyle(this.elm,a,this.now[a])}});AJS.fx.Transitions={linear:function(d,a,b,c){return b*d/c+a},sineInOut:function(d,a,b,c){return -b/2*(Math.cos(Math.PI*d/c)-1)+a}};script_loaded=true;script_loaded=true