<?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">
<!--
Base chemical equipment
-->
	<group _name="ceBaseEquip">
		<script>
                this.usedPositions = null;      // используемые позиции объекта. По данному массиву создаются объекты motion
                this.resPath = "rmeq:Bulb\\";
                this.dispos = 0;
                this.onsetfunction = null;      // function, called on setMotion action completing
                this.setmotion = null;          // motion to set
                this.settime = 0;               // motion to set
                this.ondonefunction = null;     // function, called on doMotion action completing
                this.domotion = null;           // motion to do
				this.replaceMTN = false;		// we need to replace motions
        </script>
		<object _name="obj">
			<script>
				this.hint="";
			</script>
			<script event="onPress">
                        if(parent.objOnPress != undefined)
                                parent.objOnPress();
                </script>
			<script event="onRelease">
                        if(parent.objOnRelease != undefined)
                                parent.objOnRelease();
                </script>
			<script event="onReleaseOutside">
                        if(parent.objOnReleaseOutside != undefined)
                                parent.objOnReleaseOutside();
                </script>
		</object>
		<!-- Object functions -->
		<script><![CDATA[
				function SetColor(_r,_g,_b,_a,_aback)
				{
					if (typeof(_r)!="undefined")
						this.obj.r=_r;                                     // r
					this.obj.g=_g;                                     // g
					this.obj.b=_b;                                     // b
					this.obj.a=_a;                  					// a
					this.obj.aback=_aback;
				}

				function CopyColor(setObject)
				{
					this.obj.r=setObject.obj.r;                                     // r
					this.obj.g=setObject.obj.g;                                     // g
					this.obj.b=setObject.obj.b;                                     // b
					this.obj.a=setObject.obj.a;                  					// a
					this.obj.aback=setObject.obj.aback;
				}

                function setMap(s,id)
                {
                        if ((isNum(id) != true)||(isNum(s) !== true))
                        {
                                trace("ERROR: setMap args must be integers");
                                return;
                        }
                        id = "__" + id;
                        if (s<10) s = "0" + s;
                        if( eval("scene.imap"+s) == undefined)
                        {
                                trace("ERROR: scene.imap" + s + " is not defined");
                                return;
                        }
                        mapObj = eval("this.obj.materials." + id);
                        mapObj.maps.diffuse.source = eval("scene.imap"+s);
                }

                function setKeyPos(mtn, keyframe, obj)
                {
                        mtn.tracks[-1].frames[keyframe]._pos = obj.obj._pos;
                }
                function shiftKeyPos(mtn, keyframe, x, y, z)
                {
                        if(x!=undefined && x!=0)
                        {
                                mtn.tracks[-1].frames[keyframe]._pos.x += x;
                        }
                        if(y!=undefined && y!=0)
                        {
                                mtn.tracks[-1].frames[keyframe]._pos.y += y;
                        }
                        if(z!=undefined && z!=0)
                        {
                                mtn.tracks[-1].frames[keyframe]._pos.z += z;
                        }
                }

                function isNum(s)
                {
                        if( typeof(s)=="number")        return true;
                        return false;
                }

                function loadMotionByID(pos)
                {
					var     mtn = null;
					if( !isNum(pos) && eval("obj."+pos) != undefined)
					{
						mtn = eval("obj."+pos);
					}
					else    if( eval("obj.mtSet"+pos) == undefined)
					{
						mtn = new Motion();
						mtn._name = "mtSet" + pos;
						mtn.src = this.resPath + "locations\\" + mtn._name+".caf";
						mtn.parent = this.obj;
					}
					else
					{
						mtn = eval("obj.mtSet"+pos);
					}
					return mtn;
                }

                // function moves object to specified position for specified time
                function moveTo(pos, time,onsetfunc)
                {
                        var     mtn = loadMotionByID(pos);
                        if( time == undefined)  time=0;

                        if( mtn != null)
                        {
                                this.onsetfunction = onsetfunc;
                                this.setmotion = mtn;
                                this.settime = time;
                                this.moveSequencer.rewindAndPlay();
                                this.dispos = pos;
                                return mtn.target+".onSet";
                        }
                        else
                        {
                                this.onsetfunction = null;
                                return 100;
                        }
                }
        ]]></script>
		<sequencer _name="moveSequencer">
			<script>
                        if( this.setmotion != null)
                        {
                                this.obj.setMotion(this.setmotion, this.settime);
                                "setmotion.onSet";
                        }
                        else    false;
                </script>
			<script>
                        if(this.onsetfunction != null)
                                this.onsetfunction();
                        true;
                </script>
		</sequencer>
		<!--

        -->
		<script><![CDATA[
                function GetMotionByName(nm)
                {
                        if( eval("obj.mtDo"+nm) == undefined)   return null;
                        return eval("obj.mtDo"+nm);
                }

                // function do object
                function _doMotion(nm, ondonefunc)
                {
                        var     mtn = null;
                        if( eval("obj."+nm) != undefined)
                                mtn=eval("obj."+nm);
                        else    if( eval("obj.mtDo"+nm) == undefined)
                        {
                                mtn = new Motion();
                                mtn._name = "mtDo" + nm;
                                mtn.src = this.resPath + "locations\\" + nm +".caf";
                                mtn.parent = this.obj;
                        }
                        else    mtn=eval("obj.mtDo"+nm);
                        if( mtn != null)
                        {
                                this.ondonefunction = ondonefunc;
                                this.domotion = mtn;
                                this.doSequencer.rewindAndPlay();
                        }
                }

                this.multiMoveArray = new Array();
                this.multiTimeArray = new Array();
                this.multiLength = 0;
                this.multiPos = 0;
                this.mutiOnDone = null;

                function multiMoveTo(ar, art, fn)
                {
                        if( fn!=undefined)
                                this.mutiOnDone = fn;
                        else
                                this.mutiOnDone = null;
						this.multiMoveArray.length=0;
						this.multiTimeArray.length=0;
                        if(ar==undefined || ar==null || ar.length==0)
                        {
                                this.multiLength = 0;
                                this.multiPos = 0;
                                return;
                        };
                        i=0;
                        for(i=0; i<ar.length; i++)
                        {
                                this.multiMoveArray[i] = ar[i];
                                this.multiTimeArray[i] = art[i];
                        }
                        this.multiLength = i;
                        this.multiPos = 0;
                        this.moveTo(this.multiMoveArray[0], this.multiTimeArray[0], this.multiOnSet);
					var mtn = loadMotionByID(this.multiMoveArray[this.multiMoveArray.length-1]);
					if( mtn != null)
						return	 mtn.target+".onSet";
					return true;
                }

                function multiOnSet(obj)
                {
                        this.multiPos++;
                        if(this.multiPos < this.multiLength)
                        {
                                this.moveTo(this.multiMoveArray[this.multiPos], this.multiTimeArray[this.multiPos], this.multiOnSet);
                        }
                        else
                        {
                                if( this.multiLength != 0 && this.mutiOnDone != null)
                                {
                                        //trace("this.mutiOnDone called" + this.mutiOnDone);
                                        this.mutiOnDone();
                                }
                        }
                }

        ]]></script>
		<sequencer _name="doSequencer">
			<script>
                        if( this.domotion != null)
                        {
                                this.obj.doMotion(this.domotion);
                                "domotion.onDone";
                        }
                        else    false;
                </script>
			<script>
                        if(this.ondonefunction != null)
                                this.ondonefunction(this.domotion);
                        true;
                </script>
		</sequencer>
	</group>
	<!--
