$(function(){

	var imgW = 20; //アイコンの幅
	var imgH = 20; //アイコンの高さ

	//札幌
	$.getJSON(
		"http://pipes.yahoo.com/pipes/pipe.run?_id=fb5cc1a862fc1f0e7fb4c15fcd1c8f77&_render=json&hl=ja&weather=sapporo%2Chokkaido&_callback=?",
		function(data) {
			var item = data.value.items[0];
			var icon = item.weather.current_conditions.icon.data;
			var tenki = item.weather.current_conditions.condition.data;
			var temp = item.weather.current_conditions.temp_c.data;
			$("#icon1").html("<img src=\"http://www.google.com" + icon + "\" width=\"" + imgW + "\" height=\"" + imgH + "\" alt=\"" + tenki + "\" />");
			$("#tenki1").text(tenki);
			$("#temp1").text(temp + " ℃");
		}
	);
	//道央、道南（函館）
	$.getJSON(
		"http://pipes.yahoo.com/pipes/pipe.run?_id=fb5cc1a862fc1f0e7fb4c15fcd1c8f77&_render=json&hl=ja&weather=hakodate%2Chokkaido&_callback=?",
		function(data) {
			var item = data.value.items[0];
			var icon = item.weather.current_conditions.icon.data;
			var tenki = item.weather.current_conditions.condition.data;
			var temp = item.weather.current_conditions.temp_c.data;
			$("#icon2").html("<img src=\"http://www.google.com" + icon + "\" width=\"" + imgW + "\" height=\"" + imgH + "\" alt=\"" + tenki + "\" />");
			$("#tenki2").text(tenki);
			$("#temp2").text(temp + " ℃");
		}
	);
	//道東（帯広）
	$.getJSON(
		"http://pipes.yahoo.com/pipes/pipe.run?_id=fb5cc1a862fc1f0e7fb4c15fcd1c8f77&_render=json&hl=ja&weather=obihiro%2Chokkaido&_callback=?",
		function(data) {
			var item = data.value.items[0];
			var icon = item.weather.current_conditions.icon.data;
			var tenki = item.weather.current_conditions.condition.data;
			var temp = item.weather.current_conditions.temp_c.data;
			$("#icon3").html("<img src=\"http://www.google.com" + icon + "\" width=\"" + imgW + "\" height=\"" + imgH + "\" alt=\"" + tenki + "\" />");
			$("#tenki3").text(tenki);
			$("#temp3").text(temp + " ℃");
		}
	);
	//道北（旭川）
	$.getJSON(
		"http://pipes.yahoo.com/pipes/pipe.run?_id=fb5cc1a862fc1f0e7fb4c15fcd1c8f77&_render=json&hl=ja&weather=asahikawa%2Chokkaido&_callback=?",
		function(data) {
			var item = data.value.items[0];
			var icon = item.weather.current_conditions.icon.data;
			var tenki = item.weather.current_conditions.condition.data;
			var temp = item.weather.current_conditions.temp_c.data;
			$("#icon4").html("<img src=\"http://www.google.com" + icon + "\" width=\"" + imgW + "\" height=\"" + imgH + "\" alt=\"" + tenki + "\" />");
			$("#tenki4").text(tenki);
			$("#temp4").text(temp + " ℃");
		}
	);
})

