jQuery(document).ready(function($) {
	/* ------------------------------------------------- */
	/* JQUERY CYCLE & scrubber
	/* ------------------------------------------------- */
		$('div.slideshow').cycle();
		$('div.slideshow-home').cycle({before:showCaption});
		function showCaption() {
			$('#footer #caption').html(this.alt.replace('|','<br />'));
		}
	/* ------------------------------------------------- */
	/* Scrollable init
	/* ------------------------------------------------- */
		$('#scrollable').scrollable({size:1,clickable:false,speed:1200,easing:'easeInOutCubic'});
	/* ------------------------------------------------- */
	/* Colorbox
	/* ------------------------------------------------- */
		$('.colorbox').colorbox({current:'beeld {current} van {total}',speed:1200});

	/* ------------------------------------------------- */
	/* VALIDATION FORMS
	/* ------------------------------------------------- */
		if($('#form-plaatsing').size() > 0) {
			$.metadata.setType("attr", "validate");
			$("#form-plaatsing").validate();
		}

		if($('#form-uitzicht').size() > 0) {
			$.metadata.setType("attr", "validate");
			$("#form-uitzicht").validate();
		}

		if($('#form-contactgegevens').size() > 0) {
			$("#form-contactgegevens").validate();
		}

		if($('#contact-form').size() > 0) {
			$("#contact-form").validate();
		}
		
	/* ------------------------------------------------- */
	/* CHECKBOX REPLACEMENT
	/* ------------------------------------------------- */
		$('input').checkBox();

	/* ------------------------------------------------- */
	/* GMAP DUUDES
	/* ------------------------------------------------- */
		if($('#map').length) initialize()
	
});

function initialize() {
  var myLatlng = new google.maps.LatLng(50.834192, 3.221177);
  var myOptions = {
    zoom: 17,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.SATELLITE
  }
  var map = new google.maps.Map(document.getElementById("map"), myOptions);
 
  var marker = new google.maps.Marker({
      position: myLatlng, 
      map: map,
      title:"Trappen Demunster"
  });   
}

