function ajaxInit(url) {
	url += '?uniqueID=' + (new Date()).getTime();
	var req = (window.XMLHttpRequest) ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP");
	req.onreadystatechange = processRequest;
	
	function processRequest() {
		if (req.readyState == 4)
			if (req.status == 200) {
				//obj_div1.id = '';
				obj_div1.innerHTML = obj_div2.innerHTML;
				obj_div1.style.background = 'none';
				//obj_div1.style.visibility = 'hidden';
				//obj_div2.style.visibility = 'visible';
			}
	}
	
	this.sendPost = function(postStr) {
		req.open("POST", url, true);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		req.send(postStr);
	}
}

function sendData(msgtext,typeRes,toEmail) {
	var ai = new ajaxInit('/inc/send.php');

	var postStr = 'theme=' + encodeURI(typeRes) +"&toEmail="+encodeURI(toEmail) +"&msgtext="+encodeURI(msgtext);
	
	ai.sendPost(postStr);
}
