added initial javascript files
updated javascript to cope with longer urls