function getNewHTTPObject()
{
        var xmlhttp;

        /** Special IE only code ... */
        /*@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 @*/

        /** Every other browser on the planet */
        if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
        {
            try
            {
                xmlhttp = new XMLHttpRequest();
            }
            catch (e)
            {
                xmlhttp = false;
            }
        }

        return xmlhttp;
}




var xmlHttp = getNewHTTPObject();

function add(id)
{
  var url = "http://zenithic.com/add.php?isbn=" + id;
  document.getElementById('X'+id).innerHTML = 'added';
//  alert(url);
  xmlHttp.open('GET', url, true);
  xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xmlHttp.send(null);
}

function remove(id)
{
  var url = "http://zenithic.com/remove.php?isbn=" + id;
var answer = confirm ("Are you sure you want to remove this book from your collection?")
  if (answer)
  {
   document.getElementById('X'+id).innerHTML = 'removed';
   xmlHttp.open('GET', url, true);
   xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
   xmlHttp.send(null);
  }
}
