	function print_detail(id_polozky, language) {
		w = 700;
		h = 600;
		meta_h = 40;

		wtop = Math.round((screen.height - h - meta_h) / 2) - meta_h;
		wleft = Math.round((screen.width - w) / 2);
			
		info = window.open('http://localhost/print.php?DetID=' + id_polozky + '&lang=' + language, '', 'width=' + w + ', height=' + h + ',resizable=no,scrollbars=1,status=0,top=' + wtop + ',left=' + wleft);
	}


        function centred_window_scroll(theURL,w,h) {
			meta_h = 40;

			wtop = Math.round((screen.height - h - meta_h) / 2) - meta_h;
			wleft = Math.round((screen.width - w) / 2);
			
			info = window.open(theURL, '', 'width=' + (w + 20) + ', height=' + (h + meta_h + 10) + ',resizable=no,scrollbars=1,status=0,top=' + wtop + ',left=' + wleft);
		}

        function centred_window_noscroll(theURL,w,h) {
			meta_h = 40;

			wtop = Math.round((screen.height - h - meta_h) / 2) - meta_h;
			wleft = Math.round((screen.width - w) / 2);
			
			info = window.open(theURL, '', 'width=' + (w + 20) + ', height=' + (h + meta_h + 10) + ',resizable=no,scrollbars=0,status=0,top=' + wtop + ',left=' + wleft);
		}


		function large_picture(nam, file, w, h) {

			meta_h = 50;

			wtop = Math.round((screen.height - h - meta_h) / 2) - meta_h;
			wleft = Math.round((screen.width - w) / 2);
	
			pic = window.open('', '', 'width=' + (w + 20) + ', height=' + (h + meta_h + 10) + ',resizable=yes,top=' + wtop + ',left=' + wleft);
			pic.document.open();
			pic.document.writeln('\
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\
			"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\
		\
		<html>\
		<head>\
		<title>' + nam + '</title />\
		<BASE href="<?php echo $base ?>"> \
		<style type="text/css">\
		BODY { margin: 0px; background: white; }\
		</style>\
		</head>\
		<body>\
		<center>\
		<table align="center">\
		<tr height="6">\
			<td></td>\
		</tr>\
		</table>\
		<a href="javascript:window.close();" title="Kliknutím na obrázek okno zavřete"><img src="' + file + '" width="' + w + '" height="' + h + '" style="border-color: #484848;" alt="Kliknutím na obrázek okno zavřete" border="1"/></a>\
		</center>\
		<table align="center">\
		<tr>\
			<td style="text-align: center; font-family: Tahoma; font-size: 11px"><br>' + nam +'</td>\
		</tr>\
		</table>\
		</body>\
		</html>\
		');
			pic.document.close();
		}


function checkType(typ) {

	for(i=1;i<=4;i++) {
		document.getElementById('sel' + i).style.visibility='hidden';
		document.getElementById('sel' + i).style.display='none';
	}

	if (typ == '1' || typ=='6') {
		document.getElementById('sel1').style.visibility='visible';
		document.getElementById('sel1').style.display='block';
	}

	if (typ == '2' || typ=='3' || typ=='4') {
		document.getElementById('sel2').style.visibility='visible';
		document.getElementById('sel2').style.display='block';
	}

	if (typ == '5') {
		document.getElementById('sel3').style.visibility='visible';
		document.getElementById('sel3').style.display='block';
	}

	if (typ == '7') {
		document.getElementById('sel4').style.visibility='visible';
		document.getElementById('sel4').style.display='block';
	}
}

function showHelp(number) // zobrazit nápovědu
{
	var helpDef = document.getElementById('help00');
	var helpDiv = document.getElementById('help' + number);

	if (document.getElementById('help01').style.display == 'block')
		document.getElementById('help01').style.display = 'none';

	helpDef.style.display='none';
	helpDiv.style.display='block';
}

function hideHelp(number) // skrýt nápovědu
{
	var helpDef = document.getElementById('help00');
	var helpDiv = document.getElementById('help' + number);

	if (number == '00') {
		helpDef.style.display='none';
		helpDiv.style.display='none';
	}

	if (number != '01') {
		helpDef.style.display='block';
		helpDiv.style.display='none';
	}
}

