function loadImg(img,el)
{
	$('#'+el).attr('src', img);
}


function submitForm(formId)
{
	
}

function isValidEmailAddress(emailAddress) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
}


$(document).ready(function(){
	$(".kaartVerkoopAlgemeen").colorbox({width:"90%", height:"80%", iframe:true});
	$(".kaarVerkoopAc").colorbox({innerWidth:830, innerHeight:630, iframe:true, close:'sluiten', onOpen:function(){ $('html, body').animate({scrollTop:0}, 'fast');}});
	$(".react").colorbox({width:505, height: 555, iframe:true, close:'sluiten'});
	$("a[rel='lb']").colorbox({transition:"none", maxWidth:"75%", maxHeight:"75%", close:'sluiten', next: '>', previous: '<', current: 'foto {current} van {total}'});
	$("a[rel='moverview']").colorbox({transition:"none", maxWidth:"75%", maxHeight:"75%", close:'sluiten'});
	$("a[rel='login']").colorbox({transition:"none", width:400, height:300, close:'sluiten', opacity:0.6});
	$("a.notify").colorbox({transition:"none", width:500, height:560, close:'sluiten', opacity:0.6, iframe: true});
	$("a[rel='boekingsForm']").colorbox({transition:"none", width:400, height: 600, close:'sluiten', opacity:0.6, iframe:true,rel:'nofollow'});
	
	$('#searchForm').submit(function(){
		if($('#searchQ').val() == '' || $('#searchQ').val() == 'Zoeken')
		{
			alert('Geen zoek opdracht gespecificeerd..');
			return false;
		} else {
			window.location = '/search/'+$('#searchQ').val();
			return false;
		}
	});
	
	$("div.imgHolder img[rel]").overlay();
});

