// JavaScript Document


function clearText(field){
  if (field.defaultValue == field.value) field.value = '';
  else if (field.value == '') field.value = field.defaultValue;
}

navHover = function() {
	var lis = document.getElementById("topmenu").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() { 
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);

function calendar_go(m,y) {
	url='/calendar.php?month='+m+'&year='+y;
	$('#calendar').load(url);
}

function calendar_hover(d) {
	if (d && calendar_hovers[d]) {
		$('#calendar-text').html(calendar_hovers[d]);
	} else {
    $('#calendar-text').html('&nbsp;');
	}
}


function form_load(f) {
	
	$.getJSON('/ajax.php?check='+f.mail.value, 
		function(data) {
			if (data.name) {
				f.jmeno.value = data.name;
				f.funkce.value = data.funkce;
				f.spol.value = data.spolecnost;
				f.tel.value = data.telefon;
			} 
		}
	);
	
}

function collapse(f) {
	if (f.checked)
		$('#collapse-'+f.value).slideDown();
	else
		$('#collapse-'+f.value).slideUp(); 
}







