
// reference local blank image

Ext.BLANK_IMAGE_URL = '../extjs/resources/images/default/s.gif';
Ext.namespace('MyTest');
// create application
MyTest.dd = function() {
var dragZone1, dragZone2, dropTarget1, dropTarget2;
return {
init: function() {
	dragZone1 = new MyTest.dd.MyDragZone('dd1-ct', {ddGroup: 'group',scroll: false});
	dragZone2 = new MyTest.dd.MyDragZone('dd2-ct', {ddGroup: 'group',scroll: false});
	dropTarget1 = new MyTest.dd.MyDropTarget('dd1-ct', {ddGroup: 'group', overClass: 'dd-over'});
	dropTarget2 = new MyTest.dd.MyDropTarget('dd2-ct', {ddGroup: 'group', overClass: 'dd-over'});
}
};
}();

MyTest.dd.MyDragZone = function(el, config) {
config = config || {};
Ext.apply(config, {
	ddel: document.createElement('div')
});

MyTest.dd.MyDragZone.superclass.constructor.call(this, el, config);
};

Ext.extend(MyTest.dd.MyDragZone, Ext.dd.DragZone, {
getDragData: function(e) {
	var target = Ext.get(e.getTarget());
	if(target.hasClass('ypod-hd'))
	{
	var dragItm = Ext.get(target.dom.parentNode.parentNode.parentNode.id);
	return {ddel:this.ddel, item:dragItm};
	}
	return false;
},

onInitDrag: function(e) {
	this.ddel.innerHTML = this.dragData.item.dom.innerHTML;
	this.ddel.className = this.dragData.item.dom.className;
	this.ddel.style.width = this.dragData.item.getWidth() + "px";
	this.proxy.update(this.ddel);
},

getRepairXY: function(e, data) {
	data.item.highlight('#e8edff');
	return data.item.getXY();
},
notifyDrop: function(dd, e, data) {
	this.el.removeClass(this.overClass);
	this.el.appendChild(data.item);
	return true;
}
});

MyTest.dd.MyDropTarget = function(el, config) {
MyTest.dd.MyDropTarget.superclass.constructor.call(this, el, config);
};
Ext.extend(MyTest.dd.MyDropTarget, Ext.dd.DropTarget, {
notifyDrop: function(dd, e, data) {
	this.el.removeClass(this.overClass);
	this.el.appendChild(data.item);
	return true;
}
});

// end of file
