// Menu G5.6.3 (non-frame/loader)
// Last Modified: Jun. 27, 2006
// Web Site: yxScripts.com
// Email: m_yangxin@hotmail.com

// Copyright 2003, 2004  Xin Yang   All Rights Reserved.

// ------
var _scriptPath="http://www.yxScripts.com/menuG5/script/";
var _menuTimer=500;
var _floatTimer=100;
var _floatOffset=1;
var _zBase=2;
var _menuMargin=1;
var _showMessage=1;
var _showToolTip=0;
var _onePixelGIF="onePixel.gif";
var _inheritStyle=1;
var _minimumWidth=0;
var _supportIEMac=1;
var _supportSafari=1;
// ------

Object.prototype.copy=function() { var o=new Object(); for (var i in this) { o[i]=typeof(this[i])=='object'?this[i].copy():this[i]; } return o; }
Array.prototype.copy=function() { var a=new Array(); for (var i in this) { a[i]=typeof(this[i])=='object'?this[i].copy():this[i]; } return a; }
Array.prototype.shift=Array.prototype.shift||function() { var a=this[0]||null; for (var i=0; i<this.length-1; i++) { this[i]=this[i+1]; }; if (this.length>0) { this.length--; }; return a; }
Array.prototype.push=Array.prototype.push||function() { for (var i=0; i<arguments.length; i++) { this[this.length]=arguments[i]; }; return this[this.length-1]; }

if (typeof(webPath)=="undefined") { webPath=""; }
if (typeof(scriptPath)=="undefined") { scriptPath=_scriptPath; }
if (typeof(menuTimer)=="undefined") { menuTimer=_menuTimer; }
if (typeof(floatTimer)=="undefined") { floatTimer=_floatTimer; }
if (typeof(floatOffset)=="undefined") { floatOffset=_floatOffset; }
if (typeof(zBase)=="undefined") { zBase=_zBase; }
if (typeof(menuMargin)=="undefined") { menuMargin=_menuMargin; }
if (typeof(showMessage)=="undefined") { showMessage=_showMessage; }
if (typeof(showToolTip)=="undefined") { showToolTip=_showToolTip; }
if (typeof(onePixelGIF)=="undefined") { onePixelGIF=scriptPath+_onePixelGIF; }
if (typeof(inheritStyle)=="undefined") { inheritStyle=_inheritStyle; }
if (typeof(minimumWidth)=="undefined") { minimumWidth=_minimumWidth; }
if (typeof(supportIEMac)=="undefined") { supportIEMac=_supportIEMac; }
if (typeof(supportSafari)=="undefined") { supportSafari=_supportSafari; }

var yx_navigator=navigator.userAgent.toLowerCase();
var yx_isMac=(yx_navigator.indexOf("mac")!=-1);
var yx_isOpera=(yx_navigator.indexOf("opera")!=-1);
var yx_isOpera7=yx_navigator.search(/opera[\s\/]+(\d+)/)!=-1?parseFloat(RegExp.$1)>=7:false;
var yx_isSafari=(yx_navigator.indexOf("safari")!=-1);
var yx_isIE=(yx_navigator.indexOf("msie")!=-1 && !yx_isOpera);
var yx_isIE5=(yx_isIE && yx_navigator.indexOf("msie 4")==-1);
var yx_isIE55=(yx_isIE && yx_navigator.indexOf("msie 5.5")!=-1);
var yx_isIE6up=(yx_isIE && yx_navigator.search(/msie\s+(\d+)/)!=-1?parseFloat(RegExp.$1)>=6:false);
var yx_isIE55up=(yx_isIE55 || yx_isIE6up);
var yx_isGecko=(yx_navigator.indexOf("gecko")!=-1 && !yx_isSafari);
var yx_isNetscape=(yx_isGecko && yx_navigator.indexOf("netscape")!=-1);

var yx_menuSafe=(yx_isGecko || yx_isOpera7 || yx_isSafari && supportSafari || yx_isIE5 && yx_isMac && supportIEMac || yx_isIE5 && !yx_isMac);

var yx_M="M", yx_L="L", yx_C="C", yx_I="I", yx_S="S";
var yx_goodContent=true, yx_winEvent="", yx_loaded=false, yx_names=new Array(), yx_isInfo=false;
var yx_callBackCounter=0, yx_callBacks=new Array();
var yx_onItemTimer=0, yx_offItemTimer=0, yx_scrollingTimer=0, yx_edgeMargin=menuMargin, yx_scrollingLeft=0, yx_scrollingTop=0, yx_winWidth=0, yx_winHeight=0;
var yx_pixelGIF=new Image(1,1); yx_pixelGIF.src=onePixelGIF;
var yx_pathRE=/(^\w+:)|(^\/)|(^\.)/, yx_cssRE=/css\s*:([\w\-\s]+),?([\w\-\s]+)?,?([\w\-\s]+)?,?([\w\-\s]+)?,?([\w\-\s]+)?/, yx_cssRE2=/css2\s*:([\w\-\s]+),?([\w\-\s]+)?,?([\w\-\s]+)?,?([\w\-\s]+)?,?([\w\-\s]+)?/, yx_nameRE=/\w/;
var yx_padZ=1, yx_tileZ=2, yx_itemZ=3, yx_coverZ=4, yx_itemUpZ=5, yx_coverUpZ=6;

function yx_newElement(tag) { 
	return document.createElement(tag);
}
function yx_newIMG(_src,w,h,_align) {
  var l=yx_newElement("IMG");
  
  with (l) { src=_src; width=w; height=h; border=0; hspace=0; vspace=0; align=_align; }
  return l;
}
function yx_newDIV(x,y,vis,idx) {
  var l=yx_newElement("DIV");
  with (l.style) { position="absolute"; visibility=vis; left=x+"px"; top=y+"px"; zIndex=idx; }
  return l;
}

function yx_findLayer(n) { return document.getElementById(n); }
function yx_setZIndex(l,idx) { l.style.zIndex=idx; }
function yx_getZIndex(l) { return l.style.zIndex; }
function yx_showLayer(l) { l.style.visibility="visible"; }
function yx_hideLayer(l) { l.style.visibility="hidden"; }
function yx_moveLayerTo(l,x,y) { l.style.left=x+"px"; l.style.top=y+"px"; }
function yx_moveLayerBy(l,x,y) { l.style.left=(parseInt(l.style.left)+x)+"px"; l.style.top=(parseInt(l.style.top)+y)+"px"; }
function yx_cleanLayer(menu) {
  for (var i=0; i<menu.items.length; i++) {
    if (menu.items[i].menu && menu.items[i].menu.ready) {
      yx_cleanLayer(menu.items[i].menu);
    }
  }

  try {
    document.body.removeChild(menu.holder);
    if (menu.ifrm) {
      document.body.removeChild(menu.ifrm);
    }
  }
  catch (err) {}
}

