var mapType=1;
var baidMap;
var idsData;
var markers =[];
var bzMarkers =[];
var namekg = true;
var newdata;
var mapOptions;
var yanchiAl;
var baidubool = false;
var baiduJH = false;
var test = [];
var isExit = new Array();
var markerClusterer;//聚合对象
var mapSearch;
var isExitSearch = false;
function googleToBaidu(glng,glat){
	var x_pi = 3.14159265358979324 * 3000.0 / 180.0;
	//alert(x_pi);
	var x = glng, y = glat;
	var z =Math.sqrt(x * x + y * y) + 0.00002 *Math.sin(y * x_pi);
	var theta =Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
	var lng = z *  Math.cos(theta) + 0.0065;
	var lat = z *  Math.sin(theta) + 0.006;
	var myLatlng = new BMap.Point(lng,lat);
	return myLatlng;
}
function cutoverMap(){
	openMask();
//	var checkbox1 = document.getElementsByName("checkboxcarname");
//	if(checkbox1[0].checked){
//	checkbox1[0].checked = "";
//	}
//	var bzcheckbox = document.getElementsByName("bzcheckbox");
//	if(bzcheckbox[0].checked){
//	bzcheckbox[0].checked = "";
//	}
	$("#weizhi").html("");
	//alert(getUserStatus().lat+","+getUserStatus().lng+","+getUserStatus().zoom);
	var  myselect=document.getElementById("select");
	var index=myselect.selectedIndex ;
	mapType=myselect.options[index].value;

	memoryStatus(true);
	initTool();//切换地图时初始化工具
	if(isLargeData==true){
		idsData="thresholds";
	}
	//$("#map_canvas").empty();
//	alert(mapType);
	if(1==mapType){//百度
		if(gaoMap!=null)gaoMap.destroy();
		$("#thisAreaQuery").show();
		$("#historyAreaQuery").show();
		$("#eqname").show();
		$("#markerNamePermissionsPanelBtn").show();
		$("#mapsearch").show();
		$("#mapsearch_input").hide();
		$("#gd_mapsearch").hide();
		markers.length=0;
		bzMarkers.length=0;
		baiduMap(idsData,false);
		showMarkerBaidu(markerObject.markerJson);
		addMenu();
		shieldFence();
		closeMask();
	}else if(3==mapType){//高德
		//console.info(mapType);
		$("#gd_mapsearch").show();
		$("#fencePermissionsPanelBtn").hide();
		$("#mapsearch").hide();
		$("#mapsearch_input").hide();
		$("#thisAreaQuery").hide();
		$("#historyAreaQuery").hide();
		$("#eqname").show();
		loadGaodeMapJs();//加载高德地图js
		setTimeout('loadGaoDe()',2000);
		return;
	}else if(4==mapType){
		setTimeout('loadXyMap()',2000);
		return;
	}else{//谷歌
		$("#eqname").hide();
		$("#markerNamePermissionsPanelBtn").hide();
		$("#mapsearch").hide();
//		console.info("---------------"+(typeof(google)=="undefined"));
		if(typeof(google)=="undefined"){
			loadGoogleMapJs();
			setTimeout('loadGoogle()',10000);
		}else{
			loadGoogle();
			closeMask();
		}
		/*vehicles.length=0;
		googleMap();
		//点击地图时关闭已经打开的弹出框
		mapclickEvent();
		//添加标注菜单
		addMarkerMenu();
		//添加所有标注  
		addAllMarker();
		electronicFence.tree.init();
		openFence();*/
		return;
	}
	initMarkerisShow();
	//if(namekg == false){
	//namekg = true;
	//}
	if(findbsCookie("isShowCarName")==true){
		$("#isShowCarName").attr("checked",true);
		if(baidMap.getZoom()>12){
			namekg = true;
			showCarName();
		}
	}
	ExliveMap.setMap(mapType);//设置地图类型
	SheFang.show();//显示所有设防设备设防区域
}

var oldPolygon = new BMap.Polygon();
function addMarkerBaidu(pStart,pEnd){
	oldPolygon.setPath([googleToBaidu(pStart.lng(),pStart.lat()),googleToBaidu(pEnd.lng(),pStart.lat()), googleToBaidu(pEnd.lng(),pEnd.lat()),googleToBaidu(pStart.lng(),pEnd.lat())]);
	oldPolygon.setStrokeColor("blue");
	oldPolygon.setFillColor("blue");
	oldPolygon.setStrokeWeight(2);
	oldPolygon.setStrokeOpacity(0.5);
	baidMap.addOverlay(oldPolygon);
}