Chemical glass equipment
-->
	<group _name="ceBaseGlassEquip" _class="ceBaseEquip" userEvents="evLieOverEndPour">
		<script src="eqhelp.mjs"/>
		<script><![CDATA[
                // Pouring variables
                this.pourSource = null;         // source pouring object
                this.pourDest = null;                   // destination pouring object
                this.onFirstDrop = null;
                this.pourMinBound = 10;         // min pouring level of the pourDest object
                this.pourMaxBound = 20; // max pouring level of the pourDest object
                this.pourFirstID = 13;          // first position before pouring
                this.pourStartID = 14;                  // ID of start pouring position for pourSource object
                this.pourEndID = 15;                    // ID of last pouring position for pourSource object
                this.pouring = false;                   // is pouring now?
                this.level_done = null;                 // function called on pourDest object when pouring is finished
                this.onEndPour = null;
                this.firstdrop=false;
                this.playonce = false;
                this.notEnough = null;		// function called when the reagent is not enought
                this.pourRatio = 1;
				this.autoPourTime = 3000;
		// Reactions variables
		this.animDissolve = null;
		this.animSediment = null;
		this.seqDissolve = null;

		function setDefaultLiquidParams()
		{
			obj.r=128;                                     // r
			obj.g=128;                                     // g
			obj.b=128;                                     // b
			obj.a=230;                                     // a
			obj.level=0.0;                                   // уровень жидкости
			obj.tlid="rmeq:effects\\lid.png";       // верхний слой
			obj.v_startsize=3;                             // начальный размер кипения
			obj.v_growps=2;                                // на сколько % увеличивается пузырек за 1 сек.
			obj.v_intensity=0;                             // интенсивность кипения
			obj.v_startlevel=0;                            // начальный уровень кипения
			obj.v_velocity=30.1;                             // скорость поднимания пузырьков
			obj.v_wtoler=80;                               // допуск кипения по ширине
			obj.v_shift=0;                               // сдвиг кипения по ширине
			obj.v_tskin="rmeq:effects\\vial.png";   // карта на пузырек
			obj.v_symmetrical=0;
			obj.map="";                                    // карта на жидкость
			obj.amap=250;                                  // прозрачность на карту жидкости
			obj.substlevel=0;                              // уровень вещества
			obj.st_sublevel=0;                              // уровень вещества
			obj.substmap="";                               // карта вещества
			obj.substanim=null;                            // анимационная карта вещества
			obj.asubst=255;                                // прозрачность на карту вещества
			obj.mapanim=null;
			obj.lidanim=null;
			obj.alid=255;                                  // прозрачность крышки
			obj.alidanim=255;                              // прозрачность анимации на крышке
			obj.mapr=255;
			obj.mapg=255;
			obj.mapb=255;
			obj.start_level = 0;                            // откуда считать уровень (0 - начиная с донышка)
			obj.start_level_map = 0;                       // начальный уровень отображения текстуры жидкости
			obj.end_level_map = 0;
			obj.vial_color_mult = 0.0;
			obj.aback = 0;
			obj.smokeanim=null;
			obj.smokelevel = 100.0;
			obj.asmoke=0;
			obj.drawref=0;
		}

				function addLiquidDrop()
				{
					this.obj.chem3drnd.call("ProcessMessage","adddrop");
				}

                function onBendFunction(mtn)
                {
					this.pouring = true;
                    obj.pouring = true;
                    this.firstdrop = true;
					if( scene.autoPouring)
					{
						seqAutoPouring.rewindAndPlay();
					}
                }

                function setPourRatio(koef)
                {
					this.pourRatio = koef;
                }

                function setPourStartID(id)
                {
                        this.pourStartID = id;
                }

                function setPourEndID(id)
                {
                        this.pourEndID = id;
                }

                function startPour(obj, minl, maxl)
                {

                        if( obj == undefined)
                        {
                                trace("Object to pouring is undefined. Pour source ["+this._name+"]");
                                return;
                        }
                        if( this.pouring)
                        {
                                trace("Object ["+this._name+"] is already in pouring state");
                                return;
                        }

                        if (this._class._name == "ceBulb")
                        {
							if (obj._class._name == "ceUTube")
							{
									mtn13 = new Motion();
									mtn13._name = "mtSet13";
									mtn13.src = "rmeq:Utube\\locations\\mtSet13.caf";
									mtn13.parent = this.obj;
									mtn14 = new Motion();
									mtn14._name = "mtSet14";
									mtn14.src = "rmeq:Utube\\locations\\mtSet14.caf";
									mtn14.parent = this.obj;
									mtn15 = new Motion();
									mtn15._name = "mtSet15";
									mtn15.src = "rmeq:Utube\\locations\\mtSet15.caf";
									mtn15.parent = this.obj;
							}
							if (obj._class._name == "ceCylinder" || obj._class._name == "ceMernCylinder")
							{
									mtn13 = new Motion();
									mtn13._name = "mtSet13";
									mtn13.src = "rmeq:bulb\\locations\\mtSet17.caf";
									mtn13.parent = this.obj;
									mtn14 = new Motion();
									mtn14._name = "mtSet14";
									mtn14.src = "rmeq:bulb\\locations\\mtSet18.caf";
									mtn14.parent = this.obj;
									mtn15 = new Motion();
									mtn15._name = "mtSet15";
									mtn15.src = "rmeq:bulb\\locations\\mtSet19.caf";
									mtn15.parent = this.obj;
							}

							if (obj._class._name == "ceStakBig")
							{
									this.pourFirstID = 101;
									this.pourStartID = 102;
									this.pourEndID = 103;
							}

							if (obj._class._name == "ceMernStak")
							{
								if (this.replaceMTN==false)
								{
									mtn13 = new Motion();
									mtn13._name = "mtSet13";
									mtn13.src = "rmeq:bulb\\locations\\mtSet31.caf";
									mtn13.parent = this.obj;
									mtn14 = new Motion();
									mtn14._name = "mtSet14";
									mtn14.src = "rmeq:bulb\\locations\\mtSet32.caf";
									mtn14.parent = this.obj;
									mtn15 = new Motion();
									mtn15._name = "mtSet15";
									mtn15.src = "rmeq:bulb\\locations\\mtSet33.caf";
									mtn15.parent = this.obj;
									this.pourFirstID = 31;
									this.pourStartID = 32;
									this.pourEndID = 33;
								}
								else
								{ //trace("pourFirstID="+pourFirstID);
								}
							}
							if (obj._class._name == "ceRKolba")
							{
								mtn13 = new Motion();
								mtn13._name = "mtSet13";
								mtn13.src = "rmeq:bulb\\locations\\mtSet41.caf";
								mtn13.parent = this.obj;
								mtn14 = new Motion();
								mtn14._name = "mtSet14";
								mtn14.src = "rmeq:bulb\\locations\\mtSet42.caf";
								mtn14.parent = this.obj;
								mtn15 = new Motion();
								mtn15._name = "mtSet15";
								mtn15.src = "rmeq:bulb\\locations\\mtSet43.caf";
								mtn15.parent = this.obj;
								this.pourFirstID = 41;
								this.pourStartID = 42;
								this.pourEndID = 43;
							}
							if (obj._class._name == "ceTKapel")
							{
								mtn13 = new Motion();
								mtn13._name = "mtSet13";
								mtn13.src = "rmeq:bulb\\locations\\mtSet61.caf";
								mtn13.parent = this.obj;
								mtn14 = new Motion();
								mtn14._name = "mtSet14";
								mtn14.src = "rmeq:bulb\\locations\\mtSet62.caf";
								mtn14.parent = this.obj;
								mtn15 = new Motion();
								mtn15._name = "mtSet15";
								mtn15.src = "rmeq:bulb\\locations\\mtSet63.caf";
								mtn15.parent = this.obj;
								this.pourFirstID = 61;
								this.pourStartID = 62;
								this.pourEndID = 63;
							}
							if (obj._class._name == "ceTreug")
							{
								mtn13 = new Motion();
								mtn13._name = "mtSet13";
								mtn13.src = "rmeq:bulb\\locations\\mtSet91.caf";
								mtn13.parent = this.obj;
								mtn14 = new Motion();
								mtn14._name = "mtSet14";
								mtn14.src = "rmeq:bulb\\locations\\mtSet92.caf";
								mtn14.parent = this.obj;
								mtn15 = new Motion();
								mtn15._name = "mtSet15";
								mtn15.src = "rmeq:bulb\\locations\\mtSet93.caf";
								mtn15.parent = this.obj;
								this.pourFirstID = 91;
								this.pourStartID = 92;
								this.pourEndID = 93;
							}
							if (obj.parent!=null && obj.parent._class!=null && obj.parent._class._name == "ceMernKolbaBig")
							{
								this.pourFirstID = 221;
								this.pourStartID = 222;
								this.pourEndID = 223;
							}
							if (obj.parent!=null && obj.parent._class!=null && obj.parent._class._name == "ceMernKolba")
							{
								this.pourFirstID = 224;
								this.pourStartID = 225;
								this.pourEndID = 226;
							}
						}
						else
						if (this._class._name == "ceMernStak")
                        {
							if (obj._class._name == "ceKolba")
							{
								mtn13 = new Motion();
								mtn13._name = "mtSet13";
								mtn13.src = "rmeq:stak\\locations\\mtSet21.caf";
								mtn13.parent = this.obj;
								mtn14 = new Motion();
								mtn14._name = "mtSet14";
								mtn14.src = "rmeq:stak\\locations\\mtSet22.caf";
								mtn14.parent = this.obj;
								mtn15 = new Motion();
								mtn15._name = "mtSet15";
								mtn15.src = "rmeq:stak\\locations\\mtSet23.caf";
								mtn15.parent = this.obj;
								this.pourFirstID = 21;
								this.pourStartID = 22;
								this.pourEndID = 23;
							}
							if (obj._class._name == "ceProbirka")
							{
								this.pourFirstID = 111;
								this.pourStartID = 112;
								this.pourEndID = 113;
							}
							if (obj._class._name == "ceKapel")
							{
								mtn13 = new Motion();
								mtn13._name = "mtSet13";
								mtn13.src = "rmeq:stak\\locations\\mtSet51.caf";
								mtn13.parent = this.obj;
								mtn14 = new Motion();
								mtn14._name = "mtSet14";
								mtn14.src = "rmeq:stak\\locations\\mtSet52.caf";
								mtn14.parent = this.obj;
								mtn15 = new Motion();
								mtn15._name = "mtSet15";
								mtn15.src = "rmeq:stak\\locations\\mtSet53.caf";
								mtn15.parent = this.obj;
								this.pourFirstID = 51;
								this.pourStartID = 52;
								this.pourEndID = 53;
							}
						}

                        if (this._class._name == "ceRKolba")
                        {
							if (obj._class._name == "ceTKapel")
							{
								mtn13 = new Motion();
								mtn13._name = "mtSet13";
								mtn13.src = "rmeq:rkolba\\locations\\mtSet2.caf";
								mtn13.parent = this.obj;
								mtn14 = new Motion();
								mtn14._name = "mtSet14";
								mtn14.src = "rmeq:rkolba\\locations\\mtSet3.caf";
								mtn14.parent = this.obj;
								mtn15 = new Motion();
								mtn15._name = "mtSet15";
								mtn15.src = "rmeq:rkolba\\locations\\mtSet4.caf";
								mtn15.parent = this.obj;
								this.pourFirstID = 2;
								this.pourStartID = 3;
								this.pourEndID = 4;
							}
						}
						else	if (this._class._name == "ceProbirka")
						{
							if (obj._class._name == "ceVoronka")
							{
								this.pourFirstID = 2;
								this.pourStartID = 3;
								this.pourEndID = 4;
							}
						}
						if (this._class._name == "ceCylinder")
                        {
							if (obj._class._name == "ceMernCylinder")
							{
								mtn13 = new Motion();
								mtn13._name = "mtSet13";
								mtn13.src = "rmeq:cylinder\\locations\\mtSet3.caf";
								mtn13.parent = this.obj;
								mtn14 = new Motion();
								mtn14._name = "mtSet14";
								mtn14.src = "rmeq:cylinder\\locations\\mtSet4.caf";
								mtn14.parent = this.obj;
								mtn15 = new Motion();
								mtn15._name = "mtSet15";
								mtn15.src = "rmeq:cylinder\\locations\\mtSet5.caf";
								mtn15.parent = this.obj;
/*								this.pourFirstID = 2;
								this.pourStartID = 3;
								this.pourEndID = 4;
*/
							}
						}
                        this.pourSource = this;
                        this.pourDest = obj;
                        obj.pourSource = obj;
                        obj.pourDest = this;
                        if( minl != undefined)
                        {
                                this.pourMinBound = minl;
                                obj.pourMinBound = minl;
                        }
                        if( maxl != undefined)
                        {
                                this.pourMaxBound = maxl;
                                obj.pourMaxBound = maxl;
                        }
						if (this.dispos == this.pourFirstID)
						{
							trace("this.dispos == this.pourFirstID");
							this.moveTo(this.pourStartID,500, onBendFunction);
						}
						else
						{
							var mp = new Array(this.pourFirstID,this.pourStartID);
							var mt = new Array(1000,500);
							this.multiMoveTo(mp,mt, onBendFunction);
						}
                }

                function endPour()
                {
                        if(!this.pouring)       return;
                        if( this.pourDest.obj.level > this.pourMaxBound)
                        {
                                dl = this.pourDest.obj.level - this.pourMaxBound;
                                this.pourDest.obj.level -= dl;
								if( this.pourRatio!=0)
									this.obj.level += dl/this.pourRatio;
								else
									this.obj.level += dl;
                        }
                        this.pouring = false;
                        if( this.pourDest != null)
                        {
                                this.pourSource.moveTo(this.pourFirstID,500,this.pourDest.onEndPour);
                                this.pourDest.pouring = false;
                                if( this.pourDest.level_done != null)
								{
                                        this.pourDest.level_done();
								}
                        }
                        else
                        {
                                trace("Destination object in endPour is null for source ["+this._name+"]");
                        }
                }

                function pourOut(dlevel)
                {
					if( this.pouring && this.pourDest != null)
					{
						if( this.firstdrop && this.pourDest.onFirstDrop!=null)
							this.pourDest.onFirstDrop();
						if (this.playonce)
						{
							if( typeof(scene.sengine)!="undefined")
								scene.sengine.seplay("se_flowprob.mp3");
							this.playonce = false;
						}
						this.obj.level -= dlevel;
						this.pourDest.obj.level += this.pourRatio*dlevel;
						if( this.pourDest.onLevelChanged!=null)
						this.pourDest.onLevelChanged();
						if( this.onLevelChanged!=null)
						this.onLevelChanged();

						this.firstdrop = false;
						if( this.pourDest.obj.level > this.pourDest.pourMaxBound ||
							scene.autoPouring && this.pourSource.obj.level==0)
						{
							fireEvent("evLieOverEndPour");
							this.endPour();
						}
					}
                }


                // Mouse handlers
                function objOnPress()
                {
                        if( this.pouring && !scene.autoPouring)
                        {
                                moveTo(this.pourEndID, 3000, null);
                                this.playonce = true;							// playing of "se_flowprob.mp3" allowed
                        }
                }
                function objOnRelease(){        handleMouseRelease();   }
                function objOnReleaseOutside(){ handleMouseRelease();   }
                function handleMouseRelease()
                {
                        if( this.pouring && !scene.autoPouring)
                        {
                                if( this.pourDest.obj.level > this.pourDest.pourMinBound && this.pourDest.obj.level < this.pourDest.pourMaxBound)
                                {		trace("EndPour");
                                        this.endPour();
                                }
                                else
                                {
										trace("this.pourDest.obj.level="+this.pourDest.obj.level);
										trace("this.pourDest.pourMinBound="+this.pourDest.pourMinBound);
                                        moveTo(this.pourStartID, 3000, null);
										if( typeof(scene.sengine)!="undefined")
											scene.sengine.scplay(12);
										if(this.pourSource.notEnough != null) this.pourSource.notEnough();
                                }
                        }
                }

                function snapshot()
                {
                        this.obj.chem3drnd.call("ProcessMessage","snapshot");
                }

		function beginChanges()
                {
                        this.obj.chem3drnd.call("ProcessMessage","beginChanges");
                }

		function endChanges()
                {
                        this.obj.chem3drnd.call("ProcessMessage","endChanges");
                }

                function blend(tm, ret)
                {
                        var t = 1000;
                        if( tm!=undefined)      t = tm;
                        this.obj.blendtime = t;
                        this.obj.chem3drnd.call("ProcessMessage","liqblend");
						if( ret!=undefined)	return t;
                }

		function blendnolevel(tm)
                {
                        var t = 1000;
                        if( tm!=undefined)      t = tm;
                        this.obj.blendtime = t;
                        this.obj.chem3drnd.call("ProcessMessage","liqblendnolevel");
                }

                function copyLiqFrom(ob)
                {
                        this.obj.r = ob.obj.r;
                        this.obj.g = ob.obj.g;
                        this.obj.b = ob.obj.b;
                }
        ]]></script>
		<sequencer name="seqAutoPouring">
			<script>
				if( this.objOnPress != null)	this.objOnPress();
				ret = this.moveTo(this.pourEndID, this.autoPourTime);
				ret += " || " + this.target+".evLieOverEndPour";
				ret;
			</script>
			<script>
				this.endPour();
			</script>
		</sequencer>

		<object _name="obj">
			<plugin _name="chem3drnd" src="rmeq:dlls\chem3drnd.dll" uid="mmlabChem3DPlugin"/>
			<script src="glassparams.mjs"/>
			<script><![CDATA[
				function pourOut(dlevel)
				{
					if( this.parent.pourOut != undefined)
					{
						this.parent.pourOut(dlevel);
					}
				}

				function drop()
				{
					scene.PlaySE("se_indin.mp3");
				}
			]]></script>
		</object>
	</group>
	<!--
