// 轮播图开始
//var width = document.documentElement.clientWidth; //获取当前手机屏宽
//var height = document.documentElement.clientHeight; //手机褡高

var rollNum = 0;
var a;
var b;
var divNum;
var rollImg;
var rollBtn;
var btnCircle= new Array(8);//固定数组长度为7
var btnActive= new Array(8);//固定数组长度为7


function btstart() {
   // alert(width);
      a = document.getElementsByName("roll-img1");
      b = document.getElementsByName("roll-btn1");
      divNum = a.length;
    // alert(divNum);
    rollImg = new Array(divNum);//固定数组长度为4
    for (i = 0; i < divNum; i++) {
        rollImg[i] = a[i];
    }
    rollBtn = new Array(divNum);//固定数组长度为4
    for (i = 0; i < divNum; i++) {
        rollBtn[i] = b[i];
    }
}
function rollNone  () {
    for (i = 0; i < divNum; i++) {
        rollImg[i].classList.remove('bounceInLeft');
        rollImg[i].classList.add('bounceOutRight');
        rollBtn[i].classList.add('roll-btn');
    }
    rollShow();
}
function rollShow()  {
    rollImg[rollNum].classList.remove('bounceOutRight');
    rollImg[rollNum].classList.add('bounceInLeft');
    rollBtn[rollNum].classList.remove('roll-btn');
    rollBtn[rollNum].classList.add('roll-btn-active');
}
function rollFunc() {
    rollNone();
    if (rollNum < divNum-1) rollNum++; else rollNum = 0;
    setTimeout("rollFunc()", 3000);
}

function rollBtnClick (btn){
    rollNum = btn;
    rollNone();
     return;
};
// 轮播图结束

window.onload = function(){
    rewin();
};

$(window).resize(function()
{
    rewin();
});

function rewin(){
    // $('span').text(x+=1);roll-img-0
    //var a=$("logo2").src;    //clientHeight
    a="12345";
    a=document.getElementById("roll-img-1").clientHeight;
    b=document.getElementById("navdiv2").clientHeight;
    bl=$(document.body).width();//
    //document.getElementById("window").clientWidth;
    //  c=document.getElementById("logo2").clientTop;
    c=a+b +20;
    document.getElementById("roll-btns1").style.top = (c-120) + "px";
    document.getElementById("btndiv1").style.top = c + "px";
    document.getElementById("btndiv1").style.width = (document.getElementById("navdiv1").clientWidth) +"px";
    document.getElementById("btndiv1").style.left = (document.getElementById("navdiv2").clientLeft  )+"px";
   document.getElementById("btndiv1").style.visibility="visible";
    //xzxdiv1
    document.getElementById("xzxdiv1").style.top = c  + document.getElementById("btndiv1").clientHeight +"px";
    document.getElementById("xzxdiv1").style.width = (document.getElementById("btndiv1").style.width) ;
    document.getElementById("xzxdiv1").style.left =  (document.getElementById("btndiv1").style.left );
   document.getElementById("xzxdiv1").style.visibility="visible";

    document.getElementById("copy1").style.width="100%";
    d=document.getElementById("xzxdiv1").style.top  +  document.getElementById("xzxdiv1").style.height;
    d=parseInt(d);
    document.getElementById("copy1").style.top =  (d+700) + "px" ;
    document.getElementById("copy1").style.visibility="visible";
    //  document.getElementById("btndiv1").innerText ="ABCD";
    //$('title').text(d);
    //  footTxt.style.top = "200px";
}
// 按钮开始


function  btnread(){
    //alert('AA');
    btnCircle[0] = document.getElementById("btn-circle-0");
    btnCircle[1] = document.getElementById("btn-circle-1");
    btnCircle[2] = document.getElementById("btn-circle-2");
    btnCircle[3] = document.getElementById("btn-circle-3");
   btnCircle[4] = document.getElementById("btn-circle-4");
    btnCircle[5] = document.getElementById("btn-circle-5");
    btnCircle[6] = document.getElementById("btn-circle-6");
    btnCircle[7] = document.getElementById("btn-circle-7");

    btnActive[0] = document.getElementById("btn-active-0");
    btnActive[1] = document.getElementById("btn-active-1");
    btnActive[2] = document.getElementById("btn-active-2");
    btnActive[3] = document.getElementById("btn-active-3");
    btnActive[4] = document.getElementById("btn-active-4");
    btnActive[5] = document.getElementById("btn-active-5");
    btnActive[6] = document.getElementById("btn-active-6");
    btnActive[7] = document.getElementById("btn-active-7");
}
function btnMouseEnter(i) {
    btnCircle[i].classList.remove('fadeIn');
    btnCircle[i].classList.add('fadeOut');
    btnActive[i].classList.remove('fadeOut');
    btnActive[i].classList.remove('d-none');
    btnActive[i].classList.add('fadeIn');
}

function btnMouseLeave(i) {
    btnCircle[i].classList.add('fadeIn');
    btnCircle[i].classList.remove('fadeOut');
    btnActive[i].classList.add('d-none');
    btnActive[i].classList.add('fadeOut');
    btnActive[i].classList.remove('fadeIn');
}
// 按钮结束

