//\/////
//\  coolTip Draggable Plugin
//\  This file requires coolTip 1.00 or later.
//\  Modified July 24, 2005
//\
//\  You may not remove or change this notice.
//\  Copyright Robert E Boughner 2005. All rights reserved.
//\  
//\  This plugin is governed by the same restrictions set forth
//\  in the prologue to cCore.js.
//\/////
//\  THIS IS A VERY MODIFIED VERSION. DO NOT EDIT OR PUBLISH. GET THE ORIGINAL!
if(typeof cInfo==cUdf||!cInfo.meets(1.00))alert('coolTip 1.00 or later is required for the Draggable Plugin.');else{registerCommands('draggable,altcut,dragimg');
setDefaultVariables('draggable|0|altcut|0|dragimg|');
var cMseMv;
function setDragVariables(obj){obj.draggable=cd_draggable;obj.altcut=cd_altcut;obj.dragimg=cd_dragimg;obj.imgObject=null;}
function parseDragExtras(pf,i,ar){var v,k=i;if(k<ar.length){if(ar[k]==DRAGGABLE){eval(pf+'draggable=('+pf+'draggable==0)?1:0');return k;}
if(ar[k]==ALTCUT){eval(pf+'altcut=('+pf+'altcut==0)?1:0');return k;}
if(ar[k]==DRAGIMG){eval(pf+'dragimg="'+ar[++k]+'"');return k;}}
return-1;}
function setOverTrip(obj){var pO=obj.pop;if(pO&&pO.close){if(cNs4){obj.captureEvents(Event.MOUSEOVER);obj.onmouseover=function(e){cTip=e.target;po=cTip.pop;if(po.draggable&&!cTip.onmousedown)startDrag();}
}else
obj.onmouseover=function(){cTip=this;po=cTip.pop;if(po.draggable&&!cTip.onmousedown)startDrag();}}}
function startDrag(){
with(po){if(draggable){if(sticky&&(cFrame==cd_frame)){if(!cTip.onmouseover)setOverTrip(cTip);initDrag();}else draggable=0;}}}
function stopDrag(){if(po.draggable)endDrag();}
function initDrag(){cMseMv=capExtent.onmousemove;if(cNs4){document.captureEvents(Event.MOUSEDOWN|Event.CLICK);document.onmousedown=grabEl;document.onclick=function(e){return routeEvent(e);}
}else{cTip.onmousedown=grabEl;}
with(po){if(dragimg)chkForImgSupport(dragimg);}
return true;}
function chkForImgSupport(dragImg){if(dragImg){with(po){dragimg=dragImg;if(typeof getAnchorObjRef!=cUdf)imgObject=getAnchorObjRef(dragImg);if(imgObject==null)dragimg='';}}}
function checkBodyImages(content){var obj,objI,objT,tT,rR,cC,kW3C=(document.getElementsByTagName)?1:0;if(!cNs4&&po.draggable){with(po){obj=kW3C?cTip.getElementsByTagName("table"):cTip.tags("table");tT=((typeof CSSW3C!=cUdf&&css==CSSW3C)||background)?0:(obj.length>2?2:1);rR=((typeof CSSW3C!=cUdf&&css==CSSW3C)&&cap||background)?1:0;objI=kW3C?obj[tT].getElementsByTagName("img"):obj[tT].all.tags("img");if(objI){for(var i=0;i<objI.length;i++){if(objI[i].name!=dragimg)continue;objI[i].id=dragimg;if(capicon){tT=(typeof CSSW3C!=cUdf&&css==CSSW3C)?0:1;rR=cC=0;objT=kW3C?obj[tT].getElementsByTagName("tr")[rR].getElementsByTagName("td")[cC]:obj[tT].all.tags("tr")[rR].all.tags("td")[cC];objI=kW3C?objT.getElementsByTagName("img"):objT.all.tags("img");if(objI){objI[0].removeAttribute("name");objI[0].removeAttribute("id");objI[0].removeAttribute("alt");objI[0].removeAttribute("title");}}}}}}}
function setCursor(on){if(cNs4)return;cTip.style.cursor=(on?'move':'auto');}
function chkCursorPosition(Obj,XPos,YPos){var pos;if(Obj){with(po){anchorx=anchory=0;anchoralign='LR';pos=getAnchorLocation(Obj);if(XPos<pos[0]||XPos>(pos[0]+Obj.width)||YPos<pos[1]||YPos>(pos[1]+Obj.height))return false;}}
return true;}
function grabEl(e){e=(e)?e:event;var X,Y;var cKy=(cNs4?e.modifiers&Event.ALT_MASK:(!cOp?e.altKey:e.ctrlKey));if((po.altcut?!cKy:cKy)){
X=(e.pageX||eval('e.clientX+cFrame.'+docRoot+'.scrollLeft'));Y=(e.pageY||eval('e.clientY+cFrame.'+docRoot+'.scrollTop'));if(chkCursorPosition(po.imgObject,X,Y)){if(cNs4)document.captureEvents(Event.MOUSEUP);capExtent.onmousemove=moveEl;document.onmouseup=function(){setCursor(0);if(cIe4)cTip.onselectstart=null;capExtent.onmousemove=cMseMv;}
setCursor(1);if(cIe4)cTip.onselectstart=function(){return false;}
if(cNs4){cX=X
cY=Y
}else{
cX=X-(cNs4?cTip.left:parseInt(cTip.style.left));cY=Y-(cNs4?cTip.top:parseInt(cTip.style.top));}
return(cNs4?routeEvent(e):false);}
}else setCursor(0);}
function moveEl(e){e=(e)?e:event;var dX,dY,X,Y;
X=(e.pageX||eval('e.clientX+cFrame.'+docRoot+'.scrollLeft'));Y=(e.pageY||eval('e.clientY+cFrame.'+docRoot+'.scrollTop'));if(chkCursorPosition(po.imgObject,X,Y)){if(cNs4){dX=X-cX;cX=X;dY=Y-cY;cY=Y;cTip.moveBy(dX,dY);}else
repositionTo(cTip,X-cX,Y-cY);}}
function endDrag(obj){if(cNs4){document.releaseEvents(Event.MOUSEDOWN|Event.MOUSEUP|Event.CLICK);document.onmousedown=document.onclick=null;}else{if(!obj)obj=cTip;obj.onmousedown=null;}
document.onmouseup=null;}
registerRunTimeFunction(setDragVariables);registerCmdLineFunction(parseDragExtras);registerHook("disp",startDrag,FBEFORE);registerHook("hideObject",stopDrag,FAFTER);registerHook("createPopup",checkBodyImages,FAFTER);if(cInfo.meets(1.00))registerNoParameterCommands('draggable,altcut');}
