
var conf_reflection_p=20;var conf_focus=2;var conf_slider_width=48;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='caption_1';var conf_scrollbar='scrollbar';var conf_slider='slider';var caption_id=0;var new_caption_id=0;var current=750;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=116;var img_anzahl=0;function setOpacity(image,value)
{if(image.filters&&image.filters[0])
{image.filters[0].opacity=value*100;}
else
{image.style.opacity=value;}}
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(x,new_caption_id)
{target=x;mem_target=x;if(timer==0)
{window.setTimeout(step,50);timer=1;}
caption_id=new_caption_id;if(dragging==false)
{new_slider_pos=(scrollbar_width*(-(x*100/((max-1)*xstep)))/100)-new_posx;}}
function moveTo(x)
{current=x;var zIndex=max;var num_img=0;for(var index=0;index<max;index++)
{var image=img_div.childNodes.item(array_images[index]);var current_image=index*-xstep;image.removeAttribute('id');if((x<-(xstep*2.5))||(x>(xstep*2.5)))
{image.style.visibility='hidden';image.style.display='none';}
else
{var z=Math.sqrt(10000+x*x)+100;var xs=x/z*size+size;image.style.display='block';var new_img_h=(image.h/image.w*image.pc)/z*size;switch(new_img_h>max_height)
{case false:var new_img_w=image.pc/z*size;break;default:new_img_h=max_height;var new_img_w=image.w*new_img_h/image.h;break;}
var new_img_top=(images_width*0.34-new_img_h)*0.5+images_top;var br=0;br=(xs-(image.pc/2)/z*size+images_left);image.style.left=(xs-(image.pc/2)/z*size+images_left)+'px';if(new_img_w&&new_img_h)
{image.style.height=(new_img_h-49)+'px';image.style.width=(new_img_w-38)+'px';image.style.top=new_img_top+'px';}
if((x<-(xstep*4.5))||(x>(xstep*4.5)))
{if(x>0)
setOpacity(image,(xstep*5.5-x)/xstep);else
setOpacity(image,(xstep*5.5+x)/xstep);}
else
{setOpacity(image,1);}
image.style.visibility='visible';num_img++;switch(x<0)
{case true:zIndex++;break;default:zIndex=zIndex-1;break;}
switch(image.i==caption_id)
{case false:break;default:zIndex=zIndex+1;image.onclick=function(){}
break;}
image.style.zIndex=zIndex;image.setAttribute('id','id_'+num_img);if(document.getElementById('id_1')){document.getElementById('id_1').style.left=((xs-(image.pc/2)/z*size+images_left)-577)+'px';document.getElementById('caption_1').style.left=((xs-(image.pc/2)/z*size+images_left)-577)+'px';document.getElementById('caption_1').style.width=document.getElementById('id_1').style.width;}
if(document.getElementById('id_2')){document.getElementById('caption_2').style.left=document.getElementById('id_2').style.left;document.getElementById('caption_2').style.width=document.getElementById('id_2').style.width;}
if(document.getElementById('id_3')){document.getElementById('id_3').style.zIndex='999';document.getElementById('caption_3').style.left=document.getElementById('id_3').style.left;document.getElementById('caption_3').style.width=document.getElementById('id_3').style.width;}
if(document.getElementById('id_4')){document.getElementById('caption_4').style.left=document.getElementById('id_4').style.left;document.getElementById('caption_4').style.width=document.getElementById('id_4').style.width;}
if(document.getElementById('id_5')){document.getElementById('id_5').style.left=((xs-(image.pc/2)/z*size+images_left)+50)+'px';document.getElementById('caption_5').style.left=((xs-(image.pc/2)/z*size+images_left)+50)+'px';document.getElementById('caption_5').style.width=document.getElementById('id_5').style.width;}}
x+=xstep;}
if(document.getElementById('id_1')&&document.getElementById('id_2')&&document.getElementById('id_3')&&document.getElementById('id_4')&&document.getElementById('id_5')){var caption_1=document.getElementById('id_1').getAttribute('alt');var caption_2=document.getElementById('id_2').getAttribute('alt');var caption_3=document.getElementById('id_3').getAttribute('alt');var caption_4=document.getElementById('id_4').getAttribute('alt');var caption_5=document.getElementById('id_5').getAttribute('alt');if(caption_1=='')caption_1='&nbsp;';if(caption_2=='')caption_2='&nbsp;';if(caption_3=='')caption_3='&nbsp;';if(caption_4=='')caption_4='&nbsp;';if(caption_5=='')caption_5='&nbsp;';document.getElementById('caption_1').innerHTML=caption_1;document.getElementById('caption_2').innerHTML=caption_2;document.getElementById('caption_3').innerHTML=caption_3;document.getElementById('caption_4').innerHTML=caption_4;document.getElementById('caption_5').innerHTML=caption_5;}}
function refresh(onload)
{imageflow_div=document.getElementById(conf_imageflow);img_div=document.getElementById(conf_images);caption_div=document.getElementById(conf_captions);images_width=img_div.offsetWidth;images_top=0;images_left=0;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';max=img_div.childNodes.length;img_anzahl=max-2;var i=0;for(var index=0;index<max;index++)
{var image=img_div.childNodes.item(index);if(image.nodeType==1)
{array_images[i]=index;image.x_pos=(-i*xstep);image.i=i;if(onload==true)
{image.w=image.getAttribute('width');image.h=image.getAttribute('height');}
switch((image.w+1)>(image.h/(conf_reflection_p+1)))
{case true:image.pc=118;break;default:image.pc=100;break;}
image.url=image.getAttribute('longdesc');image.ondblclick=function(){}
image.style.cursor=conf_images_cursor;i++;}}
max=array_images.length;moveTo(current);glideTo(current,caption_id);}
function show(id)
{var element=document.getElementById(id);element.style.visibility='visible';}
function hide(id)
{var element=document.getElementById(id);element.style.visibility='hidden';element.style.display='none';}
function init(position)
{if(document.getElementById(conf_imageflow))
{refresh(true);initMouseWheel();initMouseDrag();glideTo(-232,1);}}
window.onload=function()
{}
window.onresize=function()
{if(document.getElementById(conf_imageflow))refresh();}
window.onunload=function()
{document=null;}
function handle(delta)
{var change=false;switch(delta>0)
{case true:if(caption_id>=2)
{target=target+xstep;new_caption_id=caption_id-1;change=true;}
break;default:if(caption_id<(max-4))
{target=target-xstep;new_caption_id=caption_id+1;change=true;}
break;}
if(change==true)
{glideTo(target,new_caption_id);}}
function mousescroll(delta)
{var change=false;switch(delta>0)
{case true:if(caption_id>=2)
{target=target+xstep;new_caption_id=caption_id-1;change=true;}
break;default:if(caption_id<(max-4))
{target=target-xstep;new_caption_id=caption_id+1;change=true;}
break;}
if(change==true)
{glideTo(target,new_caption_id);}}
function wheel(event)
{var delta=0;if(!event)event=window.event;if(event.wheelDelta)
{delta=event.wheelDelta/120;}
else if(event.detail)
{delta=-event.detail/3;}
if(delta)handle(delta);if(event.preventDefault)event.preventDefault();event.returnValue=false;}
function initMouseWheel()
{if(window.addEventListener)imageflow_div.addEventListener('DOMMouseScroll',wheel,false);imageflow_div.onmousewheel=wheel;}
function dragstart(element)
{dragobject=element;dragx=posx-dragobject.offsetLeft+new_slider_pos;}
function dragstop()
{dragobject=null;dragging=false;}
function drag(e)
{posx=document.all?window.event.clientX:e.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 slider_pos=(new_posx+new_slider_pos);var step_width=slider_pos/((scrollbar_width)/(max-1));var image_number=Math.round(step_width);var new_target=(image_number)*-xstep;var new_caption_id=image_number;dragobject.style.left=new_posx+'px';glideTo(new_target,new_caption_id);}}
function initMouseDrag()
{document.onmousemove=drag;document.onmouseup=dragstop;document.onselectstart=function()
{if(dragging==true)
{return false;}
else
{return true;}}}
function getKeyCode(event)
{event=event||window.event;return event.keyCode;}
document.onkeydown=function(event)
{var charCode=getKeyCode(event);switch(charCode)
{case 39:handle(-1);break;case 37:handle(1);break;}}
