$(document).ready(function() {
    // 在lvVersionList中加入版本历史
    if (typeof lvVersions != "undefined") {
        var html = "<UL>";
        var count=lvVersions.length;
        if (count > 4)
            count = 4;
        for (var i=0; i<count; ++i)
        {
            html = html.concat("<LI><STRONG>", lvVersions[i]["version"], "</STRONG>&nbsp;");
            html = html.concat(lvVersions[i]["description"].replace("\n", ""), "</LI>\n");
        }
        html = html.concat("</UL>");
        $("#lvVersionList").html(html);
    }

    // 在lvDownloadList中加入下载信息
    if (typeof lvFiles != "undefined") {
        var html = "";
    
        $.each( {"": "原版", "netease": "网易版", "anyp": "博易版"}, function(shortname, oemname){
            if (typeof lvFiles[shortname] != "undefined") {
                html = html.concat(
                    "<P>LikecanViewer V", 
                    lvFiles[shortname]["version"], 
                    " <A href='", 
                    lvFiles[shortname]["file"], 
                    "'>", 
                    oemname, 
                    "</A>",
                    " / <A href='", 
                    lvFiles[shortname]["green_file"], 
                    "'>绿色版</A>",
                    "<BR>MD5: ", 
                    lvFiles[shortname]["checksum"], 
                    " / ", 
                    lvFiles[shortname]["green_checksum"], 
                    "</P>");
            }
        } );
        $("#lvDownloadList").html(html);
    }

});
