function Hide(id) {
	document.getElementById(id).style.display = 'none';
}
function Show(id) {
	document.getElementById(id).style.display = 'block';
}
function HideShow(id) {
	if(document.getElementById(id).style.display == 'block') {
		Hide(id);
	} else {
		Show(id);
	}
}

function ReadShoutbox() {
	
	var xmlHttp=GetXmlHttpObject();	
	var cycle, shoutbox = document.getElementById("shoutbox");
	var url="ajax/shoutbox.php";
	
	cycle = setInterval(function(){
		xmlHttp.onreadystatechange=function tmp(){
			if (xmlHttp.readyState==4){ 
				shoutbox.innerHTML=xmlHttp.responseText;
			}
		};
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	},1000); 
}

window.onload = function(){
	ReadShoutbox();
}
   
function Shout() {
		
	xmlHttp=GetXmlHttpObject();
		
		var text;
		text = document.getElementById("inpshout").value;
		
		if(text == '') {
			return 0;
		}
		
		document.getElementById("inpshout").value = '';
		
	var url="ajax/shoutbox.php";
		url=url+"?text="+text;
		xmlHttp.onreadystatechange=function tmp(){
			if (xmlHttp.readyState==4){ 
			document.getElementById("shoutbox").innerHTML=xmlHttp.responseText;
 		}
	};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}