SetSmileState = function(s, state) {
	var s = $(s);
	if (s == null) {
		return this;
	}
	else {
		s.style.display = state;
		return this;
	}
}
	
SetPosition = function(s, e) {
	var s = $(s);
	if (s == null) {
		return this;
	}
	else {
		var eX=XY(e, "X"), eY=XY(e,"Y");
		var sX = scrollXY("X"), sY = scrollXY("Y");
		if ((getClientWidth() - (eX - sX)) < 460) eX = eX - 460;
		if ((getClientHeight() - (eY - sY)) < s.clientHeight) eY = eY - s.clientHeight;
		s.style.top=eY+'px';
		s.style.left=eX+'px';
		return this;
	}
}
// - Добавить текст в textarea в конце набираемой строки для смайлов
function addtext_s(text,txtarea) {
	addtext(text,txtarea);
	SetSmileState('smilediv', 'none');
}
