window[data]. Но удобнее запихать все в отдельный объект.
<style type="text/css">
#wood, #stone, #food {width:50px; height:22px; border:1px solid red; background: #999999; position:absolute; ; top: 21px; cursor:pointer; text-align:center}
#wood{left: 50px}
#stone{left: 120px;}
#food{left: 190px;}
</style>
<body>
<script>
var arrays = {
wood : ["raz","dva","tri"],
stone : ["kamen","brick","kirpich"],
food : ["eda","milk","voda"]
}
</script>
<script>
function getMassiv(elem){
var data = elem.id
alert(arrays[data])
}
</script>
<div id="wood" onclick="getMassiv(this)">wood</div>
<div id="stone" onclick="getMassiv(this)">stone</div>
<div id="food" onclick="getMassiv(this)">food</div>