/* 
	Author: Martijn de Valk
*/

$(window).load(function() {
	
	// nivoSlider
	$(function () {
		$('#slider').nivoSlider({
			effect: 'fold',
			slices: 20,
			animSpeed: 600,
			pauseTime: 5000,
			startSlide: 0,
			directionNav: false,
			controlNav: false
		});
	});
	
	
	// placeholder
	$(function () {
		if (!$.support.placeholder) {
			var active = document.activeElement;
			$('input, textarea').focus(function () {
				if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) {
					$(this).val('').removeClass('hasPlaceholder');
				}
			}).blur(function () {
				if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
					$(this).val($(this).attr('placeholder')).addClass('hasPlaceholder');
				}
			});
			$('input, textarea').blur();
			$(active).focus();
			$('form').submit(function () {
				$(this).find('.hasPlaceholder').each(function () {
					$(this).val('');
				});
			});
		}
	});
	
	
	// zWeatherfeed
	$('#weather').weatherfeed(['NLXX0011']);
	
	// googleMaps
	$('#map_canvas').googleMaps({
		latitude: 52.30626,
		longitude: 5.24616,	
		depth: 14,
		markers: {
			latitude: 52.30626,
			longitude: 5.24616,
			icon: {
				image: 'assets/templates/reijnsboten/images/canvas/marker.png',
				shadow: 'assets/templates/reijnsboten/images/canvas/marker-shadow.png',
				iconSize: '38, 38',
				shadowSize: '38, 38'
			}
		}
	});

});
