$(function() {
	  
	$('#box1').hide();
   
   	$('a#close1').click(function(){
		$('#box1').fadeIn();
		$('#box2, #box3, #box4').hide();
   
	});
   
  	$('#box2').hide();
   
   	$('a#close2').click(function(){
		$('#box2').fadeIn();
		$('#box1, #box3, #box4').hide();
   
   	});
   
	$('#box3').hide();
   
   	$('a#close3').click(function(){
		$('#box3').fadeIn();
		$('#box1, #box2, #box4').hide();
   
 	});
   
	$('#box4').hide();
   
	$('a#close4').click(function(){
		$('#box4').fadeIn();
		$('#box1, #box2, #box3').hide();
   
	});
   
	// Handling the splash ad on load, 111124
	
	/*$(".hidden_link").fancybox({
		padding: 0,
		overlayOpacity: 1,
		overlayColor: '#fff'		
	}).trigger('click');   */

	$('ul.content-ul > li > img').click(function() {

		if($(this).parent().find('.ads').css('display') === 'none') {
			$(this).attr('src',function() { return "/img/splash/" + 'image_' + $(this).attr('id') + '.jpg';});

		} else {

			$(this).attr('src',function() { return "/img/splash/" + 'image_not_' + $(this).attr('id') + '.jpg';});
		}

		$(this).parent().find('.ads').slideToggle();

	});
	
});

