function doSearch(boxid, val, subids, requestURL, sell) {
  for (id in subids) {
		if (document.getElementById('span'+subids[id])) {
			document.getElementById('span'+subids[id]).innerHTML = '&nbsp;&nbsp;<b>n\/a<\/b>';
	    document.getElementById('span'+subids[id]).style.display = 'none';
		}
	}
	ajaxSend(requestURL, boxid, val, sell);
}

function ajaxSend(requestURL, boxid, val, sell){
  function ajaxBindCallback() {
    if (ajaxRequest.readyState == 4) {
      if (ajaxRequest.status == 200) {
        if (ajaxCallback){
					var temp_array = ajaxRequest.responseText.split('||');
	        document.getElementById('span'+temp_array[0]).innerHTML = temp_array[1];
	        if (temp_array[1]!="n/a") document.getElementById('span'+temp_array[0]).style.display = 'inline';
	        else document.getElementById('span'+temp_array[0]).style.display = 'none';
        } 
      } 
    }
  }
  
  var ajaxRequest = null;
  var ajaxCallback = boxid;
  var callURL = srcPath + requestURL + "?boxid=" + boxid + "&value=" + val + sell;
  if (window.XMLHttpRequest) {
    ajaxRequest = new XMLHttpRequest();
    ajaxRequest.onreadystatechange = ajaxBindCallback;
    ajaxRequest.open("GET", callURL, true);
    ajaxRequest.send(null);
  } else if (window.ActiveXObject) {
    ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
    if (ajaxRequest) {
      ajaxRequest.onreadystatechange = ajaxBindCallback;
      ajaxRequest.open("GET", callURL, true);
      ajaxRequest.send();
    }
  }
}
