var ICON_DIR = "/img/icon";

/**
 * ホテルアイコン生成
 */
function hotelIcon() {
    return {
		icon: ICON_DIR + "/icon-hotel.png",
		flat: true
    }
}
/**
 * 道の駅アイコン生成
 */
function michinoekiIcon() {
     return {
		icon: ICON_DIR + "/icon-michinoeki.png",
		flat: true
     }
}
/**
 * スポットアイコン生成
 */
function spotIcon() {
    return {
		icon: ICON_DIR + "/icon-spot2.png",
		flat: true
     }
}
/**
 * 温泉アイコン生成
 */
function onsenIcon() {
    return {
    	icon: ICON_DIR + "/icon-onsen2.png",
    	flat: true
    }
}
/**
 * ライブドアの天気アイコン生成
 */
function wheatherIcon(yohou) {
	 var image = yohou.image;
	 var icon = new google.maps.MarkerImage(
		 image.url,
		 new google.maps.Size(50, 31),
		 new google.maps.Point(0, 0),
		 new google.maps.Point(8, 8),
		 new google.maps.Size(33, 21)
	 );
    return {
   	 title: yohou.title,
   	 icon: icon
   }
}
/**
 * 道の駅マーカーをクリックしたときの吹き出しの中身
 * @param item
 * @return
 * @see http://code.google.com/intl/ja/apis/maps/documentation/staticmaps/
 */
function michinoekiFukidashi(item) {
	var lat = Number.toFloat(item.lat);
	var lng = Number.toFloat(item.lng);
	var ekiTitle = "道の駅 " + item.title;
	var h4 = new Element('h4', {'class': 'michinoeki-title'});
	h4.adopt(new Element('img', {'src': ICON_DIR + '/icon-michinoeki.png'}));
	h4.appendText(ekiTitle);
/*
	var mapurl = "http://maps.google.com/maps/api/staticmap"
		+ "?center=" + lat + "," + lng
		+ "&zoom=13"
		+ "&size=180x120"
		+ "&sensor=false"
		+ "&markers=size:small|color:yellow|" + lat + "," + lng
		;
	var mapimg = new Element('img', {
		'src': mapurl,
		'alt': ekiTitle,
		'title': ekiTitle,
		'border': '0'
	});
*/
	var div2 = new Element('div', {'class': 'michinoeki-info'});
	div2.adopt(h4);
//	div2.adopt(mapimg);
	div2.adopt(new Element('br'));
	div2.appendText(item.address);
	div2.adopt(new Element('br'));
	div2.appendText('TEL:' + item.tel);
	div2.adopt(new Element('br'));

	return div2;
}
/**
 * スポットマーカーをクリックしたときの吹き出しの中身
 * @param item
 * @return
 */
function spotFukidashi(item) {
	var title = new Element('a', {'href': item.url});
	title.adopt(new Element('img', {'src': ICON_DIR + '/icon-spot.png'}));
	title.appendText(item.title);

	var h4 = new Element('h4', {'class': 'spot-title'});
	h4.adopt(title);

	var div2 = new Element('div', {'class': 'spot-info'});
	div2.adopt(h4);
	if (item.image) {
		div2.adopt(new Element('img', {
			'src': item.image,
			'class': 'spot-image'
		}));
	}
	var pre = new Element('div').set('html', item.comment.replace(/\n/g, '<br />'));
	div2.adopt(pre);

	var detailLink = new Element('div', {'class': 'spot-detail-link'});
	var link = new Element('a', {'href': item.url});
	link.appendText('このスポットの記事を表示');
	detailLink.adopt(link);
	div2.adopt(detailLink);
	return div2;
}
/**
 * 温泉マーカーをクリックしたときの吹き出しの中身
 * @param item
 * @return
 * @see http://code.google.com/intl/ja/apis/maps/documentation/staticmaps/
 */
function onsenFukidashi(item) {
	var lat = Number.toFloat(item.lat);
	var lng = Number.toFloat(item.lng);
	var ekiTitle = item.title;
	var h4 = new Element('h4', {'class': 'onsen-title'});
	h4.adopt(new Element('img', {'src': ICON_DIR + '/icon-onsen.png'}));
	h4.appendText(ekiTitle);
/*
	var mapurl = "http://maps.google.com/maps/api/staticmap"
		+ "?center=" + lat + "," + lng
		+ "&zoom=13"
		+ "&size=180x120"
		+ "&sensor=false"
		+ "&markers=size:small|color:yellow|" + lat + "," + lng
		;
	var mapimg = new Element('img', {
		'src': mapurl,
		'alt': ekiTitle,
		'title': ekiTitle,
		'border': '0'
	});
*/
	var div2 = new Element('div', {'class': 'onsen-info'});
	div2.adopt(h4);
//	div2.adopt(mapimg);
	div2.adopt(new Element('br'));

	return div2;
}

