﻿// ----------------------------------------------------------------------
/// <summary>
/// Description:	Clientscript for CoverFlow.cs to init imageflow
/// 
/// Autor:			Hans Hawe
/// Date:			28.08.2009
/// 
/// (c) by team ModulAcht. All rights reserved
/// </summary>
// ----------------------------------------------------------------------
var CoverFlow =
{
    // ----------------------------------------------------------------------
    /// Initialize    
    ///
    /// CoverFlowInit params:
    ///
    /// imageFlowID:    string, the id of the imageflow
    /// showButtons:    bool, flags whether to show navigation buttons
    /// startAnimation: bool, flags whether to animate slider at startup 
    /// startID:        int, number of the image to be shown in front at startup
    /// reflectionGET:  string, parameter to be passed to the reflection.aspx
    /// loadingText:    string, the loading  text to be shown in front of the number of already loaded images
    /// imageCursor:    string, Css-Value for the imageCursor to be shown when hovering on images
    /// instantLoadEvent: bool, flags whether to instantload an event when the coverflow changes
    // ----------------------------------------------------------------------
    /// For meaning of the other init parameters of the imageFlow just look in the imageflow.js
    ///
    // ----------------------------------------------------------------------
    initialize: function(imageFlowID, showButtons, startAnimation, startID, reflectionGET, loadingText, imageCursor, reflectionPage, instantLoadEvent) {
        /* Create ImageFlow instances when the DOM structure has been loaded */
        /* using domReady method from ImageFlow.js */
        domReady(function() {
            // create instance of imageflow
            var instanceOne = new ImageFlow();

            // init with all needed params
            instanceOne.init({ ImageFlowID: imageFlowID,
                aspectRatio: 4.409,
                buttons: showButtons,
                captions: false,
                imageCursor: (imageCursor == "" || imageCursor == null) ? 'pointer' : imageCursor,
                imageFocusM: 1.5,
                imageFocusMax: 6,
                imageScaling: true,
                imagesHeight: 0.7,
                imagesM: 1.0,
                loadingText: (loadingText == "" || loadingText == null) ? '' : loadingText,
                xStep: 80,
                opacity: false,
                percentLandscape: 100,
                percentOther: 100,
                preloadImages: true,
                reflections: true,
                reflectionGET: (reflectionGET == "" || reflectionGET == null) ? '' : reflectionGET,
                reflectionP: 0.5,
                reflectionPNG: false,
                scrollbarP: 0.6,
                slider: true,
                sliderCursor: 'e-resize',
                sliderWidth: 14,
                startID: (startID < 1) ? 1 : startID,
                startAnimation: startAnimation,
                reflectionPage: reflectionPage,
                instantLoadEvent: instantLoadEvent
            });

            window["Eventlist_CoverFlow"] = instanceOne;
        });

    }
}
