function openPopup(imageName,popupName,windowHeight,windowWidth)
{
	var windowHeight = windowHeight+30;
	var windowWidth = windowWidth+40;
	var newWindow;
	//alert('foo');
	newWindow = window.open(imageName,popupName,"height="+windowHeight+",width="+windowWidth+",toolbar=0,location=1,directories=0,status=0,menubar=0,scrollbars=1,resizeable=1");
	//newWindow.resizeTo(530,677);
	//newWindow.focus();
	//newWindow.resizeTo(''+windowWidth+'',''+windowHeight+'');
}

function showLayer(layer,top,left)
{
	document.getElementById(layer).style.top = top+-25+'px';
	document.getElementById(layer).style.left = left+250+'px';
	document.getElementById(layer).style.display = "inline";
	document.getElementById(layer).style.position = "absolute";
}

						
function hideLayer(layer)
{
	document.getElementById(layer).style.display = "none";
}

function findPosX(obj)
{
  var curleft = 0;
  if(obj.offsetParent)
      while(1) 
      {
        curleft += obj.offsetLeft;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.x)
      curleft += obj.x;
  return curleft;
}

						
function findPosY(obj)
{
  var curtop = 0;
  if(obj.offsetParent)
      while(1)
      {
        curtop += obj.offsetTop;
        if(!obj.offsetParent)
          break;
        obj = obj.offsetParent;
      }
  else if(obj.y)
      curtop += obj.y;
  return curtop;
}

