
YAHOO.example.DDResize = function(panelElId, handleElId, sGroup, config) {
    if (panelElId) {
        this.init(panelElId);
        this.setHandleElId(handleElId);
		this.config=config;
    }
};

// YAHOO.example.DDResize.prototype = new YAHOO.util.DragDrop();
YAHOO.extend(YAHOO.example.DDResize, YAHOO.util.DragDrop);



YAHOO.example.DDResize.prototype.onMouseDown = function(e) {
    var panel = this.getEl();
	if(this.config==0 || this.config==1){
    this.startWidth = panel.offsetWidth;
	}
	if(this.config==0 || this.config==2){
    this.startHeight = panel.offsetHeight;
	}

    this.startPos = [YAHOO.util.Event.getPageX(e),
                     YAHOO.util.Event.getPageY(e)];

};

YAHOO.example.DDResize.prototype.onDrag = function(e) {
	var panel = this.getEl();
  
	var newPos = [YAHOO.util.Event.getPageX(e),
                  YAHOO.util.Event.getPageY(e)];
	 var offsetX = newPos[0] - this.startPos[0];
	 var offsetY = newPos[1] - this.startPos[1];
	
    
if(this.config==0 || this.config==1){
	 var newWidth = Math.max(this.startWidth + offsetX, 10);
   	panel.style.width = newWidth + "px";
   
}
if(this.config==0 || this.config==2){
	var newHeight = Math.max(this.startHeight + offsetY, 10);
	panel.style.height = newHeight + "px";

}
    

    
    
    
};


