$(document).ready(function() {
 
	//hovers
	$(".hvr").mouseover(function(e) {
		$(this).addClass('hover');
	}).mouseout(function(e) {
		$(this).removeClass('hover');
	}).mousedown(function(e) {
		var a = $(this).find("a");
		var firstA = a[0];
		// fix for not breaking lightbox behaviour
		var isLightbox = ($(firstA).attr('rel').indexOf('shadowbox') > -1);
		if (isLightbox)
		$(firstA).click();
		else
		document.location.href = firstA.href;
	});
	

	// rel external
	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";   
	}
});

