Fixed the old-school java-script stuff to new school.