function printIt() {

	window.print();
} // printIt()

/******************************************************************************/

function bar(url, title) {

	wasOpen = false;
	win     = window.open(url, title);    
	return (typeof(win) == 'object') ? true : false;
} // bar()

/******************************************************************************/

function clearInput(target, text) {

	if (target.value == text) {
		target.value = '';
	} // if
} // clearInput()

function restoreInput(target, text) {

	if (target.value == '') {
		target.value = text;
	} // if
} // restoreInput()

/******************************************************************************/

var imageWin = '';

function openImageWin(path) { 

	URL = '/imagewin.php?file=' + path;
	if (imageWin.location && !imageWin.closed) {
		imageWin.location.href = URL;
	} else {
		imageWin = window.open(URL, '', 'width=400,height=400,resizable=1,scrollbars=0,status=0');
	} // if
	imageWin.focus();

	return false;
} // openImageWin()

function tidy() {

	if (imageWin.location && !imageWin.closed) {
		imageWin.close();
	} // if
} // tidy()

function fit() {

	if (window.innerWidth) {
		iWidth  = window.innerWidth;
		iHeight = window.innerHeight;
	} else {
		iWidth  = document.body.clientWidth;
		iHeight = document.body.clientHeight;
	} // if
	iWidth  = document.images[0].width - iWidth;
	iHeight = document.images[0].height - iHeight;
	window.resizeBy(iWidth, iHeight);
} // fit()

/******************************************************************************/

function setDisplay(id, visibility) {

	if (visibility) {
		document.getElementById(id).style.display = 'block';
	} else {
		document.getElementById(id).style.display = 'none';
	} // if

	return;
} // setVisibility()

function isEmpty(input) {

	return (input.value.length > 0);
} // isEmpty()

function checkAddressFields(prefix) {

	fldFirstName = document.getElementById(prefix + 'firstname').value;
	fldSurname   = document.getElementById(prefix + 'surname').value;
	fldCompany   = document.getElementById(prefix + 'company').value;
	fldStreet    = document.getElementById(prefix + 'street').value;
	fldCity      = document.getElementById(prefix + 'city').value;
	fldZIP       = document.getElementById(prefix + 'zip').value;
	fldPhone     = document.getElementById(prefix + 'phone').value;
	fldMail      = document.getElementById(prefix + 'mail').value;

	if ((fldFirstName == '' || fldSurname == '') && fldCompany == '') {
		alert('Prosím vyplňte jméno a příjmení a/nebo název společnosti.');
		document.getElementById(prefix + 'firstname').focus();

		return false;
	} // if

	if (fldStreet == '') {
		alert('Prosím vyplňte adresu včetně ulice.');
		document.getElementById(prefix + 'street').focus();

		return false;
	} // if

	if (fldCity == '') {
		alert('Prosím vyplňte adresu včetně města.');
		document.getElementById(prefix + 'city').focus();

		return false;
	} // if

	if (fldZIP == '') {
		alert('Prosím vyplňte adresu včetně PSČ.');
		document.getElementById(prefix + 'zip').focus();

		return false;
	} // if

	if (fldPhone == '') {
		alert('Prosím vyplňte telefoní číslo.');
		document.getElementById(prefix + 'phone').focus();

		return false;
	} // if

	if (fldMail == '') {
		alert('Prosím vyplňte e-mailovou adresu.');
		document.getElementById(prefix + 'mail').focus();

		return false;
	} // if

	return true;
} // checkAddressFields()

/******************************************************************************/