mtimeout=0,tonum=0,x=1,y=1;
function smenu(n,bn)
{
 if (n==1)
 {
  el=document.getElementById('m'+bn);
  pos = getAbsolutePos(document.getElementById("bm"+bn));
  el.style.left=pos.x;
  el.style.top =pos.y+22;
  el.style.visibility='visible';
 }
}

function omenu(n,bn)
{
 if (n==1)
 {
  if (mtimeout==0) mtimeout=1;
  if (mtimeout==1)
  {
   el=document.getElementById('m'+bn);
   el.style.visibility='hidden';
   clearTimeout(tonum);
  }
 }
}

function getAbsolutePos(el)
{
 var r = { x: el.offsetLeft, y: el.offsetTop };
 if (el.offsetParent)
 {
  var tmp = getAbsolutePos(el.offsetParent);
  r.x += tmp.x;
  r.y += tmp.y;
 }
 return r;
}
function openPictureWindow (imageName,imageWidth,imageHeight,alt,posLeft,posTop)
{
 newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
 newWindow.document.open();
 newWindow.document.write('<html><tit'+'le>'+alt+'</tit'+'le><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
 newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>');
 newWindow.document.write('</body></html>');
 newWindow.document.close();
 newWindow.focus();
 return false;
}
