mapObj.removeEventListener(MMap.EVENT_GEOMETRY_CHANGED,pointMoved); 
mapObj.addEventListener(MMap.EVENT_GEOMETRY_CHANGED,geometryChanged);
//mapObj.addEventListener(MMap.EVENT_ON_GEOMETRY_CLICK,pointClicked);
function pointClicked(event){
	alert(event.args);
}
var editPitchonStyleid='';
var uploadtempGtype='';
function createPoint(){
	mapObj.addGeometry(MGeometry.TYPE_POINT);
}
function createPolyline(){
	var polylineStyle=new MStyle();
	polylineStyle.lineColor=0x0000ff;
	polylineStyle.lineSize=5;
	polylineStyle.lineOpacity=50;
	mapObj.addGeometry(MGeometry.TYPE_POLYLINE,polylineStyle);
}
function createPolygon(){
	var polygonStyle=new MStyle();
	polygonStyle.lineColor=0xffffff;
	polygonStyle.lineSize=3;
	polygonStyle.lineOpacity=80;
	polygonStyle.fillOpacity=50;
	polygonStyle.fillColor=0x0000ff;
	mapObj.addGeometry(MGeometry.TYPE_POLYGON,polygonStyle);
}
function exportMapData(event){
	mapObj.exportMapData();
}
function getCenterByLatLng(){
	var center=mapObj.getCenterByLatLng();
	return center;
}
function getZoomLevel(){
	return mapObj.getZoomLevel();
}
function exportMapData(event){
	mapObj.exportMapData();
}
function onexportMapData(event){
	var mymaps_center=getCenterByLatLng();
	var mymaps_zoom=getZoomLevel();
	var mymaps_save=event.args.substring(8,event.args.length);//截取前11个无效字符,使其符合JSON格式
	var tempTitle=$('my_title_edit').value;
	var tempTags=$('map_tags').value;
	var tempDescription=$('my_synopsis_edit').value;
	if(tempDescription.length>=1000){
		tempDescription=tempDescription.substring(0,1000);
		$('my_synopsis_edit').value=tempDescription;
	}else{}
	if(tempTitle==''||tempTitle==null||tempTitle==' '){
		tempTitle='标题未命名。';
		$('my_title_edit').value='标题未命名。';
	}else{}
	if(tempTags==''||tempTags==null||tempTags==' '){
		tempTags='炫地图';
		$('map_tags').value='炫地图';
	}else{}
	if(tempDescription==''||tempDescription==null||tempDescription==' '){
		tempDescription='描述暂无内容。';
		$('my_synopsis_edit').value='描述暂无内容。';
	}else{}
	document.getElementById('mydiydata').value=mymaps_save;
	document.getElementById('mymapname').value=document.getElementById('my_title_edit').value;
	document.getElementById('mymapdescription').value=document.getElementById('my_synopsis_edit').value;
	$('savediyform').submit();
}
function openUploadWindow(gtype,serialId,uploadtype){
	var thiseditid=editPitchonStyleid=serialId;
	switch(uploadtype){
		case 'file':
			o="<a style=\"display:none;\" id=\"status\" onclick=\"ajaxmenu(event,this.id,99999,'',-1)\"></a>";
			SetInnerHTML('savestatus',o);
			OpenStatusMenu(33);
			break;
		case 'url':
			o="<a style=\"display:none;\" id=\"status\" onclick=\"ajaxmenu(event,this.id,99999,'',-1)\"></a>";
			SetInnerHTML('savestatus',o);
			OpenStatusMenu(35);
			break;
		default:{}
	}
}
function submitPictureURL(url,description){
	url=[url] ;
	description=[description];
	mapObj.submitPictureURL(uploadtempGtype,editPitchonStyleid,url,description);
}
function ckPicSubmit(){
	return true;
}
var ctrlDetail=0;
function geometryCreated(event){
	if(ctrlDetail==0){
		$('detaillistarea').style.height="327px";
		$('detaillistarea').style.overflow='auto';
		$('detaillistarea').style.background='#F7F7F7';
	}
	ctrlDetail++;
	document.getElementById('submitbt').style.display='';
	var created=event.args.substring(8,event.args.length);
	var createdJson=eval('('+created+')');
	switch(createdJson.geometryType){
		case 'pp_mc':
			var geturl=judgeFlash(createdJson.geometryData.icoUrl);
				switch(geturl){
					case 'png':
					document.getElementById('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+createdJson.geometryData.serialid+"_d','"+createdJson.geometryType+"','on')\"  id="+createdJson.geometryData.serialid+" ><div class=\"xmll\"><img src=\""+createdJson.geometryData.icoUrl+"\"  /></div><div id=\""+createdJson.geometryData.serialid+"_d\" class=\"xmlr\" ><h1>"+createdJson.geometryData.titles+"</h1>"+createdJson.geometryData.notStyleContent.substring(0, 60)+"<p class=\"xmltools\"><a href=\"javascript:editGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >删除</a></p></div></div>");
					break;
					case 'swf':
					document.getElementById('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+createdJson.geometryData.serialid+"_d','"+createdJson.geometryType+"','on')\"  id="+createdJson.geometryData.serialid+" ><div class=\"xmll\"><EMBED align=middle src=\""+createdJson.geometryData.icoUrl+"\" width=36 height=36 type=application/x-shockwave-flash  QUALITY=\"high\" BGCOLOR=\"#FFFFFF\"></EMBED></div><div id=\""+createdJson.geometryData.serialid+"_d\" class=\"xmlr\" ><h1>"+createdJson.geometryData.titles+"</h1>"+createdJson.geometryData.notStyleContent.substring(0, 60)+"<p class=\"xmltools\"><a href=\"javascript:editGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >删除</a></p></div></div>");
					break;
				}
			edit_div_name=createdJson.geometryData.serialid;
			editPitchonStyle(createdJson.geometryData.serialid+'_d',createdJson.geometryType,'off');
			break;
		case 'section_mc':
			$('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+createdJson.geometryData.serialid+"_z','"+createdJson.geometryType+"','on')\" id="+createdJson.geometryData.serialid+" ><div class=\"xmll\"><hr width=\"30\" size=\""+createdJson.geometryData.line_size+"\" color=\"#"+formatColor((createdJson.geometryData.lineColor).toString(16))+"\" style=\"display:inline;vertical-align:middle;filter:alpha(opacity="+createdJson.geometryData.lineOpacity+");opacity:"+createdJson.geometryData.lineOpacity/100+";\" noshade /></div><div class=\"xmlr\"  id=\""+createdJson.geometryData.serialid+"_z\" ><h1>"+createdJson.geometryData.titles+"</h1>"+createdJson.geometryData.notStyleContent.substring(0, 60)+"<p class=\"xmltools\"><a href=\"javascript:editGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >删除</a></p></div></div>");
			edit_div_name=createdJson.geometryData.serialid;
			editPitchonStyle(createdJson.geometryData.serialid+'_z',createdJson.geometryType,'off');
			break;
		case 'polygon_mc':
		     $('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+createdJson.geometryData.serialid+"_m','"+createdJson.geometryType+"','on')\"  id="+createdJson.geometryData.serialid+" ><div class=\"xmll\"><span class=\"areaimg\" style=\"background:#"+formatColor((createdJson.geometryData.fillColor).toString(16))+";border:"+createdJson.geometryData.line_size+"px solid  #"+formatColor((createdJson.geometryData.lineColor).toString(16))+";filter:alpha(opacity="+createdJson.geometryData.fillOpacity+");opacity:"+createdJson.geometryData.fillOpacity/100+";\"></span></div><div class=\"xmlr\"  id=\""+createdJson.geometryData.serialid+"_m\" ><h1>"+createdJson.geometryData.titles+"</h1>"+createdJson.geometryData.notStyleContent.substring(0, 60)+"<p class=\"xmltools\"><a href=\"javascript:editGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >删除</a></p></div></div>");
			edit_div_name=createdJson.geometryData.serialid;
			editPitchonStyle(createdJson.geometryData.serialid+'_m',createdJson.geometryType,'off');
			break;
		$('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"eprl\"></div>");
	}
	if($('mymaps_title').innerHTML!=''){
		ShowObj('savediyform_btn');
	}
	ShowObj('detaillistarea');
}
function geometryChanged(event){
	var created=event.args.substring(8,event.args.length);
	var createdJson=eval('('+created+')');
	switch(createdJson.geometryType){
		case 'pp_mc':
			var geturl=judgeFlash(createdJson.geometryData.icoUrl);
			switch(geturl){
					case 'png':
					$(createdJson.geometryData.serialid).innerHTML="<div class=\"xmll\"><img src=\""+createdJson.geometryData.icoUrl+"\" /></div><div class=\"xmlr\" id=\""+createdJson.geometryData.serialid+"_d\" ><h1>"+createdJson.geometryData.titles+"</h1>"+createdJson.geometryData.notStyleContent.substring(0, 60)+"<p class=\"xmltools\"><a href=\"javascript:editGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >删除</a></p></div>";
					break;
					case 'swf':
					$(createdJson.geometryData.serialid).innerHTML="<div class=\"xmll\"><EMBED align=middle src=\""+createdJson.geometryData.icoUrl+"\" width=36 height=36 type=application/x-shockwave-flash  QUALITY=\"high\" BGCOLOR=\"#FFFFFF\"></EMBED></div><div id=\""+createdJson.geometryData.serialid+"_d\" class=\"tit\" ><h1>"+createdJson.geometryData.titles+"</h1>"+createdJson.geometryData.notStyleContent.substring(0, 60)+"<p class=\"xmltools\"><a href=\"javascript:editGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >删除</a></p></div>";
					break;
				}
			break;
		case 'section_mc':
			$(createdJson.geometryData.serialid).innerHTML="<div class=\"xmll\"><hr width=\"30\" size=\""+createdJson.geometryData.line_size+"\" color=\"#"+formatColor((createdJson.geometryData.lineColor).toString(16))+"\" style=\"display:inline;vertical-align:middle;filter:alpha(opacity="+createdJson.geometryData.lineOpacity+");opacity:"+createdJson.geometryData.lineOpacity/100+";\" noshade /></div><div class=\"xmlr\"  id=\""+createdJson.geometryData.serialid+"_z\" ><h1>"+createdJson.geometryData.titles+"</h1>"+createdJson.geometryData.notStyleContent.substring(0, 60)+"<p class=\"xmltools\"><a href=\"javascript:editGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >删除</a></p></div>";
			break;
		case 'polygon_mc':
		     $(createdJson.geometryData.serialid).innerHTML="<div class=\"xmll\"><span class=\"areaimg\" style=\"background:#"+formatColor((createdJson.geometryData.fillColor).toString(16))+";border:"+createdJson.geometryData.line_size+"px solid  #"+formatColor((createdJson.geometryData.lineColor).toString(16))+";filter:alpha(opacity="+createdJson.geometryData.fillOpacity+");opacity:"+createdJson.geometryData.fillOpacity/100+";\"></span></div><div class=\"xmlr\"  id=\""+createdJson.geometryData.serialid+"_m\" ><h1>"+createdJson.geometryData.titles+"</h1>"+createdJson.geometryData.notStyleContent.substring(0, 60)+"<p class=\"xmltools\"><a href=\"javascript:editGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+createdJson.geometryData.serialid+"','"+createdJson.geometryType+"')\" >删除</a></p></div>";
			break;
	}
	if($('mymaps_title').innerHTML==''){
		HideObj('savediyform_btn');
	}
}
function InsertImportDate2Edit(data,type){
	//检测传入data的坐标是否为空，为空则不加载
	//"coordX":[],"coordY":[]
	if(data.indexOf('"coordX":[]')>=0 || data.indexOf('"coordY":[]')>=0){
		alert('检测到您的路径数据为空，试试编辑您的炫地图吧~');
		return;
	}
	mapObj.importMapData(data);
	data=data.replace(new RegExp('gType',"gm"),'geometryType');
	data=data.substring(1,(data.length-1));
	var splitword="\"},";
	var gArray=data.split(splitword);
	for(i=0;i<gArray.length;i++){
		var thisGstr='';
		var thisGjson='';
		if(i==(gArray.length-1)){
			var thisGstr=gArray[i];
		}else{
			var thisGstr=(gArray[i]+"\"}");
		}
	var thisGjson=eval("("+thisGstr+")");
	switch(thisGjson.geometryType){
		case 'pp_mc':
			var geturl=judgeFlash(thisGjson.icoUrl);
				switch(geturl){
					case 'png':
					if(type=='free'){
						document.getElementById('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+thisGjson.serialid+"_d','"+thisGjson.geometryType+"','on')\"  id="+thisGjson.serialid+" ><div class=\"xmll\"><img src=\""+thisGjson.icoUrl+"\"  /></div><div id=\""+thisGjson.serialid+"_d\" class=\"tit\" ><h1>"+thisGjson.titles+"</h1>"+thisGjson.notStyleContent.substring(0,60)+"<br /></div></div>");
					}else{
						document.getElementById('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+thisGjson.serialid+"_d','"+thisGjson.geometryType+"','on')\"  id="+thisGjson.serialid+" ><div class=\"xmll\"><img src=\""+thisGjson.icoUrl+"\"  /></div><div id=\""+thisGjson.serialid+"_d\" class=\"tit\" ><h1>"+thisGjson.titles+"</h1>"+thisGjson.notStyleContent.substring(0,60)+"<br /><p class=\"xmltools\"><a href=\"javascript:editGeometry('"+thisGjson.serialid+"','"+thisGjson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+thisGjson.serialid+"','"+thisGjson.geometryType+"')\" >删除</a></p></div></div>");
					}
					break;
					case 'swf':
					if(type=='free'){
						document.getElementById('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+thisGjson.serialid+"_d','"+thisGjson.geometryType+"','on')\"  id="+thisGjson.serialid+" ><div class=\"xmll\"><EMBED align=middle src=\""+thisGjson.icoUrl+"\" width=36 height=36 type=application/x-shockwave-flash  QUALITY=\"high\" BGCOLOR=\"#FFFFFF\"></EMBED></div><div id=\""+thisGjson.serialid+"_d\" class=\"tit\" ><h1>"+thisGjson.titles+"</h1>"+thisGjson.notStyleContent.substring(0,60)+"<br /></div></div>");
					}else{
						document.getElementById('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+thisGjson.serialid+"_d','"+thisGjson.geometryType+"','on')\"  id="+thisGjson.serialid+" ><div class=\"xmll\"><EMBED align=middle src=\""+thisGjson.icoUrl+"\" width=36 height=36 type=application/x-shockwave-flash  QUALITY=\"high\" BGCOLOR=\"#FFFFFF\"></EMBED></div><div id=\""+thisGjson.serialid+"_d\" class=\"tit\" ><h1>"+thisGjson.titles+"</h1>"+thisGjson.notStyleContent.substring(0,60)+"<br /><p class=\"xmltools\"><a href=\"javascript:editGeometry('"+thisGjson.serialid+"','"+thisGjson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+thisGjson.serialid+"','"+thisGjson.geometryType+"')\" >删除</a></p></div></div>");
					}
					break;
				}
			edit_div_name=thisGjson.serialid;
			editPitchonStyle(thisGjson.serialid+'_d',thisGjson.geometryType,'off');
			break;
		case 'section_mc':
			if(type=='free'){
				$('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+thisGjson.serialid+"_z','"+thisGjson.geometryType+"','on')\" id="+thisGjson.serialid+" ><div class=\"xmll\"><hr width=\"30\" size=\""+thisGjson.line_size+"\" color=\"#"+formatColor((thisGjson.lineColor).toString(16))+"\" style=\"display:inline;vertical-align:middle;filter:alpha(opacity="+thisGjson.lineOpacity+");opacity:"+thisGjson.lineOpacity/100+";\" noshade /></div><div class=\"xmlr\"  id=\""+thisGjson.serialid+"_z\" ><h1>"+thisGjson.titles+"</h1>"+thisGjson.notStyleContent.substring(0,60)+"<br /></div></div>");
			}else{
				$('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+thisGjson.serialid+"_z','"+thisGjson.geometryType+"','on')\" id="+thisGjson.serialid+" ><div class=\"xmll\"><hr width=\"30\" size=\""+thisGjson.line_size+"\" color=\"#"+formatColor((thisGjson.lineColor).toString(16))+"\" style=\"display:inline;vertical-align:middle;filter:alpha(opacity="+thisGjson.lineOpacity+");opacity:"+thisGjson.lineOpacity/100+";\" noshade /></div><div class=\"xmlr\"  id=\""+thisGjson.serialid+"_z\" ><h1>"+thisGjson.titles+"</h1>"+thisGjson.notStyleContent.substring(0,60)+"<br /><p class=\"xmltools\"><a href=\"javascript:editGeometry('"+thisGjson.serialid+"','"+thisGjson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+thisGjson.serialid+"','"+thisGjson.geometryType+"')\" >删除</a></p></div></div>");
			}
			edit_div_name=thisGjson.serialid;
			editPitchonStyle(thisGjson.serialid+'_z',thisGjson.geometryType,'off');
			break;
		case 'polygon_mc':
			if(type=='free'){
				$('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+thisGjson.serialid+"_m','"+thisGjson.geometryType+"','on')\"  id="+thisGjson.serialid+" ><div class=\"xmll\"><span class=\"areaimg\" style=\"background:#"+formatColor((thisGjson.fillColor).toString(16))+";border:"+thisGjson.line_size+"px solid  #"+formatColor((thisGjson.lineColor).toString(16))+";filter:alpha(opacity="+thisGjson.fillOpacity+");opacity:"+thisGjson.fillOpacity/100+";\"></span></div><div class=\"xmlr\"  id=\""+thisGjson.serialid+"_m\" ><h1>"+thisGjson.titles+"</h1>"+thisGjson.notStyleContent.substring(0,60)+"<br /></div></div>");
			}else{
				$('mymaps_title').insertAdjacentHTML("beforeEnd","<div class=\"xml\" onmousedown=\"editPitchonStyle('"+thisGjson.serialid+"_m','"+thisGjson.geometryType+"','on')\"  id="+thisGjson.serialid+" ><div class=\"xmll\"><span class=\"areaimg\" style=\"background:#"+formatColor((thisGjson.fillColor).toString(16))+";border:"+thisGjson.line_size+"px solid  #"+formatColor((thisGjson.lineColor).toString(16))+";filter:alpha(opacity="+thisGjson.fillOpacity+");opacity:"+thisGjson.fillOpacity/100+";\"></span></div><div class=\"xmlr\"  id=\""+thisGjson.serialid+"_m\" ><h1>"+thisGjson.titles+"</h1>"+thisGjson.notStyleContent.substring(0,60)+"<br /><p class=\"xmltools\"><a href=\"javascript:editGeometry('"+thisGjson.serialid+"','"+thisGjson.geometryType+"')\" >编辑</a>&nbsp;&nbsp;<a href=\"javascript:deleteGeometry('"+thisGjson.serialid+"','"+thisGjson.geometryType+"')\" >删除</a></p></div></div>");
			}
			edit_div_name=thisGjson.serialid;
			editPitchonStyle(thisGjson.serialid+'_m',thisGjson.geometryType,'off');
			break;
		}
	}
}
function geometryRemoved(event){
	var created=event.args.substring(8,event.args.length);
	var createdJson=eval('('+created+')');
	var scriptTagParent=$(createdJson.id).parentNode;
	scriptTagParent.removeChild($(createdJson.id));
}
function judgeFlash(url){
	var newurl=url.split('.');
	var urlpostfix=newurl[newurl.length-1];
	if(urlpostfix==null||urlpostfix==''||urlpostfix==' '){
		return 'NaN';
	}else{
		switch(urlpostfix){
				case 'png':
				return 'png';
				break;
				case 'swf':
				return 'swf';
				break;
			}
	}
}
var isMinNS5=(navigator.appName.indexOf('Netscape')>=0&&parseFloat(navigator.appVersion)>=5)?1:0;
if(isMinNS5){
	HTMLElement.prototype.insertAdjacentElement=function(where,parsedNode){
		switch(where){
			case 'beforeBegin':
				this.parentNode.insertBefore(parsedNode,this)
				break;
			case 'afterBegin':
				this.insertBefore(parsedNode,this.firstChild);
				break;
			case 'beforeEnd':
				this.appendChild(parsedNode);
				break;
			case 'afterEnd':
				if(this.nextSibling){
					this.parentNode.insertBefore(parsedNode,this.nextSibling);
				}else{
					this.parentNode.appendChild(parsedNode)
				}
				break;
		}
	}
	HTMLElement.prototype.insertAdjacentHTML=function(where,htmlStr){
		var r=this.ownerDocument.createRange();
		r.setStartBefore(this);
		var parsedHTML=r.createContextualFragment(htmlStr);
		this.appendChild(parsedHTML)
	}
	HTMLElement.prototype.insertAdjacentText=function(where,txtStr){
		var parsedText=document.createTextNode(txtStr)
		this.insertAdjacentElement(where,parsedText)
	}
	HTMLElement.prototype.__defineGetter__
	(
		'innerText',
		function(){
			var anyString='';
			var childS=this.childNodes;
			for(var i=0;i<childS.length;i++){
			if(childS[i].nodeType==1)
			anyString+=childS[i].tagName=='BR'?'\n':childS[i].innerText;
			else if(childS[i].nodeType==3)
			anyString+=childS[i].nodeValue;
			}
			return anyString;
		}
	);
}
function editPitchonStyle(i,gtype,c){
	if(editPitchonStyleid!=''){
		try{
			$(editPitchonStyleid).className='xml';
		}catch(e){}
	}
	try{
		$(i).className='xmlr';
	}catch(e){}
	switch(c){
		case 'on':
		var temp_id=i.substring(0,i.length-2);
		editGeometry(temp_id,gtype);
		break;
		case 'off':
		break;
	}
	editPitchonStyleid=i.substring(0,i.length-2);;
	uploadtempGtype=gtype;
}
function editGeometry(gid,gtype){
	if(gtype=='point')gtype='pp_mc';
	mapObj.openGeometryTipById(gid,gtype);
}
function deleteGeometry(gid,gtype){
	if(confirm('确定删除?\n\n关闭对话框默认执行取消操作。')){
		mapObj.removeGeometryById(gid,gtype);
		var scriptTagParent=$(gid).parentNode;
		scriptTagParent.removeChild($(gid));
		if($('mymaps_title').innerHTML==''){
			HideObj('savediyform_btn');
		}
	}
}
function epreview(){
	if($('guid').value==''){
	}else{
		openplayMap($('guid').value,'play');
	}
}
function openplayMap(guid,c){
	var tempUrl='/view/'+guid+'.shtml';
	window.open(tempUrl);
}
function formatColor(cNum){
	var str=String(cNum);
	for(var i=0;i<str.length;i++){
		if(str.length<6){
			str='0'+str;
		}
	}
	return str;
}
function delsearchpoi(){
	for(i=1;i<11;i++){
		mapObj.removeCustomPointById(i);
	}
} 