function yx_downItem() {
  var item=this.item, si=item.styleI;

  yx_stopEvent(); yx_stopIt(yx_scrollingTimer); yx_scrollingTimer=0;
  if (si.sItem.onOver || item.content.type!=yx_M) { yx_setCSS(item,si.sItem.cssM,si.sTag.cssM,si.sIcon.cssM,si.sIcon.cssM2,si.sFont.cssM,true,si.sItem.xAlign,si.sItem.yAlign,si.sItem.filterM); }
}

function yx_clickInfo() { yx_isInfo=true; }
function yx_clickItem(e) {
  var item=this.item, content=item.content, type=content.type, menu=item.lead;

  yx_stopEvent();
  if (type==yx_M || type==yx_L) {
    if (!item.styleI.sItem.onOver && type==yx_M) {
      if (item.menu.shown) {
        item.menu.hideM(false); menu.open=false; this.markIt(0);
      }
      else if (!item.menu.go) {
        menu.open=true; this.markIt(1); yx_stopIt(yx_onItemTimer); yx_onItemTimer=yx_callBack(item,"onIt","()",0);
      }
    }
    else if (content.link!="") {
      yx_closeIns(null); yx_goLink(content.link,menu.head.target,yx_shiftKey(e));
    }
  }
  else if (content.code!="") {
    yx_closeIns(null); eval(content.code);
  }
}

function yx_eleWidth(ele) { return (ele==null?0:ele.offsetWidth>0?ele.offsetWidth:ele.hasChildNodes()&&ele.firstChild.nodeType==1?ele.firstChild.offsetWidth:0); }
function yx_itemWidth(item) { return yx_eleWidth(item.dis)+yx_eleWidth(item.tag)+yx_eleWidth(item.icon)+yx_eleWidth(item.icon2); }

function yx_setIt() { yx_offItemTimer=setTimeout("yx_closeIns(null)",menuTimer*2); }
function yx_stopIt(t) { if (t>0) clearTimeout(t); }
function yx_stopAll() { yx_isInfo=false; yx_stopIt(yx_onItemTimer); yx_onItemTimer=0; yx_stopIt(yx_offItemTimer); yx_offItemTimer=0; yx_stopIt(yx_scrollingTimer); yx_scrollingTimer=0; }
function yx_getPath(path) { return yx_pathRE.test(path)?path:(webPath+path); }
function yx_showMsg(msg) { if (showMessage==1) window.status=msg; }
function yx_callBack(obj,func,para,t) {
  var x=yx_callBackCounter++; yx_callBacks[x]=null; yx_callBacks[x]=obj;
  var tm=setTimeout(("yx_callBacks["+x+"]."+func+para),t);
  if (yx_callBackCounter>200) { yx_callBackCounter=0; }
  return tm;
}
function yx_goLink(link,ft,nw) {
  if (link.substring(0,11).toLowerCase()=="javascript:") {
    eval(link.substring(11));
  }
  else {
    if (nw) {
      window.open(yx_getPath(link));
    }
    else if (ft!="") {
      window.open(yx_getPath(link),ft);
    }
    else {
      window.location.href=yx_getPath(link);
    }
  }
}

function yx_findOBJ(obj,n) {
  for (var i=0; i<obj.length; i++) { if (obj[i].name==n) { return obj[i]; } }
  return null;
}
function yx_getOBJ(obj,n) {
  for (var i=0; i<obj.length; i++) { if (obj[i].name==n) { return obj[i]; } }
  return obj[0];
}

function yx_trim(s) { return (s.replace(/^\s+/,"")).replace(/\s$/,""); }
function yx_getCSS(para,re) {
  var ra=para.match(re), pa=new Array();
  pa[0]=(ra && ra[1] && yx_nameRE.test(ra[1]))?yx_trim(ra[1]):"";
  pa[1]=(ra && ra[2] && yx_nameRE.test(ra[2]))?yx_trim(ra[2]):pa[0];
  pa[2]=(ra && ra[3] && yx_nameRE.test(ra[3]))?yx_trim(ra[3]):pa[1];
  pa[3]=(ra && ra[4] && yx_nameRE.test(ra[4]))?yx_trim(ra[4]):pa[1];
  pa[4]=(ra && ra[5] && yx_nameRE.test(ra[5]))?yx_trim(ra[5]):pa[0];
  return pa;
}

function yx_stylePadOBJ(sp,para) {
  this.name=sp;

  this.cssN=para.search(/pad-css\s*:([\w\-\s]+)/)!=-1?yx_trim(RegExp.$1):"";
  this.hcssN=para.search(/holder-css\s*:([\w\-\s]+)/)!=-1?yx_trim(RegExp.$1):"";

  this.bar=(para.search(/menu-form\s*:\s*bar/)!=-1);
  this.dir=para.search(/direction\s*:\s*(right-down|right-up|left-down|left-up|center-down|center-up|abs-right-down|abs-right-up|abs-left-down|abs-left-up|abs-center-up|abs-center-down|right-top|left-top|right-middle|left-middle|right-bottom|left-bottom)/)!=-1?(RegExp.$1):"";

  this.scroll=para.search(/scroll\s*:\s*(both|x-only|y-only|none)/)!=-1?(RegExp.$1):"none";
  this.step=para.search(/step\s*:\s*(\d+)/)!=-1?parseInt(RegExp.$1,10):0;
  this.flip=(para.search(/flip\s*:\s*no/)==-1);

  this.dx=para.search(/offset-left\s*:\s*(-?\d+)/)!=-1?parseInt(RegExp.$1,10):0;
  this.dy=para.search(/offset-top\s*:\s*(-?\d+)/)!=-1?parseInt(RegExp.$1,10):0;

  var ra=para.match(/item-offset\s*:\s*(-?\d+)\s*,?\s*(-?\d+)?/);
  this.iOffx=(ra && ra[1])?parseInt(ra[1],10):0;
  this.iOffy=(ra && ra[2])?parseInt(ra[2],10):this.iOffx;

  this.col=para.search(/col\s*:\s*(\d+)/)!=-1?parseInt(RegExp.$1,10):0;
  this.row=para.search(/row\s*:\s*(\d+)/)!=-1?parseInt(RegExp.$1,10):0;

  ra=para.match(/filters\s*:\s*(\w+)\s*,?\s*(\w+)?/);
  this.filterShow=!(ra && ra[1]=="no");
  this.filterHide=(ra && ra[2]=="yes");

  ra=para.match(/tiles\s*:\s*(\d+)\s*,?\s*(\d+)\s*:([\w\-\s]+),([\w\-\s]+),([\w\-\s]+),([\w\-\s]+),([\w\-\s]+),([\w\-\s]+),([\w\-\s]+),([\w\-\s]+),([\w\-\s]+)/);
  this.tileW=(ra && ra[1])?parseInt(ra[1],10):0;
  this.tileH=(ra && ra[2])?parseInt(ra[2],10):0;
  this.tiles=new Array();
  if (this.tileW>0 || this.tileH>0) {
    for (var i=0; i<9; i++) {
      this.tiles[i]=(ra && ra[i+3] && yx_nameRE.test(ra[i+3]))?yx_trim(ra[i+3]):"";
    }
  }
}; var yx_stylePads=new Array(new yx_stylePadOBJ("",""));

