function include(filename, defer) {
	var js = document.createElement('script');
	js.setAttribute('type', 'text/javascript');
	js.setAttribute('src', filename);
	if (defer)
		js.setAttribute('defer', 'defer');
	document.getElementsByTagName('HEAD')[0].appendChild(js);
};

function sleep(delay) {
	var start = new Date().getTime();
	while (new Date().getTime() < start + delay);
};

function prepEditors() {
	$("textarea").each(function (i) {
		this.value = this.value.replace(/<\[/g, "<").replace(/\]>/g, ">");
	});
	$(".richtext").wymeditor({
			updateSelector:	'input[type=submit]',
			stylesheet:		'/themes/pitt/style/wymeditor.css',
			skin:			'compact',
			postInit: 		function(wym) {
							wym.hovertools();          //activate hovertools plugin
							wym.resizable();           //activate resizable plugin
							wym.fullscreen();           //activate fullscreen plugin
							jQuery(wym._box).find(wym._options.iframeSelector).css('height', '400px');

						}
        });
};
