var $ = function(n) {
	if (document.getElementById) return document.getElementById(n);
	return;
}
var Blog = {
	loaded: false,
	Mail: function() {
		var email_address = 'a'+'l'+'e'+'d'+'&'+'#'+'6'+'4'+';'+'s'+'m'+'o'+'t'+'y'+'n'+'.'+'c'+'o'+'m';
		$("email-link").innerHTML = '<a href="mailto:'+ email_address +'" title="E-mail me">Drop me a line</a>.';
	},
	Links: function() {
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++) {
			var a = anchors[i];
			if (a.getAttribute("href") && (a.getAttribute("rel") || a.getAttribute("class"))) {
				var p;
				if (a.getAttribute("rel")) {
					p = a.getAttribute("rel");
					if (p.indexOf("external") != -1) {
						a.target = '_blank';
						if (a.title) a.title += ' ';
						a.title += '(opens in a new window)';
					}
				} else {
					p = a.getAttribute("class");
					if (p.indexOf("external") != -1) {
						a.target = '_blank';
						if (a.title) a.title += ' ';
						a.title += '(opens in a new window)';
					}
				}
			}
		}
	},
	Bar: {
		show_bar: function() {
			$("view_blogbar").style.display = "none";
			$("navbar-iframe").style.top = "0px";
		},
		show_link: function() {
			$('footer').innerHTML = 'The design, programming and content of this blog is licensed under a <a href="http://creativecommons.org/licenses/by-nc-nd/2.5/" class="external" title="View the Creative Commons License (in a new window)">Creative Commons License</a>. Check out <a href="http://www.gvisit.com/map.php?sid=ea62da0e4abf5870a631674d7f733985" class="external">gVisit</a>. <a href="" onclick="Blog.Bar.show_bar();return false;" id="view_blogbar"><span class="hidden">View Blogger Bar</a>';
		}
	},
	Load: function() {
		if (!Blog.loaded) {
			Blog.Mail();
			Blog.Links();
			Blog.Bar.show_link();
			Blog.loaded = true;
		}
	}
};
window.onload = function() {
	Blog.Load();
}