function yx_styleItemOBJ(si,para) {
  this.name=si;

  var pa=yx_getCSS(para,yx_cssRE);
  this.cssN=pa[0]; this.cssH=pa[1]; this.cssM=pa[2]; this.cssS=pa[3]; this.cssP=[pa[0],pa[4]];
  this.cursor=para.search(/cursor\s*:([\w\-\s]+)/)!=-1?yx_trim(RegExp.$1):"";

  this.xAlign=para.search(/align\s*:\s*(left|center|right)/)!=-1?(RegExp.$1):"center";
  this.yAlign=para.search(/valign\s*:\s*(top|middle|bottom)/)!=-1?(RegExp.$1):"middle";
  this.actual=(para.search(/width\s*:\s*actual/)!=-1);
  this.onOver=(para.search(/sub-menu\s*:\s*mouse-click/)==-1);

  var ra=para.match(/filters\s*:\s*(\w+)\s*,?\s*(\w+)?\s*,?\s*(\w+)?/);
  this.filterN=(ra && ra[1]=="yes");
  this.filterH=!(ra && ra[2]=="no");
  this.filterM=(ra && ra[3]=="yes");
}; var yx_styleItems=new Array(new yx_styleItemOBJ("","width:actual;"));

function yx_styleFontOBJ(sf,para) {
  this.name=sf;

  var pa=yx_getCSS(para,yx_cssRE);
  this.cssN=pa[0]; this.cssH=pa[1]; this.cssM=pa[2]; this.cssS=pa[3]; this.cssP=[pa[0],pa[4]];
}; var yx_styleFonts=new Array(new yx_styleFontOBJ("",""));

function yx_styleTagOBJ(st,para) {
  this.name=st;

  var pa=yx_getCSS(para,yx_cssRE);
  this.cssN=pa[0]; this.cssH=pa[1]; this.cssM=pa[2]; this.cssS=pa[3]; this.cssP=[pa[0],pa[4]];

  this.text=para.search(/text\s*:([^:]+):/)!=-1?yx_trim(RegExp.$1):"";
}; var yx_styleTags=new Array(new yx_styleTagOBJ("",""));

function yx_styleIconOBJ(so,para) {
  this.name=so;

  var pa=yx_getCSS(para,yx_cssRE);
  this.cssN=pa[0]; this.cssH=pa[1]; this.cssM=pa[2]; this.cssS=pa[3]; this.cssP=[pa[0],pa[4]];

  var pa2=yx_getCSS(para,yx_cssRE2);
  this.cssN2=pa2[0]; this.cssH2=pa2[1]; this.cssM2=pa2[2]; this.cssS2=pa2[3]; this.cssP2=[pa2[0],pa2[4]];

  this.text=para.search(/text\s*:([^:]+):/)!=-1?yx_trim(RegExp.$1):"";
  this.text2=para.search(/text2\s*:([^:]+):/)!=-1?yx_trim(RegExp.$1):"";
}; var yx_styleIcons=new Array(new yx_styleIconOBJ("",""));

function yx_styleSeparatorOBJ(ss,para) {
  this.name=ss;

  var ra=para.match(/css\s*:([\w\-\s]+),?([\w\-\s]+)?/);
  this.cssTL=(ra && ra[1])?yx_trim(ra[1]):"";
  this.cssBR=(ra && ra[2])?yx_trim(ra[2]):"";
}; var yx_styleSeparators=new Array(new yx_styleSeparatorOBJ("",""));

function yx_styleMenuOBJ(sm,sp,si,sf,st,so,ss) {
  this.name=sm;

  this.sPad=yx_getPad(sp); this.sItem=yx_getItem(si); this.sFont=yx_getFont(sf); this.sTag=yx_getTag(st); this.sIcon=yx_getIcon(so); this.sSeparator=yx_getSeparator(ss);
}; var yx_styleMenus=new Array(new yx_styleMenuOBJ("", "", "", "", "", "",""));

function addStylePad(sp,para) { yx_stylePads.push(new yx_stylePadOBJ(sp,para)); }
function addStyleItem(si,para) { yx_styleItems.push(new yx_styleItemOBJ(si,para)); }
function addStyleFont(sf,para) { yx_styleFonts.push(new yx_styleFontOBJ(sf,para)); }
function addStyleTag(st,para) { yx_styleTags.push(new yx_styleTagOBJ(st,para)); }
function addStyleIcon(so,para) { yx_styleIcons.push(new yx_styleIconOBJ(so,para)); }
function addStyleSeparator(ss,para) { yx_styleSeparators.push(new yx_styleSeparatorOBJ(ss,para)); }
function addStyleMenu(sm,sp,si,sf,st,so,ss) { yx_styleMenus.push(new yx_styleMenuOBJ(sm,sp,si,sf,st,so,ss)); }

function yx_groupOBJ(menu,style) { this.menu=menu; this.style=style; }
function yx_styleGroupOBJ(sg) { this.name=sg; this.member=new Array(); }; var yx_styleGroups=new Array();
function addStyleGroup(sg,sm) {
  var xGroup=yx_findGroup(sg);
  if (xGroup==null) { var x=yx_styleGroups.length; yx_styleGroups[x]=new yx_styleGroupOBJ(sg); xGroup=yx_styleGroups[x]; }

  var xLen=xGroup.member.length;
  for (var i=2; i<addStyleGroup.arguments.length; i++) { xGroup.member[xLen+i-2]=new yx_groupOBJ(addStyleGroup.arguments[i],sm); }
}
function setDefaultStyle(sp,si,sf,st,so,ss) {
  if (sp!="") { yx_styleMenus[0].sPad=yx_getPad(sp); }
  if (si!="") { yx_styleMenus[0].sItem=yx_getItem(si); }
  if (sf!="") { yx_styleMenus[0].sFont=yx_getFont(sf); }
  if (st!="") { yx_styleMenus[0].sTag=yx_getTag(st); }
  if (so!="") { yx_styleMenus[0].sIcon=yx_getIcon(so); }
  if (ss!="") { yx_styleMenus[0].sSeparator=yx_getSeparator(ss); }
}

