$(window).bind('load', function(){ 

	overlayGroup('.ovr');
});


function overlayGroup(group) {
	$(group).each(function() {
		$(this).append(
			$("<div class='overlay'></div>").css({
				position: 'absolute',
				top: $(this).offset().top, 
				left: $(this).offset().left, 
				width: $(this).width(), 
				height: $(this).outerHeight(true)
			}).hide()
		);

		var url = $('a',this).attr('href');
		$(this).hover(function() {
			var fade = $('> .overlay', this);
			$(fade).show();
		}, function() {
			var fade = $('> .overlay', this);
			$(fade).hide();
		});
		if (url) $(this).click(function() {
		window.location = url;
		});
	});
}