menuRun = function() {
	//code only for IE
	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('m');
	for(var i=0; i<subs.length; i++) {
		var li = subs[i].parentNode;
		if(li && li.lastChild.style) {
			li.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			li.onmouseout = function() {
				this.lastChild.style.visibility = 'hidden';
			}
		}
	}
}
window.onload=menuRun;


function mm(jmeno, dom){
	location.href = '\x6D\x61\x69\x6c\x74\x6f\x3a' + jmeno + '@'+ dom;
}

function hand(obj) {
	var dec= obj.style.textDecoration;
	obj.style.cursor="pointer";
}

function trim(arg)
{
	arg=arg.replace(/^[\s]+/g,"");
	arg=arg.replace(/[\s]+$/g,"");
	return arg;
}


//nastavení cest pro lightbox
//var fileLoadingImage = "./cizi_kody/lightbox/images/loading.gif";
//var fileBottomNavCloseImage = "./cizi_kody/lightbox/images/closelabel.gif";

function add(dok,data)
{
	dok.form.odp.value += " "+data;
}


function okno(id,typ,path)
{
	settings = "menubar=no,directories=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,width=780,height=620";
	noveokno=window.open(path+'include/okno.php?id='+id+'&typ='+typ,'',settings);
	return false;
}


function validateCZ(f)
{
	var key = new Array("name","email","passengers_no");
	var val = new Array("Jméno musí být vyplněno","E-mail je povinná položka, pokud jej nemáte, uveďte telefon.","Počet pasažérů je nutné vyplnit");

	for (i = 0; i < key.length; i++){
		if (trim(document.getElementById(key[i]).value) == "" || document.getElementById(key[i]).value == "0"){
			alert(val[i]);
			document.getElementById(key[i]).focus();
			return false;
		}
	}
	if (document.orderform.ctvrti.options[document.orderform.ctvrti.selectedIndex].value==0)
	{
		alert("Zvolte, prosím, čtvrť Prahy");
		document.orderform.ctvrti.focus();
		return false;
	}

}



function calculCZ(carpricecze,carpriceeur)
{
	var carprice = "";
	var howmuch = document.orderform.passengers_no.value;



	if (howmuch > 0)
	if (carpricecze > 0)
	{
		if ((howmuch > 8) && (howmuch < 17)) {carpricecze *= 2; carpriceeur *= 2;}
		else if ((howmuch > 16) && (howmuch < 25)) {carpricecze *= 3; carpriceeur *= 3;}
		else if ((howmuch > 24) && (howmuch < 33)) {carpricecze *= 4; carpriceeur *= 4;}
		else if ((howmuch > 32) && (howmuch < 41)) {carpricecze *= 5; carpriceeur *= 5;}

		if (document.getElementById("two").checked == true)
		{
			carpricecze *= 2;
			carpriceeur *= 2;
		}
		document.orderform.total_price.value = carpricecze + ",-Kč";
		document.orderform.cenaBezPriplatku.value = carpricecze +",-Kč";
	}
	else
	{
		var ctvrti = document.orderform.ctvrti.value;

		carpricegbp = 0;
		if (document.getElementById("one").checked == true)
		{
			if (howmuch > 0 && howmuch < 5) {carpricecze = ctvrti; }
			else if ((howmuch > 4) && (howmuch < 9)) {
        if(ctvrti==950) carpricecze = 1200;
        else carpricecze = 1000; 
      }
			else if ((howmuch > 8) && (howmuch < 13)) {carpricecze = 1450;}
			else if ((howmuch > 12) && (howmuch < 17)) {carpricecze = 1750;}
			else if ((howmuch > 16) && (howmuch < 21)) {carpricecze = 2000;}
		}

		else if (document.getElementById("two").checked == true)
		{
			if (howmuch > 0 && howmuch < 5) {
			
				if(ctvrti==490) carpricecze = 950;
				else if(ctvrti==590) carpricecze = 1150;
				else if(ctvrti==690) carpricecze = 1350;
				else if(ctvrti==790) carpricecze = 1550;
				else carpricecze = 2*ctvrti;
			}
			else if ((howmuch > 4) && (howmuch < 9)) {carpricecze = 1600;}
			else if ((howmuch > 8) && (howmuch < 13)) {carpricecze = 2800;}
			else if ((howmuch > 12) && (howmuch < 17)) {carpricecze = 3400;}
			else if ((howmuch > 16) && (howmuch < 21)) {carpricecze = 3900;}
		}
		document.orderform.total_price.value = " "+ carpricecze +",-Kč";
          document.orderform.cenaBezPriplatku.value = carpricecze +",-Kč";
	}

	if (howmuch > 20)
	{
		document.orderform.passengers_no.focus();
		document.orderform.total_price.value = '?';
		alert("Pro tento počet pasažérů Vám cenu rádi vzdělíme na tel 777 31 65 56 nebo mail info@airport-transfers-prague.com, děkujeme.");

	}
	return true;
}

function changePay(pay) { 
     temp= document.orderform.cenaBezPriplatku.value; 
     if (temp !='') {     
     var c=parseInt(temp,10)  
     if (pay !='hotovost') {
          c=c*1.05;
     }else {c=c;}
    
     document.orderform.total_price.value = c +",-Kč";
     }
 return true;
}

