		var _width;
		var _height;
		function setStyle(_width, _height){
		    $('.lightBox').attr('style', 'width:' + _width.toString() + 'px;height: ' + _height.toString() + 'px; background-color: black; filter: alpha(opacity=50);opacity: 0.5; -moz-opacity:0.5; position:absolute;');
		};
		
		
		function getOrigin(){
		
		    var obj = new Object();
		    obj.left = 30;
		    obj.top = 30;
		    return obj;
		}
		
		function lightBox(srcNodeValue){
		
		    var img = new Image();
		    
		    img.src = srcNodeValue;
		    
		    _width = img.width;
		    _height = img.height;
		    
		    $('body').append('<div class="lightBox"/>');
		    
		    
		    $(window).resize(function(){
		        setStyle($(document).width(), $(document).height());
		        
		    });
		    $('body').append($(img).attr('class', 'lightBoxImage'));
		    var origin = getOrigin();
		    $('.lightBoxImage').css('position', 'absolute');
		    $('.lightBoxImage').css('left', origin.left + 'px');
		    $('.lightBoxImage').css('top', Number(origin.top) + $(document).scrollTop()).toString() + 'px';
		    $('.lightBoxImage').css('display', 'none');
		    
		    $('.lightBoxImage').load(function(){
		    
		        $('.lightBoxImage').fadeIn();
		        $('body').append('<a href="#" class="closeLightBox">X Fenster schließen</a>');
		        $('.closeLightBox').fadeIn();
		        $('.closeLightBox').css('position', 'absolute');
		        $('.closeLightBox').css('z-index', '2');
		        $('.closeLightBox').css('left', origin.left);
		        $('.closeLightBox').css('top', $('.lightBoxImage').css('top'));
		        $('.closeLightBox').css('text-decoration', 'none');
		        $('.closeLightBox').css('color', 'white');
		        $('.closeLightBox').css('font-weight', 'bold');
		        $('.closeLightBox').css('font', '80%/1.2em Verdana,Arial,Helvetica,sans-serif');
		        $('.closeLightBox').css('padding', '3px');
		        $('.closeLightBox').css('background', 'black');
		        $('.closeLightBox').unbind('click');
		        var closeFn = function(e){
		        
		            e.preventDefault();
		            $('.lightBox').fadeOut();
		            $('.closeLightBox').fadeOut();
		            $('.lightBoxImage').fadeOut(function(){
		                $(this).remove();
		                $('.closeLightBox').remove();
		                $('.lightBox').remove();
		                $('body', document).css('overflow', 'auto');
		            });
		        }
		        
		        $('.closeLightBox, .lightBox, .lightBoxImage').click(closeFn);
		        
		    });
		    
		    setStyle($(document).width(), $(document).height());
		};
		
		
		$('a[class] img').parent('a').click(function(e){
		    e.preventDefault();
		    $('body', document).css('overflow', 'hidden');
		    lightBox($(this).attr('href'));
		});

