////Superfish menu
jQuery(function($){ $("ul.sf-menu").supersubs({minWidth:13, maxWidth:30, extraWidth:0}).superfish({hoverClass:'sfHover', pathClass:'active', pathLevels:0, delay:500, animation:{height:'show'}, speed:'def', autoArrows:1, dropShadows:0}) });

		////Twitter
		$().ready(function() {
			$("#twitter").getTwitter({
				// change here the Twitter username
				userName: "finwizeweb",
				numTweets: 1,
				loaderText: "Loading tweets...",
				slideIn: false,
				showHeading: true,
				headingText: "Laatste Tweets",
				showProfileLink: true
			});
		});

//Googlemaps on hte contactpage
$(window).ready(function () {
						  
	//Mailme - Email Spam Protector
	$(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+'" class="mailme">'+ addr +'</a>')
				.remove();
		});
	});

    if($("#map").length != 0)
	{
	
	$.ajax({
		type: "GET",
		url: "exe/getaddress.php",
		dataType: "html",
		error: function(){
			alert('Map error. Please try again.');
		},
		success: function(data){
			var address = $(data).filter('#address').html();
            var googlelink = $(data).filter('#googlelink').html();
			
			$("#map").gMap({
				markers: [
					{
						address: address,
						popup: false,
						icon:
							{
								image: 'images/map-marker_small.png',
//								iconsize: [190, 153],
//								iconanchor: [70, 153],
								iconsize: [150, 121],
								iconanchor: [70, 121],
								shadow: 'none'
							}
					}
				],
				
				zoom: 14,
				onComplete: function() {
					var data = $('#map').data('gmap');
					google.maps.event.addListener(data.markers[0], 'click', function() {
						window.open( googlelink );
						return false;
					});
				}
			});
		}
	});
	}
});
