I have this code but something is wrong, I think that some divs are not properly closed, that why my template is wrong. Thanks
It would probably have helped to warn that you were attaching the php script and that it is mambo code. I'd just load your page up in Firefox (with firebug extension installed) and play around with the divs until you find the one that needs to move and then update the right script.