				
function load () {
	
	var map = document.getElementById("map");
	
	/*
	switch (screen.height) {
	case 1024:
		map.style.height = 620;
		zoomLevel=13;
		break;
	case 768:
		map.style.height = 365;
		zoomLevel=13;
		break;
	case 600:
		map.style.height = 225;
		zoomLevel=13;
		break;
	default:
		map.style.height = 365;
		zoomLevel=13;
		break;
	}
*/
	
		var zoomLevel=15;
		
		
	
	if (GBrowserIsCompatible()) {

		var gmap = new GMap2(map);
		gmap.addControl( new GSmallMapControl() );
		gmap.addControl( new GMapTypeControl()) ;
		gmap.addControl( new GOverviewMapControl(new GSize(100,100)) );		
		gmap.setCenter ( new GLatLng(52.37441, -1.25648), zoomLevel);
		
		
		/*
		
		// Create our "tiny" marker icon
		var icon = new GIcon();
		icon.image = "potz_small.gif";
		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);
		
		*/
		
		
		function bubbleHTML() {				
			var map = document.getElementById("map");
			html 	 = "<div>";
			//html 	 = "";
			//if (screen.height>600) {
			//	html 		+= "<h1>Potz Ceramic Studio</h1>";
			//}
			//else {
				html 		+= '<p class="bubbleHeading">The Wobbly Plate</p>';			
			//}
			
			html 		+= "<p class=\"bubblePara\">90 Railway Terrace"			
			
			//if (screen.height>600) {
			html 		+= "<br />";			
			//}
			//else {
			//html 		+= ", ";
			//}
			

			html 		+= "Rugby<br />";
			html 		+= "Warwickshire";
			
			//if (screen.height>600) {
			html 		+= "<br />";			
			//}
			//else {
			//html 		+= ". ";
			//}
			
			html 		+= "CV21 3EZ<br />";
			html 		+= "Tel. 01788 576136</p>";
			html		+= "</div>";					
			return html;			
		}			
		
		function createMarker() {	
			//var marker = new GMarker(new GLatLng(52.2445, -0.8081),icon);		
			var marker = new GMarker(new GLatLng(52.37441, -1.25648));				
			GEvent.addListener(marker, "click", function() {
				marker.openInfoWindowHtml(bubbleHTML());
			});	
			return marker;
		}
		
		var marker = createMarker();
		gmap.addOverlay(marker);
		marker.openInfoWindowHtml(bubbleHTML()); 		
			
	} else {
		alert("Sorry, your browser cannot handle Google Maps");
	}
}
window.onload = load;
window.onunload = GUnload;





