// JavaScript Document

Cufon.replace("h2", { fontFamily: 'Grandesign' });
Cufon.replace("h1", { fontFamily: 'Grandesign' });
Cufon.replace("h3", { fontFamily: 'Grandesign' })

window.addEvent("domready",function(){	
	// prevent ugly border on click of -ive text indent links
	$$("a").each(function(elm){
		elm.addEvent("click",function(linkElm){
			this.blur();
		});
	});
	
	var map = $("map");
	if( map ){
		var geocoder = new google.maps.Geocoder();
		if (geocoder) {
			geocoder.geocode( { 'address': "8 Bridgeland Street, Bideford, Devon, EX39 2PZ"}, function(results, status) {
				if (status == google.maps.GeocoderStatus.OK) {
					var myOptions = {
					  zoom: 16,
					  center: results[0].geometry.location,
					  mapTypeId: google.maps.MapTypeId.ROADMAP
					}
					gmap = new google.maps.Map(map, myOptions);
					var marker = new google.maps.Marker({
						map: gmap, 
						position: results[0].geometry.location,
						icon: "/style/images/map_marker.png",
						title: "Barr Financial Services"
					});
				}
				else {
					alert("Geocode was not successful for the following reason: " + status);
				}
			});
		}
	}
});