$(document).xready(function(){
		
		popWidth = 600;
		popHeight = 350;
		popID = 'popup';
		
		var popMargTop = popHeight / 2;
		var popMargLeft = popWidth / 2;
		
		//Apply Margin to Popup
		$('#' + popID).css({ 
			'width': popWidth,
			'height': popHeight,
			'margin-top' : -popMargTop,
			'margin-left' : -popMargLeft,
			'visibility' : 'visible'
		});	
		
		//Fade in Background
		$('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
		$('#fade').css({'filter' : 'alpha(opacity=70)'}).fadeIn(); //Fade in the fade layer 
	
	//Close Popups and Fade Layer
	$('a.close, #fade, .popup_block').live('click', function() { //When clicking on the close or fade layer...
	  	$('#fade , .popup_block').fadeOut(); //fade them both out
		$('#fade').remove();
		return false;
	});	
	
});