Bulb
-->
	<group _name="ceBulb" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:Bulb\\";
                </script>
		<object _name="obj" src="rmeq:Bulb\Model\mesh.cfg" enabled="true"/>
		<object _name="cover" src="rmeq:Bulb\Cover\Model\mesh.cfg" enabled="true" _visible="false">
			<motion name="uplarge"  src="rmeq:Bulb\Cover\locations\uplarge.caf" duration="300"/>
			<motion name="upsmall"  src="rmeq:Bulb\Cover\locations\upsmall.caf" duration="300" />
			<motion name="downlarge"  src="rmeq:Bulb\Cover\locations\downlarge.caf" duration="300"/>
			<motion name="downsmall"  src="rmeq:Bulb\Cover\locations\downsmall.caf" duration="300"/>
		</object>
		<script><![CDATA[
			function        moveToFront(ff)
			{
				if( ff != undefined)    moveTo(13, 1000, ff);
				else    moveTo(13, 1000, null);
			}

			function setTitle(s)
			{
				if( isNum(s)==true)
				{
					if( eval("scene.imap"+s) == undefined)  return;
					this.obj.materials.__3.maps.diffuse.source = eval("scene.imap"+s);
				}
				else
				{
					this.obj.materials.__3.maps.diffuse.src = "rmeq:bulb\\maps\\"+s+".png";
				}
			}

			function objOnPress()
			{
				ceBaseGlassEquip_objOnPress();
			}

			function adjustJarMotions(pos)
			{
				// 1
				this.cover.uplarge.tracks[-1].frames[0]._pos = pos;
				this.cover.uplarge.tracks[-1].frames[1]._pos = pos;	this.cover.uplarge.tracks[-1].frames[1]._pos.z += 14.5;
				// 2
				//trace("pos="+pos.x+":"+pos.y+":"+pos.z);
				this.cover.upsmall.tracks[-1].frames[0]._pos = pos;	this.cover.upsmall.tracks[-1].frames[0]._pos.z += 12.5;
				this.cover.upsmall.tracks[-1].frames[1]._pos = pos;	this.cover.upsmall.tracks[-1].frames[1]._pos.z += 14.5;
				// 3
				this.cover.downlarge.tracks[-1].frames[0]._pos = pos;	this.cover.downlarge.tracks[-1].frames[0]._pos.z += 14.5;
				this.cover.downlarge.tracks[-1].frames[1]._pos = pos;
				// 4
				this.cover.downsmall.tracks[-1].frames[0]._pos = pos;	this.cover.downsmall.tracks[-1].frames[0]._pos.z += 14.5;
				this.cover.downsmall.tracks[-1].frames[1]._pos = pos;	this.cover.downsmall.tracks[-1].frames[1]._pos.z += 12.5;
			}

			function moveTo(pos, time,onsetfunc)
			{
				// 0. Если перемещаемся за 0 сек. до сдвигаем крышку  ту же позицию
				// 1. Если перемещаемся в позицию 1..12 - 21..26 меньше чем за 50 ms, нужно передвинуть крышку
				// 2. Если перемещаемся в позицию 1..12 - 21..26 меньше чем за 50 ms, нужно надеть крышку
				// 3. Если текущая позиция 1..12 - 21..26, то нужно поднять крышку перед движением
//				trace("ceBulb moveTo["+pos+":"+time+"]");
				// 0. Если перемещаемся за 0 сек. до сдвигаем крышку  ту же позицию
				if( time < 25)
				{
					mtn = this.loadMotionByID(pos);
					if( mtn!=undefined && mtn!=null)
						this.adjustJarMotions(mtn.tracks[-1].frames[0]._pos);
				}
				// 1. Если перемещаемся в позицию 1..12 - 21..26 меньше чем за 50 ms, нужно передвинуть крышку
				if( ((pos>=1 && pos<=12) || (pos>=21 && pos<=26)) && (time<50))
				{
					var     mtn = loadMotionByID(pos);
					this.cover.position.x = mtn.tracks[-1].frames[0]._pos.x;
					this.cover.position.y = mtn.tracks[-1].frames[0]._pos.y;
					this.cover.position.z = mtn.tracks[-1].frames[0]._pos.z + 12.5;
					this.cover._visible=true;
					return ceBaseEquip_moveTo(pos, time,onsetfunc);
				}
				// 2. Если перемещаемся в позицию 1..12 - 21..26 больше чем за 50 ms, нужно надеть крышку
				if( ((pos>=1 && pos<=12) || (pos>=21 && pos<=26)) && (time>50) && (pos != this.dispos))
				{
						this.stsPos = pos;
						this.stsTime = time;
						this.stsFunc = onsetfunc;
						this.seq_toShelf.rewindAndPlay();
						return seq_toShelf.target + ".onPlayed";
				}
				// 3. Если текущая позиция 1..12 - 21..26, то нужно поднять крышку перед движением
				if( ((this.dispos>=1 && this.dispos<=12) || (this.dispos>=21 && this.dispos<=26)))
				{
					if( time < 50){ this.cover._visible=false;}
					else
					{
						this.sfsPos = pos;
						this.sfsTime = time;
						this.sfsFunc = onsetfunc;
						this.seq_fromShelf.rewindAndPlay();
						return seq_fromShelf.target + ".onPlayed";
					}
				}
				return ceBaseEquip_moveTo(pos, time,onsetfunc);
			}
		]]></script>

		<sequencer name="seq_fromShelf">
			<script>
				this.cover.setMotion(this.cover.upsmall);
			</script>
			<script>
				this.cover.doMotion(this.cover.upsmall);
				"cover.upsmall.onDone";
			</script>
			<script>
				this.cover.doMotion(this.cover.downlarge);
				ceBaseEquip_moveTo( this.sfsPos, this.sfsTime, sfsFunc);	// waits here
			</script>
		</sequencer>

		<sequencer name="seq_toShelf">
			<script>
				this.cover.doMotion(this.cover.uplarge);
			</script>
			<script>
				ceBaseEquip_moveTo( this.stsPos, this.stsTime, stsFunc);	// waits here
			</script>
			<script>
				this.cover.doMotion(this.cover.downsmall);
				"cover.downsmall.onDone";
			</script>
		</sequencer>

	</group>
