jsDD = { arObjects: [], arDestinations: [], arContainers: [], arContainersPos: [], current_dest_index: false, current_node: null, wndSize: null, bStarted: false, bDisable: false, bDisableDestRefresh: false, Reset: function() { jsDD.arObjects = []; jsDD.arDestinations = []; jsDD.bStarted = false; jsDD.current_node = null; jsDD.current_dest_index = false; jsDD.bDisableDestRefresh = false; jsDD.bDisable = false; jsDD.x = null; jsDD.y = null; jsDD.wndSize = null; }, registerObject: function (obNode) { obNode.onmousedown = jsDD.startDrag; obNode.__bxddid = jsDD.arObjects.length; jsDD.arObjects[obNode.__bxddid] = obNode; }, registerDest: function (obDest) { obDest.__bxddid = jsDD.arDestinations.length; jsDD.arDestinations[obDest.__bxddid] = obDest; jsDD.refreshDestArea(obDest.__bxddid); }, registerContainer: function (obCont) { jsDD.arContainers[jsDD.arContainers.length] = obCont; }, getContainersScrollPos: function(x, y) { var pos = {'left':0, 'top':0}; for(var i=0, n=jsDD.arContainers.length; i= jsDD.arContainersPos[i]["left"] && x <= jsDD.arContainersPos[i]["right"] && y >= jsDD.arContainersPos[i]["top"] && y <= jsDD.arContainersPos[i]["bottom"]) { pos.left = jsDD.arContainers[i].scrollLeft; pos.top = jsDD.arContainers[i].scrollTop; } } return pos; }, setContainersPos: function() { for(var i=0, n=jsDD.arContainers.length; i= x && jsDD.arDestinations[i].__bxpos[1] <= y && jsDD.arDestinations[i].__bxpos[3] >= y ) { return i; } } return false; }, allowSelection: function() { document.onmousedown = null; var b = document.body; b.ondrag = null; b.onselectstart = null; b.style.MozUserSelect = ''; if (jsDD.current_node) { jsDD.current_node.ondrag = null; jsDD.current_node.onselectstart = null; jsDD.current_node.style.MozUserSelect = ''; } }, denySelection: function() { document.onmousedown = jsUtils.False; var b = document.body; b.ondrag = jsUtils.False; b.onselectstart = jsUtils.False; b.style.MozUserSelect = 'none'; if (jsDD.current_node) { jsDD.current_node.ondrag = jsUtils.False; jsDD.current_node.onselectstart = jsUtils.False; jsDD.current_node.style.MozUserSelect = 'none'; } }, Disable: function() {jsDD.bDisable = true;}, Enable: function() {jsDD.bDisable = false;} }