function GetPointStyle()
{
	var o = new MStyle();
	o.lineColor = 0xff230b;
	o.lineSize = 2;
	o.fillColor = 0xffffff;
	o.fillOpacity = 100;
	o.labelColor = 0xffffff;
	o.isShowLabels = false;
	o.isShowTip = true;
	o.textSize = 13;
	o.isLabelsFontBold = false;
	o.backgroundColor = 0xff230b;
	o.isLabelsBackground = false;
	o.textColor = 0xffffff;
	return o;
}

function DrawPointOnMap_ViewPoints_Pic(x,y,smallpic,bigpic,bigpicwidth,bigpicheight,bigpicurl,piccity,filename,pictitle,id)
{
	bigpicwidth=parseInt(bigpicwidth);
	bigpicheight=parseInt(bigpicheight);
	var centerPointStyle = GetPointStyle();
	//var sContent = "图片:"+pictitle+"<br>";
	var sContent = "";
	if(bigpicwidth>200||bigpicheight>200){
		var rate = bigpicwidth/200;
		bigpicwidth = 200;
		bigpicheight = parseInt(bigpicheight/rate);
	}
	sContent += "<br><a href=\"" + bigpicurl + "\" target=\"_self\"><img src=\"" + bigpic + "\" width=\"" + bigpicwidth + "\" height=\"" + bigpicheight + "\" /></a>";
	sContent += "<p><a href=\"javascript:ActionOfPointsOnMap(1,'"+x+"','"+y+"','"+piccity+"','"+filename+"','pic');\">到此处</a></p>"+"<p><a href=\"javascript:ActionOfPointsOnMap(2,'"+x+"','"+y+"','"+piccity+"','"+filename+"','pic');\">从此处去</a></p>"+"<p><a href=\"javascript:ActionOfPointsOnMap(3,'"+x+"','"+y+"','"+piccity+"','"+filename+"','pic');\">周边</a></p>";
	centerPointStyle.textContent = sContent;
	var centerPoint = new MCustomPointOverlay(new MLatLng(x, y), smallpic, centerPointStyle, id);
	mapObj.addOverlay(centerPoint,true);
}

function DrawPointOnMap_ViewPoints_Place(x,y,placename,placeaddress,placedescription,userspace,placecity,id)
{
	var centerPointStyle = GetPointStyle();
	var icon = 'http://www.soupianer.com/sp_image/default.png';
	//var sContent = placename+"<br>"+placeaddress+"<br>"+placedescription+"<br>"+userspace+"<br>";
	var sContent = placename+"<br>"+placeaddress;
	sContent += "<br><a href=\"javascript:ActionOfPointsOnMap(1,'"+x+"','"+y+"','"+placecity+"','"+placeaddress+"','pic');\">到此处</a>  "+"<a href=\"javascript:ActionOfPointsOnMap(2,'"+x+"','"+y+"','"+placecity+"','"+placeaddress+"','pic');\">从此处去</a>  "+"<a href=\"javascript:ActionOfPointsOnMap(3,'"+x+"','"+y+"','"+placecity+"','"+placeaddress+"','pic');\">周边</a><br>";
	centerPointStyle.textContent = sContent;
	var centerPoint = new MCustomPointOverlay(new MLatLng(x, y), icon, centerPointStyle, id);
	mapObj.addOverlay(centerPoint,true);
}

function DrawPointOnMap_ViewPoints_HD(x,y,hdname,hdaddress,hddescription,hdstartdate,userspace,hdcity,id,icontype)
{
	var centerPointStyle = GetPointStyle();
	icontype = parseInt(icontype);
	var icon = GetIconUsedOnMap(icontype);
	//var sContent = hdname+"<br>"+hdaddress+"<br>"+hddescription+"<br>"+userspace+"<br>";
	var sContent = hdname+"<br>"+hdaddress;
	sContent += "<br><a href=\"javascript:ActionOfPointsOnMap(1,'"+x+"','"+y+"','"+hdcity+"','"+hdaddress+"','pic');\">到此处</a>  "+"<a href=\"javascript:ActionOfPointsOnMap(2,'"+x+"','"+y+"','"+hdcity+"','"+hdaddress+"','pic');\">从此处去</a>  "+"<a href=\"javascript:ActionOfPointsOnMap(3,'"+x+"','"+y+"','"+hdcity+"','"+hdaddress+"','pic');\">周边</a><br>";
	centerPointStyle.textContent = sContent;
	var centerPoint = new MCustomPointOverlay(new MLatLng(x, y), icon, centerPointStyle, id);
	mapObj.addOverlay(centerPoint,true);
}

