var myTWin = window.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("38","34","28","24");
//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[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+"]")}

}

function ZistitCenu1() {
document.getElementById('cenautodopravy').typauta.value=0
document.getElementById('cenautodopravy').typauta[0].checked=true
ZistitCenu()
}
function ZistitCenu2() {
document.getElementById('cenautodopravy').typauta.value=1
document.getElementById('cenautodopravy').typauta[1].checked=true
ZistitCenu()
}
function ZistitCenu3() {
document.getElementById('cenautodopravy').typauta.value=2
document.getElementById('cenautodopravy').typauta[2].checked=true
ZistitCenu()
}
function ZistitCenu4() {
document.getElementById('cenautodopravy').typauta.value=3
document.getElementById('cenautodopravy').typauta[3].checked=true
ZistitCenu()
}
//function ZistitCenu5() {
//document.getElementById('cenautodopravy').typauta.value=1
//document.getElementById('cenautodopravy').typauta[4].checked=true
//ZistitCenu()
//}





///////////////////////////////////////////////////////////////////////////////////////////////<!-- 

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=yes,width=940,height=700,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("38","34","28","26","24");

function ZistitCenuMimo() {
//  if ((document.cenautodopravy.okres.value="") && (document.cenautodopravy.vzdalenost1="")) {
//     document.cenautodopravy.okres.value=1};
  if (document.getElementById('cenautodopravy').pracovnik[0].checked) {
     pracovnikX = 0;
     document.getElementById('cenautodopravy').cenahod.value=600};
  if (document.getElementById('cenautodopravy').pracovnik[1].checked) {
     pracovnikX = 2;
     document.getElementById('cenautodopravy').cenahod.value=700};
  if (document.getElementById('cenautodopravy').pracovnik[2].checked) {
     pracovnikX = 4;
     document.getElementById('cenautodopravy').cenahod.value=900};
  if (document.getElementById('cenautodopravy').pracovnik[3].checked) {
     pracovnikX = 6;
     document.getElementById('cenautodopravy').cenahod.value=1100};   

  if ((document.getElementById('cenautodopravy').typauta[0].checked) || (document.getElementById('cenautodopravy').typauta[1].checked)){
     document.getElementById('cenautodopravy').cenahod.value=eval(document.getElementById('cenautodopravy').cenahod.value)+eval(200)};

  if ((document.getElementById('cenautodopravy').typauta[2].checked)){
     document.getElementById('cenautodopravy').cenahod.value=eval(document.getElementById('cenautodopravy').cenahod.value)+eval(100)};

if  (document.getElementById('cenautodopravy').vzdalenost1.value != 0)  {
    vzdalenost=document.getElementById('cenautodopravy').vzdalenost1.value} 
else {vzdalenost=eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]");     }


  if ((document.getElementById('cenautodopravy').typauta[0].checked))
	{document.getElementById('cenautodopravy').cena.value = vzdalenost * (eval(typ_auta[0][0])+2*eval("pracovnikX"));
	document.getElementById('cenautodopravy').vzdalenost.value = vzdalenost}

  if ((document.getElementById('cenautodopravy').typauta[1].checked))
	{document.getElementById('cenautodopravy').cena.value = vzdalenost * (eval(typ_auta[0][1])+2*eval("pracovnikX"));
	document.getElementById('cenautodopravy').vzdalenost.value = vzdalenost}
  
  if ((document.getElementById('cenautodopravy').typauta[2].checked))
	{document.getElementById('cenautodopravy').cena.value = vzdalenost * (eval(typ_auta[0][2])+2*eval("pracovnikX"));
	document.getElementById('cenautodopravy').vzdalenost.value = vzdalenost}

  if ((document.getElementById('cenautodopravy').typauta[3].checked))
	{document.getElementById('cenautodopravy').cena.value = vzdalenost * (eval(typ_auta[0][3])+2*eval("pracovnikX"));
	document.getElementById('cenautodopravy').vzdalenost.value = vzdalenost}
	
  if ((document.getElementById('cenautodopravy').typauta[4].checked))
	{document.getElementById('cenautodopravy').cena.value = vzdalenost * (eval(typ_auta[0][4])+2*eval("pracovnikX"));
	document.getElementById('cenautodopravy').vzdalenost.value = vzdalenost}

}
function VratitVzdalenost() {
document.getElementById('cenautodopravy').vzdalenost1.value=''
document.getElementById('cenautodopravy').vzdalenost.value=eval("vzdalenosti [0]["+document.getElementById('cenautodopravy').okres.value+"]");
}
// --> 
