function Drag(obj){
this.oBox= document.getElementById(obj);
this.disX =0;
this.disY =0;
var slef =this;
this.oBox.οnmοusedοwn=function(ev){
self.dragDown(ev)
}
}
Drag.prototype={
dragDown:function(ev){
this.disX =ev.clientX - this.oBox.offsetLeft;
this.disY = ev.clientY - this.oBox.offsetRight;
var self = this;
document.onmousemove = function(ev){
self.dragMove(ev);
}
document.onmouseup = function(ev){
document.οnmοusemοve=null;
document.onmouseup =null;
}
return false;
},
dragMove:function(ev){
var L = ev.clientX -this.disX;
var Y = ev.clientY - this.disY;
this.oBox.style.left = L + 'px';
this.oBox.style.top =Y + 'px';
}
}
this.oBox= document.getElementById(obj);
this.disX =0;
this.disY =0;
var slef =this;
this.oBox.οnmοusedοwn=function(ev){
self.dragDown(ev)
}
}
Drag.prototype={
dragDown:function(ev){
this.disX =ev.clientX - this.oBox.offsetLeft;
this.disY = ev.clientY - this.oBox.offsetRight;
var self = this;
document.onmousemove = function(ev){
self.dragMove(ev);
}
document.onmouseup = function(ev){
document.οnmοusemοve=null;
document.onmouseup =null;
}
return false;
},
dragMove:function(ev){
var L = ev.clientX -this.disX;
var Y = ev.clientY - this.disY;
this.oBox.style.left = L + 'px';
this.oBox.style.top =Y + 'px';
}
}