<!--
function sendAuthNetTran() {
//
//   initialize output area and collect up all <input> tags
//
//alert("Preparing to call auth_net.php");
    $("output_div").innerHTML = "";
    var allInput = $$("input","select","textarea");
    var postData = "";
//
//     generalized routine loops through all input fields
//     getting the name and value and creates a string
//     for the "POST" request to send to PHP function
//
//     only do this if the <input> tag has a name attribute
//     this is checked to avoid sending things like the "submit" button
//     which is also an <input> tag
//
//     after the first name/value pair is constructed, put "&" between
//     each value as required in "POST" data format
//
    for (var i=0;i<allInput.length;i++) {
        if (allInput[i].name !== "") {
            if (i > 0) {
                postData += "&";
            }
            postData += allInput[i].name + "=" + allInput[i].value;
        }
    }
//
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }//
//     set up event handler for when asynchronous request completes
//     successfully to output results to screen element with ID of
//     "output"
//
    xmlhttp.onreadystatechange=function()
      {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
//            alert("Got response back");
        $("output").innerHTML=xmlhttp.responseText;
        }
      }
//
//      set up to send data to PHP fucntion using "POST" method
//
    xmlhttp.open("POST","/aos/cart/php/auth_net.php",true);
    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
//    alert("sending data to auth.net = " + postData);
    xmlhttp.send(postData);
//    alert("Called auth_net.php");
}

//-->

