// main menu

Browser = navigator.appName;
Verze = parseInt(navigator.appVersion);
DoOnLoad = null;

if ((Browser == "Netscape" && Verze >= 3) || (Browser == "Microsoft Internet Explorer" && Verze >= 4)) 
  ScriptEn = 1;
else 
  ScriptEn = 0;

function DoHlite(imgDocID, imgObjName) 
{      
  if (ScriptEn)
    document.images[imgDocID].src = "img/" + eval(imgObjName + "_b");
}
    
function DoHlite2(imgDocID, imgObjName) 
{
  if (ScriptEn)
    document.images[imgDocID].src = "img/" + eval(imgObjName);
}

function ExecOnLoad()
{
  if (DoOnLoad)
    DoOnLoad();
}

function FindFormElement(aFormName, aElementName)
{
  E = null;
  for (i = 0; i < document.forms[aFormName].elements.length; i++)
    if (document.forms[aFormName].elements[i].name == aElementName)
    {
      E = document.forms[aFormName].elements[i];
      break;
    }
  return E;
};

function DrawGraph(aGraphArr, aMawWidth)
{
  var graphimage="poll.gif";
  total=0;
  max = 0;
  for (i=0;i<aGraphArr.length;i++)
  {
    total+=parseInt(aGraphArr[i][1]);
    max = (max < aGraphArr[i][1]) ? aGraphArr[i][1] : max;
  }
  
  output='<table align="center" border="0" cellspacing="0" cellpadding="0">'
  for (i=0;i<aGraphArr.length;i++)
  {
    //calpercentage=Math.round(aGraphArr[i][1]*100/total);
    calpercentage=aGraphArr[i][1];
    calwidth=Math.round(aMawWidth * (calpercentage/max));
    output += '<tr valign="middle"><td height="15" align="right" class="basecont" style="color: white;">' + 
      aGraphArr[i][0] + '&nbsp;</td><td class="basecont" style="color: white;"><img src="img/' +
      graphimage + '" width="' + calwidth + '" height="10">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    if (calpercentage > 0)
      output += calpercentage;
    output += '</td></tr>';
  }
  output+='</table>';
  document.write(output+
    '<table align="center"><tr valign="bottom"><td height="30" class="basecont" style="color: white;">Celkový počet návštěv: <b>'+
    total+'</b></td></tr></table>');
};

function OpenModalWin(aUrl)
{
  return window.open(aUrl, "", "");
}

function OpenModalWinScroll(aUrl, aXPos, aYPos, aWidth, aHeight)
{
  return window.open(aUrl, "", "menubar=no; screenX=" + aXPos + "; screenY=" +
    aYPos + "; dependent=yes; resizable=no; height=" + aHeight + "; width=" + aWidth + 
    "; status=no; hotkeys=no; location=no; scrollbars=no; directories=no");
}

