 // --Sekce Kontakt 
function notifikuj( url )
{					  
	var FormElement = document.getElementById('formu');

	var NahodneCislo = Math.round((Math.random() * 20000)) * 8513; 
	
	if (FormElement != undefined){
		FormElement.action = url + '?AuthKey=' + NahodneCislo; 	
		FormElement.submit();
	}
	
}

 //-----------------------------------------------------------------------------------
 
function initializeInputItem( defaultText, elementId ) {
	var value = document.getElementById(elementId).value;
	if (value == defaultText)
		document.getElementById(elementId).value = "";
	else if (value == "")
	    document.getElementById(elementId).value = defaultText;
	return false;    
}  

 //-----------------------------------------------------------------------------------
 
function otevriKomentare()
{
	document.getElementById('commentForm').style.display='block';
}

 //-----------------------------------------------------------------------------------

function checkSouhlas()
{
	check = document.getElementById('souhlas').checked;
	if (check == false){
		alert('Musíte souhlasit s pravidly.');
	}
	return check;
}

//-----------------------------------------------------------------------------------
 
function otevriPanel( divId )
{
	div = document.getElementById(divId);
	
	if (div.style.display=='block') {
		document.getElementById(divId).style.display='none';
	} else {
		document.getElementById(divId).style.display='block';
	}
}

//-----------------------------------------------------------------------------------

function clearSearch(clear) {
						
	var searchElem = document.getElementById('searchText');
	var searchVal = searchElem.value;						
						
	if (clear) {
		if (searchVal == 'Hledat...') {
			searchElem.value = '';
		}
	} else {
		if (searchVal == '') {
			searchElem.value = 'Hledat...';
		}
	}
}

//-----------------------------------------------------------------------------------

function beforeSubmit() {
	
	var searchForm = document.getElementById('searchForm');
	var searchElem = document.getElementById('searchText');
	var searchVal = searchElem.value;
	if (searchVal == '') {
		alert('Nic nezadáno.');
		return false;
	}
	_gaq.push(['_trackEvent', '?searchTBBTag='+searchVal]);
	return true;
}

//-----------------------------------------------------------------------------------

function redirectUrl(url) {
	
	window.location.href = url;
}
