function checkHeight()
{
	if (document.getElementById('content').offsetHeight > 439)
	{
		var pieces = parseInt(document.getElementById('content').offsetHeight) - 439;
		pieces = pieces/121;
		
		document.getElementById('layout').innerHTML ="<div class='top'></div><div class='middle'></div><div class='middle'></div>";
		for (var loop = 0; loop <= pieces; loop++)
		{
			document.getElementById('layout').innerHTML += "<div class='middle'></div>";
		}
		document.getElementById('layout').innerHTML += "<div class='bottom'></div>";
	}
}

function getNewHTTPObject()
{

if (window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
       else
        {
         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }

        return xmlhttp;
}


function getNews()
{
var xmlHttp = getNewHTTPObject();
  var url = "news.php";
  xmlHttp.open('POST', url, true);
  xmlHttp.onreadystatechange = function() {callbackFunction(xmlHttp);};
  xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  xmlHttp.send();
}

function callbackFunction(xmlHttp)
{
  if (xmlHttp.readyState != 4)
    return;
    
    var result = xmlHttp.responseText;
    document.getElementById('newsDiv').innerHTML=result;
    checkHeight();
}