/*
		* Credits to Jamie McConnell  nodstrum.com/ 
		* And jquery.com/ 
		*/


function backgroundFadeOut(id){
	$("#bg_slider").fadeOut("slow", function() {  
		$("#bg_slider").load("bgimage.php?id="+id, function(){
				backgroundFadeIn();   });
		});
	}
	
function firstcontentFadeOut(id,content){
	$("#works").fadeOut("fast", function() {
		$("#works").load("second.php?id="+id+"&content="+content, function(){
				secondcontentFadeOut(id,content);  });
		});

	}

function secondcontentFadeOut(id,content){
	$("#about").fadeOut("fast", function() {
		$("#about").load("first.php?id="+id+"&content="+content, function(){
			artistsFadeOut(id,content);	  });
		});

	}


	
function artistsFadeOut(id,content){
	$("#artists").fadeOut("fast", function() {
		headerFadeOut(id,content); 
		});

	}
	
function headerFadeOut(id,content){
	$("#header").fadeOut("fast", function() {
		$("#header").load("header.php", function(){								  
		backgroundFadeOut(id); });
		});

	}



function backgroundFadeIn(){
	$("#bg_slider").fadeIn("slow", function() {
		headerFadeIn();
		});							
	}

function firstcontentFadeIn(){
	$("#works").fadeIn("fast", function() {
		});						
	}

function secondcontentFadeIn(){
	$("#about").fadeIn("fast", function() {
			firstcontentFadeIn(); tb_init('a.thickbox, area.thickbox, input.thickbox');
	});						
	
	}
	

function artistsFadeIn(){
	$("#artists").fadeIn("fast", function() {
		secondcontentFadeIn();
		});						
	
	}


function headerFadeIn(){
	$("#header").fadeIn("fast", function() {
		artistsFadeIn(); 
		});						
	
	}


function loadContent(id, content) {
	
	
	firstcontentFadeOut(id,content);
	

	
}
	

	
		
	function loadContentSecond(id) {
		
			$("#works").fadeOut("fast", function() {  // Fade out current content
			$("#works").load("second.php?id="+id, function() { // Load the new content
			$("#works").fadeIn("slow", function() { // If loaded fade in the new content. This time a bit slower
			tb_init('a.thickbox, area.thickbox, input.thickbox');
	
			});
			});
			});

		}
		
		
	function loadContentFirst(id, content) {
		
			$("#about").fadeOut("fast", function() {  // Fade out current content
			$("#about").load("first.php?id="+id+"&content="+content, function() { // Load the new content
			$("#about").fadeIn("slow", function() { // If loaded fade in the new content. This time a bit slower
			tb_init('a.thickbox, area.thickbox, input.thickbox');
					
				
			});
			});
			});

		}


function backgroundFadeInStart(id){
	  
		$("#bg_slider").load("bgimage.php?id="+id, function(){
				
		$("#bg_slider").fadeIn("slow");
		});
	}


