moved page specific js to separate file
moved register validation to js function