function apagar(){
	$('#banner').fadeOut('slow',function(){
		$('#banner').remove();
	});
}
		
$(function(){
	 var img = new Image();
	 var url = "www.edimicros.com";
	  // wrap our new image in jQuery, then:
	  $(img)
		// once the image has loaded, execute this code
		.load(function () {
			$.img = imagen;
			$.html = '<div id="banner" style="z-index:9999;">';
			$.html += '<div id="head">'
					+ '<div id="logo"><a href="/index.php"><img src="/temporales/edimicrosGrupo.jpg"></a></div>'
				   + '<a href="#" id="cerrarContenido">Cerrar Contenido</a></div>';
			$.html += '<div id="bannerGrande"><a href="'+url+'" target="_blank"><img src="'+$.img+'" /></a>'
			+		'</div>';
			
			$('body').append($.html);
			$('#banner').css({height:'100%',width:'100%', position:'absolute', top:0, left:0});
			var t=setTimeout("apagar()",5000);
			$('#cerrarContenido').live('click',function(){
				apagar();							
			});

		})
		
		// if there was an error loading the image, react accordingly
		.error(function () {
		  // notify the user that the image could not be loaded
		})
		.attr('src', imagen);

	
});
