$(function(){
/*
- - - - - - - - - - - - - - - - - - - - - - -
index
*/

jQuery.getFeed({
url: 'http://www.takasago.com/en/news/atom.xml',
success: function(feed) {
var html = '';
for(var i = 0; i < feed.items.length && i < 5; i++) {
var item = feed.items[i];
tmpUpdated = item.published;
a = tmpUpdated.split("T");

if( item.summary != 'nonatt' ){
temp = item.summary.split("|");
option = 'withatt ';
atttype = temp[0];
atturl = temp[1];
attvolume = item.updated;
}else{
option = '';
atttype = '';
atturl = '';
attvolume = '';
}

if( option != ""){
attcode = '<span class="icn"><img src="/common/images/icn-' + atttype + '.png" alt="' + atttype.toUpperCase() + '" /></span>';
if( attvolume != "blank"){
attcode += '<span class="volume">' + attvolume + '</span>';
}
}else{
attcode = '';
}


html += '<dl class="' + option + item.author_name + '">';
html += '<dt><span class="cat">' + item.category + '</span><span class="main">' + a[0] + '</span></dt>';
if( item.link == 'blank' ){
html += '<dd class="title">' + item.title + attcode + '</dd>';
}else{
html += '<dd class="title"><a href="' + item.link + '">' + item.title + '</a>' + attcode + '</dd>';
}

html += '</dl>'
}
jQuery('#feed_archive').append(html);
}
});

/*
- - - - - - - - - - - - - - - - - - - - - - -
*/
});
