/*$(function(){ 
	$.ajax({ 
		url: 'http://rss.weather.yahoo.co.jp/rss/days/5020.xml', 
		type: 'GET', 
		dataType: 'xml', 
		timeout: 1000, 
		error: function(){ 
			alert("xmlファイルの読み込みに失敗しました"); 
		}, 
		success: function(xml){ 
		alert($(xml).find("title").html())
			$(xml).find("title").each(function(){ 
				var item_text = $(this).text(); 
				$("<li></li>") 
				.html(item_text) 
				.appendTo('ol'); 
			}); 
			$("li.demo").html(""); 
		} 
	}); 
});*/

google.load("feeds", "1");

function initialize() {
var d = new Date();
var dq = d.getMonth()+""+d.getDate()+""+d.getHours();
var feed = new google.feeds.Feed("http://rss.weather.yahoo.co.jp/rss/days/4330.xml?"+dq);
feed.load(function(result) {
if (!result.error) {
//明日
var wtexts=result.feed.entries[1].content;
var wtexts=wtexts.match(/^([^ ]+) - ([^ ℃]+)℃\/([^ ℃]+)/);
var icontext=wtexts[1];
$("#wether1").html(wtexts[3]+'℃～'+wtexts[2]+'℃<br />'+wtexts[1]);
/*$("#wether2").text(wtexts[2]);
$("#wether3").text(wtexts[3]);
//明日
var wtexts_n=result.feed.entries[1].title.match(/^【 ([^ ]+)/)[1];
$("#wether_n").text(wtexts_n);
var wtexts=result.feed.entries[1].content;
var wtexts=wtexts.match(/^([^ ]+) - ([^ ℃]+)℃\/([^ ℃]+)/);
$("#wether_n1").text(wtexts[1]);
$("#wether_n2").text(wtexts[2]);
$("#wether_n3").text(wtexts[3]);
//明後日
var wtexts_n=result.feed.entries[2].title.match(/^【 ([^ ]+)/)[1];
$("#wether_p").text(wtexts_n);
var wtexts=result.feed.entries[2].content;
var wtexts=wtexts.match(/^([^ ]+) - ([^ ℃]+)℃\/([^ ℃]+)/);
$("#wether_p1").text(wtexts[1]);
$("#wether_p2").text(wtexts[2]);
$("#wether_p3").text(wtexts[3]);*/
//天気アイコン
if(icontext == "晴れ"){$(".wetherbox").html("<img src='01module/images/wether/1.gif'>");
}else if(icontext == "晴時々曇"){$(".wetherbox").html("<img src='01module/images/wether/2.gif'>");
}else if(icontext == "晴時々雨"){$(".wetherbox").html("<img src='01module/images/wether/3.gif'>");
}else if(icontext == "晴時々雪"){$(".wetherbox").html("<img src='01module/images/wether/4.gif'>");
}else if(icontext == "晴後曇"){$(".wetherbox").html("<img src='01module/images/wether/5.gif'>");
}else if(icontext == "晴後雨"){$(".wetherbox").html("<img src='01module/images/wether/6.gif'>");
}else if(icontext == "晴後雪"){$(".wetherbox").html("<img src='01module/images/wether/7.gif'>");
}else if(icontext == "曇り"){$(".wetherbox").html("<img src='01module/images/wether/8.gif'>");
}else if(icontext == "曇時々晴"){$(".wetherbox").html("<img src='01module/images/wether/9.gif'>");
}else if(icontext == "曇時々雨"){$(".wetherbox").html("<img src='01module/images/wether/10.gif'>");
}else if(icontext == "曇時々雪"){$(".wetherbox").html("<img src='01module/images/wether/11.gif'>");
}else if(icontext == "曇後晴"){$(".wetherbox").html("<img src='01module/images/wether/12.gif'>");
}else if(icontext == "曇後雨"){$(".wetherbox").html("<img src='01module/images/wether/13.gif'>");
}else if(icontext == "曇後雪"){$(".wetherbox").html("<img src='01module/images/wether/14.gif'>");
}else if(icontext == "雨"){$(".wetherbox").html("<img src='01module/images/wether/15.gif'>");
}else if(icontext == "雨時々晴"){$(".wetherbox").html("<img src='01module/images/wether/16.gif'>");
}else if(icontext == "雨時々曇"){$(".wetherbox").html("<img src='01module/images/wether/17.gif'>");
}else if(icontext == "雨時々雪"){$(".wetherbox").html("<img src='01module/images/wether/18.gif'>");
}else if(icontext == "雨後晴"){$(".wetherbox").html("<img src='01module/images/wether/19.gif'>");
}else if(icontext == "雨後曇"){$(".wetherbox").html("<img src='01module/images/wether/20.gif'>");
}else if(icontext == "雨後雪"){$(".wetherbox").html("<img src='01module/images/wether/21.gif'>");
}else if(icontext == "暴風雨"){$(".wetherbox").html("<img src='01module/images/wether/22.gif'>");
}else if(icontext == "雪"){$(".wetherbox").html("<img src='01module/images/wether/23.gif'>");
}else if(icontext == "雪時々晴"){$(".wetherbox").html("<img src='01module/images/wether/24.gif'>");
}else if(icontext == "雪時々曇"){$(".wetherbox").html("<img src='01module/images/wether/25.gif'>");
}else if(icontext == "雪時々雨"){$(".wetherbox").html("<img src='01module/images/wether/26.gif'>");
}else if(icontext == "雪後晴"){$(".wetherbox").html("<img src='01module/images/wether/27.gif'>");
}else if(icontext == "雪後曇"){$(".wetherbox").html("<img src='01module/images/wether/28.gif'>");
}else if(icontext == "雪後雨"){$(".wetherbox").html("<img src='01module/images/wether/29.gif'>");
}else if(icontext == "暴風雪"){$(".wetherbox").html("<img src='01module/images/wether/30.gif'>");
}
}
});
}
google.setOnLoadCallback(initialize);

