$(document).ready( function()
{
	$('.tutorial_box').mouseover(function()
	{
		$(this).addClass('active');
	}).mouseout(function()
	{
		$(this).removeClass('active');
	}).click(function()
	{
		var links = $(this).children("h4").children("a.link");
		if(links.length>0)
		{
			window.location = $(links[0]).attr("href");
			return false;
		}
	});
	
	$('#basics_course li.after').hover(function()
	{
		$('#basics_title').html('Przeczytaj poprzedni kurs <strong>'+$(this).attr('title')+'</strong>');
		$(this).addClass('hover');
	}).mouseout(function()
	{
		$(this).removeClass('hover');
	});
	$('#basics_course li.before').hover(function()
	{
		$('#basics_title').html('Skocz do przodu do kursu <strong>'+$(this).attr('title')+'</strong>');
		$(this).addClass('hover');
	}).mouseout(function()
	{
		$(this).removeClass('hover');
	});
	$('#basics_course li.current').hover(function()
	{
		$('#basics_title').html('Aktualnie przeglądasz <strong>'+$(this).attr('title')+'</strong>');
		$(this).addClass('hover');
	}).mouseout(function()
	{
		$(this).removeClass('hover');
	});
	$('#basics_course li').mouseout(function()
	{
		var t = $($('#basics_course li.current')[0]).attr('title');
		$('#basics_title').html('Aktualnie przeglądasz <strong>'+t+'</strong>');
	}).click(function()
	{
		window.location = $($(this).children('a')[0]).attr('href');
	});
});

function feedback_verify()
{
	if(document.getElementById('captcha').value.length!=4 && document.getElementById('captchaDiv').style.display=='none')
	{
		document.getElementById('captchaDiv').style.display='block'; 
		return false;
	}
	else if(document.getElementById('captcha').value.length!=4)
	{
		alert('Wpisz cztery znaki, widoczne na obrazku!'); 
		return false;
	}
	else
	{
		sendFeedback();
		return false;
	}
}
