// globale Instanz von XMLHttpRequest
var xmlHttp = false;

// XMLHttpRequest-Instanz erstellen
// ... für Internet Explorer
try {
    xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
    try {
        xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        xmlHttp  = false;
    }
}
// ... für Mozilla, Opera und Safari
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}



function ShowHide(show,hide1) {
  if(document.getElementById)
  {
    document.getElementById(show).style.visibility = "visibility";
    document.getElementById(hide1).style.visibility = "hidden";
    
  }
}

function ShowHide(show,hide1,hide2) {
  if(document.getElementById)
  {
    document.getElementById(show).style.visibility = "visible";
    document.getElementById(hide1).style.visibility = "hidden";
    document.getElementById(hide2).style.visibility = "hidden";
    
  }
}


function loadPage(url)
{
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("CONTENT").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}


function loadCheck(url,element_id)
{
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById(element_id).innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function loadPageShow(url)
{ 
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("Show").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function loadPageShow2(url)
{
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("Show2").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function loadPageComments(url)
{
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("Comments").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function loadPageSubMenu(url)
{
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("SubMenu").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function editDataTV(url)
{
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("Show").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function searchData()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/Suche.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("Show").innerHTML = xmlHttp.responseText;
           }
       };
      xmlHttp.send('wert='+document.suche.wert.value);
  }
}

function searchDataPremiere()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/SuchePremiere.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("Show").innerHTML = xmlHttp.responseText;
           }
       };
      xmlHttp.send('wert='+document.suche.wert.value);
  }
}

function saveDataTV()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/input_tv.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("Show").innerHTML = xmlHttp.responseText;
           }
       };
      xmlHttp.send('Titel='+document.TVFormular.Titel.value+'&Tag='+document.TVFormular.Tag.value+'&Monat='+document.TVFormular.Monat.value+'&Jahr='+document.TVFormular.Jahr.value+'&Stunde='+document.TVFormular.Stunde.value+'&Minute='+document.TVFormular.Minute.value+'&Sender='+document.TVFormular.Sender.value+'&Cut='+document.TVFormular.Cut.value+'&Kennzeichnung='+document.TVFormular.Kennzeichnung.value+'&SB='+document.TVFormular.SB.value+'&OFDB='+document.TVFormular.OFDB.value+'&Inhalt='+document.TVFormular.Inhalt.value+'&Bemerkung='+document.TVFormular.Bemerkung.value+'&Kennzeichnung2='+document.TVFormular.Kennzeichnung2.value+'&Tag2='+document.TVFormular.Tag2.value+'&Monat2='+document.TVFormular.Monat2.value+'&Jahr2='+document.TVFormular.Jahr2.value+'&Stunde2='+document.TVFormular.Stunde2.value+'&Minute2='+document.TVFormular.Minute2.value+'&Wiederholung2='+document.TVFormular.Wiederholung2.value+'&Wiederholung='+document.TVFormular.Wiederholung.value);
  }
}

function updateDataTV()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/update_tv.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("Show").innerHTML = xmlHttp.responseText;
           }
       };
      xmlHttp.send('Titel='+document.TVFormular.Titel.value+'&Tag='+document.TVFormular.Tag.value+'&Monat='+document.TVFormular.Monat.value+'&Jahr='+document.TVFormular.Jahr.value+'&Stunde='+document.TVFormular.Stunde.value+'&Minute='+document.TVFormular.Minute.value+'&Sender='+document.TVFormular.Sender.value+'&Cut='+document.TVFormular.Cut.value+'&Kennzeichnung='+document.TVFormular.Kennzeichnung.value+'&SB='+document.TVFormular.SB.value+'&OFDB='+document.TVFormular.OFDB.value+'&Inhalt='+document.TVFormular.Inhalt.value+'&Bemerkung='+document.TVFormular.Bemerkung.value+'&Kennzeichnung2='+document.TVFormular.Kennzeichnung2.value+'&ID='+document.TVFormular.ID.value+'&Tag2='+document.TVFormular.Tag2.value+'&Monat2='+document.TVFormular.Monat2.value+'&Jahr2='+document.TVFormular.Jahr2.value+'&Stunde2='+document.TVFormular.Stunde2.value+'&Minute2='+document.TVFormular.Minute2.value+'&Wiederholung2='+document.TVFormular.Wiederholung2.value+'&Wiederholung='+document.TVFormular.Wiederholung.value);
  }
}


