var xmlHttp

function showStatus(str)
{
if (str.length==0)
  { 
  document.getElementById("formStatus").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }

var fullname = document.getElementById('fullname').value;
var tel = document.getElementById('tel').value;
var email = document.getElementById('email').value;
var comments = document.getElementById('comments').value;
var where = document.getElementById('where').value;
var more = document.getElementById('moredetail').value;
var querystring = "?fullname=" + fullname + "&tel=" + tel + "&email=" + email + "&comments=" + comments + "&where=" + where + "&more=" + more; 
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET","sendmail.asp" + querystring,true);
xmlHttp.send(null);
} 

function stateChanged() 
{
if (xmlHttp.readyState==1|2|3)
{ 
document.getElementById("formStatus").innerHTML="<p><center><img src='../images/loading.gif' width='32' height='32'><br />sending details ...</center></p>";
}
if (xmlHttp.readyState==4)
{ 
document.getElementById("formStatus").innerHTML="<h2 style='text-align:center;margin-top:12px;'>"+xmlHttp.responseText+"</h2>";
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