function updateMarkerBaidu(id,pStart,pEnd){

	for(i=0;i<bzMarkers.length;i++){
		if(bzMarkers[i].id==id){

			bzMarkers[i].polygon.setPath([googleToBaidu(pStart.lng,pStart.lat),googleToBaidu(pEnd.lng,pStart.lat),googleToBaidu(pEnd.lng,pEnd.lat),googleToBaidu(pStart.lng,pEnd.lat)]);

			break;
		}
	}
}
function updateBzMarkers(markersJson){
	for(var i=0;i<bzMarkers.length;i++){
		if(bzMarkers[i].id==markersJson.data[0].id){
			var blat;
			var blng;
			blat=markersJson.data[0].lat2;
			blng=markersJson.data[0].lng2;
			var img =markersJson.data[0].icon.replace('"',"")
			img =img.replace('"',"")
			var myIcon = new BMap.Icon(img, new BMap.Size(35,35));
			var html="<div style='font-weight:normal;'><b>名称：</b>"+markersJson.data[0].title+"</br>"
			+"<b>描述：</b>"+markersJson.data[0].text+"</br>"
			+"<b>经度：</b>"+blat+"</br>"
			+"<b>纬度：</b>"+blng+"</br>";
			var htm="<a href='javascript:openUpdateMarkerWin("+markersJson.data[0].id+");'><font color='#0000FF'>修改</font> | </a><a href='javascript:deleteMarker("+markersJson.data[0].id+");'><font color='#0000FF'>删除</font></a> </div>";
			if(markersJson.data[0].competence==1){
				html=html+htm;
			}else{
				html=html+"</div>";
			}
			bzMarkers[i].marker.setIcon(myIcon);
			bzMarkers[i].label.setContent(markersJson.data[0].title);
			bzMarkers[i].infowindow.setContent(html);
			//var pStart = new BMap.Point(markersJson.data[0].userMarkerArea.leftLon,markersJson.data[0].userMarkerArea.leftLat);
			//var pEnd = new BMap.Point(markersJson.data[0].userMarkerArea.rightLon,markersJson.data[0].userMarkerArea.rightLat);
			//bzMarkers[i].polygon.setPath([new BMap.Point(pStart.lng,pStart.lat),new BMap.Point(pEnd.lng,pStart.lat), new BMap.Point(pEnd.lng,pEnd.lat),new BMap.Point(pStart.lng,pEnd.lat)]);
			break;
		}
	}
}
function delMarkerBaidu(id){
	for(i=0;i<bzMarkers.length;i++){
		if(bzMarkers[i].id==id){
			baidMap.removeOverlay(bzMarkers[i].label);
			baidMap.removeOverlay(bzMarkers[i].marker);
			baidMap.removeOverlay(bzMarkers[i].infowindow);
			baidMap.removeOverlay(bzMarkers[i].polygon);
			bzMarkers.remove(i);
			break;
		}
	}
	for(var i=0;i<markerObject.markerJson.data.length;i++){
		if(id==markerObject.markerJson.data[i].id){
			markerObject.markerJson.data.remove(i);
			break;
		}
	}
	markerObject.markerJson.totalcount = markerObject.markerJson.data.length;
}
function openMarkerBaidu(id){
	for(i=0;i<bzMarkers.length;i++){
		if(bzMarkers[i].id==id){
			bzMarkers[i].marker.openInfoWindow(bzMarkers[i].infowindow);
			baidMap.centerAndZoom(bzMarkers[i].latlng, 15);
			break;
		}
	}
}
function updateMarkerIsShow(id,isShow,isAll){
	if(isAll){
		for(i=0;i<bzMarkers.length;i++){
			bzMarkers[i].isShow = isShow;
		}
	}else{
		for(i=0;i<bzMarkers.length;i++){
			if(bzMarkers[i].id==id){
				bzMarkers[i].isShow = isShow;
				break;
			}
		}
	}
}
function showMarkersBaidu(id,bool){
	var bzcheckbox = document.getElementsByName("bzcheckbox");
	if(bool){
		for(i=0;i<bzMarkers.length;i++){
			baidMap.addOverlay(bzMarkers[i].marker);
			baidMap.addOverlay(bzMarkers[i].polygon);
			if(bzcheckbox[0].checked){
				baidMap.addOverlay(bzMarkers[i].label);
			}
		}
	}else{
		for(i=0;i<bzMarkers.length;i++){
			if(bzMarkers[i].id==id){

				//	alert(bzMarkers[i].marker.getPosition().lng+","+bzMarkers[i].marker.getPosition().lat);
				//	bzMarkers[i].marker.setPosition(new BMap.Point("116.404", "39.915"))
				baidMap.addOverlay(bzMarkers[i].marker);
				//bzMarkers[i].marker.setZIndex(10000000);
				baidMap.addOverlay(bzMarkers[i].polygon);
				if(bzcheckbox[0].checked){
					baidMap.addOverlay(bzMarkers[i].label);
				}
			}
		}
	}

}
function hideMarkersBaidu(id,bool){
	if(bool){
		for(i=0;i<bzMarkers.length;i++){
			baidMap.removeOverlay(bzMarkers[i].marker);
			baidMap.removeOverlay(bzMarkers[i].polygon);
			baidMap.removeOverlay(bzMarkers[i].label); 
		}
	}else{
		for(i=0;i<bzMarkers.length;i++){
			if(bzMarkers[i].id==id){
				baidMap.removeOverlay(bzMarkers[i].marker);
				baidMap.removeOverlay(bzMarkers[i].polygon);
				baidMap.removeOverlay(bzMarkers[i].label); 
			}
		}
	}
}
function showMarkerBaidu(markersJson){
	//alert(markersJson);
	if(markersJson == ""){
		return;
	}
	for(var i=0;i<markersJson.data.length;i++){
		(function(x){
			//alert(markersJson.data[i].icon);
			var myLatlng = googleToBaidu(markersJson.data[i].lat2,markersJson.data[i].lng2);
			var img =markersJson.data[i].icon.replace('"',"")
			img =img.replace('"',"")
			//img =markersJson.data[i].icon.replace('"',"")
			//alert(img);
			var myIcon_ = new BMap.Icon(img, new BMap.Size(35,35));

			//var myIcon_ = new BMap.Icon(markersJson.data[i].icon.substring(1,markersJson.data[i].icon.length-1), new BMap.Size(35,35));
			var marker = new BMap.Marker(
					myLatlng
			);  // 创建标注

			marker.setIcon(myIcon_);
			//marker.setIcon(myIcon)
			//baidMap.addOverlay(marker);
			var opts = {
					position : myLatlng,    // 指定文本标注所在的地理位置
					offset   : new BMap.Size(15, -10)    //设置文本偏移量
			}
			var label = new BMap.Label(markersJson.data[i].title, opts);  // 创建文本标注对象
			label.setStyle({
				color : "#000000",
				backgroundColor : "#f5fcb8",
				borderColor : "#000000",
				fontSize : "12px",
				height : "16px",
				lineHeight : "16px",
				fontWeight:"bold",
				fontFamily:""
			});
			//baidMap.addOverlay(label); 
			//创建信息窗口
			var html="<div style='font-weight:normal;'><b>名称：</b>"+markersJson.data[i].title+"</br>"
			+"<b>描述：</b>"+markersJson.data[i].text+"</br>"
			+"<b>经度：</b>"+markersJson.data[i].lat2+"</br>"
			+"<b>纬度：</b>"+markersJson.data[i].lng2+"</br>";

			var htm="<a href='javascript:openUpdateMarkerWin("+markersJson.data[i].id+");'><font color='#0000FF'>修改</font> | </a><a href='javascript:deleteMarker("+markersJson.data[i].id+");' ><font color='#0000FF'>删除</font></a> </div>";
			if(markersJson.data[i].competence==1){
				html=html+htm;
			}else{
				html=html+"</div>";
			}
			var infoWindow = new BMap.InfoWindow(html);
			marker.addEventListener("click", function(){this.openInfoWindow(infoWindow);});
			var pStart;
			var pEnd;
			if(markersJson.data[i].userMarkerArea == null || markersJson.data[i].userMarkerArea ==""){
				var pStart = new BMap.Point(0,0);
				var pEnd = new BMap.Point(0,0);
			}else{

				var pStart = new BMap.Point(markersJson.data[i].userMarkerArea.leftLon,markersJson.data[i].userMarkerArea.leftLat);
				var pEnd = new BMap.Point(markersJson.data[i].userMarkerArea.rightLon,markersJson.data[i].userMarkerArea.rightLat);



			}
			var polygon = new BMap.Polygon([
			                                googleToBaidu(pStart.lng,pStart.lat),
			                                googleToBaidu(pEnd.lng,pStart.lat),
			                                googleToBaidu(pEnd.lng,pEnd.lat),
			                                googleToBaidu(pStart.lng,pEnd.lat)
			                                ], {strokeColor:"blue",fillColor:"blue", strokeWeight:2, strokeOpacity:0.5});
			//baidMap.addOverlay(polygon);

			markerManage = new Object();
			markerManage.id = markersJson.data[i].id;
			markerManage.title = markersJson.data[i].title;
			markerManage.label = label;
			markerManage.marker = marker;
			markerManage.polygon = polygon;
			markerManage.icon = markersJson.data[i].icon;
			markerManage.infowindow = infoWindow;
			markerManage.latlng = myLatlng;
			markerManage.isShow = false;
			bzMarkers.push(markerManage);

		})(i);
	}	
}
var strNum =0;
function addMarkers(iNum,j){
	for(var i=iNum;i<j;i++){
		(function(tx){
			if(carList.data[tx] != "" && carList.data[tx] !=null){
				//var myLatlng = new BMap.Point(carList.data[tx].positionLast.blng,carList.data[tx].positionLast.blat);

				var x_pi = 3.14159265358979324 * 3000.0 / 180.0;
				//alert(x_pi);

				var x = carList.data[tx].positionLast.lng, y = carList.data[tx].positionLast.lat;
				var z =Math.sqrt(x * x + y * y) + 0.00002 *Math.sin(y * x_pi);
				var theta =Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
				var lng = z *  Math.cos(theta) + 0.0065;
				var lat = z *  Math.sin(theta) + 0.006;
				var myLatlng = new BMap.Point(lng,lat);
				var s=10;
				var condition=carList.data[tx].positionLast.state2;
				var sp = parseInt(carList.data[tx].positionLast.speed);
				if (condition != null){
					if (condition.indexOf("不在线")>=0 || condition.indexOf("掉线")>=0)
						s = 2;
					else {
						if (condition.indexOf("速报警")>=0)
							s = 4;
						else if (condition.indexOf("报警")>=0)
							s = 3;
						else if (sp > 0.5)
							s = 0;
						else
							s = 1;
					}
					if (s != 4 && s != 3 && condition.indexOf("停车")>=0
							&& !condition.indexOf("不在线")>= 0)
					{
						if(condition.indexOf("停车超时")>=0){
							s = 5;	
						}else{
							s = 6;
						}
					}
				}else{
					if (sp > 0.5)
						s = 0;
					else
						s = 1;
				}
				if( carList.data[tx].positionLast.av == 0 ){
					s=7;
				}
				var newtime = new Date().getTime();
				var ttime = carList.data[tx].positionLast.recvtime.replace("-","/");
				ttime = ttime.replace("-","/");
				ttime = ttime.replace("T"," ");
				var oldtime = new Date(ttime).getTime();
				if(newtime-oldtime > 600000){
					s=2;
				}

				var state =s;
				var pngicon = "gpsonline/image/pic/"+carList.data[tx].icon+"/red_0.gif";
				if(state == 0) pngicon = "gpsonline/image/pic/"+carList.data[tx].icon+"/green_";
				else if(state == 1) pngicon = "gpsonline/image/pic/"+carList.data[tx].icon+"/red_";
				else if(state == 2) pngicon = "gpsonline/image/pic/"+carList.data[tx].icon+"/gray_";
				else if(state == 3) pngicon = "gpsonline/image/pic/"+carList.data[tx].icon+"/yellow_";
				else if(state == 4) pngicon = "gpsonline/image/pic/"+carList.data[tx].icon+"/pink_";
				else if(state == 5) pngicon = "gpsonline/image/pic/"+carList.data[tx].icon+"/stopalarm";
				else if(state == 7) pngicon = "gpsonline/image/pic/"+carList.data[tx].icon+"/blue_";
				else pngicon = "gpsonline/image/pic/"+carList.data[tx].icon+"/red_";
				var direction="";
				var t = parseInt(carList.data[tx].positionLast.direct);
				if(t>27 && t<=72){
					if(state == 5){
						var image=".gif";
					}else{
						var image="45.gif";
					}
					direction="东北";
				}else if(t>72 && t<=117){
					if(state == 5){
						var image=".gif";
					}else{
						var image="90.gif";
					}

					direction="东";
				}
				else if(t>117 && t<=162){
					if(state == 5){
						var image=".gif";
					}else{
						var image="135.gif";
					}
					direction="东南";
				}
				else if(t>162 && t<=207){
					if(state == 5){
						var image=".gif";
					}else{
						var image="180.gif";
					}
					direction="南";
				}
				else if(t>207 && t<=252){
					if(state == 5){
						var image=".gif";
					}else{
						var image="225.gif";
					}
					direction="西南";
				}
				else if(t>252 && t<=297){
					if(state == 5){
						var image=".gif";
					}else{
						var image="270.gif";
					}
					direction="西";
				}
				else if(t>297 && t<=342){
					if(state == 5){
						var image=".gif";
					}else{
						var image="315.gif";
					}
					direction="西北";
				}
				else {
					if(state == 5){
						var image=".gif";
					}else{
						var image="0.gif";
					}
					direction="北";
				}

				var carname = encodeURI(encodeURI(carList.data[tx].vhcCode)); 

				var temp,temp1,temp2,temp3,temp4;
				if(carList.data[tx].positionLast.temperature != null && carList.data[tx].positionLast.temperature <=127){
					temp=carList.data[tx].positionLast.temperature +" ℃";
				}else{
					temp="无效";
				}
				if(carList.data[tx].positionLast.temp1 != null && carList.data[tx].positionLast.temp1 <=127){
					temp1=carList.data[tx].positionLast.temp1 +" ℃";
				}else{
					temp1="无效";
				}
				if(carList.data[tx].positionLast.temp2 != null && carList.data[tx].positionLast.temp2 <=127){
					temp2=carList.data[tx].positionLast.temp2 +" ℃";
				}else{
					temp2="无效";
				}
				if(carList.data[tx].positionLast.temp3 != null && carList.data[tx].positionLast.temp3 <=127){
					temp3=carList.data[tx].positionLast.temp3 +" ℃";
				}else{
					temp3="无效";
				}
				if(carList.data[tx].positionLast.temp4 != null && carList.data[tx].positionLast.temp4 <=127){
					temp4=carList.data[tx].positionLast.temp4 +" ℃";
				}else{
					temp4="无效";
				}
				var html =	"";
				if(isHasPBackAut()){
					html =	"<div id='app_"+carList.data[tx].id+"' style='font-weight:normal;'>"
					+"<div id='app1_"+carList.data[tx].id+"'><b>设备名称：</b>"+carList.data[tx].vhcCode+"</br></div>"
					+"<div id='app18_"+carList.data[tx].id+"'><b>设备ID：</b>"+carList.data[tx].gprsCode+"</br></div>"
					+"<div id='app16_"+carList.data[tx].id+"'><b>到期时间：</b>"+(carList.data[tx].overduetime != null && carList.data[tx].overduetime.indexOf("19") != 0 ? carList.data[tx].overduetime:"")+"</br></div>"
					+"<div id='app17_"+carList.data[tx].id+"'><b>启用时间：</b>"+(carList.data[tx].posavtime != null && carList.data[tx].posavtime.indexOf("19") != 0 ? carList.data[tx].posavtime :"")+"</br></div>";
					if(isShowInstill){
						html +="<div><b>安装时间：</b>"+(carList.data[tx].installtime != null && carList.data[tx].installtime.indexOf("19") != 0 ? carList.data[tx].installtime :"")+"</br></div>";
					}
					html+="<div id='app14_"+carList.data[tx].id+"'><b>备注：</b>"+carList.data[tx].remark+"</br></div>"
					+"<div id='app19_"+carList.data[tx].id+"'><b>备注2：</b>"+carList.data[tx].remark2+"</br></div>"
					+"<div id='app15_"+carList.data[tx].id+"'><b>经纬度：</b>"+carList.data[tx].positionLast.lng+","+carList.data[tx].positionLast.lat+"</br></div>"
					+"<div id='app11_"+carList.data[tx].id+"'><b>SIM卡号：</b>"+carList.data[tx].simCode+"</br></div>"
					+"<div id='app2_"+carList.data[tx].id+"'><b>服务器时间：</b>"+carList.data[tx].positionLast.recvtime+"</br></div>"
					+"<div id='app12_"+carList.data[tx].id+"'><b>GPS时间：</b>"+carList.data[tx].positionLast.gpstime+"</br></div>"
					+"<div id='app3_"+carList.data[tx].id+"'><b>速度：</b>"+carList.data[tx].positionLast.speed.toFixed(1)+"km/h </br></div>"
					+"<div id='app4_"+carList.data[tx].id+"'><b>方向：</b>"+direction+"</br></div>"
					+"<div><b>海拔：</b>"+carList.data[tx].positionLast.height.toFixed(1)+"m </br></div>"
					+"<div id='app5_"+carList.data[tx].id+"'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+"</br></div>"
					+"<div id='app6_"+carList.data[tx].id+"'><b>油量：</b>"+carList.data[tx].positionLast.oilMN1+" L</br></div>"
					+"<div id='app7_"+carList.data[tx].id+"'><b>当日里程：</b>"+carList.data[tx].positionLast.distance+" km</br></div>"
					+"<div id='app8_"+carList.data[tx].id+"'><b>总里程：</b>"+carList.data[tx].positionLast.totalDistance+" km</br></div>"
					+"<div id='app9_"+carList.data[tx].id+"'><b>状态：</b>"+carList.data[tx].positionLast.state2+"</br></div>"
					+"<div id='app10_"+carList.data[tx].id+"'><b>位置：</b>"+carList.data[tx].positionLast.memo+"</br></div>"
					+"<div id='app13_"+carList.data[tx].id+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+carList.data[tx].id+");'><font color='#0000FF'>详细</font></a></br></div>"
					+"<a href='javascript:streeViewObject.open("+carList.data[tx].id+","+carList.data[tx].positionLast.blat+","+carList.data[tx].positionLast.blng+","+t+","+3+");'><font color='#0000FF'>街景</font> | </a><a href='gpsonline/jsp/TrackMap.jsp?carid="+carList.data[tx].id+"&mapType=1' target='_blank'><font color='#0000FF'>跟踪</font> | </a><a id='play_"+carList.data[tx].id+" href='gpsonline/jsp/monitor/playBack.jsp?carid="+carList.data[tx].id+"&carname="+carname+"&icon="+carList.data[tx].icon+"&mapType=1' target='_blank'><font color='#0000FF'>回放</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+carList.data[tx].id+");\" >驾驶员</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+carList.data[tx].id+");\" >刷新位置</font> | </a><a id='sim_"+carList.data[tx].id+"' href='javascript:;' ><font color='#0000FF' onclick=\"openSim("+carList.data[tx].simCode+");\">SIM </font> |</a>";
					if(isShowTTs){
						html += "<a href='javascript:void(0);' onclick='ttsCmd("+carList.data[tx].gprsCode+");'><font color='#0000FF'>TTS</font> |</a>" ;
					}
					if(isShowVideo){
						html += "<a href='javascript:void(0);' onclick='videoShow("+carList.data[tx].gprsCode+");'><font color='#0000FF'>视频</font> |</a>" ;
					}
					html += "<a id='more_"+carList.data[tx].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼</font></a></div>";

				}else{
					html =	"<div id='app_"+carList.data[tx].id+"' style='font-weight:normal;'>"
					+"<div id='app1_"+carList.data[tx].id+"'><b>设备名称：</b>"+carList.data[tx].vhcCode+"</br></div>"
					+"<div id='app18_"+carList.data[tx].id+"'><b>设备ID：</b>"+carList.data[tx].gprsCode+"</br></div>"
					+"<div id='app16_"+carList.data[tx].id+"'><b>到期时间：</b>"+(carList.data[tx].overduetime != null && carList.data[tx].overduetime.indexOf("19") != 0 ? carList.data[tx].overduetime:"")+"</br></div>"
					+"<div id='app17_"+carList.data[tx].id+"'><b>启用时间：</b>"+(carList.data[tx].posavtime != null && carList.data[tx].posavtime.indexOf("19") != 0 ? carList.data[tx].posavtime :"")+"</br></div>";
					if(isShowInstill){
						html +="<div><b>安装时间：</b>"+(carList.data[tx].installtime != null && carList.data[tx].installtime.indexOf("19") != 0 ? carList.data[tx].installtime :"")+"</br></div>";
					}
					html+="<div id='app14_"+carList.data[tx].id+"'><b>备注：</b>"+carList.data[tx].remark+"</br></div>"
					+"<div id='app19_"+carList.data[tx].id+"'><b>备注2：</b>"+carList.data[tx].remark2+"</br></div>"
					+"<div id='app15_"+carList.data[tx].id+"'><b>经纬度：</b>"+carList.data[tx].positionLast.lng+","+carList.data[tx].positionLast.lat+"</br></div>"
					+"<div id='app11_"+carList.data[tx].id+"'><b>SIM卡号：</b>"+carList.data[tx].simCode+"</br></div>"
					+"<div id='app2_"+carList.data[tx].id+"'><b>服务器时间：</b>"+carList.data[tx].positionLast.recvtime+"</br></div>"
					+"<div id='app12_"+carList.data[tx].id+"'><b>GPS时间：</b>"+carList.data[tx].positionLast.gpstime+"</br></div>"
					+"<div id='app3_"+carList.data[tx].id+"'><b>速度：</b>"+carList.data[tx].positionLast.speed.toFixed(1)+"km/h </br></div>"
					+"<div id='app4_"+carList.data[tx].id+"'><b>方向：</b>"+direction+"</br></div>"
					+"<div><b>海拔：</b>"+carList.data[tx].positionLast.height.toFixed(1)+"m </br></div>"
					+"<div id='app5_"+carList.data[tx].id+"'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+"</br></div>"
					+"<div id='app6_"+carList.data[tx].id+"'><b>油量：</b>"+carList.data[tx].positionLast.oilMN1+" L</br></div>"
					+"<div id='app7_"+carList.data[tx].id+"'><b>当日里程：</b>"+carList.data[tx].positionLast.distance+" km</br></div>"
					+"<div id='app8_"+carList.data[tx].id+"'><b>总里程：</b>"+carList.data[tx].positionLast.totalDistance+" km</br></div>"
					+"<div id='app9_"+carList.data[tx].id+"'><b>状态：</b>"+carList.data[tx].positionLast.state2+"</br></div>"
					+"<div id='app10_"+carList.data[tx].id+"'><b>位置：</b>"+carList.data[tx].positionLast.memo+"</br></div>"
					+"<div id='app13_"+carList.data[tx].id+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+carList.data[tx].id+");'><font color='#0000FF'>详细</font></a></br></div>"
					+"<a href='javascript:streeViewObject.open("+carList.data[tx].id+","+carList.data[tx].positionLast.blat+","+carList.data[tx].positionLast.blng+","+t+","+3+");'><font color='#0000FF'>街景</font> | </a><a href='gpsonline/jsp/TrackMap.jsp?carid="+carList.data[tx].id+"&mapType=1' target='_blank'><font color='#0000FF'>跟踪</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+carList.data[tx].id+");\" >驾驶员</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+carList.data[tx].id+");\" >刷新位置</font> | </a><a id='sim_"+carList.data[tx].id+"' href='javascript:;' ><font color='#0000FF' onclick=\"openSim("+carList.data[tx].simCode+");\">SIM </font> | </a> ";
					if(isShowTTs){
						html += "<a href='javascript:void(0);' onclick='ttsCmd("+carList.data[tx].gprsCode+");'><font color='#0000FF'>TTS</font> |</a>" ;
					}
					if(isShowVideo){
						html += "<a href='javascript:void(0);' onclick='videoShow("+carList.data[tx].gprsCode+");'><font color='#0000FF'>视频</font> |</a>" ;
					}
					html += "<a id='more_"+carList.data[tx].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼</font></a></div>";
				}
				var icon_size=real(carList.data[tx].icon);
				var myIcon = new BMap.Icon(pngicon+image, new BMap.Size(icon_size,icon_size));
				var marker = new BMap.Marker(
						myLatlng,{icon:myIcon}
				);// 创建标注
				if(typeof(isExit[carList.data[tx].id])=='undefined'){
					isExit[carList.data[tx].id] = marker;
					test.push(marker);
				}
				baidMap.addOverlay(marker);
				var opts = {
						position : myLatlng,    // 指定文本标注所在的地理位置
						offset   : new BMap.Size(10, -10)    //设置文本偏移量
				}
				var label = new BMap.Label(carList.data[tx].vhcCode+"("+carList.data[tx].positionLast.speed.toFixed(1)+"km/h"+")",opts);  // 创建文本标注对象
				label.setStyle({
					color : "#000000",
					backgroundColor:"#f5fcb8",
					borderColor : "#000000",
					fontSize : "12px",
					height : "16px",
					lineHeight : "16px",
					fontWeight:"bold",
					fontFamily:""
				});
				if($('#isShowCarName').is(':checked')){
					baidMap.addOverlay(label);
				}
//				if( namekg == false && baidMap.getZoom()>12){
//				}
				//创建信息窗口
				var infoWindow = new BMap.InfoWindow(html);
				marker.addEventListener("click", function(){
					this.openInfoWindow(infoWindow);
//					msgid= carList.data[tx].id;
//					fristId = carList.data[tx].id;
//					msgname= carList.data[tx].vhcCode;

					var WinShowParms = getCurUserWinShowParms();
					if(WinShowParms!=null){
						var ss = carList.data[tx].icon;
						if(ss==3 || ss==5 || ss==6){
							so = false;
						}else{
							so = true;
						}
						var app1_ = document.getElementById("app1_"+carList.data[tx].id);
						var app18html="<b>设备ID：</b>"+carList.data[tx].gprsCode+"<br/>";
						document.getElementById("app18_"+carList.data[tx].id).innerHTML = app18html;

						if(app1_ != null){
							app1_.style.display ="none";
							var app2_ = document.getElementById("app2_"+carList.data[tx].id);
							app2_.style.display ="none";
							var app3_ = document.getElementById("app3_"+carList.data[tx].id);
							app3_.style.display ="none";
							var app4_ = document.getElementById("app4_"+carList.data[tx].id);
							app4_.style.display ="none";
							var app5_ = document.getElementById("app5_"+carList.data[tx].id);
							app5_.style.display ="none";
							var app6_ = document.getElementById("app6_"+carList.data[tx].id);
							app6_.style.display ="none";
							var app7_ = document.getElementById("app7_"+carList.data[tx].id);
							app7_.style.display ="none";
							var app8_ = document.getElementById("app8_"+carList.data[tx].id);
							app8_.style.display ="none";
							var app9_ = document.getElementById("app9_"+carList.data[tx].id);
							app9_.style.display ="none";
							var app10_ = document.getElementById("app10_"+carList.data[tx].id);
							app10_.style.display ="none";
							var app11_ = document.getElementById("app11_"+carList.data[tx].id);
							app11_.style.display ="none";
							var app12_ = document.getElementById("app12_"+carList.data[tx].id);
							app12_.style.display ="none";
							var app13_ = document.getElementById("app13_"+carList.data[tx].id);
							app13_.style.display ="none";
							var app14_ = document.getElementById("app14_"+carList.data[tx].id);
							app14_.style.display ="none";
							var app15_ = document.getElementById("app15_"+carList.data[tx].id);
							app15_.style.display ="none";

							var app16_ = document.getElementById("app16_"+carList.data[tx].id);
							app16_.style.display ="none";
							var app17_ = document.getElementById("app17_"+carList.data[tx].id);
							app17_.style.display ="none";

							var app18_ = document.getElementById("app18_"+carList.data[tx].id);
							app18_.style.display ="none";
							var app19_ = document.getElementById("app19_"+carList.data[tx].id);
							app19_.style.display ="none";
							for(var ws=0;ws<WinShowParms.length;ws++){
								if(WinShowParms[ws]==1){
									app1_.style.display ="block";
								}
								if(WinShowParms[ws]==2){
									app2_.style.display ="block";
								}
								if(WinShowParms[ws]==3){
									app3_.style.display ="block";
								}
								if(WinShowParms[ws]==4){
									app4_.style.display ="block";
								}
								if(WinShowParms[ws]==5){
									app5_.style.display ="block";
								}
								if(WinShowParms[ws]==6){
									app6_.style.display ="block";
								}
								if(WinShowParms[ws]==7){
									app7_.style.display ="block";
								}
								if(WinShowParms[ws]==8){
									app8_.style.display ="block";
								}
								if(WinShowParms[ws]==9 && eqVisualPower.state){
									app9_.style.display ="block";
								}
								if(WinShowParms[ws]==10){
									app10_.style.display ="block";
								}
								if(WinShowParms[ws]==11 && eqVisualPower.sim){
									app11_.style.display ="block";
								}
								if(WinShowParms[ws]==12){
									app12_.style.display ="block";
								}
								if(WinShowParms[ws]==13){
									app13_.style.display ="block";
								}
								if(WinShowParms[ws]==14 && eqVisualPower.remark){
									app14_.style.display ="block";
								}
								if(WinShowParms[ws]==15){
									app15_.style.display ="block";
								}
								if(WinShowParms[ws]==16){
									app16_.style.display ="block";
								}
								if(WinShowParms[ws]==17){
									app17_.style.display ="block";
								}
								if(WinShowParms[ws]==18 && eqVisualPower.gprs){
									app18_.style.display ="block";
								}
								if(WinShowParms[ws]==19){
									app19_.style.display ="block";
								}
							}
							if(!eqVisualPower.sim)$("#sim_"+carList.data[tx].id).hide();
							if(!eqVisualPower.play)$("#play_"+carList.data[tx].id).hide();
							var app_ = document.getElementById("app_"+carList.data[tx].id).innerHTML;
							app_="<div id='app_"+carList.data[tx].id+"' style='font-weight:normal;'>"+app_+"</div>"
							infoWindow.setContent(app_);
							$(".BMap_top").append("<a href='javascript:void(0);' class='map_setting_ico' onclick='setSystemObject.openWin(1);'><span></span></a>");
						}
					}
				});
				var markerManage = new Object();
				markerManage.id = carList.data[tx].id;
				markerManage.remark= carList.data[tx].remark;
				markerManage.remark2= carList.data[tx].remark2;
				markerManage.vhcCode = carList.data[tx].vhcCode;
				markerManage.gprsCode = carList.data[tx].gprsCode;
				markerManage.label = label;
				markerManage.marker = marker;
				markerManage.icon = carList.data[tx].icon;
				markerManage.infowindow = infoWindow;
				markerManage.latlng = myLatlng;
				markerManage.simCode=carList.data[tx].simCode;
				markerManage.overduetime = carList.data[tx].overduetime;
				markerManage.installtime = carList.data[tx].installtime;
				markerManage.posavtime = carList.data[tx].posavtime;
				markers.push(markerManage);
				//}
			}
		})(i);
	}
	if(strNum+10<=carList.data.length){

		strNum = j+10;
		setTimeout("addMarkers("+(strNum-10)+","+strNum+")",100);

	}else{
		strNum=j;
		if(strNum<carList.data.length){
			var tNum = strNum;
			strNum=carList.data.length;
			setTimeout("addMarkers("+tNum+","+(carList.data.length)+")",100);

		}else{
			if(alSwitch == false){
				//准备倒计时  刷新在线数
				//countDown();    //每隔15秒执行函数al
				//alSwitch = true;
				strNum=0;
			}
//			markerClusterer = new BMapLib.MarkerClusterer(baidMap,{markers:test});
//			markerClusterer.setMaxZoom(12);
		}
	}
}
function baiduMap(ids,bool){
	//setT=setTimeout("MapData()",100);
	//给地图打点前 就开始倒计时 准备刷新在线数  
	if(ids == ""){
		setTimeout("baiduMap(ids)",5000);
	}else if(ids == "-1"){
		baidMap = new BMap.Map("map_canvas");// 创建地图实例    
		var point = new BMap.Point(116.404, 39.915);  // 创建点坐标
		baidMap.centerAndZoom(point, 15);
	}else if(ids == "thresholds"){
		baidMap = new BMap.Map("map_canvas");      // 创建地图实例    
		var point = new BMap.Point(111, 34);  // 创建点坐标
		baidMap.centerAndZoom(point, 5);
		baidMap.addControl(new BMap.NavigationControl());  //缩放轴
		baidMap.addControl(new BMap.OverviewMapControl());    //缩略图
		baidMap.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_HYBRID_MAP ]})); //地图类型

		baidMap.enableScrollWheelZoom(); //启用滚轮放大缩小
		baidMap.addControl(new BMap.ScaleControl());   // 添加默认比例尺控件


		var frequency = 0;
		//alert(frequency+10+"   "+carList.data.length)
		if(carList !="null" && carList!="" && carList!= null){
			if(frequency+10<=carList.data.length){
				strNum=0;
				setTimeout("addMarkers("+frequency+","+(frequency+10)+")",500);
			}else{
				setTimeout("addMarkers("+frequency+","+(carList.data.length)+")",500);
				//addMarkers(i,carList.data.length);
			}
		}
	}else{
		var obj = getUserStatus();//取用户状态
		if(obj==null){
			var lat=0,lng=0;
			for(i=0;i<carList.data.length;i++){
				try{
					if(carList.data[i].positionLast.blat != 0 &&carList.data[i].positionLast.blng != 0){
						lat = carList.data[i].positionLast.blat;
						lng = carList.data[i].positionLast.blng;
						break;
					}
				}catch(e){
					lat=0;
					lng=0;
				}
			}
			baidMap = new BMap.Map("map_canvas");      // 创建地图实例    
			var point = new BMap.Point(lng,lat);
			if(lat==0 && lng==0){
				baidMap.centerAndZoom(new BMap.Point(116.404,39.915),15);
			}else{
				baidMap.centerAndZoom(point,15);
			}
		}else{
			var zoom;
			if(bool == true){
				if(obj.bzoom == "" || obj.bzoom==null){
					zoom=6;
				}else{
					zoom=obj.bzoom;
				}
			}else{
				if(obj.gzoom == "" || obj.gzoom==null){
					zoom=6;
				}else{
					zoom=obj.gzoom+1;
				}
			}
			baidMap = new BMap.Map("map_canvas");      // 创建地图实例    
			var point = new BMap.Point(obj.lng,obj.lat);
			baidMap.centerAndZoom(new BMap.Point(116.407449, 39.904374),5);
			if(bool == true){
				addMenu();
			}
		}
		idsData=ids;
		closeMask();
		// 创建点坐标
		// 初始化地图，设置中心点坐标和地图级别
		baidMap.addControl(new BMap.NavigationControl());  //缩放轴
		baidMap.addControl(new BMap.OverviewMapControl());    //缩略图
		baidMap.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_HYBRID_MAP]})); //地图类型

		baidMap.enableScrollWheelZoom(); //启用滚轮放大缩小
		baidMap.addControl(new BMap.ScaleControl());   // 添加默认比例尺控件
		var frequency = 0;
		if(frequency+10<=carList.data.length){
			strNum=0;
			setTimeout("addMarkers("+frequency+","+(frequency+10)+")",500);
		}else{
			setTimeout("addMarkers("+frequency+","+(carList.data.length)+")",500);
		}
	}
	//创建搜索
	if(isExitSearch){
		mapSearch.dispose();
	}
	mapSearch = new BMap.Autocomplete(//建立一个自动完成的对象
			{
				"input" : "mapsearch_input",
				"location" : baidMap
			}
	);
	mapSearch.addEventListener("onhighlight",function(e){  //鼠标放在下拉列表上的事件
		isExitSearch = true;
		var str = "";
		var _value = e.fromitem.value;
		var value = "";
		if(e.fromitem.index > -1){
			value = _value.province +  _value.city +  _value.district +  _value.street +  _value.business;
		}
		str = "FromItem<br/>index = " + e.fromitem.index + "<br />value = " + value;

		value = "";
		if (e.toitem.index > -1){
			_value = e.toitem.value;
			value = _value.province +  _value.city +  _value.district +  _value.street +  _value.business;
		}    
		str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value;
		$("#searchResultPanel").innerHTML = str;
	},false);

	var myValue;
	mapSearch.addEventListener("onconfirm",function(e){//鼠标点击下拉列表后的事件
		var _value = e.item.value;
		myValue = _value.province +  _value.city +  _value.district +  _value.street +  _value.business;
		$("#searchResultPanel").innerHTML ="onconfirm<br/>index = " + e.item.index + "<br/>myValue = " + myValue;
		setPlace(myValue);
	});
	function setPlace(myValue){
		baidMap.clearOverlays();    //清除地图上所有覆盖物
		function myFun(){
			var pp = local.getResults().getPoi(0).point;    //获取第一个智能搜索的结果
			baidMap.centerAndZoom(pp,12);
			var marker = new BMap.Marker(pp);
			var opts = {
					position : pp,    // 指定文本标注所在的地理位置
					offset   : new BMap.Size(20, -10)    //设置文本偏移量
			}
			var label = new BMap.Label(myValue, opts);  // 创建文本标注对象
			label.setStyle({
				color : "#000000",
				backgroundColor:"#f5fcb8",
				borderColor : "#000000",
				fontSize : "12px",
				height : "16px",
				lineHeight : "16px",
				fontWeight:"bold",
				fontFamily:""
			});
			marker.setLabel(label);
			baidMap.addOverlay(marker);    //添加标注
		}
		var local = new BMap.LocalSearch(baidMap,{ //智能搜索
			onSearchComplete: myFun
		});
		local.search(myValue);
	}
	var yanchiAl;
	baidMap.addEventListener("dragend",function showInfo(){
		clearTimeout(yanchiAl);
		yanchiAl=setTimeout("al()",500);
	});
	baidMap.addEventListener("zoomend",function(){
		/*if(this.getZoom()>12){
			if(namekg==false){
				if(mapType==1){
					for(var j=0;j<markers.length;j++){
						if(markers[j].label != null){
							baidMap.addOverlay(markers[j].label);
						}
					}
				}
			}
			//settive();
		}else{
			if(mapType==1){
				for(var j=0;j<markers.length;j++){
					if(markers[j].label != null){
						baidMap.removeOverlay(markers[j].label);
					}
				}
			}
		}*/
	});
	if(baidubool == false){
		addMenu();
	}
	//settive();
}
function updateBaiduMap(){
	for(var i=0;i<newdata.data.length;i++){
		for(var k=0;k<markers.length;k++){
			if(newdata.data[i].vehicleId == markers[k].id){
				if(msgid== newdata.data[i].vehicleId){
					//document.getElementById('weizhi').innerHTML = msgname+"： " + newdata.data[i].memo;
					//document.getElementById('weizhi').title = msgname+"： " + newdata.data[i].memo;
				}
				//var myLatlng = new BMap.Point(newdata.data[i].blng,newdata.data[i].blat);
				var x_pi = 3.14159265358979324 * 3000.0 / 180.0;
				//alert(x_pi);

				var x = newdata.data[i].lng, y = newdata.data[i].lat;
				var z =Math.sqrt(x * x + y * y) + 0.00002 *Math.sin(y * x_pi);
				var theta =Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
				var lng = z *  Math.cos(theta) + 0.0065;
				var lat = z *  Math.sin(theta) + 0.006;
				var myLatlng = new BMap.Point(lng,lat);

				var s=10;
				var condition=newdata.data[i].state2;
				var sp = parseInt(newdata.data[i].speed);
				if (condition != null){
					if (condition.indexOf("不在线")>=0 || condition.indexOf("掉线")>=0)
						s = 2;
					else {
						if (condition.indexOf("速报警")>=0)
							s = 4;
						else if (condition.indexOf("报警")>=0)
							s = 3;
						else if (sp > 0.5)
							s = 0;
						else
							s = 1;
					}
					if (s != 4 && s != 3 && condition.indexOf("停车")>=0
							&& !condition.indexOf("不在线")>= 0){
						if(condition.indexOf("停车超时")>=0){
							s = 5;	
						}else{
							s = 6;
						}
					}
				}else{
					if (sp > 0.5)
						s = 0;
					else
						s = 1;
				}

				if( newdata.data[i].av == 0 ){
					s=7;
				}

				var newtime = new Date().getTime();
				var ttime =newdata.data[i].recvtime.replace("-","/");
				ttime=ttime.replace("-","/");
				ttime=ttime.replace("T"," ");
				var oldtime = new Date(ttime).getTime();
				//alert(newtime-oldtime);
				if(newtime-oldtime > 600000){
					s=2;
				}



				var state =s;  


				var pngicon = "gpsonline/image/pic/"+markers[k].icon+"/red_0.gif";
				if(state == 0) pngicon = "gpsonline/image/pic/"+markers[k].icon+"/green_";
				else if(state == 1) pngicon = "gpsonline/image/pic/"+markers[k].icon+"/red_";
				else if(state == 2) pngicon = "gpsonline/image/pic/"+markers[k].icon+"/gray_";
				else if(state == 3) pngicon = "gpsonline/image/pic/"+markers[k].icon+"/yellow_";
				else if(state == 4) pngicon = "gpsonline/image/pic/"+markers[k].icon+"/pink_";
				else if(state == 5) pngicon = "gpsonline/image/pic/"+markers[k].icon+"/stopalarm";
				else if(state == 7) pngicon = "gpsonline/image/pic/"+markers[k].icon+"/blue_";
				else pngicon = "gpsonline/image/pic/"+markers[k].icon+"/red_";
				var direction="";
				var t = parseInt(newdata.data[i].direct);
				if(t>27 && t<=72){
					if(state == 5){
						var image=".gif";
					}else{
						var image="45.gif";
					}
					direction="东北";
				}else if(t>72 && t<=117){
					if(state == 5){
						var image=".gif";
					}else{
						var image="90.gif";
					}

					direction="东";
				}
				else if(t>117 && t<=162){
					if(state == 5){
						var image=".gif";
					}else{
						var image="135.gif";
					}
					direction="东南";
				}
				else if(t>162 && t<=207){
					if(state == 5){
						var image=".gif";
					}else{
						var image="180.gif";
					}
					direction="南";
				}
				else if(t>207 && t<=252){
					if(state == 5){
						var image=".gif";
					}else{
						var image="225.gif";
					}
					direction="西南";
				}
				else if(t>252 && t<=297){
					if(state == 5){
						var image=".gif";
					}else{
						var image="270.gif";
					}
					direction="西";
				}
				else if(t>297 && t<=342){
					if(state == 5){
						var image=".gif";
					}else{
						var image="315.gif";
					}
					direction="西北";
				}
				else {
					if(state == 5){
						var image=".gif";
					}else{
						var image="0.gif";
					}
					direction="北";
				}

				var carname = encodeURI(encodeURI(markers[k].vhcCode));


				var temp,temp1,temp2,temp3,temp4;
				if(newdata.data[i].temperature != null && newdata.data[i].temperature <=127){
					temp=newdata.data[i].temperature +" ℃";
				}else{
					temp="无效";
				}
				if(newdata.data[i].temp1 != null && newdata.data[i].temp1 <=127){
					temp1=newdata.data[i].temp1 +" ℃";
				}else{
					temp1="无效";
				}
				if(newdata.data[i].temp2 != null && newdata.data[i].temp2 <=127){
					temp2=newdata.data[i].temp2 +" ℃";
				}else{
					temp2="无效";
				}
				if(newdata.data[i].temp3 != null && newdata.data[i].temp3 <=127){
					temp3=newdata.data[i].temp3 +" ℃";
				}else{
					temp3="无效";
				}
				if(newdata.data[i].temp4 != null && newdata.data[i].temp4 <=127){
					temp4=newdata.data[i].temp4 +" ℃";
				}else{
					temp4="无效";
				}
				var html =	"";
				if(isHasPBackAut()){
					html =	"<div id='app_"+newdata.data[i].vehicleId+"' style='font-weight:normal;'>"
					+"<div id='app1_"+newdata.data[i].vehicleId+"'><b>设备名称：</b>"+markers[k].vhcCode+"</br></div>"
					+"<div id='app18_"+newdata.data[i].vehicleId+"'><b>设备ID：</b>"+markers[k].gprsCode+"</br></div>"
					+"<div id='app16_"+newdata.data[i].vehicleId+"'><b>到期时间：</b>"+(markers[k].overduetime != null && markers[k].overduetime.indexOf("19") != 0 ? markers[k].overduetime:"")+"</br></div>"
					+"<div id='app17_"+newdata.data[i].vehicleId+"'><b>启用时间：</b>"+(markers[k].posavtime != null && markers[k].posavtime.indexOf("19") != 0 ? markers[k].posavtime :"")+"</br></div>";
					if(isShowInstill){
						html +="<div><b>安装时间：</b>"+(markers[k].installtime != null && markers[k].installtime.indexOf("19") != 0 ? markers[k].installtime :"")+"</br></div>";
					}
					html +="<div id='app14_"+newdata.data[i].vehicleId+"'><b>备注：</b>"+markers[k].remark+"</br></div>"
					+"<div id='app19_"+newdata.data[i].vehicleId+"'><b>备注2：</b>"+markers[k].remark2+"</br></div>"
					+"<div id='app15_"+newdata.data[i].vehicleId+"'><b>经纬度：</b>"+newdata.data[i].lng+","+newdata.data[i].lat+"</br></div>"
					+"<div id='app11_"+newdata.data[i].vehicleId+"'><b>SIM卡号：</b>"+markers[k].simCode+"</br></div>"
					+"<div id='app2_"+newdata.data[i].vehicleId+"'><b>服务器时间：</b>"+newdata.data[i].recvtime+"</br></div>"
					+"<div id='app12_"+newdata.data[i].vehicleId+"'><b>GPS时间：</b>"+newdata.data[i].gpstime+"</br></div>"
					+"<div id='app3_"+newdata.data[i].vehicleId+"'><b>速度：</b>"+newdata.data[i].speed.toFixed(1)+"km/h </br></div>"
					+"<div id='app4_"+newdata.data[i].vehicleId+"'><b>方向：</b>"+direction+"</br></div>"
					+"<div><b>海拔：</b>"+newdata.data[i].height.toFixed(1)+"m </br></div>"
					+"<div id='app5_"+newdata.data[i].vehicleId+"'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+"</br></div>"
					+"<div id='app6_"+newdata.data[i].vehicleId+"'><b>油量：</b>"+newdata.data[i].oilMN1+" L</br></div>"
					+"<div id='app7_"+newdata.data[i].vehicleId+"'><b>当前里程：</b>"+newdata.data[i].distance+" km</br></div>"
					+"<div id='app8_"+newdata.data[i].vehicleId+"'><b>总里程：</b>"+newdata.data[i].totalDistance+" km</br></div>"
					+"<div id='app9_"+newdata.data[i].vehicleId+"'><b>状态：</b>"+newdata.data[i].state2+"</br></div>"
					+"<div id='app10_"+newdata.data[i].vehicleId+"'><b>位置：</b>"+newdata.data[i].memo+"</br></div>"
					+"<div id='app13_"+newdata.data[i].vehicleId+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+newdata.data[i].vehicleId+");'><font color='#0000FF'>详细</font></a></br></div>"
					+"<a href='javascript:streeViewObject.open("+newdata.data[i].vehicleId+","+newdata.data[i].blat+","+newdata.data[i].blng+","+t+","+3+");'><font color='#0000FF'>街景</font> | </a><a href='gpsonline/jsp/TrackMap.jsp?carid="+markers[k].id+"&mapType=1' target='_blank'><font color='#0000FF'>跟踪</font> | </a><a id='play_"+markers[k].id+"' href='gpsonline/jsp/monitor/playBack.jsp?carid="+markers[k].id+"&carname="+carname+"&icon="+markers[k].icon+"&mapType=1' target='_blank'><font color='#0000FF'>回放</font>  |</a> <a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+newdata.data[i].vehicleId+");\" >驾驶员</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+newdata.data[i].vehicleId+");\" >刷新位置</font> | </a> <a id='sim_"+markers[k].id+"' href='javascript:;' ><font color='#0000FF' onclick=\"openSim("+markers[k].simCode+");\">SIM </font> | </a>";
					if(isShowTTs){
						html += "<a href='javascript:void(0);' onclick='ttsCmd("+markers[k].gprsCode+");'><font color='#0000FF'>TTS</font> |</a>" ;
					}
					if(isShowVideo){
						html += "<a href='javascript:void(0);' onclick='videoShow("+markers[k].gprsCode+");'><font color='#0000FF'>视频</font> |</a>" ;
					}
					html +="<a id='more_"+markers[k].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼ </font></a></div>";   
				}else{
					html =	"<div id='app_"+newdata.data[i].vehicleId+"' style='font-weight:normal;'>"
					+"<div id='app1_"+newdata.data[i].vehicleId+"'><b>设备名称：</b>"+markers[k].vhcCode+"</br></div>"
					+"<div id='app18_"+newdata.data[i].vehicleId+"'><b>设备ID：</b>"+markers[k].gprsCode+"</br></div>"
					+"<div id='app16_"+newdata.data[i].vehicleId+"'><b>到期时间：</b>"+(markers[k].overduetime != null && markers[k].overduetime.indexOf("19") != 0 ? markers[k].overduetime:"")+"</br></div>"
					+"<div id='app17_"+newdata.data[i].vehicleId+"'><b>启用时间：</b>"+(markers[k].posavtime != null && markers[k].posavtime.indexOf("19") != 0 ? markers[k].posavtime :"")+"</br></div>";
					if(isShowInstill){
						html +="<div><b>安装时间：</b>"+(markers[k].installtime != null && markers[k].installtime.indexOf("19") != 0 ? markers[k].installtime :"")+"</br></div>";
					}
					html +="<div id='app14_"+newdata.data[i].vehicleId+"'><b>备注：</b>"+markers[k].remark+"</br></div>"
					+"<div id='app19_"+newdata.data[i].vehicleId+"'><b>备注2：</b>"+markers[k].remark2+"</br></div>"
					+"<div id='app15_"+newdata.data[i].vehicleId+"'><b>经纬度：</b>"+newdata.data[i].lng+","+newdata.data[i].lat+"</br></div>"
					+"<div id='app11_"+newdata.data[i].vehicleId+"'><b>SIM卡号：</b>"+markers[k].simCode+"</br></div>"
					+"<div id='app2_"+newdata.data[i].vehicleId+"'><b>服务器时间：</b>"+newdata.data[i].recvtime+"</br></div>"
					+"<div id='app12_"+newdata.data[i].vehicleId+"'><b>GPS时间：</b>"+newdata.data[i].gpstime+"</br></div>"
					+"<div id='app3_"+newdata.data[i].vehicleId+"'><b>速度：</b>"+newdata.data[i].speed.toFixed(1)+"km/h </br></div>"
					+"<div id='app4_"+newdata.data[i].vehicleId+"'><b>方向：</b>"+direction+"</br></div>"
					+"<div><b>海拔：</b>"+data.data[0].positionLast.height.toFixed(1)+"m </br></div>"
					+"<div id='app5_"+newdata.data[i].vehicleId+"'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+"</br></div>"
					+"<div id='app6_"+newdata.data[i].vehicleId+"'><b>油量：</b>"+newdata.data[i].oilMN1+" L</br></div>"
					+"<div id='app7_"+newdata.data[i].vehicleId+"'><b>当前里程：</b>"+newdata.data[i].distance+" km</br></div>"
					+"<div id='app8_"+newdata.data[i].vehicleId+"'><b>总里程：</b>"+newdata.data[i].totalDistance+" km</br></div>"
					+"<div id='app9_"+newdata.data[i].vehicleId+"'><b>状态：</b>"+newdata.data[i].state2+"</br></div>"
					+"<div id='app10_"+newdata.data[i].vehicleId+"'><b>位置：</b>"+newdata.data[i].memo+"</br></div>"
					+"<div id='app13_"+newdata.data[i].vehicleId+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+newdata.data[i].vehicleId+");'><font color='#0000FF'>详细</font></a></br></div>"
					+"<a href='javascript:streeViewObject.open("+newdata.data[i].vehicleId+","+newdata.data[i].blat+","+newdata.data[i].blng+","+t+","+3+");'><font color='#0000FF'>街景</font> | </a><a href='gpsonline/jsp/TrackMap.jsp?carid="+markers[k].id+"&mapType=1' target='_blank'><font color='#0000FF'>跟踪</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+newdata.data[i].vehicleId+");\" >驾驶员</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+newdata.data[i].vehicleId+");\" >刷新位置</font> | </a> <a id='sim_"+markers[k].id+"' href='javascript:;' ><font color='#0000FF' onclick=\"openSim("+markers[k].simCode+");\">SIM </font> | </a>";
					if(isShowTTs){
						html += "<a href='javascript:void(0);' onclick='ttsCmd("+markers[k].gprsCode+");'><font color='#0000FF'>TTS</font> |</a>" ;
					}
					if(isShowVideo){
						html += "<a href='javascript:void(0);' onclick='videoShow("+markers[k].gprsCode+");'><font color='#0000FF'>视频</font> |</a>" ;
					}
					html +="<a id='more_"+markers[k].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼ </font></a></div>";   
				}

				markers[k].latlng=myLatlng;
				var icon_size=real(markers[k].icon);
				markers[k].marker.setIcon(new BMap.Icon(pngicon+image, new BMap.Size(icon_size,icon_size)));

				markers[k].infowindow.setContent(html);

				var WinShowParms = getCurUserWinShowParms();

				if(WinShowParms!=null){

					var app1_ = document.getElementById("app1_"+newdata.data[i].vehicleId);
					if(app1_ != null){
						app1_.style.display ="none";
						var app2_ = document.getElementById("app2_"+newdata.data[i].vehicleId);
						app2_.style.display ="none";
						var app3_ = document.getElementById("app3_"+newdata.data[i].vehicleId);
						app3_.style.display ="none";
						var app4_ = document.getElementById("app4_"+newdata.data[i].vehicleId);
						app4_.style.display ="none";
						var app5_ = document.getElementById("app5_"+newdata.data[i].vehicleId);
						app5_.style.display ="none";
						var app6_ = document.getElementById("app6_"+newdata.data[i].vehicleId);
						app6_.style.display ="none";
						var app7_ = document.getElementById("app7_"+newdata.data[i].vehicleId);
						app7_.style.display ="none";
						var app8_ = document.getElementById("app8_"+newdata.data[i].vehicleId);
						app8_.style.display ="none";
						var app9_ = document.getElementById("app9_"+newdata.data[i].vehicleId);
						app9_.style.display ="none";
						var app10_ = document.getElementById("app10_"+newdata.data[i].vehicleId);
						app10_.style.display ="none";
						var app11_ = document.getElementById("app11_"+newdata.data[i].vehicleId);
						app11_.style.display ="none";
						var app12_ = document.getElementById("app12_"+newdata.data[i].vehicleId);
						app12_.style.display ="none";
						var app13_ = document.getElementById("app13_"+newdata.data[i].vehicleId);
						app13_.style.display ="none";
						var app14_ = document.getElementById("app14_"+newdata.data[i].vehicleId);
						app14_.style.display ="none";
						var app15_ = document.getElementById("app15_"+newdata.data[i].vehicleId);
						app15_.style.display ="none";
						var app16_ = document.getElementById("app16_"+newdata.data[i].vehicleId);
						app16_.style.display ="none";
						var app17_ = document.getElementById("app17_"+newdata.data[i].vehicleId);
						app17_.style.display ="none";
						var app18_ = document.getElementById("app18_"+newdata.data[i].vehicleId);
						app18_.style.display ="none";
						var app19_ = document.getElementById("app19_"+newdata.data[i].vehicleId);
						app19_.style.display ="none";
						for(var ws=0;ws<WinShowParms.length;ws++){
							if(WinShowParms[ws]==1){
								app1_.style.display ="block";
							}
							if(WinShowParms[ws]==2){
								app2_.style.display ="block";
							}
							if(WinShowParms[ws]==3){
								app3_.style.display ="block";
							}
							if(WinShowParms[ws]==4){
								app4_.style.display ="block";
							}
							if(WinShowParms[ws]==5){
								app5_.style.display ="block";
							}
							if(WinShowParms[ws]==6){
								app6_.style.display ="block";
							}
							if(WinShowParms[ws]==7){
								app7_.style.display ="block";
							}
							if(WinShowParms[ws]==8){
								app8_.style.display ="block";
							}
							if(WinShowParms[ws]==9){
								app9_.style.display ="block";
							}
							if(WinShowParms[ws]==10){
								app10_.style.display ="block";
							}
							if(WinShowParms[ws]==11){
								app11_.style.display ="block";
							}
							if(WinShowParms[ws]==12){
								app12_.style.display ="block";
							}
							if(WinShowParms[ws]==13){
								app13_.style.display ="block";
							}
							if(WinShowParms[ws]==14){
								app14_.style.display ="block";
							}
							if(WinShowParms[ws]==15){
								app15_.style.display ="block";
							}
							if(WinShowParms[ws]==16){
								app16_.style.display ="block";
							}
							if(WinShowParms[ws]==17){
								app17_.style.display ="block";
							}
							if(WinShowParms[ws]==18){
								app18_.style.display ="block";
							}
							if(WinShowParms[ws]==19){
								app19_.style.display ="block";
							}
						}
						if(!eqVisualPower.sim)$("#sim_"+markers[k].id).hide();
						if(!eqVisualPower.play)$("#play_"+markers[k].id).hide();
						var app_ = document.getElementById("app_"+newdata.data[i].vehicleId).innerHTML;;
						app_="<div id='app_"+newdata.data[i].vehicleId+"' style='font-weight:normal;'>"+app_+"</div>"
						markers[k].infowindow.setContent(app_);
					}
				}

				markers[k].label.setContent(markers[k].vhcCode+"("+newdata.data[i].speed.toFixed(1)+"km/h"+")");
				if( newdata.data[i].lat != 0 && newdata.data[i].lng !=0){
					markers[k].marker.setPosition(myLatlng);
					markers[k].infowindow.setPosition(myLatlng);
					markers[k].label.setPosition(myLatlng);
				}
				if(namekg == true){
					baidMap.removeOverlay(markers[k].label);
				}	
			}
		}
	}