<!--
Probirka
-->
	<group _name="ceProbirka" _class="ceBaseGlassEquip">
		<script>
                this.resPath = "rmeq:TestTube\\";
        </script>
		<object _name="obj" src="rmeq:TestTube\Model\mesh.cfg" enabled="true">
			<motion _name="mtShake" src="rmeq:TestTube\locations\mtshake.caf"/>
		</object>
		<script>
                this.frontfunc = null;
                function onDoneFunction(act)
                {
                        if( act == GetMotionByName("up"))
                        {
                                moveTo(3, 1000, this.frontfunc);
                        }
                }

                function        moveToFront(ff)
                {
                        if( ff != undefined)    this.frontfunc = ff;
                        else    this.frontfunc = null;
                        _doMotion("up", this.onDoneFunction);
                }
                function        pShake()
                {
                        this._doMotion("mtshake");
						if( typeof(scene.sengine)!="undefined")
							scene.sengine.seplay("se_shakeprob.mp3");
                }
                function        pHeating()
                {
                                moveTo(7, 500, this.pHeating_);
                }
                function        pHeating_()
                {
                        this._doMotion("mtheat");
                }
                function objOnPress()
                {

                }
        </script>
		<sequencer _name="seqFront">
        </sequencer>
	</group>
	<group _name="cePipetkaCommon" _class="ceBaseGlassEquip">
		<object _name="obj" src="rmeq:IndBulb\Pipetka\model\mesh.cfg" enabled="true">
			<motion _name="mtnMoveToDrop" src="rmeq:IndBulb\Pipetka\locations\moveToDrop.caf" duration="500" />
			<motion _name="mtnMoveToBack" src="rmeq:IndBulb\Pipetka\locations\moveToBack.caf"/>
		</object>
		<script><![CDATA[
                        this.dropobject = null;
                        this.downpos = new Position3D;
                        this.uppos = new Position3D;
                        this.ondropstage=false;

                        function        startDrop(ob, func)
                        {
                                if(this.ondropstage)    return;
                                this.dropobject = ob;
                                var     mtn = obj.mtnMoveToDrop;
                                this.downpos = new Position3D(obj._pos);
                                mtn.tracks[-1].frames[0]._pos = this.downpos;

                                mtn.tracks[-1].frames[1]._pos.x = obj._pos.x;   mtn.tracks[-1].frames[1]._pos.y = obj._pos.y;
                                this.uppos = mtn.tracks[-1].frames[1]._pos;

                                mtn.tracks[-1].frames[2]._pos.x = this.dropobject.obj._pos.x;
                                mtn.tracks[-1].frames[2]._pos.y = this.dropobject.obj._pos.y;

                                if( ob._class._name == "ceProbirka")
                                        mtn.tracks[-1].frames[2]._pos.z = this.dropobject.obj._pos.z + 20;
                                else
								if( ob._class._name == "cePBowl")
								{
                                        mtn.tracks[-1].frames[2]._pos.z = this.dropobject.obj._pos.z + 7;
										mtn.tracks[-1].frames[2]._pos.y = this.dropobject.obj._pos.y - 3;
								}
								else
								if( ob._class._name == "ceMernStak")
								{
									mtn.tracks[-1].frames[2]._pos.z = this.dropobject.obj._pos.z + 15;
//									mtn.tracks[-1].frames[2]._pos.y = this.dropobject.obj._pos.y + 3;
									mtn.tracks[-1].frames[2]._pos.x = this.dropobject.obj._pos.x - 1;
								}
								else
								if( ob._class._name == "ceStakCov")
								{
									mtn.tracks[-1].frames[2]._pos.z = this.dropobject.obj._pos.z + 21;
									mtn.tracks[-1].frames[2]._pos.x = this.dropobject.obj._pos.x - 1;
								}
                                else
                                        mtn.tracks[-1].frames[2]._pos.z = this.dropobject.obj._pos.z;


                                if( func == undefined)  _doMotion("mtnMoveToDrop");
                                else    _doMotion("mtnMoveToDrop", func);
                                this.ondropstage = true;
                        }

                        function        endDrop(func)
                        {
                                if(!this.ondropstage)   return;
                                var     mtn = obj.mtnMoveToBack;

                                mtn.tracks[-1].frames[0]._pos = obj._pos;

                                mtn.tracks[-1].frames[1]._pos = this.uppos;
                                mtn.tracks[-1].frames[2]._pos = this.downpos;

                                if( func == undefined)  _doMotion("mtnMoveToBack");
                                else    _doMotion("mtnMoveToBack", func);
                                this.ondropstage = false;
                        }

                        function addDrop()
                        {
				if( this.dropobject != null)
					this.dropobject.addLiquidDrop();
                        }
                ]]></script>
	</group>
	<!--
