<?xml version="1.0" encoding="Win-1251"?>
<rmml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="L:\collaborative-nir\program\Cscl3DWS\rmml\RMML.xsd">
	<include src="resimage.xml" />
	<include src="kmbutton.xml" />
	<composition _name="CBaseWindow" userEvents="evClosed, onMoved" depth="-1">
		<script>
			this.txtTitle = null;
			this.onClose = null;
			this.drag=false;
			this.dragPointX = 0;
			this.dragPointY = 0;
			this.useOnlyClientArea = true;
		</script>
		<styles _name="stlTitle" fontSize="12"  fontFamily="Microsoft Sans Serif"  textAlign="left" color="eval(WNDTITLECOLOR)"/>
		<!--<image _name="imTop" src="eval(ENVRPATH+'window\\top.png')"/>-->
		<composition name="imTop" class="CResizablePaper">
			<image _name="lt" src="eval(ENVRPATH+'window\\top.png')">
				<script>this.crop(0,0,4,4);</script>
			</image>
			<image _name="ct" src="eval(ENVRPATH+'window\\top.png')">
				<script>this.crop(4,0,250,4);</script>
			</image>
			<image _name="rt" src="eval(ENVRPATH+'window\\top.png')">
				<script>this.crop(295,0,25,4);</script>
			</image>
			<image _name="lc" src="eval(ENVRPATH+'window\\top.png')">
				<script>this.crop(0,4,4,15);</script>
			</image>
			<image _name="cc" src="eval(ENVRPATH+'window\\top.png')">
				<script>this.crop(4,4,250,15);</script>
			</image>
			<image _name="rc" src="eval(ENVRPATH+'window\\top.png')">
				<script>this.crop(295,4,25,15);</script>
			</image>
			<image _name="lb" src="eval(ENVRPATH+'window\\top.png')">
				<script>this.crop(0,19,4,4);</script>
			</image>
			<image _name="cb" src="eval(ENVRPATH+'window\\top.png')">
				<script>this.crop(4,19,250,4);</script>
			</image>
			<image _name="rb" src="eval(ENVRPATH+'window\\top.png')">
				<script>this.crop(295,19,25,4);</script>
			</image>
		</composition>
		<!--<image _name="imFrame" src="eval(ENVRPATH+'window\\frame.png')" _y="23"/>-->
		<composition name="imFrame"  class="CResizablePaper" _y="23">
			<image _name="lt" src="eval(ENVRPATH+'window\\frame.png')">
				<script>this.crop(0,0,4,4);</script>
			</image>
			<image _name="ct" src="eval(ENVRPATH+'window\\frame.png')">
				<script>this.crop(4,0,312,4);</script>
			</image>
			<image _name="rt" src="eval(ENVRPATH+'window\\frame.png')">
				<script>this.crop(316,0,4,4);</script>
			</image>
			<image _name="lc" src="eval(ENVRPATH+'window\\frame.png')">
				<script>this.crop(0,4,4,20);</script>
			</image>
			<image _name="cc" src="eval(ENVRPATH+'window\\frame.png')">
				<script>this.crop(4,4,312,20);</script>
			</image>
			<image _name="rc" src="eval(ENVRPATH+'window\\frame.png')">
				<script>this.crop(316,4,4,20);</script>
			</image>
			<image _name="lb" src="eval(ENVRPATH+'window\\frame.png')">
				<script>this.crop(0,211,4,4);</script>
			</image>
			<image _name="cb" src="eval(ENVRPATH+'window\\frame.png')">
				<script>this.crop(4,211,312,4);</script>
			</image>
			<image _name="rb" src="eval(ENVRPATH+'window\\frame.png')">
				<script>this.crop(316,211,4,4);</script>
			</image>
		</composition>
		<composition _name="btClose"  _x="304"  _y="3" _depth="-1" class="CKMButton">
			<script>
				this.imCount = 4;
				this.checkButton = false;
			</script>
			<image _name="img" src="eval(ENVRPATH+'window\\btClose.png')"/>
			<script event="onClick">
				parent.close();
			</script>
		</composition>
		<script><![CDATA[
			function showDialog()
			{
				this.modal = true;
				this.show();
			}

			function close()
			{
				this.modal = false;
				this._visible = false;
				//this.enabled = false;
				if( this.onClose != null)
					this.onClose();
				fireEvent("evClosed");
			}

			function setTitle(stitle)
			{
				if( this.txtTitle == null)
				{
					this.txtTitle = new Text();
					this.txtTitle._x = 10;
					this.txtTitle._y = 2;
					this.txtTitle._depth = -1;
					this.txtTitle.parent = this;
					this.txtTitle.style = stlTitle;
					this.txtTitle.enabled = false;
				}
				this.txtTitle.value = '<b>'+stitle+'</b>';
			}

			function resize(w, h)
			{
				if ((w == undefined)||(h == undefined))
				{
					trace("ERROR: resize() - one or more args is not defined");
					return;
				}
				if ((typeof(w) != "number")||(typeof(h) != "number"))
				{
					trace("ERROR: resize() args must be numbers");
					return;
				}
				//this.imFrame._width = w;
				//this.imFrame._height = h;
				this.imFrame.resize(w, h);
				//this.imTop._width = w;
				this.imTop.resize(w, 23);
//trace("this.imTop.height="+this.imTop.height);
				this.hsA01.hitArea = "[0,0," + w + ",23]";
				this.btClose._x = w - this.btClose._width -3;
			}

			function resizeClient(w, h)
			{
				this.resize( w, h + imTop._height);
			}

			function moveBy(dx, dy)
			{
			}

			function moveTo(ax, ay)
			{
				if( this.useOnlyClientArea)
				{
					if( ax+this.width > Player.window.clientWidth)
						ax = Player.window.clientWidth - this.width;
					if( ax < 0)	ax = 0;
					if( ay+this.height+scene.y > Player.window.clientHeight)
						ay = Player.window.clientHeight - this.height - scene.y;
					if( ay < 0)	ay = 0;
				}
				this.x = ax;
				this.y = ay;
				fireEvent("onMoved");
			}

			function centerScreen()
			{
				this.moveTo((800 - this._width)/2, (600 - this.imFrame._height)/2)
			}

			function getWidth()
			{
				return this.imFrame.width;
			}

			function getHeight()
			{
				return this.imFrame.height;
			}
		]]></script>
		<button _name="hsA01" hitArea="[ 0,0,320,25]" enabled="true" _depth="0">
			<script event="onPress">
				this.parent.startDrag();
			</script>
			<script event="onMouseMove">
				if(this.parent.drag)
					this.parent.fdrag(scene._xmouse, scene._ymouse);
			</script>
			<script event="onRelease">
				this.parent.endDrag();
			</script>
			<script event="onReleaseOutside">
				this.parent.endDrag();
			</script>
		</button>
		<script><![CDATA[
			function startDrag()
			{
				this.dragPointX = this.xMouse;
				this.dragPointY = this.yMouse;
				this.drag = true;
			}
			function endDrag()
			{
				this.drag = false;
			}
			function fdrag(nx, ny)
			{
				// Проверка на отрицательные значения
				if( nx > 32000)	nx = nx - 65535;
				if( ny > 32000)	ny = ny - 65535;
				var newX = nx-this.dragPointX;
				var newY = ny-this.dragPointY;
				this.moveTo(newX, newY);
			}
		]]></script>
	</composition>
	<composition name="CBackNavigWindow" class="CBaseWindow" userEvents="onGoBack">
		<image name="btBack" src="eval(ENVRPATH+'window\\btBack.png')"  x="4" y="4"  depth="-1" visible="false">
			<script event="onPress">
				fireEvent("parent.onGoBack");
			</script>
		</image>
	</composition>
	<composition name="CNextPrevNavig" userEvents="onGoPrev,onGoNext">
		<image name="FonNavig" src="eval(ENVRPATH+'window\\fon.png')"  x="0" y="0"/>
		<image name="butPrev" src="eval(ENVRPATH+'window\\prev.png')"  x="14" y="10">
			<script event="onPress">
				fireEvent("parent.onGoPrev");
			</script>
		</image>
		<image name="butNext" src="eval(ENVRPATH+'window\\next.png')"  x="44" y="10">
			<script event="onPress">
				fireEvent("parent.onGoNext");
			</script>
		</image>
	</composition>
</rmml>
