(function($){
// 1.2
	$.fn.extend({
		Llight_create: function(parametros) {
					var opciones=parametros;
					if(opciones==undefined){ var opciones={};}
					if(opciones.zIndex==undefined){
						opciones.zIndex=499;
					}
					if(opciones.entrada==undefined){
						opciones.entrada=600;
					}
					if(opciones.salida==undefined){
						opciones.salida=499;
					}
					if(opciones.opacidad==undefined){
						opciones.opacidad=0.6;
					}
					//Crea el Fondo
						objeto_ventana=$(this);
						tamanio_width='100%';
						if (typeof document.body.style.maxHeight === "undefined") { // es IE 6
								$("body","html").css({height: "100%",width: '100%'});	
								tamanio_width=$(window).width();
							}			
						tamanio_height=$(document).height();
						id_objeto_ventana=objeto_ventana.attr("id");
						overlay = $("<div id='modal-overlay' style='z-index:"+opciones.zIndex+"; padding:0; margin:0; border:none;'></div>").css({
							position: 'absolute',
							top: '0px',
							left: '0px',
							background: '#000',
							display: 'none',
							height: tamanio_height,
							width: tamanio_width
						}).attr("Llightattr",id_objeto_ventana);
							objeto_ventana.centrar_objeto();
							$(overlay.click(function(overlay){ $(objeto_ventana).Llight_destroy(opciones);})).appendTo(document.body);
							overlay.css("opacity", opciones.opacidad);
							overlay.fadeIn(opciones.entrada);
							$(objeto_ventana).css({display:"none", visibility:"visible"});
							objeto_ventana.fadeIn(opciones.entrada);
							objeto_ventana.Llight_resize();
					/*      Tecla ESC  ***********/
							$(document).keydown(function (e) {
							  if (e.which == 27) {
								$(objeto_ventana).Llight_destroy(opciones);
							  }
							});
					/*      Tecla ESC  **********/
						},
					//Funcion Cerrar y Centrar
					Llight_destroy: function(parametros){
					var opciones=parametros;
					if(opciones==undefined){ var opciones={};}
					if(opciones.zIndex==undefined){
						opciones.zIndex=499;
					}
					if(opciones.entrada==undefined){
						opciones.entrada=600;
					}
					if(opciones.salida==undefined){
						opciones.salida=499;
					}
					if(opciones.opacidad==undefined){
						opciones.opacidad=0.6;
					}
						objeto_cerrar=$(this);
						attr_light=$(overlay).attr("Llightattr");
						var remove = function() { $(overlay).remove(); };
						overlay.fadeOut(opciones.salida,remove);
						if(attr_light!=""){ objeto_cerrar=$("#"+attr_light); }
						
						objeto_cerrar.fadeOut(opciones.salida);
					},centrar_objeto: function(){ 
						var wnd = $(window), doc = $(document),	pTop = doc.scrollTop(), pLeft = doc.scrollLeft(), minTop = pTop;
						pLeft += parseInt((wnd.width() - $(this).width()) / 2); if(pLeft<0){ pLeft=0;  }
						pTop += parseInt((wnd.height() - $(this).height()) / 2); if(pTop<5){ pTop=5;  }
						$(this).css({top: pTop, left: pLeft}); 
					},Llight_resize: function(){
							objeto_ventana=$(this);
							tamanio_width='100%';
							if (typeof document.body.style.maxHeight === "undefined") { // es IE 6
									$("body","html").css({height: "100%",width: '100%'});	
									tamanio_width=$(window).width();
								}			
							tamanio_height=$(document).height();
							id_objeto_ventana=objeto_ventana.attr("id");
							
							$('#modal-overlay').css({
							height: tamanio_height,
							width: tamanio_width   });
					}
		});
	})(jQuery);
// Ejemplo:      $('#TU DIV ID').Llight_create();
// Ejemplo Full: $('#TU DIV ID').Llight_create({'zIndex':499,'entrada':600,'salida':499,'opacidad':0.6});