function InzeratValidator (){
  var Veta = document.frmMain.taText.value;
  var Slova = Veta.split(' ');
  var Slova1 = Veta.split('Ű');  
  var Pocet_slov = Slova.length;
  var Pocet_slov1 = Slova1.length;
  var Cena = 0.2;
  var Spolu = 0;
  if (Veta != '')
  {
    if (Veta.charAt(Veta.length-1) == ' ') Pocet_slov -= 1;
    document.frmMain.edTotal.value = Pocet_slov;
    if (document.frmMain.edDruh[0].checked == true) Cena = 0.2; else Cena = 0.4;
    Spolu = Pocet_slov * Cena;
    Spolu = Math.round(Spolu*100)/100;
    document.frmMain.edPrice.value = Spolu + ' €';
  }
  else
  {
    document.frmMain.edTotal.value = '0';
    document.frmMain.edPrice.value = '0 €';
  }
}

function AddFavorite(linkObj,addUrl,addTitle)
{
  if (document.all && !window.opera)
  {
    window.external.AddFavorite(addUrl,addTitle);
    return false;
  }
  else if (window.opera && window.print)
  {
    linkObj.title = addTitle;
    return true;
  }
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
  {
    if (window.confirm('Pridať obľúbenú stránku ako nový panel?'))
    {
      window.sidebar.addPanel(addTitle,addUrl,'');
      return false;
    }
  }
  window.alert('Po potvrdení stlačte CTRL-D,\nstránka bude pridána k vašim obľúbeným odkazom.');
  return false;
}

function checkForm() {
  var text = "";
  
  if(document.frmMain.taText.value == "") text = text+"- Text inzerátu\n";
  if(document.frmMain.meno.value == "") text = text+"- Meno a priezvisko\n";
  if(document.frmMain.adresa.value == "") text = text+"- Adresa\n";
  if(document.frmMain.email.value == "") text = text+"- E-mail\n";
  if(document.frmMain.telefon.value == "") text = text+"- Telefón\n";
  
  if(text != "") {
    text = "Tieto údaje sú povinné:\n=======================\n"+text+"=======================\nProsím vyplňte všetky povinné údaje.";
    alert(text);
    return false;
  } else return true;
}

//Tmp=Math.floor(1000000 * Math.random());
//document.write("<scr" + "ipt src=\"http://cnt1.pocitadlo.cz/counter.php?poc=41996&ref="+escape(top.document.referrer)+"&depth="+screen.colorDepth+"&width="+screen.width+"&height="+screen.height+"&tmp="+Tmp+"\" language=\"JavaScript\" type=\"text/javascript\"></scr" + "ipt>");
