albumid = "/albumid/5180967719544535105?kind=photo";  
  
function LoadSlideShow() {
    var feed  = "http://picasaweb.google.com/data/feed/base/user/pmarstall" + albumid + "&alt=rss&hl=en_US";
    var options = {
			fullControlPanel : true, 
			displayTime:5000, 
			transistionTime:600, 
			linkTarget : google.feeds.LINK_TARGET_BLANK,
			scaleImages:true};
    var ss = new GFslideShow(feed, "slideShow", options);
  }

  /**
   * Use google.load() to load the AJAX Feeds API
   * Use google.setOnLoadCallback() to call LoadSlideShow once the page loads
   */
  google.load("feeds", "1");
  google.setOnLoadCallback(LoadSlideShow);


function showAlbum(alID){
	albumid = "/albumid/" + alID + "?kind=photo";
	document.getElementById('maindiv').innerHTML = "<div id='slideShow'><img src='../images/ajax-loader.gif' /></div>";
	LoadSlideShow();
}

function accordion(el) {
    if ($('visible') == el) {
        return;
    }
    if ($('visible')) {
        var eldown = el.parentNode.id+'-body';
        var elup = $('visible').parentNode.id+'-body';
	  new Effect.Highlight(elup);
        new Effect.Parallel(
        [
            new Effect.SlideUp(elup),
            new Effect.SlideDown(eldown)
        ], {
            duration: 1.1
        });
	new Effect.Highlight(eldown, {startcolor:'#ffffff', endcolor:'#ffff99'});
        $('visible').id = '';
    }
    el.id = 'visible';
}

function init() {

    // hide all elements apart from the one with id visible
    var acc = document.getElementById('accordion');
    var apanels = acc.getElementsByTagName('div');
    for (i = 0; i < apanels.length; i++) {
        if (apanels[i].className == 'panel_body') {
            apanels[i].style.display = 'none';
        }
    }
    var avis = document.getElementById('visible').parentNode.id+'-body';
    document.getElementById(avis).style.display = 'block';
}
function addEvent(elm, evType, fn, useCapture) {
    elm["on"+evType]=fn;return;
}

addEvent(window, "load", init);


/** AJAX stuff **/

function processStateChange() {
		if (req.readyState == 4) { // The request is complete
		 	if (req.status == 200) { // The response is good to go
		 		document.getElementById('maindiv').innerHTML = req.responseText;
		 	} else {
		 		alert("Error: " + req.statusText);
		 	}
		 }
	}



	function retrieveURL(url) {
		if (window.XMLHttpRequest) { // FireFox and others
			req = new XMLHttpRequest();
			req.onreadystatechange = processStateChange;
			
			try {
				req.open("GET", url, true);
			} catch (e) {
				alert(e);
			}
			
			req.send(null);
			
		} else if (window.ActiveXObject) { // M$ IE
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = processStateChange;
				req.open("GET", url, true);
				req.send();
			}
		}
	}


	function showDiv(url,locale,source) {
		document.getElementById('maindiv').innerHTML = "<img src='../images/ajax-loader.gif' />";
		retrieveURL(url);
	}
	
	