var imf={conf_reflection_p:0.5,conf_focus:4,conf_slider_width:66,conf_images_cursor:"pointer",conf_slider_cursor:"e-resize",hide_slider:false,hide_caption:false,conf_imageflow:"imageflow",conf_loading:"imageflow_loading",conf_images:"imageflow_images",conf_captions:"imageflow_captions",conf_scrollbar:"imageflow_scrollbar",conf_slider:"imageflow_slider",caption_id:0,new_caption_id:0,current:0,target:0,mem_target:0,imf_timer:0,array_images:[],new_slider_pos:0,dragging:false,dragobject:null,dragx:0,posx:0,new_posx:0,xstep:150,img_div:null,imageflow_div:null,scrollbar_div:null,slider_div:null,caption_div:null,images_width:0,images_top:0,images_left:0,max_conf_focus:0,size:0,scrollbar_width:0,max_height:0,max:0,step:function(){if(imf.target<imf.current-1||imf.target>imf.current+1){imf.moveTo(imf.current+(imf.target-imf.current)/3);window.setTimeout(imf.step,50);imf.imf_timer=1}else{imf.imf_timer=0}},glideTo:function(A,C){imf.target=A;imf.mem_target=A;if(imf.imf_timer==0){window.setTimeout(imf.step,50);imf.imf_timer=1}imf.caption_id=C;var D=imf.img_div.childNodes.item(imf.array_images[imf.caption_id]);D=imf.getImage(D);var B;if(imf.hide_caption){B=""}else{B=D.getAttribute("alt")}if(B==""){B="&nbsp;"}imf.caption_div.innerHTML=B;if(imf.dragging==false){imf.new_slider_pos=(imf.scrollbar_width*(-(A*100/((imf.max-1)*imf.xstep)))/100)-imf.new_posx;imf.slider_div.style.marginLeft=(imf.new_slider_pos-imf.conf_slider_width)+"px"}},moveTo:function(J){imf.current=J;var H=imf.max;for(var E=0;E<imf.max;E++){var B=imf.img_div.childNodes.item(imf.array_images[E]);B=imf.getImage(B);var I=E*-imf.xstep;if((I+imf.max_conf_focus)<imf.mem_target||(I-imf.max_conf_focus)>imf.mem_target){B.style.visibility="hidden";B.style.display="none"}else{var G=Math.sqrt(10000+J*J)+100;var A=J/G*(imf.images_width/2)+(imf.images_width/2);B.style.display="block";var C=(B.h/B.w*B.pc)/G*imf.size;var F=0;if(C>imf.max_height){C=imf.max_height;F=B.w*(C/B.h)}else{F=B.pc/G*imf.size}var D=(imf.images_width*0.35-C)+imf.images_top+((C/(imf.conf_reflection_p+1))*imf.conf_reflection_p);B.style.left=A-(B.pc/2)/G*imf.size+imf.images_left+"px";if(F&&C){B.style.height=C+"px";B.style.width=F+"px";B.style.top=D+"px"}B.style.visibility="visible";if(J<0){H++}else{H--}if(B.i==imf.caption_id){H++;if(B.url!==null&&B.url!==""){B.onclick=function(){document.location=this.url}}}else{B.onclick=function(){imf.glideTo(this.x_pos,this.i)}}B.style.zIndex=H}J+=imf.xstep}},getImage:function(B){if(B.nodeName=="IMG"||B.childNodes.length==0){return B}for(var A=0;A<B.childNodes.length;A++){if(B.childNodes[A].nodeName=="IMG"){return B.childNodes[A]}}return B},refresh:function(D){imf.imageflow_div=document.getElementById(imf.conf_imageflow);imf.img_div=document.getElementById(imf.conf_images);imf.scrollbar_div=document.getElementById(imf.conf_scrollbar);imf.slider_div=document.getElementById(imf.conf_slider);imf.caption_div=document.getElementById(imf.conf_captions);imf.images_width=imf.img_div.offsetWidth;imf.images_top=imf.imageflow_div.offsetTop;imf.images_left=imf.imageflow_div.offsetLeft;imf.max_conf_focus=imf.conf_focus*imf.xstep;imf.size=imf.images_width*0.67;imf.scrollbar_width=imf.images_width*0.6;imf.conf_slider_width=imf.conf_slider_width*0.5;imf.max_height=imf.images_width*0.51;imf.imageflow_div.style.height=imf.max_height+"px";imf.img_div.style.height=imf.images_width*0.338+"px";imf.caption_div.style.width=imf.images_width+"px";imf.caption_div.style.marginTop=imf.images_width*0.03+"px";imf.scrollbar_div.style.marginTop=imf.images_width*0.02+"px";imf.scrollbar_div.style.marginLeft=imf.images_width*0.2+"px";imf.scrollbar_div.style.width=imf.scrollbar_width+"px";imf.slider_div.onmousedown=function(){imf.dragstart(this)};imf.slider_div.style.cursor=imf.conf_slider_cursor;imf.max=imf.img_div.childNodes.length;var B=0;for(var A=0;A<imf.max;A++){var C=imf.img_div.childNodes.item(A);if(C.nodeType==1){imf.array_images[B]=A;C=imf.getImage(C);C.x_pos=(-B*imf.xstep);C.i=B;if(D==true){C.w=C.width;C.h=C.height}if((C.w+1)>(C.h/(imf.conf_reflection_p+1))){C.pc=130}else{C.pc=100}C.url=C.getAttribute("link");if(C.url!==null&&C.url!==""){C.ondblclick=function(){document.location=this.url}}C.style.cursor=imf.conf_images_cursor;B++}}imf.max=imf.array_images.length;imf.moveTo(imf.current);imf.glideTo(imf.current,imf.caption_id)},show:function(B){var A=document.getElementById(B);A.style.visibility="visible"},hide:function(B){var A=document.getElementById(B);A.style.visibility="hidden";A.style.display="none"},initOnLoad:function(){if(document.getElementById(imf.conf_imageflow)){imf.hide(imf.conf_loading);imf.refresh(true);imf.show(imf.conf_images);if(imf.hide_slider===false){imf.show(imf.conf_scrollbar)}imf.initMouseWheel();imf.initMouseDrag();imf.moveTo(5000)}},resize:function(){if(document.getElementById(imf.conf_imageflow)){imf.refresh()}},unload:function(){if(navigator.userAgent.search(/msie/i)!=-1){}else{document=null}},handle:function(B){var A=false;if(B>0){if(imf.caption_id>=1){imf.target=imf.target+imf.xstep;imf.new_caption_id=imf.caption_id-1;A=true}}else{if(imf.caption_id<(imf.max-1)){imf.target=imf.target-imf.xstep;imf.new_caption_id=imf.caption_id+1;A=true}}if(A==true){imf.glideTo(imf.target,imf.new_caption_id)}},wheel:function(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){imf.handle(B)}if(A.preventDefault){A.preventDefault()}A.returnValue=false},addEventListener:function(A,C,B){try{A.addEventListener(C,B,false)}catch(D){try{A.detachEvent("on"+C,B);A.attachEvent("on"+C,B)}catch(D){A["on"+C]=B}}},initMouseWheel:function(){if(window.addEventListener){imf.imageflow_div.addEventListener("DOMMouseScroll",imf.wheel,false)}imf.imageflow_div.onmousewheel=imf.wheel},dragstart:function(A){imf.dragobject=A;imf.dragx=imf.posx-imf.dragobject.offsetLeft+imf.new_slider_pos},dragstop:function(){imf.dragobject=null;imf.dragging=false},drag:function(F){imf.posx=document.all?window.event.clientX:F.pageX;if(imf.dragobject!=null){imf.dragging=true;imf.new_posx=(imf.posx-imf.dragx)+imf.conf_slider_width;if(imf.new_posx<(-imf.new_slider_pos)){imf.new_posx=-imf.new_slider_pos}if(imf.new_posx>(imf.scrollbar_width-imf.new_slider_pos)){imf.new_posx=imf.scrollbar_width-imf.new_slider_pos}var B=(imf.new_posx+imf.new_slider_pos);var E=B/((imf.scrollbar_width)/(imf.max-1));var D=Math.round(E);var A=(D)*-imf.xstep;var C=D;imf.dragobject.style.left=imf.new_posx+"px";imf.glideTo(A,C)}},initMouseDrag:function(){document.onmousemove=imf.drag;document.onmouseup=imf.dragstop;document.onselectstart=function(){if(imf.dragging==true){return false}else{return true}}},getKeyCode:function(A){A=A||window.event;return A.keyCode},keyHandler:function(B){var A=imf.getKeyCode(B);switch(A){case 39:imf.handle(-1);break;case 37:imf.handle(1);break}}};imf.addEventListener(document,"keydown",imf.keyHandler);imf.addEventListener(window,"load",imf.initOnLoad);imf.addEventListener(window,"unload",imf.unload);imf.addEventListener(window,"resize",imf.resize);