﻿// JScript 文件
    //左侧滚动关键字
    $(document).ready(function(){
        marqueesHeight=26;
        stopscroll=false;
        var keywordListLeftObject = document.getElementById('keywordListLeft');
        with(keywordListLeftObject) {
           //style.width=0;
           style.height=marqueesHeight;
        //   style.overflowX="visible";
           style.overflow="hidden";
           noWrap=true;
           onmouseover=new Function("stopscroll=true");
           onmouseout=new Function("stopscroll=false");
        }
        preTop=0;
        currentTop=marqueesHeight;
        stoptime=0;
        keywordListLeftObject.innerHTML+=keywordListLeftObject.innerHTML;

        function init_srolltext() {
           keywordListLeftObject.scrollTop=0;
           setInterval(function(){scrollUp(keywordListLeftObject);},1);
        }

        function scrollUp(obj) {
           if(stopscroll==true) return;
            currentTop+=1;
           if(currentTop==marqueesHeight+1) { 
            stoptime+=1;
            currentTop-=1;
            if(stoptime==300) {
             currentTop=0;
             stoptime=0;    
            }
           } else {   
            preTop=obj.scrollTop;
            obj.scrollTop+=1;
            if(preTop==obj.scrollTop) {
             obj.scrollTop=marqueesHeight;
             obj.scrollTop+=1;   
            }
           }    
        }
        init_srolltext(); 
    });
    
    //右侧滚动关键字
    $(document).ready(function(){
        marqueesHeightRight=26;
        stopscrollRight=false;
        var keywordListRightObject = document.getElementById('keywordListRight');
        with(keywordListRightObject) {
           //style.width=0;
           style.height=marqueesHeight;
        //   style.overflowX="visible";
           style.overflow="hidden";
           noWrapRight=true;
           onmouseover=new Function("stopscrollRight=true");
           onmouseout=new Function("stopscrollRight=false");
        }
        preTopRight=0;
        currentTopRight=marqueesHeightRight;
        stoptimeRight=0;
        keywordListRightObject.innerHTML+=keywordListRightObject.innerHTML;

        function init_srolltextRight() {
           keywordListRightObject.scrollTop=0;
           setInterval(function(){scrollUpRight(keywordListRightObject);},1);
        }

        function scrollUpRight(obj) {
           if(stopscrollRight==true) return;
            currentTopRight+=1;
           if(currentTopRight==marqueesHeightRight+1) { 
            stoptimeRight+=1;
            currentTopRight-=1;
            if(stoptimeRight==300) {
             currentTopRight=0;
             stoptimeRight=0;    
            }
           } else {   
            preTopRight=obj.scrollTop;
            obj.scrollTop+=1;
            if(preTopRight==obj.scrollTop) {
             obj.scrollTop=marqueesHeightRight;
             obj.scrollTop+=1;   
            }
           }    
        }
        init_srolltextRight(); 
    });
