// here we define global variable
var ajaxdestination2="";

function getdata2(what,where) { // get data from source (what)

 try {
   xmlhttp2 = window.XMLHttpRequest?new XMLHttpRequest():
  		new ActiveXObject("Microsoft.XMLHTTP");
 }
 catch (e) { /* do nothing */ }

 document.getElementById(where).innerHTML ="<center><img src='/PF/loading.gif'></center>";
// we are defining the destination DIV id, must be stored in global variable (ajaxdestination)
 ajaxdestination2=where;
 xmlhttp2.onreadystatechange = triggered2; // when request finished, call the function to put result to destination DIV
 xmlhttp2.open("GET", what);
 xmlhttp2.send(null);
  return false;
}

function triggered2() { // put data returned by requested URL to selected DIV
  if (xmlhttp2.readyState == 4) if (xmlhttp2.status == 200) 
    document.getElementById(ajaxdestination2).innerHTML =xmlhttp2.responseText;
}



