function dominnerText(node, text) { while (node.hasChildNodes()) { node.removeChild(node.firstChild); } node.appendChild(document.createTextNode(text)); }
function OpenNewWindow(soubor, jmeno, dx, dy, vlastnosti)
{
window.open(soubor, jmeno, "left=" + ((screen.width - dx) / 2) + ", top=" + ((screen.height - dy) / 2 - 16) + ", width=" + dx + ", height=" + dy +", " + vlastnosti);
// vlastnosti: channelmode=no, status=no, toolbar=no, menubar=no, location=no, scrollbars=no, resizable=yes);
}
if (top.location != self.location) top.location = self.location;


function doTranslate(lang_pair)
{
  if (lang_pair.value)
  {
    lang_pair = lang_pair.value;
  }
  if (location.hostname == 'www.greenagency.cz' && lang_pair == 'cs|cs')
  {
    return;
  }
  else if (location.hostname != 'www.greenagency.cz' && lang_pair == 'cs|cs')
  {
    location.href = unescape(gfg('u'));
  }
  else if (location.hostname == 'www.greenagency.cz' && lang_pair != 'cs|cs')
  {
    location.href = 'http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href);
  }
  else
  {
    location.href = 'http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u'));
  }
}

function gfg(name)
{
  name = name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
  var regexS="[\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(location.href);
  if (results == null)
  {
    return '';
  }
  return results[1];
}
