// This module does not contain any user definable parameters.
// In order to enable menus as dragable, the menu must be alwaysvisible
// and the menu item initiating drag/drop must have the property type=dragable; declared

resetFollowScrollers=true; // If you want the menu to remain in the position dragged to for $X menus, set resetFollowScrollers to false

DragLayer=-1;
DragX=0;
DragY=0

function drag_drop(m,item)
{
	DragLayer=m;
	_gm=$F("menu"+DragLayer);
	if(ns4)_gm.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP);
	$F("el"+_itemRef).onmousedown=_DDgo;
	$F("el"+_itemRef).onmouseup=_DDstop;
}

function _DDgo()
{
	var t=$h("M_toolTips")	
	if(t)
	{
		$Y(t,0);
		clearTimeout(_Mtip)
		_Mtip=null
	}
	_gm=$F("menu"+DragLayer);
	_m[DragLayer].ifr=DragLayer
	gp=$D(_gm);
	DragY=_Y-gp[0];
	DragX=_X-gp[1];
	inDragMode=1;
}

function _DDstop()
{
	_gm=$F("menu"+DragLayer);
	_gm.style.zIndex=_zi;
	if(!resetFollowScrollers&&_m[DragLayer][19])_m[DragLayer][19]=_Y-_sT-(gp[2]/2)
	inDragMode=0;
}


