var conf_reflection_p=0.3;var conf_focus=4;var conf_slider_width=14;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=140;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(j){current=j;var h=max;for(var e=0;e<max;e++){var b=img_div.childNodes.item(array_images[e]);var i=e*-xstep;if((i+max_conf_focus)<mem_target||(i-max_conf_focus)>mem_target){b.style.visibility="hidden";b.style.display="none"}else{var g=Math.sqrt(10000+j*j)+100;var a=j/g*size+size;b.style.display="block";var c=(b.h/b.w*b.pc)/g*size;switch(c>max_height){case false:var f=b.pc/g*size;break;default:c=max_height;var f=b.w*c/b.h;break}var d=(images_width*0.24-c)+images_top+((c/(conf_reflection_p+1))*conf_reflection_p);b.style.left=a-(b.pc/1.3)/g*size+images_left+"px";if(f&&c){b.style.height=c+75+"px";b.style.width=f+100+"px";b.style.top=d+"px"}b.style.visibility="visible";switch(j<0){case true:h++;break;default:h=h-1;break}switch(b.i==caption_id){case false:b.onclick=function(){glideTo(this.x_pos,this.i)};break;default:h=h+1;b.onclick=function(){window.open(this.url,"Defaut","toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=no, scrollbars=no, width=800, height=600")};break}b.style.zIndex=h}j+=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.6;conf_slider_width=conf_slider_width*0.5;max_height=images_width*0.51;imageflow_div.style.height=max_height+"px";img_div.style.height=images_width*0.338+"px";caption_div.style.width=images_width+"px";caption_div.style.marginTop=images_width*0.03+"px";scrollbar_div.style.marginTop=images_width*0.02+"px";scrollbar_div.style.marginLeft=images_width*0.2+"px";scrollbar_div.style.width=scrollbar_width+"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(){window.open(this.url,"Defaut","toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=no, scrollbars=no, width=800, height=600")};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()}};window.onresize=function(){if(document.getElementById(conf_imageflow)){refresh()}};window.onunload=function(){document.close()};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 b=(new_posx+new_slider_pos);var f=b/((scrollbar_width)/(max-1));var d=Math.round(f);var a=(d)*-xstep;var c=d;dragobject.style.left=new_posx+"px";glideTo(a,c)}}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}};
