		$(window).load(function () {
			$("#titlePic").fadeIn(1000);
			pinballEffect();
			externalLinks();
		});

		$(document).ready(function() {
	
			$("#titlePic").hide();

			// Fading effects
			$(".info").fadeTo("fast", 0.1).fadeTo("slow", 1);
			$(".error").fadeTo("fast", 0.1).fadeTo("slow", 1);
			$(".ok").fadeTo("fast", 0.1).fadeTo("slow", 1);

				// Autocomplete
				function formatItem(row) {
					return "<a href=\""+row[1]+"\" onclick=\"location.href='"+row[1]+"';\">"+row[0]+"</a>";
				}
			
				
				$("#search").autocomplete("ajax.php", {
					minChars: 2,
					width: 310,
					selectFirst: false,
					formatItem: formatItem
			
				}).result(function(row) {
					return false;
				});


			
			});

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(54.59321, -5.92829), 14); // belfast close-up (lat, lng, mag)

	// Create our "tiny" marker icon
	var icon = new GIcon();
	icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
	icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
	icon.iconSize = new GSize(12, 20);
	icon.shadowSize = new GSize(22, 20);
	icon.iconAnchor = new GPoint(6, 20);
	icon.infoWindowAnchor = new GPoint(5, 1);
	
	
	var bounds = map.getBounds();
	var southWest = bounds.getSouthWest();
	var northEast = bounds.getNorthEast();
	var lngSpan = northEast.lng() - southWest.lng();
	var latSpan = northEast.lat() - southWest.lat();
	var point = new GLatLng(54.59321, -5.92829);
	map.addOverlay(new GMarker(point, icon));

      }
    }