﻿startList = function() {
    if (document.all && document.getElementById) {
        navRoot = document.getElementById("nav");
        for (i = 0; i < navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            if (node.nodeName == "LI") {
                node.onmouseover = function() {
                    this.className += " over";
                }
                node.onmouseout = function() {
                    this.className = this.className.replace(" over", "");
                }
            }
        }
    }
}
function MqObj(obj, width, height, speed, direct) {
    obj.contWidth = obj.offsetWidth; // offsetWidth
    obj.stopscroll = false;
    obj.nowscroll = 0;
    with (obj) {
        scrollLeft = 0; //
        innerHTML += innerHTML;
        style.width = width;
        style.height = height;
        style.overflowX = "hidden"; //
        style.overflowY = "visible"; //
        noWrap = true;
        onmouseover = function() { stopscroll = true };
        onmouseout = function() { stopscroll = false };
    }
    eval("setInterval('doScroll(" + obj.id + ")'," + speed + ")");
}
function doScroll(obj) {
    if (obj.stopscroll == true) return;
    if (obj.nowscroll < obj.contWidth) { // 
        obj.scrollLeft = obj.nowscroll++; //scrollLeft
    } else {
        obj.scrollLeft = 0; //scrollLeft
        obj.nowscroll = 0;
    }
}

window.onload = function() {
    startList();
    MqObj(img_list, "900", "140", "20");
    //MqObj(group_list, "480", "200", "20");
}