var XmlHttpTitel = false;

if( window.XMLHttpRequest ) {
  XmlHttpTitel = new XMLHttpRequest();
  }
else if( window.ActiveXObject ) {
  XmlHttpTitel = new ActiveXObject( "Microsoft.XMLHTTP" );
  }

function AjaxTitel() {

  var Url = "/nl/subtitle.php?Random=" + Math.random();

  XmlHttpTitel.open( "GET", Url, true );
  XmlHttpTitel.onreadystatechange = function() {

    if( XmlHttpTitel.readyState == 4 ) {

      var XmlData  = XmlHttpTitel.responseXML;
      var Response = XmlData.documentElement;
       
      if( getNodeValue( Response, "status" ) == "Ok" ) {

        div = document.getElementById( "subtitle" );
        div.innerHTML = getNodeValue( Response, "subtitle" );

        }
      }
    }

  XmlHttpTitel.send( null );

  TitelTime = window.setTimeout( 'AjaxTitel()', 4000 );

  }

function getNodeValue( Obj, Tag ) {
  return Obj.getElementsByTagName(Tag)[0].firstChild.nodeValue;
  }

