floating div along with scrollbars (horizontal and vertical)

I need a div(image in it) to float along with the scrollbars.
I implemented using position: fixed. but it is not working in IE 6.
so i used the script given in http://www.javascript-fx.com/submitscripts/float/float.html 
It is working fine for vertical scroll (height wise).
the link also has example 3 which scrolls width wise. but it will not scroll along with the horizontal scroll bar.

please give me the script/css which can work on IE6 that will float the div along with the scrollbars
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Please post your code snippet.
divyasindhuAuthor Commented:
// this div has a large image.
//the user can select a part of the image and save (crop image)
<div id="originalDiv" style="z-index:0;">
<img src="<html:rewrite page="<%=imageParam%>"/>" id="uploadedImage" />
//the preview wrap will contain the preview of the selected portion of the large image
<div id="floatingDiv" style="position: absolute;z-index:1;">
        <div id="previewWrap">
<html:submit value="Save" styleClass="cssButton"></html:submit>
// i am using the following script to float the preview image
// the horizontal float is working.
//but the div is not moving horizontally

<script type="text/javascript">
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy)
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
var px = document.layers ? "" : "px";
window[id + "_obj"] = el;
if(d.layers) {
el.cx = el.sx = sx;el.cy = el.sy = sy;
var pX, pY;
pX = (this.sx >= 0) ? 0 : ns ? innerWidth :
document.documentElement && document.documentElement.clientWidth ?
document.documentElement.clientWidth : document.body.clientWidth;
pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ?
document.documentElement.scrollTop : document.body.scrollTop;
if(this.sy<0) {
pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ?
document.documentElement.clientHeight : document.body.clientHeight;
this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
this.sP(this.cx, this.cy);
setTimeout(this.id + "_obj.floatIt()", 40);
return el;
JSFX_FloatDiv("floatingDiv", 10,30).floatIt();
divyasindhuAuthor Commented:
A correction in the submitted code comments
the vertical float is working. but the horizontal float is not working
divyasindhuAuthor Commented:
I got it working with the help of following links:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.