function hlaskaConfirm(hlaska)
	{
	var hlaska = confirm(hlaska);
	return hlaska;
	}
	
function zmenPozadi(co,pozadi)
       {
       co.style.backgroundColor = pozadi;
       }
       
function generujRetezec(objekt,p_z)
       {
       var samohlasky = "aeiouy";
       var souhlasky = "bcdfghjklmnpqrstvwxz";
       ret = "";
       
       for (var i = 1; i <= p_z; i++)
              {
              if (Math.floor(i/2)*2 != i)
                     {
                     cislo = Math.floor(Math.random() * 20);
                     ret = ret + souhlasky.substring(cislo,cislo + 1);
                     }
              
              else
                     {
                     cislo = Math.floor(Math.random() * 6);
                     ret = ret + samohlasky.substring(cislo,cislo + 1);
                     }
              }
              
       document.getElementById(objekt).value = ret;
       }
       
function zobrazObjekt(objekt)
       {
       var objekt = document.getElementById(objekt);
       
       if (objekt.style.display == 'none')
              objekt.style.display = '';
              
       else
              objekt.style.display = 'none';
       }

function cislo()
	{
	if (event.keyCode < 48 || event.keyCode > 57)
	event.returnValue = false;
	}

function nastavObrazek(objekt,rozmer)
       {       
       if (objekt.height > objekt.width)
              {
              objekt.height = rozmer;
              }
       
       else if (objekt.height < objekt.width)
              {
              objekt.width = rozmer;
              }
       
       else if (objekt.height == objekt.width)
              {
              objekt.width = rozmer;
              objekt.height = rozmer;
              }
       }

function odkryj()
       {
       document.getElementById('skryj').style.display = "none";
       document.getElementById('odkryj').className = "odkryt";
       }

function odkryjGalerii()
       {
       document.getElementById('skryj').style.display = "none";
       document.getElementById('odkryj').className = "fotogalerie";
       }

function zobrazSub(ID_sub)
       {
       for (var i = 1; i <= pocet_sub; i++)
              {
              var sub = document.getElementById('menu2_sub_' + ID_sub);
              
              if (sub.className == "nezob" && ID_sub == i)
                     sub.className = "zob";
              
              else if (sub.className == "zob" && ID_sub == i)
                     sub.className = "nezob";
              
              else
                     document.getElementById('menu2_sub_' + i).className = "nezob";
              }
       }


function presmeruj2(url)
       {
       window.location.replace(url); 
       }

function startPresmeruj2(url)
       {
       setTimeout('presmeruj2("' + url + '")',1000 * 60 * 15);
       }

function HBHttpRequest(url,method,format,data,handle)
       {
       var url = url;
       var rq = new SZN.HTTPRequest();
       
       rq.setMethod(method);
       if (data.length > 0)
       rq.setPostData(data);
       rq.setFormat(format);
       rq.setMode("async");
       rq.send(url,window,handle);
       }


function nactiTerminy(datum,ID_ter)
       {
       var ID_zna = document.getElementById('IDD_zna').value;
       
       HBHttpRequest('http://www.autojarov.cz/system/obj_servis.php?datum=' + datum + '&ID_zna=' + ID_zna + '&ID_ter=' + ID_ter,'get','txt','','_zobrazTerminy');
       }


function _zobrazTerminy(txt,status)
       {
       var box = document.getElementById("seznam-terminu");
       
       if (status == 200) 
              box.innerHTML = txt;
       }

function nactiTerminyEmise(datum)
       {
       HBHttpRequest('http://www.autojarov.cz/system/terminy.php?datum=' + datum,'get','txt','','_zobrazTerminy');
       }

function otevriDoporuc(server,ID_webu)
       {
       window.open(server + "stranky/doporuc.php?ID_webu=" + ID_webu, "doporucit", "scrollbars=yes, width=500px, height=350px, z-lock=yes"); 
       }
