﻿AjaxControlToolkit.FloatingBehavior=function(H){AjaxControlToolkit.FloatingBehavior.initializeBase(this,[H]);var E;var G;var D;var C;var F;var B=Function.createDelegate(this,A);this.add_move=function(I){this.get_events().addHandler("move",I)};this.remove_move=function(I){this.get_events().removeHandler("move",I)};this.get_handle=function(){return E};this.set_handle=function(I){if(E!=null){$removeHandler(E,"mousedown",B)}E=I;$addHandler(E,"mousedown",B)};this.get_profileProperty=function(){return C};this.set_profileProperty=function(I){C=I};this.get_profileComponent=function(){return F};this.set_profileComponent=function(I){F=I};this.get_location=function(){return G};this.set_location=function(I){if(G!=I){G=I;if(this.get_isInitialized()){$common.setLocation(this.get_element(),G)}this.raisePropertyChanged("location")}};this.initialize=function(){AjaxControlToolkit.FloatingBehavior.callBaseMethod(this,"initialize");AjaxControlToolkit.DragDropManager.registerDropTarget(this);var I=this.get_element();if(!G){G=$common.getLocation(I)}I.style.position="fixed";$common.setLocation(I,G)};this.dispose=function(){AjaxControlToolkit.DragDropManager.unregisterDropTarget(this);if(E&&B){$removeHandler(E,"mousedown",B)}B=null;AjaxControlToolkit.FloatingBehavior.callBaseMethod(this,"dispose")};this.checkCanDrag=function(J){var K=["input","button","select","textarea","label"];var I=J.tagName;if((I.toLowerCase()=="a")&&(J.href!=null)&&(J.href.length>0)){return false}if(Array.indexOf(K,I.toLowerCase())>-1){return false}return true};function A(J){window._event=J;var I=this.get_element();if(this.checkCanDrag(J.target)){D=$common.getLocation(I);J.preventDefault();this.startDragDrop(I)}}this.get_dragDataType=function(){return"_floatingObject"};this.getDragData=function(I){return null};this.get_dragMode=function(){return AjaxControlToolkit.DragMode.Move};this.onDragStart=function(){};this.onDrag=function(){};this.onDragEnd=function(I){if(!I){var L=this.get_events().getHandler("move");if(L){var M=new Sys.CancelEventArgs();L(this,M);I=M.get_cancel()}}var K=this.get_element();if(I){$common.setLocation(K,D)}else{var J=$common.getLocation(K);G=J.x+","+J.y;this.raisePropertyChanged("location")}};this.startDragDrop=function(I){AjaxControlToolkit.DragDropManager.startDragDrop(this,I,null)};this.get_dropTargetElement=function(){return document.body};this.canDrop=function(K,I,J){return(I=="_floatingObject")};this.drop=function(K,I,J){};this.onDragEnterTarget=function(K,I,J){};this.onDragLeaveTarget=function(K,I,J){};this.onDragInTarget=function(K,I,J){}};AjaxControlToolkit.FloatingBehavior.registerClass("AjaxControlToolkit.FloatingBehavior",AjaxControlToolkit.BehaviorBase,AjaxControlToolkit.IDragSource,AjaxControlToolkit.IDropTarget,Sys.IDisposable);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();