		var myView;
		
		var currentZoom = $random(0,0);
		var theLongWait;
		
		var pov = [
			{
				GLatLng:new GLatLng(40.748818,-73.985466),
				Yaw:{
					start:208.5,
					current:208.5,
					end:320,
					acc:0.05
				},
				Pitch:{
					start:-80,
					current:-80,
					end:-88,
					acc:0
					
				},
				currentZoom:0
			},
			{
				GLatLng:new GLatLng(40.748116,-73.985864),
				Yaw:{
					start:30,
					current:30,
					end:30,
					acc:0.05
				},
				Pitch:{
					start:-70,
					current:-70,
					end:-70,
					acc:0
				},
				currentZoom:0
			},
			{
				GLatLng:new GLatLng(40.74811,-73.984789),
				Yaw:{
					start:300,
					current:300,
					end:300,
					acc:0.05
				},
				Pitch:{
					start:-70,
					current:-70,
					end:-80,
					acc:0
				},
				currentZoom:0
			}
		];
		
		var currentPovIndex = $random(0,(pov.length-1));
		var currentZoomDirection = 1;
		
		function waitForSunset() {
		  		  
			if (pov[currentPovIndex].Pitch.current>=pov[currentPovIndex].Pitch.end) pov[currentPovIndex].Pitch.current += pov[currentPovIndex].Pitch.acc;
			
			if ((pov[currentPovIndex].Yaw.acc>0)&&(pov[currentPovIndex].Yaw.current>=pov[currentPovIndex].Yaw.start+70)) {
				pov[currentPovIndex].Yaw.acc = pov[currentPovIndex].Yaw.acc*(-1)						
			}else if ((pov[currentPovIndex].Yaw.acc<0)&&(pov[currentPovIndex].Yaw.current<=pov[currentPovIndex].Yaw.start-70)) {
				pov[currentPovIndex].Yaw.acc = pov[currentPovIndex].Yaw.acc*(-1)						
			}
			
			pov[currentPovIndex].Yaw.current += (pov[currentPovIndex].Yaw.acc/(pov[currentPovIndex].currentZoom+1));


			myView.panTo({yaw:pov[currentPovIndex].Yaw.current, pitch:pov[currentPovIndex].Pitch.current, zoom:pov[currentPovIndex].currentZoom});
			
		}
		function changeZoom() {
			$clear(theLongWait);
			
			if (pov[currentPovIndex].currentZoom==0) currentZoomDirection =1;
			else if (pov[currentPovIndex].currentZoom==2) currentZoomDirection =-1;
			pov[currentPovIndex].currentZoom+=currentZoomDirection;				
			myView.setLocationAndPOV(pov[currentPovIndex].GLatLng, {yaw: pov[currentPovIndex].Yaw.current, pitch: pov[currentPovIndex].Pitch.current, zoom: pov[currentPovIndex].currentZoom});
			theLongWait = window.setInterval(waitForSunset, 25);		
		
		}
		function changeZoom() {
			$clear(theLongWait);
			
			if (pov[currentPovIndex].currentZoom==0) currentZoomDirection =1;
			else if (pov[currentPovIndex].currentZoom==2) currentZoomDirection =-1;
			pov[currentPovIndex].currentZoom+=currentZoomDirection;				
			
			(function() {
				theLongWait = window.setInterval(waitForSunset, 25);		
			}).delay(600);
		}
		
		function getPov() {
		
		
		}
		
		window.addEvent('domready',function() {
			
			if($('empire')) $('empire').set('html','');
			
		});
		window.addEvent('resize',function() { 
			if (myView) myView.checkResize();
		});
		window.addEvent('load',function() {
			if ($('empire')) {
				
				myView = new GStreetviewPanorama($("empire"));
				myView.setLocationAndPOV(pov[currentPovIndex].GLatLng, {yaw: pov[currentPovIndex].Yaw.start, pitch: pov[currentPovIndex].Pitch.current, zoom: pov[currentPovIndex].currentZoom});
				(function() {
					theLongWait = window.setInterval(waitForSunset, 25);
					thePersistenceOfTheZoom = window.setInterval(changeZoom, 10000);
				}).delay(750);
			}
		})
