﻿//用于官网首页滚动图片广告
var n = 0;
var autoStart;
function mea(value,count) {
    n = value;
    plays(value,count );
}
function plays(value,count) {
    for (i = 0; i < count ; i++) {
        var name = 'focusdiv' + i;
        var select = 'focust' + i;
        if (i == value) {
            document.getElementById(name).className = 'focusdis';
            document.getElementById(select).className = 'focusselect';
        }
        else {
            document.getElementById(name).className = 'focusundis';
            document.getElementById(select).className = 'focusunselect';             
        }
    }
}

function clearauto() { clearInterval(autoStart) }
function setauto(count) { autoStart = setInterval("auto('" + count +" ')", 2000) }
function auto(count) {
    n++;
    if (n >= count)
    { n = 0; }
    mea(n,count );
}
function start(count) {
    setauto(count);
}