/* ZOZNAM.PHP */
function showPic(image,largeur,hauteur)
{
	nomDeFenetre = "bundy" + Math.round(100000*Math.random());
	options = "width=" + largeur + ",height=" + hauteur +",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no";
	okno = window.open('showpic.php?href='+image,nomDeFenetre,options);
}

/*DETAIL.PHP*/
function round(courruptNumber) {
a=courruptNumber*100;
b=a % 1;
if (b>= 0.5) {
	b=0.01;
	}  
else {
	b=0;
	}

a=a-(a % 1);
return (a/100)+b;
}

function calculate(cena, cenasdph) {
document.basket1.cenaX.value=round(document.basket1.count.value.replace(",", ".")*cena);
document.basket1.cenaY.value=round(document.basket1.count.value.replace(",", ".")*cenasdph);
}

/*VOLF.PHP - LOGIN*/

function checkData() {
	var f1 = document.loginForm;
	var wm = "Vážený uživateľ, zadajte prosím nasledujúce údaje:\r\n";
	var noerror = 1;

	// --- entered_login ---
	var t1 = f1.entered_login;
	if (t1.value == "" || t1.value == " ") {
		wm += "Uživateľské meno\r\n";
		noerror = 0;
	}

	// --- entered_password ---
	var t1 = f1.entered_password;
	if (t1.value == "" || t1.value == " ") {
		wm += "Heslo\r\n";
		noerror = 0;
	}

	// --- check if errors occurred ---
	if (noerror == 0) {
		alert(wm);
		return false;
	}
	else return true;
}

/*BAKET.PHP*/
function dropFromB(c) {
	document.basket.toDel.value=c;
	document.basket.submit();
}

/*KONTAKT.PHP*/
function otvorOkno(image,largeur,hauteur,description)
{
	nomDeFenetre = "bundy" + Math.round(100000*Math.random());
	options = "width=" + (largeur) + ",height=" + (hauteur) +",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no";
	fenetre = window.open('showpic.php?pic='+image,nomDeFenetre,options);
}

function otvorOknoOff(html,largeur,hauteur,description)
{
	nomDeFenetre = "bundy" + Math.round(100000*Math.random());
	options = "width=" + (largeur) + ",height=" + (hauteur) +",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no";
	fenetre = window.open(html,nomDeFenetre,options);
}


/*uvod.php*/
function cennikExcel() {
	options = "width=300,height=210,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes,copyhistory=no";
	window.open("cennik-xls.php",'',options);
	}
