var videos = new Array();
var currentSet = 1;
var totalSets = 1;

function Video(set, link, image)
{
	this.link = link;
	this.image = image;
	this.set = set;
}

function initVideoBlock()
{

	$('#next_video').click(function()
	{
		nextVideos();
	});
	
	$('#last_video').click(function()
	{
		lastVideos();
	});
	
}
function setVideos()
{
	var count = 0;
	
	$.each(videos, function(key, video) 
	{ 
		if (video.set == currentSet)
		{ 
	
			count++;
			
			$('#video_block_image_' + count).attr('src', video.image);
			$('#video_block_link_' + count).attr('href', video.link);
			
		}
	});
	
}


function nextVideos()
{
	
	if (currentSet == totalSets)
	{
		
		currentSet = 1;
		
	}
	else
	{ 
	
		currentSet++;
	
	}
	
	setVideos();
	
}

function lastVideos()
{
	
	if (currentSet == 1)
	{
	
		currentSet = totalSets;
		
	}
	else
	{
		
		currentSet--;
		
	}
	
	setVideos();
	
}

