
// routine to add elements to array and toggle their visibility
var ObjectArray = new Array ();
var Moved = new Object();
var xx = -100;
var yy=-50;
var zind = 0;
function ToggleVis (which)
{
	var obj = document.getElementById(which);
	var already=false;   // already in the array?

	for (n=0; n<ObjectArray.length; n++)
	{
		if (ObjectArray[n] == obj) already=true;
		else if (Moved[obj.id]!=true && Moved[ObjectArray[n].id]!=true && Moved[obj.reloc] != true) ObjectArray[n].style.visibility = "hidden";
	}
	if (already == false)
	{
	    ObjectArray[ObjectArray.length] = obj;
	    Moved[obj.id] = false;  // set to true onMD on surrounding area during drag
	    //Moved[obj.reloc] = false;  // optional - set to true if forced relocation
	}
	if (expanded && !Moved[obj.id])
	{
//	    alert(obj.style.top);
	    xx+=180;
	    yy+=100;
	    obj.style.left=xx;
	    obj.style.top=yy; //alert(obj.style.top);
	    //Moved[obj.reloc] = true;
	    Moved[obj.id] = true;
    }
	if (obj.style.visibility != "visible") 
    {
//        if (document.all)  // change top location for firefox
//        {
//            var sPath = window.location.pathname;
//            var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
//            sPage == "PgControlPanelX.aspx"? obj.style.top = "471px": obj.style.top = "471px"; //was 291px??
//            alert(sPage);
//        }
		obj.style.visibility = "visible";
		zind++;
		obj.style.zIndex+=zind;
	}
	else 
	{
    	if (!(expanded && !Moved[obj.id])) obj.style.visibility = "hidden";
	}
}

function Hide(which)
{
//var obj = document.getElementById(which);
//alert(obj.visibility);
//	obj.visibility="hidden";
//	alert(obj.visibility);

}


