I have a custom template with some dynmaic content. It appears what I have embedded in the template appears outside the #content div, making it display further down the page. There are some text details in the rhs widget itself.
You have placed your code in wrong place. Please place your code inside #content so that it will be displayed in main content area and will not jumps to the foot of the secondary widget.