function Number(str){
	return str*1;
}
OnPlaceChanged=function(oldPlace,newPlace){
	var top=0;
	if(Number(GetWindowsVersion().MajorVersion)>=6){
		top=Number(GetWorkArea().top);
	}
	var bTopVisibleOld=box_bar.bg_top.IsVisible();
	var bTopVisibleOld2=box_bar.bg_bottom.IsVisible();
	var bTopVisible=newPlace.y>=top;

	var needReset=false;
	var oldWidth=box_bar.GetPlace().width;
	var newWidth=newPlace.width>271?269:111;
	if(oldWidth!=newWidth){
		needReset=true;
		box_bar.box_bar1.ShowChildGroup("cg_big",newPlace.width>271);
	}
	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);
	}
}
BeforeSetWndPlace=function(newPlace){
	var left=0;
	var top=0;
	var right=0;
	var bottom=0;
	if(Number(GetWindowsVersion().MajorVersion)>=6){
		var workArea=GetWorkArea();
		left=Number(workArea.left);
		top=Number(workArea.top);
		right=Number(workArea.right);
		bottom=Number(workArea.bottom);
	}
	else{
		var screenSize=GetScreenSize();
		right=Number(screenSize.cx);
		bottom=Number(screenSize.cy);
	}
	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<left) x_ctrl=left;
	if(x_ctrl+Number(ctrlPlace.width)>right) x_ctrl=right-Number(ctrlPlace.width);
	if(y_ctrl<top) y_ctrl=top;
	if(y_ctrl+Number(ctrlPlace.height)>bottom) y_ctrl=bottom-Number(ctrlPlace.height);
	newPlace.x=x_ctrl-Number(ctrlPlace.x);
	newPlace.y=y_ctrl-Number(ctrlPlace.y);
	return true;
}
