/*
 * script.js - scripty
 * Autor: Radek Liska, radarfox at seznam.cz 
 */

// Vyhledavani v hlavicce
function initSearch() {
	$('#head .box.search input')
		.val('')
		.focus(function() {
			$('#head .box.search label')
				.hide();
		})
}

// Skryvatelne boxy ve sloupci
function initMinimizeBox() {
	$('#lcolumn .box.minimize .container, #rcolumn .box.minimize .container')
		.hide();
	$('#lcolumn .box.minimize .header, #rcolumn .box.minimize .header')
		.click(function() {
			$(this)
				.siblings('.container')
				.toggle();
		});
}

// Detail kategorie
function initAbout() {
        document.getElementById("more").style.display = "block";
        document.getElementById("less").style.display = "none";
        document.getElementById("text").style.display = "none";
}

function zobraz(){
        document.getElementById("more").style.display = "none";
        document.getElementById("less").style.display = "block";
        document.getElementById("text").style.display = "block";
}

function schovat(){
        document.getElementById("more").style.display = "block";
        document.getElementById("less").style.display = "none";
        document.getElementById("text").style.display = "none";
}

// Prepinaci box s novinkami
function initNews() {
	$('#main .box.news .item .header')
		.click(function() {
			$('#main .box.news .item .header.active')
				.removeClass('active');
			$('#main .box.news .item .container')
				.hide();
			$(this)
				.siblings('.container')
				.show();
			$(this)
				.addClass('active');
		})
	$('#main .box.news .item.n01 .header')
		.click();
}

$(document).ready(function(){
	// LIGHTBOX
	initAbout();
	initSearch();
	$('a.lightbox').lightBox();

	initMinimizeBox();
	initNews();

});