function yx_getPad(sp) { return yx_getOBJ(yx_stylePads,sp); }
function yx_getItem(si) { return yx_getOBJ(yx_styleItems,si); }
function yx_getFont(sf) { return yx_getOBJ(yx_styleFonts,sf); }
function yx_getTag(st) { return yx_getOBJ(yx_styleTags,st); }
function yx_getIcon(so) { return yx_getOBJ(yx_styleIcons,so); }
function yx_getSeparator(ss) { return yx_getOBJ(yx_styleSeparators,ss); }
function yx_getMenu(sm) { return yx_findOBJ(yx_styleMenus,sm); }
function yx_findGroup(sg) { return yx_findOBJ(yx_styleGroups,sg); }
function yx_findContent(n) { return yx_findOBJ(yx_content,n); }
function yx_findItemEvent(n) { return yx_findOBJ(yx_iCodes,n); }
function yx_findMenuEvent(n) { return yx_findOBJ(yx_mCodes,n); }

function yx_linkOBJ(dis,msg,link,id) { this.type=yx_L; this.dis=dis; this.msg=msg; this.link=link; this.group=id; this.onPath=0; }
function yx_commandOBJ(dis,msg,code,id) { this.type=yx_C; this.dis=dis; this.msg=msg; this.code=code; this.group=id; this.onPath=0; }
function yx_infoOBJ(dis,id) { this.type=yx_I; this.dis=dis; this.group=id; }
function yx_separatorOBJ(id) { this.type=yx_S; this.group=id; }

function yx_submenuOBJ(dis,msg,link,sub,id) {
  this.name=sub; this.type=yx_M;
  this.dis=dis; this.msg=msg; this.link=link; this.group=id; this.onPath=0;
  this.items=new Array();
  this.addM=yx_addM; this.addL=yx_addL; this.addC=yx_addC; this.addI=yx_addI; this.addS=yx_addS;
}

function yx_topmenuOBJ(tm) {
  this.name=tm; this.items=new Array();
  this.addM=yx_addM; this.addL=yx_addL; this.addC=yx_addC; this.addI=yx_addI; this.addS=yx_addS;
}

function yx_contentOBJ(n,obj){ this.name=n; this.menu=obj; }; yx_content=new Array();

function yx_addM(dis,msg,link,sub,id) {
  if (typeof(yx_names[sub])=="undefined") {
    yx_names[sub]=new yx_submenuOBJ(dis,msg,link,sub,id);
  }
  this.items.push(yx_names[sub]);
}
function yx_addL(dis,msg,link,id) { this.items.push(new yx_linkOBJ(dis,msg,link,id)); }
function yx_addC(dis,msg,code,id) { this.items.push(new yx_commandOBJ(dis,msg,code,id)); }
function yx_addI(dis,id) { this.items.push(new yx_infoOBJ(dis,id)); }
function yx_addS(id) { this.items.push(new yx_separatorOBJ(id)); }

function yx_badContent(n) { yx_goodContent=false; yx_showMsg("["+n+"] Not Found."); }

function addMenu(n,tm) {
  if (yx_goodContent) {
    yx_names[tm]=new yx_topmenuOBJ(tm);

    var c=yx_findContent(n);
    if (c==null) {
      yx_content.push(new yx_contentOBJ(n,yx_names[tm]));
    }
    else {
      c.menu=yx_names[tm];
    }
  }
}

function addSubMenu(n,dis,msg,link,sub,id) {
  if (yx_goodContent) {
    if (typeof(yx_names[n])!="undefined") {
      yx_names[n].addM(dis,msg||"",link||"",sub,id||"");
    }
    else {
      yx_badContent(n);
    }
  }
}

function addLink(n,dis,msg,link,id) {
  if (yx_goodContent) {
    if (typeof(yx_names[n])!="undefined") {
      yx_names[n].addL(dis,msg||"",link||"",id||"");
    }
    else {
      yx_badContent(n);
    }
  }
}

function addCommand(n,dis,msg,code,id) {
  if (yx_goodContent) {
    if (typeof(yx_names[n])!="undefined") {
      yx_names[n].addC(dis,msg||"",code||"",id||"");
    }
    else {
      yx_badContent(n);
    }
  }
}

function addInfo(n,dis,id) {
  if (yx_goodContent) {
    if (typeof(yx_names[n])!="undefined") {
      yx_names[n].addI(dis,id||"");
    }
    else {
      yx_badContent(n);
    }
  }
}

function addSeparator(n,id) {
  if (yx_goodContent) {
    if (typeof(yx_names[n])!="undefined") {
      yx_names[n].addS(id||"");
    }
    else {
      yx_badContent(n);
    }
  }
}

function endMenu() {
  if (yx_goodContent) { yx_showMsg("Menu Parsed"); }
}

function yx_getMenuStyle(menu) {
  if (menu.head.style!=null) {
    var styles=menu.head.style.member;
    for (var i=0; i<styles.length; i++) {
      if (styles[i].menu==menu.content.name) { return yx_getMenu(styles[i].style); }
    }
  }
  return (menu.lead==menu.head || inheritStyle==0)?yx_styleMenus[0]:menu.lead.lead.style;
}

function yx_getItemStyle(item) {
  if (item.content.group!="" && item.lead.head.style!=null) {
    var styles=item.lead.head.style.member;
    for (var i=0; i<styles.length; i++) {
      if (styles[i].menu==item.content.group) {
        return yx_getMenu(styles[i].style);
      }
    }
  }
  return item.lead.style;
}

function yx_xyOBJ(x,y) { this.x=x; this.y=y; }
function yx_getSlot(n) {
  yx_getDim();
  var x=(n==0 || n==6 || n==7)?0:((n==1 || n==5 || n== 8)?Math.round(yx_winWidth/2):(yx_winWidth-1));
  var y=(n==0 || n==1 || n==2)?0:((n==3 || n==7 || n== 8)?Math.round(yx_winHeight/2):(yx_winHeight-1));
  return (new yx_xyOBJ(x,y));
}

function yx_findIns(n,mode) {
  var ins=yx_findOBJ(yx_ins,n);
  return mode?((ins!=null && ins.menu!=null && ins.menu.ready)?ins:null):ins;
}

function yx_closeIns(ins) {
  for (var i=0; i<yx_ins.length; i++) {
    if (yx_ins[i].menu.shown && yx_ins[i]!=ins) { yx_ins[i].hideIns(); }
  }
}

function yx_setIdx(ins,idx) { ins.z=idx; yx_setZIndex(ins.menu.holder,idx); }

function addInstance(n,mc,para) {
  if (yx_menuSafe) {
    var content=yx_findContent(mc);
    if (content!=null) {
      for (var i=0; i<yx_ins.length; i++) { if (yx_ins[i].name==n) { yx_dropIns(i); break; } }
      yx_ins.push(new yx_insOBJ(n,content.copy().menu,para));
      yx_showMsg("Menu ["+n+"] Enabled");
    }
  }
}

