var xhrobj;
var divid;

function ajax_request(actionid) {
  if(navigator.appName == "Microsoft Internet Explorer") {
    xhrobj = new ActiveXObject("Microsoft.XMLHTTP");
  } else {
    xhrobj = new XMLHttpRequest();
  }
  xhrobj.open('get', 'getcode?actionid='+actionid);
  xhrobj.onreadystatechange = ajax_response;  
  xhrobj.send(null);
  divid = actionid;
}

function ajax_response(e) {  
  if(xhrobj.readyState == 4) {
    document.getElementById('code'+divid).innerHTML = xhrobj.responseText; 
  }
}

