// main_init function

main_init = function(mc){
 subs_done = true;
 subs = $sub_cnt;
 pr_sub = sub = 0;
}

// main_effect function

main_effect = function(mc,frame){
 if (frame % lastsubframe == 1){
  $smc[pr_sub]._visible = stay || $smc[pr_sub].done;
  var m = $smc[sub];
  m.level += out_effect ? -Math.floor( Math.random() * (m.level+1)) : Math.floor( Math.random() * (levels - m.level));
  m._alpha = m.level * (100 / (levels - 1));
  m.done = m._alpha == (out_effect ? 0 : 100);
  m._visible = m._alpha > 0;
  if (m.done) subs--;
  if (subs > 0){
   pr_sub = sub;
   cont = true;
   while (cont){
    sub = (sub+1) % $sub_cnt;
    cont = $smc[sub].done;
   }
  } else end_effect = true
 }
}

// sub_init function

sub_init = function(mc){
 if (!out_effect) mc._alpha = 0;
 mc.level = out_effect ? levels-1 : 0;
}

// sub_effect function

sub_effect = function(mc,frame){
}
