pvBase = '/';

window.onload = function() {

	var fck_textareas = new Array (
	/* FAQ */ 'question', 'answer',
	/* Messages */ 'message',
	/* Polls */ 'comment',
	/* Reviews */ 'text', 'comments', 'description',
	/* Submit News */ /*'articletext', 'extendedtext',*/ 'storytext', 'bodytext',
	/* User block */ 'ublock',
	/* User details */ 'user_sig', 'bio',
	/* ADMIN */
	/* Add Story */ 'hometext', /*'bodytext',*/ 'notes',
	/* Admin Messages */ 'add_content', 'content',
	/* Banners */ 'extrainfo',
	/* Blocks */// 'content',
	/* Downloads */ 'cdescription', /*'description',*/ 'editorialtext', 'ratingcomments',
	/* Ephemerids */// 'content',
	/* Mailer */ 'mailer_body',
	/* Mail Users */// 'message',
	/* Quotes */ 'qquote',
	/* Sections */// 'content',
	/* Settings */ 'xfoot1',
	/* User */ 'chng_bio', 'xreg_noregreasons',
	/* Web links */// 'cdescription', 'description', 'editorialtext', 'ratingcomments'
	/* PostCalendar */'event_desc'
	);

	if (document.URL.search(/PNphpBB2/) == -1 && document.URL.search(/NS-MailUsers/) == -1) {
		for (i = 0; i < fck_textareas.length; i++) {

			if ((document.getElementById(fck_textareas[i]) && document.getElementById(fck_textareas[i]).tagName == 'TEXTAREA')
			|| (document.getElementsByName(fck_textareas[i])[0] && document.getElementsByName(fck_textareas[i])[0].tagName == 'TEXTAREA')) {
				var oFCKeditor = new FCKeditor(fck_textareas[i], 650, 250, 'pv');
				oFCKeditor.BasePath = pvBase + 'fckeditor/';
				oFCKeditor.Config['CustomConfigurationsPath'] = oFCKeditor.BasePath + 'pv_config.js';
				oFCKeditor.ReplaceTextarea();
			}
		}
	}

	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		var href = anchor.getAttribute("href")
		if (href) {
			/*if (href.search(/(Web_Links|Downloads).*req(=|-)(visit|getit)/) != -1) {*/
			if (href.search(/Web_Links.*req(=|-)visit/) != -1) {
				anchor.target = "_blank";
				title = anchor.title + ' (External Website)';
				anchor.title = title;
			}
		}
	}
}
