//   About
$(document).ready(function(){
		$('#about').waypoint(function(event, direction) {
		$('#about').waypoint('remove');
		$("#aboutfade").fadeIn(1000);							
					
		});	
	

});
function initBinding(){ 
// Smooth scroll
		var jump=function(e){
		e.preventDefault();
		var target = $(this).attr("href");
		$('html,body').animate(
		{
		scrollTop: $(target).offset().top
		},500,function()
		{
		location.hash = target;
		});
		}
		$(document).ready(function()
		{
		$('a[href*=#]').bind("click", jump);
		return false;
		});
}// End Binding About

// Contact
$(document).ready(function(){
	
//     Contact effect Viewport   
		$('#contact').waypoint(function(event, direction) {
		$("#contactfade").fadeIn(1000); 
		});					
//      Contact inner
		var sections = $("#proposalbutton,#formbutton,#formbuttontwo");
		var loading = $("#contact .loading");
		var content = $("#mapoverlay");
		var exit = $("#closecontact");
		sections.click(function(){
		showLoading();
		switch(this.id){
		case "formbutton":
		content.load("form/index.php", hideLoading);
		content.fadeIn();
		exit.fadeIn();
		break;
		case "formbuttontwo":
		content.load("form/index.php", hideLoading);
		content.fadeIn();
		exit.fadeIn();
		break;
		case "proposalbutton":
		content.load("form/offerte.php", hideLoading);
		content.fadeIn();
		exit.fadeIn();
		break;
		default:
		hideLoading();
		break;
		}
});
		function showLoading(){
		loading
		.css({visibility:"visible"})
		.css({opacity:"1"})
		.css({display:"block"});
		}
		function hideLoading(){
		loading.fadeTo(1000, 0);
		}
});// End Contact

//   Clients
$(document).ready(function(){
		var loading = $("#clients .loading");
		var content = $("#clientsfade");
		$('#clients').waypoint(function(event, direction) {
		$('#clients').waypoint('remove');
		showLoading();
		content.load("content/clients.html", hideLoading);
		content.fadeIn(1000);
});	
		function showLoading(){
		loading
		.css({visibility:"visible"})
		.css({opacity:"1"})
		.css({display:"block"});
		}
		function hideLoading(){
		loading.fadeTo(1000, 0);
		}
});// End clients		
