window.onload=function(){
	httpObj = createXMLHttpRequest(displayData);
	if (httpObj) {
		httpObj.open('GET','top.php', true);// This is include file.
		httpObj.send(null);
	}
}
function displayData(){
	if ( httpObj.readyState == 4 ){
		var h='';
		switch( httpObj.status ){
			case 200:
			var dt = httpObj.responseText.split('\n');
			for(var i=0; i< dt.length ; i++){
				h+=dt[i];
			}
			break;
			case 403: H = 'The access was refused.'; break;
			case 404: H = 'There is no file.'; break;
		}
	document.getElementById('news').innerHTML=h;
	}
}
function createXMLHttpRequest(cbFunc) {
	var XMLhttpObject = null;
	try{ XMLhttpObject = new XMLHttpRequest();}
	catch(e){
		try{ XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");}
		catch(e){
			try{ XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");}
			catch(e){ return null;}
		}
	}
	if(XMLhttpObject)
		XMLhttpObject.onreadystatechange = cbFunc;
	return XMLhttpObject;
}
