var CurrentStatus = {
	Map: '',
	MapPosX: 300,
	MapPosY: 15,
	MapWidth: 500,//695
	MapHeight: 550,
	MapZoom: 9,
	MapEnviSet: [25.048073112708416, 121.51727859255477, 9, 0],
	MapType: 'U_MAP_TYPE',
	InnerBlock: 5 + 29,
	Marker: '',
	SetPoint: '',
	SetSPoint: '',
	SetEPoint: '',
	NormalPoint: '',
	StartPoint: '',
	EndPoint: '',
	SearchPoint: '',
	StationPoint: '',
	FamousPoint: '',
	MyPoint: '',
	AroundPoint0: '',
	AroundPoint1: '',
	AroundPoint2: '',
	AroundPoint3: '',
	WarnTxt: '',
	PointAmt: 0,
	MRMenuWidth: 145,
	MRMenuHeight: 152,
	Polyline: '',
	DragFlag: false,
	MoveDistX: 0,
	MoveDistY: 0,
	WinPosX: 0,
	WinPosY:0,
	FuncWinDrag: '',
	WinPrint: '',
	MapAction: 'None',
	MapMode: 'Normal',
	UrlVars: '',
	ControlSet: ['Type1', 'Type2', 'Clear', 'Print', 'Mail2'],
	MRMenuSet: ['設為起點', '設為終點', '新增此地標', '查詢此處座標', '清除所有座標點', '關閉選單'],
	PointTypeSet: { N:'自設座標查尋點', S:'自設路徑起點', E:'自設路徑終點', Search:'地點搜尋', Famous:'人氣地標', MP:'我的清單', Around:'週邊地標' },
	MenuContent: ['MyListSection', 'FamousMarkSection', 'RouteSection', 'AroundMarkSection', 'FMUsersSection', 'UserPOIsSection', 'ListPOIsSection', 'LBSection'],
	RouteMenuSet: ['起終點對調', '全部清除', '我的導航', '儲存導航'],
	FamousMarkMenuSet: ['最新地標', '推薦地標', '人氣地標'],
	AroundMarkMenuSet: ['美食餐廳', '交通宿舍', '生活休閒', '機關機構'],
	UserPOIsMenuSet: ['收藏地標', '推薦地標', '自設地標'],
	FamousMarkTypeSet: ['newcreated', 'hotrecommended', 'hotcollected'],
	AroundMarkTypeSet: [0, 1, 2, 3],
	FMUsersTypeSet: [0, 1],
	UserPOIsTypeSet: [0, 1, 2],
	ListPOIsTypeSet: ['P21'],
	WinIntroContentSet: ['WinIntroMain', 'AddMarkerMain', 'CollectMain', 'SaveNaviMain', 'WinIntroMyPOI', 'EditMyPOIMain', 'Mail2Main', 'MailResultMain'],
	MaxLinks: 5, //單頁最多顯示頁數
	FamousMarkType: 0,
	AroundMarkType: 0,
	FMUsersType: 0,
	UserPOIsType: 0,
	ListPOIsType: 0,
	FamousMarkMaxRows: 42,
	FamousMarkPageNum: 1, //FM 當前頁數
	FamousMarkTotalPages: 1, //FM 總頁數
	AroundMarkMaxRows: 42,
	AroundMarkPageNum: 1, //AM 當前頁數
	AroundMarkTotalPages: 1, //AM 總頁數
	FMUsersMaxRows: 28,
	FMUsersPageNum: 1, //FMUsers 當前頁數
	FMUsersTotalPages: 1, //FMUsers 總頁數
	UserPOIsMaxRows: 39,
	UserPOIsPageNum: 1,
	UserPOIsTotalPages: 1,
	ListPOIsMaxRows: 42,
	ListPOIsPageNum: 1,
	ListPOIsTotalPages: 1,
	FMUsersInfo: [],
	FMUsersDataSet: [],
	FMDataSet: [],
	AMDataSet: [],
	ViewORoute: [],
	RouteLatLngSet: [],
	PTRDataArray: [],
	PTRStatus: [],
	StationMarkerSet: [],
	MailDataSet: [],
	PointFlag: false,
	SearchFlag: false,
	SearchBFlag: false,
	isMember: true,
	pc_id: 'mei',
	uid: 'ff80808118f62de5011907aab91e00f8',
	hId: 'pchome',
	getZoomArray: [],
	getMRMenuArray: [],
	getFamousMarkMenuArray: [],
	getFamousMarkLinkArray: [],
	getAroundMarkMenuArray: [],
	getAroundMarkLinkArray: [],
	getFMUsersLinkArray: [],
	getUserPOIsMenuArray: [],
	getUserPOIsArray: [],
	getListPOIsArray: [],
	getMyRouteArray: [],
	getMyListArray: [],
	FirstEnviFlag: [false, false],
	getWinIntroTitle: '',
	Keyword: '',
	IntervalID: '',
	TimerIntervalID: '',
	JumperElementSet: ['JumperLT', 'JumperMT', 'JumperRT', 'JumperLM', 'JumperRM', 'JumperLB', 'JumperMB', 'JumperRB'],
	JumperSet: ['None', false],
	Browser: identifyBrowser(),
	BrowserPNGfix: 'ie5,ie5mac,ie5.5,ie6',
	ShowRootMouse: function(e) {
		var RootX = (this.Browser.indexOf('ie') != -1) ? window.event.x : e.pageX;
		var RootY = (this.Browser.indexOf('ie') != -1) ? window.event.y : e.pageY;
		$('RootMouseInfo').innerHTML = 'RootX:'+RootX+' RootY:'+RootY;
	},
	MapInit: function() {
		if (!$('map')) return;
		var ElementPosArray = getPosition($('map'));
		this.Map = new UMap($('map'));
		this.Map.addControl(U_SCALE_CONTROL);
		this.Map.centerAndZoom(new ULatLng(this.MapEnviSet[0], this.MapEnviSet[1]), this.MapEnviSet[2]);
		if (this.MapMode != 'Print') {
			$('map').onmousedown = function(e) { CurrentStatus.MapMouseDownAction(e); };
			Event.observe($('map'), "mouseup", CurrentStatus.StoreEnviSet, false);
			Event.observe($('map'), "mousewheel", CurrentStatus.MouseRollAction, false);
			Event.observe($('map'), "DOMMouseScroll", CurrentStatus.MouseRollAction, false);
		}//end if
		
		//IconSetInit
		this.IconSetInit();
		
		//MRMenu
		var MRMenu = document.createElement('div');
		MRMenu.id = 'MRMenu';
		MRMenu.className = 'MRMenu';
		MRMenu.style.width = (this.MRMenuWidth - 20) + 'px';
		MRMenu.style.height = (this.MRMenuHeight - 20) + 'px';
		document.getElementsByTagName('body')[0].appendChild(MRMenu);
		
		for (var i=0; i<this.MRMenuSet.length; i++) {
			var MenuElement = document.createElement('div');
			MenuElement.id = 'MRMenu#' + i;
			MenuElement.className = 'MRMenuElementOut';
			MenuElement.style.marginTop = (i == 0) ? '0px' : '4px';
			MenuElement.innerHTML = '<img src="./img/MRMenu/Icon'+i+'.gif" align="absmiddle" style="margin-right:2px; float:left"><span style="float:left">' + this.MRMenuSet[i] + '</span>';
			MenuElement.onmouseover = function() { if (this.className != 'MRMenuElementBlock') this.className = 'MRMenuElementOver'; };
			MenuElement.onmouseout = function() { if (this.className != 'MRMenuElementBlock') this.className = 'MRMenuElementOut'; };
			MenuElement.onclick = function() {
				if (this.className == 'MRMenuElementBlock') return;
				var FuncID = Number(this.id.replace('MRMenu#', ''));
				CurrentStatus.MRMenuClickAction(FuncID);
			};
			MRMenu.appendChild(MenuElement);
			this.getMRMenuArray.push(MenuElement);
		}//end for
		
		//ControlSet
		var GetBody = document.getElementsByTagName('body')[0];
		for (var i=0; i<this.ControlSet.length; i++) {
			var ControlElement = document.createElement('div');
			ControlElement.id = 'ControlSet_' + this.ControlSet[i];
			ControlElement.style.background = 'url(img/ControlSet_' + this.ControlSet[i] + '_Out.gif)';
			if (i == 0) {
				ControlElement.style.marginLeft = '0px';
				ControlElement.style.background = 'url(img/ControlSet_' + this.ControlSet[i] + '_Over.gif)';
			} else ControlElement.style.marginLeft = '4px';
			ControlElement.onmouseover = function() { CurrentStatus.IconRollEffect(this.id, 'Over'); }
			ControlElement.onmouseout = function() { CurrentStatus.IconRollEffect(this.id, 'Out'); }
			ControlElement.onclick =  function() { CurrentStatus.ControlClickAction(this.id); }
			$('ControlSet').appendChild(ControlElement);
		}//end for

		//ZoomSet
		var ZoomSet = document.createElement('div');
		ZoomSet.id = 'ZoomSet';
		ZoomSet.className = 'ZoomSet';
		ZoomSet.style.left = (this.MapPosX + 5) + 'px';
		ZoomSet.style.top = (this.MapPosY + 5) + 'px';
		GetBody.appendChild(ZoomSet);
		//ZoomSet - ZoomIn
		var ZoomIn = document.createElement('div');
		ZoomIn.className = 'ZoomIn';
		if (this.BrowserPNGfix.indexOf(this.Browser) != -1) {
			ZoomIn.style.background = 'url(./img/transparent.gif)';
			ZoomIn.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=./img/Zoom/Zoom+.png, sizingMethod=scale)';
		}
		ZoomIn.onclick = function() { CurrentStatus.ZoomClickAction('+'); }
		ZoomSet.appendChild(ZoomIn);
		//ZoomSet - ZoomElement
		for (var i=0; i<11; i++) {
			var Mode = (i == this.MapZoom) ? '_Func' : '_Out';
			var ZoomElement = document.createElement('div');
			ZoomElement.id = 'Zoom' + i;
			ZoomElement.className = 'ZoomElement';
			if (this.BrowserPNGfix.indexOf(this.Browser) != -1) {
				ZoomElement.style.background = 'url(./img/transparent.gif)';
				ZoomElement.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=./img/Zoom/Zoom_'+i+Mode+'.png, sizingMethod=scale)';
			} else ZoomElement.style.background = 'url(./img/Zoom/Zoom_'+ i + Mode + '.png)';
			ZoomElement.onmouseover = function() { 
				var FuncID = Number(this.id.replace('Zoom', ''));
				CurrentStatus.ZoomRollEffect(FuncID, 'Over');
			}
			ZoomElement.onmouseout = function() { 
				var FuncID = Number(this.id.replace('Zoom', ''));
				CurrentStatus.ZoomRollEffect(FuncID, 'Out');
			}
			ZoomElement.onclick = function() { 
				var FuncID = Number(this.id.replace('Zoom', ''));
				CurrentStatus.ZoomClickAction(FuncID);
			}
			ZoomSet.appendChild(ZoomElement);
			this.getZoomArray.push(ZoomElement);
		}//end for
		//ZoomSet - ZoomOut
		var ZoomOut = document.createElement('div');
		ZoomOut.className = 'ZoomOut';
		if (this.BrowserPNGfix.indexOf(this.Browser) != -1) {
			ZoomOut.style.background = 'url(./img/transparent.gif)';
			ZoomOut.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=./img/Zoom/Zoom-.png, sizingMethod=scale)';
		}
		ZoomOut.onclick = function() { CurrentStatus.ZoomClickAction('-'); }
		ZoomSet.appendChild(ZoomOut);
		
		//MapJumper
		for (var i=0; i<this.JumperElementSet.length; i++) {
			var JumperElement = document.createElement('div');
			JumperElement.id = this.JumperElementSet[i];
			JumperElement.className = this.JumperElementSet[i];
			JumperElement.onmouseover = function() { CurrentStatus.JumperMouseAction('Over', this.id); };
			JumperElement.onmouseout = function() { CurrentStatus.JumperMouseAction('Out', this.id); };
			$('map').appendChild(JumperElement);
			
			var JumperOverLay = document.createElement('div');
			JumperOverLay.className = 'JumperOverlay';
			JumperElement.appendChild(JumperOverLay);
			Element.hide(JumperOverLay);
			
			var JumperArrow = document.createElement('div');
			JumperArrow.className = 'JumperArrow';
			JumperArrow.style.backgroundImage = 'url(./img/' + this.JumperElementSet[i] + '.gif)';
			JumperElement.appendChild(JumperArrow);
			Element.hide(JumperArrow);
		}//end for
		
		if (this.UrlVars['MapType'] == 'U_HYBRID_TYPE') this.ControlClickAction('ControlSet_Type2');
		if (this.MapMode == 'Print') {
			Element.hide(MRMenu);
			Element.hide('ControlSet');
			Element.hide(ZoomSet);
		}//end if
		this.EnvironmentInit();
	},
	JumperMouseAction: function(mode, type) {
		clearTimeout(this.TimerIntervalID);
		clearInterval(this.IntervalID);
		var GetJumper = $(type);
		if (mode == 'Over') {
			this.JumperSet[0] = type;
			this.JumperSet[1] = true;
			this.TimerIntervalID = setTimeout('CurrentStatus.JumperPre()', 1000);
			for (var i=0; i<GetJumper.childNodes.length; i++) {
				if (type == 'JumperLM' || type == 'JumperRM') GetJumper.childNodes[i].style.height = (this.MapHeight - 40) + 'px';
				Element.show(GetJumper.childNodes[i]);
			}//end for
		} else {
			this.JumperSet[0] = 'None';
			this.JumperSet[1] = false;
			for (var i=0; i<GetJumper.childNodes.length; i++) Element.hide(GetJumper.childNodes[i]);
			//this.MapAction = 'None';
			this.StoreEnviSet();
		}//end if
	},
	JumperPre: function() {
		if (!this.JumperSet[1]) { clearTimeout(this.TimerIntervalID); return; }
		clearInterval(this.IntervalID);
		this.IntervalID = setInterval("CurrentStatus.JumperEns('"+this.JumperSet[0]+"')", 15);
	},
	JumperEns: function(type) {
		Element.hide('WinWarn');
		CurrentStatus.WinInfoHide();
		Element.hide('MRMenu');
		var CentalX = CurrentStatus.MapWidth/2;
		var CentalY = CurrentStatus.MapHeight/2;
		switch (type) {
			case 'JumperLT':
				CentalX -= 100;
				CentalY -= 100;
				break;
			case 'JumperMT':
				CentalY -= 100;
				break;
			case'JumperRT':
				CentalX += 100;
				CentalY -= 100;
				break;
			case 'JumperLM':
				CentalX -= 100;
				break;
			case 'JumperRM':
				CentalX += 100;
				break;
			case 'JumperLB':
				CentalX -= 100;
				CentalY += 100;
				break;
			case 'JumperMB':
				CentalY += 100;
				break;
			case'JumperRB':
				CentalX += 100;
				CentalY += 100;
				break;
		}//end switch		
		var NewCenter = CurrentStatus.Map.transformContainerCoordinatesToLatLng(new UPoint(CentalX, CentalY));
		CurrentStatus.Map.centerAndZoom(NewCenter, CurrentStatus.MapZoom);
	},
	EnvironmentInit: function() {
		if (this.MapMode == 'Print') return;
		//MRMenu
		if (!this.isMember) this.getMRMenuArray[2].className = 'MRMenuElementBlock';
		this.getMRMenuArray[4].className = (this.PointAmt != 0) ? 'MRMenuElementOut' : 'MRMenuElementBlock';
		//ControlSet
		$('ControlSet_Clear').style.display = (this.SearchFlag) ? 'block' : 'none';
	},
	IconSetInit: function() {
		//Normal
		this.NormalPoint = new UIcon();
		this.NormalPoint.image = './img/IconPoint.gif';
		this.NormalPoint.iconWidth = 21;
		this.NormalPoint.iconHeight = 24;
		this.NormalPoint.iconAnchor = new UPoint(11, 24);
		//Start
		this.StartPoint = new UIcon();
		this.StartPoint.image = './img/IconSP.gif';
		this.StartPoint.iconWidth = 21;
		this.StartPoint.iconHeight = 24;
		this.StartPoint.iconAnchor = new UPoint(11, 24);
		//End
		this.EndPoint = new UIcon();
		this.EndPoint.image = './img/IconEP.gif';
		this.EndPoint.iconWidth = 21;
		this.EndPoint.iconHeight = 24;
		this.EndPoint.iconAnchor = new UPoint(11, 24);
		//Search
		this.SearchPoint = new UIcon();
		this.SearchPoint.image = './img/IconSearchP.gif';
		this.SearchPoint.iconWidth = 21;
		this.SearchPoint.iconHeight = 24;
		this.SearchPoint.iconAnchor = new UPoint(11, 24);
		//StationPoint
		this.StationPoint = new UIcon();
		this.StationPoint.image = './img/IconRouteB.gif';
		this.StationPoint.iconWidth = 21;
		this.StationPoint.iconHeight = 24;
		this.StationPoint.iconAnchor = new UPoint(11, 24);
		//FamousPoint
		this.FamousPoint = new UIcon();
		this.FamousPoint.image = './img/IconFM.gif';
		this.FamousPoint.iconWidth = 21;
		this.FamousPoint.iconHeight = 24;
		this.FamousPoint.iconAnchor = new UPoint(11, 24);
		//MyPoint
		this.MyPoint = new UIcon();
		this.MyPoint.image = './img/IconMP.gif';
		this.MyPoint.iconWidth = 21;
		this.MyPoint.iconHeight = 24;
		this.MyPoint.iconAnchor = new UPoint(11, 24);
		//AroundPoint0
		this.AroundPoint0 = new UIcon();
		this.AroundPoint0.image = './img/IconAP0.gif';
		this.AroundPoint0.iconWidth = 21;
		this.AroundPoint0.iconHeight = 24;
		this.AroundPoint0.iconAnchor = new UPoint(11, 24);
		//AroundPoint1
		this.AroundPoint1 = new UIcon();
		this.AroundPoint1.image = './img/IconAP1.gif';
		this.AroundPoint1.iconWidth = 21;
		this.AroundPoint1.iconHeight = 24;
		this.AroundPoint1.iconAnchor = new UPoint(11, 24);
		//AroundPoint2
		this.AroundPoint2 = new UIcon();
		this.AroundPoint2.image = './img/IconAP2.gif';
		this.AroundPoint2.iconWidth = 21;
		this.AroundPoint2.iconHeight = 24;
		this.AroundPoint2.iconAnchor = new UPoint(11, 24);
		//AroundPoint3
		this.AroundPoint3 = new UIcon();
		this.AroundPoint3.image = './img/IconAP3.gif';
		this.AroundPoint3.iconWidth = 21;
		this.AroundPoint3.iconHeight = 24;
		this.AroundPoint3.iconAnchor = new UPoint(11, 24);
	},
	WinInfoBInit: function(Content) {
		$('WinInfoBMid').style.height = '';
		$('WinInfoBMain').style.height = '';
		$('WinInfoBMidShadow').style.height = '';
		$('WinInfoBMain').innerHTML = Content;
		var getHeight = $('WinInfoBMain').getHeight();
		if (getHeight == 0) {
			switch (this.Marker.type) {
				case 'N':
					getHeight = 62;
					break;
				case 'Famous':
					getHeight = 124;
					break;
				case 'MP':
					getHeight = 100;
					break;
				case 'Around':
					getHeight = 100;
					break;
				default:
					getHeight = (this.Marker.PosTitle != undefined) ? 78 : 62;
			}//end switch
		}//end if
		$('WinInfoBMid').style.height = getHeight + 'px';
		$('WinInfoBMain').style.height = getHeight + 'px';
		$('WinInfoBMidShadow').style.height = getHeight + 'px';
		if (CurrentStatus.BrowserPNGfix.indexOf(CurrentStatus.Browser) != -1) {
			$('WinInfoBMidShadow').style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=./img/WinInfoB/BackRM.png, sizingMethod=scale)';
		}
		return getHeight+30+14;
	},
	WinInfoHide: function() {
		$('WinInfoB').style.left = '-1000px';
	},
	IconRollEffect: function(FuncID, Mode) {
		if (FuncID.indexOf('Type') != -1) {
			var GetID = Number(FuncID.replace('ControlSet_Type', ''));
			if ((GetID == 1 && this.MapType == 'U_MAP_TYPE') || (GetID == 2 && this.MapType == 'U_HYBRID_TYPE')) return;
		}//end if
		$(FuncID).style.background = 'url(img/' + FuncID + '_' + Mode + '.gif)';
	},
	ControlClickAction: function(FuncID) {
		switch (FuncID) {
			case 'ControlSet_Type1':
				if (this.MapType == 'U_MAP_TYPE') return;
				this.MapType = 'U_MAP_TYPE';
				$(FuncID).style.background = 'url(img/' + FuncID + '_Over.gif)';
				$('ControlSet_Type2').style.background = 'url(img/ControlSet_Type2_Out.gif)';
				this.Map.setMapType(U_MAP_TYPE);
				break;
			case 'ControlSet_Type2':
				if (this.MapType == 'U_HYBRID_TYPE' || this.MapZoom == 10) return;
				this.MapType = 'U_HYBRID_TYPE';
				$(FuncID).style.background = 'url(img/' + FuncID + '_Over.gif)';
				$('ControlSet_Type1').style.background = 'url(img/ControlSet_Type1_Out.gif)';
				this.Map.setMapType(U_HYBRID_TYPE);
				break;
			case 'ControlSet_Clear':
				this.RemoveMarker(-1);
				break;
			case 'ControlSet_Print':
				//alert('Print Action.');
				CurrentStatus.WinInfoHide();
				Element.hide('MRMenu');
				Element.hide('WinWarn');
				var UrlParameter = this.MkUrlParameter();
				//var Parameter = 'Lat=' + this.Map.getCenter().lat() + '&Lng=' + this.Map.getCenter().lng() + '&MapZoom=' + this.Map.getZoomLevel();
				var WinOptions = 'width=700,height=650,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=yes,left=10,top=10';
				var Path = './MapPrint.html?' + UrlParameter;
				this.WinPrint = window.open(Path, 'WinPrint', WinOptions);
				break;
			case 'ControlSet_Mail2':
				this.WinInfoClickAction(8);
				break;
		}//end switch
	},
	MouseRollAction: function(e) {
		(Event.wheel(e) > 0) ? CurrentStatus.ZoomClickAction('-') : CurrentStatus.ZoomClickAction('+');
	},
	ZoomRollEffect: function(FuncID, Mode) {
		Mode = '_' + Mode;
		if (FuncID == this.MapZoom) return;
		if (this.BrowserPNGfix.indexOf(this.Browser) != -1) {
			this.getZoomArray[FuncID].style.background = 'url(./img/transparent.gif)';
			this.getZoomArray[FuncID].style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=./img/Zoom/Zoom_'+FuncID+Mode+'.png, sizingMethod=scale)';
		} else this.getZoomArray[FuncID].style.background = 'url(./img/Zoom/Zoom_'+ FuncID + Mode + '.png)';
	},
	ZoomClickAction: function(FuncID, LatLng) {
		Element.hide('MRMenu');
		CurrentStatus.WinInfoHide();
		if (isNaN(FuncID)) {
			FuncID = (FuncID == '+') ? this.MapZoom + 1 : this.MapZoom - 1;
			if (FuncID < 0) FuncID = 0;
			if (FuncID > 10) FuncID = 10;
		}
		if (FuncID == 10 && this.MapType == 'U_HYBRID_TYPE') {
			this.MapType = 'U_MAP_TYPE';
			$('ControlSet_Type1').style.background = 'url(img/ControlSet_Type1_Over.gif)';
			$('ControlSet_Type2').style.background = 'url(img/ControlSet_Type2_Out.gif)';
		}//end if
		if (this.BrowserPNGfix.indexOf(this.Browser) != -1) {
			this.getZoomArray[this.MapZoom].style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=./img/Zoom/Zoom_'+this.MapZoom+'_Out.png, sizingMethod=scale)';
			this.getZoomArray[FuncID].style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=./img/Zoom/Zoom_'+FuncID+'_Func.png, sizingMethod=scale)';
		} else {
			this.getZoomArray[this.MapZoom].style.background = 'url(./img/Zoom/Zoom_'+this.MapZoom+'_Out.png)';
			this.getZoomArray[FuncID].style.background = 'url(./img/Zoom/Zoom_'+FuncID+'_Func.png)';
		}
		this.MapZoom = FuncID;
		(LatLng == undefined) ? this.Map.zoomMap(FuncID) : this.Map.centerAndZoom(LatLng, this.MapZoom);
		if (this.MapMode != 'Print') this.StoreEnviSet();
	},
	MRMenuClickAction: function(FuncID) {
		switch (FuncID) {
			case 0:
				Element.hide('MRMenu');
				var marker = new UMarker(this.SetPoint, this.StartPoint);
				marker.addListener('mouseover', CurrentStatus.MarkerOver);
				marker.type = 'S';
				this.Map.addOverlay(marker);
				this.Marker = marker;
				this.Map.removeOverlay(this.SetSPoint);
				this.SetSPoint = marker;
				this.MarkerOver(marker);
				this.PointAmt++;
				$('RouteSP').value = '自設路徑起點';
				$('RouteSP').style.color = '#444444';
				this.RemoveRoute();
				break;
			case 1:
				Element.hide('MRMenu');
				var marker = new UMarker(this.SetPoint, this.EndPoint);
				marker.addListener('mouseover', CurrentStatus.MarkerOver);
				marker.type = 'E';
				this.Map.addOverlay(marker);
				this.Marker = marker;
				this.Map.removeOverlay(this.SetEPoint);
				this.SetEPoint = marker;
				this.MarkerOver(marker);
				this.PointAmt++;
				$('RouteEP').value = '自設路徑終點';
				$('RouteEP').style.color = '#444444';
				this.RemoveRoute();
				break;
			case 2:
				Element.hide('MRMenu');
				var marker = new UMarker(this.SetPoint, this.NormalPoint);
				marker.addListener('mouseover', CurrentStatus.MarkerOver);
				marker.type = 'N';
				this.Map.addOverlay(marker);
				this.Marker = marker;
				this.PointAmt++;
				this.WinInfoClickAction(4);
				break;
			case 3:
				Element.hide('MRMenu');
				var marker = new UMarker(this.SetPoint, this.NormalPoint);
				marker.addListener('mouseover', CurrentStatus.MarkerOver);
				marker.type = 'N';
				this.Map.addOverlay(marker);
				this.Marker = marker;
				this.MarkerOver(marker);
				this.PointAmt++;
				break;
			case 4:
				this.PointAmt = 0;
				Element.hide('MRMenu');
				this.RemoveMarker(-1);
				break;
			case 5:
				Element.hide('MRMenu');
				break;
		}//end switch
	},
	RemoveMarker: function(Mode) {
		CurrentStatus.WinInfoHide();
		if (Mode != -1) {
			this.PointAmt--;
			if (this.PointAmt < 0) this.PointAmt = 0;
			if (this.Marker.type == 'S') { this.RemoveRoute(); this.SetSPoint = ''; $('RouteSP').value = '請輸入起點地址'; }
			if (this.Marker.type == 'E') { this.RemoveRoute(); this.SetEPoint = ''; $('RouteEP').value = '請輸入終點地址'; }
			this.Map.removeOverlay(this.Marker);
			this.SearchFlag = false;
			this.EnvironmentInit();
		} else {
			$('RouteSP').value = '請輸入起點地址';
			$('RouteEP').value = '請輸入終點地址';
			this.SetSPoint = '';
			this.SetEPoint = '';
			this.ClearSearchResult();
		}
		this.MapAction = 'None';
	},
	ClearSearchResult: function() {
		this.PointAmt = 0;
		this.Map.clearOverlays();
		this.SectionClear('RouteInfoMain');
		Element.hide('RouteInfoSection');
		CurrentStatus.WinInfoHide();
		this.SearchFlag = false;
		this.EnvironmentInit();
	},
	SEPointSwitch: function() {
		var MarkerTemp;
		if ((this.SetSPoint != '' && this.SetEPoint != '') || ($F('RouteSP') != '請輸入起點地址' && $F('RouteEP') != '請輸入終點地址')) {
			if (this.SetSPoint != '' && this.SetEPoint != '') {
				MarkerTemp = this.SetSPoint;
				this.SetSPoint.setIcon(this.EndPoint);
				this.SetSPoint = this.SetEPoint;
				this.SetSPoint.type = 'S';
				this.SetEPoint.setIcon(this.StartPoint);
				this.SetEPoint = MarkerTemp;
				this.SetEPoint.type = 'E';
			} else if (this.SetSPoint != '') {
				this.SetEPoint = this.SetSPoint;
				this.SetEPoint.setIcon(this.EndPoint);
				this.SetEPoint.type = 'E';
				this.SetSPoint = '';
			} else {
				this.SetSPoint = this.SetEPoint;
				this.SetSPoint.setIcon(this.StartPoint);
				this.SetSPoint.type = 'S';
				this.SetEPoint = '';
			}
			var TempValue = $F('RouteSP');
			$('RouteSP').value = $('RouteEP').value;
			$('RouteEP').value = TempValue;
			if ($F('RouteSP').indexOf('自設路徑') != -1) $('RouteSP').value = '自設路徑起點';
			if ($F('RouteEP').indexOf('自設路徑') != -1) $('RouteEP').value = '自設路徑終點';
			this.RemoveRoute();
			this.SearchFlag = false;
			this.EnvironmentInit();
		} else if (this.SetSPoint != '') {
			this.SetEPoint = this.SetSPoint;
			this.SetEPoint.setIcon(this.EndPoint);
			this.SetEPoint.type = 'E';
			this.SetSPoint = '';
			var ValueTemp = '';
			if ($F('RouteSP') != '自設路徑起點') ValueTemp = $F('RouteSP');
			$('RouteSP').value = '請輸入起點地址';
			$('RouteEP').value = (ValueTemp.length != 0) ? ValueTemp : (this.SetEPoint.PosTitle != undefined) ? this.SetEPoint.PosTitle.replace('定位至 ', '') : '自設路徑終點';
		} else {
			this.SetSPoint = this.SetEPoint;
			this.SetSPoint.setIcon(this.StartPoint);
			this.SetSPoint.type = 'S';
			this.SetEPoint = '';
			var ValueTemp = '';
			if ($F('RouteEP') != '自設路徑終點') ValueTemp = $F('RouteEP');
			$('RouteEP').value = '請輸入終點地址';
			$('RouteSP').value = (ValueTemp.length != 0) ? ValueTemp : (this.SetSPoint.PosTitle != undefined) ? this.SetSPoint.PosTitle.replace('定位至 ', '') : '自設路徑起點';
		}
		$('RouteSP').style.color = ($F('RouteSP') != '請輸入起點地址') ? '#444444' : '#b2b2b2';
		$('RouteEP').style.color = ($F('RouteEP') != '請輸入終點地址') ? '#444444' : '#b2b2b2';
	},
	MkSearchMarker: function(LatLng, PosTitle) {
		//this.RemoveMarker(-1);
		this.Map.clearOverlays();
		this.SectionClear('RouteInfoMain');
		Element.hide('RouteInfoSection');
		CurrentStatus.WinInfoHide();
		this.ZoomClickAction(9, LatLng);
		var marker = new UMarker(LatLng, this.SearchPoint);
		marker.addListener('mouseover', CurrentStatus.MarkerOver);
		marker.type = 'Search';
		marker.PosTitle = PosTitle.replace(/\[(.*)\]/g, '');
		this.Map.addOverlay(marker);
		this.Marker = marker;
		this.MarkerOver(marker);
		this.PointAmt++;
		this.SearchFlag = true;
		this.EnvironmentInit();
	},
	MkFamousMarker: function(VarArray) {
		this.SectionClear('RouteInfoMain');
		Element.hide('RouteInfoSection');
		
		var LatLng = new ULatLng(VarArray[2], VarArray[3]);
		this.Map.clearOverlays();
		CurrentStatus.WinInfoHide();
		this.ZoomClickAction(9, LatLng);
		var marker = new UMarker(LatLng, this.FamousPoint);
		marker.addListener('mouseover', CurrentStatus.MarkerOver);
		marker.type = 'Famous';
		marker.PosTitle = VarArray[0];
		marker.VarArray = VarArray;
		this.Map.addOverlay(marker);
		this.Marker = marker;
		this.MarkerOver(marker);
		if (this.SetSPoint) this.Map.addOverlay(this.SetSPoint);
		if (this.SetEPoint) this.Map.addOverlay(this.SetEPoint);
		this.PointAmt++;
		this.SearchFlag = true;
		this.EnvironmentInit();
		//Show WinIntro
		//this.WinInfoClickAction(3);
	},
	MkSAroundMarker: function(VarArray) {
		var LatLng = new ULatLng(VarArray[2], VarArray[3]);
		var marker = new UMarker(LatLng, this['AroundPoint'+VarArray[7]]);
		marker.addListener('mouseover', CurrentStatus.MarkerOver);
		marker.type = 'Around';
		marker.PosTitle = VarArray[0];
		marker.VarArray = VarArray;
		this.Marker = marker;
		this.Map.addOverlay(marker);
	},
	MkMyMarker: function(DataSet, mode) {
		this.SectionClear('RouteInfoMain');
		Element.hide('RouteInfoSection');
		
		var LatLng = new ULatLng(DataSet[2], DataSet[3]);
		this.Map.clearOverlays();
		CurrentStatus.WinInfoHide();
		this.ZoomClickAction(9, LatLng);
		var marker = new UMarker(LatLng, this.MyPoint);
		marker.addListener('mouseover', CurrentStatus.MarkerOver);
		marker.type = 'MP';
		marker.PosTitle = DataSet[0];
		marker.VarArray = DataSet;
		this.Map.addOverlay(marker);
		this.Marker = marker;
		this.MarkerOver(marker);
		if (this.SetSPoint) this.Map.addOverlay(this.SetSPoint);
		if (this.SetEPoint) this.Map.addOverlay(this.SetEPoint);
		this.PointAmt++;
		this.SearchFlag = true;
		this.EnvironmentInit();
		//Show WinIntro
		//(mode != undefined) ? this.WinInfoClickAction(7) : this.WinInfoClickAction(6);
		if (mode != undefined) this.WinInfoClickAction(7);
	},
	MkSEMarker: function(Type, Latlng, Title) {
		var IconSet = (Type == 'S') ? this.StartPoint : this.EndPoint;
		var marker = new UMarker(Latlng, IconSet);
		marker.addListener('mouseover', CurrentStatus.MarkerOver);
		marker.type = Type;
		if (Title != undefined) marker.PosTitle = Title.replace(/\[(.*)\]/g, '');
		this.Map.addOverlay(marker);
		this.Marker = marker;
		(Type == 'S') ? this.Map.removeOverlay(this.SetSPoint) : this.Map.removeOverlay(this.SetEPoint);
		(Type == 'S') ? this.SetSPoint = marker : this.SetEPoint = marker;
		this.PointAmt++;
	},
	RemoveRoute: function() {
		this.Map.removeOverlay(this.Polyline);
		this.SectionClear('RouteInfoMain');
		Element.hide('RouteInfoSection');
	},
	MkRoute: function(DataArray) {
		this.PointAmt = 0;
		this.SetSPoint = '';
		this.SetEPoint = '';
		this.Map.clearOverlays();
		CurrentStatus.WinInfoHide();
		Element.hide('MRMenu');
		
		var TitleSet = DataArray.pop().split('^');
		var PointSet = DataArray.pop().split(',');
		var PonitAmt = PointSet.length;
		for (var i=0; i<PonitAmt; i++) PointSet[i] = Number(PointSet[i]);
		var TotalLength = '全程:' + DataArray.pop() + 'km';
		this.SectionClear('RouteInfoMain');
		Element.show('RouteInfoSection');
		
		var StartLatLng = new ULatLng(PointSet[1], PointSet[0]);
		var EndLatLng = new ULatLng(PointSet[PonitAmt-1], PointSet[PonitAmt-2]);
		var SouthWast = [Math.min(StartLatLng.lat(), EndLatLng.lat()), Math.max(StartLatLng.lng(), EndLatLng.lng())];
		var NouthEast = [Math.max(StartLatLng.lat(), EndLatLng.lat()), Math.min(StartLatLng.lng(), EndLatLng.lng())];
		var Bounds = new UBounds(new ULatLng(SouthWast[0], SouthWast[1]), new ULatLng(NouthEast[0], NouthEast[1]));
		//var Bounds = this.Map.getBounds();
		Bounds.extend(StartLatLng);
		Bounds.extend(EndLatLng);
		this.ViewORoute = [this.Map.getBoundsZoomLevel(Bounds), Bounds.getCenter()];
		this.MkSEMarker('S', StartLatLng, TitleSet[0]);
		this.MkSEMarker('E', EndLatLng, TitleSet[1]);
		this.SearchFlag = true;
		this.EnvironmentInit();
		
		//Polyline
		var PointArray = [];
		while (PointSet.length > 0) {
			var LatLng = PointSet.splice(0, 2);
			PointArray.push(new ULatLng(LatLng[1], LatLng[0]));
		}//end while
		this.Polyline = new UPolyline(PointArray);
		this.Map.addOverlay(this.Polyline);
		this.ZoomClickAction(this.ViewORoute[0], this.ViewORoute[1]);
		
		//Info
		this.RouteLatLngSet = [];
		var RouteElement = document.createElement('div');
		RouteElement.innerHTML = '<span class="RouteInfoSP"></span>';
		$('RouteInfoMain').appendChild(RouteElement);
		var TitleElement = document.createElement('span');
		TitleElement.className = 'RouteInfoBB';
		TitleElement.innerHTML = $F('RouteSP');
		TitleElement.onmouseover = function() { this.style.textDecoration = 'underline'; };
		TitleElement.onmouseout = function() { this.style.textDecoration = 'none'; };
		TitleElement.onclick = function() { CurrentStatus.RouteClickAction(this); };
		RouteElement.appendChild(TitleElement);
		this.RouteLatLngSet.push(StartLatLng);
		
		for (var i=0; i<DataArray.length; i++) {
			var RouteInfo = DataArray[i].split('^');
			var Order = i + 1;
			var RouteElement = document.createElement('div');
			RouteElement.className = 'RouteElement';
			RouteElement.innerHTML = '<span class="RouteInfoA">'+Order+'.</span>';
			$('RouteInfoMain').appendChild(RouteElement);
			var TitleElement = document.createElement('span');
			TitleElement.className = 'RouteInfoB';
			TitleElement.innerHTML = RouteInfo[0];
			TitleElement.onmouseover = function() { this.style.textDecoration = 'underline'; };
			TitleElement.onmouseout = function() { this.style.textDecoration = 'none'; };
			TitleElement.onclick = function() { CurrentStatus.RouteClickAction(this); };
			RouteElement.appendChild(TitleElement);
			var DistElement = document.createElement('span');
			DistElement.className = 'RouteInfoC';
			RouteElement.appendChild(DistElement);
			var DistAddElement = document.createElement('span');
			DistAddElement.className = 'RouteInfoD';
			RouteElement.appendChild(DistAddElement);
			this.RouteLatLngSet.push(new ULatLng(RouteInfo[1], RouteInfo[2]));
		}
		
		var RouteElement = document.createElement('div');
		RouteElement.innerHTML = '<span class="RouteInfoEP"></span>';
		$('RouteInfoMain').appendChild(RouteElement);
		var TitleElement = document.createElement('span');
		TitleElement.className = 'RouteInfoBB';
		TitleElement.innerHTML = $F('RouteEP');
		TitleElement.onmouseover = function() { this.style.textDecoration = 'underline'; };
		TitleElement.onmouseout = function() { this.style.textDecoration = 'none'; };
		TitleElement.onclick = function() { CurrentStatus.RouteClickAction(this); };
		RouteElement.appendChild(TitleElement);
		this.RouteLatLngSet.push(EndLatLng);
		
		var RouteElement = document.createElement('div');
		$('RouteInfoMain').appendChild(RouteElement);
		var TitleElement = document.createElement('span');
		TitleElement.className = 'RouteInfoF';
		TitleElement.innerHTML = '全程路線地圖';
		TitleElement.onmouseover = function() { this.style.textDecoration = 'underline'; };
		TitleElement.onmouseout = function() { this.style.textDecoration = 'none'; };
		TitleElement.onclick = function() { CurrentStatus.RouteClickAction(this); };
		RouteElement.appendChild(TitleElement);
		var TLElement = document.createElement('span');
		TLElement.className = 'RouteInfoFL';
		TLElement.innerHTML = TotalLength;
		RouteElement.appendChild(TLElement);
	},
	MkPTRoute: function(DataArray) {
		this.PointAmt = 0;
		this.SetSPoint = '';
		this.SetEPoint = '';
		this.Map.clearOverlays();
		CurrentStatus.WinInfoHide();
		Element.hide('MRMenu');
		var TitleSet = DataArray.pop().split('^');
		var SELatLng = DataArray.pop().split('^');
		this.SectionClear('RouteInfoMain');
		Element.show('RouteInfoSection');
		
		var StartLatLng = new ULatLng(SELatLng[0], SELatLng[1]);
		var EndLatLng = new ULatLng(SELatLng[2], SELatLng[3]);
		var SouthWast = [Math.min(StartLatLng.lat(), EndLatLng.lat()), Math.max(StartLatLng.lng(), EndLatLng.lng())];
		var NouthEast = [Math.max(StartLatLng.lat(), EndLatLng.lat()), Math.min(StartLatLng.lng(), EndLatLng.lng())];
		var Bounds = new UBounds(new ULatLng(SouthWast[0], SouthWast[1]), new ULatLng(NouthEast[0], NouthEast[1]));
		//var Bounds = this.Map.getBounds();
		Bounds.extend(StartLatLng);
		Bounds.extend(EndLatLng);
		this.ViewORoute = [this.Map.getBoundsZoomLevel(Bounds), Bounds.getCenter()];
		this.MkSEMarker('S', StartLatLng, TitleSet[0]);
		this.MkSEMarker('E', EndLatLng, TitleSet[1]);
		this.SearchFlag = true;
		this.EnvironmentInit();
		this.ZoomClickAction(this.ViewORoute[0], this.ViewORoute[1]);
		
		//Get OriginalData
		this.PTRDataArray = [];
		this.PTRStatus = [];
		while (DataArray.length > 0) {
			var PlanElement = DataArray.splice(0, 2);
			this.PTRDataArray.push([PlanElement[0], PlanElement[1]]);
		}//end while
		this.PTRStatus.push(this.PTRDataArray.length);
		this.PTRStatus.push(-1);
		
		//Create Route info
		var RouteElement = document.createElement('div');
		RouteElement.className = 'RouteElementPTR';
		RouteElement.innerHTML = '<span class="RouteInfoSP"></span>';
		$('RouteInfoMain').appendChild(RouteElement);
		var TitleElement = document.createElement('span');
		TitleElement.className = 'RouteInfoBB';
		TitleElement.innerHTML = $F('RouteSP');
		TitleElement.onmouseover = function() { this.style.textDecoration = 'underline'; };
		TitleElement.onmouseout = function() { this.style.textDecoration = 'none'; };
		TitleElement.onclick = function() { CurrentStatus.MarkerOver(CurrentStatus.SetSPoint); };
		RouteElement.appendChild(TitleElement);
		
		for (var i=0; i<this.PTRDataArray.length; i++) {
			var PlanElement = document.createElement('div');
			PlanElement.id = 'Plan' + i;
			PlanElement.className = 'RouteElementPTRN';
			$('RouteInfoMain').appendChild(PlanElement);
			//PlanTop
			var PlanTop = document.createElement('div');
			PlanTop.style.marginTop = '5px';
			PlanElement.appendChild(PlanTop);
			var PlanTitle = document.createElement('div');
			PlanTitle.className = 'PlanTitle';
			PlanTitle.innerHTML = '[方案' + (i+1) + ']';
			PlanTop.appendChild(PlanTitle);
			var PlanBtn = document.createElement('div');
			PlanBtn.id = 'PlanBtn#' + i;
			PlanBtn.className = 'PlanBtn';
			PlanBtn.onmouseover = function() { this.style.backgroundPosition = '-80px 0px'; };
			PlanBtn.onmouseout = function() { this.style.backgroundPosition = '0px 0px'; };
			PlanBtn.onclick = function() { CurrentStatus.PlanBtnAction(this.id); };
			PlanTop.appendChild(PlanBtn);
			//PlanMain
			var PlanMain = document.createElement('div');
			PlanMain.style.clear = 'both';
			PlanMain.style.marginTop = '8px';
			PlanMain.style.marginBottom = '4px';
			PlanElement.appendChild(PlanMain);
			
			//Separate PlanContent
			var PlanContent = this.PTRDataArray[i][0].split('。');
			var DistWalk = PlanContent.pop();
			/*for (var j=0; j<PlanContent.length; j++) {
				if (PlanContent[j].indexOf('一共經過') != -1) {
					PlanContent = PlanContent.splice(0, j+1);
					break;
				}//end if
			}//end for*/
			var Conclusion = '<span class="IconConclusion">▲</span>' + PlanContent.pop();
			if (DistWalk.length != 0) Conclusion += ',' + DistWalk;
			var ComposeContent = '';
			var InfoArray = [];
			for (var j=0; j<PlanContent.length; j++) {
				var InfoElement = PlanContent[j];
				InfoArray.push(this.InfoFilter(InfoElement));
				/*var PosFlag = InfoElement.indexOf('搭乘');
				if (PosFlag != -1) {
					var PartA = this.InfoFilter(InfoElement.substr(0, PosFlag-1));
					var PartB = this.InfoFilter(InfoElement.substr(PosFlag, InfoElement.length));
					if (PartA.indexOf('步行0公尺') == -1) InfoArray.push(PartA);
					if (PartB.indexOf('步行0公尺') == -1) InfoArray.push(PartB);
				} else InfoArray.push(this.InfoFilter(InfoElement));*/
			}//end for
			//for (var k=0; k<InfoArray.length; k++) alert(InfoArray[k]);
			//Separate LatLng
			var PlanLatLng = this.PTRDataArray[i][1].split('[break]');
			var LatLngArray = [];
			var LatLngTitle = [];
			for (var j=0; j<PlanLatLng.length; j++) {
				var LatLngElement = PlanLatLng[j].split('^');
				LatLngArray.push(LatLngElement);
				LatLngTitle.push(LatLngElement[0]);
			}//end for
			//Replace StationLink
			for (var j=0; j<InfoArray.length; j++) {
				var InfoElement = InfoArray[j];
				for (var k=1; k<(LatLngTitle.length-1); k++) {
					var PosFlag = InfoElement.indexOf(LatLngTitle[k]);
					if (PosFlag == -1) continue;
					if (InfoElement.charAt(PosFlag-1) != ' ') continue;
					else if (InfoElement.charAt(PosFlag+LatLngTitle[k].length) != ' ') continue;
					var StationID = (LatLngTitle[k].indexOf('站') == LatLngTitle[k].length-1) ? LatLngTitle[k] : LatLngTitle[k]+'站';
					var MouseAction = 'onmouseover="CurrentStatus.StationMouseOver(this)" onmouseout="CurrentStatus.StationMouseOut(this)" onclick="CurrentStatus.StationLinkClick(this)"'; 
					var ComposeLink = '<span id="Station#' + i + '#' + k + '" class="StationLink" ' + MouseAction + '>' + StationID + '</span>';
					LatLngArray[k].push(InfoArray[j].replace(LatLngTitle[k], '本站')+'[LineBr]'+InfoArray[j+1].replace(LatLngTitle[k], '本站'));
					InfoArray[j] = InfoElement.replace(LatLngTitle[k], ComposeLink);
					break;
				}
			}//end for
			//Restore this.PTRDataArray[i][1]
			this.PTRDataArray[i][1] = '';
			while (LatLngArray.length > 0) {
				var LatLngElement = LatLngArray.shift();
				var LatLngString = '';
				for (var j=0; j<LatLngElement.length; j++)LatLngString += LatLngElement[j] + '^';
				LatLngString = LatLngString.substr(0, LatLngString.length-1) + '[break]';
				this.PTRDataArray[i][1] += LatLngString;
			}
			this.PTRDataArray[i][1] = this.PTRDataArray[i][1].substr(0, this.PTRDataArray[i][1].length-7);
			//for (var k=0; k<InfoArray.length; k++) alert(InfoArray[k]);
			//break;
			for (var j=0; j<InfoArray.length; j++) ComposeContent += '<span class="RouteOrder">' + (j+1) + '. </span>' + InfoArray[j] + '<br>';
			ComposeContent += '<br>' + Conclusion;
			PlanMain.innerHTML = ComposeContent;
		}//end for
		
		var RouteElement = document.createElement('div');
		RouteElement.innerHTML = '<span class="RouteInfoEP"></span>';
		$('RouteInfoMain').appendChild(RouteElement);
		var TitleElement = document.createElement('span');
		TitleElement.className = 'RouteInfoBB';
		TitleElement.innerHTML = $F('RouteEP');
		TitleElement.onmouseover = function() { this.style.textDecoration = 'underline'; };
		TitleElement.onmouseout = function() { this.style.textDecoration = 'none'; };
		TitleElement.onclick = function() { CurrentStatus.MarkerOver(CurrentStatus.SetEPoint); };
		RouteElement.appendChild(TitleElement);
	},
	MkMyRoute: function(DataArray) {
		this.SectionClear('RouteInfoMain');
		Element.show('RouteInfoSection');
		this.getMyRouteArray = [];
		
		//MyRouteTitle
		var MyRouteTitle = document.createElement('div');
		MyRouteTitle.className = 'MyRouteTitle';
		MyRouteTitle.innerHTML = '<span class="MyRouteTitleElement">起點地標</span><span class="MyRouteTitleElement">終點地標</span><span class="MyRouteTitleElement" style="width:85px;">資料更新</span>';
		$('RouteInfoMain').appendChild(MyRouteTitle);
		
		//MyRouteRowElement
		for (var i=0; i<DataArray.length; i++) {
			var DataElement = DataArray[i].split('[DataBr]');
			var MyRouteRowElement = document.createElement('div');
			MyRouteRowElement.id = 'MyRouteRowElement#' + i;
			MyRouteRowElement.className = 'MyRouteRowElement';
			MyRouteRowElement.DataSet = DataElement;
			$('RouteInfoMain').appendChild(MyRouteRowElement);
			this.getMyRouteArray.push(MyRouteRowElement);
			
			var MyRouteSP = document.createElement('div');
			MyRouteSP.id = 'MyRouteAddressingSP#' + i;
			MyRouteSP.className = 'MyRouteElement';
			MyRouteSP.innerHTML = this.TextLengthLimit(DataElement[7], 12);
			MyRouteSP.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			MyRouteSP.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			MyRouteSP.onclick = function() { CurrentStatus.MyRouteClickAction(this.id); }
			MyRouteRowElement.appendChild(MyRouteSP);
			var MyRouteEP = document.createElement('div');
			MyRouteEP.id = 'MyRouteAddressingEP#' + i;
			MyRouteEP.className = 'MyRouteElement';
			MyRouteEP.innerHTML = this.TextLengthLimit(DataElement[8], 12);
			MyRouteEP.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			MyRouteEP.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			MyRouteEP.onclick = function() { CurrentStatus.MyRouteClickAction(this.id); }
			MyRouteRowElement.appendChild(MyRouteEP);
			
			var MyRouteEdit = document.createElement('div');
			MyRouteEdit.className = 'MyRouteElement';
			MyRouteRowElement.appendChild(MyRouteEdit);
			
			var LinkView = document.createElement('span');
			LinkView.id = 'MyRouteView#' + i;
			LinkView.style.float = 'left';
			LinkView.style.cursor = 'pointer';
			LinkView.innerHTML = '檢視';
			LinkView.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			LinkView.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			LinkView.onclick = function() { CurrentStatus.MyRouteClickAction(this.id); }
			MyRouteEdit.appendChild(LinkView);
			var LinkDel = document.createElement('span');
			LinkDel.id = 'MyRouteDel#' + i;
			LinkDel.style.float = 'left';
			LinkDel.style.cursor = 'pointer';
			LinkDel.style.marginLeft = '10px';
			LinkDel.innerHTML = '刪除';
			LinkDel.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			LinkDel.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			LinkDel.onclick = function() { CurrentStatus.MyRouteClickAction(this.id); }
			MyRouteEdit.appendChild(LinkDel);
		}//end for
	},
	MyRouteClickAction: function(FuncID) {
		var FuncArray = FuncID.split('#');
		var Type = FuncArray[0].replace('MyRoute', '');
		var DataSet = this.getMyRouteArray[Number(FuncArray[1])].DataSet;
		switch (Type) {
			case 'AddressingSP':
				if (DataSet[1].indexOf('自設路徑') != -1) {
					var LatLng = new ULatLng(DataSet[3], DataSet[4]);
					this.MkSearchMarker(LatLng, DataSet[7]);
				} else { $('Search').value = DataSet[1]; this.SearchCheck('addressing'); }
				break;
			case 'AddressingEP':
				if (DataSet[2].indexOf('自設路徑') != -1) {
					var LatLng = new ULatLng(DataSet[5], DataSet[6]);
					this.MkSearchMarker(LatLng, DataSet[8]);
				} else { $('Search').value = DataSet[2]; this.SearchCheck('addressing'); }
				break;
			case 'View':
				//RouteSP
				if (DataSet[1].indexOf('自設路徑') != -1) {
					var LatLng = new ULatLng(DataSet[3], DataSet[4]);
					this.MkSEMarker('S', LatLng);
					$('RouteSP').value = '自設路徑起點';
				} else $('RouteSP').value = DataSet[1];
				//RouteEP
				if (DataSet[2].indexOf('自設路徑') != -1) {
					var LatLng = new ULatLng(DataSet[5], DataSet[6]);
					this.MkSEMarker('E', LatLng);
					$('RouteEP').value = '自設路徑終點';
				} else $('RouteEP').value = DataSet[2];
				this.SearchCheck('routing');
				break;
			case 'Del':
				var ElementPosArray = getPosition($(FuncID));
				ElementPosArray[0] += 25;
				ElementPosArray[1] -= 25;
				this.SectionClear('WarnTxt');
				
				var Msg = document.createElement('div');
				Msg.innerHTML = '確定刪除此導航？！';
				$('WarnTxt').appendChild(Msg);
				var BtnSection = document.createElement('div');
				BtnSection.style.marginTop = '5px';
				BtnSection.style.marginLeft = '15px';
				$('WarnTxt').appendChild(BtnSection);
				var BtnConfirm = document.createElement('div');
				BtnConfirm.id = 'WinWarn#Confirm#' + FuncArray[1];
				BtnConfirm.className = 'WinWarnConfirm';
				BtnConfirm.DelID = DataSet[0];
				BtnConfirm.onclick = function() {
					Element.hide('WinWarn');
					var hash = $H();
					hash['action'] = 'DelNavi';
					hash['pc_id'] = CurrentStatus.pc_id;
					hash['ListID'] = this.DelID;
					CurrentStatus.DataListQuery(hash, 'Api_Locate');
				}
				BtnSection.appendChild(BtnConfirm);
				var BtnCancel = document.createElement('div');
				BtnCancel.id = 'WinWarn#Cancel#' + FuncArray[1];
				BtnCancel.className = 'WinWarnCancel';
				BtnCancel.onclick = function() { Element.hide('WinWarn'); };
				BtnSection.appendChild(BtnCancel);
				
				$('WinWarn').style.left = ElementPosArray[0] + 'px';
				$('WinWarn').style.top = ElementPosArray[1] + 'px';
				Element.show('WinWarn');
				//this.WarnTxt = '確定刪除此導航？！';
				//this.ShowWinWarn(ElementPosArray);
				break;
		}//end switch
	},
	MkFamousMark: function(DataArray) {
		this.SectionClear('FMPickerSection');
		this.FMDataSet = [];
		this.getFamousMarkLinkArray = [];
		$('FMPickerSection').style.height = (Math.ceil(DataArray.length/3)*21 - 1) + 'px';
		for (var i=0; i<DataArray.length; i++) {
			var DataElement = DataArray[i].split('[DataBr]');
			this.FMDataSet.push(DataElement);
			var FMElement = document.createElement('div');
			FMElement.id = 'FMElement#' + i;
			FMElement.className = 'FMElement';
			FMElement.style.width = (i % 3 == 1) ? '86px' : '87px';
			FMElement.innerHTML = this.TextLengthLimit(DataElement[0], 10);
			FMElement.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			FMElement.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			FMElement.onclick = function() {
				for (var j=0; j<CurrentStatus.getFamousMarkLinkArray.length; j++) CurrentStatus.getFamousMarkLinkArray[j].className = 'FMElement';
				this.className = 'FMElementFunc';
				CurrentStatus.MkFamousMarker(this.VarArray);
			};
			FMElement.VarArray = DataElement;
			/*FMElement.VarArray = [];
			FMElement.VarArray.push(DataElement[0]); //NAME
			FMElement.VarArray.push(DataElement[1]); //ADDR
			FMElement.VarArray.push(DataElement[2]); //LAT
			FMElement.VarArray.push(DataElement[3]); //LNG
			FMElement.VarArray.push(DataElement[4]); //DESC
			FMElement.VarArray.push(DataElement[5]); //PHOTO
			FMElement.VarArray.push(DataElement[6]); //LINK
			FMElement.VarArray.push(DataElement[7]); //TAG
			FMElement.VarArray.push(DataElement[8]); //PID*/
			$('FMPickerSection').appendChild(FMElement);
			this.getFamousMarkLinkArray.push(FMElement);
		}//end for
		(this.FirstEnviFlag[0] && this.FirstEnviFlag[1]) ? this.MenuClickAction('Menu#1') : this.FirstEnviFlag[0] = true;
	},
	MkAroundMark: function(DataArray) {
		this.SectionClear('AMPickerSection');
		this.AMDataSet = [];
		this.getAroundMarkLinkArray = [];
		$('AMPickerSection').style.height = (Math.ceil(DataArray.length/3)*21 - 1) + 'px';
		for (var i=0; i<DataArray.length; i++) {
			var DataElement = DataArray[i].split('[DataBr]');
			this.AMDataSet.push(DataElement);
			var AMElement = document.createElement('div');
			AMElement.id = 'AMElement#' + i;
			AMElement.className = 'FMElement';
			AMElement.style.width = (i % 3 == 1) ? '86px' : '87px';
			AMElement.innerHTML = this.TextLengthLimit(DataElement[1], 10);
			AMElement.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			AMElement.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			AMElement.onclick = function() {
				for (var j=0; j<CurrentStatus.getAroundMarkLinkArray.length; j++) CurrentStatus.getAroundMarkLinkArray[j].className = 'FMElement';
				this.className = 'FMElementFunc';
				CurrentStatus.APQuery(this);
			};
			AMElement.VarArray = DataElement;
			$('AMPickerSection').appendChild(AMElement);
			this.getAroundMarkLinkArray.push(AMElement);
		}//end for 
		(this.FirstEnviFlag[0] && this.FirstEnviFlag[1]) ? this.MenuClickAction('Menu#3') : this.FirstEnviFlag[1] = true;
	},
	MkFMUsers: function(DataArray) {
		this.SectionClear('FMUsersPickerSection');
		this.FMUsersDataSet = [];
		this.getFMUsersLinkArray = [];
		$('FMUsersPickerSection').style.height = (Math.ceil(DataArray.length/3)*21 - 1) + 'px';
		//this.FMUsersInfo.push(DataArray.shift());
		this.FMUsersInfo['UserAmt'] = DataArray.shift();
		$('FMUsersTitleSection').innerHTML = '「<b style="color:#ff0000">' + this.TextLengthLimit(this.FMUsersInfo['pName'], 16) + '</b>」一共被 ' + this.FMUsersInfo['UserAmt'] + ' 人所' + ((this.FMUsersInfo['Type'] == 0) ? '收藏' : '推薦');
		
		$('FMUsersPickerSection').style.height = (Math.ceil(DataArray.length/2)*21 - 1) + 'px';
		for (var i=0; i<DataArray.length; i++) {
			var DataElement = DataArray[i].split('[DataBr]');
			this.FMUsersDataSet.push(DataElement);
			var UserElement = document.createElement('div');
			UserElement.id = 'FMUsersElement#' + i;
			UserElement.className = 'FMUsersElement';
			UserElement.style.width = '130px';
			UserElement.innerHTML = this.TextLengthLimit(DataElement[1], 16);
			UserElement.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			UserElement.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			UserElement.onclick = function() {
				CurrentStatus.FMUsersInfo['uId'] = this.VarArray[0];
				$('UserPOIsTitleSection').innerHTML = '「<b style="color:#ff0000">' + this.VarArray[1] + '</b>」的地標收集';
				CurrentStatus.UserPOIsLoadingStatus('show');
				CurrentStatus.MenuClickAction('Menu#5');
				var hash = $H();
				hash['action'] = 'UserPOIsAmtQuery';
				hash['uId'] = CurrentStatus.FMUsersInfo['uId'];
				CurrentStatus.DataListQuery(hash, 'Api_Locate');
			};
			UserElement.VarArray = DataElement;
			$('FMUsersPickerSection').appendChild(UserElement);
			this.getFMUsersLinkArray.push(UserElement);
		}//end for 
		this.HideOWin();
		this.MenuClickAction('Menu#4');
		if (!Element.visible('LSection')) this.SetElementParameter();
	},
	MkUserPOIs: function(DataArray) {
		var SelectData = DataArray.shift().split('[TagSetBr]');
		//UserPOIsPickerSection
		this.SectionClear('UserPOIsPickerSection');
		this.getUserPOIsArray = [];
		$('UserPOIsPickerSection').style.height = (Math.ceil(DataArray.length/3)*21 - 1) + 'px';
		for (var i=0; i<DataArray.length; i++) {
			var DataElement = DataArray[i].split('[DataBr]');
			var TagTemp = DataElement[9].split('[TagSetBr]');
			var TagArray = [];
			for (var j=0; j<TagTemp.length; j++) TagArray.push(TagTemp[j].split('[TagBr]')[0]);
			
			var UserPOIsElement = document.createElement('div');
			UserPOIsElement.id = 'UserPOIsElement#' + i;
			UserPOIsElement.className = 'FMElement';
			//UserPOIsElement.DataSet = DataElement;
			//UserPOIsElement.TagSet = TagArray;
			UserPOIsElement.style.width = (i % 3 == 1) ? '86px' : '87px';
			UserPOIsElement.innerHTML = this.TextLengthLimit(DataElement[0], 10);
			UserPOIsElement.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			UserPOIsElement.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			UserPOIsElement.onclick = function() {
				for (var j=0; j<CurrentStatus.getUserPOIsArray.length; j++) CurrentStatus.getUserPOIsArray[j].className = 'FMElement';
				this.className = 'FMElementFunc';
				CurrentStatus.MkFamousMarker(this.VarArray);
				//var FuncID = Number(this.id.replace('UserPOIsElement#', ''));
				//CurrentStatus.MkMyMarker(CurrentStatus.getUserPOIsArray[FuncID].DataSet);
			};
			UserPOIsElement.VarArray = DataElement;
			$('UserPOIsPickerSection').appendChild(UserPOIsElement);
			this.getUserPOIsArray.push(UserPOIsElement);
		}//end for
		this.UserPOIsLoadingStatus('hide');
		this.MenuClickAction('Menu#5');
	},
	MkListPOIs: function(DataArray) {
		$('ListPOIsTitleSection').innerHTML = '「<b style="color:#ff0000">' + this.TextLengthLimit(this.Keyword, 16) + '</b>」地標共有 ' + DataArray.shift() + ' 筆資料';
		//ListPOIsPickerSection
		this.SectionClear('ListPOIsPickerSection');
		this.getListPOIsArray = [];
		$('ListPOIsPickerSection').style.height = (Math.ceil(DataArray.length/3)*21 - 1) + 'px';
		for (var i=0; i<DataArray.length; i++) {
			var DataElement = DataArray[i].split('[DataBr]');
			var TagTemp = DataElement[9].split('[TagSetBr]');
			var TagArray = [];
			for (var j=0; j<TagTemp.length; j++) TagArray.push(TagTemp[j].split('[TagBr]')[0]);
			
			var ListPOIsElement = document.createElement('div');
			ListPOIsElement.id = 'ListPOIsElement#' + i;
			ListPOIsElement.className = 'FMElement';
			ListPOIsElement.style.width = (i % 3 == 1) ? '86px' : '87px';
			ListPOIsElement.innerHTML = this.TextLengthLimit(DataElement[0], 10);
			ListPOIsElement.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			ListPOIsElement.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			ListPOIsElement.onclick = function() {
				for (var j=0; j<CurrentStatus.getListPOIsArray.length; j++) CurrentStatus.getListPOIsArray[j].className = 'FMElement';
				this.className = 'FMElementFunc';
				CurrentStatus.MkFamousMarker(this.VarArray);
			};
			ListPOIsElement.VarArray = DataElement;
			$('ListPOIsPickerSection').appendChild(ListPOIsElement);
			this.getListPOIsArray.push(ListPOIsElement);
		}//end for
		this.MenuClickAction('Menu#6');
	},
	SetFMUserPOIsMenu : function(DataArray) {
		var TypeAmtArray = DataArray[0].split('^');
		for (i=0; i<TypeAmtArray.length; i++) TypeAmtArray[i] = Number(TypeAmtArray[i]);
		var GetDivs = $('UserPOIsMenuSection').getElementsByTagName('div');
		Element.show(GetDivs[1]);
		Element.show(GetDivs[3]);
		
		//Collect
		if (TypeAmtArray[0] > 0) {
			GetDivs[0].innerHTML = '收藏地標(<span style="color:#444444;">' + TypeAmtArray[0] + '</span>)';
			Element.show(GetDivs[0]);
			Element.show(GetDivs[1]);
		} else { Element.hide(GetDivs[0]); Element.hide(GetDivs[1]); }
		//Recommend
		if (TypeAmtArray[1] > 0) {
			GetDivs[2].innerHTML = '推薦地標(<span style="color:#444444;">' + TypeAmtArray[1] + '</span>)';
			Element.show(GetDivs[2]);
			Element.show(GetDivs[3]);
		} else { Element.hide(GetDivs[1]); Element.hide(GetDivs[2]); }
		//POIs
		if (TypeAmtArray[2] > 0) {
			GetDivs[4].innerHTML = '自設地標(<span style="color:#444444;">' + TypeAmtArray[2] + '</span>)';
			Element.show(GetDivs[4]);
		} else { Element.hide(GetDivs[3]); Element.hide(GetDivs[4]); }
		CurrentStatus.OMenuClickAction('UserPOIsMenu#'+this.FMUsersInfo['Type']);
	},
	UserPOIsLoadingStatus: function(Mode) {
		if (Mode =='show') {
			Element.show('ProgressBar');
			Element.hide('UserPOIsMenuSection');
			Element.hide('UserPOIsPickerSection');
			this.SectionClear('UserPOIsPagesSection');
			this.SectionClear('UserPOIsPagesInfo');
		} else {
			Element.hide('ProgressBar');
			Element.show('UserPOIsMenuSection');
			Element.show('UserPOIsPickerSection');
		}//end if
	},
	APQuery: function(FuncObj) {
		Element.hide('WinWarn');
		CurrentStatus.WinInfoHide();
		var GetBound = this.Map.getBounds();
		this.LoadingStatus('show');
		var hash = $H();
		hash['action'] = 'APQuery';
		hash['ulLng'] = GetBound.getSouthWest().lng();
		hash['ulLat'] = GetBound.getNorthEast().lat();
		hash['drLng'] = GetBound.getNorthEast().lng();
		hash['drLat'] = GetBound.getSouthWest().lat();
		hash['asppoiTypes'] = FuncObj.VarArray[0];
		this.DataListQuery(hash, 'Api_Locate');
	},
	MkAPs: function(DataArray) {
		this.Map.clearOverlays();
		for (var i=0; i<DataArray.length; i++) {
			var DataElement = DataArray[i].split('[DataBr]');
			DataElement.push(this.AroundMarkType);
			this.MkSAroundMarker(DataElement);
		}
		if (this.SetSPoint) this.Map.addOverlay(this.SetSPoint);
		if (this.SetEPoint) this.Map.addOverlay(this.SetEPoint);
		this.SearchFlag = true;
		this.EnvironmentInit();
	},
	MkMyList: function(DataArray, Func) {
		var SelectData = DataArray.shift().split('[TagSetBr]');
		Element.show('TypeSelectSection');
		this.SectionClear('TypeSelect');
		//TypeSelect
		var OptionElement = document.createElement('option');
		OptionElement.value = '-1';
		$('TypeSelect').appendChild(OptionElement);
		var TextNode = document.createTextNode('全部類別');
		OptionElement.appendChild(TextNode);
		for (var i=0; i<SelectData.length; i++) {
			var OptionArray = SelectData[i].split('[TagBr]');
			var OptionElement = document.createElement('option');
			OptionElement.value = OptionArray[0];
			$('TypeSelect').appendChild(OptionElement);
			var TextNode = document.createTextNode(OptionArray[1]);
			OptionElement.appendChild(TextNode);
		}
		$('TypeSelect').value = '-1';
		//MyListTitleSection
		Element.show('MyListTitleSection');
		//MyListInfoMain
		this.SectionClear('MyListInfoMain');
		this.getMyListArray = [];
		for (var i=0; i<DataArray.length; i++) {
			var DataElement = DataArray[i].split('[DataBr]');
			var TagTemp = DataElement[9].split('[TagSetBr]');
			var TagArray = [];
			for (var j=0; j<TagTemp.length; j++) TagArray.push(TagTemp[j].split('[TagBr]')[0]);
			DataElement.push(Func);
			
			var MyListRowElement = document.createElement('div');
			MyListRowElement.id = 'MyListRowElement#' + i;
			MyListRowElement.className = 'MyRouteRowElement';
			MyListRowElement.DataSet = DataElement;
			MyListRowElement.TagSet = TagArray;
			$('MyListInfoMain').appendChild(MyListRowElement);
			this.getMyListArray.push(MyListRowElement);
			
			var MyCP = document.createElement('div');
			MyCP.id = 'MyListCP#' + i;
			MyCP.className = 'MyRouteElement';
			MyCP.style.width = '115px';
			MyCP.innerHTML = this.TextLengthLimit(DataElement[0], 16);
			MyCP.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			MyCP.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			MyCP.onclick = function() {
				var FuncID = Number(this.id.replace('MyListCP#', ''));
				CurrentStatus.MkMyMarker(CurrentStatus.getMyListArray[FuncID].DataSet);
			}
			MyListRowElement.appendChild(MyCP);
			
			var MyDate = document.createElement('div');
			MyDate.className = 'MyRouteElement';
			//MyDate.style.width = '115px';
			MyDate.style.color = '#444444';
			MyDate.innerHTML = DataElement[8];
			MyListRowElement.appendChild(MyDate);
			
			var MyListEdit = document.createElement('div');
			MyListEdit.className = 'MyRouteElement';
			MyListEdit.style.width = '52px';
			MyListRowElement.appendChild(MyListEdit);
			
			if (Func == 'P20') {
				var LinkEdit = document.createElement('span');
				LinkEdit.id = 'MyListEdit#' + i;
				LinkEdit.style.float = 'left';
				LinkEdit.style.cursor = 'pointer';
				LinkEdit.innerHTML = '編輯';
				LinkEdit.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
				LinkEdit.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
				LinkEdit.onclick = function() { CurrentStatus.MyListClickAction(this.id); }
				MyListEdit.appendChild(LinkEdit);
			}//end if
			var LinkDel = document.createElement('span');
			LinkDel.id = 'MyListDel#' + i;
			LinkDel.style.float = 'left';
			LinkDel.style.cursor = 'pointer';
			LinkDel.style.marginLeft = (Func == 'P20') ? '2px' : '20px';
			LinkDel.innerHTML = '刪除';
			LinkDel.onmouseover = function() { this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
			LinkDel.onmouseout = function() { this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
			LinkDel.onclick = function() { CurrentStatus.MyListClickAction(this.id); }
			MyListEdit.appendChild(LinkDel);
		}
		Element.show('MyListInfoMain');
		
		$('TypeSelect').onchange = function() {
			var TagID = $F('TypeSelect');
			if (TagID == '-1') { for (var i=0; i<CurrentStatus.getMyListArray.length; i++) Element.show(CurrentStatus.getMyListArray[i]); return; }
			for (var i=0; i<CurrentStatus.getMyListArray.length; i++) {
				(CurrentStatus.getMyListArray[i].TagSet.indexOf(TagID) != -1) ? Element.show(CurrentStatus.getMyListArray[i]) : Element.hide(CurrentStatus.getMyListArray[i]);
			}//end for
		}
		CurrentStatus.InputsSwitch('Recover');
		(Func == 'P20') ? $('ListTypeA').checked = true : $('ListTypeB').checked = true;
		this.Map.clearOverlays();
		if (this.SetSPoint) this.Map.addOverlay(this.SetSPoint);
		if (this.SetEPoint) this.Map.addOverlay(this.SetEPoint);
	},
	MyListClickAction: function(FuncID) {
		var FuncArray = FuncID.split('#');
		var Type = FuncArray[0].replace('MyList', '');
		var DataSet = this.getMyListArray[Number(FuncArray[1])].DataSet;
		switch (Type) {
			case 'Edit':
				CurrentStatus.MkMyMarker(DataSet, 'Edit');
				break;
			case 'Del':
				var ElementPosArray = getPosition($(FuncID));
				ElementPosArray[0] += 25;
				ElementPosArray[1] -= 25;
				this.SectionClear('WarnTxt');
				
				var Msg = document.createElement('div');
				Msg.innerHTML = '確定刪除此地標？！';
				$('WarnTxt').appendChild(Msg);
				var BtnSection = document.createElement('div');
				BtnSection.style.marginTop = '5px';
				BtnSection.style.marginLeft = '15px';
				$('WarnTxt').appendChild(BtnSection);
				var BtnConfirm = document.createElement('div');
				BtnConfirm.id = 'WinWarn#Confirm#' + FuncArray[1];
				BtnConfirm.className = 'WinWarnConfirm';
				BtnConfirm.DelID = DataSet[10];
				BtnConfirm.onclick = function() {
					Element.hide('WinWarn');
					var hash = $H();
					hash['action'] = 'DelPOI';
					hash['hAccount'] = CurrentStatus.pc_id;
					hash['sUid'] = CurrentStatus.uid;
					hash['pId'] = this.DelID;
					hash['f'] = ($('ListTypeA').checked) ? 'P3' : 'P11';
					//alert(hash.toQueryString());
					CurrentStatus.DataListQuery(hash, 'Api_Locate');
				}
				BtnSection.appendChild(BtnConfirm);
				var BtnCancel = document.createElement('div');
				BtnCancel.id = 'WinWarn#Cancel#' + FuncArray[1];
				BtnCancel.className = 'WinWarnCancel';
				BtnCancel.onclick = function() { Element.hide('WinWarn'); };
				BtnSection.appendChild(BtnCancel);
				
				$('WinWarn').style.left = ElementPosArray[0] + 'px';
				$('WinWarn').style.top = ElementPosArray[1] + 'px';
				Element.show('WinWarn');
				//this.WarnTxt = '確定刪除此導航？！';
				//this.ShowWinWarn(ElementPosArray);
				break;
		}//end switch
	},
	StationMouseOver: function(Obj) {
		Obj.style.textDecoration = 'underline';
	},
	StationMouseOut: function(Obj) {
		Obj.style.textDecoration = 'none';
	},
	PlanBtnAction: function(FuncID) {
		FuncID = Number(FuncID.replace('PlanBtn#', ''));
		for (var i=0; i<this.PTRStatus[0]; i++) $('Plan'+i).className = 'RouteElementPTRN';
		$('Plan'+FuncID).className = 'RouteElementPTRNFunc';
		if (this.PTRStatus[1] == FuncID) return;
		this.PTRStatus[1] = FuncID;
		this.Map.clearOverlays();
		
		var PlanLatLng = this.PTRDataArray[FuncID][1].split('[break]');
		var LatLngArray = [];
		var LatLngTitle = [];
		for (var i=0; i<PlanLatLng.length; i++) {
			var LatLngElement = PlanLatLng[i].split('^');
			LatLngArray.push(LatLngElement);
		}//end for
		var SP = LatLngArray.shift();
		var EP = LatLngArray.pop();
		
		//Station Marker
		this.StationMarkerSet = [];
		for (var i=0; i<LatLngArray.length; i++) {
			var InfoElement = LatLngArray[i];
			var Description = InfoElement[3].split('[LineBr]');
			var DescriptionString = '';
			for (var j=0; j<Description.length; j++) DescriptionString += '<span class="IconConclusion">▲</span>' + Description[j] + '<br><br>';
			DescriptionString = DescriptionString.substr(0, DescriptionString.length-8);
			var marker = new UMarker(new ULatLng(InfoElement[1], InfoElement[2]), this.StationPoint);
			marker.addListener('mouseover', CurrentStatus.MarkerOver);
			marker.type = 'Station';
			marker.PosTitle = InfoElement[0];
			marker.Description = DescriptionString;
			this.Map.addOverlay(marker);
			this.StationMarkerSet.push(marker);
			this.PointAmt++;
		}//end for
		
		//Start End Marker
		var StartLatLng = new ULatLng(SP[1], SP[2]);
		var EndLatLng = new ULatLng(EP[1], EP[2]);
		var SouthWast = [Math.min(StartLatLng.lat(), EndLatLng.lat()), Math.max(StartLatLng.lng(), EndLatLng.lng())];
		var NouthEast = [Math.max(StartLatLng.lat(), EndLatLng.lat()), Math.min(StartLatLng.lng(), EndLatLng.lng())];
		var Bounds = new UBounds(new ULatLng(SouthWast[0], SouthWast[1]), new ULatLng(NouthEast[0], NouthEast[1]));
		Bounds.extend(StartLatLng);
		Bounds.extend(EndLatLng);
		this.MkSEMarker('S', StartLatLng, SP[0]);
		this.MkSEMarker('E', EndLatLng, EP[0]);
		this.SearchFlag = true;
		this.EnvironmentInit();
		this.ZoomClickAction(this.Map.getBoundsZoomLevel(Bounds), Bounds.getCenter());
	},
	StationLinkClick: function(Obj) {
		var LinkArray = Obj.id.split('#');
		LinkArray.shift();
		if (this.PTRStatus[1] != Number(LinkArray[0])) this.PlanBtnAction(LinkArray[0]);
		this.MarkerOver(this.StationMarkerSet[Number(LinkArray[1])-1]);
	},
	RouteClickAction: function(FuncID){
		var GetFather = FuncID.parentNode;
		var GetSection = $('RouteInfoMain').getElementsByTagName('div');
		for (var i=0; i<GetSection.length; i++) {
			if (GetFather == GetSection[i]) {
				GetSection[i].className = 'RouteElementFunc';
				this.Map.refreshMap();
				(i == (GetSection.length-1)) ? this.ZoomClickAction(this.ViewORoute[0], this.ViewORoute[1]) : this.ZoomClickAction(9, this.RouteLatLngSet[i]);
			} else GetSection[i].className = 'RouteElement';
		}//end for
		if (this.MapMode == 'Print') scrollTo(0, 0);
	},
	ShowWinIntro: function(Type, VarArray) {
		CurrentStatus.WinInfoHide();
		Element.hide('WinWarn');
		Element.hide('MRMenu');
		for (var i=0; i<this.WinIntroContentSet.length; i++) $(this.WinIntroContentSet[i]).hide();
		Element.show(Type);
		var PageSizeArray = getPageSize();
		var MainHeight = 0;
		$('Overlay').style.height = PageSizeArray[1] + 'px';
		switch (Type) {
			case 'WinIntroMain':
				var ViewPath = './img/DefaultView.gif';
				var Link;
				this.getWinIntroTitle.innerHTML = '地標介紹';
				var GetDivSet = $('WinIntroMain').getElementsByTagName('div');
				GetDivSet[3].innerHTML = '名稱： <span style="color:#ff0000">' + VarArray[0] + '</span>';
				GetDivSet[4].innerHTML = '地址： ' + VarArray[1];
				GetDivSet[5].innerHTML = '座標： <span style="color:#105cb6">緯度： ' + CurrentStatus.LatLngFormat(VarArray[2], 'Lat') + ' / 經度： ' + CurrentStatus.LatLngFormat(VarArray[3], 'Lng') + '</span>';
				GetDivSet[6].innerHTML = '標籤： ' + this.MkTagString(VarArray[7]);
				GetDivSet[7].innerHTML = '介紹： ' + VarArray[4];
				if (VarArray[5].length != 0) ViewPath = this.ReverseSpecialChars(VarArray[5]);
				if (VarArray[6].length != 0 ) Link = '<a href="' + this.ReverseSpecialChars(VarArray[6]) + '" target="_blank">' + VarArray[6] + '</a>';
				if (Link == undefined) Link = '';
				GetDivSet[8].innerHTML = '網址： ' + Link;
				$('WinIntroMain').getElementsByTagName('img')[0].src = ViewPath;
				MainHeight = 201;
				break;
			case 'AddMarkerMain':
				this.getWinIntroTitle.innerHTML = '新增地標';
				if (this.Marker.type == 'Search') { $('AddMarkerAddr').value = this.Marker.PosTitle.replace('定位至 ', ''); $('AddMarkerAddr').disabled = true; }
				else if (this.Marker.VarArray != undefined) { $('AddMarkerAddr').value = this.Marker.VarArray[1]; $('AddMarkerAddr').disabled = true; }
				else $('AddMarkerAddr').disabled = false;
				MainHeight = 346;
				break;
			case 'CollectMain':
				this.getWinIntroTitle.innerHTML = '加入收藏';
				MainHeight = 142;
				break;
			case 'SaveNaviMain':
				this.getWinIntroTitle.innerHTML = '儲存導航';
				MainHeight = 157;
				break;
			case 'WinIntroMyPOI':
				var ViewPath = './img/DefaultView.gif';
				var Link;
				this.getWinIntroTitle.innerHTML = '個人地標介紹';
				var GetDivSet = $('WinIntroMyPOI').getElementsByTagName('div');
				GetDivSet[3].innerHTML = '名稱： <span style="color:#ff0000">' + VarArray[0] + '</span>';
				GetDivSet[4].innerHTML = '地址： ' + VarArray[1];
				GetDivSet[5].innerHTML = '座標： <span style="color:#105cb6">緯度： ' + CurrentStatus.LatLngFormat(VarArray[2], 'Lat') + ' / 經度： ' + CurrentStatus.LatLngFormat(VarArray[3], 'Lng') + '</span>';
				GetDivSet[6].innerHTML = '標籤： ' + this.MkTagString(VarArray[9]);
				GetDivSet[7].innerHTML = '介紹： ' + VarArray[4];
				if (VarArray[5].length != 0) ViewPath = this.ReverseSpecialChars(VarArray[5]);
				if (VarArray[6].length != 0 ) Link = '<a href="' + this.ReverseSpecialChars(VarArray[6]) + '" target="_blank">' + VarArray[6] + '</a>';
				if (Link == undefined) Link = '';
				GetDivSet[8].innerHTML = '網址： ' + Link;
				$('WinIntroMyPOI').getElementsByTagName('img')[0].src = ViewPath;
				MainHeight = 201;
				break;
			case 'EditMyPOIMain':
				this.getWinIntroTitle.innerHTML = '編輯個人地標';
				MainHeight = 346;
				break;
			case 'Mail2Main':
				this.getWinIntroTitle.innerHTML = '寄給朋友--編輯信件';
				MainHeight = 449;
				break;
			case 'MailResultMain':
				$('MapLinkC').href = this.MailDataSet[2];
				this.getWinIntroTitle.innerHTML = '寄給朋友--完成傳送';
				$('ReceiverSection').innerHTML = this.MailDataSet[1];
				$('MailSenserSection').innerHTML =  this.MailDataSet[0] + ' 寄發一則地圖網址連結給你喔!!';
				$('MailContentSection').innerHTML = this.MailDataSet[0] + ' 寄發一則地圖網址連結給你喔!!<br>' + $('MailContentSection').innerHTML;
				MainHeight = 449;
				break;
		}//end switch
		$('WinIntro').style.left = Math.floor(PageSizeArray[0]/2 - 300) + 'px';
		$('WinIntro').style.top = Math.floor(PageSizeArray[1]/2 - MainHeight/2) + 'px';
		if (!$('WinIntro').visible()) new Effect.Appear('Overlay', { duration: 0.2, from: 0.0, to: 0.6, afterFinish: function(){ Element.show('WinIntro'); } });
	},
	MkTagString: function(Tag) {
		var TagTemp = Tag.split('[TagSetBr]');
		var TagString = '';
		for (var j=0; j<TagTemp.length; j++) TagString += TagTemp[j].split('[TagBr]')[1] + ' ';
		return TagString.substr(0, TagString.length-1);
	},
	HideOWin: function() {
		Element.hide('WinWarn');
		$('AddMarkerAddr').disable = false;
		$('AddMarkerAddr').value = '請輸入地標地址';
		Element.hide('WinIntro');
		new Effect.Fade('Overlay', { duration: 0.2 });
	},
	WinInfoClickAction: function(FuncID, Obj) {
		CurrentStatus.WinInfoHide();
		switch (FuncID) {
			case 0:
				this.Map.removeOverlay(this.SetSPoint);
				this.Marker.type = 'S';
				this.SetSPoint = this.Marker;
				this.SetSPoint.setIcon(this.StartPoint);
				$('RouteSP').value = (this.SetSPoint.PosTitle != undefined) ? this.SetSPoint.PosTitle.replace('定位至 ', '') : '自設路徑起點';
				$('RouteSP').style.color = '#444444';
				if (this.SetSPoint.VarArray != undefined && this.SetSPoint.VarArray[1].length != 0)  $('RouteSP').value = this.SetSPoint.VarArray[1];
				this.MenuClickAction('Menu#2');
				break;
			case 1:
				this.Map.removeOverlay(this.SetEPoint);
				this.Marker.type = 'E';
				this.SetEPoint = this.Marker;
				this.SetEPoint.setIcon(this.EndPoint);
				$('RouteEP').value = (this.SetEPoint.PosTitle != undefined) ? this.SetEPoint.PosTitle.replace('定位至 ', '') : '自設路徑終點';
				$('RouteEP').style.color = '#444444';
				if (this.SetEPoint.VarArray != undefined && this.SetEPoint.VarArray[1].length != 0)  $('RouteEP').value = this.SetEPoint.VarArray[1];
				this.MenuClickAction('Menu#2');
				break;
			case 2:
				this.SEPointSwitch();
				break;
			case 3:
				//show Famous
				$('WinIntroMainCollect').onclick = function() { if (this.className.indexOf('Block') != -1) return; CurrentStatus.WinInfoClickAction(5) };
				$('WinIntroMainAdd').onclick = function() { if (this.className.indexOf('Block') != -1) return; CurrentStatus.WinInfoClickAction(4); };
				$('WinIntroMainRecommend').onclick = function() {
					if (this.className.indexOf('Block') != -1) return;
					var hash = $H();
					hash['action'] = 'RecommendPOI';
					hash['hAccount'] = CurrentStatus.pc_id;
					hash['sUid'] = CurrentStatus.uid;
					hash['pId'] = CurrentStatus.Marker.VarArray[8];
					Element.hide('WinWarn');
					CurrentStatus.DataListQuery(hash, 'Api_Locate');
				}
				$('WinIntroMainMail2').onclick = function() { CurrentStatus.WinInfoClickAction(8); };
				if (Number(this.Marker.VarArray[9]) != 0) {
					$('WinIntroMainCollectAmt').innerHTML = '(' + this.Marker.VarArray[9] + ')';
					Element.show('WinIntroMainCollectAmt');
					$('WinIntroMainCollectAmt').onclick = function() {
						CurrentStatus.UsersPageNum = 1;
						CurrentStatus.GetFMUsers(CurrentStatus.Marker.VarArray, 0);
					}
				} else Element.hide('WinIntroMainCollectAmt');
				if (Number(this.Marker.VarArray[10]) != 0) {
					$('WinIntroMainRecommendAmt').innerHTML = '(' + this.Marker.VarArray[10] + ')';
					Element.show('WinIntroMainRecommendAmt');
					$('WinIntroMainRecommendAmt').onclick = function() {
						CurrentStatus.UsersPageNum = 1;
						CurrentStatus.GetFMUsers(CurrentStatus.Marker.VarArray, 1);
					}
				} else Element.hide('WinIntroMainRecommendAmt');
				
				if (!this.isMember) {
					$('WinIntroMainCollect').className = 'BtnAddPointBlock';
					$('WinIntroMainAdd').className = 'BtnNewPointBlock';
					$('WinIntroMainRecommend').className = 'BtnRecommendBlock';
				}
				this.ShowWinIntro('WinIntroMain', this.Marker.VarArray);
				break;
			case 4:
				//Addmarker
				if (Obj != undefined &&　Obj.className.indexOf('Block') != -1) return;
				this.ClearAction('AddMarker');
				this.ShowWinIntro('AddMarkerMain');
				break;
			case 5:
				//Collect
				if (Obj != undefined &&　Obj.className.indexOf('Block') != -1) return;
				$('SubmitCollect').onclick = function() { CurrentStatus.SearchCheck('CollectMarker'); };
				$('ClearCollect').onclick = function() { CurrentStatus.ClearAction('CollectMarker'); };
				this.ClearAction('CollectMain');
				this.ShowWinIntro('CollectMain');
				break;
			case 6:
				//show MyPoint
				$('BtnEditMyPOI').onclick = function() { CurrentStatus.WinInfoClickAction(7) };
				$('BtnMailMyPOI').onclick = function() { CurrentStatus.WinInfoClickAction(8); };
				(this.Marker.VarArray.last() != 'P20') ? Element.hide('BtnEditMyPOI') : Element.show('BtnEditMyPOI');
				this.ShowWinIntro('WinIntroMyPOI', this.Marker.VarArray);
				break
			case 7:
				//Edit MyPoint
				$('SubmitEditMyPOI').onclick = function() { CurrentStatus.SearchCheck('EditMyPOI'); };
				$('ClearEditMyPOI').onclick = function() { CurrentStatus.ClearAction('EditMyPOI'); };
				this.ClearAction('EditMyPOI');
				this.ShowWinIntro('EditMyPOIMain', this.Marker.VarArray);
				break;
			case 8:
				//Mail2Main
				$('ShowSenderName').innerHTML = '';
				var UrlParameter = this.MkUrlParameter();
				$('MapLinkA').href = 'http://map.pchome.com.tw/index.html?' + UrlParameter;
				$('MapLinkB').href = 'http://map.pchome.com.tw/index.html?' + UrlParameter;
				$('SubmitMail2').onclick = function() { CurrentStatus.SearchCheck('Mail2'); };
				$('ClearMail2').onclick = function() { CurrentStatus.ClearAction('Mail2'); };
				this.ClearAction('Mail2');
				this.ShowWinIntro('Mail2Main');
				break;
		}//end switch
	},
	WinInfoLinkMouseAction : function(mode, Obj) {
		if (Obj.className.indexOf('Block') != -1) return;
		if (mode == 1) {
			Obj.style.color = '#ff3300';
			Obj.style.textDecoration = 'underline';
		} else {
			Obj.style.color = '#105cb6';
			Obj.style.textDecoration = 'none';
		}//end if
	},
	GetFMUsers: function(DataArray, Mode) {
		this.FMUsersInfo = [];
		this.FMUsersInfo['pName'] = DataArray[0];
		this.FMUsersInfo['Type'] = Mode;
		this.FMUsersInfo['pId'] = DataArray[8];
		this.FMUsersType = Mode;
		this.FMUsersPageNum = 1;
		var hash = $H();
		hash['action'] = 'FMUsers';
		hash['pId'] = this.FMUsersInfo['pId'];
		hash['Type'] = this.FMUsersType;
		hash['MaxRows'] = this.FMUsersMaxRows;
		hash['PageNum'] = this.FMUsersPageNum;
		Element.hide('WinWarn');
		this.DataListQuery(hash, 'Api_Locate');
	},
	LatLngFormat: function(Digital, Mode) {
		var FormatArray = [];
		var Sign = '';
		Sign = (Mode == 'Lat') ? (Number(Digital) > 0) ? 'N' : 'S' : (Number(Digital) > 0) ? 'E' : 'W';
		var DigiArray = String(Digital).split('.');
		FormatArray[0] = DigiArray[0];
		var DigiTalNew = FormatArray[0] + '.' + DigiArray[1].substr(0, 5);
		var DigiMin = Number('0.' + DigiArray[1].substr(0, 5)) * 60;
		DigiArray = String(DigiMin).split('.');
		FormatArray[1] = DigiArray[0];
		FormatArray[2] =  Math.round(Number('0.' + DigiArray[1]) * 60);
		return FormatArray[0]+'° '+FormatArray[1]+"' "+FormatArray[2]+'" '+Sign+' ('+DigiTalNew+')';
	},
	MarkerOver: function(Marker) {
		if (CurrentStatus.MapMode == 'Print') return;
		$('MRMenu').style.display = 'none';
		CurrentStatus.Marker = (Marker != undefined) ? Marker : this;
		
		$('WinInfoBTR').update(CurrentStatus.PointTypeSet[CurrentStatus.Marker.type]);
		var ComposeContent = (CurrentStatus.Marker.PosTitle) ? '<b>' + CurrentStatus.Marker.PosTitle + '</b><br>' : '';
		if ((CurrentStatus.Marker.type == 'Famous' || CurrentStatus.Marker.type == 'MP' || CurrentStatus.Marker.type == 'Around') && CurrentStatus.Marker.VarArray[0].length != 0) ComposeContent += '地址:' + CurrentStatus.Marker.VarArray[1] + '<br>';
		if (CurrentStatus.Marker.type == 'Around') {
			if (CurrentStatus.Marker.VarArray[5].length > 0) ComposeContent += '電話:' + CurrentStatus.Marker.VarArray[5] + '<br>';
			//if (CurrentStatus.Marker.VarArray[4].length > 0) ComposeContent += '網址:' + CurrentStatus.Marker.VarArray[4] + '<br>';
		//} else ComposeContent += '緯度:' + CurrentStatus.Marker.getPoint().lat() + '<br>經度:' + CurrentStatus.Marker.getPoint().lng() + '<br>';
		} else ComposeContent += '緯度:' + CurrentStatus.LatLngFormat(CurrentStatus.Marker.getPoint().lat(), 'Lat') + '<br>經度:' + CurrentStatus.LatLngFormat(CurrentStatus.Marker.getPoint().lng(), 'Lng') + '<br>';
		var WinLink0 = '<span class="WinInfoLink0" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.RemoveMarker();">移除這個點</span>';
		switch (CurrentStatus.Marker.type) {
			case 'N':
				var WinLink1 = '<span class="WinInfoLink1" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.RemoveMarker(-1);">移除所有點</span>';
				ComposeContent += '<div>' + WinLink0 + WinLink1 + '</div>';
				var BlockSet = (CurrentStatus.isMember) ? '' : 'Block';
				ComposeContent += '<div><span class="WinInfoLink2' + BlockSet + '" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(4, this);">新增地標</span></div>';
				CurrentStatus.MapAction = 'NormalPoint';
				break;
			case 'Search':
				var WinLink1 = '<span class="WinInfoLink3" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(0);">設為起點</span>';
				ComposeContent += '<div>' + WinLink0 + WinLink1 + '</div>';
				var WinLink2 = '<span class="WinInfoLink4" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(1);">設為終點</span>';
				var BlockSet = (CurrentStatus.isMember) ? '' : 'Block';
				ComposeContent += '<div>' + WinLink2 + '<span class="WinInfoLink2' + BlockSet + '" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(4, this);">新增地標</span></div>';
				CurrentStatus.MapAction = 'addressing';
				break;
			case 'Station':
				$('WinInfoBTR').update(CurrentStatus.Marker.PosTitle);
				ComposeContent = CurrentStatus.Marker.Description;
				break;
			case 'Famous':
				var WinLink1 = '<span class="WinInfoLink3" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(0);">設為起點</span>';
				ComposeContent += '<div>' + WinLink0 + WinLink1 + '</div>';
				var WinLink2 = '<span class="WinInfoLink4" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(1);">設為終點</span>';
				var WinLink3 = '<span class="WinInfoLink5" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(3);">詳細資訊</span>';
				ComposeContent += '<div>' + WinLink2 + WinLink3 + '</div>';
				var BlockSet = (CurrentStatus.isMember) ? '' : 'Block';
				ComposeContent += '<div><span class="WinInfoLink6' + BlockSet + '" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(5, this);">加入收藏</span></div>';
				CurrentStatus.MapAction = 'FamousPoint';
				break;
			case 'MP':
				var WinLink1 = '<span class="WinInfoLink3" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(0);">設為起點</span>';
				ComposeContent += '<div>' + WinLink0 + WinLink1 + '</div>';
				var WinLink2 = '<span class="WinInfoLink4" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(1);">設為終點</span>';
				var WinLink3 = '<span class="WinInfoLink5" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(6);">詳細資訊</span>';
				ComposeContent += '<div>' + WinLink2 + WinLink3 + '</div>';
				CurrentStatus.MapAction = 'MyPoint';
				break;
			case 'Around':
				var WinLink1 = '<span class="WinInfoLink1" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.RemoveMarker(-1);">移除所有點</span>';
				ComposeContent += '<div>' + WinLink0 + WinLink1 + '</div>';
				var WinLink2 = '<span class="WinInfoLink3" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(0);">設為起點</span>';
				var WinLink3 = '<span class="WinInfoLink4" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(1);">設為終點</span>';
				ComposeContent += '<div>' + WinLink2 + WinLink3 + '</div>';
				CurrentStatus.MapAction = 'AroundPoint';
				break;
			default:
				var WinLink1 = '<span class="WinInfoLink7" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(2);">起點終點對調</span>';
				ComposeContent += '<div>' + WinLink0 + WinLink1 + '</div>';
				var BlockSet = (CurrentStatus.isMember) ? '' : 'Block';
				ComposeContent += '<div><span class="WinInfoLink2' + BlockSet + '" onmouseover="CurrentStatus.WinInfoLinkMouseAction(1, this);" onmouseout="CurrentStatus.WinInfoLinkMouseAction(0, this);" onclick="CurrentStatus.WinInfoClickAction(4, this);">新增地標</span></div>';
				CurrentStatus.MapAction = 'None';
		}//end switch
		var WinHeight = CurrentStatus.WinInfoBInit(ComposeContent) - 4;
		var PosTrans = CurrentStatus.Map.transformLatLngToContainerCoordinates(CurrentStatus.Marker.getPoint());
		var MouseX = PosTrans.x - 11;
		var MouseY = PosTrans.y - 24;
		var CentalX = CurrentStatus.MapWidth/2;
		var CentalY = CurrentStatus.MapHeight/2;
		var MenuX, MenuY;
		var FlagX = FlagY = false;
		if (MouseX < (CurrentStatus.InnerBlock + 96) || MouseX > (CurrentStatus.MapWidth - CurrentStatus.InnerBlock - 96)) {
			FlagX = true;
			if (MouseX < (CurrentStatus.InnerBlock + 96)) {
				MenuX = CurrentStatus.InnerBlock;
				CentalX -= CurrentStatus.InnerBlock + 96 - MouseX;
			} else {
				MenuX = CurrentStatus.MapWidth - CurrentStatus.InnerBlock - 213;
				CentalX += (CurrentStatus.InnerBlock + 117) - (CurrentStatus.MapWidth - MouseX);
			}//end if
		} else MenuX = MouseX - 96;
		MenuX += CurrentStatus.MapPosX;
		
		if (MouseY < (CurrentStatus.InnerBlock + WinHeight) || MouseY > (CurrentStatus.MapHeight - CurrentStatus.InnerBlock)) {
			FlagY = true;
			if (MouseY < (CurrentStatus.InnerBlock + WinHeight)) {
				MenuY = CurrentStatus.InnerBlock;
				CentalY -= CurrentStatus.InnerBlock + WinHeight - MouseY;
			} else {
				MenuY = CurrentStatus.MapHeight - CurrentStatus.InnerBlock - WinHeight;
				CentalY += MouseY - (CurrentStatus.MapHeight - CurrentStatus.InnerBlock);
			}//end if
		} else MenuY = MouseY - WinHeight;
		MenuY += CurrentStatus.MapPosY;
		
		//shift map
		if (FlagX || FlagY) {
			var NewCenter = CurrentStatus.Map.transformContainerCoordinatesToLatLng(new UPoint(CentalX, CentalY));
			CurrentStatus.Map.centerAndZoom(NewCenter, CurrentStatus.MapZoom);
		}
		
		$('WinInfoB').style.left = MenuX + 'px';
		$('WinInfoB').style.top = MenuY + 'px';
		Element.show('WinInfoB');
	},
	MapMouseDownAction: function(e) {
		var MouseStatus;
		CurrentStatus.WinInfoHide();
		Element.hide('WinWarn');
		if (window.event && window.event.srcElement) MouseStatus = window.event.button;
		else if (e && e.target) MouseStatus = e.button;
		if (MouseStatus != 2) { $('MRMenu').style.display = 'none'; return; }
		this.EnvironmentInit();
		var PageScroll = getPageScroll();
		var MouseX = (this.Browser.indexOf('ie') != -1) ? window.event.x : e.pageX;
		var MouseY;
		if (this.Browser.indexOf('ie') != -1) {
			MouseY = window.event.y + PageScroll[1];
		} else MouseY = e.pageY;
		MouseX -= this.MapPosX;
		MouseY -= this.MapPosY;
		var PosTrans = this.Map.transformContainerCoordinatesToLatLng(new UPoint(MouseX, MouseY));
		this.SetPoint = PosTrans;
		var CentalX = this.MapWidth/2;
		var CentalY = this.MapHeight/2;
		var MRMenuWidthHelf = (this.MRMenuWidth-1)/2;
		var MenuX, MenuY;
		var FlagX = FlagY = false;
		if (MouseX < (this.InnerBlock + MRMenuWidthHelf) || MouseX > (this.MapWidth - this.InnerBlock - MRMenuWidthHelf)) {
			FlagX = true;
			if (MouseX < (this.InnerBlock + MRMenuWidthHelf)) {
				MenuX = this.InnerBlock;
				CentalX -= this.InnerBlock + MRMenuWidthHelf - MouseX;
			} else {
				MenuX = this.MapWidth - this.InnerBlock - this.MRMenuWidth;
				CentalX += (this.InnerBlock + MRMenuWidthHelf) - (this.MapWidth - MouseX);
			}//end if
		} else MenuX = MouseX - MRMenuWidthHelf;
		MenuX += this.MapPosX;
		
		if (MouseY < (this.InnerBlock + this.MRMenuHeight) || MouseY > (this.MapHeight - this.InnerBlock)) {
			FlagY = true;
			if (MouseY < (this.InnerBlock + this.MRMenuHeight)) {
				MenuY = this.InnerBlock;
				CentalY -= this.InnerBlock + this.MRMenuHeight - MouseY;
			} else {
				MenuY = this.MapHeight - this.InnerBlock - this.MRMenuHeight;
				CentalY += MouseY - (this.MapHeight - this.InnerBlock);
			}//end if
		} else MenuY = MouseY - this.MRMenuHeight;
		MenuY += this.MapPosY;
		
		//shift map
		if (FlagX || FlagY) {
			var NewCenter = this.Map.transformContainerCoordinatesToLatLng(new UPoint(CentalX, CentalY));
			this.Map.centerAndZoom(NewCenter, this.MapZoom);
		}
		
		//Menu
		$('MRMenu').style.display = 'block';
		$('MRMenu').style.left = MenuX + 'px';
		$('MRMenu').style.top = MenuY +'px';
	},
	SectionClear: function(SectionID) {
		while ($(SectionID).childNodes.length > 0) $(SectionID).removeChild($(SectionID).firstChild);
	},
	ClearDefault: function (funcid, content) {
		Element.hide('WinWarn');
		if ($F(funcid) == content) $(funcid).value = '';
		$(funcid).style.color = '#444444'; 
	},
	RecoverDefault: function (funcid, content) {
		if ($F(funcid) == '') { $(funcid).value = content; $(funcid).style.color = '#b2b2b2'; }
	},
	InputFix: function (FieldID) {
		$(FieldID).value = $F(FieldID).replace(/^\s*|\s*$/g, ''); //trim
		$(FieldID).value = $F(FieldID).replace(/'/g, '');
		$(FieldID).value = $F(FieldID).stripScripts();
		$(FieldID).value = $F(FieldID).stripTags();
	},
	InfoFilter: function(Info) {
		Info = Info.replace('[b]', '<b>');
		Info = Info.replace('[/b]', '</b>');
		Info = Info.replace(/，/g, ',');
		return Info;
	},
	InputsSwitch: function(Mode) {
		var OInputs = document.getElementsByTagName('input');
		var OTextareas = document.getElementsByTagName('textarea');
		if (Mode == 'Block') {
			$('Overlay').onclick = '';
			this.SearchBFlag = true;
			for (var i=0; i<OInputs.length; i++) OInputs[i].disabled = true;
			for (var i=0; i<OTextareas.length; i++) OTextareas[i].disabled = true;
		} else {
			$('Overlay').onclick = function() { CurrentStatus.HideOWin(); };
			this.SearchBFlag = false;
			for (var i=0; i<OInputs.length; i++) OInputs[i].disabled = false;
			for (var i=0; i<OTextareas.length; i++) OTextareas[i].disabled = false;
		}//end if
	},
	ReverseSpecialChars: function(Content) {
		Content = Content.replace(/&amp;/g, '&');
		Content = Content.replace(/&quot;/g, '"');
		Content = Content.replace(/&#039;/g, "'");
		Content = Content.replace(/&lt;/g, '<');
		Content = Content.replace(/&gt;/g, '>');
		return Content;
	},
	CalculateTxt: function(EventTitle) {
		var lengthTmp = 0;
		for (var i=0; i<EventTitle.length; i++) {
			if ((EventTitle.charCodeAt(i) >= 33 && EventTitle.charCodeAt(i) <= 255) || (EventTitle.charAt(i) == ' ')) {
				lengthTmp += 1;
			} else {
				lengthTmp += 2;
			}
		}//end for
		return lengthTmp;
	},
	TextLengthLimit: function(Content, LengthLimit) {
		var NewContent = '';
		var LengthTmp = 0;
		var LengthNow = this.CalculateTxt(Content);
		if (LengthNow >= LengthLimit) {
			for (var i=0; i<Content.length; i++) {
				LengthTmp = ((Content.charCodeAt(i) >= 33 && Content.charCodeAt(i) <= 255) || Content.charCodeAt(i) == ' ') ? LengthTmp + 1 : LengthTmp + 2;
				if (LengthTmp <= LengthLimit) NewContent += Content.charAt(i); else break;
			}
			NewContent += '...';
		} else NewContent = Content;
		return NewContent;
	},
	GetKeyCode: function(e) {
		var KeyCode;
		if (window.event && window.event.srcElement)
			KeyCode = window.event.keyCode;
		else if (e && e.target)
			KeyCode = e.keyCode;
		return KeyCode;
	},
	PagesRegister: function(PageStatus, SectionID) {
		var PageStatusArray = PageStatus.split('^');
		for (var i=0; i<PageStatusArray.length; i++) PageStatusArray[i] = Number(PageStatusArray[i]);
		this[SectionID+'PageNum'] = PageStatusArray[0];
		this[SectionID+'TotalPages'] = PageStatusArray[1];
		
		//PagesSevtion
		this.SectionClear(SectionID+'PagesSection');
		var PagesSection = $(SectionID+'PagesSection');
		var LastTen = document.createElement('span');
		LastTen.id = 'LastTen#' + SectionID;
		if (PageStatusArray[0]-10 <= 0) {
			LastTen.className = 'PageLinkBlock';
			LastTen.style.cursor = 'not-allowed';
		} else {
			LastTen.className = 'PageLink';
			LastTen.style.cursor = 'pointer';
		}
		LastTen.innerHTML = '上<b>10</b>頁';
		LastTen.onmouseover = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
		LastTen.onmouseout = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
		LastTen.onclick = function() { if (this.className == 'PageLinkBlock') return; CurrentStatus.GoPages(this.id); };
		PagesSection.appendChild(LastTen);
		
		var LastPage = document.createElement('span');
		LastPage.id = 'LastPage#' + SectionID;
		if (PageStatusArray[0]-1 <= 0) {
			LastPage.className = 'PageLinkBlock';
			LastPage.style.cursor = 'not-allowed';
		} else {
			LastPage.className = 'PageLink';
			LastPage.style.cursor = 'pointer';
		}
		LastPage.style.marginLeft = '4px';
		LastPage.innerHTML = '上一頁';
		LastPage.onmouseover = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
		LastPage.onmouseout = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
		LastPage.onclick = function() { if (this.className == 'PageLinkBlock') return; CurrentStatus.GoPages(this.id); };
		PagesSection.appendChild(LastPage);
		
		var Slash = document.createElement('span');
		Slash.className = 'PageLinkBlock';
		Slash.style.marginLeft = '4px';
		Slash.innerHTML = '/';
		PagesSection.appendChild(Slash);
		
		var NextPage = document.createElement('span');
		NextPage.id = 'NextPage#' + SectionID;
		if (PageStatusArray[0]+1 > PageStatusArray[1]) {
			NextPage.className = 'PageLinkBlock';
			NextPage.style.cursor = 'not-allowed';
		} else {
			NextPage.className = 'PageLink';
			NextPage.style.cursor = 'pointer';
		}
		NextPage.style.marginLeft = '4px';
		NextPage.innerHTML = '下一頁';
		NextPage.onmouseover = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
		NextPage.onmouseout = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
		NextPage.onclick = function() { if (this.className == 'PageLinkBlock') return; CurrentStatus.GoPages(this.id); };
		PagesSection.appendChild(NextPage);
		
		var NextTen = document.createElement('span');
		NextTen.id = 'NextTen#' + SectionID;
		if (PageStatusArray[0]+10 > PageStatusArray[1]) {
			NextTen.className = 'PageLinkBlock';
			NextTen.style.cursor = 'not-allowed';
		} else {
			NextTen.className = 'PageLink';
			NextTen.style.cursor = 'pointer';
		}
		NextTen.style.marginLeft = '4px';
		NextTen.innerHTML = '下<b>10</b>頁';
		NextTen.onmouseover = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
		NextTen.onmouseout = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
		NextTen.onclick = function() { if (this.className == 'PageLinkBlock') return; CurrentStatus.GoPages(this.id); };
		PagesSection.appendChild(NextTen);
		
		//PagesInfo
		this.SectionClear(SectionID+'PagesInfo');
		var PagesInfo = $(SectionID+'PagesInfo');
		var FirstPage = document.createElement('span');
		FirstPage.id = 'FirstPage#' + SectionID;
		if (PageStatusArray[0] == 1) {
			FirstPage.className = 'PageLinkBlock';
			FirstPage.style.cursor = 'not-allowed';
		} else {
			FirstPage.className = 'PageLink';
			FirstPage.style.cursor = 'pointer';
		}
		FirstPage.innerHTML = '<span class="PageLinkBlock">【</span>第一頁<span class="PageLinkBlock">】</span>';
		FirstPage.onmouseover = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
		FirstPage.onmouseout = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
		FirstPage.onclick = function() { if (this.className == 'PageLinkBlock') return; CurrentStatus.GoPages(this.id); };
		PagesInfo.appendChild(FirstPage);
		
		var Infos = document.createElement('span');
		Infos.className = 'PageLinkBlock';
		Infos.style.marginLeft = '4px';
		Infos.innerHTML = 'Page ' + PageStatusArray[0] + ' of ' + PageStatusArray[1];
		PagesInfo.appendChild(Infos);
		
		var FinalPage = document.createElement('span');
		FinalPage.id = 'FinalPage#' + SectionID;
		if (PageStatusArray[0] == PageStatusArray[1]) {
			FinalPage.className = 'PageLinkBlock';
			FinalPage.style.cursor = 'not-allowed';
		} else {
			FinalPage.className = 'PageLink';
			FinalPage.style.cursor = 'pointer';
		}
		FinalPage.innerHTML = '<span class="PageLinkBlock">【</span>最末頁<span class="PageLinkBlock">】</span>';
		FinalPage.onmouseover = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#ff3300'; this.style.textDecoration = 'underline'; };
		FinalPage.onmouseout = function() { if (this.className == 'PageLinkBlock') return; this.style.color = '#105cb6'; this.style.textDecoration = 'none'; };
		FinalPage.onclick = function() { if (this.className == 'PageLinkBlock') return; CurrentStatus.GoPages(this.id); };
		PagesInfo.appendChild(FinalPage);
		
		//Hide PagesSection when TotalPage is 1
		if (PageStatusArray[1] == 1) {
			Element.hide(PagesSection);
			Element.hide(PagesInfo);
		} else {
			Element.show(PagesSection);
			Element.show(PagesInfo);
		}//end if
	},
	GoPages: function(FuncID) {
		var FuncArray = FuncID.split('#');
		var FuncType = FuncArray[1];
		this.MenuClickAction('Menu#7');
		var hash = $H();
		hash['action'] = FuncType;
		hash['MaxRows'] = this[FuncType+'MaxRows'];
		//hash['Type'] = this.FamousMarkTypeSet[this.FamousMarkType];
		hash['Type'] = this[FuncType+'TypeSet'][this[FuncType+'Type']];
		switch (FuncArray[0]) {
			case 'LastTen':
				this[FuncType+'PageNum'] -= 10;
				break;
			case 'LastPage':
				this[FuncType+'PageNum'] -= 1;
				break;
			case 'NextPage':
				this[FuncType+'PageNum'] += 1;
				break;
			case 'NextTen':
				this[FuncType+'PageNum'] += 10;
				break;
			case 'FirstPage':
				this[FuncType+'PageNum'] = 1;
				break;
			case 'FinalPage':
				this[FuncType+'PageNum'] = this[FuncType+'TotalPages'];
				break;
		}//end switch
		hash['PageNum'] = this[FuncType+'PageNum'];
		if (FuncType == 'FMUsers') hash['pId'] = this.FMUsersInfo['pId'];
		if (FuncType == 'UserPOIs') hash['uId'] = this.FMUsersInfo['uId'];
		if (FuncType == 'ListPOIs') hash['keyword'] = this.Keyword;
		this.DataListQuery(hash, 'Api_Locate');
	},
	DataListQuery: function(Vars, Api) {
		var req = new Ajax.Request('./api/'+ Api +'.php',
									{method: 'post',
									 parameters: Vars.toQueryString(),
									 onComplete: CurrentStatus.QueryDone
									});
	},
	QueryDone: function(r) {
		CurrentStatus.SearchBFlag = false;
		CurrentStatus.LoadingStatus('hide');
		var DataArray = r.responseText.split('\n').without('\r', '\n', '');
		var ReturnMsg = DataArray.shift();
		CurrentStatus.MapAction = 'None';
		switch (ReturnMsg) {
			case 'addressingErrorEmpty':
				var ElementPosArray = getPosition($('SearchSection'));
				ElementPosArray[0] += 290;
				ElementPosArray[1] -= 9;
				CurrentStatus.WarnTxt = '請輸入關鍵字';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'addressingErrorNone':
				var ElementPosArray = getPosition($('SearchSection'));
				ElementPosArray[0] += 290;
				ElementPosArray[1] -= 9;
				CurrentStatus.WarnTxt = '很抱歉，您輸入的地點無法找到，請重新輸入。';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'addressingSuccess':
				CurrentStatus.MapAction = 'addressing';
				var LatLng = DataArray[0].split('^');
				var PosTitle = LatLng.pop();
				LatLng = new ULatLng(LatLng[0], LatLng[1]);
				CurrentStatus.MkSearchMarker(LatLng, PosTitle);
				break;
			case 'RouteActionErrorSPEmpty':
				var ElementPosArray = getPosition($('RouteSection'));
				ElementPosArray[0] += 270;
				ElementPosArray[1] -= 23;
				CurrentStatus.WarnTxt = '請輸入起點地址';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'RouteActionErrorEPEmpty':
				var ElementPosArray = getPosition($('RouteSection'));
				ElementPosArray[0] += 270;
				ElementPosArray[1] += 3;
				CurrentStatus.WarnTxt = '請輸入終點地址';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'RouteActionErrorSPNone':
				var ElementPosArray = getPosition($('RouteSection'));
				ElementPosArray[0] += 270;
				ElementPosArray[1] -= 23;
				CurrentStatus.WarnTxt = '很抱歉，您輸入的起點無法找到，請重新輸入。';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'RouteActionErrorEPNone':
				var ElementPosArray = getPosition($('RouteSection'));
				ElementPosArray[0] += 270;
				ElementPosArray[1] += 3;
				CurrentStatus.WarnTxt = '很抱歉，您輸入的終點無法找到，請重新輸入。';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'RouteActionErrorNone':
				var ElementPosArray = getPosition($('RouteSection'));
				ElementPosArray[0] += 270;
				ElementPosArray[1] -= 10;
				CurrentStatus.WarnTxt = '很抱歉，您輸入的路線無法進行規劃，請重新輸入。';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'routingSuccess':
				CurrentStatus.MapAction = 'routing';
				CurrentStatus.MkRoute(DataArray);
				break;
			case 'PTRoutingSuccess':
				CurrentStatus.MapAction = 'PTRouting';
				CurrentStatus.MkPTRoute(DataArray);
				break;
			case 'FamousMarkSuccess':
				var PageInfo = DataArray.shift();
				CurrentStatus.PagesRegister(PageInfo, 'FamousMark');
				CurrentStatus.MkFamousMark(DataArray);
				break;
			case 'AroundMarkSuccess':
				var PageInfo = DataArray.shift();
				CurrentStatus.PagesRegister(PageInfo, 'AroundMark');
				CurrentStatus.MkAroundMark(DataArray);
				break;
			case 'SaveNaviErrorSPLen':
				var ElementPosArray = getPosition($('SaveNaviSP'));
				ElementPosArray[0] += 230;
				ElementPosArray[1] -= 23;
				this.WarnTxt = '起點名稱長度限制10個字以內(且不可為空)';
				$('SaveNaviSP').value = $F('SaveNaviSP').substr(0, 10);
				this.ShowWinWarn(ElementPosArray);
				CurrentStatus.InputsSwitch('Recover');
				break;
			case 'SaveNaviErrorEPLen':
				var ElementPosArray = getPosition($('SaveNaviSP'));
				ElementPosArray[0] += 230;
				ElementPosArray[1] -= 23;
				this.WarnTxt = '終點名稱長度限制10個字以內(且不可為空)';
				$('SaveNaviEP').value = $F('SaveNaviEP').substr(0, 10);
				this.ShowWinWarn(ElementPosArray);
				CurrentStatus.InputsSwitch('Recover');
				break;
			case 'SaveNaviSuccess':
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.HideOWin();
				break;
			case 'SaveNaviError':
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.HideOWin();
				break;
			case 'QueryNaviError':
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.HideOWin();
				break;
			case 'QueryNaviSuccess':
				if (DataArray.length <= 0) {
					var ElementPosArray = getPosition($('RouteMenu#2'));
					ElementPosArray[0] += 53;
					ElementPosArray[1] -= 27;
					CurrentStatus.WarnTxt = '您尚未儲存任何路線。';
					CurrentStatus.ShowWinWarn(ElementPosArray);
					return;
				}//end if
				CurrentStatus.MkMyRoute(DataArray);
				break;
			case 'DelNaviError':
				break;
			case 'AddMarkerErrorName':
				CurrentStatus.InputsSwitch('Recover');
				var ElementPosArray = getPosition($('AddMarkerName'));
				ElementPosArray[0] += 230;
				ElementPosArray[1] -= 23;
				CurrentStatus.WarnTxt = '請輸入地標名稱(本欄位為必填欄位)';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'AddMarkerErrorAddr':
				CurrentStatus.InputsSwitch('Recover');
				var ElementPosArray = getPosition($('AddMarkerAddr'));
				ElementPosArray[0] += 230;
				ElementPosArray[1] -= 23;
				CurrentStatus.WarnTxt = '請輸入地標地址(本欄位為必填欄位)';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'AddMarkerErrortName':
				CurrentStatus.InputsSwitch('Recover');
				var ElementPosArray = getPosition($('AddMarkerTag'));
				ElementPosArray[0] += 230;
				ElementPosArray[1] -= 23;
				CurrentStatus.WarnTxt = '請輸入標籤(本欄位為必填欄位)';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'AddMarkerErrorInsert':
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.HideOWin();
				break;
			case 'AddMarkerSuccess':
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.HideOWin();
				//Update MyList
				$('ListTypeA').checked = true;
				CurrentStatus.SectionClear('MyListInfoMain');
				CurrentStatus.MenuClickAction('Menu#0');
				break;
			case 'CollectMarkerErrortName':
				CurrentStatus.InputsSwitch('Recover');
				var ElementPosArray = getPosition($('CollectTag'));
				ElementPosArray[0] += 230;
				ElementPosArray[1] -= 23;
				CurrentStatus.WarnTxt = '請輸入標籤(本欄位為必填欄位)';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'CollectMarkerErrorInsert':
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.HideOWin();
				break;
			case 'CollectMarkerSuccess':
				//alert('CollectMarkerSuccess');
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.HideOWin();
				//Update MyList
				$('ListTypeB').checked = true;
				CurrentStatus.SectionClear('MyListInfoMain');
				CurrentStatus.MenuClickAction('Menu#0');
				break;
			case 'RecommendPOIError':
				CurrentStatus.HideOWin();
				break;
			case 'RecommendPOISuccess':
				CurrentStatus.HideOWin();
				break;
			case 'QueryMyListError':
				CurrentStatus.InputsSwitch('Recover');
				break;
			case 'QueryMyListSuccess':
				(DataArray.length > 0) ? CurrentStatus.MkMyList(DataArray, 'P20') : CurrentStatus.InputsSwitch('Recover');
				break;
			case 'QueryMyListCollectSuccess':
				(DataArray.length > 0) ? CurrentStatus.MkMyList(DataArray, 'P23') : CurrentStatus.InputsSwitch('Recover');
				break;
			case 'DelPOIError':
				break;
			case 'DelPOISuccess':
				CurrentStatus.MyListQuery();
				break;
			case 'DelPOICollectSuccess':
				CurrentStatus.MyListQuery();
				break;
			case 'EditMyPOIErrorName':
				CurrentStatus.InputsSwitch('Recover');
				var ElementPosArray = getPosition($('EditMyPOIName'));
				ElementPosArray[0] += 230;
				ElementPosArray[1] -= 23;
				CurrentStatus.WarnTxt = '請輸入地標名稱(本欄位為必填欄位)';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'EditMyPOIErrorAddr':
				CurrentStatus.InputsSwitch('Recover');
				var ElementPosArray = getPosition($('EditMyPOIAddr'));
				ElementPosArray[0] += 230;
				ElementPosArray[1] -= 23;
				CurrentStatus.WarnTxt = '請輸入地標地址(本欄位為必填欄位)';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'EditMyPOIErrortName':
				CurrentStatus.InputsSwitch('Recover');
				var ElementPosArray = getPosition($('EditMyPOITag'));
				ElementPosArray[0] += 230;
				ElementPosArray[1] -= 23;
				CurrentStatus.WarnTxt = '請輸入標籤(本欄位為必填欄位)';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'EditMyPOIErrorInsert':
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.HideOWin();
				break;
			case 'EditMyPOISuccess':
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.HideOWin();
				//Update MyList
				$('ListTypeA').checked = true;
				CurrentStatus.SectionClear('MyListInfoMain');
				CurrentStatus.MenuClickAction('Menu#0');
				break;
			case 'APQueryError':
				break;
			case 'APQuerySuccess':
				//alert('APQuerySuccess'+' '+DataArray);
				//alert('APQuerySuccess');
				CurrentStatus.MkAPs(DataArray);
				break;
			case 'MailSuccess':
				CurrentStatus.InputsSwitch('Recover');
				CurrentStatus.ShowWinIntro('MailResultMain');
				break;
			case 'MailError':
				CurrentStatus.InputsSwitch('Recover');
				var ElementPosArray = getPosition($('ReceiverMail'));
				ElementPosArray[0] += 450;
				CurrentStatus.WarnTxt = 'eMail格式錯誤，請再次檢查。';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'FMUsersError':
				CurrentStatus.HideOWin();
				break;
			case 'FMUsersSuccess':
				var PageInfo = DataArray.shift();
				CurrentStatus.PagesRegister(PageInfo, 'FMUsers');
				CurrentStatus.MkFMUsers(DataArray);
				break;
			case 'UserPOIsError':
				CurrentStatus.MenuClickAction('Menu#2');
				break;
			case 'UserPOIsSuccess':
				var PageInfo = DataArray.shift();
				CurrentStatus.PagesRegister(PageInfo, 'UserPOIs');
				CurrentStatus.MkUserPOIs(DataArray);
				break;
			case 'UserPOIsAmtQueryError':
				CurrentStatus.MenuClickAction('Menu#2');
				break;
			case 'UserPOIsAmtQuerySuccess':
				CurrentStatus.SetFMUserPOIsMenu(DataArray);
				break;
			case 'ListPOIsError':
				var ElementPosArray = getPosition($('SearchSection'));
				ElementPosArray[0] += 290;
				ElementPosArray[1] -= 9;
				CurrentStatus.WarnTxt = '很抱歉，您輸入的地點無法找到，請重新輸入。';
				CurrentStatus.ShowWinWarn(ElementPosArray);
				break;
			case 'ListPOIsSuccess':
				var PageInfo = DataArray.shift();
				CurrentStatus.PagesRegister(PageInfo, 'ListPOIs');
				CurrentStatus.MkListPOIs(DataArray);
				break;
			default:
				//alert(r.responseText);
				CurrentStatus.InputsSwitch('Recover');
		}//end switch
	},
	ShowWinWarn: function(ElementPosArray) {
		$('WinWarn').style.left = ElementPosArray[0] + 'px';
		$('WinWarn').style.top = ElementPosArray[1] + 'px';
		$('WarnTxt').update(this.WarnTxt);
		Element.show('WinWarn');
	},
	LoadingStatus: function(Mode) {
		if (Mode == 'show') {
			//show
			this.SearchBFlag = true;
			$('LoadingSection').style.left = this.MapPosX + this.InnerBlock + 5 + 'px';
			$('LoadingSection').style.top = this.MapPosY + 5 + 'px';
			Element.show('LoadingSection');
			$('Search').disabled = true;
			$('RouteSP').disabled = true;
			$('RouteEP').disabled = true;
			if (this.MapMode != 'Print') {
				this.getMRMenuArray[0].className = 'MRMenuElementBlock';
				this.getMRMenuArray[1].className = 'MRMenuElementBlock';
			}//end if
		} else {
			//hide
			this.SearchBFlag = false;
			Element.hide('LoadingSection');
			$('Search').disabled = false;
			$('RouteSP').disabled = false;
			$('RouteEP').disabled = false;
			if (this.MapMode != 'Print') {
				this.getMRMenuArray[0].className = 'MRMenuElementOut';
				this.getMRMenuArray[1].className = 'MRMenuElementOut';
			}//end if
		}//end if
	},
	FamousMarkMenuInit: function(FuncID) {
		if (!$('FamousMarkMenuSection')) return;
		for (var i=0; i<this.FamousMarkMenuSet.length; i++) {
			var MenuElement = document.createElement('div');
			MenuElement.id = 'FamousMarkMenu#' + i;
			MenuElement.className = 'RouteMenuElement';
			MenuElement.innerHTML = this.FamousMarkMenuSet[i];
			MenuElement.onmouseover = function() { if (this.className == 'RouteMenuElementBlock') return; this.className = 'RouteMenuElementOver'; };
			MenuElement.onmouseout = function() { if (this.className == 'RouteMenuElementBlock') return; this.className = 'RouteMenuElement'; };
			MenuElement.onclick = function() {  if (this.className == 'RouteMenuElementBlock') return; CurrentStatus.OMenuClickAction(this.id); };
			$('FamousMarkMenuSection').appendChild(MenuElement);
			this.getFamousMarkMenuArray.push(MenuElement);
			var BlockElement = document.createElement('div');
			BlockElement.className = 'MenuBlock';
			BlockElement.innerHTML = '/';
			$('FamousMarkMenuSection').appendChild(BlockElement);
		}//end for
		$('FamousMarkMenuSection').removeChild($('FamousMarkMenuSection').lastChild);
		//QueryData
		this.OMenuClickAction(FuncID);
	},
	AroundMarkMenuInit: function(FuncID) {
		if (!$('AroundMarkMenuSection')) return;
		for (var i=0; i<this.AroundMarkMenuSet.length; i++) {
			var MenuElement = document.createElement('div');
			MenuElement.id = 'AroundMarkMenu#' + i;
			MenuElement.className = 'RouteMenuElement';
			MenuElement.innerHTML = this.AroundMarkMenuSet[i];
			MenuElement.onmouseover = function() { if (this.className == 'RouteMenuElementBlock') return; this.className = 'RouteMenuElementOver'; };
			MenuElement.onmouseout = function() { if (this.className == 'RouteMenuElementBlock') return; this.className = 'RouteMenuElement'; };
			MenuElement.onclick = function() {  if (this.className == 'RouteMenuElementBlock') return; CurrentStatus.OMenuClickAction(this.id); };
			$('AroundMarkMenuSection').appendChild(MenuElement);
			this.getAroundMarkMenuArray.push(MenuElement);
			var BlockElement = document.createElement('div');
			BlockElement.className = 'MenuBlock';
			BlockElement.innerHTML = '/';
			$('AroundMarkMenuSection').appendChild(BlockElement);
		}//end for
		$('AroundMarkMenuSection').removeChild($('AroundMarkMenuSection').lastChild);
		//QueryData
		this.OMenuClickAction(FuncID);
	},
	UserPOIsMenuInit: function(FuncID) {
		if (!$('UserPOIsMenuSection')) return;
		for (var i=0; i<this.UserPOIsMenuSet.length; i++) {
			var MenuElement = document.createElement('div');
			MenuElement.id = 'UserPOIsMenu#' + i;
			MenuElement.className = 'RouteMenuElement';
			MenuElement.innerHTML = this.UserPOIsMenuSet[i];
			MenuElement.onmouseover = function() { if (this.className == 'RouteMenuElementBlock') return; this.className = 'RouteMenuElementOver'; };
			MenuElement.onmouseout = function() { if (this.className == 'RouteMenuElementBlock') return; this.className = 'RouteMenuElement'; };
			MenuElement.onclick = function() {  if (this.className == 'RouteMenuElementBlock') return; CurrentStatus.OMenuClickAction(this.id); };
			$('UserPOIsMenuSection').appendChild(MenuElement);
			this.getUserPOIsMenuArray.push(MenuElement);
			var BlockElement = document.createElement('div');
			BlockElement.className = 'MenuBlock';
			BlockElement.innerHTML = '/';
			$('UserPOIsMenuSection').appendChild(BlockElement);
		}//end for
		$('UserPOIsMenuSection').removeChild($('UserPOIsMenuSection').lastChild);
	},
	RouteMenuInit: function() {
		if (!$('RouteMenuSection')) return;
		for (var i=0; i<this.RouteMenuSet.length; i++) {
			var MenuElement = document.createElement('div');
			MenuElement.id = 'RouteMenu#' + i;
			MenuElement.className = 'RouteMenuElement';
			MenuElement.innerHTML = this.RouteMenuSet[i];
			MenuElement.onmouseover = function() { this.className = 'RouteMenuElementFunc'; };
			MenuElement.onmouseout = function() { this.className = 'RouteMenuElement'; };
			MenuElement.onclick = function() { CurrentStatus.OMenuClickAction(this.id); };
			$('RouteMenuSection').appendChild(MenuElement);
			var BlockElement = document.createElement('div');
			BlockElement.className = 'MenuBlock';
			BlockElement.innerHTML = '|';
			$('RouteMenuSection').appendChild(BlockElement);
		}//end for
		$('RouteMenuSection').removeChild($('RouteMenuSection').lastChild);
	},
	OMenuClickAction: function(FuncID) {
		if (this.SearchBFlag) return;
		Element.hide('WinWarn');
		CurrentStatus.WinInfoHide();
		var FamousMark;
		var AroundMark;
		var UserPOIs;
		if (FuncID.indexOf('FamousMark') != -1) { FamousMark = FuncID; FuncID = 'FamousMark'; }
		if (FuncID.indexOf('AroundMark') != -1) { AroundMark = FuncID; FuncID = 'AroundMark'; }
		if (FuncID.indexOf('UserPOIs') != -1) { UserPOIs = FuncID; FuncID = 'UserPOIs'; }
		switch(FuncID) {
			case 'RouteMenu#0':
				if ($('RouteSP').value == '請輸入起點地址' && $('RouteEP').value == '請輸入終點地址') {
					var ElementPosArray = getPosition($('RouteSection'));
					ElementPosArray[0] += 270;
					ElementPosArray[1] -= 10;
					CurrentStatus.WarnTxt = '請輸入欲進行導航的起點以及終點地址。';
					CurrentStatus.ShowWinWarn(ElementPosArray);
					return;
				}
				this.SEPointSwitch();
				break;
			case 'RouteMenu#1':
				this.RemoveMarker(-1);
				break;
			case 'RouteMenu#2':
				var ElementPosArray = getPosition($('RouteMenu#2'));
				ElementPosArray[0] += 53;
				ElementPosArray[1] -= 27;
				//CurrentStatus.WarnTxt = (this.isMember) ? '很抱歉，本功能尚未開放。' : '會員專屬功能，請先進行<a href="https://member.pchome.com.tw/login.html?ref=http://map.pchome.com.tw/index.html" style="color:#ffffff; font-weight:bold; text-decoration:underline;">會員登入</a>。';
				//CurrentStatus.ShowWinWarn(ElementPosArray);
				if (!this.isMember) {
					CurrentStatus.WarnTxt = '會員專屬功能，請先進行<a href="https://member.pchome.com.tw/login.html?ref=http://map.pchome.com.tw/index.html" style="color:#ffffff; font-weight:bold; text-decoration:underline;">會員登入</a>。';
					CurrentStatus.ShowWinWarn(ElementPosArray);
					return;
				}//end if
				
				var hash = $H();
				hash['action'] = 'QueryNavi';
				hash['pc_id'] = this.pc_id;
				this.DataListQuery(hash, 'Api_Locate');
				break;
			case 'RouteMenu#3':
				var ElementPosArray = getPosition($('RouteMenu#3'));
				ElementPosArray[0] += 53;
				ElementPosArray[1] -= 27;
				if (!this.isMember) {
					CurrentStatus.WarnTxt = '會員專屬功能，請先進行<a href="https://member.pchome.com.tw/login.html?ref=http://map.pchome.com.tw/index.html" style="color:#ffffff; font-weight:bold; text-decoration:underline;">會員登入</a>。';
					CurrentStatus.ShowWinWarn(ElementPosArray);
					return;
				}//end if
				if ($('RouteTypeB').checked) {
					CurrentStatus.WarnTxt = '本導航系統僅支援開車路線規劃之存儲。';
					CurrentStatus.ShowWinWarn(ElementPosArray);
					return;
				}
				if ($F('RouteSP') == '請輸入起點地址' || $F('RouteEP') == '請輸入終點地址') {
					CurrentStatus.WarnTxt = '請輸入起點和終點地址，缺一不可。';
					CurrentStatus.ShowWinWarn(ElementPosArray);
					return;
				}
				this.ClearAction('SaveNavi');
				if (this.SetSPoint != undefined && this.SetSPoint.VarArray != undefined) $('SaveNaviSP').value = this.SetSPoint.VarArray[0];
				if (this.SetEPoint != undefined && this.SetEPoint.VarArray != undefined) $('SaveNaviEP').value = this.SetEPoint.VarArray[0];
				this.ShowWinIntro('SaveNaviMain');
				break;
			case 'FamousMark':
				var Type = Number(FamousMark.replace('FamousMarkMenu#', ''));
				if (Type != this.FamousMarkType) this.FamousMarkPageNum = 1;
				this.FamousMarkType = Type;
				this.FamousMarkPageNum = 1;
				for (var i=0; i<this.getFamousMarkMenuArray.length; i++) this.getFamousMarkMenuArray[i].className = 'RouteMenuElement';
				this.getFamousMarkMenuArray[Type].className = 'RouteMenuElementBlock';
				var hash = $H();
				hash['action'] = 'FamousMark';
				hash['MaxRows'] = this.FamousMarkMaxRows;
				hash['PageNum'] = this.FamousMarkPageNum;
				hash['Type'] = this.FamousMarkTypeSet[Type];
				//alert(hash.toQueryString());
				this.DataListQuery(hash, 'Api_Locate');
				break;
			case 'AroundMark':
				var Type = Number(AroundMark.replace('AroundMarkMenu#', ''));
				if (Type != this.AroundMarkType) this.AroundMarkPageNum = 1;
				this.AroundMarkType = Type;
				this.AroundMarkPageNum = 1;
				for (var i=0; i<this.getAroundMarkMenuArray.length; i++) this.getAroundMarkMenuArray[i].className = 'RouteMenuElement';
				this.getAroundMarkMenuArray[Type].className = 'RouteMenuElementBlock';
				var hash = $H();
				hash['action'] = 'AroundMark';
				hash['MaxRows'] = this.AroundMarkMaxRows;
				hash['PageNum'] = this.AroundMarkPageNum;
				hash['Type'] = Type+1;
				//alert(hash.toQueryString());
				this.DataListQuery(hash, 'Api_Locate');
				break;
			case 'UserPOIs':
				var Type = Number(UserPOIs.replace('UserPOIsMenu#', ''));
				if (Type != this.UserPOIsType) this.UserPOIsPageNum = 1;
				this.UserPOIsType = Type;
				this.UserPOIsPageNum = 1;
				for (var i=0; i<this.getUserPOIsMenuArray.length; i++) this.getUserPOIsMenuArray[i].className = 'RouteMenuElement';
				this.getUserPOIsMenuArray[Type].className = 'RouteMenuElementBlock';
				var hash = $H();
				hash['action'] = 'UserPOIs';
				hash['uId'] = this.FMUsersInfo['uId'];
				hash['Type'] = Type;
				hash['MaxRows'] = this.UserPOIsMaxRows;
				hash['PageNum'] = this.UserPOIsPageNum;
				//alert(hash.toQueryString());
				this.DataListQuery(hash, 'Api_Locate');
				break;
		}//end switch
	},
	MenuInit: function(FuncID) {
		for (var i=0; i<this.MenuContent.length; i++) {
			if ($('Menu#'+i)) $('Menu#'+i).onclick = function() { CurrentStatus.MenuClickAction(this.id); };
			if ($(this.MenuContent[i])) {
				$('MainContentSection').appendChild($(this.MenuContent[i]));
				Element.hide($(this.MenuContent[i]));
			}//end if
		}//end for
		this.MenuClickAction(FuncID);
	},
	MenuClickAction: function(FuncID) {
		Element.hide('WinWarn');
		FuncID = Number(FuncID.replace('Menu#', ''));
		//member only
		if (FuncID == 0) {
			if (!this.isMember) {
				var ElementPosArray = getPosition($('MainMenuSection'));
				ElementPosArray[0] += 70;
				ElementPosArray[1] -= 19;
				this.WarnTxt = '會員專屬功能，請先進行<a href="https://member.pchome.com.tw/login.html?ref=http://map.pchome.com.tw/index.html" style="color:#ffffff; font-weight:bold; text-decoration:underline;">會員登入</a>。';
				this.ShowWinWarn(ElementPosArray);
				return;
			}//end if
			if ($('MyListInfoMain').childNodes.length <= 0) this.MyListQuery();
		}//end if
		/*if (FuncID == 3) {
			var ElementPosArray = getPosition($('MainMenuSection'));
			ElementPosArray[0] += 274;
			ElementPosArray[1] -= 19;
			this.WarnTxt = (this.isMember) ? '很抱歉，本功能尚未開放。' : '會員專屬功能，請先進行<a href="https://member.pchome.com.tw/login.html?ref=http://map.pchome.com.tw/index.html" style="color:#ffffff; font-weight:bold; text-decoration:underline;">會員登入</a>。';
			this.ShowWinWarn(ElementPosArray);
			return;
		}//end if*/
		for (var i=0; i<this.MenuContent.length; i++) {
			if ($(this.MenuContent[i])) Element.hide($(this.MenuContent[i]));
			if ($('Menu#'+i)) $('Menu#'+i).className = 'MenuElement';
		}//end for
		if ($(this.MenuContent[FuncID])) Element.show($(this.MenuContent[FuncID]));
		if ($('Menu#'+FuncID)) $('Menu#'+FuncID).className = 'MenuElementFunc';
	},
	MyListQuery: function() {
		if (this.SearchBFlag) return;
		Element.hide('TypeSelectSection');
		Element.hide('MyListTitleSection');
		Element.hide('MyListInfoMain');
		this.InputsSwitch('Block');
		var hash = $H();
		hash['action'] = 'QueryMyList';
		hash['hAccount'] = this.pc_id;
		if ($('ListTypeA').checked) {
			hash['sUid'] = this.uid;
			hash['f'] = 'P20';
		} else {
			hash['uid'] = this.uid;
			hash['f'] = 'P23';
		}
		this.DataListQuery(hash, 'Api_Locate');
	},
	ClearAction: function(Type) {
		if (this.SearchBFlag) return;
		switch (Type) {
			case 'AddMarker':
				$('AddMarkerName').value = '請輸入地標名稱';
				$('AddMarkerName').style.color = '#b2b2b2';
				if (!$('AddMarkerAddr').disabled) {
					$('AddMarkerAddr').value = '請輸入地標地址';
					$('AddMarkerAddr').style.color = '#b2b2b2';
				}
				$('AddMarkerTag').value = '請輸入標籤';
				$('AddMarkerTag').style.color = '#b2b2b2';
				$('AddMarkerDesc').value = '請輸入地標介紹';
				$('AddMarkerDesc').style.color = '#b2b2b2';
				$('AddMarkerPhoto').value = '請輸入圖片網址';
				$('AddMarkerPhoto').style.color = '#b2b2b2';
				$('AddMarkerLink').value = '請輸入相關網址';
				$('AddMarkerLink').style.color = '#b2b2b2';
				$('MarkerStatusA').checked = true;
				break;
			case 'CollectMain':
				$('CollectTag').value = '請輸入標籤';
				$('CollectTag').style.color = '#b2b2b2';
				break;
			case 'SaveNavi':
				$('SaveNaviSP').value = '請輸入起點名稱';
				$('SaveNaviSP').style.color = '#b2b2b2';
				$('SaveNaviEP').value = '請輸入終點名稱';
				$('SaveNaviEP').style.color = '#b2b2b2';
				break;
			case 'EditMyPOI':
				$('EditMyPOIName').value = this.Marker.VarArray[0];
				$('EditMyPOIAddr').value = this.Marker.VarArray[1];
				$('EditMyPOIDesc').value = (this.Marker.VarArray[4].length == 0) ? '請輸入地標介紹' : this.Marker.VarArray[4];
				$('EditMyPOIPhoto').value = (this.Marker.VarArray[5].length == 0) ? '請輸入圖片網址' : this.Marker.VarArray[5];
				$('EditMyPOILink').value = (this.Marker.VarArray[6].length == 0) ? '請輸入相關網址' : this.Marker.VarArray[6];
				(this.Marker.VarArray[11] == 'Y') ? $('MyPOIStatusA').checked = true : $('MyPOIStatusB').checked = true;
				//Fix Input Color
				$('EditMyPOIName').style.color = ($F('EditMyPOIName') == '請輸入地標名稱') ? '#b2b2b2' : '#444444';
				$('EditMyPOIAddr').style.color = ($F('EditMyPOIAddr') == '請輸入地標地址') ? '#b2b2b2' : '#444444';
				$('EditMyPOIDesc').style.color = ($F('EditMyPOIDesc') == '請輸入地標介紹') ? '#b2b2b2' : '#444444';
				$('EditMyPOIPhoto').style.color = ($F('EditMyPOIPhoto') == '請輸入圖片網址') ? '#b2b2b2' : '#444444';
				$('EditMyPOILink').style.color = ($F('EditMyPOILink') == '請輸入相關網址') ? '#b2b2b2' : '#444444';
				break;
			case 'Mail2':
				$('SenderName').value = '請輸入寄件者姓名';
				$('ReceiverMail').value = '請輸入收件者eMail';
				$('SenderName').style.color = '#b2b2b2';
				$('SenderName').style.color = '#b2b2b2';
				break;
		}//end switch
	},
	SearchCheck: function(Type) {
		if (this.SearchBFlag) return;
		Element.hide('WinWarn');
		var hash = $H();
		switch (Type) {
			case 'addressing':
				if ($F('Search').length == 0 || $F('Search') == '請輸入關鍵字') { 
					var ElementPosArray = getPosition($('SearchSection'));
					ElementPosArray[0] += 290;
					ElementPosArray[1] -= 9;
					this.WarnTxt = '請輸入關鍵字';
					this.ShowWinWarn(ElementPosArray);
					//$('Search').focus();
					return;
				}
				this.InputFix('Search');
				this.LoadingStatus('show');
				if ($F('AddrTypeSelect') == 'addr') {
					hash['action'] = Type;
					hash['addrs'] = $F('Search');
				} else {
					this.ListPOIsPageNum = 1;
					this.ListPOIsType = 0;
					this.Keyword = $F('Search');
					hash['action'] = 'ListPOIs';
					hash['keyword'] = this.Keyword;
					hash['Type'] = this.ListPOIsTypeSet[this.ListPOIsType];
					hash['MaxRows'] = this.ListPOIsMaxRows;
					hash['PageNum'] = this.ListPOIsPageNum;
				}//end if
				//alert(hash.toQueryString());
				this.DataListQuery(hash, 'Api_Locate');
				break;
			case 'routing':
				//RouteSP
				if ($F('RouteSP').length == 0 || $F('RouteSP') == '請輸入起點地址') { 
					var ElementPosArray = getPosition($('RouteSection'));
					ElementPosArray[0] += 270;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入起點地址';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('RouteSP');
				//RouteEP
				if ($F('RouteEP').length == 0 || $F('RouteEP') == '請輸入終點地址') { 
					var ElementPosArray = getPosition($('RouteSection'));
					ElementPosArray[0] += 270;
					ElementPosArray[1] += 3;
					this.WarnTxt = '請輸入終點地址';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('RouteEP');
				this.LoadingStatus('show');
				hash['action'] = 'RouteAction';
				hash['Type'] = ($('RouteTypeA').checked) ? 'routing' : 'PTRouting';
				hash['RouteSP'] = $F('RouteSP');
				hash['RouteEP'] = $F('RouteEP');
				hash['stlat'] = '';
				hash['stlng'] = '';
				hash['destlat'] = '';
				hash['destlng'] = '';
				if ($F('RouteSP') == '自設路徑起點') {
					var StartPos = this.SetSPoint.getPoint();
					hash['stlat'] = StartPos.lat();
					hash['stlng'] = StartPos.lng();
				}
				if ($F('RouteEP') == '自設路徑終點') {
					var EndPos = this.SetEPoint.getPoint();
					hash['destlat'] = EndPos.lat();
					hash['destlng'] = EndPos.lng();
				}
				Element.hide('WinWarn');
				this.DataListQuery(hash, 'Api_Locate');
				break;
			case 'AddMarker':
				if ($F('AddMarkerName').length == 0 || $F('AddMarkerName') == '請輸入地標名稱') { 
					var ElementPosArray = getPosition($('AddMarkerName'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入地標名稱(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('AddMarkerName');
				
				if ($F('AddMarkerAddr').length == 0 || $F('AddMarkerAddr') == '請輸入地標地址') { 
					var ElementPosArray = getPosition($('AddMarkerAddr'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入地標地址(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('AddMarkerAddr');
				
				if ($F('AddMarkerTag').length == 0 || $F('AddMarkerTag') == '請輸入標籤') { 
					var ElementPosArray = getPosition($('AddMarkerTag'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入標籤(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('AddMarkerTag');
				this.InputFix('AddMarkerDesc');
				
				this.InputFix('AddMarkerPhoto');
				if ($F('AddMarkerPhoto') != '請輸入圖片網址' && $F('AddMarkerPhoto').toLowerCase().indexOf('http') != 0) {
					var ElementPosArray = getPosition($('AddMarkerPhoto'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入完整圖片網址(需包含 http://)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				
				this.InputFix('AddMarkerLink');
				if ($F('AddMarkerLink') != '請輸入相關網址' && $F('AddMarkerLink').toLowerCase().indexOf('http') != 0) {
					var ElementPosArray = getPosition($('AddMarkerLink'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入完整的相關網址(需包含 http://)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				
				this.InputsSwitch('Block');
				
				hash['action'] = 'AddMarker';
				hash['hAccount'] = this.pc_id;
				hash['sUid'] = this.uid;
				hash['pName'] = $F('AddMarkerName');
				hash['pAddr'] = $F('AddMarkerAddr');
				hash['tName'] = $F('AddMarkerTag').replace(/ /g, ';');
				hash['desc'] = ($F('AddMarkerDesc') == '請輸入地標介紹') ? '' : $F('AddMarkerDesc');
				hash['pPhoto'] = ($F('AddMarkerPhoto') == '請輸入圖片網址') ? '' : $F('AddMarkerPhoto');
				hash['pLink'] = ($F('AddMarkerLink') == '請輸入相關網址') ? '' : $F('AddMarkerLink');
				hash['pub'] = ($('MarkerStatusA').checked) ? 'Y' : 'N';
				var LatLng = this.Marker.getPoint();
				hash['pLat'] = LatLng.lat();
				hash['pLng'] = LatLng.lng();
				Element.hide('WinWarn');
				this.DataListQuery(hash, 'Api_Locate');
				break;
			case 'CollectMarker':
				if ($F('CollectTag').length == 0 || $F('CollectTag') == '請輸入標籤') { 
					var ElementPosArray = getPosition($('CollectTag'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入標籤(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('CollectTag');
				
				this.InputsSwitch('Block');
				
				hash['action'] = 'CollectMarker';
				hash['hAccount'] = this.pc_id;
				hash['sUid'] = this.uid;
				hash['tName'] = $F('CollectTag').replace(/ /g, ';');
				hash['pId'] = this.Marker.VarArray[8];
				Element.hide('WinWarn');
				//alert(hash.toQueryString());
				this.DataListQuery(hash, 'Api_Locate');
				break;
			case 'SaveNavi':
				if ($F('SaveNaviSP').length == 0 || $F('SaveNaviSP') == '請輸入起點名稱') { 
					var ElementPosArray = getPosition($('SaveNaviSP'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入起點名稱(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				} else if ($F('SaveNaviSP').length > 10) {
					var ElementPosArray = getPosition($('SaveNaviSP'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '起點名稱長度限制10個字以內(半形英數和符號皆算1個字)';
					$('SaveNaviSP').value = $F('SaveNaviSP').substr(0, 10);
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('SaveNaviSP');
				
				if ($F('SaveNaviEP').length == 0 || $F('SaveNaviEP') == '請輸入終點名稱') { 
					var ElementPosArray = getPosition($('SaveNaviEP'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入終點名稱(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				} else if ($F('SaveNaviEP').length > 10) {
					var ElementPosArray = getPosition($('SaveNaviEP'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '終點名稱長度限制10個字以內(半形英數和符號皆算1個字)';
					$('SaveNaviEP').value = $F('SaveNaviEP').substr(0, 10);
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('SaveNaviEP');
				
				/*$('SaveNaviSP').disabled = true;
				$('SaveNaviEP').disabled = true;
				$('Overlay').onclick = '';
				this.SearchBFlag = true;*/
				this.InputsSwitch('Block');
				
				hash['action'] = 'SaveNavi';
				hash['pc_id'] = this.pc_id;
				hash['RouteSPTitle'] = $F('SaveNaviSP');
				hash['RouteEPTitle'] = $F('SaveNaviEP');
				hash['RouteSP'] = $F('RouteSP');
				hash['RouteEP'] = $F('RouteEP');
				hash['stlat'] = '';
				hash['stlng'] = '';
				hash['destlat'] = '';
				hash['destlng'] = '';
				if ($F('RouteSP') == '自設路徑起點') {
					var StartPos = this.SetSPoint.getPoint();
					hash['stlat'] = StartPos.lat();
					hash['stlng'] = StartPos.lng();
				}
				if ($F('RouteEP') == '自設路徑終點') {
					var EndPos = this.SetEPoint.getPoint();
					hash['destlat'] = EndPos.lat();
					hash['destlng'] = EndPos.lng();
				}
				Element.hide('WinWarn');
				//alert(hash.toQueryString());
				this.DataListQuery(hash, 'Api_Locate');
				break;
			case 'EditMyPOI':
				if ($F('EditMyPOIName').length == 0 || $F('EditMyPOIName') == '請輸入地標名稱') { 
					var ElementPosArray = getPosition($('EditMyPOIName'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入地標名稱(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('EditMyPOIName');
				
				if ($F('EditMyPOIAddr').length == 0 || $F('EditMyPOIAddr') == '請輸入地標地址') { 
					var ElementPosArray = getPosition($('EditMyPOIAddr'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入地標地址(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('EditMyPOIAddr');
				
				this.InputFix('EditMyPOIDesc');
				this.InputFix('EditMyPOIPhoto');
				if ($F('EditMyPOIPhoto') != '請輸入圖片網址' && $F('EditMyPOIPhoto').toLowerCase().indexOf('http') != 0) {
					var ElementPosArray = getPosition($('EditMyPOIPhoto'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入完整圖片網址(需包含 http://)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				
				this.InputFix('EditMyPOILink');
				if ($F('EditMyPOILink') != '請輸入相關網址' && $F('EditMyPOILink').toLowerCase().indexOf('http') != 0) {
					var ElementPosArray = getPosition($('EditMyPOILink'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入完整的相關網址(需包含 http://)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				
				this.InputsSwitch('Block');
				
				hash['action'] = 'EditMyPOI';
				hash['hAccount'] = this.pc_id;
				hash['sUid'] = this.uid;
				hash['pId'] = this.Marker.VarArray[10];
				hash['pName'] = $F('EditMyPOIName');
				hash['pAddr'] = $F('EditMyPOIAddr');
				hash['desc'] = ($F('EditMyPOIDesc') == '請輸入地標介紹') ? '' : $F('EditMyPOIDesc');
				hash['pPhoto'] = ($F('EditMyPOIPhoto') == '請輸入圖片網址') ? '' : $F('EditMyPOIPhoto');
				hash['pLink'] = ($F('EditMyPOILink') == '請輸入相關網址') ? '' : $F('EditMyPOILink');
				hash['pub'] = ($('MyPOIStatusA').checked) ? 'Y' : 'N';
				Element.hide('WinWarn');
				this.DataListQuery(hash, 'Api_Locate');
				break;
			case 'Mail2':
				if ($F('SenderName').length == 0 || $F('SenderName') == '請輸入寄件者姓名') { 
					var ElementPosArray = getPosition($('SenderName'));
					ElementPosArray[0] += 230;
					ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入寄件者姓名(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				this.InputFix('SenderName');
				
				if ($F('ReceiverMail').length == 0 || $F('ReceiverMail') == '請輸入收件者eMail') { 
					var ElementPosArray = getPosition($('ReceiverMail'));
					ElementPosArray[0] += 450;
					//ElementPosArray[1] -= 23;
					this.WarnTxt = '請輸入收件者eMail(本欄位為必填欄位)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}
				if ($F('ReceiverMail').split(',').length > 20) {
					var ElementPosArray = getPosition($('ReceiverMail'));
					ElementPosArray[0] += 450;
					//ElementPosArray[1] -= 23;
					this.WarnTxt = '您預寄發的 Mail 已超過20組(本系統最多僅可同時發送20組)';
					this.ShowWinWarn(ElementPosArray);
					return;
				}//end if
				this.InputFix('ReceiverMail');
				
				var UrlParameter = this.MkUrlParameter();
				this.MailDataSet = [];
				this.MailDataSet.push($F('SenderName'));
				this.MailDataSet.push($F('ReceiverMail'));
				this.MailDataSet.push('http://map.pchome.com.tw/index.html?'+UrlParameter);
				
				this.InputsSwitch('Block');
				
				hash['action'] = 'Mail';
				hash['SenderName'] = $F('SenderName');
				hash['ReceiverMail'] = $F('ReceiverMail');
				hash['MapLink'] = 'http://map.pchome.com.tw/index.html?' + UrlParameter;
				Element.hide('WinWarn');
				this.DataListQuery(hash, 'Api_Locate');
				//this.ShowWinIntro('MailResultMain');
				break;
			default:
				alert('Are you kidding ?');
		}//end switch
	},
	MkUrlParameter: function() {
		var LatLng = this.Map.getCenter();
		var MapZoom = this.Map.getZoomLevel();
		var hash = $H();
		hash['MapAction'] = this.MapAction;
		hash['MapType'] = this.MapType;
		switch (this.MapAction) {
			case 'addressing':
				hash['DataSet'] = this.Marker.getPoint().lat() + '^' + this.Marker.getPoint().lng() + '^' + this.Marker.PosTitle;
				hash['Lat'] = LatLng.lat();
				hash['Lng'] = LatLng.lng();
				hash['MapZoom'] = MapZoom;
				hash['AddrType'] = $F('AddrTypeSelect');
				break;
			case 'routing':
				hash['RouteSP'] = $F('RouteSP');
				hash['RouteEP'] = $F('RouteEP');
				var StartPos = this.SetSPoint.getPoint();
				hash['stlat'] = StartPos.lat();
				hash['stlng'] = StartPos.lng();
				var EndPos = this.SetEPoint.getPoint();
				hash['destlat'] = EndPos.lat();
				hash['destlng'] = EndPos.lng();
				break;
			case 'PTRouting':
				hash['RouteSP'] = $F('RouteSP');
				hash['RouteEP'] = $F('RouteEP');
				var StartPos = this.SetSPoint.getPoint();
				hash['stlat'] = StartPos.lat();
				hash['stlng'] = StartPos.lng();
				var EndPos = this.SetEPoint.getPoint();
				hash['destlat'] = EndPos.lat();
				hash['destlng'] = EndPos.lng();
				break;
			case 'NormalPoint':
				hash['DataSet'] = this.Marker.getPoint().lat() + '^' + this.Marker.getPoint().lng();
				hash['Lat'] = LatLng.lat();
				hash['Lng'] = LatLng.lng();
				hash['MapZoom'] = MapZoom;
				break;
			case 'FamousPoint':
				hash['DataSet'] = this.Marker.VarArray.toString().replace(/,/g, '[DataBr]');
				hash['Lat'] = LatLng.lat();
				hash['Lng'] = LatLng.lng();
				hash['MapZoom'] = MapZoom;
				break;
			case 'MyPoint':
				hash['DataSet'] = this.Marker.VarArray.toString().replace(/,/g, '[DataBr]');
				hash['Lat'] = LatLng.lat();
				hash['Lng'] = LatLng.lng();
				hash['MapZoom'] = MapZoom;
				break;
			case 'AroundPoint':
				hash['DataSet'] = this.Marker.VarArray.toString().replace(/,/g, '[DataBr]');
				hash['Lat'] = LatLng.lat();
				hash['Lng'] = LatLng.lng();
				hash['MapZoom'] = MapZoom;
				break;
			default:
				hash['Lat'] = LatLng.lat();
				hash['Lng'] = LatLng.lng();
				hash['MapZoom'] = MapZoom;
		}//end switch
		return hash.toQueryString();
	},
	ResizeEvent: function() {
		var PageSize = getPageSize();
		var SetWidth = 0;
		var SetHeight = 0;
		if (Element.visible('LSection')) {
			SetWidth = PageSize[2] - 300 - 1 - 10;
			$('BtnBlind').className = 'BtnBlindExpand';
			$('BtnBlind').style.left = '294px';
		} else {
			SetWidth = PageSize[2] - 1 - 10;
			$('BtnBlind').className = 'BtnBlindShrink';
			$('BtnBlind').style.left = '0px';
		}
		SetHeight = PageSize[3] - 50;
		$('BtnBlind').style.top = Math.floor(PageSize[3]/2 - 42) + 'px';
		if (CurrentStatus.Browser.indexOf('ie') != -1) SetWidth -= 10; 
		$('RSection').style.width = SetWidth + 'px';
		$('RSection').style.height = SetHeight + 'px';
		CurrentStatus.MapWidth = SetWidth;
		//CurrentStatus.MapHeight = SetHeight - 10 - 30;
		CurrentStatus.MapHeight = SetHeight - 10 - 30 - 18;
		
		var ElementPosArray = getPosition($('map'));
		$('map').style.width = (CurrentStatus.MapWidth - 2) + 'px';
		$('map').style.height = (CurrentStatus.MapHeight - 2) + 'px';
		CurrentStatus.MapPosX = ElementPosArray[0];
		CurrentStatus.MapPosY = ElementPosArray[1];
		
		//Jumper
		$('JumperMT').style.width = (CurrentStatus.MapWidth - 40) + 'px';
		$('JumperLM').style.height = (CurrentStatus.MapHeight - 40) + 'px';
		$('JumperRM').style.height = (CurrentStatus.MapHeight - 40) + 'px';
		$('JumperMB').style.width = (CurrentStatus.MapWidth - 40) + 'px';
		
		$('ZoomSet').style.left = (CurrentStatus.MapPosX + 5) + 'px';
		$('ZoomSet').style.top = (CurrentStatus.MapPosY + 5) + 'px';
		CurrentStatus.Map.refreshMap();
		
		Element.hide('WinWarn');
		CurrentStatus.WinInfoHide();
		Element.hide('MRMenu');
		CurrentStatus.StoreEnviSet();
	},
	SetElementParameter: function() {
		var PageSize = getPageSize();
		var SetWidth = 0;
		var SetHeight = 0;
		if (Element.visible('LSection')) {
			Element.hide('LSection');
			SetWidth = PageSize[2] - 1 - 10;
			$('BtnBlind').className = 'BtnBlindShrink';
			$('BtnBlind').style.left = '0px';
		} else {
			Element.show('LSection');
			SetWidth = PageSize[2] - 300 - 1 - 10;
			$('BtnBlind').className = 'BtnBlindExpand';
			$('BtnBlind').style.left = '294px';
		}
		SetHeight = PageSize[3] - 50;
		$('BtnBlind').style.top = Math.floor(PageSize[3]/2 - 42) + 'px';
		if (this.Browser.indexOf('ie') != -1) SetWidth -= 10; 
		$('RSection').style.width = SetWidth + 'px';
		$('RSection').style.height = SetHeight + 'px';
		this.MapWidth = SetWidth;
		//this.MapHeight = SetHeight - 10 - 30;
		this.MapHeight = SetHeight - 10 - 30 - 18;
		
		var ElementPosArray = getPosition($('map'));
		$('map').style.width = (this.MapWidth - 2) + 'px';
		$('map').style.height = (this.MapHeight - 2) + 'px';
		this.MapPosX = ElementPosArray[0];
		this.MapPosY = ElementPosArray[1];
		
		//Jumper
		$('JumperMT').style.width = (CurrentStatus.MapWidth - 40) + 'px';
		$('JumperLM').style.height = (CurrentStatus.MapHeight - 40) + 'px';
		$('JumperRM').style.height = (CurrentStatus.MapHeight - 40) + 'px';
		$('JumperMB').style.width = (CurrentStatus.MapWidth - 40) + 'px';
		
		$('ZoomSet').style.left = (this.MapPosX + 5) + 'px';
		$('ZoomSet').style.top = (this.MapPosY + 5) + 'px';
		this.Map.refreshMap();
		
		Element.hide('WinWarn');
		CurrentStatus.WinInfoHide();
		Element.hide('MRMenu');
		this.StoreEnviSet();
	},
	GetCookie: function(SearchID) {
		if (!document.cookie) return false;
		//var Cookies = document.cookie.split(';');
		var Cookies = document.cookie.replace(/ /g, '').split(';');
		if (Cookies.length == 0) return  false;
		for (var i=0; i<Cookies.length; i++) {
			var CookieCrumbs = Cookies[i].split('=');
			if (CookieCrumbs[0] == SearchID) return CookieCrumbs[1];
		}//end for
		return false;
	},
	LoadEnviSet: function(MapEnviSet) {
		if (MapEnviSet.length == 0) return;
		this.MapEnviSet = MapEnviSet.split('^');
		for (var i=0; i<this.MapEnviSet.length; i++) this.MapEnviSet[i] = Number(this.MapEnviSet[i]);
		this.MapZoom = this.MapEnviSet[2];
	},
	StoreEnviSet: function() {
		if (CurrentStatus.MapMode == 'Print') return;
		//write in cookie
		var Today = new Date();
		var Expiration = new Date(Today.getFullYear(), Today.getMonth(), Today.getDate()+30).toGMTString();
		var EnviSet = [];
		var LatLng = CurrentStatus.Map.getCenter();
		var ShowLSection = (Element.visible('LSection')) ? 1 : 0;
		
		EnviSet.push(LatLng.lat());
		EnviSet.push(LatLng.lng());
		EnviSet.push(CurrentStatus.Map.getZoomLevel());
		EnviSet.push(ShowLSection);
		
		document.cookie = 'MapEnviSet=' + EnviSet.toString().replace(/,/g, '^') + ';path=/;expires=' + Expiration;
	},
	EnviSetUpdate: function() {
		if (!this.UrlVars['MapAction']) return;
		if (!this.UrlVars['AddrType'] || (this.UrlVars['AddrType'] != 'addr' && this.UrlVars['AddrType'] != 'point')) this.UrlVars['AddrType'] = 'addr';
		$('AddrTypeSelect').value = this.UrlVars['AddrType'];
		if (this.UrlVars['Lat'] && this.UrlVars['Lng'] && this.UrlVars['MapZoom']) {
			this.MapEnviSet[0] = Number(this.UrlVars['Lat']);
			this.MapEnviSet[1] = Number(this.UrlVars['Lng']);
			this.MapEnviSet[2] = Number(this.UrlVars['MapZoom']);
			this.MapZoom = this.MapEnviSet[2];
		}//end if
	},
	RunMapAction: function() {
		if (!this.UrlVars['MapAction'] || this.UrlVars['MapAction'] == 'None') return;
		switch (this.UrlVars['MapAction']) {
			case 'MainPage':
				$('Search').value = decodeURI(this.UrlVars['Search']);
				//$('AddrTypeSelect').value = 'addr';
				$('AddrTypeSelect').value = 'point';
				this.SearchCheck('addressing');
				break;
			case 'MainPageAddr':
				$('Search').value = decodeURI(this.UrlVars['Search']);
				$('AddrTypeSelect').value = 'addr';
				this.SearchCheck('addressing');
				break;
			case 'addressing':
				this.UrlVars['DataSet'] = decodeURI(this.UrlVars['DataSet']);
				var DataArray = this.UrlVars['DataSet'].split('^');
				$('Search').value = DataArray[2].replace('定位至 ', '');
				this.MkSearchMarker(new ULatLng(DataArray[0], DataArray[1]), DataArray[2]);
				if (this.MapMode == 'Print') $('PrintTitle').innerHTML = DataArray[2].replace('定位至 ', '');
				break;
			case 'routing':
				$('RouteSP').value = decodeURI(this.UrlVars['RouteSP']);
				$('RouteEP').value = decodeURI(this.UrlVars['RouteEP']);
				if ($F('RouteSP') == '自設路徑起點') this.MkSEMarker('S', new ULatLng(this.UrlVars['stlat'], this.UrlVars['stlng']));
				if ($F('RouteEP') == '自設路徑終點') this.MkSEMarker('E', new ULatLng(this.UrlVars['destlat'], this.UrlVars['destlng']));
				this.SearchCheck('routing');
				if (this.MapMode == 'Print') $('PrintTitle').innerHTML = '開車路線規劃';
				break;
			case 'PTRouting':
				$('RouteSP').value = decodeURI(this.UrlVars['RouteSP']);
				$('RouteEP').value = decodeURI(this.UrlVars['RouteEP']);
				if ($F('RouteSP') == '自設路徑起點') this.MkSEMarker('S', new ULatLng(this.UrlVars['stlat'], this.UrlVars['stlng']));
				if ($F('RouteEP') == '自設路徑終點') this.MkSEMarker('E', new ULatLng(this.UrlVars['destlat'], this.UrlVars['destlng']));
				$('RouteTypeB').checked = true;
				this.SearchCheck('routing');
				if (this.MapMode == 'Print') $('PrintTitle').innerHTML = '大眾運輸路線規劃';
				break;
			case 'NormalPoint':
				this.UrlVars['DataSet'] = decodeURI(this.UrlVars['DataSet']);
				var DataArray = this.UrlVars['DataSet'].split('^');
				var marker = new UMarker(new ULatLng(DataArray[0], DataArray[1]), this.NormalPoint);
				marker.addListener('mouseover', CurrentStatus.MarkerOver);
				marker.type = 'N';
				this.Map.addOverlay(marker);
				this.Marker = marker;
				this.MarkerOver(marker);
				this.PointAmt++;
				break;
			case 'FamousPoint':
				this.UrlVars['DataSet'] = decodeURI(this.UrlVars['DataSet']);
				var DataArray = this.UrlVars['DataSet'].split('[DataBr]');
				this.MkFamousMarker(DataArray);
				if (this.MapMode == 'Print') {
					var Info = '';
					$('RouteInfoSection').style.width = this.MapWidth + 'px';
					Element.show('RouteInfoSection');
					this.SectionClear('RouteInfoMain');
					$('PrintTitle').innerHTML = DataArray[0];
					Info = '地址:' + DataArray[1] + '<br>';
					if (DataArray[4].length > 0) Info += '介紹:' + DataArray[4];
					$('RouteInfoMain').innerHTML = '<span style="font-size:12px; color:#444444">' + Info + '</span>';
				}//end if
				break;
			case 'MyPoint':
				this.UrlVars['DataSet'] = decodeURI(this.UrlVars['DataSet']);
				var DataArray = this.UrlVars['DataSet'].split('[DataBr]');
				this.MkMyMarker(DataArray);
				if (this.MapMode == 'Print') {
					var Info = '';
					$('RouteInfoSection').style.width = this.MapWidth + 'px';
					Element.show('RouteInfoSection');
					this.SectionClear('RouteInfoMain');
					$('PrintTitle').innerHTML = DataArray[0];
					Info = '地址:' + DataArray[1] + '<br>';
					if (DataArray[4].length > 0) Info += '介紹:' + DataArray[4];
					$('RouteInfoMain').innerHTML = '<span style="font-size:12px; color:#444444">' + Info + '</span>';
				}//end if
				break;
			case 'AroundPoint':
				this.UrlVars['DataSet'] = decodeURI(this.UrlVars['DataSet']);
				var DataArray = this.UrlVars['DataSet'].split('[DataBr]');
				this.MkSAroundMarker(DataArray);
				this.MarkerOver(this.Marker);
				if (this.MapMode == 'Print') {
					var Info = '';
					$('RouteInfoSection').style.width = this.MapWidth + 'px';
					Element.show('RouteInfoSection');
					this.SectionClear('RouteInfoMain');
					$('PrintTitle').innerHTML = DataArray[0];
					Info = '地址:' + DataArray[1] + '<br>';
					if (DataArray[5].length > 0) Info += '電話:' + DataArray[5];
					$('RouteInfoMain').innerHTML = '<span style="font-size:12px; color:#444444">' + Info + '</span>';
				}//end if
				break;
			case 'MyList':
				if (!CurrentStatus.isMember) { window.location = 'https://member.pchome.com.tw/login.html?ref=http://map.pchome.com.tw/index.html?MapAction=MyList'; return; }
				this.MenuClickAction('Menu#0');
				break;
			case 'FamousList':
				this.MenuClickAction('Menu#1');
				break;
		}//end switch
	},
	WinDragStart: function(e) {
		var MouseStatus;
		if (window.event && window.event.srcElement) MouseStatus = window.event.button;
		else if (e && e.target) MouseStatus = e.button;
		var target = getEventTarget(e);
		var FuncID = target.id.replace('Top', '');;
		if (MouseStatus == 0 || MouseStatus == 1) {
			if (CurrentStatus.Browser.indexOf('ie') != -1 && MouseStatus != 1) return;
			var ElementPosArray = getPosition($(FuncID));
			var PageSizeArray = getPageSize();
			var PageScroll = getPageScroll();
			var MouseX = (CurrentStatus.Browser.indexOf('ie') != -1) ? window.event.x : e.pageX;
			var MouseY;
			if (CurrentStatus.Browser.indexOf('ie') != -1) {
				MouseY = window.event.y + PageScroll[1];
			} else MouseY = e.pageY;
			
			//if (MouseX > PageSizeArray[0] || MouseY > PageSizeArray[1]) return;
			CurrentStatus.DragFlag = true;
			CurrentStatus.WinPosX = ElementPosArray[0];
			CurrentStatus.WinPosY = ElementPosArray[1];
			CurrentStatus.MoveDistX = MouseX - ElementPosArray[0];
			CurrentStatus.MoveDistY = MouseY - ElementPosArray[1];
			CurrentStatus.FuncWinDrag = FuncID;
			Element.hide('WinWarn');
		}//end if
	},
	TotalMoveEffect: function(e) {
		var FuncID = CurrentStatus.FuncWinDrag;
		if (!CurrentStatus.DragFlag) return;
		var PageScroll = getPageScroll();
		var MouseX = (CurrentStatus.Browser.indexOf('ie') != -1) ? window.event.x : e.pageX;
		var MouseY;
		if (CurrentStatus.Browser.indexOf('ie') != -1) {
			MouseY = window.event.y + PageScroll[1];
		} else MouseY = e.pageY;
		//$('RootMouseInfo').innerHTML = 'RootX:'+MouseX+' RootY:'+MouseY;
		
		CurrentStatus.WinPosX = MouseX - CurrentStatus.MoveDistX;
		CurrentStatus.WinPosY = MouseY - CurrentStatus.MoveDistY;
		
		$(FuncID).style.left = CurrentStatus.WinPosX + 'px';
		$(FuncID).style.top = CurrentStatus.WinPosY + 'px';
	},
	TotalMoveEnd: function(e) {
		var FuncID = CurrentStatus.FuncWinDrag;
		if (!CurrentStatus.DragFlag) return;
		var MouseStatus;
		if (window.event && window.event.srcElement) MouseStatus = window.event.button;
		else if (e && e.target) MouseStatus = e.button;
		if (MouseStatus == 0 || MouseStatus == 1) {
			if (CurrentStatus.Browser.indexOf('ie') != -1 && MouseStatus != 1) return;
			CurrentStatus.MoveDistX = 0;
			CurrentStatus.MoveDistY = 0;
			CurrentStatus.DragFlag = false;
			CurrentStatus.FuncWinDrag = '';
		}//end if
	}
}