function externalLinks() {
	if (!document.getElementsByTagName)
		return;
	var anchors = document.getElementsByTagName("a");

	for ( var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
			anchor.target = "_blank";
	}
}
window.onload = externalLinks;

function gotoCushion(title, url, path) {
	var encodetitle = encodeURIComponent(title);
	var encodeUrl = encodeURIComponent(url);
	window.open(path + 'external_link.html?title=' + encodetitle + '&url=' + encodeUrl);
}

function gotoPersonalCushion(title, url) {
	gotoCushion(title, url, '/');
}

function gotoCorpCushion(title, url) {
	gotoCushion(title, url, '/corp/');
}

function gotoIrCushion(title, url) {
	gotoCushion(title, url, '/ir/');
}

