/****************************************************
 * jQuery RSS Plugin by fieeeld
 * version: 0.04 (2008/12/01)
 * @requires jQuery v1.2.6 or later
 *
 * Demo at: http://tpfields.xrea.jp/demo/js/sitefeeds/
 *
 ****************************************************/
$(function(){
	$.ajax({
		url: "http://www.clairlaw.jp/blog/toshiofuruta/feed/",//RSSファイル名
		async: true,
		cache: false,
		dataType:"xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
                if ( i > 0 ) {
                    return false;
                }
				var date = dateParse($(this).find('pubDate').text());
				$('.furuta').append(date[1]);
    		});
		}
	});
});

$(function(){
	$.ajax({
		url: "http://www.clairlaw.jp/blog/akiosagawa/feed/",//RSSファイル名
		async: true,
		cache: false,
		dataType:"xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
                if ( i > 0 ) {
                    return false;
                }
				var date = dateParse($(this).find('pubDate').text());
				$('.sagawa').append(date[1]);
    		});
		}
	});
});

$(function(){
	$.ajax({
		url: "http://www.clairlaw.jp/blog/masaakisuzuki/feed/",//RSSファイル名
		async: true,
		cache: false,
		dataType:"xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
                if ( i > 0 ) {
                    return false;
                }
				var date = dateParse($(this).find('pubDate').text());
				$('.msuzuki').append(date[1]);
    		});
		}
	});
});

$(function(){
	$.ajax({
		url: "http://www.clairlaw.jp/blog/miosato/feed/",//RSSファイル名
		async: true,
		cache: false,
		dataType:"xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
                if ( i > 0 ) {
                    return false;
                }
				var date = dateParse($(this).find('pubDate').text());
				$('.msato').append(date[1]);
    		});
		}
	});
});

$(function(){
	$.ajax({
		url: "http://www.clairlaw.jp/blog/satoshisuzuki/feed/",//RSSファイル名
		async: true,
		cache: false,
		dataType:"xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
                if ( i > 0 ) {
                    return false;
                }
				var date = dateParse($(this).find('pubDate').text());
				$('.ssato').append(date[1]);
    		});
		}
	});
});

$(function(){
	$.ajax({
		url: "http://www.clairlaw.jp/blog/toshiakitanabe/feed/",//RSSファイル名
		async: true,
		cache: false,
		dataType:"xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
                if ( i > 0 ) {
                    return false;
                }
				var date = dateParse($(this).find('pubDate').text());
				$('.ttanabe').append(date[1]);
    		});
		}
	});
});

$(function(){
	$.ajax({
		url: "http://www.clairlaw.jp/blog/yuujihirai/feed/",//RSSファイル名
		async: true,
		cache: false,
		dataType:"xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
                if ( i > 0 ) {
                    return false;
                }
				var date = dateParse($(this).find('pubDate').text());
				$('.yhirai').append(date[1]);
    		});
		}
	});
});

$(function(){
	$.ajax({
		url: "http://www.clairlaw.jp/blog/namikoyoshida/feed/",//RSSファイル名
		async: true,
		cache: false,
		dataType:"xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
                if ( i > 0 ) {
                    return false;
                }
				var date = dateParse($(this).find('pubDate').text());
				$('.nyoshida').append(date[1]);
    		});
		}
	});
});

$(function(){
	$.ajax({
		url: "http://www.clairlaw.jp/blog/ryosato/feed/",//RSSファイル名
		async: true,
		cache: false,
		dataType:"xml",
		success: function(xml){
			$(xml).find('item').each(function(i){
                if ( i > 0 ) {
                    return false;
                }
				var date = dateParse($(this).find('pubDate').text());
				$('.rsato').append(date[1]);
    		});
		}
	});
});

//dateParse: "2008/10/14" 形式
function dateParse(str){
    var objDate = new Date(str);
    var nowDate = new Date();
    //現在の日付との差を計算
    myDay = Math.floor((nowDate.getTime()-objDate.getTime()) / (1000*60*60*24)) + 1;
    //もし2週間以内なら"new!"マーク
    if (myDay < 8 ){
        var newMsg = '<img src="/images/new.gif" alt="New" style="border:none;vertical-align:top;margin:4px 0 0 10px;padding:0;" />';
    } else {
        var newMsg = '';
    }
    var year = objDate.getFullYear();
    var month = objDate.getMonth() + 1;
    var date = objDate.getDate();
    if ( month < 10 ) { month = "0" + month; }
    if ( date < 10 ) { date = "0" + date; }
    str = year + '/' + month + '/' + date;
    rtnValue = new Array(2);
    rtnValue[0] = str;
    rtnValue[1] = newMsg;
    return rtnValue;
}
