google.load("maps", "2.x");

var marker,loc,dir,streetView;

google.setOnLoadCallback(function() {
	if (GBrowserIsCompatible()) {
		loc = document.getElementById('map_location').innerHTML;
		dir = document.getElementById('map_directions').innerHTML;
		var map = document.getElementById('map'),
			point = new google.maps.LatLng(50.762167,0.28249);
			streetView = document.getElementById("streetView");

		map.style.height = '506px';
		map.style.overflow = 'hidden';
		map = new google.maps.Map2(map);
		marker = new google.maps.Marker(point);
		map.setCenter(point,16,G_HYBRID_MAP);
		map.setUIToDefault();
		map.addControl(new google.maps.OverviewMapControl());
		map.addOverlay(marker);
		openInfo();
		new google.maps.Event.addListener(marker,"click",openInfo);
		
		streetView.style.height = '350px'
		
		streetView = new GStreetviewPanorama(streetView,{
			latlng : point,
			pov : {
				yaw : 177.51,
				pitch : -18.5
			},
			features : {
				userPhotos : false
			}
		});
		
	}
});
function openInfo() {
	marker.openInfoWindowTabsHtml([
		new GInfoWindowTab('Location',loc),
		new GInfoWindowTab('Directions',dir)										 
	]);	
}
/*
function X() {
	alert(streetView.getPOV().pitch+'|'+streetView.getPOV().yaw+'|'+streetView.getPOV().zoom);
}
function showDP() {
	streetView.panTo({
		yaw : 3.47,
		pitch : 2.49
	});
	setTimeout(function(){
		streetView.panTo({
			zoom : 2
		});
	},2000);
}
*/