
	var LINECLICK = false;
	var SETCOURSEID = 0;
	var SETCOURSENO = 0;
	var SETPOILIST = new Object();
	var MTADDLEVEL = 0;
	var ACTIVECOURSE;
	
	WFsMTMan.prototype.FindItem = function(id) 
	{
		return this.WFsMap.MTAREA_FindItem(id);
	};

	WFsMTMan.prototype.MTAdd = function(list, id, caption, leftlon, leftlat, rightlon, rightlat, plevel, poiID, level) 
	{
		LINECLICK = false;
		SETCOURSEID = 0;
		SETCOURSENO = 0;
		SETPOILIST = new Object();
		MTADDLEVEL = plevel;
		
		this.WFsMap.ViewMovingMask(true, 80);
		
		if(plevel == null)
			this.MTAreaAdd (id, caption, leftlon, leftlat, rightlon, rightlat, this.WFsMap.GetAreaLevel(leftlon, leftlat, rightlon, rightlat), poiID );
		else
			this.MTAreaAdd (id, caption, leftlon, leftlat, rightlon, rightlat, plevel, poiID);
			
		if(level == undefined) level = 0;
		this.MTLineAdd (list, id, level);
	};
	
	WFsMTMan.prototype.MTLineAdd = function(list, id, level) 
	{
		this.WFsMap.LoadCourse(list, 4, 0x406C24, level);
	};
	
	//µî»êÁöµµ È°¼º ¿Ï·á½Ã Event ¹ß»ý
	WFsMTMan.prototype.OnLoaded = function()
	{
		this.WFsMap.Track_InfoBoxView( null, false);
		if(EventMan.mapmode == 10)
		{
			this.WFsMap.ViewMovingMask(false, 0);
		}
		else if(EventMan.mapmode == 20)
		{
			this.WFsMap.ViewMovingMask(false, 0);
			this.WFsMap.PrePrint ( );
		}
		
		if(ACTIVECOURSE != undefined) {
			WFsCourseSelect(ACTIVECOURSE);
			ACTIVECOURSE = undefined;
		}
	};
	
	WFsMTMan.prototype.MTAreaAdd = function(id, caption, leftlon, leftlat, rightlon, rightlat, plevel, poiID) 
	{
		this.WFsMap.SetCenterPos(leftlon+(rightlon-leftlon)/2,  leftlat+(rightlat-leftlat)/2, plevel, false);
		var item        = this.WFsMap.MTAREA_NewItem(id);
		item.LeftLon    = leftlon;
		item.LeftLat    = leftlat;
		item.RightLon   = rightlon;
		item.RightLat   = rightlat;
		item.Caption    = caption;
		item.CourseId   = id;
		item.Tag        = poiID;
		this.WFsMap.Update(item);
	};

	WFsMTMan.prototype.TrackInfoShow = function(CourseId, courseNo)
	{
		var Course = new Object();
		Course.Contents = CourseId;
		
		var LineId = (CourseNo%6);
		if(LineId == 0) LineId = 6;
		
		switch(LineId)
		{
			case 1:		this.WFsMap.DrawLine(CourseId, 6, 0xEC008C);	break;
			case 2:		this.WFsMap.DrawLine(CourseId, 6, 0x1DA6CE);	break;
			case 3:		this.WFsMap.DrawLine(CourseId, 6, 0xFFBA00);	break;
			case 4:		this.WFsMap.DrawLine(CourseId, 6, 0xB500FF);	break;
			case 5:		this.WFsMap.DrawLine(CourseId, 6, 0x8C6239);	break;
			case 6:		this.WFsMap.DrawLine(CourseId, 6, 0x363636);	break;
		}
		this.WFsMap.Track_InfoBoxView(Course, true );
	}

	WFsMTMan.prototype.OnLineClick = function(px, py, CourseId, CourseNo, POIList)
	{	
		LINECLICK = true;
		this.WFsMap.DrawLine(SETCOURSEID, 4, 0x406C24);
		
		if(SETCOURSENO > 0)
		{
			if(SETCOURSENO != CourseNo)	//Å¬¸¯Çß´ø ÄÚ½º°¡ ¾Æ´Ò½Ã ÁöÁ¡¹øÈ£ È°¼º
			{
				for(var i=0; i<SETPOILIST.length; i++)
				{
					this.WFsMap.POIShowTitle(SETPOILIST[i], false);

					if( i == 0 || i == (SETPOILIST.length-1) )
						SETPOILIST[i].Symbol = "ANode0";
					else
						SETPOILIST[i].Symbol = "BNode0";

					this.WFsMap.Update(SETPOILIST[i], SETCOURSENO);
				}
			}
		}
		
		SETCOURSEID = CourseId;	
		SETCOURSENO = CourseNo;	
		SETPOILIST = POIList;		
		
		var LineId = (CourseNo%6);
		if(LineId == 0) LineId = 6;

		switch(LineId)
		{
			case 1:		this.WFsMap.DrawLine(CourseId, 6, 0xEC008C);	break;
			case 2:		this.WFsMap.DrawLine(CourseId, 6, 0x1DA6CE);	break;
			case 3:		this.WFsMap.DrawLine(CourseId, 6, 0xFFBA00);	break;
			case 4:		this.WFsMap.DrawLine(CourseId, 6, 0xB500FF);	break;
			case 5:		this.WFsMap.DrawLine(CourseId, 6, 0x8C6239);	break;
			case 6:		this.WFsMap.DrawLine(CourseId, 6, 0x363636);	break;
		}
		
		//var Course = new Object();
		//Course.Contents = CourseId;
		//this.WFsMap.LoadInfoBox("InfoBox.swf", title, contents);
		//this.WFsMap.Track_InfoBoxView(Course, true );
		var obj = new Object();
		obj.Contents = CourseId;
		obj.X = px;
		obj.Y = py;
		this.WFsMap.Track_InfoBoxView( obj, true );
	};

	WFsMTMan.prototype.OnLineOver = function(CourseId, CourseNo, POIList)
	{
		LINECLICK = false;
		
		ActiveCourseLine(CourseNo, CourseId, POIList);	// ÄÚ½º¶óÀÎ È°¼ºÈ­

	};
	
	WFsMTMan.prototype.OnLineOut = function(CourseId, CourseNo, POIList)
	{	
		if(SETCOURSEID != CourseId)
		{
			this.WFsMap.DrawLine(CourseId, 4, 0x406C24);
		
			// ÄÚ½º ÁöÁ¡¹øÈ£¸¦ ºñÈ°¼º
			for(var i=0; i<POIList.length; i++)
			{
				this.WFsMap.POIShowTitle(POIList[i], false);

				if( i == 0 || i == (POIList.length-1) )
					POIList[i].Symbol = "ANode0";
					POIList[i].Symbol = "BNode0";

				this.WFsMap.Update(POIList[i], CourseNo);
			}
			ActiveCourseLine(SETCOURSENO, SETCOURSEID);	// ÄÚ½º¶óÀÎ È°¼ºÈ­
		}
	};
	function ActiveCourseLine(courseNo, courseId, ppoilist)
	{
		//ÀÌÀü¿¡ Å¬¸¯ÇÑ ÄÚ½º¶óÀÎÀ» ´Ù½Ã È°¼º½ÃÅ²´Ù. 
		var LineId = (courseNo%6);
		if(LineId == 0) LineId = 6;
		
		switch(LineId)
		{
			case 1:		MTMan.WFsMap.DrawLine(courseId, 6, 0xEC008C);	break;
			case 2:		MTMan.WFsMap.DrawLine(courseId, 6, 0x1DA6CE);	break;
			case 3:		MTMan.WFsMap.DrawLine(courseId, 6, 0xFFBA00);		break;
			case 4:		MTMan.WFsMap.DrawLine(courseId, 6, 0xB500FF);		break;
			case 5:		MTMan.WFsMap.DrawLine(courseId, 6, 0x8C6239);	break;
			case 6:		MTMan.WFsMap.DrawLine(courseId, 6, 0x363636);	break;
		}
		
		if(ppoilist != undefined)
		{
			for(var i=0; i<ppoilist.length; i++)
			{
				MTMan.WFsMap.POIShowTitle(ppoilist[i], true);

				if( i == 0 || i == (ppoilist.length-1) )
					ppoilist[i].Symbol = "ANode" + LineId;
				else
					ppoilist[i].Symbol = "BNode" + LineId;

				MTMan.WFsMap.Update(ppoilist[i], courseNo);
			}
		}

	}
	WFsMTMan.prototype.UnLoadCourse = function()
	{
		this.WFsMap.UnLoadCourse  ( );
		this.WFsMap.MTAREA_Delete ( );
	};