var counter = 0;

$(document).ready(function() {

	setTimeout("animateSlider();", 30000);

	$('a.tip[title]').qtip({
		content: { text: false },
		position: { corner: { tooltip: 'topMiddle', target: 'bottomMiddle' } },
		style: { border: { width: 0, radius: 0 }, padding: 10, tip: true, name: 'dark' }
	});
	
	$("img.icon").bind('mouseover', function() {
		$(this).attr("src", $(this).attr("src").replace("-off", "-on"));
	});
	$("img.icon").bind('mouseout', function() {
		$(this).attr("src", $(this).attr("src").replace("-on", "-off"));
	});
	
	$(".jqModal").each(function(index) {
		$('#'+$(this).attr("id").replace("-trigger", "-window")).jqm({ trigger: '#'+$(this).attr("id") });
	});
  
});

function animateSlider() {
	if(counter == 0) {
		counter = 1;
		$('#slider-holder').animate({
			left: "-980px"
		}, 1000);
		setTimeout("animateSlider();", 31000);
	} else {
		counter = 0;
		$('#slider-holder').animate({
			left: "0"
		}, 1000);
		setTimeout("animateSlider();", 31000);
	}
}

function validateContactForm() {
	var name = $("#name").val();
	var email = $("#email").val();
	var subject = $("#subject").val();
	var message = $("#message").val();
	
	if(name && email && subject && message) {
		return true;
	} else {
		alert("Vul a.u.b. alle velden in.");
		return false;
	}
}
