var _editor_url='/htmlarea/';
var prevonload=new String(window.onload);
var baseurl;

document.write('<script type="text/javascript" src="'+_editor_url+'htmlarea.js"></script>');
document.write('<script type="text/javascript" src="'+_editor_url+'lang/en.js"></script>');
document.write('<script type="text/javascript" src="'+_editor_url+'dialog.js"></script>');
document.write('<script type="text/javascript" src="'+_editor_url+'popupwin.js"></script>');
document.write('<script type="text/javascript" src="'+_editor_url+'plugins/TableOperations/table-operations.js"></script>');
document.write('<script type="text/javascript" src="'+_editor_url+'plugins/TableOperations/lang/en.js"></script>');
document.write('<script type="text/javascript" src="'+_editor_url+'plugins/SpellChecker/spell-checker.js"></script>');
document.write('<script type="text/javascript" src="'+_editor_url+'plugins/SpellChecker/lang/en.js"></script>');
document.write('<style type="text/css">@import url('+ _editor_url+'htmlarea.css)</style>');

htmlareainit = function (){
	var i=0;
	var ed;
	var id;
	var tas=document.getElementsByTagName("textarea");
	var loc=new String(document.location);
	var pos=loc.indexOf('/',8);
	baseurl=loc.substring(0,pos);
	for (i=0;i<tas.length;i++){
		id=new String(tas[i].id);
		if (id.substring(0,6)=='htmled'){
	  		ed=new HTMLArea(tas[i]);
			ed.registerPlugin("TableOperations");
  			ed.registerPlugin("SpellChecker");
  			ed.generate();
		}
	}
};

window.onload = htmlareainit;