function sfeerCycle() {
	$('#cycle')
		.after('<div id="cyclenav">')
		.cycle({
			fx:     'fade',
			timeout: 5000,
			speed:	 900,
			pager: '#cyclenav',
			after: function(curr,next,opts) {

			}
	});
}

function sfeervervolgCycle() {
	$('#cycle')
		.after('<div id="cyclenav">')
		.cycle({
			fx:     'fade',
			timeout: 5000,
			speed:	 900,
			pager: '#cyclenav',
			after: function(curr,next,opts) {

			}
	});
}

function productMenu() {
	$('#left_nav li').click(function() {
		if(!$(this).hasClass('active')) {
			$('li.active ul.subcat').slideUp(600);
			$('li.active').removeClass('active');
			$(this).addClass('active');
			$(this).children('ul.subcat').slideDown(600);
		}
	});
}

function validateForm(p_sForm) {

	switch(p_sForm) {
		case 'contactformulier':

			var rules = {};
			rules[oFields[p_sForm][1]] = {
				required: true,
				notags: true,
				minlength: 2
			};
			rules[oFields[p_sForm][5]] = {
				required: true,
				email: true
			};
			
			var messages = {};
			messages[oFields[p_sForm][1]] = {
				required: 'Vul hier uw naam in.',
				notags: 'U mag geen tags invoeren.',
				minlength: 'Vul minimaal 2 tekens in.'
			};
			messages[oFields[p_sForm][5]] = {
				required: 'Vul uw e-mailadres in.',
				email: 'Vul hier een geldig e-mailadres in.'
			};
		
		break;
	}
	
	$('#'+p_sForm).validate({
		rules: rules,
		messages: messages,
		errorPlacement: function(error, element) {
			var obj = element.parent().next('div.icon');
			error.insertAfter(obj);
			obj.attr('class','icon invalid');
		},
		success: function(label) {
			label.prev('div.icon').attr('class','icon valid');
			label.remove();
		},
		submitHandler: function(form) {
			form.submit();
		}
	});	
}

function googlemaps(){
	var myCenter = new google.maps.LatLng(51.87174, 4.54903);
	var myOptions = {
	  zoom: 17,
	  center: myCenter,
	  mapTypeId: google.maps.MapTypeId.ROADMAP,	  
	  mapTypeControl: false,
	  scrollwheel: false
	}
	var myLatlng = new google.maps.LatLng(51.87174, 4.54903);
	var map = new google.maps.Map(document.getElementById("map"), myOptions);
	var image = new google.maps.MarkerImage('images/template/marker_burchthuys.png',
		new google.maps.Size(121, 81),
		// The origin for this image is 0,0.
		new google.maps.Point(0,0),
		// The anchor for this image is the base of the flagpole at 0,32.
		new google.maps.Point(15, 70)
	);
	var marker = new google.maps.Marker({
		position: myLatlng, 
		map: map,
		icon: image
	});
}
