javascript prev next fuction
<p>I have asp.net code as</p>

<pre><code>&lt;div class='OuterDiv'&gt;
    &lt;div class='InnerDiv' id='product_827'&gt;
        &lt;a onclick="javascript:ajaxLightboxPopup(827,'', this)" href="javascript:void(0);"
            style='text-decoration: none;'&gt;
            &lt;img width='85' height='85' src='pngs/100942644.jpg' /&gt;&lt;div class='product-code'
                style='text-decoration: none;' width='120px'&gt;
                KWD 1.75
            &lt;/div&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div class='InnerDiv' id='product_828'&gt;
        &lt;a onclick="javascript:ajaxLightboxPopup(828,'', this)" href="javascript:void(0);"
            style='text-decoration: none;'&gt;
            &lt;img width='85' height='85' src='pngs/101255432.jpg' /&gt;&lt;div class='product-code'
                style='text-decoration: none;' width='120px'&gt;
                KWD 2.25
            &lt;/div&gt;
        &lt;/a&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>and I have javascript function as </p>

<pre><code>function ajaxLightboxPopup(productId, page, cntrl) {
   var pref = 'product_';
    var prevElement = jQuery('#' + pref + productId).prev();
    var prevElemHTML = prevElement.html();

}
</code></pre>

<p>here the requirement,
My page containing 3 Outer Div
and each outer div containing 5 innerDiv.
The same inner div with same id will be repeated in more than outer div.
When I  var prevElement = jQuery('#' + pref + productId).prev(); statement to get previous element of innerdiv from 2 or 3 outer div its 
always points to Previous of inner div present in 1 outer div.
How to solve this..</p>
