function LSouSouSMapClick(){
	var self = this;
	base(self,LSprite,[]);
}
LSouSouSMapClick.prototype.onDown = function(e){
	if(LSouSouObject.sMap.menu == null)LSouSouObject.sMap.mouseIsDown = true;
	LSouSouObject.sMap.mapIsMove = false;
};
LSouSouSMapClick.prototype.onUp = function(e){
	LSouSouObject.sMap.mouseIsDown = false;
	var mx = e.selfX;
	var my = e.selfY;
	var self = LSouSouObject.sMap.smapClick;
	if(LSouSouObject.sMap.roadList != null){
		self.clickRoad(mx,my);
	}else if(LSouSouObject.sMap.menu != null){
		LSouSouObject.sMap.sMenu.onClick(LSouSouObject.sMap.menu,mouseX,mouseY);
	}else{
		var isClick = false;
		//是否点击我军
		isClick = self.checkCharacter(LSouSouObject.sMap.ourlist,mx,my);
		if(isClick)return;
		//是否点击友军
		isClick = self.checkCharacter(LSouSouObject.sMap.friendlist,mx,my);
		if(isClick)return;
		//是否点击敌军
		isClick = self.checkCharacter(LSouSouObject.sMap.enemylist,mx,my);
		if(isClick)return;
                //点击战场，显示地形 暂略...
	}
};
LSouSouSMapClick.prototype.clickRoad = function(mx,my){
	var intX = ((mx - LSouSouObject.sMap.backLayer.x)/LSouSouObject.sMap.nodeLength) >>> 0;
	var intY = ((my - LSouSouObject.sMap.backLayer.y)/LSouSouObject.sMap.nodeLength) >>> 0;
	var isRoad = false,node,_characterS,i,j;
	for(i=0;i<LSouSouObject.sMap.roadList.length;i++){
		node = LSouSouObject.sMap.roadList[i];
		for(j=0;j<LSouSouObject.sMap.ourlist.length;j++){
			_characterS = LSouSouObject.sMap.ourlist[j];
			if(_characterS.visible && _characterS.member.getIndex() != LSouSouObject.charaSNow.member.getIndex() && _characterS.locationX() == intX && _characterS.locationY() == intY)return;
		}
		for(j=0;j<LSouSouObject.sMap.friendlist.length;j++){
			_characterS = LSouSouObject.sMap.friendlist[j];
			if(_characterS.locationX() == intX && _characterS.locationY() == intY)return;
		}
		for(j=0;j<LSouSouObject.sMap.enemylist.length;j++){
			_characterS = LSouSouObject.sMap.enemylist[j];
			if(_characterS.locationX() == intX && _characterS.locationY() == intY)return;
		}
		if(mx >= node.x*LSouSouObject.sMap.nodeLength + LSouSouObject.sMap.backLayer.x && 
			mx < node.x*LSouSouObject.sMap.nodeLength + LSouSouObject.sMap.backLayer.x + LSouSouObject.sMap.nodeLength && 
			my >= node.y*LSouSouObject.sMap.nodeLength + LSouSouObject.sMap.backLayer.y && 
			my < node.y*LSouSouObject.sMap.nodeLength + LSouSouObject.sMap.backLayer.y + LSouSouObject.sMap.nodeLength){
			isRoad = true;
			break;
		}
	}
	if(!isRoad)return;
	LSouSouObject.sMap.moveToCoordinate(intX,intY);
};
LSouSouSMapClick.prototype.checkCharacter = function(list,mx,my){
	var i,isChara,sx,sy,act,_characterS;
	for(i=0;i<list.length;i++){
		_characterS = list[i];
		if(!_characterS.visible)continue;
		if(mx > _characterS.x + LSouSouObject.sMap.backLayer.x && 
			mx < _characterS.x + LSouSouObject.sMap.backLayer.x + LSouSouObject.sMap.nodeLength && 
			my > _characterS.y + LSouSouObject.sMap.backLayer.y && 
			my < _characterS.y + LSouSouObject.sMap.backLayer.y + LSouSouObject.sMap.nodeLength){
			LSouSouObject.charaSNow = _characterS;
			sx = LSouSouObject.charaSNow.x;
			sy = LSouSouObject.charaSNow.y;
			act = LSouSouObject.charaSNow.action;
			LSouSouObject.returnFunction = function (){
				LSouSouObject.charaSNow.x = sx;
				LSouSouObject.charaSNow.y = sy;
				LSouSouObject.charaSNow.action = act;
				LSouSouObject.charaSNow.tagerCoordinate=new LPoint(LSouSouObject.charaSNow.x,LSouSouObject.charaSNow.y);
				LSouSouObject.sMap.menu = LSouSouSMapMenu.addSMenu(LSouSouObject.charaSNow.x,LSouSouObject.charaSNow.y,"select");
				LSouSouObject.sMap.menuLayer.addChild(LSouSouObject.sMap.menu);
			}
			LSouSouObject.returnFunction();
			return true;
		}
	}
	return false;
};
LSouSouSMapClick.prototype.setClickEvent = function(){
	var self = this;
	LSouSouObject.sMap.addEventListener(LMouseEvent.MOUSE_UP,self.onUp); 
	LSouSouObject.sMap.addEventListener(LMouseEvent.MOUSE_DOWN,self.onDown); 
};
LSouSouSMapClick.prototype.removeClickEvent = function(){
	var self = this;
	LSouSouObject.sMap.removeEventListener(LMouseEvent.MOUSE_UP,self.onUp); 
	LSouSouObject.sMap.removeEventListener(LMouseEvent.MOUSE_DOWN,self.onDown); 
};
LSouSouSMapClick.prototype.setAtkClickEvent = function(){
	var self = this;
	LSouSouObject.sMap.attackRangeLayer.addEventListener(LMouseEvent.MOUSE_UP,self.onAtkClickUp); 
};
LSouSouSMapClick.prototype.removeAtkClickEvent = function(){
	var self = this;
	LSouSouObject.sMap.attackRangeLayer.removeEventListener(LMouseEvent.MOUSE_UP,self.onAtkClickUp); 
};
LSouSouSMapClick.prototype.onAtkClickUp = function(e){
	trace("onAtkClickUp is click");
	var mx = e.selfX;
	var my = e.selfY;
	var intX = ((mx - LSouSouObject.sMap.backLayer.x)/LSouSouObject.sMap.nodeLength) >>> 0;
	var intY = ((my - LSouSouObject.sMap.backLayer.y)/LSouSouObject.sMap.nodeLength) >>> 0;
	var nodeStr;
	var nodeArr;
	var _characterS;
	var list = LSouSouObject.sMap.enemylist;
	for(i=0;i<list.length;i++){
		_characterS = list[i];
		if(!_characterS.visible)continue;
		if(mx > _characterS.x + LSouSouObject.sMap.backLayer.x && 
			mx < _characterS.x + LSouSouObject.sMap.backLayer.x + LSouSouObject.sMap.nodeLength && 
			my > _characterS.y + LSouSouObject.sMap.backLayer.y && 
			my < _characterS.y + LSouSouObject.sMap.backLayer.y + LSouSouObject.sMap.nodeLength){
			LSouSouObject.sMap.menu.parent.removeChild(LSouSouObject.sMap.menu);
			LSouSouObject.sMap.menu = null;
			LSouSouObject.sMap.attackRangeLayer.graphics.clear();
			LSouSouObject.charaSNow.targetCharacter = _characterS;
	trace("LSouSouObject.charaSNow.targetCharacter="+LSouSouObject.charaSNow.targetCharacter);
			//攻击
			LSouSouObject.charaSNow.setAttackNumber();
			LSouSouObject.charaSNow.attackCalculate();
		}
	}
};