function nivoInit(item,slideShow){
	var self = jQuery(item).find('div.nivoSlider');
	self.hide();
	var length = jQuery(self).find('img').length;
	jQuery(self).find('img').preload({
		threshold:length,
		onFinish:function(data){
			jQuery(self).fadeIn('slow');
			jQuery(item).find("span.overlay").remove();
		
			jQuery(self).nivoSlider({
				controlNav:slideShow['control'],
				directionNav:slideShow['control'],
				effect:slideShow['effect'],
				slices:slideShow['slices'],
				animSpeed:slideShow['animSpeed'],
				pauseTime:slideShow['pauseTime'],
				startSlide:0,
				boxCols: slideShow['boxCols'],
				boxRows: slideShow['boxRows'],
				pauseOnHover:slideShow['pauseOnHover'],
				manualAdvance:slideShow['manualAdvance'],
				captionOpacity:slideShow['captionOpacity'],
				randomStart:slideShow['randomStart'],
				slideshowEnd: function(){
					if(slideShow['stopAtEnd']){
						self.data('nivoslider').stop();
						if(jQuery(self).parent().attr('id') == 'slideshow'){
							jQuery('.slide-button-pause').fadeOut(300); 
							jQuery('.slide-button-play').fadeIn(200);
						}
					}
				},
				afterLoad:function(){
					if(slideShow['stop']){
						this.stop();
						if(jQuery(self).parent().attr('id') == 'slideshow'){
							jQuery('.slide-button-pause').fadeOut(300); 
							jQuery('.slide-button-play').fadeIn(200);  
						}
					}	
				},
				symplexnav:slideShow['symplexnav']
			});
		}
	});
	if(jQuery(self).parent().attr('id') == 'slideshow'){
		jQuery('.slide-button-play').click(function(){
			self.data('nivoslider').start();	
		});
		jQuery('.slide-button-pause').click(function(){
			self.data('nivoslider').stop();	
		});
	}
}