//	if(usertype!="-100"){
		$(".BMap_top").append("<a href='javascript:void(0);' class='map_setting_ico' onclick='setSystemObject.openWin(1);'><span></span></a>");
//	}
}
var isFirst = true;
function centerBaiduMap(data,db){
	//console.info(JSON.stringify(data));
	msgid=data.data[0].id;
	msgname= data.data[0].vhcCode;
	if(isLargeData==true){
		if(isFirst){
			settive();
			isFirst = false;
		}
		if(markers.length>0){
			for(var k=0;k<markers.length;k++){
				if(data.data[0].id == markers[k].id){
					msgid= data.data[0].id;
					markers[k].vhcCode=data.data[0].vhcCode;
					isUpdate = true;
					var x_pi = 3.14159265358979324 * 3000.0 / 180.0;

					var x =data.data[0].positionLast.lng , y = data.data[0].positionLast.lat;
					var z =Math.sqrt(x * x + y * y) + 0.00002 *Math.sin(y * x_pi);
					var theta =Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
					var lng = z *  Math.cos(theta) + 0.0065;
					var lat = z *  Math.sin(theta) + 0.006;
					var myLatlng = new BMap.Point(lng,lat);

					var s=10;
					var condition=data.data[0].positionLast.state2;
					var sp = parseInt(data.data[0].positionLast.speed);
					if (condition != null) {
						if (condition.indexOf("不在线")>=0 || condition.indexOf("掉线")>=0)
							s = 2;
						else {
							if (condition.indexOf("速报警")>=0)
								s = 4;
							else if (condition.indexOf("报警")>=0)
								s = 3;
							else if (sp > 0.5)
								s = 0;
							else
								s = 1;
						}
						if (s != 4 && s != 3 && condition.indexOf("停车")>=0
								&& !condition.indexOf("不在线")>= 0)
						{
							if(condition.indexOf("停车超时")>=0){
								s = 5;	
							}else{
								s = 6;
							}
						}
					}else{
						if (sp > 0.5)
							s = 0;
						else
							s = 1;
					}
					if( data.data[0].positionLast.av == 0 ){
						s=7;
					}
					var newtime = new Date().getTime();
					var ttime =data.data[0].positionLast.recvtime.replace("-","/");
					ttime=ttime.replace("-","/");
					ttime=ttime.replace("T"," ");
					var oldtime = new Date(ttime).getTime();
					if(newtime-oldtime > 600000){
						s=2;
					}
					var state =s;
					var pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/red_0.gif";
					if(state == 0) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/green_";
					else if(state == 1) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/red_";
					else if(state == 2) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/gray_";
					else if(state == 3) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/yellow_";
					else if(state == 4) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/pink_";
					else if(state == 5) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/stopalarm";
					else if(state == 7) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/blue_";
					else pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/red_";
					var direction="";
					var t = parseInt(data.data[0].positionLast.direct);
					if(t>27 && t<=72){
						if(state == 5){
							var image=".gif";
						}else{
							var image="45.gif";
						}

						direction="东北";
					}else if(t>72 && t<=117){
						if(state == 5){
							var image=".gif";
						}else{
							var image="90.gif";
						}

						direction="东";
					}
					else if(t>117 && t<=162){
						if(state == 5){
							var image=".gif";
						}else{
							var image="135.gif";
						}
						direction="东南";
					}
					else if(t>162 && t<=207){
						if(state == 5){
							var image=".gif";
						}else{
							var image="180.gif";
						}
						direction="南";
					}
					else if(t>207 && t<=252){
						if(state == 5){
							var image=".gif";
						}else{
							var image="225.gif";
						}
						direction="西南";
					}
					else if(t>252 && t<=297){
						if(state == 5){
							var image=".gif";
						}else{
							var image="270.gif";
						}
						direction="西";
					}
					else if(t>297 && t<=342){
						if(state == 5){
							var image=".gif";
						}else{
							var image="315.gif";
						}
						direction="西北";
					}
					else {
						if(state == 5){
							var image=".gif";
						}else{
							var image="0.gif";
						}
						direction="北";
					}
					var carname = encodeURI(encodeURI(data.data[0].vhcCode)); 
					var temp,temp1,temp2,temp3,temp4;
					if(data.data[0].positionLast.temperature != null && data.data[0].positionLast.temperature <=127){
						temp=data.data[0].positionLast.temperature +" ℃";
					}else{
						temp="无效";
					}
					if(data.data[0].positionLast.temp1 != null && data.data[0].positionLast.temp1 <=127){
						temp1=data.data[0].positionLast.temp1 +" ℃";
					}else{
						temp1="无效";
					}
					if(data.data[0].positionLast.temp2 != null && data.data[0].positionLast.temp2 <=127){
						temp2=data.data[0].positionLast.temp2 +" ℃";
					}else{
						temp2="无效";
					}
					if(data.data[0].positionLast.temp3 != null && data.data[0].positionLast.temp3 <=127){
						temp3=data.data[0].positionLast.temp3 +" ℃";
					}else{
						temp3="无效";
					}
					if(data.data[0].positionLast.temp4 != null && data.data[0].positionLast.temp4 <=127){
						temp4=data.data[0].positionLast.temp4 +" ℃";
					}else{
						temp4="无效";
					}
					var html =	"";
					if(isHasPBackAut()){
						html =	"<div id='app_"+data.data[0].id+"' style='font-weight:normal;'>"
						+"<div id='app1_"+data.data[0].id+"'><b>设备名称：</b>"+data.data[0].vhcCode+"</br></div>"
						+"<div id='app18_"+data.data[0].id+"'><b>设备ID：</b>"+data.data[0].gprsCode+"</br></div>"
						+"<div id='app16_"+data.data[0].id+"'><b>到期时间：</b>"+(data.data[0].overduetime != null && data.data[0].overduetime.indexOf("19") != 0 ? data.data[0].overduetime :'')+"</br></div>"
						+"<div id='app17_"+data.data[0].id+"'><b>启用时间：</b>"+(data.data[0].posavtime != null && data.data[0].posavtime.indexOf("19") != 0 ? data.data[0].posavtime :"")+"</br></div>";
						if(isShowInstill){
							html+="<div><b>安装时间：</b>"+(data.data[0].installtime != null && data.data[0].installtime.indexOf("19") != 0 ? data.data[0].installtime :"")+"</br></div>";
						}
						html+="<div id='app14_"+data.data[0].id+"'><b>备注：</b>"+data.data[0].remark+"</br></div>"
						+"<div id='app19_"+data.data[0].id+"'><b>备注2：</b>"+data.data[0].remark2+"</br></div>"
						+"<div id='app15_"+data.data[0].id+"'><b>经纬度：</b>"+data.data[0].positionLast.lng+","+data.data[0].positionLast.lat+"</br></div>"
						+"<div id='app11_"+data.data[0].id+"'><b>SIM卡号：</b>"+data.data[0].simCode+"</br></div>"
						+"<div id='app2_"+data.data[0].id+"'><b>服务器时间：</b>"+data.data[0].positionLast.recvtime+"</br></div>"
						+"<div id='app12_"+data.data[0].id+"'><b>GPS时间：</b>"+data.data[0].positionLast.gpstime+"</br></div>"
						+"<div id='app3_"+data.data[0].id+"'><b>速度：</b>"+data.data[0].positionLast.speed.toFixed(1)+"km/h </br></div>"
						+"<div id='app4_"+data.data[0].id+"'><b>方向：</b>"+direction+"</br></div>"
						+"<div><b>海拔：</b>"+data.data[0].positionLast.height.toFixed(1)+"m </br></div>"
						+"<div id='app5_"+data.data[0].id+"'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+" </br></div>"
						+"<div id='app6_"+data.data[0].id+"'><b>油量：</b>"+data.data[0].positionLast.oilMN1+" L</br></div>"
						+"<div id='app7_"+data.data[0].id+"'><b>当日里程：</b>"+data.data[0].positionLast.distance+" km</br></div>"
						+"<div id='app8_"+data.data[0].id+"'><b>总里程：</b>"+data.data[0].positionLast.totalDistance+" km</br></div>"
						+"<div id='app9_"+data.data[0].id+"'><b>状态：</b>"+data.data[0].positionLast.state2+"</br></div>"
						+"<div id='app10_"+data.data[0].id+"'><b>位置：</b>"+data.data[0].positionLast.memo+"</br></div>"
						+"<div id='app13_"+data.data[0].id+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+data.data[0].id+");'><font color='#0000FF'>详细</font></a></br></div>"
						+"<a href='javascript:streeViewObject.open("+data.data[0].id+","+data.data[0].positionLast.blat+","+data.data[0].positionLast.blng+","+t+","+3+");'><font color='#0000FF'>街景</font> | </a><a href='gpsonline/jsp/TrackMap.jsp?carid="+data.data[0].id+"&mapType=1' target='_blank'><font color='#0000FF'>跟踪</font> | </a><a id='play_"+data.data[0].id+"' href='gpsonline/jsp/monitor/playBack.jsp?carid="+data.data[0].id+"&carname="+carname+"&icon="+data.data[0].icon+"&mapType=1' target='_blank'><font color='#0000FF'>回放</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+data.data[0].id+");\" >驾驶员</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+data.data[0].id+");\" >刷新位置</font> | </a> <a id='sim_"+data.data[0].id+"' href='javascript:;'><font color='#0000FF' onclick=\"openSim("+data.data[0].simCode+");\">SIM</font> | </a> ";
						if(isShowTTs){
							html += "<a href='javascript:void(0);' onclick='ttsCmd("+data.data[0].gprsCode+");'><font color='#0000FF'>TTS</font> |</a>" ;
						}
						if(isShowVideo){
							html += "<a href='javascript:void(0);' onclick='videoShow("+data.data[0].gprsCode+");'><font color='#0000FF'>视频</font> |</a>" ;
						}
						html +="<a id='more_"+data.data[0].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼</font></a></div>";
					}else{
						html =	"<div id='app_"+data.data[0].id+"' style='font-weight:normal;'>"
						+"<div id='app1_"+data.data[0].id+"'><b>设备名称：</b>"+data.data[0].vhcCode+"</br></div>"
						+"<div id='app18_"+data.data[0].id+"'><b>设备ID：</b>"+data.data[0].gprsCode+"</br></div>"
						+"<div id='app16_"+data.data[0].id+"'><b>到期时间：</b>"+(data.data[0].overduetime != null && data.data[0].overduetime.indexOf("19") != 0 ? data.data[0].overduetime :'')+"</br></div>"
						+"<div id='app17_"+data.data[0].id+"'><b>启用时间：</b>"+(data.data[0].posavtime != null && data.data[0].posavtime.indexOf("19") != 0 ? data.data[0].posavtime :"")+"</br></div>";
						if(isShowInstill){
							html +="<div><b>安装时间：</b>"+(data.data[0].installtime != null && data.data[0].installtime.indexOf("19") != 0 ? data.data[0].installtime :"")+"</br></div>";
						}
						html+="<div id='app14_"+data.data[0].id+"'><b>备注：</b>"+data.data[0].remark+"</br></div>"
						+"<div id='app19_"+data.data[0].id+"'><b>备注2：</b>"+data.data[0].remark2+"</br></div>"
						+"<div id='app15_"+data.data[0].id+"'><b>经纬度：</b>"+data.data[0].positionLast.lng+","+data.data[0].positionLast.lat+"</br></div>"
						+"<div id='app11_"+data.data[0].id+"'><b>SIM卡号：</b>"+data.data[0].simCode+"</br></div>"
						+"<div id='app2_"+data.data[0].id+"'><b>服务器时间：</b>"+data.data[0].positionLast.recvtime+"</br></div>"
						+"<div id='app12_"+data.data[0].id+"'><b>GPS时间：</b>"+data.data[0].positionLast.gpstime+"</br></div>"
						+"<div id='app3_"+data.data[0].id+"'><b>速度：</b>"+data.data[0].positionLast.speed.toFixed(1)+"km/h </br></div>"
						+"<div id='app4_"+data.data[0].id+"'><b>方向：</b>"+direction+"</br></div>"
						+"<div><b>海拔：</b>"+data.data[0].positionLast.height.toFixed(1)+"m </br></div>"
						+"<div id='app5_"+data.data[0].id+"'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+" </br></div>"
						+"<div id='app6_"+data.data[0].id+"'><b>油量：</b>"+data.data[0].positionLast.oilMN1+" L</br></div>"
						+"<div id='app7_"+data.data[0].id+"'><b>当日里程：</b>"+data.data[0].positionLast.distance+" km</br></div>"
						+"<div id='app8_"+data.data[0].id+"'><b>总里程：</b>"+data.data[0].positionLast.totalDistance+" km</br></div>"
						+"<div id='app9_"+data.data[0].id+"'><b>状态：</b>"+data.data[0].positionLast.state2+"</br></div>"
						+"<div id='app10_"+data.data[0].id+"'><b>位置：</b>"+data.data[0].positionLast.memo+"</br></div>"
						+"<div id='app13_"+data.data[0].id+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+data.data[0].id+");'><font color='#0000FF'>详细</font></a></br></div>"
						+"<a href='javascript:streeViewObject.open("+data.data[0].id+","+data.data[0].positionLast.blat+","+data.data[0].positionLast.blng+","+t+","+3+");'><font color='#0000FF'>街景</font> | </a><a href='gpsonline/jsp/TrackMap.jsp?carid="+data.data[0].id+"&mapType=1' target='_blank'><font color='#0000FF'>跟踪</font> | </a><a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+data.data[0].id+");\" >驾驶员</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+data.data[0].id+");\" >刷新位置</font> | </a> <a id='sim_"+data.data[0].id+"' href='javascript:;'><font color='#0000FF' onclick=\"openSim("+data.data[0].simCode+");\">SIM</font> | </a> ";
						if(isShowTTs){
							html += "<a href='javascript:void(0);' onclick='ttsCmd("+data.data[0].gprsCode+");'><font color='#0000FF'>TTS</font> |</a>" ;
						}
						if(isShowVideo){
							html += "<a href='javascript:void(0);' onclick='videoShow("+data.data[0].gprsCode+");'><font color='#0000FF'>视频</font> |</a>" ;
						}
						html +="<a id='more_"+data.data[0].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼</font></a></div>";
					}
					var icon_size=real(data.data[0].icon);
					markers[k].marker.setIcon(new BMap.Icon(pngicon+image, new BMap.Size(icon_size,icon_size)));
					baidMap.addOverlay(markers[k].marker);
					markers[k].infowindow.setContent(html);
					markers[k].label.setContent(markers[k].vhcCode+"("+data.data[0].positionLast.speed.toFixed(1)+"km/h"+")");
					markers[k].marker.openInfoWindow(markers[k].infowindow);
					var app1_ = document.getElementById("app1_"+data.data[0].id);

					if($('#isShowCarName').is(':checked')){
						baidMap.addOverlay(markers[k].label);
					}else{
						baidMap.removeOverlay(markers[k].label);
					}
					var WinShowParms = getCurUserWinShowParms();
					if(WinShowParms!=null){
						var app1_ = document.getElementById("app1_"+data.data[0].id);
						app1_.style.display ="none";
						var app2_ = document.getElementById("app2_"+data.data[0].id);
						app2_.style.display ="none";
						var app3_ = document.getElementById("app3_"+data.data[0].id);
						app3_.style.display ="none";
						var app4_ = document.getElementById("app4_"+data.data[0].id);
						app4_.style.display ="none";
						var app5_ = document.getElementById("app5_"+data.data[0].id);
						app5_.style.display ="none";
						var app6_ = document.getElementById("app6_"+data.data[0].id);
						app6_.style.display ="none";
						var app7_ = document.getElementById("app7_"+data.data[0].id);
						app7_.style.display ="none";
						var app8_ = document.getElementById("app8_"+data.data[0].id);
						app8_.style.display ="none";
						var app9_ = document.getElementById("app9_"+data.data[0].id);
						app9_.style.display ="none";
						var app10_ = document.getElementById("app10_"+data.data[0].id);
						app10_.style.display ="none";
						var app11_ = document.getElementById("app11_"+data.data[0].id);
						app11_.style.display ="none";
						var app12_ = document.getElementById("app12_"+data.data[0].id);
						app12_.style.display ="none";
						var app13_ = document.getElementById("app13_"+data.data[0].id);
						app13_.style.display ="none";
						var app14_ = document.getElementById("app14_"+data.data[0].id);
						app14_.style.display ="none";
						var app15_ = document.getElementById("app15_"+data.data[0].id);
						app15_.style.display ="none";
						var app16_ = document.getElementById("app16_"+data.data[0].id);
						app16_.style.display ="none";
						var app17_ = document.getElementById("app17_"+data.data[0].id);
						app17_.style.display ="none";
						var app18_ = document.getElementById("app18_"+data.data[0].id);
						app18_.style.display ="none";
						var app19_ = document.getElementById("app19_"+data.data[0].id);
						app19_.style.display ="none";
						for(var ws=0;ws<WinShowParms.length;ws++){
							if(WinShowParms[ws]==1){
								app1_.style.display ="block";
							}
							if(WinShowParms[ws]==2){
								app2_.style.display ="block";
							}
							if(WinShowParms[ws]==3){
								app3_.style.display ="block";
							}
							if(WinShowParms[ws]==4){
								app4_.style.display ="block";
							}
							if(WinShowParms[ws]==5){
								app5_.style.display ="block";
							}
							if(WinShowParms[ws]==6){
								app6_.style.display ="block";
							}
							if(WinShowParms[ws]==7){
								app7_.style.display ="block";
							}
							if(WinShowParms[ws]==8){
								app8_.style.display ="block";
							}
							if(WinShowParms[ws]==9 && eqVisualPower.state){
								app9_.style.display ="block";
							}
							if(WinShowParms[ws]==10){
								app10_.style.display ="block";
							}
							if(WinShowParms[ws]==11 && eqVisualPower.sim){
								app11_.style.display ="block";
							}
							if(WinShowParms[ws]==12){
								app12_.style.display ="block";
							}
							if(WinShowParms[ws]==13){
								app13_.style.display ="block";
							}
							if(WinShowParms[ws]==14 && eqVisualPower.remark){
								app14_.style.display ="block";
							}
							if(WinShowParms[ws]==15){
								app15_.style.display ="block";
							}
							if(WinShowParms[ws]==16){
								app16_.style.display ="block";
							}
							if(WinShowParms[ws]==17){
								app17_.style.display ="block";
							}
							if(WinShowParms[ws]==18 && eqVisualPower.gprs){
								app18_.style.display ="block";
							}
							if(WinShowParms[ws]==19){
								app19_.style.display ="block";
							}
						}
						if(!eqVisualPower.sim)$("#sim_"+data.data[0].id).hide();
						if(!eqVisualPower.play)$("#play_"+data.data[0].id).hide();
						var app_ = document.getElementById("app_"+data.data[0].id).innerHTML;
						app_="<div id='app_"+data.data[0].id+"' style='font-weight:normal;'>"+app_+"</div>"
						markers[k].infowindow.setContent(app_);
					}
					msgid= data.data[0].id;
					msgname=data.data[0].vhcCode;

					markers[k].latlng=myLatlng;
					markers[k].marker.setPosition(myLatlng);	
					markers[k].infowindow.setPosition(myLatlng);
					markers[k].label.setPosition(myLatlng);
					if(db==1){
						baidMap.setCenter(myLatlng);
					}
				}
			}
		}
		if(isUpdate==false || markers.length ==0){
			carList=data;
			addMarkers(carList.data.length-1,carList.data.length);
			markers[markers.length-1].marker.openInfoWindow(markers[markers.length-1].infowindow);
			if(baidMap.getZoom()<13){
				baidMap.setZoom(13);
			}
			if(db==1){
				baidMap.setCenter(myLatlng);
			}
		}
	}else{
		for(var k=0;k<markers.length;k++){
			if(data.data[0].id == markers[k].id){
				//console.info(JSON.stringify(data.data[0]));
				var x_pi = 3.14159265358979324 * 3000.0/180.0;
				var x =data.data[0].positionLast.lng,y = data.data[0].positionLast.lat;
				var z =Math.sqrt(x * x + y * y) + 0.00002 *Math.sin(y * x_pi);
				var theta =Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
				var lng = z *  Math.cos(theta) + 0.0065;
				var lat = z *  Math.sin(theta) + 0.006;
				var myLatlng = new BMap.Point(lng,lat);
				var s=10;
				var condition=data.data[0].positionLast.state2;
				var sp = parseInt(data.data[0].positionLast.speed);
				if(condition != null){
					if (condition.indexOf("不在线")>=0 || condition.indexOf("掉线")>=0)
						s = 2;
					else {
						if (condition.indexOf("速报警")>=0)
							s = 4;
						else if (condition.indexOf("报警")>=0)
							s = 3;
						else if (sp > 0.5)
							s = 0;
						else
							s = 1;
					}
					if (s != 4 && s != 3 && condition.indexOf("停车")>=0
							&& !condition.indexOf("不在线")>= 0)
					{
						if(condition.indexOf("停车超时")>=0){
							s = 5;	
						}else{
							s = 6;
						}
					}
				}else{
					if (sp > 0.5)
						s = 0;
					else
						s = 1;
				}
				if( data.data[0].positionLast.av == 0 ){
					s=7;
				}
				var newtime = new Date().getTime();
				var ttime =data.data[0].positionLast.recvtime.replace("-","/");
				ttime=ttime.replace("-","/");
				ttime=ttime.replace("T"," ");
				var oldtime = new Date(ttime).getTime();
				if(newtime-oldtime > 600000){
					s=2;
				}

				var state =s;

				var pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/red_0.gif";
				if(state == 0) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/green_";
				else if(state == 1) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/red_";
				else if(state == 2) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/gray_";
				else if(state == 3) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/yellow_";
				else if(state == 4) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/pink_";
				else if(state == 5) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/stopalarm";
				else if(state == 7) pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/blue_";
				else pngicon = "gpsonline/image/pic/"+data.data[0].icon+"/red_";

				var ss = data.data[0].icon;
				if(ss==3 || ss==5 || ss==6){
					so = false;
				}else{
					so = true;
				}
				var direction="";
				var t = parseInt(data.data[0].positionLast.direct);
				if(t>27 && t<=72){
					if(state == 5){
						var image=".gif";
					}else{
						var image="45.gif";
					}

					direction="东北";
				}else if(t>72 && t<=117){
					if(state == 5){
						var image=".gif";
					}else{
						var image="90.gif";
					}

					direction="东";
				}
				else if(t>117 && t<=162){
					if(state == 5){
						var image=".gif";
					}else{
						var image="135.gif";
					}
					direction="东南";
				}
				else if(t>162 && t<=207){
					if(state == 5){
						var image=".gif";
					}else{
						var image="180.gif";
					}
					direction="南";
				}
				else if(t>207 && t<=252){
					if(state == 5){
						var image=".gif";
					}else{
						var image="225.gif";
					}
					direction="西南";
				}
				else if(t>252 && t<=297){
					if(state == 5){
						var image=".gif";
					}else{
						var image="270.gif";
					}
					direction="西";
				}
				else if(t>297 && t<=342){
					if(state == 5){
						var image=".gif";
					}else{
						var image="315.gif";
					}
					direction="西北";
				}
				else {
					if(state == 5){
						var image=".gif";
					}else{
						var image="0.gif";
					}
					direction="北";
				}

				var carname = encodeURI(encodeURI(data.data[0].vhcCode)); 
				var temp,temp1,temp2,temp3,temp4;
				if(data.data[0].positionLast.temperature != null && data.data[0].positionLast.temperature <=127){
					temp=data.data[0].positionLast.temperature +" ℃";
				}else{
					temp="无效";
				}
				if(data.data[0].positionLast.temp1 != null && data.data[0].positionLast.temp1 <=127){
					temp1=data.data[0].positionLast.temp1 +" ℃";
				}else{
					temp1="无效";
				}
				if(data.data[0].positionLast.temp2 != null && data.data[0].positionLast.temp2 <=127){
					temp2=data.data[0].positionLast.temp2 +" ℃";
				}else{
					temp2="无效";
				}
				if(data.data[0].positionLast.temp3 != null && data.data[0].positionLast.temp3 <=127){
					temp3=data.data[0].positionLast.temp3 +" ℃";
				}else{
					temp3="无效";
				}
				if(data.data[0].positionLast.temp4 != null && data.data[0].positionLast.temp4 <=127){
					temp4=data.data[0].positionLast.temp4 +" ℃";
				}else{
					temp4="无效";
				}
				var html =	"";
				//console.info("isHasPBackAut()：" + isHasPBackAut());
				//console.info(JSON.stringify(data.data[0]));
				if(isHasPBackAut()){
					html =	"<div id='app_"+data.data[0].id+"' style='font-weight:normal;'>"
					+"<div id='app1_"+data.data[0].id+"'><b>设备名称：</b>"+data.data[0].vhcCode+"</br></div>"
					+"<div id='app18_"+data.data[0].id+"'><b>设备ID：</b>"+data.data[0].gprsCode+"</br></div>"
					+"<div id='app16_"+data.data[0].id+"'><b>到期时间：</b>"+(data.data[0].overduetime != null && data.data[0].overduetime.indexOf("19") != 0 ? data.data[0].overduetime :'')+"</br></div>"
					+"<div id='app17_"+data.data[0].id+"'><b>启用时间：</b>"+(data.data[0].posavtime != null && data.data[0].posavtime.indexOf("19") != 0 ? data.data[0].posavtime :"")+"</br></div>";
					if(isShowInstill){
						html +="<div><b>安装时间：</b>"+(data.data[0].installtime != null && data.data[0].installtime.indexOf("19") != 0 ? data.data[0].installtime :"")+"</br></div>";
					}
					html+="<div id='app14_"+data.data[0].id+"'><b>备注：</b>"+data.data[0].remark+"</br></div>"
					+"<div id='app19_"+data.data[0].id+"'><b>备注2：</b>"+data.data[0].remark2+"</br></div>"
					+"<div id='app15_"+data.data[0].id+"'><b>经纬度：</b>"+data.data[0].positionLast.lng+","+data.data[0].positionLast.lat+"</br></div>"
					+"<div id='app11_"+data.data[0].id+"'><b>SIM卡号：</b>"+data.data[0].simCode+"</br></div>"
					+"<div id='app2_"+data.data[0].id+"'><b>服务器时间：</b>"+data.data[0].positionLast.recvtime+"</br></div>"
					+"<div id='app12_"+data.data[0].id+"'><b>GPS时间：</b>"+data.data[0].positionLast.gpstime+"</br></div>"
					+"<div id='app3_"+data.data[0].id+"'><b>速度：</b>"+data.data[0].positionLast.speed.toFixed(1)+"km/h </br></div>"
					+"<div id='app4_"+data.data[0].id+"'><b>方向：</b>"+direction+"</br></div>"
					+"<div><b>海拔：</b>"+data.data[0].positionLast.height.toFixed(1)+"m </br></div>"
					+"<div id='app5_"+data.data[0].id+"'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+" </br></div>"
					+"<div id='app6_"+data.data[0].id+"'><b>油量：</b>"+data.data[0].positionLast.oilMN1+" L</br></div>"
					+"<div id='app7_"+data.data[0].id+"'><b>当日里程：</b>"+data.data[0].positionLast.distance+" km</br></div>"
					+"<div id='app8_"+data.data[0].id+"'><b>总里程：</b>"+data.data[0].positionLast.totalDistance+" km</br></div>"
					+"<div id='app9_"+data.data[0].id+"'><b>状态：</b>"+data.data[0].positionLast.state2+"</br></div>"
					+"<div id='app10_"+data.data[0].id+"'><b>位置：</b>"+data.data[0].positionLast.memo+"</br></div>"
					+"<div id='app13_"+data.data[0].id+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+data.data[0].id+");'><font color='#0000FF'>详细</font></a></br></div>"
					+"<a href='javascript:streeViewObject.open("+data.data[0].id+","+data.data[0].positionLast.blat+","+data.data[0].positionLast.blng+","+t+","+3+");'><font color='#0000FF'>街景</font> | </a>" +
					"<a href='gpsonline/jsp/TrackMap.jsp?carid="+data.data[0].id+"&mapType=1' target='_blank'><font color='#0000FF'>跟踪</font> | </a><a id='play_"+data.data[0].id+"' href='gpsonline/jsp/monitor/playBack.jsp?carid="+data.data[0].id+"&carname="+carname+"&icon="+data.data[0].icon+"&mapType=1' target='_blank'><font color='#0000FF'>回放</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+data.data[0].id+");\" >驾驶员</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+data.data[0].id+");\" >刷新位置</font></a> | <a id='sim_"+data.data[0].id+"' href='javascript:;'><font color='#0000FF' onclick=\"openSim("+data.data[0].simCode+");\">SIM</font> | </a>";
					if(isShowTTs){
						html += "<a href='javascript:void(0);' onclick='ttsCmd("+data.data[0].gprsCode+");'><font color='#0000FF'>TTS</font> |</a>" ;
					}
					if(isShowVideo){
						html += "<a href='javascript:void(0);' onclick='videoShow("+data.data[0].gprsCode+");'><font color='#0000FF'>视频</font> |</a>" ;
					}
					html += "<a id='more_"+data.data[0].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼</font></a></div>";
				}else{
					html =	"<div id='app_"+data.data[0].id+"' style='font-weight:normal;'>"
					+"<div id='app1_"+data.data[0].id+"'><b>设备名称：</b>"+data.data[0].vhcCode+"</br></div>"
					+"<div id='app18_"+data.data[0].id+"'><b>设备ID：</b>"+data.data[0].gprsCode+"</br></div>"
					+"<div id='app16_"+data.data[0].id+"'><b>到期时间：</b>"+(data.data[0].overduetime != null && data.data[0].overduetime.indexOf("19") != 0 ? data.data[0].overduetime :'')+"</br></div>"
					+"<div id='app17_"+data.data[0].id+"'><b>启用时间：</b>"+(data.data[0].posavtime != null && data.data[0].posavtime.indexOf("19") != 0 ? data.data[0].posavtime :"")+"</br></div>";
					if(isShowInstill){
						html +="<div><b>安装时间：</b>"+(data.data[0].installtime != null && data.data[0].installtime.indexOf("19") != 0 ? data.data[0].installtime :"")+"</br></div>";
					}
					html+="<div id='app14_"+data.data[0].id+"'><b>备注：</b>"+data.data[0].remark+"</br></div>"
					+"<div id='app19_"+data.data[0].id+"'><b>备注2：</b>"+data.data[0].remark2+"</br></div>"
					+"<div id='app15_"+data.data[0].id+"'><b>经纬度：</b>"+data.data[0].positionLast.lng+","+data.data[0].positionLast.lat+"</br></div>"
					+"<div id='app11_"+data.data[0].id+"'><b>SIM卡号：</b>"+data.data[0].simCode+"</br></div>"
					+"<div id='app2_"+data.data[0].id+"'><b>服务器时间：</b>"+data.data[0].positionLast.recvtime+"</br></div>"
					+"<div id='app12_"+data.data[0].id+"'><b>GPS时间：</b>"+data.data[0].positionLast.gpstime+"</br></div>"
					+"<div id='app3_"+data.data[0].id+"'><b>速度：</b>"+data.data[0].positionLast.speed.toFixed(1)+"km/h </br></div>"
					+"<div id='app4_"+data.data[0].id+"'><b>方向：</b>"+direction+"</br></div>"
					+"<div><b>海拔：</b>"+data.data[0].positionLast.height.toFixed(1)+"m/h </br></div>"
					+"<div id='app5_"+data.data[0].id+"'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+" </br></div>"
					+"<div id='app6_"+data.data[0].id+"'><b>油量：</b>"+data.data[0].positionLast.oilMN1+" L</br></div>"
					+"<div id='app7_"+data.data[0].id+"'><b>当日里程：</b>"+data.data[0].positionLast.distance+" km</br></div>"
					+"<div id='app8_"+data.data[0].id+"'><b>总里程：</b>"+data.data[0].positionLast.totalDistance+" km</br></div>"
					+"<div id='app9_"+data.data[0].id+"'><b>状态：</b>"+data.data[0].positionLast.state2+"</br></div>"
					+"<div id='app10_"+data.data[0].id+"'><b>位置：</b>"+data.data[0].positionLast.memo+"</br></div>"
					+"<div id='app13_"+data.data[0].id+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+data.data[0].id+");'><font color='#0000FF'>详细</font></a></br></div>"
					+"<a href='javascript:streeViewObject.open("+data.data[0].id+","+data.data[0].positionLast.blat+","+data.data[0].positionLast.blng+","+t+","+3+");'><font color='#0000FF'>街景</font> | </a><a href='gpsonline/jsp/TrackMap.jsp?carid="+data.data[0].id+"&mapType=1' target='_blank'><font color='#0000FF'>跟踪</font> | </a><a id='play_"+data.data[0].id+"' href='gpsonline/jsp/monitor/playBack.jsp?carid="+data.data[0].id+"&carname="+carname+"&icon="+data.data[0].icon+"&mapType=1' target='_blank'><font color='#0000FF'>回放</font>|</a><a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+data.data[0].id+");\" >驾驶员</font> | </a> <a id='sim_"+data.data[0].id+"' href='javascript:;' ><font color='#0000FF' onclick=\"openSim("+data.data[0].simCode+");\">SIM </font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+data.data[0].id+");\" >刷新位置</font>| </a><a id='sim_"+data.data[0].id+"' href='javascript:;' ><font color='#0000FF' onclick=\"openSim("+data.data[0].simCode+");\">SIM </font> | </a>";
					if(isShowTTs){
						html += "<a href='javascript:void(0);' onclick='ttsCmd("+data.data[0].gprsCode+");'><font color='#0000FF'>TTS</font> |</a>" ;
					}
					if(isShowVideo){
						html += "<a href='javascript:void(0);' onclick='videoShow("+data.data[0].gprsCode+");'><font color='#0000FF'>视频</font> |</a>" ;
					}
					html += "<a id='more_"+data.data[0].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼</font></a></div>";
				}

				var icon_size=real(data.data[0].icon);

				markers[k].marker.setIcon(new BMap.Icon(pngicon+image, new BMap.Size(icon_size,icon_size)));
				markers[k].infowindow.setContent(html);
				markers[k].label.setContent(markers[k].vhcCode +"("+data.data[0].positionLast.speed.toFixed(1)+"km/h"+")");
				baidMap.addOverlay(markers[k].marker);
				markers[k].marker.openInfoWindow(markers[k].infowindow);
				baidMap.removeOverlay(markers[k].label);
				if($('#isShowCarName').is(':checked')){
					baidMap.addOverlay(markers[k].label);
				}
				var WinShowParms = getCurUserWinShowParms();
				if(WinShowParms!=null){
					var app1_ = document.getElementById("app1_"+data.data[0].id);
					app1_.style.display ="none";
					var app2_ = document.getElementById("app2_"+data.data[0].id);
					app2_.style.display ="none";
					var app3_ = document.getElementById("app3_"+data.data[0].id);
					app3_.style.display ="none";
					var app4_ = document.getElementById("app4_"+data.data[0].id);
					app4_.style.display ="none";
					var app5_ = document.getElementById("app5_"+data.data[0].id);
					app5_.style.display ="none";
					var app6_ = document.getElementById("app6_"+data.data[0].id);
					app6_.style.display ="none";
					var app7_ = document.getElementById("app7_"+data.data[0].id);
					app7_.style.display ="none";
					var app8_ = document.getElementById("app8_"+data.data[0].id);
					app8_.style.display ="none";
					var app9_ = document.getElementById("app9_"+data.data[0].id);
					app9_.style.display ="none";
					var app10_ = document.getElementById("app10_"+data.data[0].id);
					app10_.style.display ="none";
					var app11_ = document.getElementById("app11_"+data.data[0].id);
					app11_.style.display ="none";
					var app12_ = document.getElementById("app12_"+data.data[0].id);
					app12_.style.display ="none";
					var app13_ = document.getElementById("app13_"+data.data[0].id);
					app13_.style.display ="none";
					var app14_ = document.getElementById("app14_"+data.data[0].id);
					app14_.style.display ="none";
					var app15_ = document.getElementById("app15_"+data.data[0].id);
					app15_.style.display ="none";
					var app16_ = document.getElementById("app16_"+data.data[0].id);
					app16_.style.display ="none";
					var app17_ = document.getElementById("app17_"+data.data[0].id);
					app17_.style.display ="none";
					var app18_ = document.getElementById("app18_"+data.data[0].id);
					app18_.style.display ="none";
					var app19_ = document.getElementById("app19_"+data.data[0].id);
					app19_.style.display ="none";
					for(var ws=0;ws<WinShowParms.length;ws++){
						if(WinShowParms[ws]==1){
							app1_.style.display ="block";
						}
						if(WinShowParms[ws]==2){
							app2_.style.display ="block";
						}
						if(WinShowParms[ws]==3){
							app3_.style.display ="block";
						}
						if(WinShowParms[ws]==4){
							app4_.style.display ="block";
						}
						if(WinShowParms[ws]==5){
							app5_.style.display ="block";
						}
						if(WinShowParms[ws]==6){
							app6_.style.display ="block";
						}
						if(WinShowParms[ws]==7){
							app7_.style.display ="block";
						}
						if(WinShowParms[ws]==8){
							app8_.style.display ="block";
						}
						if(WinShowParms[ws]==9){
							app9_.style.display ="block";
						}
						if(WinShowParms[ws]==10){
							app10_.style.display ="block";
						}
						if(WinShowParms[ws]==11){
							app11_.style.display ="block";
						}
						if(WinShowParms[ws]==12){
							app12_.style.display ="block";
						}
						if(WinShowParms[ws]==13){
							app13_.style.display ="block";
						}
						if(WinShowParms[ws]==14){
							app14_.style.display ="block";
						}
						if(WinShowParms[ws]==15){
							app15_.style.display ="block";
						}
						if(WinShowParms[ws]==16){
							app16_.style.display ="block";
						}
						if(WinShowParms[ws]==17){
							app17_.style.display ="block";
						}
						if(WinShowParms[ws]==18 && eqVisualPower.gprs){
							app18_.style.display ="block";
						}
						if(WinShowParms[ws]==19){
							app19_.style.display ="block";
						}
					}
					var app_ = document.getElementById("app_"+data.data[0].id).innerHTML;
					app_="<div id='app_"+data.data[0].id+"' style='font-weight:normal;'>"+app_+"</div>"
					markers[k].infowindow.setContent(app_);
				}
				if(!eqVisualPower.sim)$("#sim_"+data.data[0].id).hide();
				if(!eqVisualPower.play)$("#play_"+data.data[0].id).hide();
				var mo = data.data[0].vhcCode+":" + data.data[0].positionLast.memo;
				if(mo.length > 50){
					mo = mo.substring(0,50)+"...";
				}
				if(baidMap.getZoom()<13){
					baidMap.setZoom(13);
				}
				markers[k].latlng = myLatlng;
				markers[k].marker.setPosition(myLatlng);		
				markers[k].infowindow.setPosition(myLatlng);
				markers[k].label.setPosition(myLatlng);
				if(db==1){
					baidMap.setCenter(myLatlng);
				}
			}
		}
	}
