function wallSlider()
{
	if(typeof JSONWall != "object")
	{
		return;
	}
	
	var base = this, autoRun,
	currentTopFirst = 0,
	currentTopSecond = 0,
	currentTopThird = 0,
	currentBottomFirst = 0,
	currentBottomSecond = 0,
	currentBottomThird = 0,
	firstTopOut, firstTopIn, secondTopOut, secondTopIn, thirdTopOut, thirdTopIn,
	firstBottomOut, firstBottomIn, secondBottomOut, secondBottomIn, thirdBottomOut, thirdBottomIn;
	
	//Properties
	base.wallImages = new Array();

	//Methods
	base.BuildWall = function()
	{
		var childsFirstTop = $('.wallImages .topImages .first').children();
		var childsSecondTop = $('.wallImages .topImages .second').children();
		var childsThirdTop = $('.wallImages .topImages .third').children();
		var childsFirstBottom = $('.wallImages .bottomImages .first').children();
		var childsSecondBottom = $('.wallImages .bottomImages .second').children();
		var childsThirdBottom = $('.wallImages .bottomImages .third').children();
		
		//Get link url
		$(childsFirstTop[0]).attr('href', JSONWall[0].link);
		$(childsFirstTop[1]).attr('href', JSONWall[1].link);
		$(childsFirstTop[2]).attr('href', JSONWall[2].link);
		
		$(childsSecondTop[0]).attr('href', JSONWall[3].link);
		$(childsSecondTop[1]).attr('href', JSONWall[4].link);
		$(childsSecondTop[2]).attr('href', JSONWall[5].link);
		
		$(childsThirdTop[0]).attr('href', JSONWall[6].link);
		$(childsThirdTop[1]).attr('href', JSONWall[7].link);
		$(childsThirdTop[2]).attr('href', JSONWall[8].link);
		
		$(childsFirstBottom[0]).attr('href', JSONWall[9].link);
		$(childsFirstBottom[1]).attr('href', JSONWall[10].link);
		$(childsFirstBottom[2]).attr('href', JSONWall[11].link);
		
		$(childsSecondBottom[0]).attr('href', JSONWall[12].link);
		$(childsSecondBottom[1]).attr('href', JSONWall[13].link);
		$(childsSecondBottom[2]).attr('href', JSONWall[14].link);
		
		$(childsThirdBottom[0]).attr('href', JSONWall[15].link);
		$(childsThirdBottom[1]).attr('href', JSONWall[16].link);
		$(childsThirdBottom[2]).attr('href', JSONWall[17].link);
		
		//Get images source
		$('img', childsFirstTop[0]).attr('src', JSONWall[0].imageSrc);
		$('img', childsFirstTop[1]).attr('src', JSONWall[1].imageSrc);
		$('img', childsFirstTop[2]).attr('src', JSONWall[2].imageSrc);
		
		$('img', childsSecondTop[0]).attr('src', JSONWall[3].imageSrc);
		$('img', childsSecondTop[1]).attr('src', JSONWall[4].imageSrc);
		$('img', childsSecondTop[2]).attr('src', JSONWall[5].imageSrc);
		
		$('img', childsThirdTop[0]).attr('src', JSONWall[6].imageSrc);
		$('img', childsThirdTop[1]).attr('src', JSONWall[7].imageSrc);
		$('img', childsThirdTop[2]).attr('src', JSONWall[8].imageSrc);
		
		$('img', childsFirstBottom[0]).attr('src', JSONWall[9].imageSrc);
		$('img', childsFirstBottom[1]).attr('src', JSONWall[10].imageSrc);
		$('img', childsFirstBottom[2]).attr('src', JSONWall[11].imageSrc);
		
		$('img', childsSecondBottom[0]).attr('src', JSONWall[12].imageSrc);
		$('img', childsSecondBottom[1]).attr('src', JSONWall[13].imageSrc);
		$('img', childsSecondBottom[2]).attr('src', JSONWall[14].imageSrc);
		
		$('img', childsThirdBottom[0]).attr('src', JSONWall[15].imageSrc);
		$('img', childsThirdBottom[1]).attr('src', JSONWall[16].imageSrc);
		$('img', childsThirdBottom[2]).attr('src', JSONWall[17].imageSrc);
	}
	
	base.GetImages = function()
	{
		//Top images
		base.wallImages[0] = new Array();
		$('.wallImages .topImages > div:not(.clear)').each(function(i){
			base.wallImages[0][i] = new Array();
			
			$('a', $(this)).each(function(j){
				base.wallImages[0][i].push($(this));
			});
		});
		
		//Bottom images
		base.wallImages[1] = new Array();
		$('.wallImages .bottomImages > div:not(.clear)').each(function(i){
			base.wallImages[1][i] = new Array();
			
			$('a', $(this)).each(function(j){
				base.wallImages[1][i].push($(this));
			});
		});
	}
	
	base.AutoSlide = function()
	{
		autoRun = setInterval(function (){ base.slideNext() }, 5000);
	}
	
	base.fadeImages = function()
	{
		//Top images
		$(base.wallImages[0][0][firstTopOut]).fadeOut('fast', 'swing');
		$(base.wallImages[0][0][firstTopIn]).fadeIn(800, 'swing');	
		
		$(base.wallImages[0][1][secondTopOut]).fadeOut('fast', 'swing');
		$(base.wallImages[0][1][secondTopIn]).fadeIn(800, 'swing');	
		
		$(base.wallImages[0][2][thirdTopOut]).fadeOut('fast', 'swing');
		$(base.wallImages[0][2][thirdTopIn]).fadeIn(800, 'swing');	
		
		//Bottom images
		$(base.wallImages[1][0][firstBottomOut]).fadeOut('fast', 'swing');
		$(base.wallImages[1][0][firstBottomIn]).fadeIn(800, 'swing');	
		
		$(base.wallImages[1][1][secondBottomOut]).fadeOut('fast', 'swing');
		$(base.wallImages[1][1][secondBottomIn]).fadeIn(800, 'swing');	
		
		$(base.wallImages[1][2][thirdBottomOut]).fadeOut('fast', 'swing');
		$(base.wallImages[1][2][thirdBottomIn]).fadeIn(800, 'swing');

		currentTopFirst = firstTopIn;
		currentTopSecond = secondTopIn;
		currentTopThird = thirdTopIn;
		currentBottomFirst = firstBottomIn;
		currentBottomSecond = secondBottomIn;
		currentBottomThird = thirdBottomIn;	

		base.AutoSlide();
	}
	
	base.slidePrevious = function()
	{
		clearInterval(autoRun);
		
		//Top images
		if(currentTopFirst == 0)
		{
			firstTopOut = 0;
			firstTopIn = base.wallImages[0][0].length - 1;
		}
		else
		{
			firstTopOut = currentTopFirst;
			firstTopIn = currentTopFirst - 1;
		}
		
		if(currentTopSecond == 0)
		{
			secondTopOut = 0;
			secondTopIn = base.wallImages[0][1].length - 1;
		}
		else
		{
			secondTopOut = currentTopSecond;
			secondTopIn = currentTopSecond - 1;
		}
		
		if(currentTopThird == 0)
		{
			thirdTopOut = 0;
			thirdTopIn = base.wallImages[0][2].length - 1;
		}
		else
		{
			thirdTopOut = currentTopThird;
			thirdTopIn = currentTopThird - 1;
		}
		
		//Bottom Images
		if(currentBottomFirst == 0)
		{
			firstBottomOut = 0;
			firstBottomIn = base.wallImages[1][0].length - 1;
		}
		else
		{
			firstBottomOut = currentBottomFirst;
			firstBottomIn = currentBottomFirst - 1;
		}
		
		if(currentBottomSecond == 0)
		{
			secondBottomOut = 0;
			secondBottomIn = base.wallImages[1][1].length - 1;
		}
		else
		{
			secondBottomOut = currentBottomSecond;
			secondBottomIn = currentBottomSecond - 1;
		}
		
		if(currentBottomThird == 0)
		{
			thirdBottomOut = 0;
			thirdBottomIn = base.wallImages[1][2].length - 1;
		}
		else
		{
			thirdBottomOut = currentBottomThird;
			thirdBottomIn = currentBottomThird - 1;
		}
		
		base.fadeImages();
	}
	
	base.slideNext = function()
	{
		clearInterval(autoRun);
		
		//Imagens fila topo
		if(currentTopFirst == 0)
		{
			firstTopOut = 0;
			firstTopIn = currentTopFirst + 1;
		}
		else
		{
			firstTopOut = currentTopFirst;
			((currentTopFirst + 1) <= base.wallImages[0][0].length - 1) ? firstTopIn = currentTopFirst + 1 : firstTopIn = 0;
		}
		
		if(currentTopSecond == 0)
		{
			secondTopOut = 0;
			secondTopIn = currentTopSecond + 1;
		}
		else
		{
			secondTopOut = currentTopSecond;
			((currentTopSecond + 1) <= base.wallImages[0][1].length - 1) ? secondTopIn = currentTopSecond + 1 : secondTopIn = 0;
		}
		
		if(currentTopThird == 0)
		{
			thirdTopOut = 0;
			thirdTopIn = currentTopThird + 1;
		}
		else
		{
			thirdTopOut = currentTopThird;
			((currentTopThird + 1) <= base.wallImages[0][2].length - 1) ? thirdTopIn = currentTopThird + 1 : thirdTopIn = 0;
		}
		
		//Imagens fila baixo
		if(currentBottomFirst == 0)
		{
			firstBottomOut = 0;
			firstBottomIn = currentBottomFirst + 1;
		}
		else
		{
			firstBottomOut = currentBottomFirst;
			((currentBottomFirst + 1) <= base.wallImages[1][0].length - 1) ? firstBottomIn = currentBottomFirst + 1 : firstBottomIn = 0;
		}
		
		if(currentBottomSecond == 0)
		{
			secondBottomOut = 0;
			secondBottomIn = currentBottomSecond + 1;
		}
		else
		{
			secondBottomOut = currentBottomSecond;
			((currentBottomSecond + 1) <= base.wallImages[1][1].length - 1) ? secondBottomIn = currentBottomSecond + 1 : secondBottomIn = 0;
		}
		
		if(currentBottomThird == 0)
		{
			thirdBottomOut = 0;
			thirdBottomIn = currentBottomThird + 1;
		}
		else
		{
			thirdBottomOut = currentBottomThird;
			((currentBottomThird + 1) <= base.wallImages[1][2].length - 1) ? thirdBottomIn = currentBottomThird + 1 : thirdBottomIn = 0;
		}
		
		base.fadeImages();
	}
	
	base.initialFade = function()
	{
		$(base.wallImages[0][0][0]).fadeIn(800, 'swing');
		$(base.wallImages[0][1][0]).fadeIn(800, 'swing');
		$(base.wallImages[0][2][0]).fadeIn(800, 'swing');
		
		$(base.wallImages[1][0][0]).fadeIn(800, 'swing');
		$(base.wallImages[1][1][0]).fadeIn(800, 'swing');
		$(base.wallImages[1][2][0]).fadeIn(800, 'swing');
	}
	
	base.init = function()
	{
		base.BuildWall();
		base.GetImages();
		base.AutoSlide();
		base.initialFade();
	}
	
	base.init();
}
