$(document).ready(function(){
  	$("a.featured-link").bigTarget({
    hoverClass: 'over', // CSS class applied to the click zone onHover
    clickZone : 'div:eq(0)' // jQuery parent selector
  });
	$("a.ban-subscribe").bigTarget({
    hoverClass: 'over', // CSS class applied to the click zone onHover
    clickZone : 'div:eq(0)' // jQuery parent selector
  });
	linkNewWindow();
	var container = $('div#errorbox');
	// validate signup form on keyup and submit
	$("#freeform").validate({
errorContainer: container,
messages: {
     name: "",
email:"",
voornaam:"",
plaats:""
     }
	});
});

function linkNewWindow(){
	var hostname = window.location.hostname;
	hostname = hostname.replace("www.","").toLowerCase();
	var a = document.getElementsByTagName("a");	
	this.check = function(obj){
		var href = obj.href.toLowerCase();
		return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? true : false;				
	};
	this.set = function(obj){
		obj.target = "_blank";
		obj.className = obj.className + " external";
	};	
	for (var i=0;i<a.length;i++){
		if(check(a[i])) set(a[i]);
	};		
};


