/*
   Milonic DHTML Menu Drag & Drop Module dragdrop.js version 1.3 - December 14 2004
   This module is only compatible with the Milonic DHTML Menu version 5.63 or higher

   Copyright 2004 (c) Milonic Solutions Limited. All Rights Reserved.
   This is a commercial software product, please visit http://www.milonic.com/ for more information.
*/

// 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

DragLayer=-1;
DragX=0;
DragY=0

function drag_drop(menuid)
{
	DragLayer=menuid;
	_gm=gmobj("menu"+DragLayer);
	if(ns4)_gm.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP);
	_gm.onmousedown=_DDgo;
	_gm.onmouseup=_DDstop;
}

function _DDgo()
{
	_TTmn=getMenuByName("M_toolTips")	
	if(_TTmn)
	{
		menuDisplay(_TTmn,0);
		clearTimeout(_Mtip)
		_Mtip=null
	}
	
	_gm=gmobj("menu"+DragLayer);
	_gm.style.zIndex=9999;
	gp=gpos(_gm);
	DragY=_Y-gp[0];
	DragX=_X-gp[1];
	inDragMode=1;
}

function _DDstop()
{
	_gm=gmobj("menu"+DragLayer);
	_gm.style.zIndex=_zi;
	inDragMode=0;
}

