/*
Name:       ImageFlow
Version:    1.1 (March 13 2008)
Author:     Finn Rudolph
Support:    http://finnrudolph.de/ImageFlow

Licence:    ImageFlow is licensed under a Creative Commons
            Attribution-Noncommercial 3.0 Unported License
            (http://creativecommons.org/licenses/by-nc/3.0/).

            You are free:
                + to Share - to copy, distribute and transmit the work
                + to Remix - to adapt the work

            Under the following conditions:
                + Attribution. You must attribute the work in the manner specified by the author or licensor
                  (but not in any way that suggests that they endorse you or your use of the work).
                + Noncommercial. You may not use this work for commercial purposes.

            + For any reuse or distribution, you must make clear to others the license terms of this work.
            + Any of the above conditions can be waived if you get permission from the copyright holder.
            + Nothing in this license impairs or restricts the author's moral rights.

Credits:    This script is based on Michael L. Perrys Cover flow in Javascript [1].
            The reflections are generated server-sided by a slightly hacked version
            of Richard Daveys easyreflections [2] written in PHP. The mouse wheel
            support is an implementation of Adomas Paltanavicius JavaScript mouse
            wheel code [3]. It also uses the domReadyEvent from Tanny O'Haley [4].

            [1] http://www.adventuresinsoftware.com/blog/?p=104#comment-1981
            [2] http://reflection.corephp.co.uk/v2.php
            [3] http://adomas.org/javascript-mouse-wheel/
            [4] http://tanny.ica.com/ICA/TKO/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-v
*/

