Update the javascript - this now turns things on and off based on the type. It still...