function saveDataTVPremiere()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/input_tv_premiere.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("Show").innerHTML = xmlHttp.responseText;
           }
       };
      xmlHttp.send('Titel='+document.TVFormular.Titel.value+'&Tag='+document.TVFormular.Tag.value+'&Monat='+document.TVFormular.Monat.value+'&Jahr='+document.TVFormular.Jahr.value+'&Stunde='+document.TVFormular.Stunde.value+'&Minute='+document.TVFormular.Minute.value+'&Sender='+document.TVFormular.Sender.value+'&Cut='+document.TVFormular.Cut.value+'&Kennzeichnung='+document.TVFormular.Kennzeichnung.value+'&SB='+document.TVFormular.SB.value+'&OFDB='+document.TVFormular.OFDB.value+'&Inhalt='+document.TVFormular.Inhalt.value+'&Bemerkung='+document.TVFormular.Bemerkung.value+'&Kennzeichnung2='+document.TVFormular.Kennzeichnung2.value+'&Weiter='+document.TVFormular.Weiter.value+'&Premiere='+document.TVFormular.Premiere.value);
  }
}

function updateDataTVPremiere()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/update_tv_premiere.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("Show").innerHTML = xmlHttp.responseText;
           }
       };
      xmlHttp.send('Titel='+document.TVFormular.Titel.value+'&Tag='+document.TVFormular.Tag.value+'&Monat='+document.TVFormular.Monat.value+'&Jahr='+document.TVFormular.Jahr.value+'&Stunde='+document.TVFormular.Stunde.value+'&Minute='+document.TVFormular.Minute.value+'&Sender='+document.TVFormular.Sender.value+'&Cut='+document.TVFormular.Cut.value+'&Kennzeichnung='+document.TVFormular.Kennzeichnung.value+'&SB='+document.TVFormular.SB.value+'&OFDB='+document.TVFormular.OFDB.value+'&Inhalt='+document.TVFormular.Inhalt.value+'&Bemerkung='+document.TVFormular.Bemerkung.value+'&Kennzeichnung2='+document.TVFormular.Kennzeichnung2.value+'&ID='+document.TVFormular.ID.value+'&Weiter='+document.TVFormular.Weiter.value+'&Premiere='+document.TVFormular.Premiere.value);
  }
}



function saveDataLink()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/input_link.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("Show").innerHTML = xmlHttp.responseText;
           }
       };
       
       
Name = document.LinkFormular.Name.value;
       
Angebot = "";    
if (document.LinkFormular.RC1.checked) { Angebot = ",RC1"; }
if (document.LinkFormular.RC2.checked) { Angebot = Angebot+",RC2"; }
if (document.LinkFormular.RC3.checked) { Angebot = Angebot+",RC3"; }
if (document.LinkFormular.RC4.checked) { Angebot = Angebot+",RC4"; }
if (document.LinkFormular.DT.checked) { Angebot = Angebot+",DT"; }
if (document.LinkFormular.US.checked) { Angebot = Angebot+",US"; }
if (document.LinkFormular.UK.checked) { Angebot = Angebot+",UK"; }
if (document.LinkFormular.HK.checked) { Angebot = Angebot+",HK"; }
if (document.LinkFormular.JP.checked) { Angebot = Angebot+",JP"; }
if (document.LinkFormular.TH.checked) { Angebot = Angebot+",TH"; }
if (document.LinkFormular.CN.checked) { Angebot = Angebot+",CN"; }
if (document.LinkFormular.SK.checked) { Angebot = Angebot+",SK"; }
if (document.LinkFormular.FR.checked) { Angebot = Angebot+",FR"; }
if (document.LinkFormular.SO.checked) { Angebot = Angebot+",SO"; }
if (document.LinkFormular.BE.checked) { Angebot = Angebot+",BE"; }
if (document.LinkFormular.IT.checked) { Angebot = Angebot+",IT"; }
if (document.LinkFormular.SN.checked) { Angebot = Angebot+",SN"; }
if (document.LinkFormular.AU.checked) { Angebot = Angebot+",AU"; }
if (document.LinkFormular.NL.checked) { Angebot = Angebot+",NL"; }

AngebotGames = "";
if (document.LinkFormular.PC.checked) { AngebotGames = ",PC"; }
if (document.LinkFormular.PS.checked) { AngebotGames = AngebotGames+",Playstation"; }
if (document.LinkFormular.XBOX.checked) { AngebotGames = AngebotGames+",XBox"; }
if (document.LinkFormular.Nintendo.checked) { AngebotGames = AngebotGames+",Nintendo"; }
if (document.LinkFormular.DT_G.checked) { AngebotGames = AngebotGames+",DT_G"; }
if (document.LinkFormular.US_G.checked) { AngebotGames = AngebotGames+",US_G"; }
if (document.LinkFormular.EU_G.checked) { AngebotGames = AngebotGames+",EU_G"; }
if (document.LinkFormular.SO_G.checked) { AngebotGames = AngebotGames+",SO_G"; }