function yx_eventOBJ(n,eh1,eh2) { this.name=n; this.code1=eh1; this.code2=eh2; }; var yx_iCodes=new Array(), yx_mCodes=new Array();
function addItemEvent(n,eh1,eh2) { var x=yx_findItemEvent(n); if (x==null) { yx_iCodes.push(new yx_eventOBJ(n,eh1,eh2)); } }
function addMenuEvent(n,eh1,eh2) { var x=yx_findMenuEvent(n); if (x==null) { yx_mCodes.push(new yx_eventOBJ(n,eh1,eh2)); } }
function addWindowEvent(eh) { yx_winEvent=eh; }

function yx_dimOBJ(x,y,w,h,sx,sy) { this.x=x; this.y=y; this.width=w; this.height=h; this.scrollx=sx; this.scrolly=sy; }
function yx_getDim() { yx_scrollingLeft=yx_getScrollX(); yx_scrollingTop=yx_getScrollY(); yx_winWidth=yx_getWinWidth(); yx_winHeight=yx_getWinHeight(); }

function yx_print(s) {
  for (var i=1; i<yx_print.arguments.length && s.indexOf('%')!=-1; i++) {
    s=s.substring(0,s.indexOf('%'))+yx_print.arguments[i]+s.substring(s.indexOf('%')+1);
  }
  return s;
}
function yx_getTiles(sPad,w,h) {
  var tileContent="", tdCell="<td class='%' width='%' height='%'></td>", tw=sPad.tileW, th=sPad.tileH;

  if (th>0) {
    if (tw>0) {
      tileContent+=yx_print("<tr>"+tdCell+tdCell+tdCell+"</tr>",sPad.tiles[0],tw,th,sPad.tiles[1],w-tw*2,th,sPad.tiles[2],tw,th);
    }
    else {
      tileContent+=yx_print("<tr>"+tdCell+"</tr>",sPad.tiles[1],w,th);
    }
  }

  if (tw>0) {
    tileContent+=yx_print("<tr>"+tdCell+tdCell+tdCell+"</tr>",sPad.tiles[3],tw,h-th*2,sPad.tiles[4],w-tw*2,h-th*2,sPad.tiles[5],tw,h-th*2);
  }
  else {
    tileContent+=yx_print("<tr>"+tdCell+"</tr>",sPad.tiles[4],w,h-th*2);
  }

  if (th>0) {
    if (tw>0) {
      tileContent+=yx_print("<tr>"+tdCell+tdCell+tdCell+"</tr>",sPad.tiles[6],tw,th,sPad.tiles[7],w-tw*2,th,sPad.tiles[8],tw,th);
    }
    else {
      tileContent+=yx_print("<tr>"+tdCell+"</tr>",sPad.tiles[7],w,th);
    }
  }

  return "<table cellpadding='0' cellspacing='0' border='0'>"+tileContent+"</table>";
}

function yx_getPos(mode) {
  var head=this.head, pItem=this.lead, pMenu=pItem.lead, sPad=this.style.sPad, sW=this.sW, sH=this.sH;
  var x_align=head.xAlign, y_align=head.yAlign, dir=sPad.dir==""?(head.dir):(sPad.dir);

  yx_getDim();

  var padX=0, padY=0;
  if (pItem==head) {
    padX=x_align=="left"?0:x_align=="center"?(-Math.round(this.width/2)):(-this.width+1);
    padY=y_align=="top"?0:y_align=="middle"?(-Math.round(this.height/2)):(-this.height+1);

    if (head.floating && head.timer>0) { yx_stopIt(head.timer); head.timer=-1; head.holder.x=head.ox; head.holder.y=head.oy; }
    padX+=head.holder.x; padY+=head.holder.y;
    if (head.pos=="slot" || head.floating) { padX+=yx_scrollingLeft; padY+=yx_scrollingTop; }
  }
  else {
    var iX=pMenu.x+pItem.x, iY=pMenu.y+pItem.y, iW=pItem.width, iH=pItem.height;
    if (pMenu.bar) {
      padY=dir.indexOf("up")!=-1?(iY-this.height+sH):(iY+iH-sH);
      padX=dir.indexOf("abs-center")!=-1?(pMenu.x+Math.round((pMenu.width-this.width)/2)):dir.indexOf("abs-left")!=-1?pMenu.x:dir.indexOf("abs-right")!=-1?(pMenu.x+pMenu.width-this.width):dir.indexOf("center")!=-1?(iX+Math.round((iW-this.width)/2)):dir.indexOf("left")!=-1?(iX+iW-this.width+sW):(iX-sW);
    }
    else {
      padX=dir.indexOf("left")!=-1?(iX-this.width+sW):(iX+iW-sW);
      padY=dir.indexOf("top")!=-1?pMenu.y:dir.indexOf("bottom")!=-1?(pMenu.y+pMenu.height-this.height):dir.indexOf("middle")!=-1?(pMenu.y+Math.round((pMenu.height-this.height)/2)):dir.indexOf("up")!=-1?(iY+iH-this.height+sH):(iY-sH);
    }

    padX+=sPad.dx; padY+=sPad.dy;

    if (sPad.flip) {
      var padTop=padY, padBottom=padTop+this.height-1, padLeft=padX, padRight=padLeft+this.width-1;
      var dx=0, dx2=0, dy=0, dy2=0;

      if (pMenu.bar) {
        if (dir.indexOf("down")!=-1 && padBottom-yx_scrollingTop>=yx_winHeight && padTop-this.height-pItem.height+2*sH>=yx_scrollingTop) {
          dy=-this.height-pItem.height+2*sH-2*sPad.dy; padTop+=dy; padBottom+=dy;
        }
        if (dir.indexOf("up")!=-1 && padTop<yx_scrollingTop && padBottom+this.height+pItem.height-2*sH-yx_scrollingTop<yx_winHeight) {
          dy=this.height+pItem.height-2*sH-2*sPad.dy; padTop+=dy; padBottom+=dy;
        }
      }
      else {
        if (dir.indexOf("right")!=-1 && padRight-yx_scrollingLeft>=yx_winWidth && padLeft-this.width-pItem.width+2*sW>=yx_scrollingLeft) {
          dx=-this.width-pItem.width+2*sW-2*sPad.dx; padLeft+=dx; padRight+=dx;
        }
        if (dir.indexOf("left")!=-1 && padLeft<yx_scrollingLeft && padRight+this.width+pItem.width-2*sW-yx_scrollingLeft<yx_winWidth) {
          dx=this.width+pItem.width-2*sW-2*sPad.dx; padLeft+=dx; padRight+=dx;
        }
      }

      if (padBottom-yx_scrollingTop>=yx_winHeight) { dy2=yx_winHeight+yx_scrollingTop-padBottom-yx_edgeMargin; }
      if (padTop+dy2<yx_scrollingTop) { dy2=yx_scrollingTop-padTop+yx_edgeMargin; }
      if (padRight-yx_scrollingLeft>=yx_winWidth) { dx2=yx_winWidth+yx_scrollingLeft-padRight-yx_edgeMargin; }
      if (padLeft+dx2<yx_scrollingLeft) { dx2=yx_scrollingLeft-padLeft+yx_edgeMargin; }

      padX+=dx+dx2; padY+=dy+dy2;
    }
  }

  this.moveMTo(padX,padY);

  if (mode && !this.shown && (pMenu==null || pMenu.active==pItem)) {
    yx_setZIndex(this.holder, pMenu!=null?(yx_getZIndex(pMenu.holder)+1):(++zBase));
    yx_showLayer(this.holder); this.shown=true;

    for (var i=0; i<this.itemL; i++) {
      var type=this.items[i].content.type;
      if (type==yx_M || type==yx_L || type==yx_C) { this.items[i].offIt(); }
    }

    if (this.code1!="") { eval(this.code1); }
  }

  if (pItem==head && head.floating && head.timer<0) { head.sX=yx_scrollingLeft; head.sY=yx_scrollingTop; head.timeIt(); }
}

