// JavaScript Document
var Ex=function (o){for(var k in o)this[k]=o[k];return this}
var UI=function (id){return document.getElementById(id)}
var UIs=function (tag){return Ex.call([],this.getElementsByTagName(tag))}
var Each=function (a,fn){for(var i=0;i<a.length;i++)fn.call(a[i],i,a)}
var dhooo=function (ini){
this.bind(ini,this);
this.autoIndex=0;
};
Ex.call(dhooo.prototype,{
bind:function (ini,me){
var dir=ini.dir=='top'?'scrollTop':'scrollLeft',pan=UI(ini.contentID);
var start=function (o){
Each(ini.btns,function(){this.className=''});
o.className=ini.className;
me.autoIndex=o.index;
me.begin(o.index,pan,ini.len,dir);
};
pan.onmouseover=function (){me.stop=true};
Each(ini.btns,function (i){
this.index=i;
this.onmouseover=function (){me.stop=true;start(this)};
pan.onmouseout=this.onmouseout=function(){me.stop=false}
});
var auto=function(){
if(!me.stop){
me.autoIndex=me.autoIndex==bannercount?0:++me.autoIndex;
start(ini.btns[me.autoIndex]);
}
};
if(ini.auto)this.autoPlay=window.setInterval(auto,5000);
}
,begin:function (i,o,len,dir){
    var img=o.getElementsByTagName("li");
    if(document.all)
        img[i].childNodes[0].childNodes[0].style.filter="alpha(opacity=0)";
    else
        img[i].style.opacity=0.05;
    var diff=(i*len-o[dir])*1;
o[dir]+=Math[diff>0?'ceil':'floor'](diff);
var opacitynum=0;
(function (me){
clearInterval(me.only);
me.only=setInterval(function (){
opacitynum+=0.05;
if(document.all)
    img[i].childNodes[0].childNodes[0].style.filter="alpha(opacity="+opacitynum*100+")";
else
img[i].style.opacity=opacitynum;
if(opacitynum>=1)clearInterval(me.only);
},10)
})(this)
}
})
if(!isIE_8()){
    if(isIE_c()){
    new dhooo({
    btns:UIs.call(UI('myTab_btns2'),'LI')
    ,className:'nonce'
    ,contentID:'main2'
    ,len:313
    ,dir:'top'
    ,auto:true
    });
    }else{
        new dhooo({
            btns:UIs.call(UI('myTab_btns2'),'LI')
            ,className:'nonce'
            ,contentID:'main2'
            ,len:310
            ,dir:'top'
            ,auto:true
            });
    }
}else{
    new dhooo({
    btns:UIs.call(UI('myTab_btns2'),'LI')
    ,className:'nonce'
    ,contentID:'main2'
    ,len:310
    ,dir:'top'
    ,auto:true
    });
}
function showhide_divU(showdivid,hidedivid){
    if($(showdivid)!=null){
        $(showdivid).style.display="";
        if(showdivid=='guanzhu')
            $(showdivid+"_title").className="nonce";
        else
            $(showdivid+"_title").className="other nonce";
    }
    if($(hidedivid)!=null){
        $(hidedivid).style.display="none";
        if(hidedivid=='huodong')
            $(hidedivid+"_title").className="other";
        else
            $(hidedivid+"_title").className="";
    }
}
//ff兼容
function isIE_c(){
    if(window.navigator.userAgent.toLowerCase().indexOf("msie 8.0")>1)
        return false;
   return window.navigator.userAgent.toLowerCase().indexOf("msie")>=1?true:false;
}
function isIE_8(){
    if(window.navigator.userAgent.toLowerCase().indexOf("msie 8.0")>1)
        return true;
    else
        return false;
}
function scrollImg(){
    var posX,posY;
    if (window.innerHeight) {
        posX = window.pageXOffset;
        posY = window.pageYOffset;
    }
    else if (document.documentElement && document.documentElement.scrollTop) {
        posX = document.documentElement.scrollLeft;
        posY = document.documentElement.scrollTop;
    }
    else if (document.body) {
        posX = document.body.scrollLeft;
        posY = document.body.scrollTop;
    }
    if(document.body.clientWidth>1024){
    posX=1004+((document.body.clientWidth-970)/2);
    }else{
    posX=1004+((document.body.clientWidth-970)/2);
    }
    var ad=$("feedback");
    ad.style.top=(posY+200)+"px";
    ad.style.left=(posX)+"px";
    setTimeout("scrollImg()",200);
}