function showTextbox(number, value) // zobrazit textové pole
{
	var tbDiv = document.getElementById('textbox' + number);
	if (value==1)
		tbDiv.style.display='block';
	else
		tbDiv.style.display='none';
}

function showTextbox2(number, value) // zobrazit textové pole
{
	var iks;

	if (number.substr(0,1) == 'x') {
		iks = true;
		nr = number.substr(1);
	}
	else
		nr = number;

	var tbDiv = document.getElementById('textbox' + nr);
	if (value==3 || value==4)
		tbDiv.style.display='block';
	else
		tbDiv.style.display='none';

	if (iks == true) {
		var tbDiv = document.getElementById('textbox' + nr + 'x');
		if (value==3 || value==4)
			tbDiv.style.display='block';
		else
			tbDiv.style.display='none';
	}

}

function showTextbox3(typ,number1, number2, value) // zobrazit textové pole
{
	var tbDiv = document.getElementById('textbox' + number1);
	var tbDiv2 = document.getElementById('textbox' + number2);

	if (typ ==1) {
		if (value==2 || value==3) {
			tbDiv.style.display='block';
			tbDiv2.style.display='block';
		}
		else {
			tbDiv.style.display='none';
			tbDiv2.style.display='none';
		}
	}
	else {
		if (value==1) {
			tbDiv.style.display='block';
			tbDiv2.style.display='block';
		}
		else {
			tbDiv.style.display='none';
			tbDiv2.style.display='none';
		}
	}
}

function showFlat(number) // zobrazit bytove jednotky v dome
{
//	nejprve zrusime zobrazeni vsech bytovych jednotek
	for(i=1;i<=9;i++) {
		document.getElementById('flat0' + i).style.display='none';
	}

	// potom zobrazime pozadovany pocet
	for(i=1;i<=number;i++) {
		document.getElementById('flat0' + i).style.display='block';
	}
}


function recommend(lng) {
	wtop = Math.round((screen.height - 400) / 2);
	wleft = Math.round((screen.width - 450) / 2);

    img =  window.open('/recommend.php?lang=' + lng, '', 'width= 500, height=450, toolbar=no,resizable=no,scrollbars=0,status=0,top=' + wtop + ',left=' + wleft);
    img.focus();
}

function selectLocation() {
	alert('ano');
}

var dialogWindow = null;
var theField = null;

function ShowDialog( theInput ) {
		w=800;
		h=600;

		wtop = Math.round((screen.height - h) / 2);
		wleft = Math.round((screen.width - w) / 2);

        theField1 = eval("document.formular.okres");
        theField2 = eval("document.formular.obec");
        theField3 = eval( "document.formular.cobce");
        theField4 = eval("document.formular.ulice");
        theField5 = eval( "document.formular.psc");
        theField6 = eval("document.formular.okres_id");
        theField7 = eval("document.formular.obec_id");
        theField8 = eval( "document.formular.cobce_id");
        theField9 = eval("document.formular.ulice_id");

        theField1.value = "";
        theField2.value = "";
        theField3.value = "";
        theField4.value = "";
        theField5.value = "";
        theField6.value = "";
        theField7.value = "";
        theField8.value = "";
        theField9.value = "";

        dialogWindow=window.open("/select_location.inc.php","MyDialog", "dependent=yes,menubar=no,location=no,resizable=yes,scrollbars=1,width=" + w + ",height=" + h + ",toolbar=0,top="+ wtop+",left=" + wleft);
}

function Transfer( theValue1, theValue2, theValue3, theValue4, theValue5, theValue6, theValue7, theValue8, theValue9 ) {
//         if( theField != null ) theField.value = theValue2;
		theField1.value = theValue1;
		theField2.value = theValue2;
		theField3.value = theValue3;
		theField4.value = theValue4;
		theField5.value = theValue5;
		theField6.value = theValue6;
		theField7.value = theValue7;
		theField8.value = theValue8;
		theField9.value = theValue9;
//		 document.formular.submit();
}

function HideDialog() {
        if( dialogWindow != null ) {
                if (typeof(dialogWindow.document) == "object")
                        dialogWindow.close()
        }
}
