Help me condense a series of lengthy javascript conditional arrays
Assuming the variables you're using aren't needed later, you can condense it down to this:

var messages = [
    'Find a location…',
    'Try searching by zip code, like 90012…',
    'Know your location ID? Find it like so: #xxxx',
    'Search locations by type, like apartment, office, or retail...',
    'Search locations by area, like downtown, Pasadena, or Hollywood...',
    'Search locations by style, like art deco, tudor, or industrial...',
    'Search locations by feature, like fireplace, pond, or tiled floors...',
    'Modify your search…',
    'Modify your search by zip code, like 90012…'
], messageSets = [
    [3, 4, 5, 6, 7, 8],
    [0, 1, 2, 3, 4, 5, 6],
    [0]
];

var s = messageSets[$('.filters').length ? +/^\/locations\/?$/.test(location.pathname) : 3];
$('#s').val(messages[s[Math.random() * s.length | 0]]);
inputReplace();


Ideally the first var statement would be at a higher level, so it would only be run once, not every time the function is executed.

You could shorten it even further by using ranges instead of sets, but that could get complicated if you want to add more messages later. On the flip side, if you are planning to add a lot more messages, it would probably be clearer to make messages and messageSets objects (= dictionaries), so that you can name each message and set.

edit: here's how you would do the same thing using objects instead of arrays. The only difference is that each message, and set, has a name instead of a number, which makes references to it clearer to read.

var messages = {
    default: 'Find a location…',
    zip: 'Try searching by zip code, like 90012…',
    id: 'Know your location ID? Find it like so: #xxxx',
    type: 'Search locations by type, like apartment, office, or retail...',
    area: 'Search locations by area, like downtown, Pasadena, or Hollywood...',
    style: 'Search locations by style, like art deco, tudor, or industrial...',
    feature: 'Search locations by feature, like fireplace, pond, or tiled floors...',
    modify: 'Modify your search…',
    modify_zip: 'Modify your search by zip code, like 90012…'
}, messageSets = {
    locations: 'default zip id type area style feature'.split(' '),
    filters: 'type area style feature modify modify_zip'.split(' '),
    default: ['default']
};

var s = messageSets[$('.filters').length ?
    /^\/locations\/?$/.test(location.pathname) ? 'locations' : 'filters' :
    'default'
];
$('#s').val(messages[s[Math.random() * s.length | 0]]);
inputReplace();


Note that this has the additional advantage of making the order of the objects not matter: you could add alert: 'Enter something!', directly under the first line and it wouldn't break anything.