function check(id){
	if(document.getElementById(id).value.length < 3){
		alert('Hledaný text musí mít minimálně 3 znaky');
		return false;
	}
	return true;
}

function sema(mail1, mail2){
	if(window.confirm('Chcete napsat mail na adresu '+mail1+'@'+mail2+'?'))location.href="mailto:"+mail1+'@'+mail2;
}

function rea(nadpis, idp){
	document.getElementById('nazev').value='Re: '+nadpis;
	document.getElementById('reakce').value=idp;
	document.getElementById('textp').focus();
}

function chForm(param) {
	fields=param.split(",");
	for(var i=0;i<fields.length;i+=2){
		if(document.getElementById(fields[i+1]).value==""){
			alert(fields[i]+" je povinná položka!");
			document.getElementById(fields[i+1]).focus();
			return false;
			}
		}
	return true;
}

function dihi(co){
	if(document.getElementById(co).style.display=="block")
		document.getElementById(co).style.display="none";
	else
		document.getElementById(co).style.display="block";
}

function objpoc(id){ // input
	if((document.getElementById('poc'+id).value=="")||(Math.round(document.getElementById('poc'+id).value)==0)){
		document.getElementById('obj'+id).checked="";
		document.getElementById('poc'+id).value="";
	} else
		document.getElementById('obj'+id).checked="checked";
}

function objit(id,chb){ // checkbox
	if(chb.checked){
		if(document.getElementById('poc'+id).value=="")document.getElementById('poc'+id).value="1";
	}else{
		document.getElementById('poc'+id).value="";
	}
}

function selinp(id){
	document.getElementById(id).focus();
}

function zind(id,val){
	document.getElementById(id).style.zindex=val;
}

function swPanel(param){
	if(param==0){
		hide('fLgn');
		showb('fHld');
		document.getElementById('dHldBut').style.textDecoration='none';
		document.getElementById('dLgnBut').style.textDecoration='underline';
	} else {
		hide('fHld');
		showb('fLgn');
		document.getElementById('dLgnBut').style.textDecoration='none';
		document.getElementById('dHldBut').style.textDecoration='underline';
	}
	return false;
}

function nw(obj){
	return !window.open(obj.href);
}

function addHTML(id, html){
	if(document.getElementById(id).innerHTML=="")
		document.getElementById(id).innerHTML=html;
	else
		document.getElementById(id).innerHTML="";
}

function showDiscussForm(text){
	document.getElementById('discussForm').style.display="block";
	document.getElementById('discussTitle').innerHTML=text;
	return true;
}