function yx_blurM() {
  this.open=false;
  if (this.active!=null) {
    this.active.offIt(); this.active=null;

    for (var i=0; i<this.itemL; i++) {
      if (this.items[i].menu!=null) { this.items[i].menu.hideM(true); }
    }

    if (this.lead==this.head && this.head.vis && this.code2!="") { eval(this.code2); }
  }
}

function yx_getDX(mx,ix,dis,mw,iw) { return (mx+ix<yx_scrollingLeft || mx+ix-dis-iw<yx_scrollingLeft && mx<yx_scrollingLeft)?iw:(mx+ix+iw-yx_scrollingLeft>yx_winWidth || mx+ix+iw+dis+iw-yx_scrollingLeft>yx_winWidth && mx+mw-yx_scrollingLeft>yx_winWidth)?-iw:0; }
function yx_getDY(my,iy,dis,mh,ih) { return (my+iy<yx_scrollingTop || my+iy-dis-ih<yx_scrollingTop && my<yx_scrollingTop)?ih:(my+iy+ih-yx_scrollingTop>yx_winHeight || my+iy+ih+dis+ih-yx_scrollingTop>yx_winHeight && my+mh-yx_scrollingTop>yx_winHeight)?-ih:0; }

function yx_scrollIt(dx,dy) {
  var done=true;

  if (dx>0 && this.x+dx>=yx_scrollingLeft) {
    dx=yx_scrollingLeft-this.x+yx_edgeMargin;
  }
  else if (dx<0 && this.x+this.width-yx_scrollingLeft+dx<=yx_winWidth) {
    dx=yx_winWidth+yx_scrollingLeft-this.x-this.width-yx_edgeMargin;
  }
  else if (dy>0 && this.y+dy>=yx_scrollingTop) {
    dy=yx_scrollingTop-this.y+yx_edgeMargin;
  }
  else if (dy<0 && this.y+this.height-yx_scrollingTop+dy<=yx_winHeight) {
    dy=yx_winHeight+yx_scrollingTop-this.y-this.height-yx_edgeMargin;
  }
  else {
    done=false;
  }

  this.moveMBy(dx,dy);
  if (!done) { yx_scrollingTimer=yx_callBack(this,"scrollIt","("+dx+","+dy+")",floatTimer); }
}

function yx_itemOBJ(lead,content) {
  this.lead=lead; this.content=content; this.styleI=null;

  this.item=null; this.tag=null; this.icon=null; this.icon2=null; this.dis=null;
  this.cover=null; this.menu=null;

  this.x=0; this.y=0; this.ox=0; this.oy=0; this.width=0; this.height=0; this.ow=0; this.oh=0;
  this.code1=""; this.code2="";

  this.makeI=yx_makeI; this.makeC=yx_makeC; this.onIt=yx_onIt; this.offIt=yx_offIt;
}

function yx_menuOBJ(head,lead,content) {
  this.head=head; this.lead=lead; this.content=content; this.style=null;

  this.holder=null; this.pad=null;
  this.items=new Array(); this.active=null; this.itemL=content.items.length; this.actual=false;

  this.ready=false; this.flying=false; this.go=false; this.shown=false; this.open=false;

  this.x=0; this.y=0; this.width=0; this.height=0; this.sW=0; this.sH=0; this.getPos=yx_getPos;
  this.code1=""; this.code2="";

  this.makeM=yx_makeM; this.showM=yx_showM; this.hideM=yx_hideM; this.blurM=yx_blurM; this.moveMTo=yx_moveMTo; this.moveMBy=yx_moveMBy;
  this.scrollIt=yx_scrollIt; this.bar=false;
}

function yx_switchPath(menu,mode) {
  for (var i=0; i<menu.itemL; i++) {
    var item=menu.items[i];
    if (item.content.onPath==1) {
      var si=item.styleI;
      yx_setCSS(item,si.sItem.cssP[mode],si.sTag.cssP[mode],si.sIcon.cssP[mode],si.sIcon.cssP2[mode],si.sFont.cssP[mode],true,si.sItem.xAlign,si.sItem.yAlign,false);
      if (item.content.type==yx_M && item.menu.ready) {
        yx_switchPath(item.menu,mode);
      }
      break;
    }
  }
}
function yx_updatePath(menu,path,mode) {
  var curItem=path.shift();
  for (var i=0; i<menu.items.length; i++) {
    if (menu.items[i].group==curItem) {
      menu.items[i].onPath=mode;
      if (menu.items[i].type==yx_M && path.length>0) {
        yx_updatePath(menu.items[i],path,mode);
      }
      break;
    }
  }
}
function yx_showPath(x) {
  if (this.itemPath.length>0) {
    if (this.menu.ready) { yx_switchPath(this.menu,0); }
    yx_updatePath(this.menu.content,this.itemPath,0);
  }
  var newPath=new Array();
  for (var i=1; i<x.length; i++) {
    newPath[i-1]=x[i];
  }
  if (newPath.length>0) {
    this.itemPath=newPath.copy();
    yx_updatePath(this.menu.content,newPath,1);
    if (this.menu.ready) { yx_switchPath(this.menu,1); }
  }
}
function yx_resetPath() {
  if (this.menu.ready) { yx_switchPath(this.menu,0); }
  if (this.itemPath.length>0) {
    yx_updatePath(this.menu.content,this.itemPath,0);
    this.itemPath=new Array();
  }
}

