
function miniSlideF(miniSlide, maxi)
{
	this.counter = this.counter ? this.counter + 1 : 1;
	current = this.counter;
	imgslideid = 'slide' + current;
	new Effect.Shrink(document.getElementById(imgslideid), {
		duration: 2, 
		afterFinish: function() {
			$('slideshow').removeChild(document.getElementById(imgslideid))
			
			light = 'Lightview.show({href: "' + miniSlideBig[current] + '"}); pe.currentlyExecuting = "false";';
			img = Builder.node('img', {id: imgslideid, onClick: light, onmouseover: 'this.style. cursor="pointer";', src: miniSlide[current], height:'128'});
			$('slideshow').appendChild(img);
		}
	});
	
	if (current == maxi)
		this.counter = 0;
}

function manualSlideV (elem, direction) {
	var elems = [];
	elems = $$('#gal-list li');
	
	this.counter = this.counter ? this.counter : 0;
	if (direction == 'up')
	{
		if(this.counter > 0 )
		{
			new Effect.MoveBy(elem, elems[this.counter].getHeight(), 0, 
			                              {
			                                  duration: 0.4,  
			                                  transition: Effect.Transitions.sinoidal,
											  queue: {position: 'end', scope: 'gal-scroll'}
			                              });
			this.counter--;
		}
		if(this.counter <= 0)
		{
			//to remove the arrow;
		}
	}
	if (direction == 'down')
	{
		if(this.counter < elems.size()-1 )
		{
			new Effect.MoveBy(elem, '-'+elems[this.counter].getHeight(), 0, 
			                              {
			                                  duration: 0.4,  
			                                  transition: Effect.Transitions.sinoidal,
											  queue: {position: 'end', scope: 'gal-scroll'}
			                              });
			this.counter++;
		}
	}
	if (direction == 'right')
	{
		if(this.counter < elems.size()-1 )
		{
			new Effect.MoveBy(elem, 0, '-'+elems[this.counter].getWidth(), 
			                              {
			                                  duration: 0.4,  
			                                  transition: Effect.Transitions.sinoidal,
											  queue: {position: 'end', scope: 'gal-scroll'}
			                              });
			
			if(this.counter == 0)
			{
				new Effect.Appear($$('#gallery-category .scroll-left')[0]);
			}
			
			this.counter++;
			
			if(this.counter == elems.size()-1)
			{
				new Effect.Fade($$('#gallery-category .scroll-right')[0]);
			}
		}
	}
	if (direction == 'left')
	{
		if(this.counter > 0 )
		{
			new Effect.MoveBy(elem, 0, elems[this.counter].getWidth(), 
			                              {
			                                  duration: 0.4,  
			                                  transition: Effect.Transitions.sinoidal,
											  queue: {position: 'end', scope: 'gal-scroll'}
			                              });
			
			if(this.counter > 0)
			{
				new Effect.Appear($$('#gallery-category .scroll-right')[0]);
			}

			this.counter--;

			if(this.counter == 0)
			{
				new Effect.Fade($$('#gallery-category .scroll-left')[0]);
			}
		}
	}
}

function gotoCats(){
	$$('#gal-list li a').each(function(item) { $('gallery-'+item.readAttribute('id')).hide(); } );
	new Effect.SlideDown('gallery-category');
	new Effect.Appear('gallery-cat0');
	$('gallery-back').hide();
}

function catSelect (e, tt) {
	$$('#gal-list li a').each(function(item) {
												if ($(tt).readAttribute('id')==item.readAttribute('id'))
												{
													new Effect.SlideUp('gallery-category');
													new Effect.SlideUp('gallery-cat0');
													new Effect.Appear('gallery-back');
													
													// new Effect.Morph(Element.up(item), {style: 'background-color: #232323'});
													new Effect.SlideDown('gallery-'+item.readAttribute('id'));
												}
												else
												{
													// new Effect.Morph(Element.up(item), {style: 'background-color: #3B553B'});
													$('gallery-'+item.readAttribute('id')).hide();
												}
											});
}

function authorSelect(e, tt) {
	$$('#gal-list li a').each(function(item) {
												if ($(tt).readAttribute('id')==item.readAttribute('id'))
												{
													$('gallery-cat0').hide();
													
													// new Effect.Morph(Element.up(item), {style: 'background-color: #232323'});
													new Effect.Appear('gallery-'+item.readAttribute('id'));
												}
												else
												{
													// new Effect.Morph(Element.up(item), {style: 'background-color: #3B553B'});
													$('gallery-'+item.readAttribute('id')).hide();
												}
											});
}