function show(id,vol) {
    for (var i=1; i<=3; i++) {
        $("#c"+i).hide();
        $("#a"+i).removeClass("select");
    }
    $("#c"+id).show();
    $("#a"+id).addClass("select");
    if (id==2) {
        showComments(vol);
    }
}
function postComment(vol) {
    jQuery.ajax({
        url: 'comment.php',
        data: 'act=add&vol='+vol+'&user='+$("#user").val()+'&email='+$("#email").val()+'&url='+$("#url").val()+'&comment='+$("#message").val(),
        type: 'POST',
        beforeSend: function() {
            if(!isEmail($("#email").val())) {
                alert("Email地址错误！");
                $("#email").focus();
                return false;
            }
            $('input[type=submit]').attr('value','评论提交中...');
            $('input[type=submit]').attr('disabled','disabled');
        },
        success: function(data) {

            $('input[type=submit]').attr('value',' 提交评论 ');
            $('input[type=submit]').attr('disabled','');
            if(data=='yes') {
                alert("成功提交评论");
                showComments(vol);
            } else alert("发生未知错误，请联系网站管理员");

        }
    });
    return false;
}
function showComments(vol,page) {
    jQuery.ajax({
        url: 'comment.php',
        data: 'act=list&vol='+vol+'&page='+page,
        type: 'POST',
        beforeSend: function() {
            $(".loading").show();
        },
        success: function(data) {
            //show(2);
            $("#c2").html(data);
            $(".loading").hide();
        }
    });
    return false;
}
function isEmail(str){
    var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
    return reg.test(str);
}
function showInfo(id) {
    //$.weeboxs.open('#testbox', {title: 'hello world', width:400, height: 200});
    $.weeboxs.open('track.php?act=info&id='+id, {contentType:'ajax',title: '曲目信息',width:500, height: 200, showClose: true});
    return false;
}