function yx_insOBJ(n,content,para) {
  this.name=n; this.content=content;

  this.floating=(para.search(/floating\s*:\s*yes/)!=-1);

  var ra=para.match(/position\s*:\s*(absolute|relative|slot)\s*([\w\-]+)?/);
  this.pos=(ra && ra[1])?ra[1]:"absolute";
  this.ref=(ra && ra[2])?ra[2]:"";

  this.xAlign=para.search(/align\s*:\s*(left|center|right)/)!=-1?(RegExp.$1):"left";
  this.yAlign=para.search(/valign\s*:\s*(top|middle|bottom)/)!=-1?(RegExp.$1):"top";

  this.dx=para.search(/offset-left\s*:\s*(-?\d+)/)!=-1?parseInt(RegExp.$1,10):0;
  this.dy=para.search(/offset-top\s*:\s*(-?\d+)/)!=-1?parseInt(RegExp.$1,10):0;

  this.bar=(para.search(/menu-form\s*:\s*bar/)!=-1);
  this.dir=para.search(/direction\s*:\s*(right-down|right-up|left-down|left-up|center-down|center-up|abs-right-down|abs-right-up|abs-left-down|abs-left-up|abs-center-up|abs-center-down|right-top|left-top|right-middle|left-middle|right-bottom|left-bottom)/)!=-1?(RegExp.$1):"right-down";
  this.vis=(para.search(/visibility\s*:\s*hidden/)==-1);
  this.target=para.search(/target\s*:\s*([\w\-]+)/)!=-1?(RegExp.$1):"";
  this.sticky=(para.search(/sticky\s*:\s*yes/)!=-1);
  this.highlight=(para.search(/highlight\s*:\s*no/)==-1);

  this.style=yx_findGroup(para.search(/style\s*:\s*([\w\-]+)/)!=-1?(RegExp.$1):"");

  this.lead=null; this.head=this;
  this.menu=new yx_menuOBJ(this,this,this.content);

  this.timer=-1; this.timeIt=yx_timeIt; this.sX=0; this.sY=0; this.z=zBase-1;
  this.holder=null; this.getHolder=yx_getHolder; this.ox=0; this.oy=0;
  this.itemPath=new Array(); this.showPath=yx_showPath; this.resetPath=yx_resetPath;

  this.showIns=yx_showIns; this.hideIns=yx_hideIns; this.movInsTo=yx_movInsTo; this.movInsBy=yx_movInsBy;
}; yx_ins=new Array();

function yx_showIns() {
  yx_checkPage();
  if (yx_loaded) {
    if (this.holder==null) { this.getHolder(); }
    yx_closeIns(this); this.menu.showM();
  }
}
function yx_hideIns() {
  yx_checkPage();
  if (yx_loaded) {
    this.menu.hideM(true);
  }
}
function yx_movInsTo(x,y) {
  if (this.menu.ready) {
    this.holder.x=x; this.holder.y=y;
    this.menu.getPos(false); this.menu.blurM();
  }
}
function yx_movInsBy(x,y) {
  if (this.menu.ready) {
    this.holder.x+=x; this.holder.y+=y;
    this.menu.moveMBy(x,y); this.menu.blurM();
  }
}

function yx_timeIt() {
  yx_getDim();

  if (this.sX!=yx_scrollingLeft || this.sY!=yx_scrollingTop) {
    var mx=yx_scrollingLeft>this.sX?Math.ceil:Math.floor, my=yx_scrollingTop>this.sY?Math.ceil:Math.floor;
    var dx=mx((yx_scrollingLeft-this.sX)/floatOffset), dy=my((yx_scrollingTop-this.sY)/floatOffset); this.sX+=dx; this.sY+=dy;
    this.movInsBy(dx,dy);
  }

  this.timer=yx_callBack(this,"timeIt","()",floatTimer);
}

function yx_bringUp(item) {yx_setZIndex(item.item,yx_itemUpZ); yx_setZIndex(item.cover,yx_coverUpZ); }
function yx_bringDown(item) { yx_setZIndex(item.item,yx_itemZ); yx_setZIndex(item.cover,yx_coverZ); }

function yx_overOther() { yx_stopAll(); }
function yx_outOther() { yx_stopAll(); if (!this.sticky) { yx_setIt(); } }
function yx_clickOther() { yx_isInfo=false; yx_stopEvent(); }

function yx_markIt(mode) {
  var item=this.item, menu=item.lead, prep=menu.active;
  var si=item.styleI, sItem=si.sItem, sFont=si.sFont, sTag=si.sTag, sIcon=si.sIcon;

  if (prep!=null && prep!=item) { prep.offIt(); }
  menu.active=item;

  yx_bringUp(item);
  yx_setCSS(item,mode==0?sItem.cssH:sItem.cssS,mode==0?sTag.cssH:sTag.cssS,mode==0?sIcon.cssH:sIcon.cssS,mode==0?sIcon.cssH2:sIcon.cssS2,mode==0?sFont.cssH:sFont.cssS,(mode==0 && item!=prep),sItem.xAlign,sItem.yAlign,mode==0?sItem.filterH:false);
}

function yx_upIt(it) {
  var x=it.lead.lead;
  if (x.lead!=null) { x.cover.markIt(1); yx_upIt(x); }
}

function yx_downIt(it) {
  var x=it.menu;
  if (x!=null && x.shown) {
    for (var i=0; i<x.itemL; i++) {
      if (x.items[i].menu!=null && x.items[i].menu.shown) {
        x.items[i].cover.markIt(1); yx_downIt(x.items[i]);
        break;
      }
    }
  }
}

function yx_onIt() {
  var type=this.content.type, menu=this.lead, head=menu.head;

  yx_closeIns(head);
  if (head.z<zBase) { yx_setIdx(head,++zBase); }

  for (var i=0; i<menu.itemL; i++) {
    if (menu.items[i]!=this && menu.items[i].menu!=null) { menu.items[i].menu.hideM(true); }
  }

  var sPad=menu.style.sPad;
  var dx=(sPad.scroll=="none" || sPad.scroll=="y-only")?0:yx_getDX(menu.x,this.x,menu.bar?sPad.iOffx:0,menu.width,sPad.step==0?this.width:sPad.step), dy=(sPad.scroll=="none" || sPad.scroll=="x-only")?0:yx_getDY(menu.y,this.y,menu.bar?0:sPad.iOffy,menu.height,sPad.step==0?this.height:sPad.step);
  if (dx!=0 || dy!=0) {
    yx_scrollingTimer=yx_callBack(menu,"scrollIt","("+dx+","+dy+")",menuTimer);
  }
  else if (type==yx_M) {
    if ((this.styleI.sItem.onOver || menu.open) && !this.menu.shown && this.menu.itemL>0) {
      this.menu.showM();
    }
    else if (!head.highlight) {
      this.menu.blurM();
    }
  }
}

function yx_offIt() {
  var si=this.styleI, mode=this.content.onPath;
  yx_bringDown(this);
  yx_setCSS(this,si.sItem.cssP[mode],si.sTag.cssP[mode],si.sIcon.cssP[mode],si.sIcon.cssP2[mode],si.sFont.cssP[mode],true,si.sItem.xAlign,si.sItem.yAlign,si.sItem.filterN);
}

