function NabewiseWidget(api_key, id, size, neighborhood, city, options) {
  options = (!options)? {} : options;
  sizes = {"tall": [302,600], "small": [302,340], "schools": [302,600]};
  document.getElementById(id).innerHTML = "<iframe src=\"http://nabewise.com/widgets/"+
    size+"/"+api_key+"?city="+escape(city)+
    "&neighborhood="+escape(nabewiseLookupNabe(city, neighborhood, options["nabe_lookup"]))+
    nabewiseFairHousingCompliant(options["fair_housing_compliant"]) + 
    "\"  scrolling=\"no\" style=\"border: none;\" frameborder=\"0\" width=\""+sizes[size][0]+"\" height=\""+sizes[size][1]+"\" onload=\"this.parentNode.style.display='block';\"></iframe>";
  return false;
}
function nabewiseLookupNabe(city, neighborhood, nabe_lookup) {
  if(nabe_lookup && nabe_lookup[city]) {
    return (nabe_lookup[city][neighborhood] || neighborhood);
  } else {
    return neighborhood;
  }
}
function nabewiseFairHousingCompliant(fair_housing_compliant) {
  if(fair_housing_compliant) {
    return "&fair_housing_compliant=true";
  } else {
    return "";
  }
}
