// Hortkinder //

function zeigeAufstellung(spiel_id)
{
  $("#Aufstellung_Inhalt").html('<p>Daten werden geladen</p></div>');
        $.post('gen_AufstellungsPopup.php', {spielid: spiel_id, mode: 'default'} ,  function(data){
        $("#Aufstellung_Inhalt").html(data);
    }, "html" ); 
       
// $('#Aufstellung_Inhalt').load('gen_AufstellungsPopup.php?spielid='+spiel_id);
 $('#Wechselbank_Inhalt').load('gen_AufstellungsPopup.php?spielid='+spiel_id+'&mode=bank');
 
 zeige_AufstellungsPopup();
}



function toggledisplay (id){
  if (document.getElementById) {
    var mydiv = document.getElementById(id);
    mydiv.style.display = (mydiv.style.display=='block'?'none':'block');
  }
}

function showText(index) {
    document.getElementById('link' + index).style.display = 'none';
    document.getElementById('text' + index).style.display = 'block';
}



function wechsle_zu_spiel(){
    
    var spielid = $(this).attr('id');
    spielid = spielid.substring(2);       // ZeilenIndikator  hl wegwerfen 
    
    if (spielid>98)
    {
    $("ul.tabs li").removeClass("active"); //Remove any "active" class
	$("treiter99").addClass("active"); //Add "active" class to selected tab
    $(".tab_content").hide(); //Hide all tab content
    $("#tab99").fadeIn(); //Fade in the active ID content
        
    } 
    else {
                
    var auswahl = "#treiter" + spielid;
    $("ul.tabs li").removeClass("active"); //Remove any "active" class
	$(auswahl).addClass("active"); //Add "active" class to selected tab
    $(".tab_content").hide(); //Hide all tab content
    var activeTab = $(auswahl).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
    $(activeTab).fadeIn(); //Fade in the active ID content
    } 


    return false;
}
