registration javascript and index.php modification

Since the use cases say that the first thing the user should see the
login page so i adjusted the index.php page to redirect the unlogged-in
user to login.php and homeage.php  if they are. also I added the
registration javascript to check for form correctness on signup