Without really playing around with this, it looks like this is where the width is being set:this.divObj.style.width=distancepercent * this.contentwidth +"px"And, because of the name of the variable, and the fact that is it multiplied by the width rather than added, tells me that this script is shrinking/expanding the width by a percentage rather than in absolute pixel increments. This might make my first suggestion a bit difficult. Maybe you could set the div's position to absolute and have the right site anchored rather than the left. Check out this example:
<html><body><style>#test { background-color: red; width: 400px; height: 400px; position: absolute; right: 0px; }</style><script type="text/javascript">function shrink(){ var div = document.getElementById("test"); div.style.width = (div.offsetWidth * .5) + "px";}</script><button onclick="shrink()">Shrink</button><div id="test">Hello</div></body></html>