$('document').ready(function() {
	// Text inside textfield
	var active_color = '#fff'; // Color of user provided text
	var inactive_color = '#fff'; // Color of default text

	$('input[type="text"]').each(function() {
		var value = $(this).parent().children('label').html();

		if($(this).attr("value") == "") {
			$(this).attr("value", value);
			$(this).css("color", inactive_color);
		}
	});
	
	var default_values = new Array();
	
	$('input[type="text"]').focus(function() {
		if (!default_values[this.id]) {
  			default_values[this.id] = this.value;
		}
		if (this.value == default_values[this.id]) {
  			this.value = '';
  			this.style.color = active_color;
		}
		
		$(this).blur(function() {
  			if (this.value == '') {
    			this.style.color = inactive_color;
    			this.value = default_values[this.id];
  			}
		});
	});
});
		
$(window).scroll(function(){
	if(isScrollBottom() > 1750){
		$('#scrolleur').fadeIn();
	} else {
		$('#scrolleur').fadeOut();
	}
});

function isScrollBottom() { 
  var documentHeight = $(document).height(); 
  var scrollPosition = $(window).height() + $(window).scrollTop(); 
  return (scrollPosition); 
}

function goTo(id) {
	var nextBulle = document.getElementById(id);
		
		var target_offset = $(nextBulle).offset();
    	var target_top = target_offset.top +10;
		
		$('html, body').animate({
    	    scrollTop: target_top
    	}, 1200, function () {
			
    	if (typeof callback === 'function') {
    	     callback()
    	}
    })
}


function goToTop(id) {
	var nextBulle = $('html');
		
		var target_offset = $(nextBulle).offset();
    	var target_top = target_offset.top +10;
		
		$('html, body').animate({
    	    scrollTop: target_top
    	}, 1200, function () {
			
    	if (typeof callback === 'function') {
    	     callback()
    	}
    })
}

