/*******************************************************************************
 ** @usage: Page handler with useful methods
 *******************************************************************************/
var PageHandler = function() {
 this.init.apply(this, arguments);
 this.openExternalInNewWindow();
}

PageHandler.prototype = {
	/*** Object constructor ***/
	init: function() {
	},

	/*** Open all links with attribute 'rel' set to 'external' in a new window (equivalent to target="_blank") ***/
	openExternalInNewWindow: function() {
	var links = document.getElementsByTagName('a');

	for (i=0; i<links.length; i++) {
	 if (links[i].getAttribute('rel') == 'external') {
		links[i].onclick = function() {
		 window.open(this.href);
		 return false;
		}
	 }
	}
 }
};


Event.observe(window, 'load', function(){
	var BCT = new PageHandler();
});