function ImageFlow(H,E,D,K,J,F,A,B,C){this.diapos=[];this.scr=false;this.size=K;this.zoom=J;this.horizon=D;this.bdw=F;this.oCont=H;this.oc=document.getElementById(H);this.scrollbar=getElementsByClass(this.oc,"div","scrollbar2");this.text=getElementsByClass(this.oc,"div","text2");this.title=getElementsByClass(this.text,"div","title2");this.legend=getElementsByClass(this.text,"div","legend2");this.bar=getElementsByClass(this.oc,"img","bar2");this.arL=getElementsByClass(this.oc,"img","arrow-left2");this.arR=getElementsByClass(this.oc,"img","arrow-right2");this.bw=this.bar.width;this.alw=this.arL.width-5;this.arw=this.arR.width-5;this.bar.parent=this.oc.parent=this;this.arL.parent=this.arR.parent=this;this.view=this.back=-1;this.time_start=A*62.5||0;this.time_inter=B*62.5||0;this.time_out=this.time_start;this.time=0;this.time_dir=1;this.resize();this.oc.onselectstart=function(){return false};this.NF=E.length;var I='<a href="" onclick="javascript:Hide();return false;" ><font color="white">Click here to go back to the listing</font></a>';for(var G=0;G<this.NF;G++){this.diapos[G]=new Diapo(this,G,E[G],I,"MLS#"+C+"<br/>To make an appointment email to John: idht@yahoo.com",false,"_self")}if(window.addEventListener){this.oc.addEventListener("DOMMouseScroll",function(L){this.parent.scroll(-L.detail);return false},false)}this.oc.onmousewheel=function(){this.parent.scroll(event.wheelDelta);return false};this.bar.onmousedown=function(N){if(!N){N=window.event}var M=N.screenX-this.offsetLeft;var L=this.parent;this.parent.oc.onmousemove=function(O){if(!O){O=window.event}L.bar.style.left=Math.round(Math.min((L.ws-L.arw-L.bw),Math.max(L.alw,O.screenX-M)))+"px";L.view=Math.round(((O.screenX-M))/(L.ws-L.alw-L.arw-L.bw)*(L.NF-1));if(L.view!=L.back){L.calc()}return false};this.parent.oc.onmouseup=function(O){L.oc.onmousemove=null;return false};return false};this.arR.onclick=this.arR.ondblclick=function(){if(this.parent.view<this.parent.NF-1){this.parent.calc(1)}};this.arL.onclick=this.arL.ondblclick=function(){if(this.parent.view>0){this.parent.calc(-1)}}}ImageFlow.prototype={calc:function(E){if(E){this.view+=E;this.time=0;this.time_out=this.time_start}var H=0;var F=0;var C=this.diapos[this.view];if(C&&C.loaded){var B=this.diapos[this.back];if(B&&B!=C){B.img.className="diapo";B.z1=1}this.title.innerHTML=C.title;this.legend.innerHTML=C.text;if(C.url){C.img.className="diapo link";window.status="hyperlink: "+C.url}else{C.img.className="diapo";window.status=""}if(C.r<1){C.w1=Math.min(C.iw,this.wh*0.8,Math.round(this.ht*this.horizon/C.r))*C.z1}else{C.w1=Math.round(this.ht*this.horizon/C.r)*C.z1}var D=C.x1=(this.wh*0.5)-(C.w1*0.5);var I=D+C.w1+this.bdw;for(var G=this.view+1,C;C=this.diapos[G];G++){if(C.loaded){C.x1=I;C.w1=(this.ht/C.r)*this.size;I+=C.w1+this.bdw;H+=C.w1+this.bdw}}I=D-this.bdw;for(var G=this.view-1,C;C=this.diapos[G];G--){if(C.loaded){C.w1=(this.ht/C.r)*this.size;C.x1=I-C.w1;I-=C.w1+this.bdw;H+=C.w1+this.bdw;F+=C.w1+this.bdw}}if(!this.scr&&H){var A=(this.ws-this.alw-this.arw-this.bw)/H;this.bar.style.left=Math.round(this.alw+F*A)+"px"}this.back=this.view}},scroll:function(A){if(A<0){if(this.view<this.NF-1){this.calc(1)}}else{if(this.view>0){this.calc(-1)}}},resize:function(){this.wh=this.oc.clientWidth;this.ht=this.oc.clientHeight;this.ws=this.scrollbar.offsetWidth;this.calc();this.run(true)},run:function(B){var A=this.NF;while(A--){this.diapos[A].move(B)}if(this.time_out){this.time++;if(this.time>this.time_out){this.view+=this.time_dir;if(this.view>=this.NF||this.view<0){this.time_dir=-this.time_dir;this.view+=this.time_dir*2}this.calc();this.time=0;this.time_out=this.time_inter}}}};