// +------------------------------------------------------------+

// | Menu G3(frame)                  Last Modified 02/04/2002   |

// | Web Site:                       http://yx.webprovider.com  |

// | eMail:                          m_yangxin@hotmail.com      |

// +------------------------------------------------------------+

// | Copyright 2001,2002  Xin Yang   All Rights Reserved.       |

// +------------------------------------------------------------+


var FS=top, goodI=false, iTimer=0, offTimer=0, sX=0, sY=0, oW=0, oH=0, wW=0, wH=0, onItem=false, winEvent="";

var zCount=2, cBack=new Array(), cCount=0, yxIns=new Array(), yxIdx=-1, yxPads=new Array(), yxPCount=-1, yxItems=new Array(), yxICount=-1;

var showMenu=FS.showMenu, showMenuX=FS.showMenuX, hideMenu=FS.hideMenu, hideMenuX=FS.hideMenuX, hideAll=FS.hideAll, hideAllX=FS.hideAllX, moveMenuTo=FS.moveMenuTo, moveMenuBy=FS.moveMenuBy, getMenuDim=FS.getMenuDim, moveMenuBack=FS.moveMenuBack;



function setIt() { cutIt(); offTimer=setTimeout("clickIt()",FS.tOff*2); }

function cutIt() { if (offTimer!=0) clearTimeout(offTimer); }



function callBack(obj,func,t) {

  var x=cCount++; cBack[x]=obj;

  var tm=setTimeout(("cBack["+x+"]."+func),t);

  if (cCount>200) { cCount=0; }

  return tm;

}



function delFrame() { FS.delFrame(self); }

function resizeIt() {

  FS.resizeIt(self);

  if (winEvent!="") { eval(winEvent); }

}

function clickIt() { FS.clickIt(self); }

function clearIt() { clearTimeout(iTimer); iTimer=0;}

function findItemEvent(e_name) { return FS.findOBJ(yxICodes,e_name); }

function findMenuEvent(e_name) { return FS.findOBJ(yxMCodes,e_name); }

function clickItem(idx) { FS.clickItem(self,idx); }

function evalIt(code) { eval(code); }



function eventOBJ(e_name,e_handler1,e_handler2) {

  this.name=e_name;

  this.code1=e_handler1; this.code2=e_handler2;

}; var yxICodes=new Array(), yxMCodes=new Array();



function addItemEvent(e_name,e_handler1,e_handler2) {

  var x=findItemEvent(e_name);

  if (x==null) { yxICodes[yxICodes.length]=new eventOBJ(e_name,e_handler1,e_handler2); }

}

function addMenuEvent(e_name,e_handler1,e_handler2) {
  var x=findMenuEvent(e_name);
  if (x==null) { yxMCodes[yxMCodes.length]=new eventOBJ(e_name,e_handler1,e_handler2); }
}
function addWindowEvent(e_handler) { winEvent=e_handler; }
function addInstance(i_name,i_menu,i_type,i_pos,i_ref,i_idx,i_xalign,i_yalign,i_x,i_y,i_form,i_dir,i_vis,i_target,i_style,i_mode) {
  FS.addInstance(self,i_name,i_menu,i_type,i_pos,i_ref,i_idx,i_xalign,i_yalign,i_x,i_y,i_form,i_dir,i_vis,i_target,i_style,i_mode);
}
function initMenu() {
  if (FS.menuSafe) {
    if (FS.doneM) {
      zCount=FS.zBase;
      buildMenu();
      if (FS.goodI) {
        goodI=true;
        window.onunload=delFrame;
        window.onresize=resizeIt;
        if (FS.isIE || FS.isN6) {
          window.document.onclick=clickIt;
        }
        else if (FS.isNN4x) {
          window.document.onmouseup=clickIt;
          window.document.captureEvents(Event.MOUSEUP);
        }
        FS.showMsg("Stichting Muziektherapie");
      }
    }
    else {
      eval('setTimeout("initMenu()",500)');
    }
  }
}
