/*
* LSouSouObject.js
* 战棋游戏部分共通类
**/
var LSouSouObject=function(){};
LSouSouObject.perWarList = [];
LSouSouObject.memberList = [];
LSouSouObject.BELONG_SELF = 0;
LSouSouObject.BELONG_FRIEND = -1;
LSouSouObject.BELONG_ENEMY = 1;
LSouSouObject.sQuery = null;
LSouSouObject.getBar=function(w,h){
	var barWidth = 500,barHeight = 380;
	var img,bar = new LSprite();
	if(w > 530){
		for(var i=15;i<15+(w-530)*0.5+1;i+=100){
			img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-up'],0,0,100,15));
			img.x = i;
			bar.addChild(img);
			img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-down'],0,0,100,15));
			img.x = i;
			img.y = h - 15;
			bar.addChild(img);
		}
		img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-up'],0,0,500,15));
		img.x = (w-500)*0.5;
		bar.addChild(img);
		img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-down'],0,0,500,15));
		img.x = (w-500)*0.5;
		img.y = h - 15;
		bar.addChild(img);
		for(var i=w-15;i>(w+530)*0.5 - 15;i-=100){
			img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-up'],400,0,100,15));
			img.x = i - 100;
			bar.addChild(img);
			img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-down'],400,0,100,15));
			img.x = i - 100;
			img.y = h - 15;
			bar.addChild(img);
		}
	}else{
		img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-up'],(530 - w)*0.5,0,w-30,15));
		img.x = 15;
		bar.addChild(img);
		img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-down'],(530 - w)*0.5,0,w-30,15));
		img.y = h - 15;
		img.x = 15;
		bar.addChild(img);
	}
	
	if(h > 410){
		for(var i=15;i<(h-410)*0.5 + 1;i+=50){
			img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-left'],0,0,15,50));
			img.y = i;
			bar.addChild(img);
			img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-right'],0,0,15,50));
			img.y = i;
			img.x = w - 15;
			bar.addChild(img);
		}
		img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-left'],0,0,15,380));
		img.y = (h-380)*0.5;
		bar.addChild(img);
		img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-right'],0,0,15,380));
		img.y = (h-380)*0.5;
		img.x = w - 15;
		bar.addChild(img);
		for(var i=h-15;i>(h+410)*0.5;i-=50){
			img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-left'],0,330,15,50));
			img.y = i - 50;trace(img.y);
			bar.addChild(img);
			img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-right'],0,330,15,50));
			img.y = i - 50;
			img.x = w - 15;
			bar.addChild(img);
		}
	}else{
		img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-left'],0,(410 - h)*0.5,15,h-30));
		img.y = 15;
		bar.addChild(img);
		img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-right'],0,(410 - h)*0.5,15,h-30));
		img.x = w - 15;
		img.y = 15;
		bar.addChild(img);
	}
	img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-left-up'],0,0,15,15));
	bar.addChild(img);
	img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-right-up'],0,0,15,15));
	img.x = w - 15;
	bar.addChild(img);
	img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-left-down'],0,0,15,15));
	img.y = h - 15;
	bar.addChild(img);
	img = new LBitmap(new LBitmapData(LGlobal.imglist['bar-right-down'],0,0,15,15));
	img.x = w - 15;
	img.y = h - 15;
	bar.addChild(img);
	return bar;
};