﻿// JScript 文件

function g(o){return document.getElementById(o);}
function HoverLi(n){
//如果有N个标签,就将i<=N;
//本功能非常OK,兼容IE7,FF,IE6;
for(var i=1;i<=6;i++){g('tb_'+i).className='normaltab';g('tbc_0'+i).className='undis';}g('tbc_0'+n).className='dis';g('tb_'+n).className='hovertab';
}



var showTime=5;
var tt;
function timeClear(){

    if(tt!=null){
        clearInterval(tt);
    }
    var time=function(){
        if(showTime==-1)
        {
            clearInterval(tt);  
        }
        else
        {
        document.getElementById('prompt').innerHTML="温馨提示:"+showTime+"秒后图片收起";
        showTime-=1;
        }
    }
    if(showTime>0){

        tt = window.setInterval(time,1000); 
    }
}

 var checktopAds=false; 
  var t1;
 function open_chk_show()
 {
        if(t1!=null)
            clearInterval(t1);
        if(!checktopAds)
        { 
            var anim = function()
            { 
                n += 20;
                if(n = 450){ 
                document.getElementById('topAds_chk_show').style.marginTop = "0"; 
                window.clearInterval(t1); 
                } 
                else{ 
                document.getElementById('topAds_chk_show').style.marginTop = "-"+(450 - n)+"px"; 
                } 
                },
                n=0; 
                t1 = window.setInterval(anim,80); 
        } 
//      window.setTimeout('close_chk_show()',3000)
}

 function close_chk_show()
 {
        if(t1!=null)
            clearInterval(t1);
        var anim = function()
        {
        n += 10; 
        if(n >= 450)
        { 
            document.getElementById('topAds_chk_show').style.marginTop = "-450px"; 
            window.clearInterval(t1); 
        } 
        else
        { 
            document.getElementById('topAds_chk_show').style.marginTop = "-"+ n +"px"; 
        } 
        },
        n=0; 
        t1 = window.setInterval(anim,80); 
        } 
        window.onload=function(){ 
        open_chk_show() 
}


//下面的slow()方法用于实现单击重播使图片逐渐下滑而不是一下出现
 function slow()
 {
        if(t1!=null)
            clearInterval(t1);
        if(!checktopAds)
        { 
            var anim = function()
            { 
                n += 20;
                if(n <= 450){ 
                document.getElementById('topAds_chk_show').style.marginTop = "-"+(450 - n)+"px";
               
                } 
                else{ 
                  document.getElementById('topAds_chk_show').style.marginTop = "0"; 
                  window.clearInterval(t1); 
                } 
                },
                n=0; 
                t1 = window.setInterval(anim,80); 
                
        } 
//      window.setTimeout('close_chk_show()',3000)
}


function fun_tab() {   
    if (event.keyCode == 13 && event.srcElement.type!='image') {   
        event.keyCode = 9;   
        }   
    if(event.keyCode == 13 && event.srcElement.type=='image'){   
            document.Form1.submit();
        }   
}  
function start_stop()
{
//    alert(document.getElementById('topAds_chk_show').style.marginTop);
    if(document.getElementById('topAds_chk_show').style.marginTop =="-450px")
    {
       slow();
       window.setTimeout('close_chk_show()',3000);
    }   
    else
    {
    }
}

function start()
{
    if(document.getElementById('topAds_chk_show').style.marginTop =="-450px")
    {
        document.getElementById('prompt').style.display='none';
       slow();
    }   
}
function close()
{
    if(document.getElementById('topAds_chk_show').style.marginTop =="0px")
    {
       close_chk_show();
    }  
}