Bulb with indikatorom
-->
	<group _name="ceIndikBulb">
		<group _name="pip" _class="cePipetkaCommon">
			<script>
                                this.resPath = "rmeq:IndBulb\\Pipetka\\";

				function startDrop(ob, func)
				{
					copyLiqFrom(parent.bulb);
					obj.level = 50;
					obj.aback = parent.bulb.obj;
					cePipetkaCommon_startDrop(ob, func);
				}
                        </script>
			<object _name="obj" src="rmeq:IndBulb\Pipetka\model\mesh.cfg" enabled="true"/>
		</group>
		<group _name="bulb" _class="ceBulb">
			<script>
			this.resPath = "rmeq:IndBulb\\Bulb\\";

			function setTitle(s)
			{
				if( isNum(s)==true)
				{
					if( eval("scene.imap"+s) == undefined)  return;
					this.obj.materials.__3.maps.diffuse.source = eval("scene.imap"+s);
				}
				else
				{
					this.obj.materials.__3.maps.diffuse.src = "rmeq:IndBulb\\Bulb\\maps\\"+s+".png";
				}
			}

			function moveTo(pos, time,onsetfunc)
			{
				return ceBaseEquip_moveTo(pos, time,onsetfunc);
			}
			</script>
		</group>
		<!-- Define same functions as in the ceBaseGlassEquip class -->
		<script>
                        this.bulb.obj.level = 50;

                        function moveTo(pos, time,onsetfunc)
                        {
                                this.bulb.moveTo(pos, time,onsetfunc);
                                this.pip.moveTo(pos, time,null);
                        }
                        function objOnPress()
                        {
                        }
                </script>
	</group>
	<!--
        Merny stakan
        -->
	<group _name="ceMernStak" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:stak\\";
			function objOnPress(){
				ceBaseGlassEquip_objOnPress();
			}
                </script>
		<object _name="obj" src="rmeq:stak\Model\mesh.cfg" enabled="true">
			<motion _name="mtShake" src="rmeq:stak\locations\mtshake.caf"/>
		</object>
		<script>
                function        pShake()
                {
                        this._doMotion("mtshake");
						if( typeof(scene.sengine)!="undefined")
							scene.sengine.seplay("se_shakeprob.mp3");
                }
		</script>
	</group>
	<!--
        stakan
        -->
	<group _name="ceStakBig" _class="ceBaseGlassEquip">
		<script>
			this.resPath = "rmeq:stak200\\";
			function objOnPress(){
				ceBaseGlassEquip_objOnPress();
			}
                </script>
		<object _name="obj" src="rmeq:stak200\Model\mesh.cfg" enabled="true"/>
	</group>
	<!--
        bowl
        -->
	<group _name="ceGlassBowl" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:bowl\\";
                </script>
		<object _name="obj" src="rmeq:bowl\Model\mesh.cfg" enabled="true"/>
	</group>
	<!--
        Palochka
        -->
	<group _name="cePalochka" _class="ceBaseEquip">
		<script>
                        this.resPath = "rmeq:palochka\\";
                </script>
		<object _name="obj" src="rmeq:palochka\Model\mesh.cfg" enabled="true">
			<motion _name="MixInGlass" src="rmeq:palochka\locations\MixInGlass.caf" duration="4000"/>
			<motion _name="MixInGlass2" src="rmeq:palochka\locations\MixInGlass2.caf" duration="4000"/>
			<motion _name="MixInPbowl" src="rmeq:palochka\locations\MixInPbowl.caf" duration="3000"/>
		</object>
		<script>
			this.f = null;

			function mixInGlass()
			{
				this._doMotion("MixInGlass");
			}

			function mixInGlass2()
			{
				this._doMotion("MixInGlass2");
			}

			function mixInPbowl(f)
			{
				this.f = f;
				this.moveTo("MixInPbowl",500,onCenterPos);
			}

			function onCenterPos()
			{
				if (this.f!=null)
					this._doMotion("MixInPbowl",this.f);
				else
					this._doMotion("MixInPbowl");
				this.f = null;
			}
		</script>
	</group>
	<!--s
        Pipetka
        -->
	<group _name="cePipetka" _class="cePipetkaCommon">
		<script>
                        this.resPath = "rmeq:pipetka\\";
                </script>
		<object _name="obj" src="rmeq:pipetka\Model\mesh.cfg" enabled="true">
			<motion _name="mtnMoveToDrop" src="rmeq:pipetka\locations\moveToDrop.caf" duration="1000"/>
			<motion _name="mtnMoveToBack" src="rmeq:pipetka\locations\moveToBack.caf"/>
			<motion _name="mtnMoveToBulb" src="rmeq:pipetka\locations\moveToBulb.caf" duration="500"/>
			<motion _name="mtnMoveFromBulb" src="rmeq:pipetka\locations\moveFromBulb.caf" duration="500"/>
			<motion _name="mtnMoveToProb" src="rmeq:pipetka\locations\mtset2.caf"/>
			<motion _name="mtnOutOfScreen" src="rmeq:pipetka\locations\outofscreen.caf"/>
		</object>
		<script><![CDATA[
                        this.onReadyToDrop = null;
                        this.dropbulb = null;
						this.savedDispose=0;
                        function startDrop(ob, bulb, func)
                        {
							this.copyLiqFrom(bulb);
							this.obj.aback = bulb.obj.aback;
							this.obj.a = bulb.obj.a;

							trace("bulb="+bulb._name);
							if(this.ondropstage)    return;
							this.dropobject = ob;
							this.dropbulb = bulb;

							if( func != undefined && func != null)  this.onReadyToDrop = func;
							else    this.onReadyToDrop = null;

							var     mtn = obj.mtnMoveToDrop;
							this.downpos = new Position3D(obj._pos);
							mtn.tracks[-1].frames[0]._pos = this.downpos;

							mtn.tracks[-1].frames[1]._pos.x = bulb.obj._pos.x;
							mtn.tracks[-1].frames[1]._pos.y = bulb.obj._pos.y;

							if( bulb._class._name=="ceBulb" || bulb._class._name=="ceIndikBulb")
							mtn.tracks[-1].frames[1]._pos.z = bulb.obj._pos.z + 15;
							else
							mtn.tracks[-1].frames[1]._pos.z = bulb.obj._pos.z;

							mtn = obj.mtnMoveToProb;
							mtn.tracks[-1].frames[0]._pos = ob.obj._pos;

							if( ob._class._name=="ceProbirka")
								mtn.tracks[-1].frames[0]._pos.z += 20;
							else	if( ob._class._name=="ceMernStak")
								mtn.tracks[-1].frames[0]._pos.z += 15;
							else	if( ob._class._name=="cePaper")
									{
										mtn.tracks[-1].frames[0]._pos.z += 2;
										mtn.tracks[-1].frames[0]._pos.x += 8;
									}

							mtn = obj.mtnMoveToBack;
							mtn.tracks[-1].frames[0]._pos = this.downpos;

							this.seqGetLiq.rewindAndPlay();
							this.ondropstage = true;
                        }
                        function endDrop(outofscreen)
                        {
                                if(!this.ondropstage)   return;
				this.savedDispose = this.dispos;
				if( outofscreen==undefined || outofscreen==null)
					outofscreen = true;
				if( outofscreen)
				{
					var asets = new Array("mtnOutOfScreen","mtnMoveToBack");
					var atimes = new Array(1500,500);
					this.multiMoveTo(asets, atimes, this.onAfterLie);
				}
				else
					this.moveTo("mtnMoveToBack", 500);
                                this.ondropstage = false;
                        }
                        function getLiquid()
                        {
                                this.snapshot();
                                this.copyLiqFrom(this.dropbulb);
                                this.obj.level = 25;
                                this.blend(1000);
                        }
			function onAfterLie()
			{
				this.dispos = this.savedDispose;
			}
                ]]></script>
		<sequencer _name="seqGetLiq">
			<script>
                                //trace("this="+this._name);
                                this.obj.doMotion(this.obj.mtnMoveToDrop);
                                "obj.mtnMoveToDrop.onDone"
                        </script>
			<script>
                                this.obj.doMotion(this.obj.mtnMoveToBulb);
                                "obj.mtnMoveToBulb.onDone"
                        </script>
			<script>
                                this.getLiquid();
                                1000;
                        </script>
			<script>
                                this.obj.doMotion(this.obj.mtnMoveFromBulb);
                                "obj.mtnMoveFromBulb.onDone"
                        </script>
			<script>
                                this.obj.setMotion(this.obj.mtnMoveToProb, 500);
                                "obj.mtnMoveToProb.onSet"
                        </script>
			<script>
                                if(this.onReadyToDrop!=null)
                                        this.onReadyToDrop();
                                true;
                        </script>
		</sequencer>
	</group>
<!--
Jar
-->
	<group _name="ceJar">
		<group _name="jbulb" _class="ceBaseGlassEquip">
			<script>
                this.resPath = "rmeq:jar\\jbulb\\";
            </script>
			<object _name="obj" src="rmeq:jar\jbulb\model\mesh.cfg" enabled="true">
				<motion _name="tofront" src="rmeq:jar\jbulb\locations\tofront.caf" duration="700"/>
				<motion _name="toback" src="rmeq:jar\jbulb\locations\toback.caf" duration="700"/>
				<!--                                <motion/>   _name="_toback_"  src="rmeq:jar\jbulb\locations\toback.caf" -->
			</object>
			<script>
				function objOnPress()
				{
					if(parent.objOnPress != undefined)
						parent.objOnPress();
				}
				function setTitle(s)
				{
					if( isNum(s)==true)
					{
						if( eval("scene.imap"+s) == undefined)  return;
						this.obj.materials.__3.maps.diffuse.source = eval("scene.imap"+s);
					}
					else
					{
						this.obj.materials.__3.maps.diffuse.src = "rmeq:jar\\jbulb\\maps\\"+s+".png";
					}
				}
		</script>
		</group>
		<group _name="jcover" _class="ceBaseGlassEquip">
			<script>
                                this.resPath = "rmeq:jar\\jcover\\";
                        </script>
			<object _name="obj" src="rmeq:jar\jcover\model\mesh.cfg" enabled="true">
				<motion _name="moveToTable" src="rmeq:jar\jcover\locations\moveToTable.caf" duration="900"/>
				<motion _name="moveUp2Down" src="rmeq:jar\jcover\locations\moveUp2Down.caf" duration="500"/>
				<motion _name="moveUp" src="rmeq:jar\jcover\locations\moveUp.caf"/>
			</object>
			<script>
                                function objOnPress()
                                {
                                        if(parent.objOnPress != undefined)
                                                parent.objOnPress();
                                }
                        </script>
		</group>
		<!-- Define same functions as in the ceBaseGlassEquip class -->
		<script><![CDATA[
				this.doingMotion = false;
				this.onFront = false;
				this.frontFunc = null;
				this.backFunc = null;
				this.needToBack = 0;
				this.needToFront = 0;
				function moveTo(pos, time,onsetfunc)
				{
						this.jcover.moveTo(pos, time,onsetfunc);
						this.jbulb.moveTo(pos, time,null);
				}

				function moveToFront(func)
				{
					if( this.seqBack._playing || this.seqFront._playing)
					{
						this.needToFront++;
						return;
					}

					if (this.onFront != true)
					{
						if( func!=undefined && func!=null)
							this.frontFunc = func;
						else
							this.frontFunc = null;
						this.onFront = true;
						this.doingMotion = true;
						if( this.needToFront>0)	this.needToFront--;
						this.seqFront.rewindAndPlay();
					}
					else
						trace(this.name + " already on front");
				}

				function moveToBack(func)
				{
					if( this.seqBack._playing || this.seqFront._playing)
					{
						this.needToBack++;
						return;
					}

					if (this.onFront == true)
					{
						if( func!=undefined && func!=null)
							this.backFunc = func;
						else
							this.backFunc = null;
						this.doingMotion = true;
						if( this.needToBack>0)	this.needToBack--;
						this.seqBack.rewindAndPlay();
					}
					else	trace(this.name + " already on back");
				}
		]]></script>
		<script event="jcover.obj.moveUp2Down.onDone">
				this.onFront = false;
				this.doingMotion = false;
		</script>
		<script event="jcover.obj.moveToTable.onDone">
				this.doingMotion = false;
		</script>
		<sequencer _name="seqFront">
			<script>
				this.jcover._doMotion("moveToTable");
				300;
			</script>
			<script>
				scene.PlaySE("se_eqmove.mp3");
				this.jbulb._doMotion("tofront");
				"jbulb.obj.tofront.onDone";
			</script>
			<script><![CDATA[
				if( this.frontFunc != null)
					this.frontFunc();
				trace("this.needToBack="+this.needToBack);
				if( this.needToBack>0)
				{
					this.seqFront.stop();
					this.moveToBack();
				}
				true;
			]]></script>
		</sequencer>
		<sequencer _name="seqBack">
			<script>
				this.jcover._doMotion("moveUp");
				"jcover.obj.moveUp.onDone"
			</script>
			<script>
				scene.PlaySE("se_eqmove.mp3");
				this.jbulb._doMotion("toback");
				"jbulb.obj.toback.onDone"
			</script>
			<script>
				var mtn = this.jcover.obj.moveUp2Down;
				this.jcover.setKeyPos(mtn, 0, this.jcover);
				mtn.tracks[-1].frames[1]._pos.x = this.jcover.obj._pos.x;
				mtn.tracks[-1].frames[1]._pos.y = this.jcover.obj._pos.y;
				this.jcover._doMotion("moveUp2Down");
				"jcover.obj.moveUp2Down.onDone";
			</script>
			<script><![CDATA[
				if( this.backFunc != null)
					this.backFunc();
				if( this.moveToFront>0)
				{
					this.seqBack.stop();
					this.moveToFront();
				}
				true;
			]]></script>
		</sequencer>
	</group>
	<!--
