/* ContentFlow, version 0.7  | (c) 2007 - 2009 Sebastian Kutsch | <http://www.jacksasylum.eu/ContentFlow/> | ContentFlow is distributed under the terms of the MIT license. | (see http://www.jacksasylum.eu/ContentFlow/LICENSE) */var ContentFlowGlobal={Flows:new Array,AddOns:{},scriptName:'contentflow.js/',scriptElement:null,Browser:new (function(){this.Opera=window.opera?true:false;this.IE=document.all&&!this.Opera?true:false;this.IE6=this.IE&&typeof (window.XMLHttpRequest)=="undefined"?true:false;this.IE8=this.IE&&typeof (document.querySelectorAll)!="undefined"?true:false;this.IE7=this.IE&&!this.IE6&&!this.IE8?true:false;this.WebKit=/WebKit/i.test(navigator.userAgent)?true:false,this.iPhone=/iPhone|iPod/i.test(navigator.userAgent)?true:false;this.Chrome=/Chrome/i.test(navigator.userAgent)?true:false;this.Safari=/Safari/i.test(navigator.userAgent)&&!this.Chrome?true:false;this.Konqueror=navigator.vendor=="KDE"?true:false;this.Konqueror4=this.Konqueror&&/native code/.test(document.getElementsByClassName)?true:false;this.Gecko=!this.WebKit&&navigator.product=="Gecko"?true:false;this.Gecko19=this.Gecko&&Array.reduce?true:false})(),getScriptElement:function(D){var C=new RegExp(D);var A=document.getElementsByTagName("script");for(var B=0;B<A.length;B++){if(A[B].src&&C.test(A[B].src)){return A[B]}}return""},getScriptPath:function(C,B){var A=new RegExp(B+".*");return C.src.replace(A,"")},addScript:function(B){
				if(this.Browser.IE||this.Browser.WebKit||this.Browser.Konqueror){
					document.write('<script type="text/javascript" src="'+B+'"><\/script>');
				}else{
					var A=document.createElement("script");
					A.src=B;A.setAttribute("type","text/javascript");
					document.getElementsByTagName("head")[0].appendChild(A);
				}
			},addScripts:function(C,B){for(var A=0;A<filename.length;A++){this.addScript(basepath+B[A])}},addStylesheet:function(B){if(this.Browser.Gecko19){var A=document.createElement("link");A.setAttribute("rel","stylesheet");A.setAttribute("titel","Standard");A.setAttribute("href",B);A.setAttribute("type","text/css");A.setAttribute("media","screen");document.getElementsByTagName("head")[0].appendChild(A)}else{document.write('<link rel="stylesheet" title="Standard" href="'+B+'" type="text/css" media="screen" />')}},addStylesheets:function(C,B){for(var A=0;A<filename.length;A++){this.addStylesheet(basepath+B[A])}},initPath:function(){this.scriptElement=this.getScriptElement(this.scriptName);if(!this.scriptElement){this.scriptName='contentflow_src.js/';this.scriptElement=this.getScriptElement(this.scriptName)}this.BaseDir=this.getScriptPath(this.scriptElement,this.scriptName);if(!this.AddOnBaseDir){this.AddOnBaseDir=this.BaseDir}if(!this.CSSBaseDir){this.CSSBaseDir=this.BaseDir}},init:function()
			{
				this.addStylesheet(this.CSSBaseDir+"contentflow.css/startItem/0/scaleFactor/0.8/reflectionType/none/topSidebarWidth/0/bottomSidebarWidth/0/useAddOns/lightbox2/contentPosition/top/maxItemHeight/0/contentflowHeight/174/");this.addScript(this.AddOnBaseDir+"addonlightbox2.js/")
				var CFG=this;
				if(document.addEventListener){
					if(/WebKit/i.test(navigator.userAgent)){
						var _timer=setInterval(function(){
							if(/loaded|complete/.test(document.readyState)){
								clearInterval(_timer);
								CFG.onloadInit()
							}
						},10);
					}else{
						document.addEventListener("DOMContentLoaded",CFG.onloadInit,false);
					}
				}
				window.addEvent("load",CFG.onloadInit,false);
				
			},onloadInit:function(){if(arguments.callee.done){return }arguments.callee.done=true;if(window.Element&&document.all&&!window.opera){for(var F in window.CFElement.prototype){if(!window.Element.prototype[F]){window.Element.prototype[F]=window.CFElement.prototype[F]}}}if(window.$&&typeof Prototype!="undefined"&&document.all&&!window.opera){var E=window.$;window.$=function(G){return E(window._$(G))}}else{if(!window.$){window.$=window._$}}for(var B=0;B<ContentFlowGlobal.Flows.length;B++){ContentFlowGlobal.Flows[B].init()}var C=document.getElementsByTagName("div");DIVS:for(var B=0;B<C.length;B++){if(C[B].className.match(/\bContentFlow\b/)){for(var A=0;A<ContentFlowGlobal.Flows.length;A++){if(C[B]==ContentFlowGlobal.Flows[A].container){continue DIVS}}var D=new ContentFlow(C[B],{},false);D.init()}}}};ContentFlowGlobal.initPath();var ContentFlowAddOn=function(B,A,C){if(typeof C=="undefined"||C!=false){ContentFlowGlobal.AddOns[B]=this}this.name=B;if(!A){A={}}this.methods=A;this.scriptpath=ContentFlowGlobal.AddOnBaseDir;if(A.init){var D=A.init.bind(this);D(this)}};ContentFlowAddOn.prototype={Browser:ContentFlowGlobal.Browser,addScript:ContentFlowGlobal.addScript,addScripts:ContentFlowGlobal.addScripts,addStylesheet:function(A){if(!A){A=this.scriptpath+"addon"+this.name+".css"}ContentFlowGlobal.addStylesheet(A)},addStylesheets:ContentFlowGlobal.addStylesheets,_init:function(A){if(this.methods.ContentFlowConf){A.setConfig(this.methods.ContentFlowConf);}}};
				var ContentFlowGUIElement=function(A,B){
					B.setDimensions=function(){
					this.dimensions=this.getDimensions();
					this.center={
						x:744/2,
						y:174/2
					};
					this.position=this.findPos()
				};
				B.addObserver=function(D,E){
					var C=this.eventMethod=E.bind(A);
					this.observedEvent=D;
					this.addEvent(D,C,false);
				};
				B.makeDraggable=function(E,D,F){
					this.stopDrag=function(G){
						if(!G){
							var G=window.event;
						}
						window.removeEvent("mousemove",E,false);
						F(G);
					}
					.bind(this);
					this.startDrag=function(H){
						if(!H){
							var H=window.event;
						}
						this.mouseX=H.clientX;
						this.mouseY=H.clientY;
						D(H);
						window.addEvent("mousemove",E,false);
						var G=this.stopDrag;
						window.addEvent("mouseup",G,false);
					}
					.bind(this);
					var C=this.startDrag;
					this.addEvent("mousedown",C,false)
				};
				$(B).setDimensions();
				return B;
			};
			var ContentFlowItem=function(A,C,B){
				this.CFobj=A;
				this._activeElement=A._activeElement;
				this.clickInactiveItem=function(H){
					if(!H){
						var H=window.event;
					}
					var G=H.target?H.target:H.srcElement;
					var F=G.itemIndex?G.itemIndex:G.parentNode.itemIndex;
					this.moveToIndex(F);
					this._onclickInactiveItem(this.items[F]);
				}.bind(A);
				this.clickActiveItem=function(H){
					if(!H){
						var H=window.event;
					}
					var G=H.target?H.target:H.srcElement;
					var href = G.getAttribute("href");
					if (href.indexOf(".JPG") > 0 || 
						href.indexOf(".jpg") > 0 || 
						href.indexOf(".PNG") > 0 || 
						href.indexOf(".png") > 0 || 
						href.indexOf(".GIF") > 0 || 
						href.indexOf(".gif") > 0 || 
						href.indexOf(".JPEG") > 0 || 
						href.indexOf(".jpeg") > 0){
					} else {
						location=href;
					}
					
				}.bind(A);
				this.setIndex=function(F){
					this.index=F;
					this.element.itemIndex=F;
				};
				this.getIndex=function(){
					return this.index;
				};
				this.element=$(C);
				this.item=C;
				if(typeof B!="undefined"){
					this.setIndex(B);
				}
				this.content=this.element.getChildrenByClassName("contentflow_content")[0];
				this.caption=this.element.getChildrenByClassName("contentflow_caption")[0];
				this.label=this.element.getChildrenByClassName("label")[0];
				this.initClickInactive();
				if(this.content.nodeName=="IMG"){
					A._imagesToLoad++;
					var E=function(){
						A._imagesToLoad--;
						this.image=this.content;
						this.setImageFormat(this.image);
						if(A._reflectionType!="none"){
							this.addReflection();
						}else{
							var F=A._calcSize(0,0);
							this.positionContent(F);
						}
					};
					var D=E.bind(this);
					if(this.content.complete&&this.content.width>0){
						D();
					}else{
						this.content.onload=D;
					}
				}
			};
			ContentFlowItem.prototype={
				Browser:ContentFlowGlobal.Browser,
				makeActive:function(){
					var A=this.CFobj;
					this.element.addClassName("active");
					var B=this.clickActiveItem;
					if(window.addEventListener){
						this[this._activeElement].addEvent("click",B,false);
					}else{
						this[this._activeElement].onclick=B
					}
					A._onMakeActive(this);
				},
				makeInactive:function(){
					var A=this.CFobj;
					this.element.removeClassName("active");
					var B=this.clickActiveItem;
					var C=this.clickInactiveItem;
					if(window.addEventListener){
						this[this._activeElement].removeEvent("click",B,false);
					}else{
						this[this._activeElement].onclick=C;
					}
					A._onMakeInactive(this)
				},
				initClickInactive:function(){
					var A=this.CFobj;
					var B=this.clickInactiveItem;
					if(window.addEventListener){
						this[this._activeElement].addEvent("click",B,false);
					}else{
						this[this._activeElement].onclick=B
					}
				},
				addReflection:function(){
					var F=this.CFobj;
					var U;
					var M=this.content;
					if(F._reflectionType=="serverside"){
						var J=F._fileRegEx.exec(M.src);
						var R=M.src.replace(new RegExp(J[1]+"$"),"");
						var H=F._reflectionServerSrc;
						H=H.replace(/\{URLTO\}/,R);
						H=H.replace(/\{FILE\}/,J[1]);
						H=H.replace(/\{FILENAME\}/,J[2]);
						H=H.replace(/\{EXT\}/,J[3]);
						U=this.reflection=document.createElement("img");
						U.src=H
					}else{
						if(this.Browser.IE){
							var S="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
							if(F._reflectionColorRGB){
								if(F._reflectionColor=="transparent"){
									var P=U=this.reflection=document.createElement("img");
									U.src=M.src;
								}else{
									U=this.reflection=document.createElement("div");
									var P=document.createElement("img");
									P.src=M.src;
									U.width=P.width;
									U.height=P.height;
									P.style.width="100%";
									P.style.height="100%";
									var O=F._reflectionColorRGB;U.style.backgroundColor=falseU.appendChild(P);
								}
								S+=" progid:DXImageTransform.Microsoft.Alpha(opacity=0, finishOpacity=50, style=1, finishX=0, startY="+F._reflectionHeight*100+" finishY=0)";
							}else{
								var P=U=this.reflection=document.createElement("img");
								U.src=M.src;
							}
							S+=" progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22="+1/F._reflectionHeight+")";
							P.style.filter=S;
						}else{
							if(F._reflectionWithinImage){
								var D=this.canvas=$(document.createElement("canvas"));
							}else{
								var D=U=this.reflection=document.createElement("canvas");
							}
							if(D.getContext){
								if(F._reflectionWithinImage){
									for(var T=0;T<M.attributes.length;T++){
										D.setAttributeNode(M.attributes[T].cloneNode(true));
									}
								}
								var C=D.getContext("2d");
								if(F._reflectionWithinImage){
									if(M.height>F.maxHeight){
										var L=F.maxHeight;
										var N=F.maxHeight/M.origProportion;
									}else{
										var L=M.height;
										var N=M.width;
									}
									D.width=N;
									D.height=L;
									this.setImageFormat(D);
									D.height=L*(1+F._reflectionHeight)
								}else{
									D.width=N;
									D.height=L*F._reflectionHeight;
								}
								C.save();
								if(F._reflectionWithinImage){
									C.drawImage(M,0,0,N,L);
								}
								if(F._reflectionWithinImage){
									var Q=L*2-1;
								}else{
									var Q=M.height-1
								}
							C.translate(0,Q);
							C.scale(1,-1);
							C.drawImage(M,0,0,N,L);
							C.restore();
							if(F._reflectionColorRGB){
								var B=C.createLinearGradient(0,0,0,D.height);
								var E=[0,0.5,1];
								if(F._reflectionColor=="transparent"){
									C.globalCompositeOperation="destination-in";
									E=[1,0.5,0];
								}
								var G=F._reflectionColorRGB.iR;
								var I=F._reflectionColorRGB.iG;
								var A=F._reflectionColorRGB.iB;
								if(F._reflectionWithinImage){
									B.addColorStop(0,"rgba("+G+","+I+","+A+","+E[0]+")");
									B.addColorStop(L/D.height,"rgba("+G+","+I+","+A+","+E[0]+")");
									B.addColorStop(L/D.height,"rgba("+G+","+I+","+A+","+E[1]+")");
								}else{
									B.addColorStop(0,"rgba("+G+","+I+","+A+","+E[1]+")");
								}
								B.addColorStop(1,"rgba("+G+","+I+","+A+","+E[2]+")");
								C.fillStyle=B;
								C.fillRect(0,0,D.width,D.height);
							}
							if(F._reflectionWithinImage){
								M.parentNode.replaceChild(D,M);
								this.content=D;
								this.origContent=D;
								this.initClickInactive();
								delete this.image;
							}
						}else{
							F._reflectionWithinImage=false;
							delete this.reflection;
						}
					}
				}
				if(U){
					U.className="reflection";
					this.element.appendChild(U);
					if(this.caption){
						this.element.appendChild(this.caption);
					}
				}
				var K=F._calcSize(0,0);
				this.positionContent(K)
			},setImageFormat:function(A){
				A.origProportion=A.height/A.width;
				A.setAttribute("origProportion",A.height/A.width);
				if(A.origProportion>=1){
					A.addClassName("portray");
				}else{
					A.addClassName("landscape");
				}
			},calcContentDim:function(E){
				var B=this.CFobj;
				var D=this;
				var G=this.content;
				var H=G.origProportion;
				var F,A;
				if(H>=1){
					if(B._verticalFlow){
						if(B._scaleFactorLandscape=="max"){
							var F=E.width;
						}else{
							var F=E.height/H*B._scaleFactorLandscape;
						}
						F=F>B.maxHeight?B.maxHeight:F;
						A=F*H;
					}else{
						A=E.height;
						F=E.height/H;
					}
				}else{
					if(B._verticalFlow){
						A=E.width*H;
						F=E.width;
					}else{
						if(B._scaleFactorLandscape=="max"){
							A=E.height;
						}else{
							A=E.width*H*B._scaleFactorLandscape;
						}
						A=A>B.maxHeight?B.maxHeight:A;
						F=A/H;
					}
				}
				var C={height:A,width:F};
				return C;
			},positionContent:function(I,A){var C=this.CFobj;var B=this;var F=this.content;var E=F.origProportion;var G=this.calcContentDim(I);if(isNaN(G.height)||isNaN(G.width)){return }var H={};if(C._verticalFlow){H.top=(I.height-G.height)/2}else{H.left=this.Browser.IE6?0:(I.width-G.width)/2}
			switch("top"){
				case "top":
					if(C._verticalFlow){
						H.left=0;
					}else{
						H.top=0;
					}
					break;
				case "center":
				case "middle":
					if(C._verticalFlow){
						H.left=(I.width-G.width)/2;
					}else{
						H.top=(I.height-G.height)/2;
					};
					break;
				case"bottom":
				default:
					if(C._verticalFlow){
						H.left=I.width-G.width;
					}else{
						H.top=I.height-G.height;
					}
					break;
			}
			if(A){
				if(C._reflectionType!="none"&&C._reflectionWithinImage&&!this.Browser.IE){F.style.height=(G.height*(1+C._reflectionHeight))+"px"}else{F.style.height=G.height+"px"}F.style.width=G.width+"px";F.style.marginLeft=H.left+"px";F.style.marginTop=H.top+"px"}else{if(C._reflectionType!="none"&&C._reflectionWithinImage&&!this.Browser.IE){F.style.height=(G.height*(1+C._reflectionHeight)/I.height*100)+"%"}else{if(C.Browser.IE){F.style.height=(G.height/(I.height*(1+C._reflectionHeight))*100)+"%"}else{F.style.height=(G.height/I.height*100)+"%"}}F.style.width=(G.width/I.width*100)+"%";F.style.marginLeft=(H.left/I.width*100)+"%";F.style.marginTop=(H.top/I.height*100)+"%"}if(this.reflection){var D=this.reflection;if(A){D.style.height=(G.height*C._reflectionHeight)+"px"}else{D.style.height=(G.height*C._reflectionHeight/(I.height*(1+C._reflectionHeight))*100)+"%"}D.style.width=F.style.width;D.style.marginLeft=F.style.marginLeft}}};var ContentFlow=function(A,B){if(A){ContentFlowGlobal.Flows.push(this);this.container=A;this._userConf=B?B:{}}else{throw ("ContentFlow ERROR: No flow container node or id given")}};ContentFlow.prototype={_imagesToLoad:0,_activeItem:0,_currentPosition:0,_targetPosition:0,_stepLock:false,_millisecondsPerStep:50,_fileRegEx:/(([^\/?=&]+)\.(\w+)){1}$/,Browser:ContentFlowGlobal.Browser,_defaultConf:{useAddOns:"Array",biggestItemPos:0,loadingTimeout:30000,activeElement:"content",maxItemHeight:0,scaleFactor:0.8,scaleFactorLandscape:1,relativeItemPosition:"center center",contentPosition:"top",circularFlow:true,verticalFlow:false,verticalScrollbar:false,endOpacity:1,visibleItems:-1,startItem:"0",scrollInFrom:"pre",flowSpeedFactor:1,flowDragFriction:1,scrollWheelSpeed:1,keys:{
							37:function(){
								this.moveTo("pre")
							},
							38:function(){
								this.moveTo("visibleNext")
							},
							39:function(){
								this.moveTo("next")
							},
							40:function(){
								this.moveTo("visiblePre")
							},
							13:function(B){
								B = this.getActiveItem();
								
				var A,C;
				if(A=B.content.getAttribute("href")){
					C=B.content.getAttribute("target");
					var D=B.content.getAttribute("rel");
				}else{
					var D = false;
					if(A=B.element.getAttribute("href")){
						C=B.element.getAttribute("target");
					}else{
						if(A=B.content.getAttribute("src")){
							C=B.content.getAttribute("target");
						}
					}
				}
				if(A){
					if(C){
						if(D != "lightbox2"){
							window.open(A,C).focus();
						} else {
							return false;
						}
					}else{
						if(D != "lightbox2"){
							window.location.href=A;
						} else {
							return false;
						}
					}
				}
							}
						},reflectionType:"none",reflectionWithinImage:true,reflectionColor:"transparent",reflectionHeight:0.5,negativeMarginOnFloat:"auto",reflectionServerSrc:"{URLTO}{FILENAME}_reflection.{EXT}",onInit:function(){},onclickInactiveItem:function(A){return},onclickActiveItem:function(B){
				var A,C;
				if(A=B.content.getAttribute("href")){
					C=B.content.getAttribute("target");
					var D=B.content.getAttribute("rel");
				}else{
					var D = false;
					if(A=B.element.getAttribute("href")){
						C=B.element.getAttribute("target");
					}else{
						if(A=B.content.getAttribute("src")){
							C=B.content.getAttribute("target");
						}
					}
				}
				if(A){
					if(C){
						if(D != "lightbox2"){
							window.open(A,C).focus();
						} else {
							return false;
						}
					}else{
						if(D != "lightbox2"){
							window.location.href=A;
						} else {
							return false;
						}
					}
				}},onMakeInactive:function(A){},onMakeActive:function(A){},onReachTarget:function(A){},onMoveTo:function(A){},onclickPreButton:function(A){this.moveToIndex("pre");return Event.stop(A)},onclickNextButton:function(A){this.moveToIndex("next");return Event.stop(A)},calcStepWidth:function(C,B){if(B>this._visibleItems){if(C>0){var A=C-this._visibleItems}else{var A=C+this._visibleItems}}else{if(this._visibleItems>=this.items.length){var A=C/this.items.length}else{var A=C*(this._visibleItems/this.items.length)}}return A},calcSize:function(B,D){var C=B;var G=this._visibleItems;var F=this.maxHeight;var E=F/(Math.abs(C)+1);var A=E;return{width:A,height:E}},calcCoordinates:function(B,D){var C=B;var G=this._visibleItems;var E=this.maxHeight;var F=1-1/Math.exp(Math.abs(C)*0.75);var A=this.Flow.center.x*(1+D*G/(G+1)*F);var H=this.maxHeight;return{x:A,y:H}},calcZIndex:function(A,C,B){return -Math.abs(B)},calcFontSize:function(A,C,B){return B.height/this.maxHeight},calcOpacity:function(A,B){return 1-((1-this._endOpacity)*Math.sqrt(Math.abs(A)/this._visibleItems))}},init:function(){if(this.isInit){return }this._init()},setConfig:function(A){
				if(!A){
					return;
				}
				var E=this._defaultConf;
				for(var F in A){
					if(E[F]=="undefined"){
						continue;
					}
					switch(F){
						case "scrollInFrom":
						case "startItem":
						case "negativeMarginOnFloat":
							if(typeof(A[F])=="number"||typeof(A[F])=="string"){
								this["_"+F]=A[F];
							}
							break;
						default:
							if(typeof (E[F]==A[F])){
								this["_"+F]=A[F];
							}
					}
				}
				switch(this._reflectionColor){
					case "overlay":
						break;
					case this._reflectionColor.search(/#[0-9a-fA-F]{6}/)>=0?this._reflectionColor:this._reflectionColor+"x":this._reflectionColorRGB={hR:this._reflectionColor.slice(1,3),hG:this._reflectionColor.slice(3,5),hB:this._reflectionColor.slice(5,7),iR:parseInt(this._reflectionColor.slice(1,3),16),iG:parseInt(this._reflectionColor.slice(3,5),16),iB:parseInt(this._reflectionColor.slice(5,7),16)}
						break;
					case "none":
					case "transparent":
					default:
						this._reflectionColor="transparent";
						this._reflectionColorRGB={hR:0,hG:0,hB:0,iR:0,iG:0,iB:0};
						break;
					}
					if(this._negativeMarginOnFloat=="none"){
						this._negativeMarginOnFloat=0;
					}
					if(this.items){
					if(this._visibleItems<0){
						this._visibleItems=Math.round(Math.sqrt(this.items.length));
					}
					this._visibleItems=Math.min(this._visibleItems,this.items.length-1);
				}
				if(this._relativeItemPosition){
					var C={x:{left:function(J){return -J.width},center:function(J){return -J.width/2},right:function(J){return 0}},y:{top:function(J){return -J.height},center:function(J){return -J.height/2},bottom:function(J){return 0}}};
					var I=this._relativeItemPosition;
					I=I.replace(/above/,"top").replace(/below/,"bottom");
					var H,G=null;
					H=I.match(/left|right/);
					G=I.match(/top|bottom/);
					c=I.match(/center/);
					if(!H){
						if(c){
							H="center";
						}else{
							H="center";
						}
					}
					if(!G){
						if(c){
							G="center";
						}else{
							G="bottom";
						}
					}
					var D=C.x[H];
					var B=C.y[G];
					this._calcRelativeItemPosition=function(M,L,K){
						var J=D(K);
						var N=B(K);
						return{x:J,y:N};
					};
					this._relativeItemPosition=null;
				}
			},getItem:function(A){return this.items[this._checkIndex(Math.round(A))]},getActiveItem:function(){return this._activeItem},getNumberOfItems:function(){return this.items.length},resize:function(){this._initSizes();this._initStep()},moveToPosition:function(A){if(!this._circularFlow){A=this._checkIndex(A)}this._targetPosition=A;this._onMoveTo(this._getItemByPosition(A));this._initStep()},moveToIndex:function(A){
				this._targetPosition=Math.round(this._getPositionByIndex(this._getIndexByKeyWord(A,this._activeItem.index,!this._circularFlow)));
				this._onMoveTo(this._getItemByPosition(this._targetPosition));
				this._initStep()
			},moveToItem:function(B){var A;if(B.itemIndex){A=B.itemIndex}else{A=B.index}this.moveToIndex(A)},moveTo:function(A){if(typeof A=="object"){this.moveToItem(A)}else{if(isNaN(A)||A==Math.floor(A)){this.moveToIndex(A)}else{this.moveToPosition(A)}}},addItem:function(C,A){if(typeof A=="string"){switch(A){case"first":case"start":A=0;break;case"last":case"end":A=this.itemsLastIndex+1;break;default:A=this._getIndexByKeyWord(A);if(A<this._activeItem.index){A++}}}A=Math.max(A,0);A=Math.min(A,this.itemsLastIndex+1);this.Flow.appendChild(C);item=new ContentFlowItem(this,C,B);this.items.splice(A,0,item);for(var B=A;B<this.items.length;B++){this.items[B].setIndex(B)}this._setLastIndex();if(Math.round(this._getPositionByIndex(A))<=Math.round(this._targetPosition)){this._targetPosition++;if(!this._circularFlow){this._targetPosition=Math.min(this._targetPosition,this.itemsLastIndex)}}if(this._getPositionByIndex(A)<=this._currentPosition){this._currentPosition++;if(!this._circularFlow){this._currentPosition=Math.min(this._currentPosition,this.itemsLastIndex)}}var D=this;window.setTimeout(function(){D._initStep()},10);return A},rmItem:function(B){if(B=="undefined"){B=this._activeItem.index}B=this._getIndexByKeyWord(B);if(!this.items[B]){return null}var A=this.items[B];var F=A.element;var E=A.content;this.items.splice(B,1);for(var C=B;C<this.items.length;C++){this.items[C].setIndex(C)}this._setLastIndex();if(Math.round(this._getPositionByIndex(B))<Math.round(this._targetPosition)){this._targetPosition--;if(!this._circularFlow){this._targetPosition=this._checkIndex(this._targetPosition)}}if(this._getPositionByIndex(B)<this._currentPosition){this._currentPosition--;if(!this._circularFlow){this._currentPosition=this._checkIndex(this._currentPosition)}}this._activeItem=this._getItemByPosition(this._currentPosition);var D=F.parentNode.removeChild(F);var G=this;window.setTimeout(function(){G._initStep()},10);return D},_checkIndex:function(A){A=Math.max(A,0);A=Math.min(A,this.itemsLastIndex);return A},_setLastIndex:function(){this.itemsLastIndex=this.items.length-1},_getItemByIndex:function(A){return this.items[this._checkIndex(A)]},_getItemByPosition:function(A){return this._getItemByIndex(this._getIndexByPosition(A))},_getPositionByIndex:function(B){if(!this._circularFlow){return this._checkIndex(B)}var A=this._getIndexByPosition(this._currentPosition);var C=B-A;if(Math.abs(C)>C+this.items.length){C+=this.items.length}else{if(Math.abs(C)>(Math.abs(C-this.items.length))){C-=this.items.length}}return this._currentPosition+C},_getIndexByPosition:function(A){if(A<0){var C=0}else{var C=1}var B=(Math.round(A)+C)%this.items.length;if(B>0){B-=C}else{if(B<0){B+=this.items.length-C}else{if(A<0){B=0}else{B=this.items.length-1}}}return B},_getIndexByKeyWord:function(B,D,A){if(D){var C=D}else{var C=this._activeItem.index}if(isNaN(B)){switch(B){case"first":case"start":C=0;break;case"last":case"end":C=this.itemsLastIndex;break;case"middle":case"center":C=Math.round(this.itemsLastIndex/2);break;case"right":case"next":C+=1;break;case"left":case"pre":case"previous":C-=1;break;case"visible":case"visiblePre":case"visibleLeft":C-=this._visibleItems;break;case"visibleNext":case"visibleRight":C+=this._visibleItems;break;default:C=C}}else{C=B}if(A!=false){C=this._checkIndex(C)}return C},_init:function(){
				if(typeof (this.container)=="string"){
					var B=document.getElementById(this.container);
					if(B){
						this.container=B;
					}else{
						throw ("ContentFlow ERROR: No element with id '"+this.container+"' found!");
						return;
					}
				}
				$(this.container).addClassName("ContentFlow");
				var A=$(this.container).getChildrenByClassName("contentflow_flow")[0];
				if(!A){
					throw ("ContentFlow ERROR: No element with class 'contentflow_flow' found!");
					return;
				}
				this.Flow=new ContentFlowGUIElement(this,A);
				var K=this.container.getChildrenByClassName("contentflow_scrollbar")[0];
				if(K){
					this.Scrollbar=new ContentFlowGUIElement(this,K);
					var F=this.Scrollbar.getChildrenByClassName("contentflow_slider")[0];
					if(F){
						this.Slider=new ContentFlowGUIElement(this,F);
						var H=this.Slider.getChildrenByClassName("contentflow_position")[0];
						if(H){
							this.Position=new ContentFlowGUIElement(this,H);
						}
					}
				}
				this.setConfig(this._defaultConf);
				this._initAddOns();
				this.setConfig(this._userConf);
				this._initSizes();
				var J=this.Flow.getChildrenByClassName("item");
				this.items=new Array();
				for(var G=0;G<J.length;G++){
					this.items[G]=new ContentFlowItem(this,J[G],G);
				}
				this.items[0].makeActive();
				this._activeItem=this.items[0];
				this._setLastIndex();
				this._initGUI();
				if(this._activeElement!="content"){
					this._activeElement="element";
				}
				if(this._visibleItems<0){
					this._visibleItems=Math.round(Math.sqrt(this.items.length));
				}
				this._visibleItems=Math.min(this._visibleItems,this.items.length-1);
				this._targetPosition=this._getIndexByKeyWord(this._startItem);
				var I=this._getIndexByKeyWord(this._scrollInFrom,this._targetPosition);
				switch(this._scrollInFrom){
					case"next":
						I-=0.5;
						break;
					case"pre":
						I+=0.5;
						break;
				}
				this._currentPosition=I;
				this._activeItem=this.getItem(I);
				this._activeItem.makeActive();
				var E=new Date();
				var D=this;
				var C=window.setInterval(function(){
					if(D._imagesToLoad==0||new Date()-E>D._loadingTimeout){
						clearInterval(C);
						D.Flow.style.visibility="visible";
						if(D.loadIndicator){
							D.loadIndicator.style.display="none";
						}
						if(D.Scrollbar){
							D.Scrollbar.style.visibility="visible";
						}
						if(D.Browser.WebKit){
							D.resize();
						}else{
							D._initStep();
						}
						D._onInit();
					}
				},10);
				this.isInit=true;
			},_initAddOns:function(){
							var C=[];
							if(this._userConf.useAddOns){
								if(typeof this._userConf.useAddOns=="string"){
									C=this._userConf.useAddOns.split(" ")
								}else{
									if(typeof this._userConf.useAddOns=="array"){
										C=this._userConf.useAddOns
									}
								}
							}else{
								if(this.container.getAttribute("useAddOns")){
									C=this.container.getAttribute("useAddOns").split(" ")
								}else{
									C=this._useAddOns.split(" ")
								}
							}
							for(var B=0;B<C.length;B++){
								if(C[B]=="none"){
									C=new Array();
									break
								}else{
									if(C[B]=="all"){
										C=new Array();
										for(var A in ContentFlowGlobal.AddOns){
											C.push(A)
										}
										break
									}
								}
							}
							for(var B=0;B<C.length;B++){
								var A=ContentFlowGlobal.AddOns[C[B]];
								if(A){
									A._init(this);
									this.container.addClassName("addon"+A.name);
									if(A.methods.onloadInit){
										A.methods.onloadInit(this)
									}
								}
							}
						},_initGUI:function(){var B=this.resize.bind(this);window.addEvent("resize",B,false);var J=this.container.getElementsByTagName("div");for(var F=0;F<J.length;F++){if($(J[F]).hasClassName("preButton")){var E=J[F];var A=this._onclickPreButton.bind(this);E.addEvent("click",A,false)}else{if(J[F].hasClassName("nextButton")){var H=J[F];var A=this._onclickNextButton.bind(this);H.addEvent("click",A,false)}}}if(this._scrollWheelSpeed!=0){var I=this._wheel.bind(this);if(window.addEventListener){this.container.addEventListener("DOMMouseScroll",I,false)}this.container.onmousewheel=I}var K=this._keyStroke.bind(this);if(this._keys&&!this.Browser.iPhone){if(document.addEventListener){if(!this.Browser.Opera){var C=document.createElement("div");C.addClassName("mouseoverCheckElement");this.container.appendChild(C);if(this.Browser.WebKit){document.body.addEvent("keydown",function(N){if(C.offsetLeft>0){K(N)}})}else{window.addEvent("keydown",function(N){if(C.offsetLeft>0){K(N)}})}}else{this.container.addEvent("keydown",K)}}else{this.container.onkeydown=K}}if(this._flowDragFriction>0){var D=function(Q){var P=Q.clientX;var O=Q.clientY;if(this._verticalFlow){var T=O-this.Flow.mouseY;var S=this.Flow.dimensions.height}else{var T=P-this.Flow.mouseX;var S=this.Flow.dimensions.width}var N=(T/S)*(2*this._visibleItems+1);var R=this._currentPosition-N*2*this._visibleItems/this._flowDragFriction;this.Flow.mouseX=P;this.Flow.mouseY=O;this.moveToPosition(R)}.bind(this);var M=function(){};var G=function(O){var N=Math.round(this._targetPosition);if(Math.abs(N-this._currentPosition)>0.001){this.moveToPosition(N)}}.bind(this);this.Flow.makeDraggable(D,M,G)}if(this.Scrollbar){var L=function(Q){if(!Q){var Q=window.event}if(!this.Scrollbar.clickLocked){var P=Q.clientX;var O=P-this.Scrollbar.position.left;var N=Math.round(O/this.Scrollbar.dimensions.width*this.itemsLastIndex);this.moveToIndex(N)}else{this.Scrollbar.clickLocked=false}}.bind(this);this.Scrollbar.addObserver("click",L)}if(this.Slider){this.Slider.setPosition=function(N){N=N-Math.floor(N)+this._getIndexByPosition(Math.floor(N));if(Math.round(N)<0){N=this.itemsLastIndex}else{if(N<=0){N=0}else{if(Math.round(N)>this.itemsLastIndex){N=0}else{if(N>=this.itemsLastIndex){N=this.itemsLastIndex}}}}if(this.items.length>1){var O=(N/this.itemsLastIndex)*this.Scrollbar.dimensions.width}else{var O=0.5*this.Scrollbar.dimensions.width}this.Slider.style.left=O-this.Slider.center.x+"px";this.Slider.style.top=this.Scrollbar.center.y-this.Slider.center.y+"px"}.bind(this);var M=function(N){this.Scrollbar.clickLocked=true}.bind(this);var D=function(O){var N=this._checkIndex((O.clientX-this.Scrollbar.position.left)/this.Scrollbar.dimensions.width*this.itemsLastIndex);this._targetPosition=this._getPositionByIndex(N);this.Slider.setPosition(N);if(this.Position){this.Position.setLabel(N)}this._initStep(true)}.bind(this);var G=function(N){this._targetPosition=Math.round(this._targetPosition);this._onMoveTo(this._getItemByPosition(this._targetPosition));this._initStep(true)}.bind(this);this.Slider.makeDraggable(D,M,G)}if(this.Position){this.Position.setLabel=function(N){N=this._checkIndex(Math.round(N));if(this.items&&this.items[N].label){this.Position.innerHTML=this.items[N].label.innerHTML}else{this.Position.innerHTML=N+1}this.Position.style.left=(this.Slider.dimensions.width-this.Position.clientWidth)/2+"px"}.bind(this)}this.globalCaption=this.container.getChildrenByClassName("contentflow_globalCaption")[0];this.loadIndicator=this.container.getChildrenByClassName("contentflow_loadIndicator")[0]},_initSizes:function(){if(this._verticalFlow){if(this.containerOldHeight){this.container.style.width=this.containerOldHeight}if(this.FlowOldHeight){this.Flow.style.width=this.FlowOldHeight}}else{if(this.containerOldHeight){this.container.style.height=this.containerOldHeight}if(this.FlowOldHeight){this.Flow.style.height=this.FlowOldHeight}}this.containerOldHeight="auto";this.FlowOldHeight="auto";if(this._maxItemHeight<=0){if(this._verticalFlow){this.maxHeight=this.Flow.clientHeight/3*screen.width/screen.height*this._scaleFactor;if(this.maxHeight==0||this.maxHeight>this.Flow.clientWidth){this.maxHeight=this.Flow.clientWidth}if(this.container.style.width&&this.container.style.width!="auto"){this.maxHeight=this.container.clientWidth/this._scaleFactor;this.containerOldHeight=this.container.style.width}if(this.Flow.style.width&&this.Flow.style.width!="auto"){this.maxHeight=this.Flow.clientWidth/this._scaleFactor;this.FlowOldHeight=this.Flow.style.width}}else{this.maxHeight=this.Flow.clientWidth/3*screen.height/screen.width*this._scaleFactor;if(this.container.style.height&&this.container.style.height!="auto"){this.maxHeight=this.container.clientHeight/(this._scaleFactor*(this._reflectionType!="none"?1+this._reflectionHeight:1));this.containerOldHeight=this.container.style.height}else{if(this.Flow.style.height&&this.Flow.style.height!="auto"){this.maxHeight=this.Flow.clientHeight/(this._scaleFactor*(this._reflectionType!="none"?1+this._reflectionHeight:1));this.FlowOldHeight=this.Flow.style.height}}}}else{this.maxHeight=this._maxItemHeight}if(this.Scrollbar){this.Scrollbar.setDimensions();var A=this.Scrollbar.dimensions.height;if(this.Slider){this.Slider.setDimensions();A+=this.Slider.dimensions.height;if(this.Position){if(this.Position.innerHTML==""){this.Position.innerHTML="&nbsp;"}this.Position.setDimensions();var C=this.Position.position.top-this.Slider.position.top;if(C>0){C+=-this.Scrollbar.dimensions.height+this.Position.dimensions.height;this.Scrollbar.style.marginBottom=C+"px"}else{C*=-1;this.Scrollbar.style.marginTop=C+"px"}A+=C}}if(this.container.style.height&&this.container.style.height!="auto"){this.maxHeight-=A}}var B=this._calcSize(this._biggestItemPos,0);if(this._reflectionType!="none"){if(this._verticalFlow){this.Flow.style.width=B.width+"px";this.Flow.style.height=3*B.width*(1+this._reflectionHeight)+"px"}else{this.Flow.style.height=B.height*(1+this._reflectionHeight)+"px"}if(typeof (this._negativeMarginOnFloat)=="number"){this.Flow.style.marginBottom=-B.height*(this._reflectionHeight*this._negativeMarginOnFloat)+"px"}else{this.Flow.style.marginBottom=-B.height*this._reflectionHeight+"px"}this.Flow.dimensions=this.Flow.getDimensions();if(this.container.clientHeight<this.Flow.dimensions.height){this.container.style.height=this.Flow.dimensions.height+"px"}}else{if(this._verticalFlow){this.Flow.style.width=B.width+"px";this.Flow.style.height=3*B.width+"px"}else{this.Flow.style.height=B.height+"px"}this.Flow.style.marginBottom="0"}this.Flow.dimensions=this.Flow.getDimensions();if(this._verticalFlow){this.Flow.center={x:this.Flow.dimensions.height/2,y:B.width/2}}else{this.Flow.center={x:this.Flow.dimensions.width/2,y:B.height/2}}},_keyStroke:function(A){
							if(!A){
								var A=window.event
							}
							if(A.which){
								var B=A.which
							}else{
								if(A.keyCode){
									var B=A.keyCode
								}
							}
							if(this._keys[B]){
								this._keys[B].bind(this)();
								return Event.stop(A)
							}else{
								return true
							}
						},_wheel:function(A){if(!A){var A=window.event}var C=0;if(A.wheelDelta){C=A.wheelDelta/120}else{if(A.detail){C=-A.detail/3}}if(C){var B=this._targetPosition;if(C<0){B+=(1*this._scrollWheelSpeed)}else{B-=(1*this._scrollWheelSpeed)}this.moveToPosition(Math.round(B))}return Event.stop(A)},_setGlobalCaption:function(){if(this.globalCaption){this.globalCaption.innerHTML="";if(this._activeItem.caption){this.globalCaption.appendChild(this._activeItem.caption.cloneNode(true))}}},_initStep:function(A){
				if(this.Slider){
					if(A){
						this.Slider.locked=true;
					}else{
						this.Slider.locked=false;
					}
				}
				if(!this._stepLock){
					this._stepLock=true;
					this._step();
				}
			},_step:function(){
				var D=this._targetPosition-this._currentPosition;
				var C=Math.abs(D);
				if(C>0.001){
					this._currentPosition+=this._flowSpeedFactor*this._calcStepWidth(D,C);
					var A=this.items[(this._getIndexByPosition(this._currentPosition))];
					if(A!=this._activeItem){
						this._activeItem.makeInactive();
						this._activeItem=A;
						this._activeItem.makeActive();
						if(this.Position&&!this.Slider.locked){
							this.Position.setLabel(this._activeItem.index);
						}
						this._setGlobalCaption();
					}
					this._positionItems();
					var B=this._step.bind(this);
					setTimeout(B,this._millisecondsPerStep)
				}else{
					if(this.Slider){
						this.Slider.locked=false;
					}
					this._currentPosition=Math.round(this._currentPosition);
					if(this.Position&&!this.Slider.locked){
						this.Position.setLabel(this._activeItem.index);
					}
					this._setGlobalCaption();
					this._positionItems();
					this._stepLock=false;
					this._onReachTarget(this._activeItem);
				}
				if(this.Slider&&!this.Slider.locked){
					this.Slider.setPosition(this._currentPosition);
				}
			},_positionItems:function(){
				var A=this._currentPosition-this._visibleItems;
				var D=this._currentPosition+this._visibleItems;
				if(!this._circularFlow){
					A=this._checkIndex(A);
					D=this._checkIndex(D);
				}
				for(var E=0;E<this.items.length;E++){
					var B=this._getPositionByIndex(E);
					var K=this.items[E];var J=this.items[E].element;J.style.display="none";if(B<A||B>D){continue}var N=Math.round(B-this._currentPosition);var C=Math.round(B)-this._currentPosition;var F=C<0?-1:1;F*=C==0?0:1;var M=this._calcSize(C,F);var I=this._calcCoordinates(C,F);var H=this._calcRelativeItemPosition(C,F,M);var G=this._calcZIndex(C,F,N);var L=this._calcFontSize(C,F,M);if(this._verticalFlow){J.style.left=I.y+H.y*M.width/M.height+"px";J.style.top=I.x+H.x*M.height/M.width+"px"}else{J.style.left=I.x+H.x+"px";J.style.top=I.y+H.y+"px"}if(this.Browser.IE){J.style.height=M.height*(1+this._reflectionHeight)+"px"}else{J.style.height=M.height+"px"}J.style.width=M.width+"px";if((this.Browser.iPhone||this.Browser.IE6||this.Browser.Konqueror4)&&(this.items[E].image||this._reflectionWithinImage)){K.positionContent(M,this.Browser.IE6)}J.style.zIndex=32768+G;J.style.visibility="visible";J.style.display="block"}}};if(!Function.bind){Function.prototype.bind=function(A){var B=this;return function(){return B.apply(A,arguments)}}}if(!Math.erf2){Math.erf2=function(A){var B=-(8*(Math.PI-3)/(3*Math.PI*(Math.PI-4)));var C=A*A;var D=1-Math.pow(Math.E,-C*(4/Math.PI+B*C)/(1+B*C));return D}}if(!Math._2PI05){Math._2PI05=Math.sqrt(2*Math.PI)}if(!Math.normDist){Math.normDist=function(A,C,B){if(!C){var C=1}if(!B){var B=0}if(!A){var A=-B}return 1/(C*Math._2PI05)*Math.pow(Math.E,-(A-B)*(A-B)/(2*C*C))}}if(!Math.normedNormDist){Math.normedNormDist=function(A,C,B){return this.normDist(A,C,B)/this.normDist(B,C,B)}}if(!Math.exp){Math.exp=function(A){return Math.pow(Math.E,A)}}if(!Math.ln){Math.ln=Math.log}if(!Math.log2){Math.log2=function(A){return Math.log(A)/Math.LN2}}if(!Math.log10){Math.log10=function(A){return Math.log(A)/Math.LN10}}if(!Math.logerithm){Math.logerithm=function(B,A){if(!A||A==Math.E){return Math.log(B)}else{if(A==2){return Math.log2(B)}else{if(A==10){return Math.log10(B)}else{return Math.log(B)/Math.log(A)}}}}}if(!Event){var Event={}}if(!Event.stop){Event.stop=function(A){A.cancelBubble=true;if(A.preventDefault){A.preventDefault()}if(A.stopPropagation){A.stopPropagation()}return false}}if(document.all&&!window.opera){window._$=function(A){if(typeof A=="string"){return window._$(document.getElementById(A))}else{if(CFElement.prototype.extend&&A&&!A.extend){CFElement.prototype.extend(A)}}return A}}else{window._$=function(A){return A}}if(!window.HTMLElement){CFElement={};CFElement.prototype={};CFElement.prototype.extend=function(A){for(var B in this){if(!A[B]){A[B]=this[B]}}}}else{CFElement=window.HTMLElement}if(!CFElement.findPos){CFElement.prototype.findPos=function(){var A=this;var B=curtop=0;if(A.offsetParent){B=A.offsetLeft;curtop=A.offsetTop;while(A=A.offsetParent){B+=A.offsetLeft;curtop+=A.offsetTop}}return{left:B,top:curtop}}}if(!CFElement.getDimensions){
			CFElement.prototype.getDimensions=function(){
				return{width:this.clientWidth,height:this.clientHeight}
				
			}
			}
			if(!CFElement.hasClassName){
				CFElement.prototype.hasClassName=function(A){
					return(new RegExp("\\b"+A+"\\b").test(this.className));
				}
			}
			if(!CFElement.addClassName){
				CFElement.prototype.addClassName=function(A){
					if(!this.hasClassName(A)){
						this.className+=(this.className?" ":"")+A;
					}
				}
			}
			if(!CFElement.removeClassName){
				CFElement.prototype.removeClassName=function(A){
					this.className=this.className.replace(new RegExp("\\b"+A+"\\b"),"").replace(/\s\s/g," ");
				}
			}
			if(!CFElement.toggleClassName){CFElement.prototype.toggleClassName=function(A){if(this.hasClassName(A)){this.removeClassName(A)}else{this.addClassName(A)}}}if(!CFElement.getChildrenByClassName){CFElement.prototype.getChildrenByClassName=function(C){var B=new Array();for(var A=0;A<this.childNodes.length;A++){var D=this.childNodes[A];if(D.nodeType==1&&$(D).hasClassName(C)){B.push(D)}}return B}}if(!CFElement.addEvent){CFElement.prototype.addEvent=function(B,C,A){if(this.addEventListener){this.addEventListener(B,C,A)}else{this.attachEvent("on"+B,C)}}}if(!CFElement.removeEvent){CFElement.prototype.removeEvent=function(B,C,A){if(this.removeEventListener){this.removeEventListener(B,C,A)}else{this.detachEvent("on"+B,C)}}}if(!window.addEvent){window.addEvent=function(B,C,A){if(this.addEventListener){this.addEventListener(B,C,A)}else{if(B!="load"&&B!="resize"){document.attachEvent("on"+B,C)}else{this.attachEvent("on"+B,C)}}}}if(!window.removeEvent){window.removeEvent=function(B,C,A){if(this.removeEventListener){this.removeEventListener(B,C,A)}else{if(B!="load"&&B!="resize"){document.detachEvent("on"+B,C)}else{this.detachEvent("on"+B,C)}}}}ContentFlowGlobal.init();
