function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
        xmlhttp = false;
        }
      }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
      } catch (e) {
      xmlhttp = false;
      }
    }
  return xmlhttp;
  }
var apendia_http = 0;
apendia_curent_do=0;
apendia_curent_wait=0;
apendia_array=new Array();
function apendia_in_queue(keyed)
	{
	if(keyed=='') return true;
	for(i=apendia_curent_do+1;i<apendia_curent_wait+1;i++)
		{
		if(apendia_array[i][3]==keyed) return false;
		}
	return true;
	}
apendia_http = getHTTPObject();
function apendia_ajax_get(url,function_name,params,keyed)
	{
	if(apendia_in_queue(keyed))
		{
		// alert(keyed);
		apendia_curent_wait++;
		apendia_array[apendia_curent_wait] = new Array;
		apendia_array[apendia_curent_wait][0]=url;
		apendia_array[apendia_curent_wait][1]=function_name;
		apendia_array[apendia_curent_wait][2]=params;
		apendia_array[apendia_curent_wait][3]=keyed;
		if(apendia_curent_do==apendia_curent_wait-1) apendia_launch();
		}
	}
function apendia_launch()
	{	
	cur=apendia_curent_do+1;
	// alert(apendia_array[cur][0]);
	apendia_http.open("GET", apendia_array[cur][0] ,true); 
	apendia_http.onreadystatechange = apendia_send;  
	apendia_http.send(null);			
	}

function apendia_alert(v,v2)
	{
	// this is just an exemple !
	alert(v);
	}

function apendia_send()
	{		
	if (apendia_http.readyState == 4) {
		if( apendia_http.responseText!='' )
			{
			apendia_curent_do++;
			eval(apendia_array[apendia_curent_do][1]+"(apendia_http.responseText,apendia_array[apendia_curent_do][2])");
			// still ajax in queue 
			if(apendia_curent_do<apendia_curent_wait) apendia_launch();
			// no more ajax in queue , reset
			if(apendia_curent_do==apendia_curent_wait) 
				{
				// reset when nothing to do
				apendia_curent_do=0;
				apendia_curent_wait=0;
				}
			}
		}			
	}
	
// this is just an exemple !