var flashID;
var tArea, tInput;
function readyEXTI(id) {
	flashID = id;
	return true
}



// ------ //
dom.event.addEventListener(window, 'load', init);
function init() {
	tArea = document.getElementById('textarea');
	dom.event.addEventListener(tArea, 'focus', onTextAreaFocus);
	dom.event.addEventListener(document.getElementById('form'), 'submit', onSubmit);
}

function onTextAreaFocus() {
	tArea.blur();
}

function message(str) {
	tArea.value = tArea.value + str + "\n";
}


function onSubmit(evt) {
	dom.event.preventDefault(evt);
	if (flashID.length > 0) {
		var obj = getSWF(flashID);
		obj.message(document.getElementById("textinput").value);
	}
}

function getSWF(id) { 
    if (navigator.appName.indexOf("Microsoft") != -1) { 
        return window[id]; 
    } else { 
        return document[id]; 
    } 
}