jQuery(document).ready(function(){


		jQuery('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
		jQuery('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer   
		 		
		 		   
		// This will hold our timer
		var myTimer = {};
		
		//Fade in the Popup and add close button
		jQuery(window).load(function() {
		
		jQuery('#popup1').fadeIn().css('width', '600px').prepend('<a href="#" class="close"><img src="http://www.aretemagazine.co.uk/wp-content/themes/arete/popup/fancy_closebox.png" class="btn_close" title="Close Window" alt="Close" /></a>');
		
			//Fade in Background

		
		myTimer = jQuery.timer(4750,function(){
		
		jQuery('#fade , .popup_block').fadeOut(function() {
			jQuery('#fade, a.close').remove();
			jQuery.clearTimer(myTimer); 
	});
	});
		
			//Close Popups and Fade Layer
	jQuery('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
	  	jQuery('#fade , .popup_block').fadeOut(function() {
			jQuery('#fade, a.close').remove();
			jQuery.clearTimer(myTimer); 
	}); //fade them both out
		
		return false;
	});
	
	


		
		});

	
});

