var HTMLWindow=new Object();HTMLWindow.draggedObject=null;HTMLWindow.draggedAreaObject=null;HTMLWindow.startDPositionX=0;HTMLWindow.startDPositionY=0;HTMLWindow.maxDocZIndex=50;HTMLWindow.blinkingObject=null;HTMLWindow.setDraggable=function(D,B,E,C,A){var E=((E==undefined)?true:E);var C=((C==undefined)?true:C);var A=((A==undefined)?"1.0":A);if(String(this.dragMode).toLowerCase()=="switch"){D.isDraggable=(((D.isDraggable==undefined)||(!D.isDraggable))?true:false)}else{D.isDraggable=E}if(HTMLWindow.isDraggable(D)){if(D.style.position!="absolute"){posX=HTMLElement.findPosX(D);posY=HTMLElement.findPosY(D);D.style.top=posY+"px";D.style.left=posX+"px";D.style.filter="alpha(opasity="+(A*100)+")";D.style.MozOpacity=A;D.style.opasity=A;D.style.position="absolute"}D.style.zIndex=++HTMLWindow.maxDocZIndex;HTMLWindow.setDragAndDropFunctions(D,B);D.title="To start drag Click on Window header"}else{HTMLWindow.unsetDraggable(D,B)}if(C){HTMLWindow.blinkingObject=D;HTMLWindow.blinkBorder(7,"#ffffff","#000000",D.style.border)}};HTMLWindow.blinkBorder=function(C,B,A,D){if(HTMLWindow.blinkingObject==null){return }if(!C){HTMLWindow.blinkingObject.style.border=D;return }if(C%2){HTMLWindow.blinkingObject.style.border="1px solid "+B}else{HTMLWindow.blinkingObject.style.border="1px solid "+A}setTimeout("HTMLWindow.blinkBorder ("+(C-1)+', "'+B+'", "'+A+'", "'+D+'")',100)};HTMLWindow.unsetDraggable=function(B,A){HTMLWindow.unsetDragAndDropFunctions(B,A)};HTMLWindow.isDraggable=function(A){return((A.isDraggable!=undefined)&&(A.isDraggable))};HTMLWindow.startDragToObject=function(A){if(HTMLWindow.isDraggable(A)){HTMLWindow.draggedObject=A}else{if(A.parentNode!=undefined){HTMLWindow.startDragToObject(A.parentNode)}}};HTMLWindow.startDrag=function(A){currentEvent=A?A:event;src=currentEvent.srcElement?currentEvent.srcElement:currentEvent.target;HTMLWindow.startDragToObject(src);if(HTMLWindow.draggedObject!=null){HTMLWindow.startDPositionX=(currentEvent.clientX-HTMLWindow.draggedObject.style.left.replace("px",""));HTMLWindow.startDPositionY=(currentEvent.clientY-HTMLWindow.draggedObject.style.top.replace("px",""));HTMLWindow.draggedObject.style.zIndex=++HTMLWindow.maxDocZIndex}HTMLWindow.fixMouseSelect()};HTMLWindow.stopDrag=function(A){HTMLWindow.draggedObject=null;HTMLWindow.startDPositionX=0;HTMLWindow.startDPositionY=0};HTMLWindow.doMove=function(A){currentEvent=A?A:event;src=currentEvent.srcElement?currentEvent.srcElement:currentEvent.target;if(HTMLWindow.draggedObject!=null){HTMLWindow.draggedObject.style.position="absolute";HTMLWindow.draggedObject.style.top=(currentEvent.clientY-HTMLWindow.startDPositionY)+"px";HTMLWindow.draggedObject.style.left=(currentEvent.clientX-HTMLWindow.startDPositionX)+"px";if(typeof (HTMLWindow.draggedObject.onMove)=="function"){HTMLWindow.draggedObject.onMove()}HTMLWindow.fixMouseSelect()}};HTMLWindow.stopDragOnEsc=function(A){currentEvent=A?A:event;key=(currentEvent.which==undefined)?currentEvent.keyCode:currentEvent.which;if(key==27){HTMLWindow.stopDrag(currentEvent)}};HTMLWindow.setDragAndDropFunctions=function(B,A){currentDraggedAreaObject=((A)?A:B);if(document.all!=undefined){currentDraggedAreaObject.attachEvent("onmouseup",HTMLWindow.stopDrag);currentDraggedAreaObject.attachEvent("onmousedown",HTMLWindow.startDrag)}else{currentDraggedAreaObject.addEventListener("mouseup",HTMLWindow.stopDrag,false);currentDraggedAreaObject.addEventListener("mousedown",HTMLWindow.startDrag,false)}};HTMLWindow.unsetDragAndDropFunctions=function(B,A){currentDraggedAreaObject=((A)?A:B);if(document.all!=undefined){currentDraggedAreaObject.detachEvent("onmouseup",HTMLWindow.stopDrag);currentDraggedAreaObject.detachEvent("onmousedown",HTMLWindow.startDrag)}else{currentDraggedAreaObject.removeEventListener("mouseup",HTMLWindow.stopDrag,false);currentDraggedAreaObject.removeEventListener("mousedown",HTMLWindow.startDrag,false)}};HTMLWindow.attachDragAndDropEventsToBrowser=function(){if(document.all!=undefined){document.attachEvent("onmousemove",HTMLWindow.doMove);document.attachEvent("onkeypress",HTMLWindow.stopDragOnEsc)}else{document.addEventListener("mousemove",HTMLWindow.doMove,false);document.addEventListener("keypress",HTMLWindow.stopDragOnEsc,false)}};HTMLWindow.mouseSelectProtector=null;HTMLWindow.fixMouseSelect=function(){if(!HTMLWindow.mouseSelectProtector){var A='<input type="text" id="mouseSelectInputFixx" border="0" style="width: 0px; height: 0px; padding: 0px; margin: 0px; font-size: 0px; border: 0px; display: inline; position: absolute;" />';if(HTMLWindow.draggedObject!=null){HTMLWindow.draggedObject.insertAdjacentHTML("afterBegin",A)}else{document.body.insertAdjacentHTML("afterEnd",A)}HTMLWindow.mouseSelectProtector=document.getElementById("mouseSelectInputFixx");HTMLWindow.mouseSelectProtector.disabled=true}try{HTMLWindow.mouseSelectProtector.focus()}catch(B){HTMLWindow.mouseSelectProtector.disabled=false;HTMLWindow.mouseSelectProtector.focus();HTMLWindow.mouseSelectProtector.disabled=true}};HTMLWindow.attachDragAndDropEventsToBrowser();
