

// div met ul#rotator wordt rotator
$(document).ready(function(){
				
	$('ul#rotator').innerfade({
		speed: 1000,
		timeout: 5000,
		type: 'random_start',
		containerheight: '80px'
	});				
			
});


// footer nav hiden
$(document).ready(function(){
	$('#e-toggle').hide();
});



// checks plugin op form zetten 
$(document).ready(function() {
	$("#callmebackform form").validate({
	messages: {
		name: {
			required: 'Vul uw naam in'
		},
		telephone: {
			required: 'Vul uw telefoonnummer in'
		}
	}		
	});
});


// callmeback sessie bescherming
$(document).ready(function(){
	$("#sess_callback").blur(function() {
		$.get('sesscallback.php');
	});
});


$(document).ready(function(){

	//$('#callmebackform form input#submitbutton').click(function(){
	$('#callmebackform form').submit(function(){
		
		var vals = $(this).serialize();
		
		//$("#callmebackform form").validate();
		if ($('#callmebackform form').valid())
		{
			// alle inputs disabled zetten
			$('#callmebackform form input').each(function(){
				$(this).attr('disabled', 'disabled');
			});
			
			// met ajax spullen versturen
			$.get('callmeback.php', vals, function(data) {
				//$('#callmebackform #result').html(data);
				$('#callmebackform').html('<h2>Bedankt voor het invullen van het formulier</h2><p>Wij nemen zo spoedig mogelijk contact met u op.</p>');
			});
		}
		
		return false;
	});
});