// JavaScript Document
function openUtilWindow(url,width,height)
{
	window.open (url,
"mywindow","menubar=0,resizable=1,width="+width+",height="+height); 
}

function closeUtilWindow(refreshParent)
{
	window.opener.location.href = window.opener.location.href;//window.opener.location.reload()

	if (refreshParent==true)
  	{
    	window.opener.progressWindow.close()
  	}
  	window.close();
}

function showMenu(menu, parent)
{
	var myparent = document.getElementById(parent);
		var x = findPosX(myparent);
		var y = findPosY(myparent) 
				+myparent.offsetHeight;
		var myDiv = document.getElementById(menu);
		//alert(x.toString() +" "+ y.toString());
		myDiv.style.left = x.toString()+"px";
		myDiv.style.top = y.toString()+"px";
		myDiv.style.visibility = 'visible';
		//alert(myDiv);
}
function hideMenu(menu)
{
	document.getElementById(menu).style.visibility='hidden';
}
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;
  }
/*
*the actual menu is just a <div> with all the links,
*so you would for example call showMenu(menu, parent) from an image's onMouseOver property.
*'menu' refers to the actual div to be displayed,
*'parent' is usually the item you mouseOver to make the menu appear
*all colors, borders, etc can be changed as normal by using css
*/