Shpatel
-->
	<group _name="ceShpatel" _class="ceBaseEquip">
		<script>
                        this.resPath = "rmeq:shpatel\\";
                        this.moveTo(1, 0);
                        this.powCounter = 0;
                </script>
		<object _name="obj" src="rmeq:shpatel\Model\mesh.cfg" enabled="true">
			<motion _name="mtnLie2Jar" src="rmeq:shpatel\locations\lie2jar.caf" duration="2000"/>
			<motion _name="mtnJar2Dest" src="rmeq:shpatel\locations\jar2dest.caf" duration="2000"/>
			<motion _name="mtnDrop" src="rmeq:shpatel\locations\drop.caf" duration="500"/>
			<motion _name="mtnLie" src="rmeq:shpatel\locations\lie.caf"/>
			<motion _name="mtnOutOfScreen" src="rmeq:shpatel\locations\outofscreen.caf"/>
		</object>
		<script><![CDATA[
                        this.lie2jar_func = null;
                        this.jar2dest_func = null;
                        this.drop_func = null;

						this.drop_subst = null;
						this.drop_obj = null;
                        this.jar_obj = null;
                        this.granula = null;
						this.savedDispose=0;
						this.afterLieFunc=0;

                        function table2jar(jar,pos1, f, vs)
                        {
							this.enabled=false;
						if(vs==undefined || vs==null)
							vs = false;
						else
							vs = true;
						this.bpos=false;
						if (jar == "[object Position3D]")
						{
							var jar_tmp = new Group();
							jar_tmp._class = "ceBaseEquip";
							jar_tmp.obj._pos.x = jar.x;
							jar_tmp.obj._pos.y = jar.y;
							jar_tmp.obj._pos.z = jar.z;
							jar = jar_tmp;
							this.bpos=true;
						}
						this.jar_obj = jar;
						var mtn = this.obj.mtnLie2Jar;
						this.setKeyPos(mtn, 0,this);
						this.setKeyPos(mtn, 1, jar);
						this.setKeyPos(mtn, 2, jar);
						if( this.bpos)
						{
							if( !vs)
							{
								shiftKeyPos(mtn, 1, pos1.x, pos1.y, pos1.z);
								shiftKeyPos(mtn, 2, -2, 0, 2);
							}
							else	// Для работы 91 школьная
							{
								shiftKeyPos(mtn, 2, pos1.x, pos1.y, pos1.z);
							}
						}
						else
						{
							var pos = new Position3D();
							if( jar._class!=null && jar._class._name == "ceGlassBowl")
							{
								pos.z = 10;
							}
							if( jar._class!=null && jar._class._name == "cePBowl")
							{
								pos.z = 7;
								shiftKeyPos(mtn, 2, 0, 0, 3);
							}
							else if( jar._class!=null && jar._class._name == "ceStupka")
							{
								pos.z = 11;
							}
							else if( jar._class!=null && jar._class._name == "ceVoronka")
							{
								pos.z = 20;
								shiftKeyPos(mtn, 2, 0, 0, 10);
							}
							else if( jar.parent != undefined && jar.parent!=null &&  jar.parent._class!=null && (jar.parent._class._name == "ceJar" || jar.parent._class._name == "jarCommon"))
							{
								pos.z = 20;
								shiftKeyPos(mtn, 2, -2, 0, 0);
							}
							shiftKeyPos(mtn, 1, pos.x, pos.y, pos.z);
						}
						this.setKeyPos(this.obj.mtnLie, 0, this);
						if( f!=undefined)       this.lie2jar_func = f;
						else    this.lie2jar_func = null;
						scene.PlaySE("se_shpatup.mp3");

//						var fr1 = this.obj.mtnLie2Jar.tracks[-1].frames[1];
	//					var fr2 = this.obj.mtnLie2Jar.tracks[-1].frames[2];
		//				trace("##"+fr1._pos.x+":"+fr1._pos.y+":"+fr1._pos.z+":"+fr2._pos.x+":"+fr2._pos.y+":"+fr2._pos.z);
						this._doMotion("mtnLie2Jar", this.lie2jar_func);
                        }

                        function jar2dest(dest,pos2, f)
                        {
						if(dest == "[object Position3D]")
						{
							var dest_tmp = new Group();
							dest_tmp._class = "ceBaseEquip";
							dest_tmp.obj._pos.x = dest.x;
							dest_tmp.obj._pos.y = dest.y;
							dest_tmp.obj._pos.z = dest.z;
							dest = dest_tmp;
						}
						this.drop_obj = dest;
						var mtn = this.obj.mtnJar2Dest;

						this.setKeyPos(mtn, 0, this);
						this.setKeyPos(mtn, 1, this);

						this.setKeyPos(mtn, 2, dest);
						if( pos2 != undefined && pos2 != null)
						{
							shiftKeyPos(mtn, 2, pos2.x, pos2.y, pos2.z);
						}
						else
						{
							var pos = new Position3D();
							if( dest._class._name == "ceProbirka")
							{
								pos.x = 20;
							}
							else	if( dest._class._name == "ceEqTreug" || dest._class._name == "ceTreug")
							{
								pos.x = 20;
							}
							else if( dest._class._name == "ceProbWP")
							{
								pos.x = 20;
							}
							else if( dest._class._name == "ceStupka")
							{
								pos.x = 8;
							}
							else	if( dest._class._name == "ceMernStak")
							{
								pos.x = 15;
							}else	if( dest._class._name == "cePBowl")
							{
								pos.x = 7;
							}

							if( jar_obj.parent != undefined && jar_obj.parent!=null &&  jar_obj.parent._class!=null && (jar_obj.parent._class._name == "ceJar" || jar_obj.parent._class._name == "jarCommon"))
							{
								shiftKeyPos(mtn, 1, 2, 0, 15);
							}
							else if( jar_obj._class!=null && jar_obj._class._name == "ceStupka")
							{
								shiftKeyPos(mtn, 1, 0, 0, 11);
							}
							if( jar_obj._class!=null && jar_obj._class._name == "cePBowl")
							{
								shiftKeyPos(mtn, 1, 0, 0, 7);
							}
							if( jar_obj._class!=null && jar_obj._class._name == "ceVoronka")
							{
								shiftKeyPos(mtn, 1, 0, 0, 5);
							}
							//trace("pos.x ="+pos.x +":"+dest._class._name);

							pos.mult(dest.obj._rotation);
							shiftKeyPos(mtn, 2, pos.x, pos.y, pos.z);
						}
						if( f!=undefined)       this.jar2dest_func = f;
						else    this.jar2dest_func = null;
						this._doMotion("mtnJar2Dest", this.jar2dest_func);
                        }

                        function drop(f,drop_subst,ratio)
                        {
							if (drop_subst != undefined && drop_subst != null)
								this.drop_subst = drop_subst;
							if ( ratio!=undefined && (ratio!=null) && (isNum(ratio)) && this.powder!=null)
								this.powder.ratio = ratio;
							if( f!=undefined && f!=null)
								this.drop_func = f;
							else
								this.drop_func = null;
							if (this.granula != null)
							{
								this._doMotion("mtnDrop", this.onGranDrop);
							}
							else	if( this.powder != null)
							{
								this._doMotion("mtnDrop", this.onPowDrop);
							}
                        }
						function onPowDrop()
						{
							this.powder.drop(this.drop_func,this.drop_subst,this.drop_obj);
						}
                        function onGranDrop()
                        {
//							trace("---onGranulaDrop---");
							this.granula.obj.attachTo(null);
							this.granula.drop(this.drop_func);
							this.granula = null;
							/*if( this.drop_func != null)
							{
								this.drop_func();
							}*/
						}
                        function lieOnTable(f, outofscreen)
                        {
							if( outofscreen==undefined || outofscreen==null)
								outofscreen = true;
							if( f==undefined)	f=null;
							if( outofscreen)
							{
								this.savedDispose = this.dispos;
								var asets = new Array("mtnOutOfScreen","mtnLie");
								var atimes = new Array(1000,700);
								this.afterLieFunc = f;
								this.multiMoveTo(asets, atimes,this.onAfterLieOnTable);
							}
							else	this.moveTo("mtnLie", 1000, f);
                        }

						function onAfterLieOnTable()
						{	this.enabled=true;
							this.dispos = this.savedDispose;
							if( this.afterLieFunc != null)
								this.afterLieFunc();
						}

                        function attachGranula(tp,num)
                        {
								if( num == undefined) 	num=1;
                                var     granula = new Group();
								granula._class = "ceGranula";
                                granula.parent = parent;
                                granula.setType(tp);
                                granula._name = "gr_"+tp;

                                // Calculate granula position
                                var tempPos = new Position3D(1.3, -1.31, 0);
                                tempPos.mult(obj._rotation);
                                tempPos.add(obj._pos);
                                granula.obj._pos = tempPos;

                                var tempRtn = granula.obj._rotation;
                                tempRtn.mult( obj._rotation.clone());
                               granula.obj._rotation = tempRtn.clone();

                                granula.obj.attachTo(this.obj, "BoneSh");
                                this.granula = granula;
                        }

                        function attachPowder(tp)
                        {
                                var     powder = new Group();
                                powder._class = "cePowder";
                                powder.parent = parent;
                                powder.setType(tp);
                                powder._name = "powder";
                                //powder.obj._pos = this.obj._pos;

                                // Calculate powder position
                                var tempPos = new Position3D(0.58, -0.25, 0);
                                tempPos.mult(obj._rotation);
                                tempPos.add(obj._pos);
                                powder.obj._pos = tempPos;

                                var tempRtn = powder.obj._rotation;
                                tempRtn.mult( obj._rotation.clone());
                               powder.obj._rotation = tempRtn.clone();

                                powder.obj.attachTo(this.obj, "BoneSh");
                                this.powder = powder;
                        }
                ]]></script>
		<script event="obj.mtnLie.onSet">
			scene.PlaySE("se_shpatdown.mp3");
		</script>
	</group>
	<!--
