The theory you have there is sound but in practice its more complicated. You need more variables as you will need to grab both the browser windows size, the offset co-ordinates to the spot where you want to display the image and then manipulate those variables with the ever changing image size variables...
the JS code that appears to be doing all that is this section...
PHP Code:
function floatSS(iX,iY,id){
var L=dD.getElementById?dD.getElementById(id):dD.all?dD.all[id]:dD.layers[id];
this[id+'O']=L;if(dD.layers)L.style=L;L.nX=L.iX=iX;L.nY=L.iY=iY;
L.P=function(x,y){this.style.left=x+px;this.style.top=y+px;};L.Fss=function(){var pX, pY;
pX=(this.iX >=0)?0:nn?innerWidth:nn&&dH.clientWidth?dH.clientWidth:dB.clientWidth;
pY=nn?pageYOffset:nn&&dH.scrollTop?dH.scrollTop:dB.scrollTop;
if(this.iY<0)pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;
this.nX+=.1*(pX+this.iX-this.nX);this.nY+=.1*(pY+this.iY-this.nY);this.P(this.nX,this.nY);
As to how to alter it to recalculate a 'base' point so that portrait images extend upwards from the left bottom corner rather than from the center (needed to fix a starting point for both landscape and portrait orientation) I really don't know.
Sorry