<?xml version="1.0" encoding="UTF-8"?>
<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="list.xml"/>

	<composition name="CPhotoList"  x="800" y="0" depth="0">
		<composition name="imFrame"  class="CResizablePaper">
			<script>
				init("rmeq:environment\\photo\\frame_back.png", 2, 2, 2, 2);
			</script>
		</composition>
		<!--<text name="fotoTxt" value="Фотографии" style="stlFotoTxt" y="5" x="65"/>-->
		<image name="imgTitle" src="rmeq:environment\photo\photolist1.png" depth="-10" visible="true"/>
		<image name="imgBottom" src="rmeq:environment\photo\photolist2.png" depth="-10" visible="true" y="590"/>
		<styles _name="stlFotoTxt" fontSize="14" fontFamily="Microsoft Sans Serif" textAlign="justify" color="#000000"/>

		<composition name="list" class="CScrolledList" userProperties="lines=false" y="46">
			<script>
				this.nextId = 0;
			</script>

			<script event="evItemAdd">
				this.nextId += 1;
			</script>

			<image name="img1" src="eval(ENVRPATH+'viewporthint.png')" visible="false">
			<script>
					this.width = 150;
					this.height = 150;
				</script>
			</image>
			<image name="maskIm" src="rmeq:environment\photo\frame_back.png" visible="false">
				<script>
					this.width = 210;
					this.height = 544;
				</script>
			</image>
			<script>
				this.showTree();
				this.createScroller(maskIm);
				this.setTab(0);
				this.setSpace(-10);
				setStringInterval(15);
			</script>
		</composition>
		<composition name="item" visible="false">
			<script>
				this.w = 177;
				this.h=133;
			</script>
			<styles name="stlID" fontSize="12"  fontFamily="Arial"  textAlign="center" color="#9B8A64"/>
			<text name="id" style="stlID" depth="-1" y="2" x="3">
				<script><![CDATA[
					this.value="<b>1.</b>";
					this.width=21;
					this.height=26;]]>
				</script>
			</text>
			<image name="id_back" src="rmeq:environment\photo\idback.png"/>
			<image name="photo"/>
			<styles name="stlText" fontSize="12"  fontFamily="Arial"  textAlign="left" color="#9B8A64"/>
			<text name="text" style="stlText"/>
			<composition name="frame_photo" class="CResizablePaper" x="21"/>
			<script>
				function setPhotoCaption(atxt)
				{
					this.text.value = atxt;
					this.text.visible = true;
				}
			</script>
		</composition>

		<script>
			function addPhoto(fileName, txt, akeepSize)
			{<![CDATA[
				var keepSize = false;
				if( typeof(akeepSize) != "undefined")
					keepSize = akeepSize;
				if (list.nextId < 100)
				{
					var img = new Image();
					item.photo.src=":"+fileName;
					if( keepSize == false)
					{
						item.photo.width=item.w;
						item.photo.height=item.h;
					}
					else
					{
						item.photo.width = item.photo.getMediaSize().width;
						item.photo.height = item.photo.getMediaSize().height;
					}
					item.photo.x = item.id_back.width+1;
					item.photo.y=1;

					if (txt != null && typeof(txt)!='undefined')
					{
						item.text.width=180;//item.photo.width;
						item.text.value=txt;
						item.text.y=item.photo.y + item.photo.height+5;
						item.text.x = item.photo.x;
						item.text.visible = true;
					}
					else
					{
						item.text.visible = false;
					}

					list.addItem(this.list.root,"r" + this.list.nextId, item);
					list.root.children[this.list.nextId-1].content.item.frame_photo.init("rmeq:environment\\photo\\frame_photo.png", 1, 1, 6, 8);
					list.root.children[this.list.nextId-1].content.item.frame_photo.resize(item.photo.width+7, item.photo.height+9);
					list.root.children[this.list.nextId-1].content.item.id.value = "<b>" + list.nextId +".</b>";
					if (list.nextId > 9)
					{
						list.root.children[this.list.nextId-1].content.item.id.x = 1;
					}
					list.showTree();

					list.scrollerV.setClientPos(list.scrollerV.scrollMax);
					list.scrollerV.setSliderPos(1);
				}
			}

			function setNextPhotoSize(w, h)
			{
				if ( w != undefined && w != null)
				{
					this.item.w = w;
				}
				if ( h != undefined && h != null)
				{
					this.item.h = h;
				}
			}

			function loadPhotos(src, id)
			{
				var i=id;
				source = src + "image" + i + ".png";
				while (resourceExists(source))
				{
					addPhoto(source);
					i++;
					source = src + "image" + i + ".png";
				}
			}
			]]>
		</script>
		<script>
			this.imFrame.resize(224, 600);
		</script>
	</composition>
</rmml>