// JavaScript Document

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function GetObject(objName, x) { //v3.0
  var obj = MM_findObj(objName); if (obj) return obj;
}

var lastSubmenu = 'stavby';
function selectSubmenu(menuItem) {

	GetObject(lastSubmenu).style.color = "#25953F";
	GetObject(menuItem).style.color = "#CD5A00";
	lastSubmenu = menuItem;
}

var poc = 0;
function openNewWindow(URLtoOpen, windowName, windowFeatures) 
{ if (poc!==0) {newWindow.close();};
  newWindow=window.open(URLtoOpen, windowName, windowFeatures);
  newWindow.focus();
  poc++;
}

function str_replace(_search, _replace, _source) {
	while (_source.replace(_search, _replace) != _source) _source = _source.replace(_search, _replace);
	return _source;
}

