function calmenulocleft(Tid){
	ML = document.getElementById(Tid)
	xPos = eval(ML).offsetLeft;
	tempEl = eval(ML).offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	
	return xPos;
}
function calmenuloctop(Tid){
	ML = document.getElementById(Tid)
	yPos = eval(ML).offsetTop;
	tempEl = eval(ML).offsetParent;
  	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	
	return yPos;
}
function turnonlayer(tlay){
	var object = findObj(tlay);
	object.style.visibility="visible"
}
function reposlayer(tgt,tlay){
	Lx=calmenulocleft(tgt)
	Ly=calmenuloctop(tgt)
	NS4=(document.layers);
    IE4=(document.all);
    var browser = navigator.appName;
    var version = parseInt(navigator.appVersion);
    var object = findObj(tlay);
	
	Lxc=eval(Lx);
	Lyc=eval(Ly+5);
    if ((browser == 'Netscape') && (version == 5)){
    Move(Lxc, Lyc, object)
    }
    if (IE4){
    object.style.posLeft=Lxc
	object.style.posTop=Lyc
    }
    if ((browser == 'Netscape') && (version == 7)){
    document.all[object].style.posTop = Lyc;
    document.all[object].style.posLeft = Lxc;
    }
	
    }
	
function Move(x, y, Nlayer){
	Nlayer.style.left=x + 'px';
    Nlayer.style.top=y + 'px';
}
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

