	function block_none(name){
	var obj=document.getElementById(name);
	obj.style.display=obj.style.display=='none'?'block':'none';
	}

	var xmlHttp = false;

	try {
	    xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
	    try {
 	       xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
	    } catch(e) {
	        xmlHttp  = false;
	    }
	}

	if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
	    xmlHttp = new XMLHttpRequest();
	}




	function loadComment(url,id)
	{
	 if (xmlHttp)
		{
	     document.getElementById('comments').innerHTML = '<br><center><img src="images/design/loadstream.gif"><br>Lade Kommentare</center><br>';
	     xmlHttp.open('GET', url, true);
	     xmlHttp.onreadystatechange = function ()
			{
 	     if (xmlHttp.readyState == 4)
		{
 	     document.getElementById(id).innerHTML = xmlHttp.responseText;
 	    	}
     			};
     	     xmlHttp.send(null);
 		}
	}


	function refreshZufall(url,id)
	{
	 if (xmlHttp)
		{
	     document.getElementById('zufallsbox').innerHTML = '<br><center><img src="images/design/loadstream.gif"><br>Lade Zuf&auml;llige Episoden</center><br>';
	     xmlHttp.open('GET', url, true);
	     xmlHttp.onreadystatechange = function ()
			{
 	     if (xmlHttp.readyState == 4)
		{
 	     document.getElementById(id).innerHTML = xmlHttp.responseText;
 	    	}
     			};
     	     xmlHttp.send(null);
 		}
	}

	function loadFilm(url,id)
	{
	 if (xmlHttp)
		{
	     document.getElementById('playerbox').innerHTML = '<br><center><img src="images/design/loadstream.gif"><br>Lade Stream</center><br>';
	     xmlHttp.open('GET', url, true);
	     xmlHttp.onreadystatechange = function ()
			{
 	     if (xmlHttp.readyState == 4)
		{
 	     document.getElementById(id).innerHTML = xmlHttp.responseText;
 	    	}
     			};
     	     xmlHttp.send(null);
 		}
	}



	function refreshSite(url,id)
	{
	 if (xmlHttp)
		{
	     document.getElementById('pageContent').innerHTML = '<div id="middle_middle_left"><div id="staffel_episode_right"><br><center><img src="images/design/loadstream.gif"><br>Lade Seite neu..</center><br></div><div id="staffel_episode_right2"></div></div>';
	     xmlHttp.open('GET', url, true);
	     xmlHttp.onreadystatechange = function ()
			{
 	     if (xmlHttp.readyState == 4)
		{
 	     document.getElementById(id).innerHTML = xmlHttp.responseText;
 	    	}
     			};
     	     xmlHttp.send(null);
 		}
	}



	function toggle(control)
	{
	var elem = document.getElementById(control);
	if(elem.style.display == "none")
	{
	elem.style.display = "block";
	}
	else
	{
	elem.style.display = "none";
	}
	}




function addComment()
{
if (xmlHttp) {

xmlHttp.open('POST', 'functions/add_comment.php');
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("comments").innerHTML = xmlHttp.responseText;
         }
     };
    xmlHttp.send('&number='+document.comment.number.value+'&subid='+document.comment.subid.value+'&nickname='+document.comment.nickname.value+'&text='+document.comment.text.value);
	     document.getElementById('comment').innerHTML = '<br><br><center><img src="images/design/loadstream.gif"><br>Trage Kommentar ein..</center>';
}
}

function register()
{
if (xmlHttp) {

xmlHttp.open('POST', 'functions/register.inc.php');
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("pageContent").innerHTML = xmlHttp.responseText;
         }
     };
    xmlHttp.send('&nickname='+document.register.nickname.value+'&password='+document.register.password.value+'&passwordtwo='+document.register.passwordtwo.value+'&email='+document.register.email.value+'&chatango='+document.register.chatango.value);
             document.getElementById("pageContent").innerHTML = xmlHttp.responseText;
}
}


function login()
{
if (xmlHttp) {

xmlHttp.open('POST', 'functions/login.inc.php');
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("pageContent").innerHTML = xmlHttp.responseText;
         }
     };
    xmlHttp.send('&nickname='+document.login.nickname.value+'&password='+document.login.password.value);
             document.getElementById("pageContent").innerHTML = xmlHttp.responseText;
}
}


function addTicket()
{
if (xmlHttp) {

xmlHttp.open('POST', 'episodenfinder/ticket.php');
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("divticket").innerHTML = xmlHttp.responseText;
         }
     };
    xmlHttp.send('&ticketid='+document.ticketform.ticketid.value+'&name='+document.ticketform.name.value+'&text='+document.ticketform.text.value+'&email='+document.ticketform.email.value+'&date='+document.ticketform.date.value);
	     document.getElementById('divticket').innerHTML = '<br><br><center><img src="images/design/loadstream.gif"><br>Bearbeite Ticket..</center>';

}
}

	function loadTicket(url,id)
	{
	 if (xmlHttp)
		{
	     document.getElementById('divticket').innerHTML = '<br><br><center><img src="images/design/loadstream.gif"><br>Lade Seite..</center>';
	     xmlHttp.open('GET', url, true);
	     xmlHttp.onreadystatechange = function ()
			{
 	     if (xmlHttp.readyState == 4)
		{
 	     document.getElementById(id).innerHTML = xmlHttp.responseText;
 	    	}
     			};
     	     xmlHttp.send(null);
 		}
	}