Passing argument to anonymous function
<p>want to pass a simple integer to function after finding it. Code is as below:</p>

<pre><code>$("#play").click(function() {
    var elementNumber;
    var properElement;
    for (var i = 0; i &lt; playlistLength; i++) {
        if (listOfElements[i].type == 'video' &amp;&amp; listOfElements[i].position == 0) {
            elementNumber = i;
        }
    };
    document.getElementById(listOfElements[elementNumber].name).play();
    properElement = listOfElements[elementNumber];
    console.log(properElement); // gives out proper element;
    setInterval("galleryElement.draw(properElement.name, properElement.type, properElement.position)", 33); // Cannot read property 'name' of undefined 
    return false;
})​
</code></pre>

<p>and I get an error <code>Cannot read property "name" of undefined</code>?  How can I pass arguments there?</p>

<p>Thanks in advance!</p>
