function xmlhttpPost(strURL, idx, p) 
{
	var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText, idx, p);
        }
    }
    self.xmlHttpReq.send(getquerystring(idx, p));
}
function getquerystring(idx, p) 
{
	if(idx=="call")
	{
		var obj_zoom = document.getElementById('call_td');
		obj_zoom.className='tdalpha';

		var x1 = document.getElementById('call_name').value;
		var x2 = document.getElementById('call_phone').value;
		var x3 = document.getElementById('call_time').value;
		
		if ((x1.length < 3))
		{
			alert('Неправильная имя');
			return false;
		}
		else if (!x2.match( /^\(\d{3}\) \d{3}-\d{4}$/ ))
		{
			alert('Неправильный номер телефона');
			return ;
		}
		qstr = 'x1=' + escape(x1) + '&x2=' + escape(x2) + '&x3=' + escape(x3);
		alert(qstr);
	}

	return qstr;
}
function updatepage(str, idx, p)
{
	if(idx == "call")
	{
		if(str != 'err')
			document.getElementById('callupd_td').innerHTML=str;

		var obj_zoom = document.getElementById('call_td');
		obj_zoom.className='tdnonalpha';
	}
}
function checkForm()
{
	/*x2 = document.getElementById('call_phone').value;
	if (!x2.match( /^\(\d{3}\) \d{3}-\d{4}$/ ))
	{
		alert('Неправильный номер телефона');
		return false;
	}
	else */
	document.call.submit();
}