Hello. I am working on a site for t-shirt called www.liquidcotton.com. I need some help with some logic on this site.

Every t-shirt on this site has a little keyword rollover menu that display2 the keywords for that shirt.

However, the javascript menus I am using are placed on the page based on thier absolute values, in pixels, from the top left of the brower. These are passed into the header in javascript. So I need to write a php program to write this javascript. IT needs to query the database, and then based on where the image falls in the grid, assign a top and left value for it..does this makes sense.

There are 5 images in a column and an unlimited # of rows...

I know i will probably start with something like

$column =0: and
$row = 0; and then increment them for every item in the databse...but I can't seem to wrap my head around the logic for this...probably some while loops in the.

for example purposes we can say that the starting top and left values are 100 from the left and 100 from the top and that for every row we need increment the top value by another hundred and for every column we need to increment the left value by 50.

I hope this makes sense..