// here we define global variable
var ajaxdestination="";

																										    

function getdata(what,where) { // get data from source (what)
            try{
                xmlhttp=new XMLHttpRequest();
            }
            catch(e)    {
                    try{
                        xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
	                }
            catch(e){
                    try{
                        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
                    }
            catch(e1){
                    xmlhttp=false;
                }
	    }
    }
 document.getElementById(where).innerHTML ="<center><img src='/images/loading.gif'></center>";
// we are defining the destination DIV id, must be stored in global variable (ajaxdestination)
 ajaxdestination=where;
 xmlhttp.onreadystatechange = triggered; // when xmlhttpuest finished, call the function to put result to destination DIV
 xmlhttp.open("GET", what);
 xmlhttp.send(null);
  return false;
}

function triggered() { // put data returned by xmlhttpuested URL to selected DIV																										    
  if (xmlhttp.readyState == 4) if (xmlhttp.status == 200) 
    document.getElementById(ajaxdestination).innerHTML =xmlhttp.responseText;
}




