﻿$(document).ready(function() {
    //设置一级菜单无链接时默认链接到第一个子菜单 如果无子菜单则不跳转
    $('#menu a[class=parent]').each(function() {
        if ($(this).attr("href") == '') {
            if ($(this).next().html() == null) {
                $(this).attr("href", "javascript:void(0);");
            } else {
                var href = $(this).next().find('a').eq(0).attr("href");
                if ($(this).next().find('a').eq(1).attr("href").split('=')[1].length == 7) {
                    href = $(this).next().find('a').eq(1).attr("href");
                }
                $(this).attr("href", href);
            }
        }
    });
});

$(document).ready(function() {
    $('#menu').width($('#menu ul').width() + 29);
});


//使得FrmMain自动适应高度,不再显示Iframe中的滚动条
function SetFrmMainheight() {
    var iFrm = document.getElementById("FrmMain");
    var subWeb = document.frames ? document.frames["FrmMain"].document : iFrm.contentDocument;

    if (iFrm != null && subWeb != null) {
        if (subWeb.body.scrollHeight > 480)
            iFrm.height = subWeb.body.scrollHeight + 20;
        else
            iFrm.height = 500;
    }
}


        var widths=931;
    var heights=306;
    var counts=3;

    img1 = new Image(); img1.src = '../Images/Dynamic/1.jpg';
    img2 = new Image(); img2.src = '../Images/Dynamic/2.jpg';
    img3 = new Image(); img3.src = '../Images/Dynamic/3.jpg'; 
//    img4=new Image ();img4.src='<%=ImgUrl4 %>';
//    img5=new Image ();img5.src='<%=ImgUrl5 %>'; 
    var nn=1;
    var key=0;
    
    function change_img(n){
        if (key == 0) {
            key = 1;
        }
        else if (document.all) {
            document.getElementById("pic").filters[0].Apply();
            document.getElementById("pic").filters[0].Play(duration = 1);
        }
        
        eval('document.getElementById("pic").src=img'+nn+'.src');
        for (var i = 1; i < counts + 1; i++) {
            // eval('"Images/Web/banner_bt'+i+'.png"');
            eval('document.getElementById("img' + i + '").src="../Images/Web/banner_bt' + i + '.png"');
        }
        if(nn!=null)
           eval('document.getElementById("img'+nn+'").src="../Images/Web/banner_bt'+nn+'_onselect.png"');
       
           
        nn++;

        if (nn > counts) {
            nn = 1;
        }
        tt=setTimeout('change_img()',7000);
    }

    function changeimg(n) {
        nn = n;
        window.clearInterval(tt);
        change_img(n);
    }



   
