function getEquiv(cell, action, eq_class, first_oid, foid, fclass) {
  if(!http) {
    http = getRequestObject();
  }
  var uri = '/search/get-equiv?class=' + eq_class;
  var equiv_data = new Array();

  if(http) {
    http.open('GET', uri, true);
    http.setRequestHeader("Host", server_hostname);
    http.send(null);
    http.onreadystatechange = function() {
      if (http.readyState == 4) {
        if (http.status == 200) {
          var result = http.responseText;
          var lines = result.split("\n");

          // split the data into components, looks like this:
          // eq_offset:oid:hoid:escape(small_thumb):smallx:smally:escape(big_thumb):bigx:bigy:orient
          for(i = 0; i < lines.length; i++) {
            if(lines[i].length) {
              var elements = lines[i].split("*");
              if(elements.length > 1) {
                elements[3] = unescape(elements[3]);
                elements[6] = unescape(elements[6]);
                equiv_data[i] = elements;
              }
            }
          }

          // switch the original oid to index 0
          for(i = 1; i < equiv_data.length; i++) {
            if(equiv_data[i][1] == first_oid) {
              tmp = equiv_data[0];
              equiv_data[0] = equiv_data[i];
              equiv_data[i] = tmp;
            }
          }

          http = null;
          updateEquiv(cell, action, equiv_data, foid, fclass);
        }
      }
    } // http data callback
  }
}


function getRequestObject() {
  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) {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp=false;
    }
  }

  return xmlhttp;
}
