

    Eva.require('slide', 'datalazyloader').ready(function(S) {
        //2A
        if (typeof S.DataLazyLoader === 'undefined' || typeof S.one === 'undefined' || typeof S.Slide === 'undefined') return;
        var YT_lazyLoad = null;
        /*
        * SlideShow Three Style
        */
        if (YT_lazyLoad == null) {
            YT_lazyLoad = new S.DataLazyLoader();
        }

        //BigSlideShow
        if (S.one('#J_BigShow')) {
            var LargeShow = new S.Slide('J_BigShow', {
                autoSlide: true,
                eventype: 'mouseover',
                effect: 'fade',
                selectedClass: 'on',
                timeout: 5000,
                speed: 0.35
            }).on("switch", function(param) {
                var tabPannel = S.all("#J_BigShow .tab-pannel").item(param.index);
                if (tabPannel != null) {
                    YT_lazyLoad.loadCustomLazyData(tabPannel, "img-src");
                }
            });
        }

        //RollSlideShow
        if (S.one('#J_RollFrame')) {
            var pannels = null;
            var RollFrame = new S.Slide('J_RollFrame', {
                autoSlide: true,
                eventype: 'mouseover',
                effect: 'h-slide',
                selectedClass: 'on',
                timeout: 4000,
                speed: 0.3,
                ready: function() {
                    pannels = S.one("#J_RollFrame").all(".tab-pannel");
                }
            });
            RollFrame.on("switch", function(param) {
                if (pannels.size() > 0) {
                    var tabPannel = pannels.item(param.index);
                    if (tabPannel != null) {
                        YT_lazyLoad.loadCustomLazyData(tabPannel, "img-src");
                    }
                }
            });
            //ControlHandle
            S.one('.box-handle .handle-pre').on('click', function(e) { e.halt(); RollFrame.previous(); e.target.blur(); });
            S.one('.box-handle .handle-next').on('click', function(e) { e.halt(); RollFrame.next(); e.target.blur(); });
        }

        //BrandSlideShow
        if (S.one('#J_BrandShow')) {
            var BrandShow = new S.Slide('J_BrandShow', {
                autoSlide: true,
                eventype: 'mouseover',
                effect: 'v-slide',
                selectedClass: 'on',
                timeout: 5000,
                speed: 0.3
            }).on("switch", function(param) {
                var tabPannel = S.all("#J_BrandShow .tab-pannel").item(param.index);
                if (tabPannel != null) {
                    YT_lazyLoad.loadCustomLazyData(tabPannel, "img-src");
                }
            });
        }

        //首页内容延迟展示
        if (S.one('.data-area')) {
            var allTextarealoader = S.all('.data-area');
            var _loaded = [];
            var _goReplace = function() {
                allTextarealoader.each(function(area, index) {
                    if (area.inViewportRegion() && !_loaded[index]) {
                        YT_lazyLoad.loadCustomLazyData(area);
                        _loaded[index] = true;
                        if (S.one("#J_Cooperation")) {
                            cooperationSlide();
                        }

                    }
                });
            };
            _goReplace();
            //滚动条移动时
            S.on('scroll', function() {
                _goReplace();
            });

            //窗口改变时
            S.on('resize', function() {
                _goReplace();
            });
        }

        function cooperationSlide() {
            if (S.DataLazyLoader && S.Slide) {
                new S.Slide('J_Cooperation', {
                    autoSlide: true,
                    eventype: 'mouseover',
                    effect: 'fade',
                    selectedClass: 'on',
                    timeout: 6000,
                    speed: 0.35
                }).on("switch", function(param) {
                    var tabPannel = S.all("#J_Cooperation .tab-pannel").item(param.index);
                    if (tabPannel != null) {
                        YT_lazyLoad.loadCustomLazyData(tabPannel, "img-src");
                    }
                });
            }
        }

    });


    Eva.require('node', 'inputip', 'navi').ready(function(S) {
        //2b
        if (typeof S.one === 'undefined' || typeof S.inputTip === 'undefined' || typeof S.Navi === 'undefined') return;
        /*
        * Search Input
        */
        var YT_searchInput = new S.inputTip('J_globalSrchbox', { defaultclass: 'default-text', autoSelected: true });
        var _oValue = S.one('#J_globalSrchbox').get('value'),
            _oButton = S.one('#J_globalSrchbox').next();
        S.on('click', function(e) {
            e.halt();
            var el = e.target;
            if (_oValue == '') {
                alert(infos.CE009);
            } else {
                S.one("#searchForm").submit();
            }

        }, _oButton);

        /*
        * Public Navigation Bar
        */
        var YT_Navi = new S.Navi('J_navigation', { zIndex: '10' });

        //loginOut
        if (S.one('#logout') !== null) {
            S.one('#logout').on('click', function(e) {
                e.halt();
                S.one("#hidlogout").set("value", "logout");
                S.one("#Logform").submit();
            })
        }

    });


