improve javascript code

now the button will display the option you chose
reduse the repeated part of javascript code
Merge branch 'temporary_work_around'

Conflicts:
	option.html
	option.js

Solved by Eddy, conflict due to page structure changes.