	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 helpDiv = document.getElementById('help' + number);
	helpDiv.style.display='block';
}

function hideHelp(number) // skrýt nápovědu
{
	var helpDiv = document.getElementById('help' + number);
	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 tbDiv = document.getElementById('textbox' + number);
	if (value==3 || value==4)
		tbDiv.style.display='block';
	else
		tbDiv.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 bookmark() {
title = "dnesnimenu.cz - kam dnes vyrazit na oběd";
url = "http://www.streetshop.cz/";
if (window.sidebar) {
// Mozilla

//alert("You are using FireFox!");
window.sidebar.addPanel(title, url,"");
//alert("Script from mistonline.in");

} else if( window.external ) {
// IE Favorite
//alert("You are using IE");
window.external.AddFavorite( url, title);

//alert("Script from mistonline.in");
}
else if(window.opera && window.print) {
// Opera

return true;

//alert("Script from mistonline.in");
}
}

