// AJAX LIVE CHAT
// 2008 (c) Ashus www.ashus.ashus.net


// ruzne prikazy v odpovedi AJAXu
window.prefix_chat_post = '<div class="chat_post">';
window.prefix_chat_present = '<present>';
window.prefix_chat_topic = '<topic>';
window.prefix_chat_clean = '<clean>';
window.prefix_chat_sound = '<sound>';
window.prefix_chat_lastloaded = '<lastloaded>';
window.prefix_chat_lastpresent = '<lastpresent>';
window.prefix_info = '<info>';

window.prefix_chat_post_L = window.prefix_chat_post.length;
window.prefix_chat_present_L = window.prefix_chat_present.length;
window.prefix_chat_topic_L = window.prefix_chat_topic.length;
window.prefix_chat_clean_L = window.prefix_chat_clean.length;
window.prefix_chat_sound_L = window.prefix_chat_sound.length;
window.prefix_chat_lastloaded_L = window.prefix_chat_lastloaded.length;
window.prefix_chat_lastpresent_L = window.prefix_chat_lastpresent.length;
window.prefix_info_L = window.prefix_info.length;


// interni vychozi hodnoty
window.selected_posts = new Array();
window.smileys_selected = 1;
window.soundsnp = new Array();
window.sound_own = 0;
window.present_loaded = false;
window.content_loaded = false;
window.chat_text_enabled = true;
window.max_items_count = 1;
window.max_items_pageratio = 0;
window.cclines = 0;
window.chat_last_loaded = 0;
window.chat_last_present = "";
window.content_updating = false;


function submitEnter(event)
	{
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;

	if (! window.chat_text_enabled)
		{return false;}
		
	if (keyCode == 13)
		{
		submitText();
		return false;
		}
	return true;
	}


function trim(str)
	{
	return str.replace(/^\s+|\s+$/g, '');
	}

