
wp_menus.prototype.m_type = 0;
wp_menus.prototype.m_delay = 600;
wp_menus.prototype.m_bordersize = 1;
wp_menus.prototype.m_fontsize = 12;
wp_menus.prototype.m_filterOpacity = 100;
wp_menus.prototype.m_mozOpacity = 1;
wp_menus.prototype.m_fontfamily = 'Verdana';
wp_menus.prototype.m_bordercolor = '#000075';
wp_menus.prototype.m_bkgndcolor = '#A2C9F0';
wp_menus.prototype.m_textcolor = '#000075';
wp_menus.prototype.m_bkgndcolorhl = '#000075';
wp_menus.prototype.m_textcolorhl = '#A2C9F0';
wp_menus.prototype.m_imagearrow = 'arrow.gif';
wp_menus.prototype.m_imagearrowhl = 'arrowhl.gif';
wp_menus.prototype.m_timeout = null;
wp_menus.prototype.m_active = null;
wp_menus.prototype.m_acStack = new wp_activestack();

function wp_menus() {}
wp_menus.prototype.InitElement = function(id_name,normal,over) { var e = document.getElementById(id_name); e.p_root = this; e.m_imgNormal = new Image(); e.m_imgOver = new Image(); e.m_imgNormal.src = normal; e.m_imgOver.src = over; }
wp_menus.prototype.BeginMenu = function(id_name) { this.m_active = id_name; document.write('<div id="'+id_name+'" style="z-index:100;border:'+this.m_bordersize+'px solid '+this.m_bordercolor+';filter:alpha( opacity='+this.m_filterOpacity+' );-moz-opacity:'+this.m_mozOpacity+';position:absolute;visibility:hidden;">'); }
wp_menus.prototype.EndMenu = function() { document.write('</div>'); this.m_active = null; }
wp_menus.prototype.AddLink = function(id_name,title,url,id_submenu) {
  document.write('<a id="'+id_name+'" href="'+url+'" style="display:block;padding:4px 1px 3px 1px;width:138px;position:relative;text-decoration:none;background-color:'+this.m_bkgndcolor+';color:'+this.m_textcolor+';font-size:'+this.m_fontsize+'px;font-family:'+this.m_fontfamily+';text-align:left;');
  if(id_submenu) { document.write('background-image:url('+this.m_imagearrow+');background-repeat:no-repeat;background-position:right;'); }
  document.write('" onmouseover="wp_SubMenuOver(\''+id_name+'\');');
  document.write('" onmouseout="wp_SubMenuOut(\''+id_name+'\');">');
  document.writeln(title+'</a>\n');
  var e = document.getElementById(id_name);
  e.m_root = this; e.m_idchild = id_submenu; e.m_menu = this.m_active;
}
function wp_ImageRoll(action,id_name) { var e = document.getElementById(id_name); if(action == 0) { e.src = e.m_imgNormal.src; } else { e.src = e.m_imgOver.src; }}
function wp_MenuItemOver(id_name,p_root,id_sub) { clearInterval(p_root.m_timeout); if(id_sub) document.getElementById(id_sub).m_depth = 1; p_root.m_active = id_name; p_root.m_acStack.push(0,id_name,id_sub); }
function wp_SubMenuOver(id_name) { var e = document.getElementById(id_name); var pm = document.getElementById(e.m_menu); if(e.m_idchild) document.getElementById(e.m_idchild).m_depth = pm.m_depth+1; clearInterval(e.m_root.m_timeout); e.m_root.m_acStack.push(pm.m_depth,id_name,e.m_idchild); }
function wp_SubMenuOut(id_name) { var e = document.getElementById(id_name); e.m_root.m_timeout = setInterval("wp_Timeout('"+e.m_root.m_active+"')",e.m_root.m_delay); }
function wp_MenuItemOut(id_name,p_menu) { p_menu.m_timeout = setInterval("wp_Timeout('"+id_name+"')",p_menu.m_delay); }
function wp_Timeout(id_name) { var e = document.getElementById(id_name); e.p_root.m_acStack.clear(); e.p_root.m_active = null; }

wp_activestack.prototype.count = 0;
wp_activestack.prototype.depth = new Array();
wp_activestack.prototype.element = new Array();
wp_activestack.prototype.type = 0;
function wp_activestack() {}

wp_activestack.prototype.push = function(depth,idelem,idchild) {
  while(( this.count>0 )&&( depth<=this.depth[this.count-1] )) { this.pop(); }
  if(idelem) {
    this.depth[this.count] = depth; this.element[this.count] = idelem; this.count++;
    document.getElementById(idelem).m_idchild = idchild;
    if(depth==0) { wp_ImageRoll(1,idelem); if(idchild) this.ShowMenu(idchild,idelem,true);
    } else {
      var e = document.getElementById(idelem);
      e.style.backgroundColor = e.m_root.m_bkgndcolorhl;
      e.style.color = e.m_root.m_textcolorhl;
      if(e.style.backgroundImage) e.style.backgroundImage = 'url('+e.m_root.m_imagearrowhl+')';
      if(idchild) this.ShowMenu(idchild,idelem,false);
    }
  }
}

wp_activestack.prototype.pop = function() {
  with( this ) {
    if(count>0) { count--;
      if(depth[count]==0) { wp_ImageRoll(0,element[count]); }
      else {
        var e = document.getElementById(element[count]);
        e.style.backgroundColor = e.m_root.m_bkgndcolor;
        e.style.color = e.m_root.m_textcolor;
        if( e.style.backgroundImage ) e.style.backgroundImage = 'url('+e.m_root.m_imagearrow+')';
      }
      var idchild = document.getElementById(element[count]).m_idchild;
      if(idchild) document.getElementById(idchild).style.visibility = "hidden";
      depth[count] = element[count] = null;
    }
  }
}

wp_activestack.prototype.clear = function() { while(this.count>0) { this.pop(); }}
wp_activestack.prototype.ShowMenu = function(id_name,id_parent,down) { var p = document.getElementById(id_parent); var e = document.getElementById(id_name);  var top = 0; var left = 0; var c = p;
  while(c) { top += c.offsetTop; left += c.offsetLeft; c = c.offsetParent; }
  if( this.type==1 || !down ) left += p.offsetWidth; else top += p.offsetHeight; e.style.top = top+"px"; e.style.left = left+"px"; e.style.visibility = "visible";
}
