function ImageFlow(){
this.defaults={ImageFlowID:"imageflow",preloadImages:true,reflections:true,reflectionP:0.5,reflectionPNG:false,reflectionGET:"",imageFocusMax:4,imageFocusM:1,imageCursor:"default",startID:1,startAnimation:false,slider:true,sliderCursor:"e-resize",sliderWidth:14,xStep:150,heightDec:5,isWidthDec:true,stepByStep:false,captions:true,opacity:false,opacityArray:[10,8,6,4,2],onClick:function(){
document.location=this.url;
}};
var _1=this;
this.init=function(_2){
var _3=new Array("ImageFlowID","preloadImages","reflections","reflectionP","reflectionPNG","reflectionGET","imageFocusMax","imageFocusM","imageCursor","startID","startAnimation","slider","sliderCursor","sliderWidth","xStep","heightDec","isWidthDec","stepByStep","captions","opacity","opacityArray","onClick");
var _4=_3.length;
for(var i=0;i<_4;i++){
var _6=_3[i];
this[_6]=(_2!==undefined&&_2[_6]!==undefined)?_2[_6]:_1.defaults[_6];
}
var _7=document.getElementById(_1.ImageFlowID);
if(_7){
_7.style.visibility="visible";
this.ImageFlowDiv=_7;
if(this.createStructure()){
this.imagesDiv=document.getElementById(_1.ImageFlowID+"_images");
this.captionDiv=document.getElementById(_1.ImageFlowID+"_caption");
this.scrollbarDiv=document.getElementById(_1.ImageFlowID+"_scrollbar");
this.sliderDiv=document.getElementById(_1.ImageFlowID+"_slider");
this.indexArray=[];
this.current=0;
this.imageID=0;
this.target=0;
this.memTarget=0;
this.firstRefresh=true;
this.firstCheck=true;
this.busy=false;
this.bpMainHeight=document.getElementById(_1.ImageFlowID+"_size").offsetHeight;
if(this.slider===false){
this.scrollbarDiv.style.display="none";
}
var _8=this.ImageFlowDiv.offsetWidth;
var _9=Math.round(_8*0.5085);
document.getElementById(_1.ImageFlowID+"_loading_txt").style.paddingTop=((_9*0.5)-22)+"px";
_7.style.height=_9+"px";
document.getElementById(_1.ImageFlowID+"_loading_txt").style.display="none";
document.getElementById(_1.ImageFlowID+"_loading").style.display="none";
this.loadingProgress();
}
}
};
this.createStructure=function(){
var _a=document.createElement("div");
_a.setAttribute("id",_1.ImageFlowID+"_images");
_a.setAttribute("class","images");
_a.setAttribute("className","images");
var _b=null;
var _c=this.ImageFlowDiv.childNodes.length;
for(var _d=0;_d<_c;_d++){
_b=this.ImageFlowDiv.childNodes[_d];
if(_b&&_b.nodeType==1&&_b.nodeName=="IMG"){
if(_1.reflections===true){
var _e="2";
if(_1.reflectionPNG===true){
_e="3";
}
var _f=_b.getAttribute("src",2);
_f="reflect"+_e+".php?img="+_f+_1.reflectionGET;
_b.setAttribute("src",_f);
}
var _10=_b.cloneNode(true);
_a.appendChild(_10);
}
}
var _11=document.createElement("p");
var _12=document.createTextNode(" ");
_11.setAttribute("id",_1.ImageFlowID+"_loading_txt");
_11.appendChild(_12);
var _13=document.createElement("div");
_13.setAttribute("id",_1.ImageFlowID+"_loading");
_13.setAttribute("class","loading");
_13.setAttribute("className","loading");
var _14=document.createElement("div");
_14.setAttribute("id",_1.ImageFlowID+"_loading_bar");
_14.setAttribute("class","loading_bar");
_14.setAttribute("className","loading_bar");
_13.appendChild(_14);
var _15=document.createElement("div");
_15.setAttribute("id",_1.ImageFlowID+"_caption");
_15.setAttribute("class","caption");
_15.setAttribute("className","caption");
if(!_1.captions){
_15.style.display="none";
}
var _16=document.createElement("div");
_16.setAttribute("id",_1.ImageFlowID+"_scrollbar");
_16.setAttribute("class","scrollbar");
_16.setAttribute("className","scrollbar");
var _17=document.createElement("div");
_17.setAttribute("id",_1.ImageFlowID+"_slider");
_17.setAttribute("class","slider");
_17.setAttribute("className","slider");
_16.appendChild(_17);
var _18=false;
if(_1.ImageFlowDiv.appendChild(_a)&&_1.ImageFlowDiv.appendChild(_11)&&_1.ImageFlowDiv.appendChild(_13)&&_1.ImageFlowDiv.appendChild(_15)&&_1.ImageFlowDiv.appendChild(_16)){
for(_d=0;_d<_c;_d++){
_b=this.ImageFlowDiv.childNodes[_d];
if(_b&&_b.nodeType==1&&_b.nodeName=="IMG"){
this.ImageFlowDiv.removeChild(_b);
}
}
_18=true;
}
return _18;
};
this.loadingProgress=function(){
var p=_1.loadingStatus();
if(p<100||_1.firstCheck===true&&_1.preloadImages===true){
if(_1.firstCheck===true&&p==100){
_1.firstCheck=false;
window.setTimeout(_1.loadingProgress,100);
}else{
window.setTimeout(_1.loadingProgress,40);
}
}else{
document.getElementById(_1.ImageFlowID+"_loading_txt").style.display="none";
document.getElementById(_1.ImageFlowID+"_loading").style.display="none";
window.setTimeout(_1.addResizeEvent,1000);
window.onunload=function(){
document=null;
};
_1.initMouseWheel();
_1.MouseDrag.init();
_1.Key.init();
_1.refresh(true);
document.getElementById(_1.ImageFlowID+"_scrollbar").style.visibility="visible";
var _1a=_1.startID-1;
if(_1a<0){
_1a=0;
}
if(_1a>_1.max){
_1a=_1.max-1;
}
_1.glideTo(_1a);
if(_1.startAnimation===true){
_1.moveTo(5000);
}
}
};
this.loadingStatus=function(){
var max=_1.imagesDiv.childNodes.length;
var i=0,_1d=0;
var _1e=null;
for(var _1f=0;_1f<max;_1f++){
_1e=_1.imagesDiv.childNodes[_1f];
if(_1e&&_1e.nodeType==1&&_1e.nodeName=="IMG"){
if(_1e.complete===true){
_1d++;
}
i++;
}
}
var _20=Math.round((_1d/i)*100);
var _21=document.getElementById(_1.ImageFlowID+"_loading_bar");
_21.style.width=_20+"%";
var _22=document.getElementById(_1.ImageFlowID+"_loading_txt");
var _23=document.createTextNode("loading images "+_1d+"/"+i);
_22.replaceChild(_23,_22.firstChild);
return _20;
};
this.refresh=function(){
this.iWidth=_1.imagesDiv.offsetWidth;
this.maxHeight=Math.round(_1.iWidth*0.51);
this.maxFocus=_1.imageFocusMax*_1.xStep;
this.size=_1.iWidth*0.5;
this.scrollbarWidth=Math.round(_1.iWidth*0.6);
this.sliderWidth=_1.sliderWidth*0.5;
_1.ImageFlowDiv.style.height=_1.bpMainHeight;
_1.imagesDiv.style.height=_1.bpMainHeight;
_1.captionDiv.style.width=_1.iWidth+"px";
_1.captionDiv.style.marginTop=Math.round(_1.iWidth*0.03)+"px";
_1.scrollbarDiv.style.width=_1.scrollbarWidth+"px";
_1.scrollbarDiv.style.marginTop=Math.round(_1.iWidth*0.02)+"px";
_1.scrollbarDiv.style.marginLeft=Math.round(_1.iWidth*0.2)+"px";
_1.sliderDiv.style.cursor=_1.sliderCursor;
_1.sliderDiv.onmousedown=function(){
_1.MouseDrag.start(this);
return false;
};
var _24=(_1.reflections===true)?_1.reflectionP+1:1;
var max=_1.imagesDiv.childNodes.length;
var i=0;
var _27=null;
for(var _28=0;_28<max;_28++){
_27=_1.imagesDiv.childNodes[_28];
if(_27!==null&&_27.nodeType==1&&_27.nodeName=="IMG"){
this.indexArray[i]=_28;
_27.url=_27.getAttribute("longdesc");
_27.xPosition=(-i*_1.xStep);
_27.i=i;
if(_1.firstRefresh){
if(_27.getAttribute("width")!==null&&_27.getAttribute("height")!==null){
_27.w=_27.getAttribute("width");
_27.h=_27.getAttribute("height")*_24;
}else{
_27.w=_27.width;
_27.h=_27.height;
}
}
if((_27.w)>(_27.h/(_1.reflectionP+1))){
_27.pc=118;
_27.pcMem=118;
}else{
_27.pc=100;
_27.pcMem=100;
}
_27.style.cursor=_1.imageCursor;
i++;
}
}
this.max=_1.indexArray.length;
if(_1.firstRefresh){
_1.firstRefresh=false;
}
_1.moveTo(_1.current);
_1.glideTo(_1.imageID);
};
this.moveTo=function(x){
this.current=x;
this.zIndex=_1.max;
for(var _2a=0;_2a<_1.max;_2a++){
var _2b=_1.imagesDiv.childNodes[_1.indexArray[_2a]];
var _2c=_2a*-_1.xStep;
if((_2c+_1.maxFocus)<_1.memTarget||(_2c-_1.maxFocus)>_1.memTarget){
_2b.style.visibility="hidden";
_2b.style.display="none";
}else{
var z=Math.sqrt(100000+x*x);
var xs=x/z*_1.size+_1.size;
_2b.style.display="block";
var _2f=_2b.h-(Math.abs(x)/_1.xStep)*_1.heightDec;
var _30=_2b.w/_2b.h*_2f;
var _31=(_1.imagesDiv.offsetHeight-_2f)+((_2f/(_1.reflectionP+1))*_1.reflectionP);
_2b.style.left=xs-(_2b.pc/2)/z*_1.size+"px";
if(!_1.isWidthDec){
_2b.style.left=x+_1.size;
}
if(_30&&_2f){
_2b.style.height=_2f+"px";
_2b.style.width=_30+"px";
_2b.style.top=_31+"px";
}
_2b.style.visibility="visible";
switch(x<0){
case true:
this.zIndex++;
break;
default:
this.zIndex=_1.zIndex-1;
break;
}
switch(_2b.i==_1.imageID){
case false:
_2b.onclick=function(){
_1.glideTo(this.i);
};
break;
default:
this.zIndex=_1.zIndex+1;
if(_2b.url!==""){
_2b.onclick=_1.onClick;
}
break;
}
_2b.style.zIndex=_1.zIndex;
}
x+=(_1.stepByStep&&_30!=undefined?_30+4:_1.xStep);
}
};
this.glideTo=function(_32){
var x=-_32*_1.xStep;
this.target=x;
this.memTarget=x;
this.imageID=_32;
var _34=_1.imagesDiv.childNodes[_32].getAttribute("alt");
if(_34===""||_1.captions===false){
_34="&nbsp;";
}
_1.captionDiv.innerHTML=_34;
if(_1.MouseDrag.busy===false){
this.newSliderX=(_32*_1.scrollbarWidth)/(_1.max-1)-_1.MouseDrag.newX;
_1.sliderDiv.style.marginLeft=(_1.newSliderX-_1.sliderWidth)+"px";
}
if(_1.opacity===true||_1.imageFocusM!==_1.defaults.imageFocusM){
_1.setOpacity(_1.imagesDiv.childNodes[_32],_1.opacityArray[0]);
_1.imagesDiv.childNodes[_32].pc=_1.imagesDiv.childNodes[_32].pc*_1.imageFocusM;
var _35=0;
var _36=0;
var _37=0;
var _38=_1.opacityArray.length;
for(var i=1;i<(_1.imageFocusMax+1);i++){
if((i+1)>_38){
_35=_1.opacityArray[_38-1];
}else{
_35=_1.opacityArray[i];
}
_36=_32+i;
_37=_32-i;
if(_36<_1.max){
_1.setOpacity(_1.imagesDiv.childNodes[_36],_35);
_1.imagesDiv.childNodes[_36].pc=_1.imagesDiv.childNodes[_36].pcMem;
}
if(_37>=0){
_1.setOpacity(_1.imagesDiv.childNodes[_37],_35);
_1.imagesDiv.childNodes[_37].pc=_1.imagesDiv.childNodes[_37].pcMem;
}
}
}
if(_1.busy===false){
window.setTimeout(_1.animate,50);
_1.busy=true;
}
};
this.animate=function(){
switch(_1.target<_1.current-1||_1.target>_1.current+1){
case true:
_1.moveTo(_1.current+(_1.target-_1.current)/3);
window.setTimeout(_1.animate,50);
_1.busy=true;
break;
default:
_1.busy=false;
break;
}
};
this.setOpacity=function(_3a,_3b){
if(_1.opacity===true){
_3a.style.opacity=_3b/10;
_3a.style.filter="alpha(opacity="+_3b*10+")";
}
};
this.initMouseWheel=function(){
if(window.addEventListener){
_1.ImageFlowDiv.addEventListener("DOMMouseScroll",_1.eventMouseWheel,false);
}
_1.ImageFlowDiv.onmousewheel=_1.eventMouseWheel;
};
this.eventMouseWheel=function(_3c){
var _3d=0;
if(!_3c){
_3c=window.event;
}
if(_3c.wheelDelta){
_3d=_3c.wheelDelta/120;
}else{
if(_3c.detail){
_3d=-_3c.detail/3;
}
}
if(_3d){
_1.handleMouseWheel(_3d);
}
if(_3c.preventDefault){
_3c.preventDefault();
}
_3c.returnValue=false;
};
this.handleMouseWheel=function(_3e){
var _3f=false;
var _40=0;
if(_3e>0){
if(_1.imageID>=1){
_40=_1.imageID-1;
_3f=true;
}
}else{
if(_1.imageID<(_1.max-1)){
_40=_1.imageID+1;
_3f=true;
}
}
if(_3f===true){
_1.glideTo(_40);
}
};
this.MouseDrag={object:null,objectX:0,mouseX:0,newX:0,busy:false,init:function(){
_1.addEvent(_1.ImageFlowDiv,"mousemove",_1.MouseDrag.drag);
_1.addEvent(_1.ImageFlowDiv,"mouseup",_1.MouseDrag.stop);
_1.addEvent(document,"mouseup",_1.MouseDrag.stop);
_1.ImageFlowDiv.onselectstart=function(){
var _41=true;
if(_1.MouseDrag.busy===true){
_41=false;
}
return _41;
};
},start:function(o){
_1.MouseDrag.object=o;
_1.MouseDrag.objectX=_1.MouseDrag.mouseX-o.offsetLeft+_1.newSliderX;
},stop:function(){
_1.MouseDrag.object=null;
_1.MouseDrag.busy=false;
},drag:function(e){
var _44=0;
if(!e){
e=window.event;
}
if(e.pageX){
_44=e.pageX;
}else{
if(e.clientX){
_44=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;
}
}
_1.MouseDrag.mouseX=_44;
if(_1.MouseDrag.object!==null){
var _45=(_1.MouseDrag.mouseX-_1.MouseDrag.objectX)+_1.sliderWidth;
if(_45<(-_1.newSliderX)){
_45=-_1.newSliderX;
}
if(_45>(_1.scrollbarWidth-_1.newSliderX)){
_45=_1.scrollbarWidth-_1.newSliderX;
}
var _46=(_45+_1.newSliderX)/(_1.scrollbarWidth/(_1.max-1));
var _47=Math.round(_46);
_1.MouseDrag.newX=_45;
_1.MouseDrag.object.style.left=_45+"px";
if(_1.imageID!==_47){
_1.glideTo(_47);
}
_1.MouseDrag.busy=true;
}
}};
this.Key={init:function(){
document.onkeydown=function(_48){
_1.Key.handle(_48);
};
},handle:function(_49){
var _4a=_1.Key.get(_49);
switch(_4a){
case 39:
_1.handleMouseWheel(-1);
break;
case 37:
_1.handleMouseWheel(1);
break;
}
},get:function(_4b){
_4b=_4b||window.event;
return _4b.keyCode;
}};
this.addEvent=function(obj,_4d,fn){
if(obj.addEventListener){
obj.addEventListener(_4d,fn,false);
}else{
if(obj.attachEvent){
obj["e"+_4d+fn]=fn;
obj[_4d+fn]=function(){
obj["e"+_4d+fn](window.event);
};
obj.attachEvent("on"+_4d,obj[_4d+fn]);
}
}
};
this.addResizeEvent=function(){
var _4f=window.onresize;
if(typeof window.onresize!="function"){
window.onresize=function(){
_1.refresh();
};
}else{
window.onresize=function(){
if(_4f){
_4f();
}
_1.refresh();
};
}
};
};
var domReadyEvent={name:"domReadyEvent",events:{},domReadyID:1,bDone:false,DOMContentLoadedCustom:null,add:function(_50){
if(!_50.$$domReadyID){
_50.$$domReadyID=this.domReadyID++;
if(this.bDone){
_50();
}
this.events[_50.$$domReadyID]=_50;
}
},remove:function(_51){
if(_51.$$domReadyID){
delete this.events[_51.$$domReadyID];
}
},run:function(){
if(this.bDone){
return;
}
this.bDone=true;
for(var i in this.events){
this.events[i]();
}
},schedule:function(){
if(this.bDone){
return;
}
if(/KHTML|WebKit/i.test(navigator.userAgent)){
if(/loaded|complete/.test(document.readyState)){
this.run();
}else{
setTimeout(this.name+".schedule()",100);
}
}else{
if(document.getElementById("__ie_onload")){
return true;
}
}
if(typeof this.DOMContentLoadedCustom==="function"){
if(typeof document.getElementsByTagName!=="undefined"&&(document.getElementsByTagName("body")[0]!==null||document.body!==null)){
if(this.DOMContentLoadedCustom()){
this.run();
}else{
setTimeout(this.name+".schedule()",250);
}
}
}
return true;
},init:function(){
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",function(){
domReadyEvent.run();
},false);
}
setTimeout("domReadyEvent.schedule()",100);
function run(){
domReadyEvent.run();
};
if(typeof addEvent!=="undefined"){
addEvent(window,"load",run);
}else{
if(document.addEventListener){
document.addEventListener("load",run,false);
}else{
if(typeof window.onload==="function"){
var _53=window.onload;
window.onload=function(){
domReadyEvent.run();
_53();
};
}else{
window.onload=run;
}
}
}
}};
var domReady=function(_54){
domReadyEvent.add(_54);
};
domReadyEvent.init();

