Javascript problem

hey everyone,

for the past few weeks i've been redesigning my site. i found this really cool javascript i want to use, but the problem is that the script is meant for sites that are aligned to the left. i wan to make i website aligned to the center.

here is the script:

var flash = document.getElementById('flashGallery');

flash.onmousemove = function(f){

f = f || window.event;

var x_f = getMouseX(f);

var image_f = Math.floor(x_f / 35) % 6;

setImage_f(image_f);

}

flash.onmouseout = function(f){

setImage_f(0);

}

function setImage_f(i_f){

document.getElementById('flashGallery').style.backgroundPosition = "0pt " + (-160 * i_f) + "px";

}

function getMouseX(f){

var posx_over_flash = 0;

if (f.pageX != undefined) {

posx_over_flash = f.pageX;

}

else if (f.clientX != undefined) {

posx_over_flash = f.clientX + document.body.scrollLeft

+ document.documentElement.scrollLeft;

}

return posx_over_flash;

}

the problem is that different browser sizes create different results. any suggestions on how to fix this

#484144

For the setImage_f( ) function you'll need to get the browser's window width, divide it by 2, then substract the width of your page.

A quick (and very dirty, I admit) workaround would be to put the page as an iframe, inside another page, like this:

<html>

<body>

<table border="0" width="100%">

<tr>

<td align="center" valign="top">

<iframe src="../../unavailable.html" width="the_witdh_for_the_page" height="enough_height_to_fit_the_page"></iframe>

</td>

</tr>

</table>

</body>

</html>

#484145

Thank You So Much!!!!!!!!!!!!!!!!

#484202

by the way... what is that script all about? please share it for newbies....

#493304