
	Dim Pilot_Flag
	Dim  PilotArray(3)	
	Dim SelectIDX 			' ¹ö½º °ü·Ã ¼±ÅÃÇÑ IDX°ª... 
	Dim LineColorFlag		' ¹ö½º °ü·Ã ¼±ÅÃÇÑ ¼±»ö»ó°ª... 
	
	LineColorFlag = 99
	'==================================================================================================
	' °æ·Î°Ë»ö ¼­¹ö Á¢¼Ó
	'==================================================================================================
	Sub Pilot_Startup
		On Error Resume Next

		PilotExc.Startup cstr(PILOT_SERVER), CInt(PILOT_PORT)
		
		PilotExc.SetURI "/cgi-bin/happy_cgi_0911/happy_cgi_0911", "/cgi-bin/mtp_cgi/pub.cgi"



		Dim Search_Mode                                                ' °í¼Ó: 0, ÃßÃµ: 1, ¹«·á: 2, ´Ü°Å¸®:3 ÀÔ´Ï´Ù.


		For i= 0 to 7			
			Pilot_POINT(i)=-1
		Next
        
		
		If err.source <> "" Then
			msgbox "°æ·Î°Ë»ö¼­¹ö¿¡ Á¢¼Ó ÇÒ ¼ö ¾ø½À´Ï´Ù."&vblf&"°æ·Î°Ë»öÀº Àá½ÃÈÄ ÀÌ¿ëÇÏ½Ã±â	¹Ù¶ø´Ï´Ù."&vbCrLf&err.Description,vbOKOnly,"MapTopia Service message"
		End If


	End Sub

	'==================================================================================================
	' °æ·Î°Ë»ö ½ÇÇà ÈÄ ¼º°øÀûÀ»·Î ½ÇÇàÈÄ °á°ú ÆäÀÌÁö·Î ÀÌµ¿
	'==================================================================================================
	Sub searchPilot_CarH(howTo,howMuch,s)
		On Error Resume Next
				
		if Pilot_search(howTo,howMuch) then		
			If (Pilot_POINT(0) > 0) and (Pilot_POINT(6) > 0) Then
				
				Select Case curLayerNo
					Case 21
						Call document.lnfoFrame_21.DisplayResult(1)
						Call document.lnfoFrame_22.DisplayResult(0)
						Call document.lnfoFrame_23.DisplayResult(0)
						document.lnfoFrame_21.ifrmResult.location.href = "/_Menu/RouteSearch/RouteSearch_Car.asp"
					Case 22
						Call document.lnfoFrame_21.DisplayResult(0)
						Call document.lnfoFrame_22.DisplayResult(1)
						Call document.lnfoFrame_23.DisplayResult(0)
						document.lnfoFrame_22.ifrmResult.location.href = "/_Menu/RouteSearch/RouteSearch_Car.asp"
					Case 23
						Call document.lnfoFrame_21.DisplayResult(0)
						Call document.lnfoFrame_22.DisplayResult(0)
						Call document.lnfoFrame_23.DisplayResult(1)
						document.lnfoFrame_23.ifrmResult.location.href = "/_Menu/RouteSearch/RouteSearch_Car.asp"
					Case Else
						
				End Select
				Call SetRouteLines()
			End if
		end if



		If err.Number <> 0 Then
			'msgbox "error===>"&vbCrLf&err.Description,vbOKOnly,"MapTopia Service message"
		End If
	End Sub

	'==================================================================================================
	' °æ·Î°Ë»ö ¼­¹ö ÃÊ±âÈ­
	'==================================================================================================
	Sub ResetPilot
		On Error Resume Next
		Dim	i

		'// °æ·ÎÅ½»ö ¼±Çü Á¦°Å
		If IsObject(WindCtl) Then
			If Pilot_POINT(0) <> -1  Then
				WindCtl.DO_RouteLines = false
				Call WindCtl.ReDraw()
			End If
		End If

		For i= 0 to 7
			Pilot_POINT(i)=-1
		Next
		'document.ifrmPilot.PilotExc.Clear
		'document.ifrmPilot.location.href= "/_Menu/Map/Pilot.asp"
		' ÃÊ±âÈ­½Ã¿¡ ¹ÝµíÀÌ µ¿½Ã¿¡ È£ÃâÇÒ°Í - Çü½Ä¿Ð - À±Ç¥¾¸
		PilotExc.Clear
		PilotExc.Cleanup
		PilotExc.Reset
		'// °æ·ÎÅ½»ö ¼­¹ö Á¢¼Ó
		'Call Pilot_Startup()
		'PilotExc.Reset

	End Sub

	'==================================================================================================
	' °æ·Î°Ë»ö ½ÇÇà ÇÔ¼ö
	'==================================================================================================
	Function Pilot_search(howTo,howMuch)

		Dim sn,i,n,nDim
		Dim PointArray3(3),PointArray5(5),PointArray7(7)
		Pilot_search = false


		' ÃÊ±âÈ­½Ã¿¡ ¹ÝµíÀÌ ½ÃÄÑÁÙ°Í- Çü½Ä¿Ð - À±Ç¥¾¸
		document.PilotExc.Clear
		document.PilotExc.Cleanup
