From http://stackoverflow.com/questions/1368264/get-host-name-in-javascript