// JavaScript Document
function search(){
  //vyhledávání
  Event.observe($('searchText'), 'focus', function(){
    if(this.value == "Hledat..."){
      this.value = '';
      this.style.color='#000000';
    }
  });
  Event.observe($('searchText'), 'blur', function(){
    if(this.value == ''){
      this.value = 'Hledat...';
      this.style.color='#787878';
    }
  });
  
  //jméno
  Event.observe($('loginName'), 'focus', function(){
    if(this.value == "Jméno"){
      this.value = '';
      this.style.color='#000000';
    }
  });
  Event.observe($('loginName'), 'blur', function(){
    if(this.value == ''){
      this.value = 'Jméno';
      this.style.color='#787878';
    }
  });
  
  //heslo
  Event.observe($('loginPass'), 'focus', function(){
    if(this.value == "Heslo"){
      this.type = 'password';
      this.style.color='#000000';
      this.value = '';
      $('loginPass').focus();
    }
  });
  Event.observe($('loginPass'), 'blur', function(){
    if(this.value == ''){
      this.value = 'Heslo';
      this.type = 'text';
      this.style.color='#787878';
    }
  });
  
}
Event.observe(window, 'load', function(){
  search();
  if($('searchText').value=='Hledat...')
    $('searchText').style.color='#787878';
  if($('loginName').value=='Jméno')
    $('loginName').style.color='#787878';
  if($('loginPass').value==''){
    $('loginPass').style.color='#787878';
    $('loginPass').value = 'Heslo';
    $('loginPass').type = 'text';
  }
    
  
});