function setBg(xRow, xColor)
{
 if (xColor == '' || typeof(xRow.style) == 'undefined') 
    { return false; }
 if (typeof(document.getElementsByTagName) != 'undefined') 
    { var xTD = xRow.getElementsByTagName('td'); }
 else if (typeof(xRow.cells) != 'undefined') 
         { var xTD = xRow.cells; }
      else 
         { return false; }
 var cntTD  = xTD.length;
 for (var c = 0; c < cntTD; c++) 
     { xTD[c].style.backgroundColor = xColor; }
 return true;
}

// -------------- pocet znaku textarea -------------
function recount(x,y,maxlength)
{
  myval = 0+ x.value.length;
  y.value = myval;
  if (myval > maxlength )
  {
   x.value= x.value.substring(0,maxlength);
   y.value = maxlength;
  }
}

function popup(w,h)
{
 okno1=window.open("","Okno1",'toolbar=0, statusbar=1, location=0, scrollbars=0,width='+w+',height='+h+',resizable=0,top=0,left=0');
 okno1.resizeTo(w,h);
 okno1.focus();
}

function smazat1()
{
 document.forms[0].nick.value = "";
 document.forms[0].email.value = "";
 document.forms[0].zprava.value = "";
}

function validate1()
{
 if (document.forms[0].nick.value == "")
 {
 alert("Vyplňte prosím nickname!");
 document.forms[0].nick.focus();
 return false;
 }
 else if (document.forms[0].email.value == "")
 {
 alert("Vyplňte prosím e-mailovou adresu!");
 document.forms[0].email.focus();
 return false;
 }
 else if (document.forms[0].zprava.value == "")
 {
 alert("Vyplňte prosím text příspěvku!");
 document.forms[0].zprava.focus();
 return false;
 }
}

function validate_emaily()
{
 if (document.forms[0].zprava.value == "")
 {
 alert("Vyplňte prosím text emailu!");
 document.forms[0].zprava.focus();
 return false;
 }
}

function validate_reg()
{
 if (document.forms[0].nick.value == "")
 {
 alert("Vyplňte prosím nickname!");
 document.forms[0].nick.focus();
 return false;
 }
 else if (document.forms[0].pass.value == "")
 {
 alert("Vyplňte prosím heslo!");
 document.forms[0].pass.focus();
 return false;
 }
 else if (document.forms[0].email.value == "")
 {
 alert("Vyplňte prosím e-mailovou adresu!");
 document.forms[0].email.focus();
 return false;
 }
 else if (isNaN(document.forms[0].icq.value))
 {
 alert("ICQ number musí být číslo!");
 document.forms[0].icq.focus();
 return false;
 }
}

function validate_log()
{
 if (document.forms[0].nick.value == "")
 {
 alert("Vyplňte prosím username!");
 document.forms[0].nick.focus();
 return false;
 }
 else if (document.forms[0].pass.value == "")
 {
 alert("Vyplňte prosím password!");
 document.forms[0].pass.focus();
 return false;
 }
}

function validate2()
{
 if (document.forms[0].nick.value == "")
 {
 alert("Vyplňte prosím nickname!");
 document.forms[0].nick.focus();
 return false;
 }
 else if (document.forms[0].komentar.value == "")
 {
 alert("Vyplňte prosím komentář!");
 document.forms[0].komentar.focus();
 return false;
 }
}

