var jbAnimatieKlaar = false;


////////////////// FADE IN //////////////////

$.fn.jbAnimatieFadeIn = function() { 
	
	var me = $(this).get(0);

	if(webkitBrowser == true){
	    $(this).css('opacity','1');
	    me.addEventListener('webkitTransitionEnd', function(event){
	    	jbAnimatieKlaar = true;
	   		if(debug == true){
	    		console.log('fadeIn animatie met: css3');
	    	};
		});
	}
	else{
		$(this).animate({"opacity":"1"},2000, function(){
			jbAnimatieKlaar = true;
			if(debug == true){
				console.log('fadeIn animatie met: jquery.animate');
			};
			
		});
	};
};

////////////////// FADE OUT //////////////////

$.fn.jbAnimatieFadeUit = function() { 
	
	var me = $(this).get(0);
	
	if(webkitBrowser == true){

	    $(this).css('opacity','0');
	    me.addEventListener('webkitTransitionEnd', function(event){
	   		jbAnimatieKlaar = true;
	    	if(debug == true){
	    		console.log('fadeUit animatie met: css3'); 
	    	};	    	
	    });
	}
	else{
		$(this).animate({"opacity":"0"},2000, function(){
			jbAnimatieKlaar = true;
			if(debug == true){
				console.log('fadeUit animatie met: jquery.animate');
			};
			
		});
	};
};
