<?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="dragDrop.xml"/>
	<include src="resimage.xml"/>
	<composition name="CItemTemplate" visible="false" enabled="true">
		<text name="txCaption" style="stNormalItem"/>
		<styles name="stNormalItem" fontFamily="Arial" fontSize="20" color="#FF0000"/>
		<styles name="stOveredItem" fontFamily="Arial" fontSize="20" color="#00FF00"/>
		<styles name="stSelectedItem" fontFamily="Arial" fontSize="20" color="#0000FF"/>
		<script>
			this.data = null;
		</script>
		<script event="onRelease">
			this.parent.onItemSelected( this);
		</script>
		<script><![CDATA[
			function init(arrStyle)
			{
				if (arrStyle.length > 0)
					this.stNormalItem = arrStyle[0];
				if (arrStyle.length > 1)
					this.stOveredItem = arrStyle[1];
				if (arrStyle.length > 2)
					this.stSelectedItem = arrStyle[2];
				this.onRollOver = function()
					{
						if(this.txCaption.style.name!="stOveredItem")
							this.txCaption.style=this.stOveredItem;
					}
				this.onRollOut = function()
					{
						if(this.txCaption.style.name!="stNormalItem")
							this.txCaption.style=this.stNormalItem;
					}
			}]]></script>
	</composition>
	<composition name="CListBase">
		<composition name="itemTemplate" class="CItemTemplate" visible="false" enabled="true"/>
		<script><![CDATA[
			this.items = null;
			this.usedItems = 0;
			this.leftMargin = 0;
			this.rightMargin = 0;
			this.topMargin = 0;
			this.bottomMargin = 0;
			this.itemPadding = 0;
			function reset()
			{
				for (var i = 0;  i < this.items.length;  i++)
					this.items[ i].visible=false;
				this.visible = false;
				this.usedItems = 0;
			}

			function addItem( aText, aData)
			{
				var itemY = this.topMargin;
				if (this.items == null)
					this.items = new Array();
				if (this.usedItems > 0)
					itemY = this.items[ this.usedItems-1].y +
					this.items[ this.usedItems-1].txCaption.getMediaSize().height + this.itemPadding;
				var newItem;
				if (this.usedItems < this.items.length)
					newItem = this.items[ this.usedItems];
				else
				{
					newItem = new Composition();
					newItem._class = itemTemplate;
					newItem.name = "item" + this.items.length;
					newItem.id = this.items.length;
					newItem.x = this.leftMargin;
					newItem.parent = this;
					this.items.push( newItem);
				}
				this.usedItems++;
				newItem.y = itemY;
				newItem.txCaption.value = aText;
				newItem.txCaption.height = newItem.txCaption.getMediaSize().height
				newItem.data = aData;
				newItem.visible = true;
				newItem.init( 3, [this.stNormalItem,this.stOveredItem,this.stOveredItem], false);
				return newItem;
			}

			function getListWidth()
			{
				return this.leftMargin + this.width + this.rightMargin;
			}

			function getListHeight()
			{
				return this.topMargin + this.height + this.bottomMargin;
			}
		]]></script>
	</composition>
	<composition name="CBulletList" _class="CListBase">
		<composition name="itemTemplate">
			<image name="imBullet"/>
		</composition>
		<script><![CDATA[
			this.bulletPadding = 0;
			function addItem( aText, aData)
			{
				var newItem = this.CListBase_addItem( aText, aData);
				newItem.txCaption.x = newItem.imBullet.width + this.bulletPadding;
				return newItem;
			}
		]]></script>
	</composition>
	<composition name="CBulletFonList" _class="CListBase">
		<composition name="itemTemplate">
			<image name="imFon" depth="0"/>
		</composition>
		<script><![CDATA[
			this.bulletPadding = 0;
			function addItem( aText, aData)
			{
				var newItem = this.CListBase_addItem( aText, aData);
				newItem.txCaption.x = newItem.imBullet.width + this.bulletPadding;
				return newItem;
			}
		]]></script>
	</composition>
	<composition name="CNumberBulletList" _class="CBulletList">
		<composition name="itemTemplate">
			<styles name="stNumber" fontFamily="Times New Roman" fontSize="14" color="#FF0000"/>
			<text name="txNumber" style="stNumber" width="30"/>
		</composition>
		<script><![CDATA[
			function addItem( aText, aData, aNumber)
			{
				var newItem = this.CBulletList_addItem( aText, aData);
				newItem.txNumber.value = (aNumber == undefined ? this.usedItems : aNumber)
				newItem.txCaption.x = Math.max( newItem.imBullet.width, newItem.txNumber.getMediaSize().width) + this.bulletPadding;
				if (newItem.txNumber.value>9) newItem.txNumber.x -=6;
				return newItem;
			}
		]]></script>
	</composition>
	<composition name="CBulletNumberList" _class="CBulletList">
		<composition name="itemTemplate">
			<styles name="stNumber" fontFamily="Times New Roman" fontSize="14" color="#FF0000"/>
			<text name="txNumber" style="stNumber" width="30"/>
		</composition>
		<script><![CDATA[
			function addItem( aText, aData, aNumber)
			{
				var newItem = this.CBulletList_addItem( aText, aData);
				newItem.txNumber.value = (aNumber == undefined ? this.usedItems : aNumber)
				newItem.txCaption.x = Math.max( newItem.imBullet.width, newItem.txNumber.getMediaSize().width) + this.bulletPadding;
				if (newItem.txNumber.value>9) newItem.txNumber.x -=6;
				return newItem;
			}
		]]></script>
	</composition>
	<composition name="CNumberList" _class="CListBase">
		<composition name="itemTemplate">
			<styles name="stNumber" fontFamily="Times New Roman" fontSize="14" color="#FF0000"/>
			<text name="txNumber" style="stNumber" width="30"/>
		</composition>
		<script><![CDATA[
			function addItem( aText, aData, aNumber)
			{
				var newItem = this.CListBase_addItem( aText, aData);
				newItem.txNumber.value = (aNumber == undefined ? this.usedItems : aNumber)
				newItem.txCaption.x =  newItem.txNumber.getMediaSize().width + this.numberPadding;
				newItem.txNumber.y = newItem.txCaption.y;
				if (newItem.txNumber.value>9) newItem.txNumber.x -=newItem.txNumber.getMediaSize().width/2;
				return newItem;
			}
		]]></script>
	</composition>
	<composition name="CHorizList" _class="CListBase">
		<script>
			this.itemSelected=null;
		</script>
		<composition name="itemTemplate">
			<styles name="stSelectedItem" fontFamily="Times New Roman" fontSize="14" color="#330099"/>
			<script event="onRelease"><![CDATA[
					if (this.parent.itemSelected!=this)
						{
							if ( this.parent.itemSelected!=null)
								this.parent.itemSelected.txCaption.style=stNormalItem;
							this.parent.itemSelected=this;
							this.txCaption.style=stSelectedItem;
						}
			]]></script>
		</composition>
		<script>
			this.itemSelected=null;
		</script>
		<script><![CDATA[
			function addItem( aText, aData)
			{
				var newItem = this.CListBase_addItem( aText, aData);
				var ItemX =0;
				if (this.usedItems > 1)
					{
						ItemX = this.items[ this.usedItems-2].txCaption.x +this.items[ this.usedItems-2].txCaption.getMediaSize().width+this.itemPadding ;
					};
				newItem.txCaption.x = ItemX;
				newItem.y = this.items[ this.usedItems-1].txCaption.y;
				newItem.txCaption.width=newItem.txCaption.getMediaSize().width;
				return newItem;
			}
		]]></script>
	</composition>

</rmml>
