// JavaScript Document
function MM_findObj1(n, d)
{ //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length)
  {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


// threadsafe asynchronous XMLHTTPRequest code
function handleResponse(response) {
//var sepInd = response.indexOf('|', 0);
//if(sepInd != -1) {
//updateDiv = response.substring(0, sepInd);
//updateCont = response.substring(sepInd + 1);
//update = response.split('|');
//document.getElementById(updateDiv).innerHTML = updateCont;

document.getElementById("lineItems").innerHTML = response;
//alert(response);

//}
}


function ajaxSend(url, callback){
// we use a javascript feature here called "inner functions"
// using these means the local variables retain their values after the outer function
// has returned. this is useful for thread safety, so
// reassigning the onreadystatechange function doesn't stomp over earlier requests.


function ajaxBindCallback() {
if (ajaxRequest.readyState == 4) {
if (ajaxCallback) {
ajaxCallback(ajaxRequest.responseText);
} 
else {
alert('no callback defined');
}
} 
}


// use a local variable to hold our request and callback until the inner function is called...
var ajaxRequest = null;
var ajaxCallback = callback;



// bind our callback then hit the server...
if (window.XMLHttpRequest) {
// moz et al
ajaxRequest = new XMLHttpRequest();
ajaxRequest.onreadystatechange = ajaxBindCallback;
ajaxRequest.open("GET", url, true);
ajaxRequest.send(null);
} 
else 
if (window.ActiveXObject) {
// ie
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
if (ajaxRequest) {
ajaxRequest.onreadystatechange = ajaxBindCallback;
ajaxRequest.open("GET", url, true);
ajaxRequest.send();
}
}
}