window.onscroll = function () {
	
	document.getElementById('window').style.top = document.body.scrollTop+ (document.body.clientHeight-500)*0.5;
	//document.getElementById('body').style.top = document.body.scrollTop;
}
var xmlHttp=createXmlHttpRequest();
var IE = 'true';
var par1 = new Array;
if(-[1,]){
  IE = 'false';
}
function encode_utf8( s )
{
  return unescape( encodeURIComponent( s ) );
}

function get_id(id) {
return document.getElementById(id);
}
function createXmlHttpRequest() {
  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 getRequestBody(oForm) { 
        var sParam = '';
        for(var i = 0; i < oForm.elements.length; i++) {
          sParam += encodeURIComponent(oForm.elements[i].name);
          sParam += "=";
          sParam += encodeURIComponent(oForm.elements[i].value);
		  sParam += "&";
        }
        return sParam;
    }
 function sendRequest() {
	par1 = new Array;
    var oForm = document.submit_form;
    var sBody = getRequestBody(oForm)+'ie='+IE;
    xmlHttp.open("POST","http://www.londondom.com/send.htm", true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	xmlHttp.setRequestHeader("Content-length", sBody.length);
	xmlHttp.setRequestHeader("Connection", "close"); 
    xmlHttp.onreadystatechange = ok;
	xmlHttp.send(sBody);
 }
function ok() {
	if(xmlHttp.readyState==4){ 
		if(xmlHttp.status==200 ) {
			var xmlResponse=xmlHttp.responseText;
			document.location.href="http://www.londondom.com/ok.htm";
			//alert(xmlResponse);
		}
	}
	/*
	else
		alert('Ошибка при обращении к серверу. Попробуйте ещё раз.')+xmlHttp.statusText;
	*/
}
