function fixLinks()
{
  if (!document.getElementsByTagName) return null;
  var server = document.location.hostname;
  var anchors = document.getElementsByTagName("a");
  for(var i=0; i < anchors.length; i++)
  {
    var a = anchors[i];
    var href = a.href;
    var id = a.id;
    var title = a.title;
    if (href.indexOf("#head") != -1) { // back to top
      a.className = "alt";
    } else if ((href.indexOf("#") != -1) && (href.indexOf("header") == -1)) { // jump ref
      var index = href.indexOf("#") + 1;
      href = "javascript:show('" + href.substring(index) + "');";
      a.setAttribute("href",href);
    }
  }
}

function hideDivs(exempt)
{
  if (!document.getElementsByTagName) return null;
  if (!exempt) exempt = "";
  var divs = document.getElementsByTagName("div");
  for(var i=0; i < divs.length; i++)
  {
    var div = divs[i];
    var id = div.id;
    if ((id != "main") &&
        (id != "main_border") &&
        (id != "head") &&
        (id != "flashcontent") &&
        (id != "obsah") && 
        (id != "vidim") && 
        (id != "menu") && 
        (id != "col_440") &&
        (id != "col_420") &&
        (id != "col_200") &&
        (id != "col_200end") &&
        (id != "sport") &&
        (id != "float") &&
        (id != "forum") &&
        (id != "aktu_dotazy") &&
        (id != "aktu_forum") &&
        (id != "footer") &&
        (id != "footer_in") &&
        (id != "cislo") &&
        (id != "radek") &&
        (id != "container") &&
        (id != "lefttop") &&
        (id != "righttop") &&
        (id != "bottom") &&
        (id != "menu") &&
        (id != "dev") &&
        (id != "devin") &&
        /*lightbox;greybox*/
        
        (id != "lightbox") &&
        (id != "lightboxImage") &&
        (id != "outerImageContainer") &&
        (id != "imageContainer") &&
        (id != "loading") &&
        (id != "loadingLink") &&
        (id != "hoverNav") &&
        (id != "prevLink") &&
        (id != "nextLink") &&
        (id != "imageDataContainer") &&
        (id != "imageData") &&
        (id != "imageDetails") &&
        (id != "caption") &&
        (id != "numberDisplay") &&
        (id != "bottomNav") &&
        (id != "bottomNavClose") &&
        (id != "overlay") &&
        (id != exempt))
    {
      div.className = "hidden";
    }
  }
}
function show(what)
{
  if (!document.getElementById) return null;
  showWhat = document.getElementById(what);
  showWhat.className = "";
  hideDivs(what);
}

function sendFocus(what)
{
  var obj = document.getElementById(what);
  obj.focus();
}

function open_window(href)
{
  var width = parseInt(screen.availWidth * .8);
  var height = parseInt(screen.availHeight * .8);
  var x = parseInt((screen.availWidth/2) - (width/2));
  var y = parseInt((screen.availHeight/2) - (height/2));
  var windowFeatures = "width=" + width + ",height=" + height + ",left=" + x +",screenX=" + x +",top=" + y + ",screenY=" + y;
  var openWindow = this.open(href, "Popup", windowFeatures);
}

//getUrlVars();
var qs = location.search.substring(1);
var nv = qs.split('&');
var url = new Object();
for(i = 0; i < nv.length; i++)
{
  eq = nv[i].indexOf('=');
  url[nv[i].substring(0,eq).toLowerCase()] = unescape(nv[i].substring(eq + 1));
}
//alert(url.r);
var r = url.r;
if (r == 1) {
// tady je show flash - vola nahrani flash menu, normalne je v indexu pod function showFlash();  
/*
window.onload = function()
{
  fixLinks();
  hideDivs("site_06");
  sendFocus("navIntro");
  showFlash();
}
} else {
  window.onload = function()
{
  fixLinks();
  hideDivs("site_01");
  sendFocus("navIntro");
  showFlash();
} */

window.onload = function()
{
  fixLinks();
  hideDivs("site_06");
  sendFocus("navIntro");
}
} else {
  window.onload = function()
{
  fixLinks();
  hideDivs("site_01");
  sendFocus("navIntro");
}
}

  

