$('.location').each(function(){

	var address 	= $(this).attr('data-address');
	var geocoder 	= new google.maps.Geocoder();
	var latlng 		= new google.maps.LatLng(-34.397, 150.644);
	var map;
	
	$('.map',this).each(function(){
		map = new google.maps.Map(this,{
			zoom:13,
			center:latlng,
			disableDefaultUI: true,
			mapTypeId:google.maps.MapTypeId.ROADMAP
	    });
	});

	geocoder.geocode({'address':address},function(results, status)
	{
		if(status == google.maps.GeocoderStatus.OK)
		{
			map.setCenter(results[0].geometry.location);
			var marker = new google.maps.Marker({
				map: map, 
				position: results[0].geometry.location
			});
		} 
		else
		{
			console.log("Geocode was not successful for the following reason: " + status);
		}
	});
	
});

$('.gallery').bxSlider({
	displaySlideQty:5,
	moveSlideQty:5,
	prevText:'&rsaquo;',
	nextText:'&lsaquo;'
}).find('a').click(function(e){
	e.preventDefault();
	$(this).fancybox();
});
