var h;
var w;
var l;
var t;
var topMar = 1;
var leftMar = -2;
var space = 1;
var isvisible;
var MENU_SHADOW_COLOR='#999999';//定义下拉菜单阴影色
var global = window.document
global.fo_currentMenu = null
global.fo_shadows = new Array

document.writeln("<div id=menuDiv style='Z-INDEX: 1000; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR: #FFFFFF'></div>");

function HideMenu() 
{
var mX;
var mY;
var vDiv;
var mDiv;
  if (isvisible == true)
{
    vDiv = document.all("menuDiv");
    mX = window.event.clientX + document.body.scrollLeft;
    mY = window.event.clientY + document.body.scrollTop;
    if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)){
      vDiv.style.visibility = "hidden";
      isvisible = false;
    }
}
}

function ShowMenu(vMnuCode,tWidth,bgcolor) {
  vSrc = window.event.srcElement;
  vMnuCode = "<table id='submenu' cellspacing=0 cellpadding=0 style='border:1 solid #FFFFFF;width:"+tWidth+"' onmouseout='HideMenu()' bgcolor='"+bgcolor+"'><tr height=23><td width=10 bgcolor=#D4ECBE >  </td><td nowrap align=left>" + vMnuCode + "</td></tr></table>";
  h = vSrc.offsetHeight-0;
  w = vSrc.offsetWidth;
  l = vSrc.offsetLeft + leftMar;
  t = vSrc.offsetTop + topMar + h + space-2;
  vParent = vSrc.offsetParent;
  while (vParent.tagName.toUpperCase() != "BODY")
  {
    l += vParent.offsetLeft;
    t += vParent.offsetTop;
    vParent = vParent.offsetParent;
  }

  menuDiv.innerHTML = vMnuCode;
  menuDiv.style.top = t;
  menuDiv.style.left = l;
  menuDiv.style.visibility = "visible";
  isvisible = true;
makeRectangulardropShadow(submenu, MENU_SHADOW_COLOR, 4)

}

function makeRectangulardropShadow(el, color, size)
{
  var i;
  for (i=size; i>0; i--)
  {
    var rect = document.createElement('div');
    var rs = rect.style
    rs.position = 'absolute';
    rs.left = (el.style.posLeft + i) + 'px';
    rs.top = (el.style.posTop + i) + 'px';
    rs.width = el.offsetWidth + 'px';
    rs.height = el.offsetHeight + 'px';
    rs.zIndex = el.style.zIndex - i;
    rs.backgroundColor = color;
    var opacity = 1 - i / (i + 1);
    rs.filter = 'alpha(opacity=' + (50 * opacity) + ')';
    el.insertAdjacentElement('afterEnd', rect);
    global.fo_shadows[global.fo_shadows.length] = rect;
  }
}

var m1= '<table height=20 border=0 cellspacing=0 cellpadding=0><tr><td nowrap width=70 height=20 align=center><A href="products.asp?id=1">刨花板</A>&nbsp;|&nbsp;</td><td nowrap width=60 height=20 align=center><A href="products.asp?id=2">中纤板</A>&nbsp;|&nbsp;</td><td nowrap width=90 height=20 align=center><A href=products.asp?id=3>三聚氰氨饰面板</A></td></tr></table>'
