﻿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})(),getAddOnConf:function(a){if(this.AddOns[a]){return this.AddOns[a].conf}else{return{}}},setAddOnConf:function(d,a){this.AddOns[d].setConfig(a)},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("href",d);a.setAttribute("type","text/css");a.setAttribute("media","screen");document.getElementsByTagName("head")[0].appendChild(a)}else{document.write('<link rel="stylesheet" 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+"mycontentflow.css");this.loadAddOns=new Array();if(this.scriptElement.innerHTML){var a=this.scriptElement.innerHTML.replace(/\s+/g," ").split(" ");for(var e=0;e<a.length;e++){if(a[e]==""){continue}this.loadAddOns.push(a[e]);this.addScript(this.AddOnBaseDir+"ContentFlowAddOn_"+a[e]+".js")}}var g=this;if(document.addEventListener){if(this.Browser.WebKit){var f=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(f);g.onloadInit()}},100)}else{document.addEventListener("DOMContentLoaded",g.onloadInit,false)}}else{if(this.Browser.IE){document.write("<script id=__ie_cf_onload defer src=javascript:void(0)><\/script>");var d=document.getElementById("__ie_cf_onload");d.onreadystatechange=function(){if(this.readyState=="complete"){g.onloadInit()}}}}window.addEvent("load",g.onloadInit,false)},onloadInit:function(){if(ContentFlowGlobal.styleAttributes.length==2){ContentFlowGlobal.styleAttributes.push("font","font-size","color")}if(arguments.callee.done){return}if(!LightFlowGlobal.readyJS||typeof LightFlowGlobal.myLightWindow=="undefined"){var l=ContentFlowGlobal;window.setTimeout(l.onloadInit,100);return}for(var f=0;f<ContentFlowGlobal.loadAddOns.length;f++){var d=ContentFlowGlobal.loadAddOns[f];if(!ContentFlowGlobal.AddOns[d]){var l=ContentFlowGlobal;window.setTimeout(l.onloadInit,100);return}}arguments.callee.done=true;if(window.Element&&Element.implement&&document.all&&!window.opera){for(var m in window.CFElement.prototype){if(!window.Element.prototype[m]){var k={};k[m]=window.CFElement.prototype[m];Element.implement(k)}}}var d=document.getElementById(c("s"));if(d){if(b(d.getAttribute(c("dpoufou")))!=86716){return}}else{return}for(var f=0;f<ContentFlowGlobal.Flows.length;f++){ContentFlowGlobal.Flows[f].init()}var g=document.getElementsByTagName("div");DIVS:for(var f=0;f<g.length;f++){if(g[f].className.match(/\bContentFlow\b/)){for(var e=0;e<ContentFlowGlobal.Flows.length;e++){if(g[f]==ContentFlowGlobal.Flows[e].Container){continue DIVS}}var h=new ContentFlow(g[f],{},false);h.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.conf={};if(this.methods.conf){this.setConfig(this.methods.conf);delete this.methods.conf}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,setConfig:function(a){for(var d in a){this.conf[d]=a[d]}},_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(j){if(!j){var j=window.event}if(this.Browser.iPhone){window.removeEvent("touchemove",g,false);if(!this.ontochmove){var i=j.target;if(i.firstChild){i=i.firstChild}var k=document.createEvent("MouseEvents");k.initEvent("click",true,true);i.dispatchEvent(k)}}else{window.removeEvent("mousemove",g,false)}h(j)}.bind(this);this.initDrag=function(i){if(!i){var i=window.event}var j=i;if(i.touches){j=i.touches[0]}this.mouseX=j.clientX;this.mouseY=j.clientY;f(i)}.bind(this);this.startDrag=function(k){if(!k){var k=window.event}var i=this.stopDrag;if(this.Browser.iPhone){var j=this;j.ontouchmove=false;window.addEvent("touchmove",function(l){j.ontouchmove=true;g(l)},false);k.preventDefault();window.addEvent("touchend",i,false)}else{window.addEvent("mousemove",g,false);window.addEvent("mouseup",i,false)}if(k.preventDefault){k.preventDefault()}}.bind(this);var e=this.startDrag;if(this.Browser.iPhone){this.addEventListener("touchstart",e,false)}else{this.addEvent("mousedown",e,false)}};d.Browser=ContentFlowGlobal.Browser;$CF(d).setDimensions();return d};var ContentFlowItem=function(e,f,g){this.CFobj=e;this._activeElement=e.conf.activeElement;this.pre=null;this.next=null;this.clickItem=function(o){if(!o){var o=window.event}var m=o.target?o.target:o.srcElement;var l=m.itemIndex?m.itemIndex:m.parentNode.itemIndex;var n=this.items[l];if(this._activeItem==n){this.conf.onclickActiveItem(n)}else{if(this.conf.onclickInactiveItem(n)!=false){this.moveToIndex(l)}}}.bind(e),this.setIndex=function(l){this.index=l;this.element.itemIndex=l};this.getIndex=function(){return this.index};if($CF(f).nodeName=="IMG"){var a=document.createElement("div");a.className="item";var k=f.parentNode.replaceChild(a,f);k.className="content";a.appendChild(k);if(f.title){var j=document.createElement("div");j.className="caption";j.innerHTML=f.title;a.appendChild(j)}f=a}this.element=$CF(f);this.item=f;if(typeof g!="undefined"){this.setIndex(g)}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.info=this.element.getChildrenByClassName("info")[0];this.iconPath=this.element.getChildrenByClassName("iconPath")[0];this.thumbWidth=this.element.getChildrenByClassName("thumbWidth")[0];this.thumbHeight=this.element.getChildrenByClassName("thumbHeight")[0];if(this.content.nodeName=="IMG"){e._imagesToLoad++;var d=function(){e._imagesToLoad--;this.image=this.content;this.setImageFormat(this.image);if(e.conf.reflectionHeight>0){this.addReflection()}this.initClick();e._addItemCueProcess(true)}.bind(this);if(this.content.complete&&this.content.width>0){d()}else{var h=function(){if(this.content.complete&&this.content.width>0){clearInterval(i);d()}}.bind(this);var i=window.setInterval(h,100)}}else{this.initClick();e._addItemCueProcess(true)}};ContentFlowItem.prototype={Browser:ContentFlowGlobal.Browser,makeActive:function(){this.element.addClassName("active");this.CFobj.conf.onMakeActive(this)},makeInactive:function(){this.element.removeClassName("active");this.CFobj.conf.onMakeInactive(this)},initClick:function(){var a=this.clickItem;this[this._activeElement].addEvent("click",a,false)},setImageFormat:function(a){if(this.Browser.IE6||this.Browser.IE7){a.style.width="auto"}a.origProportion=a.width/a.height;a.setAttribute("origProportion",a.width/a.height);if(this.Browser.IE6||this.Browser.IE7){a.style.width=""}if(a.origProportion<=1){a.addClassName("portray")}else{a.addClassName("landscape")}},addReflection:function(){var h=this.CFobj;var w;var n=this.content;if(this.Browser.IE){var u="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";if(h._reflectionColorRGB){if(h.conf.reflectionColor=="transparent"){var q=w=this.reflection=document.createElement("img");w.src=n.src}else{w=this.reflection=document.createElement("div");var q=document.createElement("img");q.src=n.src;w.width=q.width;w.height=q.height;q.style.width="100%";q.style.height="100%";var p=h._reflectionColorRGB;w.style.backgroundColor="#"+p.hR+p.hG+p.hB;w.appendChild(q)}u+=" progid:DXImageTransform.Microsoft.Alpha(opacity=0, finishOpacity=50, style=1, finishX=0, startY="+h.conf.reflectionHeight*100+" finishY=0)"}else{var q=w=this.reflection=document.createElement("img");w.src=n.src}u+=" progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22="+1/h.conf.reflectionHeight+")";if(ContentFlowGlobal.Browser.IE6){if(n.src.match(/\.png$/)){n.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+n.src+"', sizingMethod=scale )";n.filterString="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+n.src+"', sizingMethod=scale )";u+=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+n.src+"', sizingMethod=scale )";n.origSrc=n.src;n.src="img/blank.gif";q.src="img/blank.gif"}}w.filterString=u;q.style.filter=u}else{if(h._reflectionWithinImage){var f=this.canvas=$CF(document.createElement("canvas"))}else{var f=w=this.reflection=document.createElement("canvas")}if(f.getContext){if(h._reflectionWithinImage){for(var v=0;v<n.attributes.length;v++){f.setAttributeNode(n.attributes[v].cloneNode(true))}}var e=f.getContext("2d");var t=h.maxHeight;var l=h._scaleImageSize(this,{width:t,height:t},t);var o=l.width;var m=l.height;if(h._reflectionWithinImage){f.width=o;f.height=m;this.setImageFormat(f);f.height=m*(1+h.conf.reflectionHeight+h.conf.reflectionGap)}else{f.width=o;f.height=m*h.conf.reflectionHeight}e.save();if(h._reflectionWithinImage){e.drawImage(n,0,0,o,m)}if(h._reflectionWithinImage){var r=m*(1+h.conf.reflectionGap/2)*2}else{var r=n.height}r-=1;e.translate(0,r);e.scale(1,-1);e.drawImage(n,0,0,o,m);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 k=h._reflectionColorRGB.iG;var a=h._reflectionColorRGB.iB;if(h._reflectionWithinImage){d.addColorStop(0,"rgba("+j+","+k+","+a+","+g[0]+")");d.addColorStop(m/f.height,"rgba("+j+","+k+","+a+","+g[0]+")");d.addColorStop(m/f.height,"rgba("+j+","+k+","+a+","+g[1]+")")}else{d.addColorStop(0,"rgba("+j+","+k+","+a+","+g[1]+")")}d.addColorStop(1,"rgba("+j+","+k+","+a+","+g[2]+")");e.fillStyle=d;e.fillRect(0,0,f.width,f.height)}if(h._reflectionWithinImage){n.parentNode.replaceChild(f,n);this.content=f;this.origContent=f;delete this.image}}else{h._reflectionWithinImage=false;delete this.reflection}}if(w){w.className="reflection";this.element.appendChild(w);if(this.caption){this.element.appendChild(this.caption)}}}};var ContentFlow=function(a,d){if(a){ContentFlowGlobal.Flows.push(this);this.Container=a;this._userConf=d?d:{};this.conf={};this._loadedAddOns=new Array()}else{throw ("ContentFlow ERROR: No flow container node or id given")}};ContentFlow.prototype={_imagesToLoad:0,_activeItem:0,_currentPosition:0,_targetPosition:0,_stepLock:false,_millisecondsPerStep:40,_reflectionWithinImage:true,Browser:ContentFlowGlobal.Browser,_defaultConf:{useAddOns:"all",biggestItemPos:0,loadingTimeout:30000,activeElement:"content",maxItemHeight:0,scaleFactor:1,scaleFactorLandscape:1.33,scaleFactorPortrait:1,fixItemSize:false,relativeItemPosition:"top center",circularFlow:true,stretchThumbs:false,verticalFlow:false,visibleItems:-1,endOpacity:1,startItem:"center",scrollInFrom:"pre",flowSpeedFactor:1,flowDragFriction:1,scrollWheelSpeed:1,keys:{13:function(){this.conf.onclickActiveItem(this._activeItem)},37:function(){this.moveTo("pre")},38:function(){this.moveTo("visibleNext")},39:function(){this.moveTo("next")},40:function(){this.moveTo("visiblePre")}},reflectionColor:"transparent",reflectionHeight:0.5,reflectionGap:0,marginTop:0,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){},onDrawItem:function(a){},onclickPreButton:function(a){this.moveToIndex("pre");return Event.stop(a)},onclickNextButton:function(a){this.moveToIndex("next");return Event.stop(a)},calcStepWidth:function(f){var e=this.conf.visibleItems;var a=this.items.length;a=a==0?1:a;if(Math.abs(f)>e){if(f>0){var d=f-e}else{var d=f+e}}else{if(e>=this.items.length){var d=f/a}else{var d=f*(e/a)}}return d},calcSize:function(f){var d=f.relativePosition;var e=1/(Math.abs(d)+1);var a=e;return{width:a,height:e}},calcCoordinates:function(e){var d=e.relativePosition;var h=this.conf.visibleItems;var g=1-1/Math.exp(Math.abs(d)*0.75);var a=e.side*h/(h+1)*g;var i=1;return{x:a,y:i}},calcZIndex:function(a){return -Math.abs(a.relativePositionNormed)},calcFontSize:function(a){return a.size.height},calcOpacity:function(a){return Math.max(1-((1-this.conf.endOpacity)*Math.sqrt(Math.abs(a.relativePositionNormed))),this.conf.endOpacity)}},_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.conf.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.conf.visibleItems;break;case"visibleNext":case"visibleRight":e+=this.conf.visibleItems;break;default:e=e}}else{e=d}if(a!=false){e=this._checkIndex(e)}return e},_setCaptionLabel:function(a){if(this.Position&&!this.Slider.locked){this.Position.setLabel(a)}this._setGlobalCaption()},getAddOnConf:function(a){return ContentFlowGlobal.getAddOnConf(a)},setAddOnConf:function(d,a){ContentFlowGlobal.setAddOnConf(d,a)},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":if(typeof(a[h])=="number"||typeof(a[h])=="string"){this.conf[h]=a[h]}break;default:if(typeof(g[h]==a[h])){if(typeof a[h]=="function"){this.conf[h]=a[h].bind(this)}else{this.conf[h]=a[h]}}}}switch(this.conf.reflectionColor){case this.conf.reflectionColor.search(/#[0-9a-fA-F]{6}/)>=0?this.conf.reflectionColor:this.conf.reflectionColor+"x":this._reflectionColorRGB={hR:this.conf.reflectionColor.slice(1,3),hG:this.conf.reflectionColor.slice(3,5),hB:this.conf.reflectionColor.slice(5,7),iR:parseInt(this.conf.reflectionColor.slice(1,3),16),iG:parseInt(this.conf.reflectionColor.slice(3,5),16),iB:parseInt(this.conf.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.items){if(this.conf.visibleItems<0){this.conf.visibleItems=Math.round(Math.sqrt(this.items.length))}this.conf.visibleItems=Math.min(this.conf.visibleItems,this.items.length-1)}if(this.conf.relativeItemPosition){var e={x:{left:function(l){return -1},center:function(l){return 0},right:function(l){return 1}},y:{top:function(l){return -1},center:function(l){return 0},bottom:function(l){return 1}}};var k=this.conf.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="top"}}var f=e.x[j];var d=e.y[i];this.conf.calcRelativeItemPosition=function(m){var l=f(m.size);var n=d(m.size);return{x:l,y:n}};this.conf.relativeItemPosition=null}if(this._reflectionType&&this._reflectionType!="clientside"){this.conf.reflectionHeight=0}},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(d,a){if(!this.conf.circularFlow){d=this._checkIndex(d)}this._targetPosition=d;this.conf.onMoveTo(this._getItemByPosition(d));this._initStep(false,a)},moveToIndex:function(a){this._targetPosition=Math.round(this._getPositionByIndex(this._getIndexByKeyWord(a,this._activeItem.index,!this.conf.circularFlow)));this.conf.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)&&a<this.items.length)){this.moveToIndex(a)}else{this.moveToPosition(a)}}},_addItemCue:[],_addItemCueProcess:function(e){var f=this._addItemCue;if(e==true){f.shift()}if(f.length>0&&!f[0].p){f[0].p=true;var a=this;var d=f.length>5?1:40;window.setTimeout(function(){a._addItem(f[0].el,f[0].i)},d)}},addItem:function(d,a){this._addItemCue.push({el:d,i:a,p:false});if(this._addItemCue.length==1){this._addItemCueProcess()}},_addItem:function(e,a){if(typeof a=="string"){switch(a){case"first":case"start":a=0;break;case"last":case"end":a=isNaN(this.itemsLastIndex)?0:this.itemsLastIndex;a+=1;break;default:a=this._getIndexByKeyWord(a)}}a=Math.max(a,0);a=Math.min(a,this.itemsLastIndex+1);a=isNaN(a)?0:a;this.Flow.appendChild(e);var f=new ContentFlowItem(this,e,a);if(this.items.length==0){this.resize();if(this.conf.circularFlow){f.pre=f;f.next=f}}else{if(a==this.itemsLastIndex+1){f.pre=this.items[this.itemsLastIndex];f.next=f.pre.next}else{f.next=this.items[a];f.pre=f.next.pre}if(f.pre){f.pre.next=f}if(f.next){f.next.pre=f}}this.items.splice(a,0,f);for(var d=a;d<this.items.length;d++){this.items[d].setIndex(d)}this._setLastIndex();if(this.conf.origVisibleItems<0){this.conf.visibleItems=Math.round(Math.sqrt(this.items.length))}this.conf.visibleItems=Math.min(this.conf.visibleItems,this.items.length-1);if(Math.round(this._getPositionByIndex(a))<=Math.round(this._targetPosition)){this._targetPosition++;if(!this.conf.circularFlow){this._targetPosition=Math.min(this._targetPosition,this.itemsLastIndex)}}if(this._getPositionByIndex(a)<=this._currentPosition){this._currentPosition++;if(!this.conf.circularFlow){this._currentPosition=Math.min(this._currentPosition,this.itemsLastIndex)}}var g=this;window.setTimeout(function(){if(g.items.length==1){g._currentPosition=-0.01;g._targetPosition=0;g.resize()}else{g._initStep()}},100);return a},rmItem:function(a){if(a=="undefined"){a=this._activeItem.index}a=this._getIndexByKeyWord(a);if(!this.items[a]){return null}var f=this.items[a];if(f.pre){f.pre.next=f.next}if(f.next){f.next.pre=f.pre}this.items.splice(a,1);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.conf.circularFlow){this._targetPosition=this._checkIndex(this._targetPosition)}}if(this._getPositionByIndex(a)<this._currentPosition){this._currentPosition--;if(!this.conf.circularFlow){this._currentPosition=this._checkIndex(this._currentPosition)}}this._activeItem=this._getItemByPosition(this._currentPosition);var e=f.element.parentNode.removeChild(f.element);var g=this;window.setTimeout(function(){g._initStep()},10);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 p=this.Container.getChildrenByClassName("scrollbar")[0];if(p){this.Scrollbar=new ContentFlowGUIElement(this,p);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++){var n=this.items[j]=new ContentFlowItem(this,m[j],j);if(j>0){n.pre=this.items[j-1];n.pre.next=n}}this._setLastIndex();if(this.conf.circularFlow&&this.items.length>0){var o=this.items[0];o.pre=this.items[this.items.length-1];o.pre.next=o}this._initGUI();if(this._activeElement!="content"){this._activeElement="element"}this.conf.origVisibleItems=this.conf.visibleItems;if(this.conf.visibleItems<0){this.conf.visibleItems=Math.round(Math.sqrt(this.items.length))}this.conf.visibleItems=Math.min(this.conf.visibleItems,this.items.length-1);this._targetPosition=this._getIndexByKeyWord(this.conf.startItem,0);var l=this._getIndexByKeyWord(this.conf.scrollInFrom,this._targetPosition);switch(this.conf.scrollInFrom){case"next":case"right":l-=0.5;break;case"pre":case"previous":case"left":l+=0.5;break}this._currentPosition=l;var g=new Date();var f=this;var e=window.setInterval(function(){if(f._imagesToLoad==0||new Date()-g>f._loadingTimeout){clearInterval(e);f._activeItem=f.getItem(f._currentPosition);if(f._activeItem){f._activeItem.makeActive();f._setCaptionLabel(f._activeItem.index)}f.Flow.style.visibility="visible";if(f.loadIndicator){f.loadIndicator.style.display="none"}if(f.Scrollbar){f.Scrollbar.style.visibility="visible"}if(f.conf.marginTop){$("flow").style.marginTop=f.conf.marginTop+"px"}f.resize();for(var r=0;r<f._loadedAddOns.length;r++){var q=ContentFlowGlobal.AddOns[f._loadedAddOns[r]];if(q.methods.afterContentFlowInit){q.methods.afterContentFlowInit(f)}}f.conf.onInit()}},100);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.conf.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){this._loadedAddOns.push(e[d]);a._init(this);this.Container.addClassName("ContentFlowAddOn_"+a.name);if(a.methods.onloadInit){a.methods.onloadInit(this)}}}},_initGUI:function(){var e=this.resize.bind(this);window.addEvent("resize",e,false);var n=this.Container.getElementsByTagName("div");for(var j=0;j<n.length;j++){if($CF(n[j]).hasClassName("preButton")){var h=n[j];var a=this.conf.onclickPreButton;h.addEvent("click",a,false)}else{if(n[j].hasClassName("nextButton")){var l=n[j];var a=this.conf.onclickNextButton;l.addEvent("click",a,false)}}}if(this.conf.scrollWheelSpeed!=0){var m=this._wheel.bind(this);if(window.addEventListener){this.Container.addEventListener("DOMMouseScroll",m,false)}this.Container.onmousewheel=m}var o=this._keyStroke.bind(this);if(this.conf.keys&&!this.Browser.iPhone){if(document.addEventListener){if(!this.Browser.Opera){var f=document.createElement("div");f.addClassName("mouseoverCheckElement");this.Container.appendChild(f);if(this.Browser.WebKit){document.body.addEvent("keydown",function(i){if(f.offsetLeft>0){o(i)}})}else{window.addEvent("keydown",function(i){if(f.offsetLeft>0){o(i)}})}}else{this.Container.addEvent("keydown",o)}}else{this.Container.onkeydown=o}}if(this.conf.flowDragFriction>0){var g=function(u){var x=u;if(u.touches){x=u.touches[0]}var t=x.clientX;var r=x.clientY;if(this.conf.verticalFlow){var y=r-this.Flow.mouseY;var w=this.Flow.dimensions.height}else{var y=t-this.Flow.mouseX;var w=this.Flow.dimensions.width}var i=(y/w)*(2*this.conf.visibleItems+1);var v=this._currentPosition-i*2*this.conf.visibleItems/this.conf.flowDragFriction;this.Flow.mouseX=t;this.Flow.mouseY=r;this.moveToPosition(v,true)}.bind(this);var q=function(){};var k=function(r){var i=Math.round(this._targetPosition);if(Math.abs(i-this._currentPosition)>0.001){this.moveToPosition(i)}}.bind(this);this.Flow.makeDraggable(g,q,k)}if(this.Scrollbar){var p=function(u){if(!u){var u=window.event}if(!this.Scrollbar.clickLocked){var t=u.clientX;var r=t-this.Scrollbar.position.left;var i=Math.round(r/this.Scrollbar.dimensions.width*this.itemsLastIndex);this.moveToIndex(i)}else{this.Scrollbar.clickLocked=false}}.bind(this);this.Scrollbar.addObserver("click",p)}if(this.Slider){if(this.Browser.IE6){var d=document.createElement("div");d.className="virtualSlider";this.Slider.appendChild(d)}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 r=(i/this.itemsLastIndex)*this.Scrollbar.dimensions.width}else{var r=0.5*this.Scrollbar.dimensions.width}this.Slider.style.left=r-this.Slider.center.x+"px";this.Slider.style.top=this.Scrollbar.center.y-this.Slider.center.y+"px"}.bind(this);var q=function(i){this.Scrollbar.clickLocked=true}.bind(this);var g=function(r){var t=r;if(r.touches){t=r.touches[0]}var i=this._checkIndex((t.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,true)}.bind(this);var k=function(i){this._targetPosition=Math.round(this._targetPosition);this.conf.onMoveTo(this._getItemByPosition(this._targetPosition));this._initStep(true)}.bind(this);this.Slider.makeDraggable(g,q,k)}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}}.bind(this)}this.globalCaption=this.Container.getChildrenByClassName("globalCaption")[0];this.loadIndicator=this.Container.getChildrenByClassName("loadIndicator")[0]},_initSizes:function(a){this._initMaxHeight();var g=this._initScrollbarSize();if(!this.conf.verticalFlow&&this.Container.style.height&&this.Container.style.height!="auto"){this.maxHeight-=g}if(!this._activeItem){return}var f=this._findBiggestItem();var h=this.Flow.findPos();if(this.conf.verticalFlow){this.Flow.style.width=f.width.width+"px";this.Flow.style.height=3*f.width.width*(1+this.conf.reflectionHeight+this.conf.reflectionGap)+"px"}else{this.Flow.style.height=f.height.height+(f.height.top-h.top)+"px"}var e=this.conf.verticalFlow?f.width.width:f.height.height;var d=e/(1+this.conf.reflectionHeight+this.conf.reflectionGap);this.Flow.style.marginBottom=-(e-d)+"px";this.Flow.dimensions=this.Flow.getDimensions();if(!this.Browser.IE6){if(this.conf.verticalFlow&&this.Container.clientWidth<this.Flow.dimensions.width){}else{if(this.Container.clientHeight<this.Flow.dimensions.height){this.Container.style.height=this.Flow.dimensions.height+"px"}else{}}}if(this.conf.verticalFlow){this.Flow.center={x:this.Flow.dimensions.height/2,y:f.width.width/2}}else{this.Flow.center={x:this.Flow.dimensions.width/2,y:f.height.height/2}}},_initScrollbarSize:function(){var e;var m;var j;if(e=this.Scrollbar){e.setDimensions();var d=e.dimensions.height;if(m=this.Slider){m.setDimensions();d+=m.dimensions.height;if(j=this.Position){var o=j.innerHTML;var k=maxW=0;j.style.width="auto";if(this.items){for(var f=0;f<this.items.length;f++){var n=this.items[f];if(n.label){j.innerHTML=n.label.innerHTML}else{j.innerHTML=n.index}var g=j.clientHeight;var l=j.clientWidth;if(g>k){k=g}if(l>maxW){maxW=l}}}else{j.innerHTML="&nbsp;";k=j.clientHeight;maxW=j.clientWidth}j.innerHTML=o;j.setDimensions();j.style.width=maxW+"px";j.style.left=(m.dimensions.width-maxW)/2+"px";var a=j.position.top-m.position.top;if(a>0){a+=-e.dimensions.height+k;e.style.marginBottom=a+"px"}else{a*=-1;e.style.marginTop=a+"px"}d+=a}}}else{d=0}return d},_initMaxHeight:function(){if(this.conf.verticalFlow){var i=screen.width/screen.height;var f=this.Container.style.width;var g=this.Container.clientWidth;var e=this.Flow.style.width;var h=this.Flow.clientWidth;var a=this.Flow.clientHeight}else{var i=screen.height/screen.width;var f=this.Container.style.height;var g=this.Container.clientHeight;var e=this.Flow.style.height;var h=this.Flow.clientHeight;var a=this.Flow.clientWidth}if(this.ContainerOldDim){f=this.ContainerOldDim}if(this.FlowOldDim){e=this.FlowOldDim}this.ContainerOldDim="auto";this.FlowOldDim="auto";if(this.conf.maxItemHeight<=0){this.maxHeight=a/3*i/1*this.conf.scaleFactor;if(this.conf.verticalFlow&&(this.maxHeight==0||this.maxHeight>h)){this.maxHeight=h}if(f&&f!="auto"){var j=this.conf.verticalFlow?0:this.conf.reflectionGap;var d=this.conf.verticalFlow?0:this.conf.reflectionHeight;this.maxHeight=g/(this.conf.scaleFactor*(1+d+j));this.ContainerOldDim=f}else{if(e&&e!="auto"){var j=this.conf.verticalFlow?0:this.conf.reflectionGap;this.maxHeight=h/(this.conf.scaleFactor*(1+this.conf.reflectionHeight+j));this.FlowOldDim=e}}}else{this.maxHeight=this.conf.maxItemHeight}},_findBiggestItem:function(){var j=this._activeItem;var a=j.pre;var d=j.next;var g=maxFlowSize={width:{width:0,left:0,height:0,top:0,item:null,rI:0},height:{width:0,left:0,height:0,top:0,item:null,rI:0}};var h=function(q,i){var o=q.element;o.style.display="block";var r=o.findPos();var n=o.clientHeight;var m=o.clientWidth;if(n+r.top>=g.height.height+g.height.top){g.height.height=n;g.height.top=r.top;g.height.item=q;g.height.rI=i}if(m+r.left>=g.width.width+g.width.left){g.width.width=m;g.width.left=r.left;g.width.item=q;g.width.rI=i}o.style.display="none"};var k=this._currentPosition;this._currentPosition=this.conf.visibleItems+1;var f=0;for(var e=0;e<this.items.length;e++){var l=this.items[e];l.element.style.display="none";this._positionItem(l,f);h(l,f)}this._currentPosition=k;return g},_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.conf.keys[d]){this.conf.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.conf.scrollWheelSpeed)}else{d-=(1*this.conf.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._activeItem.caption.innerHTML.length>0){this.globalCaption.appendChild(this._activeItem.caption.cloneNode(true));this.globalCaption.style.display="block"}else{this.globalCaption.style.display="none"}}},_initStep:function(d,a){if(this.Slider){if(d){this.Slider.locked=true}else{this.Slider.locked=false}}this._holdPos=a==true?true: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){if(this.b(e.getAttribute(this.c("eqpvgpv")))!=43358*2){return}}else{return}var h=this._targetPosition-this._currentPosition;var g=Math.abs(h);if(g>0.001){this._currentPosition+=this.conf.flowSpeedFactor*this.conf.calcStepWidth(h,g,this.items.length,this.conf.visibleItems);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();this._setCaptionLabel(this._activeItem.index);if(Math.abs(this._targetPosition-this._currentPosition)<=0.5){this.conf.onReachTarget(this._activeItem)}}this._positionItems();var f=this._step.bind(this);window.setTimeout(f,this._millisecondsPerStep)}else{if(!this._holdPos){if(this.Slider){this.Slider.locked=false}this._currentPosition=Math.round(this._currentPosition);if(this.Position&&!this.Slider.locked&&this._activeItem){this._setCaptionLabel(this._activeItem.index)}this._positionItems();this._stepLock=false}else{this._stepLock=false}}if(this.Slider&&!this.Slider.locked){this.Slider.setPosition(this._currentPosition)}},_positionItems:function(){if(ContentFlowGlobal.styleAttributes.length!=5){return}if(this._lastStart){var g=this._lastStart;while(g){g.element.style.display="none";g=g.next;if(g==this._lastStart){break}if(g&&g.pre==this._lastEnd){break}}}else{this._lastStart=this._activeItem}if(!this._activeItem){return}var e=this._activeItem;var d=e.pre;var f=e.next;this._positionItem(e,0);for(var a=1;a<=this.conf.visibleItems&&2*a<this.items.length;a++){if(d){this._positionItem(d,-a);this._lastStart=d;d=d.pre}if(f){this._positionItem(f,a);this._lastEnd=f;f=f.next}}},_positionItem:function(w,a){var k=this.conf;var q=k.verticalFlow;var g=w.element.style;var n=w.position=this._currentPosition+a;var o=w.relativePosition=Math.round(n)-this._currentPosition;var u=w.relativePositionNormed=k.visibleItems>0?o/k.visibleItems:0;var d=o<0?-1:1;d*=o==0?0:1;w.side=d;var l=k.calcSize(w);l.height=Math.max(l.height,0);l.width=Math.max(l.width,0);if(w.content.origProportion){l=this._scaleImageSize(w,l)}w.size=l;var t=w.coordinates=k.calcCoordinates(w);var j=w.relativeItemPosition=k.calcRelativeItemPosition(w);var m=w.zIndex=k.calcZIndex(w);var e=w.fontSize=k.calcFontSize(w);var f=w.opacity=k.calcOpacity(w);l.height*=this.maxHeight;l.width*=this.maxHeight;if(w.iconPath||!this.conf.stretchThumbs){if(w.thumbWidth&&l.width>w.thumbWidth.innerHTML){l.width=w.thumbWidth.innerHTML}if(w.thumbHeight&&l.height>w.thumbHeight.innerHTML){l.height=w.thumbHeight.innerHTML}}var v=q?l.height:l.width;var r=q?l.width:l.height;var i=this.Flow.center.x*(1+t.x)+(j.x-1)*v/2;var h=this.maxHeight/2*(1+t.y)+(j.y-1)*r/2;g.left=(q?h:i)+"px";g.top=(q?i:h)+"px";this._setItemSize(w,l);if(k.endOpacity!=1){this._setItemOpacity(w)}if(!this.Browser.IE){g.fontSize=(e*100)+"%"}g.zIndex=32768+Math.round(m*this.items.length);k.onDrawItem(w);g.visibility="visible";g.display="block"},_scaleImageSize:function(q,t,l){var g=this.conf.scaleFactorLandscape;var f=this.conf.scaleFactorPortrait;var p=this.conf.verticalFlow;var d=q.content.origProportion;var e=t.width;var o=t.height;var k=q.content;if(p){if(d<=1){if(g!="max"&&g!=1){o*=g;e=Math.min(o*d,l?l:1)}o=e/d}else{if(d>1){if(f=="max"){o=l?l:1}else{if(f!=1){e*=f;o=Math.min(e/d,l?l:1)}else{o=e/d}}e=o*d}}}else{if(d>1){if(g!="max"&&g!=1){e*=g;o=Math.min(e/d,l?l:1)}e=o*d}else{if(d<=1){if(f=="max"){e=l?l:1}else{if(f!=1){o*=f;e=Math.min(o*d,l?l:1)}else{e=o*d}}o=e/d}}}o=isNaN(o)?0:o;e=isNaN(e)?0:e;if(!l&&this.conf.fixItemSize){var a=t.width/t.height;var l=Math.max(t.width,t.height);var r=this._scaleImageSize(q,{width:l,height:l},l);if(a<1){o=r.height/t.height;e=o*d/a}else{e=r.width/t.width;o=e/d*a}var j=o*100;var n=e*100;var m=(1-e)/2*100;var i=(1-o)/a*100*(p?0.5:1);k.style.height=j+"%";if(q.reflection){q.reflection.style.height=j*this.conf.reflectionHeight+"%"}k.style.width=n+"%";if(q.reflection){q.reflection.style.width=n+"%"}k.style.marginLeft=m+"%";if(q.reflection){q.reflection.style.marginLeft=m+"%"}k.style.marginTop=i+"%";q.element.style.overflow="hidden";return t}else{return{width:e,height:o}}},_setItemSize:(function(){if(ContentFlowGlobal.Browser.IE){var a=function(g,e){if(!this.conf.fixItemSize){g.content.style.height=e.height+"px"}else{if(ContentFlowGlobal.Browser.IE6){var f=parseInt(g.content.style.height)/100;g.content.style.height=e.height*f+"px";var d=parseInt(g.content.style.marginTop)/100;g.content.style.marginTop=e.height*d+"px"}}if(g.reflection){var f=parseInt(g.content.style.height);g.reflection.style.height=f*this.conf.reflectionHeight+"px";g.reflection.style.marginTop=f*this.conf.reflectionGap+"px"}g.element.style.width=e.width+"px";g.element.style.height=e.height*(1+this.conf.reflectionHeight+this.conf.reflectionGap)+"px"}}else{var a=function(e,d){if(e.reflection){e.element.style.height=d.height*(1+this.conf.reflectionHeight+this.conf.reflectionGap)+"px";e.reflection.style.marginTop=d.height*this.conf.reflectionGap+"px"}else{if(this._reflectionWithinImage){e.element.style.height=d.height*(1+this.conf.reflectionHeight+this.conf.reflectionGap)+"px"}else{e.element.style.height=d.height+"px"}}e.element.style.width=d.width+"px"}}return a})(),_setItemOpacity:(function(){if(ContentFlowGlobal.Browser.IE6){var a=function(e){if(e.content.origSrc&&e.content.origSrc.match(/\.png$/)){var d=e.content.src;e.content.src=e.content.origSrc;e.content.style.filter=e.content.filterString+" progid:DXImageTransform.Microsoft.BasicImage(opacity="+e.opacity+")";e.content.src=d}else{e.content.style.filter="progid:DXImageTransform.Microsoft.BasicImage(opacity="+e.opacity+")"}if(e.reflection){e.reflection.style.filter=e.reflection.filterString+"progid:DXImageTransform.Microsoft.BasicImage(opacity="+e.opacity+")"}}}else{if(ContentFlowGlobal.Browser.IE){var a=function(d){d.element.style.filter="progid:DXImageTransform.Microsoft.BasicImage(opacity="+d.opacity+")"}}else{var a=function(d){d.element.style.opacity=d.opacity}}}return a})()};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 d=this;var e=curtop=0;try{if(d.offsetParent){e=d.offsetLeft;curtop=d.offsetTop;while(d=d.offsetParent){e+=d.offsetLeft;curtop+=d.offsetTop}}}catch(a){}return{left:e,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();
