move code out of loop
move plotrestaurant out of onload
namespace js