var xmlHttpEmoticon = null;

function open_emoticon()
{
	var obj;

	obj = document.getElementById('emoticon');

	obj.style.left = g_x - 200;
	obj.style.top = g_y - 222;

	if (obj.innerHTML != " ")
	{
		xmlHttpEmoticon = GetXmlHttpObject();
		if (xmlHttpEmoticon == null) return;

		var url = URL + "/ajax/open_emoticon.php";
		xmlHttpEmoticon.onreadystatechange = on_open_emoticon;
		xmlHttpEmoticon.open("GET", url, true);
		xmlHttpEmoticon.send(null);
	}

	if (obj.style.visibility == "hidden")
	{
		obj.style.visibility = "visible";
		obj.style.height = "204px";
	}
	else
	{
		obj.style.visibility = "hidden";
	}
}

function on_open_emoticon()
{
	if (xmlHttpEmoticon == null) return;
	if (xmlHttpEmoticon.readyState == 4 || xmlHttpEmoticon.readyState == "complete")
	{
		var obj = document.getElementById('emoticon');
		obj.innerHTML = xmlHttpEmoticon.responseText;
	}
}

