Tidied up selectable title js a bit.