/*
--------------------
Amistr Website Code
--------------------
For use exclusively by Amistr.net.
--------------------
*/
var http = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
} 

function gather($CONTENT, $TARGET) {
  var token=Math.floor(Math.random()*1000000)
  
  http.open("GET", $CONTENT + "token=" + token, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      if ($TARGET == "cp") { document.getElementById('amistrcpanel').innerHTML = http.responseText; }
      if ($TARGET == "content") { document.getElementById('divContent').innerHTML = http.responseText; }
    }
  }
  
  http.send(null);
}

var http_request = false;

   function get(obj, $PAGE, $TYPE, $TARGET) {
      var getstr = "?";
      for (i=0; i<obj.childNodes.length; i++) {
         if (obj.childNodes[i].tagName == "INPUT") {
            if (obj.childNodes[i].type == "text") {
               getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
            }
            if (obj.childNodes[i].type == "password") {
               getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
            }
            if (obj.childNodes[i].type == "checkbox") {
               if (obj.childNodes[i].checked) {
                  getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
               } else {
                  getstr += obj.childNodes[i].name + "=&";
               }
            }
            if (obj.childNodes[i].type == "radio") {
               if (obj.childNodes[i].checked) {
                  getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
               }
            }
         }   
         if (obj.childNodes[i].tagName == "SELECT") {
            var sel = obj.childNodes[i];
            getstr += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";
         }
         getstr += $TYPE + "=1&";
      }
      gather($PAGE + getstr, $TARGET);
   }
   
// ReIMG Stuff
function reimg($STRING) {
}