
// main_init function

main_init = function(mc){
 box = function(mc, tl_x, tl_y, br_x, br_y, c, a){
  mc.lineStyle();
  mc.beginFill(c,a);
  mc.moveTo (tl_x,tl_y);
  mc.lineTo (br_x,tl_y);
  mc.lineTo (br_x,br_y);
  mc.lineTo (tl_x,br_y);
  mc.endFill();
 }
 new_speed = function(){
  return min_speed + Math.random() * (max_speed - min_speed);
 }
 subs_done = true;
 b = mc.getBounds();
 for (i=0; i < bars; i++){

  var m = createEmptyMovieClip('m'+i,6+i);
  m._x = mc._x; m._y = mc._y;
  m.blendMode = blend;

  m.width = thin_width + (i / (bars - 1)) * (thick_width - thin_width);
  m.alpha = thin_alpha + (i / (bars - 1)) * (thick_alpha - thin_alpha);

  if (vertical){
   m.range = b.xMax - b.xMin - m.width;
   box(m, b.xMin, b.yMin, b.xMin + m.width, b.yMax, color, m.alpha);
   m._x += Math.random() * m.range;
  } else {
   m.range = b.yMax - b.yMin - m.width;
   box(m, b.xMin, b.yMin, b.xMax, b.yMin + m.width, color, m.alpha);
   m._y += Math.random() * m.range;
  }
  m.step = Math.random() < .5 ? new_speed() : -new_speed();

 }
}

// main_effect function

main_effect = function(mc,frame){
 for (i=0; i < bars; i++){
  var m = this['m'+i];
  if (vertical){
   m._x += m.step;
   if (m._x < 0 || m._x > mc._x + m.range){
    m._x -= m.step;
    m.step = m.step < 0 ? new_speed() : -new_speed();  
   }
  } else {
   m._y += m.step;
   if (m._y < 0 || m._y > mc._y + m.range){
    m._y -= m.step;
    m.step = m.step < 0 ? new_speed() : -new_speed();  
   }
  }
 }
}

// sub_init function

sub_init = function(mc){
}

// sub_effect function

sub_effect = function(mc,frame){
}
