//    <script type="text/javascript">
    var rozbalene;
    function RozbalMenu(id)
    {
     var Rozbal = document.getElementById('main_menu_'+id);
      if (!Rozbal){ return;}

      if(!isNaN(rozbalene)){
        var Zbal = document.getElementById('main_menu_'+rozbalene);
        if (!Zbal){ return;}
        Zbal.style.display = "none";
      }
      if(rozbalene != id){
        rozbalene = id;
        Rozbal.style.display = "block";
      } else {
        rozbalene = NaN;
      }
    }
//    </script>

function showitinline(what) {
 var o = document.getElementById(what);
 o.style.display = 'inline';
}

function hideit(what) {
 var o = document.getElementById(what);
 o.style.display = 'none';
}

function formr_change() {
 var o = document.getElementById('chsuhlas');
  hideit('suhlasil');
 if (o.checked) {showitinline('suhlasil');  }
}

function upozorni(theMessage)
 {
      if(document.getElementById) {
        document.getElementById('required').style.visibility= "visible";
        document.getElementById('requiredtext').style.visibility= "visible";
        document.getElementById('requiredtext').innerHTML= theMessage;
        setTimeout( "HideIt()",2500);
      } else {
          alert(theMessage);}
 }


function echeck(str) {

  var at="@"
  var dot="."
  var lat=str.indexOf(at)
  var lstr=str.length
  var ldot=str.indexOf(dot)



  if (str.indexOf(at)==-1){
     upozorni("neexistujúca e-mailová adresa!")
     return false
  }

  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
     upozorni("neexistujúca e-mailová adresa!")
     return false
  }

  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
      upozorni("neexistujúca e-mailová adresa!")
      return false
  }

   if (str.indexOf(at,(lat+1))!=-1){
      upozorni("neexistujúca e-mailová adresa!")
      return false
   }

   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      upozorni("neexistujúca e-mailová adresa!")
      return false
   }

   if (str.indexOf(dot,(lat+2))==-1){
      upozorni("neexistujúca e-mailová adresa!")
      return false
   }

   if (str.indexOf(" ")!=-1){
      upozorni("neexistujúca e-mailová adresa!")
      return false
   }

    return true
 }




function HideIt() {
        document.getElementById('required').style.visibility= "hidden";
        document.getElementById('requiredtext').style.visibility= "hidden";
}

function CheckEmptyField( theField, theMessage ) {
 
   if(( theField.value=="" )||( theField.value=="@" )||( theField.value=="+421" )) {
      theField.focus();
      if(document.getElementById) {
        document.getElementById('required').style.visibility= "visible";
        document.getElementById('requiredtext').style.visibility= "visible";
        document.getElementById('requiredtext').innerHTML= theMessage;
        setTimeout( "HideIt()",2500);
      } else {
          alert(theMessage);
      }
      return false;
   } else {
      return true;
   }
 
}

function Validate(theForm) {
  if( !CheckEmptyField(theForm.nickname,"Vyplňte prosím pole Nickname/prezývka!") ) return false;
  if( !CheckEmptyField(theForm.email,"Vyplňte prosím pole E-mailová adresa!") ) return false;  
  if( !CheckEmptyField(theForm.email2,"Vyplňte prosím pole E-mailová adresa (znovu)!") ) return false;  
  if( !CheckEmptyField(theForm.pwd,"Vyplňte prosím pole Heslo!") ) return false;  
  if( !CheckEmptyField(theForm.pwd2,"Vyplňte prosím pole Heslo (znovu)!") ) return false;  
   if( echeck(theForm.email.value)==false) return false;
   if( echeck(theForm.email2.value)==false) return false;

  // uspech
  return true;
}

///////////////////////////


  
