function getObj(name)
{
	if(document.getElementById)
	{
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	}else if (document.all) {
		this.obj = document.all[name];
		this.style = document.all[name].style;
	}else if (document.layers){
		this.obj = document.layers[name];
		this.style = document.layers[name];
	}
}
function showdiv(whichid)
{
	mainobject = new getObj(whichid);
	if (mainobject.style.display=="none")
	{
		mainobject.style.display="block";
	}
	else {
		mainobject.style.display="none";
	}
}
function OpenModalWin(uri,name,w,h)
{
	window.open(uri,name,'modal=yes,height='+h+',width='+w+',toolbar=no,directories=no,status=yes,scrollbars=yes,resizable=yes,left='+(screen.width/2-w/2)+',top='+(screen.height/2-h/2));
}
function WinOpenerWrite(formname,inpname,valname)
{
	if(window.opener)
	{
		frm = window.opener.document.forms[formname];
		eval('frm.'+inpname+'.value = "'+valname+'";');
		window.close();
	} else {
		alert('Zavřeli jste stránku, která toto okno otevřela. Nebude možné do ní zapisovat. Akce tak nemuže být provedena.');
	}
}
function skyscraper()
{
	document.getElementById("skyscraper").style.margin = document.body.scrollTop + 'px 0px 0px 0px';
}
function showMap(v)
{
	if(document.getElementById(v).style.height == '600px')
	{
		document.getElementById(v).style.height = '20px';
	}else {
		document.getElementById(v).style.height = '600px';
	}
}
function showElement(v)
{
	if(document.getElementById(v).display == 'none')
	{
		document.getElementById(v).display = 'block';
	}else {
		document.getElementById(v).display = 'none';
	}
}
function searchValue()
{
	if(document.getElementById('c').value == 'false')
	{
		document.getElementById('q').style.color = '#000000';
		document.getElementById('q').value = '';
		document.getElementById('c').value = 'true';
	}
}
function init()
{
	document.getElementById('q').style.color = '#cccccc';
	document.getElementById('q').value = 'Hledání v katalogu';
}
function CheckLength(t,l,m)
{
	if(t.value.length>m)
	{
		t.value = t.value.substring(0,m);
	}
	l.value = m - t.value.length;
}

