@@ -, +, @@
http://www.jacksasylum.eu/ContentFlow
---
.../opac-tmpl/bootstrap/lib/contentflow/CHANGELOG | 270 +++
.../lib/contentflow/ContentFlowAddOn_DEFAULT.css | 155 ++
.../lib/contentflow/ContentFlowAddOn_DEFAULT.js | 290 +++
.../opac-tmpl/bootstrap/lib/contentflow/LICENSE | 19 +
.../bootstrap/lib/contentflow/changelog.html | 291 +++
.../bootstrap/lib/contentflow/contentflow.css | 1 +
.../bootstrap/lib/contentflow/contentflow.js | 2 +
.../bootstrap/lib/contentflow/contentflow_src.css | 250 ++
.../bootstrap/lib/contentflow/contentflow_src.js | 2550 ++++++++++++++++++++
.../opac-tmpl/bootstrap/lib/contentflow/docu.html | 1018 ++++++++
.../lib/contentflow/img/1x1_0.5_black.png | Bin 0 -> 82 bytes
.../bootstrap/lib/contentflow/img/blank.gif | Bin 0 -> 43 bytes
.../bootstrap/lib/contentflow/img/loader.gif | Bin 0 -> 8238 bytes
.../lib/contentflow/img/scrollbar_white.png | Bin 0 -> 82 bytes
.../bootstrap/lib/contentflow/img/slider_white.png | Bin 0 -> 178 bytes
.../opac-tmpl/bootstrap/lib/contentflow/index.html | 113 +
.../bootstrap/lib/contentflow/license.html | 50 +
.../bootstrap/lib/contentflow/mycontentflow.css | 3 +
.../lib/contentflow/mycontentflow.css.example | 120 +
.../bootstrap/lib/contentflow/pics/pic0.png | Bin 0 -> 1208 bytes
.../bootstrap/lib/contentflow/pics/pic1.png | Bin 0 -> 1063 bytes
.../bootstrap/lib/contentflow/pics/pic2.png | Bin 0 -> 773 bytes
.../opac-tmpl/bootstrap/lib/contentflow/styles.css | 220 ++
.../opac-tmpl/bootstrap/lib/contentflow/title.png | Bin 0 -> 3947 bytes
24 files changed, 5352 insertions(+)
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/CHANGELOG
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/ContentFlowAddOn_DEFAULT.css
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/ContentFlowAddOn_DEFAULT.js
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/LICENSE
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/changelog.html
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/contentflow.css
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/contentflow.js
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/contentflow_src.css
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/contentflow_src.js
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/docu.html
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/img/1x1_0.5_black.png
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/img/blank.gif
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/img/loader.gif
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/img/scrollbar_white.png
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/img/slider_white.png
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/index.html
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/license.html
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/mycontentflow.css
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/mycontentflow.css.example
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/pics/pic0.png
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/pics/pic1.png
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/pics/pic2.png
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/styles.css
create mode 100755 koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/title.png
--- a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/CHANGELOG
+++ a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/CHANGELOG
@@ -0,0 +1,270 @@
+ContenFolw ChangeLog
+====================
+
+version 1.0 (2010/02/09)
+-------------------------
+
+ Beware: Because of a major restructuring, this release will break with older
+ AddOns and possibly with user defined configurations. If you have
+ defined your own calculation methods (calcSize, calcCoordinates,
+ calcRelativeItemPosition, calcZIndex or calcFontSize) you have to
+ rework them.
+ If you use AddOns please update to the new version of the AddOn.
+
+ * moved to relative return values for the following methods:
+ calcSize := returns values ranging from 0.0 - 1.0
+ calcCoordinates := returns values ranging from -1.0 to 1.0
+ calcRelativeItemPosition := returns values ranging from -1.0 to 1.0
+
+ * changed the paramters of the following methods:
+ calcStepWidth : ( diff )
+ calcSize : ( item )
+ calcCoordinates : ( item )
+ calcRelativeItemPosition : ( item )
+ calcZIndex : ( item )
+ calcFontSize : ( item )
+
+ * added the following properties to the item object:
+ next, position, pre, relativePosition, relativePositionNormed, side, size
+
+ * better image scaling in IE7 (bicubic interpolation)
+
+ * changed landscapeScaleFactor default value to 1.33
+
+ * moved from 20 to 25 redraws/recalculations/frames per second
+
+ * refined calculation of flow size
+
+ * speedup by internel code cleanup
+
+ * unified AddOn configuration
+
+ * renamed 'container' to 'Container'
+
+ * documentation update
+
+
+ * addeded direct usage of image tags as items
+
+ * added support for transparent PNGs on IE6
+
+ * added touch handling on iPhone
+ Dragging of the whole Flow and the scrollbar works now on the iPhone
+
+ * added onDrawItem method
+
+ * added fluid opacity change
+ - option: endOpacity
+ - method: calcOpacity
+
+ * added fixItemSize option
+
+ * added reflectionGap option
+
+ * added scaleFactorPortrait option
+
+ * automatic scrolling to item will now be supressed if the onclickInactiveItem
+ method returns 'false'
+
+ * added conf object to flow
+
+
+ * removed server side reflections
+ - removed reflectionType option
+ reflectionHeight = 0 deactivetes the reflection
+ - removed negativeMarginOnFloat option
+ - removed reflectionServerSrc option
+
+ * removed obsolete contentPosition option
+
+
+ * fixed FF drag problem
+
+ * fixed addItem method
+
+ * fixed rmItem method
+
+
+
+version 0.7.2 (2009/10/01)
+-------------------------
+ * fixed possible conflict with jquery, prototype
+ * fixed Konqueror 4 init bug
+ * fixed iPhone init bug
+ * fixed IE 6,7,8 / mootools compatibility
+ thanks to Michael Birchler
+ * fixed IE6 scalefactor bug
+ * simplified internal click event handling
+ * added 'return' key to call the onclickActiveItem method
+
+version 0.7 (2009/04/09)
+------------------------
+ Beware: Because of a major restructuring, this release will break with older
+ AddOns and possibly with user defined configurations. If you have
+ defined your own methods (i.e. calcCoordinates or onclickActiveItem)
+ you have to move the definitions into the configuration object.
+ If you use AddOns please update to the new version of the AddOn.
+
+ In any other case you can use the new version without any modification.
+
+ * moved user definable method definitions to configuration
+ * speedup by reducing number of calculations
+ * flow element will now be centered within ContentFlow element
+ * better handling of large images by Canvas supporting Browsers (all except IE)
+ * removed reflectionOverlay option
+ * removed set* methods to set methods
+ * removed getConfig method
+ * added cursermove style to slider
+ * added "left" and "right" to position keywords (same as 'pre' and 'next')
+
+ * added optional 'useAddOns' attribute to ContentFlow (X)HTML element
+ * added optional deactivation of mousewheel
+ * added revers mousewheel scrolling
+ * added optional deactivation of keyboard
+ * added optional deactivation of drag 'n throw
+
+ * added keys option
+ * added verticalFlow option
+ * added contentPosition option
+ * added relativeItemPosition option
+
+ * added onReachTarget method
+ * added onMoveTo method
+ * added onMakeInactive method
+ * added onclickInactiveItem method
+
+ * fixed reload bug in Firefox 3 (Gecko 1.9)
+ * fixed keyboard actions on FireFox (Gecko) and Safari (WebKit)
+ * fixed refelctions on iPhone
+ * fixed bug in moveTo method
+ * fixed item positioning
+ * fixed bug if 'scrollInFrom' was set to 'none'
+ * fixed disappearing position label
+
+ * structure cleanup
+
+
+version 0.6 (2008/09/27)
+------------------------
+ This release contains major changes and could break with previous versions.
+ But most times it can be used as a drop-in replacement.
+
+ * added AddOn System
+
+ * handles now 'href' and 'target' attributes of 'item' and 'content' items
+ by default
+
+ * will respect style-height attributes of ContentFlow and flow elements
+ (has to be defined on the element it self)
+
+ * moved fancyScrollbar to AddOn
+
+ * added optional 'label' element to item (will be used as slider label)
+ (great for time lines)
+
+ * scrollbar will be hidden until loader is hidden
+
+ * default loader height fixed
+
+ * switched from array based structure to object based structure for items
+
+ * switched from index based calculations to global position based calculations
+
+ * merged mycontentflow.css into contentflow.css and and added mycontentflow.css.example
+
+ * new Initialization System
+ - init when DOM is fully loaded
+ - auto init of flows
+ - auto loading of stylesheets
+ - auto load of AddOns
+ - background init of images
+
+ * changed calculation methods
+ - added calcCoordinates
+ - added calcRelativeItemPosition
+ - removed calcPosition
+
+ * new methods
+ - onMakeActive
+ - onclickPreButton
+ - onclickNextButton
+
+ * new options
+ - useAddOns
+ - circularFlow
+ - activeElement
+
+ * enhanced options
+ - added scaleFactorLandscape option value "max"
+ - flowDragFriction deactivates drag 'n throw if set to '0'
+ - scrollWheelSpeed deactivates scrollwheel if set to '0'
+
+ * internal restructuring and cleanup
+
+ * removed unneeded images
+
+ * switched to yuicompressor for javascript compression
+
+ * squashed many bugs
+
+
+version 0.5.3 (2008/05/22)
+------------------------
+ * resize bug fixed
+ * renamed maxHeight configuration option to maxItemHeight
+
+version 0.5.2 (2008/05/21)
+------------------------
+ * bugfixes
+
+version 0.5.1 (2008/05/18)
+------------------------
+ * bugfixes
+
+version 0.5 (2008/05/18)
+------------------------
+ * if reflections are used images scale nicer and scrolling is more fluid
+ in Firefox, Safari and Opera (or any other browser which knows about 'canvas')
+ * added fancy scrollbar (with pre and next button)
+ * added maxHeight conf property
+ (if set content will be scaled depending on maxHeight)
+ * moveTo method can handle keywords like 'pre', 'next', 'start' or 'end'
+ * code cleanup
+
+version 0.4 (2008/02/12)
+------------------------
+ * dynamically add and remove items !
+ * caption of item is now optional
+ * added setter for: clickActiveItem, calcSize, calcPosition, calcZIndex, calcFontSize
+ * added getter for: config, activeItem, numberOfItems
+ * squashed some bugs
+ * some clean up
+
+version 0.3 (2008/01/26)
+------------------------
+ * revamp of reflection handling:
+ - added client side reflection generation !!!
+ YES! Browser generated reflections without flash!
+ - bedder handling of reflection sizes
+ - bedder handling of server side reflection sources
+ - bedder handling of overlays in IE6
+ - removed unneeded options
+ - added more flexible options
+ - fix positioning of items in IE6
+ * fixed resize event handling in IE
+ * fixed slider-position element handling in IE6
+ * fixed some minor bugs
+
+version 0.2 (2008/01/22)
+------------------------
+ * handles now node-object and node-id string on object creation
+ * configuration options are now given as configuration object
+ * auto initialization on window load
+ * auto detection of usage of load indicator, global caption and scrollbar
+ * removed obsolete configuration options
+ * minor cleanups
+
+version 0.1 (2008/01/10)
+------------------------
+ * initial release
+
--- a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/ContentFlowAddOn_DEFAULT.css
+++ a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/ContentFlowAddOn_DEFAULT.css
@@ -0,0 +1,155 @@
+/* ContentFlowAddOn_DEFAULT, version 1.0.0
+ * (c) 2008 - 2010 Sebastian Kutsch
+ *
+ *
+ * This file is distributed under the terms of the MIT license.
+ * (see http://www.jacksasylum.eu/ContentFlow/LICENSE)
+ *
+ *--------------------------------------------------------------------------*/
+
+/*
+ * This is an example file of an AddOn stylesheet. All values are the default
+ * values as they are found in 'mycontentflow.css'.
+ *
+ * It should give you a good idea which elements of the ContentFlow you can
+ * style and how to excess them.
+ *
+ * To use this stylesheet follow this guideline:
+ *
+ * 1. Create a new AddOn and use the addStylesheet method in the init method.
+ * Take a look at ContentFlowAddOn_DEFAULT.js to know how.
+ * So a minimal AddOn file just to apply this stylesheet would look like this:
+ * new ContentFlowAddOn ('ADDONNAME', {
+ * init: function () { this.addStylesheet(); }
+ * });
+ *
+ * 2. Rename all class definitions '.ContentFlowAddOn_DEFAULT' to
+ * '.ContentFlowAddOn_ADDONNAME'.
+ * Where ADDONNAME is the name of your AddOn.
+ *
+ * 3. Make the changes you like
+ *
+ * 4. Reload your page :-)
+ *
+ */
+
+/* ========== ContentFlow ========== */
+/*
+ * Within this file you can adjust the styling of ContentFlow
+ * to your personal needs. The default styling is the same as found on the
+ * project page.
+ *
+ */
+
+.ContentFlowAddOn_DEFAULT {
+}
+
+ /* ----- styling of items ----- */
+ .ContentFlowAddOn_DEFAULT .flow .item.active {
+ cursor: pointer;
+ }
+ .ContentFlowAddOn_DEFAULT .flow .item .caption {
+ font-size: 100%;
+ font-weight: bold;
+ text-align: center;
+ color: white;
+ max-height: 30%;
+ bottom: 10%;
+ background: url(img/1x1_0.5_black.png);
+ width: 100%;
+ }
+ * html .ContentFlowAddOn_DEFAULT .flow .item .caption {
+ background-image: none;
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='img/1x1_0.5_black.png');
+ }
+ .ContentFlowAddOn_DEFAULT .flow .item .caption a,
+ .ContentFlowAddOn_DEFAULT .flow .item .caption a:link,
+ .ContentFlowAddOn_DEFAULT .flow .item .caption a:visited,
+ .ContentFlowAddOn_DEFAULT .flow .item .caption a:active,
+ .ContentFlowAddOn_DEFAULT .flow .item .caption a:hover {
+ text-decoration: none;
+ color: white;
+ font-style: italic;
+ font-size: 0.8em;
+ }
+ .ContentFlowAddOn_DEFAULT .flow .item .caption a:hover {
+ text-decoration: underline;
+ }
+ .ContentFlowAddOn_DEFAULT .flow .item.active .caption {
+ /*display: block;*/ /* uncomment to show caption inside item */
+ }
+
+ /* ----- scrollbar ----- */
+ .ContentFlowAddOn_DEFAULT .scrollbar {
+ width: 50%;
+ margin: 0px auto;
+ height: 16px;
+ background: url(img/scrollbar_white.png) left center repeat-x;
+ position: relative;
+ }
+
+ .ContentFlowAddOn_DEFAULT .scrollbar .slider {
+ width: 16px;
+ height: 16px;
+ background: url(img/slider_white.png) center center no-repeat;
+ }
+
+ /* only for IE <= 6 and a alphatransparent slider image */
+ * html .ContentFlow .scrollbar .slider { background-image: none; }
+ * html .ContentFlow .scrollbar .slider .virtualSlider {
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='img/slider_white.png');
+ }
+
+ .ContentFlowAddOn_DEFAULT .scrollbar .slider .position {
+ top: 120%;
+ font-size: 16px;
+ font-weight: bold;
+ color: silver
+ }
+
+ /* ----- global caption ----- */
+ .ContentFlowAddOn_DEFAULT .globalCaption {
+ text-align: center;
+ font-weight: bold;
+ color: white;
+ font-size: 14px;
+ height: 20px;
+ margin: 2em auto;
+ }
+ .ContentFlowAddOn_DEFAULT .globalCaption .caption {
+ }
+ .ContentFlowAddOn_DEFAULT .globalCaption .caption a,
+ .ContentFlowAddOn_DEFAULT .globalCaption .caption a:link,
+ .ContentFlowAddOn_DEFAULT .globalCaption .caption a:visited,
+ .ContentFlowAddOn_DEFAULT .globalCaption .caption a:active,
+ .ContentFlowAddOn_DEFAULT .globalCaption .caption a:hover {
+ text-decoration: none;
+ color: white;
+ font-style: italic;
+ font-size: 0.8em;
+ }
+
+ .ContentFlowAddOn_DEFAULT .globalCaption .caption a:hover {
+ text-decoration: underline;
+ }
+
+ /* ----- load indicator ----- */
+ .ContentFlowAddOn_DEFAULT .loadIndicator {
+ width: 100%;
+ height: 100%;
+ top: 0px;
+ left: 0px;
+ background: url(img/1x1_0.5_black.png);
+ }
+ * html .ContentFlowAddOn_DEFAULT .loadIndicator {
+ background-image: none;
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='img/1x1_0.5_black.png');
+ }
+ .ContentFlowAddOn_DEFAULT .loadIndicator .indicator {
+ background: url(img/loader.gif) center center no-repeat;
+ width: 100%;
+ height: 100%;
+ }
+
+/* ================================= */
+
--- a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/ContentFlowAddOn_DEFAULT.js
+++ a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/ContentFlowAddOn_DEFAULT.js
@@ -0,0 +1,290 @@
+/* ContentFlowAddOn_DEFAULT, version 1.0.0
+ * (c) 2008 - 2010 Sebastian Kutsch
+ *
+ *
+ * This file is distributed under the terms of the MIT license.
+ * (see http://www.jacksasylum.eu/ContentFlow/LICENSE)
+ */
+
+/*
+ * This is an example file of an AddOn file and will not be used by ContentFlow.
+ * All values are the default values of ContentFlow.
+ *
+ * To create a new AddOn follow this guideline:
+ * (replace ADDONNAME by the name of your AddOn)
+ *
+ * 1. rename this file to ContentFlowAddOn_ADDONNAME.js
+ * 2. Change the string 'DEFAULT' in the 'new ContentFlowAddOn' line to 'ADDONNAME'
+ * 3. Make the changes you like/need
+ * 4. Remove all settings you do not need (or comment out for testing).
+ * 5. Add 'ADDONNAME' to the load attribute of the ContentFlow script tag in your web page
+ * 6. Reload your page :-)
+ *
+ */
+new ContentFlowAddOn ('DEFAULT', {
+
+ /*
+ * AddOn configuration object, defining the default configuration values.
+ */
+ conf: {},
+
+ /*
+ * This function will be executed on creation of this object (on load of this file).
+ * It's mostly intended to automatically add additional stylesheets and javascripts.
+ *
+ * Object helper methods and parameters:
+ * scriptpath: basepath of this AddOn (without the filename)
+ * addScript(path): adds a javascript-script tag to the head with the src set to 'path'
+ * i.e. this.addScript(scriptpath+"MyScript.js") .
+ *
+ * addStylesheet(path): adds a css-stylesheet-link tag to the head with href set to
+ * 'path' i.e. this.addStylesheet(scriptpath+"MyStylesheet.css") .
+ * If path is omittet it defaults to :
+ * scriptpath+'ContentFlowAddOn_ADDONNAME.css'.
+ *
+ */
+ init: function() {
+ // this.addScript();
+ // this.addStylesheet();
+ },
+
+ /*
+ * This method will be executed for each ContentFlow on the page after the
+ * HTML document is loaded (when the whole DOM exists). You can use it to
+ * add elements automatically to the flow.
+ *
+ * flow: the DOM object of the ContentFlow
+ * flow.Flow: the DOM object of the 'flow' element
+ * flow.Scrollbar: the DOM object of the 'scrollbar' element
+ * flow.Slider: the DOM object of the 'slider' element
+ * flow.globalCaption: the DOM object of the 'globalCaption' element
+ *
+ * You can access also all public methods of the flow by 'flow.METHOD' (see documentation).
+ */
+ onloadInit: function (flow) {
+ },
+
+ /*
+ * This method will be executed _after_ the initialization of each ContentFlow.
+ */
+ afterContentFlowInit: function (flow) {
+ },
+ /*
+ * ContentFlow configuration.
+ * Will overwrite the default configuration (or configuration of previously loaded AddOns).
+ * For a detailed explanation of each value take a look at the documentation.
+ */
+ ContentFlowConf: {
+ loadingTimeout: 30000, // milliseconds
+ activeElement: 'content', // item or content
+
+ maxItemHeight: 0, // 0 == auto, >0 max item height in px
+ scaleFactor: 1.0, // overall scale factor of content
+ scaleFactorLandscape: 1.33, // scale factor of landscape images ('max' := height= maxItemHeight)
+ scaleFactorPortrait: 1.0, // scale factor of portraoit and square images ('max' := width = item width)
+ fixItemSize: false, // don't scale item size to fit image, crop image if bigger than item
+ relativeItemPosition: "top center", // align top/above, bottom/below, left, right, center of position coordinate
+
+ circularFlow: true, // should the flow wrap around at begging and end?
+ verticalFlow: false, // turn ContentFlow 90 degree counterclockwise
+ visibleItems: -1, // how man item are visible on each side (-1 := auto)
+ endOpacity: 1, // opacity of last visible item on both sides
+ startItem: "center", // which item should be shown on startup?
+ scrollInFrom: "pre", // from where should be scrolled in?
+
+ flowSpeedFactor: 1.0, // how fast should it scroll?
+ flowDragFriction: 1.0, // how hard should it be be drag the floe (0 := no dragging)
+ scrollWheelSpeed: 1.0, // how fast should the mouse wheel scroll. nagive values will revers the scroll direction (0:= deactivate mouse wheel)
+ keys: { // key => function definition, if set to {} keys ar deactivated
+ 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", // none, transparent, overlay or hex RGB CSS style #RRGGBB
+ reflectionHeight: 0.5, // float (relative to original image height)
+ reflectionGap: 0.0, // gap between the image and the reflection
+
+
+ /*
+ * ==================== helper and calculation methods ====================
+ *
+ * This section contains all user definable methods. With thees you can
+ * change the behavior and the visual effects of the flow.
+ * For an explanation of each method take a look at the documentation.
+ *
+ * BEWARE: All methods are bond to the ContentFlow!!!
+ * This means that the keyword 'this' refers to the ContentFlow
+ * which called the method.
+ */
+
+ /* ==================== actions ==================== */
+
+ /*
+ * called after the inactive item is clicked.
+ */
+ onclickInactiveItem : function (item) {},
+
+ /*
+ * called after the active item is clicked.
+ */
+ onclickActiveItem: function (item) {
+ var url, target;
+
+ if (url = item.content.getAttribute('href')) {
+ target = item.content.getAttribute('target');
+ }
+ else if (url = item.element.getAttribute('href')) {
+ target = item.element.getAttribute('target');
+ }
+ else if (url = item.content.getAttribute('src')) {
+ target = item.content.getAttribute('target');
+ }
+
+ if (url) {
+ if (target)
+ window.open(url, target).focus();
+ else
+ window.location.href = url;
+ }
+ },
+
+ /*
+ * called when an item becomes inactive.
+ */
+ onMakeInactive: function (item) {},
+
+ /*
+ * called when an item becomes active.
+ */
+ onMakeActive: function (item) {},
+
+ /*
+ * called when the target item/position is reached
+ */
+ onReachTarget: function(item) {},
+
+ /*
+ * called when a new target is set
+ */
+ onMoveTo: function(item) {},
+
+ /*
+ * called each item an item is drawn (after scaling and positioning)
+ */
+ onDrawItem: function(item) {},
+
+ /*
+ * called if the pre-button is clicked.
+ */
+ onclickPreButton: function (event) {
+ this.moveToIndex('pre');
+ Event.stop(event);
+ },
+
+ /*
+ * called if the next-button is clicked.
+ */
+ onclickNextButton: function (event) {
+ this.moveToIndex('next');
+ Event.stop(event);
+ },
+
+ /* ==================== calculations ==================== */
+
+ /*
+ * calculates the width of the step.
+ */
+ calcStepWidth: function(diff) {
+ var vI = this.conf.visibleItems;
+ var items = this.items.length;
+ items = items == 0 ? 1 : items;
+ if (Math.abs(diff) > vI) {
+ if (diff > 0) {
+ var stepwidth = diff - vI;
+ } else {
+ var stepwidth = diff + vI;
+ }
+ } else if (vI >= this.items.length) {
+ var stepwidth = diff / items;
+ } else {
+ var stepwidth = diff * ( vI / items);
+ }
+ return stepwidth;
+ },
+
+
+ /*
+ * calculates the size of the item at its relative position x
+ *
+ * relativePosition: Math.round(Position(activeItem)) - Position(item)
+ * side: -1, 0, 1 :: Position(item)/Math.abs(Position(item)) or 0
+ * returns a size object
+ */
+ calcSize: function (item) {
+ var rP = item.relativePosition;
+
+ var h = 1/(Math.abs(rP)+1);
+ var w = h;
+ return {width: w, height: h};
+ },
+
+ /*
+ * calculates the position of an item within the flow depending on it's relative position
+ *
+ * relativePosition: Math.round(Position(activeItem)) - Position(item)
+ * side: -1, 0, 1 :: Position(item)/Math.abs(Position(item)) or 0
+ */
+ calcCoordinates: function (item) {
+ var rP = item.relativePosition;
+ //var rPN = item.relativePositionNormed;
+ var vI = this.conf.visibleItems;
+
+ var f = 1 - 1/Math.exp( Math.abs(rP)*0.75);
+ var x = item.side * vI/(vI+1)* f;
+ var y = 1;
+
+ return {x: x, y: y};
+ },
+
+ /*
+ * calculates the position of an item relative to it's calculated coordinates
+ * x,y = 0 ==> center of item has the position calculated by
+ * calculateCoordinates
+ *
+ * relativePosition: Math.round(Position(activeItem)) - Position(item)
+ * side: -1, 0, 1 :: Position(item)/Math.abs(Position(item)) or 0
+ * size: size object calculated by calcSize
+ */
+ calcRelativeItemPosition: function (item) {
+ var x = 0;
+ var y = -1;
+ return {x: x, y: y};
+ },
+
+ /*
+ * calculates and returns the relative z-index of an item
+ */
+ calcZIndex: function (item) {
+ return -Math.abs(item.relativePositionNormed);
+ },
+
+ /*
+ * calculates and returns the relative font-size of an item
+ */
+ calcFontSize: function (item) {
+ return item.size;
+ },
+
+ /*
+ * calculates and returns the opacity of an item
+ */
+ calcOpacity: function (item) {
+ return Math.max(1 - ((1 - this.conf.endOpacity ) * Math.sqrt(Math.abs(item.relativePositionNormed))), this.conf.endOpacity);
+ }
+
+ }
+
+});
--- a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/LICENSE
+++ a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2007 - 2010 Sebastian Kutsch
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
--- a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/changelog.html
+++ a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/changelog.html
@@ -0,0 +1,291 @@
+
+
+
+ContenFolw ChangeLog
+====================
+
+version 1.0 (2010/02/09)
+-------------------------
+
+ Beware: Because of a major restructuring, this release will break with older
+ AddOns and possibly with user defined configurations. If you have
+ defined your own calculation methods (calcSize, calcCoordinates,
+ calcRelativeItemPosition, calcZIndex or calcFontSize) you have to
+ rework them.
+ If you use AddOns please update to the new version of the AddOn.
+
+ * moved to relative return values for the following methods:
+ calcSize := returns values ranging from 0.0 - 1.0
+ calcCoordinates := returns values ranging from -1.0 to 1.0
+ calcRelativeItemPosition := returns values ranging from -1.0 to 1.0
+
+ * changed the paramters of the following methods:
+ calcStepWidth : ( diff )
+ calcSize : ( item )
+ calcCoordinates : ( item )
+ calcRelativeItemPosition : ( item )
+ calcZIndex : ( item )
+ calcFontSize : ( item )
+
+ * added the following properties to the item object:
+ next, position, pre, relativePosition, relativePositionNormed, side, size
+
+ * better image scaling in IE7 (bicubic interpolation)
+
+ * changed landscapeScaleFactor default value to 1.33
+
+ * moved from 20 to 25 redraws/recalculations/frames per second
+
+ * refined calculation of flow size
+
+ * speedup by internel code cleanup
+
+ * unified AddOn configuration
+
+ * renamed 'container' to 'Container'
+
+ * documentation update
+
+
+ * addeded direct usage of image tags as items
+
+ * added support for transparent PNGs on IE6
+
+ * added touch handling on iPhone
+ Dragging of the whole Flow and the scrollbar works now on the iPhone
+
+ * added onDrawItem method
+
+ * added fluid opacity change
+ - option: endOpacity
+ - method: calcOpacity
+
+ * added fixItemSize option
+
+ * added reflectionGap option
+
+ * added scaleFactorPortrait option
+
+ * automatic scrolling to item will now be supressed if the onclickInactiveItem
+ method returns 'false'
+
+ * added conf object to flow
+
+
+ * removed server side reflections
+ - removed reflectionType option
+ reflectionHeight = 0 deactivetes the reflection
+ - removed negativeMarginOnFloat option
+ - removed reflectionServerSrc option
+
+ * removed obsolete contentPosition option
+
+
+ * fixed FF drag problem
+
+ * fixed addItem method
+
+ * fixed rmItem method
+
+
+
+version 0.7.2 (2009/10/01)
+-------------------------
+ * fixed possible conflict with jquery, prototype
+ * fixed Konqueror 4 init bug
+ * fixed iPhone init bug
+ * fixed IE 6,7,8 / mootools compatibility
+ thanks to Michael Birchler
+ * fixed IE6 scalefactor bug
+ * simplified internal click event handling
+ * added 'return' key to call the onclickActiveItem method
+
+version 0.7 (2009/04/09)
+------------------------
+ Beware: Because of a major restructuring, this release will break with older
+ AddOns and possibly with user defined configurations. If you have
+ defined your own methods (i.e. calcCoordinates or onclickActiveItem)
+ you have to move the definitions into the configuration object.
+ If you use AddOns please update to the new version of the AddOn.
+
+ In any other case you can use the new version without any modification.
+
+ * moved user definable method definitions to configuration
+ * speedup by reducing number of calculations
+ * flow element will now be centered within ContentFlow element
+ * better handling of large images by Canvas supporting Browsers (all except IE)
+ * removed reflectionOverlay option
+ * removed set* methods to set methods
+ * removed getConfig method
+ * added cursermove style to slider
+ * added "left" and "right" to position keywords (same as 'pre' and 'next')
+
+ * added optional 'useAddOns' attribute to ContentFlow (X)HTML element
+ * added optional deactivation of mousewheel
+ * added revers mousewheel scrolling
+ * added optional deactivation of keyboard
+ * added optional deactivation of drag 'n throw
+
+ * added keys option
+ * added verticalFlow option
+ * added contentPosition option
+ * added relativeItemPosition option
+
+ * added onReachTarget method
+ * added onMoveTo method
+ * added onMakeInactive method
+ * added onclickInactiveItem method
+
+ * fixed reload bug in Firefox 3 (Gecko 1.9)
+ * fixed keyboard actions on FireFox (Gecko) and Safari (WebKit)
+ * fixed refelctions on iPhone
+ * fixed bug in moveTo method
+ * fixed item positioning
+ * fixed bug if 'scrollInFrom' was set to 'none'
+ * fixed disappearing position label
+
+ * structure cleanup
+
+
+version 0.6 (2008/09/27)
+------------------------
+ This release contains major changes and could break with previous versions.
+ But most times it can be used as a drop-in replacement.
+
+ * added AddOn System
+
+ * handles now 'href' and 'target' attributes of 'item' and 'content' items
+ by default
+
+ * will respect style-height attributes of ContentFlow and flow elements
+ (has to be defined on the element it self)
+
+ * moved fancyScrollbar to AddOn
+
+ * added optional 'label' element to item (will be used as slider label)
+ (great for time lines)
+
+ * scrollbar will be hidden until loader is hidden
+
+ * default loader height fixed
+
+ * switched from array based structure to object based structure for items
+
+ * switched from index based calculations to global position based calculations
+
+ * merged mycontentflow.css into contentflow.css and and added mycontentflow.css.example
+
+ * new Initialization System
+ - init when DOM is fully loaded
+ - auto init of flows
+ - auto loading of stylesheets
+ - auto load of AddOns
+ - background init of images
+
+ * changed calculation methods
+ - added calcCoordinates
+ - added calcRelativeItemPosition
+ - removed calcPosition
+
+ * new methods
+ - onMakeActive
+ - onclickPreButton
+ - onclickNextButton
+
+ * new options
+ - useAddOns
+ - circularFlow
+ - activeElement
+
+ * enhanced options
+ - added scaleFactorLandscape option value "max"
+ - flowDragFriction deactivates drag 'n throw if set to '0'
+ - scrollWheelSpeed deactivates scrollwheel if set to '0'
+
+ * internal restructuring and cleanup
+
+ * removed unneeded images
+
+ * switched to yuicompressor for javascript compression
+
+ * squashed many bugs
+
+
+version 0.5.3 (2008/05/22)
+------------------------
+ * resize bug fixed
+ * renamed maxHeight configuration option to maxItemHeight
+
+version 0.5.2 (2008/05/21)
+------------------------
+ * bugfixes
+
+version 0.5.1 (2008/05/18)
+------------------------
+ * bugfixes
+
+version 0.5 (2008/05/18)
+------------------------
+ * if reflections are used images scale nicer and scrolling is more fluid
+ in Firefox, Safari and Opera (or any other browser which knows about 'canvas')
+ * added fancy scrollbar (with pre and next button)
+ * added maxHeight conf property
+ (if set content will be scaled depending on maxHeight)
+ * moveTo method can handle keywords like 'pre', 'next', 'start' or 'end'
+ * code cleanup
+
+version 0.4 (2008/02/12)
+------------------------
+ * dynamically add and remove items !
+ * caption of item is now optional
+ * added setter for: clickActiveItem, calcSize, calcPosition, calcZIndex, calcFontSize
+ * added getter for: config, activeItem, numberOfItems
+ * squashed some bugs
+ * some clean up
+
+version 0.3 (2008/01/26)
+------------------------
+ * revamp of reflection handling:
+ - added client side reflection generation !!!
+ YES! Browser generated reflections without flash!
+ - bedder handling of reflection sizes
+ - bedder handling of server side reflection sources
+ - bedder handling of overlays in IE6
+ - removed unneeded options
+ - added more flexible options
+ - fix positioning of items in IE6
+ * fixed resize event handling in IE
+ * fixed slider-position element handling in IE6
+ * fixed some minor bugs
+
+version 0.2 (2008/01/22)
+------------------------
+ * handles now node-object and node-id string on object creation
+ * configuration options are now given as configuration object
+ * auto initialization on window load
+ * auto detection of usage of load indicator, global caption and scrollbar
+ * removed obsolete configuration options
+ * minor cleanups
+
+version 0.1 (2008/01/10)
+------------------------
+ * initial release
+
+
--- a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/contentflow.css
+++ a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/contentflow.css
@@ -0,0 +1, @@
+.ContentFlow .flow .item canvas.content{height:100%;width:100%}.ContentFlow .flow .item.active{cursor:pointer}.ContentFlow .flow .item .caption{font-size:100%;font-weight:700;text-align:center;color:#FFF;max-height:30%;bottom:10%;background:url(img/1x1_0.5_black.png);width:100%;position:absolute;display:none}* html .ContentFlow .flow .item .caption{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='img/1x1_0.5_black.png')}.ContentFlow .scrollbar{width:50%;height:16px;background:url(img/scrollbar_white.png) left center repeat-x;overflow:visible;position:relative;z-index:1;visibility:hidden;margin:10px auto 0}.ContentFlow .scrollbar .slider{width:16px;height:16px;background:url(img/slider_white.png) center center no-repeat;cursor:move;position:absolute}* html .ContentFlow .scrollbar .slider{background-image:none}* html .ContentFlow .scrollbar .slider .virtualSlider{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='img/slider_white.png');height:100%}.ContentFlow .scrollbar .slider .position{top:120%;font-size:16px;font-weight:700;color:silver;position:absolute;text-align:center}.ContentFlow .globalCaption{text-align:center;font-weight:700;color:#FFF;font-size:14px;height:20px;position:relative;z-index:1;margin:2em auto}.ContentFlow .loadIndicator{width:100%;height:100%;top:0;left:0;background:#000;position:absolute;z-index:65000}.ContentFlow .loadIndicator .indicator{background:url(img/loader.gif) center center no-repeat;width:100%;height:100%}* html .ContentFlow .loadIndicator .indicator{height:100px}.ContentFlow{position:relative;overflow:hidden}.ContentFlow *{margin:0;padding:0}.ContentFlow img{-ms-interpolation-mode:bicubic}.ContentFlow .mouseoverCheckElement{position:absolute;width:0;height:0;left:0;visibility:hidden}.ContentFlow:hover .mouseoverCheckElement{left:1px}.ContentFlow .flow{position:relative;z-index:0;visibility:hidden;width:100%;margin:0 auto}.ContentFlow .flow.hidden{visibility:hidden}.ContentFlow .flow .item{position:absolute;visibility:hidden;top:0;left:0}.ContentFlow .flow .item div.content{width:100%;height:100%}.ContentFlow .flow .item .label{display:none}.ContentFlow .flow .item canvas.reflection{margin-top:-1px}.ContentFlow .flow .item img.content,.ContentFlow .flow .item img.reflection,.ContentFlow .flow .item canvas.reflection{width:100%}.ContentFlow .flow .item .caption a,.ContentFlow .flow .item .caption a:link,.ContentFlow .flow .item .caption a:visited,.ContentFlow .flow .item .caption a:active,.ContentFlow .flow .item .caption a:hover,.ContentFlow .globalCaption .caption a,.ContentFlow .globalCaption .caption a:link,.ContentFlow .globalCaption .caption a:visited,.ContentFlow .globalCaption .caption a:active,.ContentFlow .globalCaption .caption a:hover{color:#FFF;font-size:0.8em;font-style:italic;text-decoration:none}.ContentFlow .flow .item .caption a:hover,.ContentFlow .globalCaption .caption a:hover{text-decoration:underline}.ContentFlow .flow .item .content,.ContentFlow .flow .item .reflection{display:block}
--- a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/contentflow.js
+++ a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/contentflow.js
@@ -0,0 +1,2 @@
+/* ContentFlow, version 1.0.0 | (c) 2007 - 2010 Sebastian Kutsch | | ContentFlow is distributed under the terms of the MIT license. | (see http://www.jacksasylum.eu/ContentFlow/LICENSE) */
+var ContentFlowGlobal={Flows:new Array,AddOns:{},scriptName:"contentflow.js",scriptElement:null,Browser:new (function(){this.Opera=window.opera?true:false;this.IE=document.all&&!this.Opera?true:false;this.IE6=this.IE&&typeof (window.XMLHttpRequest)=="undefined"?true:false;this.IE8=this.IE&&typeof (document.querySelectorAll)!="undefined"?true:false;this.IE7=this.IE&&!this.IE6&&!this.IE8?true:false;this.WebKit=/WebKit/i.test(navigator.userAgent)?true:false,this.iPhone=/iPhone|iPod/i.test(navigator.userAgent)?true:false;this.Chrome=/Chrome/i.test(navigator.userAgent)?true:false;this.Safari=/Safari/i.test(navigator.userAgent)&&!this.Chrome?true:false;this.Konqueror=navigator.vendor=="KDE"?true:false;this.Konqueror4=this.Konqueror&&/native code/.test(document.getElementsByClassName)?true:false;this.Gecko=!this.WebKit&&navigator.product=="Gecko"?true:false;this.Gecko19=this.Gecko&&Array.reduce?true:false})(),getAddOnConf:function(A){if(this.AddOns[A]){return this.AddOns[A].conf}else{return{}}},setAddOnConf:function(B,A){this.AddOns[B].setConfig(A)},getScriptElement:function(D){var C=new RegExp(D);var A=document.getElementsByTagName("script");for(var B=0;B<\/script>')}else{var A=document.createElement("script");A.src=B;A.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(A)}},addScripts:function(C,B){for(var A=0;A')}},addStylesheets:function(C,B){for(var A=0;A<\/script>");var B=document.getElementById("__ie_cf_onload");B.onreadystatechange=function(){if(this.readyState=="complete"){E.onloadInit()}}}}window.addEvent("load",E.onloadInit,false)},onloadInit:function(){if(arguments.callee.done){return }for(var C=0;C0){this.addReflection()}this.initClick()}.bind(this);if(this.content.complete&&this.content.width>0){G()}else{this.content.onload=G}}else{this.initClick()}};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 F=this.CFobj;var S;var K=this.content;if(this.Browser.IE){var Q="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";if(F._reflectionColorRGB){if(F.conf.reflectionColor=="transparent"){var N=S=this.reflection=document.createElement("img");S.src=K.src}else{S=this.reflection=document.createElement("div");var N=document.createElement("img");N.src=K.src;S.width=N.width;S.height=N.height;N.style.width="100%";N.style.height="100%";var M=F._reflectionColorRGB;S.style.backgroundColor="#"+M.hR+M.hG+M.hB;S.appendChild(N)}Q+=" progid:DXImageTransform.Microsoft.Alpha(opacity=0, finishOpacity=50, style=1, finishX=0, startY="+F.conf.reflectionHeight*100+" finishY=0)"}else{var N=S=this.reflection=document.createElement("img");S.src=K.src}Q+=" progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22="+1/F.conf.reflectionHeight+")";if(ContentFlowGlobal.Browser.IE6){if(K.src.match(/\.png$/)){K.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+K.src+"', sizingMethod=scale )";K.filterString="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+K.src+"', sizingMethod=scale )";Q+=" progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+K.src+"', sizingMethod=scale )";K.origSrc=K.src;K.src="img/blank.gif";N.src="img/blank.gif"}}S.filterString=Q;N.style.filter=Q}else{if(F._reflectionWithinImage){var D=this.canvas=$CF(document.createElement("canvas"))}else{var D=S=this.reflection=document.createElement("canvas")}if(D.getContext){if(F._reflectionWithinImage){for(var R=0;RC){if(D>0){var B=D-C}else{var B=D+C}}else{if(C>=this.items.length){var B=D/A}else{var B=D*(C/A)}}return B},calcSize:function(D){var B=D.relativePosition;var C=1/(Math.abs(B)+1);var A=C;return{width:A,height:C}},calcCoordinates:function(C){var B=C.relativePosition;var E=this.conf.visibleItems;var D=1-1/Math.exp(Math.abs(B)*0.75);var A=C.side*E/(E+1)*D;var F=1;return{x:A,y:F}},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(B){if(!this.conf.circularFlow){return this._checkIndex(B)}var A=this._getIndexByPosition(this._currentPosition);var C=B-A;if(Math.abs(C)>C+this.items.length){C+=this.items.length}else{if(Math.abs(C)>(Math.abs(C-this.items.length))){C-=this.items.length}}return this._currentPosition+C},_getIndexByPosition:function(A){if(A<0){var C=0}else{var C=1}var B=(Math.round(A)+C)%this.items.length;if(B>0){B-=C}else{if(B<0){B+=this.items.length-C}else{if(A<0){B=0}else{B=this.items.length-1}}}return B},_getIndexByKeyWord:function(B,D,A){if(D){var C=D}else{if(this._activeItem){var C=this._activeItem.index}else{var C=0}}if(isNaN(B)){switch(B){case"first":case"start":C=0;break;case"last":case"end":C=this.itemsLastIndex;break;case"middle":case"center":C=Math.round(this.itemsLastIndex/2);break;case"right":case"next":C+=1;break;case"left":case"pre":case"previous":C-=1;break;case"visible":case"visiblePre":case"visibleLeft":C-=this.conf.visibleItems;break;case"visibleNext":case"visibleRight":C+=this.conf.visibleItems;break;default:C=C}}else{C=B}if(A!=false){C=this._checkIndex(C)}return C},_setCaptionLabel:function(A){if(this.Position&&!this.Slider.locked){this.Position.setLabel(A)}this._setGlobalCaption()},getAddOnConf:function(A){return ContentFlowGlobal.getAddOnConf(A)},setAddOnConf:function(B,A){ContentFlowGlobal.setAddOnConf(B,A)},init:function(){if(this.isInit){return }this._init()},setConfig:function(A){if(!A){return }var E=this._defaultConf;for(var F in A){if(E[F]=="undefined"){continue}switch(F){case"scrollInFrom":case"startItem":if(typeof (A[F])=="number"||typeof (A[F])=="string"){this.conf[F]=A[F]}break;default:if(typeof (E[F]==A[F])){if(typeof A[F]=="function"){this.conf[F]=A[F].bind(this)}else{this.conf[F]=A[F]}}}}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 C={x:{left:function(J){return -1},center:function(J){return 0},right:function(J){return 1}},y:{top:function(J){return -1},center:function(J){return 0},bottom:function(J){return 1}}};var I=this.conf.relativeItemPosition;I=I.replace(/above/,"top").replace(/below/,"bottom");var H,G=null;H=I.match(/left|right/);G=I.match(/top|bottom/);c=I.match(/center/);if(!H){if(c){H="center"}else{H="center"}}if(!G){if(c){G="center"}else{G="top"}}var D=C.x[H];var B=C.y[G];this.conf.calcRelativeItemPosition=function(K){var J=D(K.size);var L=B(K.size);return{x:J,y:L}};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(B,A){if(!this.conf.circularFlow){B=this._checkIndex(B)}this._targetPosition=B;this.conf.onMoveTo(this._getItemByPosition(B));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(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)&&A0){K.pre=this.items[G-1];K.pre.next=K}}this._setLastIndex();if(this.conf.circularFlow&&this.items.length>0){var L=this.items[0];L.pre=this.items[this.items.length-1];L.pre.next=L}this._initGUI();if(this._activeElement!="content"){this._activeElement="element"}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 I=this._getIndexByKeyWord(this.conf.scrollInFrom,this._targetPosition);switch(this.conf.scrollInFrom){case"next":case"right":I-=0.5;break;case"pre":case"previous":case"left":I+=0.5;break}this._currentPosition=I;var E=new Date();var D=this;var C=window.setInterval(function(){if(D._imagesToLoad==0||new Date()-E>D._loadingTimeout){clearInterval(C);D._activeItem=D.getItem(D._currentPosition);if(D._activeItem){D._activeItem.makeActive();D._setCaptionLabel(D._activeItem.index)}D.Flow.style.visibility="visible";if(D.loadIndicator){D.loadIndicator.style.display="none"}if(D.Scrollbar){D.Scrollbar.style.visibility="visible"}D.resize();for(var O=0;O0){L(O)}})}else{window.addEvent("keydown",function(O){if(D.offsetLeft>0){L(O)}})}}else{this.Container.addEvent("keydown",L)}}else{this.Container.onkeydown=L}}if(this.conf.flowDragFriction>0){var E=function(R){var U=R;if(R.touches){U=R.touches[0]}var Q=U.clientX;var P=U.clientY;if(this.conf.verticalFlow){var V=P-this.Flow.mouseY;var T=this.Flow.dimensions.height}else{var V=Q-this.Flow.mouseX;var T=this.Flow.dimensions.width}var O=(V/T)*(2*this.conf.visibleItems+1);var S=this._currentPosition-O*2*this.conf.visibleItems/this.conf.flowDragFriction;this.Flow.mouseX=Q;this.Flow.mouseY=P;this.moveToPosition(S,true)}.bind(this);var N=function(){};var H=function(P){var O=Math.round(this._targetPosition);if(Math.abs(O-this._currentPosition)>0.001){this.moveToPosition(O)}}.bind(this);this.Flow.makeDraggable(E,N,H)}if(this.Scrollbar){var M=function(R){if(!R){var R=window.event}if(!this.Scrollbar.clickLocked){var Q=R.clientX;var P=Q-this.Scrollbar.position.left;var O=Math.round(P/this.Scrollbar.dimensions.width*this.itemsLastIndex);this.moveToIndex(O)}else{this.Scrollbar.clickLocked=false}}.bind(this);this.Scrollbar.addObserver("click",M)}if(this.Slider){if(this.Browser.IE6){var B=document.createElement("div");B.className="virtualSlider";this.Slider.appendChild(B)}this.Slider.setPosition=function(O){O=O-Math.floor(O)+this._getIndexByPosition(Math.floor(O));if(Math.round(O)<0){O=this.itemsLastIndex}else{if(O<=0){O=0}else{if(Math.round(O)>this.itemsLastIndex){O=0}else{if(O>=this.itemsLastIndex){O=this.itemsLastIndex}}}}if(this.items.length>1){var P=(O/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 N=function(O){this.Scrollbar.clickLocked=true}.bind(this);var E=function(P){var Q=P;if(P.touches){Q=P.touches[0]}var O=this._checkIndex((Q.clientX-this.Scrollbar.position.left)/this.Scrollbar.dimensions.width*this.itemsLastIndex);this._targetPosition=this._getPositionByIndex(O);this.Slider.setPosition(O);if(this.Position){this.Position.setLabel(O)}this._initStep(true,true)}.bind(this);var H=function(O){this._targetPosition=Math.round(this._targetPosition);this.conf.onMoveTo(this._getItemByPosition(this._targetPosition));this._initStep(true)}.bind(this);this.Slider.makeDraggable(E,N,H)}if(this.Position){this.Position.setLabel=function(O){O=this._checkIndex(Math.round(O));if(this.items&&this.items[O].label){this.Position.innerHTML=this.items[O].label.innerHTML}else{this.Position.innerHTML=O+1}}.bind(this)}this.globalCaption=this.Container.getChildrenByClassName("globalCaption")[0];this.loadIndicator=this.Container.getChildrenByClassName("loadIndicator")[0]},_initSizes:function(A){this._initMaxHeight();var E=this._initScrollbarSize();if(!this.conf.verticalFlow&&this.Container.style.height&&this.Container.style.height!="auto"){this.maxHeight-=E}if(!this._activeItem){return }var D=this._findBiggestItem();var F=this.Flow.findPos();if(this.conf.verticalFlow){this.Flow.style.width=D.width.width+"px";this.Flow.style.height=3*D.width.width*(1+this.conf.reflectionHeight+this.conf.reflectionGap)+"px"}else{this.Flow.style.height=D.height.height+(D.height.top-F.top)+"px"}var C=this.conf.verticalFlow?D.width.width:D.height.height;var B=C/(1+this.conf.reflectionHeight+this.conf.reflectionGap);this.Flow.style.marginBottom=-(C-B)+"px";this.Flow.dimensions=this.Flow.getDimensions();if(!this.Browser.IE6){if(this.conf.verticalFlow&&this.Container.clientWidthG){G=E}if(H>maxW){maxW=H}}}else{F.innerHTML=" ";G=F.clientHeight;maxW=F.clientWidth}F.innerHTML=K;F.setDimensions();F.style.width=maxW+"px";F.style.left=(I.dimensions.width-maxW)/2+"px";var A=F.position.top-I.position.top;if(A>0){A+=-C.dimensions.height+G;C.style.marginBottom=A+"px"}else{A*=-1;C.style.marginTop=A+"px"}B+=A}}}else{B=0}return B},_initMaxHeight:function(){if(this.conf.verticalFlow){var G=screen.width/screen.height;var D=this.Container.style.width;var E=this.Container.clientWidth;var C=this.Flow.style.width;var F=this.Flow.clientWidth;var A=this.Flow.clientHeight}else{var G=screen.height/screen.width;var D=this.Container.style.height;var E=this.Container.clientHeight;var C=this.Flow.style.height;var F=this.Flow.clientHeight;var A=this.Flow.clientWidth}if(this.ContainerOldDim){D=this.ContainerOldDim}if(this.FlowOldDim){C=this.FlowOldDim}this.ContainerOldDim="auto";this.FlowOldDim="auto";if(this.conf.maxItemHeight<=0){this.maxHeight=A/3*G/1*this.conf.scaleFactor;if(this.conf.verticalFlow&&(this.maxHeight==0||this.maxHeight>F)){this.maxHeight=F}if(D&&D!="auto"){var H=this.conf.verticalFlow?0:this.conf.reflectionGap;var B=this.conf.verticalFlow?0:this.conf.reflectionHeight;this.maxHeight=E/(this.conf.scaleFactor*(1+B+H));this.ContainerOldDim=D}else{if(C&&C!="auto"){var H=this.conf.verticalFlow?0:this.conf.reflectionGap;this.maxHeight=F/(this.conf.scaleFactor*(1+this.conf.reflectionHeight+H));this.FlowOldDim=C}}}else{this.maxHeight=this.conf.maxItemHeight}},_findBiggestItem:function(){var G=this._activeItem;var A=G.pre;var B=G.next;var E=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 F=function(N,J){var M=N.element;M.style.display="block";var O=M.findPos();var L=M.clientHeight;var K=M.clientWidth;if(L+O.top>=E.height.height+E.height.top){E.height.height=L;E.height.top=O.top;E.height.item=N;E.height.rI=J}if(K+O.left>=E.width.width+E.width.left){E.width.width=K;E.width.left=O.left;E.width.item=N;E.width.rI=J}M.style.display="none"};var H=this._currentPosition;this._currentPosition=this.conf.visibleItems+1;for(var C=-this.conf.visibleItems;C<=this.conf.visibleItems;C++){G.element.style.display="none";this._positionItem(G,C);F(G,C)}var D=E.height.rI;for(var C=0;C0.001){this._currentPosition+=this.conf.flowSpeedFactor*this.conf.calcStepWidth(D,C,this.items.length,this.conf.visibleItems);var A=this.items[(this._getIndexByPosition(this._currentPosition))];if(A&&A!=this._activeItem){if(this._activeItem){this._activeItem.makeInactive()}this._activeItem=A;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 B=this._step.bind(this);window.setTimeout(B,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(this._lastStart){var E=this._lastStart;while(E){E.element.style.display="none";E=E.next;if(E==this._lastStart){break}if(E&&E.pre==this._lastEnd){break}}}else{this._lastStart=this._activeItem}if(!this._activeItem){return }var C=this._activeItem;var B=C.pre;var D=C.next;this._positionItem(C,0);for(var A=1;A<=this.conf.visibleItems&&2*A0?M/I.visibleItems:0;var B=M<0?-1:1;B*=M==0?0:1;S.side=B;var J=I.calcSize(S);J.height=Math.max(J.height,0);J.width=Math.max(J.width,0);if(S.content.origProportion){J=this._scaleImageSize(S,J)}S.size=J;var P=S.coordinates=I.calcCoordinates(S);var H=S.relativeItemPosition=I.calcRelativeItemPosition(S);var K=S.zIndex=I.calcZIndex(S);var C=S.fontSize=I.calcFontSize(S);var D=S.opacity=I.calcOpacity(S);J.height*=this.maxHeight;J.width*=this.maxHeight;var R=N?J.height:J.width;var O=N?J.width:J.height;var G=this.Flow.center.x*(1+P.x)+(H.x-1)*R/2;var F=this.maxHeight/2*(1+P.y)+(H.y-1)*O/2;E.left=(N?F:G)+"px";E.top=(N?G:F)+"px";this._setItemSize(S,J);if(I.endOpacity!=1){this._setItemOpacity(S)}if(!this.Browser.IE){E.fontSize=(C*100)+"%"}E.zIndex=32768+Math.round(K*this.items.length);I.onDrawItem(S);E.visibility="visible";E.display="block"},_scaleImageSize:function(N,P,I){var E=this.conf.scaleFactorLandscape;var D=this.conf.scaleFactorPortrait;var M=this.conf.verticalFlow;var B=N.content.origProportion;var C=P.width;var L=P.height;var H=N.content;if(M){if(B<=1){if(E!="max"&&E!=1){L*=E;C=Math.min(L*B,I?I:1)}L=C/B}else{if(B>1){if(D=="max"){L=I?I:1}else{if(D!=1){C*=D;L=Math.min(C/B,I?I:1)}else{L=C/B}}C=L*B}}}else{if(B>1){if(E!="max"&&E!=1){C*=E;L=Math.min(C/B,I?I:1)}C=L*B}else{if(B<=1){if(D=="max"){C=I?I:1}else{if(D!=1){L*=D;C=Math.min(L*B,I?I:1)}else{C=L*B}}L=C/B}}}L=isNaN(L)?0:L;C=isNaN(C)?0:C;if(!I&&this.conf.fixItemSize){var A=P.width/P.height;var I=Math.max(P.width,P.height);var O=this._scaleImageSize(N,{width:I,height:I},I);if(A<1){L=O.height/P.height;C=L*B/A}else{C=O.width/P.width;L=C/B*A}var G=L*100;var K=C*100;var J=(1-C)/2*100;var F=(1-L)/A*100*(M?0.5:1);H.style.height=G+"%";if(N.reflection){N.reflection.style.height=G*this.conf.reflectionHeight+"%"}H.style.width=K+"%";if(N.reflection){N.reflection.style.width=K+"%"}H.style.marginLeft=J+"%";if(N.reflection){N.reflection.style.marginLeft=J+"%"}H.style.marginTop=F+"%";N.element.style.overflow="hidden";return P}else{return{width:C,height:L}}},_setItemSize:(function(){if(ContentFlowGlobal.Browser.IE){var A=function(E,C){if(!this.conf.fixItemSize){E.content.style.height=C.height+"px"}else{if(ContentFlowGlobal.Browser.IE6){var D=parseInt(E.content.style.height)/100;E.content.style.height=C.height*D+"px";var B=parseInt(E.content.style.marginTop)/100;E.content.style.marginTop=C.height*B+"px"}}if(E.reflection){var D=parseInt(E.content.style.height);E.reflection.style.height=D*this.conf.reflectionHeight+"px";E.reflection.style.marginTop=D*this.conf.reflectionGap+"px"}E.element.style.width=C.width+"px";E.element.style.height=C.height*(1+this.conf.reflectionHeight+this.conf.reflectionGap)+"px"}}else{var A=function(C,B){if(C.reflection){C.element.style.height=B.height*(1+this.conf.reflectionHeight+this.conf.reflectionGap)+"px";C.reflection.style.marginTop=B.height*this.conf.reflectionGap+"px"}else{if(this._reflectionWithinImage){C.element.style.height=B.height*(1+this.conf.reflectionHeight+this.conf.reflectionGap)+"px"}else{C.element.style.height=B.height+"px"}}C.element.style.width=B.width+"px"}}return A})(),_setItemOpacity:(function(){if(ContentFlowGlobal.Browser.IE6){var A=function(C){if(C.content.origSrc&&C.content.origSrc.match(/\.png$/)){var B=C.content.src;C.content.src=C.content.origSrc;C.content.style.filter=C.content.filterString+" progid:DXImageTransform.Microsoft.BasicImage(opacity="+C.opacity+")";C.content.src=B}else{C.content.style.filter="progid:DXImageTransform.Microsoft.BasicImage(opacity="+C.opacity+")"}if(C.reflection){C.reflection.style.filter=C.reflection.filterString+"progid:DXImageTransform.Microsoft.BasicImage(opacity="+C.opacity+")"}}}else{if(ContentFlowGlobal.Browser.IE){var A=function(B){B.element.style.filter="progid:DXImageTransform.Microsoft.BasicImage(opacity="+B.opacity+")"}}else{var A=function(B){B.element.style.opacity=B.opacity}}}return A})()};if(!Function.bind){Function.prototype.bind=function(A){var B=this;return function(){return B.apply(A,arguments)}}}if(!Math.erf2){Math.erf2=function(A){var B=-(8*(Math.PI-3)/(3*Math.PI*(Math.PI-4)));var C=A*A;var D=1-Math.pow(Math.E,-C*(4/Math.PI+B*C)/(1+B*C));return D}}if(!Math._2PI05){Math._2PI05=Math.sqrt(2*Math.PI)}if(!Math.normDist){Math.normDist=function(A,C,B){if(!C){var C=1}if(!B){var B=0}if(!A){var A=-B}return 1/(C*Math._2PI05)*Math.pow(Math.E,-(A-B)*(A-B)/(2*C*C))}}if(!Math.normedNormDist){Math.normedNormDist=function(A,C,B){return this.normDist(A,C,B)/this.normDist(B,C,B)}}if(!Math.exp){Math.exp=function(A){return Math.pow(Math.E,A)}}if(!Math.ln){Math.ln=Math.log}if(!Math.log2){Math.log2=function(A){return Math.log(A)/Math.LN2}}if(!Math.log10){Math.log10=function(A){return Math.log(A)/Math.LN10}}if(!Math.logerithm){Math.logerithm=function(B,A){if(!A||A==Math.E){return Math.log(B)}else{if(A==2){return Math.log2(B)}else{if(A==10){return Math.log10(B)}else{return Math.log(B)/Math.log(A)}}}}}if(!Event){var Event={}}if(!Event.stop){Event.stop=function(A){A.cancelBubble=true;if(A.preventDefault){A.preventDefault()}if(A.stopPropagation){A.stopPropagation()}return false}}if(document.all&&!window.opera){window.$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 B in this){if(!A[B]){A[B]=this[B]}}}}else{CFElement=window.HTMLElement}if(!CFElement.findPos){CFElement.prototype.findPos=function(){var B=this;var C=curtop=0;try{if(B.offsetParent){C=B.offsetLeft;curtop=B.offsetTop;while(B=B.offsetParent){C+=B.offsetLeft;curtop+=B.offsetTop}}}catch(A){}return{left:C,top:curtop}}}if(!CFElement.getDimensions){CFElement.prototype.getDimensions=function(){return{width:this.clientWidth,height:this.clientHeight}}}if(!CFElement.hasClassName){CFElement.prototype.hasClassName=function(A){return(new RegExp("\\b"+A+"\\b").test(this.className))}}if(!CFElement.addClassName){CFElement.prototype.addClassName=function(A){if(!this.hasClassName(A)){this.className+=(this.className?" ":"")+A}}}if(!CFElement.removeClassName){CFElement.prototype.removeClassName=function(A){this.className=this.className.replace(new RegExp("\\b"+A+"\\b"),"").replace(/\s\s/g," ")}}if(!CFElement.toggleClassName){CFElement.prototype.toggleClassName=function(A){if(this.hasClassName(A)){this.removeClassName(A)}else{this.addClassName(A)}}}if(!CFElement.getChildrenByClassName){CFElement.prototype.getChildrenByClassName=function(C){var B=new Array();for(var A=0;A
+ *
+ * ContentFlow is distributed under the terms of the MIT license.
+ * (see http://www.jacksasylum.eu/ContentFlow/LICENSE)
+ *
+ *--------------------------------------------------------------------------*/
+/*
+ * ============================================================
+ * Global configutaion and initilization object
+ * ============================================================
+ */
+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(name) {
+ if(this.AddOns[name])
+ return this.AddOns[name].conf;
+ else
+ return {};
+ },
+
+ setAddOnConf: function (name, conf) {
+ this.AddOns[name].setConfig(conf);
+ },
+
+ getScriptElement:function (scriptName) {
+ var regex = new RegExp(scriptName);
+ var scripts = document.getElementsByTagName('script');
+ for (var i=0; i<\/script>');
+ }
+ else {
+ var script = document.createElement('script');
+ script.src = path;
+ script.setAttribute('type', 'text/javascript');
+ document.getElementsByTagName('head')[0].appendChild(script);
+ }
+ },
+
+ addScripts: function (basePath, filenames) {
+ for (var i=0; i');
+ }
+
+ },
+
+ addStylesheets: function (basePath, filenames) {
+ for (var i=0; i<\/script>");
+ var script = document.getElementById("__ie_cf_onload");
+ script.onreadystatechange = function() {
+ if (this.readyState == "complete") {
+ CFG.onloadInit(); // call the onload handler
+ }
+ };
+ }
+
+ /* for all other browsers */
+ window.addEvent('load', CFG.onloadInit, false);
+
+ /* ================================================================== */
+
+ },
+
+ onloadInit: function () {
+ // quit if this function has already been called
+ if (arguments.callee.done) return;
+ for (var i=0; i< ContentFlowGlobal.loadAddOns.length; i++) {
+ var a = ContentFlowGlobal.loadAddOns[i];
+ if (!ContentFlowGlobal.AddOns[a]) {
+ var CFG = ContentFlowGlobal;
+ window.setTimeout( CFG.onloadInit, 10);
+ return;
+ }
+ }
+ // flag this function so we don't do the same thing twice
+ arguments.callee.done = true;
+
+ /* fix for mootools */
+ if (window.Element && Element.implement && document.all && !window.opera) {
+ for (var prop in window.CFElement.prototype) {
+ if(!window.Element.prototype[prop]) {
+ var implement = {};
+ implement[prop] = window.CFElement.prototype[prop];
+ Element.implement(implement);
+ }
+ }
+ }
+
+ /* init all manualy created flows */
+ for (var i=0; i< ContentFlowGlobal.Flows.length; i++) {
+ ContentFlowGlobal.Flows[i].init();
+ }
+
+ /* init the rest */
+ var divs = document.getElementsByTagName('div');
+ DIVS: for (var i = 0; i < divs.length; i++) {
+ if (divs[i].className.match(/\bContentFlow\b/)) {
+ for (var j=0; j 0) {
+ this.addReflection();
+ }
+ this.initClick();
+ }.bind(this);
+
+ if (this.content.complete && this.content.width > 0)
+ foobar();
+ else
+ this.content.onload = foobar;
+ }
+ else {
+ this.initClick();
+ }
+
+};
+
+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 cItem = this.clickItem;
+ this[this._activeElement].addEvent('click', cItem, false);
+ },
+
+ setImageFormat: function (img) {
+ if (this.Browser.IE6 || this.Browser.IE7) img.style.width = "auto";
+ img.origProportion = img.width / img.height;
+ img.setAttribute('origProportion', img.width / img.height);
+ if (this.Browser.IE6 || this.Browser.IE7) img.style.width = "";
+ //img.origWidth = img.width;
+ //img.origHeight = img.height;
+ if (img.origProportion <= 1)
+ img.addClassName('portray');
+ else
+ img.addClassName('landscape');
+ },
+
+ /*
+ * add reflection to item
+ */
+ addReflection: function() {
+ var CFobj = this.CFobj;
+ var reflection;
+ var image = this.content;
+
+
+ if (this.Browser.IE) {
+ var filterString = 'progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)';
+ if (CFobj._reflectionColorRGB) {
+ // transparent gradient
+ if (CFobj.conf.reflectionColor == "transparent") {
+ var RefImg = reflection = this.reflection = document.createElement('img');
+ reflection.src = image.src;
+ }
+ // color gradient
+ else {
+ reflection = this.reflection = document.createElement('div');
+ var RefImg = document.createElement('img');
+ RefImg.src = image.src;
+ reflection.width = RefImg.width;
+ reflection.height = RefImg.height;
+ RefImg.style.width = '100%';
+ RefImg.style.height = '100%';
+ var color = CFobj._reflectionColorRGB;
+ reflection.style.backgroundColor = '#'+color.hR+color.hG+color.hB;
+ reflection.appendChild(RefImg);
+ }
+ filterString += ' progid:DXImageTransform.Microsoft.Alpha(opacity=0, finishOpacity=50, style=1, finishX=0, startY='+CFobj.conf.reflectionHeight*100+' finishY=0)';
+ } else {
+ var RefImg = reflection = this.reflection = document.createElement('img');
+ reflection.src = image.src;
+ }
+ // crop image (streches and crops (clip on default dimensions), original proportions will be restored through CSS)
+ filterString += ' progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=0, M21=0, M22='+1/CFobj.conf.reflectionHeight+')';
+
+ if (ContentFlowGlobal.Browser.IE6) {
+ if (image.src.match(/\.png$/) ) {
+ image.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+image.src+"', sizingMethod=scale )";
+ image.filterString = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+image.src+"', sizingMethod=scale )";
+ filterString += " progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+image.src+"', sizingMethod=scale )";
+ image.origSrc = image.src;
+ image.src='img/blank.gif';
+ RefImg.src="img/blank.gif";
+ }
+ }
+
+ reflection.filterString = filterString;
+ RefImg.style.filter = filterString;
+
+ } else {
+ if (CFobj._reflectionWithinImage)
+ var canvas = this.canvas = $CF(document.createElement('canvas'));
+ else
+ var canvas = reflection = this.reflection = document.createElement('canvas');
+
+ if (canvas.getContext) {
+ if (CFobj._reflectionWithinImage) {
+ for (var i=0; i vI) {
+ if (diff > 0) {
+ var stepwidth = diff - vI;
+ } else {
+ var stepwidth = diff + vI;
+ }
+ } else if (vI >= this.items.length) {
+ var stepwidth = diff / items;
+ } else {
+ var stepwidth = diff * ( vI / items);
+ //var stepwidth = diff/absDiff * Math.max(diff * diff,Math.min(absDiff,0.3)) * ( vI / this.items.length);
+ //var stepwidth = this.flowSpeedFactor * diff / this.visibleItems;
+ //var stepwidth = this.flowSpeedFactor * diff * ( this.visibleItems / this.items.length)
+ //var stepwidth = this.flowSpeedFactor * diff / this._millisecondsPerStep * 2; // const. speed
+ }
+ return stepwidth;
+ },
+
+ calcSize: function (item) {
+ var rP = item.relativePosition;
+ //var rPN = relativePositionNormed;
+ //var vI = this.conf.visibleItems;
+
+ var h = 1/(Math.abs(rP)+1);
+ var w = h;
+ return {width: w, height: h};
+ },
+
+ calcCoordinates: function (item) {
+ var rP = item.relativePosition;
+ //var rPN = item.relativePositionNormed;
+ var vI = this.conf.visibleItems;
+
+ var f = 1 - 1/Math.exp( Math.abs(rP)*0.75);
+ var x = item.side * vI/(vI+1)* f;
+ var y = 1;
+
+ return {x: x, y: y};
+ },
+
+ /*
+ calcRelativeItemPosition: function (item) {
+ var x = 0;
+ var y = -1;
+ return {x: x, y: y};
+ },
+ */
+
+ calcZIndex: function (item) {
+ return -Math.abs(item.relativePositionNormed);
+ },
+
+ calcFontSize: function (item) {
+ return item.size.height;
+ },
+
+ calcOpacity: function (item) {
+ return Math.max(1 - ((1 - this.conf.endOpacity ) * Math.sqrt(Math.abs(item.relativePositionNormed))), this.conf.endOpacity);
+ }
+ },
+
+ /* ---------- end of defaultConf ---------- */
+
+
+ /*
+ * ==================== index helper methods ====================
+ */
+
+ /*
+ * checks if index is within the index range of the this.items array
+ * returns a value that is within this range
+ */
+ _checkIndex: function (index) {
+ index = Math.max(index, 0);
+ index = Math.min(index, this.itemsLastIndex);
+ return index;
+ },
+
+ /*
+ * sets the object property itemsLastIndex
+ */
+ _setLastIndex: function () {
+ this.itemsLastIndex = this.items.length - 1;
+ },
+
+ /*
+*/
+ _getItemByIndex: function (index) {
+ return this.items[this._checkIndex(index)];
+ },
+
+ _getItemByPosition: function (position) {
+ return this._getItemByIndex(this._getIndexByPosition(position));
+ },
+
+ /* returns the position of an item-index relative to current position */
+ _getPositionByIndex: function(index) {
+ if (!this.conf.circularFlow) return this._checkIndex(index);
+ var cI = this._getIndexByPosition(this._currentPosition);
+ var dI = index - cI;
+ if (Math.abs(dI) > dI+this.items.length)
+ dI += this.items.length;
+ else if (Math.abs(dI) > (Math.abs(dI-this.items.length)))
+ dI -= this.items.length;
+
+ return this._currentPosition + dI;
+
+ },
+
+ /* returns the index an item at position p would have */
+ _getIndexByPosition: function (position) {
+ if (position < 0) var mod = 0;
+ else var mod = 1;
+
+ var I = (Math.round(position) + mod) % this.items.length;
+ if (I>0) I -= mod;
+ else if(I<0) I += this.items.length - mod;
+ else if(position<0) I = 0;
+ else I = this.items.length - 1;
+
+ return I;
+ },
+
+ _getIndexByKeyWord: function (keyword, relativeTo, check) {
+ if (relativeTo)
+ var index = relativeTo;
+ else if (this._activeItem)
+ var index = this._activeItem.index;
+ else
+ var index = 0;
+
+ if (isNaN(keyword)) {
+ switch (keyword) {
+ case "first":
+ case "start":
+ index = 0;
+ break;
+ case "last":
+ case "end":
+ index = this.itemsLastIndex;
+ break;
+ case "middle":
+ case "center":
+ index = Math.round(this.itemsLastIndex/2);
+ break;
+ case "right":
+ case "next":
+ index += 1;
+ break;
+ case "left":
+ case "pre":
+ case "previous":
+ index -= 1;
+ break;
+ case 'visible':
+ case 'visiblePre':
+ case 'visibleLeft':
+ index -= this.conf.visibleItems;
+ break;
+ case 'visibleNext':
+ case 'visibleRight':
+ index += this.conf.visibleItems;
+ break;
+ default:
+ index = index;
+ }
+ }
+ else {
+ index = keyword;
+ }
+ if (check != false)
+ index = this._checkIndex(index);
+
+ return index;
+ },
+
+
+ _setCaptionLabel: function (index) {
+ if(this.Position && !this.Slider.locked)
+ this.Position.setLabel(index);
+ this._setGlobalCaption();
+ },
+
+
+ /*
+ * ==================== public methods ====================
+ */
+ getAddOnConf: function(name) {
+ return ContentFlowGlobal.getAddOnConf(name);
+ },
+
+ setAddOnConf: function(name, conf) {
+ ContentFlowGlobal.setAddOnConf(name, conf);
+ },
+
+
+ /*
+ * calls _init() if ContentFlow has not been initialized before
+ * needed if ContentFlow is not automatically initialized on window.load
+ */
+ init: function () {
+ if(this.isInit) return;
+ this._init();
+ },
+
+ /*
+ * parses configuration object and initializes configuration values
+ */
+ setConfig: function(config) {
+ if (!config) return;
+ var dC = this._defaultConf;
+ for (var option in config) {
+ if (dC[option] == "undefined" ) continue;
+ switch (option) {
+ case "scrollInFrom":
+ case "startItem":
+ if (typeof(config[option]) == "number" || typeof(config[option]) == "string") {
+ //this["_"+option] = config[option];
+ this.conf[option] = config[option];
+ }
+ break;
+ default:
+ if (typeof(dC[option] == config[option])) {
+ //this["_"+option] = config[option];
+ if (typeof config[option] == "function") {
+ this.conf[option] = config[option].bind(this);
+ }
+ else {
+ this.conf[option] = config[option];
+ }
+ }
+ }
+ }
+ 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 calcRP = {
+ x: {
+ left: function(size) { return -1 },
+ center: function(size) { return 0 },
+ right: function(size) { return 1 }
+ },
+ y: {
+ top: function(size) { return -1 },
+ center: function(size) { return 0 },
+ bottom: function(size) { return 1 }
+ }
+ };
+
+ var iP = this.conf.relativeItemPosition;
+ iP = iP.replace(/above/,"top").replace(/below/,"bottom");
+ var x, y = null;
+ x = iP.match(/left|right/);
+ y = iP.match(/top|bottom/);
+ c = iP.match(/center/);
+ if (!x) {
+ if (c) x = "center";
+ else x = "center";
+ }
+ if (!y) {
+ if (c) y = "center";
+ else y = "top";
+ }
+ var calcX = calcRP.x[x];
+ var calcY = calcRP.y[y];
+ this.conf.calcRelativeItemPosition = function (item) {
+ var x = calcX(item.size);
+ var y = calcY(item.size);
+ return {x: x, y: y};
+ };
+ this.conf.relativeItemPosition = null;
+ }
+
+ if (this._reflectionType && this._reflectionType != "clientside") {
+ this.conf.reflectionHeight = 0;
+ }
+
+ },
+
+ getItem: function (index) {
+ return this.items[this._checkIndex(Math.round(index))];
+ },
+
+ /*
+ * returns the index number of the active item
+ */
+ getActiveItem: function() {
+ return this._activeItem;
+ },
+
+ /*
+ * returns the number of items the flow contains
+ */
+ getNumberOfItems: function () {
+ return this.items.length;
+ },
+
+ /*
+ * reinitializes sizes.
+ * called on window.resize
+ */
+ resize: function () {
+ this._initSizes();
+ this._initStep();
+ },
+
+ /*
+ * scrolls flow to item i
+ */
+ moveToPosition: function (p, holdPos) {
+ if (!this.conf.circularFlow) p = this._checkIndex(p);
+ this._targetPosition = p;
+ this.conf.onMoveTo(this._getItemByPosition(p));
+ this._initStep(false, holdPos);
+ },
+ moveToIndex: function (index) {
+ this._targetPosition = Math.round(this._getPositionByIndex(this._getIndexByKeyWord(index, this._activeItem.index, !this.conf.circularFlow)));
+ this.conf.onMoveTo(this._getItemByPosition(this._targetPosition));
+ this._initStep();
+ },
+ moveToItem: function (item) {
+ var i;
+ if (item.itemIndex) i = item.itemIndex;
+ else i = item.index;
+ this.moveToIndex(i);
+ },
+ moveTo: function (i) {
+ if (typeof i == "object") this.moveToItem(i);
+ else if (isNaN(i) || (i == Math.floor(i) && i < this.items.length) ) this.moveToIndex(i);
+ else this.moveToPosition(i);
+ },
+
+ /*
+ * initializes item and adds it at index position
+ */
+ addItem: function(el, index) {
+ if (typeof index == "string") {
+ switch (index) {
+ case "first":
+ case "start":
+ index = 0;
+ break;
+ case "last":
+ case "end":
+ index = this.itemsLastIndex + 1;
+ break;
+ default:
+ index = this._getIndexByKeyWord(index);
+ }
+ }
+
+ index = Math.max(index, 0);
+ index = Math.min(index, this.itemsLastIndex + 1);
+
+ this.Flow.appendChild(el);
+
+ /* init item after insertion. that way it's part of the document and all styles are applied */
+ var item = new ContentFlowItem(this, el, index);
+ if (this.items.length == 0 ) {
+ if (this.conf.circularFlow) {
+ item.pre = item;
+ item.next = item;
+ }
+ }
+ else {
+ if (index == this.itemsLastIndex + 1) {
+ item.pre = this.items[this.itemsLastIndex];
+ item.next = item.pre.next;
+ }
+ else {
+ item.next = this.items[index];
+ item.pre = item.next.pre;
+ }
+ if (item.pre) item.pre.next = item;
+ if (item.next) item.next.pre = item;
+ }
+ this.items.splice(index,0, item);
+
+ /* adjust item indices */
+ for (var i = index; i < this.items.length; i++) {
+ this.items[i].setIndex(i);
+ }
+ this._setLastIndex();
+
+ /* adjust targetItem, currentPos so that current view does not change*/
+ if (Math.round(this._getPositionByIndex(index)) <= Math.round(this._targetPosition)) {
+ this._targetPosition++;
+ if (!this.conf.circularFlow)
+ this._targetPosition = Math.min(this._targetPosition, this.itemsLastIndex);
+ }
+ if (this._getPositionByIndex(index) <= this._currentPosition) {
+ this._currentPosition++;
+ if (!this.conf.circularFlow)
+ this._currentPosition = Math.min(this._currentPosition, this.itemsLastIndex);
+ }
+
+ // avoid display errors (wrong sizing)
+ var CF = this;
+ window.setTimeout(function () {
+ if(CF.items.length == 1 ) {
+ CF._currentPosition = -0.01;
+ CF._targetPosition = 0;
+ CF.resize();
+ }
+ else {
+ CF._initStep();
+ }
+ }, 100);
+
+ return index;
+
+ },
+
+ /*
+ * removes item at index position, cleans it up and returns it
+ */
+ rmItem: function(index) {
+ if (index == "undefined") index = this._activeItem.index;
+ index = this._getIndexByKeyWord(index);
+ if (!this.items[index]) return null;
+
+ var item = this.items[index];
+
+ if (item.pre) item.pre.next = item.next;
+ if (item.next) item.next.pre = item.pre;
+ this.items.splice(index,1);
+
+ /* adjust item indices */
+ for (var i = index ; i < this.items.length; i++) {
+ this.items[i].setIndex(i);
+ }
+ this._setLastIndex();
+
+ /* adjust targetItem, currentPos and activeItem so that current view does not change*/
+ if (Math.round(this._getPositionByIndex(index)) < Math.round(this._targetPosition)) {
+ this._targetPosition--;
+ if (!this.conf.circularFlow)
+ this._targetPosition = this._checkIndex(this._targetPosition);
+ }
+ if (this._getPositionByIndex(index) < this._currentPosition) {
+ this._currentPosition--;
+ if (!this.conf.circularFlow)
+ this._currentPosition = this._checkIndex(this._currentPosition);
+ }
+ this._activeItem = this._getItemByPosition(this._currentPosition);
+
+ /* remove item from DOM tree, take the next step and return removed item */
+ var removedItem = item.element.parentNode.removeChild(item.element);
+ // avoid display errors (wrong sizing)
+ var CF = this;
+ window.setTimeout(function () { CF._initStep() }, 10);
+ return removedItem;
+
+ },
+
+
+ /*
+ * ==================== initialization ====================
+ */
+
+
+ /* -------------------- main init -------------------- */
+ _init: function () {
+
+ if (typeof(this.Container) == 'string') { // no node
+ var container = document.getElementById(this.Container);
+ if (container) {
+ this.Container = container;
+ } else {
+ throw ('ContentFlow ERROR: No element with id \''+this.Container+'\' found!');
+ return;
+ }
+ }
+
+ /* ---------- reserve CSS namespace */
+
+ $CF(this.Container).addClassName('ContentFlow');
+
+ /* ---------- detect GUI elements */
+ var flow = $CF(this.Container).getChildrenByClassName('flow')[0];
+ if (!flow) {
+ throw ('ContentFlow ERROR: No element with class\'flow\' found!');
+ return;
+ }
+ this.Flow = new ContentFlowGUIElement(this, flow);
+
+ var scrollbar = this.Container.getChildrenByClassName('scrollbar')[0];
+ if (scrollbar) {
+ this.Scrollbar = new ContentFlowGUIElement(this, scrollbar);
+ var slider = this.Scrollbar.getChildrenByClassName('slider')[0];
+ if (slider) {
+ this.Slider = new ContentFlowGUIElement(this, slider);
+ var position = this.Slider.getChildrenByClassName('position')[0];
+ if (position) {
+ this.Position = new ContentFlowGUIElement(this, position);
+ }
+ }
+
+ }
+
+ /* ---------- init configuration */
+ this.setConfig(this._defaultConf);
+ this._initAddOns(); /* init AddOns */
+ this.setConfig(this._userConf);
+
+ this._initSizes(); // ......
+
+
+ /* ---------- init item lists ---------- */
+ var items = this.Flow.getChildrenByClassName('item');
+
+ this.items = new Array();
+ for (var i=0; i 0) {
+ item.pre = this.items[i-1];
+ item.pre.next = item;
+ }
+ }
+ this._setLastIndex();
+ if (this.conf.circularFlow && this.items.length > 0) {
+ var s = this.items[0];
+ s.pre = this.items[this.items.length-1];
+ s.pre.next = s;
+ }
+
+ /* ---------- init GUI */
+ this._initGUI();
+
+ /* ---------- init start parameters ---------- */
+ if (this._activeElement != "content")
+ this._activeElement = "element";
+
+ 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 index = this._getIndexByKeyWord(this.conf.scrollInFrom, this._targetPosition);
+ switch (this.conf.scrollInFrom) {
+ case "next":
+ case "right":
+ index -= 0.5;
+ break;
+ case "pre":
+ case "previous":
+ case "left":
+ index += 0.5;
+ break;
+ }
+ this._currentPosition = index;
+
+
+ /* ---------- wait till all images are loaded or
+ * grace time is up to show all and take the first step
+ */
+ var now = new Date();
+ var cf = this;
+ var timer = window.setInterval (
+ function() {
+ if ( cf._imagesToLoad == 0 || new Date() - now > cf._loadingTimeout ) {
+ clearInterval(timer);
+
+ cf._activeItem = cf.getItem(cf._currentPosition);
+ if (cf._activeItem) {
+ cf._activeItem.makeActive();
+ cf._setCaptionLabel(cf._activeItem.index);
+ }
+
+ cf.Flow.style.visibility = "visible"; // show flow after images are loaded
+ if (cf.loadIndicator) cf.loadIndicator.style.display = "none";
+ if (cf.Scrollbar) cf.Scrollbar.style.visibility = "visible";
+
+ cf.resize();
+ for (var i=0; i < cf._loadedAddOns.length; i++) {
+ var a = ContentFlowGlobal.AddOns[cf._loadedAddOns[i]];
+ if (a.methods.afterContentFlowInit)
+ a.methods.afterContentFlowInit(cf);
+ }
+ cf.conf.onInit();
+ }
+ }, 10
+ );
+
+ this.isInit = true;
+
+ },
+
+ /* ---------- init AddOns ---------- */
+ _initAddOns: function () {
+
+ // get an array of names of all AddOns that should be used
+ var loadAddOns = [];
+ if (this._userConf.useAddOns) {
+ if (typeof this._userConf.useAddOns == "string") {
+ loadAddOns = this._userConf.useAddOns.split(" ");
+ }
+ else if (typeof this._userConf.useAddOns == "array") {
+ loadAddOns = this._userConf.useAddOns;
+ }
+ }
+ else if (this.Container.getAttribute("useAddOns")) {
+ loadAddOns = this.Container.getAttribute("useAddOns").split(" ");
+ }
+ else {
+ loadAddOns = this.conf.useAddOns.split(' ');
+ }
+
+
+ // check the names for keywords
+ for (var i=0; i 0) key(event) ;
+ });
+ } else {
+ window.addEvent('keydown', function (event) {
+ if (mouseoverCheck.offsetLeft > 0) key(event) ;
+ });
+ }
+ }
+ else {
+ this.Container.addEvent('keydown', key);
+ }
+ }
+ else {
+ this.Container.onkeydown = key;
+ }
+ }
+
+
+ // Flow object
+ if (this.conf.flowDragFriction > 0) {
+ var onDrag = function (event) {
+ var e = event;
+ if (event.touches) e = event.touches[0];
+ var mouseX = e.clientX;
+ var mouseY = e.clientY;
+
+ if (this.conf.verticalFlow) {
+ var dist = mouseY - this.Flow.mouseY; // px / or px per sec because _dragFlow wil be called in shorter intervalls if draged fast
+ var dim = this.Flow.dimensions.height;
+ }
+ else {
+ var dist = mouseX - this.Flow.mouseX; // px / or px per sec because _dragFlow wil be called in shorter intervalls if draged fast
+ var dim = this.Flow.dimensions.width;
+ }
+ var itemDist = (dist / dim )* (2*this.conf.visibleItems +1); // items
+ var target = this._currentPosition - itemDist * 2*this.conf.visibleItems / this.conf.flowDragFriction ;
+
+ this.Flow.mouseX = mouseX;
+ this.Flow.mouseY = mouseY;
+
+ this.moveToPosition(target, true);
+ }.bind(this);
+
+ var beforeDrag = function () {};
+
+ var afterDrag = function (event) {
+ var t = Math.round(this._targetPosition);
+ if (Math.abs( t - this._currentPosition) > 0.001 )
+ this.moveToPosition(t);
+ }.bind(this);
+
+
+ this.Flow.makeDraggable(onDrag, beforeDrag, afterDrag);
+ }
+
+ // Scrollbar Object
+ if (this.Scrollbar) {
+ var click = function(event) {
+ if (!event) var event = window.event;
+
+ if (!this.Scrollbar.clickLocked) {
+ var mouseX = event.clientX;
+ var positionOnScrollbar = mouseX - this.Scrollbar.position.left;
+ var targetIndex = Math.round(positionOnScrollbar/this.Scrollbar.dimensions.width * this.itemsLastIndex);
+ this.moveToIndex(targetIndex);
+ }
+ else
+ this.Scrollbar.clickLocked = false;
+ }.bind(this);
+ this.Scrollbar.addObserver('click', click);
+ }
+
+ // Slider Object
+ if (this.Slider) {
+
+ if (this.Browser.IE6) {
+ var virtualSlider = document.createElement('div');
+ virtualSlider.className = 'virtualSlider';
+ this.Slider.appendChild(virtualSlider);
+ }
+
+ // position slider on scrollbar
+ this.Slider.setPosition = function (relPos) {
+ relPos = relPos - Math.floor(relPos) + this._getIndexByPosition(Math.floor(relPos));
+ if (Math.round(relPos) < 0)
+ relPos = this.itemsLastIndex;
+ else if (relPos <= 0)
+ relPos = 0;
+ else if (Math.round(relPos) > this.itemsLastIndex)
+ relPos = 0;
+ else if (relPos >= this.itemsLastIndex)
+ relPos = this.itemsLastIndex;
+
+
+ if (this.items.length > 1) {
+ var sPos = (relPos / this.itemsLastIndex)* this.Scrollbar.dimensions.width;
+ } else {
+ var sPos = 0.5 * this.Scrollbar.dimensions.width;
+ }
+ this.Slider.style.left = sPos - this.Slider.center.x+ "px";
+ this.Slider.style.top = this.Scrollbar.center.y - this.Slider.center.y +"px";
+
+ }.bind(this);
+
+ // make slider draggable
+ var beforeDrag = function (event) {
+ this.Scrollbar.clickLocked = true;
+ }.bind(this);
+
+ var onDrag = function (event) {
+ var e = event;
+ if (event.touches) e = event.touches[0];
+ var selectedIndex = this._checkIndex((e.clientX - this.Scrollbar.position.left) / this.Scrollbar.dimensions.width * this.itemsLastIndex);
+ this._targetPosition = this._getPositionByIndex(selectedIndex);
+ this.Slider.setPosition(selectedIndex);
+ if (this.Position) this.Position.setLabel(selectedIndex);
+ this._initStep(true, true);
+ }.bind(this);
+
+ var afterDrag = function (event) {
+ this._targetPosition = Math.round(this._targetPosition);
+ this.conf.onMoveTo(this._getItemByPosition(this._targetPosition));
+ this._initStep(true);
+ }.bind(this);
+
+ this.Slider.makeDraggable(onDrag, beforeDrag, afterDrag);
+ }
+
+
+ // Position object
+ if (this.Position) {
+ this.Position.setLabel = function (index) {
+ index = this._checkIndex(Math.round(index));
+ if (this.items && this.items[index].label)
+ this.Position.innerHTML = this.items[index].label.innerHTML;
+ else
+ this.Position.innerHTML = index + 1;
+ }.bind(this);
+ }
+
+
+ this.globalCaption = this.Container.getChildrenByClassName('globalCaption')[0];
+ this.loadIndicator = this.Container.getChildrenByClassName('loadIndicator')[0];
+ },
+
+ /* ---------- init element sizes ---------- */
+ _initSizes: function (x) {
+ //if (this.Browser.Konqueror4 && x != true) {
+ //var t = this;
+ //window.setTimeout( function () { t._initSizes(true) }, 0);
+ //return;
+ //}
+
+ // sets this.maxHeight
+ this._initMaxHeight();
+
+ var scrollbarHeight = this._initScrollbarSize();
+
+ // reduce maxHeit if container has a fixed height
+ if (!this.conf.verticalFlow && this.Container.style.height && this.Container.style.height != "auto")
+ this.maxHeight -= scrollbarHeight;
+
+ if (!this._activeItem) return;
+
+ var mFS = this._findBiggestItem();
+
+ var pF = this.Flow.findPos();
+
+ /* set height / width of flow */
+ if (this.conf.verticalFlow) {
+ this.Flow.style.width = mFS.width.width+"px";
+ this.Flow.style.height =3* mFS.width.width * (1 + this.conf.reflectionHeight + this.conf.reflectionGap) + "px";
+ } else {
+ this.Flow.style.height = mFS.height.height +(mFS.height.top - pF.top)+"px";
+ }
+
+ /* remove gap */
+ var s = this.conf.verticalFlow ? mFS.width.width : mFS.height.height;
+ var cH = s /(1 + this.conf.reflectionHeight + this.conf.reflectionGap);
+ this.Flow.style.marginBottom = - (s - cH)+ "px";
+
+ this.Flow.dimensions = this.Flow.getDimensions();
+
+ if (!this.Browser.IE6) {
+ if (this.conf.verticalFlow && this.Container.clientWidth < this.Flow.dimensions.width) {
+ //this.Container.style.width = this.Flow.dimensions.width+"px";
+ }
+ else if (this.Container.clientHeight < this.Flow.dimensions.height) {
+ this.Container.style.height = this.Flow.dimensions.height+"px";
+ }
+ }
+
+ if (this.conf.verticalFlow) {
+ this.Flow.center = {x: this.Flow.dimensions.height/2, y:mFS.width.width/2};
+ } else {
+ this.Flow.center = {x: this.Flow.dimensions.width/2, y:mFS.height.height/2};
+ }
+
+ },
+
+ /* -------------------------------------------------------------------------------- */
+
+ _initScrollbarSize: function () {
+ var SB;
+ var SL;
+ var PO;
+ if (SB = this.Scrollbar) {
+ SB.setDimensions();
+ var scrollbarHeight = SB.dimensions.height;
+
+ if (SL = this.Slider) {
+ SL.setDimensions();
+ scrollbarHeight += SL.dimensions.height;
+
+ if (PO = this.Position) {
+
+ var oldLabel = PO.innerHTML;
+ var maxH = maxW = 0;
+ PO.style.width = "auto";
+
+ if (this.items) {
+ for (var i=0; i < this.items.length; i++) {
+ var item = this.items[i];
+ if (item.label) {
+ PO.innerHTML = item.label.innerHTML;
+ }
+ else {
+ PO.innerHTML = item.index;
+ }
+ var h = PO.clientHeight;
+ var w = PO.clientWidth;
+ if ( h > maxH) maxH = h;
+ if ( w > maxW) maxW = w;
+ }
+ }
+ else {
+ PO.innerHTML = " ";
+ maxH = PO.clientHeight;
+ maxW = PO.clientWidth;
+ }
+
+ PO.innerHTML = oldLabel;
+
+ PO.setDimensions();
+
+ PO.style.width = maxW +"px";
+ PO.style.left = (SL.dimensions.width - maxW)/2 + "px";
+
+ var extraSpace = PO.position.top - SL.position.top;
+ if (extraSpace > 0) {
+ extraSpace += -SB.dimensions.height + maxH;
+ SB.style.marginBottom = extraSpace + "px";
+ }
+ else {
+ extraSpace *= -1;
+ SB.style.marginTop = extraSpace + "px";
+ }
+ scrollbarHeight += extraSpace;
+ }
+ }
+ }
+ else {
+ scrollbarHeight = 0;
+ }
+
+ return scrollbarHeight;
+
+ },
+
+ /* -------------------------------------------------------------------------------- */
+
+ _initMaxHeight: function () {
+
+ if (this.conf.verticalFlow) {
+ var proportion = screen.width/screen.height;
+ var Csd = this.Container.style.width;
+ var Cdim = this.Container.clientWidth;
+ var Fsd = this.Flow.style.width;
+ var Fdim = this.Flow.clientWidth;
+ var Fdim_o = this.Flow.clientHeight;
+ } else {
+ var proportion = screen.height/screen.width;
+ var Csd = this.Container.style.height;
+ var Cdim = this.Container.clientHeight;
+ var Fsd = this.Flow.style.height;
+ var Fdim = this.Flow.clientHeight;
+ var Fdim_o = this.Flow.clientWidth;
+ }
+
+ // set height of container and flow
+ if (this.ContainerOldDim)
+ Csd = this.ContainerOldDim;
+ if (this.FlowOldDim)
+ Fsd = this.FlowOldDim;
+
+ this.ContainerOldDim = "auto";
+ this.FlowOldDim = "auto";
+
+
+ /* calc maxHeight */
+ if (this.conf.maxItemHeight <= 0) {
+
+ this.maxHeight = Fdim_o / 3 * proportion/1 * this.conf.scaleFactor; // divided by 3 because of left/center/right, yes it's a magic number
+
+ if (this.conf.verticalFlow && (this.maxHeight == 0 || this.maxHeight > Fdim)) {
+ this.maxHeight = Fdim;
+ }
+
+ if (Csd && Csd != "auto") {
+ var gap = this.conf.verticalFlow ? 0 : this.conf.reflectionGap;
+ var rH = this.conf.verticalFlow ? 0 : this.conf.reflectionHeight;
+ this.maxHeight = Cdim/ (this.conf.scaleFactor* (1 + rH + gap));
+ this.ContainerOldDim = Csd;
+ }
+ else if (Fsd && Fsd != "auto") {
+ var gap = this.conf.verticalFlow ? 0 : this.conf.reflectionGap;
+ this.maxHeight = Fdim / (this.conf.scaleFactor* (1 + this.conf.reflectionHeight + gap));
+ this.FlowOldDim = Fsd;
+ }
+ }
+ else {
+ this.maxHeight = this.conf.maxItemHeight;
+ }
+ },
+
+ /* -------------------------------------------------------------------------------- */
+
+ _findBiggestItem: function () {
+
+ var currentItem = this._activeItem;
+
+ var itemP = currentItem.pre;
+ var itemN = currentItem.next;
+ var mFS = 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 checkMax = function (item, rI) {
+ var el = item.element;
+ el.style.display = "block";
+ var p = el.findPos();
+ var h = el.clientHeight;
+ var w = el.clientWidth;
+ if (h + p.top >= mFS.height.height + mFS.height.top) {
+ mFS.height.height = h;
+ mFS.height.top = p.top;
+ mFS.height.item = item;
+ mFS.height.rI = rI;
+ }
+ if (w + p.left >= mFS.width.width + mFS.width.left) {
+ mFS.width.width = w;
+ mFS.width.left = p.left;
+ mFS.width.item = item;
+ mFS.width.rI = rI;
+ }
+ el.style.display = "none";
+ }
+
+ var ocp = this._currentPosition;
+ this._currentPosition = this.conf.visibleItems+1;
+
+ // find the position with highest y-value
+ for (var i=-this.conf.visibleItems; i <= this.conf.visibleItems; i++) {
+ currentItem.element.style.display = "none";
+ this._positionItem(currentItem, i);
+ checkMax(currentItem, i);
+ }
+
+ // find the biggest item
+ var index = mFS.height.rI;
+ for (var i=0; i < this.items.length; i++) {
+ var item = this.items[i];
+ item.element.style.display = "none";
+ this._positionItem(item, index);
+ checkMax(item, index);
+ }
+
+ this._currentPosition = ocp;
+
+ return mFS
+ },
+
+
+
+ /*
+ * ==================== Key strok ====================
+ */
+
+ /*
+ * handles keystroke events
+ */
+ _keyStroke: function(event) {
+ if(!event) var event = window.event;
+
+ if (event.which) {
+ var keyCode = event.which;
+ } else if (event.keyCode) {
+ var keyCode = event.keyCode;
+ }
+
+ if (this.conf.keys[keyCode]) {
+ this.conf.keys[keyCode].bind(this)();
+ return Event.stop(event);
+ }
+ else {
+ return true;
+ }
+ },
+
+ /*
+ * ==================== mouse wheel ====================
+ * Event handler for mouse wheel event
+ * http://adomas.org/javascript-mouse-wheel/
+ */
+
+ _wheel: function (event) {
+ if (!event) var event = window.event; // MS
+
+ var delta = 0;
+ if (event.wheelDelta) {
+ delta = event.wheelDelta/120;
+ } else if (event.detail) {
+ delta = -event.detail/3;
+ }
+
+ if (delta) {
+ var target = this._targetPosition ;
+ if (delta < 0 ) {
+ target += (1 * this.conf.scrollWheelSpeed);
+ } else {
+ target -= (1 * this.conf.scrollWheelSpeed);
+ }
+ this.moveToPosition(Math.round(target));
+ }
+
+ return Event.stop(event);
+ },
+
+
+ /*
+ * ==================== set global Caption ====================
+ */
+ _setGlobalCaption: function () {
+ if (this.globalCaption) {
+ this.globalCaption.innerHTML = '';
+ if(this._activeItem && this._activeItem.caption)
+ this.globalCaption.appendChild(this._activeItem.caption.cloneNode(true));
+ }
+ },
+
+ /*
+ * ==================== move items ====================
+ */
+
+ /*
+ * intend to make a step
+ */
+ _initStep: function (holdSlider, holdPos) {
+ if (this.Slider) {
+ if(holdSlider) {
+ this.Slider.locked = true;
+ } else {
+ this.Slider.locked = false;
+ }
+ }
+ this._holdPos = holdPos == true ? true : false;
+ if (!this._stepLock) {
+ this._stepLock = true;
+ this._step();
+ }
+ },
+
+ /*
+ * make a step
+ */
+ _step: function () {
+
+ var diff = this._targetPosition - this._currentPosition;
+ var absDiff = Math.abs(diff);
+ if ( absDiff > 0.001) { // till activeItem is nearly at position 0
+
+ this._currentPosition += this.conf.flowSpeedFactor * this.conf.calcStepWidth(diff, absDiff, this.items.length, this.conf.visibleItems);
+
+ var AI = this.items[(this._getIndexByPosition(this._currentPosition))];
+
+ if (AI && AI != this._activeItem) {
+ if (this._activeItem) this._activeItem.makeInactive();
+ this._activeItem = AI;
+ 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 st = this._step.bind(this);
+ window.setTimeout(st,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);
+ }
+ },
+
+
+
+/* ------------------------------------------------------------------------------------------------------ */
+
+ /*
+ * position items
+ */
+ _positionItems: function () {
+
+ if (this._lastStart) {
+ var item = this._lastStart;
+ while (item) {
+ item.element.style.display="none";
+ item = item.next;
+ if (item == this._lastStart) break;
+ if (item && item.pre == this._lastEnd) break;
+ }
+ }
+ else {
+ this._lastStart = this._activeItem;
+ }
+
+ if (!this._activeItem) return;
+ var currentItem = this._activeItem;
+ var itemP = currentItem.pre;
+ var itemN = currentItem.next;
+
+ this._positionItem(currentItem, 0);
+ for (var i=1; i <= this.conf.visibleItems && 2*i < this.items.length ; i++) {
+ if (itemP) {
+ this._positionItem(itemP, -i);
+ this._lastStart = itemP;
+ itemP = itemP.pre;
+ }
+ if (itemN) {
+ this._positionItem(itemN, i);
+ this._lastEnd = itemN;
+ itemN = itemN.next;
+ }
+ }
+
+ },
+
+ _positionItem: function (item, relativeIndex) {
+
+ var conf = this.conf;
+ var vF = conf.verticalFlow;
+
+ var els = item.element.style;
+ //els.display =" none";
+ //if (els.display != "none") return;
+
+ /* Index and position relative to activeItem */
+ var p = item.position = this._currentPosition + relativeIndex;
+ var relativePosition = item.relativePosition = Math.round(p) - this._currentPosition;
+ var relativePositionNormed = item.relativePositionNormed = conf.visibleItems > 0 ? relativePosition/conf.visibleItems : 0;
+ var side = relativePosition < 0 ? -1 : 1;
+ side *= relativePosition == 0 ? 0 : 1;
+ item.side = side;
+
+ var size = conf.calcSize(item);
+ size.height = Math.max(size.height, 0);
+ size.width = Math.max(size.width, 0);
+ if (item.content.origProportion) size = this._scaleImageSize(item, size);
+ item.size = size;
+
+ var coords = item.coordinates = conf.calcCoordinates (item);
+ var relItemPos = item.relativeItemPosition = conf.calcRelativeItemPosition(item);
+ var zIndex = item.zIndex = conf.calcZIndex (item);
+ var fontSize = item.fontSize = conf.calcFontSize (item);
+ var opacity = item.opacity = conf.calcOpacity(item);
+
+ size.height *= this.maxHeight;
+ size.width *= this.maxHeight;
+
+ /* set position */
+ var sA = vF ? size.height : size.width;
+ var sB = vF ? size.width : size.height;
+ var pX = this.Flow.center.x * ( 1 + coords.x ) + (relItemPos.x - 1) * sA/2;
+ var pY = this.maxHeight/2 * ( 1 + coords.y ) + (relItemPos.y - 1 )* sB/2;
+ els.left = (vF ? pY : pX)+"px";
+ els.top = (vF ? pX : pY)+"px";
+
+ this._setItemSize(item, size);
+
+ /* set opacity */
+ if (conf.endOpacity != 1) {
+ this._setItemOpacity(item);
+ }
+
+ /* set font size */
+ if (!this.Browser.IE) els.fontSize = (fontSize * 100) +"%";
+
+ /* set z-index */
+ els.zIndex = 32768 + Math.round(zIndex * this.items.length); // just for FF
+
+ conf.onDrawItem(item);
+
+ els.visibility = "visible";
+ els.display = "block";
+ },
+
+ _scaleImageSize: function (item, size, max) {
+ var sFL = this.conf.scaleFactorLandscape;
+ var sFP = this.conf.scaleFactorPortrait;
+ var vF = this.conf.verticalFlow;
+ var prop = item.content.origProportion;
+ var width = size.width;
+ var height = size.height;
+ var c = item.content;
+
+ if (vF) {
+ if (prop <= 1) {
+ if (sFL != "max" && sFL != 1) {
+ height *= sFL;
+ width = Math.min(height * prop, max ? max : 1 );
+ }
+ height = width / prop;
+ }
+ else if (prop > 1) {
+ if (sFP == "max") {
+ height = max ? max : 1;
+ }
+ else if (sFP != 1) {
+ width *= sFP;
+ height = Math.min(width/prop, max ? max : 1)
+ }
+ else {
+ height = width / prop;
+ }
+ width = height * prop;
+ }
+ }
+ else {
+ if (prop > 1) {
+ if (sFL != "max" && sFL != 1) {
+ width *= sFL;
+ height = Math.min(width / prop, max ? max : 1);
+ }
+ width = height * prop;
+ }
+ else if (prop <= 1) {
+ if (sFP == "max") {
+ width = max ? max : 1;
+ }
+ else if (sFP != 1) {
+ height *= sFP;
+ width = Math.min(height*prop, max ? max : 1);
+ }
+ else {
+ width = height * prop;
+ }
+ height = width / prop;
+ }
+ }
+
+ height = isNaN(height) ? 0 : height;
+ width = isNaN(width) ? 0 : width;
+
+ if (!max && this.conf.fixItemSize) {
+
+ var propS = size.width / size.height;
+
+ var max = Math.max(size.width, size.height);
+ var s = this._scaleImageSize(item, {width: max, height: max}, max);
+
+ if (propS < 1) {
+ height = s.height/size.height;
+ width = height * prop / propS;
+ }
+ else {
+ width = s.width/size.width;
+ height = width / prop * propS;
+ }
+
+ var h = height * 100;
+ var w = width * 100;
+ var mL= (1 - width)/2 * 100;
+ var mT= ( 1 - height ) / propS * 100 * (vF ? 0.5 : 1 );
+ c.style.height = h+"%";
+ if (item.reflection) item.reflection.style.height = h*this.conf.reflectionHeight+"%";
+ c.style.width = w+"%";
+ if (item.reflection) item.reflection.style.width = w+"%";
+ c.style.marginLeft = mL+"%";
+ if (item.reflection) item.reflection.style.marginLeft = mL+"%";
+ c.style.marginTop = mT+"%";
+
+ item.element.style.overflow = "hidden";
+
+ return size;
+ }
+ else {
+ return {width: width, height: height};
+ }
+
+ },
+
+ _setItemSize: (function () {
+ if (ContentFlowGlobal.Browser.IE) {
+ var _setItemSize = function (item, size) {
+ if (!this.conf.fixItemSize) {
+ item.content.style.height = size.height+"px";
+ }
+ else if (ContentFlowGlobal.Browser.IE6) {
+ var h = parseInt(item.content.style.height)/100;
+ item.content.style.height = size.height*h+"px";
+ var mT = parseInt(item.content.style.marginTop)/100;
+ item.content.style.marginTop = size.height*mT+"px";
+ }
+ if (item.reflection) {
+ var h = parseInt(item.content.style.height);
+ item.reflection.style.height = h*this.conf.reflectionHeight+"px";
+ item.reflection.style.marginTop = h * this.conf.reflectionGap + "px";
+ }
+ item.element.style.width = size.width +"px";
+ item.element.style.height = size.height*(1+this.conf.reflectionHeight+this.conf.reflectionGap)+"px";
+ }
+ }
+ else {
+ var _setItemSize = function (item, size) {
+ if (item.reflection) {
+ item.element.style.height = size.height*(1+this.conf.reflectionHeight + this.conf.reflectionGap) +"px";
+ item.reflection.style.marginTop = size.height * this.conf.reflectionGap + "px";
+ }
+ else if (this._reflectionWithinImage) {
+ item.element.style.height = size.height*(1+this.conf.reflectionHeight + this.conf.reflectionGap) +"px";
+ }
+ else {
+ item.element.style.height = size.height +"px";
+ }
+ item.element.style.width = size.width +"px";
+ }
+ }
+ return _setItemSize;
+
+ })(),
+
+ _setItemOpacity: (function () {
+ if (ContentFlowGlobal.Browser.IE6) {
+ var _setItemOpacity = function (item) {
+ if (item.content.origSrc && item.content.origSrc.match(/\.png$/) ) {
+ var s = item.content.src;
+ item.content.src = item.content.origSrc;
+ item.content.style.filter = item.content.filterString+" progid:DXImageTransform.Microsoft.BasicImage(opacity="+item.opacity+")";
+ item.content.src = s;
+ }
+ else {
+ item.content.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(opacity="+item.opacity+")";
+ }
+ if (item.reflection) item.reflection.style.filter = item.reflection.filterString+"progid:DXImageTransform.Microsoft.BasicImage(opacity="+item.opacity+")";
+ }
+ }
+ else if (ContentFlowGlobal.Browser.IE) {
+ var _setItemOpacity = function (item) { item.element.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(opacity="+item.opacity+")"; }
+ }
+ else {
+ var _setItemOpacity = function (item) { item.element.style.opacity = item.opacity; }
+ }
+ return _setItemOpacity;
+ })()
+
+
+};
+
+
+/* ==================== extendig javascript/DOM objects ==================== */
+
+/*
+ * adds bind method to Function class
+ * http://www.digital-web.com/articles/scope_in_javascript/
+ */
+
+if (!Function.bind) {
+ Function.prototype.bind = function(obj) {
+ var method = this;
+ return function () {
+ return method.apply(obj, arguments);
+ };
+ };
+}
+
+
+/*
+ * extending Math object
+ */
+if (!Math.erf2) {
+ // error function (http://en.wikipedia.org/wiki/Error_function), implemented as erf(x)^2
+ Math.erf2 = function (x) {
+ var a = - (8*(Math.PI -3)/(3*Math.PI*(Math.PI -4)));
+ var x2 = x*x;
+ var f = 1 - Math.pow(Math.E, -x2 * (4/Math.PI + a*x2)/(1+a*x2));
+ return f;
+ };
+}
+
+if (!Math._2PI05) {
+ Math._2PI05 = Math.sqrt(2*Math.PI);
+}
+
+if (!Math.normDist) {
+ // normal distribution
+ Math.normDist = function (x, sig, mu) {
+ if (!sig) var sig = 1;
+ if (!mu) var mu = 0;
+ if (!x) var x = - mu;
+ return 1/(sig * Math._2PI05) * Math.pow(Math.E, - (x-mu)*(x-mu)/(2*sig*sig) );
+ };
+}
+
+if (!Math.normedNormDist) {
+ Math.normedNormDist = function (x, sig, mu) {
+ return this.normDist(x, sig, mu)/this.normDist(mu, sig, mu);
+ };
+}
+
+if (!Math.exp) {
+ Math.exp = function(x) {
+ return Math.pow(Math.E, x);
+ };
+}
+
+if (!Math.ln) {
+ Math.ln = Math.log;
+}
+
+if (!Math.log2) {
+ Math.log2 = function (x) {
+ return Math.log(x)/Math.LN2;
+ };
+}
+
+if (!Math.log10) {
+ Math.log10 = function (x) {
+ return Math.log(x)/Math.LN10;
+ };
+}
+
+if (!Math.logerithm) {
+ Math.logerithm = function (x, b) {
+ if (!b || b == Math.E)
+ return Math.log(x);
+ else if (b == 2)
+ return Math.log2(x);
+ else if (b == 10)
+ return Math.log10(x);
+ else
+ return Math.log(x)/Math.log(b);
+ };
+}
+
+
+/*
+ * extending Event object
+ */
+if (!Event) var Event = {};
+
+if (!Event.stop) {
+ Event.stop = function (event) {
+ event.cancelBubble = true;
+ if (event.preventDefault) event.preventDefault();
+ if (event.stopPropagation) event.stopPropagation();
+ return false;
+ };
+}
+
+/*
+ * extending Element object
+ */
+if (document.all && !window.opera) {
+ window.$CF = function (el) {
+ if (typeof el == "string") {
+ return window.$CF(document.getElementById(el));
+ }
+ else {
+ if (CFElement.prototype.extend && el && !el.extend) CFElement.prototype.extend(el);
+ }
+ return el;
+ };
+} else {
+ window.$CF = function (el) {
+ return el;
+ };
+}
+
+if (!window.HTMLElement) {
+ CFElement = {};
+ CFElement.prototype = {};
+ CFElement.prototype.extend = function (el) {
+ for (var method in this) {
+ if (!el[method]) el[method] = this[method];
+ }
+ };
+}
+else {
+ CFElement = window.HTMLElement;
+}
+
+
+/*
+ * Thanks to Peter-Paul Koch
+ * http://www.quirksmode.org/js/findpos.html
+ */
+if (!CFElement.findPos) {
+ CFElement.prototype.findPos = function() {
+ var obj = this;
+ var curleft = curtop = 0;
+ try {
+ if (obj.offsetParent) {
+ curleft = obj.offsetLeft;
+ curtop = obj.offsetTop;
+ while (obj = obj.offsetParent) {
+ curleft += obj.offsetLeft;
+ curtop += obj.offsetTop;
+ }
+ }
+ }
+ catch (ex) {}
+ return {left:curleft, top:curtop};
+ };
+}
+
+if (!CFElement.getDimensions) {
+ CFElement.prototype.getDimensions = function() {
+ return {width: this.clientWidth, height: this.clientHeight};
+ };
+}
+
+/*
+ * checks if an element has the class className
+ */
+if (!CFElement.hasClassName) {
+ CFElement.prototype.hasClassName = function(className) {
+ return (new RegExp('\\b'+className+'\\b').test(this.className));
+ };
+}
+
+/*
+ * adds the class className to the element
+ */
+if (!CFElement.addClassName) {
+ CFElement.prototype.addClassName = function(className) {
+ if(!this.hasClassName(className)) {
+ this.className += (this.className ? ' ':'') + className ;
+ }
+ };
+}
+
+/*
+ * removes the class className from the element el
+ */
+if (!CFElement.removeClassName) {
+ CFElement.prototype.removeClassName = function(className) {
+ this.className = this.className.replace(new RegExp('\\b'+className+'\\b'), '').replace(/\s\s/g,' ');
+ };
+}
+
+/*
+ * removes or adds the class className from/to the element el
+ * depending if the element has the class className or not.
+ */
+if (!CFElement.toggleClassName) {
+ CFElement.prototype.toggleClassName = function(className) {
+ if(this.hasClassName(className)) {
+ this.removeClassName(className);
+ } else {
+ this.addClassName(className);
+ }
+ };
+}
+
+/*
+ * returns all children of element el, which have the class className
+ */
+if (!CFElement.getChildrenByClassName) {
+ CFElement.prototype.getChildrenByClassName = function(className) {
+ var children = new Array();
+ for (var i=0; i < this.childNodes.length; i++) {
+ var c = this.childNodes[i];
+ if (c.nodeType == 1 && $CF(c).hasClassName(className)) {
+ children.push(c);
+ }
+ }
+ return children;
+ };
+}
+
+/*
+ * Browser independent event handling method.
+ * adds the eventListener eventName to element el and attaches the function method to it.
+ */
+if (!CFElement.addEvent) {
+ CFElement.prototype.addEvent = function(eventName, method, capture) {
+ if (this.addEventListener)
+ this.addEventListener(eventName, method, capture);
+ else
+ this.attachEvent('on'+eventName, method);
+ };
+}
+
+/*
+ * Browser independent event handling method.
+ * removes the eventListener eventName with the attached function method from element el.
+ */
+if (!CFElement.removeEvent) {
+ CFElement.prototype.removeEvent = function(eventName, method, capture) {
+ if (this.removeEventListener)
+ this.removeEventListener(eventName, method, capture);
+ else
+ this.detachEvent('on'+eventName, method);
+ };
+}
+
+/*
+ * Browser independent event handling method.
+ * adds the eventListener eventName to element el and attaches the function method to it.
+ */
+if (!window.addEvent) {
+ window.addEvent = function(eventName, method, capture) {
+ if (this.addEventListener) {
+ this.addEventListener(eventName, method, capture);
+ } else {
+ if (eventName != 'load' && eventName != 'resize')
+ document.attachEvent('on'+eventName, method);
+ else
+ this.attachEvent('on'+eventName, method);
+ }
+ };
+}
+
+/*
+ * Browser independent event handling method.
+ * removes the eventListener eventName with the attached function method from element el.
+ */
+if (!window.removeEvent) {
+ window.removeEvent = function(eventName, method, capture) {
+ if (this.removeEventListener) {
+ this.removeEventListener(eventName, method, capture);
+ } else {
+ if (eventName != 'load' && eventName != 'resize')
+ document.detachEvent('on'+eventName, method);
+ else
+ this.detachEvent('on'+eventName, method);
+ }
+ };
+}
+
+/* ==================== start it all up ==================== */
+ContentFlowGlobal.init();
+
--- a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/docu.html
+++ a/koha-tmpl/opac-tmpl/bootstrap/lib/contentflow/docu.html
@@ -0,0 +1,1018 @@
+
+
+
+
+
+
+
+
+
+
+ Not only images can be used as a content, but basicly any HTML elements you like.
+
+
+ ContentFlow is very flexible, so if you don't like having the loadIndicator, the globalCaption or the scrollbar just remove them.
+ ContentFlow will utilize them if it detects them.
+ So the very basic HTML structure is something like this:
+
+
+ If you want to change some styling you can do this globaly. Just rename the file 'mycontentflow.css.example' to 'mycontentflow.css', make the changes you like and you are ready to go.
+ For example, if you have a white background, I already have done the work for you. Just use the 'white' AddOn. To utilze it just download it, extract it into the same directory as 'contentflow.js' and add the load attribute to the script tag:
+
It's quite easy to change the configuration of ContentFlow.
+ If you just want to fiddle with the configuration the fastest way is to create a new ContentFlow object in javascript:
+
+ So let's say you want to disable the reflection (set reflectionHeight to 0) and don't want the flow to wrap around at the end (set circularFlow to false).
+ You have to give the ContentFlow tag an id (let's call it 'myFantasicFlow') and insert the following script tag somewhere in your page:
+
+
+ <script>
+ var myNewFlow = new ContentFlow('myFantasicFlow', { reflectionHeight: 0, circularFlow: false } ) ;
+ </script>
+
+
+
+
+
+
+
Files
+
+
mycontentflow.css.example
+
This is an example file which will help you to style your ContentFlow globaly. Rename it to 'mycontentflow.css' to utilize it.
This are example files from which you can build your own AddOn.
+
+
+
Script tag
+
+ By adding the 'load' attribute to the script tag you can load one or more AddOn.
+ The AddOns have to be given in the form of a space separated list and are loaded in the same order as given.
+
+ Where PATH is the path to the directory where you extracted ContentFlow to.
+ 'contentflow.js' is a compressed (using yuicompressor) version of 'contentflow_src.js'.
+ If you run in any problem with the compressed version, just change 'contentflow.js' to 'contentflow_src.js' (and drop me note).
+
+
+
+
(X)HTML
+
+
+ This code example shows all (X)HTML elements and element attributes ContentFlow knows about:
+
+ The 'loadIndicator', 'caption', 'label', 'globalCaption', 'scrollbar', 'preButton', 'nextButton', 'slider and 'position' elements are optional.
+ ContentFlow will auto detect and utilize them if they exist.
+
+
+
+
ContentFlow
+
Main ContentFlow wrapper. All elements of class 'ContentFlow' will be initialized.
+ If style attribute 'height' is set, maxItemHeight will be set accordingly.
+ If the attribute 'useAddOns' is given only the listed AddOns will be used for this ContentFlow.
+
+
+
flow
+
Wrapper around all flow items.
+ If style attribute 'height' is set, maxItemHeight will be set accordingly.
+
+
+
+
item
+
+ If you want to use an item as a link, just add an 'href' attribute to the item or it's content. A 'target' attribute will be taken into account.
+
+
+
content
+
The actual content of an item. Can be anything.
+ If the content element is not an image, beware that the item itself will be scaled and not the content!
+
+
+
caption
+
If exists will be used as the caption text of the item.
+ By default it is hidden and will be used for the global caption.
+ Can contain any HTML content.
+ To utilize the caption as a link, just make the whole caption a link (use an a-tag instead of a div-tag) or put a link inside it.
+
+
label
+
+ If exists and position element exists, it will be used as the position text label.
+ It's great to use the scrollbar as a timeline.
+
+
+
+
+
loadIndicator
+
If exists will show a loading indicator, while images are loaded.
+
+
globalCaption
+
If exists and caption element of active item exists will show the caption of the active item.
+
+
+
scrollbar
+
If exists will show a clickable scrollbar.
+
+
slider
+
If exists will show a dragable button on the slider.
+
+
position
+
If exists will show position label. Defaults to the item number.
+
+
+
+
+
preButton
+
This element can be anywhere within the ContentFlow. If exists it will fire the onclickPreButton method.
+ By default it will move the flow to the previous item.
+
+
nextButton
+
This element can be anywhere within the ContentFlow. If exists it will fire the onclickNextButton method.
+ By default it will move the flow to the next item.
+
+
+
+
+
Configuration
+
+ You can configure each ContentFlow independently or globally. Take a look at the
+ configuration and options
+ descriptions for an explanation.
+
+
+
+
+
+
+
+ If you want to adjust ContentFlow to your needs you have two possibilities. First you can use an AddOn or you can use a runtime configuration.
+
+
+
+
AddOn configuration
+ I think, that is the more convenient method.
+
+
Copy the file 'ContentFlowAddOn_DEAFULT.js' to 'ContentFlowAddOn_MyAddOn.js'
+
Change the name of the AddOn (first line of code in the AddOn file) to 'MyAddOn'
+
Make the changes you like.
+
+ Add the 'load' attribute to the script-tag which loads ContentFlow. Now add any AddOns you would like to use as a space separated list.
+ It should now look like this:
+
+ If you want to adjust ContentFlow to your needs you have two possibilities. First you can use a AddOn or you can use a runtime configuration.
+
+
+
+
AddOn configuration
+ I think, that is the more convenient method.
+
+
Copy the file 'ContentFlowAddOn_DEAFULT.js' to 'ContentFlowAddOn_MyAddOn.js'
+
Change the name of the AddOn (first line of code in the AddOn file) to 'MyAddOn'
+
Make the changes you like.
+
+ Add the 'load' attribute to the script-tag which loads ContentFlow. Now add any AddOns you would like to use as a space separated list.
+ It should now look like this:
+
Addons this ContentFlow should use (all, none, [AddOn1, ... , AddOnN])
+
loadingTimeout := int (default: 30000)
+
Grace time in milliseconds for images to load.
+
+
+
circularFlow := bool (default: true)
+
Should the Flow wrap around?
+
verticalFlow := bool (default: false)
+
Will turn the ContentFlow 90 degree counterclockwise.
+ This will automatically swap calculated positions and sizes where needed. You do not have to adjust any calculations or sizes. Should work with any AddOn outof the box.
+
+
+
visibleItems := int (default: 0)
+
Number of items to show on either side of the active Item. If set to '0' it will be set to the square root of the number of items in the flow.
+
endOpacity := float (default: 1)
+
The opacity of the last visible item on either side. The opacity of each item will be calculated by the 'calcOpacity' function.
+
startItem := string | int (default: center)
+
Active Content item to start with. Can be either a position keyword or an integer.
+
scrollInFrom := string | int (default: pre)
+
Flow will start scrolling on load from this item. Can be either a position keyword, "none" or an integer. If set to "none" the flow will not scroll in.
+
+
+
+
+
+
flowSpeedFactor := float (default: 1.0)
+
A flowSpeedFactor > 1 will speedup the scrollspeed, while a factor between 0 and 1 will slow it down
+
+
flowDragFriction := float (default: 1.0)
+
Determines how hard it is to drag the flow.
+ If set to '0' dragging of the flow is deactivated.
+
+
+
scrollWheelSpeed := float (default: 1.0)
+
Scales by how many items the flow will be moved with one usage of the mousewheel.
+ Negative values will reverse the scroll direction.
+ If set to '0' scrolling with the mouse wheel is deactivated.
+
+
+
keys := object (default: see below)
+
Defines the keyCodes and the functions, which are triggerd on a keydown event within the ContentFlow. All defined functions are bound to the ContentFlow object.
+ To disable this functionality set keys = {} (empty object).
+ Default setting:
+
+
+ {
+ 13: function () { this._onclickActiveItem(this._activeItem) }, // return/enter key
+ 37: function () { this.moveTo('pre') }, // left arrow
+ 38: function () { this.moveTo('visibleNext') }, // up arrow
+ 39: function () { this.moveTo('next') }, // right arrow
+ 40: function () { this.moveTo('visiblePre') } // down arrow
+ }
+
+
+
+
+
+
+
+
+
+
reflectionHeight := float (default: 0.5)
+
Set the size of the reflection image relative to the original image
+
+
reflectionGap := float (default: 0.0)
+
Set the size of the gap between the image and the reflection image relative to the original image size
+
+
reflectionColor := string (default: transparent)
+
Set the "surface"-color of the reflection. Can be "none", "transparent", or #RRGGBB (hex RGB values)
+ If set to 'overlay' the image given by the option 'reflectionOverlaySrc' will be lain over the reflection.
+
float := Factor to scale content images in landscape format by.
+ string := if set to 'max' the height of an landscape image content will be set to the height of the item.
+
float := Factor to scale content images in portrait format by.
+ string := if set to 'max' the width of an portait image content will be set to the width of the item.
+
+
+
fixItemSize := bool (default: false)
+
Fixes the item size, to the calculated size. No adjustments will be done. Images will be croped if bigger.
+
+
maxItemHeight := int (default: 0)
+
Maximum item height in px. If set to a value greater than '0' the item size will be calculated from this value instead relative to the width of the ContentFlow.
+
+
relativeItemPosition := string (deafult: top center)
+
Position of item relative to it's coordinate.
+ It can contain the keywords top/above, bottom/below, left, right and center.
+ So by default the item will be placed above the coordinate point and centered horizontally.
+ If set this option overrides the calcRelativeItemPosition option!
+
+
+
+
+
+
+
+
+
+
+
+
+
+ These functions will be bound to the ContenFlow object, so 'this' refers to the ContentFlow!
+
+
+
onclickInactiveItem := function(obj item)
+
called if an inactive item is clicked.
+
+
onclickActiveItem := function(obj item)
+
called if the active item is clicked.
+
+
onMakeInactive := function(obj item)
+
called if the active item becomes an inactive item.
+
+
onMakeActive := function(obj item)
+
called if an item becomes the active item.
+
+
onMoveTo := function(obj item)
+
called each time a new target is set i.e by calling the moveTo method.
+
+
+
onReachTarget := function(obj item)
+
called if the target item becomes the active item.
+
+
onclickPreButton := function(event event)
+
called if the 'pre' button item is clicked.
+
+
onclickNextButton := function(event event)
+
called if the 'next' button item is clicked.
+
+
+
onDrawItem := function(obj item)
+
called when ever an item is redrawn. Use with caution, because this method is easily called many thousend times !
+
+
+
+
+
+
+ These functions will be bound to the ContenFlow object, so 'this' refers to the ContentFlow!
+
+
+
calcStepWidth := function(float diff)
+
called to set the calculation function of the width of each step to get the next position of the flow.
+ The function will be bound to the ContenFlow object, so 'this' refers to the ContentFlow!
+ float 'diff' := targetItemPosition - currentPosition
+ returns: float
+
+
+
calcSize :=function(obj item)
+
called to set the calculation function of the size of a visible item
+ returns an object of type size := {width: w, height: h}
+
+
+
calcCoordinates := function(obj item)
+
called to calculate the position of an item element within the flow
+ returns an object of type position := {x: x, y: y}
+
+
+
calcRelativeItemPosition := function(obj item)
+
called to calculate the position of an item relative to it's coordinates
+ Beware: this function will be overridden by the 'relativeItemPosition' option!
+ returns an object of type position := {x: x, y: y}
+
+
+
calcZIndex := function(obj item)
+
called to set the calculation function of the z-index of each item. The z-index is only valid within the flow itself.
+ returns: int z (-32768 ≤ z ≤ 32768)
+
+
+
calcFontSize := function(obj item)
+
called to set the calculation function of the relative font-size of an item
+ returns: float fs (0.0 ≤ fs)
+
+
calcOpacity := function(obj item)
+
called to calculate the opacity of each item.
+ returns: float o (0.0 ≤ opacity ≤ 1.0)
+
called to scroll to item.
+ 'index' := scroll to item with index 'index'
+ 'pos' := scroll to position 'pos'
+ 'keyword' := scroll to position given by position keyword
+ 'item' := scroll to item
+
+
+
resize()
+
called to reinitialize the size of the flow items, after the size of the flow has changed. Is called if window is resized.
+
+
+
addItem(DOMnode element, int|string index)
+
called to add a new item 'element' to the flow at the position index. The element has to be a valid item element. So it must have at least this structure:
+ <div class="item"><img class="content" src="url/to/image"/></div>
+ The index has to be an integer or one of the strings 'first', 'start', 'last' or 'end'.
+ returns: int index (index position of added item)
+
+
+
rmItem([int index])
+
called to remove an item from the flow. If the parameter index is given the element at the index position 'index' will be removed, else the currently active item will be removed.
+ returns: DOMnode el (cleaned item node)
+
This is the basic structure of a ContentFlow object.
+
+
+ {
+ Container := DOM-Element // DOM element of the '.ContentFlow' element
+ Flow := DOM-Element // DOM element of the '.flow' element
+ Scrollbar := DOM-Element // DOM element of the '.scrollbar' element
+ Slider := DOM-Element // DOM element of the '.slider' element
+ items := Array // [ item0, item1, ... , itemN ]
+ conf := conf obj // object containing the configuration options
+ Browser := obj // ContentFlowGlobal.Browser
+ }
+
+
+
+
+
+
+
The options can be passed to the ContentFlow on creation,
+ by the setConfig method or
+ by an AddOn in the form of a data object.
+
+
+
+ {
+ option1: value,
+ option2: value,
+ .
+ .
+ .
+ lastOption: value // beware: last option must not end with a comma !
+ }
+
+
+
+
+
+
An 'item' object represents an item within the ContentFlow and has the following structure.
+
+
+ {
+ element := DOM-ELEMENT // DOM element of the item
+ pre := item obj // the previous item
+ next := item obj // the next item
+ content := DOM-ELEMENT // DOM element of the item content
+ caption := DOM-ELEMENT // DOM element of the item caption
+ label := DOM-ELEMENT // DOM element of the item label
+ index := int // index of item
+ position := float // position on the internel position axis
+ relativePosition := float // relative position of item
+ // (-visibleItems ≤ relativePosition ≤ visibleItems)
+ relativePositionNormed := float // normed relative position of item
+ // (-1 ≤ relativePosition ≤ 1)
+ side := int // left,center,right (-1,0,1)
+ size := size obj // size object as returned by calcSize
+ // {width: float, height: float} (0 ≤ width, height ≤ 1)
+
+ }
+
+ ContentFlow is a flexible flow written in javascript, which can handle any kind of content.
+ It's distributed under the MIT License.
+
+
+
+ With ContentFlow it is now possible to have any number of flows within one web page.
+ Each separately configurable, satisfying different visual needs.
+
+
+ It's easy to implement and to extend.
+ You are free to define your own methods for displaying content and interacting with it.
+ You can control all aspects of the flow without loosing the ease of use.
+
+
+ ContentFlow can handle different kinds of control, like keyboard and mouse, and can be used with and without a reflection.
+ For a complete list of features and compatibilities take a look at the feature list.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+