function mailRequest(strURL)
{ 
	var xmlHttp; 
	if(window.XMLHttpRequest)
	{ // For Mozilla, Safari...
		var xmlHttp = new XMLHttpRequest(); 
	} 
	else if(window.ActiveXObject)
	{ //for IE
		var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
	} 
	xmlHttp.open("POST",strURL,true); 
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	xmlHttp.onreadystatechange = function()
	{ 
		if (xmlHttp.readyState == 4)
		{ 
			document.getElementById("send_state").innerHTML="";  
			if(xmlHttp.responseText=='')
			{
				document.getElementById("send_state").innerHTML='send email failed!';
			}
			else
			{
				document.getElementById("title").value='';
				document.getElementById("word").value='';
				document.getElementById("send_state").innerHTML='Your comment has been published.'; 
				
			}
		} 
	} 
	xmlHttp.send(strURL); 
} 
function sendmail()
{
	var title=window.document.fm2.title.value; 
	var word=window.document.fm2.word.value;
	if(title=='' ||  word=='')
	{
		document.getElementById("send_state").innerHTML="<font color=red>please enter mail's title and message!</font>";
	}
	else
	{
		document.getElementById("send_state").innerHTML="send mail............";  
		var url="sendmaildata.php?title="+title+"&word="+word;	
		mailRequest(url); 
	}

}
