var http_request = false;
    var pozice = '0';
    function makeRequest(adresa) {

    http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari,...
      http_request = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE
      try {
        http_request = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
        try {
          http_request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
      }
    }
    
    if (!http_request) {
      alert('Lituji, ale váš prohlížeč nepodporuje objekt XmlHttpRequest :-(');
      return false;
    }

    http_request.onreadystatechange = alertContents;
    http_request.open('GET', adresa, true);
    http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 
    http_request.send(null);
    
  }

  function alertContents() {

    if (http_request.readyState == 4) {
      if (http_request.status == 200) {
      if (document.getElementById('search').value.length>0)    
        {  
          document.getElementById('suggest').innerHTML = http_request.responseText;
        }
      } else {
        alert('Požadavek se nepodařilo zpracovat.');
      }
    }
  }
  function zminzi()
  {
    document.getElementById('suggest').style.visibility='hidden';
    pozice='0';
  }
 
  function posun(klavesa) 
  {
  //up 38, down 40
   
    if(klavesa<'37') { pozice='0'; } 
    if(klavesa>'40') { pozice='0'; } 
    if (klavesa=='40') 
      { 
        if (pozice>='1') document.getElementById('a'+pozice).style.backgroundColor="#eeeeee"; 
        if (pozice<document.getElementById('count').value-1) pozice++;
        document.getElementById('a'+pozice).style.backgroundColor="#FF6600"; 
      }
    if (klavesa=='38') 
      {
        document.getElementById('a'+pozice).style.backgroundColor="#eeeeee";
        if (pozice>'1') pozice--;
        document.getElementById('a'+pozice).style.backgroundColor="#FF6600"; 
      }
    if (klavesa=='39') 
      { 
        document.getElementById('search').value=document.getElementById('i'+pozice).value;  
        document.getElementById('a'+pozice).style.backgroundColor="#eeeeee";
        pozice='0'; 
      }
  }

function prepis(klavesa)
{
/*
32 -
50 e
51 s
52 c
53 r
54 z
55 y
56 a
57 i
58 e
*/


document.getElementById('vypis').value=document.getElementById('nazev').value; 
}
function vyplneno(text) { 
return (text.length > 0); 
} 

function kontrola(){ 
x = document.users.login; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím přihlašovací jmeno!'); 
x.focus();
return false; 
} 
x = document.users.heslo; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím heslo'); 
x.focus();
return false; 
}
x = document.users.heslo2; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím heslo'); 
x.focus();
return false; 
}

x = document.users.heslo; 
y = document.users.heslo2; 
if (x.value!=y.value) { 
alert('zadaná hesla jsou rozdílná'); 
x.focus();  
return false; 
}

x = document.users.jmeno; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím jméno'); 
x.focus();
return false; 
}

x = document.users.prijmeni; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím přijmení'); 
x.focus();
return false; 
}


x = document.users.email; 
if (!vyplneno(x.value)) { 
alert('Vyplňte prosím e-mail.'); 
x.focus(); 
return false; }

 if (window.RegExp) { 
		re = new RegExp('^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}$'); 
		if (!re.test(document.getElementById('email').value)) { 
		x = document.users.email;
			window.alert('E-mailové adresa nemá správný formát'); 
			x.focus();
			return false; 
		} 
	}

x = document.users.telefon; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím telefoní číslo'); 
x.focus();
return false; 
}

x = document.users.ulice; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím ulici'); 
x.focus();
return false; 
}
x = document.users.cislo_popisne; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím číslo popisné'); 
x.focus();
return false; 
}
x = document.users.obec; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím obec'); 
x.focus();
return false; 
}
x = document.users.psc; 
if (!vyplneno(x.value)) { 
alert('vyplňte prosím poštovní směrovací číslo'); 
x.focus();
return false; }

}







































