var HighlightFlow_speed=7;var HighlightFlow_windowWidth=300;function HighlightFlow_SmoothMovement(a,c,b){a=Math.round(a);c=Math.round(c);b=(b?Math.round(b):0);this.updatePosition=function(){if(((b<0)&&(a-b>c))||((b>0)&&(a-b<c))){a=c}else{a-=b}return a};this.changeTarget=function(d){c=Math.round(d)};this.getPosition=function(){return a};this.getVelocity=function(){return b};this.hasStopped=function(){return(a==c&&b==0)}}var g_bInMove=false;function HighlightFlow_MoveCollectionLeft(d){if(g_bInMove){return}g_bInMove=true;var e=document.getElementById(d);if(e){var c=0;if(e.style.marginLeft!=null&&e.style.marginLeft!=""){c=parseInt(e.style.marginLeft)}e.style.marginLeft=c+"px";if(c<0){var b=c+HighlightFlow_windowWidth;var a=new HighlightFlow_SmoothMovement(c,b,-HighlightFlow_speed);window.setTimeout(function(){HighlightFlow_UpdateCollectionSlide(e,a,b)},20)}else{g_bInMove=false}}}function HighlightFlow_MoveCollectionRight(e){if(g_bInMove){return}g_bInMove=true;var f=document.getElementById(e);if(f){var d=0;var c=0;c=parseInt(f.style.width);if(f.style.marginLeft!=null&&f.style.marginLeft!=""){d=parseInt(f.style.marginLeft)}f.style.marginLeft=d+"px";var b=d-HighlightFlow_windowWidth;if(Math.abs(b)<c){var a=new HighlightFlow_SmoothMovement(d,b,HighlightFlow_speed);window.setTimeout(function(){HighlightFlow_UpdateCollectionSlide(f,a,b)},20)}else{g_bInMove=false}}}function HighlightFlow_UpdateCollectionSlide(f,b,e){var c=b.updatePosition();f.style.marginLeft=c+"px";if(c!=e){window.setTimeout(function(){HighlightFlow_UpdateCollectionSlide(f,b,e)},20)}else{g_bInMove=false;var d=document.getElementById("collectionpreviousbtn");if(e>=0){d.src="/images/previousphoto_disabled.gif"}else{d.src="/images/previousphoto.gif"}var a=document.getElementById("collectionnextbtn");if(Math.abs(e-HighlightFlow_windowWidth)>=parseInt(f.style.width)){a.src="/images/nextphoto_disabled.gif"}else{a.src="/images/nextphoto.gif"}}};