object problems in javascript
<p>How can I create object and put in on array so I can use it multiple time I tried like this</p>

<pre><code>var createNew = new enemyMove(id);
</code></pre>

<p>So every Time I use it Iwill have a different values and fields</p>

<pre><code>function enemyMove() {


    var enemyimagew = document.getElementById("enemy");
    var leftenemy = parseInt(enemyimagew.style.left);
    var topenemy = parseInt(enemyimagew.style.top);


        if (leftenemy &lt; leftplayer) {
            leftenemy = leftenemy + 5;

        }
        if (leftenemy &gt; leftplayer) {
            leftenemy = leftenemy - 5;

        }

        if (topenemy &lt; topplayer) {
            topenemy = topenemy + 5;
        }
        if (topenemy &gt; topplayer) {
            topenemy = topenemy - 5;
        }

        enemyimagew.style.left = leftenemy + "px";
        enemyimagew.style.top = topenemy + "px";

        var hit_list = $("#x").collision(".lollol");
        hit_list.remove();   
}

function enemyMovetow() {


    var enemyimage = document.getElementById("enemy2");
    var leftenemy = parseInt(enemyimage.style.left);
    var topenemy = parseInt(enemyimage.style.top);


    if (leftenemy &lt; leftplayer) {
        leftenemy = leftenemy + 5;

    }
    if (leftenemy &gt; leftplayer) {
        leftenemy = leftenemy - 5;

    }

    if (topenemy &lt; topplayer) {
        topenemy = topenemy + 5;
    }
    if (topenemy &gt; topplayer) {
        topenemy = topenemy - 5;
    }

    enemyimage.style.left = leftenemy + "px";
    enemyimage.style.top = topenemy + "px";

    var hit_list = $("#x").collision(".lollol");
    hit_list.remove();
}
</code></pre>

<p>I want this 2 funtion on an array so I wont write another one</p>
