$(function() {
    var at = / at /;
    var dot = / dot /g;
    $('span.mailme').each( function() {
        var addr = jQuery(this).text().replace(at,"@").replace(dot,".");
        $(this)
            .after('<a href="mailto:'+addr+'"><img src="images/email.png" class="mailme" title="'+ addr +'" alt="'+ addr +'"/></a>')
            .remove();
    });
});

$(document).ready(function()
{
	slide("#sliding-navigation", 25, 15, 150, .8);
});

function slide(navigation_id, pad_out, pad_in, time, multiplier)
{
	// creates the target paths
	var list_elements = navigation_id + " li.sliding-element";
	var link_elements = list_elements + " a";
	
	// initiates the timer used for the sliding animation
	var timer = 0;
	
	// creates the slide animation for all list elements 
	$(list_elements).each(function(i)
	{
		// margin left = - ([width of element] + [total vertical padding of element])
		$(this).css("margin-left","-180px");
		// updates timer
		timer = (timer*multiplier + time);
		$(this).animate({ marginLeft: "0" }, timer);
		$(this).animate({ marginLeft: "15px" }, timer);
		$(this).animate({ marginLeft: "0" }, timer);
	});

	// creates the hover-slide effect for all link elements 		
	$(link_elements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).animate({ paddingLeft: pad_out }, 150);
		},		
		function()
		{
			$(this).animate({ paddingLeft: pad_in }, 150);
		});
	});
}

$(function() {
	$('.overlay').css('opacity',0.8);
	});

$(document).ready(function(){
			$("#contactform").validate();
		  });
		$(function() {
			$(".external").attr("target","_blank");
		});


$(document).ready(function(){

 jQuery.easing.def = 'easeOutBounce';
 
	$('.thumbs').piroBox({
			mySpeed: 1500,
			open_speed : 1500,
			close_speed : 1500,
			bg_alpha: 0.8,
			pathLoader : 'url(css_pirobox/ajax-loader_b.gif) center center no-repeat;', 
			gallery : '.pirobox_in li a', 
			gallery_li : '.pirobox_in li', 
			next_class : '.next_in',
			previous_class : '.previous_in'
	});	
	$('.thumbs').piroBox({
			mySpeed: 1500,
			open_speed : 1500,
			close_speed : 1500,
			bg_alpha: 0.8,
			pathLoader : 'url(css_pirobox/ajax-loader_b.gif) center center no-repeat;', 
			gallery : '.pirobox li a', 
			gallery_li : '.pirobox li',
			single : '.single  a',
			next_class : '.next',
			previous_class : '.previous'
	});	
});





function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		map.setMapType(G_HYBRID_MAP);
		map.disableDragging();
		
		map.addControl(new GSmallMapControl()); //inzoemen en uitzoemen
		
		//map.addControl(new GMapTypeControl()); //kaart, satelliet, beide opties
		
		map.setCenter(new GLatLng(50.81371579973345, 5.735206604003906), 17); //lengte en breedte graad
		map.getCenter();
		//map.openInfoWindow(map.getCenter()); //info ballong
		
		var blueIcon = new GIcon(G_DEFAULT_ICON);
		markerOptions = { icon:blueIcon };
		
		var point = new GLatLng(50.81371579973345, 5.735206604003906);
		map.addOverlay(new GMarker(point, markerOptions));

      }
    }
