$ = function(em) {
    if (document.getElementById) {
        return document.getElementById(em)
    } else if (document.all) {
        return document.all[em]
    } else if (document.layers) {
        return document.layers[em]
    } else {
        return null
    }
};
function dj(s, ss, sss, n) {
    for (var i = 1; i <= 2; i++) {
        var curC = document.getElementById(s + i);
        var curB = document.getElementById(ss + i);
        if (n == i) {
            curC.style.display = "block";
            curB.className = "a01"
        } else {
            curC.style.display = "none";
            curB.className = "a02"
        }
    }
}
function t1(s, ss, sss, n) {
    for (var i = 1; i <= 4; i++) {
        var curC = document.getElementById(s + i);
        var curB = document.getElementById(ss + i);
        if (n == i) {
            curC.style.display = "block";
            curB.className = "a01"
        } else {
            curC.style.display = "none";
            curB.className = "a02"
        }
    }
}
function open_comment(_id) {
    try {
        if ('' == $('f_comment').getAttribute('src')) {
            $('f_comment').setAttribute('src', '' + web_url + 'skin/index/dancecomment.php?id=' + _id)
        }
        parent.document.documentElement.scrollTop = 530;
        parent.document.body.scrollTop = 530
    } catch(e) {
        return
    }
};
function CopyTxt(obj) {
    obj.select();
    js = obj.createTextRange();
    js.execCommand("Copy");
    alert("复制成功，请添加到您需要的地方!")
}
function get_tags(parentobj, tag) {
    if (typeof parentobj.getElementsByTagName != 'undefined') {
        return parentobj.getElementsByTagName(tag)
    } else if (parentobj.all && parentobj.all.tags) {
        return parentobj.all.tags(tag)
    } else {
        return new Array()
    }
};
function clk(_act, _id) {
    var v = [];
    var a = get_tags($(_id), 'input');
    for (var i = 0; i < a.length; i++) {
        if (_act == 'all') {
            a[i].checked = true
        } else if (_act == 'un') {
            a[i].checked = (a[i].checked) ? false: true
        } else {
            if (0 < a[i].value && a[i].checked) {
                v.push(a[i].value)
            }
        }
    }
    if ('play' == _act) {
        if (3 > v.length) {
            alert('至少选择三首歌曲以上才能进行连播！');
            return
        }
        window.open('' + web_url + 'playsong.php?id=' + v.join('_'), 'play')
    }
};
function getClass(_id){
     document.getElementById("class_"+_id+"").className="now";
}