<!--
	$(document).ready(function () {
								
		$('#slider').nivoSlider({
			effect:'random', //Specify sets like: 'fold,fade,sliceDown'
			slices:15,
			animSpeed:500,
			pauseTime:3000,
			//startSlide:0, //Set starting Slide (0 index)
			directionNav:true, //Next & Prev
			directionNavHide:false, //Only show on hover
			controlNav:false, //1,2,3...
			controlNavThumbs:false, //Use thumbnails for Control Nav
			controlNavThumbsFromRel:false, //Use image rel for thumbs
			controlNavThumbsSearch: '.jpg', //Replace this with...
			controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
			keyboardNav:true, //Use left & right arrows
			pauseOnHover:true, //Stop animation while hovering
			manualAdvance:false, //Force manual transitions
			captionOpacity:1, //Universal caption opacity
			//beforeChange: function(){},
			//afterChange: function(){},
			//slideshowEnd: function(){} //Triggers after all slides have been shown
		});
		
		$('.hover_vertical').each(function(index) {
			$bg_pos = $(this).css('backgroundPosition');
			if ($bg_pos == null || $bg_pos == undefined) {
				$bg_pos = "0px 0px";
			}
			$(this).css( {backgroundPosition: $bg_pos} )
			$height = $(this).css('height');
			$height = $height.substr(0, ($height.length - 2));
			$arr_bg_pos = $bg_pos.split(" ");
			$bg_pos_x = $arr_bg_pos[0];
			$bg_pos_y = $arr_bg_pos[1];
			$bg_pos_y_res = $bg_pos_y.substr(0, ($bg_pos_y.length - 2));
			$bg_pos_y_res = (parseInt($bg_pos_y_res) - parseInt($height)) + "px";
			$(this).attr('bg_pos_x', $bg_pos_x);
			$(this).attr('bg_pos_y', $bg_pos_y);
			$(this).attr('bg_pos_y_res', $bg_pos_y_res);
			//
			$(this).mouseover(function(){
				$(this).stop().animate({backgroundPosition:"(" + $(this).attr('bg_pos_x')  + " " + $(this).attr('bg_pos_y_res') + ")"}, {duration:200});
	
			});
			$(this).mouseout(function(){
				$(this).stop().animate({backgroundPosition:"(" + $(this).attr('bg_pos_x')  + " " + $(this).attr('bg_pos_y') + ")"}, {duration:200});
			});
		});
		
		
		$('.toggleval').each(function(index) {
			$(this).focus(function() {
				if ($(this).val() == window[$(this).attr('id') + "dv"]) {
					$(this).val("");
				}
			});
			$(this).blur(function() {
				if ($(this).val() == "") {
					$(this).val(window[$(this).attr('id') + "dv"]);
				}
			});
		});
		
		$('#btn_verstuur').click(function(e) {
			if (isValid(document.getElementById('formulier'))) {
				$('#formulier').submit();
			}
		});
		
	});
	
	var arrRequiredFields = new Array();
	arrRequiredFields[0] = "txtemail";
	arrRequiredFields[1] = "txtnaam";
	arrRequiredFields[2] = "txttelefoon";
	arrRequiredFields[3] = "txtstraat";
	arrRequiredFields[4] = "txtpostcode";
	arrRequiredFields[5] = "txtgemeente";
	//
	function isValid(myForm) {
		//
		var bIsValid = true;
		//
		for (i=0; i<myForm.elements.length; i++) {
			for (r=0; r<arrRequiredFields.length; r++) {
				if (myForm.elements[i].id == arrRequiredFields[r] && myForm.elements[i].value != "" && myForm.elements[i].value != this[arrRequiredFields[r] + "dv"]) {
					// veld is ingevuld
					// resetten
					document.getElementById(myForm.elements[i].id).style.backgroundColor = "#FFFFFF";
					document.getElementById(myForm.elements[i].id).style.color = "#464646";
					// emailveld checken als het een geldig emailadres is
					if (myForm.elements[i].id == "txtemail") {
						if (!checkEmail(myForm.elements[i].value)) {
							document.getElementById(myForm.elements[i].id).style.backgroundColor = "#e2001a";	
							document.getElementById(myForm.elements[i].id).style.color = "#FFFFFF";							
							bIsValid = false;
						}
					}
					//
				} else if (myForm.elements[i].id == arrRequiredFields[r]) {
					document.getElementById(myForm.elements[i].id).style.backgroundColor = "#e2001a";	
					document.getElementById(myForm.elements[i].id).style.color = "#FFFFFF";	
					// veld is niet ingevuld
					bIsValid = false;
				}
			}
		}
		//
		/*if (!bIsValid) {
			showError(sError, mouseX, mouseY - 20);
		} else {
			hideError();
		}*/
		//
		return bIsValid;
		//
	}
	//
	function checkEmail(email) {
		var reg = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i;
		return reg.test(email);
	}
-->
