// JavaScript Document
function AJAXReq(method,url,bool){
  if(window.XMLHttpRequest){
    myReq = new XMLHttpRequest();
  } else
 
  if(window.ActiveXObject){
    myReq = new ActiveXObject("Microsoft.XMLHTTP");
   
    if(!myReq){
      myReq = new ActiveXObject("Msxml2.XMLHTTP");
    }
  }
 
  if(myReq){
    execfunc(method,url,bool);
  }else{
    alert("Impossibilitati ad usare AJAX");
  }
}

function execfunc(method,url,bool){
  myReq.onreadystatechange = handleResponse;
  myReq.open(method,url,bool);
  myReq.send(null);
}

function handleResponse(){
  if(myReq.readyState == 4){
    if(myReq.status == 200){
      target = document.getElementById('player');
      target.innerHTML = myReq.responseText;
    }else{
      alert("AJAX Error..");
    }
  }
}