/* Packed ImageFlow constructor and DOMContentLoaded event handler */
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([79q-vx-zA-Z]|[1-3]\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('r ImageFlow(){7.25={1A:1.964,26:t,27:\'1o\',y:\'imageflow\',1p:1.0,1B:4,28:0.67,29:1.0,2a:r(){s.location=7.2b},1d:v,1e:[10,8,6,4,2],1C:118,1D:S,2c:t,1E:t,2d:\'\',1f:0.5,2e:v,2f:0.6,1q:t,2g:\'e-resize\',T:14,2h:1,2i:v,12:150};q a=7;7.13=r(b){q c=new Array(\'1A\',\'26\',\'27\',\'29\',\'y\',\'1p\',\'1B\',\'28\',\'2a\',\'1d\',\'1e\',\'1C\',\'1D\',\'2c\',\'1E\',\'2d\',\'1f\',\'2e\',\'2f\',\'1q\',\'2g\',\'T\',\'2h\',\'2i\',\'12\');q d=c.1g;U(q e=0;e<d;e++){q f=c[e];7[f]=(b!==1F&&b[f]!==1F)?b[f]:a.25[f]}q h=s.G(a.y);9(h){h.u.1G=\'2j\';7.D=h;9(7.2A()){7.B=s.G(a.y+\'_2\');7.1H=s.G(a.y+\'_3\');7.1r=s.G(a.y+\'_1\');7.1I=s.G(a.y+\'_4\');7.1J=[];7.15=0;7.L=0;7.1s=0;7.1K=0;7.1L=t;7.1M=t;7.I=v;9(7.1q===v){7.1r.u.1t=\'1N\'}q i=7.D.2E;q g=J.M(i/a.1A);s.G(a.y+\'_0\').u.paddingTop=((g*0.5)-22)+\'F\';h.u.16=g+\'F\';7.1P()}}};7.2A=r(){q b=s.17(\'1h\');b.z(\'V\',a.y+\'_2\');b.z(\'1i\',\'2l\');b.z(\'1j\',\'2l\');q c=H;q d=7.D.C.1g;U(q e=0;e<d;e++){c=7.D.C[e];9(c&&c.1Q==1&&c.1R==\'1S\'){9(a.1E===t){q f=\'2\';9(a.2e===t){f=\'3\'}q h=c.18(\'2m\',2);h=\'reflect\'+f+\'.php?img=\'+h+a.2d;c.z(\'2m\',h)}q i=c.cloneNode(t);b.N(i)}}q g=s.17(\'p\');q j=s.2F(\' \');g.z(\'V\',a.y+\'_0\');g.N(j);q k=s.17(\'1h\');k.z(\'V\',a.y+\'_5\');k.z(\'1i\',\'2n\');k.z(\'1j\',\'2n\');q m=s.17(\'1h\');m.z(\'V\',a.y+\'_6\');m.z(\'1i\',\'2I\');m.z(\'1j\',\'2I\');k.N(m);q n=s.17(\'1h\');n.z(\'V\',a.y+\'_3\');n.z(\'1i\',\'2J\');n.z(\'1j\',\'2J\');q l=s.17(\'1h\');l.z(\'V\',a.y+\'_1\');l.z(\'1i\',\'2K\');l.z(\'1j\',\'2K\');q o=s.17(\'1h\');o.z(\'V\',a.y+\'_4\');o.z(\'1i\',\'1q\');o.z(\'1j\',\'1q\');l.N(o);q p=v;9(a.D.N(b)&&a.D.N(g)&&a.D.N(k)&&a.D.N(n)&&a.D.N(l)){U(e=0;e<d;e++){c=7.D.C[e];9(c&&c.1Q==1&&c.1R==\'1S\'){7.D.removeChild(c)}}p=t}O p};7.1P=r(){q b=a.2L();9(b<S||a.1M===t&&a.2c===t){9(a.1M===t&&b==S){a.1M=v;A.W(a.1P,S)}E{A.W(a.1P,40)}}E{s.G(a.y+\'_0\').u.1t=\'1N\';s.G(a.y+\'_5\').u.1t=\'1N\';A.W(a.2M,1000);a.2N();a.x.13();a.1T.13();a.1U(t);s.G(a.y+\'_1\').u.1G=\'2j\';q c=a.2h-1;9(c<0){c=0}9(c>a.P){c=a.P-1}a.1k(c);9(a.2i===t){a.1V(5000)}}};7.2L=r(){q b=a.B.C.1g;q c=0,d=0;q e=H;U(q f=0;f<b;f++){e=a.B.C[f];9(e&&e.1Q==1&&e.1R==\'1S\'){9(e.2o===t){d++}c++}}q h=J.M((d/c)*S);q i=s.G(a.y+\'_6\');i.u.19=h+\'%\';q g=s.G(a.y+\'_0\');q j=s.2F(\'2n 2l \'+d+\'/\'+c);g.replaceChild(j,g.firstChild);O h};7.1U=r(){7.X=a.B.2E;7.1u=J.M(a.X/a.1A);7.2p=a.1B*a.12;7.1l=a.X*0.5;7.T=a.T*0.5;7.1a=(a.X-(J.M(a.T)*2))*a.2f;7.2q=J.M(a.1u*a.28);a.D.u.16=a.1u+\'F\';a.B.u.16=a.2q+\'F\';a.1H.u.19=a.X+\'F\';a.1H.u.2O=J.M(a.X*0.02)+\'F\';a.1r.u.19=a.1a+\'F\';a.1r.u.2O=J.M(a.X*0.02)+\'F\';a.1r.u.2Q=J.M(a.T+((a.X-a.1a)/2))+\'F\';a.1I.u.2R=a.2g;a.1I.onmousedown=r(){a.x.2S(7);O v};q b=(a.1E===t)?a.1f+1:1;q c=a.B.C.1g;q d=0;q e=H;U(q f=0;f<c;f++){e=a.B.C[f];9(e!==H&&e.1Q==1&&e.1R==\'1S\'){7.1J[d]=f;e.2b=e.18(\'longdesc\');e.xPosition=(-d*a.12);e.i=d;9(a.1L){9(e.18(\'19\')!==H&&e.18(\'16\')!==H){e.w=e.18(\'19\');e.h=e.18(\'16\')*b}E{e.w=e.19;e.h=e.16}}9((e.w)>(e.h/(a.1f+1))){e.Q=a.1C;e.1W=a.1C}E{e.Q=a.1D;e.1W=a.1D}e.u.2R=a.27;d++}}7.P=a.1J.1g;9(a.1L){a.1L=v}a.1k(a.L);a.1V(a.15)};7.1V=r(b){7.15=b;7.Y=a.P;U(q c=0;c<a.P;c++){q d=a.B.C[a.1J[c]];q e=c*-a.12;9((e+a.2p)<a.1K||(e-a.2p)>a.1K){d.u.1G=\'hidden\';d.u.1t=\'1N\'}E{q f=(J.sqrt(10000+b*b)+S)*a.29;q h=b/f*a.1l+a.1l;d.u.1t=\'block\';q i=(d.h/d.w*d.Q)/f*a.1l;q g=0;1v(i>a.1u){1m v:g=d.Q/f*a.1l;K;1o:i=a.1u;g=d.w*i/d.h;K}q j=(a.2q-i)+((i/(a.1f+1))*a.1f);d.u.2T=h-(d.Q/2)/f*a.1l+\'F\';9(g&&i){d.u.16=i+\'F\';d.u.19=g+\'F\';d.u.top=j+\'F\'}d.u.1G=\'2j\';1v(b<0){1m t:7.Y++;K;1o:7.Y=a.Y-1;K}1v(d.i==a.L){1m v:d.2U=r(){a.1k(7.i)};K;1o:7.Y=a.Y+1;9(d.2b!==\'\'){d.2U=a.2a}K}d.u.Y=a.Y}b+=a.12}};7.1k=r(b){q c=-b*a.12;7.1s=c;7.1K=c;7.L=b;q d=a.B.C[b].18(\'alt\');9(d===\'\'||a.26===v){d=\'&nbsp;\'}a.1H.innerHTML=d;9(a.x.I===v){7.Z=(b*a.1a)/(a.P-1)-a.x.2r;a.1I.u.2Q=(a.Z-a.T)+\'F\'}9(a.1d===t||a.1p!==a.25.1p){a.1X(a.B.C[b],a.1e[0]);a.B.C[b].Q=a.B.C[b].Q*a.1p;q e=0;q f=0;q h=0;q i=a.1e.1g;U(q g=1;g<(a.1B+1);g++){9((g+1)>i){e=a.1e[i-1]}E{e=a.1e[g]}f=b+g;h=b-g;9(f<a.P){a.1X(a.B.C[f],e);a.B.C[f].Q=a.B.C[f].1W}9(h>=0){a.1X(a.B.C[h],e);a.B.C[h].Q=a.B.C[h].1W}}}9(a.I===v){A.W(a.2s,50);a.I=t}};7.2s=r(){1v(a.1s<a.15-1||a.1s>a.15+1){1m t:a.1V(a.15+(a.1s-a.15)/3);A.W(a.2s,50);a.I=t;K;1o:a.I=v;K}};7.1X=r(b,c){9(a.1d===t){b.u.1d=c/10;b.u.filter=\'alpha(1d=\'+c*10+\')\'}};7.2N=r(){9(A.11){a.D.11(\'DOMMouseScroll\',a.2t,v)}a.D.onmousewheel=a.2t};7.2t=r(b){q c=0;9(!b){b=A.1Y}9(b.2W){c=b.2W/120}E 9(b.2X){c=-b.2X/3}9(c){a.1Z(c)}9(b.2Y){b.2Y()}b.returnValue=v};7.1Z=r(b){q c=v;q d=0;9(b>0){9(a.L>=1){d=a.L-1;c=t}}E{9(a.L<(a.P-1)){d=a.L+1;c=t}}9(c===t){a.1k(d)}};7.x={1w:H,2u:0,20:0,2r:0,I:v,13:r(){a.1n(a.D,\'mousemove\',a.x.2Z);a.1n(a.D,\'30\',a.x.2v);a.1n(s,\'30\',a.x.2v);a.D.onselectstart=r(){q b=t;9(a.x.I===t){b=v}O b}},2S:r(b){a.x.1w=b;a.x.2u=a.x.20-b.offsetLeft+a.Z},2v:r(){a.x.1w=H;a.x.I=v},2Z:r(b){q c=0;9(!b){b=A.1Y}9(b.31){c=b.31}E 9(b.32){c=b.32+s.2w.33+s.documentElement.33}a.x.20=c;9(a.x.1w!==H){q d=(a.x.20-a.x.2u)+a.T;9(d<(-a.Z)){d=-a.Z}9(d>(a.1a-a.Z)){d=a.1a-a.Z}q e=(d+a.Z)/(a.1a/(a.P-1));q f=J.M(e);a.x.2r=d;a.x.1w.u.2T=d+\'F\';9(a.L!==f){a.1k(f)}a.x.I=t}}};7.1T={13:r(){s.onkeydown=r(b){a.1T.34(b)}},34:r(b){q c=a.1T.35(b);1v(c){1m 39:a.1Z(-1);K;1m 37:a.1Z(1);K}},35:r(b){b=b||A.1Y;O b.keyCode}};7.1n=r(b,c,d){9(b.11){b.11(c,d,v)}E 9(b.36){b["e"+c+d]=d;b[c+d]=r(){b["e"+c+d](A.1Y)};b.36("on"+c,b[c+d])}};7.2M=r(){q b=A.21;9(1x A.21!=\'r\'){A.21=r(){a.1U()}}E{A.21=r(){9(b){b()}a.1U()}}}}q R={2x:"R",1y:{},1b:1,1z:v,2y:H,38:r(b){9(!b.$$1b){b.$$1b=7.1b++;9(7.1z){b()}7.1y[b.$$1b]=b}},remove:r(b){9(b.$$1b){delete 7.1y[b.$$1b]}},1c:r(){9(7.1z){O}7.1z=t;U(q b in 7.1y){7.1y[b]()}},23:r(){9(7.1z){O}9(/KHTML|WebKit/i.3a(navigator.userAgent)){9(/loaded|2o/.3a(s.3b)){7.1c()}E{W(7.2x+".23()",S)}}E 9(s.G("2z")){O t}9(1x 7.2y==="r"){9(1x s.3c!==\'1F\'&&(s.3c(\'2w\')[0]!==H||s.2w!==H)){9(7.2y()){7.1c()}E{W(7.2x+".23()",250)}}}O t},13:r(){9(s.11){s.11("DOMContentLoaded",r(){R.1c()},v)}W("R.23()",S);r b(){R.1c()}9(1x 1n!=="1F"){1n(A,"3d",b)}E 9(s.11){s.11("3d",b,v)}E 9(1x A.24==="r"){q c=A.24;A.24=r(){R.1c();c()}}E{A.24=b}/*@cc_on @9(@_win32||@_win64)s.write("<3e V=2z defer 2m=\\"//:\\"><\\/3e>");q d=s.G("2z");d.onreadystatechange=r(){9(7.3b=="2o"){R.1c()}};@end @*/}};q domReady=r(b){R.38(b)};R.13();',[],201,'|||||||this||if|||||||||||||||||var|function|document|true|style|false||MouseDrag|ImageFlowID|setAttribute|window|imagesDiv|childNodes|ImageFlowDiv|else|px|getElementById|null|busy|Math|break|imageID|round|appendChild|return|max|pc|domReadyEvent|100|sliderWidth|for|id|setTimeout|iWidth|zIndex|newSliderX||addEventListener|xStep|init||current|height|createElement|getAttribute|width|scrollbarWidth|domReadyID|run|opacity|opacityArray|reflectionP|length|div|class|className|glideTo|size|case|addEvent|default|imageFocusM|slider|scrollbarDiv|target|display|maxHeight|switch|object|typeof|events|bDone|aspectRatio|imageFocusMax|percentLandscape|percentOther|reflections|undefined|visibility|captionDiv|sliderDiv|indexArray|memTarget|firstRefresh|firstCheck|none||loadingProgress|nodeType|nodeName|IMG|Key|refresh|moveTo|pcMem|setOpacity|event|handleMouseWheel|mouseX|onresize||schedule|onload|defaults|captions|imageCursor|imagesHeight|imagesM|onClick|url|preloadImages|reflectionGET|reflectionPNG|scrollbarP|sliderCursor|startID|startAnimation|visible||images|src|loading|complete|maxFocus|imagesDivHeight|newX|animate|eventMouseWheel|objectX|stop|body|name|DOMContentLoadedCustom|__ie_onload|createStructure||||offsetWidth|createTextNode|||loading_bar|caption|scrollbar|loadingStatus|addResizeEvent|initMouseWheel|marginTop||marginLeft|cursor|start|left|onclick||wheelDelta|detail|preventDefault|drag|mouseup|pageX|clientX|scrollLeft|handle|get|attachEvent||add||test|readyState|getElementsByTagName|load|script'.split('|'),0,{}))

