//PopUP
	var mpcontents01="中央図書館<br /><img src='../img/visual/lib_chuo.jpg' width='190px' height='125px'>";
	var mpcontents02="高田早苗記念研究図書館<br /><img src='../img/visual/lib_takada.jpg' width='190px' height='125px'>";
	var mpcontents03="戸山図書館<br /><img src='../img/visual/lib_toyama.jpg' width='190px' height='125px'>";
	var mpcontents04="理工学図書館<br /><img src='../img/visual/lib_riko.jpg' width='190px' height='125px'>";
	var mpcontents05="所沢図書館<br /><img src='../img/visual/lib_tokorozawa.jpg' width='190px' height='125px'>";
	
	var point  = new GLatLng(35.70777131894265, 139.71420764923096);
	var point1 = new GLatLng(35.71078121035695, 139.71806466579437);
	var point2 = new GLatLng(35.70852271347915, 139.72027480602264);
	var point3 = new GLatLng(35.70520127829052, 139.71872448921204);
	var point4 = new GLatLng(35.70603546158448, 139.70671087503433);
	var point5 = new GLatLng(35.785969787685744, 139.39824879169464);
	
	// マーカーアイコン生成
	function createMarkerA(point, info) {
	   
	   			// マーカーオプション　アイコン
				var icon = new GIcon();
				icon.image = "../img/share/w_logo.png";
				icon.iconSize = new GSize(25, 30);/*icon size*/
				icon.iconAnchor = new GPoint(0, 20);/*icon position*/
				  
				icon.infoWindowAnchor = new GPoint(9, 2);
        		icon.infoShadowAnchor = new GPoint(18, 25);
					
	   
          markerOptions = { icon:icon };
          var marker = new GMarker(point, markerOptions);

          GEvent.addListener(marker, "click", function() {
            marker.openInfoWindowHtml(info);
          });
          return marker;
        }
		
	// 表示座標を指定
    function selectchanged(point,zm,iconx,icony) {
        var point;
		if (!arguments[1]){var zm=17;}
		//icon.iconAnchor = new GPoint(iconx, icony);
		//var marker = new GMarker(point, markeropts);
		
		map.setCenter(point, zm);
		
    }
	// テキストリンクから，PopUPを開く
    function selectpopup(mpcontents) {
    map.openInfoWindowHtml(map.getCenter(),mpcontents);

	}
	
	
	
	function LibraryMap(pt,zoom,popup){
	
	if (!pt){pt = point;}
	if (!zoom){zoom = 15;}
	
	//表示座標セット	
    map.setCenter(pt , zoom);

	//インターフェース配置	
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
			
		
		map.addOverlay(createMarkerA(point1, mpcontents01));
		map.addOverlay(createMarkerA(point2, mpcontents02));
		map.addOverlay(createMarkerA(point3, mpcontents03));
		map.addOverlay(createMarkerA(point4, mpcontents04));
		map.addOverlay(createMarkerA(point5, mpcontents05));
				  

		
	if (location.hash){
	
		if (location.hash =="#CLIB"){selectchanged(point1);selectpopup(mpcontents01);}
		if (location.hash =="#TAKATA"){selectchanged(point2);selectpopup(mpcontents02);}
		if (location.hash =="#TOYAMA"){selectchanged(point3);selectpopup(mpcontents03);}
		if (location.hash =="#RIKOU"){selectchanged(point4);selectpopup(mpcontents04);}
		if (location.hash =="#TOKOROZAWA"){selectchanged(point5);selectpopup(mpcontents05);}
		
	}else{
	//selectchanged(point1, 17, 0, 20);
	if(popup){selectpopup(popup);}
	}
    

	}
	
	
function LibraryAdress(){
contents = '<p>';
contents += '<table border="0" width="100%" class="access_tbl" style="">';
contents += '   <tr class="">';
contents += '	<td class="tbl_head" nowrap="nowrap">図書館名</td>';
contents += '	<td class="tbl_head">場所</td>';
contents += '	<td class="tbl_head">住所</td>';
contents += '  </tr>';
contents += '  <tr class="">';
contents += '	<td class="item_td"><h3><a href="javascript:selectchanged(point1);selectpopup(mpcontents01);">中央図書館</a></h3></td>';
contents += '	<td class="">早稲田キャンパス18号館<br />総合学術情報センター<br />2階入口</td>';
contents += '	<td class="">〒169-8050 東京都新宿区西早稲田1-6-1<br />TEL. 03-3203-5581</td>';
contents += '  </tr>';
contents += '	<tr class="">';
contents += '	<td class="item_td"><h3><a href="javascript:selectchanged(point2);selectpopup(mpcontents02);">高田早苗記念研究図書館</a></h3></td>';
contents += '	<td class="">早稲田キャンパス2号館3階<br />南側入口</td>';
contents += '	<td class="">〒169-8050 東京都新宿区西早稲田1-6-1<br />TEL. 03-5286-1851</td>';
contents += '  </tr>';
contents += '	<tr class="">';
contents += '	<td class="item_td"><h3><a href="javascript:selectchanged(point3);selectpopup(mpcontents03);">戸山図書館</a></h3></td>';
contents += '	<td class="">戸山キャンパス38号館</td>';
contents += '	<td class="">〒162-8644 東京都新宿区戸山1-24-1<br />TEL 03-5286-3528</td>';
contents += '  </tr>';
contents += '	<tr class="">';
contents += '	<td class="item_td"><h3><a href="javascript:selectchanged(point4);selectpopup(mpcontents04);">理工学図書館</a></h3></td>';
contents += '	<td class="">西早稲田キャンパス<br />（旧・大久保キャンパス）<br />51号館 B1/B2</td>';
contents += '	<td class="">〒169-8555 東京都新宿区大久保3-4-1<br />TEL. 03-5286-3889</td>';
contents += '  </tr>';
contents += '	<tr class="">';
contents += '	<td class="item_td"><h3><a href="javascript:selectchanged(point5);selectpopup(mpcontents05);">所沢図書館</a></h3></td>';
contents += '	<td class="">所沢キャンパス100号館4階</td>';
contents += '	<td class="">〒359-1192 埼玉県所沢市三ケ島2-579-15<br />TEL. 04-2947-6705</td>';
contents += '  </tr>';
contents += '</table>';
contents += '<span class="caption">●早稲田大学までの交通詳細は「<a href="http://www.waseda.jp/jp/campus/index.html" target="_blank">早稲田大学へのアクセス</a>」をご覧下さい。</span>';
document.write(contents);
}
