//PopUP
	mpcontents01="Central Library<br /><img src='../img/visual/lib_chuo.jpg' width='190px' height='125px'>";
	mpcontents02="S.Takata Memorial Research Library<br /><img src='../img/visual/lib_takada.jpg' width='190px' height='125px'>";
	mpcontents03="Toyama Library<br /><img src='../img/visual/lib_toyama.jpg' width='190px' height='125px'>";
	mpcontents04="Science & Engineering Library<br /><img src='../img/visual/lib_riko.jpg' width='190px' height='125px'>";
	mpcontents05="Tokorozawa Library<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 = '';
contents += '<p>';
contents += '<table border="0" width="100%" class="access_tbl" style="">';
contents += '   <tr class="">';
contents += '    <td class="tbl_head" nowrap="nowrap">Library</td>';
contents += '    <td class="tbl_head">Location</td>';
contents += '    <td class="tbl_head">Address</td>';
contents += '  </tr>';
contents += '  ';
contents += '  <tr class="">';
contents += '    <td class="item_td"><h3><a href="javascript:selectchanged(point1);selectpopup(mpcontents01);">Central Library</a></h3></td>';
contents += '    <td class="">Building No.18, Center for Scholarly Information 2F Entrance, Waseda Campus</td>';
contents += '    <td class="">1-6-1 Nishiwaseda, Shinjuku-ku, Tokyo, 169-8050<br />TEL. 03-3203-5581</td>';
contents += '  </tr>';
contents += '<tr class="">';
contents += '    <td class="item_td"><h3><a href="javascript:selectchanged(point2);selectpopup(mpcontents02);">S.Takata Memorial Research Library</a></h3></td>';
contents += '    <td class="">Building No.2, 3F South Entrance, Waseda Campus</td>';
contents += '    <td class="">1-6-1 Nishiwaseda, Shinjuku-ku, Tokyo, 169-8050<br />TEL. 03-5286-1851</td>';
contents += '  </tr>';
contents += '<tr class="">';
contents += '    <td class="item_td"><h3><a href="javascript:selectchanged(point3);selectpopup(mpcontents03);">Toyama Library</a></h3></td>';
contents += '    <td class="">Building No.38, Toyama Campus </td>';
contents += '    <td class="">1-24-1 Toyama, Shinjuku-ku, Tokyo, 162-8644<br />TEL 03-5286-3528</td>';
contents += '  </tr>';
contents += '<tr class="">';
contents += '    <td class="item_td"><h3><a href="javascript:selectchanged(point4);selectpopup(mpcontents04);">Science&Engineering Library</a></h3></td>';
contents += '    <td class="">Building No.51, B1/B2 Nishiwaseda Campus</td>';
contents += '    <td class=""> 3-4-1 Okubo, Shinjuku-ku, Tokyo, 169-8555<br />TEL. 03-5286-3084</td>';
contents += '  </tr>';
contents += '<tr class="">';
contents += '    <td class="item_td"><h3><a href="javascript:selectchanged(point5);selectpopup(mpcontents05);">Tokorozawa Library</a></h3></td>';
contents += '    <td class="">Building No.100, 4F Tokorozawa Campus</td>';
contents += '    <td class="">2-579-15, Mikajima, Tokorozawa-shi, Saitama-ken, 359-1192<br />TEL. 04-2947-6705</td>';
contents += '  </tr>';
contents += '</table>';
contents += '<span class="caption">&raquo;<a href="http://www.waseda.jp/eng/campus/index.html" target="_blank">Access and Campus Map</a></span>';

document.write(contents);
}
