var conf_reflection_p=0.5;var conf_focus=3;var conf_slider_width=5;var conf_images_cursor="pointer";var conf_slider_cursor="default";var conf_imageflow="imageflow";var conf_loading="loading";var conf_images="images";var conf_captions="captions";var conf_scrollbar="scrollbar";var conf_slider="slider";var caption_id=0;var new_caption_id=0;var current=0;var target=0;var mem_target=0;var timer=0;var array_images=new Array();var new_slider_pos=0;var dragging=false;var dragobject=null;var dragx=0;var posx=0;var new_posx=0;var xstep=150;function step(){switch(target<current-1||target>current+1){case true:moveTo(current+(target-current)/3);window.setTimeout(step,50);timer=1;break;default:timer=0;break}}function glideTo(a,b){target=a;mem_target=a;if(timer==0){window.setTimeout(step,50);timer=1}caption_id=b;caption=img_div.childNodes.item(array_images[caption_id]).getAttribute("alt");if(caption==""){caption="&nbsp;"}caption_div.innerHTML=caption;if(dragging==false){new_slider_pos=(scrollbar_width*(-(a*100/((max-1)*xstep)))/100)-new_posx;slider_div.style.marginLeft=(new_slider_pos-conf_slider_width)+"px"}}function moveTo(h){current=h;var j=max;for(var f=0;f<max;f++){var c=img_div.childNodes.item(array_images[f]);var i=f*-xstep;if((i+max_conf_focus)<mem_target||(i-max_conf_focus)>mem_target){c.style.visibility="hidden";c.style.display="none"}else{var g=Math.sqrt(10000+h*h)+60;var b=h/g*size+size;c.style.display="block";var d=(c.h/c.w*c.pc)/g*size;switch(d>max_height){case false:var a=c.pc/g*size;break;default:d=max_height;var a=c.w*d/c.h;break}var e=(images_width*0.34-d)+images_top+((d/(conf_reflection_p+1))*conf_reflection_p);c.style.left=b-(c.pc/2)/g*size+images_left+"px";if(a&&d){c.style.height=d+"px";c.style.width=a+"px";c.style.top=e+"px"}c.style.visibility="visible";switch(h<0){case true:j++;break;default:j=j-1;break}switch(c.i==caption_id){case false:c.onclick=function(){glideTo(this.x_pos,this.i)};break;default:j=j+1;c.onclick=function(){document.location=this.url};break}c.style.zIndex=j}h+=xstep}}function refresh(d){imageflow_div=document.getElementById(conf_imageflow);img_div=document.getElementById(conf_images);scrollbar_div=document.getElementById(conf_scrollbar);slider_div=document.getElementById(conf_slider);caption_div=document.getElementById(conf_captions);images_width=img_div.offsetWidth;images_top=imageflow_div.offsetTop;images_left=imageflow_div.offsetLeft;max_conf_focus=conf_focus*xstep;size=images_width*0.5;scrollbar_width=images_width*0.685;conf_slider_width=conf_slider_width*0.5;max_height=images_width*0.51;caption_div.style.width=images_width+"px";caption_div.style.marginTop=images_width*0.06+"px";scrollbar_div.style.marginTop=images_width*0.02+"px";scrollbar_div.style.marginLeft=images_width*0.2+"px";scrollbar_div.style.marginRight=images_width*0.2+"px";scrollbar_div.style.width=(scrollbar_width+15)+"px";slider_div.onmousedown=function(){dragstart(this)};slider_div.style.cursor=conf_slider_cursor;max=img_div.childNodes.length;var b=0;for(var a=0;a<max;a++){var c=img_div.childNodes.item(a);if(c.nodeType==1){array_images[b]=a;c.onclick=function(){glideTo(this.x_pos,this.i)};c.x_pos=(-b*xstep);c.i=b;if(d==true){c.w=c.width;c.h=c.height}switch((c.w+1)>(c.h/(conf_reflection_p+1))){case true:c.pc=118;break;default:c.pc=100;break}c.url=c.getAttribute("longdesc");c.ondblclick=function(){document.location=this.url};c.style.cursor=conf_images_cursor;b++}}max=array_images.length;moveTo(current);glideTo(current,caption_id)}function show(b){var a=document.getElementById(b);a.style.visibility="visible"}function hide(b){var a=document.getElementById(b);a.style.visibility="hidden";a.style.display="none"}window.onload=function(){if(document.getElementById(conf_imageflow)){hide(conf_loading);refresh(true);show(conf_images);show(conf_scrollbar);initMouseWheel();initMouseDrag()}if(navigator.appName!="Microsoft Internet Explorer"){glideTo(-150,1)}};window.onresize=function(){if(document.getElementById(conf_imageflow)){refresh()}};window.onunload=function(){document=null};function handle(b){var a=false;switch(b>0){case true:if(caption_id>=1){target=target+xstep;new_caption_id=caption_id-1;a=true}break;default:if(caption_id<(max-1)){target=target-xstep;new_caption_id=caption_id+1;a=true}break}if(a==true){glideTo(target,new_caption_id)}}function wheel(a){var b=0;if(!a){a=window.event}if(a.wheelDelta){b=a.wheelDelta/120}else{if(a.detail){b=-a.detail/3}}if(b){handle(b)}if(a.preventDefault){a.preventDefault()}a.returnValue=false}function initMouseWheel(){if(window.addEventListener){imageflow_div.addEventListener("DOMMouseScroll",wheel,false)}imageflow_div.onmousewheel=wheel}function dragstart(a){dragobject=a;dragx=posx-dragobject.offsetLeft+new_slider_pos}function dragstop(){dragobject=null;dragging=false}function drag(g){posx=document.all?window.event.clientX:g.pageX;if(dragobject!=null){dragging=true;new_posx=(posx-dragx)+conf_slider_width;if(new_posx<(-new_slider_pos)){new_posx=-new_slider_pos}if(new_posx>(scrollbar_width-new_slider_pos)){new_posx=scrollbar_width-new_slider_pos}var c=(new_posx+new_slider_pos);var b=c/((scrollbar_width)/(max-1));var f=Math.round(b);var a=(f)*-xstep;var d=f;dragobject.style.left=new_posx+"px";glideTo(a,d)}}function initMouseDrag(){document.onmousemove=drag;document.onmouseup=dragstop;document.onselectstart=function(){if(dragging==true){return false}else{return true}}}function getKeyCode(a){a=a||window.event;return a.keyCode}document.onkeydown=function(b){var a=getKeyCode(b);switch(a){case 39:handle(-1);break;case 37:handle(1);break}};