var rText = null;

YAHOO.util.Event.onDOMReady(init);

function init() {
	renderRichTextBox();
	//showSubmitMethod();
}

function showSubmitMethod() {
	var elm = el("method");
	if (elm.selectedIndex != 0) {
		if (elm.selectedIndex == 1)
			showFileUpload();
		else
			showRichTextBox();
	}
}

function showFileUpload() {
	rText.hide();
	YAHOO.util.Dom.addClass("submit-text","hidden");
	YAHOO.util.Dom.removeClass("submit-upload","hidden");
}
function showRichTextBox(){
	YAHOO.util.Dom.addClass("submit-upload","hidden");
	YAHOO.util.Dom.removeClass("submit-text","hidden");
	rText.show();
}

function renderRichTextBox() {
	rText = new YAHOO.widget.SimpleEditor("text", { 
		height: '300px',
		width: '645px',
		handleSubmit: true
	});
	rText.render();
}


function el(id) {
	return document.getElementById(id);
}
