function createAjaxObj() {
  var httprequest=false
  if (window.XMLHttpRequest) {
    httprequest=new XMLHttpRequest()
    if (httprequest.overrideMimeType)
      httprequest.overrideMimeType('text/xml')
    }
  else if (window.ActiveXObject) {
         try {
           httprequest=new ActiveXObject("Msxml2.XMLHTTP");
           } 
        catch (e) {
          try {
            httprequest=new ActiveXObject("Microsoft.XMLHTTP");
            }
          catch (e) {}
          }
        }
    return httprequest
    }
  var ajaxpack=new Object()
  ajaxpack.basedomain="http://"+window.location.hostname
  ajaxpack.ajaxobj=createAjaxObj()
  ajaxpack.ajaxobj=createAjaxObj()
  var parameters=parameters+"&ajaxcachebust="+new Date().getTime()
  if (this.ajaxobj) {
    this.ajaxobj.onreadystatechange=callbackfunc
    this.ajaxobj.open('GET', url+"?"+parameters, true)
    this.ajaxobj.send(null)
    }
ajaxpack.postAjaxRequest=function(url, parameters, callbackfunc) {
  ajaxpack.ajaxobj=createAjaxObj()
  if (this.ajaxobj) {
    this.ajaxobj.onreadystatechange = callbackfunc;
    this.ajaxobj.open('POST', url, true);
    this.ajaxobj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    this.ajaxobj.setRequestHeader("Content-length", parameters.length);
    this.ajaxobj.setRequestHeader("Connection", "close");
    this.ajaxobj.send(parameters);
    }
  }
function processGetPost() {
  var myajax=ajaxpack.ajaxobj
  if (myajax.readyState == 4) {
    if (myajax.status==200 || window.location.href.indexOf("http")==-1) {
      if (parseInt(myajax.responseText)) { location.href='/wholesale/categories/'; } else { alert('Invalid login name or password'); }
      }
    }
  }
function processGetPass() {
  var myajax=ajaxpack.ajaxobj
  if (myajax.readyState == 4) {
    if (myajax.status==200 || window.location.href.indexOf("http")==-1) {
      if (parseInt(myajax.responseText)) { location.href='/wholesale/retrieval/'; } else { alert('Invalid login name or Email address'); }
      }
    }
  }
function getPostParameters() {
  var loginvalue=document.getElementById("login_form").login.value
  var passvalue=document.getElementById("login_form").password.value
  var poststr = "login=" + encodeURI(loginvalue) + "&pass=" + encodeURI(passvalue)
  return poststr
  }
function getPassParameters() {
  var loginvalue=document.getElementById("login_form").login.value
  var emailvalue=document.getElementById("login_form").email.value
  var poststr = "login=" + encodeURI(loginvalue) + "&email=" + encodeURI(emailvalue)
  return poststr
  }
