$(document).ready( function() {

	$("textarea").focus( function() {
		if ( $("#textareaVi:checked").length > 0 ) {
			//editor( this );
			editor( $(this).get(0) );
		}
	});
	/*
	$("textarea").each( function() {
		var id = $(this).attr("id");
		//alert("id is " + id);
		$(this).before("<div class='editorToggle' forTextArea='" + id + "'>Vi</div>");
	});
	*/

	/*
	$(".editorToggle").click( function(e) {
		e.preventDefault();
		//alert("got me " + $(this).attr("forTextArea"));
		editor( document.getElementById( $(this).attr("forTextArea") ) );
	});
	*/

	/*
	$(".startViEditor").click( function(e) {
		e.preventDefault();
		editor( document.getElementById('id_text') );
		//$(".editor").addClass("editorFix");
		//$(".editor").css(
		//	{
		//		'position' : 'absolute',
		//		'margin-top' : '200px'
		//	}
		//);
	});
	*/
});

