function createXMLHttpRequest() {
    var xhr = null;
    // standards compliant browsers (Firefox, Safari, IE7, etc.)
    if (window.XMLHttpRequest) { 
        xhr = new XMLHttpRequest();
    } 
    else {
        // older versions of Internet Explorer
        if (window.ActiveXObject) {
            try {
                xhr = new ActiveXObject("Msxml2.XMLHTTP");
            } 
            catch (e) {
                try {
                    xhr = new ActiveXObject("Microsoft.XMLHTTP");
                } 
                catch (e) {
                    // give up, no XMLHttpRequest available
                }
            }
        }
    }
    return xhr;
}

function content(page) {
  var http = null;

  http = createXMLHttpRequest();

  try
  {
    http.open("GET", "page.php?page=" + page, true);
    http.onreadystatechange=function() {
      if(http.readyState == 4) {
        document.getElementById('content').innerHTML = http.responseText;
      }
    }
    http.send(null);
  }
  catch(err)
  {
    document.write("Error description: " + err.description + "\n\n");
  }
}

function Post_Form(form)
{
  var http = null;
  var data = "&author=" + form.author.value + "&comment=" + form.comment.value;
 
  http = createXMLHttpRequest();
  
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById('content').innerHTML = http.responseText;
    }
  }
  http.open("POST", "vk/writebook.php?act=sign", true);
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", data.length);
  http.setRequestHeader("Connection", "close");
  
  http.send(data);
}