'		document.PilotExc.Reset


		'Set Guide = document.ifrmPilot.PilotExc
		If Pilotflag_check  >  1 Then
	
			window.status="ÇöÀç °æ·Î °Ë»ö ÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ½Ê½Ã¿ä"
			' Ä¿¼­ º¯°æ¿äÇÔ
			n=0
			nDim=-1
						
			For i= 0 to 6 step 2			    
				If Pilot_POINT(i) <> -1 Then nDim = nDim + 2
			Next

			Select Case nDim
				Case 3  'Ãâ¹ßÁö ¸ñÀûÁö						
					For	i= 0 to	6 step 2			
						
						If Pilot_POINT(i) <> -1 Then
							PointArray3(n+0) = CLng(Pilot_POINT(i+0)-0)
							PointArray3(n+1) = CLng(Pilot_POINT(i+1)-0)
							'msgbox "PointArray3("&n+0&")=" & PointArray3(n+0)
							'msgbox "PointArray3("&n+1&")=" & PointArray3(n+1)
							n=n+2							
						End	If
					Next			

					document.PilotExc.Execute PointArray3, howTo,howMuch	' [(x1,y1,x2,y2...)array],[1=ÃÖ´Ü,2=ÃÖÀû,3=ÃÖÀû+±³Åë],[1=À¯·áÆ÷ÇÔ,2=¹«·á]
				
				Case 5 '°æÀ¯Áö ÇÑ°³

					If Pilot_POINT(0) <> -1 Then
						PointArray5(0) = CLng(Pilot_POINT(0))

					End If

					If Pilot_POINT(1) <>-1 Then
						PointArray5(1) = CLng(Pilot_POINT(1))

					End If

					If Pilot_POINT(6) <>-1 Then
						PointArray5(2) = CLng(Pilot_POINT(6))

					End If

					If Pilot_POINT(7) <>-1 Then
						PointArray5(3) = CLng(Pilot_POINT(7))

					End If

					If Pilot_POINT(2) <>-1 Then
						PointArray5(4) = CLng(Pilot_POINT(2))

					End If

					If Pilot_POINT(3) <>-1 Then
						PointArray5(5) = CLng(Pilot_POINT(3))

					End If

					document.PilotExc.Execute PointArray5, howTo,howMuch	' [(x1,y1,x2,y2...)array],[1=ÃÖ´Ü,2=ÃÖÀû,3=ÃÖÀû+±³Åë],[1=À¯·áÆ÷ÇÔ,2=¹«·á]
				Case 7 '°æÀ¯Áö µÎ°³
					If Pilot_POINT(0) <>-1 Then
						PointArray7(0) = CLng(Pilot_POINT(0))

					End If

					If Pilot_POINT(1) <>-1 Then
						PointArray7(1) = CLng(Pilot_POINT(1))

					End If

					If Pilot_POINT(6) <>-1 Then
						PointArray7(2) = CLng(Pilot_POINT(6))

					End If

					If Pilot_POINT(7) <>-1 Then
						PointArray7(3) = CLng(Pilot_POINT(7))

					End If

					If Pilot_POINT(2) <>-1 Then
						PointArray7(4) = CLng(Pilot_POINT(2))

					End If

					If Pilot_POINT(3) <>-1 Then
						PointArray7(5) = CLng(Pilot_POINT(3))

					End If

					If Pilot_POINT(4) <>-1 Then
						PointArray7(6) = CLng(Pilot_POINT(4))

					End If

					If Pilot_POINT(5) <>-1 Then
						PointArray7(7) = CLng(Pilot_POINT(5))

					End If

					
					document.PilotExc.Execute PointArray7, howTo, howMuch	' [(x1,y1,x2,y2...)array],[1=ÃÖ´Ü,2=ÃÖÀû,3=ÃÖÀû+±³Åë],[1=À¯·áÆ÷ÇÔ,2=¹«·á]
			End Select
			Pilot_Flag = howTo

			window.status=""

