

function addBookmark(title,url) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}

function okno(soubor,sirka,vyska)  {
	window.open(soubor,'','toolbar=no,scrollbars=yes,location=no,status=no,width='+sirka+',height='+vyska+',resizable=1')
}

// ------------------------------------------ zmena tridy
function Aktivni(id)  {
  document.getElementById(id).className = "aktivni";
}

function Deaktivni(id)  {
  document.getElementById(id).className = "";
}

// ------------------------------------------ funkce pro rozbalovaci menu

var PocetMenu = 3;

function show(menu_item)
{
  document.getElementById("podmenu" + menu_item).style.visibility = "visible";

}

function hide(menu_item)
{
  document.getElementById("podmenu" + menu_item).style.visibility = "hidden";

}

function ValidaceRestaurace(hlaska) {
	var nevyplneno = 0;
	if (!document.getElementById("r_pocetOsob").value) nevyplneno = 1;
	if (!document.getElementById("r_cas").value) nevyplneno = 1;
	if (!document.getElementById("r_jmeno").value) nevyplneno = 1;
	if (!document.getElementById("r_telefon").value) nevyplneno = 1;
	if (nevyplneno) {
		alert(hlaska);
		return false;
	}
	else return true;
}
function ValidaceUbytovani(hlaska) {
	var nevyplneno = 0;
	if (!document.getElementById("u_pocetOsob").value) nevyplneno = 1;
	if (!document.getElementById("u_poznamky").value) nevyplneno = 1;
	if (!document.getElementById("u_jmeno").value) nevyplneno = 1;
	if (!document.getElementById("u_telefon").value) nevyplneno = 1;
	if (nevyplneno) {
		alert(hlaska);
		return false;
	}
	else return true;
}

//vypnout/zapnout DIVy **************************************
function toggle(cilovyObjekt, vyvolavac) {
	Effect.toggle(cilovyObjekt, 'blind', { duration: 0.2 });
	if (document.getElementById(cilovyObjekt).style.display == "none")
		document.getElementById(vyvolavac).style.backgroundImage = "url(../img/yellow_down.jpg)";
	else 
		document.getElementById(vyvolavac).style.backgroundImage = "url(../img/yellow_up.jpg)";
}

function PrepniJazyk(what) {
try {
	   xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():
	  		new ActiveXObject("Microsoft.XMLHTTP");
	 }
	 catch (e) { /* do nothing */ }
	// document.getElementById(where).innerHTML ="<center><br /><img src='loading.gif'></center>";
	// we are defining the destination DIV id, must be stored in global variable (ajaxdestination)
	// ajaxdestination=where;
//	 xmlhttp.onreadystatechange = triggered; // when request finished, call the function to put result to destination DIV
	 xmlhttp.open("GET", what);
	 xmlhttp.send(null);
	 xmlhttp.onreadystatechange = prepnout;

	  return false;
}
function prepnout() { // put data returned by requested URL to selected DIV
  if (xmlhttp.readyState == 4) if (xmlhttp.status == 200) 
    location.reload(true);
}
