home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Demo / elearn / Fizica / lib / lib_interf.swf / scripts / frame_1 / DoAction.as
Text File  |  2004-05-12  |  119KB  |  4,658 lines

  1. MovieClip.prototype.dashTo = function(startx, starty, endx, endy, len, gap)
  2. {
  3.    if(arguments.length < 6)
  4.    {
  5.       return false;
  6.    }
  7.    var seglength;
  8.    var deltax;
  9.    var deltay;
  10.    var segs;
  11.    var cx;
  12.    var cy;
  13.    seglength = len + gap;
  14.    deltax = endx - startx;
  15.    deltay = endy - starty;
  16.    delta = Math.sqrt(deltax * deltax + deltay * deltay);
  17.    segs = Math.floor(Math.abs(delta / seglength));
  18.    radians = Math.atan2(deltay,deltax);
  19.    cx = startx;
  20.    cy = starty;
  21.    deltax = Math.cos(radians) * seglength;
  22.    deltay = Math.sin(radians) * seglength;
  23.    var n = 0;
  24.    while(n < segs)
  25.    {
  26.       this.moveTo(cx,cy);
  27.       this.lineTo(cx + Math.cos(radians) * len,cy + Math.sin(radians) * len);
  28.       cx += deltax;
  29.       cy += deltay;
  30.       n++;
  31.    }
  32.    this.moveTo(cx,cy);
  33.    delta = Math.sqrt((endx - cx) * (endx - cx) + (endy - cy) * (endy - cy));
  34.    if(delta > len)
  35.    {
  36.       this.lineTo(cx + Math.cos(radians) * len,cy + Math.sin(radians) * len);
  37.    }
  38.    else if(delta > 0)
  39.    {
  40.       this.lineTo(cx + Math.cos(radians) * delta,cy + Math.sin(radians) * delta);
  41.    }
  42.    this.moveTo(endx,endy);
  43. };
  44. MovieClip.prototype.drawArc = function(x, y, radius, arc, startAngle, yRadius)
  45. {
  46.    if(arguments.length < 5)
  47.    {
  48.       return undefined;
  49.    }
  50.    if(yRadius == undefined)
  51.    {
  52.       yRadius = radius;
  53.    }
  54.    var segAngle;
  55.    var theta;
  56.    var angle;
  57.    var angleMid;
  58.    var segs;
  59.    var ax;
  60.    var ay;
  61.    var bx;
  62.    var by;
  63.    var cx;
  64.    var cy;
  65.    arc = 360;
  66.    segs = Math.ceil(Math.abs(arc) / 45);
  67.    segAngle = arc / segs;
  68.    theta = (- segAngle / 180) * 3.141592653589793;
  69.    angle = 90;
  70.    ax = x - Math.cos(angle) * radius;
  71.    ay = y - Math.sin(angle) * yRadius;
  72.    if(segs > 0)
  73.    {
  74.       var i = 0;
  75.       while(i < segs)
  76.       {
  77.          angle += theta;
  78.          angleMid = angle - theta / 2;
  79.          bx = ax + Math.cos(angle) * radius;
  80.          by = ay + Math.sin(angle) * yRadius;
  81.          cx = ax + Math.cos(angleMid) * (radius / Math.cos(theta / 2));
  82.          cy = ay + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));
  83.          this.curveTo(cx,cy,bx,by);
  84.          i++;
  85.       }
  86.    }
  87.    return {x:bx,y:by};
  88. };
  89. MovieClip.prototype.drawBurst = function(x, y, sides, innerRadius, outerRadius, angle)
  90. {
  91.    if(arguments < 5)
  92.    {
  93.       return undefined;
  94.    }
  95.    if(sides > 2)
  96.    {
  97.       var step;
  98.       var halfStep;
  99.       var qtrStep;
  100.       var start;
  101.       var n;
  102.       var dx;
  103.       var dy;
  104.       var cx;
  105.       var cy;
  106.       step = 6.283185307179586 / sides;
  107.       halfStep = step / 2;
  108.       qtrStep = step / 4;
  109.       start = angle / 180 * 3.141592653589793;
  110.       this.moveTo(x + Math.cos(start) * outerRadius,y - Math.sin(start) * outerRadius);
  111.       n = 1;
  112.       while(n <= sides)
  113.       {
  114.          cx = x + Math.cos(start + step * n - qtrStep * 3) * (innerRadius / Math.cos(qtrStep));
  115.          cy = y - Math.sin(start + step * n - qtrStep * 3) * (innerRadius / Math.cos(qtrStep));
  116.          dx = x + Math.cos(start + step * n - halfStep) * innerRadius;
  117.          dy = y - Math.sin(start + step * n - halfStep) * innerRadius;
  118.          this.curveTo(cx,cy,dx,dy);
  119.          cx = x + Math.cos(start + step * n - qtrStep) * (innerRadius / Math.cos(qtrStep));
  120.          cy = y - Math.sin(start + step * n - qtrStep) * (innerRadius / Math.cos(qtrStep));
  121.          dx = x + Math.cos(start + step * n) * outerRadius;
  122.          dy = y - Math.sin(start + step * n) * outerRadius;
  123.          this.curveTo(cx,cy,dx,dy);
  124.          n++;
  125.       }
  126.    }
  127. };
  128. MovieClip.prototype.drawGear = function(x, y, sides, innerRadius, outerRadius, angle, holeSides, holeRadius)
  129. {
  130.    if(arguments < 5)
  131.    {
  132.       return undefined;
  133.    }
  134.    if(sides > 2)
  135.    {
  136.       var step;
  137.       var qtrStep;
  138.       var start;
  139.       var n;
  140.       var dx;
  141.       var dy;
  142.       step = 6.283185307179586 / sides;
  143.       qtrStep = step / 4;
  144.       start = angle / 180 * 3.141592653589793;
  145.       this.moveTo(x + Math.cos(start) * outerRadius,y - Math.sin(start) * outerRadius);
  146.       n = 1;
  147.       while(n <= sides)
  148.       {
  149.          dx = x + Math.cos(start + step * n - qtrStep * 3) * innerRadius;
  150.          dy = y - Math.sin(start + step * n - qtrStep * 3) * innerRadius;
  151.          this.lineTo(dx,dy);
  152.          dx = x + Math.cos(start + step * n - qtrStep * 2) * innerRadius;
  153.          dy = y - Math.sin(start + step * n - qtrStep * 2) * innerRadius;
  154.          this.lineTo(dx,dy);
  155.          dx = x + Math.cos(start + step * n - qtrStep) * outerRadius;
  156.          dy = y - Math.sin(start + step * n - qtrStep) * outerRadius;
  157.          this.lineTo(dx,dy);
  158.          dx = x + Math.cos(start + step * n) * outerRadius;
  159.          dy = y - Math.sin(start + step * n) * outerRadius;
  160.          this.lineTo(dx,dy);
  161.          n++;
  162.       }
  163.       if(holeSides > 2)
  164.       {
  165.          if(holeRadius == undefined)
  166.          {
  167.             holeRadius = innerRadius / 3;
  168.          }
  169.          step = 6.283185307179586 / holeSides;
  170.          this.moveTo(x + Math.cos(start) * holeRadius,y - Math.sin(start) * holeRadius);
  171.          n = 1;
  172.          while(n <= holeSides)
  173.          {
  174.             dx = x + Math.cos(start + step * n) * holeRadius;
  175.             dy = y - Math.sin(start + step * n) * holeRadius;
  176.             this.lineTo(dx,dy);
  177.             n++;
  178.          }
  179.       }
  180.    }
  181. };
  182. MovieClip.prototype.drawOval = function(x, y, radius, yRadius)
  183. {
  184.    if(arguments.length < 3)
  185.    {
  186.       return undefined;
  187.    }
  188.    var theta;
  189.    var xrCtrl;
  190.    var yrCtrl;
  191.    var angle;
  192.    var angleMid;
  193.    var px;
  194.    var py;
  195.    var cx;
  196.    var cy;
  197.    if(yRadius == undefined)
  198.    {
  199.       yRadius = radius;
  200.    }
  201.    theta = 0.7853981633974483;
  202.    xrCtrl = radius / Math.cos(theta / 2);
  203.    yrCtrl = yRadius / Math.cos(theta / 2);
  204.    angle = 0;
  205.    this.moveTo(x + radius,y);
  206.    var i = 0;
  207.    while(i < 8)
  208.    {
  209.       angle += theta;
  210.       angleMid = angle - theta / 2;
  211.       cx = x + Math.cos(angleMid) * xrCtrl;
  212.       cy = y + Math.sin(angleMid) * yrCtrl;
  213.       px = x + Math.cos(angle) * radius;
  214.       py = y + Math.sin(angle) * yRadius;
  215.       this.curveTo(cx,cy,px,py);
  216.       i++;
  217.    }
  218. };
  219. MovieClip.prototype.drawPoly = function(x, y, sides, radius, angle)
  220. {
  221.    if(arguments.length < 4)
  222.    {
  223.       return undefined;
  224.    }
  225.    var count = Math.abs(sides);
  226.    if(count > 2)
  227.    {
  228.       var step;
  229.       var start;
  230.       var n;
  231.       var dx;
  232.       var dy;
  233.       step = 6.283185307179586 / sides;
  234.       start = angle / 180 * 3.141592653589793;
  235.       this.moveTo(x + Math.cos(start) * radius,y - Math.sin(start) * radius);
  236.       n = 1;
  237.       while(n <= count)
  238.       {
  239.          dx = x + Math.cos(start + step * n) * radius;
  240.          dy = y - Math.sin(start + step * n) * radius;
  241.          this.lineTo(dx,dy);
  242.          n++;
  243.       }
  244.    }
  245. };
  246. MovieClip.prototype.drawRect = function(x, y, w, h, cornerRadius)
  247. {
  248.    if(arguments.length < 4)
  249.    {
  250.       return undefined;
  251.    }
  252.    if(cornerRadius > 0)
  253.    {
  254.       var theta;
  255.       var angle;
  256.       var cx;
  257.       var cy;
  258.       var px;
  259.       var py;
  260.       if(cornerRadius > Math.min(w,h) / 2)
  261.       {
  262.          cornerRadius = Math.min(w,h) / 2;
  263.       }
  264.       theta = 0.7853981633974483;
  265.       this.moveTo(x + cornerRadius,y);
  266.       this.lineTo(x + w - cornerRadius,y);
  267.       angle = -1.5707963267948966;
  268.       cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  269.       cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  270.       px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
  271.       py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
  272.       this.curveTo(cx,cy,px,py);
  273.       angle += theta;
  274.       cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  275.       cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  276.       px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
  277.       py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
  278.       this.curveTo(cx,cy,px,py);
  279.       this.lineTo(x + w,y + h - cornerRadius);
  280.       angle += theta;
  281.       cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  282.       cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  283.       px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
  284.       py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
  285.       this.curveTo(cx,cy,px,py);
  286.       angle += theta;
  287.       cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  288.       cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  289.       px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
  290.       py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
  291.       this.curveTo(cx,cy,px,py);
  292.       this.lineTo(x + cornerRadius,y + h);
  293.       angle += theta;
  294.       cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  295.       cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  296.       px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
  297.       py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
  298.       this.curveTo(cx,cy,px,py);
  299.       angle += theta;
  300.       cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  301.       cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  302.       px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
  303.       py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
  304.       this.curveTo(cx,cy,px,py);
  305.       this.lineTo(x,y + cornerRadius);
  306.       angle += theta;
  307.       cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  308.       cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  309.       px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
  310.       py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
  311.       this.curveTo(cx,cy,px,py);
  312.       angle += theta;
  313.       cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  314.       cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
  315.       px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
  316.       py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
  317.       this.curveTo(cx,cy,px,py);
  318.    }
  319.    else
  320.    {
  321.       this.moveTo(x,y);
  322.       this.lineTo(x + w,y);
  323.       this.lineTo(x + w,y + h);
  324.       this.lineTo(x,y + h);
  325.       this.lineTo(x,y);
  326.    }
  327. };
  328. MovieClip.prototype.drawStar = function(x, y, points, innerRadius, outerRadius, angle)
  329. {
  330.    if(arguments.length < 5)
  331.    {
  332.       return undefined;
  333.    }
  334.    var count = Math.abs(points);
  335.    if(count > 2)
  336.    {
  337.       var step;
  338.       var halfStep;
  339.       var start;
  340.       var n;
  341.       var dx;
  342.       var dy;
  343.       step = 6.283185307179586 / points;
  344.       halfStep = step / 2;
  345.       start = angle / 180 * 3.141592653589793;
  346.       this.moveTo(x + Math.cos(start) * outerRadius,y - Math.sin(start) * outerRadius);
  347.       n = 1;
  348.       while(n <= count)
  349.       {
  350.          dx = x + Math.cos(start + step * n - halfStep) * innerRadius;
  351.          dy = y - Math.sin(start + step * n - halfStep) * innerRadius;
  352.          this.lineTo(dx,dy);
  353.          dx = x + Math.cos(start + step * n) * outerRadius;
  354.          dy = y - Math.sin(start + step * n) * outerRadius;
  355.          this.lineTo(dx,dy);
  356.          n++;
  357.       }
  358.    }
  359. };
  360. MovieClip.prototype.drawWedge = function(x, y, startAngle, arc, radius, yRadius)
  361. {
  362.    if(arguments.length < 5)
  363.    {
  364.       return undefined;
  365.    }
  366.    this.moveTo(x,y);
  367.    if(yRadius == undefined)
  368.    {
  369.       yRadius = radius;
  370.    }
  371.    var segAngle;
  372.    var theta;
  373.    var angle;
  374.    var angleMid;
  375.    var segs;
  376.    var ax;
  377.    var ay;
  378.    var bx;
  379.    var by;
  380.    var cx;
  381.    var cy;
  382.    if(Math.abs(arc) > 360)
  383.    {
  384.       arc = 360;
  385.    }
  386.    segs = Math.ceil(Math.abs(arc) / 45);
  387.    segAngle = arc / segs;
  388.    theta = (- segAngle / 180) * 3.141592653589793;
  389.    angle = (- startAngle / 180) * 3.141592653589793;
  390.    if(segs > 0)
  391.    {
  392.       ax = x + Math.cos(startAngle / 180 * 3.141592653589793) * radius;
  393.       ay = y + Math.sin((- startAngle) / 180 * 3.141592653589793) * yRadius;
  394.       this.lineTo(ax,ay);
  395.       var i = 0;
  396.       while(i < segs)
  397.       {
  398.          angle += theta;
  399.          angleMid = angle - theta / 2;
  400.          bx = x + Math.cos(angle) * radius;
  401.          by = y + Math.sin(angle) * yRadius;
  402.          cx = x + Math.cos(angleMid) * (radius / Math.cos(theta / 2));
  403.          cy = y + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));
  404.          this.curveTo(cx,cy,bx,by);
  405.          i++;
  406.       }
  407.       this.lineTo(x,y);
  408.    }
  409. };
  410. MovieClip.prototype.arc = function(centerX, centerY, radius, startAngle, endAngle, radiusY, connectToLastPoint)
  411. {
  412.    if(arguments.length < 5 || startAngle == endAngle)
  413.    {
  414.       return undefined;
  415.    }
  416.    if(null == radiusY)
  417.    {
  418.       radiusY = radius;
  419.    }
  420.    if(null == connectToCenter)
  421.    {
  422.       connectToCenter = false;
  423.    }
  424.    var yRatio = radiusY / radius;
  425.    var counterClockwise = startAngle > endAngle || endAngle == 360;
  426.    startAngle -= 360 * Math.floor(startAngle / 360);
  427.    if(startAngle < 0)
  428.    {
  429.       startAngle = 360 - startAngle;
  430.    }
  431.    endAngle -= 360 * Math.floor(endAngle / 360);
  432.    if(endAngle < 0)
  433.    {
  434.       endAngle = 360 - endAngle;
  435.    }
  436.    if(counterclockWise && startAngle >= endAngle || startAngle == endAngle)
  437.    {
  438.       endAngle += 360;
  439.    }
  440.    startAngle = 3.141592653589793 * startAngle / 180;
  441.    endAngle = 3.141592653589793 * endAngle / 180;
  442.    var deltaPhi = (endAngle - startAngle) / 8;
  443.    var nax = Math.cos(startAngle);
  444.    var nay = Math.sin(startAngle);
  445.    var xa = nax * radius;
  446.    var ya = nay * radius;
  447.    if(connectToLastPoint)
  448.    {
  449.       this.lineTo(centerX + xa,centerY + yRatio * ya);
  450.    }
  451.    else
  452.    {
  453.       this.moveTo(centerX + xa,centerY + yRatio * ya);
  454.    }
  455.    var i = 1;
  456.    while(i <= 8)
  457.    {
  458.       var nextAngle = startAngle + i * deltaPhi;
  459.       var nbx = Math.cos(nextAngle);
  460.       var nby = Math.sin(nextAngle);
  461.       var xb = radius * nbx;
  462.       var yb = radius * nby;
  463.       var det = nay * nbx - nax * nby;
  464.       var tau1 = ((xa - xb) * nbx + (ya - yb) * nby) / det;
  465.       var tau2 = ((xb - xa) * nax - (ya - yb) * nay) / det;
  466.       var xc = ((- nay) * tau1 + xa + nby * tau2 + xb) / 2;
  467.       var yc = (nax * tau1 + ya - nbx * tau2 + yb) / 2;
  468.       this.curveTo(centerX + xc,centerY + yRatio * yc,centerX + xb,centerY + yRatio * yb);
  469.       xa = xb;
  470.       ya = yb;
  471.       nax = nbx;
  472.       nay = nby;
  473.       i++;
  474.    }
  475.    xa += centerX;
  476.    ya += centerY;
  477. };
  478. if(typeof Object.debug == "undefined")
  479. {
  480.    Object.debug = function(m)
  481.    {
  482.       trace(m + " [time:" + getTimer() + "]");
  483.    };
  484. }
  485. if(typeof Object.lista == "undefined")
  486. {
  487.    Object.lista = function(m)
  488.    {
  489.       if(m == undefined)
  490.       {
  491.          trace("Your object is undefined");
  492.       }
  493.       else
  494.       {
  495.          trace("*************LISTA*******************\n" + m + " [time:" + getTimer() + "] \n--------------------------------------");
  496.          trace("object " + typeof m + " contains:");
  497.          for(var j in m)
  498.          {
  499.             trace(j + "= " + m[j]);
  500.          }
  501.       }
  502.       trace("***************END*****************");
  503.    };
  504. }
  505. Function.prototype["extends"] = function(superCls)
  506. {
  507.    this.prototype.__proto__ = superCls.prototype;
  508.    this.prototype.__constructor__ = superCls;
  509.    ASSetPropFlags(this.prototype,["__constructor__"],1);
  510. };
  511. Function.prototype["implements"] = function(superCls)
  512. {
  513.    Object.debug(">> Object.implements() called; sub, super: " + [this,superCls]);
  514.    var sb = this.prototype;
  515.    var sp = superCls.prototype;
  516.    for(var i in sp)
  517.    {
  518.       sb[i] = sp[i];
  519.    }
  520. };
  521. Object.Exe = function(funct, interval, cine, p2, p3, p4)
  522. {
  523.    this.proces = setInterval(funct,interval,cine,p2,p3,p4);
  524. };
  525. Object.Exe.prototype.kill = function(cine)
  526. {
  527.    var cine = cine || this.proces;
  528.    clearInterval(cine);
  529.    delete this;
  530. };
  531. MovieClip.prototype.createMc = function(n, x, y)
  532. {
  533.    var depth = this.nextDepth();
  534.    this.createEmptyMovieclip(n,depth);
  535.    var nc = this[n];
  536.    x == undefined ? 0 : (nc._x = x);
  537.    y == undefined ? 0 : (nc._y = y);
  538.    return nc;
  539. };
  540. MovieClip.prototype.isPlaying = function()
  541. {
  542.    if(this._previousframe == undefined)
  543.    {
  544.       this._previousframe = this._currentframe;
  545.    }
  546.    if(this._previousframe == this._currentframe)
  547.    {
  548.       var playing = false;
  549.    }
  550.    else
  551.    {
  552.       playing = true;
  553.    }
  554.    this._previousframe = this._currentframe;
  555.    return playing;
  556. };
  557. MovieClip.prototype.attachMc = function(id, n, x, y)
  558. {
  559.    var depth = this.nextDepth();
  560.    this.attachMovie(id,n,depth);
  561.    var nc = this[n];
  562.    if(x != undefined)
  563.    {
  564.       nc._x = x;
  565.    }
  566.    if(y != undefined)
  567.    {
  568.       nc._y = y;
  569.    }
  570.    return nc;
  571. };
  572. MovieClip.prototype.attachCmp = function(symbolID, name, ┬ºclass┬º, x, y, args)
  573. {
  574.    var nc = this.attachMc(symbolID,name,x,y);
  575.    nc.transform(eval("class"),args);
  576.    return nc;
  577. };
  578. MovieClip.prototype.transform = function(cls, args)
  579. {
  580.    if(typeof cls == "function")
  581.    {
  582.       this.__proto__ = cls.prototype;
  583.       this.tmp = cls;
  584.       this.tmp(args);
  585.       delete this.tmp;
  586.    }
  587.    else
  588.    {
  589.       trace("tansform: Incorrect superClass type or path - " + typeof cls);
  590.    }
  591. };
  592. MovieClip.prototype.mcImplements = function(superCls)
  593. {
  594.    var sb = this;
  595.    var sp = superCls.prototype;
  596.    for(var i in sp)
  597.    {
  598.       sb[i] = sp[i];
  599.    }
  600. };
  601. MovieClip.prototype.copyMc = function(n)
  602. {
  603.    var depth = this.nextDepth();
  604.    var str = String(this);
  605.    var newName = "copy_of_" + str.substring(str.lastIndexOf(".") + 1,str.length) + depth;
  606.    delete str;
  607.    return this.duplicateMovieClip(newName,depth);
  608. };
  609. MovieClip.prototype.attachEvent = function(eventName, myFunction)
  610. {
  611.    this[eventName] = function()
  612.    {
  613.       myFunction(this);
  614.    };
  615. };
  616. MovieClip.prototype.clearMc = function()
  617. {
  618.    for(var i in this)
  619.    {
  620.       if(typeof this[i] == "movieclip")
  621.       {
  622.          this[i].removeMovieClip();
  623.       }
  624.    }
  625. };
  626. MovieClip.prototype.write = function(tx, x, y)
  627. {
  628.    this.createTextField("mytext",this.nextDepth(),x,y,this._width,30);
  629.    with(this)
  630.    {
  631.       mytext.autoSize = "left";
  632.       mytext.type = "dynamic";
  633.       mytext.html = true;
  634.       mytext.wordWrap = true;
  635.       mytext.selectable = false;
  636.       mytext.htmlText = tx;
  637.       mytext.embedFonts = true;
  638.    }
  639.    return this.mytext;
  640. };
  641. MovieClip.prototype.nextDepth = function()
  642. {
  643.    MovieClip.nextDepthCounter = MovieClip.nextDepthCounter + 1;
  644.    return MovieClip.nextDepthCounter;
  645. };
  646. ASSetPropFlags(MovieClip.prototype,null,1,1);
  647. var BO = Object.BaseObject = function(arg)
  648. {
  649.    this.nuanta = arg;
  650.    Object.__MainPlayControler__.registerBO(this);
  651.    this.addProperty("_bright",this.getBright,this.setBright);
  652. };
  653. BO.tip = "BaseObject";
  654. BO["extends"](MovieClip);
  655. var BOp = BO.prototype;
  656. BOp.setCursor = function(crs)
  657. {
  658.    this.$hasCursor = true;
  659.    this.$cursor = crs;
  660. };
  661. BOp.removeCursor = function()
  662. {
  663.    this.$hasCursor = false;
  664.    this.$cursor = null;
  665. };
  666. BOp.setLocation = function(x, y)
  667. {
  668.    var tx = this._x;
  669.    var ty = this._y;
  670.    if(x == undefined)
  671.    {
  672.       x = tx;
  673.    }
  674.    else
  675.    {
  676.       this._x = x;
  677.    }
  678.    if(y == undefined)
  679.    {
  680.       y = ty;
  681.    }
  682.    else
  683.    {
  684.       this._y = y;
  685.    }
  686. };
  687. BOp.setScale = function(x, y)
  688. {
  689.    var tx = _xscale;
  690.    var ty = _yscale;
  691.    if(x == undefined)
  692.    {
  693.       x = tx;
  694.    }
  695.    else
  696.    {
  697.       _xscale = x;
  698.    }
  699.    if(y == undefined)
  700.    {
  701.       y = ty;
  702.    }
  703.    else
  704.    {
  705.       _yscale = y;
  706.    }
  707.    if(tx != x || ty != y)
  708.    {
  709.       trace("modificat scala");
  710.    }
  711. };
  712. BOp.setDimensions = function(w, h)
  713. {
  714.    var tw = _width;
  715.    var th = _height;
  716.    if(w == undefined)
  717.    {
  718.       w = tw;
  719.    }
  720.    else
  721.    {
  722.       _width = w;
  723.    }
  724.    if(h == undefined)
  725.    {
  726.       h = th;
  727.    }
  728.    else
  729.    {
  730.       _height = h;
  731.    }
  732.    if(tw != w || th != h)
  733.    {
  734.       trace("modificat widt si/sau height");
  735.    }
  736. };
  737. BOp.setRotation = function(r)
  738. {
  739.    var tr = _rotation;
  740.    if(r == undefined)
  741.    {
  742.       r = tr;
  743.    }
  744.    else
  745.    {
  746.       _rotation = r;
  747.    }
  748.    if(tr != r)
  749.    {
  750.       trace("modificat rotatie");
  751.    }
  752. };
  753. BOp.setAlpha = function(a)
  754. {
  755.    var ta = _alpha;
  756.    if(a == undefined)
  757.    {
  758.       a = ta;
  759.    }
  760.    else
  761.    {
  762.       _alpha = a;
  763.    }
  764.    if(ta != a)
  765.    {
  766.       trace("modificat alpha");
  767.    }
  768. };
  769. BOp.msetRGB = function(c)
  770. {
  771.    var tc = this.getRGB();
  772.    if(c == undefined)
  773.    {
  774.       c = tc;
  775.    }
  776.    else
  777.    {
  778.       new Color(this).setRGB(c);
  779.    }
  780.    if(tc != c)
  781.    {
  782.    }
  783. };
  784. BOp.mgetRGB = function()
  785. {
  786.    return new Color(this).getRGB();
  787. };
  788. BOp.$remove = function()
  789. {
  790.    this.removeMovieClip();
  791. };
  792. BOp.setColor = function(r, g, b)
  793. {
  794.    if(this.mycolor == undefined)
  795.    {
  796.       this.mycolor = new Color(this);
  797.       this.clr = new Object();
  798.       this.clr.ra = 100;
  799.       this.clr.rb = 0;
  800.       this.clr.ga = 100;
  801.       this.clr.gb = 0;
  802.       this.clr.ba = 100;
  803.       this.clr.bb = 0;
  804.       this.clr.aa = this._alpha;
  805.       this.clr.ab = 100;
  806.    }
  807.    this.clr.rb = r;
  808.    this.clr.gb = g;
  809.    this.clr.bb = b;
  810.    this.mycolor.setTransform(this.clr);
  811. };
  812. BOp.getColor = function()
  813. {
  814.    return {r:this.clr.rb,g:this.clr.gb,b:this.clr.bb};
  815. };
  816. BOp.setBright = function(cat)
  817. {
  818.    if(this._bright == undefined)
  819.    {
  820.       this.actclr = this.getColor();
  821.    }
  822.    this._brightness = cat;
  823.    var br = this._brightness;
  824.    this.setColor(this.actclr.r + br,this.actclr.g + br,this.actclr.b + br);
  825. };
  826. BOp.getBright = function()
  827. {
  828.    return this._brightness;
  829. };
  830. BOp.Rectangle = function(n, x, y, wide, high, fillColor)
  831. {
  832.    this.createMc(n,x,y);
  833.    var u = this[n];
  834.    u.beginFill(fillColor || 6710886,100);
  835.    var x2 = 0 + wide;
  836.    var y2 = 0 + high;
  837.    u.moveTo(0,0);
  838.    u.lineTo(x2,0);
  839.    u.lineTo(x2,y2);
  840.    u.lineTo(0,y2);
  841.    u.lineTo(0,0);
  842.    u.endFill();
  843.    return u;
  844. };
  845. BOp.rec_outline = function(n, x, y, wide, high, lineColor, g)
  846. {
  847.    this.createMc(n,x,y);
  848.    var u = this[n];
  849.    var g = g || 1;
  850.    u.lineStyle(g,lineColor,50);
  851.    var x2 = 0 + wide;
  852.    var y2 = 0 + high;
  853.    u.moveTo(0,0);
  854.    u.lineTo(x2,0);
  855.    u.lineTo(x2,y2);
  856.    u.lineTo(0,y2);
  857.    u.lineTo(0,0);
  858.    u.endFill();
  859.    return u;
  860. };
  861. BOp.line = function(n, x1, y1, x2, y2, lineColor, gros)
  862. {
  863.    this.createMc(n,x1,y1);
  864.    var u = this[n];
  865.    var gros = gros || 1;
  866.    var lineColor = lineColor;
  867.    u.lineStyle(gros,lineColor,80);
  868.    u.moveTo(0,0);
  869.    u.lineTo(x2 - x1,y2 - y1);
  870.    return u;
  871. };
  872. BOp.loadImg = function(src, n, x, y, wide, high)
  873. {
  874.    this.createMc(n,x,y);
  875.    this[n]._alpha = 0;
  876.    this[n].loadMovie(src);
  877.    this.dfer = function()
  878.    {
  879.       if(this[n]._width != 0)
  880.       {
  881.          var wi = this[n]._width;
  882.          var hi = this[n]._height;
  883.          this[n]._width = wide || wi;
  884.          this[n]._height = high || hi;
  885.          this.inte.kill();
  886.          delete this.inte;
  887.          delete this.dfer;
  888.          this[n]._alpha = 100;
  889.          this.ev_LImg();
  890.       }
  891.    };
  892.    this.inte = new Object.Exe(this,"dfer",50);
  893.    return this[n];
  894. };
  895. BOp.interval = function(interval, actiune)
  896. {
  897.    var a;
  898.    var actiune = actiune;
  899.    var count = function(cine, interval, actiune)
  900.    {
  901.       a++;
  902.       if(a >= interval)
  903.       {
  904.          cine.interv.kill();
  905.          actiune();
  906.       }
  907.    };
  908.    this.count = count;
  909.    this.interv = new Object.Exe(this.count,1000,this,interval,actiune);
  910.    this.onUnload = function()
  911.    {
  912.       this.interv.kill();
  913.    };
  914. };
  915. BOp.fade = function(pas, strt, stp, inc)
  916. {
  917.    var pas = pas || 1;
  918.    var strt = strt || 0;
  919.    var remove = false;
  920.    if(stp == 0)
  921.    {
  922.       var remove = true;
  923.    }
  924.    else if(Number(stp) == undefined)
  925.    {
  926.       stp = 100;
  927.    }
  928.    var inc = inc;
  929.    var anim;
  930.    var eu = this;
  931.    if(strt < stp)
  932.    {
  933.       anim = function(eu)
  934.       {
  935.          if(eu._alpha <= stp)
  936.          {
  937.             eu._alpha += pas;
  938.             updateAfterEvent();
  939.          }
  940.          else
  941.          {
  942.             eu.fadez.kill();
  943.             delete eu.fadez;
  944.          }
  945.          if(inc)
  946.          {
  947.             pas++;
  948.          }
  949.       };
  950.    }
  951.    else
  952.    {
  953.       if(strt <= stp)
  954.       {
  955.          this._alpha = strt;
  956.          this.fadez.kill();
  957.          return undefined;
  958.       }
  959.       anim = function(eu)
  960.       {
  961.          if(eu._alpha >= stp)
  962.          {
  963.             eu._alpha -= pas;
  964.             updateAfterEvent();
  965.          }
  966.          else
  967.          {
  968.             eu.fadez.kill();
  969.             delete eu.fadez;
  970.             if(remove)
  971.             {
  972.                eu.removeMovieClip();
  973.             }
  974.          }
  975.          if(inc)
  976.          {
  977.             pas++;
  978.          }
  979.       };
  980.    }
  981.    this._alpha = strt;
  982.    this.anim = anim;
  983.    if(this.fadez != undefined)
  984.    {
  985.       this.fadez.kill();
  986.       delete this.fadez;
  987.    }
  988.    this.fadez = new Object.Exe(this.anim,50,this);
  989.    this.onUnload = function()
  990.    {
  991.       this.fadez.kill();
  992.    };
  993. };
  994. BOp.bright = function(pas, strt, stp, inc)
  995. {
  996.    var pas = pas || 1;
  997.    var strt = strt || 0;
  998.    var remove = false;
  999.    if(stp == 0)
  1000.    {
  1001.       var remove = true;
  1002.    }
  1003.    else if(Number(stp) == undefined)
  1004.    {
  1005.       stp = 100;
  1006.    }
  1007.    var inc = inc;
  1008.    var anim;
  1009.    var eu = this;
  1010.    if(strt < stp)
  1011.    {
  1012.       anim = function(eu)
  1013.       {
  1014.          if(eu._bright <= stp)
  1015.          {
  1016.             eu._bright += pas;
  1017.             updateAfterEvent();
  1018.          }
  1019.          else
  1020.          {
  1021.             eu.brightez.kill();
  1022.             delete eu.brightez;
  1023.          }
  1024.          if(inc)
  1025.          {
  1026.             pas++;
  1027.          }
  1028.          trace("bright in");
  1029.       };
  1030.    }
  1031.    else
  1032.    {
  1033.       if(strt <= stp)
  1034.       {
  1035.          this._bright = strt;
  1036.          this.brightez.kill();
  1037.          return undefined;
  1038.       }
  1039.       anim = function(eu)
  1040.       {
  1041.          if(eu._bright >= stp)
  1042.          {
  1043.             eu._bright -= pas;
  1044.             updateAfterEvent();
  1045.          }
  1046.          else
  1047.          {
  1048.             eu.brightez.kill();
  1049.             delete eu.brightez;
  1050.             if(remove)
  1051.             {
  1052.                eu.removeMovieClip();
  1053.             }
  1054.          }
  1055.          if(inc)
  1056.          {
  1057.             pas++;
  1058.          }
  1059.          trace("bright out");
  1060.       };
  1061.    }
  1062.    this._bright = strt;
  1063.    Object.lista(eu);
  1064.    this.bnim = anim;
  1065.    if(this.brightez != undefined)
  1066.    {
  1067.       this.brightez.kill();
  1068.       delete this.brightez;
  1069.    }
  1070.    this.brightez = new Object.Exe(this.bnim,50,this);
  1071.    this.onUnload = function()
  1072.    {
  1073.       this.brightez.kill();
  1074.    };
  1075. };
  1076. BOp.ev_LImg = function()
  1077. {
  1078.    ASBroadcaster.initialize(this);
  1079.    this.addListener(this);
  1080.    this.broadcastMessage("onLoadImg",this);
  1081. };
  1082. BOp.xmlLoaded = function(obj)
  1083. {
  1084.    this.__proto__.obj = obj;
  1085.    !this.nuanta ? this.msetRGB(obj.getAttribute("cl2") || "0x466099") : this.msetRGB(obj.getAttribute("cl1") || "0x466099");
  1086.    globalStyleFormat.darkshadow = obj.getAttribute("cl1");
  1087.    globalStyleFormat.shadow = obj.getAttribute("cl1");
  1088.    globalStyleFormat.highlight3D = obj.getAttribute("cl2");
  1089.    globalStyleFormat.highlight = 13421772;
  1090.    globalStyleFormat.face = obj.getAttribute("cl2");
  1091.    globalStyleFormat.background = 16777215;
  1092.    globalStyleFormat.arrow = obj.getAttribute("cl1");
  1093.    globalStyleFormat.backgroundDisabled = 16777215;
  1094. };
  1095. delete BO;
  1096. delete BOp;
  1097. Object.ferestreXml = function(xmlSA)
  1098. {
  1099.    this.xmlSA = xmlSA;
  1100. };
  1101. Object.ferestreXml.prototype.getVarsById = function(id)
  1102. {
  1103.    var i = 0;
  1104.    while(i < this.xmlSA.fereastra.length)
  1105.    {
  1106.       if(id == this.xmlSA.fereastra[i].attributes.id)
  1107.       {
  1108.          var retArr = new Array();
  1109.          var myNode = this.xmlSA.fereastra[i];
  1110.          retArr.push(myNode.attributes.x);
  1111.          retArr.push(myNode.attributes.y);
  1112.          retArr.push(myNode.attributes.width);
  1113.          retArr.push(myNode.attributes.height);
  1114.          retArr.push(myNode.attributes.title);
  1115.          retArr.push(myNode.text[0].getValue());
  1116.          if(undefined != myNode.img[0])
  1117.          {
  1118.             var iArr = new Array();
  1119.             var myNodec = myNode.img[0];
  1120.             iArr.push(myNodec.attributes.src);
  1121.             iArr.push(myNodec.attributes.vspace);
  1122.             retArr.push(iArr);
  1123.          }
  1124.          return retArr;
  1125.       }
  1126.       i++;
  1127.    }
  1128.    trace("id not found: " + id);
  1129.    return null;
  1130. };
  1131. Object.ferestreXML.prototype.getTooltipById = function(id)
  1132. {
  1133.    var i = 0;
  1134.    while(i < this.xmlSA.tooltip.length)
  1135.    {
  1136.       if(id == this.xmlSA.tooltip[i].attributes.id)
  1137.       {
  1138.          var retArr = new Array();
  1139.          var myNode = this.xmlSA.tooltip[i];
  1140.          retArr.push(myNode.getValue());
  1141.          return retArr;
  1142.       }
  1143.       i++;
  1144.    }
  1145.    trace("id not found " + id);
  1146.    return null;
  1147. };
  1148. Object.ferestreXML.prototype.getLabelById = function(id)
  1149. {
  1150.    var i = 0;
  1151.    while(i < this.xmlSA.label.length)
  1152.    {
  1153.       if(id == this.xmlSA.label[i].attributes.id)
  1154.       {
  1155.          var retArr = new Array();
  1156.          var myNode = this.xmlSA.label[i];
  1157.          retArr.push(myNode.getValue());
  1158.          return retArr;
  1159.       }
  1160.       i++;
  1161.    }
  1162.    trace("id not found " + id);
  1163.    return null;
  1164. };
  1165. Object.Glyph = function()
  1166. {
  1167. };
  1168. Object.Glyph["extends"](Object.BaseObject);
  1169. var fp = Object.Glyph.prototype;
  1170. fp.construct = function(cz, tip, sy, x, y, w, h)
  1171. {
  1172.    var tp;
  1173.    var m = this.__proto__;
  1174.    m.cnt = this.cnt = Object.film;
  1175.    var cont = this.cnt;
  1176.    m.cz = cz;
  1177.    m.wid = Number(w) || 250;
  1178.    m.hig = Number(h) || 200;
  1179.    m.sy = sy;
  1180.    switch(tip)
  1181.    {
  1182.       case Object.POP:
  1183.          tp = "fr";
  1184.          break;
  1185.       case Object.TLT:
  1186.          tp = "tlt";
  1187.          break;
  1188.       case Object.Ara:
  1189.          tp = "ara";
  1190.          break;
  1191.       case Object.Msg:
  1192.          tp = "msg";
  1193.          break;
  1194.       case Object.Lbl:
  1195.          tp = "lb";
  1196.          break;
  1197.       default:
  1198.          tp = "gly";
  1199.    }
  1200.    if(cont[tp] == undefined)
  1201.    {
  1202.       if(tp == "fr")
  1203.       {
  1204.          if(cont.tlt)
  1205.          {
  1206.             removeMovieClip(cont.tlt);
  1207.          }
  1208.       }
  1209.       m.fre = this.fre = cont.createMc(tp,x,y);
  1210.       var tip = tip || Object.Glyph;
  1211.       this.fre.transform(tip);
  1212.       this.fre.cntconstruct();
  1213.       this.fre.bgconstruct();
  1214.       this.poz(this.fre,x,y);
  1215.       return true;
  1216.    }
  1217.    return false;
  1218. };
  1219. fp.bgconstruct = function()
  1220. {
  1221.    var cine = this.fre;
  1222.    w = this.wid;
  1223.    h = this.hig;
  1224.    var fundal = cine.createMc("fundal",0,0);
  1225.    mfundal.transform(Object.BaseObject);
  1226.    fundal.swapDepths(this.cont);
  1227.    fundal.transform(Object.BaseObject);
  1228.    fundal.msetRGB(this.obj.getAttribute("cl2") || "0x466099");
  1229.    var c1 = fundal.attachCmp("c1","colt1",Object.BaseObject,0,0,args);
  1230.    if(c1 == undefined)
  1231.    {
  1232.       c1 = fundal.rectangle("colt1",0,0,15,15);
  1233.    }
  1234.    var c3 = fundal.attachCmp("c3","colt3",Object.BaseObject,w,h,args);
  1235.    if(c3 == undefined)
  1236.    {
  1237.       c3 = fundal.rectangle("colt3",w,h,15,15);
  1238.    }
  1239.    var c4 = fundal.attachCmp("c4","colt4",Object.BaseObject,0,h,args);
  1240.    if(c4 == undefined)
  1241.    {
  1242.       c4 = fundal.rectangle("colt4",0,h,15,15);
  1243.    }
  1244.    var c2 = fundal.attachCmp("c2","colt2",Object.BaseObject,w,0,args);
  1245.    if(c2 == undefined)
  1246.    {
  1247.       c2 = fundal.rectangle("colt2",w,0,15,15);
  1248.    }
  1249.    var d1 = fundal.rectangle("dr1",c1._width,c1._y,c2._x - c1._x - c1._width,c1._height,16777215);
  1250.    var d2 = fundal.rectangle("dr2",c2._x,c2._y + c2._height,c2._width,c3._y - c2._y - c2._height);
  1251.    var d3 = fundal.rectangle("dr3",c4._width,c4._y,c3._x - c4._x - c4._width,c4._height,16777215);
  1252.    var d4 = fundal.rectangle("dr4",0,c1._height,c1._width,c4._y - c1._y - c4._height,16777215);
  1253.    var centru = fundal.rectangle("centru",c1._width - 1,c1._height - 1,c2._x - c1._x - c1._width + 2,c4._y - c1._y - c1._height + 2,16777215);
  1254.    fundal.onPress = null;
  1255.    fundal.enabled = false;
  1256.    return fundal;
  1257. };
  1258. fp.poz = function(cine, x, y)
  1259. {
  1260.    var stw = 1024;
  1261.    var sth = 718;
  1262.    if(x + cine._width > stw)
  1263.    {
  1264.       x -= cine._x + cine._width - stw;
  1265.    }
  1266.    if(y + cine._height > sth)
  1267.    {
  1268.       y -= cine._y + cine._height - sth + 40;
  1269.    }
  1270.    cine.setLocation(x,y);
  1271. };
  1272. fp.vis_link = function()
  1273. {
  1274.    this.vlink = this.fre.vlink = new Object.VL(this.fre);
  1275. };
  1276. fp.kill = function(cine)
  1277. {
  1278.    this.bara.fadez.kill();
  1279.    removeMovieClip(this.vlink.layer);
  1280.    removeMovieClip(this);
  1281.    fscommand("show");
  1282.    getURL("FSCommand:appletDo",1);
  1283. };
  1284. delete fp;
  1285. Object.PlayCtrlX = function(xFile)
  1286. {
  1287.    ASBroadcaster.initialize(this);
  1288.    var xi = new Object.XMLloader(xFile,this);
  1289. };
  1290. Object.PlayCtrlX.prototype.swXmlLoaded = function(xmlSA)
  1291. {
  1292.    this.xmlSA = xmlSA;
  1293.    this.movies = this.xmlSA.movie;
  1294.    this.mcMomArr = new Array();
  1295.    this.mcMovMomArr = new Array();
  1296.    this.mcMomTitArr = new Array();
  1297.    this.mcMovArr = new Array();
  1298.    this.cStopMoments = new Array();
  1299.    this.type = parseInt(this.xmlSA.attributes.type);
  1300.    this.broadcastMessage("xmlLoaded",this);
  1301.    this.parent = eval(this.xmlSA.attributes.parent);
  1302.    this.mainCnt = this.parent._container_;
  1303.    this.__miniTile__ = this.parent.minititle;
  1304.    this.parent.title__.text = this.xmlSA.attributes.title;
  1305.    this.evCntrl = null;
  1306.    if(this.type <= 2)
  1307.    {
  1308.       var pCont = eval(this.parent + "." + this.xmlSA.attributes.play);
  1309.       var pCr = pCont.attachMc("play_ctrl","_play_cntrl_",0,0);
  1310.       this.playMcCntrl = new Object.PlayButton(pCr.playMc,this);
  1311.       this.evCntrl = new Object.EvCntrl(pCont,this);
  1312.       if(this.type == 1)
  1313.       {
  1314.          pCr.rollover.onRollOver = function()
  1315.          {
  1316.             _root.menu.gotoAndPlay("start");
  1317.             this.enabled = false;
  1318.          };
  1319.       }
  1320.       else if(this.type == 2)
  1321.       {
  1322.          pCr.rollover.master = this;
  1323.          pCr.rollover.onRelease = function()
  1324.          {
  1325.             this.master.playMv(0);
  1326.          };
  1327.       }
  1328.    }
  1329.    else
  1330.    {
  1331.       this.parent.bottom.bg._visible = false;
  1332.       this.parent.bottom.bar_h._visible = false;
  1333.       this.parent.bottom.bar_over_h._visible = false;
  1334.    }
  1335.    if(this.type == 1)
  1336.    {
  1337.       this.movingMc = new Object.MomentsBar(eval(this.parent + "." + this.xmlSA.attributes.moving),this);
  1338.    }
  1339.    var x = 0;
  1340.    while(x < this.movies.length)
  1341.    {
  1342.       var y = 0;
  1343.       while(y < this.movies[x].moment.length)
  1344.       {
  1345.          if(this.movies[x].moment[y].attributes.type == 1)
  1346.          {
  1347.             this.mcMomTitArr.push(this.movies[x].moment[y].attributes.title);
  1348.             this.mcMovArr.push(x);
  1349.             this.mcMovMomArr.push(y);
  1350.          }
  1351.          y++;
  1352.       }
  1353.       x++;
  1354.    }
  1355.    this.parent.playCntrlLoaded();
  1356.    this.mcMovThr = setInterval(this,"initMov",100,0);
  1357. };
  1358. Object.PlayCtrlX.prototype.initMov = function(plMv, type)
  1359. {
  1360.    if(this.cLoadedMovie !== this.movies[this.mcMovArr[plMv]].attributes.src)
  1361.    {
  1362.       if(this.cLevel != null)
  1363.       {
  1364.          var lev = this.cLevel;
  1365.          this.oldLevel = this.cLevel;
  1366.       }
  1367.       var newLevel = this.mainCnt.createMc("_loaded_" + plMv,0,0);
  1368.       loadMovie(this.movies[this.mcMovArr[plMv]].attributes.src,newLevel);
  1369.       this.cLoadedMovie = this.movies[this.mcMovArr[plMv]].attributes.src;
  1370.       this.onStopMoment = false;
  1371.       this.cStopMoments = new Array();
  1372.       var myCMoment = this.movies[this.mcMovArr[plMv]].moment[this.mcMovMomArr[plMv]].getValue();
  1373.       var m = 0;
  1374.       while(m < this.movies[this.mcMovArr[plMv]].moment.length)
  1375.       {
  1376.          var myM = this.movies[this.mcMovArr[plMv]].moment[m].getValue();
  1377.          this.cStopMoments.push(myM);
  1378.          m++;
  1379.       }
  1380.       this.cLevel = newLevel;
  1381.       this.nLevel = plMv;
  1382.    }
  1383.    var lev = this.cLevel;
  1384.    lev.gotoAndStop(1);
  1385.    var part = lev.getBytesLoaded();
  1386.    var total = lev.getBytesTotal();
  1387.    if(part > 0 && total / part == 1)
  1388.    {
  1389.       if(undefined != this.oldLevel)
  1390.       {
  1391.          trace("unload: " + this.oldLevel);
  1392.          unloadMovie(this.oldLevel);
  1393.          this.oldLevel = null;
  1394.       }
  1395.       clearInterval(this.mcMovThr);
  1396.       this.mcMovThr = null;
  1397.       this.change(lev);
  1398.       if(this.cStopMoments[0] != 1 && this.movies[this.mcMovArr[plMv]].attributes.src != this.movies[this.mcMovArr[plMv - 1]].attributes.src && type != 1)
  1399.       {
  1400.          trace("play intro");
  1401.          lev.gotoAndPlay(1,this);
  1402.       }
  1403.       else
  1404.       {
  1405.          this.playMv(plMv);
  1406.       }
  1407.    }
  1408. };
  1409. Object.PlayCtrlX.prototype.change = function(lev)
  1410. {
  1411.    lev.__playing__ = new Boolean();
  1412.    ASBroadcaster.initialize(lev);
  1413.    lev.addListener(this);
  1414.    lev.master = this;
  1415.    lev.__plCntrl__ = this;
  1416.    Object.film = lev;
  1417.    lev.old_stop = lev.stop;
  1418.    ASSetPropFlags(lev,stop,0,4);
  1419.    lev.stop = function()
  1420.    {
  1421.       if(arguments[0] != this.__plCntrl__ && this.__plCntrl__.type < 3)
  1422.       {
  1423.          trace("Bad Stop!");
  1424.          return undefined;
  1425.       }
  1426.       this.old_stop();
  1427.       this.__playing__ = false;
  1428.       this.broadcastMessage("mcstop");
  1429.    };
  1430.    lev.old_play = lev.play;
  1431.    ASSetPropFlags(lev,stop,0,4);
  1432.    lev.play = function()
  1433.    {
  1434.       if(arguments[0] != this.__plCntrl__ && this.__plCntrl__.type < 3)
  1435.       {
  1436.          trace("Bad Play!");
  1437.          return undefined;
  1438.       }
  1439.       this.old_play();
  1440.       this.__playing__ = true;
  1441.       this.broadcastMessage("mcplay");
  1442.    };
  1443.    lev.old_gotoAndPlay = lev.gotoAndPlay;
  1444.    ASSetPropFlags(lev,gotoAndPlay,0,4);
  1445.    lev.gotoAndPlay = function()
  1446.    {
  1447.       if(arguments[1] != this.__plCntrl__ && this.__plCntrl__.type < 3)
  1448.       {
  1449.          trace("Bad gotoAndPlay! " + arguments[0]);
  1450.          return undefined;
  1451.       }
  1452.       this.old_gotoAndPlay(arguments[0]);
  1453.       this.__playing__ = true;
  1454.       this.broadcastMessage("mcgotoAndPlay",arguments[0]);
  1455.    };
  1456.    lev.old_gotoAndStop = lev.gotoAndStop;
  1457.    ASSetPropFlags(lev,gotoAndStop,0,4);
  1458.    lev.gotoAndStop = function()
  1459.    {
  1460.       if(arguments[1] != this.__plCntrl__ && this.__plCntrl__.type < 3)
  1461.       {
  1462.          trace("Bad gotoAndStop! " + arguments[0]);
  1463.          return undefined;
  1464.       }
  1465.       this.old_gotoAndStop(arguments[0]);
  1466.       this.__playing__ = false;
  1467.       this.broadcastMessage("mcgotoAndStop",arguments[0]);
  1468.    };
  1469.    lev.transform(Object.BaseObject);
  1470.    lev.oldEnterFrame = lev.onEnterFrame;
  1471.    lev.onEnterFrame = function()
  1472.    {
  1473.       lev.oldEnterFrame();
  1474.       this.__plCntrl__.loadedMovieIsAtFrame(this.__plCntrl__.cLevel._currentframe);
  1475.    };
  1476.    lev.isPlaying = function()
  1477.    {
  1478.       return this.__playing__;
  1479.    };
  1480.    Object.film = lev;
  1481.    if(Object.component.behaviour == 0)
  1482.    {
  1483.       var xi = new Object.XMLloader(this.movies[this.mcMovArr[this.nLevel]].attributes.csrc,lev);
  1484.       lev.swXmlLoaded = function(xmlSA)
  1485.       {
  1486.          Object.contentFerXml = new Object.ferestreXml(xmlSA);
  1487.          lev.broadcastMessage("update",lev);
  1488.          Object.__MainPlayControler__.broadcastMessage("update",lev);
  1489.       };
  1490.    }
  1491.    this.parent.newMovieLoaded(lev);
  1492. };
  1493. Object.PlayCtrlX.prototype.mcstop = function()
  1494. {
  1495.    trace("stoped " + this.cLevel._currentframe);
  1496.    this.playMcCntrl.setState("Stop");
  1497. };
  1498. Object.PlayCtrlX.prototype.mcplay = function()
  1499. {
  1500.    trace("play " + this.cLevel._currentframe);
  1501.    this.playMcCntrl.setState("Play");
  1502. };
  1503. Object.PlayCtrlX.prototype.mcgotoAndStop = function()
  1504. {
  1505.    trace("gotoAndStop " + arguments[0] + " " + this.cLevel._currentframe);
  1506.    this.checkM(arguments[0]);
  1507.    this.playMcCntrl.setState("Stop");
  1508. };
  1509. Object.PlayCtrlX.prototype.mcgotoAndPlay = function()
  1510. {
  1511.    trace("gotoAndPlay " + arguments[0] + " " + this.cLevel._currentframe);
  1512.    this.checkM(arguments[0]);
  1513.    this.playMcCntrl.setState("Play");
  1514. };
  1515. Object.PlayCtrlX.prototype.loadedMovieIsAtFrame = function(cf)
  1516. {
  1517.    var myClev = this.cLevel;
  1518.    if(myClev._totalframes == myClev._currentframe)
  1519.    {
  1520.       this.stopMc();
  1521.       var t = this.nLevel;
  1522.       while(this.movies[this.mcMovArr[t]].attributes.src == this.cLoadedMovie)
  1523.       {
  1524.          t++;
  1525.       }
  1526.       if(t == this.mcMovArr.length)
  1527.       {
  1528.          this.playMcCntrl.setState("Disable");
  1529.       }
  1530.    }
  1531.    if(this.type == 3)
  1532.    {
  1533.       return undefined;
  1534.    }
  1535.    if(this._lastframe != cf)
  1536.    {
  1537.       this.checkM(cf);
  1538.    }
  1539.    this._lastframe = cf;
  1540.    var cf = cf + 1;
  1541.    if(this.cLevel.isPlaying() == true)
  1542.    {
  1543.       var i = 0;
  1544.       while(i < this.cStopMoments.length)
  1545.       {
  1546.          if(cf == this.cStopMoments[i])
  1547.          {
  1548.             this.stopMc();
  1549.             return undefined;
  1550.          }
  1551.          i++;
  1552.       }
  1553.    }
  1554. };
  1555. Object.PlayCtrlX.prototype.playMv = function(plMv, type)
  1556. {
  1557.    removeMovieClip(Object.film.fr);
  1558.    if(this.cLoadedMovie == this.movies[this.mcMovArr[plMv]].attributes.src && this.mcMovThr == null)
  1559.    {
  1560.       var myCMoment = this.movies[this.mcMovArr[plMv]].moment[this.mcMovMomArr[plMv]].getValue();
  1561.       this.cLevel.gotoAndPlay(myCMoment,this);
  1562.    }
  1563.    else if(this.mcMovThr == null)
  1564.    {
  1565.       this.mcMovThr = setInterval(this,"initMov",100,plMv,type);
  1566.       this.movingMc.delCurrent();
  1567.    }
  1568. };
  1569. Object.PlayCtrlX.prototype.getM2Moments = function(plMv)
  1570. {
  1571.    var nrMM = this.mcMovMomArr.length;
  1572.    var m = 1;
  1573.    var cMoment = this.mcMovMomArr[plMv] + 1;
  1574.    while(this.movies[this.mcMovArr[plMv]].moment[cMoment].attributes.type == 2)
  1575.    {
  1576.       m++;
  1577.       cMoment++;
  1578.    }
  1579.    if(m >= 2)
  1580.    {
  1581.       this.evCntrl.update(m);
  1582.    }
  1583.    else
  1584.    {
  1585.       this.evCntrl.hide();
  1586.    }
  1587. };
  1588. Object.PlayCtrlX.prototype.playMc = function()
  1589. {
  1590.    removeMovieClip(Object.film.fr);
  1591.    if(this.cLevel.isPlaying() == true || this.mcMovThr != null)
  1592.    {
  1593.       return undefined;
  1594.    }
  1595.    var cf = this.cLevel._currentframe;
  1596.    var tf = this.cLevel._totalframes;
  1597.    if(cf == tf)
  1598.    {
  1599.       if(this.lookAtNextMovieAndSeeIfItIsEnabled_ForCristea(this.nlevel) == false)
  1600.       {
  1601.          return undefined;
  1602.       }
  1603.       var plMv = this.nLevel;
  1604.       while(this.movies[this.mcMovArr[plMv]].attributes.src == this.cLoadedMovie)
  1605.       {
  1606.          plMv++;
  1607.       }
  1608.       if(plMv < this.mcMovArr.length)
  1609.       {
  1610.          this.mcMovThr = setInterval(this,"initMov",100,plMv,0);
  1611.          this.movingMc.delCurrent();
  1612.       }
  1613.       else
  1614.       {
  1615.          this.playMcCntrl.setState("Disable");
  1616.       }
  1617.    }
  1618.    else if(this.findMainMoment(cf + 1) != null)
  1619.    {
  1620.       var c = this.findMainMoment(cf + 1);
  1621.       if(this.getEnabled(cf + 1) == true)
  1622.       {
  1623.          this.cLevel.play(this);
  1624.       }
  1625.       else
  1626.       {
  1627.          trace("Disabled");
  1628.       }
  1629.    }
  1630.    else
  1631.    {
  1632.       if(this.evCntrl.canFill())
  1633.       {
  1634.          var i = 0;
  1635.          while(i < this.cStopMoments.length)
  1636.          {
  1637.             if(cf + 1 == this.cStopMoments[i])
  1638.             {
  1639.                this.evCntrl.fill();
  1640.             }
  1641.             i++;
  1642.          }
  1643.       }
  1644.       this.cLevel.play(this);
  1645.    }
  1646. };
  1647. Object.PlayCtrlX.prototype.stopMc = function()
  1648. {
  1649.    if(this.cLevel.isPlaying() == false || this.mcMovThr != null)
  1650.    {
  1651.       return undefined;
  1652.    }
  1653.    this.cLevel.stop(this);
  1654. };
  1655. Object.PlayCtrlX.prototype.checkM = function(cf)
  1656. {
  1657.    var m = this.findMainMoment(cf);
  1658.    if(null != m)
  1659.    {
  1660.       var m2Mom = this.getM2Moments(m);
  1661.       this.movingMc.setCurrent(m);
  1662.    }
  1663. };
  1664. Object.PlayCtrlX.prototype.getEnabled = function(cf)
  1665. {
  1666.    var m = this.findMainMoment(cf);
  1667.    if(null != m)
  1668.    {
  1669.       var en = this.movingMc.getEnabled(m);
  1670.       return en;
  1671.    }
  1672.    return false;
  1673. };
  1674. Object.PlayCtrlX.prototype.setEnabled = function(m)
  1675. {
  1676.    this.movingMc.setEnabled(m);
  1677. };
  1678. Object.PlayCtrlX.prototype.lookAtNextMovieAndSeeIfItIsEnabled_ForCristea = function()
  1679. {
  1680.    var en = this.movingMc.getEnabled(this.nLevel + 1);
  1681.    return en;
  1682. };
  1683. Object.PlayCtrlX.prototype.findMainMoment = function(cf)
  1684. {
  1685.    var mLevel = this.nlevel;
  1686.    var mMoment = null;
  1687.    var m = 0;
  1688.    while(m < this.movies[this.mcMovArr[this.nLevel]].moment.length)
  1689.    {
  1690.       if(this.movies[this.mcMovArr[mLevel]].moment[m].attributes.type == 1 && this.movies[this.mcMovArr[this.nLevel]].moment[m].getValue() == cf)
  1691.       {
  1692.          mMoment = m;
  1693.          while(this.movies[this.mcMovArr[mLevel - 1]].attributes.src == this.movies[this.mcMovArr[this.nlevel]].attributes.src)
  1694.          {
  1695.             mLevel--;
  1696.          }
  1697.          break;
  1698.       }
  1699.       m++;
  1700.    }
  1701.    if(mMoment != null)
  1702.    {
  1703.       var y = mLevel;
  1704.       while(y < this.mcMovMomArr.length)
  1705.       {
  1706.          if(cf == this.movies[this.mcMovArr[this.nLevel]].moment[this.mcMovMomArr[y]].getValue())
  1707.          {
  1708.             trace("Found " + y);
  1709.             return y;
  1710.          }
  1711.          y++;
  1712.       }
  1713.    }
  1714.    return null;
  1715. };
  1716. Object.PlayCtrlX.prototype.registerBO = function(cine)
  1717. {
  1718.    this.addListener(cine);
  1719. };
  1720. Object.PlayCtrlX.prototype.getAttribute = function(att)
  1721. {
  1722.    if(att == "cl1" or att == "cl2")
  1723.    {
  1724.       return "0x" + this.xmlSA.attributes[att];
  1725.    }
  1726.    return this.xmlSA.attributes[att];
  1727. };
  1728. Object.Error = function()
  1729. {
  1730.    trace(arguments[0]);
  1731. };
  1732. Object.PlayButton = function(instance, cntrl)
  1733. {
  1734.    if("movieclip" == typeof instance)
  1735.    {
  1736.       this.playMc = instance;
  1737.    }
  1738.    else
  1739.    {
  1740.       new Object.Error("initialization error in Object.PlayButton: " + typeOf(instance));
  1741.    }
  1742.    if("object" == typeof cntrl)
  1743.    {
  1744.       this.playCntrl = cntrl;
  1745.    }
  1746.    else
  1747.    {
  1748.       new Object.Error("initialization error in Object.PlayButton");
  1749.    }
  1750.    this.mcPlayMovThr = setInterval(this,"initPlayMc",100);
  1751. };
  1752. Object.PlayButton.prototype.initPlayMc = function()
  1753. {
  1754.    clearInterval(this.mcPlayMovThr);
  1755.    this.myOldRelease = this.playMc.onRelease;
  1756.    this.playMc.master = this;
  1757.    this.state = "Pause";
  1758.    this.playMc.__plCntrl__ = this.playCntrl;
  1759.    this.playMc.onRelease = function()
  1760.    {
  1761.       this.myOldRelease();
  1762.       if(this.master.state == "Play")
  1763.       {
  1764.          this.__plCntrl__.stopMc();
  1765.       }
  1766.       else if(this.master.state == "Stop" || this.master.state == "Pause")
  1767.       {
  1768.          this.__plCntrl__.playMc();
  1769.       }
  1770.       else
  1771.       {
  1772.          return undefined;
  1773.       }
  1774.    };
  1775. };
  1776. Object.PlayButton.prototype.setState = function(state)
  1777. {
  1778.    this.playMc.gotoAndStop(state);
  1779.    this.state = state;
  1780. };
  1781. Object.MomentsBar = function(cont, cntrl)
  1782. {
  1783.    this.movingMc = cont;
  1784.    this.cntrl = cntrl;
  1785.    this.mcMomArr = new Array();
  1786.    this.mcMomEnabled = new Array();
  1787.    this.mcMovMomArr = new Array();
  1788.    this.mcMomTitArr = new Array();
  1789.    var movies = this.cntrl.xmlSA.movie;
  1790.    var x = 0;
  1791.    while(x < movies.length)
  1792.    {
  1793.       var y = 0;
  1794.       while(y < movies[x].moment.length)
  1795.       {
  1796.          var toLoad = null;
  1797.          if(movies[x].moment[y].attributes.type == 1)
  1798.          {
  1799.             toLoad = movies[x].moment[y].attributes.src;
  1800.             var mEnabled = Boolean(mTitle = movies[x].moment[y].attributes.enabled);
  1801.             this.loadMovieInPlayBar(toLoad,y,movies[x].moment[y].attributes.title,mEnabled);
  1802.          }
  1803.          y++;
  1804.       }
  1805.       x++;
  1806.    }
  1807.    this.mcMomThr = setInterval(this,"initMom",100);
  1808. };
  1809. Object.MomentsBar.prototype.loadMovieInPlayBar = function(toLoad, cMvMov, mTitle, mEnabled)
  1810. {
  1811.    this.tx != undefined ? (this.tx += 105) : (this.tx = 0);
  1812.    var tMc = this.movingMc.createMc("__mc" + this.tx,this.tx,0);
  1813.    this.mcMomArr.push(tMc);
  1814.    this.mcMomEnabled.push(mEnabled);
  1815.    this.mcMomTitArr.push(mTitle);
  1816.    this.mcMovMomArr.push(cMvMov);
  1817.    loadMovie(toLoad,tMc);
  1818. };
  1819. Object.MomentsBar.prototype.initMom = function()
  1820. {
  1821.    var total = 0;
  1822.    var part = 0;
  1823.    for(var mc in this.mcMomArr)
  1824.    {
  1825.       total += this.mcMomArr[mc].getBytesTotal();
  1826.       part += this.mcMomArr[mc].getBytesLoaded();
  1827.    }
  1828.    if(part > 0 && total / part == 1)
  1829.    {
  1830.       clearInterval(this.mcMomThr);
  1831.       var mc = 0;
  1832.       while(mc < this.mcMomArr.length)
  1833.       {
  1834.          this.init(mc);
  1835.          if(this.mcMomEnabled[mc] == true)
  1836.          {
  1837.             this.setEnabled(mc);
  1838.          }
  1839.          mc++;
  1840.       }
  1841.    }
  1842. };
  1843. Object.MomentsBar.prototype.setCurrent = function(mc)
  1844. {
  1845.    this.currentMc._x = this.currentMc.x;
  1846.    this.currentMc._y = this.currentMc.y;
  1847.    this.currentMc._xscale = this.currentMc._yscale = 100;
  1848.    this.mcMomArr[mc]._x -= 3;
  1849.    this.mcMomArr[mc]._y -= 7;
  1850.    this.mcMomArr[mc]._xscale = 105;
  1851.    this.mcMomArr[mc]._yscale = 105;
  1852.    this.currentMc = this.mcMomArr[mc];
  1853. };
  1854. Object.MomentsBar.prototype.delCurrent = function()
  1855. {
  1856.    this.currentMc._x = this.currentMc.x;
  1857.    this.currentMc._y = this.currentMc.y;
  1858.    this.currentMc._xscale = this.currentMc._yscale = 100;
  1859. };
  1860. Object.MomentsBar.prototype.getEnabled = function(m)
  1861. {
  1862.    return this.mcMomEnabled[m];
  1863. };
  1864. Object.MomentsBar.prototype.init = function(mc)
  1865. {
  1866.    this.mcMomArr[mc].x = this.mcMomArr[mc]._x;
  1867.    this.mcMomArr[mc].y = this.mcMomArr[mc]._y;
  1868.    this.mcMomArr[mc].__mcLnk__ = parseInt(mc);
  1869.    this.mcMomArr[mc].__plCntrl__ = this.cntrl;
  1870.    this.mcMomArr[mc].__title__ = this.mcMomTitArr[mc];
  1871.    this.mcMomArr[mc].oldRollOver = this.mcMomArr[mc].onRollOver;
  1872.    this.mcMomArr[mc].onRollOver = function()
  1873.    {
  1874.       this.oldRollOver();
  1875.       this.__plCntrl__.__miniTile__.text = this.__title__;
  1876.    };
  1877.    this.mcMomArr[mc].oldRollOut = this.mcMomArr[mc].onRollOut;
  1878.    this.mcMomArr[mc].onRollOut = function()
  1879.    {
  1880.       this.oldRollOut();
  1881.       this.__plCntrl__.__miniTile__.text = "";
  1882.    };
  1883. };
  1884. Object.MomentsBar.prototype.setEnabled = function(mc)
  1885. {
  1886.    this.mcMomEnabled[mc] = true;
  1887.    this.mcMomArr[mc].oldRelease = this.mcMomArr[mc].onRelease;
  1888.    this.mcMomArr[mc].onRelease = function()
  1889.    {
  1890.       this.__plCntrl__.playMv(this.__mcLnk__,1);
  1891.    };
  1892. };
  1893. Object.EvCntrl = function(pCont, master)
  1894. {
  1895.    this.miArr = new Array();
  1896.    this.pCont = pCont;
  1897.    this.master = master;
  1898.    this.mv = this.pCont.attachMc("prg____","lgt",0,32);
  1899.    this.mv._visible = false;
  1900. };
  1901. Object.EvCntrl.prototype.update = function(nr)
  1902. {
  1903.    this.steps = nr;
  1904.    this.ev = 60 / nr;
  1905.    this.cStep = 1;
  1906.    this.mv._visible = true;
  1907.    this.fill();
  1908. };
  1909. Object.EvCntrl.prototype.fill = function()
  1910. {
  1911.    this.fr = this.ev * this.cStep;
  1912.    this.mv.gotoAndStop(this.fr);
  1913.    this.cStep = this.cStep + 1;
  1914. };
  1915. Object.EvCntrl.prototype.canFill = function()
  1916. {
  1917.    if(this.steps > 0 && this.cStep <= this.steps)
  1918.    {
  1919.       return 1;
  1920.    }
  1921.    return 0;
  1922. };
  1923. Object.EvCntrl.prototype.hide = function()
  1924. {
  1925.    this.mv._visible = false;
  1926. };
  1927. Object.POP = function()
  1928. {
  1929. };
  1930. Object.POP["extends"](Object.Glyph);
  1931. var POPp = Object.POP.prototype;
  1932. POPp.construct = function(cz, sy, tit, x, y, w, h)
  1933. {
  1934.    var tip = Object.POP;
  1935.    var exist = super.construct(cz,tip,sy,x,y,w,h);
  1936.    if(exist)
  1937.    {
  1938.       this.fre.tit = tit;
  1939.       this.fre.barconstruct();
  1940.       this.fre.cont.setSize(this.fre.wid,this.fre.hig - this.fre.bara._height + 10);
  1941.       this.fre.cont.refreshPane();
  1942.    }
  1943. };
  1944. POPp.bgconstruct = function()
  1945. {
  1946.    var fnd = super.bgconstruct();
  1947.    this.dev = 4;
  1948.    this.fre.fundal.dr1._y += this.dev;
  1949. };
  1950. POPp.cntconstruct = function()
  1951. {
  1952.    var cine = this.fre;
  1953.    var sy = this.sy;
  1954.    var xoffset = 8;
  1955.    var yoffset = 10;
  1956.    var isinlib = false;
  1957.    var img;
  1958.    var vspace = this.vspace = Number(Object.contentFerXml.getVarsById(sy)[6][1]) || 10;
  1959.    if(Object.library[sy].img == undefined)
  1960.    {
  1961.       img = Object.contentFerXml.getVarsById(sy)[6][0];
  1962.    }
  1963.    else
  1964.    {
  1965.       img = Object.library[sy].img;
  1966.       vspace += Object.library[sy].vspace;
  1967.    }
  1968.    var c = cine.attachMc("FScrollPaneSymbol","cont",xoffset,yoffset);
  1969.    c.boundingBox_mc.transform(Object.BaseObject);
  1970.    c.boundingBox_mc.msetRGB("0xffffff");
  1971.    c.setScrollContent("work_load");
  1972.    c.setDragContent(false);
  1973.    c.tmp_mc.transform(Object.BaseObject);
  1974.    c.tmp_mc.rectangle("spacer",0,0,this.wid,10,"0xffffff");
  1975.    if(img != undefined)
  1976.    {
  1977.       if(img.indexOf(".") == -1)
  1978.       {
  1979.          isinlib = true;
  1980.          img = img.substr(img.lastIndexOf("/") + 1);
  1981.          var i = c.tmp_mc.attachMc(img,"imag",10,10);
  1982.          vspace += i._height;
  1983.       }
  1984.       else
  1985.       {
  1986.          var i = c.tmp_mc.loadImg(img,"imag",10,10);
  1987.       }
  1988.    }
  1989.    if(Object.component.behaviour == 1)
  1990.    {
  1991.       c.tmp_mc.attachMc("mc" + sy,"txt",10,vspace);
  1992.    }
  1993.    else
  1994.    {
  1995.       if(!isinlib)
  1996.       {
  1997.          c.tmp_mc.onLoadImg = function()
  1998.          {
  1999.             vspace += i._height;
  2000.             c.tmp_mc.write(Object.contentFerXml.getVarsById(sy)[5],10,vspace);
  2001.             this._parent._parent.onLoadCnt();
  2002.             c.refreshPane();
  2003.          };
  2004.       }
  2005.       else
  2006.       {
  2007.          c.tmp_mc.write(Object.contentFerXml.getVarsById(sy)[5],10,vspace);
  2008.       }
  2009.       if(img == undefined)
  2010.       {
  2011.          c.tmp_mc.write(Object.contentFerXml.getVarsById(sy)[5],10,vspace);
  2012.       }
  2013.    }
  2014.    this.wid = c.tmp_mc._width + 30;
  2015.    return c;
  2016. };
  2017. POPp.barconstruct = function()
  2018. {
  2019.    var cine = this.fre;
  2020.    var culoare = this.obj.getAttribute("cl1") || "0xccaacc";
  2021.    var xoffset = 10;
  2022.    var yoffset = 10;
  2023.    var bara = cine.createMc("bara",cine.fundal.colt1._width,2);
  2024.    bara.transform(Object.BaseObject);
  2025.    var bc1 = bara.attachCmp("b_c_1","colt1",Object.BaseObject,0,0,args);
  2026.    if(bc1 == undefined)
  2027.    {
  2028.       bc1 = bara.rectangle("colt1",0,0,15,25,culoare);
  2029.    }
  2030.    bc1.msetRGB(culoare);
  2031.    var bc2 = bara.attachCmp("b_c_2","colt2",Object.BaseObject,cine.fundal.colt2._x - cine.fundal.colt1._x - cine.fundal.colt1._width,0,args);
  2032.    if(bc2 == undefined)
  2033.    {
  2034.       bc2 = bara.rectangle("colt2",cine.fundal.colt2._x - cine.fundal.colt1._x - cine.fundal.colt1._width,0,15,25,culoare);
  2035.    }
  2036.    bc2._x -= bc2._width;
  2037.    bc2.msetRGB(culoare);
  2038.    var r = bara.rectangle("bar",bc1._width,0,bc2._x - bc1._x - bc1._width,bc1._height,culoare);
  2039.    var cls_e = cine.attachCmp("close_er","cls_er",Object.BaseObject,cine.fundal.colt2._x,bara._y + bara._height / 2);
  2040.    cls_e.cls.onPress = function()
  2041.    {
  2042.       bara._parent.kill(cine);
  2043.       if(cine.blk != undefined)
  2044.       {
  2045.          cine.blk.removeMovieClip();
  2046.       }
  2047.    };
  2048.    cine.cont._y = bara._height + bara._y + this.dev;
  2049.    this.setTitle(this.tit);
  2050.    bara.onPress = function()
  2051.    {
  2052.       bara.fade(1,60,60);
  2053.       this.dx = _xmouse - bara._parent._x;
  2054.       this.dy = _ymouse - bara._parent._y;
  2055.       this.che = Object.film.createMc("chenar",bara._parent._x,bara._parent._y);
  2056.       this.che.transform(Object.BaseObject);
  2057.       this.che.rec_outline("chenar",0,0,bara._parent.fundal._width,bara._parent.fundal._height,13421772);
  2058.       startDrag(this.che,0,0,36,1024 - this.che._width,768 - this.che._height - 30);
  2059.    };
  2060.    bara.onRollOver = function()
  2061.    {
  2062.       bara.fade(1,95,60,true);
  2063.    };
  2064.    bara.onRollOut = function()
  2065.    {
  2066.       bara.fade(1,bara._alpha,100,true);
  2067.    };
  2068.    bara.onReleaseOutside = bara.onRelease = function()
  2069.    {
  2070.       bara.fade(1,bara._alpha,100,true);
  2071.       bara._parent._x = this.che._x;
  2072.       bara._parent._y = this.che._y;
  2073.       removeMovieClip(this.che);
  2074.       bara._parent.vlink.update();
  2075.    };
  2076.    bara.fade(1,40,100,true);
  2077.    return bara;
  2078. };
  2079. POPp.setTitle = function(tit, culoare)
  2080. {
  2081.    var culoare = culoare || this.bara._parent.obj.getAttribute("cl2");
  2082.    var fnt = this.bara._parent.obj.getAttribute("font");
  2083.    if(this.bara.mytext != undefined)
  2084.    {
  2085.       this.bara.mytext.removeTextField();
  2086.    }
  2087.    this.bara.createTextField("mytext",this.nextDepth(),5,3,this.bara._width - 30,35);
  2088.    with(this.bara)
  2089.    {
  2090.       myformat = new TextFormat();
  2091.       myformat.color = 16777215;
  2092.       myformat.font = "eLearning_Black";
  2093.       myformat.size = "14";
  2094.       myformat.bold = true;
  2095.       mytext._alpha = 100;
  2096.       mytext.multiline = true;
  2097.       mytext.type = "dynamic";
  2098.       mytext.html = true;
  2099.       mytext.wordWrap = true;
  2100.       mytext.selectable = false;
  2101.       mytext.embedFonts = true;
  2102.       mytext.htmlText = tit;
  2103.       mytext.setTextFormat(myformat);
  2104.    }
  2105. };
  2106. POPp.poz = null;
  2107. POPp.vis_link = null;
  2108. Object.MO = function(id)
  2109. {
  2110.    this.init(id);
  2111. };
  2112. Object.MO.tip = "MouseInteraction";
  2113. Object.MO["extends"](Object.BaseObject);
  2114. var MOp = Object.MO.prototype;
  2115. MOp.init = function(id)
  2116. {
  2117.    this.behave();
  2118.    this.parseID(id);
  2119.    ASBroadcaster.initialize(this);
  2120.    this.b_manager = new Object();
  2121.    this.b_manager.ids = new Object();
  2122.    this.b_manager.ids.id = 0;
  2123. };
  2124. MOp.addEvent = function(type, funct)
  2125. {
  2126.    var c = this.b_manager[this.b_manager.ids.id++] = new Object();
  2127.    c[type] = funct;
  2128.    this.addListener(c);
  2129. };
  2130. MOp.behave = function()
  2131. {
  2132.    this.onPress = function()
  2133.    {
  2134.       this.BroadcastMessage("onpress",this);
  2135.    };
  2136.    this.onRollOver = function()
  2137.    {
  2138.       this.BroadcastMessage("onrollover",this);
  2139.    };
  2140.    this.onRollOut = function()
  2141.    {
  2142.       this.BroadcastMessage("onrollout",this);
  2143.    };
  2144.    this.onRelease = function()
  2145.    {
  2146.       this.BroadcastMessage("onrelease",this);
  2147.    };
  2148. };
  2149. MOp.parseID = function(id)
  2150. {
  2151.    var set_id = new Object();
  2152.    prs2 = function(id)
  2153.    {
  2154.       switch(id.substring(0,1))
  2155.       {
  2156.          case "f":
  2157.             set_id.fer = id;
  2158.             return set_id.fer;
  2159.          case "t":
  2160.             set_id.tlt = id;
  2161.             return set_id.tlt;
  2162.          case "p":
  2163.             set_id.fer = id;
  2164.             this.make_group(id);
  2165.             return set_id.fer;
  2166.          case "m":
  2167.             set_id.msg = id;
  2168.             return set_id.msg;
  2169.          default:
  2170.             trace(id + " - parametru introdus incorect!");
  2171.       }
  2172.    };
  2173.    var v = id;
  2174.    var i;
  2175.    var j;
  2176.    var par = new Array();
  2177.    while(i < v.length)
  2178.    {
  2179.       if(isNaN(parseInt(v.charAt(i))))
  2180.       {
  2181.          if(j >= 2)
  2182.          {
  2183.             break;
  2184.          }
  2185.          j++;
  2186.          par[j - 1] = v.charAt(i);
  2187.       }
  2188.       else
  2189.       {
  2190.          par[j - 1] += v.charAt(i);
  2191.       }
  2192.       i++;
  2193.    }
  2194.    for(var k in par)
  2195.    {
  2196.       if(par[k].length < 2)
  2197.       {
  2198.          trace(par[k] + " - parametru introdus incorect");
  2199.          break;
  2200.       }
  2201.       prs2(par[k]);
  2202.    }
  2203.    if(set_id.fer != undefined)
  2204.    {
  2205.       this.id_fer = set_id.fer;
  2206.    }
  2207.    if(set_id.tlt != undefined)
  2208.    {
  2209.       this.id_tlt = set_id.tlt;
  2210.    }
  2211.    if(set_id.msg != undefined)
  2212.    {
  2213.       this.id_msg = set_id.msg;
  2214.    }
  2215.    return set_id;
  2216. };
  2217. MOp.make_group = function(id)
  2218. {
  2219.    trace("referinta este " + this.cz);
  2220.    if(!Object.arahnides)
  2221.    {
  2222.       Object.arahnides = new Object();
  2223.    }
  2224.    if(!Object.arahnides[id])
  2225.    {
  2226.       Object.arahnides[id] = new Object();
  2227.       Object.arahnides[id].content = new Array();
  2228.       Object.arahnides[id].content[0] = this.cz;
  2229.    }
  2230.    else
  2231.    {
  2232.       Object.arahnides[id].content.push(this.cz);
  2233.    }
  2234. };
  2235. Object.CZ = function(id)
  2236. {
  2237.    this.init(id);
  2238. };
  2239. Object.CZ.tip = "ClickableZone";
  2240. Object.CZ["extends"](Object.MO);
  2241. var CZp = Object.CZ.prototype;
  2242. CZp.init = function(id)
  2243. {
  2244.    this.useHandCursor = false;
  2245.    if(id == undefined)
  2246.    {
  2247.       trace("Nu a fost introdus ID in " + this);
  2248.       return undefined;
  2249.    }
  2250.    super.init(id);
  2251.    if(this.id_tlt != undefined)
  2252.    {
  2253.       this.addEvent("onrollover",this.tltp);
  2254.       this.addEvent("onrollout",this.dtltp);
  2255.    }
  2256.    if(this.id_fer != undefined)
  2257.    {
  2258.       this.addEvent("onpress",this.fer);
  2259.       this.addEvent("onrollover",this.label);
  2260.       this.addEvent("onrollout",this.dlabel);
  2261.       this.addEvent("onpress",this.dlabel);
  2262.    }
  2263. };
  2264. CZp.label = function(cine)
  2265. {
  2266.    Object.film.attachMovie("palma","cursor_palma",123);
  2267.    Mouse.hide();
  2268.    with(Object.film.cursor_palma)
  2269.    {
  2270.       _rotation = -135;
  2271.       _xscale = _yscale = 30;
  2272.    }
  2273.    Object.film.cursor_palma.startDrag(true);
  2274.    Object.film.cursor_palma.onMouseMove = function()
  2275.    {
  2276.       updateAfterEvent();
  2277.    };
  2278. };
  2279. CZp.dlabel = function()
  2280. {
  2281.    Mouse.show();
  2282.    Object.film.cursor_palma.removeMovieClip();
  2283. };
  2284. CZp.fer = function(cine)
  2285. {
  2286.    fscommand("ascund");
  2287.    getURL("FSCommand:appletDo",0);
  2288.    var cine = cine || this;
  2289.    this.cz = cine;
  2290.    var sy = cine.id_fer;
  2291.    if(Object.component.behaviour == 1)
  2292.    {
  2293.       var f = Object.library[sy];
  2294.       if(sy != undefined)
  2295.       {
  2296.          if(sy.substring(0,1) == "f")
  2297.          {
  2298.             new Object.POP().construct(cine,sy,f.title,f.x,f.y,f.width,f.height);
  2299.          }
  2300.          else
  2301.          {
  2302.             new Object.Ara().construct(cine,sy,f.title,f.x,f.y,f.width,f.height);
  2303.          }
  2304.       }
  2305.    }
  2306.    else if(sy != undefined)
  2307.    {
  2308.       var parametrii = Object.contentFerXml.getVarsById(sy);
  2309.       if(sy.substring(0,1) == "f")
  2310.       {
  2311.          new Object.POP().construct(cine,sy,parametrii[4],parametrii[0],parametrii[1],parametrii[2],parametrii[3]);
  2312.       }
  2313.       else
  2314.       {
  2315.          new Object.Ara().construct(cine,sy,parametrii[4],parametrii[0],parametrii[1],parametrii[2],parametrii[3]);
  2316.       }
  2317.    }
  2318. };
  2319. CZp.tltp = function(cine)
  2320. {
  2321.    this.yoff = 15;
  2322.    this.xoff = 10;
  2323.    var cine = cine || this;
  2324.    this.cz = cine;
  2325.    var sy = cine.id_tlt;
  2326.    if(Object.component.behaviour == 1)
  2327.    {
  2328.       var tx = Object.library[sy].text;
  2329.       if(tx != undefined)
  2330.       {
  2331.          cine.tooltip = new Object.TLT().construct(cine,tx,_level0._xmouse + this.xoff,_level0._ymouse + this.yoff);
  2332.       }
  2333.    }
  2334.    else if(sy != undefined)
  2335.    {
  2336.       var tx = Object.contentFerXml.getTooltipById(cine.id_tlt);
  2337.       cine.tooltip = new Object.TLT().construct(cine,tx,_xmouse + this.xoff,_ymouse + this.yoff);
  2338.    }
  2339. };
  2340. Czp.dtltp = function(cine)
  2341. {
  2342.    Object.film.tlt.fadez.kill();
  2343.    removeMovieClip(Object.film.tlt);
  2344. };
  2345. Object.Btn = function(id)
  2346. {
  2347.    this.init(id);
  2348. };
  2349. Object.Btn.tip = "button_zone";
  2350. Object.Btn["extends"](Object.MO);
  2351. var Bp = Object.Btn.prototype;
  2352. Bp.init = function(id)
  2353. {
  2354.    super.init(id);
  2355.    this.addEvent("onrollover",this.rlov);
  2356.    this.addEvent("onrollout",this.rlou);
  2357.    this.addEvent("onpress",this.down);
  2358.    this.addEvent("onrelease",this.rlou);
  2359. };
  2360. Bp.setText = function(tx)
  2361. {
  2362.    this.Label = tx;
  2363. };
  2364. Bp.getText = function()
  2365. {
  2366.    return this.Label;
  2367. };
  2368. Bp.rlov = function(cine)
  2369. {
  2370.    var cine = cine || this;
  2371.    cine.gotoAndStop("over");
  2372. };
  2373. Bp.rlou = function(cine)
  2374. {
  2375.    var cine = cine || this;
  2376.    cine.gotoAndStop("up");
  2377. };
  2378. Bp.down = function(cine)
  2379. {
  2380.    var cine = cine || this;
  2381.    cine.gotoAndStop("down");
  2382. };
  2383. Object.TLT = function()
  2384. {
  2385. };
  2386. Object.TLT["extends"](Object.Glyph);
  2387. var TLTp = Object.TLT.prototype;
  2388. TLTp.construct = function(cz, sy, x, y)
  2389. {
  2390.    if(sy == undefined)
  2391.    {
  2392.       return undefined;
  2393.    }
  2394.    var tip = Object.TLT;
  2395.    var exist = super.construct(cz,tip,sy,x,y,w,h);
  2396. };
  2397. TLTp.cntconstruct = function()
  2398. {
  2399.    var cine = this;
  2400.    var tx = this.sy;
  2401.    cine.createMc("cont",5,5);
  2402.    with(cine.cont)
  2403.    {
  2404.       var txt = Function.replaceFunny(tx);
  2405.       var w = 250;
  2406.       myformat = new TextFormat();
  2407.       myformat.bold = true;
  2408.       myformat.font = "eLEARNING_Medium";
  2409.       myformat.size = 25;
  2410.       myformat.bullet = false;
  2411.       createTextField("mytext",1,0,0,5,10);
  2412.       mytext.autoSize = "left";
  2413.       mytext.type = "dynamic";
  2414.       mytext.selectable = false;
  2415.       mytext.html = true;
  2416.       mytext.wordWrap = true;
  2417.       mytext.setTextFormat(myformat);
  2418.       mytext.htmlText = txt;
  2419.       mytext.embedFonts = true;
  2420.    }
  2421.    var w = cine.cont.mytext.textWidth;
  2422.    if(w > 250)
  2423.    {
  2424.       w = 250;
  2425.    }
  2426.    else
  2427.    {
  2428.       w += 30;
  2429.    }
  2430.    cine.cont.mytext._width = w;
  2431.    this.wid = w;
  2432.    this.hig = cine.cont.mytext._height - 10;
  2433. };
  2434. TLTp.bgconstruct = function()
  2435. {
  2436.    var fnd = super.bgconstruct();
  2437.    fnd.fade(2,50,100,true);
  2438. };
  2439. TLTp.poz = function(cine, x, y)
  2440. {
  2441.    var stw = 1024;
  2442.    var sth = 718;
  2443.    if(x + cine._width > stw)
  2444.    {
  2445.       x -= cine._x + cine._width - stw;
  2446.    }
  2447.    if(y + cine._height > sth)
  2448.    {
  2449.       trace("situatie anormala" + this.fre);
  2450.       y = _ymouse - 10 - this.fre._height;
  2451.    }
  2452.    cine.setLocation(x,y);
  2453. };
  2454. TLTp.vis_link = null;
  2455. Object.Msg = function()
  2456. {
  2457. };
  2458. Object.Msg.tip = "Messages";
  2459. Object.Msg["extends"](Object.Glyph);
  2460. var Mp = Object.Msg.prototype;
  2461. Mp.construct = function(sy, tit, ico, exe)
  2462. {
  2463.    fscommand("ascund");
  2464.    getURL("FSCommand:appletDo",0);
  2465.    var tip = Object.Msg;
  2466.    var x = x || 100;
  2467.    var y = y || 200;
  2468.    var m = this.__proto__;
  2469.    m.icon = ico;
  2470.    m.wid = w;
  2471.    m.exe = exe;
  2472.    m.hig = h;
  2473.    m.ico = ico;
  2474.    var exist = super.construct(cz,tip,sy,x,y,w,h);
  2475.    if(exist)
  2476.    {
  2477.       this.fre.tit = tit;
  2478.       this.cont.boundingBox_mc._visible = false;
  2479.       this.bar = this.fre.barconstruct(this.fre,tit,w,h,x,y);
  2480.       this.fre.cont.boundingBox_mc._visible = false;
  2481.       this.bt_ok();
  2482.       this.centrez(this.fre);
  2483.       this.fnc_blc();
  2484.       return true;
  2485.    }
  2486.    return false;
  2487. };
  2488. Mp.bgconstruct = Object.POP.prototype.bgconstruct;
  2489. Mp.barconstruct = Object.POP.prototype.barconstruct;
  2490. Mp.setTitle = Object.POP.prototype.setTitle;
  2491. Mp.icoconstruct = function(cine)
  2492. {
  2493.    var margine = 15;
  2494.    var ico = cine.attachMc(this.icon,"icn",0,0);
  2495.    ico._x += margine;
  2496.    ico._y += margine;
  2497.    return ico;
  2498. };
  2499. Mp.bt_ok = function()
  2500. {
  2501.    var eu = this.fre;
  2502.    var margine = 4;
  2503.    var ms = 30;
  2504.    var mj = 15;
  2505.    var inchid = eu.createMc("shell",0,eu._height);
  2506.    var bg = inchid.createMc("bkgrnd");
  2507.    bg.transform(Object.BaseObject);
  2508.    var buton = inchid.attachMc("ok_er","k_er",2,2);
  2509.    var clt = bg.attachMc("c4","colt",0,0);
  2510.    inchid._x = eu.fundal._width - buton._width - margine * 2;
  2511.    inchid._y = eu.fundal._height - buton._height - clt._height;
  2512.    clt._y = buton._height - clt._height / 2 - margine / 2;
  2513.    bg.rectangle("r1",bg.colt._x + bg.colt._width,bg.colt._y,eu.fundal._width - inchid._x - bg.colt._width,bg.colt._height);
  2514.    bg.rectangle("r2",0,0,bg._width,bg.r1._y + 1);
  2515.    bg.msetRGB(this.obj.getAttribute("cl1") || "0x466099");
  2516.    bg.fade(2,50,100,true);
  2517.    buton.ok.onPress = function()
  2518.    {
  2519.       eu.kill(eu);
  2520.       eu.blk.removeMovieClip();
  2521.       eu.exe();
  2522.    };
  2523. };
  2524. Mp.cntconstruct = function()
  2525. {
  2526.    var eu = this.fre;
  2527.    var tx = this.sy;
  2528.    eu.createMc("cont",0,eu.bara._height + 5);
  2529.    var ico = this.icoconstruct(eu.cont);
  2530.    var in_space = 15;
  2531.    var up_space = 10;
  2532.    var margine = 30;
  2533.    if(Object.component.behaviour == 1 and this.checkMsg())
  2534.    {
  2535.       eu.cont.attachMc("mc" + tx,"txt",ico._width + ico._x + in_space,up_space);
  2536.       this.wid = this._width + margine / 2;
  2537.       this.hig = this._height + margine * 3;
  2538.       return undefined;
  2539.    }
  2540.    var txte = eu.cont.createMc("txbox",ico._width + ico._x + in_space,up_space);
  2541.    txte.transform(Object.BaseObject);
  2542.    with(txte)
  2543.    {
  2544.       var txt = Function.replaceFunny(tx);
  2545.       if(tx.length > 1)
  2546.       {
  2547.          var w = 250;
  2548.       }
  2549.       else
  2550.       {
  2551.          w = 10;
  2552.       }
  2553.       myformat = new TextFormat();
  2554.       myformat.bold = true;
  2555.       myformat.font = "eLEARNING_Black";
  2556.       myformat.size = 14;
  2557.       myformat.bullet = false;
  2558.       createTextField("mytext",1,0,0,w,10);
  2559.       mytext.autoSize = "left";
  2560.       mytext.type = "dynamic";
  2561.       mytext.selectable = false;
  2562.       mytext.html = true;
  2563.       mytext.wordWrap = true;
  2564.       mytext.setTextFormat(myformat);
  2565.       mytext.embedFonts = true;
  2566.       mytext.text = txt;
  2567.       mytext.htmlText = txt;
  2568.       mytext.setTextFormat(myformat);
  2569.    }
  2570.    if(txte.mytext._height < ico._height)
  2571.    {
  2572.       this.hig = ico._height + margine * 3;
  2573.    }
  2574.    else
  2575.    {
  2576.       this.hig = txte.mytext._height + margine * 3;
  2577.       ico._y = txte._y + txte._height / 2 - ico._height / 2;
  2578.    }
  2579.    this.wid = this._width;
  2580. };
  2581. Mp.centrez = function(cine)
  2582. {
  2583.    cine._x = Stage.width / 2 - cine._width / 2;
  2584.    cine._y = Stage.height / 2 - cine._height / 2;
  2585. };
  2586. Mp.checkMsg = function()
  2587. {
  2588.    if(this.sy.substring(0,1) == "m" and !isNaN(this.sy.substring(1,2)))
  2589.    {
  2590.       return true;
  2591.    }
  2592.    return false;
  2593. };
  2594. Mp.fnc_blc = function()
  2595. {
  2596.    var blk = this.cnt.rectangle("blocker",0,0,Stage.width,Stage.height,16777215);
  2597.    this.fre.blk = blk;
  2598.    blk.swapDepths(this.fre);
  2599.    blk.transform(Object.BaseObject);
  2600.    blk.fade(3,20,40,true);
  2601.    blk.onPress = function()
  2602.    {
  2603.    };
  2604.    blk.enabled = false;
  2605. };
  2606. Mp.vis_link = null;
  2607. delete Mp;
  2608. _global.mesaj = function(mesaj, titlu, icon, exe)
  2609. {
  2610.    var parseID = Object.MO.prototype.parseID;
  2611.    if(mesaj.substring(0,1) == "#")
  2612.    {
  2613.       mesaj = mesaj.substring(1,mesaj.length);
  2614.    }
  2615.    else
  2616.    {
  2617.       var simb = parseID(mesaj);
  2618.       var sy = simb.msg;
  2619.       if(Object.component.behaviour == 1)
  2620.       {
  2621.          mesaj;
  2622.          if(icon == undefined or icon == "")
  2623.          {
  2624.             icon = Object.library[sy].img;
  2625.          }
  2626.          if(titlu == undefined or titlu == "")
  2627.          {
  2628.             titlu = Object.library[sy].title;
  2629.          }
  2630.       }
  2631.       else
  2632.       {
  2633.          mesaj = Object.contentFerXml.getVarsById(sy)[5];
  2634.          if(titlu == undefined or titlu == "")
  2635.          {
  2636.             titlu = Object.contentFerXml.getVarsById(sy)[4];
  2637.          }
  2638.          if(icon == undefined or icon == "")
  2639.          {
  2640.             icon = Object.contentFerXml.getVarsById(sy)[6][0];
  2641.          }
  2642.       }
  2643.    }
  2644.    if(mesaj == undefined or mesaj == "")
  2645.    {
  2646.       mesaj = "Introduce├╛i mesajul dorit !";
  2647.    }
  2648.    if(titlu == undefined or titlu == "")
  2649.    {
  2650.       titlu = "Aten├╛ie !";
  2651.    }
  2652.    if(icon == undefined or icon == "")
  2653.    {
  2654.       icon = "icon_alert";
  2655.    }
  2656.    return new Object.Msg().construct(mesaj,titlu,icon,exe);
  2657. };
  2658. Object.VL = function(cine)
  2659. {
  2660.    this.fer = cine;
  2661.    this.kill();
  2662.    this.construct();
  2663.    this.layer.mcImplements(Object.VL);
  2664. };
  2665. var vp = Object.VL.prototype;
  2666. vp.construct = function()
  2667. {
  2668.    this.layer = Object.film.createEmptyMovieClip("v_link",900);
  2669.    this.layer.transform(Object.BaseObject);
  2670.    this.layer.swapDepths(this.fer);
  2671.    this.update();
  2672.    updateAfterEvent();
  2673. };
  2674. vp.update = function()
  2675. {
  2676.    var xdif = 15;
  2677.    var ydif = 20;
  2678.    var cine = this.fer;
  2679.    this.clear();
  2680.    this.l1 = this.layer.line("linie1",cine.cz._x,cine.cz._y,cine._x - xdif,cine.cz._y,this.fer.obj.getAttribute("cl1"));
  2681.    this.l2 = this.layer.line("linie2",cine._x - xdif,cine.cz._y,cine._x - xdif,cine._y + ydif,this.fer.obj.getAttribute("cl1"));
  2682.    this.l3 = this.layer.line("linie3",cine._x - xdif,cine._y + ydif,cine._x,cine._y + ydif,this.fer.obj.getAttribute("cl1"));
  2683. };
  2684. vp.clear = function()
  2685. {
  2686.    removeMovieClip(this.l1);
  2687.    removeMovieClip(this.l2);
  2688.    removeMovieClip(this.l3);
  2689. };
  2690. delete vp;
  2691. XML.prototype.getElementsByTagName = function(targetName)
  2692. {
  2693.    function diverDown(node, targetName)
  2694.    {
  2695.       var nodeList = node.childNodes;
  2696.       var i = 0;
  2697.       while(i < nodeList.length)
  2698.       {
  2699.          if(nodeList[i].nodeType == 1 && nodeList[i].hasChildNodes)
  2700.          {
  2701.             if(nodeList[i].nodeName == targetName)
  2702.             {
  2703.                var n = 0;
  2704.                while(n < nodeList[i].parentNode.childNodes.length)
  2705.                {
  2706.                   if(nodeList[i].parentNode.childNodes[n].nodeName == targetName)
  2707.                   {
  2708.                      returnValue[index] = nodeList[i].parentNode.childNodes[n];
  2709.                      index++;
  2710.                   }
  2711.                   n++;
  2712.                }
  2713.                return undefined;
  2714.             }
  2715.             diverDown(nodeList[i],targetName);
  2716.          }
  2717.          i++;
  2718.       }
  2719.       index = 0;
  2720.    }
  2721.    var index = 0;
  2722.    var returnValue = new Array();
  2723.    diverDown(this,targetName);
  2724.    if(returnValue.length == 0)
  2725.    {
  2726.       returnValue = null;
  2727.    }
  2728.    return returnValue;
  2729. };
  2730. XML.prototype.findRootNode = function(XMLNode)
  2731. {
  2732.    var nd = null;
  2733.    trace("in findRootNode");
  2734.    nd = XMLNode.parentNode;
  2735.    while(nd != null)
  2736.    {
  2737.       XMLNode = nd;
  2738.       nd = nd.parentNode;
  2739.    }
  2740.    return XMLNode;
  2741. };
  2742. Object.XMLloader = function(lXML, creator)
  2743. {
  2744.    this.creator = creator;
  2745.    this.cXML = new XML();
  2746.    this.cXML.ignoreWhite = true;
  2747.    this.cXML.parent = this;
  2748.    this.cXML.onLoad = function(success)
  2749.    {
  2750.       if(success)
  2751.       {
  2752.          this.parent.xmlSA = new Object.XMLSA(this);
  2753.       }
  2754.       else
  2755.       {
  2756.          trace("error=" + this.status);
  2757.       }
  2758.    };
  2759.    this.cXML.load(lXML);
  2760.    this.thr = setInterval(this,"checkState",100);
  2761. };
  2762. Object.XMLloader.prototype.checkState = function()
  2763. {
  2764.    if(this.xmlSA != null)
  2765.    {
  2766.       this.creator.swXmlLoaded(this.xmlSA);
  2767.       clearInterval(this.thr);
  2768.    }
  2769. };
  2770. Object.XMLSA = function(watchXML)
  2771. {
  2772.    if(watchXML != undefined)
  2773.    {
  2774.       this.parse(watchXML,true);
  2775.    }
  2776. };
  2777. Object.XMLSA.prototype.getValue = function()
  2778. {
  2779.    if(this.__xml.firstChild.nodeType == 1)
  2780.    {
  2781.       var ret = "";
  2782.       var t = 0;
  2783.       while(t < this.__xml.childNodes.length)
  2784.       {
  2785.          ret += this.__xml.childNodes[t];
  2786.          t++;
  2787.       }
  2788.       return ret;
  2789.    }
  2790.    var ret = "";
  2791.    var t = 0;
  2792.    while(t < this.__xml.childNodes.length)
  2793.    {
  2794.       ret += this.__xml.childNodes[t];
  2795.       t++;
  2796.    }
  2797.    return ret;
  2798. };
  2799. Object.XMLSA.prototype.setValue = function(text)
  2800. {
  2801.    this.__xml.firstChild.nodeValue = text;
  2802. };
  2803. Object.XMLSA.prototype.parse = function(node, replaceRoot)
  2804. {
  2805.    if(replaceRoot)
  2806.    {
  2807.       this.__root = node;
  2808.       node = node.firstChild;
  2809.    }
  2810.    this.__xml = node;
  2811.    this.attributes = node.attributes;
  2812.    if(node.nodeType == 1 and node.firstChild.nodeType == 1)
  2813.    {
  2814.       var childCounter = 0;
  2815.       while(childCounter < node.childNodes.length)
  2816.       {
  2817.          var tempName = node.childNodes[childCounter].nodeName;
  2818.          if(this[tempName] == undefined)
  2819.          {
  2820.             this[tempName] = new Array();
  2821.          }
  2822.          var tempIndex;
  2823.          tempIndex = this[tempName].push(new Object.XMLSA());
  2824.          this[tempName][tempIndex - 1].parse(node.childNodes[childCounter]);
  2825.          childCounter++;
  2826.       }
  2827.    }
  2828. };
  2829. Object.PlayStopClass = function()
  2830. {
  2831.    ASBroadcaster.initialize(this);
  2832.    this.movie = this._parent[this._targetInstanceName];
  2833.    this.check();
  2834.    this.init();
  2835.    this.attachEvents();
  2836. };
  2837. Object.PlayStopClass.prototype = new MovieClip();
  2838. Object.PlayStopClass["extends"](MovieClip);
  2839. Object.PlayStopClass.prototype.check = function()
  2840. {
  2841.    if("function" != typeof this.movie.isPlaying)
  2842.    {
  2843.       trace("error:in PlayStop mc must implement Boolean isPlaying()");
  2844.    }
  2845. };
  2846. Object.PlayStopClass.prototype.init = function()
  2847. {
  2848.    if("function" != typeof this.playHandler.setState)
  2849.    {
  2850.       this.playHandler.setState = function(arg)
  2851.       {
  2852.          this.gotoAndPlay(arg);
  2853.       };
  2854.    }
  2855.    if(this.loop == true)
  2856.    {
  2857.       trace("loop enabled");
  2858.    }
  2859.    ASBroadcaster.initialize(this.movie);
  2860.    this.movie.addListener(this);
  2861.    this.movie.master = this;
  2862.    this.movie.old_stop = this.movie.stop;
  2863.    ASSetPropFlags(this.movie,"stop",0,4);
  2864.    this.movie.stop = function()
  2865.    {
  2866.       this.old_stop();
  2867.       this.isPlaying();
  2868.       this.broadcastMessage("mcStoped","broadcast");
  2869.    };
  2870. };
  2871. Object.PlayStopClass.prototype.attachEvents = function()
  2872. {
  2873.    this.playHandler.master = this;
  2874.    this.playHandler.onRelease = function()
  2875.    {
  2876.       if(this.master.movie.isPlaying())
  2877.       {
  2878.          if(this.master.getContinuous() == true)
  2879.          {
  2880.             this.master.setContinuous(false);
  2881.          }
  2882.          this.master.movie.stop();
  2883.          this.setState("stop");
  2884.       }
  2885.       else
  2886.       {
  2887.          this.master.movie.play();
  2888.          this.setState("play");
  2889.       }
  2890.    };
  2891.    this.checkBox.setChangeHandler("setContinuousCb");
  2892. };
  2893. Object.PlayStopClass.prototype.dettachEvents = function()
  2894. {
  2895.    this.playHandler.onRelease = function()
  2896.    {
  2897.       trace("disabled");
  2898.    };
  2899. };
  2900. Object.PlayStopClass.prototype.mcStoped = function()
  2901. {
  2902.    if(this.movie._currentframe == this.movie._totalframes && true == this.loop)
  2903.    {
  2904.       this.movie.play();
  2905.    }
  2906.    else if(true == this.getContinuous() && this.movie._currentframe != this.movie._totalframes)
  2907.    {
  2908.       this.movie.play();
  2909.    }
  2910.    else
  2911.    {
  2912.       this.playHandler.setState("stop");
  2913.    }
  2914. };
  2915. Object.PlayStopClass.prototype.getContinuous = function()
  2916. {
  2917.    return this.checkBox.getValue();
  2918. };
  2919. Object.PlayStopClass.prototype.setContinuous = function()
  2920. {
  2921.    this.checkBox.setValue(false);
  2922. };
  2923. Object.PlayStopClass.prototype.setContinuousCb = function()
  2924. {
  2925.    if(true == this.getContinuous() && this.movie._currentframe != this.movie._totalframes && false == this.movie.isPlaying())
  2926.    {
  2927.       this.movie.play();
  2928.       this.playHandler.setState("play");
  2929.    }
  2930.    this.broadcastMessage("loop",this.getLoop());
  2931. };
  2932. Object.PlayStopClass.prototype.setState = function(arg)
  2933. {
  2934. };
  2935. var AutorFereastraClass = Object.AutorFereastraClass = function()
  2936. {
  2937.    this.path = "";
  2938.    var myLv = targetPath(this);
  2939.    this.tscr._visible = false;
  2940.    this.behaviour = Object.component.behaviour;
  2941.    this._parent.addListener(this);
  2942.    Object.__MainPlayControler__.addListener(this);
  2943.    this.width = this._width;
  2944.    this.height = this._height;
  2945.    this._xscale = this._yscale = 100;
  2946.    this.cLevel = eval(myLv.substring(0,myLv.indexOf(".")));
  2947.    if(this._width != undefined && this._height != undefined && this.id != undefined)
  2948.    {
  2949.       this.update();
  2950.    }
  2951.    else
  2952.    {
  2953.       trace("w: " + this._width + "\nh: " + this._height + "\nid: " + this.Id);
  2954.    }
  2955. };
  2956. AutorFereastraClass.prototype = new MovieClip();
  2957. AutorFereastraClass["extends"](MovieClip);
  2958. AutorFereastraClass.prototype.setSize = function(w, h)
  2959. {
  2960.    this.width = w;
  2961.    this.height = h;
  2962.    this._xscale = this._yscale = 100;
  2963.    this.update();
  2964. };
  2965. AutorFereastraClass.prototype.update = function()
  2966. {
  2967.    this._xscale = this._yscale = 100;
  2968.    this.show();
  2969. };
  2970. AutorFereastraClass.prototype.show = function()
  2971. {
  2972.    this.scr._visible = false;
  2973.    this.scr.removeMovieClip();
  2974.    this.scr.unloadMovie();
  2975.    this.attachMc("FScrollPaneSymbol","scr",0,0);
  2976.    this.scr.setSize(this.width,this.height);
  2977.    this.behaviour != 1 ? this.xmlShow() : this.libShow();
  2978.    this.scr.refreshPane();
  2979. };
  2980. AutorFereastraClass.prototype.xmlShow = function()
  2981. {
  2982.    if(undefined != Object.contentFerXml)
  2983.    {
  2984.       var tArr = Object.contentFerXml.getVarsById(this.id);
  2985.       this.cText = tArr[5];
  2986.       if(undefined != tArr[6])
  2987.       {
  2988.          this.img = tArr[6][0];
  2989.          this.vspace = parseInt(tArr[6][1]);
  2990.       }
  2991.       else
  2992.       {
  2993.          this.img = undefined;
  2994.       }
  2995.    }
  2996.    else
  2997.    {
  2998.       this.cText = "<font face=\'eLearning Black\'>Loading...</font>";
  2999.    }
  3000.    this.scr.setScrollContent("dummy");
  3001.    var c = this.scr.getScrollContent();
  3002.    c.clear();
  3003.    c.lineStyle(2,6719658);
  3004.    c.drawRect(0,0,this.width - 20,this.height);
  3005.    c._xscale = c._yscale = 100;
  3006.    c._y = c._x = 0;
  3007.    if(undefined != this.img)
  3008.    {
  3009.       c.createMc("imgMc",0,0);
  3010.       this.imgMc = c.imgMc;
  3011.       c.imgMc.loadMovie(this.path + this.img);
  3012.       c._visible = false;
  3013.       var prel = new Object.Preloader(this,c.imgMc);
  3014.    }
  3015.    this.textMc = c.write(this.cText,0,0);
  3016.    c.clear();
  3017. };
  3018. AutorFereastraClass.prototype.loadComplete = function()
  3019. {
  3020.    var mc = this.scr.getScrollContent();
  3021.    this.imgMc._x = this.width / 2 - this.imgMc._width / 2;
  3022.    this.imgMc._y = this.vspace / 2;
  3023.    this.textMc._y = this.vspace + this.imgMc._height;
  3024.    this.textMc._x = 5;
  3025.    mc._visible = true;
  3026. };
  3027. AutorFereastraClass.prototype.libShow = function()
  3028. {
  3029.    var w = Object.library[this.id].width;
  3030.    var h = Object.library[this.id].height;
  3031.    this.scr.setSize(w,h);
  3032.    this.scr.setScrollContent("mc" + this.id);
  3033. };
  3034. AutorFereastraClass.prototype.onUnload = function()
  3035. {
  3036.    this.scr._visible = false;
  3037.    this.scr.removeMovieClip();
  3038.    this.scr.unloadMovie();
  3039. };
  3040. AutorFereastraClass.prototype.setxmlSrc = function(xs)
  3041. {
  3042.    this.xmlSrc = xs;
  3043. };
  3044. AutorFereastraClass.prototype.getSrc = function()
  3045. {
  3046.    return this.xmlSrc;
  3047. };
  3048. AutorFereastraClass.prototype.setId = function(xid)
  3049. {
  3050.    this.xmlId = xid;
  3051. };
  3052. AutorFereastraClass.prototype.getId = function()
  3053. {
  3054.    return this.xmlId;
  3055. };
  3056. AutorFereastraClass.prototype.setWidth = function(w)
  3057. {
  3058.    this.width = w;
  3059. };
  3060. AutorFereastraClass.prototype.getWidth = function()
  3061. {
  3062.    return this.width;
  3063. };
  3064. AutorFereastraClass.prototype.setHeight = function(h)
  3065. {
  3066.    this.height = h;
  3067. };
  3068. AutorFereastraClass.prototype.getHeight = function()
  3069. {
  3070.    return this.height;
  3071. };
  3072. delete AutorFereastraClass;
  3073. var XmlTextBoxClass = Object.XmlTextBoxClass = function()
  3074. {
  3075.    this.path = "";
  3076.    this.watch("id",function(id, o, n)
  3077.    {
  3078.       this.id = n;
  3079.       this.update();
  3080.    }
  3081.    );
  3082.    var myLv = targetPath(this);
  3083.    this.tscr._visible = false;
  3084.    this.behaviour = Object.component.behaviour;
  3085.    this._parent.addListener(this);
  3086.    Object.__MainPlayControler__.addListener(this);
  3087.    this.width = this._width;
  3088.    this.height = this._height;
  3089.    this._xscale = this._yscale = 100;
  3090.    this.cLevel = eval(myLv.substring(0,myLv.indexOf(".")));
  3091.    if(this._width != undefined && this._height != undefined && this.id != undefined)
  3092.    {
  3093.       this.update();
  3094.    }
  3095.    else
  3096.    {
  3097.       trace("w: " + this._width + "\nh: " + this._height + "\nid: " + this.Id);
  3098.    }
  3099. };
  3100. XmlTextBoxClass.prototype = new MovieClip();
  3101. XmlTextBoxClass["extends"](MovieClip);
  3102. XmlTextBoxClass.prototype.setSize = function(w, h)
  3103. {
  3104.    this.width = w;
  3105.    this.height = h;
  3106.    this._xscale = this._yscale = 100;
  3107.    this.update();
  3108. };
  3109. XmlTextBoxClass.prototype.update = function()
  3110. {
  3111.    this._xscale = this._yscale = 100;
  3112.    this.show();
  3113. };
  3114. XmlTextBoxClass.prototype.show = function()
  3115. {
  3116.    this.scr._visible = false;
  3117.    this.scr.removeMovieClip();
  3118.    this.scr.unloadMovie();
  3119.    this.attachMc("FScrollPaneSymbol","scr",0,0);
  3120.    this.scr.boundingBox_mc._visible = false;
  3121.    this.scr.setSize(this.width,this.height);
  3122.    this.behaviour != 1 ? this.xmlShow() : this.libShow();
  3123.    this.scr.refreshPane();
  3124. };
  3125. XmlTextBoxClass.prototype.xmlShow = function()
  3126. {
  3127.    if(undefined != Object.contentFerXml)
  3128.    {
  3129.       var tArr = Object.contentFerXml.getVarsById(this.id);
  3130.       this.cText = tArr[5];
  3131.       if(undefined != tArr[6])
  3132.       {
  3133.          this.img = tArr[6][0];
  3134.          this.vspace = parseInt(tArr[6][1]);
  3135.       }
  3136.       else
  3137.       {
  3138.          this.img = undefined;
  3139.       }
  3140.    }
  3141.    else
  3142.    {
  3143.       this.cText = "<font face=\'eLEARNING_Black\'>Loading...</font>";
  3144.    }
  3145.    this.scr.setScrollContent("dummy");
  3146.    var c = this.scr.getScrollContent();
  3147.    c.clear();
  3148.    c.lineStyle(2,16777215);
  3149.    c.drawRect(0,0,this.width - 20,this.height);
  3150.    c._xscale = c._yscale = 100;
  3151.    c._y = c._x = 0;
  3152.    if(undefined != this.img)
  3153.    {
  3154.       c.createMc("imgMc",0,0);
  3155.       this.imgMc = c.imgMc;
  3156.       c.imgMc.loadMovie(this.path + this.img);
  3157.       c._visible = false;
  3158.       var prel = new Object.Preloader(this,c.imgMc);
  3159.    }
  3160.    this.textMc = c.write(this.cText,0,0);
  3161.    c.clear();
  3162. };
  3163. XmlTextBoxClass.prototype.loadComplete = function()
  3164. {
  3165.    var mc = this.scr.getScrollContent();
  3166.    this.imgMc._x = this.width / 2 - this.imgMc._width / 2;
  3167.    this.textMc._y = this.vspace + this.imgMc._height;
  3168.    this.textMc._x = 5;
  3169.    mc._visible = true;
  3170.    this.scr.refreshPane();
  3171. };
  3172. XmlTextBoxClass.prototype.libShow = function()
  3173. {
  3174.    var w = Object.library[this.id].width;
  3175.    var h = Object.library[this.id].height;
  3176.    this.scr.setSize(w,h);
  3177.    this.scr.setScrollContent("mc" + this.id);
  3178. };
  3179. XmlTextBoxClass.prototype.onUnload = function()
  3180. {
  3181.    this.scr._visible = false;
  3182.    this.scr.removeMovieClip();
  3183.    this.scr.unloadMovie();
  3184. };
  3185. XmlTextBoxClass.prototype.setxmlSrc = function(xs)
  3186. {
  3187.    this.xmlSrc = xs;
  3188. };
  3189. XmlTextBoxClass.prototype.getSrc = function()
  3190. {
  3191.    return this.xmlSrc;
  3192. };
  3193. XmlTextBoxClass.prototype.setId = function(xid)
  3194. {
  3195.    this.xmlId = xid;
  3196. };
  3197. XmlTextBoxClass.prototype.getId = function()
  3198. {
  3199.    return this.xmlId;
  3200. };
  3201. XmlTextBoxClass.prototype.setWidth = function(w)
  3202. {
  3203.    this.width = w;
  3204. };
  3205. XmlTextBoxClass.prototype.getWidth = function()
  3206. {
  3207.    return this.width;
  3208. };
  3209. XmlTextBoxClass.prototype.setHeight = function(h)
  3210. {
  3211.    this.height = h;
  3212. };
  3213. XmlTextBoxClass.prototype.getHeight = function()
  3214. {
  3215.    return this.height;
  3216. };
  3217. Function.prototype.replaceFunny = function(str)
  3218. {
  3219.    var s = str.indexOf("@@");
  3220.    while(s < str.length && s > 0)
  3221.    {
  3222.       var c = parseInt(str.substr(s + 2,3));
  3223.       str = str.substring(0,s) + String.fromCharCode(c) + str.substring(s + 5,str.length);
  3224.       s = str.indexOf("@@",s);
  3225.    }
  3226.    return str;
  3227. };
  3228. var SwLabelClass = Object.SwLabelClass = function()
  3229. {
  3230.    this.behaviour = Object.component.behaviour;
  3231.    this._parent.addListener(this);
  3232.    Object.__MainPlayControler__.addListener(this);
  3233.    this.createTextField("txLabel",this.nextDepth(),0,0,0,0);
  3234.    with(this.txlabel)
  3235.    {
  3236.       autoSize = "left";
  3237.       multiline = false;
  3238.       type = "dynamic";
  3239.       html = true;
  3240.       selectable = false;
  3241.       embedFonts = true;
  3242.    }
  3243.    this.update();
  3244. };
  3245. SwLabelClass.prototype = new MovieClip();
  3246. SwLabelClass["extends"](MovieClip);
  3247. SwLabelClass.prototype.update = function()
  3248. {
  3249.    this._xscale = this._yscale = 100;
  3250.    this.behaviour != 1 ? this.xmlShow() : this.libShow();
  3251. };
  3252. SwLabelClass.prototype.libShow = function()
  3253. {
  3254.    var mtx = Function.replaceFunny(Object.library[this.id].text);
  3255.    this.txLabel.htmlText = mtx;
  3256.    this.txLabel._width = this.txLabel.textWidth + 10;
  3257.    this.txLabel._height = this.txLabel.textHeight;
  3258. };
  3259. SwLabelClass.prototype.xmlShow = function()
  3260. {
  3261.    if(undefined != Object.contentFerXml)
  3262.    {
  3263.       var tArr = Object.contentFerXml.getLabelById(this.id);
  3264.       this.txLabel.htmlText = tArr[0];
  3265.    }
  3266.    else
  3267.    {
  3268.       this.txLabel.htmlText = "<font face=\'Arial\'>Loading...</font>";
  3269.    }
  3270.    this.txLabel._width = this.txLabel.textWidth + 15;
  3271.    this.txLabel._height = this.txLabel.textHeight;
  3272. };
  3273. delete SwLabelClass;
  3274. var TestCmpClass = Object.TestCmpClass = function()
  3275. {
  3276.    this._visible = false;
  3277.    this.arrPlhs = new Array();
  3278.    this.arrDragsB = new Array();
  3279.    this.arrDrags = new Array();
  3280.    this.Id = 0;
  3281. };
  3282. TestCmpClass.prototype = new MovieClip();
  3283. TestCmpClass["extends"](MovieClip);
  3284. TestCmpClass.prototype.addRel = function()
  3285. {
  3286.    var drag = arguments.shift();
  3287.    var btnBeh = arguments.pop();
  3288.    var strType = arguments.pop();
  3289.    var plhs = arguments[0];
  3290.    if(!drag.init_x && typeof drag == "movieclip")
  3291.    {
  3292.       drag.mcExtends(Object.DragClassB,this,plhs,strType,btnBeh);
  3293.       this.setNewDragB(drag);
  3294.    }
  3295.    var i = 0;
  3296.    while(i < plhs.length)
  3297.    {
  3298.       if(!plhs[i].init_x)
  3299.       {
  3300.          plhs[i].mcExtends(Object.PlhClass,this,strType);
  3301.       }
  3302.       this.setNewPlh(plhs[i]);
  3303.       if(typeof drag == "movieclip")
  3304.       {
  3305.          plhs[i].setNewDrag(drag);
  3306.       }
  3307.       i++;
  3308.    }
  3309. };
  3310. TestCmpClass.prototype.setNewPlh = function(plh)
  3311. {
  3312.    var found = 0;
  3313.    var i = 0;
  3314.    while(i < this.arrPlhs.length)
  3315.    {
  3316.       if(this.arrPlhs[i] == plh)
  3317.       {
  3318.          found = 1;
  3319.       }
  3320.       i++;
  3321.    }
  3322.    if(!found)
  3323.    {
  3324.       this.arrPlhs.push(plh);
  3325.    }
  3326.    found = 0;
  3327. };
  3328. TestCmpClass.prototype.setNewDragB = function(drag)
  3329. {
  3330.    var found = 0;
  3331.    var i = 0;
  3332.    while(i < this.arrDragsB.length)
  3333.    {
  3334.       if(this.arrDragsB[1] == drag)
  3335.       {
  3336.          found = 1;
  3337.       }
  3338.       i++;
  3339.    }
  3340.    if(!found)
  3341.    {
  3342.       this.arrDragsB.push(drag);
  3343.    }
  3344.    found = 0;
  3345. };
  3346. TestCmpClass.prototype.setNewDrag = function(drag)
  3347. {
  3348.    var found = 0;
  3349.    var i = 0;
  3350.    while(i < this.arrDrags.length)
  3351.    {
  3352.       if(this.arrDrags[1] == drag)
  3353.       {
  3354.          found = 1;
  3355.       }
  3356.       i++;
  3357.    }
  3358.    if(!found)
  3359.    {
  3360.       this.arrDrags.push(drag);
  3361.    }
  3362.    found = 0;
  3363. };
  3364. TestCmpClass.prototype.removeDrag = function(arg1)
  3365. {
  3366.    var i = 0;
  3367.    while(i < this.arrDrags.length)
  3368.    {
  3369.       if(this.arrDrags[i] == arg1)
  3370.       {
  3371.          this.arrDrags.splice(i,1);
  3372.          return true;
  3373.       }
  3374.       i++;
  3375.    }
  3376.    return false;
  3377. };
  3378. TestCmpClass.prototype.getPlhs = function(strTypev)
  3379. {
  3380.    var arr = new Array();
  3381.    var i = 0;
  3382.    while(i < this.arrPlhs.length)
  3383.    {
  3384.       if(this.arrPlhs[i].strType == strTypev)
  3385.       {
  3386.          arr.push(this.arrPlhs[i]);
  3387.       }
  3388.       i++;
  3389.    }
  3390.    return arr;
  3391. };
  3392. TestCmpClass.prototype.getBros = function(strTypev)
  3393. {
  3394.    var arr = new Array();
  3395.    var i = 0;
  3396.    while(i < this.arrDrags.length)
  3397.    {
  3398.       if(this.arrDrags[i].strType == strTypev)
  3399.       {
  3400.          arr.push(this.arrDrags[i]);
  3401.       }
  3402.       i++;
  3403.    }
  3404.    return arr;
  3405. };
  3406. TestCmpClass.prototype.getBrosB = function(strTypev)
  3407. {
  3408.    var arr = new Array();
  3409.    var i = 0;
  3410.    while(i < this.arrDragsB.length)
  3411.    {
  3412.       if(this.arrDragsB[i].strType == strTypev)
  3413.       {
  3414.          arr.push(this.arrDragsB[i]);
  3415.       }
  3416.       i++;
  3417.    }
  3418.    return arr;
  3419. };
  3420. TestCmpClass.prototype.getNName = function()
  3421. {
  3422.    this.Id = this.Id + 1;
  3423.    return "__created_movie__" + this.Id;
  3424. };
  3425. TestCmpClass.prototype.getNDepth = function()
  3426. {
  3427.    var depth = this.nextDepth();
  3428.    return depth;
  3429. };
  3430. TestCmpClass.prototype.validate = function(strTypev, resB, resG, onlyArr, serverInvolved, txBxDisplayRez)
  3431. {
  3432.    var plhsToCheck = new Array();
  3433.    var badAnswer = false;
  3434.    var arrToSend = new Array();
  3435.    var rezTx = "";
  3436.    if(undefined == onlyArr)
  3437.    {
  3438.       var i = 0;
  3439.       while(i < this.arrPlhs.length)
  3440.       {
  3441.          if(this.arrPlhs[i].strType == strTypev)
  3442.          {
  3443.             plhsToCheck.push(this.arrPlhs[i]);
  3444.          }
  3445.          i++;
  3446.       }
  3447.    }
  3448.    else
  3449.    {
  3450.       plhsToCheck = onlyArr;
  3451.    }
  3452.    if(serverInvolved)
  3453.    {
  3454.       var i = 0;
  3455.       while(i < plhsToCheck.length)
  3456.       {
  3457.          arrToSend.push(plhsToCheck[i],plhsToCheck[i].getCont());
  3458.          i++;
  3459.       }
  3460.       var arrSrez = this.performServerValid(arrToSend);
  3461.       badAnswer = arrSrez[0];
  3462.       rezTx = arrSrez[1];
  3463.    }
  3464.    else
  3465.    {
  3466.       var i = 0;
  3467.       while(i < plhsToCheck.length)
  3468.       {
  3469.          if(badAnswer)
  3470.          {
  3471.             break;
  3472.          }
  3473.          var corDrags = plhsToCheck[i].getDrags();
  3474.          if(corDrags.length > 0)
  3475.          {
  3476.             var cntNs = plhsToCheck[i].getCont();
  3477.             if(cntNs == null)
  3478.             {
  3479.                badAnswer = true;
  3480.             }
  3481.             else
  3482.             {
  3483.                badAnswer = true;
  3484.                var y = 0;
  3485.                while(y < corDrags.length)
  3486.                {
  3487.                   if(corDrags[y] == cntNs.plhF)
  3488.                   {
  3489.                      badAnswer = false;
  3490.                   }
  3491.                   if(corDrags[y] == cntNs)
  3492.                   {
  3493.                      badAnswer = false;
  3494.                   }
  3495.                   y++;
  3496.                }
  3497.             }
  3498.          }
  3499.          else if(corDrags.length == 0)
  3500.          {
  3501.             var cntNs = plhsToCheck[i].getCont();
  3502.             if(cntNs != null)
  3503.             {
  3504.                badAnswer = true;
  3505.             }
  3506.          }
  3507.          i++;
  3508.       }
  3509.       if(badAnswer)
  3510.       {
  3511.          rezTx = "Bad";
  3512.       }
  3513.       else
  3514.       {
  3515.          rezTx = "Good";
  3516.       }
  3517.    }
  3518.    if(badAnswer)
  3519.    {
  3520.       if(resB)
  3521.       {
  3522.          this.reset(strTypev,onlyArr,txBxDisplayRez);
  3523.       }
  3524.       if(undefined != txBxDisplayRez)
  3525.       {
  3526.          txBxDisplayRez.text = rezTx;
  3527.       }
  3528.    }
  3529.    else
  3530.    {
  3531.       if(resG)
  3532.       {
  3533.          this.reset(strTypev,onlyArr,txBxDisplayRez);
  3534.       }
  3535.       if(undefined != txBxDisplayRez)
  3536.       {
  3537.          txBxDisplayRez.text = rezTx;
  3538.       }
  3539.    }
  3540. };
  3541. TestCmpClass.prototype.performServerValid = function(rezArr)
  3542. {
  3543.    var arrMy = new Array();
  3544.    arrMy.push(true);
  3545.    arrMy.push("Good");
  3546.    return arrMy;
  3547. };
  3548. TestCmpClass.prototype.reset = function(strTypev, onlyArr, txBxDisplayRez)
  3549. {
  3550.    if(undefined == onlyArr)
  3551.    {
  3552.       var i = 0;
  3553.       while(i < this.arrPlhs.length)
  3554.       {
  3555.          if(this.arrPlhs[i].strType == strTypev)
  3556.          {
  3557.             this.arrPlhs[i].setCont(null);
  3558.          }
  3559.          i++;
  3560.       }
  3561.    }
  3562.    else
  3563.    {
  3564.       var i = 0;
  3565.       while(i < onlyArr.length)
  3566.       {
  3567.          onlyArr[i].setCont(null);
  3568.          i++;
  3569.       }
  3570.    }
  3571.    if(undefined != txBxDisplayRez)
  3572.    {
  3573.       txBxDisplayRez.text = "";
  3574.    }
  3575. };
  3576. Object.DragClassB = function(plhF, arrPlhs, strType, btnBeh)
  3577. {
  3578.    this.init_x = this._x;
  3579.    this.init_y = this._y;
  3580.    this.btnBeh = btnBeh;
  3581.    this.strType = strType;
  3582.    this.plhF = plhF;
  3583.    this.lastCreated = null;
  3584.    this.corPlhs = arrPlhs;
  3585.    this.cnt = null;
  3586.    this.init();
  3587. };
  3588. Object.DragClassB.prototype.init = function()
  3589. {
  3590.    this.onMouseMove = function()
  3591.    {
  3592.       if(!this.btnBeh)
  3593.       {
  3594.          return undefined;
  3595.       }
  3596.       if(this.getLastCreated() == null && this.hitTest(_root._xmouse,_root._ymouse,false))
  3597.       {
  3598.          var nName = this.plhF.getNName();
  3599.          var nDepth = this.plhF.getNDepth();
  3600.          duplicateMovieClip(this,nName,16384 + nDepth);
  3601.          nName = eval(this._parent + "." + nName);
  3602.          if(nDepth < this.getDepth())
  3603.          {
  3604.             this.swapDepths(nName);
  3605.          }
  3606.          nName.mcExtends(Object.DragClass,this,this.corPlhs,this.strType);
  3607.          this.setNewDrag(nName);
  3608.          this.setLastCreated(nName);
  3609.       }
  3610.       else if(this.getLastCreated() != null && !this.hitTest(_root._xmouse,_root._ymouse,false))
  3611.       {
  3612.          this.removeDrag(this.getLastCreated());
  3613.          removeMovieClip(this.getLastCreated());
  3614.          this.setLastCreated(null);
  3615.       }
  3616.    };
  3617.    this.setLastCreated = function(arg1)
  3618.    {
  3619.       this.lastCreated = arg1;
  3620.    };
  3621.    this.getLastCreated = function()
  3622.    {
  3623.       return this.lastCreated;
  3624.    };
  3625.    this.removeDrag = function(arg1)
  3626.    {
  3627.       return this.plhF.removeDrag(arg1);
  3628.    };
  3629.    this.getBros = function()
  3630.    {
  3631.       if(this.btnBeh)
  3632.       {
  3633.          var arr = this.plhF.getBros(this.strType);
  3634.          return arr;
  3635.       }
  3636.       var arr = this.plhF.getBrosB(this.strType);
  3637.       return arr;
  3638.    };
  3639.    this.getPlhs = function(strTypev)
  3640.    {
  3641.       return this.plhF.getPlhs(strTypev);
  3642.    };
  3643.    this.setNewDrag = function(drag)
  3644.    {
  3645.       this.plhF.setNewDrag(drag);
  3646.    };
  3647.    this.setCnt = function(arg)
  3648.    {
  3649.       this.cnt = arg;
  3650.    };
  3651.    this.getCnt = function()
  3652.    {
  3653.       return this.cnt;
  3654.    };
  3655.    this.rlse = function()
  3656.    {
  3657.       this._x = this.init_x;
  3658.       this._y = this.init_y;
  3659.    };
  3660.    this.onPress = function()
  3661.    {
  3662.       if(this.btnBeh)
  3663.       {
  3664.          return undefined;
  3665.       }
  3666.       startDrag(this,0);
  3667.    };
  3668.    this.onRelease = function()
  3669.    {
  3670.       if(this.btnBeh)
  3671.       {
  3672.          return undefined;
  3673.       }
  3674.       plCobjs = this.plhF.getPlhs(this.strType);
  3675.       i = 0;
  3676.       while(i < plCobjs.length)
  3677.       {
  3678.          plCobj = plCobjs[i];
  3679.          if(plCobj.hitTest(this))
  3680.          {
  3681.             plCobj.setCont(this);
  3682.             stopDrag();
  3683.             this._x = plCobj._x + (plCobj._width / 2 - this._width / 2);
  3684.             this._y = plCobj._y;
  3685.             this._parent[this.strType](plCobj,this.corPlhs);
  3686.             return undefined;
  3687.          }
  3688.          i++;
  3689.       }
  3690.       this.stopDrag();
  3691.       this._parent[this.strType]();
  3692.       this.rlse();
  3693.    };
  3694.    this.onReleaseOutside = this.onRelease;
  3695.    this.onDragOut = function()
  3696.    {
  3697.       if(this.btnBeh)
  3698.       {
  3699.          return undefined;
  3700.       }
  3701.       var bros = this.plhF.getBrosB(this.strType);
  3702.       i = 0;
  3703.       while(i < bros.length)
  3704.       {
  3705.          if(this.hitTest(bros[i]) && this.getDepth() < bros[i].getDepth())
  3706.          {
  3707.             this.swapDepths(bros[i]);
  3708.          }
  3709.          i++;
  3710.       }
  3711.    };
  3712.    this.setCnt = function(arg)
  3713.    {
  3714.       this.cnt = arg;
  3715.    };
  3716.    this.getCnt = function()
  3717.    {
  3718.       return this.cnt;
  3719.    };
  3720. };
  3721. Object.DragClass = function(plhF, arrPlhs, strType)
  3722. {
  3723.    this.init_x = this._x;
  3724.    this.init_y = this._y;
  3725.    this.strType = strType;
  3726.    this.plhF = plhF;
  3727.    this.corPlhs = arrPlhs;
  3728.    this.cnt = null;
  3729.    this.init();
  3730. };
  3731. Object.DragClass.prototype.init = function()
  3732. {
  3733.    this.rlse = function()
  3734.    {
  3735.       this._x = this.init_x;
  3736.       this._y = this.init_y;
  3737.    };
  3738.    this.onPress = function()
  3739.    {
  3740.       this.plhF.setLastCreated(null);
  3741.       startDrag(this,0);
  3742.    };
  3743.    this.onMouseMove = function()
  3744.    {
  3745.       plCobjs = this.plhF.getPlhs(this.strType);
  3746.       var j = this.plhF.plhF.arrPlhs.length - 1;
  3747.       while(j >= 0)
  3748.       {
  3749.          this._parent.normal(this.plhF.plhF.arrPlhs[j]);
  3750.          if(this.plhF.plhF.arrPlhs[j].nucleo.hitTest(this.hit))
  3751.          {
  3752.             this._parent.highlight(this.plhF.plhF.arrPlhs[j]);
  3753.          }
  3754.          j--;
  3755.       }
  3756.    };
  3757.    this.onRelease = function()
  3758.    {
  3759.       plCobjs = this.plhF.getPlhs(this.strType);
  3760.       i = plCobjs.length - 1;
  3761.       while(i >= 0)
  3762.       {
  3763.          plCobj = plCobjs[i];
  3764.          if(plCobj.nucleo.hitTest(this.hit))
  3765.          {
  3766.             trace("release" + plCobj);
  3767.             this._parent.normal(plCobj);
  3768.             this._parent.callback(this,plCobjs[i],this.plhF.plhF.arrPlhs);
  3769.             plCobj.setCont(this);
  3770.             stopDrag();
  3771.             var point = new Object();
  3772.             point.x = plCobj._x;
  3773.             point.y = plCobj._y;
  3774.             plCobj.localToGlobal(point);
  3775.             this.globalToLocal(point);
  3776.             this._x = point.x;
  3777.             this._y = point.y;
  3778.             return undefined;
  3779.          }
  3780.          i--;
  3781.       }
  3782.       var j = this.plhF.plhF.arrPlhs.length - 1;
  3783.       while(j >= 0)
  3784.       {
  3785.          this._parent.normal(this.plhF.plhF.arrPlhs[j]);
  3786.          if(this.plhF.plhF.arrPlhs[j].nucleo.hitTest(this.hit))
  3787.          {
  3788.             this._parent.ncallback(this,this.plhF.plhF.arrPlhs[j]);
  3789.             break;
  3790.          }
  3791.          j--;
  3792.       }
  3793.       this.plhF.removeDrag(this);
  3794.       if(this.getCnt() != null)
  3795.       {
  3796.          this.getCnt().setCont(null);
  3797.       }
  3798.       removeMovieClip(this);
  3799.    };
  3800.    this.onReleaseOutside = this.onRelease;
  3801.    this.onDragOut = function()
  3802.    {
  3803.       var bros = this.plhF.getBros();
  3804.       i = 0;
  3805.       while(i < bros.length)
  3806.       {
  3807.          if(this.hitTest(bros[i]) && this.getDepth() < bros[i].getDepth())
  3808.          {
  3809.             this.swapDepths(bros[i]);
  3810.          }
  3811.          i++;
  3812.       }
  3813.    };
  3814.    this.setCnt = function(arg)
  3815.    {
  3816.       this.cnt = arg;
  3817.    };
  3818.    this.getCnt = function()
  3819.    {
  3820.       return this.cnt;
  3821.    };
  3822. };
  3823. Object.PlhClass = function(plhF, strType)
  3824. {
  3825.    this.init_x = this._x;
  3826.    this.init_y = this._y;
  3827.    this.strType = strType;
  3828.    this.plhF = plhF;
  3829.    this.init();
  3830.    this.Cont = null;
  3831.    this.arrDrags = new Array();
  3832. };
  3833. Object.PlhClass.prototype.init = function()
  3834. {
  3835.    this.setCont = function(cnt)
  3836.    {
  3837.       if(this.Cont != null && this.Cont != cnt && this.Cont.getCnt() == this)
  3838.       {
  3839.          if(this.cont.plhF.removeDrag(this.cont))
  3840.          {
  3841.             removeMovieClip(this.cont);
  3842.          }
  3843.          else
  3844.          {
  3845.             this.cont.rlse();
  3846.          }
  3847.       }
  3848.       this.Cont = cnt;
  3849.       cnt.setCnt(this);
  3850.    };
  3851.    this.getCont = function()
  3852.    {
  3853.       return this.Cont;
  3854.    };
  3855.    this.setNewDrag = function(drag)
  3856.    {
  3857.       var found = 0;
  3858.       var i = 0;
  3859.       while(i < this.arrDrags.length)
  3860.       {
  3861.          if(this.arrDrags[1] == drag)
  3862.          {
  3863.             found = 1;
  3864.          }
  3865.          i++;
  3866.       }
  3867.       if(!found)
  3868.       {
  3869.          this.arrDrags.push(drag);
  3870.       }
  3871.       found = 0;
  3872.    };
  3873.    this.getDrags = function()
  3874.    {
  3875.       return this.arrDrags;
  3876.    };
  3877. };
  3878. MovieClip.prototype.mcExtends = function(superClass)
  3879. {
  3880.    if(typeof superClass == "function")
  3881.    {
  3882.       this.__proto__ = superClass.prototype;
  3883.       if(typeof this.attachMovie == "undefined")
  3884.       {
  3885.          var o = this.__proto__;
  3886.          var p = o.__proto__.__proto__;
  3887.          while(p != null)
  3888.          {
  3889.             p = p.__proto__;
  3890.             o = o.__proto__;
  3891.          }
  3892.          o.__proto__ = MovieClip.prototype;
  3893.       }
  3894.       arguments.splice(0,1);
  3895.       superClass.apply(this,arguments);
  3896.    }
  3897.    else
  3898.    {
  3899.       trace("mcExtends: Incorrect superClass type or path - " + typeof superClass);
  3900.    }
  3901. };
  3902. var TestMcClass = Object.TestMcClass = function()
  3903. {
  3904.    this._visible = false;
  3905.    this.init();
  3906. };
  3907. TestMcClass.prototype = new MovieClip();
  3908. TestMcClass["extends"](MovieClip);
  3909. TestMcClass.prototype.init = function()
  3910. {
  3911.    this.testComp = this._parent[this.testComp];
  3912.    this.mc = this._parent[this._targetInstanceName];
  3913.    var i = 0;
  3914.    while(i < this.plhs.length)
  3915.    {
  3916.       this.plhs[i] = this._parent[this.plhs[i]];
  3917.       i++;
  3918.    }
  3919.    this.testComp.addRel(this.mc,this.plhs,this.test,this.btnBeh);
  3920. };
  3921. Object.FRadioButtonGroupC = function()
  3922. {
  3923.    this.radioInstances = new Array();
  3924.    trace("hey");
  3925. };
  3926. Object.FRadioButtonGroupC.prototype = new FUIComponentClass();
  3927. var FRB = Object.FRadioButtonGroupC.prototype;
  3928. FRB.addRadioInstance = function(instance)
  3929. {
  3930.    this.radioInstances.push(instance);
  3931.    this.radioInstances[0].tabEnabled = true;
  3932. };
  3933. FRB.setEnabled = function(enableFlag)
  3934. {
  3935.    var i = 0;
  3936.    while(i < this.radioInstances.length)
  3937.    {
  3938.       this.radioInstances[i].setEnabled(enableFlag);
  3939.       i++;
  3940.    }
  3941. };
  3942. FRB.getEnabled = function()
  3943. {
  3944.    var i = 0;
  3945.    while(i < this.radioInstances.length)
  3946.    {
  3947.       if(this.radioInstances[i].getEnabled() != this.radioInstances[0].getEnabled())
  3948.       {
  3949.          return undefined;
  3950.       }
  3951.       i++;
  3952.    }
  3953.    return this.radioInstances[0].getEnabled();
  3954. };
  3955. FRB.setClickHandler = function(clickHandler, obj)
  3956. {
  3957.    var i = 0;
  3958.    while(i < this.radioInstances.length)
  3959.    {
  3960.       this.radioInstances[i].setClickHandler(clickHandler,obj);
  3961.       i++;
  3962.    }
  3963. };
  3964. FRB.getValue = function()
  3965. {
  3966.    var i = 0;
  3967.    while(i < this.radioInstances.length)
  3968.    {
  3969.       if(this.radioInstances[i].selected == true)
  3970.       {
  3971.          if(this.radioInstances[i].data == "" || this.radioInstances[i].data == undefined)
  3972.          {
  3973.             return this.radioInstances[i].getLabel();
  3974.          }
  3975.          return this.radioInstances[i].data;
  3976.       }
  3977.       i++;
  3978.    }
  3979. };
  3980. FRB.getData = function()
  3981. {
  3982.    var i = 0;
  3983.    while(i < this.radioInstances.length)
  3984.    {
  3985.       if(this.radioInstances[i].selected)
  3986.       {
  3987.          return this.radioInstances[i].getData();
  3988.       }
  3989.       i++;
  3990.    }
  3991. };
  3992. FRB.getInstance = function()
  3993. {
  3994.    var i = 0;
  3995.    while(i < this.radioInstances.length)
  3996.    {
  3997.       if(this.radioInstances[i].selected == true)
  3998.       {
  3999.          return i;
  4000.       }
  4001.       undefined;
  4002.       i++;
  4003.    }
  4004. };
  4005. FRB.setValue = function(dataValue)
  4006. {
  4007.    var i = 0;
  4008.    while(i < this.radioInstances.length)
  4009.    {
  4010.       if(this.radioInstances[i].data == dataValue)
  4011.       {
  4012.          this.radioInstances[i].setValue(true);
  4013.          return undefined;
  4014.       }
  4015.       i++;
  4016.    }
  4017.    var i = 0;
  4018.    while(i < this.radioInstances.length)
  4019.    {
  4020.       if(this.radioInstances[i].getLabel() == dataValue)
  4021.       {
  4022.          this.radioInstances[i].setValue(true);
  4023.       }
  4024.       i++;
  4025.    }
  4026. };
  4027. FRB.setSize = function(w)
  4028. {
  4029.    var i = 0;
  4030.    while(i < this.radioInstances.length)
  4031.    {
  4032.       this.radioInstances[i].setSize(w);
  4033.       i++;
  4034.    }
  4035. };
  4036. FRB.getSize = function()
  4037. {
  4038.    var widestRadio = 0;
  4039.    var i = 0;
  4040.    while(i < this.radioInstances.length)
  4041.    {
  4042.       if(this.radioInstances[i].width >= widestRadio)
  4043.       {
  4044.          widestRadio = this.radioInstances[i].width;
  4045.       }
  4046.       i++;
  4047.    }
  4048.    return widestRadio;
  4049. };
  4050. FRB.setGroupName = function(groupName)
  4051. {
  4052.    this.oldGroupName = this.radioInstances[0].groupName;
  4053.    var i = 0;
  4054.    while(i < this.radioInstances.length)
  4055.    {
  4056.       this.radioInstances[i].groupName = groupName;
  4057.       this.radioInstances[i].addToRadioGroup();
  4058.       i++;
  4059.    }
  4060.    delete this._parent[this.oldGroupName];
  4061. };
  4062. FRB.getGroupName = function()
  4063. {
  4064.    return this.radioInstances[0].groupName;
  4065. };
  4066. FRB.setLabelPlacement = function(pos)
  4067. {
  4068.    var i = 0;
  4069.    while(i < this.radioInstances.length)
  4070.    {
  4071.       this.radioInstances[i].setLabelPlacement(pos);
  4072.       i++;
  4073.    }
  4074. };
  4075. FRB.setStyleProperty = function(propName, value, isGlobal)
  4076. {
  4077.    var i = 0;
  4078.    while(i < this.radioInstances.length)
  4079.    {
  4080.       this.radioInstances[i].setStyleProperty(propName,value,isGlobal);
  4081.       i++;
  4082.    }
  4083. };
  4084. FRB.addListener = function()
  4085. {
  4086.    var i = 0;
  4087.    while(i < this.radioInstances.length)
  4088.    {
  4089.       this.radioInstances[i].addListener();
  4090.       i++;
  4091.    }
  4092. };
  4093. FRB.applyChanges = function()
  4094. {
  4095.    var i = 0;
  4096.    while(i < this.radioInstances.length)
  4097.    {
  4098.       this.radioInstances[i].applyChanges();
  4099.       i++;
  4100.    }
  4101. };
  4102. FRB.removeListener = function(component)
  4103. {
  4104.    var i = 0;
  4105.    while(i < this.radioInstances.length)
  4106.    {
  4107.       this.radioInstances[i].removeListener(component);
  4108.       i++;
  4109.    }
  4110. };
  4111. Object.BUClass = function()
  4112. {
  4113.    this.init();
  4114. };
  4115. Object.BUClass.prototype = new FUIComponentClass();
  4116. Object.registerClass("ButonUniversal",Object.BUClass);
  4117. var BUC = Object.BUClass.prototype;
  4118. BUC.init = function()
  4119. {
  4120.    super.setSize(this._width,this._height);
  4121.    this.boundingBox_mc._visible = false;
  4122.    this.textStyle = new TextFormat();
  4123.    this.textStyle.font = "eLEARNING_Medium";
  4124.    this.textStyle.size = 18;
  4125.    this.textStyle.align = "left";
  4126.    this.attachMovie("fpb_states2","fpbState_mc",1);
  4127.    this.attachMovie("FLabelSymbol","fLabel_mc",2);
  4128.    this.attachMovie("fpb_hitArea","fpb_hitArea_mc",3);
  4129.    super.init();
  4130.    this.createTextField("styleTable",100,0,0,0,0);
  4131.    this.styleTable.type = "dynamic";
  4132.    this.styleTable.embedFonts = true;
  4133.    this.btnState = false;
  4134.    this.setClickHandler(this.clickHandler);
  4135.    this._xscale = 100;
  4136.    this._yscale = 100;
  4137.    this.setSize(this.width,this.inaltime);
  4138.    if(this.data == "" || this.tipBtn == 3 || this.tipBtn == 4)
  4139.    {
  4140.       this.data = undefined;
  4141.    }
  4142.    else
  4143.    {
  4144.       this.setData(this.data);
  4145.    }
  4146.    if(this.tipBtn == undefined)
  4147.    {
  4148.       this.tipBtn = 4;
  4149.    }
  4150.    this.selected = false;
  4151.    if(this.label != undefined)
  4152.    {
  4153.       this.setLabel(this.label);
  4154.    }
  4155.    this.ROLE_SYSTEM_PUSHBUTTON = 43;
  4156.    this.STATE_SYSTEM_PRESSED = 8;
  4157.    this.EVENT_OBJECT_STATECHANGE = 32778;
  4158.    this.EVENT_OBJECT_NAMECHANGE = 32780;
  4159.    this._accImpl.master = this;
  4160.    this._accImpl.stub = false;
  4161.    this._accImpl.get_accRole = this.get_accRole;
  4162.    this._accImpl.get_accName = this.get_accName;
  4163.    this._accImpl.get_accState = this.get_accState;
  4164.    this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
  4165.    this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
  4166.    if(this.tipBtn == 1 || this.tipBtn == 2)
  4167.    {
  4168.       this.addToRadioGroup();
  4169.    }
  4170. };
  4171. BUC.setHitArea = function(w, h)
  4172. {
  4173.    var hit = this.fpb_hitArea_mc;
  4174.    this.hitArea = hit;
  4175.    hit._visible = false;
  4176.    hit._width = w;
  4177.    hit._height = arguments.length <= 1 ? hit._height : h;
  4178. };
  4179. BUC.setSize = function(w, h)
  4180. {
  4181.    w = w >= 6 ? w : 6;
  4182.    if(arguments.length > 1)
  4183.    {
  4184.       if(h < 6)
  4185.       {
  4186.          h = 6;
  4187.       }
  4188.    }
  4189.    super.setSize(w,h);
  4190.    this.setLabel(this.getLabel());
  4191.    this.arrangeLabel();
  4192.    this.setHitArea(w,h);
  4193.    this.boundingBox_mc._width = w;
  4194.    this.boundingBox_mc._height = h;
  4195.    this.drawFrame();
  4196.    if(this.focused)
  4197.    {
  4198.       super.myOnSetFocus();
  4199.    }
  4200.    this.initContentPos("fLabel_mc");
  4201. };
  4202. BUC.arrangeLabel = function()
  4203. {
  4204.    var label = this.fLabel_mc;
  4205.    var h = this.height;
  4206.    var w = this.width - 2;
  4207.    var b = 1;
  4208.    this.fLabel_mc.setSize(w - b * 4);
  4209.    label._x = 10;
  4210.    label._y = h / 2 - label._height / 2;
  4211. };
  4212. BUC.getLabel = function()
  4213. {
  4214.    return this.fLabel_mc.labelField.text;
  4215. };
  4216. BUC.setLabel = function(label)
  4217. {
  4218.    this.fLabel_mc.setLabel(label);
  4219.    this.txtFormat();
  4220.    this.arrangeLabel();
  4221.    if(Accessibility.isActive())
  4222.    {
  4223.       Accessibility.sendEvent(this,0,this.EVENT_OBJECT_NAMECHANGE);
  4224.    }
  4225. };
  4226. BUC.setData = function(dataValue)
  4227. {
  4228.    this.data = dataValue;
  4229. };
  4230. BUC.getData = function()
  4231. {
  4232.    return this.data;
  4233. };
  4234. BUC.getState = function()
  4235. {
  4236.    return this.selected;
  4237. };
  4238. BUC.getGroupName = function()
  4239. {
  4240.    return this.groupName;
  4241. };
  4242. BUC.setGroupName = function(groupName)
  4243. {
  4244.    var i = 0;
  4245.    while(i < this._parent[this.groupName].radioInstances.length)
  4246.    {
  4247.       if(this._parent[this.groupName].radioInstances[i] == this)
  4248.       {
  4249.          delete this._parent[this.groupName].radioInstances[i];
  4250.       }
  4251.       i++;
  4252.    }
  4253.    this.groupName = groupName;
  4254.    this.addToRadioGroup();
  4255. };
  4256. BUC.setValue = function(selected)
  4257. {
  4258.    if(selected || selected == undefined)
  4259.    {
  4260.       this.setState(true);
  4261.       this.focusRect.removeMovieClip();
  4262.       this.drawFrame();
  4263.       this.setBtnState(true);
  4264.       this.executeCallBack();
  4265.    }
  4266.    else if(selected == false)
  4267.    {
  4268.       this.setState(false);
  4269.    }
  4270. };
  4271. BUC.setTabState = function(selected)
  4272. {
  4273.    Selection.setFocus(this);
  4274.    this.setState(selected);
  4275.    this.drawFocusRect();
  4276.    this.executeCallBack();
  4277. };
  4278. BUC.getValue = function()
  4279. {
  4280.    if(this.selected)
  4281.    {
  4282.       if(this.data == "" || this.data == undefined)
  4283.       {
  4284.          return this.getLabel();
  4285.       }
  4286.       return this.data;
  4287.    }
  4288. };
  4289. BUC.setState = function(selected)
  4290. {
  4291.    if((selected || selected == undefined) && (this.tipBtn == 1 || this.tipBtn == 2))
  4292.    {
  4293.       this.tabEnabled = true;
  4294.       for(var i in this._parent)
  4295.       {
  4296.          if(this != this._parent[i] && this._parent[i].groupName == this.groupName && (this._parent[i].tipBtn == 1 || this._parent[i].tipBtn == 2))
  4297.          {
  4298.             this._parent[i].setState(false);
  4299.             this._parent[i].tabEnabled = false;
  4300.          }
  4301.       }
  4302.    }
  4303.    if(this.enable && this.tipBtn != 4)
  4304.    {
  4305.       this.flabel_mc.setEnabled(true);
  4306.       if(selected || selected == undefined)
  4307.       {
  4308.          this.fpbState_mc.gotoAndStop(3);
  4309.          if(this.tipBtn === 1)
  4310.          {
  4311.             this.enabled = false;
  4312.          }
  4313.          this.selected = true;
  4314.          this.tabEnabled = true;
  4315.          this.tabFocused = true;
  4316.          this.fLabel_mc.setColor("0xeeeeee");
  4317.       }
  4318.       else
  4319.       {
  4320.          this.fpbState_mc.gotoAndStop(1);
  4321.          this.drawFrame();
  4322.          this.enabled = true;
  4323.          this.selected = false;
  4324.          this.tabEnabled = false;
  4325.          var enabTrue = this._parent[this.groupName].getEnabled();
  4326.          var noneSelect = this._parent[this.groupName].getValue() == undefined;
  4327.          if(enabTrue && noneSelect)
  4328.          {
  4329.             this._parent[this.groupName].radioInstances[0].tabEnabled = true;
  4330.          }
  4331.       }
  4332.    }
  4333.    else
  4334.    {
  4335.       this.flabel_mc.setEnabled(false);
  4336.       if(selected || selected == undefined)
  4337.       {
  4338.          this.fpbState_m.gotoAndStop("selectedDisabled");
  4339.          this.enabled = false;
  4340.          this.selected = true;
  4341.          this.tabEnabled = false;
  4342.       }
  4343.       else
  4344.       {
  4345.          this.fpbState_m.gotoAndStop("unselectedDisabled");
  4346.          this.enabled = false;
  4347.          this.selected = false;
  4348.          this.tabEnabled = false;
  4349.       }
  4350.    }
  4351.    if(Accessibility.isActive())
  4352.    {
  4353.       Accessibility.sendEvent(this,0,this.EVENT_OBJECT_STATECHANGE,true);
  4354.    }
  4355. };
  4356. BUC.getEnabled = function()
  4357. {
  4358.    return this.enabled;
  4359. };
  4360. BUC.setEnabled = function(enable)
  4361. {
  4362.    if(enable || enable == undefined)
  4363.    {
  4364.       this.gotoFrame(1);
  4365.       this.drawFrame();
  4366.       this.flabel_mc.setEnabled(true);
  4367.       this.enabled = true;
  4368.       this.enable = true;
  4369.       super.setEnabled(true);
  4370.    }
  4371.    else
  4372.    {
  4373.       this.gotoFrame(4);
  4374.       this.drawFrame();
  4375.       this.flabel_mc.setEnabled(false);
  4376.       this.enabled = false;
  4377.       this.enable = false;
  4378.       super.setEnabled(false);
  4379.    }
  4380. };
  4381. BUC.getGroupName = function()
  4382. {
  4383.    return this.groupName;
  4384. };
  4385. BUC.txtFormat = function()
  4386. {
  4387.    var txtS = this.textStyle;
  4388.    var sTbl = this.styleTable;
  4389.    txtS.align = sTbl.textAlign.value != undefined ? undefined : (txtS.align = "left");
  4390.    txtS.leftMargin = sTbl.textLeftMargin.value != undefined ? undefined : (txtS.leftMargin = 1);
  4391.    txtS.rightMargin = sTbl.textRightMargin.value != undefined ? undefined : (txtS.rightMargin = 1);
  4392.    if(this.fLabel_mc._height > this.height)
  4393.    {
  4394.       super.setSize(this.width,this.fLabel_mc._height);
  4395.    }
  4396.    else
  4397.    {
  4398.       super.setSize(this.width,this.height);
  4399.    }
  4400.    this.fLabel_mc.labelField.setTextFormat(this.textStyle);
  4401.    this.setEnabled(this.enable);
  4402. };
  4403. BUC.drawFrame = function()
  4404. {
  4405.    var b = 1;
  4406.    var x1 = 0;
  4407.    var y1 = 0;
  4408.    var x2 = this.width;
  4409.    var y2 = this.height;
  4410.    var mc_array = ["up_mc","over_mc","down_mc","disabled_mc"];
  4411.    var frame = mc_array[this.fpbState_mc._currentframe - 1];
  4412.    var mc = "frame";
  4413.    var i = 0;
  4414.    while(i < 6)
  4415.    {
  4416.       x1 += i % 2 * b;
  4417.       y1 += i % 2 * b;
  4418.       x2 -= (i + 1) % 2 * b;
  4419.       y2 -= (i + 1) % 2 * b;
  4420.       var w = Math.abs(x1 - x2) + 2 * b;
  4421.       var h = Math.abs(y1 - y2) + 2 * b;
  4422.       this.fpbState_mc[frame][mc + i]._width = w;
  4423.       this.fpbState_mc[frame][mc + i]._height = h;
  4424.       this.fpbState_mc[frame][mc + i]._x = x1 - b;
  4425.       this.fpbState_mc[frame][mc + i]._y = y1 - b;
  4426.       i++;
  4427.    }
  4428. };
  4429. BUC.setClickHandler = function(chng, obj)
  4430. {
  4431.    this.handlerObj = arguments.length >= 2 ? obj : this._parent;
  4432.    this.clickHandler = chng;
  4433. };
  4434. BUC.executeCallBack = function()
  4435. {
  4436.    if(this.tipBtn == 3 || this.tipBtn == 2 || this.tipBtn == 4)
  4437.    {
  4438.       this.handlerObj[this.clickHandler](this);
  4439.    }
  4440.    else
  4441.    {
  4442.       this.handlerObj[this.clickHandler](this._parent[this.radioGroup]);
  4443.    }
  4444. };
  4445. BUC.initContentPos = function(mc)
  4446. {
  4447.    this.incrVal = 1;
  4448.    this.initx = this[mc]._x - this.getBtnState() * this.incrVal;
  4449.    this.inity = this[mc]._y - this.getBtnState() * this.incrVal;
  4450.    this.togx = this.initx + this.incrVal;
  4451.    this.togy = this.inity + this.incrVal;
  4452. };
  4453. BUC.setBtnState = function(state)
  4454. {
  4455.    this.btnState = state;
  4456.    if(state)
  4457.    {
  4458.       this.fLabel_mc._x = this.togx;
  4459.       this.fLabel_mc._y = this.togy;
  4460.    }
  4461.    else
  4462.    {
  4463.       this.fLabel_mc._x = this.initx;
  4464.       this.fLabel_mc._y = this.inity;
  4465.    }
  4466. };
  4467. BUC.getBtnState = function()
  4468. {
  4469.    return this.btnState;
  4470. };
  4471. BUC.myOnSetFocus = function()
  4472. {
  4473.    this.focused = true;
  4474.    super.myOnSetFocus();
  4475. };
  4476. BUC.selectat = function(b)
  4477. {
  4478.    if(b != undefined)
  4479.    {
  4480.       if(b)
  4481.       {
  4482.          this.boundingBox_mc._visible = true;
  4483.          this.boundingBox_mc._width = this._width + 4;
  4484.          this.boundingBox_mc._height = this._height + 4;
  4485.          this.boundingBox_mc._x = -2;
  4486.          this.boundingBox_mc._y = -2;
  4487.       }
  4488.       else
  4489.       {
  4490.          this.boundingBox_mc._visible = false;
  4491.          this.boundingBox_mc._width = this._width - 4;
  4492.          this.boundingBox_mc._height = this._height - 4;
  4493.       }
  4494.    }
  4495.    else if(this.boundingBox_mc._visible)
  4496.    {
  4497.       this.boundingBox_mc._visible = false;
  4498.       this.boundingBox_mc._width = this._width - 4;
  4499.       this.boundingBox_mc._height = this._height - 4;
  4500.    }
  4501.    else
  4502.    {
  4503.       this.boundingBox_mc._visible = true;
  4504.       this.boundingBox_mc._width += 4;
  4505.       this.boundingBox_mc._height += 4;
  4506.       this.boundingBox_mc._x = -2;
  4507.       this.boundingBox_mc._y = -2;
  4508.    }
  4509. };
  4510. BUC.addToRadioGroup = function()
  4511. {
  4512.    if(this._parent[this.groupName] == undefined)
  4513.    {
  4514.       this._parent[this.groupName] = new Object.FRadioButtonGroupC();
  4515.    }
  4516.    this._parent[this.groupName].addRadioInstance(this);
  4517. };
  4518. BUC.onPress = function()
  4519. {
  4520.    this.pressFocus();
  4521.    switch(this.tipBtn)
  4522.    {
  4523.       case 1:
  4524.          this.setState(true);
  4525.          break;
  4526.       case 2:
  4527.          if(this.selected)
  4528.          {
  4529.             this.setState(false);
  4530.          }
  4531.          else
  4532.          {
  4533.             this.setState(true);
  4534.          }
  4535.          break;
  4536.       case 3:
  4537.          if(this.selected)
  4538.          {
  4539.             this.setState(false);
  4540.          }
  4541.          else
  4542.          {
  4543.             this.setState(true);
  4544.          }
  4545.          break;
  4546.       case 4:
  4547.          this.fpbState_mc.gotoAndStop(3);
  4548.          this.fLabel_mc.setColor("0xeeeeee");
  4549.    }
  4550.    this.drawFrame();
  4551.    this.executeCallBack();
  4552.    this.setBtnState(true);
  4553.    if(Accessibility.isActive())
  4554.    {
  4555.       Accessibility.sendEvent(this,0,this.EVENT_OBJECT_STATECHANGE,true);
  4556.    }
  4557. };
  4558. BUC.onRelease = function()
  4559. {
  4560.    if(this.tipBtn == 4)
  4561.    {
  4562.       this.fpbState_mc.gotoAndStop(2);
  4563.       this.fLabel_mc.setColor("0x000000");
  4564.    }
  4565.    this.drawFrame();
  4566.    this.setBtnState(false);
  4567.    if(Accessibility.isActive())
  4568.    {
  4569.       Accessibility.sendEvent(this,0,this.EVENT_OBJECT_STATECHANGE,true);
  4570.    }
  4571. };
  4572. BUC.onRollOver = function()
  4573. {
  4574.    if(this.tipBtn == 1 || this.tipBtn == 4 || (this.tipBtn == 2 || this.tipBtn == 3) && !this.selected)
  4575.    {
  4576.       this.fpbState_mc.gotoAndStop(2);
  4577.    }
  4578.    this.drawFrame();
  4579. };
  4580. BUC.onRollOut = function()
  4581. {
  4582.    if(this.tipBtn == 1 | this.tipBtn == 4 || (this.tipBtn == 2 || this.tipBtn == 3) && !this.selected)
  4583.    {
  4584.       this.fpbState_mc.gotoAndStop(1);
  4585.    }
  4586.    this.drawFrame();
  4587. };
  4588. BUC.onReleaseOutside = function()
  4589. {
  4590.    this.setBtnState(false);
  4591.    if(this.tipBtn == 1)
  4592.    {
  4593.       this.fpbState_mc.gotoAndStop(1);
  4594.    }
  4595.    this.drawFrame();
  4596. };
  4597. BUC.onDragOut = function()
  4598. {
  4599.    this.setBtnState(false);
  4600.    if(this.tipBtn == 1)
  4601.    {
  4602.       this.fpbState_mc.gotoAndStop(1);
  4603.    }
  4604.    this.drawFrame();
  4605. };
  4606. BUC.onDragOver = function()
  4607. {
  4608.    this.setBtnState(true);
  4609.    if(this.tipBtn == 1)
  4610.    {
  4611.       this.fpbState_mc.gotoAndStop(3);
  4612.    }
  4613.    this.drawFrame();
  4614. };
  4615. BUC.myOnKeyDown = function()
  4616. {
  4617.    if(Key.getCode() == 32 && this.pressOnce == undefined)
  4618.    {
  4619.       this.onPress();
  4620.       this.pressOnce = 1;
  4621.    }
  4622. };
  4623. BUC.myOnKeyUp = function()
  4624. {
  4625.    if(Key.getCode() == 32)
  4626.    {
  4627.       this.onRelease();
  4628.       this.pressOnce = undefined;
  4629.    }
  4630. };
  4631. BUC.get_accRole = function(childId)
  4632. {
  4633.    return this.master.ROLE_SYSTEM_PUSHBUTTON;
  4634. };
  4635. BUC.get_accName = function(childId)
  4636. {
  4637.    return this.master.getLabel();
  4638. };
  4639. BUC.get_accState = function(childId)
  4640. {
  4641.    if(this.pressOnce)
  4642.    {
  4643.       return this.master.STATE_SYSTEM_PRESSED;
  4644.    }
  4645.    return this.master.STATE_SYSTEM_DEFAULT;
  4646. };
  4647. BUC.get_accDefaultAction = function(childId)
  4648. {
  4649.    return "Press";
  4650. };
  4651. BUC.accDoDefaultAction = function(childId)
  4652. {
  4653.    this.master.onPress();
  4654.    this.master.onRelease();
  4655. };
  4656. delete FRB;
  4657. delete BUC;
  4658.