	function getPage(url, id){
		$('#'+id).prepend('<div id="tempLoading" style="position:absolute;"><img src="img/loading.gif" align="center"/></div>');	
		$('#'+id).hide();
		$("#"+id).load(url, function(){
			setLinks();
			$('#tempLoading').remove();
		}).slideDown();
		
		var number=Math.ceil(Math.random()*4);
		$('#contentContainer').css({ background:"url('../img/contentBG"+number+".jpg')"});
	}

	
	function flipBG(){
		var number=Math.ceil(Math.random()*4);
		$('#contentContainer').css({ background:"url('../img/contentBG"+number+".jpg')"});		
	}
	
	function showEmail(){
		emailAdres=('rodneyglunder@' + 'live.nl')
		document.write('<a href="mailto:' + emailAdres + '"><font color=black>' + emailAdres + '</font></a>');
	}
	
	function setLinks(){
		$(".link").unbind('click');
		$(".link").click(function(event){
			event.preventDefault();
			this.blur();
			getPage(this.href, 'content');
			return false;
		});	
	}
	
   $(function(){		
		setLinks();		
		flipBG();
		
		$('#fotoSlide').cycle({
			fx:    'fade', 
			speed:  2000
		});

		$('#home').hover(function(){
			this.src='img/home2.jpg';
		},function(){
			this.src='img/home.jpg';
		});		
		$('#profiel').hover(function(){
			this.src='img/profiel2.jpg';
		},function(){
			this.src='img/profiel.jpg';
		});						
		$('#nieuws').hover(function(){
			this.src='img/nieuws2.jpg';
		},function(){
			this.src='img/nieuws.jpg';
		});				
		$('#fotogallery').hover(function(){
			this.src='img/fotogallery2.jpg';
		},function(){
			this.src='img/fotogallery.jpg';
		});
		$('#links').hover(function(){
			this.src='img/links2.jpg';
		},function(){
			this.src='img/links.jpg';
		});
	
	});