var article = document.getElementById("article");
var handleRight = document.getElementById("handleRight");
var handleCorner = document.getElementById("handleCorner");
var handleBottom = document.getElementById("handleBottom");
var textDiv = document.getElementById("textDiv");

new dragObject(handleRight, null, new Position(15, 0), new Position(1000, 0), null, RightMove, null, false);
new dragObject(handleBottom, null, new Position(0, 15), new Position(0, 1000), null, BottomMove, null, false);
new dragObject(handleCorner, null, new Position(15, 15), new Position(1000, 1000), null, CornerMove, null, false);

function BottomMove(newPos,element){DoHeight(newPos.Y,element);}

function RightMove(newPos,element){DoWidth(newPos.X,element);}

function CornerMove(newPos,element){DoHeight(newPos.Y,element);DoWidth(newPos.X,element);}

function DoHeight(y,element){textDiv.style.height=(y+5)+'px';if(element!=handleCorner){handleCorner.style.top=y+'px';}handleRight.style.height=y+'px';if(element!=handleBottom){handleBottom.style.top=y+'px';}article.style.height=(y-5)+'px';}

function DoWidth(x,element){textDiv.style.width=(x+5)+'px';if(element!=handleCorner){handleCorner.style.left=x+'px';}if(element!=handleRight){handleRight.style.left=x+'px';}handleBottom.style.width=x+'px';article.style.width=(x-5)+'px';}