function mcms_ajax_call(type,arr_replace,data,func,addiotional) {
  var xmlhttp = null;
  var url = "ajax.php";
  
  data = data.replace(/&amp;/g,"&");
  
  if(type=='GET' && data) { url = url+"?"+data; }
  if(!data) { data = null; }
  if(!func) { func = mcms_ajax_load; }


  try { xmlhttp=new XMLHttpRequest(); }
  catch (e) {
    try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); }
    catch(e) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
  }

  if(xmlhttp) {
    xmlhttp.onreadystatechange = function() {
      if((xmlhttp.readyState == 4)) {
        func(xmlhttp,arr_replace,addiotional);
      }
    }

    xmlhttp.open(type,url,true);
    if(type=='POST') { xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded;'); }
    xmlhttp.send(data);
  }
}


function mcms_ajax_load(httpReq,arr_replace,addiotional) {
  httpReq = httpReq.responseXML;

  if(arr_replace) {
    
    for(var i in arr_replace) {
      obj = document.getElementById(i);
      x = httpReq.getElementsByTagName(arr_replace[i])[0];

      if(x.childNodes.length>1 && typeof(x.textContent) != "undefined") { reqvalue = x.textContent; }
      else { reqvalue = x.childNodes[0].nodeValue; }  

      reqvalue = reqvalue.replace(/&lt;/g,"<");
      reqvalue = reqvalue.replace(/&gt;/g,">");
      reqvalue = reqvalue.replace(/x99/g,"&");

      reqvalue += addiotional;
      obj.innerHTML = reqvalue;
      
      obj.style.display = 'block';
    }
  
  }
}
