//ajax history (back forward) button processing
var changeAnchor = function(anchor){window.location.hash = anchor;}

var recentHash = "";
function pageSwitch(){
	var pageAnchor = window.location.hash.toString();
	alert("pageSwitch");
     // URL has changed, update the UI accordingly.
	switch (pageAnchor)	{
		case '#windsurf':keyMap("s");break;
		case '#surf':keyMap("s");break;
		case '#country':keyMap("c");break;
		case '#kite':keyMap("b");break;
		case '#photo':keyMap("f");break;
		case '#project':keyMap("p");break;
		case '#news':keyMap("n");break;
		//default:alert(pageAnchor+"::opening home");
	}
}
/*
var album = { 
  startup: function() { 
    new PeriodicalExecuter(album.cycle, 5) // change image every 5 seconds 
  }, 
  cycle: function() { 
    new Effect.Fade('image', { // the id of the <DIV> containing the photos 
      duration: 1, 
      fps: 50, 
      afterFinish: function() { 
        new Ajax.Updater('image','gfx/Bg', { // URL for next <IMG> tag 
          asynchronous: true, 
          onSuccess: function() { 
            new Effect.Appear('swapphoto', {
              duration: 1,
              fps: 50,
              queue:'end'
            })
          } 
        }) 
      } 
    }) 
  } 
} 

//Google Playground
var feedUrl = "http://www.google.com/calendar/feeds/oceatoon@gmail.com/public/full";

function setupMyService() {
  var myService = new google.gdata.calendar.CalendarService('exampleCo-exampleApp-1');
  return myService;
}

function getMyFeed() {
  myService = setupMyService();

  myService.getEventsFeed(feedUrl, handleMyFeed, handleError);
}
function handleMyFeed(myResultsFeedRoot) {
  alert("This feed's title is: " + myResultsFeedRoot.feed.getTitle().getText());
}

function handleError(e) {
  alert("There was an error!");
  alert(e.cause ? e.cause.statusText : e.message);
}*/