drags.pop();
		var e = d.element;
		d.stopScrolling();
		d.destroy();
		d.element = null;
		if (e.parentNode) {e.parentNode.removeChild(e)}; 
	}
}

function cleanup() { //try to remove circular references
	lis = document.getElementsByTagName("li");
	for (i = 0; i < lis.length; i++) {
		if (lis[i].longListItem) {lis[i].longListItem.destroy();}
		else if (lis[i].container) {lis[i].container.destroy();}
	}
	Draggables.clear();
}

window.onload = function() {
	var li = $("masterList").getElementsByTagName('LI')