//	if(usertype!="-100"){
		$(".BMap_top").append("<a href='javascript:void(0);' class='map_setting_ico' onclick='setSystemObject.openWin(1);'><span></span></a>");
//	}
}
function real(id){
	if(id == "0"){
		return 24;
	}
	if(id == "1"){
		return 24;
	}
	if(id == "2"){
		return 24;
	}
	if(id == "3"){
		return 24;
	}
	if(id == "4"){
		return 24;
	}
	if(id == "5"){
		return 24;
	}
	if(id == "6"){
		return 24;
	}
	if(id == "7"){
		return 24;
	}
	if(id == "8"){
		return 24;
	}
	if(id == "9"){
		return 32;
	}
	if(id == "10"){
		return 24;
	}
	if(id == "12"){
		return 29;
	}
};
/*function googleMap(){
	var data =carList;
	var lat = 0;
	var lng = 0;
	if(carList != "null" && carList!="" && carList!= null){
		if(data.flag==true){
			for(i=0;i<data.data.length;i++){
				if(data.data[i].positionLast.lat != 0 &&data.data[i].positionLast.lng != 0){
					lat = data.data[i].positionLast.lat;
					lng = data.data[i].positionLast.lng;
					break;
				}
			}
			if(lat==null && lng ==null){
				var mapOptions = {
						center: new google.maps.LatLng(31.23, 121.47),
						zoom: 4,
						mapTypeId: google.maps.MapTypeId.ROADMAP,
						mapTypeControlOptions: {
					mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.SATELLITE, "MAPabc"]
				}
				};
				map = new google.maps.Map(document.getElementById("map_canvas"),
						mapOptions);
				addMAPabc(map);
				var geocoder = new google.maps.Geocoder(); 
				geocoder.geocode( { 'address': remote_ip_info.city}, function(results, status) { 
					if (status == google.maps.GeocoderStatus.OK) { 
						map.setCenter(results[0].geometry.location);
						map.setZoom(8);
					} else { 
						//alert("Geocode was not successful for the following reason: " + status); 
					} 
				});
			}else{
				if(alSwitch == false){
					countDown();//每隔15秒执行函数al
					alSwitch = true;
				}
				var obj = getUserStatus();
				if(obj==null){
					mapOptions = {
							center: new google.maps.LatLng(lat,lng),
							zoom: 10,
							mapTypeId: google.maps.MapTypeId.ROADMAP,
							mapTypeControlOptions: {
						mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.SATELLITE, "MAPabc"]
					}
					};
				}else{
					var zoom;
					if(obj.bzoom == "" || obj.bzoom==null){
						zoom=6;
					}else{
						zoom=obj.bzoom-1;
					}

					mapOptions = {
							center: new google.maps.LatLng(obj.lat,obj.lng),
							zoom: zoom,
							mapTypeId: google.maps.MapTypeId.ROADMAP,
							mapTypeControlOptions: {
						mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.SATELLITE, "MAPabc"]
					}
					};
				}
				map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
				addMAPabc(map);
				for(i=0;i<data.data.length;i++){
					(function(x){
						var myLatlng = new google.maps.LatLng(data.data[x].positionLast.lat,data.data[x].positionLast.lng);
						var s=10;
						var condition=data.data[x].positionLast.state2;
						var sp = parseInt(data.data[x].positionLast.speed);
						if (condition != null) {
							if (condition.indexOf("不在线")>=0 || condition.indexOf("掉线")>=0)
								s = 2;
							else {
								if (condition.indexOf("速报警")>=0)
									s = 4;
								else if (condition.indexOf("报警")>=0)
									s = 3;
								else if (sp > 0.5)
									s = 0;
								else
									s = 1;
							}
							if (s != 4 && s != 3 && condition.indexOf("停车")>=0
									&& !condition.indexOf("不在线")>= 0)
							{
								if(condition.indexOf("停车超时")>=0){
									s = 5;	
								}else{
									s = 6;
								}
							}
						}else{
							if (sp > 0.5)
								s = 0;
							else
								s = 1;
						}
						if( data.data[i].positionLast.av == 0 ){
							s=7;
						}
						var newtime = new Date().getTime();
						var ttime =data.data[i].positionLast.recvtime.replace("-","/");
						ttime=ttime.replace("-","/");
						ttime=ttime.replace("T"," ");
						var oldtime = new Date(ttime).getTime();
						if(newtime-oldtime > 600000){
							s=2;
						}



						var state =s;
						var pngicon = "gpsonline/image/pic/"+data.data[x].icon+"/red_0.gif";
						if(state == 0) pngicon = "gpsonline/image/pic/"+data.data[x].icon+"/green_";
						else if(state == 1) pngicon = "gpsonline/image/pic/"+data.data[x].icon+"/red_";
						else if(state == 2) pngicon = "gpsonline/image/pic/"+data.data[x].icon+"/gray_";
						else if(state == 3) pngicon = "gpsonline/image/pic/"+data.data[x].icon+"/yellow_";
						else if(state == 4) pngicon = "gpsonline/image/pic/"+data.data[x].icon+"/pink_";
						else if(state == 5) pngicon = "gpsonline/image/pic/"+data.data[x].icon+"/stopalarm";
						else if(state == 7) pngicon = "gpsonline/image/pic/"+data.data[x].icon+"/blue_";
						else pngicon = "gpsonline/image/pic/"+data.data[x].icon+"/red_";
						var direction="";
						var t = parseInt(data.data[x].positionLast.direct);
						if(t>27 && t<=72){
							if(state == 5){
								var image=".gif";
							}else{
								var image="45.gif";
							}
							direction="东北";
						}else if(t>72 && t<=117){
							if(state == 5){
								var image=".gif";
							}else{
								var image="90.gif";
							}

							direction="东";
						}
						else if(t>117 && t<=162){
							if(state == 5){
								var image=".gif";
							}else{
								var image="135.gif";
							}
							direction="东南";
						}
						else if(t>162 && t<=207){
							if(state == 5){
								var image=".gif";
							}else{
								var image="180.gif";
							}
							direction="南";
						}
						else if(t>207 && t<=252){
							if(state == 5){
								var image=".gif";
							}else{
								var image="225.gif";
							}
							direction="西南";
						}
						else if(t>252 && t<=297){
							if(state == 5){
								var image=".gif";
							}else{
								var image="270.gif";
							}
							direction="西";
						}
						else if(t>297 && t<=342){
							if(state == 5){
								var image=".gif";
							}else{
								var image="315.gif";
							}
							direction="西北";
						}
						else {
							if(state == 5){
								var image=".gif";
							}else{
								var image="0.gif";
							}
							direction="北";
						}

						var icon_size=real(data.data[x].icon);
						var marker = new google.maps.Marker({
							position: myLatlng,
							map: map,
							icon: new google.maps.MarkerImage(pngicon+image, new google.maps.Size(icon_size, icon_size),new google.maps.Point(0,0),new google.maps.Point(10, 10)),
							title:data.data[x].vhcCode
						});
						var carname = encodeURI(encodeURI(data.data[x].vhcCode)); 
						markersArray.push(marker);

						var temp,temp1,temp2,temp3,temp4;
						if(data.data[x].positionLast.temperature != null && data.data[x].positionLast.temperature <=127){
							temp=data.data[x].positionLast.temperature +" ℃";
						}else{
							temp="无效";
						}
						if(data.data[x].positionLast.temp1 != null && data.data[x].positionLast.temp1 <=127){
							temp1=data.data[x].positionLast.temp1 +" ℃";
						}else{
							temp1="无效";
						}
						if(data.data[x].positionLast.temp2 != null && data.data[x].positionLast.temp2 <=127){
							temp2=data.data[x].positionLast.temp2 +" ℃";
						}else{
							temp2="无效";
						}
						if(data.data[x].positionLast.temp3 != null && data.data[x].positionLast.temp3 <=127){
							temp3=data.data[x].positionLast.temp3 +" ℃";
						}else{
							temp3="无效";
						}
						if(data.data[x].positionLast.temp4 != null && data.data[x].positionLast.temp4 <=127){
							temp4=data.data[x].positionLast.temp4 +" ℃";
						}else{
							temp4="无效";
						}
						var contentString = "";	
						if(isHasPBackAut()){
							contentString = "<div id='app_"+data.data[x].id+"'><p>"+
							"<div id='app1_"+data.data[x].id+"' style='display:block'><b>设备名称：</b>"+data.data[x].vhcCode+"</br></div>"
							+"<div id='app18_"+data.data[x].id+"' style='display:block'><b>设备ID：</b>"+data.data[x].gprsCode+"</br></div>"
							+"<div id='app16_"+data.data[x].id+"' style='display:block'><b>到期时间：</b>"+(data.data[x].overduetime != null && data.data[x].overduetime.indexOf("19") != 0 ? data.data[x].overduetime:"")+"</br></div>"
							+"<div id='app17_"+data.data[x].id+"' style='display:block'><b>启用时间：</b>"+(data.data[x].posavtime != null && data.data[x].posavtime.indexOf("19") != 0 ? data.data[x].posavtime :"")+"</br></div>"

							+"<div id='app14_"+data.data[x].id+"' style='display:block'><b>备注：</b>"+data.data[x].remark+"</br></div>"
							+"<div id='app15_"+data.data[x].id+"' style='display:block'><b>经纬度：</b>"+data.data[x].positionLast.lng+","+data.data[x].positionLast.lat+"</br></div>"
							+"<div id='app11_"+data.data[x].id+"' style='display:block'><b>SIM卡号：</b>"+data.data[x].simCode+"</br></div>"
							+"<div id='app2_"+data.data[x].id+"' style='display:block'><b>服务器时间：</b>"+data.data[x].positionLast.recvtime+"</br></div>"
							+"<div id='app12_"+data.data[x].id+"' style='display:block'><b>GPS时间：</b>"+data.data[x].positionLast.recvtime+"</br></div>"
							+"<div id='app3_"+data.data[x].id+"' style='display:block'><b>速度：</b>"+data.data[x].positionLast.speed+" km/h </br></div>"
							+"<div id='app4_"+data.data[x].id+"' style='display:block'><b>方向：</b>"+direction+"</br></div>"
							+"<div id='app5_"+data.data[x].id+"' style='display:block'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+" </br></div>"
							+"<div id='app6_"+data.data[x].id+"' style='display:block'><b>油量：</b>"+data.data[x].positionLast.oilMN1+" L</br></div>"
							+"<div id='app7_"+data.data[x].id+"' style='display:block'><b>当日里程：</b>"+data.data[x].positionLast.distance+" km</br></div>"
							+"<div id='app8_"+data.data[x].id+"' style='display:block'><b>总里程：</b>"+data.data[x].positionLast.totalDistance+" km</br></div>"
							+"<div id='app9_"+data.data[x].id+"' style='display:block'><b>状态：</b>"+data.data[x].positionLast.state2+"</br></div>"
							+"<div id='app10_"+data.data[x].id+"' style='display:block'><b>位置：</b>"+data.data[x].positionLast.memo+"</br></div>"
							+"<div id='app13_"+data.data[x].id+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+data.data[x].id+");'><font color='#0000FF'>详细</font></a></br></div>"
							+"<a href='javascript:streeViewObject.open("+data.data[x].id+","+data.data[x].positionLast.lat+","+data.data[x].positionLast.lng+","+t+","+5+");'><font color='#0000FF'>街景</font> | </a><a href='"+url+"gpsonline/jsp/TrackMap.jsp?carid="+data.data[x].id+"&mapType=2' target='_blank'><font color='#0000FF'>跟踪</font> | </a><a href='"+url+"gpsonline/jsp/monitor/playBack.jsp?carid="+data.data[x].id+"&carname="+carname+"&icon="+data.data[x].icon+"' target='_blank'><font color='#0000FF'>回放</font> | </a>  <a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+data.data[x].id+");\" >驾驶员</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+data.data[x].id+");\" >刷新位置</font> | </a> <a id='more_"+data.data[x].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼</font></a></p></div>";

						}else{
							contentString = "<div id='app_"+data.data[x].id+"'><p>"+
							"<div id='app1_"+data.data[x].id+"' style='display:block'><b>设备名称：</b>"+data.data[x].vhcCode+"</br></div>"
							+"<div id='app18_"+data.data[x].id+"' style='display:block'><b>设备ID：</b>"+data.data[x].gprsCode+"</br></div>"
							+"<div id='app16_"+data.data[x].id+"' style='display:block'><b>到期时间：</b>"+(data.data[x].overduetime != null && data.data[x].overduetime.indexOf("19") != 0 ? data.data[x].overduetime:"")+"</br></div>"
							+"<div id='app17_"+data.data[x].id+"' style='display:block'><b>启用时间：</b>"+(data.data[x].posavtime != null && data.data[x].posavtime.indexOf("19") != 0 ? data.data[x].posavtime :"")+"</br></div>"

							+"<div id='app14_"+data.data[x].id+"' style='display:block'><b>备注：</b>"+data.data[x].remark+"</br></div>"
							+"<div id='app15_"+data.data[x].id+"' style='display:block'><b>经纬度：</b>"+data.data[x].positionLast.lng+","+data.data[x].positionLast.lat+"</br></div>"
							+"<div id='app11_"+data.data[x].id+"' style='display:block'><b>SIM卡号：</b>"+data.data[x].simCode+"</br></div>"
							+"<div id='app2_"+data.data[x].id+"' style='display:block'><b>服务器时间：</b>"+data.data[x].positionLast.recvtime+"</br></div>"
							+"<div id='app12_"+data.data[x].id+"' style='display:block'><b>GPS时间：</b>"+data.data[x].positionLast.recvtime+"</br></div>"
							+"<div id='app3_"+data.data[x].id+"' style='display:block'><b>速度：</b>"+data.data[x].positionLast.speed+" km/h </br></div>"
							+"<div id='app4_"+data.data[x].id+"' style='display:block'><b>方向：</b>"+direction+"</br></div>"
							+"<div id='app5_"+data.data[x].id+"' style='display:block'><b>温度：</b>"+temp+" | <b>温度1：</b>"+temp1+" | <b>温度2：</b>"+temp2+" | <b>温度3：</b>"+temp3+" | <b>温度4：</b>"+temp4+" </br></div>"
							+"<div id='app6_"+data.data[x].id+"' style='display:block'><b>油量：</b>"+data.data[x].positionLast.oilMN1+" L</br></div>"
							+"<div id='app7_"+data.data[x].id+"' style='display:block'><b>当日里程：</b>"+data.data[x].positionLast.distance+" km</br></div>"
							+"<div id='app8_"+data.data[x].id+"' style='display:block'><b>总里程：</b>"+data.data[x].positionLast.totalDistance+" km</br></div>"
							+"<div id='app9_"+data.data[x].id+"' style='display:block'><b>状态：</b>"+data.data[x].positionLast.state2+"</br></div>"
							+"<div id='app10_"+data.data[x].id+"' style='display:block'><b>位置：</b>"+data.data[x].positionLast.memo+"</br></div>"
							+"<div id='app13_"+data.data[x].id+"'><b>OBD/CAN数据：</b><a href='javascript:opobd("+data.data[x].id+");'><font color='#0000FF'>详细</font></a></br></div>"
							+"<a href='javascript:streeViewObject.open("+data.data[x].id+","+data.data[x].positionLast.lat+","+data.data[x].positionLast.lng+","+t+","+5+");'><font color='#0000FF'>街景</font> | </a><a href='"+url+"gpsonline/jsp/TrackMap.jsp?carid="+data.data[x].id+"&mapType=2' target='_blank'><font color='#0000FF'>跟踪</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"openDriverInfo("+data.data[x].id+");\" >驾驶员</font> | </a> <a href='javascript:;' ><font color='#0000FF' onclick=\"updateWeizhi("+data.data[x].id+");\" >刷新位置</font> | </a> <a id='more_"+data.data[x].id+"' href='javascript:;' onclick=\"showSecondMenu(this,event);\"><font color='#0000FF'>更多▼</font></a></p></div>";
						}




						//infowindow.setContent(contentString);
						var infowindow = new google.maps.InfoWindow({
							content: contentString
							//,zIndex:10
						});
						/* google.maps.event.addListener(marker, 'click', function() {
		    infowindow.open(map,marker);
		  });



						//var infowindow = new InfoBox(myOptions);
						google.maps.event.addListener(marker, "click", function (e) {
							//alert($(boxText).css("height"));
							//	$("#1_"+data.data[x].id).hide();

							markerObject.closeInfowindow();//关闭打开的标注弹出框

							if(menu!=null){
								menu.hide();
							}

							for(var i=0;i<vehicles.length;i++){
								vehicles[i].infowindow.close();
							}		
							centerMap(data.data[x].id,null,null)
							/*		    
			infowindow.open(map, this);
			var WinShowParms = getCurUserWinShowParms();
			//alert(WinShowParms);
			if(WinShowParms!=null){
				var app1_ = document.getElementById("app1_"+data.data[x].id);
				if(app1_ != null){
					app1_.style.display ="none";
					var app2_ = document.getElementById("app2_"+data.data[x].id);
					app2_.style.display ="none";
					var app3_ = document.getElementById("app3_"+data.data[x].id);
					app3_.style.display ="none";
					var app4_ = document.getElementById("app4_"+data.data[x].id);
					app4_.style.display ="none";
					var app5_ = document.getElementById("app5_"+data.data[x].id);
					app5_.style.display ="none";
					var app6_ = document.getElementById("app6_"+data.data[x].id);
					app6_.style.display ="none";
					var app7_ = document.getElementById("app7_"+data.data[x].id);
					app7_.style.display ="none";
					var app8_ = document.getElementById("app8_"+data.data[x].id);
					app8_.style.display ="none";
					var app9_ = document.getElementById("app9_"+data.data[x].id);
					app9_.style.display ="none";
					var app10_ = document.getElementById("app10_"+data.data[x].id);
					app10_.style.display ="none";
					var app11_ = document.getElementById("app11_"+data.data[x].id);
					app11_.style.display ="none";
					var app12_ = document.getElementById("app12_"+data.data[x].id);
					app12_.style.display ="none";
					var app13_ = document.getElementById("app13_"+data.data[x].id);
					app13_.style.display ="none";
					var app14_ = document.getElementById("app14_"+data.data[x].id);
					app14_.style.display ="none";
					var app15_ = document.getElementById("app15_"+data.data[x].id);
					app15_.style.display ="none";


					for(var ws=0;ws<WinShowParms.length;ws++){
			      		if(WinShowParms[ws]==1){
			      			app1_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==2){
			      			app2_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==3){
			      			app3_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==4){
			      			app4_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==5){
			      			app5_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==6){
			      			app6_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==7){
			      			app7_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==8){
			      			app8_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==9){
			      			app9_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==10){
			      			app10_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==11){
			      			app11_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==12){
			      			app12_.style.display ="block";
			      		}
			      		if(WinShowParms[ws]==13){
			      			app13_.style.display ="block";
			      		}
		      			if(WinShowParms[ws]==14){
			      			app14_.style.display ="block";
			      		}
		      			if(WinShowParms[ws]==15){
			      			app15_.style.display ="block";
			      		}
			      	}
			      	var app_ = document.getElementById("app_"+data.data[x].id);
					infowindow.setContent(app_);
				}

			}



							//document.getElementById('weizhi').innerHTML = data.data[x].vhcCode+"： " + data.data[x].positionLast.memo;
							//document.getElementById('weizhi').title = data.data[x].vhcCode+"： " + data.data[x].positionLast.memo;

							msgid= data.data[x].id;
							msgname= data.data[x].vhcCode;

						});
						var vehicle = new Object();
						vehicle.id = data.data[x].id;
						vehicle.vhcCode = data.data[x].vhcCode;
						vehicle.label = new LableMarker(map,data.data[x].vhcCode,myLatlng);
						//vehicle.label.setMap(null);
						vehicle.marker = marker;
						vehicle.icon = data.data[x].icon;
						vehicle.infowindow = infowindow;
						vehicle.latlng = myLatlng;
						vehicle.simCode = data.data[x].simCode;
						if(data.data[x].positionLast.lat == 0 &&data.data[x].positionLast.lng == 0){
							//vehicle.marker.setMap(null);
							//vehicle.label.setMap(null);
						}
						vehicles.push(vehicle);
					})(i);
				}	
			}
		}
	}else{
		var obj = getUserStatus();
		if(obj==null){
			var mapOptions = {
					center: new google.maps.LatLng(31.23, 121.47),
					zoom: 4,
					mapTypeId: google.maps.MapTypeId.ROADMAP,
					mapTypeControlOptions: {
				mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.SATELLITE, "MAPabc"]
			}
			};
			map = new google.maps.Map(document.getElementById("map_canvas"),
					mapOptions);
			addMAPabc(map);
			var geocoder = new google.maps.Geocoder(); 
			geocoder.geocode( { 'address': remote_ip_info.city}, function(results, status) { 
				if (status == google.maps.GeocoderStatus.OK) { 
					map.setCenter(results[0].geometry.location);
					map.setZoom(8);
				} else { 

				} 
			}); 
		}else{
			var zoom;

			if(obj.bzoom == "" || obj.bzoom==null){
				zoom=6;
			}else{
				zoom=obj.bzoom-1;
			}
			var mapOptions = {
					center: new google.maps.LatLng(obj.lat,obj.lng),
					zoom: zoom,
					mapTypeId: google.maps.MapTypeId.ROADMAP,
					mapTypeControlOptions: {
				mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.SATELLITE, "MAPabc"]
			}
			};
			map = new google.maps.Map(document.getElementById("map_canvas"),
					mapOptions);
			addMAPabc(map);
		}	

	}
	google.maps.event.addListener(map, 'drag', function(){
		clearTimeout(yanchiAl);
		yanchiAl=setTimeout("al()",500);
	});
}*/