what's wrong with this javascript object?
<p>I think it's fairly clear what I want to do here:</p>

<pre><code>var viewnames = {};
viewnames['region-a'] = "Region A";
viewnames['region-b'] = "Region B, partial";
viewnames['region-c'] = "Region C";

function loadView(view_name) {
    alert('view_name: ' + view_name);
    alert('viewname: ' + viewnames.view_name);
    document.getElementById("viewtitle").innerText = view_name;
}
</code></pre>

<p>But if I call this with <code>view_name</code> as <code>region-a</code> the alert says <code>viewnames.view_name</code> is undefined. What is the problem?</p>
