/*Base64 fix - IE*/
function fixBase64(img) {
	var BASE64_DATA = /^data:.*;base64/i;
	// path to the PHP module that will decode the encoded data
	var base64Path = "base64.php";

	// stop the CSS expression from being endlessly evaluated
	img.runtimeStyle.behavior = "none";
	// apply the fix
	if (BASE64_DATA.test(img.src)) {
		img.src = base64Path + "?" + img.src.slice(5);
	}
};

/*Account Daten ändern*/
function change(n,m)
{
  var w=window.open("change.php?Username="+n+"&Mail="+m,
                    "Userdetails",
                    "height=250,width=400,location=no,menubar=no,status=yes,toolbar=no,scrollbars=no");   
  if (w.blur)
    {w.focus();}
}


/*Registrieren*/
function register()
{
  var w=window.open("register.php",
                    "Register",
                    "height=270,width=400,location=no,menubar=no,status=yes,toolbar=no,scrollbars=no");   
  if (w.blur)
    {w.focus();}
}

/*Tuch Anfrage*/
function pop_request(n, kind)
{
  var w=window.open("request.php?id=" + n + "&k=" + kind,
                    "Request",
                    "height=620,width=500,location=no,menubar=no,status=yes,toolbar=no,scrollbars=no");   
  if (w.blur)
    {w.focus();}
}


/*Ein-Ausblenden - Log-in Bereich*/

function display(){
if (document.getElementById)
{
	if (document.getElementById("form").style.display=="none")
	{
		document.getElementById("form").style.display="block";
		document.getElementById("login_menue").style.display="none";
	}
	else if (document.getElementById("form").style.display=="block")
	{
		document.getElementById("form").style.display="none";
		document.getElementById("login_menue").style.display="block";		
	}	
}
}


/*Navigationsmenüpunkte ein-ausblenden*/
function onoff (navino)
{
  if (document.getElementById)
  {
    if(document.getElementById(navino).style.display=="block")
    {
      document.getElementById(navino).style.display = "none";    
    }
    else if (document.getElementById(navino).style.display=="none")
    {
      document.getElementById(navino).style.display = "block";

    }
  }
}

/*Adminpunkte ein-ausblenden*/
function einaus (punkt)
{
  if (document.getElementById)
  {
    if(document.getElementById(punkt).style.display=="block")
    {
      document.getElementById(punkt).style.display = "none";    
    }
    else if (document.getElementById(punkt).style.display=="none")
    {
      document.getElementById(punkt).style.display = "block";

    }
  }
}

/*Tabellensortierung*/
function getXMLHttpRequest() {
	
	var httpReq = null;
	if (window.XMLHttpRequest) {
		httpReq = new XMLHttpRequest();
	} else if (typeof ActiveXObject != "undefined") {
		httpReq = new ActiveXObject("Microsoft.XMLHTTP");
	}	
	return httpReq;
}

function tabelle(get, tab) {
	req = getXMLHttpRequest();
	if (req) {

		req.onreadystatechange = "RE("+tab+")";
		req.open("get", "sortieren.php?attr="+get+"&div="+tab , true);
		req.send(null);
	}
}

function RE(art) {
	if (req.readyState == 4)
	{
		document.getElementById(art).innerHTML = req.responseText;
	}
}
