// Week in photos Javascript SSP Callbacks
// See also the "actions" layer in the SSP component for corresponding event listeners

window.name = "weekinphotos";

function flashPutHref(href) { location.href = href; } 
function flashPutTitle(title) { document.title = title; } 


// add multiple events after page loads (by Simon Willison)
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function sspToggleDisplayMode() {
	thisMovie("ssp").sspToggleDisplayMode();
}
		
/*
	Passes the ID of the album from the XML file
	we want SlideShowPro inside the SWF to load
*/
function sspLoadAlbum(album) {
	thisMovie("ssp").sspLoadAlbum(album);
}

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
	} else {
		return document[movieName]
	}
}
