function onBlur(el) {
    if (el.value == '') {
        el.value = el.defaultValue;
    }
}

function onFocus(el) {
    if (el.value == el.defaultValue) {
        el.value = '';
    }
}

function switch_html(data){
	
	var done = false;
	var timeout = 0;
	
	while(done == false && timeout < 15){
		
		if($('#newcontent').html() == ""){
					
			$('#newcontent').html(data);
			$('#newcontent').fadeIn(function(){
				
				$('#content').fadeOut(function(){
					
					$('#newcontent').css('position','relative');
					$('#newcontent').css('top','0');
					$('#content').css('position','absolute')
					$('#content').css('top','162px');
					
					$('#content').html("");
					
				});
				
			});
			
			done = true;
		
		}else if($('#content').html() == ""){
		
			$('#content').html(data);
			$('#content').fadeIn(function(){
				
				$('#newcontent').fadeOut(function(){
					
					$('#content').css('position','relative');
					$('#content').css('top','0');
					$('#newcontent').css('position','absolute')
					$('#newcontent').css('top','162px');
					
					$('#newcontent').html("");
					
				});	
			
			});
			
			done = true;
			
		}
		
		timeout++;

	}
	
}

function refresh_projects(page) {

	$.post("projecten.php?page="+page, {},
   		function(data){
     		
			switch_html(data);
	
	});
	
}

function refresh_news(id) {

	$.post("nieuws.php?id="+id, {},
   		function(data){
     		
			switch_html(data);
    
	});
	
}
