CORE.emoticons = {};
CORE.emoticons.emoticonsPop = {};

CORE.emoticons.isPopulated = function(element) {
	
	if (CORE.emoticons.emoticonsPop[element] == undefined) {
		return false;
	} else {	
		return true;
	}
	
};

CORE.emoticons.addPopulated = function(element) {
	CORE.emoticons.emoticonsPop[element] = true;
};

CORE.emoticons.openBox = function(elink, ediv, field) {
	
	CORE.dhtml.overlay(elink, ediv, 'bottom');
	
	if (!CORE.emoticons.isPopulated(ediv)) {
		
		CORE.emoticons.addPopulated(ediv);
		
		$('#' + ediv).load(
		   	'/advice/emoticons/index.cfm?field=' + field + '&element=' + ediv
		);

	}
	
	return false;
	
};

CORE.emoticons.add = function(element, field, code) {

	$('#' + field).append("{:" + code + ":}");
	$('#' + element).hide();
	
	return false;
	
};
