$(document).ready(function(){ 
	$(".subTable").hide();
	
	
	$("#menu a").mouseover(function() {
		$(this).stop().animate({left:-5,top:-3},100);
	});	
	$("#menu a").mouseout(function() {
		$(this).stop().animate({left:0,top:0},100);
	});	
	
	 $('#sliderport').carousel('#previous', '#next');
	
	function slide(){ 
		$('#next').click(); 
	} 
	
	var intervalId = window.setInterval(slide, 5000);  
	$('#previous').click(  
		function(){window.clearInterval(intervalId); } 
	);
	
		
});

function divSlideDown(){
	$(this).children('.subTable').slideDown();
}
function divSlideUp(){
	$(this).children('.subTable').slideUp();
}

function uploadfiles(filefolder){
	$("#uploadercontainer").slideDown();
	$("#uploadinitbtn").slideUp();
	$("#uploadercontainer").get(0).src = '/blog/u/?p=' + filefolder;
}

function loadblogfilelist(filefolder){
	$("#blogfilelist").html("Bezig met laden ...");
	$.get('/blog/u/list.asp?r='+Math.random()+'&p=' + filefolder, function(data) {
  		$('#blogfilelist').html(data);
		$("#uploadercontainer").slideUp();
		$("#uploadinitbtn").slideDown();
	});
	
}

function deletefile(d,f){
	if (confirm('Weet je zeker dat je dit bestand wil verwijderen?')){
		var url = '/blog/u/dropfile.asp?sure=sure&d=' + d + '&f=' + f;
		//$('#blogfilelist').html(url);
		//alert(url);
		$.get(url, function(data) {
  		if (isNaN(data)){
			alert('Oeps ... het bestand kon niet worden verwijderd: ' + data);
		}else{
			loadblogfilelist(data);
		}
	});
		
	}
}