'if nDim >= 5 then
'	Dim i1, pointlist1
'	for i1 = 0 to 7
'		pointlist1 = pointlist1 & "*" & Pilot_POINT(i1)
'	next
'	ifrmErrSend.document.location.href = "/_Lib/Templete/ErrReportSend.asp?point="& pointlist1
'end if
			If document.PilotExc.Empty Then
				msgbox "°æ·Î¸¦ Ã£À»¼ö ¾ø½À´Ï´Ù. " & vbcrlf & "Ãâ¹ßÁö ¸ñÀûÁö È®ÀÎÈÄ ´Ù½Ã ½ÃµµÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù." ,vbOKOnly,""
				Call HideProgressBar()    	'°Ë»ö MagDialog Close
				Pilot_search = false
				'Call ResetPilot()
				Exit Function
			Else

			End If

		Else
			MsgBox "Ãâ¹ßÁö¿Í ¸ñÀûÁö¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.",vbOKOnly,"MapTopia	Service	message"
			Call HideProgressBar()    	'°Ë»ö MagDialog Close
			Pilot_search = false
			Exit function
		End If


		Pilot_search = true

	End Function


	'==================================================================================================
	'Ãâ¹ßÁö, °æ¿ìÁö, ¸ñÀûÁö  È®ÀÎÈÄ ¾ÆÀÌÄÜ Ç¥½Ã ÇÔ¼ö
	'==================================================================================================
	Sub Pilot_check
		On Error Resume Next
		Dim t,tt,t2,c



		'°æÀ¯Áö1
		If Pilot_POINT(2) <> -1 And Pilot_POINT(3) <> -1 Then

			IconURL = Cstr(IconSvrURL & "mapico/pass1.png")
			WindCtl.RL_DrawImage "M", IconURL, "LC",Pilot_POINT(2),Pilot_POINT(3)

		End If

		'°æÀ¯Áö2
		If Pilot_POINT(4) <> -1 And Pilot_POINT(5) <> -1 Then

			IconURL = Cstr(IconSvrURL & "mapico/pass3.png")
			WindCtl.RL_DrawImage "M", IconURL, "LC",Pilot_POINT(4),Pilot_POINT(5)


		End If

		'Ãâ¹âÁö
		If Pilot_POINT(0) <> -1 And Pilot_POINT(1) <> -1 Then

			IconURL = Cstr(IconSvrURL & "mapico/departureNew.png")
			Call WindCtl.RL_DrawImage ("M", IconURL, "LC",CLng(Pilot_POINT(0)),CLng(Pilot_POINT(1)))

			' y + 2 * WindCtl.GetDispScale ¼¼·ÎÁ¤È®
			'°¡·Î WindCtl.GetDispScale * 1.2

		End If

		'¸ñÀûÁö
		If Pilot_POINT(6) <> -1 And Pilot_POINT(7) <> -1 Then
			IconURL = Cstr(IconSvrURL & "mapico/arrivalNew.png")
			WindCtl.RL_DrawImage "M", IconURL, "UC",Pilot_POINT(6),Pilot_POINT(7)


			'WindCtl.RL_SetBrush "FFFF0000"
			'WindCtl.RL_SetFont "±¼¸²", 9, 1
			'Call WindCtl.RL_DrawStringWithBoundingRect ("M", "¸ñÀûÁö",   "UC", Pilot_POINT(6), Pilot_POINT(7) - 8 * WindCtl.DisplayScale, 1, "180000FF", "600000FF")

		End If
	End Sub

	'==================================================================================================
	'°æ·ÎÅ½»ö Ãâ¹ßÁö, ¸ñÀûÁö ¼³Á¤ ¿©ºÎ È®ÀÎ ÇÔ¼ö
	'==================================================================================================
	Function Pilotflag_check
		Dim	Pilotflag
		Pilotflag=0
		If Pilot_POINT(0) <> -1	and	Pilot_POINT(1) <> -1 Then
			Pilotflag = Pilotflag + 1
		end if
		If Pilot_POINT(6) <> -1	and	Pilot_POINT(7) <> -1 Then
			Pilotflag = Pilotflag + 1
		end if

		Pilotflag_check	=Pilotflag		
	End Function

	'==================================================================================================
	'°æ·ÎÅ½»ö °á°ú¸¦ Áöµµ¿¡ Ç¥½Ã
	'==================================================================================================
	Sub SetRouteLines
		On Error Resume Next

		Dim PointArray
		Dim sxMBR, syMBR, exMBR, eyMBR
		
		

		If document.PilotExc.Empty = False Then

			PointArray = document.PilotExc.pointArray

			If Not WindCtl.DO_RouteLines Then
				WindCtl.DO_RouteLines = true
			End If

			Select Case Pilot_Flag
				Case 1
					WindCtl.SetRouteLines PointArray , "FFF00000", sxMBR, syMBR, exMBR, eyMBR
				Case 2
					WindCtl.SetRouteLines PointArray , "FFF00000", sxMBR, syMBR, exMBR, eyMBR
				Case Else
					WindCtl.SetRouteLines PointArray , "FFF00000", sxMBR, syMBR, exMBR, eyMBR

			End Select


			Dim xMargin, yMargin
			xMargin = (exMBR - sxMBR) / 10
			yMargin = (eyMBR - syMBR) / 10
			
			Call WindCtl.SetExtent (sxMBR - xMargin, syMBR - yMargin, exMBR + xMargin, eyMBR + yMargin)

		End If
		
		If err.number <> 0 Then
			PrintWindError err.description
			err.clear
		End If

		'err.clear
	End Sub
	
	'==================================================================================================
	'°æ·ÎÅ½»ö °á°ú¸¦ Áöµµ¿¡ Ç¥½Ã
	'==================================================================================================
	Sub SetRouteLinesDraw(LineColorFlag,ExtentFlag )
		On Error Resume Next

		Dim PointArray
		Dim sxMBR, syMBR, exMBR, eyMBR
		
		

		If document.PilotExc.Empty = False Then

			PointArray = document.PilotExc.pointArray

			If Not WindCtl.DO_RouteLines Then
				WindCtl.DO_RouteLines = true
			End If

			Select Case LineColorFlag
				Case 1		' ±¤¿ª ¹ö½º
					'WindCtl.SetRouteLines PointArray , "FFF74A21", sxMBR, syMBR, exMBR, eyMBR
					WindCtl.SetRouteLines PointArray , "FFF00000", sxMBR, syMBR, exMBR, eyMBR
				Case 2		' BLUE °£¼± ¹ö½º
					'WindCtl.SetRouteLines PointArray , "FF4A84C5", sxMBR, syMBR, exMBR, eyMBR
					WindCtl.SetRouteLines PointArray , "FFF00000", sxMBR, syMBR, exMBR, eyMBR
				Case 3		' GREEN Áö¼± ¹ö½º
					'WindCtl.SetRouteLines PointArray , "FF63BD42", sxMBR, syMBR, exMBR, eyMBR
					WindCtl.SetRouteLines PointArray , "FFF00000", sxMBR, syMBR, exMBR, eyMBR
				Case 3		' GREEN °£¼± ¹ö½º
					'WindCtl.SetRouteLines PointArray , "FFF5B308", sxMBR, syMBR, exMBR, eyMBR
					WindCtl.SetRouteLines PointArray , "FFF00000", sxMBR, syMBR, exMBR, eyMBR
				Case Else
					'WindCtl.SetRouteLines PointArray , "FFFFD000", sxMBR, syMBR, exMBR, eyMBR
					WindCtl.SetRouteLines PointArray , "FFF00000", sxMBR, syMBR, exMBR, eyMBR
			End Select
			
			Dim xMargin, yMargin
			xMargin = (exMBR - sxMBR) / 10
			yMargin = (eyMBR - syMBR) / 10
				
			If ExtentFlag = 1 Then
				Call WindCtl.SetExtent (sxMBR - xMargin, syMBR - yMargin, exMBR + xMargin, eyMBR + yMargin)
			Else
				'WindCtl.CopyMemDCtoScreenDC()
				WindCtl.ReDraw()	
			End If

		End If
		
		If err.number <> 0 Then
			PrintWindError err.description
			err.clear
		End If

		'err.clear
	End Sub
	
	'°æ·Î ¶óÀÎÀÌ ÇöÀç Áöµµ¸¦ Áö³ª°¡´Â ¿©ºÎ È®ÀÎ
	'Function InLine(PointArray) 
	'	On Error Resume Next
	'	For i=0 to UBound(PointArray) -1 step 2
	'		If (MapPos_sx < CLng(PointArray(i))) and (MapPos_sy < CLng(PointArray(i+1))) and (MapPos_ex > CLng(PointArray(i))) and (MapPos_ey >  CLng(PointArray(i+1))) Then
	'			InLine = true
	'			Exit Function
	'		End If
	'	Next
	'	InLine = false
	'	
	'End Function



	'mapwndÀÇ mode º¯°æ½Ã ÀÌ¹ÌÁö ¹×	¿ìÃø ÇÁ·¹ÀÓÀÇ ¹öÆ° check
	Sub RoadSearchModechange(s)
		On Error Resume Next
		Dim objwin
		Dim Now_Mode_Check


		NowMethod = "ProRouteSearch" & s

		Call setMapMode(WM_NULL)

		'WindCtl.SetNullModeCursor IconSvrURL & "Cur/icon.ani"

		'document.lnfoFrame.pilot_FrameSet(s)

		'MapWnd.MapMode = 4

		If err.number = 0 Then
			If s = "pilot1" Then
				Now_Mode_Check =  "ÇöÀç ±æÃ£±âÀÇ Ãâ¹ßÁö/¸ñÀûÁö ¼±ÅÃ¸ðµå (Áöµµ¿¡¼­ ¼±ÅÃÇÑÁ¡ÀÌ	Ãâ¹ßÁö·Î ¼±ÅÃµË´Ï´Ù.)"
			ElseIf s = "pilot2"Then
				Now_Mode_Check =  "ÇöÀç ±æÃ£±âÀÇ Ãâ¹ßÁö/¸ñÀûÁö ¼±ÅÃ¸ðµå (Áöµµ¿¡¼­ ¼±ÅÃÇÑÁ¡ÀÌ	°æÀ¯Áö1·Î ¼±ÅÃµË´Ï´Ù.)"
			ElseIf s = "pilot3" Then
				Now_Mode_Check =  "ÇöÀç ±æÃ£±âÀÇ Ãâ¹ßÁö/¸ñÀûÁö ¼±ÅÃ¸ðµå (Áöµµ¿¡¼­ ¼±ÅÃÇÑÁ¡ÀÌ	°æÀ¯Áö2·Î ¼±ÅÃµË´Ï´Ù.)"
			ElseIf s = "pilot4"Then
				Now_Mode_Check =  "ÇöÀç ±æÃ£±âÀÇ Ãâ¹ßÁö/¸ñÀûÁö ¼±ÅÃ¸ðµå (Áöµµ¿¡¼­ ¼±ÅÃÇÑÁ¡ÀÌ	¸ñÀûÁö·Î ¼±ÅÃµË´Ï´Ù.)"
			End If
		End If



		'window.status =	Now_Mode_Check & err.description
	End Sub


	Sub Pilot_point_check(x,y,flag)
		On Error Resume Next
		'--------------------------------------------------------------------------------
		'±æÃ£±â Àü¹®°¡ (°æ·Î°Ë»ö) ¿¡¼­ Ãâ¹ßÁö,¸ñÀûÁö ¼³Á¤½Ã (Viper ClickÀ¸·Î ¼³Á¤ ÇÒ¶§)
		'±æÃ£±â Ã¢ÀÌ ¾øÀ» °æ¿ì error ¹ß»ý On Error Rewume Next Ã³¸®
		'--------------------------------------------------------------------------------
		Dim objwin
		Set objwin = document.lnfoFrame

		If flag =  "pilot1"  Then
			Pilot_POINT(0) = x
			Pilot_POINT(1) = y
		ElseIf flag = "pilot2" Then
			Pilot_POINT(2) = x
			Pilot_POINT(3) = y
		ElseIf flag = "pilot3" Then
			Pilot_POINT(4) = x
			Pilot_POINT(5) = y
		ElseIf flag = "pilot4" Then
			Pilot_POINT(6) = x
			Pilot_POINT(7) = y
		End If

		objwin.lococlicktime(flag)
		'WindCtl.UserMode = BeforeMapMode
		Call WindCtl.ReDraw()
	End Sub
	
	
	'==================================================================================================
	' ´ëÁß±³Åë °Ë»ö
	'==================================================================================================
	Sub searchPilot_Traffic()
		On Error Resume Next
		
		Dim SearchName(1)		
		Dim Search_Opt
		Dim route_id	
		
	
		' ÃÊ±âÈ­½Ã¿¡ ¹ÝµíÀÌ ½ÃÄÑÁÙ°Í
		document.PilotExc.Clear
		document.PilotExc.Cleanup
		
		' À½ Àß ¸ô¶ó¿ä.. 
		' ±âÁ¸¿¡ .. Á¤·ùÀå °Ë»ö±â´ÉÀÌ ÇÊ¿ä½Ã »ç¿ë...
		' ±â´É È®Àå ÇÒ¶§ »ç¿ë...  		
		SearchName(0) = ""
		SearchName(1) = ""
		
		Search_Opt = 20
		route_id = -1

		SetPilotArray() ' PilotArray ¹è¿­À» ¼³Á¤ ÇÕ´Ï´Ù.
		
	

		'msgbox "PilotArray(0) =" & PilotArray(0)
		'msgbox "SearchName =" & SearchName
		'msgbox "Search_Opt ="& Search_Opt
		'msgbox "route_id =" & route_id

		PilotExc.ExecuteRouteSearch PilotArray, SearchName, Search_Opt, route_id	

		If PilotExc.Empty then
			MsgBox "°æ·ÎÅ½»ö¿¡ ½ÇÆÐ ÇÏ¿´½À´Ï´Ù." & vbCrLf&err.Description, vbOKOnly, "Raven Error Message !!!"
			
		else
			'°æ·Î ÁÂÇ¥°ª ¹è¿­
			'MsgBox "°æ·ÎÅ½»ö¿¡ ¼º°ø ÇÏ¿´½À´Ï´Ù." & vbCrLf &err.Description, vbOKOnly, "Raven Success Message !!!"
			'¿ä¾àÁ¤º¸ Ãâ·Â ÇÔ¼ö È£Ãâ
			
			Select Case curLayerNo
				Case 21
					Call document.lnfoFrame_21.DisplayResult(1)
					Call document.lnfoFrame_22.DisplayResult(0)
					Call document.lnfoFrame_23.DisplayResult(0)
					document.lnfoFrame_21.ifrmResult.location.href = "/_Menu/RouteSearch/RouteSearch_Traffic.asp"
				Case 22
					Call document.lnfoFrame_21.DisplayResult(0)
					Call document.lnfoFrame_22.DisplayResult(1)
					Call document.lnfoFrame_23.DisplayResult(0)
					document.lnfoFrame_22.ifrmResult.location.href = "/_Menu/RouteSearch/RouteSearch_Traffic.asp"
				Case 23
					Call document.lnfoFrame_21.DisplayResult(0)
					Call document.lnfoFrame_22.DisplayResult(0)
					Call document.lnfoFrame_23.DisplayResult(1)
					document.lnfoFrame_23.ifrmResult.location.href = "/_Menu/RouteSearch/RouteSearch_Traffic.asp"
				Case Else
					
			End Select

			
			
		End If	
		Call HideProgressBar()    	'°Ë»ö MagDialog Close
	End Sub
	
	
	
	'==================================================================================================
	' Ãâ¹ßÁö, ¸ñÀûÁö, °æÀ¯Áö ¹è¿­ ¸¸µé±â
	'==================================================================================================
	Sub SetPilotArray()
		Dim sn,i,n,nDim
			
		n=0
		nDim=-1		
		For	i= 0 to	6 step 2
			If Pilot_POINT(i) <>-1 Then
				PilotArray(n+0) = CLng(Pilot_POINT(i+0)-0)
				PilotArray(n+1) = CLng(Pilot_POINT(i+1)-0)
				n=n+2				

				'msgbox "PilotArray("&n+0&")" & PilotArray(n+0)
				'msgbox "PilotArray("&n+1&")" & PilotArray(n+1)
			End	If
		Next
		
	End Sub
	
	Sub fnPrint(flag)
		On Error Resume Next

		const wWidth = 700
		const wHeight = 600'822

		Dim fileName
		Dim Openurl, wLeft, wTop

		If err.source = "" Then
			wTop = 0
			wLeft = window.screen.availWidth - wWidth - 10
			'Openurl = "/_Lib/Popup/PrintForm_traffic.asp?flag=" & flag
			If flag = "1" Then
				Openurl = "/_Menu/Map/MapimgCapture.asp?JobFlag=Route" 
			Else
				Openurl = "/_Menu/Map/MapimgCapture.asp?JobFlag=BusSearch" 
			End If
			Call fnWindowOpen(Openurl, "ResultWin", "no", "1", wWidth, wHeight, wLeft, wTop)
		else
			PrintWindError err.description
			err.clear
		end if

	End Sub
	

	

