var agt=navigator.userAgent.toLowerCase();
var is_ie = (agt.indexOf("msie") != -1);
var is_nn = (agt.indexOf("netscape") != -1);
var is_op = (agt.indexOf("opera") != -1);
var is_ff = (agt.indexOf("firefox") != -1);
if(is_op) {
is_ie = false;
is_nn = false;
is_ff = false;
}

function showhide(id,check,descid) {
 check = !check;
 if (isArray(id)) for(i in id)
  document.getElementById(id[i]).style.display = check ? "" : "none";
 else document.getElementById(id).style.display = check ? "" : "none";
 if (descid) {
  if (isArray(descid)) for(i in descid)
   document.getElementById(descid[i]).style.display = check ? "none" : "";
  else document.getElementById(descid).style.display = check ? "none" : "";
 }
}

function member(number)
{
open("http://www.bierschinken.net/members/membersstyle.php?"+number+"&style=small","_blank","width=400,height=360,scrollbars=yes");
}

function isArray(obj) {
   if (obj.constructor.toString().indexOf("Array") == -1)
      return false;
   else
      return true;
}

var ld_connections = new Array();
var ld_cache = new Array();
function loaddiv(file, div, usecache)
{
 if ( (ld_cache[file] !== undefined) && usecache )
  document.getElementById(div).innerHTML = ld_cache[file];
 else {
     var xmlHttp = getXmlHttp();
     if (xmlHttp) {
      xmlHttp.open('GET', file, true);
      xmlHttp.onreadystatechange = function () {
             if (xmlHttp.readyState == 4) {
    		   ld_loaded(file);
    		  }
       };
      xmlHttp.send(null);
      var a = new Array(xmlHttp, div, usecache);
      ld_connections[file] = a;
     }
 }
}

function ld_loaded(file) {
 var connection = ld_connections[file];
 if (connection != null) {
  var xmlHttp = connection[0];
  var div = connection[1];
  var usecache = connection[2];
  var text = xmlHttp.responseText;
  if (usecache)
   ld_cache[file] = text;
  if (text.length > 0)
   document.getElementById(div).innerHTML = text;
  delete ld_connections[file];
 //ld_connections.splice(file, 1);
 }
}

function getXmlHttp() {
 var xmlHttp;
 try { xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP"); }
 catch(e) {
  try { xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP"); }
  catch(e) { xmlHttp  = false; }
 }
 // xmlhttp-Klasse fuer sonstige Browser erstellen
 if (!xmlHttp  && typeof XMLHttpRequest != 'undefined')
 xmlHttp = new XMLHttpRequest();
 return xmlHttp;
}

function startload(load, dir) {
 if (document.getElementById('e_'+load) != null)
  document.getElementById('e_'+load).style.backgroundColor = "#D4A595";
 loaddiv('/start.php?load='+load+'&dir='+dir,'box_'+load, true);
}

function loadbox(load, dir, style) {
 if (document.getElementById('e_'+load) != null)
  document.getElementById('e_'+load).style.backgroundColor = "#D4A595";
 loaddiv('/start_boxes.php?load='+load+'&dir='+dir+'&style='+style,'box_'+load, true);
}

    function rd(a,b,c) {
     if (typeof(c) == 'undefined') {
      var c = a.href;
      setTimeout(function () {rd(a,b,c);}, 100);
      if (b == 0) b = "m0";
      else b = "00";
      c = "http://r.bierschinken.net/?"+b+c;
     }
     else a.onmousedown = function() {};
     a.href = c;
    }
