jQuery(function() {

    jQuery.getFeed({
        url: '/proxy.php?url=http://www.24news.ru/export/export.phtml?Type=rss&class=70',
        // url: '/proxy.php?url=http://news.yandex.ru/politics.rss',
        success: function(feed) {
/*
            jQuery('#result').append('<h2>'
            + '<a href="'
            + feed.link
            + '">'
            + feed.title
            + '</a>'
            + '</h2>');
*/
            var html = '<table width="100%" border="0" cellspacing="4" cellpadding="0" class="feed_news"><tr>';

            for(var i = 0; i < feed.items.length && i < 5; i++) {

                var item = feed.items[i];

/* fix date on 24News.ru */
var sTemp = item.updated.toString().split(" ");
if (sTemp[3].length < 4) {
  // loop through string
  item.updated = '';
  for (var j = 0; j < 6; j++) {
    if(j == 3) item.updated += "20";
    item.updated += sTemp[j] + " ";
  }
}

    item.description = item.description.match(/<img[^>]*>/ig);
    item.updated = $.PHPDate("d.m.y H:i", new Date(item.updated));

/*
                html += '<td class="panel" valign="top" align="center" width="20%">'
                + '<p style="color:#5da0de;"><b>' + item.updated + '</b><br /><span>'
                + '<a href="'
                + item.link
                + '">'
                + item.description + '</a></span></p><br />'
                + '<p style="color:#5da0de;">' + item.title + '</p>'
                + '</td>';
*/
                html += '<td valign="top" width="20%"><span class="panel">'
                + '<p><b>' + item.updated + '</b>';

                if (item.description != null)
                    html += '<br /><span><a href="' + item.link + '">' + item.description + '</a></span>';

                html += '</p>'
                + '<p><a href="' + item.link + '">' + item.title + '</a></p>'
                + '</span></td>';
            }

            html += '</tr></table>';

            jQuery('#result').append(html);
            // alert(html);
        }
    });
});
