You may want to read up on `localstorage'. A good page is at:
http://diveintohtml5.info/storage.html
So, you could create a key/pair, or update whenever there is a click:
So to read it you would do something like:
var mystore = localStorage.getItem("sidebar");
And to set it you can do:
localStorage.setItem("red", mystore);
So, on loading, look for the keys, and if they exist, set the elements, and whenever there is a click create/update the storage.
For some more info you can look at:
http://paperkilledrock.com/2010/05/html5-localstorage-part-one/