var animObjects=[];var featuredHols=[];var featureShown=0;var featureTimer;function init(){for(i=0;i<document.getElementById("featured-body").childNodes.length;i++){if(document.getElementById("featured-body").childNodes[i].className=="featured-holiday"){featuredHols.push(document.getElementById("featured-body").childNodes[i]);}}if(featuredHols.length>0){featuredHols[0].style.left="0px";var a=[];a.push("<ul>");for(i=0;i<featuredHols.length;i++){a.push("<li>");a.push("<a id='featured-hol-");a.push(i);a.push("' href='Javascript:rollAround(");a.push(i);a.push(")'>");a.push((i+1)+"");a.push("</a>");a.push("</li>");}a.push("</ul>");document.getElementById("featured-foot").innerHTML=a.join("");var b=document.getElementById("featured-hol-"+featureShown);b.style.backgroundColor="#FF7D00";b.style.color="white";if(featuredHols.length>1){featureTimer=setTimeout("rollAround(1)",10000);}}}function rollAround(b){if(b!=featureShown){clearTimeout(featureTimer);if(b>=featuredHols.length){b=0;}animate2(featuredHols[featureShown],"left",0,-150,1000,20,"easeOutBack");animate2(featuredHols[b],"left",150,0,1000,20,"easeOutBack");var a=document.getElementById("featured-hol-"+b);a.style.backgroundColor="#FF7D00";a.style.color="white";var a=document.getElementById("featured-hol-"+featureShown);a.style.backgroundColor="white";a.style.color="#FF7D00";featureShown=b;featureTimer=setTimeout("rollAround(featureShown+1)",10000);}}function animObject(b,a){this.obj=b;this.end=a;}function addAnimObject(b,a){if(!animatingThisWay(b,a)){animObjects.push(new animObject(b,a));}}Array.prototype.remove=function(a,b){this.splice(a,!b||1+b-a+(!(b<0^a>=0)&&(b<0||-1)*this.length));return this.length;};function animate2(obj,elm,begin,end,animationDuration,fps,easing){var abort=false;if(!animationDuration){animationDuration=1000;}if(!fps){fps=20;}begin=parseFloat(begin);end=parseFloat(end);animationDuration=parseFloat(animationDuration);fps=parseFloat(fps);var change=end-begin;var interval=Math.ceil(1000/fps);var totalframes=Math.ceil(animationDuration/interval);var step=change/totalframes;for(var i=1;i<=totalframes;i++){(function(){var frame=i;function innerChangeWidth(){var s=eval(easing);var increase=s(frame,begin,change,totalframes);var slope=increase-begin;unit=(elm=="opacity")?"":"px";if(!animatingOtherWay(obj,end)){obj.style[elm]=increase+unit;}if(increase==end){endAnimation(obj,end);}else{i=totalframes+1;}}timer=setTimeout(innerChangeWidth,interval*frame);})();}}function removeAnimObject(c,a){for(var b=0;b<animObjects.length;b++){if(c==animObjects[b].obj&&a!=animObjects[b].end){animObjects.remove(b);return;}}return;}function animatingObject(b){for(var a=0;a<animObjects.length;a++){if(b==animObjects[a].obj){return true;}}return false;}function animatingOtherWay(c,a){for(var b=0;b<animObjects.length;b++){if(c==animObjects[b].obj&&a!=animObjects[b].end){return true;}}return false;}function animatingThisWay(c,a){for(var b=0;b<animObjects.length;b++){if(c==animObjects[b].obj&&a==animObjects[b].end){return true;}}return false;}easeOutBounce=function(a,e,f,g){if((a/=g)<(1/2.75)){return f*(7.5625*a*a)+e;}else{if(a<(2/2.75)){return f*(7.5625*(a-=(1.5/2.75))*a+0.75)+e;}else{if(a<(2.5/2.75)){return f*(7.5625*(a-=(2.25/2.75))*a+0.9375)+e;}else{return f*(7.5625*(a-=(2.625/2.75))*a+0.984375)+e;}}}};easeInOutBack=function(e,f,g,h,a){if(a==undefined){a=1.70158;}if((e/=h/2)<1){return g/2*(e*e*(((a*=(1.525))+1)*e-a))+f;}return g/2*((e-=2)*e*(((a*=(1.525))+1)*e+a)+2)+f;};easeOutBack=function(e,f,g,h,a){if(a==undefined){a=1.70158;}return g*((e=e/h-1)*e*((a+1)*e+a)+1)+f;};function Motion(b,c,d,f,a){startAnimation();var e=35;animate2(b,"left",c,d,a,e,f);}function startAnimation(){animating=true;document.getElementById("calendar-left").style.display="none";document.getElementById("calendar-right").style.display="none";}function endAnimation(c,a){animating=false;for(var b=0;b<animObjects.length;b++){if(c==animObjects[b].obj&&a==animObjects[b].end){animObjects.remove(b);break;}}if(document.getElementById("calendar-left")){if(currentSlot>0){document.getElementById("calendar-left").style.display="block";}if(currentSlot<calendarSlots.length-1&&calendarSlots[currentSlot+1].type!="U"){document.getElementById("calendar-right").style.display="block";}}}function WaitWhileAnimating(){if(animating){setTimeout(WaitWhileAnimating,10);}}