function ajaxSendMail(fm){
    if (typeof XMLHttpRequest != "undefined") { this.http = new XMLHttpRequest(); } 
		else if (typeof ActiveXObject != "undefined") { this.http = new ActiveXObject("MSXML2.XmlHttp"); } 
		else {alert("No XMLHttpRequest object available. This functionality will not work.");return; }
		var oHttp=this.http;
    if (oHttp.readyState!=0)oHttp.abort();                   
		
		var sURL = "zjs/mail/mail.php";
    //open connection to states.txt file
		
		params="e="+fm.email.value+"&s="+fm.subject.value+"&m="+fm.msg.value;
		//alert(params);		
    oHttp.open("post", sURL , true);
		oHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		oHttp.setRequestHeader("Content-length", params.length);
		oHttp.setRequestHeader("Connection", "close");
		
	  //fm.email.value='';
		hidediv("divmailform")
		ge("divmailmsg").innerHTML='<table bgcolor=white style="border:2px solid #000000;" border=0 cellpadding=5 cellspacing=0 width=270 height=180><tr><td align=center><b><font color=000000>Sending Message...</b></td></tr></table>';
		showdiv("divmailmsg")

    oHttp.onreadystatechange = function () {
        if (oHttp.readyState == 4) {
            var retval = oHttp.responseText;						
						if(retval=="1"){
						 fm.email.value='';
						 fm.subject.value='';
						 fm.msg.value='';
						 ge("divmailmsg").innerHTML='<table bgcolor=white style="border:1px solid #000000;" border=0 cellpadding=5 cellspacing=0 width=270 height=180><tr><td align=center><b><font color=000000>You message has been sent.</font></b></td></tr></table>';
						 setTimeout('hidediv("divmailmsg");showdiv("divmailform");',3000);
						}
						else{
						 ge("divmailmsg").innerHTML='<table bgcolor=white style="border:1px solid #000000;" border=0 cellpadding=5 cellspacing=0 width=270 height=180><tr><td align=center><b><font color=880000>There was an error senting your message.</font></b></td></tr></table>';
						 setTimeout('hidediv("divmailmsg");showdiv("divmailform")',3000);
						}
        }    
    };
    oHttp.send(params);
}











