Two major things wrong:
1. You have two doctype declarations and two doctype headers. Get rid of one or condense them into one if you need the code for both. THAT in itself can be giving you a good majority of your current troubles.
2. Your current sidebar coding won’t work for what you want it to for a few different reasons.
Your total width for your content is 608 pixels. Your narrowcolumn is 400 pixels. To make your sidebar fit next to your content, you need to make sure the total width of your sidebar is not bigger than the remainder amount of space which is, in this case, 208 pixels.
Your sidebar code currently looks like this:
#sidebar {
padding: 20px 0 10px 0;
margin-left: 500px;
width: 190px;
}
Try this instead:
#sidebar {
padding: 20px 0px 10px 0px;
float: right:
width: 185px;
}
And see where your sidebar ends up.
From THERE (and make sure you fix that doctype problem I mentioned earlier), you can troubleshoot the rest of your coding.