$(document).ready(function() {
	$.theBox ={
		open: function(id, content){
			var docHeight= $(document).height();
			var backgroundDiv= '<div id="imgAnimBackgroundDiv" style=" position:absolute; top:0px; left:0px; '+
				'background: #fff; width:100%; height:'+docHeight+'px; z-index:1000;'+
				'opacity:0.5; -moz-opacity:0.5;  filter: alpha(opacity=50); display:none; ">.</div>';
						
												//FUNDALUL INTUNECAT
			$('body').append(backgroundDiv);
			$('#imgAnimBackgroundDiv').fadeIn(300);
			
			var container= "<div id='"+id+"' style='position:absolute;'>"+content+"</div>";
			$('body').append(container);
			var left = ($(document).width()-$('#'+id).width())/2;
			var top = $(window).scrollTop()+40;
			$('#'+id).css({"top":top,"left":left,"z-index":"1001"});
			$('#'+id).fadeIn(500);
			
			$('#imgAnimBackgroundDiv').click(function(){
				$(this).fadeOut("fast", function(){$(this).remove();});
				$("#"+id).fadeOut("fast", function(){$(this).remove();});
			});
		},
		close: function(id){
			$("#imgAnimBackgroundDiv").fadeOut("fast", function(){$(this).remove();});
			$("#"+id).fadeOut("fast", function(){$(this).remove();});
		}
		
	}
});