Elgg clone in Javascript