var menucontrol = Class.create({
  initialize: function(){

  },
  play:function(TG, OPT){
    this.TG = TG;
    this.OPT = OPT;
    this.hider;
    //Event.observe(this.TG, "mouseover", this.onmouseover.bind(this));
    //Event.observe(this.TG, "mouseout", this.onmouseout.bind(this));
    
    ARIAfxQ.add(OPT.tgid, {src:OPT.src, width:OPT.width, height:OPT.height, wmode:"transparent"});    
    ARIAfxQ.setParam(OPT.tgid,{selected:OPT.selectMenu, xml_url:OPT.xml, main_size:"982,44", linkageMenu:OPT.linkageMenu, second:OPT.second,linkageMovie:OPT.linkageMovie});
    ARIAfxQ.play();    
  },
  onmouseover: function(){
    if(this.hider) clearTimeout(this.hider);
    this.TG.setStyle({zIndex:"2"});
  },
  onmouseout: function(){
    if(this.hider) clearTimeout(this.hider);
    this.hider = setTimeout(this.mouseout.bind(this), 500);
  },
  mouseover: function(){  	
    //ARIAfxQ.requestFn(this.TG, "setMouseOut", "");
    this.TG.setStyle({zIndex:"2"}); 
  },
  mouseout: function(){  	
    //ARIAfxQ.requestFn(this.TG, "setMouseOut", "");
    this.TG.setStyle({zIndex:"0"}); 
  }
});

var PSAmenu = new menucontrol();

function onflashout(){
  //if($("msg")) $("msg").update($("msg").innerHTML + "out<br>");
  PSAmenu.onmouseout();
}

function onflashover(){
  //if($("msg")) $("msg").update($("msg").innerHTML + "over<br>");
  PSAmenu.onmouseover();
}