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