$(document).ready(function ()
{
	bind_panel ();
	bind_popup ();
	bind_cycle();
	bind_bkg();
	bind_content();
	bind_last_article();
});

function bind_content ()
{
	$('.footer td p:last-child').addClass('last');
}

function bind_panel ()
{
	// cislovani polozek leveho menu
	i = 1;
	$(".article .ac").each(function() {
			$(this).before('<div class="ai fl">'+i+'</div>');
			i++;
	});	
}

function bind_popup ()
{
	$('a.popup').attr('rel','facebox');
	$('a[rel*=facebox]').each(function(){
		$(this).attr('href', $(this).attr('href') );
		//+ '?layout=empty' - layout empty uz se tam doplnuje sam tzn. toto nebylo na predchozim radku na konci potreba
		$(this).facebox();
	});
}

function bind_cycle() 
{
	$('.panel2 dd p.rotate').cycle({
		fx: 'fade',
		timeout: 5000
	});
}

function bind_bkg() {
	
	$('.articles .inner h1').text("").css("background", "transparent url('../img/bkg-pripadove-studie.jpg') no-repeat top left").css("height", "53px").css("padding-bottom", "0");
	$('.panel1 dt').text("").css("background", "transparent url('../img/bkg-sluzby.jpg') no-repeat top left").css("height", "35px").css("margin-bottom", "5px");
	$('.partneri h1').text("").css("background", "transparent url('../img/bkg-proc-partner.jpg') no-repeat top left").css("height", "35px").css("margin-bottom", "5px");
	$('.motto').text("").css("background", "transparent url('../img/slogan.gif') no-repeat top left").text("").css("height", "26px").css("width", "409px");
}

function bind_last_article() {
	$('.inner .article:last').css("background-image", "none");
}
