portable: use underscore.js _.findwhere instead of $.each