fancy javascript for household type