$(document).ready(function() {

	/*****
	 * If you add a "bubble" class to an <a> - this will look for the nearest <li> which can then be used for clicking too.
	 ****/

	$('a.bubble').click(function(event) {
		event.stopPropagation();		
	}).each(function() {
		var $this = $(this);
		$this.closest('li').click(function() {
			document.location = $this.attr('href');	
			return false;
		});
	});
	
	$('a.block').click(function(event) {
		event.stopPropagation();		
	}).each(function() {
		var $this = $(this);
		$this.closest('article').click(function() {
			window.open($this.attr('href'));
			return false;
		}).addClass('block-link');
	});
	
	/*****
	 * Any link starting with "http://" in the [href] attribute will be opened in a new window.
	 ****/
	 	 
	 $("a[href^='http']").click(function() {
	 	window.open($(this).attr('href'));
	 	return false;
	 });
	
});
