move conditional javascript

because our diazo rules will not copy conditional <script> tags in the
head