﻿var  i_num=1;
var flag=2;
var int=self.setInterval("interval()",3500)
function interval(){
if(flag==1){
return;
}
 var setid="ad_"+i_num;
SetDivShow(setid);
i_num++
if(i_num==6){
i_num=1;
}

}
function setflag(fg,num){
 flag=fg;
 if(flag==1){
 i_num=num+1;
if(i_num==6){
i_num=1;
}
 }
}
function DivReload()
{
    var divList = document.getElementsByName('div_ad');
    for(var i =0 ; i< divList.length; i++)
    {
        var divID = divList[i].id + 'div';
        document.getElementById(divID).style.display = 'none';
    }
}

function HrefReload()
{
    var HrefList = document.getElementsByName('a_ad');
    for(var i =0 ; i< HrefList.length; i++)
    {
        HrefList[i].className = '';
    }            
}

function SetDivShow(id)
{
    DivReload();
    HrefReload();
    var Div_ID = id + '_div';
    if(document.getElementById(Div_ID) != null)
    {
        document.getElementById(Div_ID).style.display = 'block';
        document.getElementById(id).className = 'on';       
    }
}

var XmlHttp;
var html;

//判断
function sb()
{
    var regex=/^\d+$/;
    var MAIL=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
    var uid,pwd,checkcode;
    uid = document.getElementById("txt_UserName").value;
    pwd = document.getElementById("txt_PWD").value;
    checkcode = document.getElementById("txt_VerifyCode").value;
    uid = uid.replace(/(^\s*)|(\s*$)/g,  "");
    checkcode = checkcode.replace(/(^\s*)|(\s*$)/g,  "");
    if(uid=="")
    {
       alert("请输入你的登录邮箱")
       document.getElementById("txt_UserName").focus();
       return false;
    }
    
    if(pwd=="")
    {
       alert("请输入你的登录密码")
       document.getElementById("txt_PWD").focus();
       return false;
    }
    
    if(checkcode=="")
    {
       alert("请输入验证码")
       document.getElementById("txt_VerifyCode").focus();
       return false;
    }
    
    //判断
    logincheck(uid,pwd,checkcode)
    
    if(html!="0")
    {
       return false;
    }
 }
