function SendToDevControl(oMsgTextarea, oMsgId, oMsgDiv, oMsgBtn, oMsgMail) 
{
    var msgTextarea = oMsgTextarea;
    var msgId = oMsgId.value;
    var msgDiv = oMsgDiv;
    var msgBtn = oMsgBtn;
    var msgMail = oMsgMail;
	var me = this;	 
    
    this.createXmlHttpRequest = function() 
    {
    	var xmlHttp = false;
    
    	try {
    	  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    	} catch (e) {
    	  try {
    	    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    	  } catch (e2) {
    	    xmlHttp = false;
    	  }
    	}
    	
    	if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
    	  xmlHttp = new XMLHttpRequest();
    	}    
    	    if (xmlHttp) 
    	        return xmlHttp;
    } 
    
    var xmlHttp = me.createXmlHttpRequest();   
    
	this.sendMsgToDev = function()
	{
		var value = msgTextarea.value;
		if(!value)
			alert("Ââåäèòå òåêñò æàëîáû");
		else
		{
			var o = 'msg='+encodeURIComponent(value)+'&id='+msgId+'&mail='+encodeURIComponent(msgMail.value);
			xmlHttp.open('POST', '/includes/msg_to_dev.php', true);
			xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			xmlHttp.send(o);
			xmlHttp.onreadystatechange = function (oEvent) {
		        if (!oEvent) {
		            oEvent = window.event;
		        }    
		        me.handleServerResponce(oEvent);
		    };
		    msgTextarea.disabled = true;
		}
	}
	
	this.handleServerResponce = function()
	{
		if (xmlHttp.readyState == 4)
			if (xmlHttp.status == 200)
			{
				msgTextarea.style.display = 'none';
				msgBtn.style.display = 'none';
				msgDiv.innerHTML = '<span class="g14" style="color: blue;">Âàøå ñîîáùåíèå îòïðàâëåíî</span>'			
			}
	}	
}
