function hauptlink_onload()
{
  if (parent.ksc_mitte)
  {
    try
    {
      set_lang();
    }
    catch(e)
    {
    }
    try
    {
      if (parent.ksc_mitte.aktiv)
      {
        setTimeout("try{" + parent.ksc_mitte.aktiv + "(false, '');}catch(e){}", 100);
      }
    }
    catch(e)
    {
    }
  }
}

function init_nation_img()
{
  var sel;

  if (document.getElementById)
  {
    sel = document.getElementById("select_nation");
    if (sel)
    {
      swap_nation_img(sel[sel.selectedIndex].value);
    }
  }
}

function set_var(name, value)
{
  try
  {
    if (InternetExplorer || parent.ksc_mitte && parent.ksc_mitte.document && parent.ksc_mitte.document.getElementById && parent.ksc_mitte.document.getElementById('ksc_swf'))
    {
      if (location.host != parent.ksc_mitte.location.host)
      {
        parent.ksc_mitte.set_var(name, value);
      }
      else
      {
        parent.ksc_mitte.document.getElementById('ksc_swf').SetVariable(name, value);
      }
    }
  }
  catch(e)
  {
    if (location.host.indexOf(".x.source.at") > 0)
    {
      alert(e + " -- set_var(" + name + ", " + value + ") failed");
    }
  }
}

function sponsoring_window(url)
{
  if (sponsoring_window.miniwin && sponsoring_window.miniwin.close)
  {
    sponsoring_window.miniwin.close();
  }
  var my_width  = 400;
  var my_height = 400;
  var my_x      = Math.floor((screen.width  - my_width)  / 2);
  var my_y      = Math.floor((screen.height - my_height) / 2);

  sponsoring_window.miniwin = window.open(url,
                                          "mini_window",
                                          ""
                                          + "directories=no,"
                                          + "location=no,"
                                          + "menubar=no,"
                                          + "resizable=yes,"
                                          + "scrollbars=no,"
                                          + "status=no,"
                                          + "toolbar=no,"
                                          + "width="     + my_width  + ","
                                          + "height="    + my_height + ","
                                          + "screenX="   + my_x      + ","
                                          + "screenY="   + my_y +    ","
                                          + "left="      + my_x      + ","
                                          + "top="       + my_y +    ","
                                          + "marginwidth=0,"
                                          + "marginheight=0,"
                                          + "fullscreen=0"
                                          );
  setTimeout("sponsoring_window.miniwin.focus();", 100);
}

function swap_nation_img(nation)
{
  var img;

  if (document.getElementById)
  {
    img = document.getElementById("img_nation");
    if (img)
    {
      if (nation == "")
      {
        img.src = "/images/flags/flag_nix.gif";
      }
      else
      {
        img.src = "/images/flags/png/" + nation.toUpperCase() + ".png";
      }
    }
  }
}

function swf_onload()
{
  window.load_timeout = window.setTimeout("swf_onload_fertig()", 2000);
}

function swf_onload_fertig()
{
  window.fertig = true;
}
//////// BEGIN
sponsoring_window.miniwin = false;
window.InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
window.full_screen_text = "Please resize this window to full screen!";

