and with every click on sub nav, I would like to change the background image of the Panel2 div. I tried different classes; changed colour, font size - virtually everything EXCEPT the background image; no matter what I do - the background of Panel2 stays always the same, which is the one defined for #panel2 in CSS.
Secondly, your css rules are in conflict. You cannot override an ID based rule with a class based rule by default. Since both rules are active, the ID takes precedence. You have 2 options to deal with this easily. The first is to remove the rules from the ID selector into a class, and make that class active by default. The second is to use the css keyword !important to force the classes to override the id rules.
Example: