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";   
 }   
}
function addLikeBox(pageID) {
	var e = document.createElement('fb:like-box');
	e.setAttribute('width', '188');
	e.setAttribute('height', '100');
	e.setAttribute('profile_id', pageID);
	e.setAttribute('header', 'false');
	e.setAttribute('connections', '0');
	e.setAttribute('stream', 'false');
	document.getElementById('fb-likebox').appendChild(e); 
}
function addOGMetaField(name, content) {
	var e = document.createElement('meta');
	e.setAttribute("property", name);
	e.setAttribute("content", content);
	document.getElementsByTagName('head').item(0).appendChild(e); 
}
function addLikeButton(pageURL) {
	var e = document.createElement('fb:like');
	e.setAttribute('width', '450');
	e.setAttribute('height', '35');
	e.setAttribute('layout', 'standard');
	e.setAttribute('href', pageURL);
	e.setAttribute('show_faces', 'false');
	e.setAttribute('action', 'like');
	e.setAttribute('font', 'arial');
	e.setAttribute('colorscheme', 'light');
	e.setAttribute('action', 'like');
	document.getElementById('fb-likebutton').appendChild(e); 
}
function hideDiv(id) {
	document.getElementById(id).style.display = 'none';
}
function showDiv(id) {
	document.getElementById(id).style.display = 'block';
}
function submitForm(id) {
	document.forms[id].submit();
}
window.onload = externalLinks;
