$(function(loadPopup){
		$("#backgroundPopup").css({"opacity": "0.7"});
		$("#backgroundPopup").fadeIn("slow");
		$("#popup").fadeIn("slow");
		$("#popup").click(function(){
			$("#backgroundPopup").fadeOut("slow");
			$(this).fadeOut("slow");
		});
		$("#closePopup").click(function(){
			$("#backgroundPopup").fadeOut("slow");
			$("#popup").fadeOut("slow");
			$(this).fadeOut("slow");
		});
});

$(function (centerPopup){    
	  var windowWidth = document.documentElement.clientWidth;  
	  var windowHeight = document.documentElement.clientHeight;  
	  var popupHeight = $("#popup").height();  
	  var popupWidth = $("#popup").width();  
	
	  $("#popup").css({  
	  "position": "absolute",  
	  "top": windowHeight/2-popupHeight/2,  
	  "left": windowWidth/2-popupWidth/2  
	  });  
	  
	  //only need force for IE6  
		
	  $("#backgroundPopup").css({  
	  "height": windowHeight  
	  });  
    
});  
	


