
function mapZoom(){

	map.setZoom(18);
	map.enableContinuousZoom();
	

}


function MarkerInfo(lat,lon,number,name,address,tel,access,desc,hospitalid,tinyaddress,url,aflink,kamoku) {
	this.point=new GLatLng(parseFloat(lat),parseFloat(lon));
	this.number=number;
	this.name=name;
	this.address=address;
	this.tel=tel;
	this.access=access;
	this.desc=desc;
	this.hospitalid=hospitalid;
	this.tinyaddress=tinyaddress;
	this.url=url;
	this.aflink=aflink;
	this.kamoku=kamoku;

}

MarkerInfo.prototype.getHtml=MarkerInfo_getHtml;

function MarkerInfo_getHtml(showDate,showTime,showLocation,showHeight,imageLoaded) {

var html;

	html='<div class="marker">';
	html+='<div class="fs14px"><a href="http://hospital.accessgate.jp/detail/' +this.hospitalid+'.html" target="_blank">';
	html+='<img src="http://hospital.accessgate.jp/image/maps/icon/' + this.number +'.gif" align="absmiddle" vspace="3" hspace="2" border="0">' + this.name + '</a></div>';
	html+='<div class="fs14px"><img src="http://hospital.accessgate.jp/image/icon/address.gif" align="absmiddle" vspace="3" hspace="2">' + this.address + '</div>';
	html+='<div class="fs14px"><img src="http://hospital.accessgate.jp/image/icon/tel.gif" align="absmiddle" vspace="3" hspace="2">' + this.tel + '</div>';
	
	if(this.url){
	
		if(this.aflink == 1){
			
			html+='<div><img src="http://hospital.accessgate.jp/image/icon/url.gif" align="absmiddle" vspace="3" hspace="2">';
			html+='<a href="http://hospital.accessgate.jp/link/?hid=' + this.hospitalid + '" target="_blank">' + this.url + '</a></div>';
			
		}else{
		
			html+='<div><img src="http://hospital.accessgate.jp/image/icon/url.gif" align="absmiddle" vspace="3" hspace="2"><a href="' + this.url + '" target="_blank">' + this.url + '</a></div>';
		
		}
	
	}
	
	if(this.access){
	
	html+='<div class="fs14px"><img src="http://hospital.accessgate.jp/image/icon/traffic.gif" align="absmiddle" vspace="3" hspace="2">' + this.access + '</div>';
	
	}
	
	html+='<div class="kamoku">' + this.desc + '</div>';
	html+='<div class="marker_url"><img src="http://hospital.accessgate.jp/image/tr_icon_or.gif" align="absmiddle" hspace="2"><a href="http://hospital.accessgate.jp/detail/'+this.hospitalid+'.html" target="_blank">'+this.name+'の詳細</a></div>';
	html+='<a onMouseDown="mapZoom()" class="link"><img src="http://hospital.accessgate.jp/image/menu_window/zoom2.gif" align="absmiddle" hspace="2" border="0" alt="ズーム・拡大"></a>';
	html+='<a onMouseDown="setck(\'' + this.hospitalid + '\',\'' + this.name + '\',\'' + this.tinyaddress + '\')" class="link">';
	html+='<img src="http://hospital.accessgate.jp/image/menu_window/add_mylist2.gif" vspace="3" hspace="3" alt="マイリストに追加"></a>';
	html+='</div>';

	return html;
}


function createMarker(markerInfo,showDate,showTime,showLocation,showHeight) {

	var icon = new GIcon(baseIcon);
	icon.image = "http://hospital.accessgate.jp/image/maps/icon/" + markerInfo.number + ".png";
	var marker=new GMarker(markerInfo.point,icon);

	GEvent.addListener(marker,'click',function() {
											   
			marker.openInfoWindowHtml(markerInfo.getHtml(showDate,showTime,showLocation,showHeight,false));
	});

	return marker;
}



function popupMarker(num) {
	//alert(num);
	GEvent.trigger(markers[num],'click');
}

function getBrowser() {
	var agent=navigator.userAgent;

	if (agent.indexOf('Safari')>=0) {
		return 'Safari';
	}
	else if (agent.indexOf('Opera')>=0) {
		return 'Opera';
	}
	else if (agent.indexOf('Gecko')>=0) {
		return 'Mozilla';
	}
	else if (agent.indexOf('MSIE')>=0) {
		return 'MSIE';
	}
	else {
		return 'other';
	}
}

function handleKeyEvents(e) {
	var browser=getBrowser();
	var keycode;
	var level;

	if (browser=='MSIE') {
		keycode=event.keyCode;
	}
	else {
		keycode=e.which;
	}

	switch (keycode) {
		case 27:
			map.closeInfoWindow();
			break;
		case 33:
			map.zoomIn();
			break;
		case 34:
			map.zoomOut();
			break;
		case 35:
			if (points.length>0) {
				map.panTo(points[points.length-1]);
			}
			break;
		case 36:
			if (points.length>0) {
				map.panTo(points[0]);
			}
			break;
		case 37:
			map.panDirection(1,0);
			break;
		case 38:
			map.panDirection(0,1);
			break;
		case 39:
			map.panDirection(-1,0);
			break;
		case 40:
			map.panDirection(0,-1);
			break;
		default:
			break;
	}
}

	function centercheck(){
		
		center = map.getCenter();
		var zoomleverl = map.getZoom();
		var bookurlhtml = '<a href="http://golf.accessgate.jp/freemap/?lat='+ center.y +'&long='+ center.x +'&z=' + zoomleverl + '">フリースクロールマップ検索に切替え</a>';
		
		document.getElementById("bookurl").innerHTML = bookurlhtml;
		
	}



