	//EXTERNAL LINKS
	function externalLinks() {
	 if (!document.getElementsByTagName) return;
	 var anchors = document.getElementsByTagName("a");
	 for (var i=0; i<anchors.length; i++) {
	   var anchor = anchors[i];
	   if (anchor.getAttribute("href") &&
		   anchor.getAttribute("rel") == "external")
		 anchor.target = "_blank";
	 }
	}
	window.onload = externalLinks;	


	// DELAY FUNCTION
	$.fn.delay = function(time, callback){
		// Empty function:
		jQuery.fx.step.delay = function(){};
		// Return meaningless animation, (will be added to queue)
		return this.animate({delay:1}, time, callback);
	}

	//$(window).load(function() {
	$(function(){
		
		// VALIDATE REACTIEFORM
		$("#ReactieForm").validate({
			rules: {
				naam: {
					required: true,
					minlength: 2
				},
				bericht: {
					required: true,
					minlength: 2
				},
				email: {
					required: true,
					email: true
				}
			},
			messages: {
				naam: "Vul aub uw naam in",
				email: "Vul aub een geldig e-mailadres in",
				bericht: "Vul aub uw reactie in"	
			}
		});
		
		// VALIDATE NIEUWSBRIEFFORM
		$("#Nieuwsbrief").validate({
			rules: {
				bedrijf: {
					required: true,
					minlength: 2
				},					
				voornaam: {
					required: true,
					minlength: 2
				},	
				achternaam: {
					required: true,
					minlength: 2
				},					
				emailadres: {
					required: true,
					email: true
				}
			},
			messages: {
				bedrijf: "Vul uw bedrijfsnaam in",
				voornaam: "Vul uw voornaam in",
				achternaam: "Vul uw achternaam in",
				emailadres: "Vul een geldig e-mailadres in"	
			}
		});		
		
		// remove enter 2 submit
		$("form").bind("keypress", function(e) {
			  if (e.keyCode == 13) return false;
		});	 		
	});
