fixed some javascript in places

need to fix javascript in pictures because the button's javascript
function is not defined.