
// main_init function

main_init = function(mc){
 perc = 0;
 if (mouse) sub_delay = 0;
 if (initial_wait) mc._alpha = 0;
}

// main_effect function

main_effect = function(mc,frame){
 if (subs_done) end_effect = true;
 mc._alpha = 100;
}

// sub_init function

sub_init = function(mc){
 for (i=1;i<=4;i++){
  mc.duplicateMovieClip("p"+i+"_"+mc._i,mc._i*10+i,{_x:mc._x+df*(i-2.5),_alpha:25});
 }
 mc._alpha = 0;
}

// sub_effect function

sub_effect = function(mc,frame){
 if (!mouse) perc = frame / lastsubframe else if ($i==0) perc = hitTest(_root._xmouse,_root._ymouse,false) ? Math.min(1,perc+1/lastsubframe) : Math.max(0,perc-1/lastsubframe); 
 if (!mouse && frame == lastsubframe) {
  for (i=1;i<=4;i++){
   $mmc["p"+i+"_"+mc._i].removeMovieClip(); 
  }
  mc.done = true;
 } else {
  for (i=1;i<=4;i++){
   $mmc["p"+i+"_"+mc._i]._x = mc._x+df*(i-2.5)*(1-perc);
  }
  mc._alpha = perc * 100;
 }
}
