jQuery(document).ready(function() 
{
	/*
	if (jQuery("#newsList").length > 0) {
		var news = jQuery("#newsList li").get();
		jQuery.each(news, function() {
			var articleId = jQuery(this).attr('id').split('_').slice(-1) + "";
			jQuery('#right_' + articleId).before('<div id="nav_' + articleId + '" class="nav">').cycle( {
				fx :'scrollRight',
				click :'#nav_' + articleId + 'a',
				timeout :0,
				easing :'backinout',
				pager :'#nav_' + articleId
			});
			var images = jQuery('#right_' + articleId + ' img').get();
			jQuery.each(images, function() {
				jQuery(this).css('display', 'inline');
			})		
		});
	} 
	else
	*/
	if (jQuery(".standaloneArticle").length > 0) {
	{
		
			var articleId = jQuery(".standaloneArticle:first").attr('id').split('_').slice(-1) + "";
			var controls = jQuery('#slideshow_' + articleId + ' .prevNextControls');
			var currentPic = jQuery('#slideshow_' + articleId + ' .currentPic');
			
			if (controls.length != 0)
			{
				jQuery('#right_' + articleId).cycle({ 
				    fx:     'fade', 
				    speed:  'fast', 
				    timeout: 0, 
				    next:   '#next_' + articleId + ', #right_' + articleId, 
				    prev:   '#prev_' + articleId,
				    onPrevNextEvent : function (isNext, zeroBasedSlideIndex, slideElement) {
						currentPic.text(zeroBasedSlideIndex+1);
				    }
				});
			}
			else
			{
				jQuery('#right_' + articleId).before('<div id="nav_' + articleId + '" class="nav">').cycle( {
					fx :'scrollRight',
					click :'#nav_' + articleId + 'a',
					timeout :0,
					easing :'backinout',
					pager :'#nav_' + articleId
				});
			}
			
			
			jQuery.each(jQuery('#right_' + articleId + ' img').get(), function() {
				jQuery(this).css('display', 'inline');
			});
		}
	}
});

