/**
* Funktionen für den Ausblendemod
*/

var forums = new Array();
var anfrage = null;
try {
  anfrage = new XMLHttpRequest();
} catch (versuchmicrosoft) {
  try {
    anfrage = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (anderesmicrosoft) {
    try {
      anfrage = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (fehler) {
      anfrage = null;
    }
  }
}

// if (anfrage == null) alert("Fehler beim Erzeugen des Anfrage-Objekts - Ausblendemod wird nicht funktionieren");

function hide_forum(forum_id, category_forum_id, sid){

	elem = document.getElementById("pi_forumrow_" + forum_id);
	elem.style.display = "none";

	elem2 = document.getElementById("pi_ausblendelink_" + category_forum_id);
	elem2.innerHTML = ' <a onclick="show_category(' + category_forum_id + ', \'' + sid + '\')">Alle einblenden</a>';

	url = "../scripts/pwforum/hideforum_phpbb3.php?sid=" + sid + "&action=hide_forum&forum_id=" + forum_id;

	if(anfrage != null){
		anfrage.open( "GET", url, true );
	    anfrage.send( null );	    
	}
}

function show_category(forum_id, sid){

	url = "../scripts/pwforum/hideforum_phpbb3.php?sid=" + sid + "&action=show_category&forum_id=" + forum_id;

	if(anfrage != null){
		anfrage.open( "GET", url, true );
	    anfrage.send( null );
	    anfrage.onreadystatechange = reload_forum;
	}
}

function reload_forum(){
if (anfrage.readyState == 4) {
      window.location.href = "#forum_"+anfrage.responseText;
      window.location.reload();
     }
}