moving javascript code out of html
initial work on toolbar, make toggle pattern working
removing not used scripts