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(e){var d=new RegExp(e);
var a=document.getElementsByTagName("script");
for(var b=0;
b<a.length;
b++){if(a[b].src&&d.test(a[b].src)){return a[b]
}}return""
},getScriptPath:function(d,b){var a=new RegExp(b+".*");
return d.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(d,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(d,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");
this.addStylesheet(this.CSSBaseDir+"mycontentflow.css");
if(this.scriptElement.getAttribute("load")){var AddOns=this.scriptElement.getAttribute("load").replace(/\ +/g," ").split(" ");
for(var i=0;
i<AddOns.length;
i++){if(AddOns[i]==""){continue
}this.addScript(this.AddOnBaseDir+"ContentFlowAddOn_"+AddOns[i]+".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)
}
/*@cc_on @*/
/*@if (@_win32)
        document.write("<script id=__ie_cf_onload defer src=javascript:void(0)><\/script>");
        var script = document.getElementById("__ie_cf_onload");
        script.onreadystatechange = function() {
            if (this.readyState == "complete") {
                CFG.onloadInit(); // call the onload handler
            }
        };
        /*@end @*/
}window.addEvent("load",CFG.onloadInit,false)
},initForCmsbox:function(){ContentFlowGlobal.initPath();
if(arguments.callee.done){return
}arguments.callee.done=true;
ContentFlowGlobal.Flows=new Array();
if(window.$&&typeof Prototype!="undefined"&&document.all&&!window.opera){var b=window.$;
window.$=function(d){return b(window._$(d))
}
}else{if(!window.$){window.$=window._$
}}for(var a=0;
a<ContentFlowGlobal.Flows.length;
a++){ContentFlowGlobal.Flows[a].init()
}},onloadInit:function(){if(arguments.callee.done){return
}arguments.callee.done=true;
if(window.Element&&document.all&&!window.opera){for(var g in window.CFElement.prototype){if(!window.Element.prototype[g]){window.Element.prototype[g]=window.CFElement.prototype[g]
}}}if(window.$&&typeof Prototype!="undefined"&&document.all&&!window.opera){var f=window.$;
window.$=function(h){return f(window._$(h))
}
}else{if(!window.$){window.$=window._$
}}for(var b=0;
b<ContentFlowGlobal.Flows.length;
b++){ContentFlowGlobal.Flows[b].init()
}var d=document.getElementsByTagName("div");
DIVS:for(var b=0;
b<d.length;
b++){if(d[b].className.match(/\bContentFlow\b/)){for(var a=0;
a<ContentFlowGlobal.Flows.length;
a++){if(d[b]==ContentFlowGlobal.Flows[a].container){continue DIVS
}}var e=new ContentFlow(d[b],{},false);
e.init()
}}}};
ContentFlowGlobal.initPath();
var ContentFlowAddOn=function(b,a,d){if(typeof d=="undefined"||d!=false){ContentFlowGlobal.AddOns[b]=this
}this.name=b;
if(!a){a={}
}this.methods=a;
this.scriptpath=ContentFlowGlobal.AddOnBaseDir;
if(a.init){var e=a.init.bind(this);
e(this)
}};
ContentFlowAddOn.prototype={Browser:ContentFlowGlobal.Browser,addScript:ContentFlowGlobal.addScript,addScripts:ContentFlowGlobal.addScripts,addStylesheet:function(a){if(!a){a=this.scriptpath+"ContentFlowAddOn_"+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:this.dimensions.width/2,y:this.dimensions.height/2};
this.position=this.findPos()
};
b.addObserver=function(e,f){var d=this.eventMethod=f.bind(a);
this.observedEvent=e;
this.addEvent(e,d,false)
};
b.makeDraggable=function(f,e,g){this.stopDrag=function(h){if(!h){var h=window.event
}window.removeEvent("mousemove",f,false);
g(h)
}.bind(this);
this.startDrag=function(i){if(!i){var i=window.event
}this.mouseX=i.clientX;
this.mouseY=i.clientY;
e(i);
window.addEvent("mousemove",f,false);
var h=this.stopDrag;
window.addEvent("mouseup",h,false)
}.bind(this);
var d=this.startDrag;
this.addEvent("mousedown",d,false)
};
$(b).setDimensions();
return b
};
var ContentFlowItem=function(a,d,b){this.CFobj=a;
this._activeElement=a._activeElement;
this.clickInactiveItem=function(i){if(!i){var i=window.event
}var h=i.target?i.target:i.srcElement;
var g=h.itemIndex?h.itemIndex:h.parentNode.itemIndex;
this.moveToIndex(g);
this._onclickInactiveItem(this.items[g])
}.bind(a);
this.clickActiveItem=function(i){if(!i){var i=window.event
}var h=i.target?i.target:i.srcElement;
var g=h.itemIndex?h.itemIndex:h.parentNode.itemIndex;
this._onclickActiveItem(this.items[g])
}.bind(a);
this.setIndex=function(g){this.index=g;
this.element.itemIndex=g
};
this.getIndex=function(){return this.index
};
this.element=$(d);
this.item=d;
if(typeof b!="undefined"){this.setIndex(b)
}this.content=this.element.getChildrenByClassName("content")[0];
this.caption=this.element.getChildrenByClassName("caption")[0];
this.label=this.element.getChildrenByClassName("label")[0];
this.initClickInactive();
if(this.content.nodeName=="IMG"){a._imagesToLoad++;
var f=function(){a._imagesToLoad--;
this.image=this.content;
this.setImageFormat(this.image);
if(a._reflectionType!="none"){this.addReflection()
}else{var g=a._calcSize(0,0);
this.positionContent(g)
}};
var e=f.bind(this);
if(this.content.complete&&this.content.width>0){e()
}else{this.content.onload=e
}}};
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 d=this.clickInactiveItem;
if(window.addEventListener){this[this._activeElement].removeEvent("click",b,false)
}else{this[this._activeElement].onclick=d
}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 g=this.CFobj;
var w;
var o=this.content;
if(g._reflectionType=="serverside"){var l=g._fileRegEx.exec(o.src);
var t=o.src.replace(new RegExp(l[1]+"$"),"");
var j=g._reflectionServerSrc;
j=j.replace(/\{URLTO\}/,t);
j=j.replace(/\{FILE\}/,l[1]);
j=j.replace(/\{FILENAME\}/,l[2]);
j=j.replace(/\{EXT\}/,l[3]);
w=this.reflection=document.createElement("img");
w.src=j
}else{if(this.Browser.IE){var u="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
if(g._reflectionColorRGB){if(g._reflectionColor=="transparent"){var r=w=this.reflection=document.createElement("img");
w.src=o.src
}else{w=this.reflection=document.createElement("div");
var r=document.createElement("img");
r.src=o.src;
w.width=r.width;
w.height=r.height;
r.style.width="100%";
r.style.height="100%";
var q=g._reflectionColorRGB;
w.style.backgroundColor="#"+q.hR+q.hG+q.hB;
w.appendChild(r)
}u+=" progid:DXImageTransform.Microsoft.Alpha(opacity=0, finishOpacity=50, style=1, finishX=0, startY="+g._reflectionHeight*100+" finishY=0)"
}else{var r=w=this.reflection=document.createElement("img");
w.src=o.src
}u+=" progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22="+1/g._reflectionHeight+")";
r.style.filter=u
}else{if(g._reflectionWithinImage){var e=this.canvas=$(document.createElement("canvas"))
}else{var e=w=this.reflection=document.createElement("canvas")
}if(e.getContext){if(g._reflectionWithinImage){for(var v=0;
v<o.attributes.length;
v++){e.setAttributeNode(o.attributes[v].cloneNode(true))
}}var d=e.getContext("2d");
if(g._reflectionWithinImage){if(o.height>g.maxHeight){var n=g.maxHeight;
var p=g.maxHeight/o.origProportion
}else{var n=o.height;
var p=o.width
}e.width=p;
e.height=n;
this.setImageFormat(e);
e.height=n*(1+g._reflectionHeight)
}else{e.width=p;
e.height=n*g._reflectionHeight
}d.save();
if(g._reflectionWithinImage){d.drawImage(o,0,0,p,n)
}if(g._reflectionWithinImage){var s=n*2-1
}else{var s=o.height-1
}d.translate(0,s);
d.scale(1,-1);
d.drawImage(o,0,0,p,n);
d.restore();
if(g._reflectionColorRGB){var b=d.createLinearGradient(0,0,0,e.height);
var f=[0,0.5,1];
if(g._reflectionColor=="transparent"){d.globalCompositeOperation="destination-in";
f=[1,0.5,0]
}var h=g._reflectionColorRGB.iR;
var k=g._reflectionColorRGB.iG;
var a=g._reflectionColorRGB.iB;
if(g._reflectionWithinImage){b.addColorStop(0,"rgba("+h+","+k+","+a+","+f[0]+")");
b.addColorStop(n/e.height,"rgba("+h+","+k+","+a+","+f[0]+")");
b.addColorStop(n/e.height,"rgba("+h+","+k+","+a+","+f[1]+")")
}else{b.addColorStop(0,"rgba("+h+","+k+","+a+","+f[1]+")")
}b.addColorStop(1,"rgba("+h+","+k+","+a+","+f[2]+")");
d.fillStyle=b;
d.fillRect(0,0,e.width,e.height)
}if(g._reflectionWithinImage){o.parentNode.replaceChild(e,o);
this.content=e;
this.origContent=e;
this.initClickInactive();
delete this.image
}}else{g._reflectionWithinImage=false;
delete this.reflection
}}}if(w){w.className="reflection";
this.element.appendChild(w);
if(this.caption){this.element.appendChild(this.caption)
}}var m=g._calcSize(0,0);
this.positionContent(m)
},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(f){var b=this.CFobj;
var e=this;
var h=this.content;
var i=h.origProportion;
var g,a;
if(i>=1){if(b._verticalFlow){if(b._scaleFactorLandscape=="max"){var g=f.width
}else{var g=f.height/i*b._scaleFactorLandscape
}g=g>b.maxHeight?b.maxHeight:g;
a=g*i
}else{a=f.height;
g=f.height/i
}}else{if(b._verticalFlow){a=f.width*i;
g=f.width
}else{if(b._scaleFactorLandscape=="max"){a=f.height
}else{a=f.width*i*b._scaleFactorLandscape
}a=a>b.maxHeight?b.maxHeight:a;
g=a/i
}}var d={height:a,width:g};
return d
},positionContent:function(j,a){var d=this.CFobj;
var b=this;
var g=this.content;
var f=g.origProportion;
var h=this.calcContentDim(j);
if(isNaN(h.height)||isNaN(h.width)){return
}var i={};
if(d._verticalFlow){i.top=(j.height-h.height)/2
}else{i.left=this.Browser.IE6?0:(j.width-h.width)/2
}switch(d._contentPosition){case"top":if(d._verticalFlow){i.left=0
}else{i.top=0
}break;
case"center":case"middle":if(d._verticalFlow){i.left=(j.width-h.width)/2
}else{i.top=(j.height-h.height)/2
}break;
case"bottom":default:if(d._verticalFlow){i.left=j.width-h.width
}else{i.top=j.height-h.height
}}if(a){if(d._reflectionType!="none"&&d._reflectionWithinImage&&!this.Browser.IE){g.style.height=(h.height*(1+d._reflectionHeight))+"px"
}else{g.style.height=h.height+"px"
}g.style.width=h.width+"px";
g.style.marginLeft=i.left+"px";
g.style.marginTop=i.top+"px"
}else{if(d._reflectionType!="none"&&d._reflectionWithinImage&&!this.Browser.IE){g.style.height=(h.height*(1+d._reflectionHeight)/j.height*100)+"%"
}else{if(d.Browser.IE){g.style.height=(h.height/(j.height*(1+d._reflectionHeight))*100)+"%"
}else{g.style.height=(h.height/j.height*100)+"%"
}}g.style.width=(h.width/j.width*100)+"%";
g.style.marginLeft=(i.left/j.width*100)+"%";
g.style.marginTop=(i.top/j.height*100)+"%"
}if(this.reflection){var e=this.reflection;
if(a){e.style.height=(h.height*d._reflectionHeight)+"px"
}else{e.style.height=(h.height*d._reflectionHeight/(j.height*(1+d._reflectionHeight))*100)+"%"
}e.style.width=g.style.width;
e.style.marginLeft=g.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:"all",biggestItemPos:0,loadingTimeout:30000,activeElement:"content",maxItemHeight:0,scaleFactor:1,scaleFactorLandscape:1,relativeItemPosition:"top center",contentPosition:"bottom",circularFlow:true,verticalFlow:false,verticalScrollbar:false,endOpacity:1,visibleItems:-1,startItem:"center",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")
}},reflectionType:"clientside",reflectionWithinImage:true,reflectionColor:"transparent",reflectionHeight:0.5,negativeMarginOnFloat:"auto",reflectionServerSrc:"{URLTO}{FILENAME}_reflection.{EXT}",onInit:function(){},onclickInactiveItem:function(a){},onclickActiveItem:function(b){var a,d;
if(a=b.content.getAttribute("href")){d=b.content.getAttribute("target")
}else{if(a=b.element.getAttribute("href")){d=b.element.getAttribute("target")
}else{if(a=b.content.getAttribute("src")){d=b.content.getAttribute("target")
}}}if(b.content.getAttribute("onclick")||b.element.getAttribute("onclick")){return false
}if(a){if(d){window.open(a,d).focus()
}else{window.location.href=a
}}},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(d,b){if(b>this._visibleItems){if(d>0){var a=d-this._visibleItems
}else{var a=d+this._visibleItems
}}else{if(this._visibleItems>=this.items.length){var a=d/this.items.length
}else{var a=d*(this._visibleItems/this.items.length)
}}return a
},calcSize:function(b,e){var d=b;
var i=this._visibleItems;
var g=this.maxHeight;
var f=g/(Math.abs(d)+1);
var a=f;
return{width:a,height:f}
},calcCoordinates:function(b,e){var d=b;
var i=this._visibleItems;
var g=this.maxHeight;
var h=1-1/Math.exp(Math.abs(d)*0.75);
var a=this.Flow.center.x*(1+e*i/(i+0.25)*h);
var j=this.maxHeight;
return{x:a,y:j}
},calcZIndex:function(a,d,b){return -Math.abs(b)
},calcFontSize:function(a,d,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 f=this._defaultConf;
for(var g in a){if(f[g]=="undefined"){continue
}switch(g){case"scrollInFrom":case"startItem":case"negativeMarginOnFloat":if(typeof(a[g])=="number"||typeof(a[g])=="string"){this["_"+g]=a[g]
}break;
default:if(typeof(f[g]==a[g])){this["_"+g]=a[g]
}}}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 d={x:{left:function(k){return -k.width
},center:function(k){return -k.width/2
},right:function(k){return 0
}},y:{top:function(k){return -k.height
},center:function(k){return -k.height/2
},bottom:function(k){return 0
}}};
var j=this._relativeItemPosition;
j=j.replace(/above/,"top").replace(/below/,"bottom");
var i,h=null;
i=j.match(/left|right/);
h=j.match(/top|bottom/);
c=j.match(/center/);
if(!i){if(c){i="center"
}else{i="center"
}}if(!h){if(c){h="center"
}else{h="bottom"
}}var e=d.x[i];
var b=d.y[h];
this._calcRelativeItemPosition=function(n,m,l){var k=e(l);
var o=b(l);
return{x:k,y:o}
};
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(d,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(d);
item=new ContentFlowItem(this,d,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 e=this;
window.setTimeout(function(){e._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 g=a.element;
var f=a.content;
this.items.splice(b,1);
for(var d=b;
d<this.items.length;
d++){this.items[d].setIndex(d)
}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 e=g.parentNode.removeChild(g);
var h=this;
window.setTimeout(function(){h._initStep()
},10);
return e
},_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 d=b-a;
if(Math.abs(d)>d+this.items.length){d+=this.items.length
}else{if(Math.abs(d)>(Math.abs(d-this.items.length))){d-=this.items.length
}}return this._currentPosition+d
},_getIndexByPosition:function(a){if(a<0){var d=0
}else{var d=1
}var b=(Math.round(a)+d)%this.items.length;
if(b>0){b-=d
}else{if(b<0){b+=this.items.length-d
}else{if(a<0){b=0
}else{b=this.items.length-1
}}}return b
},_getIndexByKeyWord:function(b,e,a){if(e){var d=e
}else{var d=this._activeItem.index
}if(isNaN(b)){switch(b){case"first":case"start":d=0;
break;
case"last":case"end":d=this.itemsLastIndex;
break;
case"middle":case"center":d=Math.round(this.itemsLastIndex/2);
break;
case"right":case"next":d+=1;
break;
case"left":case"pre":case"previous":d-=1;
break;
case"visible":case"visiblePre":case"visibleLeft":d-=this._visibleItems;
break;
case"visibleNext":case"visibleRight":d+=this._visibleItems;
break;
default:d=d
}}else{d=b
}if(a!=false){d=this._checkIndex(d)
}return d
},_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("flow")[0];
if(!a){throw ("ContentFlow ERROR: No element with class'flow' found!");
return
}this.Flow=new ContentFlowGUIElement(this,a);
var m=this.container.getChildrenByClassName("scrollbar")[0];
if(m){this.Scrollbar=new ContentFlowGUIElement(this,m);
var g=this.Scrollbar.getChildrenByClassName("slider")[0];
if(g){this.Slider=new ContentFlowGUIElement(this,g);
var j=this.Slider.getChildrenByClassName("position")[0];
if(j){this.Position=new ContentFlowGUIElement(this,j)
}}}this.setConfig(this._defaultConf);
this._initAddOns();
this.setConfig(this._userConf);
this._initSizes();
var l=this.Flow.getChildrenByClassName("item");
this.items=new Array();
for(var h=0;
h<l.length;
h++){this.items[h]=new ContentFlowItem(this,l[h],h)
}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 k=this._getIndexByKeyWord(this._scrollInFrom,this._targetPosition);
switch(this._scrollInFrom){case"next":k-=0.5;
break;
case"pre":k+=0.5;
break
}this._currentPosition=k;
this._activeItem=this.getItem(k);
this._activeItem.makeActive();
var f=new Date();
var e=this;
var d=window.setInterval(function(){if(e._imagesToLoad==0||new Date()-f>e._loadingTimeout){clearInterval(d);
e.Flow.style.visibility="visible";
if(e.loadIndicator){e.loadIndicator.style.display="none"
}if(e.Scrollbar){e.Scrollbar.style.visibility="visible"
}if(e.Browser.WebKit){e.resize()
}else{e._initStep()
}e._onInit()
}},10);
this.isInit=true
},_initAddOns:function(){var d=[];
if(this._userConf.useAddOns){if(typeof this._userConf.useAddOns=="string"){d=this._userConf.useAddOns.split(" ")
}else{if(typeof this._userConf.useAddOns=="array"){d=this._userConf.useAddOns
}}}else{if(this.container.getAttribute("useAddOns")){d=this.container.getAttribute("useAddOns").split(" ")
}else{d=this._useAddOns.split(" ")
}}for(var b=0;
b<d.length;
b++){if(d[b]=="none"){d=new Array();
break
}else{if(d[b]=="all"){d=new Array();
for(var a in ContentFlowGlobal.AddOns){d.push(a)
}break
}}}for(var b=0;
b<d.length;
b++){var a=ContentFlowGlobal.AddOns[d[b]];
if(a){a._init(this);
this.container.addClassName("ContentFlowAddOn_"+a.name);
if(a.methods.onloadInit){a.methods.onloadInit(this)
}}}},_initGUI:function(){var b=this.resize.bind(this);
window.addEvent("resize",b,false);
var l=this.container.getElementsByTagName("div");
for(var g=0;
g<l.length;
g++){if($(l[g]).hasClassName("preButton")){var f=l[g];
var a=this._onclickPreButton.bind(this);
f.addEvent("click",a,false)
}else{if(l[g].hasClassName("nextButton")){var j=l[g];
var a=this._onclickNextButton.bind(this);
j.addEvent("click",a,false)
}}}if(this._scrollWheelSpeed!=0){var k=this._wheel.bind(this);
if(window.addEventListener){this.container.addEventListener("DOMMouseScroll",k,false)
}this.container.onmousewheel=k
}var m=this._keyStroke.bind(this);
if(this._keys&&!this.Browser.iPhone){if(document.addEventListener){if(!this.Browser.Opera){var d=document.createElement("div");
d.addClassName("mouseoverCheckElement");
this.container.appendChild(d);
if(this.Browser.WebKit){document.body.addEvent("keydown",function(i){if(d.offsetLeft>0){m(i)
}})
}else{window.addEvent("keydown",function(i){if(d.offsetLeft>0){m(i)
}})
}}else{this.container.addEvent("keydown",m)
}}else{this.container.onkeydown=m
}}if(this._flowDragFriction>0){var e=function(r){var q=r.clientX;
var p=r.clientY;
if(this._verticalFlow){var u=p-this.Flow.mouseY;
var t=this.Flow.dimensions.height
}else{var u=q-this.Flow.mouseX;
var t=this.Flow.dimensions.width
}var i=(u/t)*(2*this._visibleItems+1);
var s=this._currentPosition-i*2*this._visibleItems/this._flowDragFriction;
this.Flow.mouseX=q;
this.Flow.mouseY=p;
this.moveToPosition(s)
}.bind(this);
var o=function(){};
var h=function(p){var i=Math.round(this._targetPosition);
if(Math.abs(i-this._currentPosition)>0.001){this.moveToPosition(i)
}}.bind(this);
this.Flow.makeDraggable(e,o,h)
}if(this.Scrollbar){var n=function(r){if(!r){var r=window.event
}if(!this.Scrollbar.clickLocked){var q=r.clientX;
var p=q-this.Scrollbar.position.left;
var i=Math.round(p/this.Scrollbar.dimensions.width*this.itemsLastIndex);
this.moveToIndex(i)
}else{this.Scrollbar.clickLocked=false
}}.bind(this);
this.Scrollbar.addObserver("click",n)
}if(this.Slider){this.Slider.setPosition=function(i){i=i-Math.floor(i)+this._getIndexByPosition(Math.floor(i));
if(Math.round(i)<0){i=this.itemsLastIndex
}else{if(i<=0){i=0
}else{if(Math.round(i)>this.itemsLastIndex){i=0
}else{if(i>=this.itemsLastIndex){i=this.itemsLastIndex
}}}}if(this.items.length>1){var p=(i/this.itemsLastIndex)*this.Scrollbar.dimensions.width
}else{var p=0.5*this.Scrollbar.dimensions.width
}this.Slider.style.left=p-this.Slider.center.x+"px";
this.Slider.style.top=this.Scrollbar.center.y-this.Slider.center.y+"px"
}.bind(this);
var o=function(i){this.Scrollbar.clickLocked=true
}.bind(this);
var e=function(p){var i=this._checkIndex((p.clientX-this.Scrollbar.position.left)/this.Scrollbar.dimensions.width*this.itemsLastIndex);
this._targetPosition=this._getPositionByIndex(i);
this.Slider.setPosition(i);
if(this.Position){this.Position.setLabel(i)
}this._initStep(true)
}.bind(this);
var h=function(i){this._targetPosition=Math.round(this._targetPosition);
this._onMoveTo(this._getItemByPosition(this._targetPosition));
this._initStep(true)
}.bind(this);
this.Slider.makeDraggable(e,o,h)
}if(this.Position){this.Position.setLabel=function(i){i=this._checkIndex(Math.round(i));
if(this.items&&this.items[i].label){this.Position.innerHTML=this.items[i].label.innerHTML
}else{this.Position.innerHTML=i+1
}this.Position.style.left=(this.Slider.dimensions.width-this.Position.clientWidth)/2+"px"
}.bind(this)
}this.globalCaption=this.container.getChildrenByClassName("globalCaption")[0];
this.loadIndicator=this.container.getChildrenByClassName("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 d=this.Position.position.top-this.Slider.position.top;
if(d>0){d+=-this.Scrollbar.dimensions.height+this.Position.dimensions.height;
this.Scrollbar.style.marginBottom=d+"px"
}else{d*=-1;
this.Scrollbar.style.marginTop=d+"px"
}a+=d
}}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 d=0;
if(a.wheelDelta){d=a.wheelDelta/120
}else{if(a.detail){d=-a.detail/3
}}if(d){var b=this._targetPosition;
if(d<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 e=this._targetPosition-this._currentPosition;
var d=Math.abs(e);
if(d>0.001){this._currentPosition+=this._flowSpeedFactor*this._calcStepWidth(e,d);
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 e=this._currentPosition+this._visibleItems;
if(!this._circularFlow){a=this._checkIndex(a);
e=this._checkIndex(e)
}for(var f=0;
f<this.items.length;
f++){var b=this._getPositionByIndex(f);
var m=this.items[f];
var l=this.items[f].element;
l.style.display="none";
if(b<a||b>e){continue
}var q=Math.round(b-this._currentPosition);
var d=Math.round(b)-this._currentPosition;
var g=d<0?-1:1;
g*=d==0?0:1;
var o=this._calcSize(d,g);
var k=this._calcCoordinates(d,g);
var j=this._calcRelativeItemPosition(d,g,o);
var h=this._calcZIndex(d,g,q);
var n=this._calcFontSize(d,g,o);
if(this._verticalFlow){l.style.left=k.y+j.y*o.width/o.height+"px";
l.style.top=k.x+j.x*o.height/o.width+"px"
}else{l.style.left=k.x+j.x+"px";
l.style.top=k.y+j.y+"px"
}if(this.Browser.IE){l.style.height=o.height*(1+this._reflectionHeight)+"px"
}else{l.style.height=o.height+"px"
}l.style.width=o.width+"px";
if((this.Browser.iPhone||this.Browser.IE6||this.Browser.Konqueror4)&&(this.items[f].image||this._reflectionWithinImage)){m.positionContent(o,this.Browser.IE6)
}l.style.zIndex=32768+h;
l.style.visibility="visible";
l.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(b){var d=-(8*(Math.PI-3)/(3*Math.PI*(Math.PI-4)));
var e=b*b;
var g=1-Math.pow(Math.E,-e*(4/Math.PI+d*e)/(1+d*e));
return g
}
}if(!Math._2PI05){Math._2PI05=Math.sqrt(2*Math.PI)
}if(!Math.normDist){Math.normDist=function(a,d,b){if(!d){var d=1
}if(!b){var b=0
}if(!a){var a=-b
}return 1/(d*Math._2PI05)*Math.pow(Math.E,-(a-b)*(a-b)/(2*d*d))
}
}if(!Math.normedNormDist){Math.normedNormDist=function(a,d,b){return this.normDist(a,d,b)/this.normDist(b,d,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(d,a){if(!a||a==Math.E){return Math.log(d)
}else{if(a==2){return Math.log2(d)
}else{if(a==10){return Math.log10(d)
}else{return Math.log(d)/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.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(d){var b=new Array();
for(var a=0;
a<this.childNodes.length;
a++){var e=this.childNodes[a];
if(e.nodeType==1&&$(e).hasClassName(d)){b.push(e)
}}return b
}
}if(!CFElement.addEvent){CFElement.prototype.addEvent=function(b,d,a){if(this.addEventListener){this.addEventListener(b,d,a)
}else{this.attachEvent("on"+b,d)
}}
}if(!CFElement.removeEvent){CFElement.prototype.removeEvent=function(b,d,a){if(this.removeEventListener){this.removeEventListener(b,d,a)
}else{this.detachEvent("on"+b,d)
}}
}if(!window.addEvent){window.addEvent=function(b,d,a){if(this.addEventListener){this.addEventListener(b,d,a)
}else{if(b!="load"&&b!="resize"){document.attachEvent("on"+b,d)
}else{this.attachEvent("on"+b,d)
}}}
}if(!window.removeEvent){window.removeEvent=function(b,d,a){if(this.removeEventListener){this.removeEventListener(b,d,a)
}else{if(b!="load"&&b!="resize"){document.detachEvent("on"+b,d)
}else{this.detachEvent("on"+b,d)
}}}
};