$(document).ready(function(){	
	$('#nextArtistArrow').click(function(){location.reload();});
	
	$('#vipticketingBlock').click( function(){ loadOverlay(); loadContent( $('#vipticketingLightBox') ); });		
	$('#ticketingBlock').click( function(){ loadOverlay(); loadContent( $('#ticketingLightBox') ); });			
	$('#merchandiseBlock').click( function(){ loadOverlay(); loadContent( $('#merchandiseLightBox') ); });			
	$('#fanclubsBlock').click( function(){ loadOverlay(); loadContent( $('#fanclubsLightBox') ); });			
	$('#ecommerceBlock').click( function(){ loadOverlay(); loadContent( $('#ecommerceLightBox') ); });	
	$('#liveflash-2Block').click( function(){ loadOverlay(); loadContent( $('#liveflash-2LightBox') ); });	
	$('#digitalBlock').click( function(){ loadOverlay(); loadContent( $('#digitalLightBox') ); });	
	$('#mobile-3Block').click( function(){ loadOverlay(); loadContent( $('#mobile-3LightBox') ); });	
	
	$('.overlayCloseButton').click(
		function(){
			removeOverlay();
			$('#vipticketingLightBox').hide();
			$('#ticketingLightBox').hide();
			$('#merchandiseLightBox').hide();
			$('#fanclubsLightBox').hide();
			$('#ecommerceLightBox').hide();
			$('#liveflash-2LightBox').hide();
			$('#digitalLightBox').hide();
			$('#mobile-3LightBox').hide();
			}
	);

			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
// ------------------------- // 
$('#openArtistExperienceLink').click(
	function(){
				loadOverlay();
				loadContent( $('#artistExperienceContainer') );
			});

$('#closeArtistExperienceLink').click(
	function(){
				$('#artistExperienceContainer').hide();
				removeOverlay();
			});
});
// ------------------------- //
function loadContent(theElement){
	centerElement(theElement);
	theElement.fadeIn("slow");
}

function centerElement( theElement ){
	windowWidth = $(window).width();
	theElementWidth = theElement.width();

	windowHeight = $(window).height();
	theElementHeight = theElement.height();

	upperLeftCornerX =  ( windowWidth - theElementWidth) / 2 ;
	upperLeftCornerY =  (windowHeight - theElementHeight ) /2;

	theElement.css({
					'z-index':'1051',
					'top': upperLeftCornerY ,
					'left': upperLeftCornerX
	});

}

function loadOverlay(){
	$('#globalContainer').append('<div class="overlay"></div>');
	$('.overlay').fadeIn("fast");

}

function removeOverlay(){
	$('.overlay').fadeOut("slow");
	$('.overlay').remove();
}