function menujs(ktery){
  if(document.getElementById(ktery)){
  	var stav=document.getElementById(ktery).style.display;
  	if(stav==""){
  		document.getElementById(ktery).style.display = "none";
  	}
  	else if(stav=="none"){
  		document.getElementById(ktery).style.display = "";
  	}
 	}
}

function confirmLink(theLink, theMsg)
{
    var is_confirmed = confirm(theMsg);
    if (is_confirmed) {
    }
    return is_confirmed;
}


function dokosiku(xuser, lang, pid, obchod, jednotka, druha, druhb, dopl, polob) {
	var w=500;
	var h=300;
	var windowfeatures='toolbar=no, scrollbars=yes, resizable=yes, menubar=no';
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	win = window.open('./kosik.php?xuser='+xuser+'&lang='+lang+'&pid='+pid+'&obchod='+obchod+'&jednotka='+jednotka+'&druha='+druha+'&druhb='+druhb+dopl, "kosik", winprops+windowfeatures)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function kosikedit(xuser, lang, pid, obchod, polob) {
	var w=500;
	var h=300;
	var windowfeatures='toolbar=no, scrollbars=yes, resizable=yes, menubar=no';
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	win = window.open('./kosik.php?xuser='+xuser+'&lang='+lang+'&pid='+pid+'&obchod='+obchod+'&pol='+polob, "kosik", winprops+windowfeatures)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function dodaciadresa(xuser, lang, obchod, objednavka) {
	var w=600;
	var h=400;
	var windowfeatures='toolbar=0, scrollbars=1, resizable=1, menubar=0';
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl;
	win = window.open('./dodaciadresa.php?xuser='+xuser+'&lang='+lang+'&obchod='+obchod+'&objednavka='+objednavka, "adresa", winprops+windowfeatures)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function potvrdit()
{
	document.getElementById('potobj').value = "yes";
}

function objednatConf(formular){
	var conf=document.getElementById('potobj').value;
  if(conf=="yes"){
		is_confirmed = confirm('Chcete opravdu objednat vybrané zboží?');
    return is_confirmed;
	}
	else{
		return true;
	}
}

function vyprzdnit_kosik(kam, otazka){
  is_confirmed = confirm(otazka);
  if(is_confirmed == true){
    window.location.replace(kam);
  }
}

