﻿function load(cur) {
    loadImage(cur);
    if ($("whatsnew")) $("whatsnew").update("");
    new Ajax.Request("./svc.php",
                       {method:"post",
                        parameters:"action_GetTopicList=true&kind=4",
                        asynchronous:true,
                        onSuccess:showTopics});
    return;
}
function showTopics(resultRequest){
    //事前チェック
    if (resultRequest.responseText.substr(0,1)!='{') {
        $("whatsnew").update("　現在新着情報はありません。");
        return;
    }

    var result = eval( '(' + resultRequest.responseText.unescapeHTML() + ')' );

    if (result['Result'] != "success") {
        $("whatsnew").update("　現在新着情報はありません。");
        return;
    }

    //一覧の作成
    $("whatsnew").update("");
    rows = result.Data;
    if (rows.length == 0) {
        $("whatsnew").update("　現在新着情報はありません。");
        return;
    }
    var html = '<table width="100%" border="0" cellspacing="0" cellpadding="3">';
    for (var i=0; i < rows.length; i++) {
        row = rows[i];
        if (row.Topic == "") {
            topic = '';
        } else {
            topic = row.Topic.replace(/\r\n|\r/g,'<br>')+'<br>';
        }
        html += ''
                +'<tr>'
                  +'<td valign="top" width="10"><img src="images/lm03.gif" width="8" height="10" border="0" alt=""></td>'
                  +'<td valign="top">'+topic+'</td>'
                +'</tr>'
                +'<tr>'
                  +'<td class="dotline" colspan="2"><img src="images/spacer.gif" height="5" alt=""></td>'
                +'</tr>';
    }
    html += '</table>';
    $("whatsnew").update(html);
}

