defaultStatus="Vítejte na stránkách oddílu sportovní gymnastiky Sokola Brno 1 ..."

var lock = false
var maxlen = 255

function zkontroluj_email(adresa)
{
  re = /^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
  return adresa.search(re) == 0;
}

function countit(form, param)
{
    if (!lock)
    {
  lock=true;

        str= form.TEXT.value;
        strlength= str.length;
        if (strlength > maxlen)
        {
                alert("Můžete vložit maximálně 255 znaků!");
                document.frm.TEXT.value=str.substring(0, maxlen);
        }
        document.frm.CHARCOUNT.value=strlength;
        lock=false;
    }
}

function OpenWindow(url, name, w, h)
{
  if (w > screen.width - 50)
  {
    w = screen.width - 50;
  }
  if (h > screen.height - 50)
  {
    w = screen.height - 50;
  }
  popupWin = window.open(url, name, 'resizable,scrollbars,menubar=0,width=' + w + ',height=' + h);
  zhora=(screen.height-h)/2;
  zleva=(screen.width-w)/2;
  popupWin.moveTo(zleva,zhora);
  popupWin.focus();
}

function OpenMyWindow(url, name, x)
{
  w=800;
  h=650;
  if (x==1) 
  {
    w=450;
    h=300;
  }
  if (x==2) 
  {
    w=650;
    h=500;
  }
  if (x==3) 
  {
    w=800;
    h=650;
  }


  if (w > screen.width - 20)
  {
    w = screen.width - 20;
  }
  if (h > screen.height - 20)
  {
    w = screen.height - 20;
  }
  popupWin = window.open(url, name, 'resizable,scrollbars,menubar=0,width=' + w + ',height=' + h);
  zhora=(screen.height-h)/2;
  zleva=(screen.width-w)/2;
  popupWin.moveTo(zleva,zhora);
  popupWin.focus();
}


function kontrola_formulare()
{

  if (self.document.forms.F.MAIL.value=='jmeno@adresa.cz')
  {
    alert("Nejprve prosím vyplňte mailovou adresu!");
    self.document.forms.F.MAIL.value="";
    setTimeout('self.document.forms.F.MAIL.style.background = "#E99"',500);
    setTimeout('self.document.forms.F.MAIL.style.background = "#FFF"',1000);
    setTimeout('self.document.forms.F.MAIL.style.background = "#E99"',1500);
    setTimeout('self.document.forms.F.MAIL.style.background = "#FFF"',2000);
    return false;
  }

if (self.document.forms.F.MAIL.value=='')
  {
    alert("Nejprve prosím vyplňte mailovou adresu!");
    self.document.forms.F.MAIL.value="";
    setTimeout('self.document.forms.F.MAIL.style.background = "#E99"',500);
    setTimeout('self.document.forms.F.MAIL.style.background = "#FFF"',1000);
    setTimeout('self.document.forms.F.MAIL.style.background = "#E99"',1500);
    setTimeout('self.document.forms.F.MAIL.style.background = "#FFF"',2000);
    return false;
  }

  if (!zkontroluj_email(self.document.forms.F.MAIL.value))
  {
    alert("Adresa Vašeho mailu není vyplněna správně!");
    setTimeout('self.document.forms.F.MAIL.style.background = "#E99"',500);
    setTimeout('self.document.forms.F.MAIL.style.background = "#FFF"',1000);
    setTimeout('self.document.forms.F.MAIL.style.background = "#E99"',1500);
    setTimeout('self.document.forms.F.MAIL.style.background = "#FFF"',2000);
    return false;
  }
  return true;
}
