//\///// //\ overLIB Draggable Plugin //\ //\ You may not remove or change this notice. //\ Copyright Erik Bosrup 1998-2003. All rights reserved. //\ Contributors are listed on the homepage. //\ See http://www.bosrup.com/web/overlib/ for details. //\///// if(typeof olInfo=='undefined'||typeof olInfo.meets=='undefined'||!olInfo.meets(4.14))alert('overLIB 4.14 or later is required for the Draggable Plugin.');else{registerCommands('draggable,altcut,dragimg'); if(typeof ol_draggable=='undefined')var ol_draggable=0;if(typeof ol_altcut=='undefined')var ol_altcut=0;if(typeof ol_dragimg=='undefined')var ol_dragimg=''; var o3_draggable=0,o3_altcut=0,o3_dragimg='',olImgLeft,olImgTop,olImgObj,olMseMv; function setDragVariables(){o3_draggable=ol_draggable;o3_altcut=ol_altcut;o3_dragimg=ol_dragimg;olImgObj=null;} function parseDragExtras(pf,i,ar){var k=i;if(k(olImgLeft+Obj.width)||YPos(olImgTop+Obj.height))return false;} return true;} function grabEl(e){var e=(e)?e:event;var X,Y;var cKy=(olNs4?e.modifiers&Event.ALT_MASK:(!olOp?e.altKey:e.ctrlKey));if((o3_altcut?!cKy:cKy)){ X=(e.pageX||eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft'));Y=(e.pageY||eval('e.clientY+o3_frame.'+docRoot+'.scrollTop'));if(chkCursorPosition(olImgObj,X,Y)){if(olNs4)document.captureEvents(Event.MOUSEUP);capExtent.onmousemove=moveEl;document.onmouseup=function(){setCursor(0);if(olIe4)over.onselectstart=null;capExtent.onmousemove=olMseMv;} setCursor(1);if(olIe4)over.onselectstart=function(){return false;} if(olNs4){cX=X cY=Y }else{ cX=X-(olNs4?over.left:parseInt(over.style.left));cY=Y-(olNs4?over.top:parseInt(over.style.top));} return(olNs4?routeEvent(e):false);} }else setCursor(0);} function moveEl(e){var e=(e)?e:event;var dX,dY,X,Y; X=(e.pageX||eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft'));Y=(e.pageY||eval('e.clientY+o3_frame.'+docRoot+'.scrollTop'));if(chkCursorPosition(olImgObj,X,Y)){if(olNs4){dX=X-cX;cX=X;dY=Y-cY;cY=Y;over.moveBy(dX,dY);}else repositionTo(over,X-cX,Y-cY);}} function endDrag(obj){if(olNs4){document.releaseEvents(Event.MOUSEDOWN|Event.MOUSEUP|Event.CLICK);document.onmousedown=document.onclick=null;}else{if(!obj)obj=over;obj.onmousedown=null;} document.onmouseup=null;} registerRunTimeFunction(setDragVariables);registerCmdLineFunction(parseDragExtras);registerHook("disp",startDrag,FBEFORE);registerHook("hideObject",stopDrag,FAFTER);if(olInfo.meets(4.14))registerNoParameterCommands('draggable,altcut');}