var DOMEffects=function(){var constVisibility='visibility:',constOpacity='opacity',constFunc='getOpacityRule';return{getOpacityRule:function(value){this[constFunc]=window.ActiveXObject?function(value){return constOpacity+':'+value+';'+'filter:progid:DXImageTransform.Microsoft.Alpha('+constOpacity+'='+(value*100)+');';}:function(value){return(value!==0?constVisibility+'visible;':constVisibility+'hidden;')+constOpacity+':'+value+';';};return this[constFunc](value);}};}();DOMAssistant.attach(function(){var constQueue='q',constFrom='f',constTimer='t',constDuration='duration',constStart='s',constAttr='a',constEasing='easing',constCallback='c',constValue='value',constUnit='unit',constColor='color',constSetTimeout=setTimeout,constFalse=false;function easeLinear(timediff,base,change,duration){return change*timediff/duration+base;}function getTime(){return new Date().getTime();}function parseColor(value){var regexpColor=/#([a-f0-9]{1,2})([a-f0-9]{1,2})([a-f0-9]{1,2})|rgb\((\d*)\D*(\d*)\D*(\d*)\)/i;parseColor=function(value){if(value=regexpColor.exec(value)){return{r:value[1]?parseInt(value[1]+(value[1].length===1?value[1]:''),16):parseInt(value[4],10),g:value[1]?parseInt(value[2]+(value[2].length===1?value[2]:''),16):parseInt(value[5],10),b:value[1]?parseInt(value[3]+(value[3].length===1?value[3]:''),16):parseInt(value[6],10)};}};return parseColor(value);}function init(elem,time){elem.fx[constStart]=time;elem.fx[constFrom]=[];var value,attr,obj,answer=[],isObj;for(attr in elem.fx[constQueue][0][constAttr]){value=elem.fx[constQueue][0][constAttr][attr];isObj=typeof value==='object';if(isObj&&value[constUnit]==='color'){if(typeof value[constValue]==='string'){value[constValue]=parseColor(value[constValue]);}fromValue=parseColor(elem.getStyle(attr));elem.fx[constFrom][elem.fx[constFrom].length]=fromValue?fromValue:{r:0,g:0,b:0};}else{if(!isObj){obj={};obj[constValue]=value;obj[constUnit]='px';value=obj;}else{value[constUnit]=value[constUnit]!==undefined?value[constUnit]:'px';}fromValue=parseFloat(elem.getStyle(attr));elem.fx[constFrom][elem.fx[constFrom].length]=isNaN(fromValue)?0:fromValue;}value[constAttr]=attr;answer[answer.length]=value;}elem.fx[constQueue][0][constAttr]=answer;}return{stop:function(){var elem=this;if(elem.fx&&elem.fx[constTimer]){clearTimeout(elem.fx[constTimer]);elem.fx=constFalse;}return elem;},animate:function(attributes,options){var elem=this,newRow={};options=options?options:{};newRow[constAttr]=attributes;newRow[constCallback]=options.callback;newRow[constDuration]=options[constDuration]?options[constDuration]:1000;newRow[constEasing]=options[constEasing]?options[constEasing]:easeLinear;if(elem.fx){elem.fx[constQueue].push(newRow);}else{elem.fx={};elem.fx[constQueue]=[newRow];init(elem,getTime());var step=function(){var timediff=getTime()-elem.fx[constStart],current=elem.fx[constQueue][0],duration=current[constDuration],style=';',i=0,row,value,from;if(duration<timediff){timediff=duration;}for(;i<elem.fx[constQueue][0][constAttr].length;i++){row=elem.fx[constQueue][0][constAttr][i];from=elem.fx[constFrom][i];if(row[constUnit]===constColor){style+=row[constAttr]+':rgb('+Math.floor(current[constEasing](timediff,from.r,row[constValue].r-from.r,duration))+','+Math.floor(current[constEasing](timediff,from.g,row[constValue].g-from.g,duration))+','+Math.floor(current[constEasing](timediff,from.b,row[constValue].b-from.b,duration))+')';}else{value=current[constEasing](timediff,from,row[constValue]-from,duration);style+=row[constAttr]==='opacity'?DOMEffects.getOpacityRule(value):row[constAttr]+':'+value+row[constUnit]+';';}}elem.style.cssText+=style;if(duration===timediff){if(typeof elem.fx[constQueue][0][constCallback]==='function'){elem.fx[constQueue][0][constCallback].call(elem);}elem.fx[constQueue].shift();if(elem.fx[constQueue].length===0){elem.fx=constFalse;return;}else{init(elem,elem.fx[constStart]+timediff);}}elem.fx[constTimer]=constSetTimeout(step,30);};elem.fx[constTimer]=constSetTimeout(step,30);}return elem;}};}());DOMAssistant.attach({highlight:function(options){var elem=$$(this),optionsType=typeof options,isObj=optionsType==='object',constBackgroundColor='background-color',constColor='color',attr={},value=optionsType==='string'?options:((isObj&&options[constColor])?options[constColor]:'#ff9');attr[constBackgroundColor]={value:(isObj&&options.original)?options.original:elem.getStyle(constBackgroundColor),unit:constColor};return elem.setStyle(constBackgroundColor,value).animate(attr,isObj?options:{});}});DOMAssistant.attach({show:function(options){options=options?options:{};var elem=$$(this);if(options.duration===0){elem.setStyle(DOMEffects.getOpacityRule(1));}else{var aniOptions={};aniOptions.duration=options.duration;aniOptions.easing=options.easing;aniOptions.callback=options.callback;elem.animate({opacity:{value:1,unit:''}},aniOptions);}return elem;},hide:function(options){options=options?options:{};var elem=$$(this);if(options.duration===0){elem.setStyle(DOMEffects.getOpacityRule(0));}else{var aniOptions={};aniOptions.duration=options.duration;aniOptions.easing=options.easing;aniOptions.callback=options.remove?function(){elem.remove();}:options.callback;elem.animate({opacity:{value:0,unit:''}},aniOptions);}return elem;}});