/* Create ImageFlow instances when the DOM structure has been loaded */
domReady(function()
{
	/* Demo */
	var Demo = new ImageFlow();
	Demo.init({ ImageFlowID:'demo' });


	/* Basic Examples */
	var example_1 = new ImageFlow();
	example_1.init({ ImageFlowID:'example_1' });

	var example_2 = new ImageFlow();
	example_2.init({ ImageFlowID:'example_2', reflections:false, reflectionP:0.0 });

	var example_3 = new ImageFlow();
	example_3.init({ ImageFlowID:'example_3', reflections:false, reflectionP:0.0, slider:false });

	var example_4 = new ImageFlow();
	example_4.init({ ImageFlowID:'example_4', reflections:false, reflectionP:0.0, slider:false, captions:false });

	var example_5 = new ImageFlow();
	example_5.init({ ImageFlowID:'example_5', reflections:false, reflectionP:0.4, slider:false, captions:false });


	/* Startup and Behaviour Examples */
	var example_6 = new ImageFlow();
	example_6.init({ ImageFlowID:'example_6', startID:3 });

	var example_7 = new ImageFlow();
	example_7.init({ ImageFlowID:'example_7', startAnimation:true });

	var example_8 = new ImageFlow();
	example_8.init({ ImageFlowID:'example_8', imageFocusMax:1 });

	var example_9 = new ImageFlow();
	example_9.init({ ImageFlowID:'example_9', imageFocusM:1.4, startID:3 });

	var example_10 = new ImageFlow();
	example_10.init({ ImageFlowID:'example_10', xStep:300 });


	/* Opacity Examples */
	var example_11 = new ImageFlow();
	example_11.init({ ImageFlowID:'example_11', opacity:true});

	var example_12 = new ImageFlow();
	example_12.init({ ImageFlowID:'example_12', opacity:true, opacityArray: [4,3,2,1,1] });


	/* Reflection Examples */
	var example_13 = new ImageFlow();
	example_13.init({ ImageFlowID:'example_13', reflectionGET:'&bgc=009cec' });

	var example_14 = new ImageFlow();
	example_14.init({ ImageFlowID:'example_14', reflectionGET:'&bgc=ffffff&fade_start=20%' });

	var example_15 = new ImageFlow();
	example_15.init({ ImageFlowID:'example_15', reflectionGET:'&fade_start=20%' });

	var example_16 = new ImageFlow();
	example_16.init({ ImageFlowID:'example_16', reflectionGET:'&height=20%', reflectionP:0.2 });

	var example_17 = new ImageFlow();
	example_17.init({ ImageFlowID:'example_17', reflectionPNG:true });


	/* Combination Example */
	var example_18 = new ImageFlow();
	example_18.init({ ImageFlowID:'example_18', reflections:false, reflectionP:0.4, slider:false, captions:false, opacity:true, xStep:250, imageFocusM:1.5,startID:3 });


	/* Target Examples */
	var example_19 = new ImageFlow();
	example_19.init({ ImageFlowID:'example_19', onClick: function() { window.open(this.url, '_blank');  } });

	var example_20 = new ImageFlow();
	example_20.init({ ImageFlowID:'example_20', onClick: function() { window.open(this.url, '_blank', 'width=500,height=500,left=200,top=200');  } });


	/* Proportion Examples */
	var example_21 = new ImageFlow();
	example_21.init({ ImageFlowID:'example_21', aspectRatio:2.333, imagesHeight:0.7 });

	var example_22 = new ImageFlow();
	example_22.init({ ImageFlowID:'example_22', aspectRatio:3.0, imagesM:0.8, xStep: 70, percentLandscape:66, percentOther:50, imageFocusMax:3 });

	var example_23 = new ImageFlow();
	example_23.init({ ImageFlowID:'example_23', aspectRatio:1.618  });


	/* Combinations */
	var Highslide_1 = new ImageFlow();
	Highslide_1.init({ ImageFlowID:'Highslide_1', onClick: function() { return hs.expand(this, {src: this.getAttribute('longdesc')} ); } });

	var Highslide_2 = new ImageFlow();
	Highslide_2.init({ ImageFlowID:'Highslide_2', onClick: function() { return hs.expand(this, {src: this.getAttribute('longdesc'), outlineType: 'rounded-white', showCredits: false, fadeInOut:true }); } });

	var Highslide_3 = new ImageFlow();
	Highslide_3.init({ ImageFlowID:'Highslide_3', opacity: true, reflectionP: 0.3, reflectionGET: '&bgc=ffffff&fade_start=70%', onClick: function() { return hs.expand(this, {src: this.getAttribute('longdesc'), outlineType: 'rounded-white', showCredits: false, fadeInOut:true, captionText: this.getAttribute('alt')}); } });

});
