function sendEmailReady()
{
  if ((objHTTP.readyState == 4) || (objHTTP.readyState == 'complete')) {
    var vUrl = objHTTP.responseText;
    if (objHTTP.status != 200)
      alert(vUrl);
    else if (vUrl.substr(0,7)!='mailto:')
      alert(vUrl);
    else
      window.location.href = vUrl;
  }
}

function sendEmail(aEmail,aSubject)
{
  objHTTP = null; // Asynchronous Ajax requires a new connection
  objHTTP = GetHttpObject();
  if (objHTTP == null)
    return;
  var vPost = "email="+aEmail+"&subject="+aSubject;
  objHTTP.onreadystatechange = sendEmailReady; //Call a function when the state changes.
  objHTTP.open("POST",jul_baseurl+"ajax/email.php",true);
  //Send the proper header information along with the request
  objHTTP.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  objHTTP.setRequestHeader("Content-length", vPost.length);
  objHTTP.setRequestHeader("Connection", "close");
  objHTTP.send(vPost);
  return;
}



