<?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"/>
	<styles name="styleZag" fontFamily="Times New Roman" fontSize="28" color="#975424" fontWeight="bold"/>
	<styles name="styleGR" fontFamily="Times New Roman" fontSize="19" color="#975424"/>
	<styles name="style3DTitle" fontFamily="Times New Roman" fontSize="24" color="#975424" />
	<composition name="homologousSet">
		<composition name="mainRamka" class="CResizablePaper">
			<image _name="lt" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="ct" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="rt" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="lc" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="cc" src="rmgr:g_set/ramka.png">
				<script>this.crop(1,0,1,1);</script>
			</image>
			<image _name="rc" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="lb" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="cb" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="rb" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
		</composition>
		<composition name="titleRamka" class="CResizablePaper">
			<image _name="lt" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="ct" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="rt" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="lc" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="cc" src="rmgr:g_set/ramka.png">
				<script>this.crop(1,0,1,1);</script>
			</image>
			<image _name="rc" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="lb" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="cb" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
			<image _name="rb" src="rmgr:g_set/ramka.png">
				<script>this.crop(0,0,1,1);</script>
			</image>
		</composition>
		<image name="gr_ch2" src="rmgr:g_set/ch2.png"/>
		<composition name="btnPrev" class="ui_CSkinedButton" x="100" y="100">
			<image name="imSkin" src="rmgr:g_set/btnPrev.png"/>
			<script>
				this.init( 4, true);
			</script>
			<script event="onRelease">
				parent.animPlay("prev");
			</script>
		</composition>
		<composition name="btnNext" class="ui_CSkinedButton" x="100" y="150">
			<image name="imSkin" src="rmgr:g_set/btnNext.png"/>
			<script>
				this.init( 4, true);
			</script>
			<script event="onRelease">
				parent.animPlay("next");
			</script>
		</composition>
		<text name="txtGR" style="styleGR" x="425" y="315" visible="true">гомологическая разница</text>
		<text name="txtTitle" style="styleZag" x="385" y="70" visible="true"/>
		<script>
		//ЗАДАВАЕМЫЕ ПАРАМЕТРЫ
			this.sizeMainRamka = new Array(937,274);//размеры рамки, в которой проигрывается анимация
			this.sizeTitleRamka = new Array(300,50);//размеры рамки заголовка
			this.buttonsPadding = 100; // расстояние между кнопками
			this.txtGR_bottomPadding=7;//отступ текста "гомологическая разница" от нижнего края рамки
			this.ch2_y = 185;//-ch2- y
			this.ch2_shift = 0;//смещение -ch2- относитльно центра по оси х
		</script>
		<script><![CDATA[
			this.nAnims = new Array();
			this.arrTitles = new Array();
			this.curAnim = null;
			this.curAnimNum = 0;
			this.isAnimPlay = false;
			this.pAnims = new Array();
			]]></script>
		<script><![CDATA[
			function init (titleArr,prevArr,nextArr,x_center,y_pos)//массив названий,массив prev-анимаций, массив next-анимаций, центровка по x, положение по y
				{
					this.mainRamka.resize(sizeMainRamka[0],sizeMainRamka[1]);
					this.titleRamka.resize(sizeTitleRamka[0],sizeTitleRamka[1]);
					this.titleRamka.x = Math.round((this.mainRamka.width - this.titleRamka.width)/2);
					this.mainRamka.y = Math.round(this.titleRamka.height/2);
					this.btnPrev.y = this.mainRamka.y + this.mainRamka.height - Math.round(this.btnPrev.height/2);
					this.btnNext.y =this.btnPrev.y;
					this.btnPrev.x = Math.round((this.mainRamka.width - this.buttonsPadding) /2) - this.btnPrev.width ;
					this.btnNext.x = Math.round((this.mainRamka.width+ this.buttonsPadding)/2) ;
					this.txtGR.x = Math.round((this.mainRamka.width - this.txtGR.getMediaSize().width)/2);
					this.txtGR.y = this.btnNext.y - this.txtGR.getMediaSize().height - this.txtGR_bottomPadding;
					this.gr_ch2.y = this.ch2_y;
					this.gr_ch2.x = Math.round((this.mainRamka.width - this.gr_ch2.width)/2)+this.ch2_shift;
					this.arrTitles = titleArr;
					for (var i=0; i<prevArr.length;i++)
					{
						if (x_center!=undefined&&x_center)
							{
								prevArr[i].x = Math.round((this.mainRamka.width - prevArr[i].width)/2);
								nextArr[i].x = Math.round((this.mainRamka.width - nextArr[i].width)/2);
							}
						if (y_pos!=undefined)
							{
								prevArr[i].y = y_pos;
								nextArr[i].y = y_pos;
							}
						prevArr[i].onPlayed = function()
						{
							this.parent.animPlayed();
						}
						nextArr[i].onPlayed = function()
						{
							this.parent.animPlayed();
						}
						this.pAnims = prevArr;
						this.nAnims = nextArr;
					}
					allAnimsHide();
					this.txtTitle.value = arrTitles[this.curAnimNum];
					this.txtTitle.x = Math.round((this.mainRamka.width - this.txtTitle.getMediaSize().width)/2);
					this.txtTitle.y = Math.round((this.titleRamka.height - this.txtTitle.getMediaSize().height)/2);
					this.btnPrev.enabled =false;
					this.curAnim = this.nAnims[this.curAnimNum];
					this.curAnim.rewind();
					this.curAnim.show();
				}

			function animPlay(navigPar)
				{
					if (!this.isAnimPlay)
						{
							allAnimsHide();
							this.isAnimPlay=true;
							if (navigPar=="next")
								{
									this.curAnim = this.nAnims[this.curAnimNum];
									this.curAnimNum++;
									if (this.curAnimNum==this.nAnims.length)
										{
											this.gr_ch2.hide();
											btnNext.enabled =false;
										}

									this.curAnim.rewindAndPlay();
								}
							else
								{
									this.curAnimNum--;
									this.curAnim = this.pAnims[this.curAnimNum];
									if (this.curAnimNum==0)
										btnPrev.enabled =false;
									this.curAnim.rewindAndPlay();
									this.txtTitle.value = arrTitles[this.curAnimNum];
									this.txtTitle.x = Math.round((this.mainRamka.width - this.txtTitle.getMediaSize().width)/2);
								}
						}
				}
			function animPlayed()
				{
					allAnimsHide();
					this.txtTitle.value = arrTitles[this.curAnimNum];
					 if (this.curAnimNum==this.nAnims.length)
						{
							this.txtTitle.value = arrTitles[this.curAnimNum];
							 this.pAnims[this.curAnimNum-1].rewind();
							 this.pAnims[this.curAnimNum-1].show();
						}
					else
						{
							 this.nAnims[this.curAnimNum].rewind();
							 this.nAnims[this.curAnimNum].show();
							 if  (this.curAnimNum==1) 		btnPrev.enabled =true;
							 if  (this.curAnimNum==(this.nAnims.length-1)) 		{ btnNext.enabled =true; this.gr_ch2.show();}
						}
					this.txtTitle.x = Math.round((this.mainRamka.width - this.txtTitle.getMediaSize().width)/2);
					this.isAnimPlay=false;
				}
			function allAnimsHide()
				{
					for (var i=0; i<this.nAnims.length;i++)
						this.nAnims[i].hide();
					for (var i=0; i<this.pAnims.length;i++)
						this.pAnims[i].hide();
				}
			]]></script>
	</composition>
	<composition name="homologousSet3D" class="homologousSet">
		<composition name="titleRamka" visible="false"/>
		<image name="gr_ch2" visible="false"/>
		<image name="imgFomula"/>
		<text name="txtGR" visible="false"/>
		<text name="txtTitle" style="style3DTitle" x="385" y="70" visible="true"/>
		<script>
		//ЗАДАВАЕМЫЕ ПАРАМЕТРЫ
			this.txtTitle_bottomPadding=40;//отступ текста "гомологическая разница" от нижнего края рамки
			this.formula_bottomPadding=80;//отступ текста "гомологическая разница" от нижнего края рамки
			this.buttonsPadding = 240; // расстояние между кнопками
		</script>
		<script><![CDATA[
			this.models3D = new Array();
			this.arrTitles = new Array();
			this.imgSrc = new Array();
			this.curAnimNum = 0;
			]]></script>
		<script><![CDATA[
			function init (titleArr,models3D,imgSrc,x_center,y_pos)//массив названий,массив prev-анимаций, массив next-анимаций, центровка по x, положение по y
				{
					this.mainRamka.resize(sizeMainRamka[0],sizeMainRamka[1]);
					this.mainRamka.y = 0;
					this.btnPrev.y = this.mainRamka.height - Math.round(this.btnPrev.height/2);
					this.btnNext.y =this.btnPrev.y;
					this.btnPrev.x = Math.round((this.mainRamka.width - this.buttonsPadding) /2) - this.btnPrev.width ;
					this.btnNext.x = Math.round((this.mainRamka.width+ this.buttonsPadding)/2) ;
					this.arrTitles = titleArr;
					this.models3D = models3D;
					this.imgSrc = imgSrc;
					this.txtTitle.value = arrTitles[this.curAnimNum];
					this.txtTitle.x = Math.round((this.mainRamka.width - this.txtTitle.getMediaSize().width)/2);
					this.txtTitle.y =  this.mainRamka.height - this.txtTitle_bottomPadding ;
					this.btnPrev.enabled =false;
					this.imgFomula.src = this.imgSrc[this.curAnimNum];
					this.imgFomula.x = Math.round((this.mainRamka.width - this.imgFomula.width)/2);
					this.imgFomula.y = this.mainRamka.height - this.formula_bottomPadding ;
					scene.Initialize(this.models3D[this.curAnimNum]);
				}

			function animPlay(navigPar)
				{
					if (navigPar=="next")
						{
							this.curAnimNum++;
							if (this.curAnimNum == this.arrTitles.length-1)
									btnNext.enabled =false;
							btnPrev.enabled = true;
						}
					else
						{
							this.curAnimNum--;
							if (this.curAnimNum==0)
								btnPrev.enabled =false;
							btnNext.enabled = true;
						}
					scene.Initialize(this.models3D[this.curAnimNum]);
				//	scene.rendllmes("drawnames","");
				//	scene.setScenePos(200,50,350, 200);
					this.imgFomula.src = this.imgSrc[this.curAnimNum];
					this.imgFomula.x = Math.round((this.mainRamka.width - this.imgFomula.width)/2);
					this.txtTitle.value = arrTitles[this.curAnimNum];
					this.txtTitle.x = Math.round((this.mainRamka.width - this.txtTitle.getMediaSize().width)/2);
				}
			]]></script>
	</composition>
</rmml>
