$("#new_portlet_content_form").html("<%= escape_javascript(render( :partial => "portlet/shared/new")) %>");

$("#new_portlet_content_form .text_editor").each(function() {


	auto_tiny_mce($(this));
	
});

var first_form_element = $("#new_portlet_content_form input:text:visible:first")
if(first_form_element.length == 0){
	first_form_element = $("#new_portlet_content_form .text_editor:first")

	//first_form_element.tinymce().focus();
}

if(first_form_element.length == 0){
	first_form_element = $("#new_portlet_content_form textarea:first")
}


first_form_element.focus();


