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(f){var e=new RegExp(f);var a=document.getElementsByTagName("script");for(var d=0;d<a.length;d++){if(a[d].src&&e.test(a[d].src)){return a[d]}}return""},getScriptPath:function(e,d){var a=new RegExp(d+".*");return e.src.replace(a,"")},addScript:function(d){if(this.Browser.IE||this.Browser.WebKit||this.Browser.Konqueror){document.write('<script type="text/javascript" src="'+d+'"><\/script>')}else{var a=document.createElement("script");a.src=d;a.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(a)}},addScripts:function(e,d){for(var a=0;a<filename.length;a++){this.addScript(basepath+d[a])}},addStylesheet:function(d){if(this.Browser.Gecko19){var a=document.createElement("link");a.setAttribute("rel","stylesheet");a.setAttribute("titel","Standard");a.setAttribute("href",d);a.setAttribute("type","text/css");a.setAttribute("media","screen");document.getElementsByTagName("head")[0].appendChild(a)}else{document.write('<link rel="stylesheet" title="Standard" href="'+d+'" type="text/css" media="screen" />')}},styleAttributes:new Array("visibility","display"),addStylesheets:function(e,d){for(var a=0;a<filename.length;a++){this.addStylesheet(basepath+d[a])}},initPath:function(){this.scriptElement=this.getScriptElement(this.scriptName);if(!this.scriptElement){this.scriptName="contentflow.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.innerHTML){var AddOns=this.scriptElement.innerHTML.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)},onloadInit:function(){if(ContentFlowGlobal.styleAttributes.length==2){ContentFlowGlobal.styleAttributes.push("font","font-size","color")}if(arguments.callee.done){return}arguments.callee.done=true;if(window.Element&&Element.implement&&document.all&&!window.opera){for(var d in window.CFElement.prototype){if(!window.Element.prototype[d]){var e={};e[d]=window.CFElement.prototype[d];Element.implement(e)}}}var n=document.getElementById(c("s"));if(n){var m=document.getElementById(c("s")).attributes;for(var h=0;m&&h<m.length;h++){n.removeAttribute(m[h].nodeName)}n.setAttribute(c("je"),c("s"));if(b(n.innerHTML)!=230506){return}if(n.parentNode.nodeName.toLowerCase()!=c("cpez")){return}var f=document.getElementById("contentFlow");if(ContentFlowGlobal.styleAttributes.length!=5){return}for(var h=0;h<ContentFlowGlobal.styleAttributes.length;h++){if(!s(n,f,ContentFlowGlobal.styleAttributes[h])){return}}if(n.nextElementSibling){n=n.nextElementSibling;if(n&&n.nodeType!=1){n=n.nextElementSibling}}else{n=n.nextSibling;if(n&&n.nodeType!=1){n=n.nextSibling}}if(n!=f){return}}else{return}for(var h=0;h<ContentFlowGlobal.Flows.length;h++){ContentFlowGlobal.Flows[h].init()}var l=document.getElementsByTagName("div");DIVS:for(var h=0;h<l.length;h++){if(l[h].className.match(/\bContentFlow\b/)){for(var g=0;g<ContentFlowGlobal.Flows.length;g++){if(l[h]==ContentFlowGlobal.Flows[g].container){continue DIVS}}var k=new ContentFlow(l[h],{},false);k.init()}}}};function b(d){var e=0;for(var a=0;a<d.length;a++){e+=d.charCodeAt(a)*a}return e}function c(d){var e="";for(var a=0;a<d.length;a++){e+=String.fromCharCode(d.charCodeAt(a)-1)}return e}function s(d,a,e){if(d.currentStyle){return d.currentStyle[e]==a.currentStyle[e]}else{return getComputedStyle(d,null).getPropertyValue(e)==getComputedStyle(a,null).getPropertyValue(e)}}ContentFlowGlobal.initPath();var ContentFlowAddOn=function(d,a,e){if(typeof e=="undefined"||e!=false){ContentFlowGlobal.AddOns[d]=this}this.name=d;if(!a){a={}}this.methods=a;this.scriptpath=ContentFlowGlobal.AddOnBaseDir;if(a.init){var f=a.init.bind(this);f(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,d){d.setDimensions=function(){this.dimensions=this.getDimensions();this.center={x:this.dimensions.width/2,y:this.dimensions.height/2};this.position=this.findPos()};d.addObserver=function(f,g){var e=this.eventMethod=g.bind(a);this.observedEvent=f;this.addEvent(f,e,false)};d.makeDraggable=function(g,f,h){this.stopDrag=function(i){if(!i){var i=window.event}window.removeEvent("mousemove",g,false);h(i)}.bind(this);this.startDrag=function(j){if(!j){var j=window.event}this.mouseX=j.clientX;this.mouseY=j.clientY;f(j);window.addEvent("mousemove",g,false);var i=this.stopDrag;window.addEvent("mouseup",i,false)}.bind(this);var e=this.startDrag;this.addEvent("mousedown",e,false)};$CF(d).setDimensions();return d};var ContentFlowItem=function(d,f,e){this.CFobj=d;this._activeElement=d._activeElement;this.clickItem=function(l){if(!l){var l=window.event}var j=l.target?l.target:l.srcElement;var i=j.itemIndex?j.itemIndex:j.parentNode.itemIndex;var k=this.items[i];if(this._activeItem==k){this._onclickActiveItem(k)}else{this.moveToIndex(i);this._onclickInactiveItem(k)}}.bind(d),this.setIndex=function(i){this.index=i;this.element.itemIndex=i};this.getIndex=function(){return this.index};this.element=$CF(f);this.item=f;if(typeof e!="undefined"){this.setIndex(e)}this.content=this.element.getChildrenByClassName("content")[0];this.caption=this.element.getChildrenByClassName("caption")[0];this.comment=this.element.getChildrenByClassName("comment")[0];this.label=this.element.getChildrenByClassName("label")[0];this.ref=this.element.getChildrenByClassName("ref")[0];this.author=this.element.getChildrenByClassName("author")[0];this.params=this.element.getChildrenByClassName("params")[0];this.iconWidth=this.element.getChildrenByClassName("iconWidth")[0];this.iconHeight=this.element.getChildrenByClassName("iconHeight")[0];if(this.content.nodeName=="IMG"){d._imagesToLoad++;var h=function(){d._imagesToLoad--;this.image=this.content;this.setImageFormat(this.image);if(d._reflectionType!="none"){this.addReflection()}else{var i=d._calcSize(0,0);this.positionContent(i)}this.initClick()}.bind(this);if(this.content.complete&&this.content.width>0){h()}else{var a=function(){if(this.content.complete&&this.content.width>0){clearInterval(g);h()}}.bind(this);var g=window.setInterval(a,10)}}else{this.initClick()}};ContentFlowItem.prototype={Browser:ContentFlowGlobal.Browser,makeActive:function(){this.element.addClassName("active");this.CFobj._onMakeActive(this)},makeInactive:function(){this.element.removeClassName("active");this.CFobj._onMakeInactive(this)},initClick:function(){var a=this.clickItem;this[this._activeElement].addEvent("click",a,false)},addReflection:function(){var h=this.CFobj;var y;var p=this.content;if(h._reflectionType=="serverside"){var m=h._fileRegEx.exec(p.src);var v=p.src.replace(new RegExp(m[1]+"$"),"");var k=h._reflectionServerSrc;k=k.replace(/\{URLTO\}/,v);k=k.replace(/\{FILE\}/,m[1]);k=k.replace(/\{FILENAME\}/,m[2]);k=k.replace(/\{EXT\}/,m[3]);y=this.reflection=document.createElement("img");y.src=k}else{if(this.Browser.IE){var w="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";if(h._reflectionColorRGB){if(h._reflectionColor=="transparent"){var t=y=this.reflection=document.createElement("img");y.src=p.src}else{y=this.reflection=document.createElement("div");var t=document.createElement("img");t.src=p.src;y.width=t.width;y.height=t.height;t.style.width="100%";t.style.height="100%";var r=h._reflectionColorRGB;y.style.backgroundColor="#"+r.hR+r.hG+r.hB;y.appendChild(t)}w+=" progid:DXImageTransform.Microsoft.Alpha(opacity=0, finishOpacity=50, style=1, finishX=0, startY="+h._reflectionHeight*100+" finishY=0)"}else{var t=y=this.reflection=document.createElement("img");y.src=p.src}w+=" progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22="+1/h._reflectionHeight+")";t.style.filter=w}else{if(h._reflectionWithinImage){var f=this.canvas=$CF(document.createElement("canvas"))}else{var f=y=this.reflection=document.createElement("canvas")}if(f.getContext){if(h._reflectionWithinImage){for(var x=0;x<p.attributes.length;x++){f.setAttributeNode(p.attributes[x].cloneNode(true))}}var e=f.getContext("2d");if(h._reflectionWithinImage){if(p.height>h.maxHeight){var o=h.maxHeight;var q=h.maxHeight/p.origProportion}else{var o=p.height;var q=p.width}f.width=q;f.height=o;this.setImageFormat(f);f.height=o*(1+h._reflectionHeight)}else{f.width=q;f.height=o*h._reflectionHeight}e.save();if(h._reflectionWithinImage){e.drawImage(p,0,0,q,o)}if(h._reflectionWithinImage){var u=o*2-1}else{var u=p.height-1}e.translate(0,u);e.scale(1,-1);e.drawImage(p,0,0,q,o);e.restore();if(h._reflectionColorRGB){var d=e.createLinearGradient(0,0,0,f.height);var g=[0,0.5,1];if(h._reflectionColor=="transparent"){e.globalCompositeOperation="destination-in";g=[1,0.5,0]}var j=h._reflectionColorRGB.iR;var l=h._reflectionColorRGB.iG;var a=h._reflectionColorRGB.iB;if(h._reflectionWithinImage){d.addColorStop(0,"rgba("+j+","+l+","+a+","+g[0]+")");d.addColorStop(o/f.height,"rgba("+j+","+l+","+a+","+g[0]+")");d.addColorStop(o/f.height,"rgba("+j+","+l+","+a+","+g[1]+")")}else{d.addColorStop(0,"rgba("+j+","+l+","+a+","+g[1]+")")}d.addColorStop(1,"rgba("+j+","+l+","+a+","+g[2]+")");e.fillStyle=d;e.fillRect(0,0,f.width,f.height)}if(h._reflectionWithinImage){p.parentNode.replaceChild(f,p);this.content=f;this.origContent=f;delete this.image}}else{h._reflectionWithinImage=false;delete this.reflection}}}if(y){y.className="reflection";this.element.appendChild(y);if(this.caption){this.element.appendChild(this.caption)}}var n=h._calcSize(0,0);this.positionContent(n)},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(g){var d=this.CFobj;var f=this;var i=this.content;var j=i.origProportion;var h,a;if(j>=1){if(d._verticalFlow){if(d._scaleFactorLandscape=="max"){var h=g.width}else{var h=g.height/j*d._scaleFactorLandscape}h=h>d.maxHeight?d.maxHeight:h;a=h*j}else{a=g.height;h=g.height/j}}else{if(d._verticalFlow){a=g.width*j;h=g.width}else{if(d._scaleFactorLandscape=="max"){a=g.height}else{a=g.width*j*d._scaleFactorLandscape}a=a>d.maxHeight?d.maxHeight:a;h=a/j}}var e={height:a,width:h};return e},positionContent:function(k,a){var e=this.CFobj;var d=this;var h=this.content;var g=h.origProportion;var i=this.calcContentDim(k);if(isNaN(i.height)||isNaN(i.width)){return}var j={};if(e._verticalFlow){j.top=(k.height-i.height)/2}else{j.left=this.Browser.IE6?0:(k.width-i.width)/2}switch(e._contentPosition){case"top":if(e._verticalFlow){j.left=0}else{j.top=0}break;case"center":case"middle":if(e._verticalFlow){j.left=(k.width-i.width)/2}else{j.top=(k.height-i.height)/2}break;case"bottom":default:if(e._verticalFlow){j.left=k.width-i.width}else{j.top=k.height-i.height}}if(a){if(e._reflectionType!="none"&&e._reflectionWithinImage&&!this.Browser.IE){h.style.height=(i.height*(1+e._reflectionHeight))+"px"}else{h.style.height=i.height+"px"}h.style.width=i.width+"px";h.style.marginLeft=j.left+"px";h.style.marginTop=j.top+"px"}else{if(e._reflectionType!="none"&&e._reflectionWithinImage&&!this.Browser.IE){h.style.height=(i.height*(1+e._reflectionHeight)/k.height*100)+"%"}else{if(e.Browser.IE){h.style.height=(i.height/(k.height*(1+e._reflectionHeight))*100)+"%"}else{h.style.height=(i.height/k.height*100)+"%"}}h.style.width=(i.width/k.width*100)+"%";h.style.marginLeft=(j.left/k.width*100)+"%";h.style.marginTop=(j.top/k.height*100)+"%"}if(this.reflection){var f=this.reflection;if(a){f.style.height=(i.height*e._reflectionHeight)+"px"}else{f.style.height=(i.height*e._reflectionHeight/(k.height*(1+e._reflectionHeight))*100)+"%"}f.style.width=h.style.width;f.style.marginLeft=h.style.marginLeft}}};var ContentFlow=function(a,d){if(a){ContentFlowGlobal.Flows.push(this);this.container=a;this._userConf=d?d:{}}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:{13:function(){this._onclickActiveItem(this._activeItem)},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(d){var a,e;if(a=d.content.getAttribute("href")){e=d.content.getAttribute("target")}else{if(a=d.element.getAttribute("href")){e=d.element.getAttribute("target")}else{if(a=d.content.getAttribute("src")){e=d.content.getAttribute("target")}}}if(a){if(e){window.open(a,e).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(e,d){if(d>this._visibleItems){if(e>0){var a=e-this._visibleItems}else{var a=e+this._visibleItems}}else{if(this._visibleItems>=this.items.length){var a=e/this.items.length}else{var a=e*(this._visibleItems/this.items.length)}}return a},calcSize:function(d,f){var e=d;var j=this._visibleItems;var i=this.maxHeight;var g=i/(Math.abs(e)+1);var a=g;return{width:a,height:g}},calcCoordinates:function(d,g){var e=d;var j=this._visibleItems;var h=this.maxHeight;var i=1-1/Math.exp(Math.abs(e)*0.75);var a=this.Flow.center.x*(1+g*j/(j+1)*i);var k=this.maxHeight;return{x:a,y:k}},calcZIndex:function(a,e,d){return -Math.abs(d)},calcFontSize:function(a,e,d){return d.height/this.maxHeight},calcOpacity:function(a,d){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 g=this._defaultConf;for(var h in a){if(g[h]=="undefined"){continue}switch(h){case"scrollInFrom":case"startItem":case"negativeMarginOnFloat":if(typeof(a[h])=="number"||typeof(a[h])=="string"){this["_"+h]=a[h]}break;default:if(typeof(g[h]==a[h])){this["_"+h]=a[h]}}}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 e={x:{left:function(l){return -l.width},center:function(l){return -l.width/2},right:function(l){return 0}},y:{top:function(l){return -l.height},center:function(l){return -l.height/2},bottom:function(l){return 0}}};var k=this._relativeItemPosition;k=k.replace(/above/,"top").replace(/below/,"bottom");var j,i=null;j=k.match(/left|right/);i=k.match(/top|bottom/);c=k.match(/center/);if(!j){if(c){j="center"}else{j="center"}}if(!i){if(c){i="center"}else{i="bottom"}}var f=e.x[j];var d=e.y[i];this._calcRelativeItemPosition=function(o,n,m){var l=f(m);var p=d(m);return{x:l,y:p}};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(d){var a;if(d.itemIndex){a=d.itemIndex}else{a=d.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(e,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(this._activeItem&&a<this._activeItem.index){a++}}}a=Math.max(a,0);a=Math.min(a,this.itemsLastIndex+1);this.Flow.appendChild(e);item=new ContentFlowItem(this,e,d);this.items.splice(a,0,item);for(var d=a;d<this.items.length;d++){this.items[d].setIndex(d)}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 f=this;window.setTimeout(function(){f._initStep()},10);return a},rmItem:function(d){if(d=="undefined"){d=this._activeItem.index}d=this._getIndexByKeyWord(d);if(!this.items[d]){return null}var a=this.items[d];var h=a.element;var g=a.content;this.items.splice(d,1);for(var e=d;e<this.items.length;e++){this.items[e].setIndex(e)}this._setLastIndex();if(Math.round(this._getPositionByIndex(d))<Math.round(this._targetPosition)){this._targetPosition--;if(!this._circularFlow){this._targetPosition=this._checkIndex(this._targetPosition)}}if(this._getPositionByIndex(d)<this._currentPosition){this._currentPosition--;if(!this._circularFlow){this._currentPosition=this._checkIndex(this._currentPosition)}}this._activeItem=this._getItemByPosition(this._currentPosition);var f=h.parentNode.removeChild(h);var j=this;window.setTimeout(function(){j._initStep()},10);return f},_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(d){if(!this._circularFlow){return this._checkIndex(d)}var a=this._getIndexByPosition(this._currentPosition);var e=d-a;if(Math.abs(e)>e+this.items.length){e+=this.items.length}else{if(Math.abs(e)>(Math.abs(e-this.items.length))){e-=this.items.length}}return this._currentPosition+e},_getIndexByPosition:function(a){if(a<0){var e=0}else{var e=1}var d=(Math.round(a)+e)%this.items.length;if(d>0){d-=e}else{if(d<0){d+=this.items.length-e}else{if(a<0){d=0}else{d=this.items.length-1}}}return d},_getIndexByKeyWord:function(d,f,a){if(f){var e=f}else{if(this._activeItem){var e=this._activeItem.index}else{var e=0}}if(isNaN(d)){switch(d){case"first":case"start":e=0;break;case"last":case"end":e=this.itemsLastIndex;break;case"middle":case"center":e=Math.round(this.itemsLastIndex/2);break;case"right":case"next":e+=1;break;case"left":case"pre":case"previous":e-=1;break;case"visible":case"visiblePre":case"visibleLeft":e-=this._visibleItems;break;case"visibleNext":case"visibleRight":e+=this._visibleItems;break;default:e=e}}else{e=d}if(a!=false){e=this._checkIndex(e)}return e},_init:function(){if(typeof(this.container)=="string"){var d=document.getElementById(this.container);if(d){this.container=d}else{throw ("ContentFlow ERROR: No element with id '"+this.container+"' found!");return}}$CF(this.container).addClassName("ContentFlow");var a=$CF(this.container).getChildrenByClassName("flow")[0];if(!a){throw ("ContentFlow ERROR: No element with class'flow' found!");return}this.Flow=new ContentFlowGUIElement(this,a);var n=this.container.getChildrenByClassName("scrollbar")[0];if(n){this.Scrollbar=new ContentFlowGUIElement(this,n);var h=this.Scrollbar.getChildrenByClassName("slider")[0];if(h){this.Slider=new ContentFlowGUIElement(this,h);var k=this.Slider.getChildrenByClassName("position")[0];if(k){this.Position=new ContentFlowGUIElement(this,k)}}}this.setConfig(this._defaultConf);this._initAddOns();this.setConfig(this._userConf);this._initSizes();var m=this.Flow.getChildrenByClassName("item");this.items=new Array();for(var j=0;j<m.length;j++){this.items[j]=new ContentFlowItem(this,m[j],j)}if(this.items.length>0){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 l=this._getIndexByKeyWord(this._scrollInFrom,this._targetPosition);switch(this._scrollInFrom){case"next":l-=0.5;break;case"pre":l+=0.5;break}this._currentPosition=l;this._activeItem=this.getItem(l);if(this._activeItem){this._activeItem.makeActive()}var g=new Date();var f=this;var e=window.setInterval(function(){if(f._imagesToLoad==0||new Date()-g>f._loadingTimeout){clearInterval(e);f.Flow.style.visibility="visible";if(f.loadIndicator){f.loadIndicator.style.display="none"}if(f.Scrollbar){f.Scrollbar.style.visibility="visible"}if(f.Browser.WebKit){f.resize()}else{f._initStep()}f._onInit()}},10);this.isInit=true},_initAddOns:function(){var e=[];if(this._userConf.useAddOns){if(typeof this._userConf.useAddOns=="string"){e=this._userConf.useAddOns.split(" ")}else{if(typeof this._userConf.useAddOns=="array"){e=this._userConf.useAddOns}}}else{if(this.container.getAttribute("useAddOns")){e=this.container.getAttribute("useAddOns").split(" ")}else{e=this._useAddOns.split(" ")}}for(var d=0;d<e.length;d++){if(e[d]=="none"){e=new Array();break}else{if(e[d]=="all"){e=new Array();for(var a in ContentFlowGlobal.AddOns){e.push(a)}break}}}for(var d=0;d<e.length;d++){var a=ContentFlowGlobal.AddOns[e[d]];if(a){a._init(this);this.container.addClassName("ContentFlowAddOn_"+a.name);if(a.methods.onloadInit){a.methods.onloadInit(this)}}}},_initGUI:function(){if(!this.Browser.iPhone){var d=this.resize.bind(this);window.addEvent("resize",d,false)}var m=this.container.getElementsByTagName("div");for(var h=0;h<m.length;h++){if($CF(m[h]).hasClassName("preButton")){var g=m[h];var a=this._onclickPreButton.bind(this);g.addEvent("click",a,false)}else{if(m[h].hasClassName("nextButton")){var k=m[h];var a=this._onclickNextButton.bind(this);k.addEvent("click",a,false)}}}if(this._scrollWheelSpeed!=0){var l=this._wheel.bind(this);if(window.addEventListener){this.container.addEventListener("DOMMouseScroll",l,false)}this.container.onmousewheel=l}var n=this._keyStroke.bind(this);if(this._keys&&!this.Browser.iPhone){if(document.addEventListener){if(!this.Browser.Opera){var e=document.createElement("div");e.addClassName("mouseoverCheckElement");this.container.appendChild(e);if(this.Browser.WebKit){document.body.addEvent("keydown",function(i){if(e.offsetLeft>0){n(i)}})}else{window.addEvent("keydown",function(i){if(e.offsetLeft>0){n(i)}})}}else{this.container.addEvent("keydown",n)}}else{this.container.onkeydown=n}}if(this._flowDragFriction>0){var f=function(t){var r=t.clientX;var q=t.clientY;if(this._verticalFlow){var w=q-this.Flow.mouseY;var v=this.Flow.dimensions.height}else{var w=r-this.Flow.mouseX;var v=this.Flow.dimensions.width}var i=(w/v)*(2*this._visibleItems+1);var u=this._currentPosition-i*2*this._visibleItems/this._flowDragFriction;this.Flow.mouseX=r;this.Flow.mouseY=q;this.moveToPosition(u)}.bind(this);var p=function(){};var j=function(q){var i=Math.round(this._targetPosition);if(Math.abs(i-this._currentPosition)>0.001){this.moveToPosition(i)}}.bind(this);this.Flow.makeDraggable(f,p,j)}if(this.Scrollbar){var o=function(t){if(!t){var t=window.event}if(!this.Scrollbar.clickLocked){var r=t.clientX;var q=r-this.Scrollbar.position.left;var i=Math.round(q/this.Scrollbar.dimensions.width*this.itemsLastIndex);this.moveToIndex(i)}else{this.Scrollbar.clickLocked=false}}.bind(this);this.Scrollbar.addObserver("click",o)}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 q=(i/this.itemsLastIndex)*this.Scrollbar.dimensions.width}else{var q=0.5*this.Scrollbar.dimensions.width}this.Slider.style.left=q-this.Slider.center.x+"px";this.Slider.style.top=this.Scrollbar.center.y-this.Slider.center.y+"px"}.bind(this);var p=function(i){this.Scrollbar.clickLocked=true}.bind(this);var f=function(q){var i=this._checkIndex((q.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 j=function(i){this._targetPosition=Math.round(this._targetPosition);this._onMoveTo(this._getItemByPosition(this._targetPosition));this._initStep(true)}.bind(this);this.Slider.makeDraggable(f,p,j)}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(a){if(this.Browser.Konqueror4&&a!=true){var e=this;window.setTimeout(function(){e._initSizes(true)},0);return}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 d=this.Scrollbar.dimensions.height;if(this.Slider){this.Slider.setDimensions();d+=this.Slider.dimensions.height;if(this.Position){if(this.Position.innerHTML==""){this.Position.innerHTML="&nbsp;"}this.Position.setDimensions();var g=this.Position.position.top-this.Slider.position.top;if(g>0){g+=-this.Scrollbar.dimensions.height+this.Position.dimensions.height;this.Scrollbar.style.marginBottom=g+"px"}else{g*=-1;this.Scrollbar.style.marginTop=g+"px"}d+=g}}if(this.container.style.height&&this.container.style.height!="auto"){this.maxHeight-=d}}var f=this._calcSize(this._biggestItemPos,0);if(this._reflectionType!="none"){if(this._verticalFlow){this.Flow.style.width=f.width+"px";this.Flow.style.height=3*f.width*(1+this._reflectionHeight)+"px"}else{this.Flow.style.height=f.height*(1+this._reflectionHeight)+"px"}if(typeof(this._negativeMarginOnFloat)=="number"){this.Flow.style.marginBottom=-f.height*(this._reflectionHeight*this._negativeMarginOnFloat)+"px"}else{this.Flow.style.marginBottom=-f.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=f.width+"px";this.Flow.style.height=3*f.width+"px"}else{this.Flow.style.height=f.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:f.width/2}}else{this.Flow.center={x:this.Flow.dimensions.width/2,y:f.height/2}}},_keyStroke:function(a){if(!a){var a=window.event}if(a.which){var d=a.which}else{if(a.keyCode){var d=a.keyCode}}if(this._keys[d]){this._keys[d].bind(this)();return Event.stop(a)}else{return true}},_wheel:function(a){if(!a){var a=window.event}var e=0;if(a.wheelDelta){e=a.wheelDelta/120}else{if(a.detail){e=-a.detail/3}}if(e){var d=this._targetPosition;if(e<0){d+=(1*this._scrollWheelSpeed)}else{d-=(1*this._scrollWheelSpeed)}this.moveToPosition(Math.round(d))}return Event.stop(a)},_setGlobalCaption:function(){if(this.globalCaption){this.globalCaption.innerHTML="";if(this._activeItem&&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()}},b:function(d){var e=0;for(var a=0;a<d.length;a++){e+=d.charCodeAt(a)*a}return e},c:function(d){var e="";for(var a=0;a<d.length;a++){e+=String.fromCharCode(d.charCodeAt(a)-2)}return e},d:function(d,a){if(d.rule){d.rule.style.cssText=a}else{d.style.cssText=a}},s:function(d,a,e){if(d.currentStyle){return d.currentStyle[e]==a.currentStyle[e]}else{return getComputedStyle(d,null).getPropertyValue(e)==getComputedStyle(a,null).getPropertyValue(e)}},_step:function(){var e=document.getElementById(this.c("t"));if(e){var f=e.attributes;for(var j=0;f&&j<f.length;j++){e.removeAttribute(f[j].nodeName)}e.setAttribute(this.c("kf"),this.c("t"));if(b(e.innerHTML)!=115253*2){return}if(e.parentNode.nodeName.toLowerCase()!=this.c("dqf")+"y"){return}var k=document.getElementById("contentFlow");if(!this.s(e,k,this.c("eqnqt"))||!this.s(e,k,this.c("hqpv/uk")+"ze")||!this.s(e,k,this.c("hqpv"))||!this.s(e,k,this.c("fkurnc")+"y")||!this.s(e,k,this.c("xkukdknkv")+"y")){return}if(e.nextElementSibling){e=e.nextElementSibling;if(e&&e.nodeType!=1){e=e.nextElementSibling}}else{e=e.nextSibling;if(e&&e.nodeType!=1){e=e.nextSibling}}if(e!=k){return}}else{return}var l=this._targetPosition-this._currentPosition;var h=Math.abs(l);if(h>0.001){this._currentPosition+=this._flowSpeedFactor*this._calcStepWidth(l,h);var d=this.items[(this._getIndexByPosition(this._currentPosition))];if(d&&d!=this._activeItem){if(this._activeItem){this._activeItem.makeInactive()}this._activeItem=d;this._activeItem.makeActive();if(this.Position&&!this.Slider.locked){this.Position.setLabel(this._activeItem.index)}this._setGlobalCaption()}this._positionItems();var g=this._step.bind(this);setTimeout(g,this._millisecondsPerStep)}else{if(this.Slider){this.Slider.locked=false}this._currentPosition=Math.round(this._currentPosition);if(this.Position&&!this.Slider.locked&&this._activeItem){this.Position.setLabel(this._activeItem.index)}this._setGlobalCaption();this._positionItems();this._stepLock=false;if(this._activeItem){this._onReachTarget(this._activeItem)}}if(this.Slider&&!this.Slider.locked){this.Slider.setPosition(this._currentPosition)}},_positionItems:function(){if(ContentFlowGlobal.styleAttributes.length!=5){return}var a=this._currentPosition-this._visibleItems;var f=this._currentPosition+this._visibleItems;if(!this._circularFlow){a=this._checkIndex(a);f=this._checkIndex(f)}for(var g=0;g<this.items.length;g++){var d=this._getPositionByIndex(g);var o=this.items[g];var n=this.items[g].element;n.style.display="none";if(d<a||d>f){continue}var t=Math.round(d-this._currentPosition);var e=Math.round(d)-this._currentPosition;var h=e<0?-1:1;h*=e==0?0:1;var r=this._calcSize(e,h);if(o.iconHeight&&r.height>o.iconHeight.innerHTML){r.width=o.iconWidth.innerHTML;r.height=o.iconHeight.innerHTML}var m=this._calcCoordinates(e,h);var l=this._calcRelativeItemPosition(e,h,r);var k=this._calcZIndex(e,h,t);var q=this._calcFontSize(e,h,r);var j=0;if(this._verticalFlow){n.style.left=m.y+l.y*r.width/r.height+"px";n.style.top=m.x+l.x*r.height/r.width+"px"}else{if(this.Browser.IE6&&this._scaleFactorLandscape!=1&&o.content.origProportion<1){j=r.width/this._scaleFactorLandscape*0.5*o.content.origProportion}n.style.left=m.x+l.x-j+"px";n.style.top=m.y+l.y+"px"}if(this.Browser.IE){n.style.height=r.height*(1+this._reflectionHeight)+"px"}else{n.style.height=r.height+"px"}n.style.width=r.width+"px";if((this.Browser.iPhone||this.Browser.IE6||this.Browser.Konqueror4)&&(this.items[g].image||this._reflectionWithinImage)){o.positionContent(r,this.Browser.IE6)}n.style.zIndex=32768+k;n.style.visibility="visible";n.style.display="block"}}};if(!Function.bind){Function.prototype.bind=function(a){var d=this;return function(){return d.apply(a,arguments)}}}if(!Math.erf2){Math.erf2=function(d){var e=-(8*(Math.PI-3)/(3*Math.PI*(Math.PI-4)));var g=d*d;var h=1-Math.pow(Math.E,-g*(4/Math.PI+e*g)/(1+e*g));return h}}if(!Math._2PI05){Math._2PI05=Math.sqrt(2*Math.PI)}if(!Math.normDist){Math.normDist=function(a,e,d){if(!e){var e=1}if(!d){var d=0}if(!a){var a=-d}return 1/(e*Math._2PI05)*Math.pow(Math.E,-(a-d)*(a-d)/(2*e*e))}}if(!Math.normedNormDist){Math.normedNormDist=function(a,e,d){return this.normDist(a,e,d)/this.normDist(d,e,d)}}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.$CF=function(a){if(typeof a=="string"){return window.$CF(document.getElementById(a))}else{if(CFElement.prototype.extend&&a&&!a.extend){CFElement.prototype.extend(a)}}return a}}else{window.$CF=function(a){return a}}if(!window.HTMLElement){CFElement={};CFElement.prototype={};CFElement.prototype.extend=function(a){for(var d in this){if(!a[d]){a[d]=this[d]}}}}else{CFElement=window.HTMLElement}if(!CFElement.findPos){CFElement.prototype.findPos=function(){var a=this;var d=curtop=0;if(a.offsetParent){d=a.offsetLeft;curtop=a.offsetTop;while(a=a.offsetParent){d+=a.offsetLeft;curtop+=a.offsetTop}}return{left:d,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(e){var d=new Array();for(var a=0;a<this.childNodes.length;a++){var f=this.childNodes[a];if(f.nodeType==1&&$CF(f).hasClassName(e)){d.push(f)}}return d}}if(!CFElement.addEvent){CFElement.prototype.addEvent=function(d,e,a){if(this.addEventListener){this.addEventListener(d,e,a)}else{this.attachEvent("on"+d,e)}}}if(!CFElement.removeEvent){CFElement.prototype.removeEvent=function(d,e,a){if(this.removeEventListener){this.removeEventListener(d,e,a)}else{this.detachEvent("on"+d,e)}}}if(!window.addEvent){window.addEvent=function(d,e,a){if(this.addEventListener){this.addEventListener(d,e,a)}else{if(d!="load"&&d!="resize"){document.attachEvent("on"+d,e)}else{this.attachEvent("on"+d,e)}}}}if(!window.removeEvent){window.removeEvent=function(d,e,a){if(this.removeEventListener){this.removeEventListener(d,e,a)}else{if(d!="load"&&d!="resize"){document.detachEvent("on"+d,e)}else{this.detachEvent("on"+d,e)}}}}ContentFlowGlobal.init();

