// Generic XMLHttpRequest
function doX(url,params,target,method) {
  var method = method || "POST";
  var box = document.getElementById(target);
  if ( window.XMLHttpRequest ) {
    con = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    con = new ActiveXObject("Microsoft.XMLHTTP");
  }
  con.open(method,url,true);
  con.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');
  con.send(params);
  con.onreadystatechange = function() {
    if ( con.readyState == 4 && con.status == 200 ) {
      if ( box ) {
        box.innerHTML = con.responseText;
      }
      return con.responseText;
    } else if ( con.readyState == 4 ) {
      return "Error: "+con.status+" "+con.readyState;
    }
  }
}

/*window.addEvent('domready',function() {
  $$('#loginBtn img').addEvent('click', function() {
    var formBox = new Element('div',{ 'style': 'color: #f00; width 200px; position: absolute; bottom: 3px; right: 50px;' });
    formBox.innerHTML = '<input type="text" name="login" id="login" /> <input type="password" name="pass" id="password" />';
    formBox.injectTop($('loginBtn'));    
    $$('#loginBtn img').addEvent('click', function() {
      $('loginform').submit();
    });
  });
}); */
