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 showMeDiv(whichid)
{
	mainobject = new getObj(whichid);
  mainobject.style.display="block";
}
function hideMeDiv(whichid)
{
	mainobject = new getObj(whichid);
  mainobject.style.display="none";
}

function showMeObj(mainobject)
{
	mainobject.style.display="block";
}
function hideMeObj(mainobject)
{
	mainobject.style.display="none";
}
function visiblediv(whichid)
{
	mainobject = new getObj(whichid);
	mainobject.style.visibility="visible";
}
function hiddendiv(whichid)
{
	mainobject = new getObj(whichid);
	mainobject.style.visibility="hidden";
}
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;
}
function winopen(uri,w,h) {
  window.open(uri,'','width='+(w+20)+',height='+(h+20)+',left='+(screen.width/2-w/2-10)+',top='+(screen.height/2-h/2-10)+',status=yes,resizable=yes,scrollbars=yes');
}
function changeTab(which, others)
{
  mainobject = new getObj(which);
	mainobject.style.display = 'block';
	mainobject = new getObj(which+'_tab');
	mainobject.className = "tabSelected";
  for(var i = 0; i < others.length; i++)
  {
    mainobject = new getObj(others[i]);
    mainobject.style.display = 'none';
    mainobject = new getObj(others[i]+'_tab');
  	mainobject.className = "tabUnSelected";
  }
}
function setSize(width,height)
{
	if (window.outerWidth) 
  {
		window.outerWidth = width;
		window.outerHeight = height;
	}
	else if (window.resizeTo) 
  {
		window.resizeTo(width,height);
	}
	else {
		alert("Not supported.");
	}
}
