// JavaScript Document

function spamSave( element ) {
	element = $( element == undefined ? 'body' : element );
	var arA = element.getElementsByTagName('A');
	for (var i=0;i<arA.length; i++ ) {
		if (arA[i].href.substr(0,7) == 'mailto:') {
			arA[i].href = arA[i].href.replace("--AT--","@");
			arA[i].innerHTML = arA[i].innerHTML.replace("--AT--","@");
		}
	}
}
function seachFocus(bool) {
	if (bool == false) {
		//$('searchinput').value = 'zoeken';
	} else {
		$('searchinput').select();
		
	}
}

function submitPeopleType() {
	$('peopleForm').submit();	
}

function customClickPrev(no) {
	no = no + 2; // ?
	if (no == 1) no = $('.carousel ul').children().length - 5;
	setCarousel(no);
}
function customClickNext(no) {
	no = no + 4; // ?
	if (no >= $('.carousel ul').children().length) no = 6; //Math.floor($('.carousel ul').children().length/2+1) ;
	setCarousel(no);
}
function customClickImg(e) {
	 $(".widget .mid img").attr("src", '/getImage.cfm?size=big&file=' + $(this).attr("filename"));
	 $(".carousel img.selected").attr("class", 'carousel');
	 $(this).attr("class", 'carousel selected');
}
function setCarousel(no) {
	$(".carousel img.selected").attr("class", 'carousel');
	$('.carousel li:nth-child(' + no + ') img').attr("class", 'carousel selected');
	$(".widget .mid img").attr("src", '/getImage.cfm?size=big&file=' + $(".carousel img.selected").attr("filename"));
	$(".widget .mid img").attr("alt", $(".carousel img.selected").attr("alt"));
	$(".widget .mid img").attr("title", $(".carousel img.selected").attr("title"));
}
function printForm() {
	window.print();
}