Granula
-->
	<group _name="ceGranula" _class="ceBaseEquip">
		<script>
                        this.type = "zn";
                        this.resPath = "rmeq:granula\\";
                        //this.moveTo(1, 0);
                        this.dropmotionname="moveSlide";
                        this.dropmotion=null;
						this.ondrop=null;
                </script>
		<object _name="obj" src="rmeq:granula\Model\mesh.cfg" enabled="true"/>
		<script><![CDATA[
                        function setType(tp)
                        {
                                this.type = tp;
                                this.obj.materials.__0.maps.diffuse.src = this.resPath + "\\maps\\"+tp+".png";
                        }

                        function setDropMotion(f)
                        {
                                if( isNum(f))
                                        trace("Granula drop motion name muset be a string");
                                else
                                        this.dropmotionname = f;
                        }

                        function drop(f)
                        {
							if(f!=undefined && f!=null)	this.ondrop=f;
                                if (eval("obj."+this.dropmotionname) != undefined)
                                {
	                                       this.dropmotion = eval("obj."+this.dropmotionname);
                                }
                                else
                                {
                                        this.dropmotion = new Motion();
                                        this.dropmotion._name = this.dropmotionname;
                                        this.dropmotion.src = this.resPath + "locations\\" + this.dropmotion._name+".caf";
                                        this.dropmotion.parent = this.obj;
                                }
                                this.dropSequencer.rewindAndPlay();
                        }

                ]]></script>
		<sequencer _name="dropSequencer">
			<script>
                                1;
                        </script>
			<script>
                                this.obj.setMotion(this.dropmotion, 650);
                                "dropmotion.onSet"
                        </script>
			<script>
						scene.PlaySE("se_metdrop.mp3");
							this.dropmotion.duration=500;
                                this.obj.doMotion(this.dropmotion);
                                "dropmotion.onDone"
                        </script>
			<script>
								if( this.ondrop != null)
									this.ondrop();
                                true;
                        </script>
		</sequencer>
	</group>
	<group _name="ceBoxGranula" _class="ceGranula">
		<script>
                        this.resPath = "rmeq:granulaNa\\";
                        this.moveTo(1, 0);
                </script>
		<object _name="obj" src="rmeq:granulaNa\Model\mesh.cfg" enabled="true">
			<motion _name="mtSet1" src="rmeq:granulaNa\locations\mtSet1.caf"/>
			<motion _name="mtSet2" src="rmeq:granulaNa\locations\mtSet2.caf"/>
			<motion _name="mtSet3" src="rmeq:granulaNa\locations\mtSet3.caf"/>
		</object>
	</group>

	<group _name="ceMgGranula" _class="ceGranula">
		<script>
			this.resPath = "rmeq:granulaMg\\";
			this.moveTo(1, 0);
		</script>
		<object _name="obj" src="rmeq:granulaMg\Model\mesh.cfg" enabled="true">
			<motion _name="mtSet1" src="rmeq:granulaMg\locations\mtSet1.caf"/>
		</object>
	</group>

	<group _name="ceGranulaP" _class="ceGranula">
		<script>
                        this.resPath = "rmeq:granulaP\\";
                        this.moveTo(1, 0);
                </script>
		<object _name="obj" src="rmeq:granulaP\Model\mesh.cfg" enabled="true">
			<motion _name="mtSet1" src="rmeq:granulaP\locations\mtSet1.caf"/>
			<motion _name="mtSet2" src="rmeq:granulaP\locations\mtSet2.caf"/>
		</object>
	</group>
	<!--
