function popshowImg(t) {
   	var img = t;
   	$('body').prepend('<div id="background"></div>');
   	$('body').prepend('<div id="box"><div></div><a href="#close" class="close">fermer</a></div>')
   	$('#background').css({
   	    display:'block',
   	    position:'fixed',
   	    top:0,
   	    left:0,
   	    width:'100%',
   	    height:'100%',
   	    zIndex:1000,
   	    backgroundColor:'black',
   	    opacity:.8,
   	    filter : 'alpha(opacity=50)'
   	});
   	$('#box').css({
   	    display:'block',
   	    position:'fixed',
   	    top:'50%',
   	    left:'50%',
   	    marginTop:'-255px',
   	    marginLeft:'-255px',
   	    width:'490px',
   	    height:'460px',
   		border: '10px solid #313131',
		backgroundColor:'white',
		padding:'20px 10px 20px 10px',
   	    zIndex:1001
	});
	$('#box div').css({
		width:'490px',
		height:'460px',
   	    background:'white url('+img+') no-repeat 50% 50%'
   	});
   	$('#box .close').css({
   	    display:'block',
   	    position:'absolute',
   	    top:'0',
   	    right:'0',
   	    width:'18px',
   	    height:'18px',
   	    background:"white url('/__templates/css/imgs/close.png') no-repeat 0 0",
   	    textIndent:'-1000000px'
   	});
   	$('.close').click(function(){
   	    $('#background').remove();
   	    $('#box').remove();
   	});
}
(function($) {
    $.fn.popupImg = function(t, bool) {
        if (bool) {
            this.click(function(e) {
                popshowImg(t);
                return false;
            });
        }
        else {
            popshowImg(t);
        }
    }
})(jQuery);
