function passBack(x,y)
{
 if (x == 'b1'){document.auto.elements["t_b1"].value = y;}
 if (x == 'b2'){document.auto.elements["t_b2"].value = y;}
 if (x == 'b3'){document.auto.elements["t_b3"].value = y;}
 if (x == 'b4'){document.auto.elements["t_b4"].value = y;}
 if (x == 'b5'){document.auto.elements["t_b5"].value = y;}
 if (x == 'b6'){document.auto.elements["t_b6"].value = y;}
 if (x == 'b7'){document.auto.elements["t_b7"].value = y;}
 if (x == 'b8'){document.auto.elements["t_b8"].value = y;}
 if (x == 'b9'){document.auto.elements["t_b9"].value = y;}
 if (x == 'b10'){document.auto.elements["t_b10"].value = y;}
 if (x == 'b11'){document.auto.elements["t_b11"].value = y;}
 if (x == 'b12'){document.auto.elements["t_b12"].value = y;}
 if (x == 'b13'){document.auto.elements["t_b13"].value = y;}
 if (x == 'b14'){document.auto.elements["t_b14"].value = y;}
 if (x == 'b15'){document.auto.elements["t_b15"].value = y;}
 if (x == 'b16'){document.auto.elements["t_b16"].value = y;}
 if (x == 'b17'){document.auto.elements["t_b17"].value = y;}
 if (x == 'b18'){document.auto.elements["t_b18"].value = y;}
 if (x == 'b19'){document.auto.elements["t_b19"].value = y;}
}

function hidediv() { 
 if (document.getElementById) { // DOM3 = IE5, NS6 
  document.getElementById('pf').style.visibility = 'hidden';
  document.getElementById('pfin').style.visibility = 'hidden'; 
 } 
 else { 
  if (document.layers) { // Netscape 4 
   document.pf.visibility = 'hidden';
   document.pfin.visibility = 'hidden'; 
  } 
  else { // IE 4 
   document.all.pf.style.visibility = 'hidden';
   document.all.pfin.style.visibility = 'hidden';
  } 
 } 
}


function ValidateForm()
{
  var errors='';
  
  if (validate_required(document.getElementById("t_jmeno").value)==false)
    {errors+='Vaše jméno.\n';}
  if (validate_required(document.getElementById("t_telefon").value)==false)
    {errors+='Telefonní číslo.\n';}
  if (checkemail(document.getElementById("t_email").value)==false)
    {errors+='Emailová adresa.\n';}
	
  if (errors){
    alert('Zadejte prosím následující údaje:\n'+errors);
    return false;
  }
}

function checkemail(value)
{
  var str=value;
  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
  if (filter.test(str))
    testresults=true;
  else{
    testresults=false;
  }
return (testresults);
}

function validate_required(value)
{
  if (value==null||value=="")
    {return false}
  else {return true}
} 