Angebot18 = "";
if (document.LinkFormular.DT18.checked) { Angebot18 = Angebot18+",DT18"; }
if (document.LinkFormular.DTInd.checked) { Angebot18 = Angebot18+",DTInd"; }
if (document.LinkFormular.DTBe.checked) { Angebot18 = Angebot18+",DTBe"; }

Bezahlung= "";

if (document.LinkFormular.Uberweisung.checked) { Bezahlung = Bezahlung+",Überweisung"; }
if (document.LinkFormular.Lastschrift.checked) { Bezahlung = Bezahlung+",Lastschrift"; }
if (document.LinkFormular.Rechnung.checked) { Bezahlung = Bezahlung+",Rechnung"; }
if (document.LinkFormular.Nachnahme.checked) { Bezahlung = Bezahlung+",Nachnahme"; }
if (document.LinkFormular.Paypal.checked) { Bezahlung = Bezahlung+",Paypal"; }
if (document.LinkFormular.Kreditkarte.checked) { Bezahlung = Bezahlung+",Kreditkarte"; }

if (document.LinkFormular.Englisch.checked) { Englisch = 1; } else { Englisch = 0; }
if (document.LinkFormular.Deutsch.checked) { Deutsch = 1; } else { Deutsch = 0; }


     xmlHttp.send('Name='+Name+'&Link='+document.LinkFormular.Link.value+'&Banner='+document.LinkFormular.Banner.value+'&Standort='+document.LinkFormular.Standort.value+'&Standort2='+document.LinkFormular.Standort2.value+'&Angebot='+Angebot+'&Angebot18='+Angebot18+'&Bezahlung='+Bezahlung+'&Beschreibung='+document.LinkFormular.Beschreibung.value+'&Werbung='+document.LinkFormular.Werbung.value+'&Englisch='+Englisch+'&Deutsch='+Deutsch+'&AngebotGames='+AngebotGames);
  }
}

function updateDataLink()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/update_link.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("Show").innerHTML = xmlHttp.responseText;
           }
       };
       
Angebot = "";    
if (document.LinkFormular.RC1.checked) { Angebot = ",RC1"; }
if (document.LinkFormular.RC2.checked) { Angebot = Angebot+",RC2"; }
if (document.LinkFormular.RC3.checked) { Angebot = Angebot+",RC3"; }
if (document.LinkFormular.RC4.checked) { Angebot = Angebot+",RC4"; }
if (document.LinkFormular.DT.checked) { Angebot = Angebot+",DT"; }
if (document.LinkFormular.US.checked) { Angebot = Angebot+",US"; }
if (document.LinkFormular.UK.checked) { Angebot = Angebot+",UK"; }
if (document.LinkFormular.HK.checked) { Angebot = Angebot+",HK"; }
if (document.LinkFormular.JP.checked) { Angebot = Angebot+",JP"; }
if (document.LinkFormular.TH.checked) { Angebot = Angebot+",TH"; }
if (document.LinkFormular.CN.checked) { Angebot = Angebot+",CN"; }
if (document.LinkFormular.SK.checked) { Angebot = Angebot+",SK"; }
if (document.LinkFormular.FR.checked) { Angebot = Angebot+",FR"; }
if (document.LinkFormular.SO.checked) { Angebot = Angebot+",SO"; }
if (document.LinkFormular.BE.checked) { Angebot = Angebot+",BE"; }
if (document.LinkFormular.IT.checked) { Angebot = Angebot+",IT"; }
if (document.LinkFormular.SN.checked) { Angebot = Angebot+",SN"; }
if (document.LinkFormular.AU.checked) { Angebot = Angebot+",AU"; }
if (document.LinkFormular.NL.checked) { Angebot = Angebot+",NL"; }

