
/* *************** OUR OWN DRAG&DROP EVENT HANDLING FUNCTIONS *************** */
function myStart(ev, srcElem)
// ev: the mouse down event object
// srcElem: the source element, wich will be dragged
{
	var name= srcElem.getAttribute("name");
	//return false; // to cancel this event
	debug( name + " started");
}

function myDrag(ev, param, dragDiv, srcElem)
// param==0: the object has been moved into the current frame
// param==1: the object has been moved inside the current frame
// param==2: the object has been moved out of the current frame
// dragDiv: the div, containing the dragged object
{
	var name= srcElem.getAttribute("name");
	//return false; // to cancel this event
	switch (param)
	{
		case 0: { debug(name + " moved in: " + dragDiv.offsetLeft + ":" + dragDiv.offsetTop); break; }
		case 1: { debug(name + " moved: "    + dragDiv.offsetLeft + ":" + dragDiv.offsetTop); break; }
		case 2: { debug(name + " moved out"                                                ); break; }
	}
}

function myEnd(ev, param, dragDiv, srcElem)
// param==0: the drag&drop-operation has been finished normal
// param==2: the drag&drop-operation has been canceled
{
	var name= srcElem.getAttribute("name");
	//return false; // to cancel this event
	debug(name + " droped: " + param);
}

function myCancel(ev, param, dragDiv, srcElem)
// param==0: the drag&drop-operation has been finished normal
// param==2: the drag&drop-operation has been canceled
{
	var name= srcElem.getAttribute("name");
	//return false; // to cancel this event
	debug(name + " droped outside: " + param);
}

// simple function to print out the events into the yellow DIV
function debug(txt)
{
	//return false; // to cancel this event
	document.getElementById("debug").innerHTML = txt;
}

