var myTWin = window.myTWin;
function OpenWinAuta(link) 
{ 
  link.target = '_WinAuta'; 
  if (myTWin != null && !myTWin.closed) 
  { 
    myTWin.focus(); 
    myTWin.location.href = link.href; 
  } 
  else 
  { 
    myTWin = window.open(link.href,'_WinAuta','dependent=yes,menubar=no,location=no,resizable=no,width=800,height=300,toolbar=no'); 
    if (myTWin != null) 
      myTWin.focus(); 
  } 
  return myTWin; 
} 

var vzdalenosti = new Array(3);
vzdalenosti [0] = new Array("","42","37","211","200","276","255","88","145","171","116","149","366","116","269","114","200","100","119","106","237","99","124","152","132","397","137","35","68","267","69","110","76","68","41","63","104","147","340","54","279","352","373","110","110","104","96","0","142","260","290","62","65","83","152","112","150","110","194","222","85","155","95","145","156","273","92","170","329","235","298","199","146");

var typ_auta = new Array(1);
typ_auta[0] = new Array("6","5.5","10","9","14","13");
//var tarif = new Array

function ZistitCenu() {
  if ((document.getElementById('cenautodopravy').typauta[0].checked))
	{document.getElementById('cenautodopravy').cena.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")*eval("typ_auta[0][0]");
	document.getElementById('cenautodopravy').vzdalenost.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")}

  if ((document.getElementById('cenautodopravy').typauta[1].checked))
	{document.getElementById('cenautodopravy').cena.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")*eval("typ_auta[0][1]");
	document.getElementById('cenautodopravy').vzdalenost.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")}

  if ((document.getElementById('cenautodopravy').typauta[2].checked))
	{document.getElementById('cenautodopravy').cena.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")*eval("typ_auta[0][2]");
	document.getElementById('cenautodopravy').vzdalenost.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")}
  
  if ((document.getElementById('cenautodopravy').typauta[3].checked))
	{document.getElementById('cenautodopravy').cena.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")*eval("typ_auta[0][3]");
	document.getElementById('cenautodopravy').vzdalenost.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")}

  if ((document.getElementById('cenautodopravy').typauta[4].checked))
	{document.getElementById('cenautodopravy').cena.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")*eval("typ_auta[0][4]");
	document.getElementById('cenautodopravy').vzdalenost.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")}

 if ((document.getElementById('cenautodopravy').typauta[5].checked))
	{document.getElementById('cenautodopravy').cena.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")*eval("typ_auta[0][5]");
	document.getElementById('cenautodopravy').vzdalenost.value = eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]")}

  
}

function ZistitCenu1() {
document.getElementById('cenautodopravy').typauta.value=1
document.getElementById('cenautodopravy').typauta[0].checked=true
ZistitCenu()
}
function ZistitCenu2() {
document.getElementById('cenautodopravy').typauta.value=2
document.getElementById('cenautodopravy').typauta[1].checked=true
ZistitCenu()
}
function ZistitCenu3() {
document.getElementById('cenautodopravy').typauta.value=3
document.getElementById('cenautodopravy').typauta[2].checked=true
ZistitCenu()
}
function ZistitCenu4() {
document.getElementById('cenautodopravy').typauta.value=4
document.getElementById('cenautodopravy').typauta[3].checked=true
ZistitCenu()
}
function ZistitCenu5() {
document.getElementById('cenautodopravy').typauta.value=5
document.getElementById('cenautodopravy').typauta[4].checked=true
ZistitCenu()
}
function ZistitCenu6() {
document.getElementById('cenautodopravy').typauta.value=6
document.getElementById('cenautodopravy').typauta[5].checked=true
ZistitCenu()
}