AngebotGames = "";
if (document.LinkFormular.PC.checked) { AngebotGames = ",PC"; }
if (document.LinkFormular.PS.checked) { AngebotGames = AngebotGames+",Playstation"; }
if (document.LinkFormular.XBOX.checked) { AngebotGames = AngebotGames+",XBox"; }
if (document.LinkFormular.Nintendo.checked) { AngebotGames = AngebotGames+",Nintendo"; }
if (document.LinkFormular.DT_G.checked) { AngebotGames = AngebotGames+",DT_G"; }
if (document.LinkFormular.US_G.checked) { AngebotGames = AngebotGames+",US_G"; }
if (document.LinkFormular.EU_G.checked) { AngebotGames = AngebotGames+",EU_G"; }
if (document.LinkFormular.SO_G.checked) { AngebotGames = AngebotGames+",SO_G"; }

Angebot18 = "";
if (document.LinkFormular.DT18.checked) { Angebot18 = Angebot18+",DT18"; }
if (document.LinkFormular.DTInd.checked) { Angebot18 = Angebot18+",DTInd"; }
if (document.LinkFormular.DTBe.checked) { Angebot18 = Angebot18+",DTBe"; }

Bezahlung= "";

if (document.LinkFormular.Uberweisung.checked) { Bezahlung = Bezahlung+",Überweisung"; }
if (document.LinkFormular.Lastschrift.checked) { Bezahlung = Bezahlung+",Lastschrift"; }
if (document.LinkFormular.Rechnung.checked) { Bezahlung = Bezahlung+",Rechnung"; }
if (document.LinkFormular.Nachnahme.checked) { Bezahlung = Bezahlung+",Nachnahme"; }
if (document.LinkFormular.Paypal.checked) { Bezahlung = Bezahlung+",Paypal"; }
if (document.LinkFormular.Kreditkarte.checked) { Bezahlung = Bezahlung+",Kreditkarte"; }

if (document.LinkFormular.Englisch.checked) { Englisch = 1; } else { Englisch = 0; }
if (document.LinkFormular.Deutsch.checked) { Deutsch = 1; } else { Deutsch = 0; }


     xmlHttp.send('Name='+document.LinkFormular.Name.value+'&Link='+document.LinkFormular.Link.value+'&Banner='+document.LinkFormular.Banner.value+'&Standort='+document.LinkFormular.Standort.value+'&Standort2='+document.LinkFormular.Standort2.value+'&Angebot='+Angebot+'&Angebot18='+Angebot18+'&Bezahlung='+Bezahlung+'&Beschreibung='+document.LinkFormular.Beschreibung.value+'&Werbung='+document.LinkFormular.Werbung.value+'&Englisch='+Englisch+'&Deutsch='+Deutsch+'&ID='+document.LinkFormular.ID.value+'&AngebotGames='+AngebotGames);
  }
}


function checkPW()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/form_edit_comment2.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("CONTENT").innerHTML = xmlHttp.responseText;
           }
       };
      xmlHttp.send('KID='+document.CheckPassword.KID.value+'&Name='+document.CheckPassword.Name.value+'&Passwort='+document.CheckPassword.Passwort.value);
  }
}

function updateCom()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/form_edit_comment3.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("CONTENT").innerHTML = xmlHttp.responseText;
           }
       };
      xmlHttp.send('KID='+document.UpdateComment.KID.value+'&Kommentar='+document.UpdateComment.Kommentar.value);
  }
}

function updateCom2()
{
  if (xmlHttp) {
      xmlHttp.open('POST', 'includes/user_edit_comment2.php');
      xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      xmlHttp.onreadystatechange = function () {
           if (xmlHttp.readyState == 4) {
               document.getElementById("CONTENT").innerHTML = xmlHttp.responseText;
           }
       };
      xmlHttp.send('KID='+document.UpdateComment.KID.value+'&Kommentar='+document.UpdateComment.Kommentar.value);
  }
}




function na_preload_img()
    { 
      var img_list = na_preload_img.arguments;
      if (document.preloadlist == null) 
        document.preloadlist = new Array();
      var top = document.preloadlist.length;
      for (var i=0; i < img_list.length; i++) {
        document.preloadlist[top+i] = new Image;
        document.preloadlist[top+i].src = img_list[i+1];
      } 
    }
    
    function na_change_img_src(name, nsdoc, rpath, preload)
    { 
      var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
      if (name == '')
        return;
      if (img) {
        img.altsrc = img.src;
        img.src    = rpath;
      } 
    }
    
    function na_restore_img_src(name, nsdoc)
    {
      var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
      if (name == '')
        return;
      if (img && img.altsrc) {
        img.src    = img.altsrc;
        img.altsrc = null;
      } 
    }
    
    function Grund () {
      document.getElementByID("01").style.visibility = 'hidden';
    }


 
function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function Grund () {
  document.getElementByID("01").style.visibility = 'hidden';
}