Powder - порошок на шпателе
-->
	<group _name="cePowder" _class="ceGranula">
		<script>
                        this.type = "powder";
                        this.resPath = "rmeq:powder\\";
                        this.drop_func = null;
                        this.drop_subst = null;
                        this.drop_obj = null;
                        this.ratio = 1;
	               </script>
		<object _name="obj" src="rmeq:powder\Model\mesh.cfg" enabled="true"/>
		<script>
			this.startScale=1;
			function setType(tp)
			{
					this.type = tp;
					this.obj.materials.__0.maps.diffuse.src = this.resPath + "\\maps\\"+tp+".png";
			}

			function drop(drop_func,drop_subst,drop_obj)
			{
				this.drop_obj = drop_obj;
				this.drop_subst = drop_subst;
				this.drop_func = drop_func;
				this.seqDropPowder.rewindAndPlay();
			}

			function ondrop()
			{
//				trace("---ondrop POWDER---");
				if( this.drop_func != null)
					this.drop_func();
				scene.objects.powder = null;
			}
		</script>
		<sequencer _name="seqDropPowder">
			<script>
				this.startScale = this.obj._scale.y;
				this.powCounter = 0;
				if( this.drop_obj.obj.substmap == "")
					this.drop_obj.obj.substmap = "rmeq:subst\\" + this.drop_subst + ".png";
				this.drop_obj.obj.asubst = 255;
			</script>
			<script>
					this.obj._scale.y = this.startScale*(1 - this.powCounter/4);
					this.drop_obj.obj.substlevel += 5*this.ratio;
					this.powCounter++;
				</script>
			<script>
					20;
			</script>
			<script><![CDATA[
					if( this.powCounter < 5)
						this.seqDropPowder.currentFrame = 1;
					else
					{
						this.obj._visible = false;
						scene.PlaySE("se_probpor.mp3");
						this.ondrop();
					}
				]]></script>
		</sequencer>
	</group>
	<!--    Term    -->
	<group _name="ceTerm" _class="ceBaseEquip">
		<script>
                        this.resPath = "rmeq:term\\";
                </script>
		<object _name="obj" src="rmeq:term\Model\mesh.cfg" enabled="true">
		</object>
	</group>
	<!--    Podstavka       -->
	<group _name="cePodstavka" _class="ceBaseEquip">
		<script>
                        this.resPath = "rmeq:podstavka\\";
                </script>
		<object _name="obj" src="eval(ENVRPATH + 'podstavka\\Model\\mesh.cfg')" enabled="false">
		</object>
		<script>
			moveTo(1,0);
		</script>
	</group>

	<group _name="ceEqTreug" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:tkolba\\";
						this.moveTo(1, 0);
                </script>
		<object _name="obj" src="rmeq:tkolba\Model\mesh.cfg" enabled="false">
		</object>
	</group>
	<group _name="ceTreug" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:treugkolba\\";
						this.moveTo(1, 0);
						function objOnPress()
						{
							ceBaseGlassEquip_objOnPress();
						}
                </script>
		<object _name="obj" src="rmeq:treugkolba\Model\mesh.cfg" enabled="false">
		</object>
	</group>
	<group _name="ceEqKapel" _class="ceBaseGlassEquip">
		<script>
			this.resPath = "rmeq:virts\\";
			this.moveTo(1, 0);
		</script>
		<object _name="obj" src="rmeq:virts\Model\mesh.cfg" enabled="false">
		</object>
	</group>
	<group _name="ceKapel" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:kapel\\";
						this.moveTo(1, 0);
                </script>
		<object _name="obj" src="rmeq:kapel\Model\mesh.cfg" enabled="false">
		</object>
	</group>
	<!--Derjatel-->
	<group _name="ceDerjatel" _class="ceBaseEquip">
		<script>
                        this.resPath = "rmeq:derjatel\\";
                </script>
		<object _name="obj" src="rmeq:derjatel\Model\mesh.cfg" enabled="false">
                </object>
	</group>
	<!-- pliers -->
	<group _name="cePliers" _class="ceBaseEquip">
		<script>
                        this.resPath = "rmeq:pincers\\";
                        this.moveTo(1, 0);
                </script>
		<object _name="obj" src="rmeq:pincers\Model\mesh.cfg" enabled="false"/>
	</group>
	<!-- u Tube -->
	<group _name="ceUTube" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:Utube\\";
                </script>
		<object _name="obj" src="rmeq:Utube\Model\mesh.cfg" enabled="true"/>
	</group>
	<!-- trubka & krishka-->
	<group _name="cePIP" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:pip\\";
                        this.moveTo(1, 0);
                </script>
		<object _name="obj" src="rmeq:pip\Model\mesh.cfg" enabled="true"/>
	</group>
	<!-- Kolba-->
	<group _name="ceKolba" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:kolba\\kbulb\\";
                        this.moveTo(1, 0);
                </script>
		<object _name="obj" src="rmeq:kolba\kbulb\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceKolbaCover" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:kolba\\kcover\\";
                        this.moveTo(1, 0);
                </script>
		<object _name="obj" src="rmeq:kolba\kcover\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceRKolba" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:rkolba\\";
                        this.moveTo(1, 0);
                </script>
		<object _name="obj" src="rmeq:rkolba\Model\mesh.cfg" enabled="true"/>
		<script>
					  function objOnPress()
					   {
							ceBaseGlassEquip_objOnPress();
					  }
                </script>
	</group>
	<group _name="ceRTrubka" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:rtrubka\\";
                </script>
		<object _name="obj" src="rmeq:rtrubka\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceMernTube" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:merntube\\";
                        this.moveTo(11, 0);
                </script>
		<object _name="obj" src="rmeq:merntube\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="cePBowl" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:pbowl\\";
       </script>
		<object _name="obj" src="rmeq:pbowl\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceCup" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:cup\\";
       </script>
		<object _name="obj" src="rmeq:cup\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceTKapel" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:tkapel\\";
       </script>
		<object _name="obj" src="rmeq:tkapel\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceVoronka" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:Voronka\\";
       </script>
		<object _name="obj" src="rmeq:Voronka\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceKolbaVirts" _class="ceBaseGlassEquip">
		<script>
			this.opened = false;
            this.resPath = "rmeq:KolbaVirts\\";
       </script>
		<object _name="obj" src="rmeq:KolbaVirts\Model\mesh.cfg" enabled="true">
			<motion _name="mtOpen" src="rmeq:KolbaVirts\locations\open.caf"/>
			<motion _name="mtClose" src="rmeq:KolbaVirts\locations\close.caf"/>
			<script>
				this.setMotion(this.mtClose);
			</script>
		</object>
		<script>
			function open()
			{
				if( opened)	{ trace("Key already opened"); return;}
				opened=true;
				obj.doMotion(obj.mtOpen);
			}
			function close()
			{
				if( !opened)	{ trace("Key already closed"); return;}
				opened=false;
				obj.doMotion(obj.mtClose);
			}
		</script>
	</group>
	<group _name="ceProbWP" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:ProbWithPip\\";
       </script>
		<object _name="obj" src="rmeq:ProbWithPip\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceBigBowl" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:BigBowl\\";
       </script>
		<object _name="obj" src="rmeq:BigBowl\Model\mesh.cfg" enabled="true"/>
	</group>	<group _name="ceRound" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:round\\";
       </script>
		<object _name="obj" src="rmeq:round\Model\mesh.cfg" enabled="true"/>
	</group>	<group _name="ceSTrubka" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:STrubka\\";
       </script>
		<object _name="obj" src="rmeq:STrubka\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceStupka" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:Stupka\\";
       </script>
		<object _name="obj" src="rmeq:Stupka\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="cePestik" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:Pestik\\";
       </script>
		<object _name="obj" src="rmeq:Pestik\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceSpirtovka">
		<group _name="sbulb" _class="ceBaseGlassEquip">
			<script>
				this.resPath = "rmeq:Spirtovka\\sbulb\\";
				function objOnPress()
				{
						if(parent.objOnPress != undefined)
								parent.objOnPress();
				}
		   </script>
			<object _name="obj" src="rmeq:Spirtovka\sbulb\Model\mesh.cfg" enabled="true"/>
		</group>
		<group _name="scover" _class="ceBaseGlassEquip">
			<script>
				this.resPath = "rmeq:Spirtovka\\scover\\";
				function objOnPress()
				{
						if(parent.objOnPress != undefined)
								parent.objOnPress();
				}
		   </script>
			<object _name="obj" src="rmeq:Spirtovka\scover\Model\mesh.cfg" enabled="true"/>

		</group>
	</group>
			<group _name="cCylStand" _class="ceBaseGlassEquip">
			<script>
				this.resPath = "rmeq:cylinder\\cstand\\";
		   </script>
			<object _name="obj" src="rmeq:cylinder\cstand\model\mesh.cfg" enabled="true"/>
		</group>

	<group _name="ceMernCylinder" _class="ceBaseGlassEquip">
			<script>
				this.resPath = "rmeq:cylinder\\";
		   </script>
			<object _name="obj" src="rmeq:cylinder\model2\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceCylinder" _class="ceBaseGlassEquip">
			<script>
				this.resPath = "rmeq:cylinder\\";
		   </script>
			<object _name="obj" src="rmeq:cylinder\model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceSpoon" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:spoon\\";
       </script>
		<object _name="obj" src="rmeq:spoon\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceSpiral" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:spiral\\";
       </script>
		<object _name="obj" src="rmeq:spiral\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceStakCov" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:stakcov\\";
       </script>
		<object _name="obj" src="rmeq:stakcov\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceGlassPlane" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:glassplane\\";
       </script>
		<object _name="obj" src="rmeq:glassplane\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceGlassPlaneSmall" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:glassplanesmall\\";
       </script>
		<object _name="obj" src="rmeq:glassplanesmall\Model\mesh.cfg" enabled="true"/>
	</group>
	<group _name="ceTigel" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:tigel\\";
       </script>
		<object _name="obj" src="rmeq:tigel\Model\mesh.cfg" enabled="true"/>
	</group>
		<group _name="ceAreometr" _class="ceBaseGlassEquip">
		<script>
            this.resPath = "rmeq:areom\\";
       </script>
		<object _name="obj" src="rmeq:areom\model\mesh.cfg" enabled="true"/>
	</group>

	<group _name="cePointStick" _class="ceBaseGlassEquip">
		<script>
                        this.resPath = "rmeq:pointstick\\";
                </script>
		<object _name="obj" src="rmeq:pointstick\model\mesh.cfg" enabled="true">
			<!--motion _name="MixInGlass" src="rmeq:pointstick\locations\mtMix.caf" duration="3000"/-->
		</object>
	</group>

	<group _name="ceKippa">
		<group _name="top" _class="ceBaseGlassEquip">
			<script>
				this.resPath = "rmeq:Kippa\\top\\";
		   </script>
			<object _name="obj" src="rmeq:Kippa\top\Model\mesh.cfg" enabled="true"/>
		</group>
		<group _name="middle" _class="ceBaseGlassEquip">
			<script>
				this.resPath = "rmeq:Kippa\\middle\\";
		   </script>
			<object _name="obj" src="rmeq:Kippa\middle\Model\mesh.cfg" enabled="true"/>
		</group>
		<group _name="bottom" _class="ceBaseGlassEquip">
			<script>
				this.resPath = "rmeq:Kippa\\bottom\\";
		   </script>
			<object _name="obj" src="rmeq:Kippa\bottom\Model\mesh.cfg" enabled="true"/>
		</group>
	</group>
	<group _name="ceMernKolba" _class="ceBaseGlassEquip">
		<group name="kolba" class="ceBaseGlassEquip" >
			<script>
				this.resPath = "rmeq:MernKolba\\kolba\\";
			</script>
			<object _name="obj" src="rmeq:MernKolba\kolba\model\mesh.cfg" enabled="true">
				<motion _name="mtShake" src="rmeq:MernKolba\kolba\locations\mtshake.caf"/>
			</object>
			<script>
				function objOnPress()
				{
					if( parent.objOnPress() != undefined)
						parent.objOnPress();
				}
				function pShake()
				{
					obj.doMotion(obj.mtShake);
				}
			</script>
		</group>
		<group name="cover" class="ceBaseGlassEquip" >
			<script>
				this.resPath = "rmeq:MernKolba\\cover\\";
			</script>
			<object _name="obj" src="rmeq:MernKolba\cover\model\mesh.cfg" enabled="true"/>
			<script>
				function objOnPress()
				{
					if( parent.objOnPress() != undefined)
						parent.objOnPress();
				}
			</script>
		</group>
	</group>
	<group _name="ceMernKolbaBig" _class="ceBaseGlassEquip">
		<group name="kolba" class="ceBaseGlassEquip" >
			<script>
				this.resPath = "rmeq:MernKolbaBig\\kolba\\";
			</script>
			<object _name="obj" src="rmeq:MernKolbaBig\kolba\model\mesh.cfg" enabled="true">
				<motion _name="mtShake" src="rmeq:MernKolbaBig\kolba\locations\mtshake.caf"/>
			</object>
			<script>
				function objOnPress()
				{
					if( parent.objOnPress() != undefined)
						parent.objOnPress();
				}
				function pShake()
				{
					obj.doMotion(obj.mtShake);
				}
			</script>
		</group>
		<group name="cover" class="ceBaseGlassEquip" >
			<script>
				this.resPath = "rmeq:MernKolbaBig\\cover\\";
			</script>
			<object _name="obj" src="rmeq:MernKolbaBig\cover\model\mesh.cfg" enabled="true"/>
			<script>
				function objOnPress()
				{
					if( parent.objOnPress() != undefined)
						parent.objOnPress();
				}
			</script>
		</group>
	</group>

	<group _name="cePaper" class="ceBaseEquip">
			<script src="eqhelp.mjs"/>
			<script>
                this.resPath = "rmeq:jar\\jbulb\\";
            </script>
			<object _name="obj" src="rmeq:jar\jbulb\model\mesh.cfg" enabled="true"/>
	</group>
</rmml>
<!---->