OnPlaceChanged=function(oldPlace,newPlace){
	var bTopVisibleOld=box_bar.bg_top.IsVisible();
	var bTopVisibleOld2=box_bar.bg_bottom.IsVisible();
	var bTopVisible=newPlace.y>=0;

	var needReset=false;
	var oldWidth=box_bar.GetPlace().width;
	var newWidth=newPlace.width>290?288:130;
	if(oldWidth!=newWidth){
		needReset=true;
		box_bar.box_bar1.ShowChildGroup("cg_big",newPlace.width>290);
	}
	if(bTopVisibleOld==bTopVisibleOld2||bTopVisibleOld!=bTopVisible){
		box_bar.bg_top.Show(bTopVisible);
		box_bar.bg_bottom.Show(!bTopVisible);
		needReset=true;
		var ps1=box_bar.box_bar1.GetPlaceSet();
		box_bar.box_bar1.Reset(ps1.rect,ps1.size,bTopVisible?"ltr":"lbr",ps1.zindex); 
	}
	if(needReset){
		var ps=box_bar.GetPlaceSet();
		ps.size.cx=newWidth;
		box_bar.Reset(ps.rect,ps.size,bTopVisible?"ct":"cb",ps.zindex);
	}
}
function Number(str){
	return str*1;
}
BeforeSetWndPlace=function(newPlace){
	var screenSize=GetScreenSize();
	var ctrlPlace=desktop_lrc.GetPlace();
	var x_ctrl=Number(newPlace.x)+Number(ctrlPlace.x);
	var y_ctrl=Number(newPlace.y)+Number(ctrlPlace.y);

	if(x_ctrl<0) x_ctrl=0;
	if(x_ctrl+Number(ctrlPlace.width)>Number(screenSize.cx)) x_ctrl=Number(screenSize.cx)-Number(ctrlPlace.width);
	if(y_ctrl<0) y_ctrl=0;
	if(y_ctrl+Number(ctrlPlace.height)>Number(screenSize.cy)) y_ctrl=Number(screenSize.cy)-Number(ctrlPlace.height);
	newPlace.x=x_ctrl-Number(ctrlPlace.x);
	newPlace.y=y_ctrl-Number(ctrlPlace.y);
	return true;
}
