var
  color_normal='#cdffcc';
  color_hell  ='#FFFFFF';
  color_dunkel='#009900';
  color_over  ='#009900';
  such_art='';
  
function href_click (S)
{
  parent.daten.location.href='daten.php?'+S;
}

function suchen_click ()
{
  S='';//pid='+document.getElementById('pid').value;
  S=S+'&suchart='+such_art;
  if (such_art=='athlet')
  {
    S=S+'&fname='+escape(document.getElementById('athlet_fname').value);
  } else
  if (such_art=='event')
  {
    S=S+'&fwkart='+document.getElementById('event_fwkart').value+
          '&fsex='+document.getElementById('event_fsex').value+
          '&fakl='+document.getElementById('event_fakl').value;
  } else
  if (such_art=='nation')
  {
    fvon=document.getElementById('nation_fvon').value;
    fbis=document.getElementById('nation_fbis').value;
    if (fvon>fbis)
    {
      document.getElementById('nation_fvon').value=fbis;
      document.getElementById('nation_fbis').value=fvon;
    }
    S=S+'&fland='+document.getElementById('nation_fland').value+
        '&fvon='+document.getElementById('nation_fvon').value+
        '&fbis='+document.getElementById('nation_fbis').value+
        '&fwkart='+document.getElementById('nation_fwkart').value+
        '&fakl='+document.getElementById('nation_fakl').value+
        '&fsort='+document.getElementById('nation_fsort').value;
  } else
  if (such_art=='year')
  {
    S=S+'&fjahr='+document.getElementById('year_fjahr').value;
  } else
  if (such_art=='records')
  {
    S=S+'&fart='+document.getElementById('records_fart').value+
        '&fsex='+document.getElementById('records_fsex').value+
        '&fakl='+document.getElementById('records_fakl').value;
  }
  //alert(S);
  parent.daten.location.href="daten.php?"+S;
}


function suchart_click (art)
{
  //alert(art);
  such_art=art;
  document.getElementById('athlet').style.backgroundColor=color_normal;
  document.getElementById('event').style.backgroundColor=color_normal;
  document.getElementById('nation').style.backgroundColor=color_normal;
  document.getElementById('year').style.backgroundColor=color_normal;
  document.getElementById('records').style.backgroundColor=color_normal;
  document.getElementById('athlet').style.color='#000000';
  document.getElementById('event').style.color='#000000';
  document.getElementById('nation').style.color='#000000';
  document.getElementById('year').style.color='#000000';
  document.getElementById('records').style.color='#000000';
  document.getElementById('athlet').style.fontWeight='normal';
  document.getElementById('event').style.fontWeight='normal';
  document.getElementById('nation').style.fontWeight='normal';
  document.getElementById('year').style.fontWeight='normal';
  document.getElementById('records').style.fontWeight='normal';

  document.getElementById('div_athlet').style.visibility='hidden';
  document.getElementById('div_event').style.visibility='hidden';
  document.getElementById('div_nation').style.visibility='hidden';
  document.getElementById('div_year').style.visibility='hidden';
  document.getElementById('div_records').style.visibility='hidden';

  document.getElementById(art).style.backgroundColor=color_dunkel;
  document.getElementById(art).style.fontWeight='bold';
  document.getElementById(art).style.color='#FFFFFF';

  if (such_art=='athlet')
  {
    document.getElementById('div_athlet').style.visibility='visible';
  } else
  if (such_art=='event')
  {
    document.getElementById('div_event').style.visibility='visible';
  } else
  if (such_art=='nation')
  {
    document.getElementById('div_nation').style.visibility='visible';
  } else
  if (such_art=='year')
  {
    document.getElementById('div_year').style.visibility='visible';
  } else
  if (such_art=='records')
  {
    document.getElementById('div_records').style.visibility='visible';
  }
}

function change_bgcolor (id,art)
{

  if (art=='over')
  {
     document.getElementById(id).style.backgroundColor=color_over;
     //document.getElementById(id).style.fontWeight='bold';
     document.getElementById(id).style.color='#FFFFFF';
  } else
  if (art=='out')
  {
     document.getElementById(id).style.backgroundColor=color_normal;
     if (id=='suchen')
     {
        document.getElementById(id).style.fontWeight='bold';
        document.getElementById(id).style.color='#000000';
     } else
     if (id==such_art)
     {
        document.getElementById(id).style.backgroundColor=color_dunkel;
        document.getElementById(id).style.fontWeight='bold';
        document.getElementById(id).style.color='#FFFFFF';
     } else
     {
        document.getElementById(id).style.fontWeight='normal';
        document.getElementById(id).style.color='#000000';
     }
  } else
  if (art=='hell')
  {
    document.getElementById(id).style.backgroundColor=color_hell;
    //document.getElementById(id).style.fontWeight='normal';
    document.getElementById(id).style.color='#000000';
  } else
  if (art=='normal')
  {
    document.getElementById(id).style.backgroundColor=color_normal;
    //document.getElementById(id).style.fontWeight='normal';
    document.getElementById(id).style.color='#000000';
  } else
  if (art=='dunkel')
  {
    document.getElementById(id).style.backgroundColor=color_dunkel;
    //document.getElementById(id).style.fontWeight='bold';
    document.getElementById(id).style.color='#FFFFFF';
  }
}


function change_border (id,breite,farbe)
{
  if (breite=='0')
    {document.getElementById(id).style.borderWidth='0px'}
  else if (breite=='1')
    {document.getElementById(id).style.borderWidth='1px'}
  else if (breite=='2')
    {document.getElementById(id).style.borderWidth='2px'}
  else if (breite=='3')
    {document.getElementById(id).style.borderWidth='3px'}
  if (farbe=='hell')
    {document.getElementById(id).style.borderColor=color_hell}
  else if (farbe=='normal')
    {document.getElementById(id).style.borderColor=color_normal}
  else if (farbe=='dunkel')
    {document.getElementById(id).style.borderColor=color_dunkel}
}


function form_key_press ()
{
  evt= window.event;
  if (evt.keyCode==13)
  {
    alert('Taste');
	evt.returnValue=false;
    suchen_click();
  }
}

function name_gross (field)
{
  if (field.value.length==1)
  {
    field.value=field.value.toUpperCase();
    if (field.createTextRange)
    {
    var r = field.createTextRange();
    r.moveStart('character', field.value.length);
    r.collapse();
    r.select();
    }
  }
}

function weiter_leiten()
{
  window.document.location.href="http://www.iat.uni-leipzig.de/datenbanken/dbgwh/start.php";
}