function DrawPointOnMap_ViewPoints_Doing(x,y,message,id)
{
	var centerPointStyle = GetPointStyle();
	icontype = 0;
	var icon = GetIconUsedOnMap(icontype);
	//var sContent = hdname+"<br>"+hdaddress+"<br>"+hddescription+"<br>"+userspace+"<br>";
	var sContent = message;
	//sContent += "<br><a href=\"javascript:ActionOfPointsOnMap(1,'"+x+"','"+y+"','"+hdcity+"','"+hdaddress+"','pic');\">到此处</a>  "+"<a href=\"javascript:ActionOfPointsOnMap(2,'"+x+"','"+y+"','"+hdcity+"','"+hdaddress+"','pic');\">从此处去</a>  "+"<a href=\"javascript:ActionOfPointsOnMap(3,'"+x+"','"+y+"','"+hdcity+"','"+hdaddress+"','pic');\">周边</a><br>";
	centerPointStyle.textContent = sContent;
	var centerPoint = new MCustomPointOverlay(new MLatLng(x, y), icon, centerPointStyle, id);
	mapObj.addOverlay(centerPoint,true);
}

function DrawPointOnMap_Space_Album_Pic(x,y,piccity,filename,id)
{
	var centerPointStyle = GetPointStyle();
	var icon = 'http://www.soupianer.com/sp_image/default.png';
	var sContent = "<a href=\"javascript:ActionOfPointsOnMap(1,'"+x+"','"+y+"','"+piccity+"','"+filename+"','pic');\">到此处</a>  "+"<a href=\"javascript:ActionOfPointsOnMap(2,'"+x+"','"+y+"','"+piccity+"','"+filename+"','pic');\">从此处去</a>  "+"<a href=\"javascript:ActionOfPointsOnMap(3,'"+x+"','"+y+"','"+piccity+"','"+filename+"','pic');\">周边</a><br>";
	centerPointStyle.textContent = sContent;
	var centerPoint = new MCustomPointOverlay(new MLatLng(x, y), icon, centerPointStyle, id);
	mapObj.addOverlay(centerPoint,true);
}

function DrawPointOnMap_Place_Edit(x,y,id)
{
	var centerPoint = new MDragablePointWithoutTip(new MLatLng(x, y), new MStyle(), id);
	mapObj.addOverlay(centerPoint,true);
}

function ActionOfPointsOnMap(ac,y,x,cityname,address,pointtype)
{
	var citycode = getcitycodethroughcityname(cityname);
	var cityname = encodeURIComponent(filterContentbystr(cityname));
	var address = encodeURIComponent(filterContentbystr(address));
	if(ac==1||ac==2||ac==3){
		url = ("map.php?t="+ac+"&c="+citycode+"&x="+x+"&y="+y+"&s=1&cn="+cityname+"&addr="+address);
		window.location=url;
	}
}

function SetDragablePoint(x,y)
{
	mapObj.removeAllOverlays();
	var Point = new MDragablePointWithoutTip(new MLatLng(y,x),new MStyle(),5000);
	mapObj.addOverlay(Point,true);
}

function GetIconUsedOnMap(a){var icon='';if(a==0){icon='default';}else if(a==1){icon='dine';}else if(a==2){icon='wild';}else if(a==3){icon='show';}else if(a==4){icon='exhibit';}else if(a==5){icon='music';}else if(a==6){icon='salon';}else if(a==7){icon='gym';}else if(a==8){icon='gongyi';}if(icon!=''){return 'http://soupianer.autonavi.com/sp_image/'+icon+'.png';}else{alert('缺少预置图片!');}} 
