Update scripts

Rewrite scripts using jQuery