<?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="begunok.xml"/>
	<!-- border for molconst-->
      	<composition name="CMolBorder">
			<composition name="imFrame" class="CResizablePaper">
				<script>
					this.init("rmgr:frames/bckgr_mol.png", 2, 2, 2, 2);
				</script>
		</composition>
	</composition>

	<composition name="CMolViewer" userEvents="onChange, onPlaySound,onPlayAnim">
		<composition name="imFrame" class="CResizablePaper">
			<image _name="lt" src="rmgr:frames/bckgr_mol.png">
				<script>this.crop(0,0,2,2);</script>
			</image>
			<image _name="ct" src="rmgr:frames/bckgr_mol.png">
				<script>this.crop(2,0,1,2);</script>
			</image>
			<image _name="rt" src="rmgr:frames/bckgr_mol.png">
				<script>this.crop(3,0,2,2);</script>
			</image>
			<image _name="lc" src="rmgr:frames/bckgr_mol.png">
				<script>this.crop(0,2,2,1);</script>
			</image>
			<image _name="cc" src="rmgr:frames/bckgr_mol.png">
				<script>this.crop(2,2,1,1);</script>
			</image>
			<image _name="rc" src="rmgr:frames/bckgr_mol.png">
				<script>this.crop(3,2,2,1);</script>
			</image>
			<image _name="lb" src="rmgr:frames/bckgr_mol.png">
				<script>this.crop(0,3,2,2);</script>
			</image>
			<image _name="cb" src="rmgr:frames/bckgr_mol.png">
				<script>this.crop(2,3,1,2);</script>
			</image>
			<image _name="rb" src="rmgr:frames/bckgr_mol.png">
				<script>this.crop(3,3,2,2);</script>
			</image>
		</composition>
		<composition name="begunok" class="CBegunok"/>
		<image name="nextBtn" src="rmgr:frames/playbtn.png" depth="-100" visible="false">
			<script event="onPress"><![CDATA[
				this.src="rmgr:frames/nextbtn.png";
				parent.prevBtn.src="rmgr:frames/prevbtn.png";
				if (parent.currentAnim.playing != undefined && parent.currentAnim.currentFrame==0)
				{
						parent.currentAnim.play();
						fireEvent("parent.onPlayAnim");
					if (parent.curAnim<parent.animCount && parent.curAnim>1)
						parent.showButtons(true,true);
					else if (parent.curAnim>1 || parent.animCount==1)
						parent.showButtons(true,false);
					else if (parent.curAnim<parent.animCount)
						parent.showButtons(true,true);
					if (eval("parent.text"+parent.curAnim) != undefined)
					{
						eval("parent.text"+parent.curAnim+".show();");
					}
				}
				else if (parent.currentAnim.playing == undefined ||  parent.currentAnim.currentFrame > 0)
				{
					if (parent.curAnim<parent.animCount)
						parent.curAnim++;
					parent.changeAnim(parent.curAnim);
					fireEvent("parent.onPlaySound");
					if (parent.currentAnim.playing != undefined)
					{
						parent.currentAnim.play();
						fireEvent("parent.onPlayAnim");
					}
				}
			]]></script>
		</image>
		<image name="prevBtn" src="rmgr:frames/prevbtn.png" depth="-100" visible="false">
			<script event="onPress"><![CDATA[
				this.src="rmgr:frames/rewbtn.png";
				parent.nextBtn.src="rmgr:frames/playbtn.png";
				if (parent.currentAnim.playing != undefined && parent.currentAnim.currentFrame!=0)
				{
					parent.begunok.setStep(parent.curAnim-1);
					parent.currentAnim.rewind();
					fireEvent("parent.onPlaySound");
					if (parent.curAnim<parent.animCount && parent.curAnim>1)
						parent.showButtons(true,true);
					else if (parent.curAnim>1)
						parent.showButtons(true,true);
					else if (parent.curAnim<parent.animCount || parent.animCount==1)
						parent.showButtons(false,true);
				}
				else if (parent.curAnim>1)
				{
					parent.curAnim = 1;
					parent.changeAnim(parent.curAnim);
					fireEvent("parent.onPlaySound");
				}
			]]></script>
		</image>
		<script><![CDATA[
			this.curAnim = 1;
			this.animCount = 0;
			this.textCount = 0;
			this.resizable = true;
			this.useBckgr = true;
			function init(x,y,height,width,usebckgr)
			{
				for (var ii=1; eval("this.anim"+ii)!=undefined; ii++)
				{
					eval("this.anim"+ii+".hide();");
					var an = eval("this.anim"+ii);
					if (an.playing != undefined)
					{
						trace(ii+"-------------animation");
						an.onPlayed = function()
						{
							this.parent.begunok.setStep(this.parent.curAnim);
						}
					}
					this.animCount++;
				}
				if (this.animCount <= 1)
				{
					this.begunok.hide();
				}
				this.begunok.setStepsCount(this.animCount);
				for (var ii=1; eval("this.text"+ii)!=undefined; ii++)
				{
					eval("this.text"+ii+".hide();");
					this.textCount++;
				}
				if (y != null)
					this.y = y;
				if (x != null && height != null && width != null)
				{
					this.x = x;
					this.resizable = false;
					this.imFrame.resize(width,height);
					this.imFrame.x = 0;
					this.imFrame.y = 0;
					this.btnx = width;
					this.btny = height;
				}
				if (usebckgr != undefined && !usebckgr)
				{
					this.imFrame.parent = null;
					this.useBckgr = false;
				}
				this.changeAnim(1);
			}

			function dinamicResize()
			{
				if (this.useBckgr)
				{
					this.imFrame.resize(this.currentAnim.getMediaSize().width,this.currentAnim.getMediaSize().height);
					this.btnx = this.currentAnim.getMediaSize().width;
					this.btny = this.currentAnim.getMediaSize().height;
					this.x = Math.round((parent.width-this.currentAnim.getMediaSize().width)/2);
				}
			}

			function changeAnim(id)
			{
				if (eval("this.anim"+id) != undefined)
				{
					for (var jj=1; jj<=this.textCount; jj++)
					{
						eval("this.text"+jj+".hide();");
					}
					if (eval("this.text"+id) != undefined)
					{
						eval("this.text"+id+".show();");
					}
					if (this.currentAnim != undefined)
						this.currentAnim.hide();
					this.currentAnim = eval("this.anim"+id);
					if (this.currentAnim.playing != undefined)					
					{
						this.currentAnim.rewind();
						this.begunok.setStep(id-1);
					}
					else
					{
						this.prevBtn.src="rmgr:frames/rewbtn.png";
						this.nextBtn.src="rmgr:frames/nextbtn.png";
						this.begunok.setStep(id);
					}
					trace("this.currentAnim   "+this.currentAnim.name);
					if (this.resizable)
						this.dinamicResize();
					else if (this.useBckgr)
					{
						this.currentAnim.x = Math.round((this.btnx-this.currentAnim.getMediaSize().width)/2);
						this.currentAnim.y = Math.round((this.btny-this.currentAnim.getMediaSize().height)/2);
					}
					if (this.curAnim<this.animCount && this.curAnim>1)
						showButtons(true,true);
					else if (this.curAnim>1)
						showButtons(true,false);
					else if (this.curAnim<=this.animCount)
					{
						if ((this.curAnim==this.animCount && this.currentAnim.playing != undefined) || this.curAnim<this.animCount)
							showButtons(false,true);
					}
					this.currentAnim.show();
					fireEvent("onChange");
				}
			}
			function showButtons(last,next)
			{
				this.begunok.y = this.btny - 16;
				this.begunok.x = this.btnx - this.begunok.width - 8;
				var x1 = this.btnx-49;
				if (this.animCount > 1)
					var y = this.btny-50;
				else
					var y = this.btny-37;
				var x2 = this.btnx;
				if (next)
				{
					this.nextBtn.x = x1;
					this.nextBtn.y = y;
					this.nextBtn.show();
				}
				else
				{
					this.nextBtn.x = x2;
					this.nextBtn.y = y;
					this.nextBtn.hide();
				}
				if (last)
				{
					this.prevBtn.x = this.nextBtn.x - 49;
					this.prevBtn.y = y;
					this.prevBtn.show();
				}
				else
				{
					this.prevBtn.hide();
				}
			}
		]]></script>
	</composition>
	
	
	
	
	<composition name="CAnimViewer" userEvents="onChange">
		<composition name="playBtn" class="CMoviePlayBtn">
			<image name="dis" src="rmgr:frames/little_play_dis.png" depth="-120"/>
			<script>
				function enable()
				{
					this.enabled = true;
					this.dis.hide();
				}
				
				function disable()
				{
					this.enabled = false;
					this.dis.show();
				}
			</script>
		</composition>
    <script><![CDATA[
    	this.framesCount = 0;
    	this.currentFrame = 0;
    	function hideAll()
    	{
    		for (var ii = 1; eval("this.anim" + ii) != undefined; ii++)
    		{
    			eval("this.anim"+ii+".hide();");
    			if (eval("this.text"+ii) != undefined)
    				eval("this.text"+ii+".hide();");
    		}
    		this.playBtn.disable();
    	}

    	function changeAnim(id)
    	{
    		if (eval("this.anim" + id) != undefined)
    		{
    			this.hideAll();		    			
    			this.currentFrame = id;
    			eval("this.anim"+id+".show();");
    			if (eval("this.text"+id) != undefined)
    				eval("this.text"+id+".show();");
	    		this.begunok.setFrame(id);
    			if (eval("this.anim"+id+".playing") != undefined)
    			{
    				eval("this.anim"+id+".rewind();");
    				this.playBtn.init(eval("this.anim"+id),eval("this.Sound"+id));
    				this.playBtn.enable();
    			}		    			
    			else
    			{
    				if (eval("this.Sound"+id) != undefined)
    				eval("this.Sound"+id+".play();");
    			}
    			fireEvent("onChange");
    		}
    	}
    	
    	function init(width,height)
    	{
    		for (var ii = 1; eval("this.anim"+ii) != undefined; ii++)
    		{
    			this.framesCount = ii;
    			
    		}
    		this.playBtn.x = width - 5 - this.playBtn.width;
    		this.begunok.y = height - 5 - this.begunok.height;
    		if (this.framesCount > 1)
    		{
    			this.begunok.init(this.framesCount);
    			this.playBtn.y = height - 10 - this.begunok.height - this.playBtn.height;
    			this.begunok.x = width - 6 - 12-(this.framesCount-1)*36;
    		}
    		else
    		{
    			this.begunok.hide();
    			this.playBtn.y = hieght - 5 - this.playBtn.height;
    		}
    		this.changeAnim(1);
    		if (this.Sound1 != undefined)
    			this.Sound1.stop();
    	}
    ]]></script>

    <composition name="begunok" depth="-10">
      <image name="bckgr" src="rmgr:begunok/begun.png"/>
      <image name="active" src="rmgr:begunok/begun.png"/>
      <script><![CDATA[
      	function init(frames)
      	{
      		if (frames > 1)
      		{
      			this.bckgr.crop(0,0,12+(frames-1)*36,13);
      			for (var ii = 1; ii <= frames; ii++)
      			{
      				var btn = new Button;
      				btn.name = "slide"+ii;
      				btn.parent = this;
      				btn.depth = -100;
      				btn.x = (ii-1)*36;
      				btn.width = 12;
      				btn.height = 13;
      				btn.id = ii;
      				btn.onPress = function()
      				{
      					if (this.parent.parent.Sound1 != undefined && eval("this.parent.parent.Sound"+this.id) != undefined)
      					{
      						trace("!!!!");
      						fireEvent("scene.allSoundsStop");
      					}
      					this.parent.parent.changeAnim(this.id);      					
      				}
      			}
      		}
      	}

      	function setFrame(id)
      	{
      		this.active.x = (id-1)*36;
      		this.active.crop((id-1)*36,13,12,13);
      	}
      ]]></script>
    </composition>
	</composition>
	
	
	
	<styles name="LepRomTextStyle" fontSize="14" fontFamily="Verdana" color="#000000"/>
	<composition name="CCloudBase" depth="-10">
		<composition name="ActiveCloud" visible="false" depth="10">
			<composition name="imFrame" class="CResizablePaper">
				<image _name="lt" src="rmgr:frames/cloud/cloud_100.png">
					<script>this.crop(0,0,14,14);</script>
				</image>
				<image _name="ct" src="rmgr:frames/cloud/cloud_100.png">
					<script>this.crop(14,0,1,14);</script>
				</image>
				<image _name="rt" src="rmgr:frames/cloud/cloud_100.png">
					<script>this.crop(15,0,12,14);</script>
				</image>
				<image _name="lc" src="rmgr:frames/cloud/cloud_100.png">
					<script>this.crop(0,14,14,1);</script>
				</image>
				<image _name="cc" src="rmgr:frames/cloud/cloud_100.png">
					<script>this.crop(14,14,1,1);</script>
				</image>
				<image _name="rc" src="rmgr:frames/cloud/cloud_100.png">
					<script>this.crop(15,14,12,1);</script>
				</image>
				<image _name="lb" src="rmgr:frames/cloud/cloud_100.png">
					<script>this.crop(0,15,14,12);</script>
				</image>
				<image _name="cb" src="rmgr:frames/cloud/cloud_100.png">
					<script>this.crop(14,15,1,12);</script>
				</image>
				<image _name="rb" src="rmgr:frames/cloud/cloud_100.png">
					<script>this.crop(15,15,12,12);</script>
				</image>
			</composition>
			<image name="arrow" depth="-1"/>
		</composition>
		<composition name="InactiveCloud" visible="true" depth="10">
			<composition name="imFrame" class="CResizablePaper">
				<image _name="lt" src="rmgr:frames/cloud/cloud_60.png">
					<script>this.crop(0,0,14,14);</script>
				</image>
				<image _name="ct" src="rmgr:frames/cloud/cloud_60.png">
					<script>this.crop(14,0,1,14);</script>
				</image>
				<image _name="rt" src="rmgr:frames/cloud/cloud_60.png">
					<script>this.crop(15,0,12,14);</script>
				</image>
				<image _name="lc" src="rmgr:frames/cloud/cloud_60.png">
					<script>this.crop(0,14,14,1);</script>
				</image>
				<image _name="cc" src="rmgr:frames/cloud/cloud_60.png">
					<script>this.crop(14,14,1,1);</script>
				</image>
				<image _name="rc" src="rmgr:frames/cloud/cloud_60.png">
					<script>this.crop(15,14,12,1);</script>
				</image>
				<image _name="lb" src="rmgr:frames/cloud/cloud_60.png">
					<script>this.crop(0,15,14,12);</script>
				</image>
				<image _name="cb" src="rmgr:frames/cloud/cloud_60.png">
					<script>this.crop(14,15,1,12);</script>
				</image>
				<image _name="rb" src="rmgr:frames/cloud/cloud_60.png">
					<script>this.crop(15,15,12,12);</script>
				</image>
			</composition>
			<image name="arrow" depth="-1"/>
		</composition>
		<text name="InnerText" style="LepRomTextStyle" depth="-10" x="10" y="5" />
		<sequencer name="PlayingWatch" playing="false" loop="true">
			<script><![CDATA[
				if (this.movietype == "activeX")
				{
					if (this.movie.get("playing"))
					{
						this.show();
						this.focus();
					}
					else
					{
						this.unfocus();
					}
				}
				else if (this.movietype = "movie")
				{
					if (this.movie.playing)
					{
						this.show();
						this.focus();
					}
					else
					{
						this.unfocus();
					}
				}
			]]></script>
		</sequencer>
		<script><![CDATA[
			this.movietype = null;
			this.movie = null;
			function focus()
			{
				this.ActiveCloud.show();
				this.InactiveCloud.hide();
			}
			function unfocus()
			{
				this.ActiveCloud.hide();
				this.InactiveCloud.show();
			}
			function init(movie,movietype)
			{
				this.ActiveCloud.imFrame.resize(this.InnerText.width+10, this.InnerText.height);
				this.InactiveCloud.imFrame.resize(this.InnerText.width+10, this.InnerText.height);
				if (movie != undefined && movietype != undefined)
				{
					this.movie = movie;
					this.movietype = movietype;
					this.PlayingWatch.play();
				}
				this.customInit();
			}
			function customInit()
			{
			}
		]]></script>
	</composition>
	<composition name="TLLittleCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_bottom_right_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_bottom_right_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width - 50;
				this.ActiveCloud.arrow.y = this.InnerText.height - 6;
				this.InactiveCloud.arrow.x = this.InnerText.width - 50;
				this.InactiveCloud.arrow.y = this.InnerText.height - 6;
			}
		</script>
	</composition>
	<composition name="TLMediumCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_bottom_right_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_bottom_right_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width - 50;
				this.ActiveCloud.arrow.y = this.InnerText.height - 6;
				this.InactiveCloud.arrow.x = this.InnerText.width - 50;
				this.InactiveCloud.arrow.y = this.InnerText.height - 6;
			}
		</script>
	</composition>
	<composition name="TLLargeCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_bottom_right_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_bottom_right_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width - 50;
				this.ActiveCloud.arrow.y = this.InnerText.height - 6;
				this.InactiveCloud.arrow.x = this.InnerText.width - 50;
				this.InactiveCloud.arrow.y = this.InnerText.height - 6;
			}
		</script>
	</composition>
	<composition name="TRLittleCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_bottom_left_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_bottom_left_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 50;
				this.ActiveCloud.arrow.y = this.InnerText.height - 6;
				this.InactiveCloud.arrow.x = 50;
				this.InactiveCloud.arrow.y = this.InnerText.height - 6;
			}
		</script>
	</composition>
	<composition name="TRMediumCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_bottom_left_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_bottom_left_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 50;
				this.ActiveCloud.arrow.y = this.InnerText.height - 6;
				this.InactiveCloud.arrow.x = 50;
				this.InactiveCloud.arrow.y = this.InnerText.height - 6;
			}
		</script>
	</composition>
	<composition name="TRLargeCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_bottom_left_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_bottom_left_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 50;
				this.ActiveCloud.arrow.y = this.InnerText.height - 6;
				this.InactiveCloud.arrow.x = 50;
				this.InactiveCloud.arrow.y = this.InnerText.height - 6;
			}
		</script>
	</composition>
	<composition name="BLLittleCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_top_right_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_top_right_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width-50;
				this.ActiveCloud.arrow.y = 1-this.ActiveCloud.arrow.getMediaSize().height;
				this.InactiveCloud.arrow.x = this.InnerText.width-50;
				this.InactiveCloud.arrow.y = 1-this.InactiveCloud.arrow.getMediaSize().height;
			}
		</script>
	</composition>
	<composition name="BLMediumCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_top_right_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_top_right_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width-50;
				this.ActiveCloud.arrow.y = 1-this.ActiveCloud.arrow.getMediaSize().height;
				this.InactiveCloud.arrow.x = this.InnerText.width-50;
				this.InactiveCloud.arrow.y = 1-this.InactiveCloud.arrow.getMediaSize().height;
			}
		</script>
	</composition>
	<composition name="BLLargeCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_top_right_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_top_right_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width-50;
				this.ActiveCloud.arrow.y = 1-this.ActiveCloud.arrow.getMediaSize().height;
				this.InactiveCloud.arrow.x = this.InnerText.width-50;
				this.InactiveCloud.arrow.y = 1-this.InactiveCloud.arrow.getMediaSize().height;
			}
		</script>
	</composition>
	<composition name="BRLittleCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_top_left_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_top_left_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 50;
				this.ActiveCloud.arrow.y = 1-this.ActiveCloud.arrow.getMediaSize().height;
				this.InactiveCloud.arrow.x = 50;
				this.InactiveCloud.arrow.y = 1-this.InactiveCloud.arrow.getMediaSize().height;
			}
		</script>
	</composition>
	<composition name="BRMediumCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_top_left_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_top_left_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 50;
				this.ActiveCloud.arrow.y = 1-this.ActiveCloud.arrow.getMediaSize().height;
				this.InactiveCloud.arrow.x = 50;
				this.InactiveCloud.arrow.y = 1-this.InactiveCloud.arrow.getMediaSize().height;
			}
		</script>
	</composition>
	<composition name="BRLargeCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_top_left_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_top_left_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 50;
				this.ActiveCloud.arrow.y = 1-this.ActiveCloud.arrow.getMediaSize().height;
				this.InactiveCloud.arrow.x = 50;
				this.InactiveCloud.arrow.y = 1-this.InactiveCloud.arrow.getMediaSize().height;
			}
		</script>
	</composition>
	<composition name="LBLittleCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_right_top_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_right_top_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.ActiveCloud.arrow.y = 15;
				this.InactiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.InactiveCloud.arrow.y = 15;
			}
		</script>
	</composition>
	<composition name="LBMediumCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_right_top_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_right_top_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.ActiveCloud.arrow.y = 15;
				this.InactiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.InactiveCloud.arrow.y = 15;
			}
		</script>
	</composition>
	<composition name="LBLargeCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_right_top_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_right_top_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.ActiveCloud.arrow.y = 15;
				this.InactiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.InactiveCloud.arrow.y = 15;
			}
		</script>
	</composition>
	<composition name="LTLittleCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_right_bottom_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_right_bottom_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.ActiveCloud.arrow.y = this.InnerText.height - 30;
				this.InactiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.InactiveCloud.arrow.y = this.InnerText.height - 30;
			}
		</script>
	</composition>
	<composition name="LTMediumCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_right_bottom_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_right_bottom_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.ActiveCloud.arrow.y = this.InnerText.height - 30;
				this.InactiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.InactiveCloud.arrow.y = this.InnerText.height - 30;
			}
		</script>
	</composition>
	<composition name="LTLargeCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_right_bottom_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_right_bottom_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.ActiveCloud.arrow.y = this.InnerText.height - 30;
				this.InactiveCloud.arrow.x = this.InnerText.width + 4 ;
				this.InactiveCloud.arrow.y = this.InnerText.height - 30;
			}
		</script>
	</composition>
	<composition name="RBLittleCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_left_top_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_left_top_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 1-this.ActiveCloud.arrow.getMediaSize().width;
				this.ActiveCloud.arrow.y = 15;
				this.InactiveCloud.arrow.x = 1-this.InactiveCloud.arrow.getMediaSize().width;
				this.InactiveCloud.arrow.y = 15;
			}
		</script>
	</composition>
	<composition name="RBMediumCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_left_top_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_left_top_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 1-this.ActiveCloud.arrow.getMediaSize().width;
				this.ActiveCloud.arrow.y = 15;
				this.InactiveCloud.arrow.x = 1-this.InactiveCloud.arrow.getMediaSize().width;
				this.InactiveCloud.arrow.y = 15;
			}
		</script>
	</composition>
	<composition name="RBLargeCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_left_top_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_left_top_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 1-this.ActiveCloud.arrow.getMediaSize().width;
				this.ActiveCloud.arrow.y = 15;
				this.InactiveCloud.arrow.x = 1-this.InactiveCloud.arrow.getMediaSize().width;
				this.InactiveCloud.arrow.y = 15;
			}
		</script>
	</composition>
	<composition name="RTLittleCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_left_bottom_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_little_left_bottom_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 1-this.ActiveCloud.arrow.getMediaSize().width;
				this.ActiveCloud.arrow.y = this.InnerText.height - 30;
				this.InactiveCloud.arrow.x = 1-this.InactiveCloud.arrow.getMediaSize().width;
				this.InactiveCloud.arrow.y = this.InnerText.height - 30;
			}
		</script>
	</composition>
	<composition name="RTMediumCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_left_bottom_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_medium_left_bottom_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 1-this.ActiveCloud.arrow.getMediaSize().width;
				this.ActiveCloud.arrow.y = this.InnerText.height - 30;
				this.InactiveCloud.arrow.x = 1-this.InactiveCloud.arrow.getMediaSize().width;
				this.InactiveCloud.arrow.y = this.InnerText.height - 30;
			}
		</script>
	</composition>
	<composition name="RTLargeCloud" class="CCloudBase">
		<composition name="ActiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_left_bottom_100.png"/>
		</composition>
		<composition name="InactiveCloud">
			<image name="arrow" src="rmgr:frames/cloud/us_large_left_bottom_60.png"/>
		</composition>
		<script>
			function customInit()
			{
				this.ActiveCloud.arrow.x = 1-this.ActiveCloud.arrow.getMediaSize().width;
				this.ActiveCloud.arrow.y = this.InnerText.height - 30;
				this.InactiveCloud.arrow.x = 1-this.InactiveCloud.arrow.getMediaSize().width;
				this.InactiveCloud.arrow.y = this.InnerText.height - 30;
			}
		</script>
	</composition>
	<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_txtGRPadding = 0;//отступ -ch2- от текста "гомологическая разница"
			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.txtGR.y - this.gr_ch2.height - this.ch2_txtGRPadding;
					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>
</rmml>
