var xotree = new XML.ObjTree();
xotree.force_array = [ "shop" ];
today = new Date();
url = document.URL.replace('index.html','') + 'shops.xml?' + today.getDate() + today.getHours();
var shopTree = xotree.parseHTTP( url );
var shop_index = 0;

function listShops()
{
	var shopCount = shopTree.shops.shop.length;
	if (shopCount > 0) {
		var shopList = '<table width="100%">';
		for(var i=0;i<shopCount;i++) {
			sp = shopTree.shops.shop[i];
			if (sp.name == '　') {sp.name = '販売店の詳細情報を見る';}
			if (i%2 == 0) { shopList += "<tr>"; }
			shopList += '<td>■' ; //<img src="' + sp.sid + '/' + sp.pic + '"' + sp.pic_size + '><br>';
			shopList += '<a href="./' + sp.sid + '/">' + sp.name + '</a><br>〒' + sp.zipcode + '<br>' + sp.address + '</td>';
			if (i%2 == 1) { shopList += "</tr>"; }
		}
		$('shopList').innerHTML = shopList + '</table>';
	}
//	shopTree.shops.shop.each(function(sp) {
	//	$('shopList').innerHTML += '<div><img src="' + sp.sid + '/' + sp.pic + '"' + sp.pic_size + '><a href="./' + sp.sid + '/">' + sp.name + '</a><br>〒' + sp.zipcode + '<br>' + sp.address + '<br></div>\n';
	//});
}


Event.observe(window, "load", listShops);

