function show(_container, _middleImgId)
{
	$$('#' + _container + ' a').setStyle('display', 'none');
	$(_middleImgId).style.display = 'block';
}

var holder_cache = 1;
var holder_cache2 = 1;

window.addEvent('domready', function()
{

$$('a.slim').slimbox({
	loop: true,
	initialWidth: 1024,
	initialHeight: 768,
	overlayOpacity: 0.6,
	overlayFadeDuration: 200,
	resizeDuration: 1000,
	resizeTransition: Fx.Transitions.Elastic.easeOut,
	previousKeys: [37, 80, 16],
	nextKeys: [39, 78, 17]
});


if( $('photos_holder') ) var scroll = new Fx.Scroll('photos_holder', { wait: false, duration: 750, transition: Fx.Transitions.Quad.easeInOut });
var pageLinks = 1;
$('p1').style.display = 'block';
if( $('arrRight') )
{
	$('arrRight').addEvent('click', function(event) {
		event = new Event(event).stop();
		if( holder_cache < 10 ) // max 10 potions
		{
			scroll.toElement('content_' + (parseInt(holder_cache) + 1));
			holder_cache = parseInt(holder_cache) + 1;
			if( holder_cache >= pageLinks )
			{
			  $('arrRight').className = 'no';
			  $('arrLeft').className = 'yes';
			}
			else
			{
			  $('arrRight').className = 'yes';
			}
		}
	});
}
if( $('arrLeft') )
{
	$('arrLeft').addEvent('click', function(event) {
		event = new Event(event).stop();
		if( holder_cache > 1 )
		{
			scroll.toElement('content_' + (parseInt(holder_cache) - 1));
			holder_cache = parseInt(holder_cache) - 1;
			if( holder_cache > 1 ) $('arrLeft').className = 'yes';
			else
			{
			  $('arrLeft').className = 'no';
			  $('arrRight').className = 'yes';
			}
		}
	});
}

/* if we have two galleries */
if ($('photos_holder2'))
{
  var scroll2 = new Fx.Scroll('photos_holder2', { wait: false, duration: 750, transition: Fx.Transitions.Quad.easeInOut });
  $('2p1').style.display = 'block';
  if( $('arrRight2') )
  {
  	$('arrRight2').addEvent('click', function(event) {
  		event = new Event(event).stop();
  		if( holder_cache2 < 10 ) // max 10 potions
  		{
  			scroll2.toElement('content2_' + (parseInt(holder_cache2) + 1));
  			holder_cache2 = parseInt(holder_cache2) + 1;
  			if( holder_cache2 >= pageLinks )
  			{
  			  $('arrRight2').className = 'no';
  			  $('arrLeft2').className = 'yes';
  			}
  			else
  			{
  			  $('arrRight2').className = 'yes';
  			}
  		}
  	});
  }
  if( $('arrLeft2') )
  {
  	$('arrLeft2').addEvent('click', function(event) {
  		event = new Event(event).stop();
  		if( holder_cache2 > 1 )
  		{
  			scroll2.toElement('content2_' + (parseInt(holder_cache2) - 1));
  			holder_cache2 = parseInt(holder_cache2) - 1;
  			if( holder_cache2 > 1 ) $('arrLeft2').className = 'yes';
  			else
  			{
  			  $('arrLeft2').className = 'no';
  			  $('arrRight2').className = 'yes';
  			}
  		}
  	});
  }
}

});