Changed Hide Sidebar functions

They are now simplified ( less if-then) but they use the viewportWidth
to recalculate the maincontainer size.

I hade to indtroduce a new  viewportWidth2 variable because a global
function was causing problems with main_container_width(); function