function popshow(t) {
	/*$.get(t, function(data){
		var txt = data;
		$('body').prepend('<div id="background"></div>');
	    $('body').prepend('<div id="box"><a href="#close" class="close">fermer</a>'+ txt +'</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:'-323px',
	        marginLeft:'-302px',
	        width:'566px',
	        height:'607px',
			border: '10px solid #313131',
	        zIndex:1001,
	        backgroundColor:'white',
	        padding:'10px 20px 10px 20px'
	    });
	    $('#box .close').css({
	        display:'block',
	        position:'absolute',
	        top:'5px',
	        right:'5px',
	        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();
	    });
	});*/
	$('body').prepend('<div id="background"></div>');
    $('body').prepend('<div id="box"><a href="#close" class="close">fermer</a><div class="content"></div></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',
        width:'500px',
		border: '10px solid black',
        zIndex:1001,
        backgroundColor:'white',
        padding:'20px 20px 20px 20px'
    });
    $('#box .close').css({
        display:'block',
        position:'absolute',
        top:'5px',
        right:'5px',
        width:'18px',
        height:'18px',
        background:"white url('/__templates/css/imgs/close.png') no-repeat 0 0",
        textIndent:'-1000000px'
    });
	$.ajax({
		url:t, 
		context:$('#box'),
		success: function(data){
			$('.content', $(this)).html(data);
		},
		complete: function(){
			var height=$(this).outerHeight();
			var width=$(this).outerWidth();
			$(this).css({
				width:(width-40)+'px',
				height:(height-80)+'px',
				marginTop:-((height)/2)+10+'px',
				marginLeft:-((width)/2)-10+'px',
				top:'50%',
				left:'50%'
			});
			$('.close', $(this)).click(function(){
				$('#background, #box').fadeOut(100, function(){
					$(this).remove();
				});
				return false;
			});
		}
	});
}
(function($) {
    $.fn.popup = function(t, bool) {
        if (bool) {
            this.click(function(e) {
                popshow(t);
                return false;
            });
        }
        else {
            popshow(t);
        }
    }
})(jQuery);
