(function(C){var B=false;var E=null;var G={};var I={};var J;var H;var F;var A;var D={};C.getMousePosition=function(L){var K=0;var M=0;if(!L){var L=window.event}if(L.pageX||L.pageY){K=L.pageX;M=L.pageY}else{if(L.clientX||L.clientY){K=L.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;M=L.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return{x:K,y:M}};C.updatePosition=function(L){var N=C.getMousePosition(L);var M=(N.x-J);var K=(N.y-H);C(E).css("top",(F+K));C(E).css("left",(A+M))};C(document).mousemove(function(K){if(B&&D[E.id]=="on"){C.updatePosition(K);if(I[E.id]!=undefined){I[E.id](K,E)}return false}});C(document).mouseup(function(K){if(B&&D[E.id]=="on"){B=false;if(G[E.id]!=undefined){G[E.id](K,E)}return false}});C.fn.ondrag=function(K){return this.each(function(){I[this.id]=K})};C.fn.ondrop=function(K){return this.each(function(){G[this.id]=K})};C.fn.dragOff=function(){return this.each(function(){D[this.id]="off"})};C.fn.dragOn=function(){return this.each(function(){D[this.id]="on"})};C.fn.easydrag=function(K){return this.each(function(){if(undefined==this.id||!this.id.length){this.id="easydrag"+(new Date().getTime())}D[this.id]="on";C(this).css("cursor","move");C(this).mousedown(function(L){C(this).css("position","absolute");C(this).css("z-index","10000");B=true;E=this;var M=C.getMousePosition(L);J=M.x;H=M.y;F=this.offsetTop;A=this.offsetLeft;C.updatePosition(L);return K?true:false})})}})(jQuery);