function yx_overItem() {
  var item=this.item;

  if (item.lead.shown) {
    yx_stopAll(); yx_showMsg(item.content.msg);
    if (item.code1!="") { eval(item.code1); }
    this.markIt(item.content.type==yx_M && item.lead.open?1:0); yx_upIt(item); yx_downIt(item);
    yx_onItemTimer=yx_callBack(item,"onIt","()",menuTimer);
  }
}

function yx_outItem() {
  yx_stopAll();
  if (this.item.code2!="") { eval(this.item.code2); }
  if (!this.sticky) { yx_setIt(); }
}

function yx_getHolder() {
  var x=0, y=0;
  if (this.pos=="relative") {
    var l=yx_findLayer(this.ref);
    if (l!=null) {
      x=yx_getLeft(l); y=yx_getTop(l);
    }
  }
  else if (this.pos=="slot") {
    var s=yx_getSlot(parseInt(this.ref));
    x=s.x; y=s.y;
  }

  x+=this.dx; y+=this.dy; this.ox=x; this.oy=y;
  this.holder=new yx_xyOBJ(x,y);
}

function yx_resizeIt() {
  yx_stopAll(); yx_otherResize(); yx_getDim();

  for (var i=0; i<yx_ins.length; i++) {
    var ins=yx_ins[i];
    if (ins.menu.ready) {
      yx_stopIt(ins.timer); ins.timer=-1;
      ins.hideIns(); ins.getHolder(); ins.menu.getPos(false);
    }
  }

  if (yx_winEvent!="") { eval(yx_winEvent); }
}

function yx_checkItem(menu,id) {
  var items=menu.items, item=null;
  for (var i=0; i<menu.itemL; i++) {
    if (items[i].content.group==id) {
      return items[i];
    }
  }
  for (var i=0; i<menu.itemL; i++) {
    if (items[i].menu!=null && items[i].menu.ready) {
      item=yx_checkItem(items[i].menu,id);
      if (item!=null) {
        break;
      }
    }
  }
  return item;
}
function yx_findItem(n,id) {
  var ins=yx_findIns(n,false);
  if (ins!=null && ins.menu.ready) {
    var item=yx_checkItem(ins.menu,id);
    if (item!=null) {
      return item;
    }
  }
  return null;
}

function yx_void() { return true; }

function getMenuDim(n) { var ins=yx_findIns(n,true); return ins==null?null:(new yx_dimOBJ(ins.menu.x, ins.menu.y, ins.menu.width, ins.menu.height, yx_getScrollX(), yx_getScrollY())); }
function showMenu(n) { var ins=yx_findIns(n,false); if (ins!=null) { yx_stopAll(); ins.showIns(); } }
function showMenuX(n) { var ins=yx_findIns(n,false); if (ins!=null) { yx_stopAll(); ins.vis=true; ins.showIns(); } }
function hideMenu(n) { var ins=yx_findIns(n,true); if (ins!=null) { ins.hideIns(); } }
function hideMenuX(n) { var ins=yx_findIns(n,true); if (ins!=null) { ins.vis=false; ins.hideIns(); } }
function moveMenuTo(n,x,y) { var ins=yx_findIns(n,true); if (ins!=null) { ins.movInsTo(x,y); } }
function moveMenuBy(n,x,y) { var ins=yx_findIns(n,true); if (ins!=null) { ins.movInsBy(x,y); } }
function moveMenuBack(n) { var ins=yx_findIns(n,true); if (ins!=null) { ins.movInsTo(ins.ox,ins.oy); } }
function openMenu(n) { yx_stopAll(); yx_onItemTimer=setTimeout("showMenu('"+n+"')",menuTimer); }
function openMenuX(n) { yx_stopAll(); yx_onItemTimer=setTimeout("showMenuX('"+n+"')",menuTimer); }
function closeMenuNow() { yx_closeIns(null); }
function closeMenu() { yx_stopAll(); yx_setIt(); }
function closeMenuX(n) { var ins=yx_findIns(n,true); if (ins!=null) { ins.vis=false; }; closeMenu(); }
function clickMenu(n) { yx_stopEvent(); showMenu(n); }
function clickMenuX(n) { yx_stopEvent(); showMenuX(n); }
function switchMenu(n) { yx_stopEvent(); var ins=yx_findIns(n,false); if (ins!=null) { var act=(ins.vis && ins.menu.shown)?hideMenuX:showMenuX; act(n); } }
function setHolder(n,id) { var ins=yx_findIns(n,false), l=yx_findLayer(id); if (ins!=null && l!=null) { ins.ox=yx_getLeft(l)+ins.dx; ins.oy=yx_getTop(l)+ins.dy; ins.holder=new yx_xyOBJ(ins.ox,ins.oy); } }
function setCoordinates(n,x,y) { var ins=yx_findIns(n,false); if (ins!=null) { ins.ox=x; ins.oy=y; ins.holder=new yx_xyOBJ(x,y); } }
function slideMenuBack(n) { var ins=yx_findIns(n,false); if (ins!=null) { addMenuEvent(ins.menu.content.name, "", "moveMenuBack('"+n+"')"); } }
function showPagePath(n) { var ins=yx_findIns(n,false); if (ins!=null) { ins.showPath(showPagePath.arguments); } }
function resetPagePath(n) { var ins=yx_findIns(n,false); if (ins!=null) { ins.resetPath(); } }
function updateItemDisplay(n,id,dis) { var item=yx_findItem(n,id); if (item!=null && item.content.type!=yx_S) { item.dis.innerHTML=dis; } }
function updateItemLink(n,id,link) { var item=yx_findItem(n,id); if (item!=null && item.content.type==yx_L) { item.content.link=link; } }
function updateItemCode(n,id,code) { var item=yx_findItem(n,id); if (item!=null && item.content.type==yx_C) { item.content.code=code; } }

if (yx_menuSafe) {
  var yx_menuScript=scriptPath+(yx_isGecko?"menuG5GeckoX.js":yx_isOpera7?"menuG5OperaX.js":yx_isSafari?"menuG5SafariX.js":"menuG5IEX.js");
  document.write("<scr"+"ipt language='javascript' src='"+yx_menuScript+"' type='text/javascript'><\/scr"+"ipt>");
  if (typeof(contentScript)!="undefined") {
    document.write("<scr"+"ipt language='javascript' src='"+contentScript+"' type='text/javascript'><\/scr"+"ipt>");
  }
  if (typeof(styleScript)!="undefined") {
    document.write("<scr"+"ipt language='javascript' src='"+styleScript+"' type='text/javascript'><\/scr"+"ipt>");
  }
  if (typeof(instanceScript)!="undefined") {
    document.write("<scr"+"ipt language='javascript' src='"+instanceScript+"' type='text/javascript'><\/scr"+"ipt>");
  }
}
else if (typeof(nonMenuPage)!="undefined") {
  setTimeout("window.location.replace('"+nonMenuPage+"')",0);
}
