Event.observe(window, 'load', function(event)
{
    new Ajax.Request('http://www.c-english.com/news/?feed=atom', {
        method: 'get',
        onSuccess: function(transport)
        {
            var html = [], count = 0;
            $A(transport.responseXML.getElementsByTagName('entry'))
            .each(function(entry) {
                var id = entry.getElementsByTagName('id');
                var title = entry.getElementsByTagName('title');
                id = (id && id.length) ? id[0].firstChild.nodeValue : '';
                title = (title && title.length) ? title[0].firstChild.nodeValue
                                                : '';
                html[count++] = '<div class="news-atama">'
                                + title
                                + '<a href="news.php">…詳細はこちら</a></div>';
                if (count > 2) {
                    throw $break;
                }
            });
            $('news_naka').innerHTML = html.join('');
        },
        onFailure: function() {}
    });
});
