Fixes #1155 Move print_selection_javascript() to functions.php

#1155