function ImageFlow (){
this.defaults =
{
ImageFlowID: 'imageflow',
preloadImages: false,
reflections: true,
reflectionP: 0.5,
reflectionPNG: false,
reflectionGET: '',
imageFocusMax: 4,
imageFocusM: 1.0,
imageCursor: 'default',
startID: 1,
startAnimation: false,
slider: true,
sliderCursor: 'e-resize',
sliderWidth: 14,
xStep: 150,
captions: true,
opacity: false,
opacityArray: [10,8,6,4,2],
onClick:function(){document.location=this.url}};
var thisObject = this;
this.init=function(options){
var a=new Array('ImageFlowID','preloadImages','reflections','reflectionP','reflectionPNG','reflectionGET','imageFocusMax','imageFocusM','imageCursor','startID','startAnimation','slider','sliderCursor','sliderWidth','xStep','captions','opacity','opacityArray','onClick');
var b=a.length;
for(var i=0;i<b;i++){
var c=a[i];
this[c]=(options!==undefined&&options[c]!==undefined)?options[c]:thisObject.defaults[c]}
var d=document.getElementById(thisObject.ImageFlowID);
if(d){
d.style.visibility='visible';
this.ImageFlowDiv=d;
if(this.createStructure()){
this.imagesDiv=document.getElementById(thisObject.ImageFlowID+'_images');
this.captionDiv=document.getElementById(thisObject.ImageFlowID+'_caption');
this.scrollbarDiv=document.getElementById(thisObject.ImageFlowID+'_scrollbar');
this.sliderDiv=document.getElementById(thisObject.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;
if(this.slider===false){
this.scrollbarDiv.style.display='none'}
var e=this.ImageFlowDiv.offsetWidth;
var f=Math.round(e*0.5085);
document.getElementById(thisObject.ImageFlowID+'_loading_txt').style.paddingTop=((f*0.5)-22)+'px';
d.style.height=f+'px';
this.loadingProgress()}}}
this.createStructure=function(){
var a=document.createElement('div');
a.setAttribute('id',thisObject.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(thisObject.reflections===true){
var e='2';
if(thisObject.reflectionPNG===true){
e='3'}
var f=b.getAttribute('src',2);
f='reflect'+e+'.php?img='+f+thisObject.reflectionGET;
b.setAttribute('src',f)}
var g=b.cloneNode(true);
a.appendChild(g)}}
var h=document.createElement('p');
var i=document.createTextNode(' ');
h.setAttribute('id',thisObject.ImageFlowID+'_loading_txt');
h.appendChild(i);
var j=document.createElement('div');
j.setAttribute('id',thisObject.ImageFlowID+'_loading');
j.setAttribute('class','loading');
j.setAttribute('className','loading');
var k=document.createElement('div');
k.setAttribute('id',thisObject.ImageFlowID+'_loading_bar');
k.setAttribute('class','loading_bar');
k.setAttribute('className','loading_bar');
j.appendChild(k);
var l=document.createElement('div');
l.setAttribute('id',thisObject.ImageFlowID+'_caption');
l.setAttribute('class','caption');
l.setAttribute('className','caption');
var m=document.createElement('div');
m.setAttribute('id',thisObject.ImageFlowID+'_scrollbar');
m.setAttribute('class','scrollbar');
m.setAttribute('className','scrollbar');
var n=document.createElement('div');
n.setAttribute('id',thisObject.ImageFlowID+'_slider');
n.setAttribute('class','slider');
n.setAttribute('className','slider');
m.appendChild(n);
var o=false;
if(thisObject.ImageFlowDiv.appendChild(a)&&
thisObject.ImageFlowDiv.appendChild(h)&&
thisObject.ImageFlowDiv.appendChild(j)&&
thisObject.ImageFlowDiv.appendChild(l)&&
thisObject.ImageFlowDiv.appendChild(m)){
for(d=0;d<c;d++){
b=this.ImageFlowDiv.childNodes[d];
if(b&&b.nodeType==1&&b.nodeName=='IMG'){
this.ImageFlowDiv.removeChild(b)}}
o=true}
return o}
this.loadingProgress=function(){
var p=thisObject.loadingStatus();
if(p<100||thisObject.firstCheck===true&&thisObject.preloadImages===true){
if(thisObject.firstCheck===true&&p==100){
thisObject.firstCheck=false;
window.setTimeout(thisObject.loadingProgress,100)}
else
{
window.setTimeout(thisObject.loadingProgress,40)}}
else
{
document.getElementById(thisObject.ImageFlowID+'_loading_txt').style.display='none';
document.getElementById(thisObject.ImageFlowID+'_loading').style.display='none';
window.setTimeout(thisObject.addResizeEvent,1000);
thisObject.initMouseWheel();
thisObject.MouseDrag.init();
thisObject.Key.init();
thisObject.refresh(true);
document.getElementById(thisObject.ImageFlowID+'_scrollbar').style.visibility='visible';
var a=thisObject.startID-1;
if(a<0){
a=0}
if(a>thisObject.max){
a=thisObject.max-1}
thisObject.glideTo(a);
if(thisObject.startAnimation===true){
thisObject.moveTo(5000)}}}
this.loadingStatus=function(){
var a=thisObject.imagesDiv.childNodes.length;
var i=0,b=0;
var c=null;
for(var d=0;d<a;d++){
c=thisObject.imagesDiv.childNodes[d];
if(c&&c.nodeType==1&&c.nodeName=='IMG'){
if(c.complete===true){
b++}
i++}}
var e=Math.round((b/i)*100);
var f=document.getElementById(thisObject.ImageFlowID+'_loading_bar');
f.style.width=e+'%';
var g=document.getElementById(thisObject.ImageFlowID+'_loading_txt');
var h=document.createTextNode('loading images '+b+'/'+i);
g.replaceChild(h,g.firstChild);
return e}
this.refresh=function(){
this.iWidth=thisObject.imagesDiv.offsetWidth;
this.maxHeight=Math.round(thisObject.iWidth*0.51);
this.maxFocus=thisObject.imageFocusMax*thisObject.xStep;
this.size=thisObject.iWidth*0.5;
this.scrollbarWidth=Math.round(thisObject.iWidth*0.6);
this.sliderWidth=thisObject.sliderWidth*0.5;
thisObject.ImageFlowDiv.style.height=thisObject.maxHeight+'px';
thisObject.imagesDiv.style.height=Math.round(thisObject.iWidth*0.338)+'px';
thisObject.captionDiv.style.width=thisObject.iWidth+'px';
thisObject.captionDiv.style.marginTop=Math.round(thisObject.iWidth*0.03)+'px';
thisObject.scrollbarDiv.style.width=thisObject.scrollbarWidth+'px';
thisObject.scrollbarDiv.style.marginTop=Math.round(thisObject.iWidth*0.02)+'px';
thisObject.scrollbarDiv.style.marginLeft=Math.round(thisObject.iWidth*0.2)+'px';
thisObject.sliderDiv.style.cursor=thisObject.sliderCursor;
thisObject.
sliderDiv.onmousedown=function(){thisObject.MouseDrag.start(this);return false};
var a=(thisObject.reflections===true)?thisObject.reflectionP+1:1;
var b=thisObject.imagesDiv.childNodes.length;
var i=0;
var c=null;
for(var d=0;d<b;d++){
c=thisObject.imagesDiv.childNodes[d];
if(c!==null&&c.nodeType==1&&c.nodeName=='IMG'){
this.indexArray[i]=d;
c.url=c.getAttribute('longdesc');
c.xPosition=(-i*thisObject.xStep);
c.i=i;
if(thisObject.firstRefresh){
if(c.getAttribute('width')!==null&&c.getAttribute('height')!==null){
c.w=c.getAttribute('width');
c.h=c.getAttribute('height')*a}
else{
c.w=c.width;
c.h=c.height}}
if((c.w)>(c.h/(thisObject.reflectionP+1))){
c.pc=118;
c.pcMem=118}
else
{
c.pc=100;
c.pcMem=100}
c.style.cursor=thisObject.imageCursor;
i++}}
this.max=thisObject.indexArray.length;
if(thisObject.firstRefresh){
thisObject.firstRefresh=false}
thisObject.moveTo(thisObject.current);
thisObject.glideTo(thisObject.imageID)}
this.moveTo=function(x){
this.current=x;
this.zIndex=thisObject.max;
for(var a=0;a<thisObject.max;a++){
var b=thisObject.imagesDiv.childNodes[thisObject.indexArray[a]];
var c=a*-thisObject.xStep;
if((c+thisObject.maxFocus)<thisObject.memTarget||(c-thisObject.maxFocus)>thisObject.memTarget){
b.style.visibility='hidden';
b.style.display='none'}
else
{
var z=Math.sqrt(10000+x*x)+100;
var xs=x/z*thisObject.size+thisObject.size;
b.style.display='block';
var d=(b.h/b.w*b.pc)/z*thisObject.size;
var e=0;
switch(d>thisObject.maxHeight){
case false:
e=b.pc/z*thisObject.size;
break;
default:
d=thisObject.maxHeight;
e=b.w*d/b.h;
break}
var f=(thisObject.iWidth*0.34-d)+((d/(thisObject.reflectionP+1))*thisObject.reflectionP);
b.style.left=xs-(b.pc/2)/z*thisObject.size+'px';
if(e&&d){
b.style.height=d+'px';
b.style.width=e+'px';
b.style.top=f+'px'}
b.style.visibility='visible';
switch(x<0){
case true:
this.zIndex++;
break;
default:
this.zIndex=thisObject.zIndex-1;
break}
switch(b.i==thisObject.imageID){
case false:
b.onclick=function(){thisObject.glideTo(this.i)};
break;
default:
this.zIndex=thisObject.zIndex+1;
if(b.url!==''){
b.onclick=thisObject.onClick}
break}
b.style.zIndex=thisObject.zIndex}
x+=thisObject.xStep}}
this.glideTo=function(a){
var x=-a*thisObject.xStep;
this.target=x;
this.memTarget=x;
this.imageID=a;
var b=thisObject.imagesDiv.childNodes[a].getAttribute('alt');
if(b===''||thisObject.captions===false){
b=' '}
thisObject.captionDiv.innerHTML=b;
if(thisObject.MouseDrag.busy===false){
this.newSliderX=(a*thisObject.scrollbarWidth)/(thisObject.max-1)-thisObject.MouseDrag.newX;
thisObject.sliderDiv.style.marginLeft=(thisObject.newSliderX-thisObject.sliderWidth)+'px'}
if(thisObject.opacity===true||thisObject.imageFocusM!==thisObject.defaults.imageFocusM){
thisObject.setOpacity(thisObject.imagesDiv.childNodes[a],thisObject.opacityArray[0]);
thisObject.imagesDiv.childNodes[a].pc=thisObject.imagesDiv.childNodes[a].pc*thisObject.imageFocusM;
var c=0;
var d=0;
var e=0;
var f=thisObject.opacityArray.length;
for(var i=1;i<(thisObject.imageFocusMax+1);i++){
if((i+1)>f){
c=thisObject.opacityArray[f-1]}
else
{
c=thisObject.opacityArray[i]}
d=a+i;
e=a-i;
if(d<thisObject.max){
thisObject.setOpacity(thisObject.imagesDiv.childNodes[d],c);
thisObject.imagesDiv.childNodes[d].pc=thisObject.imagesDiv.childNodes[d].pcMem}
if(e>=0){
thisObject.setOpacity(thisObject.imagesDiv.childNodes[e],c);
thisObject.imagesDiv.childNodes[e].pc=thisObject.imagesDiv.childNodes[e].pcMem}}}
if(thisObject.busy===false){
window.setTimeout(thisObject.animate,50);
thisObject.busy=true}}
this.animate=function(){
switch(thisObject.target<thisObject.current-1||thisObject.target>thisObject.current+1){
case true:
thisObject.moveTo(thisObject.current+(thisObject.target-thisObject.current)/3);
window.setTimeout(thisObject.animate,50);
thisObject.busy=true;
break;
default:
thisObject.busy=false;
break}}
this.setOpacity=function(a,b){
if(thisObject.opacity===true){
a.style.opacity=b/10;
a.style.filter='alpha(opacity='+b*10+')'}}
this.initMouseWheel=function(){
if(window.addEventListener){
thisObject.ImageFlowDiv.addEventListener('DOMMouseScroll',thisObject.eventMouseWheel,false)}
thisObject.ImageFlowDiv.onmousewheel=thisObject.eventMouseWheel}
this.eventMouseWheel=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){
thisObject.handleMouseWheel(b)}
if(a.preventDefault){
a.preventDefault()}
a.returnValue=false}
this.handleMouseWheel=function(a){
var b=false;
var c=0;
if(a>0){
if(thisObject.imageID>=1){
c=thisObject.imageID-1;
b=true}}
else
{
if(thisObject.imageID<(thisObject.max-1)){
c=thisObject.imageID+1;
b=true}}
if(b===true){
thisObject.glideTo(c)}}
this.MouseDrag =
{
object: null,
objectX: 0,
mouseX: 0,
newX: 0,
busy: false,
init:function(){
thisObject.addEvent(thisObject.ImageFlowDiv,'mousemove',thisObject.MouseDrag.drag);
thisObject.addEvent(thisObject.ImageFlowDiv,'mouseup',thisObject.MouseDrag.stop);
thisObject.addEvent(document,'mouseup',thisObject.MouseDrag.stop);
thisObject.
ImageFlowDiv.onselectstart=function(){
var a=true;
if(thisObject.MouseDrag.busy===true){
a=false}
return a}},
start:function(o){
thisObject.MouseDrag.object=o;
thisObject.MouseDrag.objectX=thisObject.MouseDrag.mouseX-o.offsetLeft+thisObject.newSliderX},
stop:function(){
thisObject.MouseDrag.object=null;
thisObject.MouseDrag.busy=false},
drag:function(e){
var a=0;
if(!e){
e=window.event}
if(e.pageX){
a=e.pageX}
else if(e.clientX){
a=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft}
thisObject.MouseDrag.mouseX=a;
if(thisObject.MouseDrag.object!==null){
var b=(thisObject.MouseDrag.mouseX-thisObject.MouseDrag.objectX)+thisObject.sliderWidth;
if(b<(-thisObject.newSliderX)){
b=-thisObject.newSliderX}
if(b>(thisObject.scrollbarWidth-thisObject.newSliderX)){
b=thisObject.scrollbarWidth-thisObject.newSliderX}
var c=(b+thisObject.newSliderX)/(thisObject.scrollbarWidth/(thisObject.max-1));
var d=Math.round(c);
thisObject.MouseDrag.newX=b;
thisObject.MouseDrag.object.style.left=b+'px';
if(thisObject.imageID!==d){
thisObject.glideTo(d)}
thisObject.MouseDrag.busy=true}}};
this.Key =
{
init:function(){
document.onkeydown=function(a){thisObject.Key.handle(a)}},
handle:function(a){
var b=thisObject.Key.get(a);
switch(b){
case 39:
thisObject.handleMouseWheel(-1);
break;
case 37:
thisObject.handleMouseWheel(1);
break}},
get:function(a){
a=a||window.event;
return a.keyCode}};
this.addEvent=function(a,b,fn){
if(a.addEventListener){
a.addEventListener(b,fn,false)}
else if(a.attachEvent){
a["e"+b+fn]=fn;
a[b+fn]=function(){a["e"+b+fn](window.event)};
a.attachEvent("on"+b,a[b+fn])}}
this.addResizeEvent=function(){
var a=window.onresize;
if(typeof window.onresize!='function'){
window.onresize=function(){
thisObject.refresh()}
}
else
{
window.onresize=function(){
if(a){
a()}
thisObject.refresh()}
}}
}
var domReadyEvent =
{
name: "domReadyEvent",
events: {},
domReadyID: 1,
bDone: false,
DOMContentLoadedCustom: null,
add:function(a){
if(!a.$$domReadyID){
a.$$domReadyID=this.domReadyID++;
if(this.bDone){
a()}
this.events[a.$$domReadyID]=a}},
remove:function(a){
if(a.$$domReadyID){
delete this.events[a.$$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 a=window.onload;
window.onload=function(){
domReadyEvent.run();
a()}
}
else
{
window.onload=run}
/*@cc_on
@if(@_win32||@_win64)
document.write("<script id=__ie_onload defer src=\"//:\"><\/script>");
var b=document.getElementById("__ie_onload");
b.onreadystatechange=function(){
if(this.readyState=="complete"){
domReadyEvent.run()}}
@end
@*/
}};
var
domReady=function(a){domReadyEvent.add(a)};
domReadyEvent.init();
domReady(function(){
var instanceOne = new ImageFlow();
instanceOne.init({ ImageFlowID:'youflow', imageFocusM: 1.2, opacity: true, opacityArray: [10,8,8,1,1], startID: 5, captions: true, reflectionGET: '&bgc=ffffff', onClick: function(){ return hs.htmlExpand(this, { headingText: ''+this.getAttribute('alt'), preserveContent:false, outlineType: 'rounded-white', captionText: '', objectType: 'iframe', align: 'center', objectWidth: 460, objectHeight: 480, src: this.getAttribute('longdesc')})}})});
