function e(id) {
	return document.getElementById(id);
}

function myVoid() {}

function postInChat() {
	if (e('text').value != '') {
		var arg = new Object();
		arg.text = e('text').value;
		openGet("postInChat","chatViewer",arg);
	} else {
		alert("please write text");
	}
}

function blocker () {
	if (e('blocker').style.display == 'none') {
		e('blocker').style.display = 'block';
		e('url_login').style.display = 'none';
	}
}

function chatViewer() {
	openGet("viewChat","chatViewerCallback");
}

function chatViewerCallback(data) {
	e('chatbox').scrollTop = 0;
	var html = "";
	for (var i=0;i<data.chat.length;i++) {
		html += "<table border=0 width=100%>";
		html += "<tr>"+
			"<td width='140'><b style='color:blue'>"+data.chat[i].name+"</b></td>"+
			"<td align=left><font size=1>"+data.chat[i].date+"</font></td>"+
		"</tr>";
		
		html += "<tr>"+
			"<td colspan=3 style='font-size:12'>"+data.chat[i].text+"</td>"+
			"</tr>";
		html += "</table>";
		html += "<hr>";
	}
	if (e('text')) {
		e('text').value = '';
	}
	e('chatbox').innerHTML = html;
}

function scroll() {
	e('chatbox').scrollTop = 0;
}