var xmlHttp = createXmlHttpRequestObject();
var prev = "";

//--------------------------------------------------------------------//
function dfm(){

 var get_page = "http://blackmetal.hu/metal/dfm.php";

 if(xmlHttp){        
          
  xmlHttp.open("GET", get_page, true);                                                                                                        
  xmlHttp.onreadystatechange = getResponse;
  xmlHttp.send(null);

 }//if  

}//dfm
//--------------------------------------------------------------------//
function getResponse(){

 if(xmlHttp.readyState == 4){

  var resp = xmlHttp.responseText;

  if(resp != prev){

   var exp = resp.split("|");
   var txt = exp[0];
   var img = exp[1];

   document.getElementById("radiotxt").innerHTML = txt;

   if(img != "" && img != undefined)
    document.getElementById("radioimg").innerHTML = img;

   prev = resp;

  }//if

 }//if 

}//getResponse
//--------------------------------------------------------------------// 
function createXmlHttpRequestObject(){

  var xmlHttp;
  
  try{
    xmlHttp = new XMLHttpRequest();
  }
  catch(e){

    var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
                                    "MSXML2.XMLHTTP.5.0",
                                    "MSXML2.XMLHTTP.4.0",
                                    "MSXML2.XMLHTTP.3.0",
                                    "MSXML2.XMLHTTP",
                                    "Microsoft.XMLHTTP");

    for(var i=0; i<XmlHttpVersions.length && !xmlHttp; i++){

      try{ 
        xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
      } 
      catch(e){}
    
    }//for
  }//catch

  if(!xmlHttp){
   //alert("Error creating the XMLHttpRequest object.");
   return;
  }

  else{
   //alert("successfully created XMLHttp object");
   return xmlHttp;
  }

}//createXmlHttpRequestObject
//--------------------------------------------------------------------//

