jQuery.fn.outerHTML = function(s){
	return (s) ? this.before(s).remove() : jQuery("&lt;p&gt;").append(this.eq(0).clone()).html();
}



$(document).ready(function(){
	$('#overlay .inner').click(closeOverlay);
});

function closeOverlay(){
	if(!$('#overlay').is(':animated')){
		$('#overlay').fadeOut(400, function(){
			$('#overlay *').not('.inner').remove();
		});
	}
}

function loadOverlay(){
	if(!$('#overlay').is(':animated')){
		$('#overlay').fadeIn(400);
		return true;
	}
	return false;
}
