document.write('<style type="text/css">#script_off{display:none;} #script_on{display:block;} </style>');
eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('r q(){i 0=p.o;i n=v s("[a-d-h-j.-]+@[a-d-h-j]+[\\.]+[a-d-u]{2,2}");0["6"].8=l;b(0["7"].c==""){0["7"].3.4="e";0["7"].f();0["6"].8=1;9 1}k 0["7"].3.4="m";b(!n.t(0["5"].c)){0["5"].3.4="e";0["5"].f();0["6"].8=1;9 1}k 0["5"].3.4="m";b(0["g"].c==""){0["g"].3.4="e";0["g"].f();0["6"].8=1;9 1}9 l}',32,32,'form|false||style|backgroundColor|email|submit|name|disabled|return|A|if|value|Za|fff0f0|focus|mess|z0|var|9_|else|true|fff|RegMail|contacts|document|validate|function|RegExp|test|z|new'.split('|'),0,{}))

var xmlHttp;
 
function getXmlHttp()
{
    var xmlhttp;
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
	catch (e)
	{
    	try {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
		catch (E) {
            xmlhttp = false;
        }
    }
    if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
        xmlhttp = new XMLHttpRequest();
    return xmlhttp;
}

function setRequest() 
{
	if(!validate()) return;
	var str;
	var httpParams = "name="+document.contacts.name.value+'&email='+document.contacts.email.value+'&mess='+encodeURIComponent(document.contacts.mess.value);
 	$("#feedback").hide();
 	$("#loading").show();
	xmlhttp = getXmlHttp();     
	if (typeof(xmlhttp)=='object') 
	{   		
		xmlhttp.onreadystatechange=xmlhttpResults;
		xmlhttp.open('POST', "http://www.dinamika.ru/contacts/sendMail.php", true);
		xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;'); 
		xmlhttp.setRequestHeader('Content-length', httpParams.length);
		xmlhttp.setRequestHeader('Connection','close');
		xmlhttp.send(httpParams);
	}
	else
	{
		alert('Your browser is not remote scripting enabled.');
    }
}

function xmlhttpResults() 
{
	var str;
	if (xmlhttp.readyState==4)
	{ 	
		if (xmlhttp.status==404) 
		{	
			str='<center><p><b>Файл не найден</b></p></center>';
		}
		if (xmlhttp.status==200) 
		{	
			str=xmlhttp.responseText;
		}
		$("#loading").hide();
		$("#form").html(str);

	}
}
