$j(document).ready(function($j){
    $j('div.imgReel').each(function(e){
        // e = number of current element of each, makes things unique
        // add jQuery functions to this
        $this = $j(this);
 
        // add unique id to div and next/prev buttons
        $this.attr('id', 'reel'+e);
        
        // add prev next buttons
        $this.append('<div class="controls"><a href="#" class="imgNext" id="reel'+e+'next" title="next image"></a><a href="#" class="imgPrev" id="reel'+e+'prev" title="previous image"></a><div>');
        $this.find('img').wrapAll('<div class="wrapreel" style="position: relative"></div>');
 
        // initiate reel # selector is needed to identify all objects
        $j('#reel'+e+' div.wrapreel').cycle({
		    timeout:	0,
		    speed:		200,
		    next:   	'#reel'+e+'next',
		    prev:   	'#reel'+e+'prev'
		});
    });
});
