var xmlhttpSP;

// **********************************
// * saveProgress()
// **********************************

function saveProgress(strSessionID, strProduct, intRecCount, strSavename, strURL, strUserID)
{
  var strParams;
  var aryURL, strBaseURL;

  xmlhttpSP = GetxmlhttpSPObject();
  strParams = '<?xml version="1.0" encoding="utf-8"?>\n'
    + '<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n'
    + 'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '
    + 'xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">\n'
    + ' <soap12:Body>\n'
    + '  <saveProgress xmlns="http://www.referenceUSA.com/">\n'
    + '   <strSessionID>' + strSessionID + '</strSessionID>\n'
    + '   <strProductID>' + strProduct + '</strProductID>\n'
    + '   <intRecCount>' + intRecCount + '</intRecCount>\n'
    + '   <strSavename>' + strSavename + '</strSavename>\n'
    + '   <strUserID>' + strUserID + '</strUserID>\n'
    + '  </saveProgress>\n'
    + ' </soap12:Body>\n'
    + '</soap12:Envelope>\n';

  strParams = strParams.replace("&", "%26");
//alert("params=" + strParams);
  aryURL = window.location.href.split("/");
  strBaseURL = aryURL[0] + "//" + aryURL[2];
  xmlhttpSP.open("POST", strBaseURL + strURL, false);
  xmlhttpSP.setRequestHeader("Content-Type", "application/soap+xml; charset=utf-8");
  xmlhttpSP.send(strParams);
//alert("text=" + xmlhttpSP.responseText);

  return(xmlhttpSP.responseText);
}

// ******************************************
// * GetxmlhttpSPObject()
// ******************************************

function GetxmlhttpSPObject()
{
  try
  {
    // Firefox, Opera 8.0+, Safari
    xmlhttpSP = new xmlhttpSPRequest();
  }
  catch(e)
  {
      // Internet Explorer
    try
    {
      xmlhttpSP = new ActiveXObject("Msxml2.xmlhttp");
    }
    catch (e)
    {
      xmlhttpSP = new ActiveXObject("Microsoft.xmlhttp");
    }
  }
  return xmlhttpSP;
}
