<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>酒店电子地图-<%=SiteName%></title>
<link href="../style/global.css" rel="stylesheet" type="text/css" />
<link href="style/newhotel.css" rel="stylesheet" type="text/css" />
<style type="text/css">
div,form,ul,ol,li,p,dd,dl,dt,img,span,input,select,textarea { margin:0; padding:0; word-break:break-all;}

.wrap{ width:960px; margin:0px auto;}
.wrap .left { width:220px; float:left; margin-right:6px;}
.wrap .left  h5 { width:208px; border:1px solid #ccc; text-align:left; padding-left:10px; background:url(images/bg4.gif) left -30px repeat-x; height:25px; line-height:25px; padding-top:2px; position:relative; color:#000; font-size:14px; margin:0px;}
.wrap .left .contentDiv { width:216px; border:1px solid #ccc; border-top:none; padding:2px 1px;}
.wrap .left .listBox { width:210px; height:500px; overflow-y:auto; padding:0 3px; cursor:pointer;}
.wrap .left .listBox .list { border-bottom:1px dashed #ccc; text-decoration:none;}
.wrap .left .listBox .textBox { width:147px; float:left; text-align:left;background:none;}
.wrap .left .listBox h6 { font-size:14px; padding:8px 0 0 0; color:#f00; margin:0px;}
.wrap .left .listBox h6 a:link{ color:#ff5500; font-size:14px; font-weight:bold; text-decoration:none;}
.wrap .left .listBox h6 a:hover{ color:#ff5500; font-size:14px; font-weight:bold; text-decoration:underline;}
.wrap .left .listBox h6 a:visited{ color:#ff5500; font-size:14px; font-weight:bold;}
.wrap .left .listBox .iconBox { width:38px; height:40px; float:left; text-align:left; padding-top:10px; padding-left:5px;background:none;}
.wrap .left .listBox .icon { width:25px; height:40px; background:url(images/pic6.gif) left -140px no-repeat; font-size:16px; font-weight:bold; color:#fff; font-family:Arial; text-align:center; padding-top:3px; letter-spacing:-1px;}
.wrap .left .listBox .end { border-bottom:none;}
.nlink { background-color:#ffffff;}
.nvisited { background-color:#f4f4f4;}
.nhover { background-color:#fff2eb; color:#535353;}
.nactive { background-color:#ffffff;}

.wrap .mapbox { width:958px; float:left; border:1px solid #ccc;}
.wrap .mapbox h2{ text-align:center; line-height:30px; font-size:14px; font-weight:bold; color:#09C;}
#mapDiv{ width:956px; height:530px; padding:1px; background-color:#fff;}

.windows { text-align:left; background:#fff; width:300px;}
.windows h2{ color:#F30; font-size:16px; font-weight:bold; margin:0px; padding:5px; line-height:26px;}
.windows h6 { font-size:14px; border-bottom:1px solid #ccc; padding:10px 0 2px 10px; position:relative;}
.windows h6 span { background:url(images/pic6.gif) -90px -95px no-repeat; padding:0 5px; position:absolute; right:0; top:10px;}
.windows h6 a { text-decoration:none; color:#f00;}
.windows dl { margin:0px; padding:0px; width:290px; padding:0px 5px; min-height:150px;}
.windows dt {margin:0px; padding:0px;  width:125px; float:right;}
.windows dd {margin:0px; padding:0px;  width:145px; float:left; line-height:18px;}
.windows p { padding-left:10px; clear:both;}
.windows p a { color:#f00; text-decoration:underline;}
.windows .l{float:left;}
.windows .r{float:right;}
.windows .bt{clear:both;}

/* 错误页 */
.errorBox .errorCurrent { text-align:left; background:none; padding-left:8px;}
.error { width:474px; margin:80px auto; border:1px solid #ffe2bd;}
.error .title { color:#ff5500; font-size:14px; font-weight:bold; background-color:#fffbf5; border-bottom:1px solid #ffe2bd; padding:13px 0 10px;}
.error .title .classspan { background:url(../img/pic6.gif) -40px -142px no-repeat; padding:4px 14px;}
.error p { text-align:left; padding:10px 0 10px 10px; line-height:14px;}
.error .link { padding:6px 0; background-color:#fffbf5; border-top:1px solid #ffe2bd; word-spacing:15px;}
.error .link a { color:#ff5500; text-decoration:underline;}
</style>
<script type="text/javascript" src="../js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="<%=Map_Api%>"></script>	
<script type="text/javascript" src="js/ffff.js"></script>
</head>

<body>
<!--#include file="templet/head.htm"-->
<div class="br"></div>
<div class="wrap">	
  <div class="mapbox">
  	<h2>旅游酒店电子地图</h2>
  	<div class="map" id="mapDiv"></div>		
  </div>
</div>
<div class="br"></div>
<div id="status"></div>
<script type="text/javascript">

function addMarkerOf(j,x,y,label,fsts){
	var myCompOverlay = new ffff(new BMap.Point(x,y), label,label,fsts);
		myCompOverlay.addEventListener("click", function(){
		 map.openInfoWindow(GetInfoWin(j),this._point);
		});
		
  map.addOverlay(myCompOverlay);
}

function GetInfoWin(id){
	
	$.get('/hotel/data_show.asp?id='+id, function(data) {
			var xml= data.documentElement;
			var ihtm = [];
			var hotel = xml?xml.getElementsByTagName("hotel"):[];
			if(hotel!=null){
				var hh=hotel[0];				
				ihtm.push('<div class="windows">');
				ihtm.push('<h2>'+hh.getAttribute("Title")+'</h2>');
				ihtm.push('<dl>');
				ihtm.push('<dt><img src="'+hh.getAttribute("Photo")+'" width="120" height="120" /></dt>');
				ihtm.push('<dd>均 价：'+hh.getAttribute("MinPrice")+'￥<br />');
				ihtm.push('电 话：'+hh.getAttribute("Tel")+'<br />');
				ihtm.push('地    址：'+hh.getAttribute("Address")+'<br />');				
				ihtm.push('</dl><p><a target="_blank" href="/hotel_show.asp?id='+id+'">详细信息</a> ');				
				ihtm.push('</p></div>');
				infow.setContent(ihtm.join(''));
			}
		});	 
	return infow;
}

function refreshMap() {
	///////////////
	map.clearOverlays();
	var get_url="/hotel/data_get.asp";	
	$.get(get_url, function(data) {
		var xml= data.documentElement;
		
		var hotel = xml?xml.getElementsByTagName("hotel"):[];		
		for (var i = 0; i < hotel.length; i++) {			
			addMarkerOf(hotel[i].getAttribute("id"),parseFloat(hotel[i].getAttribute("lng")),parseFloat(hotel[i].getAttribute("lat")),hotel[i].getAttribute("title"),hotel[i].getAttribute("stars"));			
		}		
	});
}  	

var map = new BMap.Map("mapDiv");
var infow=new BMap.InfoWindow('');  // 创建信息窗口对象
map.enableScrollWheelZoom();
map.addControl(new BMap.NavigationControl());   
map.addControl(new BMap.ScaleControl());   
map.addControl(new BMap.OverviewMapControl());  
map.enableScrollWheelZoom();
map.addEventListener("dragend",function(){
		refreshMap();
	});
//city center
var myGeo = new BMap.Geocoder();
	myGeo.getPoint("<%=CityName_Cn%>", function(point){
		if (point) {
			map.centerAndZoom(point,16);		
		}
	}, "全国");
</script>
<script type="text/javascript">
setTimeout(refreshMap,1000);
</script>
<!--#include file="templet/root.htm"-->
</body>
</html>
<%
set carr=nothing
call connclose()
%>