/* mpshadow */
$(function(){		
	$('.add_shadow,.image_wrapper:not(.no_shadow) img').each(function(){
		var img = new Image();
		var actual_item=this;
		
		$(img).load(function(){
			$(actual_item).removeClass('add_shadow').addClass('shadow_img');
			var wrap=$(actual_item).wrap('<div class="shadow" style="width:'+($(actual_item).width()+32+2)+'px;height:'+($(actual_item).height()+32+2)+'px;"></div>').parent();
			jQuery.each(['br','bl','tr','tl', 'l','r', 'b','t'],function(){
				wrap.prepend('<span class="'+this+'"></span>');
			});

			if ($(actual_item).hasClass('add_enlarge') || $(actual_item).parent().parent().hasClass('image_wrapper')) {
				
				if ($(actual_item).parent().parent().hasClass('image_wrapper')) {
					if ($(actual_item).attr('full')) {
						wrap.append('<span class="enlarge"></span>')
						$(actual_item).wrap('<a class="nbox" href="'+$(actual_item).attr('full')+'"></a>');
                        if ($('.nbox').length>0 && typeof($('.nbox').lightBox)=="function") {
                            $('.nbox').lightBox({
                                imageLoading: '/project/html/images/lightbox/loading.gif',
                                imageBtnClose: '/project/html/images/lightbox/close.gif',
                                imageBtnPrev: '/project/html/images/lightbox/prev.gif',
                                imageBtnNext: '/project/html/images/lightbox/next.gif'
                            });
                        }
					}
					
				}else{
					wrap.append('<span class="enlarge"></span>')	
				}
			}
            if (typeof(adjust_footer)=="function") {
            adjust_footer();
            }
			
		});
		$(img).attr('src',$(this).attr('src'));
		
	});
});